periplo-ui 4.16.0 → 4.16.2

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.
Files changed (78) hide show
  1. package/dist/components/data-display/DataTable/components/DataTableCell.js +1 -1
  2. package/dist/components/data-display/DataTable/components/DataTableCell.js.map +1 -1
  3. package/dist/components/data-display/DataTable/components/DataTableGroupRow.js +1 -1
  4. package/dist/components/data-display/DataTable/components/DataTableGroupRow.js.map +1 -1
  5. package/dist/components/data-display/Marquee/Marquee.js +2 -2
  6. package/dist/components/data-display/Marquee/Marquee.js.map +1 -1
  7. package/dist/components/data-display/NotificationBadge/NotificationBadge.js +1 -1
  8. package/dist/components/data-display/NotificationBadge/NotificationBadge.js.map +1 -1
  9. package/dist/components/data-display/Tooltip/Tooltip.js +1 -1
  10. package/dist/components/data-display/Tooltip/Tooltip.js.map +1 -1
  11. package/dist/components/feedback/Dialog/Dialog.js +2 -2
  12. package/dist/components/feedback/Dialog/Dialog.js.map +1 -1
  13. package/dist/components/feedback/Progress/Progress.js +1 -1
  14. package/dist/components/feedback/Progress/Progress.js.map +1 -1
  15. package/dist/components/feedback/Skeleton/Skeleton.js +1 -1
  16. package/dist/components/feedback/Skeleton/Skeleton.js.map +1 -1
  17. package/dist/components/inputs/Button/Button.js +1 -1
  18. package/dist/components/inputs/Button/Button.js.map +1 -1
  19. package/dist/components/inputs/Checkbox/Checkbox.js +1 -1
  20. package/dist/components/inputs/Checkbox/Checkbox.js.map +1 -1
  21. package/dist/components/inputs/Combobox/Combobox.js +2 -1
  22. package/dist/components/inputs/Combobox/Combobox.js.map +1 -1
  23. package/dist/components/inputs/Combobox/StaticComboboxList.js +1 -2
  24. package/dist/components/inputs/Combobox/StaticComboboxList.js.map +1 -1
  25. package/dist/components/inputs/Combobox/VirtualizedComboboxList.js +1 -2
  26. package/dist/components/inputs/Combobox/VirtualizedComboboxList.js.map +1 -1
  27. package/dist/components/inputs/InlineMultiSelect/InlineMultiSelect.js +12 -13
  28. package/dist/components/inputs/InlineMultiSelect/InlineMultiSelect.js.map +1 -1
  29. package/dist/components/inputs/Input/Input.js +1 -1
  30. package/dist/components/inputs/Input/Input.js.map +1 -1
  31. package/dist/components/inputs/InputDate/InputDate.js +1 -1
  32. package/dist/components/inputs/InputDate/InputDate.js.map +1 -1
  33. package/dist/components/inputs/LazyDatePicker/LazyDatePicker.js +1 -1
  34. package/dist/components/inputs/LazyDatePicker/LazyDatePicker.js.map +1 -1
  35. package/dist/components/inputs/MultiSelect/MultiSelect.js +12 -13
  36. package/dist/components/inputs/MultiSelect/MultiSelect.js.map +1 -1
  37. package/dist/components/inputs/PhoneInput/PhoneInput.js +2 -1
  38. package/dist/components/inputs/PhoneInput/PhoneInput.js.map +1 -1
  39. package/dist/components/inputs/RadioGroup/RadioGroup.js +1 -1
  40. package/dist/components/inputs/RadioGroup/RadioGroup.js.map +1 -1
  41. package/dist/components/inputs/Select/Select.js +6 -5
  42. package/dist/components/inputs/Select/Select.js.map +1 -1
  43. package/dist/components/inputs/Textarea/Textarea.js +1 -1
  44. package/dist/components/inputs/Textarea/Textarea.js.map +1 -1
  45. package/dist/components/inputs/Toggle/Toggle.js +1 -1
  46. package/dist/components/inputs/Toggle/Toggle.js.map +1 -1
  47. package/dist/components/navigation/DropdownMenu/DropdownMenu.js +7 -6
  48. package/dist/components/navigation/DropdownMenu/DropdownMenu.js.map +1 -1
  49. package/dist/components/navigation/Sheet/Sheet.js +2 -2
  50. package/dist/components/navigation/Sheet/Sheet.js.map +1 -1
  51. package/dist/components/navigation/Sidebar/Sidebar.js +6 -2
  52. package/dist/components/navigation/Sidebar/Sidebar.js.map +1 -1
  53. package/dist/components/navigation/Sidebar/SidebarMenu.js +29 -55
  54. package/dist/components/navigation/Sidebar/SidebarMenu.js.map +1 -1
  55. package/dist/components/navigation/Sidebar/SidebarUser.d.ts +3 -1
  56. package/dist/components/navigation/Sidebar/SidebarUser.js +18 -5
  57. package/dist/components/navigation/Sidebar/SidebarUser.js.map +1 -1
  58. package/dist/components/navigation/Sidebar/index.js +2 -2
  59. package/dist/components/navigation/Sidebar/styles.d.ts +2 -2
  60. package/dist/components/navigation/Sidebar/styles.js +4 -2
  61. package/dist/components/navigation/Sidebar/styles.js.map +1 -1
  62. package/dist/components/navigation/Tabs/Tabs.js +1 -1
  63. package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
  64. package/dist/components/surface/Accordion/Accordion.js +3 -3
  65. package/dist/components/surface/Accordion/Accordion.js.map +1 -1
  66. package/dist/components/utils/Command/Command.js +8 -7
  67. package/dist/components/utils/Command/Command.js.map +1 -1
  68. package/dist/components/utils/Popover/Popover.js +2 -1
  69. package/dist/components/utils/Popover/Popover.js.map +1 -1
  70. package/dist/index.js +2 -2
  71. package/dist/lib/surface.d.ts +5 -0
  72. package/dist/lib/surface.js +10 -0
  73. package/dist/lib/surface.js.map +1 -0
  74. package/dist/lib/useSlidingIndicator.d.ts +22 -0
  75. package/dist/lib/useSlidingIndicator.js +65 -0
  76. package/dist/lib/useSlidingIndicator.js.map +1 -0
  77. package/dist/theme.css +46 -26
  78. package/package.json +1 -1
@@ -12,7 +12,7 @@ function DataTableCell({ columnId, isCollapsible = false, isOpen = true, classNa
12
12
  className: "p-0",
13
13
  ...tableCellProps,
14
14
  children: isCollapsible ? /* @__PURE__ */ jsx("div", {
15
- className: cn("grid transition-[grid-template-rows] duration-200 ease-in-out", isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
15
+ className: cn("ease-out-strong grid transition-[grid-template-rows] duration-200 motion-reduce:transition-none", isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
16
16
  children: /* @__PURE__ */ jsx("div", {
17
17
  className: "min-w-max overflow-hidden",
18
18
  children: content
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableCell.js","names":[],"sources":["../../../../../src/components/data-display/DataTable/components/DataTableCell.tsx"],"sourcesContent":["import { ComponentProps, ReactNode } from 'react'\n\nimport { TableCell } from '../../Table'\n\nimport { getDataTableCellClassName } from './dataTableCellStyles'\n\nimport { cn } from '@/lib/utils'\n\ntype DataTableCellProps = {\n readonly columnId: string\n readonly isCollapsible?: boolean\n readonly isOpen?: boolean\n readonly className?: string\n readonly children: ReactNode\n} & Omit<ComponentProps<typeof TableCell>, 'className' | 'children'>\n\nexport function DataTableCell({\n columnId,\n isCollapsible = false,\n isOpen = true,\n className,\n children,\n ...tableCellProps\n}: DataTableCellProps) {\n const content = <div className={cn(getDataTableCellClassName({ columnId }), className)}>{children}</div>\n\n return (\n <TableCell className=\"p-0\" {...tableCellProps}>\n {isCollapsible ? (\n <div\n className={cn(\n 'grid transition-[grid-template-rows] duration-200 ease-in-out',\n isOpen ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]',\n )}\n >\n <div className=\"min-w-max overflow-hidden\">{content}</div>\n </div>\n ) : (\n content\n )}\n </TableCell>\n )\n}\n"],"mappings":";;;;;AAgBA,SAAgB,cAAc,EAC5B,UACA,gBAAgB,OAChB,SAAS,MACT,WACA,UACA,GAAG,kBACkB;CACrB,MAAM,UAAU,oBAAC,OAAD;EAAK,WAAW,GAAG,0BAA0B,EAAE,SAAS,CAAC,GAAG,SAAS;EAAI;CAAc,CAAA;CAEvG,OACE,oBAAC,WAAD;EAAW,WAAU;EAAM,GAAI;EAC5B,UAAA,gBACC,oBAAC,OAAD;GACE,WAAW,GACT,iEACA,SAAS,oBAAoB,iBAC/B;GAEA,UAAA,oBAAC,OAAD;IAAK,WAAU;IAA6B,UAAA;GAAa,CAAA;EACtD,CAAA,IAEL;CAEO,CAAA;AAEf"}
1
+ {"version":3,"file":"DataTableCell.js","names":[],"sources":["../../../../../src/components/data-display/DataTable/components/DataTableCell.tsx"],"sourcesContent":["import { ComponentProps, ReactNode } from 'react'\n\nimport { TableCell } from '../../Table'\n\nimport { getDataTableCellClassName } from './dataTableCellStyles'\n\nimport { cn } from '@/lib/utils'\n\ntype DataTableCellProps = {\n readonly columnId: string\n readonly isCollapsible?: boolean\n readonly isOpen?: boolean\n readonly className?: string\n readonly children: ReactNode\n} & Omit<ComponentProps<typeof TableCell>, 'className' | 'children'>\n\nexport function DataTableCell({\n columnId,\n isCollapsible = false,\n isOpen = true,\n className,\n children,\n ...tableCellProps\n}: DataTableCellProps) {\n const content = <div className={cn(getDataTableCellClassName({ columnId }), className)}>{children}</div>\n\n return (\n <TableCell className=\"p-0\" {...tableCellProps}>\n {isCollapsible ? (\n <div\n className={cn(\n 'ease-out-strong grid transition-[grid-template-rows] duration-200 motion-reduce:transition-none',\n isOpen ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]',\n )}\n >\n <div className=\"min-w-max overflow-hidden\">{content}</div>\n </div>\n ) : (\n content\n )}\n </TableCell>\n )\n}\n"],"mappings":";;;;;AAgBA,SAAgB,cAAc,EAC5B,UACA,gBAAgB,OAChB,SAAS,MACT,WACA,UACA,GAAG,kBACkB;CACrB,MAAM,UAAU,oBAAC,OAAD;EAAK,WAAW,GAAG,0BAA0B,EAAE,SAAS,CAAC,GAAG,SAAS;EAAI;CAAc,CAAA;CAEvG,OACE,oBAAC,WAAD;EAAW,WAAU;EAAM,GAAI;EAC5B,UAAA,gBACC,oBAAC,OAAD;GACE,WAAW,GACT,mGACA,SAAS,oBAAoB,iBAC/B;GAEA,UAAA,oBAAC,OAAD;IAAK,WAAU;IAA6B,UAAA;GAAa,CAAA;EACtD,CAAA,IAEL;CAEO,CAAA;AAEf"}
@@ -25,7 +25,7 @@ function DataTableGroupRow({ colSpan, selector, content, isOpen, onToggle }) {
25
25
  children: /* @__PURE__ */ jsx(CaretRightIcon, {
26
26
  size: 16,
27
27
  weight: "bold",
28
- className: cn("shrink-0 transition-transform", isOpen && "rotate-90")
28
+ className: cn("ease-out-strong shrink-0 transition-transform duration-200 motion-reduce:transition-none", isOpen && "rotate-90")
29
29
  })
30
30
  })]
31
31
  })
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableGroupRow.js","names":[],"sources":["../../../../../src/components/data-display/DataTable/components/DataTableGroupRow.tsx"],"sourcesContent":["import { CaretRightIcon } from '@phosphor-icons/react/dist/ssr/CaretRight'\nimport { ReactNode } from 'react'\n\nimport { TableCell, TableRow } from '../../Table'\n\nimport { ACTIONS_COLUMN_ID, getDataTableCellClassName } from './dataTableCellStyles'\n\nimport { cn } from '@/lib/utils'\n\ntype DataTableGroupRowProps = {\n readonly colSpan: number\n readonly selector?: ReactNode\n readonly content: ReactNode\n readonly isOpen: boolean\n readonly onToggle: () => void\n}\n\nexport function DataTableGroupRow({ colSpan, selector, content, isOpen, onToggle }: DataTableGroupRowProps) {\n return (\n <TableRow onClick={onToggle} aria-expanded={isOpen} className=\"cursor-pointer bg-white hover:bg-neutral-50\">\n <TableCell colSpan={colSpan} className=\"p-0\">\n <div className=\"flex items-stretch justify-between\">\n <div className={cn(getDataTableCellClassName({ columnId: 'default', kind: 'group-label' }), 'gap-3')}>\n {selector}\n {content}\n </div>\n <div\n className={cn(\n getDataTableCellClassName({ columnId: ACTIONS_COLUMN_ID }),\n 'sticky right-0 shrink-0 bg-inherit',\n )}\n >\n <CaretRightIcon\n size={16}\n weight=\"bold\"\n className={cn('shrink-0 transition-transform', isOpen && 'rotate-90')}\n />\n </div>\n </div>\n </TableCell>\n </TableRow>\n )\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,kBAAkB,EAAE,SAAS,UAAU,SAAS,QAAQ,YAAoC;CAC1G,OACE,oBAAC,UAAD;EAAU,SAAS;EAAU,iBAAe;EAAQ,WAAU;EAC5D,UAAA,oBAAC,WAAD;GAAoB;GAAS,WAAU;GACrC,UAAA,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,qBAAC,OAAD;KAAK,WAAW,GAAG,0BAA0B;MAAE,UAAU;MAAW,MAAM;KAAc,CAAC,GAAG,OAAO;KAAnG,UAAA,CACG,UACA,OACE;IACL,CAAA,GAAA,oBAAC,OAAD;KACE,WAAW,GACT,0BAA0B,EAAE,UAAU,kBAAkB,CAAC,GACzD,oCACF;KAEA,UAAA,oBAAC,gBAAD;MACE,MAAM;MACN,QAAO;MACP,WAAW,GAAG,iCAAiC,UAAU,WAAW;KACrE,CAAA;IACE,CAAA,CACF;;EACI,CAAA;CACH,CAAA;AAEd"}
1
+ {"version":3,"file":"DataTableGroupRow.js","names":[],"sources":["../../../../../src/components/data-display/DataTable/components/DataTableGroupRow.tsx"],"sourcesContent":["import { CaretRightIcon } from '@phosphor-icons/react/dist/ssr/CaretRight'\nimport { ReactNode } from 'react'\n\nimport { TableCell, TableRow } from '../../Table'\n\nimport { ACTIONS_COLUMN_ID, getDataTableCellClassName } from './dataTableCellStyles'\n\nimport { cn } from '@/lib/utils'\n\ntype DataTableGroupRowProps = {\n readonly colSpan: number\n readonly selector?: ReactNode\n readonly content: ReactNode\n readonly isOpen: boolean\n readonly onToggle: () => void\n}\n\nexport function DataTableGroupRow({ colSpan, selector, content, isOpen, onToggle }: DataTableGroupRowProps) {\n return (\n <TableRow onClick={onToggle} aria-expanded={isOpen} className=\"cursor-pointer bg-white hover:bg-neutral-50\">\n <TableCell colSpan={colSpan} className=\"p-0\">\n <div className=\"flex items-stretch justify-between\">\n <div className={cn(getDataTableCellClassName({ columnId: 'default', kind: 'group-label' }), 'gap-3')}>\n {selector}\n {content}\n </div>\n <div\n className={cn(\n getDataTableCellClassName({ columnId: ACTIONS_COLUMN_ID }),\n 'sticky right-0 shrink-0 bg-inherit',\n )}\n >\n <CaretRightIcon\n size={16}\n weight=\"bold\"\n className={cn(\n 'ease-out-strong shrink-0 transition-transform duration-200 motion-reduce:transition-none',\n isOpen && 'rotate-90',\n )}\n />\n </div>\n </div>\n </TableCell>\n </TableRow>\n )\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,kBAAkB,EAAE,SAAS,UAAU,SAAS,QAAQ,YAAoC;CAC1G,OACE,oBAAC,UAAD;EAAU,SAAS;EAAU,iBAAe;EAAQ,WAAU;EAC5D,UAAA,oBAAC,WAAD;GAAoB;GAAS,WAAU;GACrC,UAAA,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,qBAAC,OAAD;KAAK,WAAW,GAAG,0BAA0B;MAAE,UAAU;MAAW,MAAM;KAAc,CAAC,GAAG,OAAO;KAAnG,UAAA,CACG,UACA,OACE;IACL,CAAA,GAAA,oBAAC,OAAD;KACE,WAAW,GACT,0BAA0B,EAAE,UAAU,kBAAkB,CAAC,GACzD,oCACF;KAEA,UAAA,oBAAC,gBAAD;MACE,MAAM;MACN,QAAO;MACP,WAAW,GACT,4FACA,UAAU,WACZ;KACD,CAAA;IACE,CAAA,CACF;;EACI,CAAA;CACH,CAAA;AAEd"}
@@ -10,8 +10,8 @@ function Marquee({ className, reverse = false, pauseOnHover = false, children, v
10
10
  }, className),
11
11
  children: new Array(repeat).fill(0).map((_unused, index) => /* @__PURE__ */ jsx("div", {
12
12
  className: cn("flex shrink-0 justify-around gap-(--gap)", {
13
- "animate-marquee flex-row": !vertical,
14
- "animate-marquee-vertical flex-col": vertical,
13
+ "animate-marquee flex-row motion-reduce:animate-none": !vertical,
14
+ "animate-marquee-vertical flex-col motion-reduce:animate-none": vertical,
15
15
  "group-hover:paused": pauseOnHover,
16
16
  "direction-[reverse]": reverse
17
17
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"Marquee.js","names":[],"sources":["../../../../src/components/data-display/Marquee/Marquee.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ntype MarqueeProps = {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number\n /**\n * Animation duration (e.g., \"40s\", \"2000ms\")\n * @default \"40s\"\n */\n duration?: string\n} & ComponentPropsWithoutRef<'div'>\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n duration = '40s',\n ...props\n}: MarqueeProps) {\n return (\n <div\n {...props}\n className={cn(\n 'group flex gap-(--gap) overflow-hidden p-2 [--gap:1rem]',\n {\n 'flex-row': !vertical,\n 'flex-col': vertical,\n },\n className,\n )}\n >\n {new Array(repeat).fill(0).map((_unused, index) => (\n <div\n key={`marquee-element-${index}`} // NOSONAR: fixed-length list of unnamed, unreorderable stars; index is the only stable identity there is\n className={cn('flex shrink-0 justify-around gap-(--gap)', {\n 'animate-marquee flex-row': !vertical,\n 'animate-marquee-vertical flex-col': vertical,\n 'group-hover:paused': pauseOnHover,\n 'direction-[reverse]': reverse,\n })}\n style={{ animationDuration: duration }}\n >\n {children}\n </div>\n ))}\n </div>\n )\n}\n"],"mappings":";;;AAwCA,SAAgB,QAAQ,EACtB,WACA,UAAU,OACV,eAAe,OACf,UACA,WAAW,OACX,SAAS,GACT,WAAW,OACX,GAAG,SACY;CACf,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,WAAW,GACT,2DACA;GACE,YAAY,CAAC;GACb,YAAY;EACd,GACA,SACF;EAEC,UAAA,IAAI,MAAM,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,UACvC,oBAAC,OAAD;GAEE,WAAW,GAAG,4CAA4C;IACxD,4BAA4B,CAAC;IAC7B,qCAAqC;IACrC,sBAAsB;IACtB,uBAAuB;GACzB,CAAC;GACD,OAAO,EAAE,mBAAmB,SAAS;GAEpC;EACE,GAVE,mBAAmB,OAUrB,CACN;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"Marquee.js","names":[],"sources":["../../../../src/components/data-display/Marquee/Marquee.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ntype MarqueeProps = {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number\n /**\n * Animation duration (e.g., \"40s\", \"2000ms\")\n * @default \"40s\"\n */\n duration?: string\n} & ComponentPropsWithoutRef<'div'>\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n duration = '40s',\n ...props\n}: MarqueeProps) {\n return (\n <div\n {...props}\n className={cn(\n 'group flex gap-(--gap) overflow-hidden p-2 [--gap:1rem]',\n {\n 'flex-row': !vertical,\n 'flex-col': vertical,\n },\n className,\n )}\n >\n {new Array(repeat).fill(0).map((_unused, index) => (\n <div\n key={`marquee-element-${index}`} // NOSONAR: fixed-length list of unnamed, unreorderable stars; index is the only stable identity there is\n className={cn('flex shrink-0 justify-around gap-(--gap)', {\n 'animate-marquee flex-row motion-reduce:animate-none': !vertical,\n 'animate-marquee-vertical flex-col motion-reduce:animate-none': vertical,\n 'group-hover:paused': pauseOnHover,\n 'direction-[reverse]': reverse,\n })}\n style={{ animationDuration: duration }}\n >\n {children}\n </div>\n ))}\n </div>\n )\n}\n"],"mappings":";;;AAwCA,SAAgB,QAAQ,EACtB,WACA,UAAU,OACV,eAAe,OACf,UACA,WAAW,OACX,SAAS,GACT,WAAW,OACX,GAAG,SACY;CACf,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,WAAW,GACT,2DACA;GACE,YAAY,CAAC;GACb,YAAY;EACd,GACA,SACF;EAEC,UAAA,IAAI,MAAM,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,UACvC,oBAAC,OAAD;GAEE,WAAW,GAAG,4CAA4C;IACxD,uDAAuD,CAAC;IACxD,gEAAgE;IAChE,sBAAsB;IACtB,uBAAuB;GACzB,CAAC;GACD,OAAO,EAAE,mBAAmB,SAAS;GAEpC;EACE,GAVE,mBAAmB,OAUrB,CACN;CACE,CAAA;AAET"}
@@ -75,7 +75,7 @@ var NotificationBadge = React$1.forwardRef(({ className, color = "accent", size
75
75
  }), !count && sizeClasses, className),
76
76
  ref,
77
77
  ...props,
78
- children: [ping && /* @__PURE__ */ jsx("span", { className: cn(notificationBadgeVariants({ color }), "absolute inline-flex h-full w-full animate-ping opacity-75") }), /* @__PURE__ */ jsx("span", {
78
+ children: [ping && /* @__PURE__ */ jsx("span", { className: cn(notificationBadgeVariants({ color }), "absolute inline-flex h-full w-full animate-ping opacity-75 motion-reduce:animate-none") }), /* @__PURE__ */ jsx("span", {
79
79
  className: cn(notificationBadgeVariants({ color }), "relative inline-flex h-full w-full items-center justify-center"),
80
80
  children: count
81
81
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationBadge.js","names":["React"],"sources":["../../../../src/components/data-display/NotificationBadge/NotificationBadge.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../../lib/utils'\n\nconst notificationBadgeVariants = cva('rounded-full', {\n variants: {\n color: {\n neutral: 'bg-neutral text-neutral-foreground',\n accent: 'bg-accent text-accent-foreground',\n primary: 'bg-primary text-primary-foreground',\n success: 'bg-success text-success-foreground ',\n warning: 'bg-warning text-warning-foreground',\n error: 'bg-error text-error-foreground',\n },\n size: {\n sm: 'h-2 w-2',\n md: 'h-3 w-3',\n lg: 'h-4 w-4',\n },\n position: {\n 'top-right': 'right-0 top-0',\n 'top-left': 'left-0 top-0',\n 'bottom-right': 'right-0 bottom-0',\n 'bottom-left': 'left-0 bottom-0',\n },\n numeric: {\n true: 'min-w-4 h-4 px-1 flex items-center justify-center text-[10px] font-medium',\n false: '',\n },\n },\n defaultVariants: {\n color: 'primary',\n size: 'md',\n position: 'top-right',\n numeric: false,\n },\n})\n\nexport type NotificationBadgeProps = {\n /**\n * Controls the visibility of the pulsing animation effect\n * @default true\n */\n ping?: boolean\n\n /**\n * The color variant of the badge\n * @default 'accent'\n */\n color?: 'neutral' | 'accent' | 'primary' | 'success' | 'warning' | 'error'\n\n /**\n * The size of the badge\n * @default 'md'\n */\n size?: 'sm' | 'md' | 'lg'\n\n /**\n * The position of the badge relative to its container\n * @default 'top-right'\n */\n position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'\n\n /**\n * The number to display in the badge\n */\n count?: number\n} & React.HTMLAttributes<HTMLElement>\n\n/**\n * A dot or counter positioned absolutely over an icon or avatar, used to\n * show a notification, status, or draw attention to an element.\n *\n * @example\n * ```tsx\n * // Simple notification badge\n * <div className=\"relative\">\n * <Bell className=\"h-6 w-6\" />\n * <NotificationBadge color=\"error\" />\n * </div>\n *\n * // Custom size and position\n * <div className=\"relative\">\n * <Avatar />\n * <NotificationBadge\n * color=\"success\"\n * size=\"sm\"\n * position=\"bottom-right\"\n * ping={false}\n * />\n * </div>\n * ```\n */\nconst NotificationBadge = React.forwardRef<HTMLSpanElement, NotificationBadgeProps>(\n ({ className, color = 'accent', size = 'md', position = 'top-right', ping = true, count, ...props }, ref) => {\n const sizeClasses = {\n sm: 'h-2 w-2',\n md: 'h-3 w-3',\n lg: 'h-4 w-4',\n }[size]\n\n return (\n <span\n data-testid=\"notification-badge\"\n className={cn(\n 'absolute flex',\n notificationBadgeVariants({ color, position, numeric: !!count }),\n !count && sizeClasses,\n className,\n )}\n ref={ref}\n {...props}\n >\n {ping && (\n <span\n className={cn(\n notificationBadgeVariants({ color }),\n 'absolute inline-flex h-full w-full animate-ping opacity-75',\n )}\n />\n )}\n <span\n className={cn(\n notificationBadgeVariants({ color }),\n 'relative inline-flex h-full w-full items-center justify-center',\n )}\n >\n {count}\n </span>\n </span>\n )\n },\n)\n\nNotificationBadge.displayName = 'NotificationBadge'\n\nexport { NotificationBadge, notificationBadgeVariants }\n"],"mappings":";;;;;AAKA,IAAM,4BAA4B,IAAI,gBAAgB;CACpD,UAAU;EACR,OAAO;GACL,SAAS;GACT,QAAQ;GACR,SAAS;GACT,SAAS;GACT,SAAS;GACT,OAAO;EACT;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EACA,UAAU;GACR,aAAa;GACb,YAAY;GACZ,gBAAgB;GAChB,eAAe;EACjB;EACA,SAAS;GACP,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,UAAU;EACV,SAAS;CACX;AACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAyDD,IAAM,oBAAoBA,QAAM,YAC7B,EAAE,WAAW,QAAQ,UAAU,OAAO,MAAM,WAAW,aAAa,OAAO,MAAM,OAAO,GAAG,SAAS,QAAQ;CAC3G,MAAM,cAAc;EAClB,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EAAE;CAEF,OACE,qBAAC,QAAD;EACE,eAAY;EACZ,WAAW,GACT,iBACA,0BAA0B;GAAE;GAAO;GAAU,SAAS,CAAC,CAAC;EAAM,CAAC,GAC/D,CAAC,SAAS,aACV,SACF;EACK;EACL,GAAI;EATN,UAAA,CAWG,QACC,oBAAC,QAAD,EACE,WAAW,GACT,0BAA0B,EAAE,MAAM,CAAC,GACnC,4DACF,EACD,CAAA,GAEH,oBAAC,QAAD;GACE,WAAW,GACT,0BAA0B,EAAE,MAAM,CAAC,GACnC,gEACF;GAEC,UAAA;EACG,CAAA,CACF;;AAEV,CACF;AAEA,kBAAkB,cAAc"}
1
+ {"version":3,"file":"NotificationBadge.js","names":["React"],"sources":["../../../../src/components/data-display/NotificationBadge/NotificationBadge.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../../lib/utils'\n\nconst notificationBadgeVariants = cva('rounded-full', {\n variants: {\n color: {\n neutral: 'bg-neutral text-neutral-foreground',\n accent: 'bg-accent text-accent-foreground',\n primary: 'bg-primary text-primary-foreground',\n success: 'bg-success text-success-foreground ',\n warning: 'bg-warning text-warning-foreground',\n error: 'bg-error text-error-foreground',\n },\n size: {\n sm: 'h-2 w-2',\n md: 'h-3 w-3',\n lg: 'h-4 w-4',\n },\n position: {\n 'top-right': 'right-0 top-0',\n 'top-left': 'left-0 top-0',\n 'bottom-right': 'right-0 bottom-0',\n 'bottom-left': 'left-0 bottom-0',\n },\n numeric: {\n true: 'min-w-4 h-4 px-1 flex items-center justify-center text-[10px] font-medium',\n false: '',\n },\n },\n defaultVariants: {\n color: 'primary',\n size: 'md',\n position: 'top-right',\n numeric: false,\n },\n})\n\nexport type NotificationBadgeProps = {\n /**\n * Controls the visibility of the pulsing animation effect\n * @default true\n */\n ping?: boolean\n\n /**\n * The color variant of the badge\n * @default 'accent'\n */\n color?: 'neutral' | 'accent' | 'primary' | 'success' | 'warning' | 'error'\n\n /**\n * The size of the badge\n * @default 'md'\n */\n size?: 'sm' | 'md' | 'lg'\n\n /**\n * The position of the badge relative to its container\n * @default 'top-right'\n */\n position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'\n\n /**\n * The number to display in the badge\n */\n count?: number\n} & React.HTMLAttributes<HTMLElement>\n\n/**\n * A dot or counter positioned absolutely over an icon or avatar, used to\n * show a notification, status, or draw attention to an element.\n *\n * @example\n * ```tsx\n * // Simple notification badge\n * <div className=\"relative\">\n * <Bell className=\"h-6 w-6\" />\n * <NotificationBadge color=\"error\" />\n * </div>\n *\n * // Custom size and position\n * <div className=\"relative\">\n * <Avatar />\n * <NotificationBadge\n * color=\"success\"\n * size=\"sm\"\n * position=\"bottom-right\"\n * ping={false}\n * />\n * </div>\n * ```\n */\nconst NotificationBadge = React.forwardRef<HTMLSpanElement, NotificationBadgeProps>(\n ({ className, color = 'accent', size = 'md', position = 'top-right', ping = true, count, ...props }, ref) => {\n const sizeClasses = {\n sm: 'h-2 w-2',\n md: 'h-3 w-3',\n lg: 'h-4 w-4',\n }[size]\n\n return (\n <span\n data-testid=\"notification-badge\"\n className={cn(\n 'absolute flex',\n notificationBadgeVariants({ color, position, numeric: !!count }),\n !count && sizeClasses,\n className,\n )}\n ref={ref}\n {...props}\n >\n {ping && (\n <span\n className={cn(\n notificationBadgeVariants({ color }),\n 'absolute inline-flex h-full w-full animate-ping opacity-75 motion-reduce:animate-none',\n )}\n />\n )}\n <span\n className={cn(\n notificationBadgeVariants({ color }),\n 'relative inline-flex h-full w-full items-center justify-center',\n )}\n >\n {count}\n </span>\n </span>\n )\n },\n)\n\nNotificationBadge.displayName = 'NotificationBadge'\n\nexport { NotificationBadge, notificationBadgeVariants }\n"],"mappings":";;;;;AAKA,IAAM,4BAA4B,IAAI,gBAAgB;CACpD,UAAU;EACR,OAAO;GACL,SAAS;GACT,QAAQ;GACR,SAAS;GACT,SAAS;GACT,SAAS;GACT,OAAO;EACT;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EACA,UAAU;GACR,aAAa;GACb,YAAY;GACZ,gBAAgB;GAChB,eAAe;EACjB;EACA,SAAS;GACP,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,UAAU;EACV,SAAS;CACX;AACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAyDD,IAAM,oBAAoBA,QAAM,YAC7B,EAAE,WAAW,QAAQ,UAAU,OAAO,MAAM,WAAW,aAAa,OAAO,MAAM,OAAO,GAAG,SAAS,QAAQ;CAC3G,MAAM,cAAc;EAClB,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EAAE;CAEF,OACE,qBAAC,QAAD;EACE,eAAY;EACZ,WAAW,GACT,iBACA,0BAA0B;GAAE;GAAO;GAAU,SAAS,CAAC,CAAC;EAAM,CAAC,GAC/D,CAAC,SAAS,aACV,SACF;EACK;EACL,GAAI;EATN,UAAA,CAWG,QACC,oBAAC,QAAD,EACE,WAAW,GACT,0BAA0B,EAAE,MAAM,CAAC,GACnC,uFACF,EACD,CAAA,GAEH,oBAAC,QAAD;GACE,WAAW,GACT,0BAA0B,EAAE,MAAM,CAAC,GACnC,gEACF;GAEC,UAAA;EACG,CAAA,CACF;;AAEV,CACF;AAEA,kBAAkB,cAAc"}
@@ -26,7 +26,7 @@ var TooltipContent = React$1.forwardRef(({ className, sideOffset = 4, collisionP
26
26
  ref,
27
27
  sideOffset,
28
28
  collisionPadding,
29
- className: cn("z-50 rounded-lg bg-white px-3 py-1.5 text-sm", "shadow-tooltip", "animate-in fade-in-0 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", className),
29
+ className: cn("z-50 rounded-lg bg-white px-3 py-1.5 text-sm", "shadow-tooltip", "animate-in fade-in-0 zoom-in-95 ease-out-strong origin-(--radix-tooltip-content-transform-origin)", "motion-reduce:zoom-in-100 motion-reduce:data-[state=closed]:zoom-out-100", "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", "motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0", className),
30
30
  ...props,
31
31
  children: [children, arrow && /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { fill: "white" })]
32
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","names":["React"],"sources":["../../../../src/components/data-display/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { Popover } from '../../utils/Popover/Popover'\n\nimport { useIsTouchDevice } from '@/lib/useTouchDevice'\nimport { cn } from '@/lib/utils'\n\n/**\n * Provider component that wraps all tooltip instances.\n * Controls the delay duration and positioning of tooltips app-wide.\n */\nconst TooltipProvider = TooltipPrimitive.Provider\n\n/**\n * The root component that wraps the trigger and content.\n * Manages the open state and hover interactions.\n */\nconst TooltipRoot = TooltipPrimitive.Root\n\n/**\n * The element that triggers the tooltip when hovered or focused.\n * Wrap with asChild to use custom components as triggers.\n */\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipPortal = TooltipPrimitive.Portal\n\ntype TooltipContentProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n arrow?: boolean\n /**\n * Container for the portal. When provided, the tooltip is portaled into this element instead of `document.body`.\n * Pass `null` to disable portaling and render inline (legacy behavior).\n */\n container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>['container'] | null\n}\n\nconst TooltipContent = React.forwardRef<React.ComponentRef<typeof TooltipPrimitive.Content>, TooltipContentProps>(\n ({ className, sideOffset = 4, collisionPadding = 8, arrow, container, children, ...props }, ref) => {\n const content = (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n 'z-50 rounded-lg bg-white px-3 py-1.5 text-sm',\n 'shadow-tooltip',\n 'animate-in fade-in-0 zoom-in-95',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 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 >\n {children}\n {arrow && <TooltipPrimitive.Arrow fill=\"white\" />}\n </TooltipPrimitive.Content>\n )\n\n if (container === null) return content\n return <TooltipPrimitive.Portal container={container ?? undefined}>{content}</TooltipPrimitive.Portal>\n },\n)\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport type TooltipProps = {\n /**\n * The content to be displayed inside the tooltip\n */\n children: React.ReactElement | string\n\n /**\n * The element that triggers the tooltip on hover\n */\n triggerElement: React.ReactElement | string\n\n /**\n * The preferred side of the trigger to render the tooltip\n */\n side?: 'top' | 'right' | 'bottom' | 'left'\n\n /**\n * Optional custom className for additional styling\n */\n className?: string\n\n /**\n * Delay duration for showing the tooltip in milliseconds\n * @default 300\n */\n delayDuration?: number\n\n /**\n * Whether to show an arrow pointer on the tooltip\n * @default false\n */\n arrow?: boolean\n\n /**\n * The preferred side of the trigger to render the mobile\n */\n mobileSide?: 'top' | 'right' | 'bottom' | 'left'\n\n /**\n * The preferred alignment of the mobile\n */\n mobileAlign?: 'start' | 'center' | 'end'\n\n /**\n * The preferred side offset of the mobile\n */\n mobileSideOffset?: number\n\n /**\n * The container to position the mobile\n */\n container?: HTMLElement\n\n /**\n * The minimum distance in pixels to keep between the tooltip and the boundary (usually the viewport) edges.\n * Can be a single number applied to all sides, or an object to configure each side individually.\n * @default 8\n */\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n}\n\n/**\n * A versatile tooltip component that shows additional information on hover.\n * Built on top of Radix UI's tooltip primitives with custom styling and animations.\n *\n * @example\n * // Basic usage\n * <Tooltip triggerElement={<button>Hover me</button>} side=\"top\">\n * Helpful information\n * </Tooltip>\n *\n * @example\n * // With custom delay and className\n * <Tooltip\n * triggerElement={<Icon />}\n * side=\"right\"\n * delayDuration={300}\n * className=\"custom-tooltip\"\n * >\n * Icon description\n * </Tooltip>\n */\nexport function Tooltip({\n triggerElement,\n children,\n side = 'top',\n className,\n delayDuration = 300,\n arrow = false,\n mobileSide,\n mobileAlign,\n mobileSideOffset,\n container,\n collisionPadding,\n ...props\n}: Readonly<TooltipProps>) {\n const isTouchDevice = useIsTouchDevice()\n\n return isTouchDevice ? (\n <Popover\n side={mobileSide}\n className={className}\n align={mobileAlign}\n sideOffset={mobileSideOffset}\n triggerElement={triggerElement}\n container={container}\n collisionPadding={collisionPadding}\n {...props}\n >\n {children}\n </Popover>\n ) : (\n <TooltipProvider>\n <TooltipRoot delayDuration={delayDuration}>\n <TooltipTrigger asChild>{triggerElement}</TooltipTrigger>\n <TooltipContent\n side={side}\n className={className}\n arrow={arrow}\n container={container}\n collisionPadding={collisionPadding}\n >\n {children}\n </TooltipContent>\n </TooltipRoot>\n </TooltipProvider>\n )\n}\n\n/**\n * Export primitive components for custom tooltip implementations.\n * Use these when you need more control over the tooltip behavior and styling.\n *\n * @example\n * // Custom implementation using primitives\n * <TooltipProvider>\n * <TooltipRoot>\n * <TooltipTrigger asChild>\n * <button>Hover</button>\n * </TooltipTrigger>\n * <TooltipContent>Custom tooltip</TooltipContent>\n * </TooltipRoot>\n * </TooltipProvider>\n */\nexport { TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger }\n"],"mappings":";;;;;;;;;;;AAYA,IAAM,kBAAkB,iBAAiB;;;;;AAMzC,IAAM,cAAc,iBAAiB;;;;;AAMrC,IAAM,iBAAiB,iBAAiB;AAExC,IAAM,gBAAgB,iBAAiB;AAWvC,IAAM,iBAAiBA,QAAM,YAC1B,EAAE,WAAW,aAAa,GAAG,mBAAmB,GAAG,OAAO,WAAW,UAAU,GAAG,SAAS,QAAQ;CAClG,MAAM,UACJ,qBAAC,iBAAiB,SAAlB;EACO;EACO;EACM;EAClB,WAAW,GACT,gDACA,kBACA,mCACA,kGACA,0CACA,0CACA,0CACA,0CACA,SACF;EACA,GAAI;EAfN,UAAA,CAiBG,UACA,SAAS,oBAAC,iBAAiB,OAAlB,EAAwB,MAAK,QAAS,CAAA,CACxB;;CAG5B,IAAI,cAAc,MAAM,OAAO;CAC/B,OAAO,oBAAC,iBAAiB,QAAlB;EAAyB,WAAW,aAAa,KAAA;EAAY,UAAA;CAAiC,CAAA;AACvG,CACF;AACA,eAAe,cAAc,iBAAiB,QAAQ;;;;;;;;;;;;;;;;;;;;;;AAoFtD,SAAgB,QAAQ,EACtB,gBACA,UACA,OAAO,OACP,WACA,gBAAgB,KAChB,QAAQ,OACR,YACA,aACA,kBACA,WACA,kBACA,GAAG,SACsB;CAGzB,OAFsB,iBAEf,IACL,oBAAC,SAAD;EACE,MAAM;EACK;EACX,OAAO;EACP,YAAY;EACI;EACL;EACO;EAClB,GAAI;EAEH;CACM,CAAA,IAET,oBAAC,iBAAD,EAAA,UACE,qBAAC,aAAD;EAA4B;EAA5B,UAAA,CACE,oBAAC,gBAAD;GAAgB,SAAA;GAAS,UAAA;EAA+B,CAAA,GACxD,oBAAC,gBAAD;GACQ;GACK;GACJ;GACI;GACO;GAEjB;EACa,CAAA,CACL;CACE,CAAA,EAAA,CAAA;AAErB"}
1
+ {"version":3,"file":"Tooltip.js","names":["React"],"sources":["../../../../src/components/data-display/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { Popover } from '../../utils/Popover/Popover'\n\nimport { useIsTouchDevice } from '@/lib/useTouchDevice'\nimport { cn } from '@/lib/utils'\n\n/**\n * Provider component that wraps all tooltip instances.\n * Controls the delay duration and positioning of tooltips app-wide.\n */\nconst TooltipProvider = TooltipPrimitive.Provider\n\n/**\n * The root component that wraps the trigger and content.\n * Manages the open state and hover interactions.\n */\nconst TooltipRoot = TooltipPrimitive.Root\n\n/**\n * The element that triggers the tooltip when hovered or focused.\n * Wrap with asChild to use custom components as triggers.\n */\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipPortal = TooltipPrimitive.Portal\n\ntype TooltipContentProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n arrow?: boolean\n /**\n * Container for the portal. When provided, the tooltip is portaled into this element instead of `document.body`.\n * Pass `null` to disable portaling and render inline (legacy behavior).\n */\n container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>['container'] | null\n}\n\nconst TooltipContent = React.forwardRef<React.ComponentRef<typeof TooltipPrimitive.Content>, TooltipContentProps>(\n ({ className, sideOffset = 4, collisionPadding = 8, arrow, container, children, ...props }, ref) => {\n const content = (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n 'z-50 rounded-lg bg-white px-3 py-1.5 text-sm',\n 'shadow-tooltip',\n 'animate-in fade-in-0 zoom-in-95 ease-out-strong origin-(--radix-tooltip-content-transform-origin)',\n 'motion-reduce:zoom-in-100 motion-reduce:data-[state=closed]:zoom-out-100',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 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 'motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0',\n className,\n )}\n {...props}\n >\n {children}\n {arrow && <TooltipPrimitive.Arrow fill=\"white\" />}\n </TooltipPrimitive.Content>\n )\n\n if (container === null) return content\n return <TooltipPrimitive.Portal container={container ?? undefined}>{content}</TooltipPrimitive.Portal>\n },\n)\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport type TooltipProps = {\n /**\n * The content to be displayed inside the tooltip\n */\n children: React.ReactElement | string\n\n /**\n * The element that triggers the tooltip on hover\n */\n triggerElement: React.ReactElement | string\n\n /**\n * The preferred side of the trigger to render the tooltip\n */\n side?: 'top' | 'right' | 'bottom' | 'left'\n\n /**\n * Optional custom className for additional styling\n */\n className?: string\n\n /**\n * Delay duration for showing the tooltip in milliseconds\n * @default 300\n */\n delayDuration?: number\n\n /**\n * Whether to show an arrow pointer on the tooltip\n * @default false\n */\n arrow?: boolean\n\n /**\n * The preferred side of the trigger to render the mobile\n */\n mobileSide?: 'top' | 'right' | 'bottom' | 'left'\n\n /**\n * The preferred alignment of the mobile\n */\n mobileAlign?: 'start' | 'center' | 'end'\n\n /**\n * The preferred side offset of the mobile\n */\n mobileSideOffset?: number\n\n /**\n * The container to position the mobile\n */\n container?: HTMLElement\n\n /**\n * The minimum distance in pixels to keep between the tooltip and the boundary (usually the viewport) edges.\n * Can be a single number applied to all sides, or an object to configure each side individually.\n * @default 8\n */\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n}\n\n/**\n * A versatile tooltip component that shows additional information on hover.\n * Built on top of Radix UI's tooltip primitives with custom styling and animations.\n *\n * @example\n * // Basic usage\n * <Tooltip triggerElement={<button>Hover me</button>} side=\"top\">\n * Helpful information\n * </Tooltip>\n *\n * @example\n * // With custom delay and className\n * <Tooltip\n * triggerElement={<Icon />}\n * side=\"right\"\n * delayDuration={300}\n * className=\"custom-tooltip\"\n * >\n * Icon description\n * </Tooltip>\n */\nexport function Tooltip({\n triggerElement,\n children,\n side = 'top',\n className,\n delayDuration = 300,\n arrow = false,\n mobileSide,\n mobileAlign,\n mobileSideOffset,\n container,\n collisionPadding,\n ...props\n}: Readonly<TooltipProps>) {\n const isTouchDevice = useIsTouchDevice()\n\n return isTouchDevice ? (\n <Popover\n side={mobileSide}\n className={className}\n align={mobileAlign}\n sideOffset={mobileSideOffset}\n triggerElement={triggerElement}\n container={container}\n collisionPadding={collisionPadding}\n {...props}\n >\n {children}\n </Popover>\n ) : (\n <TooltipProvider>\n <TooltipRoot delayDuration={delayDuration}>\n <TooltipTrigger asChild>{triggerElement}</TooltipTrigger>\n <TooltipContent\n side={side}\n className={className}\n arrow={arrow}\n container={container}\n collisionPadding={collisionPadding}\n >\n {children}\n </TooltipContent>\n </TooltipRoot>\n </TooltipProvider>\n )\n}\n\n/**\n * Export primitive components for custom tooltip implementations.\n * Use these when you need more control over the tooltip behavior and styling.\n *\n * @example\n * // Custom implementation using primitives\n * <TooltipProvider>\n * <TooltipRoot>\n * <TooltipTrigger asChild>\n * <button>Hover</button>\n * </TooltipTrigger>\n * <TooltipContent>Custom tooltip</TooltipContent>\n * </TooltipRoot>\n * </TooltipProvider>\n */\nexport { TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger }\n"],"mappings":";;;;;;;;;;;AAYA,IAAM,kBAAkB,iBAAiB;;;;;AAMzC,IAAM,cAAc,iBAAiB;;;;;AAMrC,IAAM,iBAAiB,iBAAiB;AAExC,IAAM,gBAAgB,iBAAiB;AAWvC,IAAM,iBAAiBA,QAAM,YAC1B,EAAE,WAAW,aAAa,GAAG,mBAAmB,GAAG,OAAO,WAAW,UAAU,GAAG,SAAS,QAAQ;CAClG,MAAM,UACJ,qBAAC,iBAAiB,SAAlB;EACO;EACO;EACM;EAClB,WAAW,GACT,gDACA,kBACA,qGACA,4EACA,kGACA,0CACA,0CACA,0CACA,0CACA,uNACA,SACF;EACA,GAAI;EAjBN,UAAA,CAmBG,UACA,SAAS,oBAAC,iBAAiB,OAAlB,EAAwB,MAAK,QAAS,CAAA,CACxB;;CAG5B,IAAI,cAAc,MAAM,OAAO;CAC/B,OAAO,oBAAC,iBAAiB,QAAlB;EAAyB,WAAW,aAAa,KAAA;EAAY,UAAA;CAAiC,CAAA;AACvG,CACF;AACA,eAAe,cAAc,iBAAiB,QAAQ;;;;;;;;;;;;;;;;;;;;;;AAoFtD,SAAgB,QAAQ,EACtB,gBACA,UACA,OAAO,OACP,WACA,gBAAgB,KAChB,QAAQ,OACR,YACA,aACA,kBACA,WACA,kBACA,GAAG,SACsB;CAGzB,OAFsB,iBAEf,IACL,oBAAC,SAAD;EACE,MAAM;EACK;EACX,OAAO;EACP,YAAY;EACI;EACL;EACO;EAClB,GAAI;EAEH;CACM,CAAA,IAET,oBAAC,iBAAD,EAAA,UACE,qBAAC,aAAD;EAA4B;EAA5B,UAAA,CACE,oBAAC,gBAAD;GAAgB,SAAA;GAAS,UAAA;EAA+B,CAAA,GACxD,oBAAC,gBAAD;GACQ;GACK;GACJ;GACI;GACO;GAEjB;EACa,CAAA,CACL;CACE,CAAA,EAAA,CAAA;AAErB"}
@@ -10,7 +10,7 @@ var DialogPortal = DialogPrimitive.Portal;
10
10
  var DialogClose = DialogPrimitive.Close;
11
11
  var DialogOverlay = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
12
12
  ref,
13
- className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80", className),
13
+ className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ease-out-strong fixed inset-0 z-50 bg-neutral-950/32", className),
14
14
  ...props
15
15
  }));
16
16
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
@@ -18,7 +18,7 @@ var DialogContent = React$1.forwardRef(({ className, children, closable = true,
18
18
  container,
19
19
  children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
20
20
  ref,
21
- className: cn("bg-background-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg", className),
21
+ className: cn("bg-background-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[state=open]:zoom-in-100 ease-out-strong fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg", className),
22
22
  onPointerDownOutside: (event) => {
23
23
  if (!closable) event.preventDefault();
24
24
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","names":["React"],"sources":["../../../../src/components/feedback/Dialog/Dialog.tsx"],"sourcesContent":["import { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\ntype DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n closable?: boolean\n container?: HTMLElement | null\n}\n\nconst Dialog = DialogPrimitive.Root\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80',\n className,\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<React.ComponentRef<typeof DialogPrimitive.Content>, DialogContentProps>(\n ({ className, children, closable = true, container, ...props }, ref) => (\n <DialogPortal container={container}>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-background-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',\n className,\n )}\n onPointerDownOutside={(event) => {\n if (!closable) {\n event.preventDefault()\n }\n }}\n onEscapeKeyDown={(event) => {\n if (!closable) {\n event.preventDefault()\n }\n }}\n {...props}\n >\n {children}\n {closable ? (\n <DialogPrimitive.Close className=\"data-[state=open]:text-muted-foreground ring-offset-background focus:ring-ring data-[state=open]:bg-accent absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none\">\n <XIcon size={24} weight=\"bold\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n ) : null}\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n)\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg leading-none font-semibold tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"],"mappings":";;;;;;AAWA,IAAM,SAAS,gBAAgB;AAE/B,IAAM,gBAAgB,gBAAgB;AAEtC,IAAM,eAAe,gBAAgB;AAErC,IAAM,cAAc,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AAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAEhD,IAAM,oBAAoBA,QAAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,aAAjB;CAAkC;CAAK,WAAW,GAAG,iCAAiC,SAAS;CAAG,GAAI;AAAQ,CAAA,CAC/G;AACD,kBAAkB,cAAc,gBAAgB,YAAY"}
1
+ {"version":3,"file":"Dialog.js","names":["React"],"sources":["../../../../src/components/feedback/Dialog/Dialog.tsx"],"sourcesContent":["import { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\ntype DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n closable?: boolean\n container?: HTMLElement | null\n}\n\nconst Dialog = DialogPrimitive.Root\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ease-out-strong fixed inset-0 z-50 bg-neutral-950/32',\n className,\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<React.ComponentRef<typeof DialogPrimitive.Content>, DialogContentProps>(\n ({ className, children, closable = true, container, ...props }, ref) => (\n <DialogPortal container={container}>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-background-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[state=open]:zoom-in-100 ease-out-strong fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',\n className,\n )}\n onPointerDownOutside={(event) => {\n if (!closable) {\n event.preventDefault()\n }\n }}\n onEscapeKeyDown={(event) => {\n if (!closable) {\n event.preventDefault()\n }\n }}\n {...props}\n >\n {children}\n {closable ? (\n <DialogPrimitive.Close className=\"data-[state=open]:text-muted-foreground ring-offset-background focus:ring-ring data-[state=open]:bg-accent absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none\">\n <XIcon size={24} weight=\"bold\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n ) : null}\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n)\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg leading-none font-semibold tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"],"mappings":";;;;;;AAWA,IAAM,SAAS,gBAAgB;AAE/B,IAAM,gBAAgB,gBAAgB;AAEtC,IAAM,eAAe,gBAAgB;AAErC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,gBAAgBA,QAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,SAAjB;CACO;CACL,WAAW,GACT,gLACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,gBAAgBA,QAAM,YACzB,EAAE,WAAW,UAAU,WAAW,MAAM,WAAW,GAAG,SAAS,QAC9D,qBAAC,cAAD;CAAyB;CAAzB,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAAC,gBAAgB,SAAjB;EACO;EACL,WAAW,GACT,scACA,SACF;EACA,uBAAuB,UAAU;GAC/B,IAAI,CAAC,UACH,MAAM,eAAe;EAEzB;EACA,kBAAkB,UAAU;GAC1B,IAAI,CAAC,UACH,MAAM,eAAe;EAEzB;EACA,GAAI;EAhBN,UAAA,CAkBG,UACA,WACC,qBAAC,gBAAgB,OAAjB;GAAuB,WAAU;GAAjC,UAAA,CACE,oBAAC,OAAD;IAAO,MAAM;IAAI,QAAO;GAAQ,CAAA,GAChC,oBAAC,QAAD;IAAM,WAAU;IAAU,UAAA;GAAW,CAAA,CAChB;EACrB,CAAA,IAAA,IACmB;CACb,CAAA,CAAA;AAElB,CAAA,CAAA;AACA,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAAC,OAAD;CAAK,WAAW,GAAG,sDAAsD,SAAS;CAAG,GAAI;AAAQ,CAAA;AAEnG,aAAa,cAAc;AAE3B,IAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAAC,OAAD;CAAK,WAAW,GAAG,iEAAiE,SAAS;CAAG,GAAI;AAAQ,CAAA;AAE9G,aAAa,cAAc;AAE3B,IAAM,cAAcA,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,OAAjB;CACO;CACL,WAAW,GAAG,qDAAqD,SAAS;CAC5E,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAEhD,IAAM,oBAAoBA,QAAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,aAAjB;CAAkC;CAAK,WAAW,GAAG,iCAAiC,SAAS;CAAG,GAAI;AAAQ,CAAA,CAC/G;AACD,kBAAkB,cAAc,gBAAgB,YAAY"}
@@ -41,7 +41,7 @@ var Progress = React$1.forwardRef(({ className, value, variant = "default", size
41
41
  className: cn(progressVariants({ radius }), "animate-indeterminate bg-primary h-full w-full flex-1", indicatorColor),
42
42
  style: { transform: "translateX(-50%)" }
43
43
  }) : /* @__PURE__ */ jsx(ProgressPrimitive.Indicator, {
44
- className: cn(progressVariants({ radius }), "h-full w-full flex-1 transition-all", indicatorColor),
44
+ className: cn(progressVariants({ radius }), "h-full w-full flex-1 transition-transform", indicatorColor),
45
45
  style: { transform: `translateX(-${(100 - (progressValue ?? 0)).toString()}%)` }
46
46
  })
47
47
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.js","names":["React"],"sources":["../../../../src/components/feedback/Progress/Progress.tsx"],"sourcesContent":["import * as ProgressPrimitive from '@radix-ui/react-progress'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { useFakeProgress } from '@/components/feedback/Progress/hooks/useFakeProgress'\nimport { cn } from '@/lib/utils'\n\nconst progressVariants = cva('relative w-full overflow-hidden bg-background-300', {\n variants: {\n size: {\n sm: 'h-2',\n md: 'h-4',\n lg: 'h-6',\n },\n radius: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'rounded-full',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n})\n\nexport type ProgressProps = {\n /**\n * The variant of the progress bar.\n * 'default': A standard progress bar that requires a `value` prop.\n * 'fake': A progress bar that simulates progress over a given `duration`.\n * 'indeterminate': A progress bar for when the progress is unknown.\n * @default 'default'\n */\n variant?: 'default' | 'fake' | 'indeterminate'\n /**\n * The color of the progress indicator. Should be a Tailwind CSS background color class.\n * @default 'bg-accent'\n */\n indicatorColor?: string\n /**\n * The total duration of the fake progress in milliseconds.\n * Only used when `variant` is 'fake'.\n * @default 10000\n */\n duration?: number\n /**\n * A callback function to be called when the fake progress is complete.\n * Only used when `variant` is 'fake'.\n */\n onComplete?: () => void\n /**\n * Whether to start the fake progress automatically.\n * Only used when `variant` is 'fake'.\n * @default true\n */\n autoStart?: boolean\n /**\n * The border radius of the progress bar and indicator.\n * @default 'full'\n */\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'full'\n} & React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> &\n VariantProps<typeof progressVariants>\n\nconst Progress = React.forwardRef<React.ComponentRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n (\n {\n className,\n value,\n variant = 'default',\n size,\n indicatorColor = 'bg-accent',\n duration = 10000,\n onComplete,\n autoStart = true,\n radius = 'full',\n ...props\n },\n ref,\n ) => {\n const { progress: fakeProgressValue } = useFakeProgress({\n duration,\n onComplete,\n autoStart: variant === 'fake' ? autoStart : false,\n })\n\n const progressValue = variant === 'fake' ? fakeProgressValue : value\n\n return (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(progressVariants({ size, radius }), className)}\n {...props}\n value={progressValue}\n >\n {variant === 'indeterminate' ? (\n <ProgressPrimitive.Indicator\n className={cn(\n progressVariants({ radius }),\n 'animate-indeterminate bg-primary h-full w-full flex-1',\n indicatorColor,\n )}\n style={{\n transform: 'translateX(-50%)',\n }}\n />\n ) : (\n <ProgressPrimitive.Indicator\n className={cn(progressVariants({ radius }), 'h-full w-full flex-1 transition-all', indicatorColor)}\n style={{ transform: `translateX(-${(100 - (progressValue ?? 0)).toString()}%)` }}\n />\n )}\n </ProgressPrimitive.Root>\n )\n },\n)\nProgress.displayName = ProgressPrimitive.Root.displayName\n\nexport { Progress }\n"],"mappings":";;;;;;;AAOA,IAAM,mBAAmB,IAAI,qDAAqD;CAChF,UAAU;EACR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EACA,QAAQ;GACN,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;EACR;CACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC;AAyCD,IAAM,WAAWA,QAAM,YAEnB,EACE,WACA,OACA,UAAU,WACV,MACA,iBAAiB,aACjB,WAAW,KACX,YACA,YAAY,MACZ,SAAS,QACT,GAAG,SAEL,QACG;CACH,MAAM,EAAE,UAAU,sBAAsB,gBAAgB;EACtD;EACA;EACA,WAAW,YAAY,SAAS,YAAY;CAC9C,CAAC;CAED,MAAM,gBAAgB,YAAY,SAAS,oBAAoB;CAE/D,OACE,oBAAC,kBAAkB,MAAnB;EACO;EACL,WAAW,GAAG,iBAAiB;GAAE;GAAM;EAAO,CAAC,GAAG,SAAS;EAC3D,GAAI;EACJ,OAAO;EAEN,UAAA,YAAY,kBACX,oBAAC,kBAAkB,WAAnB;GACE,WAAW,GACT,iBAAiB,EAAE,OAAO,CAAC,GAC3B,yDACA,cACF;GACA,OAAO,EACL,WAAW,mBACb;EACD,CAAA,IAED,oBAAC,kBAAkB,WAAnB;GACE,WAAW,GAAG,iBAAiB,EAAE,OAAO,CAAC,GAAG,uCAAuC,cAAc;GACjG,OAAO,EAAE,WAAW,gBAAgB,OAAO,iBAAiB,GAAA,CAAI,SAAS,EAAE,IAAI;EAChF,CAAA;CAEmB,CAAA;AAE5B,CACF;AACA,SAAS,cAAc,kBAAkB,KAAK"}
1
+ {"version":3,"file":"Progress.js","names":["React"],"sources":["../../../../src/components/feedback/Progress/Progress.tsx"],"sourcesContent":["import * as ProgressPrimitive from '@radix-ui/react-progress'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { useFakeProgress } from '@/components/feedback/Progress/hooks/useFakeProgress'\nimport { cn } from '@/lib/utils'\n\nconst progressVariants = cva('relative w-full overflow-hidden bg-background-300', {\n variants: {\n size: {\n sm: 'h-2',\n md: 'h-4',\n lg: 'h-6',\n },\n radius: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'rounded-full',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n})\n\nexport type ProgressProps = {\n /**\n * The variant of the progress bar.\n * 'default': A standard progress bar that requires a `value` prop.\n * 'fake': A progress bar that simulates progress over a given `duration`.\n * 'indeterminate': A progress bar for when the progress is unknown.\n * @default 'default'\n */\n variant?: 'default' | 'fake' | 'indeterminate'\n /**\n * The color of the progress indicator. Should be a Tailwind CSS background color class.\n * @default 'bg-accent'\n */\n indicatorColor?: string\n /**\n * The total duration of the fake progress in milliseconds.\n * Only used when `variant` is 'fake'.\n * @default 10000\n */\n duration?: number\n /**\n * A callback function to be called when the fake progress is complete.\n * Only used when `variant` is 'fake'.\n */\n onComplete?: () => void\n /**\n * Whether to start the fake progress automatically.\n * Only used when `variant` is 'fake'.\n * @default true\n */\n autoStart?: boolean\n /**\n * The border radius of the progress bar and indicator.\n * @default 'full'\n */\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'full'\n} & React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> &\n VariantProps<typeof progressVariants>\n\nconst Progress = React.forwardRef<React.ComponentRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n (\n {\n className,\n value,\n variant = 'default',\n size,\n indicatorColor = 'bg-accent',\n duration = 10000,\n onComplete,\n autoStart = true,\n radius = 'full',\n ...props\n },\n ref,\n ) => {\n const { progress: fakeProgressValue } = useFakeProgress({\n duration,\n onComplete,\n autoStart: variant === 'fake' ? autoStart : false,\n })\n\n const progressValue = variant === 'fake' ? fakeProgressValue : value\n\n return (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(progressVariants({ size, radius }), className)}\n {...props}\n value={progressValue}\n >\n {variant === 'indeterminate' ? (\n <ProgressPrimitive.Indicator\n className={cn(\n progressVariants({ radius }),\n 'animate-indeterminate bg-primary h-full w-full flex-1',\n indicatorColor,\n )}\n style={{\n transform: 'translateX(-50%)',\n }}\n />\n ) : (\n <ProgressPrimitive.Indicator\n className={cn(progressVariants({ radius }), 'h-full w-full flex-1 transition-transform', indicatorColor)}\n style={{ transform: `translateX(-${(100 - (progressValue ?? 0)).toString()}%)` }}\n />\n )}\n </ProgressPrimitive.Root>\n )\n },\n)\nProgress.displayName = ProgressPrimitive.Root.displayName\n\nexport { Progress }\n"],"mappings":";;;;;;;AAOA,IAAM,mBAAmB,IAAI,qDAAqD;CAChF,UAAU;EACR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EACA,QAAQ;GACN,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;EACR;CACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC;AAyCD,IAAM,WAAWA,QAAM,YAEnB,EACE,WACA,OACA,UAAU,WACV,MACA,iBAAiB,aACjB,WAAW,KACX,YACA,YAAY,MACZ,SAAS,QACT,GAAG,SAEL,QACG;CACH,MAAM,EAAE,UAAU,sBAAsB,gBAAgB;EACtD;EACA;EACA,WAAW,YAAY,SAAS,YAAY;CAC9C,CAAC;CAED,MAAM,gBAAgB,YAAY,SAAS,oBAAoB;CAE/D,OACE,oBAAC,kBAAkB,MAAnB;EACO;EACL,WAAW,GAAG,iBAAiB;GAAE;GAAM;EAAO,CAAC,GAAG,SAAS;EAC3D,GAAI;EACJ,OAAO;EAEN,UAAA,YAAY,kBACX,oBAAC,kBAAkB,WAAnB;GACE,WAAW,GACT,iBAAiB,EAAE,OAAO,CAAC,GAC3B,yDACA,cACF;GACA,OAAO,EACL,WAAW,mBACb;EACD,CAAA,IAED,oBAAC,kBAAkB,WAAnB;GACE,WAAW,GAAG,iBAAiB,EAAE,OAAO,CAAC,GAAG,6CAA6C,cAAc;GACvG,OAAO,EAAE,WAAW,gBAAgB,OAAO,iBAAiB,GAAA,CAAI,SAAS,EAAE,IAAI;EAChF,CAAA;CAEmB,CAAA;AAE5B,CACF;AACA,SAAS,cAAc,kBAAkB,KAAK"}
@@ -4,7 +4,7 @@ import { jsx } from "react/jsx-runtime";
4
4
  function Skeleton({ className, ...props }) {
5
5
  return /* @__PURE__ */ jsx("div", {
6
6
  "data-testid": "skeleton",
7
- className: cn("animate-pulse rounded-md bg-neutral-100", className),
7
+ className: cn("animate-pulse rounded-lg bg-neutral-100 motion-reduce:animate-none", className),
8
8
  ...props
9
9
  });
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton.js","names":[],"sources":["../../../../src/components/feedback/Skeleton/Skeleton.tsx"],"sourcesContent":["import { cn } from '@/lib/utils'\n\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div data-testid=\"skeleton\" className={cn('animate-pulse rounded-md bg-neutral-100', className)} {...props} />\n}\n\nexport { Skeleton }\n"],"mappings":";;;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAA+C;CAC/E,OAAO,oBAAC,OAAD;EAAK,eAAY;EAAW,WAAW,GAAG,2CAA2C,SAAS;EAAG,GAAI;CAAQ,CAAA;AACtH"}
1
+ {"version":3,"file":"Skeleton.js","names":[],"sources":["../../../../src/components/feedback/Skeleton/Skeleton.tsx"],"sourcesContent":["import { cn } from '@/lib/utils'\n\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n data-testid=\"skeleton\"\n className={cn('animate-pulse rounded-lg bg-neutral-100 motion-reduce:animate-none', className)}\n {...props}\n />\n )\n}\n\nexport { Skeleton }\n"],"mappings":";;;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAA+C;CAC/E,OACE,oBAAC,OAAD;EACE,eAAY;EACZ,WAAW,GAAG,sEAAsE,SAAS;EAC7F,GAAI;CACL,CAAA;AAEL"}
@@ -5,7 +5,7 @@ import { cva } from "class-variance-authority";
5
5
  import * as React$1 from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/components/inputs/Button/Button.tsx
8
- var buttonVariants = cva("inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", {
8
+ var buttonVariants = cva("inline-flex items-center justify-center gap-2 rounded-lg font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", {
9
9
  variants: {
10
10
  /**
11
11
  * Defines the visual style of the button
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["React"],"sources":["../../../../src/components/inputs/Button/Button.tsx"],"sourcesContent":["import type { Icon, IconWeight, IconProps } from '@phosphor-icons/react'\nimport { SpinnerGapIcon } from '@phosphor-icons/react/dist/ssr/SpinnerGap'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../../lib/utils'\nimport { typographyVariants } from '../../data-display/Typography'\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n /**\n * Defines the visual style of the button\n */\n variant: {\n primary:\n 'bg-primary-500 text-primary-foreground hover:bg-primary-700 active:bg-primary-900 disabled:bg-background-200',\n secondary:\n 'bg-neutral-950 text-neutral-foreground hover:bg-neutral-800 active:bg-neutral-700 disabled:bg-neutral-200 disabled:text-neutral-600',\n ghost:\n 'border border-neutral-500 text-primary-foreground hover:bg-neutral-100/50 active:bg-neutral-200/50 disabled:border-neutral-500 disabled:text-neutral-500',\n 'inverse-ghost':\n 'border border-neutral-50 text-neutral-50 hover:bg-neutral/50 hover:border-neutral-50 active:bg-neutral-600/50 disabled:border-neutral-300 disabled:text-neutral-300',\n text: 'hover:bg-neutral-50 active:bg-neutral-100 text-primary-foreground disabled:text-neutral-500',\n error:\n 'bg-error text-white hover:bg-error-800 active:bg-error-900 disabled:bg-error-200 disabled:text-neutral-600',\n success:\n 'bg-success text-white hover:bg-success-800 active:bg-success-900 disabled:bg-success-200 disabled:text-neutral-600',\n input:\n 'border border-neutral-200 bg-white text-neutral-950 hover:bg-neutral-50 active:bg-neutral-100 focus-visible:border-neutral-950 disabled:bg-neutral-50 focus-visible:ring-0',\n },\n /**\n * Controls the size and padding of the button\n */\n size: {\n sm: 'h-8 px-3 text-sm',\n md: 'h-10 px-4 text-sm',\n lg: 'h-12 px-6 text-base',\n },\n },\n compoundVariants: [\n {\n variant: 'input',\n size: ['sm', 'md', 'lg'],\n className: typographyVariants({ variant: 'body-lg' }),\n },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n)\n\nexport type ButtonProps = {\n /**\n * The visual style of the button.\n * @default primary\n */\n variant?: 'primary' | 'secondary' | 'ghost' | 'inverse-ghost' | 'text' | 'error' | 'success'\n\n /**\n * The size of the button, affecting height, padding, and font size.\n * @default md\n */\n size?: 'sm' | 'md' | 'lg'\n\n /**\n * Icon component to display at the start of the button content.\n * Use Phosphor icons for consistent styling.\n * @example <Button StartIcon={House}>Home</Button>\n */\n StartIcon?: Icon\n\n /**\n * Icon component to display at the end of the button content.\n * Use Phosphor icons for consistent styling.\n * @example <Button EndIcon={ArrowRight}>Next</Button>\n */\n EndIcon?: Icon\n\n /**\n * When true, displays a loading spinner and disables the button.\n * The spinner replaces the StartIcon if present.\n * @default false\n */\n loading?: boolean\n\n /**\n * When true, creates a circular button with only the StartIcon visible.\n * @default false\n */\n iconOnly?: boolean\n\n /**\n * The content to display inside the button.\n * Not displayed when iconOnly is true.\n */\n children?: React.ReactNode\n\n /**\n * Custom props to pass to the icons (StartIcon, EndIcon, SpinnerGap).\n * Allows overriding size, weight, color, etc.\n */\n iconProps?: Partial<IconProps>\n} & React.ButtonHTMLAttributes<HTMLButtonElement> &\n VariantProps<typeof buttonVariants>\n\n/**\n * A versatile button component that supports multiple variants, sizes, and icon placements.\n *\n * @example\n * // Basic usage\n * <Button>Click me</Button>\n *\n * // With icon\n * <Button StartIcon={House}>Home</Button>\n *\n * // Icon only button\n * <Button StartIcon={Plus} iconOnly aria-label=\"Add item\" />\n *\n * // Loading state\n * <Button loading>Processing...</Button>\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, variant = 'primary', size = 'md', StartIcon, EndIcon, loading, iconOnly, iconProps = {}, ...props },\n ref,\n ) => {\n const defaultIconProps = (): { size: number; weight: IconWeight } => {\n switch (size) {\n case 'sm':\n return { size: 16, weight: 'regular' }\n case 'lg':\n return { size: 20, weight: 'regular' }\n default:\n return { size: 18, weight: 'regular' }\n }\n }\n const mergedIconProps = { ...defaultIconProps(), ...iconProps }\n const getIconOnlyClasses = () => {\n switch (size) {\n case 'sm':\n return 'h-8 w-8'\n case 'lg':\n return 'h-12 w-12'\n default:\n return 'h-10 w-10'\n }\n }\n\n return (\n <button\n className={cn(\n buttonVariants({ variant, size, className }),\n iconOnly && 'rounded-full p-0',\n iconOnly && getIconOnlyClasses(),\n className,\n )}\n ref={ref}\n disabled={loading}\n {...props}\n >\n {loading && <SpinnerGapIcon {...defaultIconProps()} className=\"animate-spin\" aria-label=\"Loading\" />}\n {StartIcon && !loading && <StartIcon {...mergedIconProps} className=\"shrink-0\" />}\n {iconOnly ? <span className=\"sr-only\">{props.children}</span> : props.children}\n {EndIcon && !iconOnly && <EndIcon {...mergedIconProps} className=\"shrink-0\" />}\n </button>\n )\n },\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;AAQA,IAAM,iBAAiB,IACrB,+OACA;CACE,UAAU;;;;EAIR,SAAS;GACP,SACE;GACF,WACE;GACF,OACE;GACF,iBACE;GACF,MAAM;GACN,OACE;GACF,SACE;GACF,OACE;EACJ;;;;EAIA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,kBAAkB,CAChB;EACE,SAAS;EACT,MAAM;GAAC;GAAM;GAAM;EAAI;EACvB,WAAW,mBAAmB,EAAE,SAAS,UAAU,CAAC;CACtD,CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;;;;;;;;;;;;;;;;;AAwEA,IAAM,SAASA,QAAM,YAEjB,EAAE,WAAW,UAAU,WAAW,OAAO,MAAM,WAAW,SAAS,SAAS,UAAU,YAAY,CAAC,GAAG,GAAG,SACzG,QACG;CACH,MAAM,yBAA+D;EACnE,QAAQ,MAAR;GACE,KAAK,MACH,OAAO;IAAE,MAAM;IAAI,QAAQ;GAAU;GACvC,KAAK,MACH,OAAO;IAAE,MAAM;IAAI,QAAQ;GAAU;GACvC,SACE,OAAO;IAAE,MAAM;IAAI,QAAQ;GAAU;EACzC;CACF;CACA,MAAM,kBAAkB;EAAE,GAAG,iBAAiB;EAAG,GAAG;CAAU;CAC9D,MAAM,2BAA2B;EAC/B,QAAQ,MAAR;GACE,KAAK,MACH,OAAO;GACT,KAAK,MACH,OAAO;GACT,SACE,OAAO;EACX;CACF;CAEA,OACE,qBAAC,UAAD;EACE,WAAW,GACT,eAAe;GAAE;GAAS;GAAM;EAAU,CAAC,GAC3C,YAAY,oBACZ,YAAY,mBAAmB,GAC/B,SACF;EACK;EACL,UAAU;EACV,GAAI;EATN,UAAA;GAWG,WAAW,oBAAC,gBAAD;IAAgB,GAAI,iBAAiB;IAAG,WAAU;IAAe,cAAW;GAAW,CAAA;GAClG,aAAa,CAAC,WAAW,oBAAC,WAAD;IAAW,GAAI;IAAiB,WAAU;GAAY,CAAA;GAC/E,WAAW,oBAAC,QAAD;IAAM,WAAU;IAAW,UAAA,MAAM;GAAe,CAAA,IAAI,MAAM;GACrE,WAAW,CAAC,YAAY,oBAAC,SAAD;IAAS,GAAI;IAAiB,WAAU;GAAY,CAAA;EACvE;;AAEZ,CACF;AACA,OAAO,cAAc"}
1
+ {"version":3,"file":"Button.js","names":["React"],"sources":["../../../../src/components/inputs/Button/Button.tsx"],"sourcesContent":["import type { Icon, IconWeight, IconProps } from '@phosphor-icons/react'\nimport { SpinnerGapIcon } from '@phosphor-icons/react/dist/ssr/SpinnerGap'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../../lib/utils'\nimport { typographyVariants } from '../../data-display/Typography'\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center gap-2 rounded-lg font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n /**\n * Defines the visual style of the button\n */\n variant: {\n primary:\n 'bg-primary-500 text-primary-foreground hover:bg-primary-700 active:bg-primary-900 disabled:bg-background-200',\n secondary:\n 'bg-neutral-950 text-neutral-foreground hover:bg-neutral-800 active:bg-neutral-700 disabled:bg-neutral-200 disabled:text-neutral-600',\n ghost:\n 'border border-neutral-500 text-primary-foreground hover:bg-neutral-100/50 active:bg-neutral-200/50 disabled:border-neutral-500 disabled:text-neutral-500',\n 'inverse-ghost':\n 'border border-neutral-50 text-neutral-50 hover:bg-neutral/50 hover:border-neutral-50 active:bg-neutral-600/50 disabled:border-neutral-300 disabled:text-neutral-300',\n text: 'hover:bg-neutral-50 active:bg-neutral-100 text-primary-foreground disabled:text-neutral-500',\n error:\n 'bg-error text-white hover:bg-error-800 active:bg-error-900 disabled:bg-error-200 disabled:text-neutral-600',\n success:\n 'bg-success text-white hover:bg-success-800 active:bg-success-900 disabled:bg-success-200 disabled:text-neutral-600',\n input:\n 'border border-neutral-200 bg-white text-neutral-950 hover:bg-neutral-50 active:bg-neutral-100 focus-visible:border-neutral-950 disabled:bg-neutral-50 focus-visible:ring-0',\n },\n /**\n * Controls the size and padding of the button\n */\n size: {\n sm: 'h-8 px-3 text-sm',\n md: 'h-10 px-4 text-sm',\n lg: 'h-12 px-6 text-base',\n },\n },\n compoundVariants: [\n {\n variant: 'input',\n size: ['sm', 'md', 'lg'],\n className: typographyVariants({ variant: 'body-lg' }),\n },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n)\n\nexport type ButtonProps = {\n /**\n * The visual style of the button.\n * @default primary\n */\n variant?: 'primary' | 'secondary' | 'ghost' | 'inverse-ghost' | 'text' | 'error' | 'success'\n\n /**\n * The size of the button, affecting height, padding, and font size.\n * @default md\n */\n size?: 'sm' | 'md' | 'lg'\n\n /**\n * Icon component to display at the start of the button content.\n * Use Phosphor icons for consistent styling.\n * @example <Button StartIcon={House}>Home</Button>\n */\n StartIcon?: Icon\n\n /**\n * Icon component to display at the end of the button content.\n * Use Phosphor icons for consistent styling.\n * @example <Button EndIcon={ArrowRight}>Next</Button>\n */\n EndIcon?: Icon\n\n /**\n * When true, displays a loading spinner and disables the button.\n * The spinner replaces the StartIcon if present.\n * @default false\n */\n loading?: boolean\n\n /**\n * When true, creates a circular button with only the StartIcon visible.\n * @default false\n */\n iconOnly?: boolean\n\n /**\n * The content to display inside the button.\n * Not displayed when iconOnly is true.\n */\n children?: React.ReactNode\n\n /**\n * Custom props to pass to the icons (StartIcon, EndIcon, SpinnerGap).\n * Allows overriding size, weight, color, etc.\n */\n iconProps?: Partial<IconProps>\n} & React.ButtonHTMLAttributes<HTMLButtonElement> &\n VariantProps<typeof buttonVariants>\n\n/**\n * A versatile button component that supports multiple variants, sizes, and icon placements.\n *\n * @example\n * // Basic usage\n * <Button>Click me</Button>\n *\n * // With icon\n * <Button StartIcon={House}>Home</Button>\n *\n * // Icon only button\n * <Button StartIcon={Plus} iconOnly aria-label=\"Add item\" />\n *\n * // Loading state\n * <Button loading>Processing...</Button>\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, variant = 'primary', size = 'md', StartIcon, EndIcon, loading, iconOnly, iconProps = {}, ...props },\n ref,\n ) => {\n const defaultIconProps = (): { size: number; weight: IconWeight } => {\n switch (size) {\n case 'sm':\n return { size: 16, weight: 'regular' }\n case 'lg':\n return { size: 20, weight: 'regular' }\n default:\n return { size: 18, weight: 'regular' }\n }\n }\n const mergedIconProps = { ...defaultIconProps(), ...iconProps }\n const getIconOnlyClasses = () => {\n switch (size) {\n case 'sm':\n return 'h-8 w-8'\n case 'lg':\n return 'h-12 w-12'\n default:\n return 'h-10 w-10'\n }\n }\n\n return (\n <button\n className={cn(\n buttonVariants({ variant, size, className }),\n iconOnly && 'rounded-full p-0',\n iconOnly && getIconOnlyClasses(),\n className,\n )}\n ref={ref}\n disabled={loading}\n {...props}\n >\n {loading && <SpinnerGapIcon {...defaultIconProps()} className=\"animate-spin\" aria-label=\"Loading\" />}\n {StartIcon && !loading && <StartIcon {...mergedIconProps} className=\"shrink-0\" />}\n {iconOnly ? <span className=\"sr-only\">{props.children}</span> : props.children}\n {EndIcon && !iconOnly && <EndIcon {...mergedIconProps} className=\"shrink-0\" />}\n </button>\n )\n },\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;AAQA,IAAM,iBAAiB,IACrB,+OACA;CACE,UAAU;;;;EAIR,SAAS;GACP,SACE;GACF,WACE;GACF,OACE;GACF,iBACE;GACF,MAAM;GACN,OACE;GACF,SACE;GACF,OACE;EACJ;;;;EAIA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,kBAAkB,CAChB;EACE,SAAS;EACT,MAAM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
  className: cn("peer relative h-5 w-5 shrink-0 rounded border border-neutral-300 bg-white transition-colors", "focus-visible:ring-accent-400 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none", "disabled:cursor-not-allowed disabled:border-neutral-200 disabled:bg-neutral-100 disabled:opacity-50", "data-[state=checked]:border-neutral-600 data-[state=checked]:bg-white", "data-[state=indeterminate]:border-neutral-600 data-[state=indeterminate]:bg-white", "hover:border-neutral-600 disabled:hover:border-neutral-200 data-[state=checked]:hover:border-neutral-600", className),
32
32
  ...props,
33
33
  children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, {
34
- className: cn("absolute inset-0 flex items-center justify-center"),
34
+ className: cn("absolute inset-0 flex items-center justify-center", "animate-in fade-in-0 zoom-in-90 ease-out-strong motion-reduce:zoom-in-100 duration-150"),
35
35
  children: props.checked === "indeterminate" ? /* @__PURE__ */ jsx(MinusIcon, {
36
36
  className: "h-3.5 w-3.5 text-neutral-600",
37
37
  weight: "bold"
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","names":["React"],"sources":["../../../../src/components/inputs/Checkbox/Checkbox.tsx"],"sourcesContent":["import { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { MinusIcon } from '@phosphor-icons/react/dist/ssr/Minus'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\ntype CheckboxProps = {\n /** Additional CSS classes to be applied to the checkbox */\n className?: string\n /** The controlled checked state of the checkbox. `'indeterminate'` renders a partial (dash) state. */\n checked?: CheckboxPrimitive.CheckedState\n /** The default checked state when initially rendered */\n defaultChecked?: boolean\n /** Whether the checkbox is disabled */\n disabled?: boolean\n /** Whether the checkbox is required in a form */\n required?: boolean\n /** The name of the checkbox when used in a form */\n name?: string\n /** The value of the checkbox when used in a form */\n value?: string\n /** Handler called when the checked state changes */\n onCheckedChange?: (checked: boolean) => void\n} & React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n\n/**\n * A controlled checkbox component built on top of Radix UI Checkbox.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <Checkbox />\n *\n * // With controlled state\n * <Checkbox checked={checked} onCheckedChange={setChecked} />\n *\n * // With form integration\n * <Checkbox name=\"terms\" required />\n *\n * // With label\n * <div className=\"flex items-center gap-2\">\n * <Checkbox id=\"terms\" />\n * <label htmlFor=\"terms\">Accept terms</label>\n * </div>\n * ```\n */\nconst Checkbox = React.forwardRef<React.ComponentRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n ({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'peer relative h-5 w-5 shrink-0 rounded border border-neutral-300 bg-white transition-colors',\n 'focus-visible:ring-accent-400 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none',\n 'disabled:cursor-not-allowed disabled:border-neutral-200 disabled:bg-neutral-100 disabled:opacity-50',\n 'data-[state=checked]:border-neutral-600 data-[state=checked]:bg-white',\n 'data-[state=indeterminate]:border-neutral-600 data-[state=indeterminate]:bg-white',\n 'hover:border-neutral-600 disabled:hover:border-neutral-200 data-[state=checked]:hover:border-neutral-600',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className={cn('absolute inset-0 flex items-center justify-center')}>\n {props.checked === 'indeterminate' ? (\n <MinusIcon className=\"h-3.5 w-3.5 text-neutral-600\" weight=\"bold\" />\n ) : (\n <CheckIcon className=\"h-3.5 w-3.5 text-neutral-600\" weight=\"bold\" />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n ),\n)\n\nCheckbox.displayName = 'Checkbox'\n\nexport type { CheckboxProps }\nexport { Checkbox }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAM,WAAWA,QAAM,YACpB,EAAE,WAAW,GAAG,SAAS,QACxB,oBAAC,kBAAkB,MAAnB;CACO;CACL,WAAW,GACT,+FACA,6GACA,uGACA,yEACA,qFACA,4GACA,SACF;CACA,GAAI;CAEJ,UAAA,oBAAC,kBAAkB,WAAnB;EAA6B,WAAW,GAAG,mDAAmD;EAC3F,UAAA,MAAM,YAAY,kBACjB,oBAAC,WAAD;GAAW,WAAU;GAA+B,QAAO;EAAQ,CAAA,IAEnE,oBAAC,WAAD;GAAW,WAAU;GAA+B,QAAO;EAAQ,CAAA;CAE1C,CAAA;AACP,CAAA,CAE5B;AAEA,SAAS,cAAc"}
1
+ {"version":3,"file":"Checkbox.js","names":["React"],"sources":["../../../../src/components/inputs/Checkbox/Checkbox.tsx"],"sourcesContent":["import { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { MinusIcon } from '@phosphor-icons/react/dist/ssr/Minus'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\ntype CheckboxProps = {\n /** Additional CSS classes to be applied to the checkbox */\n className?: string\n /** The controlled checked state of the checkbox. `'indeterminate'` renders a partial (dash) state. */\n checked?: CheckboxPrimitive.CheckedState\n /** The default checked state when initially rendered */\n defaultChecked?: boolean\n /** Whether the checkbox is disabled */\n disabled?: boolean\n /** Whether the checkbox is required in a form */\n required?: boolean\n /** The name of the checkbox when used in a form */\n name?: string\n /** The value of the checkbox when used in a form */\n value?: string\n /** Handler called when the checked state changes */\n onCheckedChange?: (checked: boolean) => void\n} & React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n\n/**\n * A controlled checkbox component built on top of Radix UI Checkbox.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <Checkbox />\n *\n * // With controlled state\n * <Checkbox checked={checked} onCheckedChange={setChecked} />\n *\n * // With form integration\n * <Checkbox name=\"terms\" required />\n *\n * // With label\n * <div className=\"flex items-center gap-2\">\n * <Checkbox id=\"terms\" />\n * <label htmlFor=\"terms\">Accept terms</label>\n * </div>\n * ```\n */\nconst Checkbox = React.forwardRef<React.ComponentRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n ({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'peer relative h-5 w-5 shrink-0 rounded border border-neutral-300 bg-white transition-colors',\n 'focus-visible:ring-accent-400 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none',\n 'disabled:cursor-not-allowed disabled:border-neutral-200 disabled:bg-neutral-100 disabled:opacity-50',\n 'data-[state=checked]:border-neutral-600 data-[state=checked]:bg-white',\n 'data-[state=indeterminate]:border-neutral-600 data-[state=indeterminate]:bg-white',\n 'hover:border-neutral-600 disabled:hover:border-neutral-200 data-[state=checked]:hover:border-neutral-600',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n 'absolute inset-0 flex items-center justify-center',\n 'animate-in fade-in-0 zoom-in-90 ease-out-strong motion-reduce:zoom-in-100 duration-150',\n )}\n >\n {props.checked === 'indeterminate' ? (\n <MinusIcon className=\"h-3.5 w-3.5 text-neutral-600\" weight=\"bold\" />\n ) : (\n <CheckIcon className=\"h-3.5 w-3.5 text-neutral-600\" weight=\"bold\" />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n ),\n)\n\nCheckbox.displayName = 'Checkbox'\n\nexport type { CheckboxProps }\nexport { Checkbox }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAM,WAAWA,QAAM,YACpB,EAAE,WAAW,GAAG,SAAS,QACxB,oBAAC,kBAAkB,MAAnB;CACO;CACL,WAAW,GACT,+FACA,6GACA,uGACA,yEACA,qFACA,4GACA,SACF;CACA,GAAI;CAEJ,UAAA,oBAAC,kBAAkB,WAAnB;EACE,WAAW,GACT,qDACA,wFACF;EAEC,UAAA,MAAM,YAAY,kBACjB,oBAAC,WAAD;GAAW,WAAU;GAA+B,QAAO;EAAQ,CAAA,IAEnE,oBAAC,WAAD;GAAW,WAAU;GAA+B,QAAO;EAAQ,CAAA;CAE1C,CAAA;AACP,CAAA,CAE5B;AAEA,SAAS,cAAc"}
@@ -1,4 +1,5 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
+ import { SURFACE_LIST } from "../../../lib/surface.js";
2
3
  import { useListScroll } from "../../../lib/useListScroll.js";
3
4
  import { Command, CommandInput } from "../../utils/Command/Command.js";
4
5
  import { PopoverContent, PopoverRoot, PopoverTrigger } from "../../utils/Popover/Popover.js";
@@ -85,7 +86,7 @@ var Combobox = (props) => {
85
86
  onClick: handleClear
86
87
  })]
87
88
  }), /* @__PURE__ */ jsx(PopoverContent, {
88
- className: cn("overflow-hidden p-0", contentClassName),
89
+ className: cn(SURFACE_LIST, "overflow-hidden p-0", contentClassName),
89
90
  container,
90
91
  side: "bottom",
91
92
  align,
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.js","names":[],"sources":["../../../../src/components/inputs/Combobox/Combobox.tsx"],"sourcesContent":["import { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport { useEffect, useRef } from 'react'\n\nimport { useListScroll } from '../../../lib/useListScroll'\nimport { cn } from '../../../lib/utils'\nimport { Command, CommandInput } from '../../utils/Command'\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from '../../utils/Popover'\n\nimport { ComboboxTrigger } from './ComboboxTrigger'\nimport { StaticComboboxList } from './StaticComboboxList'\nimport { useCombobox } from './useCombobox'\nimport { VirtualizedComboboxList } from './VirtualizedComboboxList'\n\ntype ComboboxBaseProps<T> = {\n /** Unique identifier for the combobox */\n id?: string\n /** Array of options to display in the combobox (static mode). */\n options?: Array<T>\n /** Function to get the unique identifier from an option. */\n getOptionValue: (option: T) => string\n /** Function to get the display text from an option. */\n getOptionLabel: (option: T) => string\n /** Custom render function for options. If not provided, defaults to showing a checkmark and label */\n renderOption?: (option: T, isSelected: boolean) => React.ReactNode\n /** Placeholder text shown when no option is selected */\n placeholder?: React.ReactNode\n /** Placeholder text for the search input field */\n searchPlaceholder?: string\n /** Message shown when no options match the search query */\n emptyMessage?: string\n /** Additional CSS classes to apply to the combobox trigger */\n className?: string\n /** Additional CSS classes to apply to the popover content */\n contentClassName?: string\n /** Whether the combobox is disabled */\n disabled?: boolean\n /** Maximum height of the options list. Can be any valid CSS height value */\n maxHeight?: string | number\n /** Whether to close the dropdown when an option is selected. Defaults to `true` for single select and `false` for multi-select. */\n closeOnSelect?: boolean\n /** Whether the combobox is in a loading state */\n loading?: boolean\n /** Message to show when in loading state */\n loadingPlaceholder?: string\n /** Whether the combobox has an error */\n error?: boolean | string\n /** Custom function to filter options based on search term (static mode only) */\n filterOptions?: (options: Array<T>, searchTerm: string) => Array<T>\n /** Callback function executed when the clear button is clicked. When provided, an X button will appear on hover to clear the selection. */\n onClear?: boolean | (() => void)\n /** Whether the selection can be cleared */\n clearable?: boolean\n /** Whether the combobox is inside a modal */\n modal?: boolean\n /** Placeholder text for the selected multiple options */\n selectedMultiplePlaceholder?: string\n /** Placeholder text for the multiple options */\n multipleOptionsPlaceholder?: string\n /** Pinned above a separator. Selecting one switches multi-select to single-select. */\n specialOptions?: Array<T>\n /** Heading for the special options group */\n specialOptionsTitle?: string\n /** Container element to position the combobox relative to. */\n container?: HTMLElement\n /** Alignment of the dropdown relative to the trigger. Defaults to 'center'. */\n align?: 'start' | 'center' | 'end'\n /** Auto-focus the search input when the dropdown opens. */\n onOpenAutoFocus?: boolean\n /** Defaults to `!!error`. */\n 'aria-invalid'?: boolean\n 'aria-describedby'?: string\n}\n\nexport type ComboboxSingleProps<T> = ComboboxBaseProps<T> & {\n virtualized?: false\n multiple?: false\n value?: string\n onChange: (value: string) => void\n /** Custom render function for the selected value display. */\n renderLabel?: (selectedOption: T) => React.ReactNode\n}\n\nexport type ComboboxMultipleProps<T> = ComboboxBaseProps<T> & {\n virtualized?: false\n multiple: true\n value?: Array<string>\n onChange: (value: Array<string>) => void\n /** Custom render function for the selected value(s) display. */\n renderLabel?: (selectedOptions: Array<T>, onRemove: (value: string) => void) => React.ReactNode\n}\n\ntype ComboboxRemoteVirtualizedProps<T> = {\n /** The accumulated, flattened list of loaded items. */\n items: Array<T>\n /** Whether more pages can be loaded. */\n hasNextPage: boolean\n /** Whether the next page is currently being fetched. */\n isFetchingNextPage: boolean\n /** Request the next page (triggered near the end of the list). */\n onLoadMore: () => void\n /** Emitted (debounced) when the search term changes. The consumer refetches. */\n onSearchChange: (search: string) => void\n}\n\n/** Pass none of `ComboboxRemoteVirtualizedProps`'s fields to virtualize the local `options`\n * list instead (filtered the same way static mode is). */\ntype ComboboxLocalVirtualizedProps = {\n items?: undefined\n hasNextPage?: undefined\n isFetchingNextPage?: undefined\n onLoadMore?: undefined\n onSearchChange?: undefined\n}\n\nexport type ComboboxVirtualizedProps<T> = ComboboxBaseProps<T> & {\n virtualized: true\n multiple?: false\n value?: string\n onChange: (value: string) => void\n /** Custom render function for the selected value display. */\n renderLabel?: (selectedOption: T) => React.ReactNode\n /** The resolved selected item, fetched independently of the list. Used for the trigger label. */\n selectedItem?: T\n /** Estimated row height (px), default: 40. */\n estimateSize?: number\n} & (ComboboxRemoteVirtualizedProps<T> | ComboboxLocalVirtualizedProps)\n\nexport type ComboboxProps<T> = ComboboxSingleProps<T> | ComboboxMultipleProps<T> | ComboboxVirtualizedProps<T>\n\n/**\n * A searchable combobox component with support for custom rendering, keyboard navigation, and search filtering.\n *\n * @example Basic usage\n * ```tsx\n * <Combobox<User>\n * options={users}\n * value={selectedUserId}\n * onChange={setSelectedUserId}\n * getOptionValue={(user) => user.id}\n * getOptionLabel={(user) => user.name}\n * />\n * ```\n */\nexport const Combobox = <T extends object>(props: ComboboxProps<T>) => {\n const {\n id,\n options = [],\n getOptionValue,\n getOptionLabel,\n searchPlaceholder = 'Search...',\n emptyMessage = 'No results found.',\n className = 'w-60',\n contentClassName,\n disabled = false,\n maxHeight = '300px',\n renderOption,\n loading = false,\n loadingPlaceholder = 'Cargando...',\n error = false,\n multiple,\n onClear,\n modal = false,\n selectedMultiplePlaceholder = 'Selected',\n multipleOptionsPlaceholder = 'Options',\n specialOptionsTitle,\n container,\n align,\n onOpenAutoFocus = false,\n 'aria-invalid': ariaInvalid,\n 'aria-describedby': ariaDescribedBy,\n } = props\n\n const searchInputRef = useRef<HTMLInputElement>(null)\n const normalizedMaxHeight = typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight\n const boundedListMaxHeight = `min(${normalizedMaxHeight}, max(120px, calc(var(--radix-popover-content-available-height, 100dvh) - 68px)))`\n\n const {\n open,\n setOpen,\n searchTerm,\n setSearchTerm,\n setIsHovered,\n hasNextPage,\n loadingMore,\n isVirtualized,\n filteredOptions,\n filteredSpecialOptions,\n displayValue,\n hasValue,\n showClearButton,\n handleSelect,\n handleClear,\n loadNextPage,\n } = useCombobox(props)\n\n const singleValue = typeof props.value === 'string' && props.value ? props.value : undefined\n\n useEffect(() => {\n if (!open || !onOpenAutoFocus) return\n const timeoutId = globalThis.setTimeout(() => searchInputRef.current?.focus(), 0)\n return () => globalThis.clearTimeout(timeoutId)\n }, [open, onOpenAutoFocus])\n\n const listRef = useListScroll({\n open,\n searchTerm,\n selectedValue: isVirtualized ? undefined : singleValue,\n })\n\n const hasMultipleRenderLabel = !!(multiple && 'renderLabel' in props && props.renderLabel)\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <PopoverRoot open={open} onOpenChange={setOpen} modal={modal}>\n <div\n className={cn('relative', className)}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <PopoverTrigger\n asChild\n onPointerDown={(event) => {\n event.stopPropagation()\n if (open) {\n setOpen(false)\n event.preventDefault()\n } else {\n setOpen(true)\n }\n }}\n onClick={(event) => {\n if (event.detail === 0) return\n event.preventDefault()\n event.stopPropagation()\n }}\n >\n <ComboboxTrigger\n id={id}\n disabled={disabled}\n open={open}\n error={error}\n hasValue={hasValue}\n showClearButton={showClearButton}\n isMultilineLabel={hasMultipleRenderLabel}\n displayValue={displayValue}\n className={cn('w-full', className)}\n aria-invalid={ariaInvalid ?? (!!error || undefined)}\n aria-describedby={ariaDescribedBy}\n />\n </PopoverTrigger>\n {!!onClear && hasValue && (\n <XIcon\n data-testid=\"clear-button\"\n className={cn(\n 'absolute top-1/2 right-4 z-10 h-4 w-4 -translate-y-1/2 cursor-pointer transition-opacity duration-150',\n showClearButton ? 'opacity-100 hover:opacity-70' : 'opacity-0',\n )}\n onPointerDown={(event) => event.stopPropagation()}\n onClick={handleClear}\n />\n )}\n </div>\n <PopoverContent\n className={cn('overflow-hidden p-0', contentClassName)}\n container={container}\n side=\"bottom\"\n align={align}\n onOpenAutoFocus={onOpenAutoFocus ? (event) => event.preventDefault() : undefined}\n >\n <Command shouldFilter={false} defaultValue={singleValue}>\n <CommandInput\n ref={searchInputRef}\n placeholder={searchPlaceholder}\n value={searchTerm}\n onValueChange={setSearchTerm}\n />\n {isVirtualized ? (\n <VirtualizedComboboxList\n listRef={listRef}\n localOptions={filteredOptions}\n loading={loading}\n loadingPlaceholder={loadingPlaceholder}\n emptyMessage={emptyMessage}\n value={props.value as string}\n getOptionValue={getOptionValue}\n getOptionLabel={getOptionLabel}\n handleSelect={handleSelect}\n renderOption={renderOption}\n maxHeight={boundedListMaxHeight}\n hasNextPage={hasNextPage}\n loadingMore={loadingMore}\n onLoadMore={loadNextPage}\n estimateSize={'estimateSize' in props ? props.estimateSize : undefined}\n specialOptions={filteredSpecialOptions}\n specialOptionsTitle={specialOptionsTitle}\n />\n ) : (\n <StaticComboboxList\n listRef={listRef}\n filteredOptions={filteredOptions}\n loading={loading}\n loadingPlaceholder={loadingPlaceholder}\n emptyMessage={emptyMessage}\n multiple={!!multiple}\n value={props.value}\n getOptionValue={getOptionValue}\n getOptionLabel={getOptionLabel}\n handleSelect={handleSelect}\n renderOption={renderOption}\n maxHeight={boundedListMaxHeight}\n selectedMultiplePlaceholder={selectedMultiplePlaceholder}\n multipleOptionsPlaceholder={multipleOptionsPlaceholder}\n options={options}\n specialOptions={filteredSpecialOptions}\n specialOptionsTitle={specialOptionsTitle}\n />\n )}\n </Command>\n </PopoverContent>\n </PopoverRoot>\n {typeof error === 'string' && <span className=\"text-error-500 text-sm\">{error}</span>}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+IA,IAAa,YAA8B,UAA4B;CACrE,MAAM,EACJ,IACA,UAAU,CAAC,GACX,gBACA,gBACA,oBAAoB,aACpB,eAAe,qBACf,YAAY,QACZ,kBACA,WAAW,OACX,YAAY,SACZ,cACA,UAAU,OACV,qBAAqB,eACrB,QAAQ,OACR,UACA,SACA,QAAQ,OACR,8BAA8B,YAC9B,6BAA6B,WAC7B,qBACA,WACA,OACA,kBAAkB,OAClB,gBAAgB,aAChB,oBAAoB,oBAClB;CAEJ,MAAM,iBAAiB,OAAyB,IAAI;CAEpD,MAAM,uBAAuB,OADD,OAAO,cAAc,WAAW,GAAG,UAAU,MAAM,UACvB;CAExD,MAAM,EACJ,MACA,SACA,YACA,eACA,cACA,aACA,aACA,eACA,iBACA,wBACA,cACA,UACA,iBACA,cACA,aACA,iBACE,YAAY,KAAK;CAErB,MAAM,cAAc,OAAO,MAAM,UAAU,YAAY,MAAM,QAAQ,MAAM,QAAQ,KAAA;CAEnF,gBAAgB;EACd,IAAI,CAAC,QAAQ,CAAC,iBAAiB;EAC/B,MAAM,YAAY,WAAW,iBAAiB,eAAe,SAAS,MAAM,GAAG,CAAC;EAChF,aAAa,WAAW,aAAa,SAAS;CAChD,GAAG,CAAC,MAAM,eAAe,CAAC;CAE1B,MAAM,UAAU,cAAc;EAC5B;EACA;EACA,eAAe,gBAAgB,KAAA,IAAY;CAC7C,CAAC;CAED,MAAM,yBAAyB,CAAC,EAAE,YAAY,iBAAiB,SAAS,MAAM;CAE9E,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,qBAAC,aAAD;GAAmB;GAAM,cAAc;GAAgB;GAAvD,UAAA,CACE,qBAAC,OAAD;IACE,WAAW,GAAG,YAAY,SAAS;IACnC,oBAAoB,aAAa,IAAI;IACrC,oBAAoB,aAAa,KAAK;IAHxC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KACtB,CAAA,CAEI;;GACK,CAAA,CACL;EACZ,CAAA,GAAA,OAAO,UAAU,YAAY,oBAAC,QAAD;GAAM,WAAU;GAA0B,UAAA;EAAY,CAAA,CACjF;;AAET"}
1
+ {"version":3,"file":"Combobox.js","names":[],"sources":["../../../../src/components/inputs/Combobox/Combobox.tsx"],"sourcesContent":["import { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport { useEffect, useRef } from 'react'\n\nimport { SURFACE_LIST } from '../../../lib/surface'\nimport { useListScroll } from '../../../lib/useListScroll'\nimport { cn } from '../../../lib/utils'\nimport { Command, CommandInput } from '../../utils/Command'\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from '../../utils/Popover'\n\nimport { ComboboxTrigger } from './ComboboxTrigger'\nimport { StaticComboboxList } from './StaticComboboxList'\nimport { useCombobox } from './useCombobox'\nimport { VirtualizedComboboxList } from './VirtualizedComboboxList'\n\ntype ComboboxBaseProps<T> = {\n /** Unique identifier for the combobox */\n id?: string\n /** Array of options to display in the combobox (static mode). */\n options?: Array<T>\n /** Function to get the unique identifier from an option. */\n getOptionValue: (option: T) => string\n /** Function to get the display text from an option. */\n getOptionLabel: (option: T) => string\n /** Custom render function for options. If not provided, defaults to showing a checkmark and label */\n renderOption?: (option: T, isSelected: boolean) => React.ReactNode\n /** Placeholder text shown when no option is selected */\n placeholder?: React.ReactNode\n /** Placeholder text for the search input field */\n searchPlaceholder?: string\n /** Message shown when no options match the search query */\n emptyMessage?: string\n /** Additional CSS classes to apply to the combobox trigger */\n className?: string\n /** Additional CSS classes to apply to the popover content */\n contentClassName?: string\n /** Whether the combobox is disabled */\n disabled?: boolean\n /** Maximum height of the options list. Can be any valid CSS height value */\n maxHeight?: string | number\n /** Whether to close the dropdown when an option is selected. Defaults to `true` for single select and `false` for multi-select. */\n closeOnSelect?: boolean\n /** Whether the combobox is in a loading state */\n loading?: boolean\n /** Message to show when in loading state */\n loadingPlaceholder?: string\n /** Whether the combobox has an error */\n error?: boolean | string\n /** Custom function to filter options based on search term (static mode only) */\n filterOptions?: (options: Array<T>, searchTerm: string) => Array<T>\n /** Callback function executed when the clear button is clicked. When provided, an X button will appear on hover to clear the selection. */\n onClear?: boolean | (() => void)\n /** Whether the selection can be cleared */\n clearable?: boolean\n /** Whether the combobox is inside a modal */\n modal?: boolean\n /** Placeholder text for the selected multiple options */\n selectedMultiplePlaceholder?: string\n /** Placeholder text for the multiple options */\n multipleOptionsPlaceholder?: string\n /** Pinned above a separator. Selecting one switches multi-select to single-select. */\n specialOptions?: Array<T>\n /** Heading for the special options group */\n specialOptionsTitle?: string\n /** Container element to position the combobox relative to. */\n container?: HTMLElement\n /** Alignment of the dropdown relative to the trigger. Defaults to 'center'. */\n align?: 'start' | 'center' | 'end'\n /** Auto-focus the search input when the dropdown opens. */\n onOpenAutoFocus?: boolean\n /** Defaults to `!!error`. */\n 'aria-invalid'?: boolean\n 'aria-describedby'?: string\n}\n\nexport type ComboboxSingleProps<T> = ComboboxBaseProps<T> & {\n virtualized?: false\n multiple?: false\n value?: string\n onChange: (value: string) => void\n /** Custom render function for the selected value display. */\n renderLabel?: (selectedOption: T) => React.ReactNode\n}\n\nexport type ComboboxMultipleProps<T> = ComboboxBaseProps<T> & {\n virtualized?: false\n multiple: true\n value?: Array<string>\n onChange: (value: Array<string>) => void\n /** Custom render function for the selected value(s) display. */\n renderLabel?: (selectedOptions: Array<T>, onRemove: (value: string) => void) => React.ReactNode\n}\n\ntype ComboboxRemoteVirtualizedProps<T> = {\n /** The accumulated, flattened list of loaded items. */\n items: Array<T>\n /** Whether more pages can be loaded. */\n hasNextPage: boolean\n /** Whether the next page is currently being fetched. */\n isFetchingNextPage: boolean\n /** Request the next page (triggered near the end of the list). */\n onLoadMore: () => void\n /** Emitted (debounced) when the search term changes. The consumer refetches. */\n onSearchChange: (search: string) => void\n}\n\n/** Pass none of `ComboboxRemoteVirtualizedProps`'s fields to virtualize the local `options`\n * list instead (filtered the same way static mode is). */\ntype ComboboxLocalVirtualizedProps = {\n items?: undefined\n hasNextPage?: undefined\n isFetchingNextPage?: undefined\n onLoadMore?: undefined\n onSearchChange?: undefined\n}\n\nexport type ComboboxVirtualizedProps<T> = ComboboxBaseProps<T> & {\n virtualized: true\n multiple?: false\n value?: string\n onChange: (value: string) => void\n /** Custom render function for the selected value display. */\n renderLabel?: (selectedOption: T) => React.ReactNode\n /** The resolved selected item, fetched independently of the list. Used for the trigger label. */\n selectedItem?: T\n /** Estimated row height (px), default: 40. */\n estimateSize?: number\n} & (ComboboxRemoteVirtualizedProps<T> | ComboboxLocalVirtualizedProps)\n\nexport type ComboboxProps<T> = ComboboxSingleProps<T> | ComboboxMultipleProps<T> | ComboboxVirtualizedProps<T>\n\n/**\n * A searchable combobox component with support for custom rendering, keyboard navigation, and search filtering.\n *\n * @example Basic usage\n * ```tsx\n * <Combobox<User>\n * options={users}\n * value={selectedUserId}\n * onChange={setSelectedUserId}\n * getOptionValue={(user) => user.id}\n * getOptionLabel={(user) => user.name}\n * />\n * ```\n */\nexport const Combobox = <T extends object>(props: ComboboxProps<T>) => {\n const {\n id,\n options = [],\n getOptionValue,\n getOptionLabel,\n searchPlaceholder = 'Search...',\n emptyMessage = 'No results found.',\n className = 'w-60',\n contentClassName,\n disabled = false,\n maxHeight = '300px',\n renderOption,\n loading = false,\n loadingPlaceholder = 'Cargando...',\n error = false,\n multiple,\n onClear,\n modal = false,\n selectedMultiplePlaceholder = 'Selected',\n multipleOptionsPlaceholder = 'Options',\n specialOptionsTitle,\n container,\n align,\n onOpenAutoFocus = false,\n 'aria-invalid': ariaInvalid,\n 'aria-describedby': ariaDescribedBy,\n } = props\n\n const searchInputRef = useRef<HTMLInputElement>(null)\n const normalizedMaxHeight = typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight\n const boundedListMaxHeight = `min(${normalizedMaxHeight}, max(120px, calc(var(--radix-popover-content-available-height, 100dvh) - 68px)))`\n\n const {\n open,\n setOpen,\n searchTerm,\n setSearchTerm,\n setIsHovered,\n hasNextPage,\n loadingMore,\n isVirtualized,\n filteredOptions,\n filteredSpecialOptions,\n displayValue,\n hasValue,\n showClearButton,\n handleSelect,\n handleClear,\n loadNextPage,\n } = useCombobox(props)\n\n const singleValue = typeof props.value === 'string' && props.value ? props.value : undefined\n\n useEffect(() => {\n if (!open || !onOpenAutoFocus) return\n const timeoutId = globalThis.setTimeout(() => searchInputRef.current?.focus(), 0)\n return () => globalThis.clearTimeout(timeoutId)\n }, [open, onOpenAutoFocus])\n\n const listRef = useListScroll({\n open,\n searchTerm,\n selectedValue: isVirtualized ? undefined : singleValue,\n })\n\n const hasMultipleRenderLabel = !!(multiple && 'renderLabel' in props && props.renderLabel)\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <PopoverRoot open={open} onOpenChange={setOpen} modal={modal}>\n <div\n className={cn('relative', className)}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <PopoverTrigger\n asChild\n onPointerDown={(event) => {\n event.stopPropagation()\n if (open) {\n setOpen(false)\n event.preventDefault()\n } else {\n setOpen(true)\n }\n }}\n onClick={(event) => {\n if (event.detail === 0) return\n event.preventDefault()\n event.stopPropagation()\n }}\n >\n <ComboboxTrigger\n id={id}\n disabled={disabled}\n open={open}\n error={error}\n hasValue={hasValue}\n showClearButton={showClearButton}\n isMultilineLabel={hasMultipleRenderLabel}\n displayValue={displayValue}\n className={cn('w-full', className)}\n aria-invalid={ariaInvalid ?? (!!error || undefined)}\n aria-describedby={ariaDescribedBy}\n />\n </PopoverTrigger>\n {!!onClear && hasValue && (\n <XIcon\n data-testid=\"clear-button\"\n className={cn(\n 'absolute top-1/2 right-4 z-10 h-4 w-4 -translate-y-1/2 cursor-pointer transition-opacity duration-150',\n showClearButton ? 'opacity-100 hover:opacity-70' : 'opacity-0',\n )}\n onPointerDown={(event) => event.stopPropagation()}\n onClick={handleClear}\n />\n )}\n </div>\n <PopoverContent\n className={cn(SURFACE_LIST, 'overflow-hidden p-0', contentClassName)}\n container={container}\n side=\"bottom\"\n align={align}\n onOpenAutoFocus={onOpenAutoFocus ? (event) => event.preventDefault() : undefined}\n >\n <Command shouldFilter={false} defaultValue={singleValue}>\n <CommandInput\n ref={searchInputRef}\n placeholder={searchPlaceholder}\n value={searchTerm}\n onValueChange={setSearchTerm}\n />\n {isVirtualized ? (\n <VirtualizedComboboxList\n listRef={listRef}\n localOptions={filteredOptions}\n loading={loading}\n loadingPlaceholder={loadingPlaceholder}\n emptyMessage={emptyMessage}\n value={props.value as string}\n getOptionValue={getOptionValue}\n getOptionLabel={getOptionLabel}\n handleSelect={handleSelect}\n renderOption={renderOption}\n maxHeight={boundedListMaxHeight}\n hasNextPage={hasNextPage}\n loadingMore={loadingMore}\n onLoadMore={loadNextPage}\n estimateSize={'estimateSize' in props ? props.estimateSize : undefined}\n specialOptions={filteredSpecialOptions}\n specialOptionsTitle={specialOptionsTitle}\n />\n ) : (\n <StaticComboboxList\n listRef={listRef}\n filteredOptions={filteredOptions}\n loading={loading}\n loadingPlaceholder={loadingPlaceholder}\n emptyMessage={emptyMessage}\n multiple={!!multiple}\n value={props.value}\n getOptionValue={getOptionValue}\n getOptionLabel={getOptionLabel}\n handleSelect={handleSelect}\n renderOption={renderOption}\n maxHeight={boundedListMaxHeight}\n selectedMultiplePlaceholder={selectedMultiplePlaceholder}\n multipleOptionsPlaceholder={multipleOptionsPlaceholder}\n options={options}\n specialOptions={filteredSpecialOptions}\n specialOptionsTitle={specialOptionsTitle}\n />\n )}\n </Command>\n </PopoverContent>\n </PopoverRoot>\n {typeof error === 'string' && <span className=\"text-error-500 text-sm\">{error}</span>}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgJA,IAAa,YAA8B,UAA4B;CACrE,MAAM,EACJ,IACA,UAAU,CAAC,GACX,gBACA,gBACA,oBAAoB,aACpB,eAAe,qBACf,YAAY,QACZ,kBACA,WAAW,OACX,YAAY,SACZ,cACA,UAAU,OACV,qBAAqB,eACr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D;MACM;MACM;MACJ;MACC;MACG;MACO;MACjB,kBAAkB;MACJ;MACd,WAAW,GAAG,UAAU,SAAS;MACjC,gBAAc,gBAAgB,CAAC,CAAC,SAAS,KAAA;MACzC,oBAAkB;KACnB,CAAA;IACa,CAAA,GACf,CAAC,CAAC,WAAW,YACZ,oBAAC,OAAD;KACE,eAAY;KACZ,WAAW,GACT,yGACA,kBAAkB,iCAAiC,WACrD;KACA,gBAAgB,UAAU,MAAM,gBAAgB;KAChD,SAAS;IACV,CAAA,CAEA;GACL,CAAA,GAAA,oBAAC,gBAAD;IACE,WAAW,GAAG,cAAc,uBAAuB,gBAAgB;IACxD;IACX,MAAK;IACE;IACP,iBAAiB,mBAAmB,UAAU,MAAM,eAAe,IAAI,KAAA;IAEvE,UAAA,qBAAC,SAAD;KAAS,cAAc;KAAO,cAAc;KAA5C,UAAA,CACE,oBAAC,cAAD;MACE,KAAK;MACL,aAAa;MACb,OAAO;MACP,eAAe;KAChB,CAAA,GACA,gBACC,oBAAC,yBAAD;MACW;MACT,cAAc;MACL;MACW;MACN;MACd,OAAO,MAAM;MACG;MACA;MACF;MACA;MACd,WAAW;MACE;MACA;MACb,YAAY;MACZ,cAAc,kBAAkB,QAAQ,MAAM,eAAe,KAAA;MAC7D,gBAAgB;MACK;KACtB,CAAA,IAED,oBAAC,oBAAD;MACW;MACQ;MACR;MACW;MACN;MACd,UAAU,CAAC,CAAC;MACZ,OAAO,MAAM;MACG;MACA;MACF;MACA;MACd,WAAW;MACkB;MACD;MACnB;MACT,gBAAgB;MACK;KACtB,CAAA,CAEI;;GACK,CAAA,CACL;EACZ,CAAA,GAAA,OAAO,UAAU,YAAY,oBAAC,QAAD;GAAM,WAAU;GAA0B,UAAA;EAAY,CAAA,CACjF;;AAET"}
@@ -66,14 +66,13 @@ var StaticComboboxList = ({ filteredOptions, loading, loadingPlaceholder, emptyM
66
66
  return /* @__PURE__ */ jsx(CommandItem, {
67
67
  value: optionValue,
68
68
  onSelect: handleSelect,
69
- className: "px-3",
70
69
  children: renderOption ? renderOption(option, selected) : /* @__PURE__ */ jsxs(Fragment, { children: [renderSelectionIndicator(), /* @__PURE__ */ jsx(ComboboxOptionWithTooltip, { label: getOptionLabel(option) })] })
71
70
  }, optionValue);
72
71
  };
73
72
  return /* @__PURE__ */ jsx(CommandList, {
74
73
  ref: listRef,
75
74
  style: { maxHeight },
76
- className: "overflow-auto overscroll-contain px-1.5 pb-1.5 **:[[cmdk-group-heading]]:px-3",
75
+ className: "overflow-auto overscroll-contain",
77
76
  onWheel: (event) => event.stopPropagation(),
78
77
  children: loading ? /* @__PURE__ */ jsx("div", {
79
78
  className: "flex items-center justify-center py-6 text-sm text-neutral-400",
@@ -1 +1 @@
1
- {"version":3,"file":"StaticComboboxList.js","names":["_Fragment"],"sources":["../../../../src/components/inputs/Combobox/StaticComboboxList.tsx"],"sourcesContent":["import { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { useMemo } from 'react'\n\nimport { CommandEmpty, CommandGroup, CommandItem, CommandList, CommandSeparator } from '../../utils/Command'\nimport { Checkbox } from '../Checkbox'\n\nimport { ComboboxOptionWithTooltip } from './ComboboxOptionWithTooltip'\nimport type { StaticComboboxListProps } from './types'\n\nexport const StaticComboboxList = <T extends object>({\n filteredOptions,\n loading,\n loadingPlaceholder,\n emptyMessage,\n multiple,\n value,\n getOptionValue,\n getOptionLabel,\n handleSelect,\n renderOption,\n maxHeight,\n selectedMultiplePlaceholder,\n multipleOptionsPlaceholder,\n options,\n specialOptions,\n specialOptionsTitle,\n listRef,\n}: StaticComboboxListProps<T>) => {\n const isArrayValue = Array.isArray(value)\n const selectedValues = useMemo(() => (multiple && isArrayValue ? value : []), [multiple, isArrayValue, value])\n\n const isOptionSelected = (optionValue: string) =>\n multiple ? selectedValues.includes(optionValue) : value === optionValue\n\n const regularOptions = useMemo(() => {\n return filteredOptions.filter(\n (option) => !specialOptions?.some((special) => getOptionValue(special) === getOptionValue(option)),\n )\n }, [filteredOptions, specialOptions, getOptionValue])\n\n const regularSelectedOptions = useMemo(() => {\n if (!multiple || !isArrayValue) return []\n\n return options.filter(\n (option) =>\n selectedValues.includes(getOptionValue(option)) &&\n !specialOptions?.some((special) => getOptionValue(special) === getOptionValue(option)),\n )\n }, [options, selectedValues, specialOptions, getOptionValue, multiple, isArrayValue])\n\n const optionsToShow = useMemo(() => {\n if (specialOptions) return regularOptions\n\n if (!multiple || !isArrayValue) return regularOptions\n\n return regularOptions.filter((option) => !selectedValues.includes(getOptionValue(option)))\n }, [regularOptions, specialOptions, selectedValues, getOptionValue, multiple, isArrayValue])\n\n const groupHeading = !specialOptions && multiple ? multipleOptionsPlaceholder : undefined\n\n const renderListOption = (option: T) => {\n const optionValue = getOptionValue(option)\n const selected = isOptionSelected(optionValue)\n\n const renderSelectionIndicator = () => {\n if (multiple) {\n return <Checkbox checked={selected} tabIndex={-1} aria-hidden className=\"pointer-events-none mr-2 shrink-0\" />\n }\n\n return (\n <span aria-hidden className=\"mr-1 flex h-6! w-6! shrink-0 items-center justify-end\">\n {selected && <CheckIcon weight=\"bold\" className=\"h-4! w-4!\" />}\n </span>\n )\n }\n\n return (\n <CommandItem key={optionValue} value={optionValue} onSelect={handleSelect} className=\"px-3\">\n {renderOption ? (\n renderOption(option, selected)\n ) : (\n <>\n {renderSelectionIndicator()}\n <ComboboxOptionWithTooltip label={getOptionLabel(option)} />\n </>\n )}\n </CommandItem>\n )\n }\n\n return (\n <CommandList\n ref={listRef}\n style={{ maxHeight }}\n className=\"overflow-auto overscroll-contain px-1.5 pb-1.5 **:[[cmdk-group-heading]]:px-3\"\n onWheel={(event) => event.stopPropagation()}\n >\n {loading ? (\n <div className=\"flex items-center justify-center py-6 text-sm text-neutral-400\">{loadingPlaceholder}</div>\n ) : (\n <>\n {filteredOptions.length === 0 &&\n regularOptions.length === 0 &&\n (!specialOptions || specialOptions.length === 0) && <CommandEmpty>{emptyMessage}</CommandEmpty>}\n\n {specialOptions?.length ? (\n <>\n <CommandGroup heading={specialOptionsTitle}>{specialOptions.map(renderListOption)}</CommandGroup>\n\n {optionsToShow.length > 0 && <CommandSeparator className=\"mx-1\" />}\n </>\n ) : null}\n\n {!specialOptions && multiple && isArrayValue && regularSelectedOptions.length > 0 && (\n <CommandGroup heading={selectedMultiplePlaceholder}>\n {regularSelectedOptions.map(renderListOption)}\n </CommandGroup>\n )}\n\n {optionsToShow.length > 0 && (\n <CommandGroup heading={groupHeading}>{optionsToShow.map(renderListOption)}</CommandGroup>\n )}\n </>\n )}\n </CommandList>\n )\n}\n"],"mappings":";;;;;;;AASA,IAAa,sBAAwC,EACnD,iBACA,SACA,oBACA,cACA,UACA,OACA,gBACA,gBACA,cACA,cACA,WACA,6BACA,4BACA,SACA,gBACA,qBACA,cACgC;CAChC,MAAM,eAAe,MAAM,QAAQ,KAAK;CACxC,MAAM,iBAAiB,cAAe,YAAY,eAAe,QAAQ,CAAC,GAAI;EAAC;EAAU;EAAc;CAAK,CAAC;CAE7G,MAAM,oBAAoB,gBACxB,WAAW,eAAe,SAAS,WAAW,IAAI,UAAU;CAE9D,MAAM,iBAAiB,cAAc;EACnC,OAAO,gBAAgB,QACpB,WAAW,CAAC,gBAAgB,MAAM,YAAY,eAAe,OAAO,MAAM,eAAe,MAAM,CAAC,CACnG;CACF,GAAG;EAAC;EAAiB;EAAgB;CAAc,CAAC;CAEpD,MAAM,yBAAyB,cAAc;EAC3C,IAAI,CAAC,YAAY,CAAC,cAAc,OAAO,CAAC;EAExC,OAAO,QAAQ,QACZ,WACC,eAAe,SAAS,eAAe,MAAM,CAAC,KAC9C,CAAC,gBAAgB,MAAM,YAAY,eAAe,OAAO,MAAM,eAAe,MAAM,CAAC,CACzF;CACF,GAAG;EAAC;EAAS;EAAgB;EAAgB;EAAgB;EAAU;CAAY,CAAC;CAEpF,MAAM,gBAAgB,cAAc;EAClC,IAAI,gBAAgB,OAAO;EAE3B,IAAI,CAAC,YAAY,CAAC,cAAc,OAAO;EAEvC,OAAO,eAAe,QAAQ,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AC,kBAAD,EAAkB,WAAU,OAAQ,CAAA,CACjE,EAAA,CAAA,IACA;GAEH,CAAC,kBAAkB,YAAY,gBAAgB,uBAAuB,SAAS,KAC9E,oBAAC,cAAD;IAAc,SAAS;IACpB,UAAA,uBAAuB,IAAI,gBAAgB;GAChC,CAAA;GAGf,cAAc,SAAS,KACtB,oBAAC,cAAD;IAAc,SAAS;IAAe,UAAA,cAAc,IAAI,gBAAgB;GAAgB,CAAA;EAE1F,EAAA,CAAA;CAEO,CAAA;AAEjB"}
1
+ {"version":3,"file":"StaticComboboxList.js","names":["_Fragment"],"sources":["../../../../src/components/inputs/Combobox/StaticComboboxList.tsx"],"sourcesContent":["import { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { useMemo } from 'react'\n\nimport { CommandEmpty, CommandGroup, CommandItem, CommandList, CommandSeparator } from '../../utils/Command'\nimport { Checkbox } from '../Checkbox'\n\nimport { ComboboxOptionWithTooltip } from './ComboboxOptionWithTooltip'\nimport type { StaticComboboxListProps } from './types'\n\nexport const StaticComboboxList = <T extends object>({\n filteredOptions,\n loading,\n loadingPlaceholder,\n emptyMessage,\n multiple,\n value,\n getOptionValue,\n getOptionLabel,\n handleSelect,\n renderOption,\n maxHeight,\n selectedMultiplePlaceholder,\n multipleOptionsPlaceholder,\n options,\n specialOptions,\n specialOptionsTitle,\n listRef,\n}: StaticComboboxListProps<T>) => {\n const isArrayValue = Array.isArray(value)\n const selectedValues = useMemo(() => (multiple && isArrayValue ? value : []), [multiple, isArrayValue, value])\n\n const isOptionSelected = (optionValue: string) =>\n multiple ? selectedValues.includes(optionValue) : value === optionValue\n\n const regularOptions = useMemo(() => {\n return filteredOptions.filter(\n (option) => !specialOptions?.some((special) => getOptionValue(special) === getOptionValue(option)),\n )\n }, [filteredOptions, specialOptions, getOptionValue])\n\n const regularSelectedOptions = useMemo(() => {\n if (!multiple || !isArrayValue) return []\n\n return options.filter(\n (option) =>\n selectedValues.includes(getOptionValue(option)) &&\n !specialOptions?.some((special) => getOptionValue(special) === getOptionValue(option)),\n )\n }, [options, selectedValues, specialOptions, getOptionValue, multiple, isArrayValue])\n\n const optionsToShow = useMemo(() => {\n if (specialOptions) return regularOptions\n\n if (!multiple || !isArrayValue) return regularOptions\n\n return regularOptions.filter((option) => !selectedValues.includes(getOptionValue(option)))\n }, [regularOptions, specialOptions, selectedValues, getOptionValue, multiple, isArrayValue])\n\n const groupHeading = !specialOptions && multiple ? multipleOptionsPlaceholder : undefined\n\n const renderListOption = (option: T) => {\n const optionValue = getOptionValue(option)\n const selected = isOptionSelected(optionValue)\n\n const renderSelectionIndicator = () => {\n if (multiple) {\n return <Checkbox checked={selected} tabIndex={-1} aria-hidden className=\"pointer-events-none mr-2 shrink-0\" />\n }\n\n return (\n <span aria-hidden className=\"mr-1 flex h-6! w-6! shrink-0 items-center justify-end\">\n {selected && <CheckIcon weight=\"bold\" className=\"h-4! w-4!\" />}\n </span>\n )\n }\n\n return (\n <CommandItem key={optionValue} value={optionValue} onSelect={handleSelect}>\n {renderOption ? (\n renderOption(option, selected)\n ) : (\n <>\n {renderSelectionIndicator()}\n <ComboboxOptionWithTooltip label={getOptionLabel(option)} />\n </>\n )}\n </CommandItem>\n )\n }\n\n return (\n <CommandList\n ref={listRef}\n style={{ maxHeight }}\n className=\"overflow-auto overscroll-contain\"\n onWheel={(event) => event.stopPropagation()}\n >\n {loading ? (\n <div className=\"flex items-center justify-center py-6 text-sm text-neutral-400\">{loadingPlaceholder}</div>\n ) : (\n <>\n {filteredOptions.length === 0 &&\n regularOptions.length === 0 &&\n (!specialOptions || specialOptions.length === 0) && <CommandEmpty>{emptyMessage}</CommandEmpty>}\n\n {specialOptions?.length ? (\n <>\n <CommandGroup heading={specialOptionsTitle}>{specialOptions.map(renderListOption)}</CommandGroup>\n\n {optionsToShow.length > 0 && <CommandSeparator className=\"mx-1\" />}\n </>\n ) : null}\n\n {!specialOptions && multiple && isArrayValue && regularSelectedOptions.length > 0 && (\n <CommandGroup heading={selectedMultiplePlaceholder}>\n {regularSelectedOptions.map(renderListOption)}\n </CommandGroup>\n )}\n\n {optionsToShow.length > 0 && (\n <CommandGroup heading={groupHeading}>{optionsToShow.map(renderListOption)}</CommandGroup>\n )}\n </>\n )}\n </CommandList>\n )\n}\n"],"mappings":";;;;;;;AASA,IAAa,sBAAwC,EACnD,iBACA,SACA,oBACA,cACA,UACA,OACA,gBACA,gBACA,cACA,cACA,WACA,6BACA,4BACA,SACA,gBACA,qBACA,cACgC;CAChC,MAAM,eAAe,MAAM,QAAQ,KAAK;CACxC,MAAM,iBAAiB,cAAe,YAAY,eAAe,QAAQ,CAAC,GAAI;EAAC;EAAU;EAAc;CAAK,CAAC;CAE7G,MAAM,oBAAoB,gBACxB,WAAW,eAAe,SAAS,WAAW,IAAI,UAAU;CAE9D,MAAM,iBAAiB,cAAc;EACnC,OAAO,gBAAgB,QACpB,WAAW,CAAC,gBAAgB,MAAM,YAAY,eAAe,OAAO,MAAM,eAAe,MAAM,CAAC,CACnG;CACF,GAAG;EAAC;EAAiB;EAAgB;CAAc,CAAC;CAEpD,MAAM,yBAAyB,cAAc;EAC3C,IAAI,CAAC,YAAY,CAAC,cAAc,OAAO,CAAC;EAExC,OAAO,QAAQ,QACZ,WACC,eAAe,SAAS,eAAe,MAAM,CAAC,KAC9C,CAAC,gBAAgB,MAAM,YAAY,eAAe,OAAO,MAAM,eAAe,MAAM,CAAC,CACzF;CACF,GAAG;EAAC;EAAS;EAAgB;EAAgB;EAAgB;EAAU;CAAY,CAAC;CAEpF,MAAM,gBAAgB,cAAc;EAClC,IAAI,gBAAgB,OAAO;EAE3B,IAAI,CAAC,YAAY,CAAC,cAAc,OAAO;EAEvC,OAAO,eAAe,QAAQ,WAAW,CAAC,eAAe,SAAS,eAAe,MAAM,CAAC,CAAC;CAC3F,GAAG;EAAC;EAAgB;EAAgB;EAAgB;EAAgB;EAAU;CAAY,CAAC;CAE3F,MAAM,eAAe,CAAC,kBAAkB,WAAW,6BAA6B,KAAA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AChC,CAAA;GAGf,cAAc,SAAS,KACtB,oBAAC,cAAD;IAAc,SAAS;IAAe,UAAA,cAAc,IAAI,gBAAgB;GAAgB,CAAA;EAE1F,EAAA,CAAA;CAEO,CAAA;AAEjB"}
@@ -69,13 +69,12 @@ var VirtualizedComboboxList = ({ localOptions, loading, loadingPlaceholder, empt
69
69
  return /* @__PURE__ */ jsx(CommandItem, {
70
70
  value: optionValue,
71
71
  onSelect: handleSelect,
72
- className: "px-3",
73
72
  children: renderOption ? renderOption(option, isSelected) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CheckIcon, { className: `mr-2 h-4 w-4 ${isSelected ? "opacity-100" : "opacity-0"}` }), /* @__PURE__ */ jsx(ComboboxOptionWithTooltip, { label: getOptionLabel(option) })] })
74
73
  }, optionValue);
75
74
  };
76
75
  return /* @__PURE__ */ jsxs(CommandList, {
77
76
  ref: parentRef,
78
- className: "overflow-auto overscroll-contain px-2.5 pb-1.5",
77
+ className: "overflow-auto overscroll-contain",
79
78
  style: { maxHeight },
80
79
  onWheel: (event) => event.stopPropagation(),
81
80
  children: [/* @__PURE__ */ jsxs("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedComboboxList.js","names":["_Fragment"],"sources":["../../../../src/components/inputs/Combobox/VirtualizedComboboxList.tsx"],"sourcesContent":["import { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { useVirtualizer } from '@tanstack/react-virtual'\nimport { useRef, useEffect, useState } from 'react'\n\nimport { CommandEmpty, CommandGroup, CommandItem, CommandList, CommandSeparator } from '../../utils/Command'\n\nimport { ComboboxOptionWithTooltip } from './ComboboxOptionWithTooltip'\nimport type { VirtualizedComboboxListProps } from './types'\n\nconst DEFAULT_ESTIMATED_ROW_HEIGHT = 40\n\nexport const VirtualizedComboboxList = <T extends object>({\n localOptions,\n loading,\n loadingPlaceholder,\n emptyMessage,\n value,\n getOptionValue,\n getOptionLabel,\n handleSelect,\n renderOption,\n maxHeight,\n hasNextPage = false,\n loadingMore = false,\n onLoadMore = () => {},\n estimateSize = DEFAULT_ESTIMATED_ROW_HEIGHT,\n listRef,\n specialOptions,\n specialOptionsTitle,\n}: VirtualizedComboboxListProps<T>) => {\n const ownRef = useRef<HTMLDivElement>(null)\n const parentRef = listRef ?? ownRef\n const hasTriggeredRef = useRef(false)\n\n const totalCount = localOptions.length\n const PREFETCH_THRESHOLD = 25\n\n // scrollMargin accounts for the special group's height so scrollToIndex still centers correctly.\n const specialGroupRef = useRef<HTMLDivElement>(null)\n const [specialGroupHeight, setSpecialGroupHeight] = useState(0)\n useEffect(() => {\n setSpecialGroupHeight(specialGroupRef.current?.offsetHeight ?? 0)\n }, [specialOptions])\n\n const rowVirtualizer = useVirtualizer({\n count: totalCount,\n getScrollElement: () => parentRef.current,\n estimateSize: () => estimateSize,\n overscan: 10,\n useAnimationFrameWithResizeObserver: true,\n scrollMargin: specialGroupHeight,\n })\n\n useEffect(() => {\n hasTriggeredRef.current = false\n }, [totalCount, loadingMore])\n\n const hasCenteredRef = useRef(false)\n useEffect(() => {\n if (hasCenteredRef.current || !value) return\n const index = localOptions.findIndex((option) => getOptionValue(option) === value)\n if (index === -1) return\n hasCenteredRef.current = true\n if (!parentRef.current?.scrollTop) rowVirtualizer.scrollToIndex(index, { align: 'center' })\n }, [value, localOptions, getOptionValue, rowVirtualizer, parentRef])\n\n const virtualItems = rowVirtualizer.getVirtualItems()\n\n useEffect(() => {\n if (virtualItems.length === 0 || !hasNextPage || loadingMore || loading || hasTriggeredRef.current) {\n return\n }\n\n const lastVisibleItem = virtualItems.at(-1)\n const itemsFromEnd = totalCount - (lastVisibleItem?.index ?? 0)\n\n if (itemsFromEnd <= PREFETCH_THRESHOLD) {\n hasTriggeredRef.current = true\n onLoadMore()\n }\n }, [virtualItems, totalCount, hasNextPage, loadingMore, loading, onLoadMore])\n\n if (loading && localOptions.length === 0) {\n return <div className=\"flex items-center justify-center py-6 text-sm text-neutral-400\">{loadingPlaceholder}</div>\n }\n\n if (localOptions.length === 0 && !specialOptions?.length && !loading && !loadingMore) {\n return <CommandEmpty>{emptyMessage}</CommandEmpty>\n }\n\n const renderOptionRow = (option: T) => {\n const optionValue = getOptionValue(option)\n const isSelected = value === optionValue\n return (\n <CommandItem key={optionValue} value={optionValue} onSelect={handleSelect} className=\"px-3\">\n {renderOption ? (\n renderOption(option, isSelected)\n ) : (\n <>\n <CheckIcon className={`mr-2 h-4 w-4 ${isSelected ? 'opacity-100' : 'opacity-0'}`} />\n <ComboboxOptionWithTooltip label={getOptionLabel(option)} />\n </>\n )}\n </CommandItem>\n )\n }\n\n return (\n <CommandList\n ref={parentRef}\n className=\"overflow-auto overscroll-contain px-2.5 pb-1.5\"\n style={{ maxHeight }}\n onWheel={(event) => event.stopPropagation()}\n >\n <div style={{ height: `${specialGroupHeight + rowVirtualizer.getTotalSize()}px`, position: 'relative' }}>\n {specialOptions?.length ? (\n <div ref={specialGroupRef} data-testid=\"combobox-special-group\">\n <CommandGroup heading={specialOptionsTitle}>{specialOptions.map(renderOptionRow)}</CommandGroup>\n {localOptions.length > 0 && <CommandSeparator className=\"mx-1\" />}\n </div>\n ) : null}\n\n {rowVirtualizer.getVirtualItems().map((virtualRow) => (\n <div\n key={getOptionValue(localOptions[virtualRow.index])}\n data-index={virtualRow.index}\n ref={(el) => rowVirtualizer.measureElement(el)}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${virtualRow.start}px)`,\n }}\n >\n {renderOptionRow(localOptions[virtualRow.index])}\n </div>\n ))}\n </div>\n {loadingMore && (\n <div className=\"flex items-center justify-center py-2 text-sm text-neutral-500\">{loadingPlaceholder}</div>\n )}\n </CommandList>\n )\n}\n"],"mappings":";;;;;;;AASA,IAAM,+BAA+B;AAErC,IAAa,2BAA6C,EACxD,cACA,SACA,oBACA,cACA,OACA,gBACA,gBACA,cACA,cACA,WACA,cAAc,OACd,cAAc,OACd,mBAAmB,CAAC,GACpB,eAAe,8BAC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,WAAW,MAAM,CAY/C,CACN,CACE;EACJ,CAAA,GAAA,eACC,oBAAC,OAAD;GAAK,WAAU;GAAkE,UAAA;EAAwB,CAAA,CAEhG;;AAEjB"}
1
+ {"version":3,"file":"VirtualizedComboboxList.js","names":["_Fragment"],"sources":["../../../../src/components/inputs/Combobox/VirtualizedComboboxList.tsx"],"sourcesContent":["import { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { useVirtualizer } from '@tanstack/react-virtual'\nimport { useRef, useEffect, useState } from 'react'\n\nimport { CommandEmpty, CommandGroup, CommandItem, CommandList, CommandSeparator } from '../../utils/Command'\n\nimport { ComboboxOptionWithTooltip } from './ComboboxOptionWithTooltip'\nimport type { VirtualizedComboboxListProps } from './types'\n\nconst DEFAULT_ESTIMATED_ROW_HEIGHT = 40\n\nexport const VirtualizedComboboxList = <T extends object>({\n localOptions,\n loading,\n loadingPlaceholder,\n emptyMessage,\n value,\n getOptionValue,\n getOptionLabel,\n handleSelect,\n renderOption,\n maxHeight,\n hasNextPage = false,\n loadingMore = false,\n onLoadMore = () => {},\n estimateSize = DEFAULT_ESTIMATED_ROW_HEIGHT,\n listRef,\n specialOptions,\n specialOptionsTitle,\n}: VirtualizedComboboxListProps<T>) => {\n const ownRef = useRef<HTMLDivElement>(null)\n const parentRef = listRef ?? ownRef\n const hasTriggeredRef = useRef(false)\n\n const totalCount = localOptions.length\n const PREFETCH_THRESHOLD = 25\n\n // scrollMargin accounts for the special group's height so scrollToIndex still centers correctly.\n const specialGroupRef = useRef<HTMLDivElement>(null)\n const [specialGroupHeight, setSpecialGroupHeight] = useState(0)\n useEffect(() => {\n setSpecialGroupHeight(specialGroupRef.current?.offsetHeight ?? 0)\n }, [specialOptions])\n\n const rowVirtualizer = useVirtualizer({\n count: totalCount,\n getScrollElement: () => parentRef.current,\n estimateSize: () => estimateSize,\n overscan: 10,\n useAnimationFrameWithResizeObserver: true,\n scrollMargin: specialGroupHeight,\n })\n\n useEffect(() => {\n hasTriggeredRef.current = false\n }, [totalCount, loadingMore])\n\n const hasCenteredRef = useRef(false)\n useEffect(() => {\n if (hasCenteredRef.current || !value) return\n const index = localOptions.findIndex((option) => getOptionValue(option) === value)\n if (index === -1) return\n hasCenteredRef.current = true\n if (!parentRef.current?.scrollTop) rowVirtualizer.scrollToIndex(index, { align: 'center' })\n }, [value, localOptions, getOptionValue, rowVirtualizer, parentRef])\n\n const virtualItems = rowVirtualizer.getVirtualItems()\n\n useEffect(() => {\n if (virtualItems.length === 0 || !hasNextPage || loadingMore || loading || hasTriggeredRef.current) {\n return\n }\n\n const lastVisibleItem = virtualItems.at(-1)\n const itemsFromEnd = totalCount - (lastVisibleItem?.index ?? 0)\n\n if (itemsFromEnd <= PREFETCH_THRESHOLD) {\n hasTriggeredRef.current = true\n onLoadMore()\n }\n }, [virtualItems, totalCount, hasNextPage, loadingMore, loading, onLoadMore])\n\n if (loading && localOptions.length === 0) {\n return <div className=\"flex items-center justify-center py-6 text-sm text-neutral-400\">{loadingPlaceholder}</div>\n }\n\n if (localOptions.length === 0 && !specialOptions?.length && !loading && !loadingMore) {\n return <CommandEmpty>{emptyMessage}</CommandEmpty>\n }\n\n const renderOptionRow = (option: T) => {\n const optionValue = getOptionValue(option)\n const isSelected = value === optionValue\n return (\n <CommandItem key={optionValue} value={optionValue} onSelect={handleSelect}>\n {renderOption ? (\n renderOption(option, isSelected)\n ) : (\n <>\n <CheckIcon className={`mr-2 h-4 w-4 ${isSelected ? 'opacity-100' : 'opacity-0'}`} />\n <ComboboxOptionWithTooltip label={getOptionLabel(option)} />\n </>\n )}\n </CommandItem>\n )\n }\n\n return (\n <CommandList\n ref={parentRef}\n className=\"overflow-auto overscroll-contain\"\n style={{ maxHeight }}\n onWheel={(event) => event.stopPropagation()}\n >\n <div style={{ height: `${specialGroupHeight + rowVirtualizer.getTotalSize()}px`, position: 'relative' }}>\n {specialOptions?.length ? (\n <div ref={specialGroupRef} data-testid=\"combobox-special-group\">\n <CommandGroup heading={specialOptionsTitle}>{specialOptions.map(renderOptionRow)}</CommandGroup>\n {localOptions.length > 0 && <CommandSeparator className=\"mx-1\" />}\n </div>\n ) : null}\n\n {rowVirtualizer.getVirtualItems().map((virtualRow) => (\n <div\n key={getOptionValue(localOptions[virtualRow.index])}\n data-index={virtualRow.index}\n ref={(el) => rowVirtualizer.measureElement(el)}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${virtualRow.start}px)`,\n }}\n >\n {renderOptionRow(localOptions[virtualRow.index])}\n </div>\n ))}\n </div>\n {loadingMore && (\n <div className=\"flex items-center justify-center py-2 text-sm text-neutral-500\">{loadingPlaceholder}</div>\n )}\n </CommandList>\n )\n}\n"],"mappings":";;;;;;;AASA,IAAM,+BAA+B;AAErC,IAAa,2BAA6C,EACxD,cACA,SACA,oBACA,cACA,OACA,gBACA,gBACA,cACA,cACA,WACA,cAAc,OACd,cAAc,OACd,mBAAmB,CAAC,GACpB,eAAe,8BACf,SACA,gBACA,0BACqC;CACrC,MAAM,SAAS,OAAuB,IAAI;CAC1C,MAAM,YAAY,WAAW;CAC7B,MAAM,kBAAkB,OAAO,KAAK;CAEpC,MAAM,aAAa,aAAa;CAChC,MAAM,qBAAqB;CAG3B,MAAM,kBAAkB,OAAuB,IAAI;CACnD,MAAM,CAAC,oBAAoB,yBAAyB,SAAS,CAAC;CAC9D,gBAAgB;EACd,sBAAsB,gBAAgB,SAAS,gBAAgB,CAAC;CAClE,GAAG,CAAC,cAAc,CAAC;CAEnB,MAAM,iBAAiB,eAAe;EACpC,OAAO;EACP,wBAAwB,UAAU;EAClC,oBAAoB;EACpB,UAAU;EACV,qCAAqC;EACrC,cAAc;CAChB,CAAC;CAED,gBAAgB;EACd,gBAAgB,UAAU;CAC5B,GAAG,CAAC,YAAY,WAAW,CAAC;CAE5B,MAAM,iBAAiB,OAAO,KAAK;CACnC,gBAAgB;EACd,IAAI,eAAe,WAAW,CAAC,OAAO;EACtC,MAAM,QAAQ,aAAa,WAA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