diff --git a/packages/ui/src/Atoms/Select/Select.tsx b/packages/ui/src/Atoms/Select/Select.tsx
index f71095cfe..deab06b88 100644
--- a/packages/ui/src/Atoms/Select/Select.tsx
+++ b/packages/ui/src/Atoms/Select/Select.tsx
@@ -15,16 +15,17 @@ import { IconChevronGrabberVertical } from "../Icons/IconChevronGrabberVertical.
import { tv } from "tailwind-variants";
import { Children, type ComponentProps, type PropsWithChildren } from "react";
-type Props = PropsWithChildren<
+type Props = PropsWithChildren<
{
id?: string;
placeholder?: string;
- onValueChange?: (s: string) => void;
+ onValueChange?: (s: NonNullable) => void;
variant?: "default" | "editor" | "dashed";
invalid?: boolean;
disabled?: boolean;
className?: string;
- } & Omit, "onChange">
+ value?: T;
+ } & Omit, "onChange" | "value">
>;
const select = tv({
@@ -70,19 +71,19 @@ const select = tv({
},
});
-export function Select({
+export function Select({
placeholder,
children,
onValueChange,
value,
...props
-}: Props) {
+}: Props) {
const { trigger, content, icon } = select({
...props,
});
return (
-
+
) {
-
diff --git a/packages/ui/src/Atoms/Table/Table.tsx b/packages/ui/src/Atoms/Table/Table.tsx
index 8a30aa6aa..612dc1d9c 100644
--- a/packages/ui/src/Atoms/Table/Table.tsx
+++ b/packages/ui/src/Atoms/Table/Table.tsx
@@ -1,4 +1,9 @@
-import { createContext, useContext, type PropsWithChildren } from "react";
+import {
+ createContext,
+ useContext,
+ type HTMLAttributes,
+ type PropsWithChildren,
+} from "react";
import { Card } from "../Card/Card";
import { Link } from "react-router";
import clsx from "clsx";
@@ -25,9 +30,13 @@ export function Thead({ children }: PropsWithChildren) {
export function Th({
children,
className,
-}: PropsWithChildren<{ className?: string }>) {
+ width,
+}: PropsWithChildren<{ className?: string; width?: number }>) {
return (
-
|
+ |
{children}
|
);
@@ -35,17 +44,21 @@ export function Th({
const TrContext = createContext({} as { to?: string });
-export function Tr({ children, to }: PropsWithChildren<{ to?: string }>) {
+export function Tr({
+ to,
+ className,
+ ...props
+}: { to?: string } & HTMLAttributes) {
return (
- {children}
-
+ />
);
}
@@ -63,15 +76,17 @@ export function Td({
noLink,
className,
width,
-}: PropsWithChildren<{
+ ...props
+}: {
noLink?: boolean;
- className?: string;
width?: number;
-}>) {
+ colSpan?: number;
+} & HTMLAttributes) {
const { to } = useContext(TrContext);
if (!to || noLink) {
return (
@@ -81,6 +96,7 @@ export function Td({
}
return (
|
{objectKeys(icons).map((k) => {
diff --git a/packages/ui/src/Molecules/Select/ImpactOptions.stories.tsx b/packages/ui/src/Molecules/Select/ImpactOptions.stories.tsx
new file mode 100644
index 000000000..d745b2fb0
--- /dev/null
+++ b/packages/ui/src/Molecules/Select/ImpactOptions.stories.tsx
@@ -0,0 +1,21 @@
+import { ImpactOptions } from "./ImpactOptions.tsx";
+import type { Meta, StoryObj } from "@storybook/react";
+import { Select } from "../../Atoms/Select/Select.tsx";
+
+export default {
+ title: "Molecules/Select/ImpactSelect",
+ component: ImpactOptions,
+ argTypes: {},
+} satisfies Meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {
+ render() {
+ return (
+
+ );
+ },
+};
diff --git a/packages/ui/src/Molecules/Select/ImpactOptions.tsx b/packages/ui/src/Molecules/Select/ImpactOptions.tsx
new file mode 100644
index 000000000..9810565ba
--- /dev/null
+++ b/packages/ui/src/Molecules/Select/ImpactOptions.tsx
@@ -0,0 +1,47 @@
+import { Option } from "../../Atoms/Select/Select";
+import { useTranslate } from "@probo/i18n";
+
+export function ImpactOptions() {
+ const { __ } = useTranslate();
+
+ const descriptions = {
+ LOW: {
+ label: __("Low"),
+ description: __("Minimal impact on business"),
+ },
+ MEDIUM: {
+ label: __("Medium"),
+ description: __("Moderate impact on business"),
+ },
+ HIGH: {
+ label: __("High"),
+ description: __("Significant business impact"),
+ },
+ CRITICAL: {
+ label: __("Critical"),
+ description: __("Critical to business operations"),
+ },
+ } as const;
+
+ return (
+ <>
+ {Object.entries(descriptions).map(([key, description]) => (
+
+ ))}
+ >
+ );
+}
diff --git a/packages/ui/src/Molecules/Select/SentitivityOptions.stories.tsx b/packages/ui/src/Molecules/Select/SentitivityOptions.stories.tsx
new file mode 100644
index 000000000..c3a5432f2
--- /dev/null
+++ b/packages/ui/src/Molecules/Select/SentitivityOptions.stories.tsx
@@ -0,0 +1,21 @@
+import { SentitivityOptions } from "./SentitivityOptions.tsx";
+import type { Meta, StoryObj } from "@storybook/react";
+import { Select } from "../../Atoms/Select/Select.tsx";
+
+export default {
+ title: "Molecules/Select/SentitivitySelect",
+ component: SentitivityOptions,
+ argTypes: {},
+} satisfies Meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {
+ render() {
+ return (
+
+ );
+ },
+};
diff --git a/packages/ui/src/Molecules/Select/SentitivityOptions.tsx b/packages/ui/src/Molecules/Select/SentitivityOptions.tsx
new file mode 100644
index 000000000..f90a8a90e
--- /dev/null
+++ b/packages/ui/src/Molecules/Select/SentitivityOptions.tsx
@@ -0,0 +1,51 @@
+import { Option } from "../../Atoms/Select/Select";
+import { useTranslate } from "@probo/i18n";
+
+export function SentitivityOptions() {
+ const { __ } = useTranslate();
+
+ const descriptions = {
+ NONE: {
+ label: __("None"),
+ description: __("No sensitive data"),
+ },
+ LOW: {
+ label: __("Low"),
+ description: __("Public or non-sensitive data"),
+ },
+ MEDIUM: {
+ label: __("Medium"),
+ description: __("Internal/restricted data"),
+ },
+ HIGH: {
+ label: __("High"),
+ description: __("Confidential data"),
+ },
+ CRITICAL: {
+ label: __("Critical"),
+ description: __("Regulated/PII/financial data"),
+ },
+ } as const;
+
+ return (
+ <>
+ {Object.entries(descriptions).map(([key, description]) => (
+
+ ))}
+ >
+ );
+}
diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts
index c94243139..17ecb226e 100644
--- a/packages/ui/src/index.ts
+++ b/packages/ui/src/index.ts
@@ -62,6 +62,8 @@ export { MeasureBadge } from "./Molecules/Badge/MeasureBadge";
export { MeasureImplementation } from "./Molecules/MeasureImplementation/MeasureImplementation";
export { FrameworkSelector } from "./Molecules/FrameworkSelector/FrameworkSelector";
export { DocumentTypeBadge } from "./Molecules/Badge/DocumentTypeBadge";
+export { SentitivityOptions } from "./Molecules/Select/SentitivityOptions";
+export { ImpactOptions } from "./Molecules/Select/ImpactOptions";
// Hooks
export { useToast, Toasts } from "./Atoms/Toasts/Toasts";
|