@customafk/lunas-ui 0.2.7 → 0.2.9
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/dist/{alert-DIC1_ymv.cjs → alert-BqJVf4wD.cjs} +1 -1
- package/dist/{alert-DIC1_ymv.cjs.map → alert-BqJVf4wD.cjs.map} +1 -1
- package/dist/{alert-CA1RS1CG.d.cts → alert-D3OOxNtK.d.mts} +6 -6
- package/dist/{alert-VP3giy31.mjs → alert-DQHE-pdI.mjs} +1 -1
- package/dist/{alert-VP3giy31.mjs.map → alert-DQHE-pdI.mjs.map} +1 -1
- package/dist/{alert-DDL82_U3.d.mts → alert-W_Q1Gsld.d.cts} +7 -7
- package/dist/{badge-BFTGDsBm.d.cts → badge-Dm1IEgtT.d.cts} +5 -5
- package/dist/{badge-Cg0e-djv.d.mts → badge-YFen8D8o.d.mts} +5 -5
- package/dist/{button-C76drZpd.d.mts → button-BnbtzQAN.d.mts} +5 -5
- package/dist/{button-Bn54lPVz.d.cts → button-Ckjev2AT.d.cts} +3 -3
- package/dist/{calendar-CyAPpT2m.cjs → calendar-B2V4Lv0T.cjs} +1 -1
- package/dist/{calendar-CyAPpT2m.cjs.map → calendar-B2V4Lv0T.cjs.map} +1 -1
- package/dist/{calendar-JKxWM6AF.mjs → calendar-Cw1G0sVL.mjs} +1 -1
- package/dist/{calendar-JKxWM6AF.mjs.map → calendar-Cw1G0sVL.mjs.map} +1 -1
- package/dist/{checkbox-RZrRNYP2.cjs → checkbox-Di7ACavC.cjs} +1 -1
- package/dist/{checkbox-RZrRNYP2.cjs.map → checkbox-Di7ACavC.cjs.map} +1 -1
- package/dist/{checkbox-DJEdYOjA.mjs → checkbox-Dzo6oI4y.mjs} +1 -1
- package/dist/{checkbox-DJEdYOjA.mjs.map → checkbox-Dzo6oI4y.mjs.map} +1 -1
- package/dist/{cms-layout-HfnOQS16.mjs → cms-layout-Bp6rU_of.mjs} +2 -2
- package/dist/{cms-layout-HfnOQS16.mjs.map → cms-layout-Bp6rU_of.mjs.map} +1 -1
- package/dist/{cms-layout-Dc4moos1.cjs → cms-layout-r9TmK6hi.cjs} +2 -2
- package/dist/{cms-layout-Dc4moos1.cjs.map → cms-layout-r9TmK6hi.cjs.map} +1 -1
- package/dist/data-display/country.d.mts +1 -1
- package/dist/data-display/role-badge.d.mts +1 -1
- package/dist/data-display/statistic.d.cts +2 -2
- package/dist/data-display/statistic.d.mts +4 -4
- package/dist/{dialog-D6ygAOSV.d.mts → dialog-DTtlGouy.d.mts} +12 -12
- package/dist/{dialog-CNhwBcEl.d.cts → dialog-DW1Axqio.d.cts} +12 -12
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +26 -26
- package/dist/features/descriptions/index.d.cts +1 -1
- package/dist/features/descriptions/index.d.mts +1 -1
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/search-modal/index.d.mts +2 -2
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.d.cts +156 -6
- package/dist/features/tables/index.d.mts +157 -7
- package/dist/features/tables/index.mjs +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.d.cts +1 -1
- package/dist/features/tanstack-form/index.d.mts +1 -1
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/{field-CppNvoxV.cjs → field-C51eJ6QN.cjs} +2 -2
- package/dist/{field-CppNvoxV.cjs.map → field-C51eJ6QN.cjs.map} +1 -1
- package/dist/{field-CXVnw75a.mjs → field-DfsTE4Ie.mjs} +2 -2
- package/dist/{field-CXVnw75a.mjs.map → field-DfsTE4Ie.mjs.map} +1 -1
- package/dist/{index-75nSAiSe.d.mts → index-BIT9bkka.d.mts} +106 -106
- package/dist/{index-aTMCQQms.d.cts → index-CO4_ENw7.d.cts} +291 -291
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +1 -1
- package/dist/{input-Cd0G5y-9.mjs → input-6f9JTc79.mjs} +1 -1
- package/dist/{input-Cd0G5y-9.mjs.map → input-6f9JTc79.mjs.map} +1 -1
- package/dist/{input-Cl5VkKQh.cjs → input-BMOYFJYM.cjs} +1 -1
- package/dist/{input-Cl5VkKQh.cjs.map → input-BMOYFJYM.cjs.map} +1 -1
- package/dist/{input-D5dtkW6g.d.mts → input-BrM6EExy.d.mts} +6 -6
- package/dist/{input-t2hpPP2K.d.cts → input-CigimPoX.d.cts} +4 -4
- package/dist/{label-OmlGaZ5h.mjs → label-3vAlNtF9.mjs} +1 -1
- package/dist/{label-OmlGaZ5h.mjs.map → label-3vAlNtF9.mjs.map} +1 -1
- package/dist/{label-DkMTQ3Ch.cjs → label-zyBJYydC.cjs} +1 -1
- package/dist/{label-DkMTQ3Ch.cjs.map → label-zyBJYydC.cjs.map} +1 -1
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/cms-layout/index.mjs +1 -1
- package/dist/layouts/flex.d.cts +4 -4
- package/dist/layouts/flex.d.mts +4 -4
- package/dist/layouts/payment-layout/index.cjs +1 -1
- package/dist/layouts/payment-layout/index.mjs +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.mts +2 -2
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/{payment-layout-Da29dHJe.cjs → payment-layout-C9pP5HdT.cjs} +1 -1
- package/dist/{payment-layout-Da29dHJe.cjs.map → payment-layout-C9pP5HdT.cjs.map} +1 -1
- package/dist/{payment-layout-wN5c7MCM.mjs → payment-layout-D-69gOPJ.mjs} +1 -1
- package/dist/{payment-layout-wN5c7MCM.mjs.map → payment-layout-D-69gOPJ.mjs.map} +1 -1
- package/dist/{popover-OJXFbqJi.mjs → popover-BFJhuzW3.mjs} +1 -1
- package/dist/{popover-OJXFbqJi.mjs.map → popover-BFJhuzW3.mjs.map} +1 -1
- package/dist/{popover-AEt-aSy3.cjs → popover-CmoqhK17.cjs} +1 -1
- package/dist/{popover-AEt-aSy3.cjs.map → popover-CmoqhK17.cjs.map} +1 -1
- package/dist/progress-0cpDwgAJ.mjs +2 -0
- package/dist/progress-0cpDwgAJ.mjs.map +1 -0
- package/dist/progress-DE1FdQ1J.cjs +2 -0
- package/dist/progress-DE1FdQ1J.cjs.map +1 -0
- package/dist/{radio-group-CAgfOr7-.mjs → radio-group-D5OurBIG.mjs} +1 -1
- package/dist/{radio-group-CAgfOr7-.mjs.map → radio-group-D5OurBIG.mjs.map} +1 -1
- package/dist/{radio-group-BWLdQw7M.cjs → radio-group-DAv2EU3F.cjs} +1 -1
- package/dist/{radio-group-BWLdQw7M.cjs.map → radio-group-DAv2EU3F.cjs.map} +1 -1
- package/dist/{resizable-DWh_mp5P.mjs → resizable-C2Zl-iLF.mjs} +1 -1
- package/dist/{resizable-DWh_mp5P.mjs.map → resizable-C2Zl-iLF.mjs.map} +1 -1
- package/dist/{resizable-D6UKwvFa.cjs → resizable-DDPMwd28.cjs} +1 -1
- package/dist/{resizable-D6UKwvFa.cjs.map → resizable-DDPMwd28.cjs.map} +1 -1
- package/dist/{select-Ze8Fq88G.mjs → select-DRCKwnTV.mjs} +1 -1
- package/dist/{select-Ze8Fq88G.mjs.map → select-DRCKwnTV.mjs.map} +1 -1
- package/dist/{select-Py_t2nX1.cjs → select-DfvSMRUq.cjs} +1 -1
- package/dist/{select-Py_t2nX1.cjs.map → select-DfvSMRUq.cjs.map} +1 -1
- package/dist/{spinner-EgMJOaQi.mjs → spinner-B3F9W53l.mjs} +1 -1
- package/dist/{spinner-EgMJOaQi.mjs.map → spinner-B3F9W53l.mjs.map} +1 -1
- package/dist/{spinner-MKXqwF9G.cjs → spinner-rA8pMY6v.cjs} +1 -1
- package/dist/{spinner-MKXqwF9G.cjs.map → spinner-rA8pMY6v.cjs.map} +1 -1
- package/dist/tables-D1JyNmcV.cjs +2 -0
- package/dist/tables-D1JyNmcV.cjs.map +1 -0
- package/dist/tables-DTazQIyy.mjs +2 -0
- package/dist/tables-DTazQIyy.mjs.map +1 -0
- package/dist/{tanstack-form-BmV2BXDz.cjs → tanstack-form-Bb9JXuEq.cjs} +2 -2
- package/dist/{tanstack-form-BmV2BXDz.cjs.map → tanstack-form-Bb9JXuEq.cjs.map} +1 -1
- package/dist/{tanstack-form-CJ43hVb_.mjs → tanstack-form-BwyHENeF.mjs} +2 -2
- package/dist/{tanstack-form-CJ43hVb_.mjs.map → tanstack-form-BwyHENeF.mjs.map} +1 -1
- package/dist/{textarea-CdGSEkZB.mjs → textarea-5RD9ToTV.mjs} +1 -1
- package/dist/{textarea-CdGSEkZB.mjs.map → textarea-5RD9ToTV.mjs.map} +1 -1
- package/dist/{textarea-BsgmN4jy.cjs → textarea-CvoBIPlJ.cjs} +1 -1
- package/dist/{textarea-BsgmN4jy.cjs.map → textarea-CvoBIPlJ.cjs.map} +1 -1
- package/dist/{types-B_32Ieia.d.mts → types-CkRjAQZ2.d.mts} +1 -1
- package/dist/typography/paragraph.d.cts +4 -4
- package/dist/typography/paragraph.d.mts +4 -4
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.mts +2 -2
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.cjs +1 -1
- package/dist/ui/alert.d.cts +1 -1
- package/dist/ui/alert.d.mts +1 -1
- package/dist/ui/alert.mjs +1 -1
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/badge.d.cts +1 -1
- package/dist/ui/badge.d.mts +1 -1
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.d.cts +6 -6
- package/dist/ui/button-group.d.mts +6 -6
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/calendar.cjs +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/calendar.mjs +1 -1
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/checkbox.cjs +1 -1
- package/dist/ui/checkbox.d.cts +2 -2
- package/dist/ui/checkbox.d.mts +2 -2
- package/dist/ui/checkbox.mjs +1 -1
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.mts +4 -4
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.mts +11 -11
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/empty.d.cts +7 -7
- package/dist/ui/empty.d.mts +9 -9
- package/dist/ui/field.cjs +1 -1
- package/dist/ui/field.d.cts +24 -24
- package/dist/ui/field.d.mts +24 -24
- package/dist/ui/field.mjs +1 -1
- package/dist/ui/file-uploader.cjs +2 -2
- package/dist/ui/file-uploader.cjs.map +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/file-uploader.mjs +1 -1
- package/dist/ui/file-uploader.mjs.map +1 -1
- package/dist/ui/form.cjs +1 -1
- package/dist/ui/form.d.cts +11 -11
- package/dist/ui/form.d.mts +11 -11
- package/dist/ui/form.mjs +1 -1
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.mts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.mts +5 -5
- package/dist/ui/input.cjs +1 -1
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/input.mjs +1 -1
- package/dist/ui/inputs/search-input.cjs +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +3 -3
- package/dist/ui/inputs/search-input.mjs +1 -1
- package/dist/ui/item.d.cts +14 -14
- package/dist/ui/item.d.mts +11 -11
- package/dist/ui/label.cjs +1 -1
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/label.mjs +1 -1
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +3 -3
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.mts +9 -9
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/popover.cjs +1 -1
- package/dist/ui/popover.d.cts +6 -6
- package/dist/ui/popover.d.mts +6 -6
- package/dist/ui/popover.mjs +1 -1
- package/dist/ui/progress.cjs +1 -2
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/progress.mjs +1 -2
- package/dist/ui/radio-group.cjs +1 -1
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/radio-group.mjs +1 -1
- package/dist/ui/resizable.cjs +1 -1
- package/dist/ui/resizable.d.cts +9 -9
- package/dist/ui/resizable.d.mts +9 -9
- package/dist/ui/resizable.mjs +1 -1
- package/dist/ui/scroll-area.d.cts +6 -6
- package/dist/ui/scroll-area.d.mts +6 -6
- package/dist/ui/select.cjs +1 -1
- package/dist/ui/select.d.cts +9 -9
- package/dist/ui/select.d.mts +9 -9
- package/dist/ui/select.mjs +1 -1
- package/dist/ui/separator.d.cts +2 -2
- package/dist/ui/separator.d.mts +2 -2
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sidebar.cjs +1 -1
- package/dist/ui/sidebar.d.cts +28 -28
- package/dist/ui/sidebar.d.mts +26 -26
- package/dist/ui/sidebar.mjs +1 -1
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.mts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.mts +2 -2
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.mts +2 -2
- package/dist/ui/spinner.cjs +1 -1
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.mts +2 -2
- package/dist/ui/spinner.mjs +1 -1
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.mts +2 -2
- package/dist/ui/table.d.cts +18 -18
- package/dist/ui/table.d.mts +9 -9
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.mts +5 -5
- package/dist/ui/textarea.cjs +1 -1
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/textarea.mjs +1 -1
- package/dist/ui/toggle-group.d.cts +3 -3
- package/dist/ui/toggle-group.d.mts +3 -3
- package/dist/ui/toggle.d.cts +4 -4
- package/dist/ui/toggle.d.mts +2 -2
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.d.mts +5 -5
- package/package.json +1 -1
- package/dist/tables-Cc3Wik4i.cjs +0 -2
- package/dist/tables-Cc3Wik4i.cjs.map +0 -1
- package/dist/tables-DrJKQPsT.mjs +0 -2
- package/dist/tables-DrJKQPsT.mjs.map +0 -1
- package/dist/ui/progress.cjs.map +0 -1
- package/dist/ui/progress.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-
|
|
1
|
+
{"version":3,"file":"popover-BFJhuzW3.mjs","names":["Popover","PopoverPrimitive"],"sources":["../packages/components/ui/popover.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { CloseButton } from './buttons/close';\n\n/**\n * Floating panel built on Radix UI's Popover primitives, anchored to a trigger element with animated open/close transitions.\n *\n * @example\n * ```tsx\n * import {\n * Popover, PopoverTrigger, PopoverContent, PopoverClose,\n * } from '@customafk/lunas-ui/ui/popover';\n * import { Button } from '@customafk/lunas-ui/ui/button';\n *\n * <Popover>\n * <PopoverTrigger asChild>\n * <Button variant=\"outline\">Open popover</Button>\n * </PopoverTrigger>\n * <PopoverContent>\n * <PopoverClose />\n * <p>Popover body content goes here.</p>\n * </PopoverContent>\n * </Popover>\n * ```\n */\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\n/** Element that opens or closes the popover on click; use `asChild` to render a custom trigger element. */\nfunction PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\n/** Floating content panel rendered in a portal, matching the trigger width and animated on open/close. */\nfunction PopoverContent({ className, align = 'start', sideOffset = 4, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'relative bg-popover',\n 'text-text-positive',\n 'z-50',\n 'min-w-(--radix-popover-trigger-width)',\n 'max-h-(--radix-popover-content-available-height)',\n 'origin-(--radix-popover-content-transform-origin)',\n 'rounded-md p-4 shadow-dropdown outline-none',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=closed]:zoom-out-95',\n\n 'data-[side=bottom]:slide-in-from-top-2',\n 'data-[side=left]:slide-in-from-right-2',\n 'data-[side=right]:slide-in-from-left-2',\n 'data-[side=top]:slide-in-from-bottom-2',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\n/** Optional anchor element that overrides the trigger as the popover's positioning reference point. */\nfunction PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\n/** Close button pre-positioned at the top-right corner of `PopoverContent` using the shared `CloseButton` primitive. */\nfunction PopoverClose({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Close>) {\n return (\n <PopoverPrimitive.Close data-slot=\"popover-close\" {...props} asChild>\n <CloseButton className=\"absolute top-2 right-2\" />\n </PopoverPrimitive.Close>\n );\n}\n\nexport { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PopoverClose };\n"],"mappings":"wKA4BA,SAASA,EAAQ,CAAE,GAAG,GAA6D,CACjF,OAAO,EAACC,EAAiB,KAAA,CAAK,YAAU,UAAU,GAAI,GAAS,CAIjE,SAAS,EAAe,CAAE,GAAG,GAAgE,CAC3F,OAAO,EAACA,EAAiB,QAAA,CAAQ,YAAU,kBAAkB,GAAI,GAAS,CAI5E,SAAS,EAAe,CAAE,YAAW,QAAQ,QAAS,aAAa,EAAG,GAAG,GAAgE,CACvI,OACE,EAACA,EAAiB,OAAA,CAAA,SAChB,EAACA,EAAiB,QAAA,CAChB,YAAU,kBACH,QACK,aACZ,UAAW,EACT,sBACA,qBACA,OACA,wCACA,mDACA,oDACA,8CAEA,+BACA,8BACA,+BAEA,kCACA,iCACA,kCAEA,yCACA,yCACA,yCACA,yCACA,EACD,CACD,GAAI,GACJ,CAAA,CACsB,CAK9B,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAACA,EAAiB,OAAA,CAAO,YAAU,iBAAiB,GAAI,GAAS,CAI1E,SAAS,EAAa,CAAE,YAAW,GAAG,GAA8D,CAClG,OACE,EAACA,EAAiB,MAAA,CAAM,YAAU,gBAAgB,GAAI,EAAO,QAAA,YAC3D,EAAC,EAAA,CAAY,UAAU,yBAAA,CAA2B,EAC3B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./close-DXk_H3Gt.cjs`);let n=require(`react/jsx-runtime`),r=require(`@customafk/react-toolkit/utils`),i=require(`radix-ui`);function a({...e}){return(0,n.jsx)(i.Popover.Root,{"data-slot":`popover`,...e})}function o({...e}){return(0,n.jsx)(i.Popover.Trigger,{"data-slot":`popover-trigger`,...e})}function s({className:e,align:t=`start`,sideOffset:a=4,...o}){return(0,n.jsx)(i.Popover.Portal,{children:(0,n.jsx)(i.Popover.Content,{"data-slot":`popover-content`,align:t,sideOffset:a,className:(0,r.cn)(`relative bg-popover`,`text-text-positive`,`z-50`,`min-w-(--radix-popover-trigger-width)`,`max-h-(--radix-popover-content-available-height)`,`origin-(--radix-popover-content-transform-origin)`,`rounded-md p-4 shadow-dropdown outline-none`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in-0`,`data-[state=open]:zoom-in-95`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0`,`data-[state=closed]:zoom-out-95`,`data-[side=bottom]:slide-in-from-top-2`,`data-[side=left]:slide-in-from-right-2`,`data-[side=right]:slide-in-from-left-2`,`data-[side=top]:slide-in-from-bottom-2`,e),...o})})}function c({...e}){return(0,n.jsx)(i.Popover.Anchor,{"data-slot":`popover-anchor`,...e})}function l({className:e,...r}){return(0,n.jsx)(i.Popover.Close,{"data-slot":`popover-close`,...r,asChild:!0,children:(0,n.jsx)(t.t,{className:`absolute top-2 right-2`})})}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
2
|
-
//# sourceMappingURL=popover-
|
|
2
|
+
//# sourceMappingURL=popover-CmoqhK17.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-
|
|
1
|
+
{"version":3,"file":"popover-CmoqhK17.cjs","names":["PopoverPrimitive","CloseButton"],"sources":["../packages/components/ui/popover.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { CloseButton } from './buttons/close';\n\n/**\n * Floating panel built on Radix UI's Popover primitives, anchored to a trigger element with animated open/close transitions.\n *\n * @example\n * ```tsx\n * import {\n * Popover, PopoverTrigger, PopoverContent, PopoverClose,\n * } from '@customafk/lunas-ui/ui/popover';\n * import { Button } from '@customafk/lunas-ui/ui/button';\n *\n * <Popover>\n * <PopoverTrigger asChild>\n * <Button variant=\"outline\">Open popover</Button>\n * </PopoverTrigger>\n * <PopoverContent>\n * <PopoverClose />\n * <p>Popover body content goes here.</p>\n * </PopoverContent>\n * </Popover>\n * ```\n */\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\n/** Element that opens or closes the popover on click; use `asChild` to render a custom trigger element. */\nfunction PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\n/** Floating content panel rendered in a portal, matching the trigger width and animated on open/close. */\nfunction PopoverContent({ className, align = 'start', sideOffset = 4, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'relative bg-popover',\n 'text-text-positive',\n 'z-50',\n 'min-w-(--radix-popover-trigger-width)',\n 'max-h-(--radix-popover-content-available-height)',\n 'origin-(--radix-popover-content-transform-origin)',\n 'rounded-md p-4 shadow-dropdown outline-none',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=closed]:zoom-out-95',\n\n 'data-[side=bottom]:slide-in-from-top-2',\n 'data-[side=left]:slide-in-from-right-2',\n 'data-[side=right]:slide-in-from-left-2',\n 'data-[side=top]:slide-in-from-bottom-2',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\n/** Optional anchor element that overrides the trigger as the popover's positioning reference point. */\nfunction PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\n/** Close button pre-positioned at the top-right corner of `PopoverContent` using the shared `CloseButton` primitive. */\nfunction PopoverClose({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Close>) {\n return (\n <PopoverPrimitive.Close data-slot=\"popover-close\" {...props} asChild>\n <CloseButton className=\"absolute top-2 right-2\" />\n </PopoverPrimitive.Close>\n );\n}\n\nexport { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PopoverClose };\n"],"mappings":"+KA4BA,SAAS,EAAQ,CAAE,GAAG,GAA6D,CACjF,OAAO,EAAA,EAAA,KAACA,EAAAA,QAAiB,KAAA,CAAK,YAAU,UAAU,GAAI,GAAS,CAIjE,SAAS,EAAe,CAAE,GAAG,GAAgE,CAC3F,OAAO,EAAA,EAAA,KAACA,EAAAA,QAAiB,QAAA,CAAQ,YAAU,kBAAkB,GAAI,GAAS,CAI5E,SAAS,EAAe,CAAE,YAAW,QAAQ,QAAS,aAAa,EAAG,GAAG,GAAgE,CACvI,OACE,EAAA,EAAA,KAACA,EAAAA,QAAiB,OAAA,CAAA,UAChB,EAAA,EAAA,KAACA,EAAAA,QAAiB,QAAA,CAChB,YAAU,kBACH,QACK,aACZ,WAAA,EAAA,EAAA,IACE,sBACA,qBACA,OACA,wCACA,mDACA,oDACA,8CAEA,+BACA,8BACA,+BAEA,kCACA,iCACA,kCAEA,yCACA,yCACA,yCACA,yCACA,EACD,CACD,GAAI,GACJ,CAAA,CACsB,CAK9B,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAAA,EAAA,KAACA,EAAAA,QAAiB,OAAA,CAAO,YAAU,iBAAiB,GAAI,GAAS,CAI1E,SAAS,EAAa,CAAE,YAAW,GAAG,GAA8D,CAClG,OACE,EAAA,EAAA,KAACA,EAAAA,QAAiB,MAAA,CAAM,YAAU,gBAAgB,GAAI,EAAO,QAAA,aAC3D,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAY,UAAU,yBAAA,CAA2B,EAC3B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{cn as t}from"@customafk/react-toolkit/utils";import{Progress as n}from"radix-ui";function r({className:r,value:i,...a}){return e(n.Root,{"data-slot":`progress`,className:t(`bg-primary-weak relative h-2 w-full overflow-hidden rounded-full`,r),...a,children:e(n.Indicator,{"data-slot":`progress-indicator`,className:`bg-primary size-full flex-1 transition-all`,style:{transform:`translateX(-${100-(i||0)}%)`}})})}export{r as t};
|
|
2
|
+
//# sourceMappingURL=progress-0cpDwgAJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-0cpDwgAJ.mjs","names":["Progress","ProgressPrimitive"],"sources":["../packages/components/ui/progress.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress as ProgressPrimitive } from 'radix-ui';\n\n/**\n * A horizontal progress bar that visually represents a completion percentage.\n *\n * @example\n * ```tsx\n * import { Progress } from '@customafk/lunas-ui/ui/progress';\n *\n * <Progress value={65} />\n * ```\n */\nfunction Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>) {\n return (\n <ProgressPrimitive.Root data-slot=\"progress\" className={cn('bg-primary-weak relative h-2 w-full overflow-hidden rounded-full', className)} {...props}>\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className=\"bg-primary size-full flex-1 transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n}\n\nexport { Progress };\n"],"mappings":"gIAeA,SAASA,EAAS,CAAE,YAAW,QAAO,GAAG,GAA8D,CACrG,OACE,EAACC,EAAkB,KAAA,CAAK,YAAU,WAAW,UAAW,EAAG,mEAAoE,EAAU,CAAE,GAAI,WAC7I,EAACA,EAAkB,UAAA,CACjB,YAAU,qBACV,UAAU,6CACV,MAAO,CAAE,UAAW,eAAe,KAAO,GAAS,GAAG,IAAK,EAC3D,EACqB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`react/jsx-runtime`),n=require(`@customafk/react-toolkit/utils`),r=require(`radix-ui`);function i({className:e,value:i,...a}){return(0,t.jsx)(r.Progress.Root,{"data-slot":`progress`,className:(0,n.cn)(`bg-primary-weak relative h-2 w-full overflow-hidden rounded-full`,e),...a,children:(0,t.jsx)(r.Progress.Indicator,{"data-slot":`progress-indicator`,className:`bg-primary size-full flex-1 transition-all`,style:{transform:`translateX(-${100-(i||0)}%)`}})})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
|
2
|
+
//# sourceMappingURL=progress-DE1FdQ1J.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-DE1FdQ1J.cjs","names":["ProgressPrimitive"],"sources":["../packages/components/ui/progress.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress as ProgressPrimitive } from 'radix-ui';\n\n/**\n * A horizontal progress bar that visually represents a completion percentage.\n *\n * @example\n * ```tsx\n * import { Progress } from '@customafk/lunas-ui/ui/progress';\n *\n * <Progress value={65} />\n * ```\n */\nfunction Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>) {\n return (\n <ProgressPrimitive.Root data-slot=\"progress\" className={cn('bg-primary-weak relative h-2 w-full overflow-hidden rounded-full', className)} {...props}>\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className=\"bg-primary size-full flex-1 transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n}\n\nexport { Progress };\n"],"mappings":"6IAeA,SAAS,EAAS,CAAE,YAAW,QAAO,GAAG,GAA8D,CACrG,OACE,EAAA,EAAA,KAACA,EAAAA,SAAkB,KAAA,CAAK,YAAU,WAAW,WAAA,EAAA,EAAA,IAAc,mEAAoE,EAAU,CAAE,GAAI,YAC7I,EAAA,EAAA,KAACA,EAAAA,SAAkB,UAAA,CACjB,YAAU,qBACV,UAAU,6CACV,MAAO,CAAE,UAAW,eAAe,KAAO,GAAS,GAAG,IAAK,EAC3D,EACqB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{CircleIcon as e}from"lucide-react";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{cn as r}from"@customafk/react-toolkit/utils";import{RadioGroup as i}from"radix-ui";function a({className:e,...n}){return t(i.Root,{"data-slot":`radio-group`,className:r(`grid gap-3`,e),...n})}function o({className:a,...o}){return t(i.Item,{"data-slot":`radio-group-item`,className:r(`aspect-square size-4 shrink-0 rounded-full border border-border shadow-xs outline-none transition-all`,`disabled:cursor-not-allowed disabled:opacity-50`,`focus:border-border focus:ring-4 focus:ring-primary-weak`,`aria-invalid:border-danger-strong aria-invalid:ring-danger-weak`,`aria-readonly:pointer-events-none`,`aria-readonly:[&_div]:bg-muted`,`aria-readonly:[&_svg]:fill-muted-weak`,`aria-readonly:[&_svg]:text-muted-weak`,a),...o,children:n(i.Indicator,{"data-slot":`radio-group-indicator`,className:`relative flex items-center justify-center bg-primary`,children:[t(`div`,{className:`absolute size-4 rounded-full bg-primary`}),t(e,{className:`-translate-1/2 absolute top-1/2 left-1/2 size-2 fill-text-negative-strong text-text-negative`})]})})}export{o as n,a as t};
|
|
2
|
-
//# sourceMappingURL=radio-group-
|
|
2
|
+
//# sourceMappingURL=radio-group-D5OurBIG.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-
|
|
1
|
+
{"version":3,"file":"radio-group-D5OurBIG.mjs","names":["RadioGroup","RadioGroupPrimitive"],"sources":["../packages/components/ui/radio-group.tsx"],"sourcesContent":["'use client';\n\nimport { CircleIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\n\n/**\n * Accessible radio button group built on Radix UI's RadioGroup primitive, where only one option can be selected at a time.\n *\n * @example\n * ```tsx\n * import { RadioGroup, RadioGroupItem } from '@customafk/lunas-ui/ui/radio-group';\n * import { Label } from '@customafk/lunas-ui/ui/label';\n *\n * <RadioGroup defaultValue=\"monthly\">\n * <div className=\"flex items-center gap-2\">\n * <RadioGroupItem value=\"monthly\" id=\"monthly\" />\n * <Label htmlFor=\"monthly\">Monthly</Label>\n * </div>\n * <div className=\"flex items-center gap-2\">\n * <RadioGroupItem value=\"annually\" id=\"annually\" />\n * <Label htmlFor=\"annually\">Annually</Label>\n * </div>\n * </RadioGroup>\n * ```\n */\nfunction RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {\n return <RadioGroupPrimitive.Root data-slot=\"radio-group\" className={cn('grid gap-3', className)} {...props} />;\n}\n\n/** Individual radio button within a `RadioGroup`; shows a filled circle indicator when selected. */\nfunction RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item\n data-slot=\"radio-group-item\"\n className={cn(\n 'aspect-square size-4 shrink-0 rounded-full border border-border shadow-xs outline-none transition-all',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'focus:border-border focus:ring-4 focus:ring-primary-weak',\n 'aria-invalid:border-danger-strong aria-invalid:ring-danger-weak',\n 'aria-readonly:pointer-events-none',\n 'aria-readonly:[&_div]:bg-muted',\n 'aria-readonly:[&_svg]:fill-muted-weak',\n 'aria-readonly:[&_svg]:text-muted-weak',\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator data-slot=\"radio-group-indicator\" className=\"relative flex items-center justify-center bg-primary\">\n <div className=\"absolute size-4 rounded-full bg-primary\" />\n <CircleIcon className=\"-translate-1/2 absolute top-1/2 left-1/2 size-2 fill-text-negative-strong text-text-negative\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n"],"mappings":"sLA4BA,SAASA,EAAW,CAAE,YAAW,GAAG,GAAgE,CAClG,OAAO,EAACC,EAAoB,KAAA,CAAK,YAAU,cAAc,UAAW,EAAG,aAAc,EAAU,CAAE,GAAI,GAAS,CAIhH,SAAS,EAAe,CAAE,YAAW,GAAG,GAAgE,CACtG,OACE,EAACA,EAAoB,KAAA,CACnB,YAAU,mBACV,UAAW,EACT,wGACA,kDACA,2DACA,kEACA,oCACA,iCACA,wCACA,wCACA,EACD,CACD,GAAI,WAEJ,EAACA,EAAoB,UAAA,CAAU,YAAU,wBAAwB,UAAU,iEACzE,EAAC,MAAA,CAAI,UAAU,0CAAA,CAA4C,CAC3D,EAAC,EAAA,CAAW,UAAU,+FAAA,CAAiG,CAAA,EACzF,EACP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`lucide-react`),n=require(`react/jsx-runtime`),r=require(`@customafk/react-toolkit/utils`),i=require(`radix-ui`);function a({className:e,...t}){return(0,n.jsx)(i.RadioGroup.Root,{"data-slot":`radio-group`,className:(0,r.cn)(`grid gap-3`,e),...t})}function o({className:e,...a}){return(0,n.jsx)(i.RadioGroup.Item,{"data-slot":`radio-group-item`,className:(0,r.cn)(`aspect-square size-4 shrink-0 rounded-full border border-border shadow-xs outline-none transition-all`,`disabled:cursor-not-allowed disabled:opacity-50`,`focus:border-border focus:ring-4 focus:ring-primary-weak`,`aria-invalid:border-danger-strong aria-invalid:ring-danger-weak`,`aria-readonly:pointer-events-none`,`aria-readonly:[&_div]:bg-muted`,`aria-readonly:[&_svg]:fill-muted-weak`,`aria-readonly:[&_svg]:text-muted-weak`,e),...a,children:(0,n.jsxs)(i.RadioGroup.Indicator,{"data-slot":`radio-group-indicator`,className:`relative flex items-center justify-center bg-primary`,children:[(0,n.jsx)(`div`,{className:`absolute size-4 rounded-full bg-primary`}),(0,n.jsx)(t.CircleIcon,{className:`-translate-1/2 absolute top-1/2 left-1/2 size-2 fill-text-negative-strong text-text-negative`})]})})}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
2
|
-
//# sourceMappingURL=radio-group-
|
|
2
|
+
//# sourceMappingURL=radio-group-DAv2EU3F.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-
|
|
1
|
+
{"version":3,"file":"radio-group-DAv2EU3F.cjs","names":["RadioGroupPrimitive","CircleIcon"],"sources":["../packages/components/ui/radio-group.tsx"],"sourcesContent":["'use client';\n\nimport { CircleIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\n\n/**\n * Accessible radio button group built on Radix UI's RadioGroup primitive, where only one option can be selected at a time.\n *\n * @example\n * ```tsx\n * import { RadioGroup, RadioGroupItem } from '@customafk/lunas-ui/ui/radio-group';\n * import { Label } from '@customafk/lunas-ui/ui/label';\n *\n * <RadioGroup defaultValue=\"monthly\">\n * <div className=\"flex items-center gap-2\">\n * <RadioGroupItem value=\"monthly\" id=\"monthly\" />\n * <Label htmlFor=\"monthly\">Monthly</Label>\n * </div>\n * <div className=\"flex items-center gap-2\">\n * <RadioGroupItem value=\"annually\" id=\"annually\" />\n * <Label htmlFor=\"annually\">Annually</Label>\n * </div>\n * </RadioGroup>\n * ```\n */\nfunction RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {\n return <RadioGroupPrimitive.Root data-slot=\"radio-group\" className={cn('grid gap-3', className)} {...props} />;\n}\n\n/** Individual radio button within a `RadioGroup`; shows a filled circle indicator when selected. */\nfunction RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item\n data-slot=\"radio-group-item\"\n className={cn(\n 'aspect-square size-4 shrink-0 rounded-full border border-border shadow-xs outline-none transition-all',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'focus:border-border focus:ring-4 focus:ring-primary-weak',\n 'aria-invalid:border-danger-strong aria-invalid:ring-danger-weak',\n 'aria-readonly:pointer-events-none',\n 'aria-readonly:[&_div]:bg-muted',\n 'aria-readonly:[&_svg]:fill-muted-weak',\n 'aria-readonly:[&_svg]:text-muted-weak',\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator data-slot=\"radio-group-indicator\" className=\"relative flex items-center justify-center bg-primary\">\n <div className=\"absolute size-4 rounded-full bg-primary\" />\n <CircleIcon className=\"-translate-1/2 absolute top-1/2 left-1/2 size-2 fill-text-negative-strong text-text-negative\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n"],"mappings":"uKA4BA,SAAS,EAAW,CAAE,YAAW,GAAG,GAAgE,CAClG,OAAO,EAAA,EAAA,KAACA,EAAAA,WAAoB,KAAA,CAAK,YAAU,cAAc,WAAA,EAAA,EAAA,IAAc,aAAc,EAAU,CAAE,GAAI,GAAS,CAIhH,SAAS,EAAe,CAAE,YAAW,GAAG,GAAgE,CACtG,OACE,EAAA,EAAA,KAACA,EAAAA,WAAoB,KAAA,CACnB,YAAU,mBACV,WAAA,EAAA,EAAA,IACE,wGACA,kDACA,2DACA,kEACA,oCACA,iCACA,wCACA,wCACA,EACD,CACD,GAAI,YAEJ,EAAA,EAAA,MAACA,EAAAA,WAAoB,UAAA,CAAU,YAAU,wBAAwB,UAAU,kEACzE,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,0CAAA,CAA4C,EAC3D,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAW,UAAU,+FAAA,CAAiG,CAAA,EACzF,EACP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{GripVerticalIcon as e}from"lucide-react";import{memo as t}from"react";import{jsx as n}from"react/jsx-runtime";import{cn as r}from"@customafk/react-toolkit/utils";import*as i from"react-resizable-panels";const a=t(({className:e,...t})=>n(i.PanelGroup,{"data-slot":`resizable-panel-group`,className:r(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...t}));a.displayName=`ResizablePanelGroup`;const o=t(({...e})=>n(i.Panel,{"data-slot":`resizable-panel`,...e}));o.displayName=`ResizablePanel`;const s=t(({withHandle:t,className:a,...o})=>n(i.PanelResizeHandle,{"data-slot":`resizable-handle`,className:r(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90`,a),...o,children:t&&n(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border`,children:n(e,{className:`size-2.5`})})}));s.displayName=`ResizableHandle`;export{o as n,a as r,s as t};
|
|
2
|
-
//# sourceMappingURL=resizable-
|
|
2
|
+
//# sourceMappingURL=resizable-C2Zl-iLF.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable-
|
|
1
|
+
{"version":3,"file":"resizable-C2Zl-iLF.mjs","names":[],"sources":["../packages/components/ui/resizable.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { GripVerticalIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport * as ResizablePrimitive from 'react-resizable-panels';\n\ntype TResizablePanelGroup = React.ComponentProps<typeof ResizablePrimitive.PanelGroup>;\n\ntype TResizablePanel = React.ComponentProps<typeof ResizablePrimitive.Panel>;\n\ntype TResizableHandle = React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n};\n\n/**\n * Root container that manages a group of resizable panels; supports horizontal and vertical orientations.\n *\n * @example\n * ```tsx\n * import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from '@customafk/lunas-ui/ui/resizable';\n *\n * <ResizablePanelGroup direction=\"horizontal\">\n * <ResizablePanel defaultSize={50}>Left</ResizablePanel>\n * <ResizableHandle withHandle />\n * <ResizablePanel defaultSize={50}>Right</ResizablePanel>\n * </ResizablePanelGroup>\n * ```\n */\nconst ResizablePanelGroup = memo<TResizablePanelGroup>(({ className, ...props }) => {\n return (\n <ResizablePrimitive.PanelGroup\n data-slot=\"resizable-panel-group\"\n className={cn('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className)}\n {...props}\n />\n );\n});\nResizablePanelGroup.displayName = 'ResizablePanelGroup';\n\n/** An individual resizable panel within a ResizablePanelGroup. */\nconst ResizablePanel = memo<TResizablePanel>(({ ...props }) => {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />;\n});\nResizablePanel.displayName = 'ResizablePanel';\n\n/**\n * The drag handle placed between two ResizablePanels to resize them.\n *\n * @param withHandle - When true, renders a visible grip icon centered on the handle.\n */\nconst ResizableHandle = memo<TResizableHandle>(({ withHandle, className, ...props }) => {\n return (\n <ResizablePrimitive.PanelResizeHandle\n data-slot=\"resizable-handle\"\n className={cn(\n 'relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90',\n className\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border\">\n <GripVerticalIcon className=\"size-2.5\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n );\n});\nResizableHandle.displayName = 'ResizableHandle';\n\nexport { ResizableHandle, ResizablePanel, ResizablePanelGroup };\n"],"mappings":"kNAgCA,MAAM,EAAsB,GAA4B,CAAE,YAAW,GAAG,KAEpE,EAAC,EAAmB,WAAA,CAClB,YAAU,wBACV,UAAW,EAAG,oEAAqE,EAAU,CAC7F,GAAI,GACJ,CAEJ,CACF,EAAoB,YAAc,sBAGlC,MAAM,EAAiB,GAAuB,CAAE,GAAG,KAC1C,EAAC,EAAmB,MAAA,CAAM,YAAU,kBAAkB,GAAI,GAAS,CAC1E,CACF,EAAe,YAAc,iBAO7B,MAAM,EAAkB,GAAwB,CAAE,aAAY,YAAW,GAAG,KAExE,EAAC,EAAmB,kBAAA,CAClB,YAAU,mBACV,UAAW,EACT,4oBACA,EACD,CACD,GAAI,WAEH,GACC,EAAC,MAAA,CAAI,UAAU,qFACb,EAAC,EAAA,CAAiB,UAAU,WAAA,CAAa,EACrC,EAE6B,CAEzC,CACF,EAAgB,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`lucide-react`),n=require(`react`),r=require(`react/jsx-runtime`),i=require(`@customafk/react-toolkit/utils`),a=require(`react-resizable-panels`);a=e.t(a);const o=(0,n.memo)(({className:e,...t})=>(0,r.jsx)(a.PanelGroup,{"data-slot":`resizable-panel-group`,className:(0,i.cn)(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...t}));o.displayName=`ResizablePanelGroup`;const s=(0,n.memo)(({...e})=>(0,r.jsx)(a.Panel,{"data-slot":`resizable-panel`,...e}));s.displayName=`ResizablePanel`;const c=(0,n.memo)(({withHandle:e,className:n,...o})=>(0,r.jsx)(a.PanelResizeHandle,{"data-slot":`resizable-handle`,className:(0,i.cn)(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90`,n),...o,children:e&&(0,r.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border`,children:(0,r.jsx)(t.GripVerticalIcon,{className:`size-2.5`})})}));c.displayName=`ResizableHandle`,Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
2
|
-
//# sourceMappingURL=resizable-
|
|
2
|
+
//# sourceMappingURL=resizable-DDPMwd28.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable-
|
|
1
|
+
{"version":3,"file":"resizable-DDPMwd28.cjs","names":["ResizablePrimitive","GripVerticalIcon"],"sources":["../packages/components/ui/resizable.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { GripVerticalIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport * as ResizablePrimitive from 'react-resizable-panels';\n\ntype TResizablePanelGroup = React.ComponentProps<typeof ResizablePrimitive.PanelGroup>;\n\ntype TResizablePanel = React.ComponentProps<typeof ResizablePrimitive.Panel>;\n\ntype TResizableHandle = React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n};\n\n/**\n * Root container that manages a group of resizable panels; supports horizontal and vertical orientations.\n *\n * @example\n * ```tsx\n * import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from '@customafk/lunas-ui/ui/resizable';\n *\n * <ResizablePanelGroup direction=\"horizontal\">\n * <ResizablePanel defaultSize={50}>Left</ResizablePanel>\n * <ResizableHandle withHandle />\n * <ResizablePanel defaultSize={50}>Right</ResizablePanel>\n * </ResizablePanelGroup>\n * ```\n */\nconst ResizablePanelGroup = memo<TResizablePanelGroup>(({ className, ...props }) => {\n return (\n <ResizablePrimitive.PanelGroup\n data-slot=\"resizable-panel-group\"\n className={cn('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className)}\n {...props}\n />\n );\n});\nResizablePanelGroup.displayName = 'ResizablePanelGroup';\n\n/** An individual resizable panel within a ResizablePanelGroup. */\nconst ResizablePanel = memo<TResizablePanel>(({ ...props }) => {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />;\n});\nResizablePanel.displayName = 'ResizablePanel';\n\n/**\n * The drag handle placed between two ResizablePanels to resize them.\n *\n * @param withHandle - When true, renders a visible grip icon centered on the handle.\n */\nconst ResizableHandle = memo<TResizableHandle>(({ withHandle, className, ...props }) => {\n return (\n <ResizablePrimitive.PanelResizeHandle\n data-slot=\"resizable-handle\"\n className={cn(\n 'relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90',\n className\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border\">\n <GripVerticalIcon className=\"size-2.5\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n );\n});\nResizableHandle.displayName = 'ResizableHandle';\n\nexport { ResizableHandle, ResizablePanel, ResizablePanelGroup };\n"],"mappings":"iNAgCA,MAAM,GAAA,EAAA,EAAA,OAAkD,CAAE,YAAW,GAAG,MAEpE,EAAA,EAAA,KAACA,EAAmB,WAAA,CAClB,YAAU,wBACV,WAAA,EAAA,EAAA,IAAc,oEAAqE,EAAU,CAC7F,GAAI,GACJ,CAEJ,CACF,EAAoB,YAAc,sBAGlC,MAAM,GAAA,EAAA,EAAA,OAAwC,CAAE,GAAG,MAC1C,EAAA,EAAA,KAACA,EAAmB,MAAA,CAAM,YAAU,kBAAkB,GAAI,GAAS,CAC1E,CACF,EAAe,YAAc,iBAO7B,MAAM,GAAA,EAAA,EAAA,OAA0C,CAAE,aAAY,YAAW,GAAG,MAExE,EAAA,EAAA,KAACA,EAAmB,kBAAA,CAClB,YAAU,mBACV,WAAA,EAAA,EAAA,IACE,4oBACA,EACD,CACD,GAAI,WAEH,IACC,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,sFACb,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CAAiB,UAAU,WAAA,CAAa,EACrC,EAE6B,CAEzC,CACF,EAAgB,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{CheckIcon as e,ChevronDownIcon as t}from"lucide-react";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{cn as i}from"@customafk/react-toolkit/utils";import{Select as a}from"radix-ui";function o({...e}){return n(a.Root,{"data-slot":`select`,...e})}function s({...e}){return n(a.Group,{"data-slot":`select-group`,...e})}function c({...e}){return n(a.Value,{"data-slot":`select-value`,...e})}function l({className:e,size:o=`default`,children:s,...c}){return r(a.Trigger,{"data-slot":`select-trigger`,"data-size":o,className:i(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`rounded shadow-input transition-all`,`cursor-pointer whitespace-nowrap text-sm`,`focus-visible:text-text-positive-strong`,`focus-visible:outline-primary-strong`,`focus-visible:ring-4`,`focus-visible:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`aria-invalid:bg-danger-bg-subtle`,`aria-invalid:outline-danger`,`aria-invalid:ring-danger-weak`,`aria-invalid:focus:outline-danger-strong`,`aria-invalid:focus:ring-4`,`aria-invalid:placeholder:text-text-positive-weak`,`aria-invalid:data-[state=open]:outline-danger-strong`,`aria-invalid:data-[state=open]:ring-danger-weak`,`data-placeholder:text-text-positive-muted`,`*:data-[slot=select-value]:line-clamp-1`,`*:data-[slot=select-value]:flex`,`*:data-[slot=select-value]:items-center`,`*:data-[slot=select-value]:gap-2`,`aria-readonly:bg-muted-muted`,`aria-readonly:cursor-default`,`aria-readonly:focus:outline-none`,`aria-readonly:ring-0`,`aria-readonly:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg]:pointer-events-none`,`[&_svg:not([class*='size-'])]:size-4`,`[&_svg:not([class*='text-'])]:text-muted-foreground`,e),...c,children:[s,n(a.Icon,{asChild:!0,children:n(t,{size:16,opacity:50})})]})}function u({className:e,children:t,position:r=`popper`,...o}){return n(a.Portal,{children:n(a.Content,{"data-slot":`select-content`,className:i(`relative z-50 max-h-80 min-w-32 overflow-y-auto overflow-x-hidden rounded shadow-dropdown duration-300`,`bg-white`,`w-(--radix-select-trigger-width)`,`origin-(--radix-select-content-transform-origin)`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`,`data-[side=bottom]:slide-in-from-top-8`,`data-[side=left]:slide-in-from-right-8`,`data-[side=right]:slide-in-from-left-8`,`data-[side=top]:slide-in-from-bottom-8`,r===`popper`&&`data-[side=bottom]:translate-y-1`,r===`popper`&&`data-[side=left]:-translate-x-1`,r===`popper`&&`data-[side=right]:translate-x-1`,r===`popper`&&`data-[side=top]:-translate-y-1`,e),position:r,...o,children:n(a.Viewport,{className:i(`p-1`,r===`popper`&&`w-full scroll-my-1`,r===`popper`&&`h-(--radix-select-trigger-height)`,r===`popper`&&`min-w-(--radix-select-trigger-width)`),children:t})})})}function d({className:e,...t}){return n(a.Label,{"data-slot":`select-label`,className:i(`px-2 py-1.5 text-text-positive-weak text-xs`,e),...t})}function f({className:t,children:o,...s}){return r(a.Item,{"data-slot":`select-item`,className:i(`relative flex select-none items-center`,`gap-2 rounded py-2.5 pr-8 pl-2`,`w-full`,`cursor-pointer outline-none transition-colors`,`font-medium text-sm text-text-positive-weak`,`focus:shadow-xs`,`focus:bg-muted-muted`,`data-disabled:opacity-50`,`data-disabled:pointer-events-none`,`[&_svg]:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg:not([class*='size-'])]:size-4`,`[&_svg:not([class*='text-'])]:text-text-positive-weak`,`*:[span]:last:flex`,`*:[span]:last:items-center`,`*:[span]:last:gap-2`,t),...s,children:[n(a.ItemText,{children:o}),n(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:n(a.ItemIndicator,{children:n(e,{size:16})})})]})}function p({className:e,...t}){return n(a.Separator,{"data-slot":`select-separator`,className:i(`-mx-1 pointer-events-none my-1 h-px bg-border-weak`,e),...t})}export{d as a,c,f as i,u as n,p as o,s as r,l as s,o as t};
|
|
2
|
-
//# sourceMappingURL=select-
|
|
2
|
+
//# sourceMappingURL=select-DRCKwnTV.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-Ze8Fq88G.mjs","names":["Select","SelectPrimitive"],"sources":["../packages/components/ui/select.tsx"],"sourcesContent":["'use client';\n\nimport { CheckIcon, ChevronDownIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Select as SelectPrimitive } from 'radix-ui';\n\n/**\n * Accessible dropdown select built on Radix UI's Select primitives, composed from `Select`, `SelectTrigger`, `SelectContent`, and `SelectItem`.\n *\n * @example\n * ```tsx\n * import {\n * Select, SelectTrigger, SelectValue,\n * SelectContent, SelectItem,\n * } from '@customafk/lunas-ui/ui/select';\n *\n * <Select>\n * <SelectTrigger>\n * <SelectValue placeholder=\"Pick a fruit\" />\n * </SelectTrigger>\n * <SelectContent>\n * <SelectItem value=\"apple\">Apple</SelectItem>\n * <SelectItem value=\"banana\">Banana</SelectItem>\n * </SelectContent>\n * </Select>\n * ```\n */\nfunction Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\n/** Groups related `SelectItem` elements with an optional `SelectLabel` header. */\nfunction SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\n/** Renders the currently selected value (or a placeholder) inside `SelectTrigger`. */\nfunction SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\n/**\n * The button that opens the select dropdown; renders the current value and a chevron icon.\n *\n * @param size - `'default'` (standard padding) or `'sm'` (compact).\n */\nfunction SelectTrigger({\n className,\n size = 'default',\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n /** Controls the trigger's padding — `'default'` or `'sm'`. */\n size?: 'sm' | 'default';\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n 'flex w-full items-center justify-between',\n 'outline-1 outline-border -outline-offset-1',\n 'gap-2 rounded bg-transparent px-3 py-2',\n 'rounded shadow-input transition-all',\n 'cursor-pointer whitespace-nowrap text-sm',\n\n // Text styles\n 'focus-visible:text-text-positive-strong',\n 'focus-visible:outline-primary-strong',\n 'focus-visible:ring-4',\n 'focus-visible:ring-primary-weak',\n\n // State styles\n 'data-[state=open]:text-text-positive-muted',\n 'data-[state=open]:outline-primary-strong',\n 'data-[state=open]:ring-4',\n 'data-[state=open]:ring-primary-weak',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n\n // Invalid state\n 'aria-invalid:bg-danger-bg-subtle',\n 'aria-invalid:outline-danger',\n 'aria-invalid:ring-danger-weak',\n 'aria-invalid:focus:outline-danger-strong',\n 'aria-invalid:focus:ring-4',\n 'aria-invalid:placeholder:text-text-positive-weak',\n 'aria-invalid:data-[state=open]:outline-danger-strong',\n 'aria-invalid:data-[state=open]:ring-danger-weak',\n\n // Placeholder styles\n 'data-placeholder:text-text-positive-muted',\n '*:data-[slot=select-value]:line-clamp-1',\n '*:data-[slot=select-value]:flex',\n '*:data-[slot=select-value]:items-center',\n '*:data-[slot=select-value]:gap-2',\n\n // Readonly state\n 'aria-readonly:bg-muted-muted',\n 'aria-readonly:cursor-default',\n 'aria-readonly:focus:outline-none',\n 'aria-readonly:ring-0',\n 'aria-readonly:pointer-events-none',\n\n // Icon styles\n '[&_svg]:shrink-0',\n '[&_svg]:pointer-events-none',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-muted-foreground\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon size={16} opacity={50} />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\n/** Floating dropdown panel that renders inside a portal with enter/exit animations. */\nfunction SelectContent({ className, children, position = 'popper', ...props }: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n 'relative z-50 max-h-80 min-w-32 overflow-y-auto overflow-x-hidden rounded shadow-dropdown duration-300',\n 'bg-white',\n 'w-(--radix-select-trigger-width)',\n 'origin-(--radix-select-content-transform-origin)',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in',\n\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out',\n\n 'data-[side=bottom]:slide-in-from-top-8',\n 'data-[side=left]:slide-in-from-right-8',\n 'data-[side=right]:slide-in-from-left-8',\n 'data-[side=top]:slide-in-from-bottom-8',\n\n position === 'popper' && 'data-[side=bottom]:translate-y-1',\n position === 'popper' && 'data-[side=left]:-translate-x-1',\n position === 'popper' && 'data-[side=right]:translate-x-1',\n position === 'popper' && 'data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' && 'w-full scroll-my-1',\n position === 'popper' && 'h-(--radix-select-trigger-height)',\n position === 'popper' && 'min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\n/** Non-interactive label displayed above a `SelectGroup` to describe its options. */\nfunction SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return <SelectPrimitive.Label data-slot=\"select-label\" className={cn('px-2 py-1.5 text-text-positive-weak text-xs', className)} {...props} />;\n}\n\n/** A selectable option within `SelectContent`; shows a check icon when chosen. */\nfunction SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n 'relative flex select-none items-center',\n 'gap-2 rounded py-2.5 pr-8 pl-2',\n 'w-full',\n 'cursor-pointer outline-none transition-colors',\n 'font-medium text-sm text-text-positive-weak',\n\n 'focus:shadow-xs',\n 'focus:bg-muted-muted',\n\n 'data-disabled:opacity-50',\n 'data-disabled:pointer-events-none',\n\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-text-positive-weak\",\n\n '*:[span]:last:flex',\n '*:[span]:last:items-center',\n '*:[span]:last:gap-2',\n className\n )}\n {...props}\n >\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon size={16} />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n}\n\n/** Thin horizontal rule used to visually separate groups of `SelectItem` elements. */\nfunction SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return <SelectPrimitive.Separator data-slot=\"select-separator\" className={cn('-mx-1 pointer-events-none my-1 h-px bg-border-weak', className)} {...props} />;\n}\n\nexport { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue };\n"],"mappings":"sMA6BA,SAASA,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAACC,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,CAI/D,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAItE,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAQtE,SAAS,EAAc,CACrB,YACA,OAAO,UACP,WACA,GAAG,GAIF,CACD,OACE,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,YAAW,EACX,UAAW,EACT,2CACA,6CACA,yCACA,sCACA,2CAGA,0CACA,uCACA,uBACA,kCAGA,6CACA,2CACA,2BACA,sCACA,8BACA,sBAGA,mCACA,8BACA,gCACA,2CACA,4BACA,mDACA,uDACA,kDAGA,4CACA,0CACA,kCACA,0CACA,mCAGA,+BACA,+BACA,mCACA,uBACA,oCAGA,mBACA,8BACA,uCACA,sDACA,EACD,CACD,GAAI,YAEH,EACD,EAACA,EAAgB,KAAA,CAAK,QAAA,YACpB,EAAC,EAAA,CAAgB,KAAM,GAAI,QAAS,IAAM,EACrB,CAAA,EACC,CAK9B,SAAS,EAAc,CAAE,YAAW,WAAU,WAAW,SAAU,GAAG,GAA+D,CACnI,OACE,EAACA,EAAgB,OAAA,CAAA,SACf,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,yGACA,WACA,mCACA,mDAEA,+BACA,4BAEA,kCACA,+BAEA,yCACA,yCACA,yCACA,yCAEA,IAAa,UAAY,mCACzB,IAAa,UAAY,kCACzB,IAAa,UAAY,kCACzB,IAAa,UAAY,iCACzB,EACD,CACS,WACV,GAAI,WAEJ,EAACA,EAAgB,SAAA,CACf,UAAW,EACT,MACA,IAAa,UAAY,qBACzB,IAAa,UAAY,oCACzB,IAAa,UAAY,uCAC1B,CAEA,YACwB,EACH,CAAA,CACH,CAK7B,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,UAAW,EAAG,8CAA+C,EAAU,CAAE,GAAI,GAAS,CAI/I,SAAS,EAAW,CAAE,YAAW,WAAU,GAAG,GAA4D,CACxG,OACE,EAACA,EAAgB,KAAA,CACf,YAAU,cACV,UAAW,EACT,yCACA,iCACA,SACA,gDACA,8CAEA,kBACA,uBAEA,2BACA,oCAEA,8BACA,mBACA,uCACA,wDAEA,qBACA,6BACA,sBACA,EACD,CACD,GAAI,YAEJ,EAACA,EAAgB,SAAA,CAAU,WAAA,CAAoC,CAC/D,EAAC,OAAA,CAAK,UAAU,sEACd,EAACA,EAAgB,cAAA,CAAA,SACf,EAAC,EAAA,CAAU,KAAM,GAAA,CAAM,CAAA,CACO,EAC3B,CAAA,EACc,CAK3B,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAiE,CACxG,OAAO,EAACA,EAAgB,UAAA,CAAU,YAAU,mBAAmB,UAAW,EAAG,qDAAsD,EAAU,CAAE,GAAI,GAAS"}
|
|
1
|
+
{"version":3,"file":"select-DRCKwnTV.mjs","names":["Select","SelectPrimitive"],"sources":["../packages/components/ui/select.tsx"],"sourcesContent":["'use client';\n\nimport { CheckIcon, ChevronDownIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Select as SelectPrimitive } from 'radix-ui';\n\n/**\n * Accessible dropdown select built on Radix UI's Select primitives, composed from `Select`, `SelectTrigger`, `SelectContent`, and `SelectItem`.\n *\n * @example\n * ```tsx\n * import {\n * Select, SelectTrigger, SelectValue,\n * SelectContent, SelectItem,\n * } from '@customafk/lunas-ui/ui/select';\n *\n * <Select>\n * <SelectTrigger>\n * <SelectValue placeholder=\"Pick a fruit\" />\n * </SelectTrigger>\n * <SelectContent>\n * <SelectItem value=\"apple\">Apple</SelectItem>\n * <SelectItem value=\"banana\">Banana</SelectItem>\n * </SelectContent>\n * </Select>\n * ```\n */\nfunction Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\n/** Groups related `SelectItem` elements with an optional `SelectLabel` header. */\nfunction SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\n/** Renders the currently selected value (or a placeholder) inside `SelectTrigger`. */\nfunction SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\n/**\n * The button that opens the select dropdown; renders the current value and a chevron icon.\n *\n * @param size - `'default'` (standard padding) or `'sm'` (compact).\n */\nfunction SelectTrigger({\n className,\n size = 'default',\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n /** Controls the trigger's padding — `'default'` or `'sm'`. */\n size?: 'sm' | 'default';\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n 'flex w-full items-center justify-between',\n 'outline-1 outline-border -outline-offset-1',\n 'gap-2 rounded bg-transparent px-3 py-2',\n 'rounded shadow-input transition-all',\n 'cursor-pointer whitespace-nowrap text-sm',\n\n // Text styles\n 'focus-visible:text-text-positive-strong',\n 'focus-visible:outline-primary-strong',\n 'focus-visible:ring-4',\n 'focus-visible:ring-primary-weak',\n\n // State styles\n 'data-[state=open]:text-text-positive-muted',\n 'data-[state=open]:outline-primary-strong',\n 'data-[state=open]:ring-4',\n 'data-[state=open]:ring-primary-weak',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n\n // Invalid state\n 'aria-invalid:bg-danger-bg-subtle',\n 'aria-invalid:outline-danger',\n 'aria-invalid:ring-danger-weak',\n 'aria-invalid:focus:outline-danger-strong',\n 'aria-invalid:focus:ring-4',\n 'aria-invalid:placeholder:text-text-positive-weak',\n 'aria-invalid:data-[state=open]:outline-danger-strong',\n 'aria-invalid:data-[state=open]:ring-danger-weak',\n\n // Placeholder styles\n 'data-placeholder:text-text-positive-muted',\n '*:data-[slot=select-value]:line-clamp-1',\n '*:data-[slot=select-value]:flex',\n '*:data-[slot=select-value]:items-center',\n '*:data-[slot=select-value]:gap-2',\n\n // Readonly state\n 'aria-readonly:bg-muted-muted',\n 'aria-readonly:cursor-default',\n 'aria-readonly:focus:outline-none',\n 'aria-readonly:ring-0',\n 'aria-readonly:pointer-events-none',\n\n // Icon styles\n '[&_svg]:shrink-0',\n '[&_svg]:pointer-events-none',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-muted-foreground\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon size={16} opacity={50} />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\n/** Floating dropdown panel that renders inside a portal with enter/exit animations. */\nfunction SelectContent({ className, children, position = 'popper', ...props }: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n 'relative z-50 max-h-80 min-w-32 overflow-y-auto overflow-x-hidden rounded shadow-dropdown duration-300',\n 'bg-white',\n 'w-(--radix-select-trigger-width)',\n 'origin-(--radix-select-content-transform-origin)',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in',\n\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out',\n\n 'data-[side=bottom]:slide-in-from-top-8',\n 'data-[side=left]:slide-in-from-right-8',\n 'data-[side=right]:slide-in-from-left-8',\n 'data-[side=top]:slide-in-from-bottom-8',\n\n position === 'popper' && 'data-[side=bottom]:translate-y-1',\n position === 'popper' && 'data-[side=left]:-translate-x-1',\n position === 'popper' && 'data-[side=right]:translate-x-1',\n position === 'popper' && 'data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' && 'w-full scroll-my-1',\n position === 'popper' && 'h-(--radix-select-trigger-height)',\n position === 'popper' && 'min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\n/** Non-interactive label displayed above a `SelectGroup` to describe its options. */\nfunction SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return <SelectPrimitive.Label data-slot=\"select-label\" className={cn('px-2 py-1.5 text-text-positive-weak text-xs', className)} {...props} />;\n}\n\n/** A selectable option within `SelectContent`; shows a check icon when chosen. */\nfunction SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n 'relative flex select-none items-center',\n 'gap-2 rounded py-2.5 pr-8 pl-2',\n 'w-full',\n 'cursor-pointer outline-none transition-colors',\n 'font-medium text-sm text-text-positive-weak',\n\n 'focus:shadow-xs',\n 'focus:bg-muted-muted',\n\n 'data-disabled:opacity-50',\n 'data-disabled:pointer-events-none',\n\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-text-positive-weak\",\n\n '*:[span]:last:flex',\n '*:[span]:last:items-center',\n '*:[span]:last:gap-2',\n className\n )}\n {...props}\n >\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon size={16} />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n}\n\n/** Thin horizontal rule used to visually separate groups of `SelectItem` elements. */\nfunction SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return <SelectPrimitive.Separator data-slot=\"select-separator\" className={cn('-mx-1 pointer-events-none my-1 h-px bg-border-weak', className)} {...props} />;\n}\n\nexport { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue };\n"],"mappings":"sMA6BA,SAASA,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAACC,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,CAI/D,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAItE,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAQtE,SAAS,EAAc,CACrB,YACA,OAAO,UACP,WACA,GAAG,GAIF,CACD,OACE,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,YAAW,EACX,UAAW,EACT,2CACA,6CACA,yCACA,sCACA,2CAGA,0CACA,uCACA,uBACA,kCAGA,6CACA,2CACA,2BACA,sCACA,8BACA,sBAGA,mCACA,8BACA,gCACA,2CACA,4BACA,mDACA,uDACA,kDAGA,4CACA,0CACA,kCACA,0CACA,mCAGA,+BACA,+BACA,mCACA,uBACA,oCAGA,mBACA,8BACA,uCACA,sDACA,EACD,CACD,GAAI,YAEH,EACD,EAACA,EAAgB,KAAA,CAAK,QAAA,YACpB,EAAC,EAAA,CAAgB,KAAM,GAAI,QAAS,IAAM,EACrB,CAAA,EACC,CAK9B,SAAS,EAAc,CAAE,YAAW,WAAU,WAAW,SAAU,GAAG,GAA+D,CACnI,OACE,EAACA,EAAgB,OAAA,CAAA,SACf,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,yGACA,WACA,mCACA,mDAEA,+BACA,4BAEA,kCACA,+BAEA,yCACA,yCACA,yCACA,yCAEA,IAAa,UAAY,mCACzB,IAAa,UAAY,kCACzB,IAAa,UAAY,kCACzB,IAAa,UAAY,iCACzB,EACD,CACS,WACV,GAAI,WAEJ,EAACA,EAAgB,SAAA,CACf,UAAW,EACT,MACA,IAAa,UAAY,qBACzB,IAAa,UAAY,oCACzB,IAAa,UAAY,uCAC1B,CAEA,YACwB,EACH,CAAA,CACH,CAK7B,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,UAAW,EAAG,8CAA+C,EAAU,CAAE,GAAI,GAAS,CAI/I,SAAS,EAAW,CAAE,YAAW,WAAU,GAAG,GAA4D,CACxG,OACE,EAACA,EAAgB,KAAA,CACf,YAAU,cACV,UAAW,EACT,yCACA,iCACA,SACA,gDACA,8CAEA,kBACA,uBAEA,2BACA,oCAEA,8BACA,mBACA,uCACA,wDAEA,qBACA,6BACA,sBACA,EACD,CACD,GAAI,YAEJ,EAACA,EAAgB,SAAA,CAAU,WAAA,CAAoC,CAC/D,EAAC,OAAA,CAAK,UAAU,sEACd,EAACA,EAAgB,cAAA,CAAA,SACf,EAAC,EAAA,CAAU,KAAM,GAAA,CAAM,CAAA,CACO,EAC3B,CAAA,EACc,CAK3B,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAiE,CACxG,OAAO,EAACA,EAAgB,UAAA,CAAU,YAAU,mBAAmB,UAAW,EAAG,qDAAsD,EAAU,CAAE,GAAI,GAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`lucide-react`),n=require(`react/jsx-runtime`),r=require(`@customafk/react-toolkit/utils`),i=require(`radix-ui`);function a({...e}){return(0,n.jsx)(i.Select.Root,{"data-slot":`select`,...e})}function o({...e}){return(0,n.jsx)(i.Select.Group,{"data-slot":`select-group`,...e})}function s({...e}){return(0,n.jsx)(i.Select.Value,{"data-slot":`select-value`,...e})}function c({className:e,size:a=`default`,children:o,...s}){return(0,n.jsxs)(i.Select.Trigger,{"data-slot":`select-trigger`,"data-size":a,className:(0,r.cn)(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`rounded shadow-input transition-all`,`cursor-pointer whitespace-nowrap text-sm`,`focus-visible:text-text-positive-strong`,`focus-visible:outline-primary-strong`,`focus-visible:ring-4`,`focus-visible:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`aria-invalid:bg-danger-bg-subtle`,`aria-invalid:outline-danger`,`aria-invalid:ring-danger-weak`,`aria-invalid:focus:outline-danger-strong`,`aria-invalid:focus:ring-4`,`aria-invalid:placeholder:text-text-positive-weak`,`aria-invalid:data-[state=open]:outline-danger-strong`,`aria-invalid:data-[state=open]:ring-danger-weak`,`data-placeholder:text-text-positive-muted`,`*:data-[slot=select-value]:line-clamp-1`,`*:data-[slot=select-value]:flex`,`*:data-[slot=select-value]:items-center`,`*:data-[slot=select-value]:gap-2`,`aria-readonly:bg-muted-muted`,`aria-readonly:cursor-default`,`aria-readonly:focus:outline-none`,`aria-readonly:ring-0`,`aria-readonly:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg]:pointer-events-none`,`[&_svg:not([class*='size-'])]:size-4`,`[&_svg:not([class*='text-'])]:text-muted-foreground`,e),...s,children:[o,(0,n.jsx)(i.Select.Icon,{asChild:!0,children:(0,n.jsx)(t.ChevronDownIcon,{size:16,opacity:50})})]})}function l({className:e,children:t,position:a=`popper`,...o}){return(0,n.jsx)(i.Select.Portal,{children:(0,n.jsx)(i.Select.Content,{"data-slot":`select-content`,className:(0,r.cn)(`relative z-50 max-h-80 min-w-32 overflow-y-auto overflow-x-hidden rounded shadow-dropdown duration-300`,`bg-white`,`w-(--radix-select-trigger-width)`,`origin-(--radix-select-content-transform-origin)`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`,`data-[side=bottom]:slide-in-from-top-8`,`data-[side=left]:slide-in-from-right-8`,`data-[side=right]:slide-in-from-left-8`,`data-[side=top]:slide-in-from-bottom-8`,a===`popper`&&`data-[side=bottom]:translate-y-1`,a===`popper`&&`data-[side=left]:-translate-x-1`,a===`popper`&&`data-[side=right]:translate-x-1`,a===`popper`&&`data-[side=top]:-translate-y-1`,e),position:a,...o,children:(0,n.jsx)(i.Select.Viewport,{className:(0,r.cn)(`p-1`,a===`popper`&&`w-full scroll-my-1`,a===`popper`&&`h-(--radix-select-trigger-height)`,a===`popper`&&`min-w-(--radix-select-trigger-width)`),children:t})})})}function u({className:e,...t}){return(0,n.jsx)(i.Select.Label,{"data-slot":`select-label`,className:(0,r.cn)(`px-2 py-1.5 text-text-positive-weak text-xs`,e),...t})}function d({className:e,children:a,...o}){return(0,n.jsxs)(i.Select.Item,{"data-slot":`select-item`,className:(0,r.cn)(`relative flex select-none items-center`,`gap-2 rounded py-2.5 pr-8 pl-2`,`w-full`,`cursor-pointer outline-none transition-colors`,`font-medium text-sm text-text-positive-weak`,`focus:shadow-xs`,`focus:bg-muted-muted`,`data-disabled:opacity-50`,`data-disabled:pointer-events-none`,`[&_svg]:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg:not([class*='size-'])]:size-4`,`[&_svg:not([class*='text-'])]:text-text-positive-weak`,`*:[span]:last:flex`,`*:[span]:last:items-center`,`*:[span]:last:gap-2`,e),...o,children:[(0,n.jsx)(i.Select.ItemText,{children:a}),(0,n.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,n.jsx)(i.Select.ItemIndicator,{children:(0,n.jsx)(t.CheckIcon,{size:16})})})]})}function f({className:e,...t}){return(0,n.jsx)(i.Select.Separator,{"data-slot":`select-separator`,className:(0,r.cn)(`-mx-1 pointer-events-none my-1 h-px bg-border-weak`,e),...t})}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
2
|
-
//# sourceMappingURL=select-
|
|
2
|
+
//# sourceMappingURL=select-DfvSMRUq.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-Py_t2nX1.cjs","names":["SelectPrimitive","ChevronDownIcon","CheckIcon"],"sources":["../packages/components/ui/select.tsx"],"sourcesContent":["'use client';\n\nimport { CheckIcon, ChevronDownIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Select as SelectPrimitive } from 'radix-ui';\n\n/**\n * Accessible dropdown select built on Radix UI's Select primitives, composed from `Select`, `SelectTrigger`, `SelectContent`, and `SelectItem`.\n *\n * @example\n * ```tsx\n * import {\n * Select, SelectTrigger, SelectValue,\n * SelectContent, SelectItem,\n * } from '@customafk/lunas-ui/ui/select';\n *\n * <Select>\n * <SelectTrigger>\n * <SelectValue placeholder=\"Pick a fruit\" />\n * </SelectTrigger>\n * <SelectContent>\n * <SelectItem value=\"apple\">Apple</SelectItem>\n * <SelectItem value=\"banana\">Banana</SelectItem>\n * </SelectContent>\n * </Select>\n * ```\n */\nfunction Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\n/** Groups related `SelectItem` elements with an optional `SelectLabel` header. */\nfunction SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\n/** Renders the currently selected value (or a placeholder) inside `SelectTrigger`. */\nfunction SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\n/**\n * The button that opens the select dropdown; renders the current value and a chevron icon.\n *\n * @param size - `'default'` (standard padding) or `'sm'` (compact).\n */\nfunction SelectTrigger({\n className,\n size = 'default',\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n /** Controls the trigger's padding — `'default'` or `'sm'`. */\n size?: 'sm' | 'default';\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n 'flex w-full items-center justify-between',\n 'outline-1 outline-border -outline-offset-1',\n 'gap-2 rounded bg-transparent px-3 py-2',\n 'rounded shadow-input transition-all',\n 'cursor-pointer whitespace-nowrap text-sm',\n\n // Text styles\n 'focus-visible:text-text-positive-strong',\n 'focus-visible:outline-primary-strong',\n 'focus-visible:ring-4',\n 'focus-visible:ring-primary-weak',\n\n // State styles\n 'data-[state=open]:text-text-positive-muted',\n 'data-[state=open]:outline-primary-strong',\n 'data-[state=open]:ring-4',\n 'data-[state=open]:ring-primary-weak',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n\n // Invalid state\n 'aria-invalid:bg-danger-bg-subtle',\n 'aria-invalid:outline-danger',\n 'aria-invalid:ring-danger-weak',\n 'aria-invalid:focus:outline-danger-strong',\n 'aria-invalid:focus:ring-4',\n 'aria-invalid:placeholder:text-text-positive-weak',\n 'aria-invalid:data-[state=open]:outline-danger-strong',\n 'aria-invalid:data-[state=open]:ring-danger-weak',\n\n // Placeholder styles\n 'data-placeholder:text-text-positive-muted',\n '*:data-[slot=select-value]:line-clamp-1',\n '*:data-[slot=select-value]:flex',\n '*:data-[slot=select-value]:items-center',\n '*:data-[slot=select-value]:gap-2',\n\n // Readonly state\n 'aria-readonly:bg-muted-muted',\n 'aria-readonly:cursor-default',\n 'aria-readonly:focus:outline-none',\n 'aria-readonly:ring-0',\n 'aria-readonly:pointer-events-none',\n\n // Icon styles\n '[&_svg]:shrink-0',\n '[&_svg]:pointer-events-none',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-muted-foreground\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon size={16} opacity={50} />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\n/** Floating dropdown panel that renders inside a portal with enter/exit animations. */\nfunction SelectContent({ className, children, position = 'popper', ...props }: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n 'relative z-50 max-h-80 min-w-32 overflow-y-auto overflow-x-hidden rounded shadow-dropdown duration-300',\n 'bg-white',\n 'w-(--radix-select-trigger-width)',\n 'origin-(--radix-select-content-transform-origin)',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in',\n\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out',\n\n 'data-[side=bottom]:slide-in-from-top-8',\n 'data-[side=left]:slide-in-from-right-8',\n 'data-[side=right]:slide-in-from-left-8',\n 'data-[side=top]:slide-in-from-bottom-8',\n\n position === 'popper' && 'data-[side=bottom]:translate-y-1',\n position === 'popper' && 'data-[side=left]:-translate-x-1',\n position === 'popper' && 'data-[side=right]:translate-x-1',\n position === 'popper' && 'data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' && 'w-full scroll-my-1',\n position === 'popper' && 'h-(--radix-select-trigger-height)',\n position === 'popper' && 'min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\n/** Non-interactive label displayed above a `SelectGroup` to describe its options. */\nfunction SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return <SelectPrimitive.Label data-slot=\"select-label\" className={cn('px-2 py-1.5 text-text-positive-weak text-xs', className)} {...props} />;\n}\n\n/** A selectable option within `SelectContent`; shows a check icon when chosen. */\nfunction SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n 'relative flex select-none items-center',\n 'gap-2 rounded py-2.5 pr-8 pl-2',\n 'w-full',\n 'cursor-pointer outline-none transition-colors',\n 'font-medium text-sm text-text-positive-weak',\n\n 'focus:shadow-xs',\n 'focus:bg-muted-muted',\n\n 'data-disabled:opacity-50',\n 'data-disabled:pointer-events-none',\n\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-text-positive-weak\",\n\n '*:[span]:last:flex',\n '*:[span]:last:items-center',\n '*:[span]:last:gap-2',\n className\n )}\n {...props}\n >\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon size={16} />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n}\n\n/** Thin horizontal rule used to visually separate groups of `SelectItem` elements. */\nfunction SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return <SelectPrimitive.Separator data-slot=\"select-separator\" className={cn('-mx-1 pointer-events-none my-1 h-px bg-border-weak', className)} {...props} />;\n}\n\nexport { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue };\n"],"mappings":"uKA6BA,SAAS,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,CAI/D,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAItE,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAQtE,SAAS,EAAc,CACrB,YACA,OAAO,UACP,WACA,GAAG,GAIF,CACD,OACE,EAAA,EAAA,MAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,YAAW,EACX,WAAA,EAAA,EAAA,IACE,2CACA,6CACA,yCACA,sCACA,2CAGA,0CACA,uCACA,uBACA,kCAGA,6CACA,2CACA,2BACA,sCACA,8BACA,sBAGA,mCACA,8BACA,gCACA,2CACA,4BACA,mDACA,uDACA,kDAGA,4CACA,0CACA,kCACA,0CACA,mCAGA,+BACA,+BACA,mCACA,uBACA,oCAGA,mBACA,8BACA,uCACA,sDACA,EACD,CACD,GAAI,YAEH,GACD,EAAA,EAAA,KAACA,EAAAA,OAAgB,KAAA,CAAK,QAAA,aACpB,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAgB,KAAM,GAAI,QAAS,IAAM,EACrB,CAAA,EACC,CAK9B,SAAS,EAAc,CAAE,YAAW,WAAU,WAAW,SAAU,GAAG,GAA+D,CACnI,OACE,EAAA,EAAA,KAACD,EAAAA,OAAgB,OAAA,CAAA,UACf,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,WAAA,EAAA,EAAA,IACE,yGACA,WACA,mCACA,mDAEA,+BACA,4BAEA,kCACA,+BAEA,yCACA,yCACA,yCACA,yCAEA,IAAa,UAAY,mCACzB,IAAa,UAAY,kCACzB,IAAa,UAAY,kCACzB,IAAa,UAAY,iCACzB,EACD,CACS,WACV,GAAI,YAEJ,EAAA,EAAA,KAACA,EAAAA,OAAgB,SAAA,CACf,WAAA,EAAA,EAAA,IACE,MACA,IAAa,UAAY,qBACzB,IAAa,UAAY,oCACzB,IAAa,UAAY,uCAC1B,CAEA,YACwB,EACH,CAAA,CACH,CAK7B,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,WAAA,EAAA,EAAA,IAAc,8CAA+C,EAAU,CAAE,GAAI,GAAS,CAI/I,SAAS,EAAW,CAAE,YAAW,WAAU,GAAG,GAA4D,CACxG,OACE,EAAA,EAAA,MAACA,EAAAA,OAAgB,KAAA,CACf,YAAU,cACV,WAAA,EAAA,EAAA,IACE,yCACA,iCACA,SACA,gDACA,8CAEA,kBACA,uBAEA,2BACA,oCAEA,8BACA,mBACA,uCACA,wDAEA,qBACA,6BACA,sBACA,EACD,CACD,GAAI,aAEJ,EAAA,EAAA,KAACA,EAAAA,OAAgB,SAAA,CAAU,WAAA,CAAoC,EAC/D,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,uEACd,EAAA,EAAA,KAACA,EAAAA,OAAgB,cAAA,CAAA,UACf,EAAA,EAAA,KAACE,EAAAA,UAAAA,CAAU,KAAM,GAAA,CAAM,CAAA,CACO,EAC3B,CAAA,EACc,CAK3B,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAiE,CACxG,OAAO,EAAA,EAAA,KAACF,EAAAA,OAAgB,UAAA,CAAU,YAAU,mBAAmB,WAAA,EAAA,EAAA,IAAc,qDAAsD,EAAU,CAAE,GAAI,GAAS"}
|
|
1
|
+
{"version":3,"file":"select-DfvSMRUq.cjs","names":["SelectPrimitive","ChevronDownIcon","CheckIcon"],"sources":["../packages/components/ui/select.tsx"],"sourcesContent":["'use client';\n\nimport { CheckIcon, ChevronDownIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Select as SelectPrimitive } from 'radix-ui';\n\n/**\n * Accessible dropdown select built on Radix UI's Select primitives, composed from `Select`, `SelectTrigger`, `SelectContent`, and `SelectItem`.\n *\n * @example\n * ```tsx\n * import {\n * Select, SelectTrigger, SelectValue,\n * SelectContent, SelectItem,\n * } from '@customafk/lunas-ui/ui/select';\n *\n * <Select>\n * <SelectTrigger>\n * <SelectValue placeholder=\"Pick a fruit\" />\n * </SelectTrigger>\n * <SelectContent>\n * <SelectItem value=\"apple\">Apple</SelectItem>\n * <SelectItem value=\"banana\">Banana</SelectItem>\n * </SelectContent>\n * </Select>\n * ```\n */\nfunction Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\n/** Groups related `SelectItem` elements with an optional `SelectLabel` header. */\nfunction SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\n/** Renders the currently selected value (or a placeholder) inside `SelectTrigger`. */\nfunction SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\n/**\n * The button that opens the select dropdown; renders the current value and a chevron icon.\n *\n * @param size - `'default'` (standard padding) or `'sm'` (compact).\n */\nfunction SelectTrigger({\n className,\n size = 'default',\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n /** Controls the trigger's padding — `'default'` or `'sm'`. */\n size?: 'sm' | 'default';\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n 'flex w-full items-center justify-between',\n 'outline-1 outline-border -outline-offset-1',\n 'gap-2 rounded bg-transparent px-3 py-2',\n 'rounded shadow-input transition-all',\n 'cursor-pointer whitespace-nowrap text-sm',\n\n // Text styles\n 'focus-visible:text-text-positive-strong',\n 'focus-visible:outline-primary-strong',\n 'focus-visible:ring-4',\n 'focus-visible:ring-primary-weak',\n\n // State styles\n 'data-[state=open]:text-text-positive-muted',\n 'data-[state=open]:outline-primary-strong',\n 'data-[state=open]:ring-4',\n 'data-[state=open]:ring-primary-weak',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n\n // Invalid state\n 'aria-invalid:bg-danger-bg-subtle',\n 'aria-invalid:outline-danger',\n 'aria-invalid:ring-danger-weak',\n 'aria-invalid:focus:outline-danger-strong',\n 'aria-invalid:focus:ring-4',\n 'aria-invalid:placeholder:text-text-positive-weak',\n 'aria-invalid:data-[state=open]:outline-danger-strong',\n 'aria-invalid:data-[state=open]:ring-danger-weak',\n\n // Placeholder styles\n 'data-placeholder:text-text-positive-muted',\n '*:data-[slot=select-value]:line-clamp-1',\n '*:data-[slot=select-value]:flex',\n '*:data-[slot=select-value]:items-center',\n '*:data-[slot=select-value]:gap-2',\n\n // Readonly state\n 'aria-readonly:bg-muted-muted',\n 'aria-readonly:cursor-default',\n 'aria-readonly:focus:outline-none',\n 'aria-readonly:ring-0',\n 'aria-readonly:pointer-events-none',\n\n // Icon styles\n '[&_svg]:shrink-0',\n '[&_svg]:pointer-events-none',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-muted-foreground\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon size={16} opacity={50} />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\n/** Floating dropdown panel that renders inside a portal with enter/exit animations. */\nfunction SelectContent({ className, children, position = 'popper', ...props }: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n 'relative z-50 max-h-80 min-w-32 overflow-y-auto overflow-x-hidden rounded shadow-dropdown duration-300',\n 'bg-white',\n 'w-(--radix-select-trigger-width)',\n 'origin-(--radix-select-content-transform-origin)',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in',\n\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out',\n\n 'data-[side=bottom]:slide-in-from-top-8',\n 'data-[side=left]:slide-in-from-right-8',\n 'data-[side=right]:slide-in-from-left-8',\n 'data-[side=top]:slide-in-from-bottom-8',\n\n position === 'popper' && 'data-[side=bottom]:translate-y-1',\n position === 'popper' && 'data-[side=left]:-translate-x-1',\n position === 'popper' && 'data-[side=right]:translate-x-1',\n position === 'popper' && 'data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' && 'w-full scroll-my-1',\n position === 'popper' && 'h-(--radix-select-trigger-height)',\n position === 'popper' && 'min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\n/** Non-interactive label displayed above a `SelectGroup` to describe its options. */\nfunction SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return <SelectPrimitive.Label data-slot=\"select-label\" className={cn('px-2 py-1.5 text-text-positive-weak text-xs', className)} {...props} />;\n}\n\n/** A selectable option within `SelectContent`; shows a check icon when chosen. */\nfunction SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n 'relative flex select-none items-center',\n 'gap-2 rounded py-2.5 pr-8 pl-2',\n 'w-full',\n 'cursor-pointer outline-none transition-colors',\n 'font-medium text-sm text-text-positive-weak',\n\n 'focus:shadow-xs',\n 'focus:bg-muted-muted',\n\n 'data-disabled:opacity-50',\n 'data-disabled:pointer-events-none',\n\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-text-positive-weak\",\n\n '*:[span]:last:flex',\n '*:[span]:last:items-center',\n '*:[span]:last:gap-2',\n className\n )}\n {...props}\n >\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon size={16} />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n}\n\n/** Thin horizontal rule used to visually separate groups of `SelectItem` elements. */\nfunction SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return <SelectPrimitive.Separator data-slot=\"select-separator\" className={cn('-mx-1 pointer-events-none my-1 h-px bg-border-weak', className)} {...props} />;\n}\n\nexport { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue };\n"],"mappings":"uKA6BA,SAAS,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,CAI/D,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAItE,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAQtE,SAAS,EAAc,CACrB,YACA,OAAO,UACP,WACA,GAAG,GAIF,CACD,OACE,EAAA,EAAA,MAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,YAAW,EACX,WAAA,EAAA,EAAA,IACE,2CACA,6CACA,yCACA,sCACA,2CAGA,0CACA,uCACA,uBACA,kCAGA,6CACA,2CACA,2BACA,sCACA,8BACA,sBAGA,mCACA,8BACA,gCACA,2CACA,4BACA,mDACA,uDACA,kDAGA,4CACA,0CACA,kCACA,0CACA,mCAGA,+BACA,+BACA,mCACA,uBACA,oCAGA,mBACA,8BACA,uCACA,sDACA,EACD,CACD,GAAI,YAEH,GACD,EAAA,EAAA,KAACA,EAAAA,OAAgB,KAAA,CAAK,QAAA,aACpB,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAgB,KAAM,GAAI,QAAS,IAAM,EACrB,CAAA,EACC,CAK9B,SAAS,EAAc,CAAE,YAAW,WAAU,WAAW,SAAU,GAAG,GAA+D,CACnI,OACE,EAAA,EAAA,KAACD,EAAAA,OAAgB,OAAA,CAAA,UACf,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,WAAA,EAAA,EAAA,IACE,yGACA,WACA,mCACA,mDAEA,+BACA,4BAEA,kCACA,+BAEA,yCACA,yCACA,yCACA,yCAEA,IAAa,UAAY,mCACzB,IAAa,UAAY,kCACzB,IAAa,UAAY,kCACzB,IAAa,UAAY,iCACzB,EACD,CACS,WACV,GAAI,YAEJ,EAAA,EAAA,KAACA,EAAAA,OAAgB,SAAA,CACf,WAAA,EAAA,EAAA,IACE,MACA,IAAa,UAAY,qBACzB,IAAa,UAAY,oCACzB,IAAa,UAAY,uCAC1B,CAEA,YACwB,EACH,CAAA,CACH,CAK7B,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,WAAA,EAAA,EAAA,IAAc,8CAA+C,EAAU,CAAE,GAAI,GAAS,CAI/I,SAAS,EAAW,CAAE,YAAW,WAAU,GAAG,GAA4D,CACxG,OACE,EAAA,EAAA,MAACA,EAAAA,OAAgB,KAAA,CACf,YAAU,cACV,WAAA,EAAA,EAAA,IACE,yCACA,iCACA,SACA,gDACA,8CAEA,kBACA,uBAEA,2BACA,oCAEA,8BACA,mBACA,uCACA,wDAEA,qBACA,6BACA,sBACA,EACD,CACD,GAAI,aAEJ,EAAA,EAAA,KAACA,EAAAA,OAAgB,SAAA,CAAU,WAAA,CAAoC,EAC/D,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,uEACd,EAAA,EAAA,KAACA,EAAAA,OAAgB,cAAA,CAAA,UACf,EAAA,EAAA,KAACE,EAAAA,UAAAA,CAAU,KAAM,GAAA,CAAM,CAAA,CACO,EAC3B,CAAA,EACc,CAK3B,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAiE,CACxG,OAAO,EAAA,EAAA,KAACF,EAAAA,OAAgB,UAAA,CAAU,YAAU,mBAAmB,WAAA,EAAA,EAAA,IAAc,qDAAsD,EAAU,CAAE,GAAI,GAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{Loader2Icon as e}from"lucide-react";import{jsx as t}from"react/jsx-runtime";import{cn as n}from"@customafk/react-toolkit/utils";function r({className:r,...i}){return t(e,{role:`status`,"aria-label":`Loading`,className:n(`size-4 animate-spin`,r),...i})}export{r as t};
|
|
2
|
-
//# sourceMappingURL=spinner-
|
|
2
|
+
//# sourceMappingURL=spinner-B3F9W53l.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner-
|
|
1
|
+
{"version":3,"file":"spinner-B3F9W53l.mjs","names":[],"sources":["../packages/components/ui/spinner.tsx"],"sourcesContent":["import { Loader2Icon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\n/**\n * Spinning loading indicator rendered as an animated `Loader2Icon` SVG with an accessible `role=\"status\"` and `aria-label`.\n *\n * @example\n * ```tsx\n * import { Spinner } from '@customafk/lunas-ui/ui/spinner';\n *\n * <Spinner className=\"size-6 text-primary\" />\n *\n * <Button disabled>\n * <Spinner /> Saving…\n * </Button>\n * ```\n */\nfunction Spinner({ className, ...props }: React.ComponentProps<'svg'>) {\n return <Loader2Icon role=\"status\" aria-label=\"Loading\" className={cn('size-4 animate-spin', className)} {...props} />;\n}\n\nexport { Spinner };\n"],"mappings":"uIAkBA,SAAS,EAAQ,CAAE,YAAW,GAAG,GAAsC,CACrE,OAAO,EAAC,EAAA,CAAY,KAAK,SAAS,aAAW,UAAU,UAAW,EAAG,sBAAuB,EAAU,CAAE,GAAI,GAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`lucide-react`),n=require(`react/jsx-runtime`),r=require(`@customafk/react-toolkit/utils`);function i({className:e,...i}){return(0,n.jsx)(t.Loader2Icon,{role:`status`,"aria-label":`Loading`,className:(0,r.cn)(`size-4 animate-spin`,e),...i})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
|
2
|
-
//# sourceMappingURL=spinner-
|
|
2
|
+
//# sourceMappingURL=spinner-rA8pMY6v.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner-
|
|
1
|
+
{"version":3,"file":"spinner-rA8pMY6v.cjs","names":["Loader2Icon"],"sources":["../packages/components/ui/spinner.tsx"],"sourcesContent":["import { Loader2Icon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\n/**\n * Spinning loading indicator rendered as an animated `Loader2Icon` SVG with an accessible `role=\"status\"` and `aria-label`.\n *\n * @example\n * ```tsx\n * import { Spinner } from '@customafk/lunas-ui/ui/spinner';\n *\n * <Spinner className=\"size-6 text-primary\" />\n *\n * <Button disabled>\n * <Spinner /> Saving…\n * </Button>\n * ```\n */\nfunction Spinner({ className, ...props }: React.ComponentProps<'svg'>) {\n return <Loader2Icon role=\"status\" aria-label=\"Loading\" className={cn('size-4 animate-spin', className)} {...props} />;\n}\n\nexport { Spinner };\n"],"mappings":"iJAkBA,SAAS,EAAQ,CAAE,YAAW,GAAG,GAAsC,CACrE,OAAO,EAAA,EAAA,KAACA,EAAAA,YAAAA,CAAY,KAAK,SAAS,aAAW,UAAU,WAAA,EAAA,EAAA,IAAc,sBAAuB,EAAU,CAAE,GAAI,GAAS"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./button-CwDT3m4m.cjs`),n=require(`./paragraph-DN85Huc4.cjs`),r=require(`./flex-BbbogTsZ.cjs`),i=require(`./date-a3RI5Pwo.cjs`),a=require(`./badge-uQ0pIZbQ.cjs`),o=require(`./tooltip-itUmYz9k.cjs`),s=require(`./avatar-CTS9-raY.cjs`),c=require(`./separator-BwZb12bh.cjs`),l=require(`./dropdown-menu-Ct9BLGfa.cjs`),u=require(`./progress-DE1FdQ1J.cjs`),d=require(`./checkbox-Di7ACavC.cjs`),f=require(`./spinner-rA8pMY6v.cjs`),p=require(`./resizable-DDPMwd28.cjs`),m=require(`./input-BMOYFJYM.cjs`);let h=require(`lucide-react`),g=require(`react`),_=require(`react/jsx-runtime`),v=require(`@customafk/react-toolkit/utils`),y=require(`@customafk/react-toolkit/color-hash`),b=require(`@tanstack/react-table`),x=require(`@tanstack/react-virtual`),ee=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);const S=()=>(0,_.jsxs)(`div`,{className:`flex gap-0 text-text-positive-weak`,children:[(0,_.jsx)(h.MinusIcon,{size:16}),(0,_.jsx)(h.MinusIcon,{size:16})]}),te=({label:e,onClick:t,onRemove:n})=>e?n?(0,_.jsxs)(`div`,{className:`flex w-fit gap-x-0.5 rounded-full border border-border py-1 pr-2 pl-3 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:[e,(0,_.jsx)(`button`,{className:`cursor-pointer text-text-positive-weak hover:text-text-positive-strong`,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,_.jsx)(h.XIcon,{size:12})})]}):(0,_.jsx)(`button`,{className:`w-fit rounded-full border border-border px-3 py-1 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:e}):(0,_.jsx)(S,{}),ne=({value:e})=>e==null?(0,_.jsx)(S,{}):e===!1?(0,_.jsx)(`div`,{className:`text-danger-strong`,children:(0,_.jsx)(h.XIcon,{})}):(0,_.jsx)(`div`,{className:`text-success-strong`,children:(0,_.jsx)(h.CheckIcon,{})}),C=(0,g.memo)(({value:e,currency:t=`USD`,locale:n=`en-US`,display:r=`symbol`,size:i=`md`,colorize:a=!1})=>{let o=(0,g.useMemo)(()=>{let i=typeof e==`string`?Number(e.trim()):e;return i==null||Number.isNaN(i)||!Number.isFinite(i)?null:new Intl.NumberFormat(n,{style:`currency`,currency:t,currencyDisplay:r,minimumFractionDigits:2,maximumFractionDigits:2}).format(i)},[e,t,n,r]),s=(0,g.useMemo)(()=>{let t=typeof e==`string`?Number(e.trim()):e;return typeof t==`number`&&t<0},[e]);return o?(0,_.jsx)(`p`,{className:(0,v.cn)(`font-number tabular-nums`,i===`xs`&&`text-xs`,i===`sm`&&`text-sm`,i===`md`&&`text-base`,i===`lg`&&`text-lg`,i===`xl`&&`text-xl`,!a&&`text-text-positive`,a&&s&&`text-danger-strong`,a&&!s&&`text-success-strong`),children:o}):(0,_.jsx)(S,{})});C.displayName=`UITableCurrencyDisplay`;const w=({date:e})=>e==null?(0,_.jsx)(S,{}):(0,_.jsx)(o.r,{children:(0,_.jsxs)(o.t,{children:[(0,_.jsx)(o.i,{asChild:!0,children:(0,_.jsx)(a.t,{className:`h-fit`,children:(0,_.jsx)(i.t,{date:e,format:`medium`,className:`font-normal text-white`})})}),(0,_.jsx)(o.n,{className:`rounded px-2`,children:(0,_.jsx)(i.t,{date:e,format:`full`,showTime:!0,className:`font-medium text-text-negative text-xs`})})]})}),T=({content:e})=>e==null?(0,_.jsx)(S,{}):(0,_.jsxs)(o.t,{children:[(0,_.jsx)(o.i,{children:(0,_.jsx)(n.t,{variant:`sm`,className:`line-clamp-2 whitespace-pre-line break-all`,children:e})}),(0,_.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,_.jsx)(n.t,{variant:`xs`,className:`whitespace-pre-line text-wrap break-keep text-text-negative-weak`,children:e}),(0,_.jsxs)(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),E=({email:e,linkable:t=!0})=>{let[n,r]=(0,g.useState)(!1);return e?(0,_.jsx)(o.r,{children:(0,_.jsxs)(`div`,{className:`group flex items-center gap-x-1.5`,children:[(0,_.jsx)(h.MailIcon,{size:13,className:`shrink-0 text-text-positive-weak`}),t?(0,_.jsx)(`a`,{href:`mailto:${e}`,className:`truncate text-primary text-sm underline-offset-2 hover:underline`,onClick:e=>e.stopPropagation(),children:e}):(0,_.jsx)(`span`,{className:`truncate text-text-positive text-sm`,children:e}),(0,_.jsxs)(o.t,{children:[(0,_.jsx)(o.i,{asChild:!0,children:(0,_.jsx)(`button`,{onClick:t=>{t.stopPropagation(),t.preventDefault(),navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},className:`shrink-0 cursor-pointer text-text-positive-weak opacity-0 transition-opacity group-hover:opacity-100 hover:text-text-positive`,children:n?(0,_.jsx)(h.CheckIcon,{size:13,className:`text-success-strong`}):(0,_.jsx)(h.CopyIcon,{size:13})})}),(0,_.jsx)(o.n,{children:n?`Copied!`:`Copy email`})]})]})}):(0,_.jsx)(S,{})},re=({items:e,maxVisible:t=3})=>{if(!e||e.length===0)return(0,_.jsx)(S,{});let n=e.slice(0,t),r=e.slice(t);return(0,_.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[n.map((e,t)=>(0,_.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-border bg-muted-weak px-2 py-0.5 text-text-positive text-xs`,children:e},t)),r.length>0&&(0,_.jsx)(o.r,{children:(0,_.jsxs)(o.t,{children:[(0,_.jsx)(o.i,{asChild:!0,children:(0,_.jsxs)(`span`,{className:`inline-flex cursor-default items-center rounded-full bg-primary-bg-subtle px-2 py-0.5 text-primary-intense text-xs`,children:[`+`,r.length,` more`]})}),(0,_.jsx)(o.n,{align:`start`,className:`flex max-w-64 flex-wrap gap-1 p-2`,children:r.map((e,t)=>(0,_.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-border px-2 py-0.5 text-text-negative text-xs`,children:e},t))})]})})]})},D=({items:e=[]})=>(0,_.jsxs)(l.t,{children:[(0,_.jsx)(l.h,{asChild:!0,children:(0,_.jsx)(t.t,{size:`sm`,variant:`ghost`,color:`secondary`,className:`size-9 rounded-full`,children:(0,_.jsx)(h.MoreVerticalIcon,{})})}),(0,_.jsx)(l.r,{children:(0,_.jsx)(l.i,{children:e.map(e=>(0,_.jsx)(l.a,{className:`px-3`,onSelect:t=>{e.onClick(e.id),t.stopPropagation()},children:e.label},e.id))})})]}),O=({name:e})=>e?(0,_.jsxs)(o.t,{children:[(0,_.jsx)(o.i,{children:(0,_.jsx)(n.t,{variant:`sm`,className:`line-clamp-2 w-full truncate text-wrap pb-px text-start`,children:e})}),(0,_.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,_.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,_.jsxs)(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):(0,_.jsx)(S,{}),ie=({href:e,label:t})=>(0,_.jsxs)(`a`,{href:e,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[(0,_.jsx)(`span`,{children:t||e}),(0,_.jsx)(h.ExternalLinkIcon,{size:14})]}),k=({value:e})=>(0,_.jsxs)(o.t,{children:[(0,_.jsx)(o.i,{asChild:!0,children:(0,_.jsx)(`p`,{className:`font-number text-secondary-foreground text-sm tabular-nums`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,_.jsx)(o.n,{align:`start`,children:(0,_.jsx)(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),A=(0,g.memo)(({value:e,showLabel:t=!0,successThreshold:n=70,warningThreshold:r=40})=>{if(e==null)return(0,_.jsx)(S,{});let i=Math.min(100,Math.max(0,e));return(0,_.jsxs)(`div`,{className:`flex w-full min-w-24 items-center gap-x-2`,children:[(0,_.jsx)(u.t,{value:i,className:(0,v.cn)(`flex-1`,i>=n?`[&>[data-slot=progress-indicator]]:bg-success`:i>=r?`[&>[data-slot=progress-indicator]]:bg-warning`:`[&>[data-slot=progress-indicator]]:bg-danger`)}),t&&(0,_.jsxs)(`span`,{className:`w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums`,children:[i,`%`]})]})});A.displayName=`UITableProgressDisplay`;const j=({title:e,onClick:n})=>(0,_.jsxs)(o.t,{children:[(0,_.jsx)(o.i,{children:(0,_.jsx)(t.t,{type:`button`,variant:`ghost`,color:`danger`,size:`icon`,onClick:(0,g.useCallback)(async e=>{e.preventDefault(),e.stopPropagation(),await n?.()},[n]),children:(0,_.jsx)(h.Trash2Icon,{})})}),(0,_.jsx)(o.n,{children:(0,_.jsx)(`p`,{children:e||`Remove item from list table`})})]}),ae=(e,t,n)=>{let r=10**t;switch(n){case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:return Math.round(e*r)/r}},oe=(0,g.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:n,suffix:i,precision:a,roundingMode:o=`round`,showTrailingZeros:s=!1,size:c=`lg`,value:l=0})=>{let u=(0,g.useMemo)(()=>{let e={};return typeof a==`number`&&a>=0&&s&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,s]),d=(0,g.useCallback)(e=>{let t=e;return typeof a==`number`&&a>=0&&(t=ae(e,a,o)),t.toLocaleString(`en-US`,u)},[o,u,a]),f=(0,g.useMemo)(()=>{if(typeof l==`number`)return Number.isNaN(l)||!Number.isFinite(l)?`N/A`:d(l);if(typeof l==`string`){let e=l.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:d(t)}return`N/A`},[l,d]),p=(0,g.useMemo)(()=>e===`.`&&t===`,`?f:f.replace(/,/g,t).replace(/\./g,e),[f,e,t]);return p===`0`||p===`N/A`||!p?(0,_.jsx)(S,{}):(0,_.jsxs)(r.t,{padding:`none`,className:(0,v.cn)(`font-number text-lg text-text-positive tabular-nums`,c===`xs`&&`text-xs`,c===`sm`&&`text-sm`,c===`md`&&`text-base`,c===`lg`&&`text-lg`,c===`xl`&&`text-xl`),children:[n,(0,_.jsx)(`p`,{children:p}),i]})});oe.displayName=`UITableStatisticDisplay`;const se=({value:e,colorMap:t,defaultColor:n=`muted`,variant:r=`soft`})=>e==null||e===``?(0,_.jsx)(S,{}):(0,_.jsx)(a.t,{variant:r,color:(t&&t[e])??n,className:`min-w-16 justify-center capitalize`,children:e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g,` `)}),ce=({uuid:e,username:t,email:i})=>(0,_.jsxs)(r.t,{wrap:!1,gap:`sm`,padding:`none`,children:[!e&&(0,_.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,_.jsx)(s.n,{className:`bg-muted-weak`,children:(0,_.jsx)(h.UserRoundIcon,{size:28,className:`text-text-negative`})})}),e&&(0,_.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,_.jsx)(s.n,{style:{backgroundColor:y.colorHashLight.hex(e)},children:(0,_.jsx)(h.UserRoundIcon,{size:28,className:`text-white`})})}),(0,_.jsxs)(r.t,{vertical:!0,padding:`none`,gap:`none`,align:`start`,children:[(0,_.jsx)(n.t,{className:`font-medium text-sm text-text-positive-weak`,children:t??`Unknown User`}),(0,_.jsx)(n.t,{variant:`sm`,className:`mt-0! text-text-positive-weak text-xs`,children:i})]})]}),le=60,ue=60,de=20,fe=20,pe=(0,g.createContext)(null),me=()=>{let e=(0,g.use)(pe);if(!e)throw Error(`useTableInnerWrapperContext must be used within a TableInnerWrapperProvider`);return e},he=(0,g.createContext)(null),ge=()=>{let e=(0,g.use)(he);if(!e)throw Error(`useTableInnerTableContext must be used within a TableInnerTableProvider`);return e},_e=(0,g.createContext)(null),ve=()=>{let e=(0,g.use)(_e);if(!e)throw Error(`useTableHeaderRowContext must be used within a TableHeaderRowProvider`);return e},M=(0,g.createContext)(null),N=()=>{let e=(0,g.use)(M);if(!e)throw Error(`useTableBodyContext must be used within a TableBodyProvider`);return e},P=(0,g.createContext)(null),ye=()=>{let e=(0,g.use)(P);if(!e)throw Error(`useTableRowContext must be used within a TableRowProvider`);return e},F=(0,g.createContext)(null),I=()=>{let e=(0,g.use)(F);if(!e)throw Error(`useTableContext must be used within a TableProvider`);return e},L=(0,g.memo)(({isPinned:e,onLeftPin:t,onRightPin:n,onUnpin:r,className:i})=>{let a=(0,g.useCallback)(()=>{t?.(`left`)},[t]),o=(0,g.useCallback)(()=>{n?.(`right`)},[n]),s=(0,g.useCallback)(()=>{r?.(!1)},[r]);return(0,_.jsxs)(l.t,{children:[(0,_.jsx)(l.h,{asChild:!0,children:(0,_.jsx)(`button`,{className:(0,v.cn)(`absolute right-2 z-10 p-0.5 opacity-0 bg-card`,`cursor-pointer rounded-full transition-all`,`text-text-positive-weak`,`[&>svg]:size-4`,`group-hover:opacity-100`,`hover:bg-muted-muted hover:text-text-positive`,i),children:(0,_.jsx)(h.EllipsisVerticalIcon,{})})}),(0,_.jsx)(l.r,{align:`end`,className:`w-64 p-4`,children:(0,_.jsxs)(l.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:[(0,_.jsx)(g.Activity,{mode:e?`visible`:`hidden`,children:(0,_.jsxs)(l.a,{onClick:s,children:[!!e&&`Unpin`,(0,_.jsx)(l.d,{children:(0,_.jsx)(h.PinOffIcon,{className:`size-4`})})]})}),(0,_.jsxs)(g.Activity,{mode:e?`hidden`:`visible`,children:[(0,_.jsxs)(l.a,{onClick:a,children:[e?`Unpin`:`Pin to Left`,(0,_.jsx)(l.d,{children:(0,_.jsx)(h.MoveLeftIcon,{className:`size-4`})})]}),(0,_.jsxs)(l.a,{onClick:o,children:[e?`Unpin`:`Pin to Right`,(0,_.jsx)(l.d,{children:(0,_.jsx)(h.MoveRightIcon,{className:`size-4`})})]})]})]})})]})});L.displayName=`UITableHeadCellOption`;const R=(0,g.memo)(({isPinned:e,isAllRowsSelected:t,style:n,onToggleAllRowsSelected:r,...i})=>{let a=(0,g.useCallback)(e=>{r?.(!!e)},[r]);return(0,_.jsx)(`th`,{slot:`table-header-cell`,"data-pinned":!0,style:{left:0,zIndex:20,width:60,maxWidth:60},className:(0,v.cn)(e?`sticky`:`relative`),...i,children:(0,_.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,_.jsx)(d.t,{"aria-label":`Select All Rows`,checked:t,onCheckedChange:a})})})});R.displayName=`UITableHeadCellSelect`;const z=(0,g.memo)(({isEmpty:e,isFetching:t})=>!e&&!t?null:(0,_.jsxs)(`div`,{className:`sticky left-0 flex min-h-96 flex-1 items-center justify-center bg-transparent text-text-positive-weak opacity-100`,children:[t&&(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,_.jsx)(f.t,{className:`size-12`}),(0,_.jsx)(`p`,{children:`Loading data...`})]}),e&&!t&&(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,_.jsx)(h.BoxIcon,{strokeWidth:1,size:48}),(0,_.jsx)(`p`,{children:`No data available`})]})]}));z.displayName=`UITableEmptyDisplay`;const be=(0,g.memo)(({className:e,children:t,...n})=>(0,_.jsx)(`div`,{slot:`table-wrapper`,className:(0,v.cn)(`relative m-0 flex size-full flex-col flex-nowrap items-start justify-start gap-2`,e),...n,children:t}));be.displayName=`UITableWrapper`;const B=(0,g.memo)(({children:e,...t})=>{let{innerWrapperId:n}=me();return(0,_.jsx)(`div`,{id:n,slot:`table-inner-wrapper`,className:`relative size-full overflow-auto border-b border-b-border border-l border-l-border bg-card`,...t,children:e})});B.displayName=`UITableInnerWrapper`;const V=(0,g.memo)(({children:e,...t})=>{let{table:n,innerTableId:r,totalSize:i}=ge(),a=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!a.current)return;let e=n.getFlatHeaders(),t=new ResizeObserver(t=>{requestAnimationFrame(()=>{let r=t[0].target;if(r instanceof HTMLTableElement){let i=t[0];if(!i)return;let a=i.contentRect.width,{left:o=[],right:s=[]}=n.getState().columnPinning,c=0,l=0,u=0,d=e.map(e=>{let{id:t}=e,n=t===`select`||t===`actions`,r=o.includes(t)||s.includes(t),i=e.getSize(),a=e.column.columnDef.maxSize;return n?(c+=60,{id:t,isFlex:!1,width:60}):r?(c+=i,{id:t,isFlex:!1,width:i}):e.column.columnDef.size||i!==150?(u+=i,{id:t,isFlex:!1,width:i}):(l++,{id:t,isFlex:!0,maxSize:a})}),f=a-c-u,p=l>0?Math.max(0,Math.floor(f/l)):0;d.forEach(e=>{if(e.isFlex){let t=e.maxSize?Math.min(p,e.maxSize):p;r.style.setProperty(`--header-${e.id}-size`,`${t}`),r.style.setProperty(`--col-${e.id}-size`,`${t}`),e.maxSize&&r.style.setProperty(`--col-${e.id}-maxSize`,`${e.maxSize}`)}else r.style.setProperty(`--header-${e.id}-size`,`${e.width}`),r.style.setProperty(`--col-${e.id}-size`,`${e.width}`)})}})});return t.observe(a.current),()=>t.disconnect()},[n.getState().columnSizingInfo,n.getState().columnSizing,n.getState().columnPinning]),(0,_.jsx)(`table`,{id:r,ref:a,slot:`table-inner-table`,className:`grid w-full table-fixed caption-bottom border-collapse border-spacing-0 flex-col content-start [&_tfoot_td]:border-t`,style:{minWidth:i},...t,children:e})});V.displayName=`UITableInnerTable`;const H=(0,g.memo)(({className:e,children:t,...n})=>(0,_.jsx)(`thead`,{slot:`table-head`,className:(0,v.cn)(`sticky top-0 z-20 h-9 w-full`,`grid select-none bg-muted-bg-subtle`,`border-b border-b-border shadow`,`font-medium text-[13px] text-text-positive-weak`,`[&_tr:not(:last-child)_td]:border-b`,`[&_th]:inline-flex`,`[&_th]:items-center`,`[&_th]:transition-all`,`[&_th]:duration-300`,`[&_th]:whitespace-nowrap`,`[&_th]:border-border`,`[&_th]:border-r`,`[&_th]:last:border-r-0`,`[&_th]:first:border-l-0`,`[&_tr_th:not([data-pinned=false])]:bg-muted-bg-subtle`,e),...n,children:t}));H.displayName=`UITableHead`;const U=(0,g.memo)(({headerGroup:e,className:t,...n})=>{let{isAllRowsSelected:r,columnPinningState:i,leftPinnedHeaders:a,rightPinnedHeaders:o,onToggleAllRowsSelected:s}=ve(),c=o[0]?.id,l=a[a.length-1]?.id;return(0,_.jsx)(`tr`,{slot:`table-head-row`,className:(0,v.cn)(`flex`,t),...n,children:e.headers.map((e,t)=>{let n=e.column.getIsVisible(),a=i.left?.includes(e.id)?`left`:i.right?.includes(e.id)?`right`:!1;return e.id===`select`?(0,_.jsx)(R,{isPinned:a,isAllRowsSelected:r,onToggleAllRowsSelected:s},e.id):(0,_.jsx)(W,{isVisible:n,isPinned:a,isFirstCell:e.id===c,isLastCell:e.id===l,isOptionsVisible:![`select`,`actions`].includes(e.id),headerId:e.id,headerColumn:e.column,colSpan:e.colSpan,onColumnPin:e.column.pin,onToggleVisibility:e.column.toggleVisibility,children:(0,b.flexRender)(e.column.columnDef.header,e.getContext())},`${e.id}-${t}`)})})});U.displayName=`UITableHeadRow`;const W=(0,g.memo)(({isVisible:e=!0,isPinned:t=!1,isFirstCell:n=!1,isLastCell:r=!1,isOptionsVisible:i=!0,headerId:a,headerColumn:o,className:s,children:c,onColumnPin:l,onToggleVisibility:u,...d})=>{let f=(0,g.useMemo)(()=>t?20:void 0,[t]),p=(0,g.useMemo)(()=>{let e=o?.getStart?.(`left`);return t===`left`&&typeof e==`number`?`${e}px`:void 0},[t,o]),m=(0,g.useMemo)(()=>{let e=o?.getAfter?.(`right`);return t===`right`&&typeof e==`number`?`${e}px`:void 0},[t,o]),h=(0,g.useMemo)(()=>`calc(var(--header-${a}-size) * 1px)`,[a]),y=(0,g.useMemo)(()=>o?.columnDef.minSize?`calc(var(--col-${a}-minSize) * 1px)`:void 0,[a,o]),b=(0,g.useMemo)(()=>o?.columnDef.maxSize?`calc(var(--col-${a}-maxSize) * 1px)`:void 0,[a,o]);return(0,_.jsxs)(`th`,{slot:`table-head-cell`,"data-pinned":t,"data-header":a,style:{zIndex:f,left:p,right:m,width:h,minWidth:y,maxWidth:b},className:(0,v.cn)(`group flex`,a===`actions`&&`border-r-0!`,t?`sticky`:`relative`,t===`left`&&r&&`border-r border-r-border`,t===`right`&&n&&`border-l border-l-border`,o?.columnDef.meta?.position===`center`&&`justify-center`,o?.columnDef.meta?.position===`end`&&`justify-end`,o?.columnDef.meta?.position===`start`&&`justify-start`,s),...d,children:[(0,_.jsx)(`div`,{className:`truncate px-4`,children:c}),i&&(0,_.jsx)(L,{isPinned:t,isVisible:e,onLeftPin:l,onRightPin:l,onUnpin:l})]})});W.displayName=`UITableHeadCell`;const G=(0,g.memo)(({height:e,className:t,children:n,...r})=>{let{isFetching:i,isEmpty:a}=N();return a||i?null:(0,_.jsx)(`tbody`,{slot:`table-body`,style:{height:e},className:(0,v.cn)(`relative w-full`,`grid`,`[&_tr]:absolute`,`[&_tr]:flex`,`[&_tr]:flex-none`,`[&_tr]:w-full`,`[&_tr]:cursor-pointer [&_tr]:focus:outline-none`,`[&_tr]:border-b [&_tr]:border-b-border`,`[&_td]:z-10`,`[&_td]:transition-all`,`[&_td]:duration-300`,`[&_td]:flex`,`[&_td]:flex-none`,`[&_td]:overflow-hidden`,`[&_td]:whitespace-nowrap`,`[&_td]:px-4`,`[&_td]:py-2.5`,`[&_td]:align-middle`,`[&_td]:border-border`,`[&_td]:data-[selected=true]:bg-muted-muted!`,`[&_td]:data-[selected=true]:hover:bg-muted-muted!`,`[&_td>div]:inline-flex`,`[&_td>div]:items-center`,`[&_td>div]:w-full`,`[&_td:not([data-pinned=false])]:z-20`,`[&_td:not([data-pinned=false])]:sticky`,`[&_td:not([data-pinned=false])]:bg-card`,t),...r,children:n})});G.displayName=`UITableBody`;const K=(0,g.memo)(({row:e,isSelected:t,virtualRowIndex:n,virtualRowStart:r,children:i,...a})=>{let{keyOfClickRow:o,isAllRowsSelected:s,columnPinningState:c,leftPinnedHeaders:l,rightPinnedHeaders:u,onClickRow:d}=ye(),f=(0,g.useMemo)(()=>c.left??[],[c]),p=(0,g.useMemo)(()=>c.right??[],[c]),m=(0,g.useMemo)(()=>u?.[0]?.id,[u]),h=(0,g.useMemo)(()=>l?.[l.length-1]?.id,[l]),v=(0,g.useCallback)(t=>{let r=o?e.original?.[o]:void 0;d?.(n,typeof r==`string`||typeof r==`number`?r:void 0),t.preventDefault(),t.stopPropagation()},[o,d,e,n]);return(0,_.jsx)(`tr`,{slot:`table-row`,"data-index":n,style:{transform:`translateY(${r}px)`},className:`group [&_td]:border-r [&_td]:border-r-border [&_td]:last:border-r-0`,onClick:v,...a,children:e.getVisibleCells().map((e,r)=>{let i=f.includes(e.column.id),a=p.includes(e.column.id),o=i?`left`:a?`right`:!1;return e.column.id===`actions`?(0,_.jsx)(J,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,virtualRowIndex:n,column:e.column,getContext:e.getContext},`${e.id}-${r}`):e.column.id===`select`?(0,_.jsx)(q,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,isPinned:o,isSelected:s||t,onToggleRowSelected:e.row.toggleSelected},`${e.id}-${r}`):(0,_.jsx)(Y,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,isPinned:o,isFirstCell:e.column.id===m,isLastCell:e.column.id===h,colId:e.column.id,position:e.column.columnDef.meta?.position??`start`,column:e.column,getContext:e.getContext},`${e.id}-${r}`)})})});K.displayName=`UITableRow`;const q=(0,g.memo)(({isPinned:e,isSelected:t=!1,className:n,onToggleRowSelected:r,...i})=>{let a=(0,g.useCallback)(e=>{r?.(!!e)},[r]);return(0,_.jsx)(`td`,{slot:`table-body-cell`,"data-pinned":!0,style:{left:0,zIndex:20,width:60,maxWidth:60},className:(0,v.cn)(`group-hover:bg-muted-bg-subtle!`,e?`sticky`:`relative`,n),...i,children:(0,_.jsx)(`div`,{"data-slot":`table-cell-inner`,className:`flex! w-full! items-center justify-center bg-transparent text-center align-middle`,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,_.jsx)(d.t,{"aria-label":`Select Row`,checked:t,onCheckedChange:a})})})});q.displayName=`UITableCellSelect`;const J=(0,g.memo)(({virtualRowIndex:e,column:t,getContext:n,className:r,...i})=>{let a=(0,g.useMemo)(()=>(0,b.flexRender)(t?.columnDef.cell,n()),[t,n]);return(0,_.jsx)(`td`,{"data-col":`actions`,"data-cell":e,className:`sticky border-r-0! inset-y-0 right-0 z-50 flex items-center pr-4 group-hover:bg-muted-bg-subtle!`,...i,children:a})});J.displayName=`UITableCellActions`;const Y=(0,g.memo)(({isPinned:e=!1,isFirstCell:t=!1,isLastCell:n=!1,colId:r,position:i=`start`,column:a,getContext:o,...s})=>{let{innerTableId:c,table:l}=ge(),u=(0,g.useRef)(document.querySelector(`table[id="${c}"]`)),d=(0,g.useRef)(null),f=(0,g.useMemo)(()=>{let t=a?.getStart(`left`);return e===`left`&&typeof t==`number`?`${t}px`:void 0},[e,a]),p=(0,g.useMemo)(()=>{let t=a?.getAfter(`right`);return e===`right`&&typeof t==`number`?`${t}px`:void 0},[e,a]),m=(0,g.useMemo)(()=>`calc(var(--col-${r}-size) * 1px)`,[r]),h=(0,g.useMemo)(()=>a?.columnDef.minSize?`calc(var(--col-${r}-minSize) * 1px)`:void 0,[r,a]),y=(0,g.useMemo)(()=>a?.columnDef.maxSize?`calc(var(--col-${r}-maxSize) * 1px)`:void 0,[r,a]),x=(0,g.useMemo)(()=>(0,b.flexRender)(a?.columnDef.cell,o()),[a,o]);return(0,g.useEffect)(()=>{if(!d.current)return;let e=d.current.scrollWidth,t=a?.getSize();t&&e>t&&u.current instanceof HTMLTableElement&&typeof r==`string`&&a?.columnDef.meta?.fitContent&&l.setColumnSizing(t=>({...t,[r]:e+32}))},[r,a,l]),(0,_.jsx)(`td`,{slot:`table-body-cell`,"data-pinned":e,"data-lastcell":n||void 0,"data-firstcell":t||void 0,style:{left:f,right:p,width:m,minWidth:h,maxWidth:y},className:(0,v.cn)(`group-hover:bg-muted-bg-subtle!`,e===`left`&&n&&`border-r border-r-border`,e===`right`&&t&&`border-l border-l-border`),...s,children:(0,_.jsx)(`div`,{ref:d,slot:`table-body-cell-inner`,className:(0,v.cn)(`overflow-x-hidden`,i===`start`&&`justify-start`,i===`center`&&`justify-center`,i===`end`&&`justify-end`),children:x})})});Y.displayName=`UITableCell`;const xe=(0,g.memo)(({className:e,children:t,...n})=>(0,_.jsx)(`tfoot`,{slot:`table-footer`,className:(0,v.cn)(`flex w-full justify-center border-border-weak border-t py-2 font-medium [&>tr]:last:border-b-0`,e),...n,children:t}));xe.displayName=`UITableFooter`;const X=(0,g.memo)(({virtualRowIndex:e,virtualRowStart:t,fetchMoreData:n})=>{let{innerWrapperId:r}=me(),i=(0,g.useRef)(document.querySelector(`div[id="${r}"]`)),a=(0,g.useRef)(null),[o,s]=(0,g.useState)(`idle`),[c,l]=(0,g.useState)(0),u=(0,g.useCallback)(async()=>{try{s(`fetching`),await n?.(),s(`idle`)}catch(e){console.error(`Error fetching more data:`,e),s(`error`)}},[n]);return(0,g.useEffect)(()=>{if(!i.current)return;let e=new ResizeObserver(e=>{l(e[0].contentRect.width)});return e.observe(i.current),()=>e.disconnect()},[]),n?(0,_.jsx)(`tr`,{ref:a,"data-index":e,style:{transform:`translateY(${t}px)`,width:c},className:`sticky! left-0 h-10`,children:(0,_.jsx)(`td`,{className:`absolute left-0 flex w-full items-center justify-center text-xs`,children:(0,_.jsxs)(`button`,{type:`button`,disabled:o===`fetching`,className:(0,v.cn)(`flex cursor-pointer gap-x-0.5`,o===`fetching`&&`cursor-not-allowed`,o===`idle`&&`text-text-positive-weak hover:text-text-positive`,o===`error`&&`text-danger hover:text-danger-strong`),onClick:u,children:[o===`idle`&&(0,_.jsx)(h.ChevronDown,{className:`size-4`}),o===`fetching`&&(0,_.jsx)(f.t,{className:`size-4 animate-spin`}),o===`error`&&(0,_.jsx)(h.AlertTriangle,{className:`size-4 text-danger`}),o===`idle`&&`Load More`,o===`fetching`&&`Loading...`,o===`error`&&`Error! Retry?`]})})}):null});X.displayName=`UITableLoadMore`;const Se=()=>{let{table:e,isEmpty:t,isFetching:n,fetchMoreData:r}=I(),{rowSelectionState:i}=N(),a=(0,g.useRef)(null),{rows:o}=e.getRowModel(),s=(0,x.useVirtualizer)({count:o.length+1,estimateSize:()=>40,getScrollElement:()=>a.current,measureElement:typeof window<`u`&&navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:2}),c=(0,g.useMemo)(()=>{let e=s.getTotalSize(),t=a.current?.clientHeight||0;return e<t?`${t}px`:`${e}px`},[s.getTotalSize()]);return(0,_.jsx)(p.r,{direction:`horizontal`,style:{direction:e.options.columnResizeDirection},className:`relative flex w-full max-w-full flex-1 gap-1 overflow-auto border-t border-t-border border-r border-r-border bg-slate-50 p-0 text-sm`,children:(0,_.jsx)(p.n,{className:`relative`,children:(0,_.jsxs)(B,{ref:a,children:[(0,_.jsxs)(V,{children:[(0,_.jsx)(H,{children:e.getHeaderGroups().map(e=>(0,_.jsx)(U,{headerGroup:e},e.id))}),(0,_.jsx)(G,{height:c,children:s.getVirtualItems().map(e=>{let t=o[e.index],n=Object.entries(i).some(([e,n])=>e===`${t?.id}`&&n);return t?(0,_.jsx)(K,{ref:s.measureElement,row:t,isSelected:n,virtualRowIndex:e.index,virtualRowStart:e.start},e.index):(0,_.jsx)(X,{virtualRowIndex:e.index,virtualRowStart:e.start,fetchMoreData:r},e.index)})})]}),(0,_.jsx)(z,{isEmpty:t,isFetching:n})]})})})},Ce=({checked:e,title:t,onCheckedChange:n})=>(0,_.jsxs)(`div`,{className:`flex h-fit items-center gap-2`,children:[(0,_.jsx)(d.t,{checked:e,onCheckedChange:n}),(0,_.jsx)(`p`,{className:`text-sm`,children:t})]}),we=()=>{let{table:e}=I(),[n,r]=(0,g.useState)(null);return(0,_.jsx)(p.n,{defaultSize:25,className:(0,v.cn)(`bg-card`,n===null?`max-w-8!`:`min-w-64`),children:(0,_.jsxs)(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[(0,_.jsxs)(`div`,{className:`flex-1`,children:[(0,_.jsx)(g.Activity,{mode:n===`columns`?`visible`:`hidden`,children:(0,_.jsxs)(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[(0,_.jsx)(`p`,{className:`px-2 font-medium`,children:`Columns Visibility`}),(0,_.jsx)(c.t,{}),(0,_.jsx)(`div`,{className:`flex flex-col gap-4 pt-4`,children:e.getAllColumns().map(e=>[`select`,`actions`].includes(e.id)?null:(0,_.jsx)(Ce,{checked:e.getIsVisible(),title:String(e.columnDef.header),onCheckedChange:t=>e.toggleVisibility(!!t)},e.id))})]})}),(0,_.jsx)(g.Activity,{mode:n===`filters`?`visible`:`hidden`,children:(0,_.jsx)(`div`,{className:`flex size-full flex-col p-2`,children:(0,_.jsxs)(t.t,{variant:`outline`,color:`muted`,children:[(0,_.jsx)(h.ListFilterPlus,{}),`Add Filter`]})})})]}),(0,_.jsxs)(`div`,{className:`flex h-full flex-col border-border border-l bg-muted-bg-subtle text-sm`,children:[(0,_.jsxs)(`button`,{className:(0,v.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`columns`&&`bg-card`),onClick:()=>r(n===`columns`?null:`columns`),children:[(0,_.jsx)(h.Columns4Icon,{size:18}),(0,_.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Columns`})]}),(0,_.jsx)(c.t,{}),(0,_.jsxs)(`button`,{className:(0,v.cn)(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`filters`&&`bg-card`),onClick:()=>r(n===`filters`?null:`filters`),children:[(0,_.jsx)(h.ListFilterIcon,{size:18}),(0,_.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Filters`})]}),(0,_.jsx)(c.t,{})]})]})})},Te=(0,g.memo)(({innerWrapperId:e,children:t})=>{let n=(0,g.useMemo)(()=>({innerWrapperId:e}),[e]);return(0,_.jsx)(pe.Provider,{value:n,children:t})});Te.displayName=`UITableInnerWrapperProvider`;const Z=(0,g.memo)(({table:e,innerTableId:t,totalSize:n,children:r})=>{let i=(0,g.useMemo)(()=>({table:e,innerTableId:t,totalSize:n}),[e,t,n]);return(0,_.jsx)(he.Provider,{value:i,children:r})});Z.displayName=`UITableInnerTableProvider`;const Ee=(0,g.memo)(({isAllRowsSelected:e,columnPinningState:t,leftPinnedHeaders:n,rightPinnedHeaders:r,onToggleAllRowsSelected:i,children:a})=>{let o=(0,g.useMemo)(()=>({isAllRowsSelected:e,columnPinningState:t,leftPinnedHeaders:n,rightPinnedHeaders:r,onToggleAllRowsSelected:i}),[e,t,n,r,i]);return(0,_.jsx)(_e.Provider,{value:o,children:a})});Ee.displayName=`UITableHeadRowProvider`;const De=(0,g.memo)(({isFetching:e,isEmpty:t,rowSelectionState:n,children:r})=>{let i=(0,g.useMemo)(()=>({isFetching:e,isEmpty:t,rowSelectionState:n}),[e,t,n]);return(0,_.jsx)(M.Provider,{value:i,children:r})});De.displayName=`UITableBodyProvider`;const Oe=(0,g.memo)(({keyOfClickRow:e,isAllRowsSelected:t,columnPinningState:n,leftPinnedHeaders:r,rightPinnedHeaders:i,onClickRow:a,children:o})=>{let s=(0,g.useMemo)(()=>({keyOfClickRow:e,isAllRowsSelected:t,columnPinningState:n,leftPinnedHeaders:r,rightPinnedHeaders:i,onClickRow:a}),[e,t,n,r,i,a]);return(0,_.jsx)(P.Provider,{value:s,children:o})});Oe.displayName=`UITableRowProvider`;const ke=({title:e,isFetching:t=!1,isRefetching:n=!1,data:r,columns:i,totalRows:a,leftPinnedColumns:o=[],rightPinnedColumns:s=[],keyOfClickRow:c,onClickRow:l,onRowSelection:u,onColumnPinning:d,fetchMoreData:f,children:p})=>{let m=(0,g.useId)(),h=(0,g.useId)(),[v,y]=(0,g.useState)({}),[x,ee]=(0,g.useState)({right:s,left:[`select`,...o]}),[S,te]=(0,g.useState)({}),ne=(0,g.useCallback)(e=>(y(e),u?.(e instanceof Function?e(v):e),e),[v,u]),C=(0,g.useCallback)(e=>{ee(e),d?.(e instanceof Function?e(x):e)},[x,d]),w=(0,b.useReactTable)({data:r,columns:i,state:{rowSelection:v,columnPinning:x,expanded:S},defaultColumn:{enableResizing:!1,size:void 0,minSize:void 0,maxSize:void 0},columnResizeMode:`onChange`,columnResizeDirection:`ltr`,enableColumnPinning:!0,enableRowSelection:!0,enableColumnResizing:!0,enableMultiRowSelection:!0,autoResetAll:!1,autoResetExpanded:!1,autoResetPageIndex:!1,getSubRows:e=>e.subRows,getCoreRowModel:(0,b.getCoreRowModel)(),getGroupedRowModel:(0,b.getGroupedRowModel)(),getExpandedRowModel:(0,b.getExpandedRowModel)(),onRowSelectionChange:ne,onColumnPinningChange:C,onExpandedChange:te}),T=(0,g.useMemo)(()=>{let{rows:e}=w.getRowModel();return e},[w.getRowModel().rows,w.getState().columnPinning]),E=(0,g.useMemo)(()=>!t&&T.length===0,[T,t]),re=(0,g.useMemo)(()=>({title:e,table:w,isEmpty:E,isFetching:t,isRefetching:n,totalRows:a,fetchMoreData:f}),[e,w,E,n,t,a,f,w.getState().columnPinning,w.getState().expanded]),D=(0,g.useMemo)(()=>w.getState(),[w.getState()]),O=(0,g.useMemo)(()=>w.getIsAllRowsSelected(),[w.getIsAllRowsSelected()]),ie=(0,g.useMemo)(()=>D.rowSelection,[D.rowSelection]),k=(0,g.useMemo)(()=>D.columnPinning,[D.columnPinning]),A=(0,g.useMemo)(()=>w.getLeftHeaderGroups()[0]?.headers||[],[w.getState().columnPinning]),j=(0,g.useMemo)(()=>w.getRightHeaderGroups()[0]?.headers||[],[w.getState().columnPinning]),ae=(0,g.useMemo)(()=>w.getTotalSize(),[w.getTotalSize()]);return(0,_.jsx)(F.Provider,{value:re,children:(0,_.jsx)(Te,{innerWrapperId:m,children:(0,_.jsx)(Z,{table:w,innerTableId:h,totalSize:ae,children:(0,_.jsx)(Ee,{isAllRowsSelected:O,columnPinningState:k,leftPinnedHeaders:A,rightPinnedHeaders:j,onToggleAllRowsSelected:w.toggleAllRowsSelected,children:(0,_.jsx)(De,{isFetching:t,isEmpty:E,rowSelectionState:ie,children:(0,_.jsx)(Oe,{keyOfClickRow:c,isAllRowsSelected:O,columnPinningState:k,leftPinnedHeaders:A,rightPinnedHeaders:j,onClickRow:l,children:p})})})})})})},Ae=({onSearch:e,onChange:t,...n})=>{let r=(0,ee.useDebounceCallback)(t=>{e?.(t)},500);return(0,_.jsxs)(`div`,{className:`relative w-full max-w-80 flex-1`,children:[(0,_.jsx)(m.t,{...n,size:`lg`,type:`search`,placeholder:`Search records...`,className:`flex-1 ps-9 pe-9`,onChange:e=>{t?.(e),r(e.target.value??``)}}),(0,_.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50`,children:(0,_.jsx)(h.SearchIcon,{size:16})}),(0,_.jsx)(`button`,{className:`absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Submit search`,type:`submit`,children:(0,_.jsx)(h.ArrowRightIcon,{size:16,"aria-hidden":`true`})})]})},Q=({children:e,disabled:t,onClick:n})=>(0,_.jsx)(`button`,{type:`button`,disabled:t,className:`flex cursor-pointer items-center gap-x-1 rounded-sm border border-border bg-background p-2.5 text-sm text-text-positive-weak outline-none transition-all hover:shadow-card focus:border-border-emphasis focus:bg-muted-muted active:border-border-emphasis active:bg-muted-muted active:text-text-positive disabled:pointer-events-none disabled:cursor-default disabled:opacity-60 [&_svg]:size-3.5`,onClick:n,children:e}),je=({onCreate:e,onDownload:t,onRefresh:n})=>(0,_.jsxs)(`div`,{className:`flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,children:[(0,_.jsx)(Q,{disabled:!e,onClick:t=>{e?.(),t.stopPropagation(),t.preventDefault()},children:(0,_.jsx)(h.CirclePlus,{})}),(0,_.jsx)(Q,{disabled:!n,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,_.jsx)(h.RefreshCwIcon,{})}),(0,_.jsx)(Q,{disabled:!t,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:(0,_.jsx)(h.DownloadIcon,{})})]}),$=({children:e})=>{let{title:t}=I();return(0,_.jsxs)(`div`,{"data-slot":`table-tooltip`,className:`relative m-0 flex w-full flex-0 flex-col flex-wrap items-start space-y-2 p-0 px-2 text-sm`,children:[(0,_.jsx)(`h3`,{className:`font-semibold text-base text-text-positive`,children:t}),(0,_.jsx)(`div`,{className:`flex w-full flex-1 justify-between gap-x-2`,children:e})]})};$.displayName=`TableTooltip`,Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return B}});
|
|
2
|
+
//# sourceMappingURL=tables-D1JyNmcV.cjs.map
|