@oneplatformdev/ui 0.1.99-beta.36 → 0.1.99-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/Wrappers.js.map +1 -1
- package/Accordion/Accordion.d.ts +1 -1
- package/Accordion/Accordion.d.ts.map +1 -1
- package/Accordion/Accordion.js +48 -26
- package/Accordion/Accordion.js.map +1 -1
- package/Alert/Alert.js.map +1 -1
- package/Alert/alertVariants.js.map +1 -1
- package/AlertDialog/AlertDialog.js.map +1 -1
- package/AlertDialog/AlertDialog.stories.js +3 -2
- package/AlertDialog/AlertDialog.stories.js.map +1 -1
- package/AlertDialog/AlertDialogRoot.js +19 -18
- package/AlertDialog/AlertDialogRoot.js.map +1 -1
- package/AreaChart/AreaChart.js.map +1 -1
- package/Aside/Aside.js.map +1 -1
- package/Aside/AsideSidebar.js.map +1 -1
- package/AspectRatio/AspectRatio.js.map +1 -1
- package/Avatar/Avatar.js.map +1 -1
- package/Badge/Badge.js.map +1 -1
- package/Badge/badgeVariants.js.map +1 -1
- package/Breadcrumb/Breadcrumb.js.map +1 -1
- package/Button/Button.js +2 -1
- package/Button/Button.js.map +1 -1
- package/Button/Button.stories.js.map +1 -1
- package/Button/ButtonCounterBadge.js.map +1 -1
- package/Button/buttonVariants.js +1 -1
- package/Button/buttonVariants.js.map +1 -1
- package/ButtonIcon/ButtonIcon.js +19 -18
- package/ButtonIcon/ButtonIcon.js.map +1 -1
- package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
- package/ButtonIcon/buttonIconVariants.js +1 -1
- package/ButtonIcon/buttonIconVariants.js.map +1 -1
- package/CHANGELOG.md +1997 -1874
- package/Calendar/Calendar.js +1 -0
- package/Calendar/Calendar.js.map +1 -1
- package/Card/Card.js.map +1 -1
- package/Carousel/Carousel.js +7 -6
- package/Carousel/Carousel.js.map +1 -1
- package/Chart/Chart.js.map +1 -1
- package/Checkbox/Checkbox.js +18 -17
- package/Checkbox/Checkbox.js.map +1 -1
- package/Collapsible/Collapsible.js.map +1 -1
- package/Combobox/Combobox.js +32 -30
- package/Combobox/Combobox.js.map +1 -1
- package/Combobox/Combobox.stories.js.map +1 -1
- package/Combobox/ComboboxOptionItem.js +4 -4
- package/Combobox/ComboboxOptionItem.js.map +1 -1
- package/Combobox/ComboboxOptions.js +9 -8
- package/Combobox/ComboboxOptions.js.map +1 -1
- package/Command/Command.js +26 -25
- package/Command/Command.js.map +1 -1
- package/DataTable/DataTable.js +13 -12
- package/DataTable/DataTable.js.map +1 -1
- package/DataTable/DataTableColumnFilter.js +7 -6
- package/DataTable/DataTableColumnFilter.js.map +1 -1
- package/DataTable/useDataTable.d.ts +1 -1
- package/DataTable/useDataTable.js.map +1 -1
- package/DatePicker/DatePicker.js +13 -12
- package/DatePicker/DatePicker.js.map +1 -1
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/DialogOverlayScope.js.map +1 -1
- package/Drawer/Drawer.js.map +1 -1
- package/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/DropdownMenu/DropdownMenu.js +33 -20
- package/DropdownMenu/DropdownMenu.js.map +1 -1
- package/Dropzone/Dropzone.js.map +1 -1
- package/Dropzone/Dropzone.types.js.map +1 -1
- package/Dropzone/DropzoneFilePreview.js.map +1 -1
- package/Dropzone/DropzoneSinglePickPreview.js.map +1 -1
- package/Dropzone/DropzoneUtils.js.map +1 -1
- package/Form/Form.js +15 -14
- package/Form/Form.js.map +1 -1
- package/Form/FormRenderControl.js.map +1 -1
- package/Form/FormTooltipButton.js +8 -7
- package/Form/FormTooltipButton.js.map +1 -1
- package/Form/Form_old.js +5 -4
- package/Form/Form_old.js.map +1 -1
- package/FormCheckbox/FormCheckbox.js +4 -4
- package/FormCheckbox/FormCheckbox.js.map +1 -1
- package/FormCombobox/FormCombobox.js +4 -4
- package/FormCombobox/FormCombobox.js.map +1 -1
- package/FormDatePicker/FormDatePicker.js +4 -4
- package/FormDatePicker/FormDatePicker.js.map +1 -1
- package/FormDropzone/FormDropzone.js +3 -3
- package/FormDropzone/FormDropzone.js.map +1 -1
- package/FormInput/FormInput.js +6 -6
- package/FormInput/FormInput.js.map +1 -1
- package/FormRadio/FormRadio.js.map +1 -1
- package/FormSelect/FormSelect.js +25 -22
- package/FormSelect/FormSelect.js.map +1 -1
- package/FormTextarea/FormTextarea.js +4 -4
- package/FormTextarea/FormTextarea.js.map +1 -1
- package/Header/Header.js.map +1 -1
- package/HoverCard/HoverCard.js.map +1 -1
- package/Input/Input.js.map +1 -1
- package/Input/inputVariants.js.map +1 -1
- package/InputOTP/InputOTP.d.ts.map +1 -1
- package/InputOTP/InputOTP.js.map +1 -1
- package/LICENSE +21 -21
- package/Label/Label.js.map +1 -1
- package/Label/labelVariants.js.map +1 -1
- package/LazyLoader/LazyLoader.js +5 -4
- package/LazyLoader/LazyLoader.js.map +1 -1
- package/LoadedIcon/LoadedIcon.js.map +1 -1
- package/LoadingMask/LoadingMask.js.map +1 -1
- package/LoadingMask/RenderLoadingMask.js.map +1 -1
- package/LoadingProgress/LoadingProgress.js.map +1 -1
- package/LoadingProgress/loadingProgressVariants.js.map +1 -1
- package/Menubar/Menubar.js.map +1 -1
- package/NavigationMenu/NavigationMenu.js.map +1 -1
- package/NavigationMenu/navigationMenuVariants.js.map +1 -1
- package/Pagination/Pagination.js +1 -0
- package/Pagination/Pagination.js.map +1 -1
- package/Popover/Popover.js.map +1 -1
- package/Progress/Progress.js.map +1 -1
- package/README.md +7 -7
- package/Radio/Radio.js.map +1 -1
- package/RadioGroup/RadioGroup.js.map +1 -1
- package/Resizable/Resizable.js.map +1 -1
- package/Resizable/Resizable.stories.js.map +1 -1
- package/ScrollArea/ScrollArea.js.map +1 -1
- package/Search/Search.js +8 -8
- package/Search/Search.js.map +1 -1
- package/Search/Search.stories.js.map +1 -1
- package/Select/Select.js +7 -6
- package/Select/Select.js.map +1 -1
- package/Select/Select.stories.js.map +1 -1
- package/Select/SelectRoot.js.map +1 -1
- package/Separator/Separator.js.map +1 -1
- package/Sheet/Sheet.js.map +1 -1
- package/Sidebar/Sidebar.js +21 -20
- package/Sidebar/Sidebar.js.map +1 -1
- package/Skeleton/Skeleton.js.map +1 -1
- package/Slider/Slider.js.map +1 -1
- package/Sonner/Sonner.js.map +1 -1
- package/Switch/Switch.js.map +1 -1
- package/Table/Table.js.map +1 -1
- package/TablePagination/TablePagination.js +21 -17
- package/TablePagination/TablePagination.js.map +1 -1
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/TabsRoot.js.map +1 -1
- package/Textarea/Textarea.d.ts.map +1 -1
- package/Textarea/Textarea.js +48 -43
- package/Textarea/Textarea.js.map +1 -1
- package/Textarea/Textarea.stories.js.map +1 -1
- package/Textarea/Textarea.types.d.ts +3 -1
- package/Textarea/Textarea.types.d.ts.map +1 -1
- package/Textarea/useAutosizeTextArea.js.map +1 -1
- package/Theme/ThemeModeToggle.js +4 -3
- package/Theme/ThemeModeToggle.js.map +1 -1
- package/Theme/ThemeProvider.js.map +1 -1
- package/Toast/Toast.js.map +1 -1
- package/Toast/toast.constants.js.map +1 -1
- package/Toast/toastVariants.js.map +1 -1
- package/Toast/useToast.js.map +1 -1
- package/Toaster/Toaster.js.map +1 -1
- package/Toggle/Toggle.js.map +1 -1
- package/ToggleGroup/ToggleGroup.js.map +1 -1
- package/Tooltip/Tooltip.js.map +1 -1
- package/Tooltip/TooltipRoot.js.map +1 -1
- package/index.js +278 -278
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wrappers.js","sources":["../../.storybook/Wrappers.tsx"],"sourcesContent":["import { PropsWithChildren } from \"react\";\
|
|
1
|
+
{"version":3,"file":"Wrappers.js","sources":["../../.storybook/Wrappers.tsx"],"sourcesContent":["import { PropsWithChildren } from \"react\";\n\nexport const MoreWrapper = (props: PropsWithChildren) => (\n <div\n style={{\n position: 'relative',\n padding: '24px 32px',\n display: 'flex',\n gap: '32px',\n }}\n >\n {props.children}\n </div>\n)\n\nexport const DashedWrapper = (props: PropsWithChildren) => {\n return (\n <div\n style={{\n padding: '0px 20px',\n display: 'flex',\n gap: '32px',\n alignItems: 'flex-start',\n }}\n >\n <div\n style={{\n position: 'relative',\n border: '2px dashed rgba(139, 92, 246, 0.7)',\n borderRadius: '24px',\n padding: '24px 32px',\n display: 'flex',\n gap: '32px',\n }}\n >\n {props.children}\n </div>\n </div>\n )\n}\n"],"names":["DashedWrapper","props","jsx"],"mappings":";AAeO,MAAMA,IAAgB,CAACC,MAE1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS;AAAA,MACT,KAAK;AAAA,MACL,YAAY;AAAA,IAAA;AAAA,IAGd,UAAA,gBAAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,SAAS;AAAA,UACT,SAAS;AAAA,UACT,KAAK;AAAA,QAAA;AAAA,QAGN,UAAAD,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EACT;AAAA;"}
|
package/Accordion/Accordion.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
-
declare function Accordion(
|
|
3
|
+
declare function Accordion(props: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function AccordionTrigger({ className, children, showChevron, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger> & {
|
|
6
6
|
showChevron?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../src/Accordion/Accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAK/D,iBAAS,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../src/Accordion/Accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAK/D,iBAAS,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,2CAe7E;AAED,iBAAS,aAAa,CAAC,EACE,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,2CAY7E;AAED,iBAAS,gBAAgB,CAAC,EACE,SAAS,EACT,QAAQ,EACR,WAAkB,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,GAAG;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,2CAsB/G;AAED,iBAAS,gBAAgB,CAAC,EACE,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,2CAUnF;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA"}
|
package/Accordion/Accordion.js
CHANGED
|
@@ -1,50 +1,72 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "@radix-ui/react-accordion";
|
|
3
|
-
import {
|
|
3
|
+
import { ChevronRightIcon as s } from "lucide-react";
|
|
4
4
|
import { cn as i } from "@oneplatformdev/utils";
|
|
5
|
-
function u({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
function u(o) {
|
|
6
|
+
const {
|
|
7
|
+
className: t,
|
|
8
|
+
...r
|
|
9
|
+
} = o;
|
|
10
|
+
return /* @__PURE__ */ e(
|
|
11
|
+
n.Root,
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "accordion",
|
|
14
|
+
className: i(
|
|
15
|
+
"group group/accordion",
|
|
16
|
+
t
|
|
17
|
+
),
|
|
18
|
+
...r
|
|
19
|
+
}
|
|
20
|
+
);
|
|
9
21
|
}
|
|
10
|
-
function
|
|
11
|
-
className:
|
|
12
|
-
...
|
|
22
|
+
function p({
|
|
23
|
+
className: o,
|
|
24
|
+
...t
|
|
13
25
|
}) {
|
|
14
26
|
return /* @__PURE__ */ e(
|
|
15
27
|
n.Item,
|
|
16
28
|
{
|
|
17
29
|
"data-slot": "accordion-item",
|
|
18
|
-
className: i(
|
|
19
|
-
|
|
30
|
+
className: i(
|
|
31
|
+
"group group/accordion-item",
|
|
32
|
+
"border-b last:border-b-0",
|
|
33
|
+
o
|
|
34
|
+
),
|
|
35
|
+
...t
|
|
20
36
|
}
|
|
21
37
|
);
|
|
22
38
|
}
|
|
23
|
-
function
|
|
24
|
-
className:
|
|
25
|
-
children:
|
|
39
|
+
function g({
|
|
40
|
+
className: o,
|
|
41
|
+
children: t,
|
|
26
42
|
showChevron: r = !0,
|
|
27
43
|
...a
|
|
28
44
|
}) {
|
|
29
|
-
return /* @__PURE__ */ e(n.Header, { className: "flex", children: /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ e(n.Header, { className: "flex", children: /* @__PURE__ */ c(
|
|
30
46
|
n.Trigger,
|
|
31
47
|
{
|
|
32
48
|
"data-slot": "accordion-trigger",
|
|
33
49
|
className: i(
|
|
34
|
-
"
|
|
35
|
-
|
|
50
|
+
"group group/accordion-trigger",
|
|
51
|
+
"flex flex-1 items-start justify-between gap-4 rounded-md py-4",
|
|
52
|
+
"text-left text-sm font-medium",
|
|
53
|
+
"transition-all outline-none",
|
|
54
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
55
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
56
|
+
"[&[data-state=open]>svg]:rotate-90",
|
|
57
|
+
o
|
|
36
58
|
),
|
|
37
59
|
...a,
|
|
38
60
|
children: [
|
|
39
|
-
|
|
40
|
-
|
|
61
|
+
r && /* @__PURE__ */ e(s, { "data-slot": "accordion-chevrone", className: "text-[#06080D] pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" }),
|
|
62
|
+
t
|
|
41
63
|
]
|
|
42
64
|
}
|
|
43
65
|
) });
|
|
44
66
|
}
|
|
45
|
-
function
|
|
46
|
-
className:
|
|
47
|
-
children:
|
|
67
|
+
function f({
|
|
68
|
+
className: o,
|
|
69
|
+
children: t,
|
|
48
70
|
...r
|
|
49
71
|
}) {
|
|
50
72
|
return /* @__PURE__ */ e(
|
|
@@ -53,14 +75,14 @@ function g({
|
|
|
53
75
|
"data-slot": "accordion-content",
|
|
54
76
|
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
55
77
|
...r,
|
|
56
|
-
children: /* @__PURE__ */ e("div", { className: i("pt-0 pb-4",
|
|
78
|
+
children: /* @__PURE__ */ e("div", { className: i("group group/accordion-content", "pt-0 pb-4", o), children: t })
|
|
57
79
|
}
|
|
58
80
|
);
|
|
59
81
|
}
|
|
60
82
|
export {
|
|
61
83
|
u as Accordion,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
84
|
+
f as AccordionContent,
|
|
85
|
+
p as AccordionItem,
|
|
86
|
+
g as AccordionTrigger
|
|
65
87
|
};
|
|
66
88
|
//# sourceMappingURL=Accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../../src/Accordion/Accordion.tsx"],"sourcesContent":["\"use client\"\
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":["../../src/Accordion/Accordion.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { ChevronRightIcon } from \"lucide-react\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nfunction Accordion(props: React.ComponentProps<typeof AccordionPrimitive.Root>) {\n const {\n className,\n ...rest\n } = props;\n return (\n <AccordionPrimitive.Root\n data-slot=\"accordion\"\n className={cn(\n 'group group/accordion',\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction AccordionItem({\n className,\n ...props\n }: React.ComponentProps<typeof AccordionPrimitive.Item>) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn(\n 'group group/accordion-item',\n \"border-b last:border-b-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AccordionTrigger({\n className,\n children,\n showChevron = true,\n ...props\n }: React.ComponentProps<typeof AccordionPrimitive.Trigger> & { showChevron?: boolean }) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\n 'group group/accordion-trigger',\n 'flex flex-1 items-start justify-between gap-4 rounded-md py-4',\n 'text-left text-sm font-medium',\n 'transition-all outline-none',\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&[data-state=open]>svg]:rotate-90',\n className\n )}\n {...props}\n >\n {showChevron && <ChevronRightIcon data-slot=\"accordion-chevrone\" className=\"text-[#06080D] pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200\" />}\n {children}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n )\n}\n\nfunction AccordionContent({\n className,\n children,\n ...props\n }: React.ComponentProps<typeof AccordionPrimitive.Content>) {\n return (\n <AccordionPrimitive.Content\n data-slot=\"accordion-content\"\n className=\"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm\"\n {...props}\n >\n <div className={cn('group group/accordion-content', \"pt-0 pb-4\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n )\n}\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent }\n"],"names":["Accordion","props","className","rest","jsx","AccordionPrimitive","cn","AccordionItem","AccordionTrigger","children","showChevron","jsxs","ChevronRightIcon","AccordionContent"],"mappings":";;;;AAQA,SAASA,EAAUC,GAA6D;AAC9E,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDF;AACJ,SACE,gBAAAG;AAAA,IAACC,EAAmB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASI,EAAc;AAAA,EACE,WAAAL;AAAA,EACA,GAAGD;AACL,GAAyD;AAC9E,SACE,gBAAAG;AAAA,IAACC,EAAmB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASO,EAAiB;AAAA,EACE,WAAAN;AAAA,EACA,UAAAO;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,GAAGT;AACL,GAAwF;AAChH,SACE,gBAAAG,EAACC,EAAmB,QAAnB,EAA0B,WAAU,QACnC,UAAA,gBAAAM;AAAA,IAACN,EAAmB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGD;AAAA,MAEH,UAAA;AAAA,QAAAS,KAAe,gBAAAN,EAACQ,GAAA,EAAiB,aAAU,sBAAqB,WAAU,wGAAuG;AAAA,QACjLH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;AAEA,SAASI,EAAiB;AAAA,EACE,WAAAX;AAAA,EACA,UAAAO;AAAA,EACA,GAAGR;AACL,GAA4D;AACpF,SACE,gBAAAG;AAAA,IAACC,EAAmB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV,WAAU;AAAA,MACT,GAAGJ;AAAA,MAEJ,UAAA,gBAAAG,EAAC,SAAI,WAAWE,EAAG,iCAAiC,aAAaJ,CAAS,GAAI,UAAAO,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAG7F;"}
|
package/Alert/Alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../src/Alert/Alert.tsx"],"sourcesContent":["import * as React from \"react\"\
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../src/Alert/Alert.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"@oneplatformdev/utils\"\n\nimport alertVariants from './alertVariants';\n\nexport const Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n))\nAlert.displayName = \"Alert\"\n\nexport const AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-medium leading-none tracking-tight\", className)}\n {...props}\n />\n))\nAlertTitle.displayName = \"AlertTitle\"\n\nexport const AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm [&_p]:leading-relaxed\", className)}\n {...props}\n />\n))\nAlertDescription.displayName = \"AlertDescription\"\n"],"names":["Alert","React","className","variant","props","ref","jsx","cn","alertVariants","AlertTitle","AlertDescription"],"mappings":";;;;AAMO,MAAMA,IAAQC,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,GAAGC,KAASC,MACnC,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,MAAK;AAAA,IACL,WAAWE,EAAGC,EAAc,EAAE,SAAAL,EAAA,CAAS,GAAGD,CAAS;AAAA,IAClD,GAAGE;AAAA,EAAA;AACN,CACD;AACDJ,EAAM,cAAc;AAEb,MAAMS,IAAaR,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,gDAAgDL,CAAS;AAAA,IACtE,GAAGE;AAAA,EAAA;AACN,CACD;AACDK,EAAW,cAAc;AAElB,MAAMC,IAAmBT,EAAM,WAGpC,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,iCAAiCL,CAAS;AAAA,IACvD,GAAGE;AAAA,EAAA;AACN,CACD;AACDM,EAAiB,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alertVariants.js","sources":["../../src/Alert/alertVariants.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\"\
|
|
1
|
+
{"version":3,"file":"alertVariants.js","sources":["../../src/Alert/alertVariants.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\"\n\nexport const alertVariants = cva(\n \"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n destructive:\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport default alertVariants;\n"],"names":["alertVariants","cva"],"mappings":";AAEO,MAAMA,IAAgBC;AAAA,EAC3B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.js","sources":["../../src/AlertDialog/AlertDialog.tsx"],"sourcesContent":["import {\r\n Children,\r\n cloneElement,\r\n FC,\r\n Key,\r\n PropsWithChildren,\r\n ReactElement,\r\n useId,\r\n} from 'react';\r\nimport {\r\n AlertDialogAction,\r\n AlertDialogCancel,\r\n AlertDialogContent,\r\n AlertDialogDescription,\r\n AlertDialogFooter,\r\n AlertDialogHeader,\r\n AlertDialogRoot,\r\n AlertDialogTitle,\r\n AlertDialogTrigger,\r\n} from './AlertDialogRoot';\r\nimport {\r\n AlertDialogDescriptionProps,\r\n AlertDialogFooterProps,\r\n AlertDialogHeaderProps,\r\n AlertDialogProps,\r\n AlertDialogTitleProps,\r\n} from './AlertDialog.types';\r\n\r\nimport { isValidReactElement } from '@oneplatformdev/utils';\r\n\r\nconst RenderAlertDialogTrigger: FC<PropsWithChildren<AlertDialogProps>> = (\r\n props\r\n) => {\r\n const { slotProps = {}, children } = props;\r\n const triggerProps = slotProps.trigger ?? {};\r\n return <AlertDialogTrigger asChild {...triggerProps}>{children}</AlertDialogTrigger>;\r\n};\r\n\r\nconst RenderAlertDialogHeader: FC<PropsWithChildren<AlertDialogProps>> = (props) => {\r\n const {\r\n title = '',\r\n description = '',\r\n slotProps = {},\r\n children,\r\n } = props;\r\n\r\n const headerProps = slotProps.header ?? {};\r\n const titleProps = slotProps.title ?? {};\r\n const descriptionProps = slotProps.description ?? {};\r\n\r\n if(children) {\r\n return isValidReactElement(children, AlertDialogHeader)\r\n ? cloneElement<AlertDialogHeaderProps>(\r\n children as ReactElement<AlertDialogHeaderProps>,\r\n { ...((children as ReactElement<AlertDialogHeaderProps>).props || {}), ...headerProps }\r\n )\r\n : <AlertDialogHeader {...headerProps}>{children}</AlertDialogHeader>\r\n }\r\n\r\n return (\r\n <AlertDialogHeader>\r\n {Boolean(title) && isValidReactElement(title, AlertDialogTitle)\r\n ? cloneElement<AlertDialogTitleProps>(\r\n title as ReactElement<AlertDialogTitleProps>,\r\n { ...((title as ReactElement<AlertDialogTitleProps>).props || {}), ...titleProps }\r\n )\r\n : <AlertDialogTitle {...titleProps}>{title}</AlertDialogTitle>}\r\n\r\n {Boolean(description) && isValidReactElement(description, AlertDialogDescription)\r\n ? cloneElement<AlertDialogDescriptionProps>(\r\n description as ReactElement<AlertDialogDescriptionProps>,\r\n { ...((description as ReactElement<AlertDialogDescriptionProps>).props || {}), ...descriptionProps }\r\n )\r\n : <AlertDialogDescription {...descriptionProps}>{description}</AlertDialogDescription>\r\n }\r\n </AlertDialogHeader>\r\n )\r\n}\r\n\r\nconst RenderAlertDialogFooter: FC<PropsWithChildren<AlertDialogProps>> = (props) => {\r\n const {\r\n slotProps = {},\r\n children,\r\n onCancel,\r\n onConfirm,\r\n cancelLabel = 'Cancel',\r\n actionLabel = 'Continue',\r\n variant = 'confirm',\r\n } = props;\r\n const footerId = useId();\r\n\r\n const footerProps = slotProps.footer ?? {};\r\n const cancelButtonProps = slotProps.cancelButton ?? {};\r\n const actionButtonProps = slotProps.actionButton ?? {};\r\n\r\n if(children) {\r\n return isValidReactElement(children, AlertDialogFooter)\r\n ? cloneElement<AlertDialogFooterProps>(\r\n children as ReactElement<AlertDialogFooterProps>,\r\n { ...((children as ReactElement<AlertDialogFooterProps>).props || {}), ...footerProps }\r\n )\r\n : (\r\n <AlertDialogFooter {...footerProps}>\r\n {Children.map(children, (child, i) => {\r\n if(!child || !isValidReactElement(child)) return;\r\n\r\n const reactChild = child as ReactElement;\r\n const clonedChild = cloneElement(reactChild, {...(reactChild.props || {}), key: (reactChild.key || `footer-${footerId}-action-${i}` as unknown as Key)});\r\n\r\n if(isValidReactElement(child, AlertDialogAction) || isValidReactElement(child, AlertDialogCancel)) {\r\n return clonedChild;\r\n }\r\n\r\n return (\r\n <AlertDialogAction asChild>\r\n {clonedChild}\r\n </AlertDialogAction>\r\n )\r\n })}\r\n </AlertDialogFooter>\r\n )\r\n }\r\n\r\n return (\r\n <AlertDialogFooter>\r\n {variant !== 'alert' && (\r\n <AlertDialogCancel\r\n onClick={onCancel}\r\n {...cancelButtonProps}\r\n >\r\n {cancelLabel}\r\n </AlertDialogCancel>\r\n )}\r\n <AlertDialogAction\r\n onClick={onConfirm}\r\n {...actionButtonProps}\r\n variant={actionButtonProps.variant}\r\n color={actionButtonProps.color || (variant === 'destructive' ? 'error' : 'primary')}\r\n >\r\n {actionLabel}\r\n </AlertDialogAction>\r\n </AlertDialogFooter>\r\n )\r\n}\r\n\r\n/**\r\n * Component for show Alert Dialog.\r\n * @public\r\n * @see [Documentation](#)\r\n * @example\r\n * > Import:\r\n * ```tsx\r\n * import { AlertDialog } from '@oneplatformdev/ui/AlertDialog';\r\n * ```\r\n * > Simple example:\r\n * ```tsx\r\n * <AlertDialog\r\n * trigger={'Trigger text'} // may be any ReactNode | Button | string\r\n * variant='alert' // 'confirm' (default) | 'alert' | 'destructive'\r\n * title='Dialog title'\r\n * description='Description text...'\r\n * />\r\n * ```\r\n * > Base example:\r\n * ```tsx\r\n * <AlertDialog\r\n * trigger={<Button variant=\"outline\">Simple Trigger</Button>}\r\n * title='Dialog title'\r\n * description='Description text...'\r\n * onCancel={(event) => console.log(event, 'Cancel')}\r\n * onConfirm={(event) => console.log(event, 'Confirm')}\r\n * />\r\n * ```\r\n * > Trigger example: Button with icon children\r\n * ```tsx\r\n * <AlertDialog\r\n * trigger={<Button variant=\"outline\" size=\"icon\"><PencilLine /></Button>}\r\n * title=\"Dialog title with icon trigger\"\r\n * description=\"Description text...\"\r\n * onCancel={(event) => console.log(event, 'Cancel')}\r\n * onConfirm={(event) => console.log(event, 'Confirm')}\r\n * />\r\n * ```\r\n *\r\n * > Full content example:\r\n * ```tsx\r\n * <AlertDialog trigger={<Button variant=\"outline\">Full Content Trigger</Button>}>\r\n * Full Content...\r\n * </AlertDialog>\r\n * ```\r\n *\r\n * > Full control example:\r\n * ```tsx\r\n * <AlertDialog\r\n * open={true}\r\n * onOpenChange={(nextState) => console.log(nextState)}\r\n * trigger={<Button variant=\"outline\">Control Trigger</Button>}\r\n * header={<div>Custom Header</div>}\r\n * footer={[\r\n * <Button key='cancel' variant=\"outline\" onClick={() => {}}>On Action</Button>,\r\n * <Button key='action' variant=\"outline\" onClick={() => {}}>On Action</Button>,\r\n * ]}\r\n * />\r\n * ```\r\n */\r\nexport const AlertDialog: FC<PropsWithChildren<AlertDialogProps>> = (props) => {\r\n const {\r\n trigger,\r\n header,\r\n footer,\r\n slotProps = {},\r\n children,\r\n ...rest\r\n } = props;\r\n\r\n const contentProps = slotProps.content ?? {};\r\n\r\n return (\r\n <AlertDialogRoot {...rest}>\r\n <RenderAlertDialogTrigger {...props}>{trigger}</RenderAlertDialogTrigger>\r\n {children\r\n ? <AlertDialogContent {...contentProps}>{children}</AlertDialogContent>\r\n : (\r\n <AlertDialogContent {...contentProps}>\r\n <RenderAlertDialogHeader {...props}>{header}</RenderAlertDialogHeader>\r\n <RenderAlertDialogFooter {...props}>{footer}</RenderAlertDialogFooter>\r\n </AlertDialogContent>\r\n )\r\n }\r\n </AlertDialogRoot>\r\n )\r\n}\r\n\r\nexport default AlertDialog;\r\n"],"names":["RenderAlertDialogTrigger","props","slotProps","children","triggerProps","AlertDialogTrigger","RenderAlertDialogHeader","title","description","headerProps","titleProps","descriptionProps","isValidReactElement","AlertDialogHeader","cloneElement","jsx","AlertDialogTitle","AlertDialogDescription","RenderAlertDialogFooter","onCancel","onConfirm","cancelLabel","actionLabel","variant","footerId","useId","footerProps","cancelButtonProps","actionButtonProps","AlertDialogFooter","child","i","reactChild","clonedChild","AlertDialogAction","AlertDialogCancel","AlertDialog","trigger","header","footer","rest","contentProps","jsxs","AlertDialogRoot","AlertDialogContent"],"mappings":";;;;AA8BA,MAAMA,IAAoE,CACxEC,MACG;AACH,QAAM,EAAE,WAAAC,IAAY,IAAI,UAAAC,MAAaF,GAC/BG,IAAeF,EAAU,WAAW,CAAA;AAC1C,2BAAQG,GAAA,EAAmB,SAAO,IAAE,GAAGD,GAAe,UAAAD,GAAS;AACjE,GAEMG,IAAmE,CAACL,MAAU;AAClF,QAAM;AAAA,IACJ,OAAAM,IAAQ;AAAA,IACR,aAAAC,IAAc;AAAA,IACd,WAAAN,IAAY,CAAA;AAAA,IACZ,UAAAC;AAAA,EAAA,IACEF,GAEEQ,IAAcP,EAAU,UAAU,CAAA,GAClCQ,IAAaR,EAAU,SAAS,CAAA,GAChCS,IAAmBT,EAAU,eAAe,CAAA;AAElD,SAAGC,IACMS,EAAoBT,GAAUU,CAAiB,IAClDC;AAAA,IACAX;AAAA,IACA,EAAE,GAAKA,EAAkD,SAAS,CAAA,GAAK,GAAGM,EAAA;AAAA,EAAY,IAEtF,gBAAAM,EAACF,GAAA,EAAmB,GAAGJ,GAAc,UAAAN,EAAA,CAAS,sBAIjDU,GAAA,EACE,UAAA;AAAA,IAAQN,KAAUK,EAAoBL,GAAOS,CAAgB,IAC1DF;AAAA,MACAP;AAAA,MACA,EAAE,GAAKA,EAA8C,SAAS,CAAA,GAAK,GAAGG,EAAA;AAAA,IAAW,IAEjF,gBAAAK,EAACC,GAAA,EAAkB,GAAGN,GAAa,UAAAH,GAAM;AAAA,IAEpCC,KAAgBI,EAAoBJ,GAAaS,CAAsB,IAC5EH;AAAA,MACAN;AAAA,MACA,EAAE,GAAKA,EAA0D,SAAS,CAAA,GAAK,GAAGG,EAAA;AAAA,IAAiB,IAEnG,gBAAAI,EA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QACC,SAASd;AAAA,QACR,GAAGQ;AAAA,QACJ,SAASA,EAAkB;AAAA,QAC3B,OAAOA,EAAkB,UAAUL,MAAY,gBAAgB,UAAU;AAAA,QAExE,UAAAD;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ,GA8Dac,IAAuD,CAACnC,MAAU;AAC7E,QAAM;AAAA,IACJ,SAAAoC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAArC,IAAY,CAAA;AAAA,IACZ,UAAAC;AAAA,IACA,GAAGqC;AAAA,EAAA,IACDvC,GAEEwC,IAAevC,EAAU,WAAW,CAAA;AAE1C,SACE,gBAAAwC,EAACC,GAAA,EAAiB,GAAGH,GACnB,UAAA;AAAA,IAAA,gBAAAzB,EAACf,GAAA,EAA0B,GAAGC,GAAQ,UAAAoC,EAAA,CAAQ;AAAA,IAC7ClC,IACG,gBAAAY,EAAC6B,GAAA,EAAoB,GAAGH,GAAe,UAAAtC,GAAS,IAEhD,gBAAAuC,EAACE,GAAA,EAAoB,GAAGH,GACtB,UAAA;AAAA,MAAA,gBAAA1B,EAACT,GAAA,EAAyB,GAAGL,GAAQ,UAAAqC,EAAA,CAAO;AAAA,MAC5C,gBAAAvB,EAACG,GAAA,EAAyB,GAAGjB,GAAQ,UAAAsC,EAAA,CAAO;AAAA,IAAA,EAAA,CAC9C;AAAA,EAAA,GAGN;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"AlertDialog.js","sources":["../../src/AlertDialog/AlertDialog.tsx"],"sourcesContent":["import {\n Children,\n cloneElement,\n FC,\n Key,\n PropsWithChildren,\n ReactElement,\n useId,\n} from 'react';\nimport {\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogRoot,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from './AlertDialogRoot';\nimport {\n AlertDialogDescriptionProps,\n AlertDialogFooterProps,\n AlertDialogHeaderProps,\n AlertDialogProps,\n AlertDialogTitleProps,\n} from './AlertDialog.types';\n\nimport { isValidReactElement } from '@oneplatformdev/utils';\n\nconst RenderAlertDialogTrigger: FC<PropsWithChildren<AlertDialogProps>> = (\n props\n) => {\n const { slotProps = {}, children } = props;\n const triggerProps = slotProps.trigger ?? {};\n return <AlertDialogTrigger asChild {...triggerProps}>{children}</AlertDialogTrigger>;\n};\n\nconst RenderAlertDialogHeader: FC<PropsWithChildren<AlertDialogProps>> = (props) => {\n const {\n title = '',\n description = '',\n slotProps = {},\n children,\n } = props;\n\n const headerProps = slotProps.header ?? {};\n const titleProps = slotProps.title ?? {};\n const descriptionProps = slotProps.description ?? {};\n\n if(children) {\n return isValidReactElement(children, AlertDialogHeader)\n ? cloneElement<AlertDialogHeaderProps>(\n children as ReactElement<AlertDialogHeaderProps>,\n { ...((children as ReactElement<AlertDialogHeaderProps>).props || {}), ...headerProps }\n )\n : <AlertDialogHeader {...headerProps}>{children}</AlertDialogHeader>\n }\n\n return (\n <AlertDialogHeader>\n {Boolean(title) && isValidReactElement(title, AlertDialogTitle)\n ? cloneElement<AlertDialogTitleProps>(\n title as ReactElement<AlertDialogTitleProps>,\n { ...((title as ReactElement<AlertDialogTitleProps>).props || {}), ...titleProps }\n )\n : <AlertDialogTitle {...titleProps}>{title}</AlertDialogTitle>}\n\n {Boolean(description) && isValidReactElement(description, AlertDialogDescription)\n ? cloneElement<AlertDialogDescriptionProps>(\n description as ReactElement<AlertDialogDescriptionProps>,\n { ...((description as ReactElement<AlertDialogDescriptionProps>).props || {}), ...descriptionProps }\n )\n : <AlertDialogDescription {...descriptionProps}>{description}</AlertDialogDescription>\n }\n </AlertDialogHeader>\n )\n}\n\nconst RenderAlertDialogFooter: FC<PropsWithChildren<AlertDialogProps>> = (props) => {\n const {\n slotProps = {},\n children,\n onCancel,\n onConfirm,\n cancelLabel = 'Cancel',\n actionLabel = 'Continue',\n variant = 'confirm',\n } = props;\n const footerId = useId();\n\n const footerProps = slotProps.footer ?? {};\n const cancelButtonProps = slotProps.cancelButton ?? {};\n const actionButtonProps = slotProps.actionButton ?? {};\n\n if(children) {\n return isValidReactElement(children, AlertDialogFooter)\n ? cloneElement<AlertDialogFooterProps>(\n children as ReactElement<AlertDialogFooterProps>,\n { ...((children as ReactElement<AlertDialogFooterProps>).props || {}), ...footerProps }\n )\n : (\n <AlertDialogFooter {...footerProps}>\n {Children.map(children, (child, i) => {\n if(!child || !isValidReactElement(child)) return;\n\n const reactChild = child as ReactElement;\n const clonedChild = cloneElement(reactChild, {...(reactChild.props || {}), key: (reactChild.key || `footer-${footerId}-action-${i}` as unknown as Key)});\n\n if(isValidReactElement(child, AlertDialogAction) || isValidReactElement(child, AlertDialogCancel)) {\n return clonedChild;\n }\n\n return (\n <AlertDialogAction asChild>\n {clonedChild}\n </AlertDialogAction>\n )\n })}\n </AlertDialogFooter>\n )\n }\n\n return (\n <AlertDialogFooter>\n {variant !== 'alert' && (\n <AlertDialogCancel\n onClick={onCancel}\n {...cancelButtonProps}\n >\n {cancelLabel}\n </AlertDialogCancel>\n )}\n <AlertDialogAction\n onClick={onConfirm}\n {...actionButtonProps}\n variant={actionButtonProps.variant}\n color={actionButtonProps.color || (variant === 'destructive' ? 'error' : 'primary')}\n >\n {actionLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n )\n}\n\n/**\n * Component for show Alert Dialog.\n * @public\n * @see [Documentation](#)\n * @example\n * > Import:\n * ```tsx\n * import { AlertDialog } from '@oneplatformdev/ui/AlertDialog';\n * ```\n * > Simple example:\n * ```tsx\n * <AlertDialog\n * trigger={'Trigger text'} // may be any ReactNode | Button | string\n * variant='alert' // 'confirm' (default) | 'alert' | 'destructive'\n * title='Dialog title'\n * description='Description text...'\n * />\n * ```\n * > Base example:\n * ```tsx\n * <AlertDialog\n * trigger={<Button variant=\"outline\">Simple Trigger</Button>}\n * title='Dialog title'\n * description='Description text...'\n * onCancel={(event) => console.log(event, 'Cancel')}\n * onConfirm={(event) => console.log(event, 'Confirm')}\n * />\n * ```\n * > Trigger example: Button with icon children\n * ```tsx\n * <AlertDialog\n * trigger={<Button variant=\"outline\" size=\"icon\"><PencilLine /></Button>}\n * title=\"Dialog title with icon trigger\"\n * description=\"Description text...\"\n * onCancel={(event) => console.log(event, 'Cancel')}\n * onConfirm={(event) => console.log(event, 'Confirm')}\n * />\n * ```\n *\n * > Full content example:\n * ```tsx\n * <AlertDialog trigger={<Button variant=\"outline\">Full Content Trigger</Button>}>\n * Full Content...\n * </AlertDialog>\n * ```\n *\n * > Full control example:\n * ```tsx\n * <AlertDialog\n * open={true}\n * onOpenChange={(nextState) => console.log(nextState)}\n * trigger={<Button variant=\"outline\">Control Trigger</Button>}\n * header={<div>Custom Header</div>}\n * footer={[\n * <Button key='cancel' variant=\"outline\" onClick={() => {}}>On Action</Button>,\n * <Button key='action' variant=\"outline\" onClick={() => {}}>On Action</Button>,\n * ]}\n * />\n * ```\n */\nexport const AlertDialog: FC<PropsWithChildren<AlertDialogProps>> = (props) => {\n const {\n trigger,\n header,\n footer,\n slotProps = {},\n children,\n ...rest\n } = props;\n\n const contentProps = slotProps.content ?? {};\n\n return (\n <AlertDialogRoot {...rest}>\n <RenderAlertDialogTrigger {...props}>{trigger}</RenderAlertDialogTrigger>\n {children\n ? <AlertDialogContent {...contentProps}>{children}</AlertDialogContent>\n : (\n <AlertDialogContent {...contentProps}>\n <RenderAlertDialogHeader {...props}>{header}</RenderAlertDialogHeader>\n <RenderAlertDialogFooter {...props}>{footer}</RenderAlertDialogFooter>\n </AlertDialogContent>\n )\n }\n </AlertDialogRoot>\n )\n}\n\nexport default AlertDialog;\n"],"names":["RenderAlertDialogTrigger","props","slotProps","children","triggerProps","AlertDialogTrigger","RenderAlertDialogHeader","title","description","headerProps","titleProps","descriptionProps","isValidReactElement","AlertDialogHeader","cloneElement","jsx","AlertDialogTitle","AlertDialogDescription","RenderAlertDialogFooter","onCancel","onConfirm","cancelLabel","actionLabel","variant","footerId","useId","footerProps","cancelButtonProps","actionButtonProps","AlertDialogFooter","child","i","reactChild","clonedChild","AlertDialogAction","AlertDialogCancel","AlertDialog","trigger","header","footer","rest","contentProps","jsxs","AlertDialogRoot","AlertDialogContent"],"mappings":";;;;AA8BA,MAAMA,IAAoE,CACxEC,MACG;AACH,QAAM,EAAE,WAAAC,IAAY,IAAI,UAAAC,MAAaF,GAC/BG,IAAeF,EAAU,WAAW,CAAA;AAC1C,2BAAQG,GAAA,EAAmB,SAAO,IAAE,GAAGD,GAAe,UAAAD,GAAS;AACjE,GAEMG,IAAmE,CAACL,MAAU;AAClF,QAAM;AAAA,IACJ,OAAAM,IAAQ;AAAA,IACR,aAAAC,IAAc;AAAA,IACd,WAAAN,IAAY,CAAA;AAAA,IACZ,UAAAC;AAAA,EAAA,IACEF,GAEEQ,IAAcP,EAAU,UAAU,CAAA,GAClCQ,IAAaR,EAAU,SAAS,CAAA,GAChCS,IAAmBT,EAAU,eAAe,CAAA;AAElD,SAAGC,IACMS,EAAoBT,GAAUU,CAAiB,IAClDC;AAAA,IACAX;AAAA,IACA,EAAE,GAAKA,EAAkD,SAAS,CAAA,GAAK,GAAGM,EAAA;AAAA,EAAY,IAEtF,gBAAAM,EAACF,GAAA,EAAmB,GAAGJ,GAAc,UAAAN,EAAA,CAAS,sBAIjDU,GAAA,EACE,UAAA;AAAA,IAAQN,KAAUK,EAAoBL,GAAOS,CAAgB,IAC1DF;AAAA,MACAP;AAAA,MACA,EAAE,GAAKA,EAA8C,SAAS,CAAA,GAAK,GAAGG,EAAA;AAAA,IAAW,IAEjF,gBAAAK,EAACC,GAAA,EAAkB,GAAGN,GAAa,UAAAH,GAAM;AAAA,IAEpCC,KAAgBI,EAAoBJ,GAAaS,CAAsB,IAC5EH;AAAA,MACAN;AAAA,MACA,EAAE,GAAKA,EAA0D,SAAS,CAAA,GAAK,GAAGG,EAAA;AAAA,IAAiB,IAEnG,gBAAAI,EAACE,GAAA,EAAwB,GAAGN,GAAmB,UAAAH,EAAA,CAAY;AAAA,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AAA,QAC3B,OAAOA,EAAkB,UAAUL,MAAY,gBAAgB,UAAU;AAAA,QAExE,UAAAD;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ,GA8Dac,IAAuD,CAACnC,MAAU;AAC7E,QAAM;AAAA,IACJ,SAAAoC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAArC,IAAY,CAAA;AAAA,IACZ,UAAAC;AAAA,IACA,GAAGqC;AAAA,EAAA,IACDvC,GAEEwC,IAAevC,EAAU,WAAW,CAAA;AAE1C,SACE,gBAAAwC,EAACC,GAAA,EAAiB,GAAGH,GACnB,UAAA;AAAA,IAAA,gBAAAzB,EAACf,GAAA,EAA0B,GAAGC,GAAQ,UAAAoC,EAAA,CAAQ;AAAA,IAC7ClC,IACG,gBAAAY,EAAC6B,GAAA,EAAoB,GAAGH,GAAe,UAAAtC,GAAS,IAEhD,gBAAAuC,EAACE,GAAA,EAAoB,GAAGH,GACtB,UAAA;AAAA,MAAA,gBAAA1B,EAACT,GAAA,EAAyB,GAAGL,GAAQ,UAAAqC,EAAA,CAAO;AAAA,MAC5C,gBAAAvB,EAACG,GAAA,EAAyB,GAAGjB,GAAQ,UAAAsC,EAAA,CAAO;AAAA,IAAA,EAAA,CAC9C;AAAA,EAAA,GAGN;AAEJ;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { AlertDialog as n } from "./AlertDialog.js";
|
|
3
3
|
import { Button as l } from "../Button/Button.js";
|
|
4
|
-
|
|
4
|
+
import "../Button/buttonVariants.js";
|
|
5
|
+
const c = (e) => /* @__PURE__ */ t(n, { ...e }), r = ["confirm", "alert", "destructive"], b = {
|
|
5
6
|
title: "AlertDialog",
|
|
6
7
|
component: n,
|
|
7
8
|
render: c,
|
|
@@ -116,6 +117,6 @@ export {
|
|
|
116
117
|
a as FullControl,
|
|
117
118
|
s as Playground,
|
|
118
119
|
i as Variants,
|
|
119
|
-
|
|
120
|
+
b as default
|
|
120
121
|
};
|
|
121
122
|
//# sourceMappingURL=AlertDialog.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.stories.js","sources":["../../src/AlertDialog/AlertDialog.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react';\
|
|
1
|
+
{"version":3,"file":"AlertDialog.stories.js","sources":["../../src/AlertDialog/AlertDialog.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react';\n\nimport { AlertDialog } from './AlertDialog';\nimport { AlertDialogProps } from './AlertDialog.types';\nimport React from 'react';\nimport { Button } from '../Button';\n\nconst Template = (props: AlertDialogProps) => <AlertDialog {...props} />;\n\nconst variants = ['confirm', 'alert', 'destructive'] as const;\n\nconst meta = {\n title: 'AlertDialog',\n component: AlertDialog,\n render: Template,\n argTypes: {\n open: {\n control: {\n type: 'boolean',\n },\n },\n variant: {\n name: 'variant',\n description: 'ButtonIcon variant',\n options: variants,\n control: {\n type: 'inline-radio',\n },\n },\n cancelLabel: {\n control: {\n type: 'text',\n },\n },\n actionLabel: {\n control: {\n type: 'text',\n },\n },\n title: {\n control: {\n type: 'text',\n },\n },\n description: {\n control: {\n type: 'text',\n },\n },\n },\n args: {\n variant: 'alert',\n cancelLabel: 'Cancel',\n actionLabel: 'Action',\n },\n} satisfies Meta<typeof AlertDialog>;\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Playground = (args: AlertDialogProps) => (\n <AlertDialog\n {...args}\n />\n);\nPlayground.args = {\n trigger: 'Trigger text or ReactNode',\n variant: 'confirm',\n title: 'Dialog title...',\n description: 'Description text...',\n cancelLabel: 'Cancel label',\n actionLabel: 'Action label',\n}\n\nexport const Variants = (args: AlertDialogProps) => (\n <div className='flex gap-3'>\n {variants.map((variant) => (\n <AlertDialog\n key={variant}\n trigger={variant}\n {...args}\n variant={variant}\n />\n ))}\n </div>\n);\nVariants.parameters = {\n controls: {\n include: ['title', 'description', 'cancelLabel', 'actionLabel'],\n },\n};\nVariants.args = {\n title: \"Dialog title\",\n description: \"Description text...\"\n}\n\nexport const FullControl = (args: AlertDialogProps) => (\n <AlertDialog\n onOpenChange={(nextState) => console.log(nextState)}\n trigger={<Button variant=\"outline\">Control Trigger</Button>}\n header={<div>Custom Header</div>}\n footer={[\n <Button key='cancel' variant=\"outline\" onClick={console.log}>On cancel</Button>,\n <Button key='action' variant=\"outline\" onClick={console.log}>On Action</Button>,\n ]}\n {...args}\n />\n);\nFullControl.parameters = {\n controls: {\n include: ['open'],\n },\n};\nFullControl.args = {\n open: false,\n}\n\n\nexport const FullContent = (args: AlertDialogProps) => (\n <AlertDialog\n trigger={<Button variant=\"outline\">Full Content Trigger</Button>}\n {...args}\n >\n Full Content...\n </AlertDialog>\n);\nFullContent.parameters = {\n controls: {\n include: [],\n },\n};\n"],"names":["Template","props","jsx","AlertDialog","variants","meta","Playground","args","Variants","variant","FullControl","nextState","Button","FullContent"],"mappings":";;;;AAOA,MAAMA,IAAW,CAACC,MAA4B,gBAAAC,EAACC,GAAA,EAAa,GAAGF,GAAO,GAEhEG,IAAW,CAAC,WAAW,SAAS,aAAa,GAE7CC,IAAO;AAAA,EACX,OAAO;AAAA,EACP,WAAWF;AAAA,EACX,QAAQH;AAAA,EACR,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,SAAS;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,SAAS;AAAA,MACP,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAASI;AAAA,MACT,SAAS;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,aAAa;AAAA,MACX,SAAS;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,aAAa;AAAA,MACX,SAAS;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,OAAO;AAAA,MACL,SAAS;AAAA,QACP,MAAM;AAAA,MAA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AAAA,IAAA;AAAA,IAEvE,GAAGL;AAAA,EAAA;AACN;AAEFG,EAAY,aAAa;AAAA,EACvB,UAAU;AAAA,IACR,SAAS,CAAC,MAAM;AAAA,EAAA;AAEpB;AACAA,EAAY,OAAO;AAAA,EACjB,MAAM;AACR;AAGO,MAAMG,IAAc,CAACN,MAC1B,gBAAAL;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,SAAS,gBAAAD,EAACU,GAAA,EAAO,SAAQ,WAAU,UAAA,wBAAoB;AAAA,IACtD,GAAGL;AAAA,IACL,UAAA;AAAA,EAAA;AAED;AAEFM,EAAY,aAAa;AAAA,EACvB,UAAU;AAAA,IACR,SAAS,CAAA;AAAA,EAAC;AAEd;"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "@radix-ui/react-alert-dialog";
|
|
3
3
|
import { cn as l } from "@oneplatformdev/utils";
|
|
4
|
+
import "../Button/Button.js";
|
|
4
5
|
import { buttonVariants as d } from "../Button/buttonVariants.js";
|
|
5
|
-
function
|
|
6
|
+
function N(t) {
|
|
6
7
|
return /* @__PURE__ */ o(r.Root, { "data-slot": "alert-dialog", ...t });
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
+
function A(t) {
|
|
9
10
|
return /* @__PURE__ */ o(r.Trigger, { "data-slot": "alert-dialog-trigger", ...t });
|
|
10
11
|
}
|
|
11
12
|
function m(t) {
|
|
@@ -25,7 +26,7 @@ function g(t) {
|
|
|
25
26
|
}
|
|
26
27
|
);
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function D(t) {
|
|
29
30
|
const { className: a, ...e } = t;
|
|
30
31
|
return /* @__PURE__ */ c(m, { children: [
|
|
31
32
|
/* @__PURE__ */ o(g, {}),
|
|
@@ -46,7 +47,7 @@ function A(t) {
|
|
|
46
47
|
)
|
|
47
48
|
] });
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function w(t) {
|
|
50
51
|
const { className: a, ...e } = t;
|
|
51
52
|
return /* @__PURE__ */ o(
|
|
52
53
|
"div",
|
|
@@ -57,7 +58,7 @@ function D(t) {
|
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function b(t) {
|
|
61
62
|
const { className: a, ...e } = t;
|
|
62
63
|
return /* @__PURE__ */ o(
|
|
63
64
|
"div",
|
|
@@ -71,7 +72,7 @@ function w(t) {
|
|
|
71
72
|
}
|
|
72
73
|
);
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
+
function v(t) {
|
|
75
76
|
const { className: a, ...e } = t;
|
|
76
77
|
return /* @__PURE__ */ o(
|
|
77
78
|
r.Title,
|
|
@@ -82,7 +83,7 @@ function b(t) {
|
|
|
82
83
|
}
|
|
83
84
|
);
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function h(t) {
|
|
86
87
|
const { className: a, ...e } = t;
|
|
87
88
|
return /* @__PURE__ */ o(
|
|
88
89
|
r.Description,
|
|
@@ -93,7 +94,7 @@ function v(t) {
|
|
|
93
94
|
}
|
|
94
95
|
);
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function y(t) {
|
|
97
98
|
const { className: a, variant: e, size: s, color: n, ...i } = t;
|
|
98
99
|
return /* @__PURE__ */ o(
|
|
99
100
|
r.Action,
|
|
@@ -103,7 +104,7 @@ function h(t) {
|
|
|
103
104
|
}
|
|
104
105
|
);
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
+
function z(t) {
|
|
107
108
|
const { className: a, variant: e, color: s = "secondary", size: n, ...i } = t;
|
|
108
109
|
return /* @__PURE__ */ o(
|
|
109
110
|
r.Cancel,
|
|
@@ -114,17 +115,17 @@ function y(t) {
|
|
|
114
115
|
);
|
|
115
116
|
}
|
|
116
117
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
y as AlertDialogAction,
|
|
119
|
+
z as AlertDialogCancel,
|
|
120
|
+
D as AlertDialogContent,
|
|
121
|
+
h as AlertDialogDescription,
|
|
122
|
+
b as AlertDialogFooter,
|
|
123
|
+
w as AlertDialogHeader,
|
|
123
124
|
g as AlertDialogOverlay,
|
|
124
125
|
m as AlertDialogPortal,
|
|
125
126
|
r as AlertDialogPrimitive,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
N as AlertDialogRoot,
|
|
128
|
+
v as AlertDialogTitle,
|
|
129
|
+
A as AlertDialogTrigger
|
|
129
130
|
};
|
|
130
131
|
//# sourceMappingURL=AlertDialogRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialogRoot.js","sources":["../../src/AlertDialog/AlertDialogRoot.tsx"],"sourcesContent":["'use client';\
|
|
1
|
+
{"version":3,"file":"AlertDialogRoot.js","sources":["../../src/AlertDialog/AlertDialogRoot.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '@oneplatformdev/utils';\nimport { ButtonProps, buttonVariants } from '../Button';\n\nfunction AlertDialogRoot(props: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger(props: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n return <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />;\n}\nfunction AlertDialogPortal(props: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" asChild {...props} />;\n}\n\nfunction AlertDialogOverlay(props: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n const { className, ...rest } = props;\n return (\n <AlertDialogPrimitive.Overlay\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction AlertDialogContent(props: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {\n const { className, ...rest } = props;\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n data-slot=\"alert-dialog-content\"\n className={cn(\n 'fixed top-[50%] left-[50%] z-50 translate-x-[-50%] translate-y-[-50%]',\n 'grid w-full max-w-[calc(100%-2rem)] sm:max-w-lg gap-4 p-6',\n 'bg-background border rounded-lg shadow-lg',\n 'overflow-x-hidden break-words',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 duration-200',\n className\n )}\n {...rest}\n />\n </AlertDialogPortal>\n )\n}\n\n\nfunction AlertDialogHeader(props: React.ComponentProps<\"div\">) {\n const { className, ...rest } = props;\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...rest}\n />\n )\n}\n\nfunction AlertDialogFooter(props: React.ComponentProps<\"div\">) {\n const { className, ...rest } = props;\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...rest}\n />\n )\n}\nfunction AlertDialogTitle(props: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n const { className, ...rest } = props;\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\"text-lg font-semibold break-words\", className)}\n {...rest}\n />\n )\n}\n\nfunction AlertDialogDescription(props: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n const { className, ...rest } = props;\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn(\"text-muted-foreground text-sm whitespace-pre-wrap break-words\", className)}\n {...rest}\n />\n )\n}\n\n\nfunction AlertDialogAction(props: React.ComponentProps<typeof AlertDialogPrimitive.Action> & ButtonProps) {\n const { className, variant, size, color, ...rest } = props;\n return (\n <AlertDialogPrimitive.Action\n className={cn(buttonVariants({ variant, size, color }), className)}\n {...rest}\n />\n )\n}\nfunction AlertDialogCancel(props: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & ButtonProps) {\n const { className, variant, color = 'secondary', size, ...rest } = props\n return (\n <AlertDialogPrimitive.Cancel\n className={cn(buttonVariants({ variant, size, color }), className)}\n {...rest}\n />\n )\n}\n\nexport {\n AlertDialogRoot,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogPrimitive\n};\n"],"names":["AlertDialogRoot","props","AlertDialogPrimitive","AlertDialogTrigger","AlertDialogPortal","jsx","AlertDialogOverlay","className","rest","cn","AlertDialogContent","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","variant","size","color","buttonVariants","AlertDialogCancel"],"mappings":";;;;;AAQA,SAASA,EAAgBC,GAA+D;AACtF,2BAAQC,EAAqB,MAArB,EAA0B,aAAU,gBAAgB,GAAGD,GAAO;AACxE;AAEA,SAASE,EAAmBF,GAAkE;AAC5F,2BAAQC,EAAqB,SAArB,EAA6B,aAAU,wBAAwB,GAAGD,GAAO;AACnF;AACA,SAASG,EAAkBH,GAAiE;AAC1F,SAAO,gBAAAI,EAACH,EAAqB,QAArB,EAA4B,aAAU,uBAAsB,SAAO,IAAE,GAAGD,GAAO;AACzF;AAEA,SAASK,EAAmBL,GAAkE;AAC5F,QAAM,EAAE,WAAAM,GAAW,GAAGC,EAAA,IAASP;AAC/B,SACE,gBAAAI;AAAA,IAACH,EAAqB;AAAA,IAArB;AAAA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pG,QAAM,EAAE,WAAAM,GAAW,GAAGC,EAAA,IAASP;AAC/B,SACE,gBAAAI;AAAA,IAACH,EAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,WAAWO,EAAG,iEAAiEF,CAAS;AAAA,MACvF,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAGA,SAASO,EAAkBd,GAA+E;AACxG,QAAM,EAAE,WAAAM,GAAW,SAAAS,GAAS,MAAAC,GAAM,OAAAC,GAAO,GAAGV,MAASP;AACrD,SACE,gBAAAI;AAAA,IAACH,EAAqB;AAAA,IAArB;AAAA,MACC,WAAWO,EAAGU,EAAe,EAAE,SAAAH,GAAS,MAAAC,GAAM,OAAAC,EAAA,CAAO,GAAGX,CAAS;AAAA,MAChE,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AACA,SAASY,EAAkBnB,GAA+E;AACxG,QAAM,EAAE,WAAAM,GAAW,SAAAS,GAAS,OAAAE,IAAQ,aAAa,MAAAD,GAAM,GAAGT,MAASP;AACnE,SACE,gBAAAI;AAAA,IAACH,EAAqB;AAAA,IAArB;AAAA,MACC,WAAWO,EAAGU,EAAe,EAAE,SAAAH,GAAS,MAAAC,GAAM,OAAAC,EAAA,CAAO,GAAGX,CAAS;AAAA,MAChE,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.js","sources":["../../src/AreaChart/AreaChart.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"file":"AreaChart.js","sources":["../../src/AreaChart/AreaChart.tsx"],"sourcesContent":["\"use client\";\n\nimport { FC } from \"react\";\nimport { Area, AreaChart as RechartAreaChart, CartesianGrid, XAxis, YAxis } from \"recharts\";\n\nimport { ChartContainer, ChartTooltip, ChartTooltipContent } from \"../Chart\";\n\nimport { AreaChartProps } from './AreaChart.types';\n\nexport const AreaChart: FC<AreaChartProps> = ({ data, config }) => {\n return (\n <ChartContainer config={config} className=\"h-[350px] w-full\">\n <RechartAreaChart data={data} width={808} height={350} margin={{ top: 10, right: 10, left: 0, bottom: 0 }}>\n <defs>\n {Object.entries(config).map(([key, { color }]) => (\n <linearGradient id={`${key}Gradient`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\" key={key}>\n <stop offset=\"5%\" stopColor={color} stopOpacity={0.8} />\n <stop offset=\"95%\" stopColor={color} stopOpacity={0.1} />\n </linearGradient>\n ))}\n </defs>\n <CartesianGrid strokeDasharray=\"none\" stroke=\"gray\" strokeWidth={0.5} vertical={true} horizontal={true} />\n <XAxis dataKey=\"month\" axisLine={false} tickLine={false} tick={{ fontSize: 12 }} />\n <YAxis axisLine={false} tickLine={false} tick={{ fontSize: 12 }} />\n <ChartTooltip content={<ChartTooltipContent />} />\n {Object.entries(config).map(([key, { color }]) => (\n <Area\n key={key}\n type=\"monotone\"\n dataKey={key}\n stroke={color}\n fill={`url(#${key}Gradient)`}\n strokeWidth={3}\n />\n ))}\n </RechartAreaChart>\n </ChartContainer>\n );\n};\n"],"names":["AreaChart","data","config","jsx","ChartContainer","jsxs","RechartAreaChart","key","color","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Area"],"mappings":";;;AASO,MAAMA,IAAgC,CAAC,EAAE,MAAAC,GAAM,QAAAC,QAE9C,gBAAAC,EAACC,KAAe,QAAAF,GAAgB,WAAU,oBACtC,UAAA,gBAAAG,EAACC,GAAA,EAAiB,MAAAL,GAAY,OAAO,KAAK,QAAQ,KAAK,QAAQ,EAAE,KAAK,IAAI,OAAO,IAAI,MAAM,GAAG,QAAQ,EAAA,GAClG,UAAA;AAAA,EAAA,gBAAAE,EAAC,QAAA,EACI,UAAA,OAAO,QAAQD,CAAM,EAAE,IAAI,CAAC,CAACK,GAAK,EAAE,OAAAC,EAAA,CAAO,wBACvC,kBAAA,EAAe,IAAI,GAAGD,CAAG,YAAY,IAAG,KAAI,IAAG,KAAI,IAAG,KAAI,IAAG,KAC1D,UAAA;AAAA,IAAA,gBAAAJ,EAAC,UAAK,QAAO,MAAK,WAAWK,GAAO,aAAa,KAAK;AAAA,sBACrD,QAAA,EAAK,QAAO,OAAM,WAAWA,GAAO,aAAa,IAAA,CAAK;AAAA,EAAA,KAFYD,CAGvE,CACH,GACL;AAAA,EACA,gBAAAJ,EAACM,GAAA,EAAc,iBAAgB,QAAO,QAAO,QAAO,aAAa,KAAK,UAAU,IAAM,YAAY,GAAA,CAAM;AAAA,EACxG,gBAAAN,EAACO,GAAA,EAAM,SAAQ,SAAQ,UAAU,IAAO,UAAU,IAAO,MAAM,EAAE,UAAU,GAAA,EAAG,CAAG;AAAA,EACjF,gBAAAP,EAACQ,GAAA,EAAM,UAAU,IAAO,UAAU,IAAO,MAAM,EAAE,UAAU,GAAA,EAAG,CAAG;AAAA,EACjE,gBAAAR,EAACS,GAAA,EAAa,SAAS,gBAAAT,EAACU,KAAoB,GAAI;AAAA,EAC/C,OAAO,QAAQX,CAAM,EAAE,IAAI,CAAC,CAACK,GAAK,EAAE,OAAAC,EAAA,CAAO,MACxC,gBAAAL;AAAA,IAACW;AAAA,IAAA;AAAA,MAEG,MAAK;AAAA,MACL,SAASP;AAAA,MACT,QAAQC;AAAA,MACR,MAAM,QAAQD,CAAG;AAAA,MACjB,aAAa;AAAA,IAAA;AAAA,IALRA;AAAA,EAAA,CAOZ;AAAA,EAAA,CACL,EAAA,CACJ;"}
|
package/Aside/Aside.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Aside.js","sources":["../../src/Aside/Aside.tsx"],"sourcesContent":["import { SidebarInset, SidebarProvider } from \"../Sidebar\";\
|
|
1
|
+
{"version":3,"file":"Aside.js","sources":["../../src/Aside/Aside.tsx"],"sourcesContent":["import { SidebarInset, SidebarProvider } from \"../Sidebar\";\nimport { AsideProps } from \"./Aside.types\";\n\nexport const Aside: React.FC<React.PropsWithChildren<AsideProps>> = (props) => {\n const {\n children,\n header,\n sidebar\n } = props;\n return (\n <SidebarProvider>\n {Boolean(sidebar) && sidebar}\n <SidebarInset>\n {Boolean(header) && header}\n <section className=\"flex flex-1 flex-col gap-4 p-4 pt-0\">\n <div>\n test build\n </div>\n {children}\n </section>\n </SidebarInset>\n </SidebarProvider>\n )\n}\n\nexport default Aside;\n"],"names":["Aside","props","children","header","sidebar","SidebarProvider","SidebarInset","jsxs","jsx"],"mappings":";;AAGO,MAAMA,IAAuD,CAACC,MAAU;AAC7E,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEH;AACJ,2BACGI,GAAA,EACE,UAAA;AAAA,IAAA,EAAQD,KAAYA;AAAA,sBACpBE,GAAA,EACE,UAAA;AAAA,MAAA,EAAQH,KAAWA;AAAA,MACpB,gBAAAI,EAAC,WAAA,EAAQ,WAAU,uCACjB,UAAA;AAAA,QAAA,gBAAAC,EAAC,SAAI,UAAA,aAAA,CAEL;AAAA,QACCN;AAAA,MAAA,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsideSidebar.js","sources":["../../src/Aside/AsideSidebar.tsx"],"sourcesContent":["import * as React from \"react\";\
|
|
1
|
+
{"version":3,"file":"AsideSidebar.js","sources":["../../src/Aside/AsideSidebar.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarRail\n} from \"../Sidebar\";\nimport { AsideSidebarProps } from \"./Aside.types\";\n\nfunction isReactElement<T>(\n element: React.ReactNode,\n componentType: React.JSXElementConstructor<T>\n): element is React.ReactElement<T> {\n return React.isValidElement(element) && element.type === componentType;\n}\n\nexport const AsideSidebar: React.FC<React.PropsWithChildren<AsideSidebarProps>> = (props) => {\n const {\n children,\n header,\n content,\n footer,\n slot,\n hiddenRail,\n ...rest\n } = props;\n return (\n <Sidebar collapsible=\"icon\" {...rest}>\n {Boolean(children)\n ? children\n : (\n <>\n {!children && Boolean(header) && isReactElement(header, SidebarHeader)\n ? React.cloneElement(header, {\n ...header.props,\n ...(slot?.header || {})\n })\n : (\n <SidebarHeader {...(slot?.header || {})}>\n <div className=\"grid gap-2 text-center\">\n {header}\n </div>\n </SidebarHeader>\n )\n }\n\n {!children && Boolean(content) && isReactElement(content, SidebarContent)\n ? React.cloneElement(content, {\n ...content.props,\n ...(slot?.content || {})\n })\n : (\n <SidebarContent {...(slot?.content || {})}>\n {content}\n </SidebarContent>\n )\n }\n\n {!children && Boolean(footer) && isReactElement(footer, SidebarFooter)\n ? React.cloneElement(footer, {\n ...footer.props,\n ...(slot?.footer || {})\n })\n : (\n <SidebarFooter {...(slot?.footer || {})}>\n {footer}\n </SidebarFooter>\n )\n }\n </>\n )\n }\n {!hiddenRail && <SidebarRail />}\n </Sidebar>\n )\n}\n"],"names":["isReactElement","element","componentType","React","AsideSidebar","props","children","header","content","footer","slot","hiddenRail","rest","jsxs","Sidebar","Fragment","SidebarHeader","jsx","SidebarContent","SidebarFooter","SidebarRail"],"mappings":";;;AAWA,SAASA,EACPC,GACAC,GACkC;AAClC,SAAOC,EAAM,eAAeF,CAAO,KAAKA,EAAQ,SAASC;AAC3D;AAEO,MAAME,IAAqE,CAACC,MAAU;AAC3F,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDP;AACJ,SACE,gBAAAQ,EAACC,GAAA,EAAQ,aAAY,QAAQ,GAAGF,GAC7B,UAAA;AAAA,IAAQN,KAGL,gBAAAO,EAAAE,GAAA,EACG,UAAA;AAAA,MAAA,CAACT,KAAoBC,KAAWP,EAAeO,GAAQS,CAAa,IACjEb,EAAM,aAAaI,GAAQ;AAAA,QAC3B,GAAGA,EAAO;AAAA,QACV,GAAIG,GAAM,UAAU,CAAA;AAAA,MAAC,CACtB,IAEC,gBAAAO,EAACD,GAAA,EAAe,GAAIN,GAAM,UAAU,IAClC,UAAA,gBAAAO,EAAC,OAAA,EAAI,WAAU,0BACZ,aACH,GACF;AAAA,MAIH,CAACX,KAAoBE,KAAYR,EAAeQ,GAASU,CAAc,IACpEf,EAAM,aAAaK,GAAS;AAAA,QAC5B,GAAGA,EAAQ;AAAA,QACX,GAAIE,GAAM,WAAW,CAAA;AAAA,MAAC,CACvB,IAEC,gBAAAO,EAACC,GAAA,EAAgB,GAAIR,GAAM,WAAW,CAAA,GACnC,UAAAF,GACH;AAAA,MAIH,CAACF,KAAoBG,KAAWT,EAAeS,GAAQU,CAAa,IACjEhB,EAAM,aAAaM,GAAQ;AAAA,QAC3B,GAAGA,EAAO;AAAA,QACV,GAAIC,GAAM,UAAU,CAAA;AAAA,MAAC,CACtB,IAEC,gBAAAO,EAACE,GAAA,EAAe,GAAIT,GAAM,UAAU,CAAA,GACjC,UAAAD,EAAA,CACH;AAAA,IAAA,GAGN;AAAA,IAGH,CAACE,KAAc,gBAAAM,EAACG,GAAA,CAAA,CAAY;AAAA,EAAA,GAC/B;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AspectRatio.js","sources":["../../src/AspectRatio/AspectRatio.tsx"],"sourcesContent":["\"use client\"\
|
|
1
|
+
{"version":3,"file":"AspectRatio.js","sources":["../../src/AspectRatio/AspectRatio.tsx"],"sourcesContent":["\"use client\"\n\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\"\n\nexport const AspectRatio = AspectRatioPrimitive.Root\n"],"names":["AspectRatio","AspectRatioPrimitive"],"mappings":";AAIO,MAAMA,IAAcC,EAAqB;"}
|
package/Avatar/Avatar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../src/Avatar/Avatar.tsx"],"sourcesContent":["\"use client\"\
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../src/Avatar/Avatar.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nexport const Avatar = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\",\n className\n )}\n {...props}\n />\n))\nAvatar.displayName = AvatarPrimitive.Root.displayName\n\nexport const AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn(\"aspect-square h-full w-full\", className)}\n {...props}\n />\n))\nAvatarImage.displayName = AvatarPrimitive.Image.displayName\n\nexport const AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted\",\n className\n )}\n {...props}\n />\n))\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName\n"],"names":["Avatar","React","className","props","ref","jsx","AvatarPrimitive","cn","AvatarImage","AvatarFallback"],"mappings":";;;;AAOO,MAAMA,IAASC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAO,cAAcM,EAAgB,KAAK;AAEnC,MAAME,IAAcP,EAAM,WAG/B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG,EAAG,+BAA+BL,CAAS;AAAA,IACrD,GAAGC;AAAA,EAAA;AACN,CACD;AACDK,EAAY,cAAcF,EAAgB,MAAM;AAEzC,MAAMG,IAAiBR,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDM,EAAe,cAAcH,EAAgB,SAAS;"}
|
package/Badge/Badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../../src/Badge/Badge.tsx"],"sourcesContent":["import * as React from \"react\"\
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../src/Badge/Badge.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { badgeVariants } from './badgeVariants';\nimport { BadgeProps } from './Badge.types';\n\nimport * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nexport function Badge({\n className,\n variant,\n asChild = false,\n ...props\n }: BadgeProps) {\n const Comp = asChild ? Slot : \"span\"\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n )\n}\n\nexport default Badge\n\n"],"names":["Badge","className","variant","asChild","props","jsx","Slot","cn","badgeVariants"],"mappings":";;;;AAWO,SAASA,EAAM;AAAA,EACL,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,GAAGC;AACL,GAAe;AAG5B,SACE,gBAAAC;AAAA,IAHWF,IAAUG,IAAO;AAAA,IAG3B;AAAA,MACC,aAAU;AAAA,MACV,WAAWC,EAAGC,EAAc,EAAE,SAAAN,EAAA,CAAS,GAAGD,CAAS;AAAA,MAClD,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badgeVariants.js","sources":["../../src/Badge/badgeVariants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\
|
|
1
|
+
{"version":3,"file":"badgeVariants.js","sources":["../../src/Badge/badgeVariants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n"],"names":["badgeVariants","cva"],"mappings":";AAEO,MAAMA,IAAgBC;AAAA,EAC3B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","sources":["../../src/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\"\
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sources":["../../src/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\"\n\nimport { cn } from \"@oneplatformdev/utils\";\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n separator?: React.ReactNode\n }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />)\nBreadcrumb.displayName = \"Breadcrumb\"\n\nconst BreadcrumbList = React.forwardRef<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n))\nBreadcrumbList.displayName = \"BreadcrumbList\"\n\nconst BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n))\nBreadcrumbItem.displayName = \"BreadcrumbItem\"\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & {\n asChild?: boolean\n }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n )\n})\nBreadcrumbLink.displayName = \"BreadcrumbLink\"\n\nconst BreadcrumbPage = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n))\nBreadcrumbPage.displayName = \"BreadcrumbPage\"\n\nconst BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:w-3.5 [&>svg]:h-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n)\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\"\n\nconst BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n)\nBreadcrumbEllipsis.displayName = \"BreadcrumbElipssis\"\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n}\n"],"names":["Breadcrumb","React","props","ref","jsx","BreadcrumbList","className","cn","BreadcrumbItem","BreadcrumbLink","asChild","Slot","BreadcrumbPage","BreadcrumbSeparator","children","ChevronRight","BreadcrumbEllipsis","jsxs","MoreHorizontal"],"mappings":";;;;;AAMA,MAAMA,IAAaC,EAAM,WAKvB,CAAC,EAAE,GAAGC,EAAA,GAASC,MAAQ,gBAAAC,EAAC,SAAI,KAAAD,GAAU,cAAW,cAAc,GAAGD,GAAO,CAAE;AAC7EF,EAAW,cAAc;AAEzB,MAAMK,IAAiBJ,EAAM,WAG3B,CAAC,EAAE,WAAAK,GAAW,GAAGJ,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA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cAAc;AAElC,MAAMG,IAAqB,CAAC;AAAA,EAC1B,WAAAV;AAAA,EACA,GAAGJ;AACL,MACE,gBAAAe;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,WAAWV,EAAG,4CAA4CD,CAAS;AAAA,IAClE,GAAGJ;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE,EAACc,GAAA,EAAe,WAAU,UAAA,CAAU;AAAA,MACpC,gBAAAd,EAAC,QAAA,EAAK,WAAU,WAAU,UAAA,OAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAChC;AAEFY,EAAmB,cAAc;"}
|
package/Button/Button.js
CHANGED
|
@@ -4,8 +4,9 @@ import { isValidElement as V, createElement as j } from "react";
|
|
|
4
4
|
import { Slot as C } from "@radix-ui/react-slot";
|
|
5
5
|
import { cn as I } from "@oneplatformdev/utils";
|
|
6
6
|
import { buttonVariants as F } from "./buttonVariants.js";
|
|
7
|
-
import
|
|
7
|
+
import "@radix-ui/react-tooltip";
|
|
8
8
|
import { Tooltip as L } from "../Tooltip/Tooltip.js";
|
|
9
|
+
import { LoadedIcon as y } from "../LoadedIcon/LoadedIcon.js";
|
|
9
10
|
const S = (n) => {
|
|
10
11
|
const { variant: t, size: r, color: s } = n, e = { color: s, variant: t, size: r };
|
|
11
12
|
if (t === "default")
|