@oneplatformdev/ui 0.1.99-beta.259 → 0.1.99-beta.260
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.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 +68 -23
- package/AlertDialog/AlertDialog.stories.js.map +1 -1
- package/AlertDialog/AlertDialogRoot.js +23 -21
- 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 +11 -10
- package/Button/Button.js.map +1 -1
- package/Button/Button.stories.js.map +1 -1
- package/Button/Button.utils.js.map +1 -1
- package/Button/ButtonCounterBadge.js.map +1 -1
- package/Button/buttonVariants.js.map +1 -1
- package/ButtonIcon/ButtonIcon.js +22 -19
- package/ButtonIcon/ButtonIcon.js.map +1 -1
- package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
- package/ButtonIcon/buttonIconVariants.js.map +1 -1
- package/CHANGELOG.md +3369 -3353
- package/Calendar/Calendar.js +6 -4
- 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 +1 -0
- package/Checkbox/Checkbox.js.map +1 -1
- package/Checkbox/Checkbox.stories.js.map +1 -1
- package/Collapsible/Collapsible.js.map +1 -1
- package/Combobox/Combobox.js +10 -10
- package/Combobox/Combobox.js.map +1 -1
- package/Combobox/Combobox.stories.js.map +1 -1
- package/Combobox/Combobox.types.js.map +1 -1
- package/Combobox/ComboboxOptionItem.js +19 -18
- package/Combobox/ComboboxOptionItem.js.map +1 -1
- package/Combobox/ComboboxRenderContent.js +27 -26
- package/Combobox/ComboboxRenderContent.js.map +1 -1
- package/Combobox/ComboboxRenderOptions.js +5 -5
- package/Combobox/ComboboxRenderOptions.js.map +1 -1
- package/Combobox/ComboboxRenderTrigger.js +30 -28
- package/Combobox/ComboboxRenderTrigger.js.map +1 -1
- package/Command/Command.js +22 -21
- package/Command/Command.js.map +1 -1
- package/ContextPopover/ContextDropdownMenu.js.map +1 -1
- package/ContextPopover/ContextPopover.js.map +1 -1
- package/ContextPopover/useContextPopoverHandler.js.map +1 -1
- package/DataTable/DataTable.js +26 -24
- package/DataTable/DataTable.js.map +1 -1
- package/DataTable/DataTableColumnFilter.js +7 -6
- package/DataTable/DataTableColumnFilter.js.map +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 +21 -20
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/Dialog.stories.js +15 -14
- package/Dialog/Dialog.stories.js.map +1 -1
- package/Dialog/DialogOverlayScope.js.map +1 -1
- package/Dialog/useDialogClosePosition.js.map +1 -1
- package/Drawer/Drawer.js.map +1 -1
- package/DropdownMenu/DropdownMenu.js.map +1 -1
- package/Dropzone/Dropzone.js.map +1 -1
- package/Dropzone/Dropzone.stories.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 +7 -6
- package/Form/FormRenderControl.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/FormInput/FormInput.stories.js.map +1 -1
- package/FormRadio/FormRadio.js.map +1 -1
- package/FormSelect/FormSelect.js +9 -6
- 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/InfoBlock/InfoBlock.js.map +1 -1
- package/InfoBlock/InfoBlock.stories.js.map +1 -1
- package/InfoBlock/infoBlockVariants.js.map +1 -1
- package/Input/Input.js.map +1 -1
- package/Input/Input.stories.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 +9 -9
- 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/Switch/Switch.stories.js.map +1 -1
- package/Table/Table.js.map +1 -1
- package/TablePagination/TablePagination.js +26 -21
- package/TablePagination/TablePagination.js.map +1 -1
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/TabsRoot.js.map +1 -1
- package/Textarea/Textarea.js.map +1 -1
- package/Textarea/Textarea.stories.js.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/Tooltip/tooltipVariants.js.map +1 -1
- package/index.js +286 -286
- package/package.json +4 -4
- package/vite-env.d.ts +7 -7
|
@@ -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;"}
|
|
@@ -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,EAACE,GAAA,EAAwB,GAAGN,GAAmB,UAAAH,EAAA,CAAY;AAAA,EAAA,GA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3B,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","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,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,10 +1,13 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { AlertDialog as n } from "./AlertDialog.js";
|
|
3
|
-
import { Button as
|
|
4
|
-
|
|
3
|
+
import { Button as o } from "../Button/Button.js";
|
|
4
|
+
import "../Button/buttonVariants.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { InfoBlock as p } from "../InfoBlock/InfoBlock.js";
|
|
7
|
+
const d = (e) => /* @__PURE__ */ t(n, { ...e }), l = ["confirm", "alert", "destructive"], h = {
|
|
5
8
|
title: "AlertDialog",
|
|
6
9
|
component: n,
|
|
7
|
-
render:
|
|
10
|
+
render: d,
|
|
8
11
|
argTypes: {
|
|
9
12
|
open: {
|
|
10
13
|
control: {
|
|
@@ -14,7 +17,7 @@ const c = (e) => /* @__PURE__ */ t(n, { ...e }), r = ["confirm", "alert", "destr
|
|
|
14
17
|
variant: {
|
|
15
18
|
name: "variant",
|
|
16
19
|
description: "ButtonIcon variant",
|
|
17
|
-
options:
|
|
20
|
+
options: l,
|
|
18
21
|
control: {
|
|
19
22
|
type: "inline-radio"
|
|
20
23
|
}
|
|
@@ -45,13 +48,13 @@ const c = (e) => /* @__PURE__ */ t(n, { ...e }), r = ["confirm", "alert", "destr
|
|
|
45
48
|
cancelLabel: "Cancel",
|
|
46
49
|
actionLabel: "Action"
|
|
47
50
|
}
|
|
48
|
-
},
|
|
51
|
+
}, m = (e) => /* @__PURE__ */ t(
|
|
49
52
|
n,
|
|
50
53
|
{
|
|
51
54
|
...e
|
|
52
55
|
}
|
|
53
56
|
);
|
|
54
|
-
|
|
57
|
+
m.args = {
|
|
55
58
|
trigger: "Trigger text or ReactNode",
|
|
56
59
|
variant: "confirm",
|
|
57
60
|
title: "Dialog title...",
|
|
@@ -59,33 +62,33 @@ s.args = {
|
|
|
59
62
|
cancelLabel: "Cancel label",
|
|
60
63
|
actionLabel: "Action label"
|
|
61
64
|
};
|
|
62
|
-
const
|
|
65
|
+
const r = (e) => /* @__PURE__ */ t("div", { className: "flex gap-3", children: l.map((i) => /* @__PURE__ */ t(
|
|
63
66
|
n,
|
|
64
67
|
{
|
|
65
|
-
trigger:
|
|
68
|
+
trigger: i,
|
|
66
69
|
...e,
|
|
67
|
-
variant:
|
|
70
|
+
variant: i
|
|
68
71
|
},
|
|
69
|
-
|
|
72
|
+
i
|
|
70
73
|
)) });
|
|
71
|
-
|
|
74
|
+
r.parameters = {
|
|
72
75
|
controls: {
|
|
73
76
|
include: ["title", "description", "cancelLabel", "actionLabel"]
|
|
74
77
|
}
|
|
75
78
|
};
|
|
76
|
-
|
|
79
|
+
r.args = {
|
|
77
80
|
title: "Dialog title",
|
|
78
81
|
description: "Description text..."
|
|
79
82
|
};
|
|
80
83
|
const a = (e) => /* @__PURE__ */ t(
|
|
81
84
|
n,
|
|
82
85
|
{
|
|
83
|
-
onOpenChange: (
|
|
84
|
-
trigger: /* @__PURE__ */ t(
|
|
86
|
+
onOpenChange: (i) => console.log(i),
|
|
87
|
+
trigger: /* @__PURE__ */ t(o, { variant: "outline", children: "Control Trigger" }),
|
|
85
88
|
header: /* @__PURE__ */ t("div", { children: "Custom Header" }),
|
|
86
89
|
footer: [
|
|
87
|
-
/* @__PURE__ */ t(
|
|
88
|
-
/* @__PURE__ */ t(
|
|
90
|
+
/* @__PURE__ */ t(o, { variant: "outline", onClick: console.log, children: "On cancel" }, "cancel"),
|
|
91
|
+
/* @__PURE__ */ t(o, { variant: "outline", onClick: console.log, children: "On Action" }, "action")
|
|
89
92
|
],
|
|
90
93
|
...e
|
|
91
94
|
}
|
|
@@ -98,24 +101,66 @@ a.parameters = {
|
|
|
98
101
|
a.args = {
|
|
99
102
|
open: !1
|
|
100
103
|
};
|
|
101
|
-
const
|
|
104
|
+
const L = (e) => /* @__PURE__ */ t(
|
|
102
105
|
n,
|
|
103
106
|
{
|
|
104
|
-
trigger: /* @__PURE__ */ t(
|
|
107
|
+
trigger: /* @__PURE__ */ t(o, { variant: "outlined", children: "Full Content Trigger" }),
|
|
105
108
|
...e,
|
|
106
109
|
children: "Full Content..."
|
|
107
110
|
}
|
|
108
111
|
);
|
|
109
|
-
|
|
112
|
+
L.parameters = {
|
|
110
113
|
controls: {
|
|
111
114
|
include: []
|
|
112
115
|
}
|
|
113
116
|
};
|
|
117
|
+
const c = "a".repeat(300), s = (e) => /* @__PURE__ */ t(
|
|
118
|
+
n,
|
|
119
|
+
{
|
|
120
|
+
...e,
|
|
121
|
+
trigger: /* @__PURE__ */ t(o, { variant: "outlined", children: "Long Description" })
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
s.args = {
|
|
125
|
+
trigger: "Long description",
|
|
126
|
+
variant: "confirm",
|
|
127
|
+
title: "Dialog title",
|
|
128
|
+
description: c,
|
|
129
|
+
cancelLabel: "Cancel",
|
|
130
|
+
actionLabel: "Action"
|
|
131
|
+
};
|
|
132
|
+
s.parameters = {
|
|
133
|
+
controls: {
|
|
134
|
+
include: ["title", "cancelLabel", "actionLabel"]
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const g = (e) => /* @__PURE__ */ t(
|
|
138
|
+
n,
|
|
139
|
+
{
|
|
140
|
+
...e,
|
|
141
|
+
trigger: /* @__PURE__ */ t(o, { variant: "outlined", children: "Long InfoBlock Description" }),
|
|
142
|
+
description: /* @__PURE__ */ t(p, { content: c })
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
g.args = {
|
|
146
|
+
trigger: "Long InfoBlock description",
|
|
147
|
+
variant: "confirm",
|
|
148
|
+
title: "Dialog title",
|
|
149
|
+
cancelLabel: "Cancel",
|
|
150
|
+
actionLabel: "Action"
|
|
151
|
+
};
|
|
152
|
+
g.parameters = {
|
|
153
|
+
controls: {
|
|
154
|
+
include: ["title", "cancelLabel", "actionLabel"]
|
|
155
|
+
}
|
|
156
|
+
};
|
|
114
157
|
export {
|
|
115
|
-
|
|
158
|
+
L as FullContent,
|
|
116
159
|
a as FullControl,
|
|
117
|
-
s as
|
|
118
|
-
|
|
119
|
-
|
|
160
|
+
s as LongDescription,
|
|
161
|
+
g as LongInfoBlockDescription,
|
|
162
|
+
m as Playground,
|
|
163
|
+
r as Variants,
|
|
164
|
+
h as default
|
|
120
165
|
};
|
|
121
166
|
//# 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';\nimport { InfoBlock } from '../InfoBlock';\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=\"outlined\">Full Content Trigger</Button>}\n {...args}\n >\n Full Content...\n </AlertDialog>\n);\nFullContent.parameters = {\n controls: {\n include: [],\n },\n};\n\nconst LONG_UNBREAKABLE_STRING = 'a'.repeat(300);\n\nexport const LongDescription = (args: AlertDialogProps) => (\n <AlertDialog\n {...args}\n trigger={<Button variant=\"outlined\">Long Description</Button>}\n />\n);\nLongDescription.args = {\n trigger: 'Long description',\n variant: 'confirm',\n title: 'Dialog title',\n description: LONG_UNBREAKABLE_STRING,\n cancelLabel: 'Cancel',\n actionLabel: 'Action',\n};\nLongDescription.parameters = {\n controls: {\n include: ['title', 'cancelLabel', 'actionLabel'],\n },\n};\n\nexport const LongInfoBlockDescription = (args: AlertDialogProps) => (\n <AlertDialog\n {...args}\n trigger={<Button variant=\"outlined\">Long InfoBlock Description</Button>}\n description={\n <InfoBlock content={LONG_UNBREAKABLE_STRING} />\n }\n />\n);\nLongInfoBlockDescription.args = {\n trigger: 'Long InfoBlock description',\n variant: 'confirm',\n title: 'Dialog title',\n cancelLabel: 'Cancel',\n actionLabel: 'Action',\n};\nLongInfoBlockDescription.parameters = {\n controls: {\n include: ['title', 'cancelLabel', 'actionLabel'],\n },\n};\n"],"names":["Template","props","jsx","AlertDialog","variants","meta","Playground","args","Variants","variant","FullControl","nextState","Button","FullContent","LONG_UNBREAKABLE_STRING","LongDescription","LongInfoBlockDescription","InfoBlock"],"mappings":";;;;;;AAQA,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;AAA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AAEnD;AAEO,MAAMC,IAA2B,CAACT,MACvC,gBAAAL;AAAA,EAACC;AAAA,EAAA;AAAA,IACE,GAAGI;AAAA,IACJ,SAAS,gBAAAL,EAACU,GAAA,EAAO,SAAQ,YAAW,UAAA,8BAA0B;AAAA,IAC9D,aACE,gBAAAV,EAACe,GAAA,EAAU,SAASH,EAAA,CAAyB;AAAA,EAAA;AAEjD;AAEFE,EAAyB,OAAO;AAAA,EAC9B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa;AACf;AACAA,EAAyB,aAAa;AAAA,EACpC,UAAU;AAAA,IACR,SAAS,CAAC,SAAS,eAAe,aAAa;AAAA,EAAA;AAEnD;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
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
|
-
|
|
6
|
+
import "react";
|
|
7
|
+
function N(t) {
|
|
6
8
|
return /* @__PURE__ */ o(r.Root, { "data-slot": "alert-dialog", ...t });
|
|
7
9
|
}
|
|
8
|
-
function
|
|
10
|
+
function A(t) {
|
|
9
11
|
return /* @__PURE__ */ o(r.Trigger, { "data-slot": "alert-dialog-trigger", ...t });
|
|
10
12
|
}
|
|
11
13
|
function m(t) {
|
|
@@ -25,7 +27,7 @@ function g(t) {
|
|
|
25
27
|
}
|
|
26
28
|
);
|
|
27
29
|
}
|
|
28
|
-
function
|
|
30
|
+
function D(t) {
|
|
29
31
|
const { className: a, ...e } = t;
|
|
30
32
|
return /* @__PURE__ */ c(m, { children: [
|
|
31
33
|
/* @__PURE__ */ o(g, {}),
|
|
@@ -46,18 +48,18 @@ function A(t) {
|
|
|
46
48
|
)
|
|
47
49
|
] });
|
|
48
50
|
}
|
|
49
|
-
function
|
|
51
|
+
function h(t) {
|
|
50
52
|
const { className: a, ...e } = t;
|
|
51
53
|
return /* @__PURE__ */ o(
|
|
52
54
|
"div",
|
|
53
55
|
{
|
|
54
56
|
"data-slot": "alert-dialog-header",
|
|
55
|
-
className: l("flex flex-col gap-3 text-center sm:text-left", a),
|
|
57
|
+
className: l("flex flex-col gap-3 text-center sm:text-left min-w-0", a),
|
|
56
58
|
...e
|
|
57
59
|
}
|
|
58
60
|
);
|
|
59
61
|
}
|
|
60
|
-
function
|
|
62
|
+
function v(t) {
|
|
61
63
|
const { className: a, ...e } = t;
|
|
62
64
|
return /* @__PURE__ */ o(
|
|
63
65
|
"div",
|
|
@@ -71,18 +73,18 @@ function h(t) {
|
|
|
71
73
|
}
|
|
72
74
|
);
|
|
73
75
|
}
|
|
74
|
-
function
|
|
76
|
+
function b(t) {
|
|
75
77
|
const { className: a, ...e } = t;
|
|
76
78
|
return /* @__PURE__ */ o(
|
|
77
79
|
r.Title,
|
|
78
80
|
{
|
|
79
81
|
"data-slot": "alert-dialog-title",
|
|
80
|
-
className: l("text-lg font-semibold break-words min-h-10 flex items-center", a),
|
|
82
|
+
className: l("min-w-0 text-lg font-semibold break-words min-h-10 flex items-center", a),
|
|
81
83
|
...e
|
|
82
84
|
}
|
|
83
85
|
);
|
|
84
86
|
}
|
|
85
|
-
function
|
|
87
|
+
function y(t) {
|
|
86
88
|
const { className: a, children: e, ...s } = t;
|
|
87
89
|
return /* @__PURE__ */ o(
|
|
88
90
|
r.Description,
|
|
@@ -90,11 +92,11 @@ function w(t) {
|
|
|
90
92
|
...s,
|
|
91
93
|
asChild: !0,
|
|
92
94
|
"data-slot": "alert-dialog-description",
|
|
93
|
-
children: /* @__PURE__ */ o("div", { className: l("text-muted-foreground text-sm whitespace-pre-wrap
|
|
95
|
+
children: /* @__PURE__ */ o("div", { className: l("min-w-0 text-muted-foreground text-sm whitespace-pre-wrap [overflow-wrap:anywhere]", a), children: e })
|
|
94
96
|
}
|
|
95
97
|
);
|
|
96
98
|
}
|
|
97
|
-
function
|
|
99
|
+
function z(t) {
|
|
98
100
|
const { className: a, variant: e, size: s, color: n, ...i } = t;
|
|
99
101
|
return /* @__PURE__ */ o(
|
|
100
102
|
r.Action,
|
|
@@ -104,7 +106,7 @@ function b(t) {
|
|
|
104
106
|
}
|
|
105
107
|
);
|
|
106
108
|
}
|
|
107
|
-
function
|
|
109
|
+
function C(t) {
|
|
108
110
|
const { className: a, variant: e, color: s = "secondary", size: n, ...i } = t;
|
|
109
111
|
return /* @__PURE__ */ o(
|
|
110
112
|
r.Cancel,
|
|
@@ -115,17 +117,17 @@ function y(t) {
|
|
|
115
117
|
);
|
|
116
118
|
}
|
|
117
119
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
z as AlertDialogAction,
|
|
121
|
+
C as AlertDialogCancel,
|
|
122
|
+
D as AlertDialogContent,
|
|
123
|
+
y as AlertDialogDescription,
|
|
124
|
+
v as AlertDialogFooter,
|
|
125
|
+
h as AlertDialogHeader,
|
|
124
126
|
g as AlertDialogOverlay,
|
|
125
127
|
m as AlertDialogPortal,
|
|
126
128
|
r as AlertDialogPrimitive,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
N as AlertDialogRoot,
|
|
130
|
+
b as AlertDialogTitle,
|
|
131
|
+
A as AlertDialogTrigger
|
|
130
132
|
};
|
|
131
133
|
//# 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}\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-md min-h-10 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-3 text-center sm:text-left min-w-0\", 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}\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(\"min-w-0 text-lg font-semibold break-words min-h-10 flex items-center\", className)}\n {...rest}\n />\n )\n}\n\nfunction AlertDialogDescription(props: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n const { className, children, ...rest } = props;\n return (\n <AlertDialogPrimitive.Description\n {...rest}\n asChild\n data-slot=\"alert-dialog-description\"\n >\n <div className={cn(\"min-w-0 text-muted-foreground text-sm whitespace-pre-wrap [overflow-wrap:anywhere]\", className)}>\n {children}\n </div>\n </AlertDialogPrimitive.Description>\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}\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","children","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;AAEA,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,MACC,aAAU;AAAA,MACV,WAAWO;AAAA,QACT;AAAA,QACAF;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASE,EAAmBT,GAAkE;AAC5F,QAAM,EAAE,WAAAM,GAAW,GAAGC,EAAA,IAASP;AAC/B,2BACGG,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAkB;AAAA,IACnB,gBAAAD;AAAA,MAACH,EAAqB;AAAA,MAArB;AAAA,QACC,aAAU;AAAA,QACV,WAAWO;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACAF;AAAA,QAAA;AAAA,QAED,GAAGC;AAAA,MAAA;AAAA,IAAA;AAAA,EACN,GACF;AAEJ;AAGA,SAASG,EAAkBV,GAAoC;AAC7D,QAAM,EAAE,WAAAM,GAAW,GAAGC,EAAA,IAASP;AAC/B,SACE,gBAAA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EA,SAASa,EAAkBpB,GAA+E;AACxG,QAAM,EAAE,WAAAM,GAAW,SAAAU,GAAS,OAAAE,IAAQ,aAAa,MAAAD,GAAM,GAAGV,MAASP;AACnE,SACE,gBAAAI;AAAA,IAACH,EAAqB;AAAA,IAArB;AAAA,MACC,WAAWO,EAAGW,EAAe,EAAE,SAAAH,GAAS,MAAAC,GAAM,OAAAC,EAAA,CAAO,GAAGZ,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;"}
|