@customafk/lunas-ui 0.1.84 → 0.1.85
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/{button-BCcQbHEm.d.mts → button-BACBDBid.d.cts} +7 -7
- package/dist/{button-Ck5RvSE5.d.cts → button-j-XyI_BU.d.mts} +7 -7
- package/dist/cards/simple-card.d.mts +2 -2
- package/dist/{checkbox-C0xklub2.mjs → checkbox-D4K3ZATY.mjs} +1 -1
- package/dist/{checkbox-C0xklub2.mjs.map → checkbox-D4K3ZATY.mjs.map} +1 -1
- package/dist/{checkbox-CmnqBVWN.cjs → checkbox-DDuYFG0R.cjs} +1 -1
- package/dist/{checkbox-CmnqBVWN.cjs.map → checkbox-DDuYFG0R.cjs.map} +1 -1
- package/dist/data-display/empty.d.mts +2 -2
- package/dist/data-display/statistic.d.cts +4 -4
- package/dist/{dialog-BEFCmb9t.d.cts → dialog-B8BAhR8k.d.cts} +12 -12
- package/dist/{dialog-DoxEIli0.d.mts → dialog-DXBsPqiq.d.mts} +12 -12
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +26 -26
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +26 -26
- package/dist/{dropdown-menu-BuyuU6uF.cjs → dropdown-menu-5Zyw5t_J.cjs} +1 -1
- package/dist/{dropdown-menu-BuyuU6uF.cjs.map → dropdown-menu-5Zyw5t_J.cjs.map} +1 -1
- package/dist/{dropdown-menu-B8GUTfTp.mjs → dropdown-menu-BwcDzb4B.mjs} +1 -1
- package/dist/{dropdown-menu-B8GUTfTp.mjs.map → dropdown-menu-BwcDzb4B.mjs.map} +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.cjs.map +1 -1
- package/dist/features/tables/index.d.cts +12 -2
- package/dist/features/tables/index.d.mts +12 -2
- package/dist/features/tables/index.mjs +1 -1
- package/dist/features/tables/index.mjs.map +1 -1
- package/dist/features/tanstack-form/index.d.cts +90 -90
- package/dist/features/tanstack-form/index.d.mts +90 -90
- package/dist/{input-MYKLgwv_.d.mts → input-B4W9MM2a.d.cts} +6 -6
- package/dist/{input-CX8DkfC0.d.cts → input-CmnQ1O79.d.mts} +5 -5
- package/dist/layouts/flex.d.cts +9 -9
- package/dist/layouts/flex.d.mts +9 -9
- 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/typography/paragraph.d.cts +2 -2
- package/dist/typography/paragraph.d.mts +2 -2
- 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.d.cts +7 -7
- package/dist/ui/alert.d.mts +7 -7
- 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 +4 -4
- package/dist/ui/badge.d.mts +4 -4
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.d.cts +7 -7
- package/dist/ui/button-group.d.mts +7 -7
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- 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.cjs +1 -1
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/dropdown-menu.mjs +1 -1
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.mts +9 -9
- package/dist/ui/field.d.cts +25 -25
- package/dist/ui/field.d.mts +25 -25
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/form.d.cts +7 -7
- package/dist/ui/form.d.mts +11 -11
- 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.d.cts +1 -1
- package/dist/ui/input.d.mts +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/item.d.cts +16 -16
- package/dist/ui/item.d.mts +16 -16
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.mts +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 +11 -11
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/popover.d.cts +5 -5
- package/dist/ui/popover.d.mts +5 -5
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.mts +4 -4
- package/dist/ui/scroll-area.d.cts +6 -6
- package/dist/ui/scroll-area.d.mts +6 -6
- package/dist/ui/select.d.cts +11 -11
- package/dist/ui/select.d.mts +11 -11
- 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.d.cts +28 -28
- package/dist/ui/sidebar.d.mts +28 -28
- 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.d.cts +2 -2
- package/dist/ui/spinner.d.mts +2 -2
- 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.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- 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 +4 -4
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.d.mts +5 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu-BuyuU6uF.cjs","names":["DropdownMenuPrimitive","CheckIcon","CircleIcon","ChevronRightIcon"],"sources":["../packages/components/ui/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({ className, sideOffset = 4, align = 'start', ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-text-positive',\n 'z-50',\n 'min-w-32',\n 'overflow-y-auto overflow-x-hidden',\n 'rounded-md p-1.5 shadow-dropdown',\n 'max-h-(--radix-dropdown-menu-content-available-height)',\n 'origin-(--radix-dropdown-menu-content-transform-origin)',\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=closed]:zoom-out-95',\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 align={align}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-2.5 text-sm outline-hidden transition-all',\n 'focus:bg-muted-muted',\n 'focus:text-text-positive-strong',\n 'data-inset:pl-8',\n 'data-disabled:pointer-events-none',\n 'data-disabled:opacity-50',\n 'data-[variant=destructive]:text-danger',\n 'data-[variant=destructive]:focus:bg-danger-muted',\n 'data-[variant=destructive]:focus:text-danger-strong',\n 'data-[variant=destructive]:*:[svg]:text-danger!',\n '[&_svg]:shrink-0',\n '[&_svg]:pointer-events-none',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-text-positive-weak\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden',\n 'focus:bg-muted-muted',\n 'focus:text-text-positive-strong',\n 'data-disabled:opacity-50',\n 'data-disabled:pointer-events-none',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon size={16} />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden',\n 'focus:bg-accent-muted',\n 'focus:text-text-positive-strong',\n 'data-disabled:pointer-events-none',\n 'data-disabled:opacity-50',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 font-medium text-sm data-inset:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return <DropdownMenuPrimitive.Separator data-slot=\"dropdown-menu-separator\" className={cn('-mx-1 my-1 h-px bg-border-weak', className)} {...props} />;\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return <span data-slot=\"dropdown-menu-shortcut\" className={cn('ml-auto text-text-positive-muted text-xs tracking-widest', className)} {...props} />;\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden',\n 'focus:bg-accent-muted',\n 'focus:text-text-positive-strong',\n 'data-[state=open]:bg-muted-muted',\n 'data-[state=open]:text-text-positive-strong',\n 'data-inset:pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-text-positive',\n 'z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md p-1 shadow-dropdown',\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n 'data-[state=closed]:zoom-out-95',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\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 );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n};\n"],"mappings":"uKAQA,SAAS,EAAa,CAAE,GAAG,GAAkE,CAC3F,OAAO,EAAA,EAAA,KAACA,EAAAA,aAAsB,KAAA,CAAK,YAAU,gBAAgB,GAAI,GAAS,CAG5E,SAAS,EAAmB,CAAE,GAAG,GAAoE,CACnG,OAAO,EAAA,EAAA,KAACA,EAAAA,aAAsB,OAAA,CAAO,YAAU,uBAAuB,GAAI,GAAS,CAGrF,SAAS,EAAoB,CAAE,GAAG,GAAqE,CACrG,OAAO,EAAA,EAAA,KAACA,EAAAA,aAAsB,QAAA,CAAQ,YAAU,wBAAwB,GAAI,GAAS,CAGvF,SAAS,EAAoB,CAAE,YAAW,aAAa,EAAG,QAAQ,QAAS,GAAG,GAAqE,CACjJ,OACE,EAAA,EAAA,KAACA,EAAAA,aAAsB,OAAA,CAAA,UACrB,EAAA,EAAA,KAACA,EAAAA,aAAsB,QAAA,CACrB,YAAU,wBACE,aACZ,WAAA,EAAA,EAAA,IACE,gCACA,OACA,WACA,oCACA,mCACA,yDACA,0DACA,+BACA,8BACA,+BACA,kCACA,iCACA,kCACA,yCACA,yCACA,yCACA,yCACA,EACD,CACD,GAAI,EACG,SACP,CAAA,CAC2B,CAInC,SAAS,EAAkB,CAAE,GAAG,GAAmE,CACjG,OAAO,EAAA,EAAA,KAACA,EAAAA,aAAsB,MAAA,CAAM,YAAU,sBAAsB,GAAI,GAAS,CAGnF,SAAS,EAAiB,CACxB,YACA,QACA,UAAU,UACV,GAAG,GAIF,CACD,OACE,EAAA,EAAA,KAACA,EAAAA,aAAsB,KAAA,CACrB,YAAU,qBACV,aAAY,EACZ,eAAc,EAC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E,GAAI,GACJ,CAIN,SAAS,EAAsB,CAAE,YAAW,GAAG,GAAuE,CACpH,OAAO,EAAA,EAAA,KAACA,EAAAA,aAAsB,UAAA,CAAU,YAAU,0BAA0B,WAAA,EAAA,EAAA,IAAc,iCAAkC,EAAU,CAAE,GAAI,GAAS,CAGvJ,SAAS,EAAqB,CAAE,YAAW,GAAG,GAAuC,CACnF,OAAO,EAAA,EAAA,KAAC,OAAA,CAAK,YAAU,yBAAyB,WAAA,EAAA,EAAA,IAAc,2DAA4D,EAAU,CAAE,GAAI,GAAS,CAGrJ,SAAS,EAAgB,CAAE,GAAG,GAAiE,CAC7F,OAAO,EAAA,EAAA,KAACA,EAAAA,aAAsB,IAAA,CAAI,YAAU,oBAAoB,GAAI,GAAS,CAG/E,SAAS,EAAuB,CAC9B,YACA,QACA,WACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,MAACA,EAAAA,aAAsB,WAAA,CACrB,YAAU,4BACV,aAAY,EACZ,WAAA,EAAA,EAAA,IACE,6FACA,wBACA,kCACA,mCACA,8CACA,kBACA,EACD,CACD,GAAI,YAEH,GACD,EAAA,EAAA,KAACG,EAAAA,iBAAAA,CAAiB,UAAU,iBAAA,CAAmB,CAAA,EACd,CAIvC,SAAS,EAAuB,CAAE,YAAW,GAAG,GAAwE,CACtH,OACE,EAAA,EAAA,KAACH,EAAAA,aAAsB,WAAA,CACrB,YAAU,4BACV,WAAA,EAAA,EAAA,IACE,gCACA,uHACA,+BACA,8BACA,+BACA,kCACA,kCACA,iCACA,yCACA,yCACA,yCACA,yCACA,EACD,CACD,GAAI,GACJ"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu-5Zyw5t_J.cjs","names":["DropdownMenuPrimitive","CheckIcon","CircleIcon","ChevronRightIcon"],"sources":["../packages/components/ui/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({ className, sideOffset = 4, align = 'start', ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-text-positive',\n 'z-50',\n 'min-w-32',\n 'overflow-y-auto overflow-x-hidden',\n 'rounded-md p-1.5 shadow-dropdown',\n 'max-h-(--radix-dropdown-menu-content-available-height)',\n 'origin-(--radix-dropdown-menu-content-transform-origin)',\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=closed]:zoom-out-95',\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 align={align}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-2.5 text-sm outline-hidden transition-all',\n 'focus:bg-muted-muted',\n 'focus:text-text-positive-strong',\n 'data-inset:pl-8',\n 'data-disabled:pointer-events-none',\n 'data-disabled:opacity-50',\n 'data-[variant=destructive]:text-danger',\n 'data-[variant=destructive]:focus:bg-danger-muted',\n 'data-[variant=destructive]:focus:text-danger-strong',\n 'data-[variant=destructive]:*:[svg]:text-danger!',\n '[&_svg]:shrink-0',\n '[&_svg]:pointer-events-none',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-text-positive-weak\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden',\n 'focus:bg-muted-muted',\n 'focus:text-text-positive-strong',\n 'data-disabled:opacity-50',\n 'data-disabled:pointer-events-none',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon size={16} />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden',\n 'focus:bg-accent-muted',\n 'focus:text-text-positive-strong',\n 'data-disabled:pointer-events-none',\n 'data-disabled:opacity-50',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 font-medium text-sm data-inset:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return <DropdownMenuPrimitive.Separator data-slot=\"dropdown-menu-separator\" className={cn('-mx-1 my-1 h-px bg-border-weak', className)} {...props} />;\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return <span data-slot=\"dropdown-menu-shortcut\" className={cn('ml-auto text-text-positive-muted text-xs tracking-widest', className)} {...props} />;\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden',\n 'focus:bg-accent-muted',\n 'focus:text-text-positive-strong',\n 'data-[state=open]:bg-muted-muted',\n 'data-[state=open]:text-text-positive-strong',\n 'data-inset:pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-text-positive',\n 'z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md p-1 shadow-dropdown',\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n 'data-[state=closed]:zoom-out-95',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\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 );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,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B,CAAE,YAAW,GAAG,GAAuC,CACnF,OAAO,EAAA,EAAA,KAAC,OAAA,CAAK,YAAU,yBAAyB,WAAA,EAAA,EAAA,IAAc,2DAA4D,EAAU,CAAE,GAAI,GAAS,CAGrJ,SAAS,EAAgB,CAAE,GAAG,GAAiE,CAC7F,OAAO,EAAA,EAAA,KAACA,EAAAA,aAAsB,IAAA,CAAI,YAAU,oBAAoB,GAAI,GAAS,CAG/E,SAAS,EAAuB,CAC9B,YACA,QACA,WACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,MAACA,EAAAA,aAAsB,WAAA,CACrB,YAAU,4BACV,aAAY,EACZ,WAAA,EAAA,EAAA,IACE,6FACA,wBACA,kCACA,mCACA,8CACA,kBACA,EACD,CACD,GAAI,YAEH,GACD,EAAA,EAAA,KAACG,EAAAA,iBAAAA,CAAiB,UAAU,iBAAA,CAAmB,CAAA,EACd,CAIvC,SAAS,EAAuB,CAAE,YAAW,GAAG,GAAwE,CACtH,OACE,EAAA,EAAA,KAACH,EAAAA,aAAsB,WAAA,CACrB,YAAU,4BACV,WAAA,EAAA,EAAA,IACE,gCACA,uHACA,+BACA,8BACA,+BACA,kCACA,kCACA,iCACA,yCACA,yCACA,yCACA,yCACA,EACD,CACD,GAAI,GACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{cn as e}from"@customafk/react-toolkit/utils";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{CheckIcon as r,ChevronRightIcon as i,CircleIcon as a}from"lucide-react";import{DropdownMenu as o}from"radix-ui";function s({...e}){return t(o.Root,{"data-slot":`dropdown-menu`,...e})}function c({...e}){return t(o.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function l({...e}){return t(o.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function u({className:n,sideOffset:r=4,align:i=`start`,...a}){return t(o.Portal,{children:t(o.Content,{"data-slot":`dropdown-menu-content`,sideOffset:r,className:e(`bg-popover text-text-positive`,`z-50`,`min-w-32`,`overflow-y-auto overflow-x-hidden`,`rounded-md p-1.5 shadow-dropdown`,`max-h-(--radix-dropdown-menu-content-available-height)`,`origin-(--radix-dropdown-menu-content-transform-origin)`,`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`,n),...a,align:i})})}function d({...e}){return t(o.Group,{"data-slot":`dropdown-menu-group`,...e})}function f({className:n,inset:r,variant:i=`default`,...a}){return t(o.Item,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":i,className:e(`relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-2.5 text-sm outline-hidden transition-all`,`focus:bg-muted-muted`,`focus:text-text-positive-strong`,`data-inset:pl-8`,`data-disabled:pointer-events-none`,`data-disabled:opacity-50`,`data-[variant=destructive]:text-danger`,`data-[variant=destructive]:focus:bg-danger-muted`,`data-[variant=destructive]:focus:text-danger-strong`,`data-[variant=destructive]:*:[svg]:text-danger!`,`[&_svg]:shrink-0`,`[&_svg]:pointer-events-none`,`[&_svg:not([class*='size-'])]:size-4`,`[&_svg:not([class*='text-'])]:text-text-positive-weak`,n),...a})}function p({className:i,children:a,checked:s,...c}){return n(o.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:e(`relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden`,`focus:bg-muted-muted`,`focus:text-text-positive-strong`,`data-disabled:opacity-50`,`data-disabled:pointer-events-none`,`[&_svg]:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg:not([class*='size-'])]:size-4`,i),checked:s,...c,children:[t(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:t(o.ItemIndicator,{children:t(r,{size:16})})}),a]})}function m({...e}){return t(o.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function h({className:r,children:i,...s}){return n(o.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e(`relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden`,`focus:bg-accent-muted`,`focus:text-text-positive-strong`,`data-disabled:pointer-events-none`,`data-disabled:opacity-50`,`[&_svg]:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg:not([class*='size-'])]:size-4`,r),...s,children:[t(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:t(o.ItemIndicator,{children:t(a,{className:`size-2 fill-current`})})}),i]})}function g({className:n,inset:r,...i}){return t(o.Label,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:e(`px-2 py-1.5 font-medium text-sm data-inset:pl-8`,n),...i})}function _({className:n,...r}){return t(o.Separator,{"data-slot":`dropdown-menu-separator`,className:e(`-mx-1 my-1 h-px bg-border-weak`,n),...r})}function v({className:n,...r}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-text-positive-muted text-xs tracking-widest`,n),...r})}function y({...e}){return t(o.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function b({className:r,inset:a,children:s,...c}){return n(o.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":a,className:e(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden`,`focus:bg-accent-muted`,`focus:text-text-positive-strong`,`data-[state=open]:bg-muted-muted`,`data-[state=open]:text-text-positive-strong`,`data-inset:pl-8`,r),...c,children:[s,t(i,{className:`ml-auto size-4`})]})}function x({className:n,...r}){return t(o.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`bg-popover text-text-positive`,`z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md p-1 shadow-dropdown`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in-0`,`data-[state=open]:zoom-in-95`,`data-[state=closed]:zoom-out-95`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0`,`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`,n),...r})}export{f as a,m as c,v as d,y as f,l as h,d as i,h as l,b as m,p as n,g as o,x as p,u as r,c as s,s as t,_ as u};
|
|
2
|
-
//# sourceMappingURL=dropdown-menu-
|
|
2
|
+
//# sourceMappingURL=dropdown-menu-BwcDzb4B.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu-B8GUTfTp.mjs","names":["DropdownMenu","DropdownMenuPrimitive"],"sources":["../packages/components/ui/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({ className, sideOffset = 4, align = 'start', ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-text-positive',\n 'z-50',\n 'min-w-32',\n 'overflow-y-auto overflow-x-hidden',\n 'rounded-md p-1.5 shadow-dropdown',\n 'max-h-(--radix-dropdown-menu-content-available-height)',\n 'origin-(--radix-dropdown-menu-content-transform-origin)',\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=closed]:zoom-out-95',\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 align={align}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-2.5 text-sm outline-hidden transition-all',\n 'focus:bg-muted-muted',\n 'focus:text-text-positive-strong',\n 'data-inset:pl-8',\n 'data-disabled:pointer-events-none',\n 'data-disabled:opacity-50',\n 'data-[variant=destructive]:text-danger',\n 'data-[variant=destructive]:focus:bg-danger-muted',\n 'data-[variant=destructive]:focus:text-danger-strong',\n 'data-[variant=destructive]:*:[svg]:text-danger!',\n '[&_svg]:shrink-0',\n '[&_svg]:pointer-events-none',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-text-positive-weak\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden',\n 'focus:bg-muted-muted',\n 'focus:text-text-positive-strong',\n 'data-disabled:opacity-50',\n 'data-disabled:pointer-events-none',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon size={16} />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden',\n 'focus:bg-accent-muted',\n 'focus:text-text-positive-strong',\n 'data-disabled:pointer-events-none',\n 'data-disabled:opacity-50',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 font-medium text-sm data-inset:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return <DropdownMenuPrimitive.Separator data-slot=\"dropdown-menu-separator\" className={cn('-mx-1 my-1 h-px bg-border-weak', className)} {...props} />;\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return <span data-slot=\"dropdown-menu-shortcut\" className={cn('ml-auto text-text-positive-muted text-xs tracking-widest', className)} {...props} />;\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden',\n 'focus:bg-accent-muted',\n 'focus:text-text-positive-strong',\n 'data-[state=open]:bg-muted-muted',\n 'data-[state=open]:text-text-positive-strong',\n 'data-inset:pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-text-positive',\n 'z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md p-1 shadow-dropdown',\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n 'data-[state=closed]:zoom-out-95',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\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 );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n};\n"],"mappings":"6NAQA,SAASA,EAAa,CAAE,GAAG,GAAkE,CAC3F,OAAO,EAACC,EAAsB,KAAA,CAAK,YAAU,gBAAgB,GAAI,GAAS,CAG5E,SAAS,EAAmB,CAAE,GAAG,GAAoE,CACnG,OAAO,EAACA,EAAsB,OAAA,CAAO,YAAU,uBAAuB,GAAI,GAAS,CAGrF,SAAS,EAAoB,CAAE,GAAG,GAAqE,CACrG,OAAO,EAACA,EAAsB,QAAA,CAAQ,YAAU,wBAAwB,GAAI,GAAS,CAGvF,SAAS,EAAoB,CAAE,YAAW,aAAa,EAAG,QAAQ,QAAS,GAAG,GAAqE,CACjJ,OACE,EAACA,EAAsB,OAAA,CAAA,SACrB,EAACA,EAAsB,QAAA,CACrB,YAAU,wBACE,aACZ,UAAW,EACT,gCACA,OACA,WACA,oCACA,mCACA,yDACA,0DACA,+BACA,8BACA,+BACA,kCACA,iCACA,kCACA,yCACA,yCACA,yCACA,yCACA,EACD,CACD,GAAI,EACG,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DAAmD,EAAU,CAC3E,GAAI,GACJ,CAIN,SAAS,EAAsB,CAAE,YAAW,GAAG,GAAuE,CACpH,OAAO,EAACA,EAAsB,UAAA,CAAU,YAAU,0BAA0B,UAAW,EAAG,iCAAkC,EAAU,CAAE,GAAI,GAAS,CAGvJ,SAAS,EAAqB,CAAE,YAAW,GAAG,GAAuC,CACnF,OAAO,EAAC,OAAA,CAAK,YAAU,yBAAyB,UAAW,EAAG,2DAA4D,EAAU,CAAE,GAAI,GAAS,CAGrJ,SAAS,EAAgB,CAAE,GAAG,GAAiE,CAC7F,OAAO,EAACA,EAAsB,IAAA,CAAI,YAAU,oBAAoB,GAAI,GAAS,CAG/E,SAAS,EAAuB,CAC9B,YACA,QACA,WACA,GAAG,GAGF,CACD,OACE,EAACA,EAAsB,WAAA,CACrB,YAAU,4BACV,aAAY,EACZ,UAAW,EACT,6FACA,wBACA,kCACA,mCACA,8CACA,kBACA,EACD,CACD,GAAI,YAEH,EACD,EAAC,EAAA,CAAiB,UAAU,iBAAA,CAAmB,CAAA,EACd,CAIvC,SAAS,EAAuB,CAAE,YAAW,GAAG,GAAwE,CACtH,OACE,EAACA,EAAsB,WAAA,CACrB,YAAU,4BACV,UAAW,EACT,gCACA,uHACA,+BACA,8BACA,+BACA,kCACA,kCACA,iCACA,yCACA,yCACA,yCACA,yCACA,EACD,CACD,GAAI,GACJ"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu-BwcDzb4B.mjs","names":["DropdownMenu","DropdownMenuPrimitive"],"sources":["../packages/components/ui/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({ className, sideOffset = 4, align = 'start', ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-text-positive',\n 'z-50',\n 'min-w-32',\n 'overflow-y-auto overflow-x-hidden',\n 'rounded-md p-1.5 shadow-dropdown',\n 'max-h-(--radix-dropdown-menu-content-available-height)',\n 'origin-(--radix-dropdown-menu-content-transform-origin)',\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=closed]:zoom-out-95',\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 align={align}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-2.5 text-sm outline-hidden transition-all',\n 'focus:bg-muted-muted',\n 'focus:text-text-positive-strong',\n 'data-inset:pl-8',\n 'data-disabled:pointer-events-none',\n 'data-disabled:opacity-50',\n 'data-[variant=destructive]:text-danger',\n 'data-[variant=destructive]:focus:bg-danger-muted',\n 'data-[variant=destructive]:focus:text-danger-strong',\n 'data-[variant=destructive]:*:[svg]:text-danger!',\n '[&_svg]:shrink-0',\n '[&_svg]:pointer-events-none',\n \"[&_svg:not([class*='size-'])]:size-4\",\n \"[&_svg:not([class*='text-'])]:text-text-positive-weak\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden',\n 'focus:bg-muted-muted',\n 'focus:text-text-positive-strong',\n 'data-disabled:opacity-50',\n 'data-disabled:pointer-events-none',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon size={16} />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden',\n 'focus:bg-accent-muted',\n 'focus:text-text-positive-strong',\n 'data-disabled:pointer-events-none',\n 'data-disabled:opacity-50',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 font-medium text-sm data-inset:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return <DropdownMenuPrimitive.Separator data-slot=\"dropdown-menu-separator\" className={cn('-mx-1 my-1 h-px bg-border-weak', className)} {...props} />;\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return <span data-slot=\"dropdown-menu-shortcut\" className={cn('ml-auto text-text-positive-muted text-xs tracking-widest', className)} {...props} />;\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden',\n 'focus:bg-accent-muted',\n 'focus:text-text-positive-strong',\n 'data-[state=open]:bg-muted-muted',\n 'data-[state=open]:text-text-positive-strong',\n 'data-inset:pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-text-positive',\n 'z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md p-1 shadow-dropdown',\n 'data-[state=open]:animate-in',\n 'data-[state=open]:fade-in-0',\n 'data-[state=open]:zoom-in-95',\n 'data-[state=closed]:zoom-out-95',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\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 );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n};\n"],"mappings":"6NAQA,SAASA,EAAa,CAAE,GAAG,GAAkE,CAC3F,OAAO,EAACC,EAAsB,KAAA,CAAK,YAAU,gBAAgB,GAAI,GAAS,CAG5E,SAAS,EAAmB,CAAE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A,uHACA,+BACA,8BACA,+BACA,kCACA,kCACA,iCACA,yCACA,yCACA,yCACA,yCACA,EACD,CACD,GAAI,GACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime263 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/features/search-modal/index.d.ts
|
|
4
|
-
declare const SearchModal: () =>
|
|
4
|
+
declare const SearchModal: () => react_jsx_runtime263.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { SearchModal };
|
|
7
7
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/features/search-modal/index.d.ts
|
|
4
|
-
declare const SearchModal: () =>
|
|
4
|
+
declare const SearchModal: () => react_jsx_runtime18.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { SearchModal };
|
|
7
7
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-Bo2vzQp5.cjs`);const t=require(`../../button-BLYTfCyl.cjs`),n=require(`../../flex-DGPQRbN6.cjs`),r=require(`../../paragraph-B9_-MKH8.cjs`),i=require(`../../date-CuRT4hmU.cjs`),a=require(`../../badge-CsDmp3ys.cjs`),o=require(`../../tooltip-wJtgRj1d.cjs`),s=require(`../../avatar-dAu1c0bC.cjs`),c=require(`../../separator-DSZyCT2g.cjs`),l=require(`../../checkbox-CmnqBVWN.cjs`),u=require(`../../dropdown-menu-BuyuU6uF.cjs`),d=require(`../../resizable-BS63Xwia.cjs`),f=require(`../../input-qnlHzDDm.cjs`);let p=require(`@customafk/react-toolkit/utils`),m=require(`react/jsx-runtime`),h=require(`lucide-react`),g=require(`react`),_=require(`@customafk/react-toolkit/color-hash`),v=require(`@tanstack/react-table`),y=require(`@tanstack/react-virtual`);const b=()=>(0,m.jsxs)(`div`,{className:`flex gap-0 text-text-positive-weak`,children:[(0,m.jsx)(h.MinusIcon,{size:16}),(0,m.jsx)(h.MinusIcon,{size:16})]}),x=({label:e,onClick:t,onRemove:n})=>e?n?(0,m.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,m.jsx)(`button`,{className:`cursor-pointer text-text-positive-weak hover:text-text-positive-strong`,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.XIcon,{size:12})})]}):(0,m.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,m.jsx)(b,{}),S=({value:e})=>e==null?(0,m.jsx)(b,{}):e===!1?(0,m.jsx)(`div`,{className:`text-danger-strong`,children:(0,m.jsx)(h.XIcon,{})}):(0,m.jsx)(`div`,{className:`text-success-strong`,children:(0,m.jsx)(h.CheckIcon,{})}),C=({date:e})=>e==null?(0,m.jsx)(b,{}):(0,m.jsx)(o.r,{children:(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(a.t,{className:`h-fit`,children:(0,m.jsx)(i.t,{date:e,format:`medium`,className:`font-normal text-white`})})}),(0,m.jsx)(o.n,{children:(0,m.jsx)(i.t,{date:e,format:`full`,showTime:!0,className:`font-medium text-xs`})})]})}),w=({content:e})=>e==null?(0,m.jsx)(b,{}):(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(`div`,{className:`line-clamp-2 whitespace-pre-line break-all text-start text-[13px] text-text-positive-weak`,children:e})}),(0,m.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,m.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,m.jsxs)(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),T=({name:e})=>e?(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{children:(0,m.jsx)(r.t,{variant:`sm`,className:`line-clamp-2 w-full truncate text-wrap pb-px text-start text-sm`,children:e})}),(0,m.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,m.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,m.jsxs)(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):(0,m.jsx)(b,{}),E=({value:e})=>(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.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,m.jsx)(o.n,{align:`start`,children:(0,m.jsx)(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),D=({title:e,onClick:n})=>(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{children:(0,m.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,m.jsx)(h.Trash2Icon,{})})}),(0,m.jsx)(o.n,{children:(0,m.jsx)(`p`,{children:e||`Remove item from list table`})})]}),O=(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}},k=(0,g.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:r,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=O(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]),h=(0,g.useMemo)(()=>e===`.`&&t===`,`?f:f.replace(/,/g,t).replace(/\./g,e),[f,e,t]);return h===`0`||h===`N/A`||!h?(0,m.jsx)(b,{}):(0,m.jsxs)(n.t,{padding:`none`,className:(0,p.cn)(`font-number text-lg text-secondary-foreground tabular-nums`,c===`xs`&&`text-xs`,c===`sm`&&`text-sm`,c===`md`&&`text-base`,c===`lg`&&`text-lg`,c===`xl`&&`text-xl`),children:[r,(0,m.jsx)(`p`,{children:h}),i]})});k.displayName=`UITableStatisticDisplay`;const A=({uuid:e,username:t,email:i})=>(0,m.jsxs)(n.t,{wrap:!1,gap:`sm`,padding:`none`,children:[!e&&(0,m.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,m.jsx)(s.n,{className:`bg-muted-weak`,children:(0,m.jsx)(h.UserRoundIcon,{size:28,className:`text-text-negative`})})}),e&&(0,m.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,m.jsx)(s.n,{style:{backgroundColor:_.colorHashLight.hex(e)},children:(0,m.jsx)(h.UserRoundIcon,{size:28,className:`text-white`})})}),(0,m.jsxs)(n.t,{vertical:!0,padding:`none`,gap:`none`,align:`start`,children:[(0,m.jsx)(r.t,{className:`font-medium text-sm text-text-positive-weak`,children:t??`Unknown User`}),(0,m.jsx)(r.t,{variant:`sm`,className:`mt-0! text-text-positive-weak text-xs`,children:i})]})]}),j=(0,g.createContext)(null),M=()=>{let e=(0,g.use)(j);if(!e)throw Error(`useUITableClickRowContext must be used within a TableClickRowProvider`);return e},N=(0,g.createContext)(null),P=()=>{let e=(0,g.use)(N);if(!e)throw Error(`useTableContext must be used within a TableProvider`);return e},ee=60,te=20,ne=20,F=e=>{let t=e.getIsPinned();return{zIndex:t?20:void 0,left:t===`left`?`${e.getStart(`left`)}px`:void 0,right:t===`right`?`${e.getAfter(`right`)}px`:void 0}},I=({className:e,children:t,...n})=>(0,m.jsx)(`div`,{"data-slot":`table-wrapper`,className:`relative m-0 flex size-full flex-col flex-nowrap items-start justify-start gap-2 py-2.5 text-sm`,...n,children:t}),L=(0,g.memo)(({children:e})=>(0,m.jsx)(`thead`,{"data-slot":`table-header`,style:{zIndex:20},className:(0,p.cn)(`sticky top-0 grid bg-muted-bg-subtle text-[13px] text-text-positive-weak`,`[&_tr:not(:last-child)_td]:border-b`,`[&_th]:flex`,`[&_th]:h-9`,`[&_th]:select-none`,`[&_th]:items-center`,`[&_th]:whitespace-nowrap`,`[&_th]:border-border`,`[&_th]:font-medium`,`[&_th]:text-left`,`[&_th]:align-middle`,`[&_th]:last:border-r-0`,`[&_th]:first:border-l-0`,`[&_th]:data-[pinned=right]:border-l`,`[&_th]:data-[pinned=right]:border-r-0`,`[&_th]:data-[pinned=left]:border-r`,`[&_tr_th:not([data-pinned=false])]:bg-muted-bg-subtle`),children:e}));L.displayName=`TableHeader`;const R=(0,g.memo)(({children:e})=>(0,m.jsx)(`tr`,{"data-slot":`table-header-row`,className:`flex w-full border-border border-b shadow`,children:e}));R.displayName=`TableHeaderRow`;const z=({header:e,isPinned:t,isResizing:n,isAllRowsSelected:r,children:i,...a})=>{let o=F(e.column),s=`calc(var(--header-${e.id}-size) * 1px)`;return e.id===`select`?(0,m.jsx)(`th`,{"data-slot":`table-header-cell`,style:{...o,width:60},className:(0,p.cn)(t?`sticky`:`relative`),...a,children:(0,m.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,m.jsx)(l.t,{"aria-label":`Select All Rows`,checked:r,onCheckedChange:t=>{e.getContext().table.toggleAllRowsSelected(!!t)}})})}):(0,m.jsxs)(`th`,{"data-slot":`table-header-cell`,"data-pinned":t,style:{...o,width:s},colSpan:e.colSpan,className:(0,p.cn)(`group relative`,t?`sticky`:`relative`),...a,children:[(0,m.jsx)(`div`,{className:`absolute inset-0 gap-1 truncate`,children:(0,m.jsx)(`div`,{className:`flex h-full flex-1 cursor-pointer select-none items-center justify-between`,children:(0,m.jsx)(`div`,{className:`flex size-full flex-1 items-center truncate pl-4`,children:(0,v.flexRender)(e.column.columnDef.header,e.getContext())})})}),![`select`,`actions`].includes(e.id)&&(0,m.jsx)(B,{isPinned:t,isVisible:e.column.getIsVisible(),className:`invisible absolute right-2 z-10 group-hover:visible`,onLeftPin:e.column.pin,onRightPin:e.column.pin,onUnpin:e.column.pin,onToggleVisibilityHandler:e.column.toggleVisibility}),(0,m.jsx)(g.Activity,{mode:t?`hidden`:`visible`,children:(0,m.jsx)(`div`,{onDoubleClick:e.column.resetSize,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:(0,p.cn)(`absolute inset-y-0 -right-0.5 w-1 cursor-e-resize bg-transparent hover:bg-border`,n&&`bg-border`)})})]})},B=({isPinned:e,className:t,onLeftPin:n,onRightPin:r,onUnpin:i,onToggleVisibilityHandler:a})=>{let o=(0,g.useCallback)(()=>{n(`left`)},[n]),s=(0,g.useCallback)(()=>{r(`right`)},[r]),c=(0,g.useCallback)(()=>{i(!1)},[i]);return(0,m.jsxs)(u.t,{children:[(0,m.jsx)(u.h,{asChild:!0,children:(0,m.jsx)(`button`,{className:(0,p.cn)(`cursor-pointer rounded-full p-0.5 text-text-positive-weak hover:bg-muted-muted hover:text-text-positive [&>svg]:size-4`,t),children:(0,m.jsx)(h.EllipsisVerticalIcon,{})})}),(0,m.jsxs)(u.r,{align:`end`,className:`w-64 p-4`,children:[(0,m.jsxs)(u.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:[(0,m.jsx)(g.Activity,{mode:e?`visible`:`hidden`,children:(0,m.jsxs)(u.a,{onClick:c,children:[!!e&&`Unpin`,(0,m.jsx)(u.d,{children:(0,m.jsx)(h.PinOffIcon,{className:`size-4`})})]})}),(0,m.jsxs)(g.Activity,{mode:e?`hidden`:`visible`,children:[(0,m.jsxs)(u.a,{onClick:o,children:[e?`Unpin`:`Pin to Left`,(0,m.jsx)(u.d,{children:(0,m.jsx)(h.MoveLeftIcon,{className:`size-4`})})]}),(0,m.jsxs)(u.a,{onClick:s,children:[e?`Unpin`:`Pin to Right`,(0,m.jsx)(u.d,{children:(0,m.jsx)(h.MoveRightIcon,{className:`size-4`})})]})]})]}),(0,m.jsx)(u.u,{}),(0,m.jsx)(u.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:(0,m.jsxs)(u.a,{onClick:()=>a(!1),children:[`Hide Field`,(0,m.jsx)(u.d,{children:(0,m.jsx)(h.EyeOffIcon,{className:`size-4`})})]})})]})]})},V=({height:e,children:t,...n})=>(0,m.jsx)(`tbody`,{"data-slot":`table-body`,style:{height:`${e}px`},className:(0,p.cn)(`relative grid w-full bg-card`,`[&_tr]:absolute [&_tr]:flex [&_tr]:w-full [&_tr]:cursor-pointer [&_tr]:border-b [&_tr]:border-b-border [&_tr]:focus:outline-none`,`[&_td]:z-10`,`[&_td]:flex`,`[&_td]:overflow-hidden`,`[&_td]:whitespace-nowrap`,`[&_td]:px-4`,`[&_td]:py-2.5`,`[&_td]:align-middle`,`[&_td]:border-border`,`[&_td]:data-[pinned=right]:border-l`,`[&_td]:data-[pinned=left]:border-r`,`[&_td:not([data-pinned=false])]:bg-card`,`[&_td:not([data-pinned=false])]:shadow-xs`),...n,children:t}),H=(0,g.memo)(({children:e,keyOfClickRow:t,row:n,virtualRow:r,rowVirtualizer:i,onClickRow:a,className:o,...s})=>{let{columnPinning:c}=P(),l=(0,g.useCallback)(e=>{let i=t?n.original?.[t]:void 0;typeof i==`string`||typeof i==`number`?a?.(r.index,i):a?.(r.index),e.preventDefault(),e.stopPropagation()},[t,a,n.original,r.index]);return(0,m.jsx)(`tr`,{"data-slot":`table-row`,"data-index":r.index,ref:e=>i.measureElement(e),style:{transform:`translateY(${r.start}px)`},className:(0,p.cn)(`group`,o),onClick:l,...s,children:n.getVisibleCells().map(e=>(0,m.jsx)(U,{cell:e,className:`group-hover:bg-muted-bg-subtle!`},e.id))})});H.displayName=`TableRow`;const U=(0,g.memo)(({cell:e,children:t,className:n,...r})=>{let{rowSelection:i}=P(),a=e.column.getIsPinned(),o=F(e.column),s=`calc(var(--col-${e.column.id}-size) * 1px)`,c=e.column.columnDef.meta?.position??`start`;return e.column.id===`select`?(0,m.jsx)(`td`,{"data-slot":`table-cell`,style:{...o,width:60},className:(0,p.cn)(`border-none! bg-transparent! shadow-none!`,a?`sticky`:`relative`,n),...r,children:(0,m.jsx)(`div`,{"data-slot":`table-cell-inner`,className:`inline-flex w-full items-center justify-center bg-transparent text-center align-middle`,children:(0,m.jsx)(l.t,{"aria-label":`Select Row`,checked:e.row.getIsSelected(),onCheckedChange:t=>{e.row.toggleSelected(!!t)}})})}):(0,m.jsx)(`td`,{"data-slot":`table-cell`,"data-pinned":a,style:{...o,width:s},className:(0,p.cn)(a&&e.column.getPinnedIndex()===0&&`shadow!`,a&&`sticky`,!a&&`relative`,n),...r,children:(0,m.jsx)(`div`,{"data-slot":`table-cell-inner`,className:(0,p.cn)(`inline-flex w-full items-center bg-transparent text-center align-middle`,c===`start`&&`justify-start`,c===`center`&&`justify-center`,c===`end`&&`justify-end`),children:(0,v.flexRender)(e.column.columnDef.cell,e.getContext())})})});U.displayName=`TableCell`;const W=()=>(0,m.jsx)(`div`,{className:`sticky left-0 flex min-h-96 flex-1 items-center justify-center bg-transparent text-text-positive-weak opacity-100`,children:(0,m.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,m.jsx)(h.BoxIcon,{strokeWidth:1,size:48}),(0,m.jsx)(`p`,{children:`No data available`})]})}),G=({children:e})=>(0,m.jsx)(`tfoot`,{"data-slot":`table-footer`,className:`flex w-full justify-center border-border-weak border-t py-2 font-medium [&>tr]:last:border-b-0`,children:e}),K=({children:e})=>{let{table:t,isEmpty:n,isFetching:r,data:i,totalRows:a,fetchMoreData:o}=P(),{keyOfClickRow:s,onClickRow:c}=M(),l=(0,g.useRef)(null),u=(0,g.useMemo)(()=>{let e=t.getFlatHeaders(),n={};return e.forEach(e=>{n[`--header-${e.id}-size`]=e.getSize()||0,n[`--col-${e.column.id}-size`]=e.column.getSize()||0}),n},[t.getState().columnSizingInfo,t.getState().columnSizing]),f=(0,g.useCallback)(async e=>{if(!e)return null;let{scrollHeight:t,scrollTop:n,clientHeight:s}=e;t-n-s<500&&!r&&a&&i.length<a&&o?.()},[r,i.length,a,o]);(0,g.useEffect)(()=>{f(l.current)},[f]);let{rows:p}=t.getRowModel(),h=(0,y.useVirtualizer)({count:p.length,estimateSize:()=>40,getScrollElement:()=>l.current,measureElement:typeof window<`u`&&navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:2});return(0,m.jsxs)(d.r,{direction:`horizontal`,style:{direction:t.options.columnResizeDirection},className:`relative flex w-full max-w-full flex-1 gap-1 overflow-auto border-t border-t-border bg-slate-50 p-0 text-sm`,children:[(0,m.jsx)(d.n,{className:`overflow-auto`,children:(0,m.jsxs)(`div`,{ref:l,className:`relative size-full overflow-auto border-b border-b-border border-l border-l-border`,onScroll:e=>f(e.currentTarget),children:[(0,m.jsxs)(`table`,{"data-slot":`table`,style:{...u,width:t.getTotalSize()},className:`grid w-full max-w-full caption-bottom border-collapse border-spacing-0 flex-col content-start bg-card text-sm tabular-nums [&_tfoot_td]:border-t`,children:[(0,m.jsx)(L,{children:t.getHeaderGroups().map(e=>(0,m.jsx)(R,{children:e.headers.map(e=>(0,m.jsx)(z,{header:e,isPinned:e.column.getIsPinned(),isResizing:e.column.getIsResizing(),isAllRowsSelected:t.getIsAllRowsSelected()},e.id))},e.id))}),(0,m.jsx)(V,{"data-slot":`table-body`,height:h.getTotalSize(),children:h.getVirtualItems().map(e=>{let t=p[e.index];return(0,m.jsx)(H,{"data-index":e.index,keyOfClickRow:s,row:t,virtualRow:e,rowVirtualizer:h,onClickRow:c},t.id)})})]}),n&&(0,m.jsx)(W,{})]})}),(0,m.jsx)(d.t,{}),e]})},q=({checked:e,title:t,onCheckedChange:n})=>(0,m.jsxs)(`div`,{className:`flex h-fit items-center gap-2`,children:[(0,m.jsx)(l.t,{checked:e,onCheckedChange:n}),(0,m.jsx)(`p`,{className:`text-sm`,children:t})]}),J=()=>{let{table:e}=P(),[n,r]=(0,g.useState)(null);return(0,m.jsx)(d.n,{defaultSize:25,className:(0,p.cn)(`bg-card`,n===null?`max-w-8!`:`min-w-64`),children:(0,m.jsxs)(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[(0,m.jsxs)(`div`,{className:`flex-1`,children:[(0,m.jsx)(g.Activity,{mode:n===`columns`?`visible`:`hidden`,children:(0,m.jsxs)(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[(0,m.jsx)(`p`,{className:`px-2 font-medium`,children:`Columns Visibility`}),(0,m.jsx)(c.t,{}),(0,m.jsx)(`div`,{className:`flex flex-col gap-4 pt-4`,children:e.getAllColumns().map(e=>[`select`,`actions`].includes(e.id)?null:(0,m.jsx)(q,{checked:e.getIsVisible(),title:String(e.columnDef.header),onCheckedChange:t=>e.toggleVisibility(!!t)},e.id))})]})}),(0,m.jsx)(g.Activity,{mode:n===`filters`?`visible`:`hidden`,children:(0,m.jsx)(`div`,{className:`flex size-full flex-col p-2`,children:(0,m.jsxs)(t.t,{variant:`outline`,color:`muted`,children:[(0,m.jsx)(h.ListFilterPlus,{}),`Add Filter`]})})})]}),(0,m.jsxs)(`div`,{className:`flex h-full flex-col border-border border-l bg-muted-bg-subtle text-sm`,children:[(0,m.jsxs)(`button`,{className:(0,p.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,m.jsx)(h.Columns4Icon,{size:18}),(0,m.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Columns`})]}),(0,m.jsx)(c.t,{}),(0,m.jsxs)(`button`,{className:(0,p.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,m.jsx)(h.ListFilterIcon,{size:18}),(0,m.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Filters`})]}),(0,m.jsx)(c.t,{})]})]})})},Y=({title:e,isFetching:t=!1,data:n,columns:r,totalRows:i,leftPinnedColumns:a,rightPinnedColumns:o,keyOfClickRow:s,onClickRow:c,fetchMoreData:l,children:u})=>{let[d,f]=(0,g.useState)({}),[p,h]=(0,g.useState)({right:o,left:a}),[_,y]=(0,g.useState)({}),b=(0,v.useReactTable)({data:n,columns:r,state:{rowSelection:d,columnPinning:p,columnVisibility:_},defaultColumn:{minSize:40,size:150,maxSize:800},columnResizeMode:`onChange`,columnResizeDirection:`ltr`,enableColumnPinning:!0,enableRowSelection:!0,enableColumnResizing:!0,enableMultiRowSelection:!0,getCoreRowModel:(0,v.getCoreRowModel)(),onRowSelectionChange:f,onColumnPinningChange:h,onColumnVisibilityChange:y}),x=(0,g.useMemo)(()=>{let{rows:e}=b.getRowModel();return e},[b.getRowModel().rows,b.getState().columnPinning]),S=(0,g.useMemo)(()=>!t&&x.length===0,[x,t]),C=(0,g.useMemo)(()=>({title:e,table:b,data:n,isEmpty:S,isFetching:t,totalRows:i,fetchMoreData:l,rowSelection:b.getState().rowSelection,columnPinning:b.getState().columnPinning}),[e,b,n,S,t,i,l,b.getState().columnVisibility,b.getState().rowSelection,b.getState().columnPinning]),w=(0,g.useMemo)(()=>({keyOfClickRow:s,onClickRow:c}),[s,c]);return(0,m.jsx)(N.Provider,{value:C,children:(0,m.jsx)(j.Provider,{value:w,children:u})})},X=({className:e,...t})=>(0,m.jsxs)(`div`,{className:`relative`,children:[(0,m.jsx)(f.t,{...t,size:`lg`,type:`search`,placeholder:`Search records...`,className:`ps-9 pe-9`}),(0,m.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,m.jsx)(h.SearchIcon,{size:16})}),(0,m.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,m.jsx)(h.ArrowRightIcon,{size:16,"aria-hidden":`true`})})]}),Z=({children:e,onClick:t})=>(0,m.jsx)(`button`,{type:`button`,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 [&_svg]:size-3.5`,onClick:t,children:e}),Q=({onCreate:e,onDownload:t,onRefresh:n})=>(0,m.jsxs)(`div`,{className:`flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,children:[(0,m.jsx)(Z,{onClick:t=>{e?.(),t.stopPropagation(),t.preventDefault()},children:(0,m.jsx)(h.CirclePlus,{})}),(0,m.jsx)(Z,{onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.RefreshCwIcon,{})}),(0,m.jsx)(Z,{onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.DownloadIcon,{})})]}),$=({children:e})=>{let{title:t}=P();return(0,m.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,m.jsx)(`h3`,{className:`font-semibold text-base text-text-positive`,children:t}),(0,m.jsx)(`div`,{className:`flex w-full flex-1 justify-between`,children:e})]})};$.displayName=`TableTooltip`,exports.UITableBadgeDisplay=x,exports.UITableBooleanDisplay=S,exports.UITableContainer=K,exports.UITableDateDisplay=C,exports.UITableDescriptionDisplay=w,exports.UITableFilter=J,exports.UITableFooter=G,exports.UITableNameDisplay=T,exports.UITablePhoneNumberDisplay=E,exports.UITableProvider=Y,exports.UITableRemoveButton=D,exports.UITableStatisticDisplay=k,exports.UITableTooltip=$,exports.UITableTooltipActions=Q,exports.UITableTooltipFilter=X,exports.UITableUserDataDisplay=A,exports.UITableWrapper=I;
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-Bo2vzQp5.cjs`);const t=require(`../../button-BLYTfCyl.cjs`),n=require(`../../flex-DGPQRbN6.cjs`),r=require(`../../paragraph-B9_-MKH8.cjs`),i=require(`../../date-CuRT4hmU.cjs`),a=require(`../../badge-CsDmp3ys.cjs`),o=require(`../../tooltip-wJtgRj1d.cjs`),s=require(`../../avatar-dAu1c0bC.cjs`),c=require(`../../separator-DSZyCT2g.cjs`),l=require(`../../dropdown-menu-5Zyw5t_J.cjs`),u=require(`../../checkbox-DDuYFG0R.cjs`),d=require(`../../resizable-BS63Xwia.cjs`),f=require(`../../input-qnlHzDDm.cjs`);let p=require(`@customafk/react-toolkit/utils`),m=require(`react/jsx-runtime`),h=require(`lucide-react`),g=require(`react`),_=require(`@customafk/react-toolkit/color-hash`),v=require(`@tanstack/react-table`),y=require(`@tanstack/react-virtual`);const b=()=>(0,m.jsxs)(`div`,{className:`flex gap-0 text-text-positive-weak`,children:[(0,m.jsx)(h.MinusIcon,{size:16}),(0,m.jsx)(h.MinusIcon,{size:16})]}),x=({label:e,onClick:t,onRemove:n})=>e?n?(0,m.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,m.jsx)(`button`,{className:`cursor-pointer text-text-positive-weak hover:text-text-positive-strong`,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.XIcon,{size:12})})]}):(0,m.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,m.jsx)(b,{}),S=({value:e})=>e==null?(0,m.jsx)(b,{}):e===!1?(0,m.jsx)(`div`,{className:`text-danger-strong`,children:(0,m.jsx)(h.XIcon,{})}):(0,m.jsx)(`div`,{className:`text-success-strong`,children:(0,m.jsx)(h.CheckIcon,{})}),C=({date:e})=>e==null?(0,m.jsx)(b,{}):(0,m.jsx)(o.r,{children:(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(a.t,{className:`h-fit`,children:(0,m.jsx)(i.t,{date:e,format:`medium`,className:`font-normal text-white`})})}),(0,m.jsx)(o.n,{children:(0,m.jsx)(i.t,{date:e,format:`full`,showTime:!0,className:`font-medium text-xs`})})]})}),w=({content:e})=>e==null?(0,m.jsx)(b,{}):(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.jsx)(`div`,{className:`line-clamp-2 whitespace-pre-line break-all text-start text-[13px] text-text-positive-weak`,children:e})}),(0,m.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,m.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,m.jsxs)(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),T=({items:e=[]})=>(0,m.jsxs)(l.t,{children:[(0,m.jsx)(l.h,{asChild:!0,children:(0,m.jsx)(t.t,{size:`sm`,variant:`ghost`,color:`secondary`,className:`size-9 rounded-full`,children:(0,m.jsx)(h.MoreVerticalIcon,{})})}),(0,m.jsx)(l.r,{children:(0,m.jsx)(l.i,{children:e.map(e=>(0,m.jsx)(l.a,{className:`px-3`,onSelect:()=>e.onClick(e.id),children:e.label},e.id))})})]}),E=({name:e})=>e?(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{children:(0,m.jsx)(r.t,{variant:`sm`,className:`line-clamp-2 w-full truncate text-wrap pb-px text-start text-sm`,children:e})}),(0,m.jsx)(o.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,m.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,m.jsxs)(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):(0,m.jsx)(b,{}),D=({value:e})=>(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{asChild:!0,children:(0,m.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,m.jsx)(o.n,{align:`start`,children:(0,m.jsx)(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),O=({title:e,onClick:n})=>(0,m.jsxs)(o.t,{children:[(0,m.jsx)(o.i,{children:(0,m.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,m.jsx)(h.Trash2Icon,{})})}),(0,m.jsx)(o.n,{children:(0,m.jsx)(`p`,{children:e||`Remove item from list table`})})]}),k=(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}},A=(0,g.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:r,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=k(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]),h=(0,g.useMemo)(()=>e===`.`&&t===`,`?f:f.replace(/,/g,t).replace(/\./g,e),[f,e,t]);return h===`0`||h===`N/A`||!h?(0,m.jsx)(b,{}):(0,m.jsxs)(n.t,{padding:`none`,className:(0,p.cn)(`font-number text-lg text-secondary-foreground tabular-nums`,c===`xs`&&`text-xs`,c===`sm`&&`text-sm`,c===`md`&&`text-base`,c===`lg`&&`text-lg`,c===`xl`&&`text-xl`),children:[r,(0,m.jsx)(`p`,{children:h}),i]})});A.displayName=`UITableStatisticDisplay`;const j=({uuid:e,username:t,email:i})=>(0,m.jsxs)(n.t,{wrap:!1,gap:`sm`,padding:`none`,children:[!e&&(0,m.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,m.jsx)(s.n,{className:`bg-muted-weak`,children:(0,m.jsx)(h.UserRoundIcon,{size:28,className:`text-text-negative`})})}),e&&(0,m.jsx)(s.t,{className:`size-10 shadow-card`,children:(0,m.jsx)(s.n,{style:{backgroundColor:_.colorHashLight.hex(e)},children:(0,m.jsx)(h.UserRoundIcon,{size:28,className:`text-white`})})}),(0,m.jsxs)(n.t,{vertical:!0,padding:`none`,gap:`none`,align:`start`,children:[(0,m.jsx)(r.t,{className:`font-medium text-sm text-text-positive-weak`,children:t??`Unknown User`}),(0,m.jsx)(r.t,{variant:`sm`,className:`mt-0! text-text-positive-weak text-xs`,children:i})]})]}),M=(0,g.createContext)(null),N=()=>{let e=(0,g.use)(M);if(!e)throw Error(`useUITableClickRowContext must be used within a TableClickRowProvider`);return e},P=(0,g.createContext)(null),F=()=>{let e=(0,g.use)(P);if(!e)throw Error(`useTableContext must be used within a TableProvider`);return e},ee=60,te=20,ne=20,I=e=>{let t=e.getIsPinned();return{zIndex:t?20:void 0,left:t===`left`?`${e.getStart(`left`)}px`:void 0,right:t===`right`?`${e.getAfter(`right`)}px`:void 0}},L=({className:e,children:t,...n})=>(0,m.jsx)(`div`,{"data-slot":`table-wrapper`,className:`relative m-0 flex size-full flex-col flex-nowrap items-start justify-start gap-2 py-2.5 text-sm`,...n,children:t}),R=(0,g.memo)(({children:e})=>(0,m.jsx)(`thead`,{"data-slot":`table-header`,style:{zIndex:20},className:(0,p.cn)(`sticky top-0 grid bg-muted-bg-subtle text-[13px] text-text-positive-weak`,`[&_tr:not(:last-child)_td]:border-b`,`[&_th]:flex`,`[&_th]:h-9`,`[&_th]:select-none`,`[&_th]:items-center`,`[&_th]:whitespace-nowrap`,`[&_th]:border-border`,`[&_th]:font-medium`,`[&_th]:text-left`,`[&_th]:align-middle`,`[&_th]:last:border-r-0`,`[&_th]:first:border-l-0`,`[&_th]:data-[pinned=right]:border-l`,`[&_th]:data-[pinned=right]:border-r-0`,`[&_th]:data-[pinned=left]:border-r`,`[&_tr_th:not([data-pinned=false])]:bg-muted-bg-subtle`),children:e}));R.displayName=`TableHeader`;const z=(0,g.memo)(({children:e})=>(0,m.jsx)(`tr`,{"data-slot":`table-header-row`,className:`flex w-full border-border border-b shadow`,children:e}));z.displayName=`TableHeaderRow`;const B=({header:e,isPinned:t,isResizing:n,isAllRowsSelected:r,children:i,...a})=>{let o=I(e.column),s=`calc(var(--header-${e.id}-size) * 1px)`;return e.id===`select`?(0,m.jsx)(`th`,{"data-slot":`table-header-cell`,style:{...o,width:60},className:(0,p.cn)(t?`sticky`:`relative`),...a,children:(0,m.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,m.jsx)(u.t,{"aria-label":`Select All Rows`,checked:r,onCheckedChange:t=>{e.getContext().table.toggleAllRowsSelected(!!t)}})})}):(0,m.jsxs)(`th`,{"data-slot":`table-header-cell`,"data-pinned":t,style:{...o,width:s},colSpan:e.colSpan,className:(0,p.cn)(`group relative`,t?`sticky`:`relative`),...a,children:[(0,m.jsx)(`div`,{className:`absolute inset-0 gap-1 truncate`,children:(0,m.jsx)(`div`,{className:`flex h-full flex-1 cursor-pointer select-none items-center justify-between`,children:(0,m.jsx)(`div`,{className:`flex size-full flex-1 items-center truncate pl-4`,children:(0,v.flexRender)(e.column.columnDef.header,e.getContext())})})}),![`select`,`actions`].includes(e.id)&&(0,m.jsx)(V,{isPinned:t,isVisible:e.column.getIsVisible(),className:`invisible absolute right-2 z-10 group-hover:visible`,onLeftPin:e.column.pin,onRightPin:e.column.pin,onUnpin:e.column.pin,onToggleVisibilityHandler:e.column.toggleVisibility}),(0,m.jsx)(g.Activity,{mode:t?`hidden`:`visible`,children:(0,m.jsx)(`div`,{onDoubleClick:e.column.resetSize,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:(0,p.cn)(`absolute inset-y-0 -right-0.5 w-1 cursor-e-resize bg-transparent hover:bg-border`,n&&`bg-border`)})})]})},V=({isPinned:e,className:t,onLeftPin:n,onRightPin:r,onUnpin:i,onToggleVisibilityHandler:a})=>{let o=(0,g.useCallback)(()=>{n(`left`)},[n]),s=(0,g.useCallback)(()=>{r(`right`)},[r]),c=(0,g.useCallback)(()=>{i(!1)},[i]);return(0,m.jsxs)(l.t,{children:[(0,m.jsx)(l.h,{asChild:!0,children:(0,m.jsx)(`button`,{className:(0,p.cn)(`cursor-pointer rounded-full p-0.5 text-text-positive-weak hover:bg-muted-muted hover:text-text-positive [&>svg]:size-4`,t),children:(0,m.jsx)(h.EllipsisVerticalIcon,{})})}),(0,m.jsxs)(l.r,{align:`end`,className:`w-64 p-4`,children:[(0,m.jsxs)(l.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:[(0,m.jsx)(g.Activity,{mode:e?`visible`:`hidden`,children:(0,m.jsxs)(l.a,{onClick:c,children:[!!e&&`Unpin`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.PinOffIcon,{className:`size-4`})})]})}),(0,m.jsxs)(g.Activity,{mode:e?`hidden`:`visible`,children:[(0,m.jsxs)(l.a,{onClick:o,children:[e?`Unpin`:`Pin to Left`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.MoveLeftIcon,{className:`size-4`})})]}),(0,m.jsxs)(l.a,{onClick:s,children:[e?`Unpin`:`Pin to Right`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.MoveRightIcon,{className:`size-4`})})]})]})]}),(0,m.jsx)(l.u,{}),(0,m.jsx)(l.i,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:(0,m.jsxs)(l.a,{onClick:()=>a(!1),children:[`Hide Field`,(0,m.jsx)(l.d,{children:(0,m.jsx)(h.EyeOffIcon,{className:`size-4`})})]})})]})]})},H=({height:e,children:t,...n})=>(0,m.jsx)(`tbody`,{"data-slot":`table-body`,style:{height:`${e}px`},className:(0,p.cn)(`relative grid w-full bg-card`,`[&_tr]:absolute [&_tr]:flex [&_tr]:w-full [&_tr]:cursor-pointer [&_tr]:border-b [&_tr]:border-b-border [&_tr]:focus:outline-none`,`[&_td]:z-10`,`[&_td]:flex`,`[&_td]:overflow-hidden`,`[&_td]:whitespace-nowrap`,`[&_td]:px-4`,`[&_td]:py-2.5`,`[&_td]:align-middle`,`[&_td]:border-border`,`[&_td]:data-[pinned=right]:border-l`,`[&_td]:data-[pinned=left]:border-r`,`[&_td:not([data-pinned=false])]:bg-card`,`[&_td:not([data-pinned=false])]:shadow-xs`),...n,children:t}),U=(0,g.memo)(({children:e,keyOfClickRow:t,row:n,virtualRow:r,rowVirtualizer:i,onClickRow:a,className:o,...s})=>{let{columnPinning:c}=F(),l=(0,g.useCallback)(e=>{let i=t?n.original?.[t]:void 0;typeof i==`string`||typeof i==`number`?a?.(r.index,i):a?.(r.index),e.preventDefault(),e.stopPropagation()},[t,a,n.original,r.index]);return(0,m.jsx)(`tr`,{"data-slot":`table-row`,"data-index":r.index,ref:e=>i.measureElement(e),style:{transform:`translateY(${r.start}px)`},className:(0,p.cn)(`group`,o),onClick:l,...s,children:n.getVisibleCells().map(e=>(0,m.jsx)(W,{cell:e,className:`group-hover:bg-muted-bg-subtle!`},e.id))})});U.displayName=`TableRow`;const W=(0,g.memo)(({cell:e,children:t,className:n,...r})=>{let{rowSelection:i}=F(),a=e.column.getIsPinned(),o=I(e.column),s=`calc(var(--col-${e.column.id}-size) * 1px)`,c=e.column.columnDef.meta?.position??`start`;return e.column.id===`select`?(0,m.jsx)(`td`,{"data-slot":`table-cell`,style:{...o,width:60},className:(0,p.cn)(`border-none! bg-transparent! shadow-none!`,a?`sticky`:`relative`,n),...r,children:(0,m.jsx)(`div`,{"data-slot":`table-cell-inner`,className:`inline-flex w-full items-center justify-center bg-transparent text-center align-middle`,children:(0,m.jsx)(u.t,{"aria-label":`Select Row`,checked:e.row.getIsSelected(),onCheckedChange:t=>{e.row.toggleSelected(!!t)}})})}):(0,m.jsx)(`td`,{"data-slot":`table-cell`,"data-pinned":a,style:{...o,width:s},className:(0,p.cn)(a&&e.column.getPinnedIndex()===0&&`shadow!`,a&&`sticky`,!a&&`relative`,n),...r,children:(0,m.jsx)(`div`,{"data-slot":`table-cell-inner`,className:(0,p.cn)(`inline-flex w-full items-center bg-transparent text-center align-middle`,c===`start`&&`justify-start`,c===`center`&&`justify-center`,c===`end`&&`justify-end`),children:(0,v.flexRender)(e.column.columnDef.cell,e.getContext())})})});W.displayName=`TableCell`;const G=()=>(0,m.jsx)(`div`,{className:`sticky left-0 flex min-h-96 flex-1 items-center justify-center bg-transparent text-text-positive-weak opacity-100`,children:(0,m.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,m.jsx)(h.BoxIcon,{strokeWidth:1,size:48}),(0,m.jsx)(`p`,{children:`No data available`})]})}),K=({children:e})=>(0,m.jsx)(`tfoot`,{"data-slot":`table-footer`,className:`flex w-full justify-center border-border-weak border-t py-2 font-medium [&>tr]:last:border-b-0`,children:e}),q=({children:e})=>{let{table:t,isEmpty:n,isFetching:r,data:i,totalRows:a,fetchMoreData:o}=F(),{keyOfClickRow:s,onClickRow:c}=N(),l=(0,g.useRef)(null),u=(0,g.useMemo)(()=>{let e=t.getFlatHeaders(),n={};return e.forEach(e=>{n[`--header-${e.id}-size`]=e.getSize()||0,n[`--col-${e.column.id}-size`]=e.column.getSize()||0}),n},[t.getState().columnSizingInfo,t.getState().columnSizing]),f=(0,g.useCallback)(async e=>{if(!e)return null;let{scrollHeight:t,scrollTop:n,clientHeight:s}=e;t-n-s<500&&!r&&a&&i.length<a&&o?.()},[r,i.length,a,o]);(0,g.useEffect)(()=>{f(l.current)},[f]);let{rows:p}=t.getRowModel(),h=(0,y.useVirtualizer)({count:p.length,estimateSize:()=>40,getScrollElement:()=>l.current,measureElement:typeof window<`u`&&navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:2});return(0,m.jsxs)(d.r,{direction:`horizontal`,style:{direction:t.options.columnResizeDirection},className:`relative flex w-full max-w-full flex-1 gap-1 overflow-auto border-t border-t-border bg-slate-50 p-0 text-sm`,children:[(0,m.jsx)(d.n,{className:`overflow-auto`,children:(0,m.jsxs)(`div`,{ref:l,className:`relative size-full overflow-auto border-b border-b-border border-l border-l-border`,onScroll:e=>f(e.currentTarget),children:[(0,m.jsxs)(`table`,{"data-slot":`table`,style:{...u,width:t.getTotalSize()},className:`grid w-full max-w-full caption-bottom border-collapse border-spacing-0 flex-col content-start bg-card text-sm tabular-nums [&_tfoot_td]:border-t`,children:[(0,m.jsx)(R,{children:t.getHeaderGroups().map(e=>(0,m.jsx)(z,{children:e.headers.map(e=>(0,m.jsx)(B,{header:e,isPinned:e.column.getIsPinned(),isResizing:e.column.getIsResizing(),isAllRowsSelected:t.getIsAllRowsSelected()},e.id))},e.id))}),(0,m.jsx)(H,{"data-slot":`table-body`,height:h.getTotalSize(),children:h.getVirtualItems().map(e=>{let t=p[e.index];return(0,m.jsx)(U,{"data-index":e.index,keyOfClickRow:s,row:t,virtualRow:e,rowVirtualizer:h,onClickRow:c},t.id)})})]}),n&&(0,m.jsx)(G,{})]})}),(0,m.jsx)(d.t,{}),e]})},J=({checked:e,title:t,onCheckedChange:n})=>(0,m.jsxs)(`div`,{className:`flex h-fit items-center gap-2`,children:[(0,m.jsx)(u.t,{checked:e,onCheckedChange:n}),(0,m.jsx)(`p`,{className:`text-sm`,children:t})]}),Y=()=>{let{table:e}=F(),[n,r]=(0,g.useState)(null);return(0,m.jsx)(d.n,{defaultSize:25,className:(0,p.cn)(`bg-card`,n===null?`max-w-8!`:`min-w-64`),children:(0,m.jsxs)(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[(0,m.jsxs)(`div`,{className:`flex-1`,children:[(0,m.jsx)(g.Activity,{mode:n===`columns`?`visible`:`hidden`,children:(0,m.jsxs)(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[(0,m.jsx)(`p`,{className:`px-2 font-medium`,children:`Columns Visibility`}),(0,m.jsx)(c.t,{}),(0,m.jsx)(`div`,{className:`flex flex-col gap-4 pt-4`,children:e.getAllColumns().map(e=>[`select`,`actions`].includes(e.id)?null:(0,m.jsx)(J,{checked:e.getIsVisible(),title:String(e.columnDef.header),onCheckedChange:t=>e.toggleVisibility(!!t)},e.id))})]})}),(0,m.jsx)(g.Activity,{mode:n===`filters`?`visible`:`hidden`,children:(0,m.jsx)(`div`,{className:`flex size-full flex-col p-2`,children:(0,m.jsxs)(t.t,{variant:`outline`,color:`muted`,children:[(0,m.jsx)(h.ListFilterPlus,{}),`Add Filter`]})})})]}),(0,m.jsxs)(`div`,{className:`flex h-full flex-col border-border border-l bg-muted-bg-subtle text-sm`,children:[(0,m.jsxs)(`button`,{className:(0,p.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,m.jsx)(h.Columns4Icon,{size:18}),(0,m.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Columns`})]}),(0,m.jsx)(c.t,{}),(0,m.jsxs)(`button`,{className:(0,p.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,m.jsx)(h.ListFilterIcon,{size:18}),(0,m.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Filters`})]}),(0,m.jsx)(c.t,{})]})]})})},X=({title:e,isFetching:t=!1,data:n,columns:r,totalRows:i,leftPinnedColumns:a,rightPinnedColumns:o,keyOfClickRow:s,onClickRow:c,fetchMoreData:l,children:u})=>{let[d,f]=(0,g.useState)({}),[p,h]=(0,g.useState)({right:o,left:a}),[_,y]=(0,g.useState)({}),b=(0,v.useReactTable)({data:n,columns:r,state:{rowSelection:d,columnPinning:p,columnVisibility:_},defaultColumn:{minSize:40,size:150,maxSize:800},columnResizeMode:`onChange`,columnResizeDirection:`ltr`,enableColumnPinning:!0,enableRowSelection:!0,enableColumnResizing:!0,enableMultiRowSelection:!0,getCoreRowModel:(0,v.getCoreRowModel)(),onRowSelectionChange:f,onColumnPinningChange:h,onColumnVisibilityChange:y}),x=(0,g.useMemo)(()=>{let{rows:e}=b.getRowModel();return e},[b.getRowModel().rows,b.getState().columnPinning]),S=(0,g.useMemo)(()=>!t&&x.length===0,[x,t]),C=(0,g.useMemo)(()=>({title:e,table:b,data:n,isEmpty:S,isFetching:t,totalRows:i,fetchMoreData:l,rowSelection:b.getState().rowSelection,columnPinning:b.getState().columnPinning}),[e,b,n,S,t,i,l,b.getState().columnVisibility,b.getState().rowSelection,b.getState().columnPinning]),w=(0,g.useMemo)(()=>({keyOfClickRow:s,onClickRow:c}),[s,c]);return(0,m.jsx)(P.Provider,{value:C,children:(0,m.jsx)(M.Provider,{value:w,children:u})})},Z=({className:e,...t})=>(0,m.jsxs)(`div`,{className:`relative`,children:[(0,m.jsx)(f.t,{...t,size:`lg`,type:`search`,placeholder:`Search records...`,className:`ps-9 pe-9`}),(0,m.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,m.jsx)(h.SearchIcon,{size:16})}),(0,m.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,m.jsx)(h.ArrowRightIcon,{size:16,"aria-hidden":`true`})})]}),Q=({children:e,onClick:t})=>(0,m.jsx)(`button`,{type:`button`,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 [&_svg]:size-3.5`,onClick:t,children:e}),re=({onCreate:e,onDownload:t,onRefresh:n})=>(0,m.jsxs)(`div`,{className:`flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,children:[(0,m.jsx)(Q,{onClick:t=>{e?.(),t.stopPropagation(),t.preventDefault()},children:(0,m.jsx)(h.CirclePlus,{})}),(0,m.jsx)(Q,{onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.RefreshCwIcon,{})}),(0,m.jsx)(Q,{onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:(0,m.jsx)(h.DownloadIcon,{})})]}),$=({children:e})=>{let{title:t}=F();return(0,m.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,m.jsx)(`h3`,{className:`font-semibold text-base text-text-positive`,children:t}),(0,m.jsx)(`div`,{className:`flex w-full flex-1 justify-between`,children:e})]})};$.displayName=`TableTooltip`,exports.UITableBadgeDisplay=x,exports.UITableBooleanDisplay=S,exports.UITableContainer=q,exports.UITableDateDisplay=C,exports.UITableDescriptionDisplay=w,exports.UITableFilter=Y,exports.UITableFooter=K,exports.UITableMoreButton=T,exports.UITableNameDisplay=E,exports.UITablePhoneNumberDisplay=D,exports.UITableProvider=X,exports.UITableRemoveButton=O,exports.UITableStatisticDisplay=A,exports.UITableTooltip=$,exports.UITableTooltipActions=re,exports.UITableTooltipFilter=Z,exports.UITableUserDataDisplay=j,exports.UITableWrapper=L;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|