@exsto/ds 0.0.1-rc.16 → 0.0.1-rc.18

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 (53) hide show
  1. package/README.md +38 -0
  2. package/dist/ds/src/file-input.d.ts +9 -0
  3. package/dist/ds/src/time-field.d.ts +9 -0
  4. package/dist/file-input.js +2 -0
  5. package/dist/index.js +4 -3
  6. package/dist/source-hash.txt +1 -1
  7. package/dist/styles.css +176 -38
  8. package/dist/time-field.js +2 -0
  9. package/dist/ui/src/components/edyn/file-input/file-input.d.ts +90 -0
  10. package/dist/ui/src/components/edyn/file-input/file-input.js +261 -0
  11. package/dist/ui/src/components/edyn/file-input/file-input.js.map +1 -0
  12. package/dist/ui/src/components/edyn/file-input/file-input.test.d.ts +8 -0
  13. package/dist/ui/src/components/edyn/file-input/index.d.ts +1 -0
  14. package/dist/ui/src/components/edyn/multi-select/multi-select.d.ts +12 -1
  15. package/dist/ui/src/components/edyn/multi-select/multi-select.js +11 -7
  16. package/dist/ui/src/components/edyn/multi-select/multi-select.js.map +1 -1
  17. package/dist/ui/src/components/edyn/presence/presence.d.ts +1 -1
  18. package/dist/ui/src/components/edyn/presence/presence.js +5 -1
  19. package/dist/ui/src/components/edyn/presence/presence.js.map +1 -1
  20. package/dist/ui/src/components/edyn/time-field/index.d.ts +1 -0
  21. package/dist/ui/src/components/edyn/time-field/time-field.d.ts +85 -0
  22. package/dist/ui/src/components/edyn/time-field/time-field.js +330 -0
  23. package/dist/ui/src/components/edyn/time-field/time-field.js.map +1 -0
  24. package/dist/ui/src/components/edyn/time-field/time-field.test.d.ts +8 -0
  25. package/dist/ui/src/components/ui/calendar/calendar.behavior.test.d.ts +9 -0
  26. package/dist/ui/src/components/ui/calendar/calendar.d.ts +1 -1
  27. package/dist/ui/src/components/ui/calendar/calendar.js +33 -2
  28. package/dist/ui/src/components/ui/calendar/calendar.js.map +1 -1
  29. package/dist/ui/src/components/ui/combobox/combobox.d.ts +10 -0
  30. package/dist/ui/src/components/ui/combobox/combobox.js +37 -5
  31. package/dist/ui/src/components/ui/combobox/combobox.js.map +1 -1
  32. package/dist/ui/src/components/ui/context-menu/context-menu.d.ts +1 -1
  33. package/dist/ui/src/components/ui/context-menu/context-menu.js +23 -10
  34. package/dist/ui/src/components/ui/context-menu/context-menu.js.map +1 -1
  35. package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js +5 -4
  36. package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  37. package/dist/ui/src/components/ui/menubar/menubar.js +1 -1
  38. package/dist/ui/src/components/ui/menubar/menubar.js.map +1 -1
  39. package/dist/ui/src/components/ui/scroll-area/scroll-area.js +1 -1
  40. package/dist/ui/src/components/ui/scroll-area/scroll-area.js.map +1 -1
  41. package/dist/ui/src/components/ui/select/select.js +7 -6
  42. package/dist/ui/src/components/ui/select/select.js.map +1 -1
  43. package/dist/ui/src/components/ui/sheet/sheet.d.ts +8 -0
  44. package/dist/ui/src/components/ui/sheet/sheet.js +11 -3
  45. package/dist/ui/src/components/ui/sheet/sheet.js.map +1 -1
  46. package/dist/ui/src/components/ui/table/table.d.ts +9 -2
  47. package/dist/ui/src/components/ui/table/table.js +19 -6
  48. package/dist/ui/src/components/ui/table/table.js.map +1 -1
  49. package/dist/ui/src/index.d.ts +1 -0
  50. package/dist/ui/src/lib/popup-list.d.ts +29 -4
  51. package/dist/ui/src/lib/popup-list.js +30 -5
  52. package/dist/ui/src/lib/popup-list.js.map +1 -1
  53. package/package.json +9 -1
@@ -13,3 +13,13 @@ export interface IComboboxContentProps extends Omit<ComboboxPrimitive.Popup.Prop
13
13
  export declare const ComboboxContent: ({ className, children, empty, portalContainer, ...props }: IComboboxContentProps) => import('react').JSX.Element;
14
14
  export declare const ComboboxItem: ({ className, children, ...props }: ComboboxPrimitive.Item.Props) => import('react').JSX.Element;
15
15
  export declare const ComboboxEmpty: ({ className, children, ...props }: ComboboxPrimitive.Empty.Props) => import('react').JSX.Element;
16
+ /**
17
+ * A titled run of items. Put a `ComboboxLabel` first in it; with grouped `items` on the root, render the group's own items
18
+ * through `ComboboxCollection` (Base UI's grouped-items pattern), so a filter hides a group whose items all drop out.
19
+ */
20
+ export declare const ComboboxGroup: ({ ...props }: ComboboxPrimitive.Group.Props) => import('react').JSX.Element;
21
+ /** A group's heading, the same one Select and the menus draw. */
22
+ export declare const ComboboxLabel: ({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) => import('react').JSX.Element;
23
+ /** The items of one group, for grouped `items` on the root. */
24
+ export declare const ComboboxCollection: ({ ...props }: ComboboxPrimitive.Collection.Props) => import('react').JSX.Element;
25
+ export declare const ComboboxSeparator: ({ className, ...props }: ComboboxPrimitive.Separator.Props) => import('react').JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { ScrollArea } from "../scroll-area/scroll-area.js";
3
- import { POPUP_ITEM_INDICATOR_CLASS, POPUP_LIST_WIDTH_CLASS, popupItemClass } from "../../../lib/popup-list.js";
3
+ import { POPUP_FRAME_CLASS, POPUP_GROUP_LABEL_CLASS, POPUP_ITEM_INDICATOR_CLASS, POPUP_LIST_HEIGHT_CLASS, POPUP_LIST_WIDTH_CLASS, popupItemClass } from "../../../lib/popup-list.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { IconCheck, IconChevronDown } from "@tabler/icons-react";
6
6
  import { Combobox } from "@base-ui/react/combobox";
@@ -39,13 +39,13 @@ var ComboboxContent = ({ className, children, empty, portalContainer, ...props }
39
39
  className: "z-50",
40
40
  children: /* @__PURE__ */ jsxs(Combobox.Popup, {
41
41
  "data-slot": "combobox-content",
42
- className: cn(POPUP_LIST_WIDTH_CLASS, "overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md outline-none motion-reduce:animate-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
42
+ className: cn("flex max-h-(--available-height) flex-col overflow-hidden", POPUP_FRAME_CLASS, POPUP_LIST_WIDTH_CLASS, "motion-reduce:animate-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
43
43
  ...props,
44
44
  children: [/* @__PURE__ */ jsx(ComboboxEmpty, { children: empty }), /* @__PURE__ */ jsx(ScrollArea, {
45
45
  type: "always",
46
46
  fade: true,
47
- fadeFrom: "popover",
48
- className: "max-h-60",
47
+ className: POPUP_LIST_HEIGHT_CLASS,
48
+ viewportClassName: "scroll-py-1",
49
49
  children: /* @__PURE__ */ jsx(Combobox.List, {
50
50
  "data-slot": "combobox-list",
51
51
  className: "p-1",
@@ -79,7 +79,39 @@ var ComboboxEmpty = ({ className, children, ...props }) => {
79
79
  children: children ?? "No results found."
80
80
  });
81
81
  };
82
+ /**
83
+ * A titled run of items. Put a `ComboboxLabel` first in it; with grouped `items` on the root, render the group's own items
84
+ * through `ComboboxCollection` (Base UI's grouped-items pattern), so a filter hides a group whose items all drop out.
85
+ */
86
+ var ComboboxGroup = ({ ...props }) => {
87
+ return /* @__PURE__ */ jsx(Combobox.Group, {
88
+ "data-slot": "combobox-group",
89
+ ...props
90
+ });
91
+ };
92
+ /** A group's heading, the same one Select and the menus draw. */
93
+ var ComboboxLabel = ({ className, ...props }) => {
94
+ return /* @__PURE__ */ jsx(Combobox.GroupLabel, {
95
+ "data-slot": "combobox-label",
96
+ className: cn(POPUP_GROUP_LABEL_CLASS, className),
97
+ ...props
98
+ });
99
+ };
100
+ /** The items of one group, for grouped `items` on the root. */
101
+ var ComboboxCollection = ({ ...props }) => {
102
+ return /* @__PURE__ */ jsx(Combobox.Collection, {
103
+ "data-slot": "combobox-collection",
104
+ ...props
105
+ });
106
+ };
107
+ var ComboboxSeparator = ({ className, ...props }) => {
108
+ return /* @__PURE__ */ jsx(Combobox.Separator, {
109
+ "data-slot": "combobox-separator",
110
+ className: cn("-mx-1 my-1 h-px bg-border", className),
111
+ ...props
112
+ });
113
+ };
82
114
  //#endregion
83
- export { Combobox$1 as Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem };
115
+ export { Combobox$1 as Combobox, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxSeparator };
84
116
 
85
117
  //# sourceMappingURL=combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","names":[],"sources":["../../../../../../../ui/src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';\nimport { POPUP_ITEM_INDICATOR_CLASS, POPUP_LIST_WIDTH_CLASS, popupItemClass } from '@edyn/ui/lib/popup-list';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck, IconChevronDown } from '@tabler/icons-react';\nimport type { ReactNode } from 'react';\nimport { ScrollArea } from '../scroll-area';\n\nexport const Combobox = <TValue,>({ ...props }: ComboboxPrimitive.Root.Props<TValue>) => {\n return <ComboboxPrimitive.Root data-slot=\"combobox\" {...props} />;\n};\n\nexport const ComboboxInput = ({ className, ...props }: ComboboxPrimitive.Input.Props) => {\n return (\n <ComboboxPrimitive.InputGroup data-slot=\"combobox-input-group\" className=\"relative flex w-full items-center\">\n <ComboboxPrimitive.Input\n data-slot=\"combobox-input\"\n className={cn(\n 'h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 pr-8 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n className,\n )}\n {...props}\n />\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className=\"absolute right-2 flex items-center text-muted-foreground disabled:pointer-events-none disabled:opacity-50\"\n tabIndex={-1}\n aria-hidden\n >\n <IconChevronDown className=\"size-4\" />\n </ComboboxPrimitive.Trigger>\n </ComboboxPrimitive.InputGroup>\n );\n};\n\nexport interface IComboboxContentProps extends Omit<ComboboxPrimitive.Popup.Props, 'children'> {\n /** Item nodes, or the Base UI function form `(item, index) => node` (requires `items` on the root). */\n children?: ComboboxPrimitive.List.Props['children'];\n /** Empty-state content; rendered (with the default text) only when the filtered list is empty. */\n empty?: ReactNode;\n /** Optional portal destination, used by shadow-DOM element wrappers. */\n portalContainer?: ComboboxPrimitive.Portal.Props['container'];\n}\n\nexport const ComboboxContent = ({ className, children, empty, portalContainer, ...props }: IComboboxContentProps) => {\n return (\n <ComboboxPrimitive.Portal data-slot=\"combobox-portal\" container={portalContainer}>\n <ComboboxPrimitive.Positioner data-slot=\"combobox-positioner\" sideOffset={4} align=\"start\" className=\"z-50\">\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n className={cn(\n POPUP_LIST_WIDTH_CLASS,\n 'overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md outline-none motion-reduce:animate-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n >\n <ComboboxEmpty>{empty}</ComboboxEmpty>\n {/* The ScrollArea, not the List, is the scroll container: a filtered list\n that runs past the fold needs a bar and a fade to say so. Base UI\n keeps the highlighted item in view through the nearest scrollable\n ancestor, which is now the viewport. */}\n <ScrollArea type=\"always\" fade fadeFrom=\"popover\" className=\"max-h-60\">\n <ComboboxPrimitive.List data-slot=\"combobox-list\" className=\"p-1\">\n {children}\n </ComboboxPrimitive.List>\n </ScrollArea>\n </ComboboxPrimitive.Popup>\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n );\n};\n\nexport const ComboboxItem = ({ className, children, ...props }: ComboboxPrimitive.Item.Props) => {\n return (\n <ComboboxPrimitive.Item data-slot=\"combobox-item\" className={cn(popupItemClass('base-ui', true), className)} {...props}>\n <span className=\"flex-1\">{children}</span>\n <ComboboxPrimitive.ItemIndicator data-slot=\"combobox-item-indicator\" className={POPUP_ITEM_INDICATOR_CLASS}>\n <IconCheck className=\"size-3.5\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n );\n};\n\nexport const ComboboxEmpty = ({ className, children, ...props }: ComboboxPrimitive.Empty.Props) => {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n // empty:py-0 collapses the padding while the list has results: Base UI\n // keeps this status element mounted and only fills it when the list is\n // empty (and only when the root has `items` to derive emptiness from).\n className={cn('py-4 text-center text-sm text-muted-foreground empty:py-0', className)}\n {...props}\n >\n {children ?? 'No results found.'}\n </ComboboxPrimitive.Empty>\n );\n};\n"],"mappings":";;;;;;;AAOA,IAAa,cAAqB,EAAE,GAAG,YAAkD;CACvF,OAAO,oBAAC,SAAkB,MAAnB;EAAwB,aAAU;EAAW,GAAI;CAAQ,CAAA;AAClE;AAEA,IAAa,iBAAiB,EAAE,WAAW,GAAG,YAA2C;CACvF,OACE,qBAAC,SAAkB,YAAnB;EAA8B,aAAU;EAAuB,WAAU;EAAzE,UAAA,CACE,oBAAC,SAAkB,OAAnB;GACE,aAAU;GACV,WAAW,GACT,qiBACA,SACF;GACA,GAAI;EACL,CAAA,GACD,oBAAC,SAAkB,SAAnB;GACE,aAAU;GACV,WAAU;GACV,UAAU;GACV,eAAA;GAEA,UAAA,oBAAC,iBAAD,EAAiB,WAAU,SAAU,CAAA;EACZ,CAAA,CACC;;AAElC;AAWA,IAAa,mBAAmB,EAAE,WAAW,UAAU,OAAO,iBAAiB,GAAG,YAAmC;CACnH,OACE,oBAAC,SAAkB,QAAnB;EAA0B,aAAU;EAAkB,WAAW;EAC/D,UAAA,oBAAC,SAAkB,YAAnB;GAA8B,aAAU;GAAsB,YAAY;GAAG,OAAM;GAAQ,WAAU;GACnG,UAAA,qBAAC,SAAkB,OAAnB;IACE,aAAU;IACV,WAAW,GACT,wBACA,6QACA,SACF;IACA,GAAI;IAPN,UAAA,CASE,oBAAC,eAAD,EAAA,UAAgB,MAAqB,CAAA,GAKrC,oBAAC,YAAD;KAAY,MAAK;KAAS,MAAA;KAAK,UAAS;KAAU,WAAU;KAC1D,UAAA,oBAAC,SAAkB,MAAnB;MAAwB,aAAU;MAAgB,WAAU;MACzD;KACqB,CAAA;IACd,CAAA,CACW;;EACG,CAAA;CACN,CAAA;AAE9B;AAEA,IAAa,gBAAgB,EAAE,WAAW,UAAU,GAAG,YAA0C;CAC/F,OACE,qBAAC,SAAkB,MAAnB;EAAwB,aAAU;EAAgB,WAAW,GAAG,eAAe,WAAW,IAAI,GAAG,SAAS;EAAG,GAAI;EAAjH,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;GAAU;EAAe,CAAA,GACzC,oBAAC,SAAkB,eAAnB;GAAiC,aAAU;GAA0B,WAAW;GAC9E,UAAA,oBAAC,WAAD,EAAW,WAAU,WAAY,CAAA;EACF,CAAA,CACX;;AAE5B;AAEA,IAAa,iBAAiB,EAAE,WAAW,UAAU,GAAG,YAA2C;CACjG,OACE,oBAAC,SAAkB,OAAnB;EACE,aAAU;EAIV,WAAW,GAAG,6DAA6D,SAAS;EACpF,GAAI;EAEH,UAAA,YAAY;CACU,CAAA;AAE7B"}
1
+ {"version":3,"file":"combobox.js","names":[],"sources":["../../../../../../../ui/src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';\nimport {\n POPUP_FRAME_CLASS,\n POPUP_GROUP_LABEL_CLASS,\n POPUP_ITEM_INDICATOR_CLASS,\n POPUP_LIST_HEIGHT_CLASS,\n POPUP_LIST_WIDTH_CLASS,\n popupItemClass,\n} from '@edyn/ui/lib/popup-list';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck, IconChevronDown } from '@tabler/icons-react';\nimport type { ReactNode } from 'react';\nimport { ScrollArea } from '../scroll-area';\n\nexport const Combobox = <TValue,>({ ...props }: ComboboxPrimitive.Root.Props<TValue>) => {\n return <ComboboxPrimitive.Root data-slot=\"combobox\" {...props} />;\n};\n\nexport const ComboboxInput = ({ className, ...props }: ComboboxPrimitive.Input.Props) => {\n return (\n <ComboboxPrimitive.InputGroup data-slot=\"combobox-input-group\" className=\"relative flex w-full items-center\">\n <ComboboxPrimitive.Input\n data-slot=\"combobox-input\"\n className={cn(\n 'h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 pr-8 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n className,\n )}\n {...props}\n />\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className=\"absolute right-2 flex items-center text-muted-foreground disabled:pointer-events-none disabled:opacity-50\"\n tabIndex={-1}\n aria-hidden\n >\n <IconChevronDown className=\"size-4\" />\n </ComboboxPrimitive.Trigger>\n </ComboboxPrimitive.InputGroup>\n );\n};\n\nexport interface IComboboxContentProps extends Omit<ComboboxPrimitive.Popup.Props, 'children'> {\n /** Item nodes, or the Base UI function form `(item, index) => node` (requires `items` on the root). */\n children?: ComboboxPrimitive.List.Props['children'];\n /** Empty-state content; rendered (with the default text) only when the filtered list is empty. */\n empty?: ReactNode;\n /** Optional portal destination, used by shadow-DOM element wrappers. */\n portalContainer?: ComboboxPrimitive.Portal.Props['container'];\n}\n\nexport const ComboboxContent = ({ className, children, empty, portalContainer, ...props }: IComboboxContentProps) => {\n return (\n <ComboboxPrimitive.Portal data-slot=\"combobox-portal\" container={portalContainer}>\n <ComboboxPrimitive.Positioner data-slot=\"combobox-positioner\" sideOffset={4} align=\"start\" className=\"z-50\">\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n className={cn(\n 'flex max-h-(--available-height) flex-col overflow-hidden',\n POPUP_FRAME_CLASS,\n POPUP_LIST_WIDTH_CLASS,\n 'motion-reduce:animate-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n >\n <ComboboxEmpty>{empty}</ComboboxEmpty>\n {/* The ScrollArea, not the List, is the scroll container: a filtered list\n that runs past the fold needs a bar and a fade to say so. Base UI\n keeps the highlighted item in view through the nearest scrollable\n ancestor, which is now the viewport. POPUP_LIST_HEIGHT_CLASS ends\n the list on a whole row. */}\n <ScrollArea type=\"always\" fade className={POPUP_LIST_HEIGHT_CLASS} viewportClassName=\"scroll-py-1\">\n <ComboboxPrimitive.List data-slot=\"combobox-list\" className=\"p-1\">\n {children}\n </ComboboxPrimitive.List>\n </ScrollArea>\n </ComboboxPrimitive.Popup>\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n );\n};\n\nexport const ComboboxItem = ({ className, children, ...props }: ComboboxPrimitive.Item.Props) => {\n return (\n <ComboboxPrimitive.Item data-slot=\"combobox-item\" className={cn(popupItemClass('base-ui', true), className)} {...props}>\n <span className=\"flex-1\">{children}</span>\n <ComboboxPrimitive.ItemIndicator data-slot=\"combobox-item-indicator\" className={POPUP_ITEM_INDICATOR_CLASS}>\n <IconCheck className=\"size-3.5\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n );\n};\n\nexport const ComboboxEmpty = ({ className, children, ...props }: ComboboxPrimitive.Empty.Props) => {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n // empty:py-0 collapses the padding while the list has results: Base UI\n // keeps this status element mounted and only fills it when the list is\n // empty (and only when the root has `items` to derive emptiness from).\n className={cn('py-4 text-center text-sm text-muted-foreground empty:py-0', className)}\n {...props}\n >\n {children ?? 'No results found.'}\n </ComboboxPrimitive.Empty>\n );\n};\n\n/**\n * A titled run of items. Put a `ComboboxLabel` first in it; with grouped `items` on the root, render the group's own items\n * through `ComboboxCollection` (Base UI's grouped-items pattern), so a filter hides a group whose items all drop out.\n */\nexport const ComboboxGroup = ({ ...props }: ComboboxPrimitive.Group.Props) => {\n return <ComboboxPrimitive.Group data-slot=\"combobox-group\" {...props} />;\n};\n\n/** A group's heading, the same one Select and the menus draw. */\nexport const ComboboxLabel = ({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) => {\n return <ComboboxPrimitive.GroupLabel data-slot=\"combobox-label\" className={cn(POPUP_GROUP_LABEL_CLASS, className)} {...props} />;\n};\n\n/** The items of one group, for grouped `items` on the root. */\nexport const ComboboxCollection = ({ ...props }: ComboboxPrimitive.Collection.Props) => {\n return <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />;\n};\n\nexport const ComboboxSeparator = ({ className, ...props }: ComboboxPrimitive.Separator.Props) => {\n return <ComboboxPrimitive.Separator data-slot=\"combobox-separator\" className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />;\n};\n"],"mappings":";;;;;;;AAcA,IAAa,cAAqB,EAAE,GAAG,YAAkD;CACvF,OAAO,oBAAC,SAAkB,MAAnB;EAAwB,aAAU;EAAW,GAAI;CAAQ,CAAA;AAClE;AAEA,IAAa,iBAAiB,EAAE,WAAW,GAAG,YAA2C;CACvF,OACE,qBAAC,SAAkB,YAAnB;EAA8B,aAAU;EAAuB,WAAU;EAAzE,UAAA,CACE,oBAAC,SAAkB,OAAnB;GACE,aAAU;GACV,WAAW,GACT,qiBACA,SACF;GACA,GAAI;EACL,CAAA,GACD,oBAAC,SAAkB,SAAnB;GACE,aAAU;GACV,WAAU;GACV,UAAU;GACV,eAAA;GAEA,UAAA,oBAAC,iBAAD,EAAiB,WAAU,SAAU,CAA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AA;AACzE;;AAGA,IAAa,iBAAiB,EAAE,WAAW,GAAG,YAAgD;CAC5F,OAAO,oBAAC,SAAkB,YAAnB;EAA8B,aAAU;EAAiB,WAAW,GAAG,yBAAyB,SAAS;EAAG,GAAI;CAAQ,CAAA;AACjI;;AAGA,IAAa,sBAAsB,EAAE,GAAG,YAAgD;CACtF,OAAO,oBAAC,SAAkB,YAAnB;EAA8B,aAAU;EAAsB,GAAI;CAAQ,CAAA;AACnF;AAEA,IAAa,qBAAqB,EAAE,WAAW,GAAG,YAA+C;CAC/F,OAAO,oBAAC,SAAkB,WAAnB;EAA6B,aAAU;EAAqB,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;CAAQ,CAAA;AACxI"}
@@ -3,7 +3,7 @@ import type * as React from 'react';
3
3
  export declare const ContextMenu: ({ ...props }: ContextMenuPrimitive.Root.Props) => React.JSX.Element;
4
4
  export declare const ContextMenuPortal: ({ ...props }: ContextMenuPrimitive.Portal.Props) => React.JSX.Element;
5
5
  export declare const ContextMenuTrigger: ({ className, ...props }: ContextMenuPrimitive.Trigger.Props) => React.JSX.Element;
6
- export declare const ContextMenuContent: ({ className, align, alignOffset, side, sideOffset, ...props }: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">) => React.JSX.Element;
6
+ export declare const ContextMenuContent: ({ className, children, align, alignOffset, side, sideOffset, ...props }: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">) => React.JSX.Element;
7
7
  export declare const ContextMenuGroup: ({ ...props }: ContextMenuPrimitive.Group.Props) => React.JSX.Element;
8
8
  export declare const ContextMenuLabel: ({ className, inset, ...props }: ContextMenuPrimitive.GroupLabel.Props & {
9
9
  inset?: boolean;
@@ -1,6 +1,8 @@
1
1
  "use client";
2
2
  import { cn } from "../../../lib/utils.js";
3
3
  import { useExposedFocusGuards } from "../../../lib/focus-guards.js";
4
+ import { ScrollArea } from "../scroll-area/scroll-area.js";
5
+ import { POPUP_FRAME_CLASS, POPUP_GROUP_LABEL_CLASS, POPUP_ITEM_INDICATOR_CLASS, POPUP_LIST_HEIGHT_CLASS, POPUP_LIST_WIDTH_CLASS, popupItemClass } from "../../../lib/popup-list.js";
4
6
  import { jsx, jsxs } from "react/jsx-runtime";
5
7
  import { IconCheck, IconChevronRight } from "@tabler/icons-react";
6
8
  import { ContextMenu } from "@base-ui/react/context-menu";
@@ -24,7 +26,7 @@ var ContextMenuTrigger = ({ className, ...props }) => {
24
26
  ...props
25
27
  });
26
28
  };
27
- var ContextMenuContent = ({ className, align = "start", alignOffset = 4, side = "right", sideOffset = 0, ...props }) => {
29
+ var ContextMenuContent = ({ className, children, align = "start", alignOffset = 4, side = "right", sideOffset = 0, ...props }) => {
28
30
  useExposedFocusGuards();
29
31
  return /* @__PURE__ */ jsx(ContextMenu.Portal, { children: /* @__PURE__ */ jsx(ContextMenu.Positioner, {
30
32
  className: "isolate z-50 outline-none",
@@ -34,8 +36,19 @@ var ContextMenuContent = ({ className, align = "start", alignOffset = 4, side =
34
36
  sideOffset,
35
37
  children: /* @__PURE__ */ jsx(ContextMenu.Popup, {
36
38
  "data-slot": "context-menu-content",
37
- className: cn("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "motion-reduce:animate-none", className),
38
- ...props
39
+ className: cn("z-50 flex max-h-(--available-height) origin-(--transform-origin) flex-col overflow-hidden duration-100", POPUP_FRAME_CLASS, POPUP_LIST_WIDTH_CLASS, "data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "motion-reduce:animate-none", className),
40
+ ...props,
41
+ children: /* @__PURE__ */ jsx(ScrollArea, {
42
+ type: "always",
43
+ fade: true,
44
+ focusable: false,
45
+ className: POPUP_LIST_HEIGHT_CLASS,
46
+ viewportClassName: "scroll-py-1",
47
+ children: /* @__PURE__ */ jsx("div", {
48
+ className: "p-1",
49
+ children
50
+ })
51
+ })
39
52
  })
40
53
  }) });
41
54
  };
@@ -49,7 +62,7 @@ var ContextMenuLabel = ({ className, inset, ...props }) => {
49
62
  return /* @__PURE__ */ jsx(ContextMenu.GroupLabel, {
50
63
  "data-slot": "context-menu-label",
51
64
  "data-inset": inset,
52
- className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-[inset=true]:pl-7", className),
65
+ className: cn(POPUP_GROUP_LABEL_CLASS, "data-[inset=true]:pl-7", className),
53
66
  ...props
54
67
  });
55
68
  };
@@ -58,7 +71,7 @@ var ContextMenuItem = ({ className, inset, variant = "default", ...props }) => {
58
71
  "data-slot": "context-menu-item",
59
72
  "data-inset": inset,
60
73
  "data-variant": variant,
61
- className: cn("group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive", className),
74
+ className: cn("group/context-menu-item", popupItemClass(), "data-[inset=true]:pl-7", "data-[variant=destructive]:text-destructive data-[variant=destructive]:[&>svg]:text-destructive", "data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive", className),
62
75
  ...props
63
76
  });
64
77
  };
@@ -72,7 +85,7 @@ var ContextMenuSubTrigger = ({ className, inset, children, ...props }) => {
72
85
  return /* @__PURE__ */ jsxs(ContextMenu.SubmenuTrigger, {
73
86
  "data-slot": "context-menu-sub-trigger",
74
87
  "data-inset": inset,
75
- className: cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
88
+ className: cn(popupItemClass(), "data-[inset=true]:pl-7 data-popup-open:bg-foreground/6 data-popup-open:[&>svg]:text-foreground", className),
76
89
  ...props,
77
90
  children: [children, /* @__PURE__ */ jsx(IconChevronRight, { className: "ml-auto" })]
78
91
  });
@@ -89,11 +102,11 @@ var ContextMenuCheckboxItem = ({ className, children, checked, inset, ...props }
89
102
  return /* @__PURE__ */ jsxs(ContextMenu.CheckboxItem, {
90
103
  "data-slot": "context-menu-checkbox-item",
91
104
  "data-inset": inset,
92
- className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
105
+ className: cn(popupItemClass("base-ui", true), "data-checked:font-medium data-[inset=true]:pl-7", className),
93
106
  checked,
94
107
  ...props,
95
108
  children: [/* @__PURE__ */ jsx("span", {
96
- className: "pointer-events-none absolute right-2",
109
+ className: POPUP_ITEM_INDICATOR_CLASS,
97
110
  children: /* @__PURE__ */ jsx(ContextMenu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(IconCheck, {}) })
98
111
  }), children]
99
112
  });
@@ -108,10 +121,10 @@ var ContextMenuRadioItem = ({ className, children, inset, ...props }) => {
108
121
  return /* @__PURE__ */ jsxs(ContextMenu.RadioItem, {
109
122
  "data-slot": "context-menu-radio-item",
110
123
  "data-inset": inset,
111
- className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
124
+ className: cn(popupItemClass("base-ui", true), "data-checked:font-medium data-[inset=true]:pl-7", className),
112
125
  ...props,
113
126
  children: [/* @__PURE__ */ jsx("span", {
114
- className: "pointer-events-none absolute right-2",
127
+ className: POPUP_ITEM_INDICATOR_CLASS,
115
128
  children: /* @__PURE__ */ jsx(ContextMenu.RadioItemIndicator, { children: /* @__PURE__ */ jsx(IconCheck, {}) })
116
129
  }), children]
117
130
  });
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.js","names":[],"sources":["../../../../../../../ui/src/components/ui/context-menu/context-menu.tsx"],"sourcesContent":["'use client';\n\nimport { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';\nimport { useExposedFocusGuards } from '@edyn/ui/lib/focus-guards';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck, IconChevronRight } from '@tabler/icons-react';\nimport type * as React from 'react';\n\nexport const ContextMenu = ({ ...props }: ContextMenuPrimitive.Root.Props) => {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n};\n\nexport const ContextMenuPortal = ({ ...props }: ContextMenuPrimitive.Portal.Props) => {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n};\n\nexport const ContextMenuTrigger = ({ className, ...props }: ContextMenuPrimitive.Trigger.Props) => {\n return <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" className={cn('select-none', className)} {...props} />;\n};\n\nexport const ContextMenuContent = ({\n className,\n align = 'start',\n alignOffset = 4,\n side = 'right',\n sideOffset = 0,\n ...props\n}: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) => {\n useExposedFocusGuards();\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Positioner\n className=\"isolate z-50 outline-none\"\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n >\n <ContextMenuPrimitive.Popup\n data-slot=\"context-menu-content\"\n className={cn(\n 'z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'motion-reduce:animate-none',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Positioner>\n </ContextMenuPrimitive.Portal>\n );\n};\n\nexport const ContextMenuGroup = ({ ...props }: ContextMenuPrimitive.Group.Props) => {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n};\n\nexport const ContextMenuLabel = ({\n className,\n inset,\n ...props\n}: ContextMenuPrimitive.GroupLabel.Props & {\n inset?: boolean;\n}) => {\n return (\n <ContextMenuPrimitive.GroupLabel\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-[inset=true]:pl-7', className)}\n {...props}\n />\n );\n};\n\nexport const ContextMenuItem = ({\n className,\n inset,\n variant = 'default',\n ...props\n}: ContextMenuPrimitive.Item.Props & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) => {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive\",\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const ContextMenuSub = ({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) => {\n return <ContextMenuPrimitive.SubmenuRoot data-slot=\"context-menu-sub\" {...props} />;\n};\n\nexport const ContextMenuSubTrigger = ({\n className,\n inset,\n children,\n ...props\n}: ContextMenuPrimitive.SubmenuTrigger.Props & {\n inset?: boolean;\n}) => {\n return (\n <ContextMenuPrimitive.SubmenuTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto\" />\n </ContextMenuPrimitive.SubmenuTrigger>\n );\n};\n\nexport const ContextMenuSubContent = ({ ...props }: React.ComponentProps<typeof ContextMenuContent>) => {\n return <ContextMenuContent data-slot=\"context-menu-sub-content\" className=\"shadow-lg\" side=\"right\" {...props} />;\n};\n\nexport const ContextMenuCheckboxItem = ({\n className,\n children,\n checked,\n inset,\n ...props\n}: ContextMenuPrimitive.CheckboxItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.CheckboxItemIndicator>\n <IconCheck />\n </ContextMenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n};\n\nexport const ContextMenuRadioGroup = ({ ...props }: ContextMenuPrimitive.RadioGroup.Props) => {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n};\n\nexport const ContextMenuRadioItem = ({\n className,\n children,\n inset,\n ...props\n}: ContextMenuPrimitive.RadioItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.RadioItemIndicator>\n <IconCheck />\n </ContextMenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n};\n\nexport const ContextMenuSeparator = ({ className, ...props }: ContextMenuPrimitive.Separator.Props) => {\n return <ContextMenuPrimitive.Separator data-slot=\"context-menu-separator\" className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />;\n};\n\nexport const ContextMenuShortcut = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn('ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground', className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;AAQA,IAAa,iBAAe,EAAE,GAAG,YAA6C;CAC5E,OAAO,oBAAC,YAAqB,MAAtB;EAA2B,aAAU;EAAe,GAAI;CAAQ,CAAA;AACzE;AAEA,IAAa,qBAAqB,EAAE,GAAG,YAA+C;CACpF,OAAO,oBAAC,YAAqB,QAAtB;EAA6B,aAAU;EAAsB,GAAI;CAAQ,CAAA;AAClF;AAEA,IAAa,sBAAsB,EAAE,WAAW,GAAG,YAAgD;CACjG,OAAO,oBAAC,YAAqB,SAAtB;EAA8B,aAAU;EAAuB,WAAW,GAAG,eAAe,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC7H;AAEA,IAAa,sBAAsB,EACjC,WACA,QAAQ,SACR,cAAc,GACd,OAAO,SACP,aAAa,GACb,GAAG,YACkI;CACrI,sBAAsB;CACtB,OACE,oBAAC,YAAqB,QAAtB,EAAA,UACE,oBAAC,YAAqB,YAAtB;EACE,WAAU;EACH;EACM;EACP;EACM;EAEZ,UAAA,oBAAC,YAAqB,OAAtB;GACE,aAAU;GACV,WAAW,GACT,slBACA,8BACA,SACF;GACA,GAAI;EACL,CAAA;CAC8B,CAAA,EACN,CAAA;AAEjC;AAEA,IAAa,o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gC;;AAEvC;AAEA,IAAa,yBAAyB,EAAE,GAAG,YAAmD;CAC5F,OAAO,oBAAC,YAAqB,YAAtB;EAAiC,aAAU;EAA2B,GAAI;CAAQ,CAAA;AAC3F;AAEA,IAAa,wBAAwB,EACnC,WACA,UACA,OACA,GAAG,YAGC;CACJ,OACE,qBAAC,YAAqB,WAAtB;EACE,aAAU;EACV,cAAY;EACZ,WAAW,GACT,qUACA,SACF;EACA,GAAI;EAPN,UAAA,CASE,oBAAC,QAAD;GAAM,WAAU;GACd,UAAA,oBAAC,YAAqB,oBAAtB,EAAA,UACE,oBAAC,WAAD,CAAY,CAAA,EAC2B,CAAA;EACrC,CAAA,GACL,QAC6B;;AAEpC;AAEA,IAAa,wBAAwB,EAAE,WAAW,GAAG,YAAkD;CACrG,OAAO,oBAAC,YAAqB,WAAtB;EAAgC,aAAU;EAAyB,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC/I;AAEA,IAAa,uBAAuB,EAAE,WAAW,GAAG,YAA0C;CAC5F,OACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GAAG,8GAA8G,SAAS;EACrI,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"context-menu.js","names":[],"sources":["../../../../../../../ui/src/components/ui/context-menu/context-menu.tsx"],"sourcesContent":["'use client';\n\nimport { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';\nimport { useExposedFocusGuards } from '@edyn/ui/lib/focus-guards';\nimport {\n POPUP_FRAME_CLASS,\n POPUP_GROUP_LABEL_CLASS,\n POPUP_ITEM_INDICATOR_CLASS,\n POPUP_LIST_HEIGHT_CLASS,\n POPUP_LIST_WIDTH_CLASS,\n popupItemClass,\n} from '@edyn/ui/lib/popup-list';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck, IconChevronRight } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport { ScrollArea } from '../scroll-area';\n\nexport const ContextMenu = ({ ...props }: ContextMenuPrimitive.Root.Props) => {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n};\n\nexport const ContextMenuPortal = ({ ...props }: ContextMenuPrimitive.Portal.Props) => {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n};\n\nexport const ContextMenuTrigger = ({ className, ...props }: ContextMenuPrimitive.Trigger.Props) => {\n return <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" className={cn('select-none', className)} {...props} />;\n};\n\nexport const ContextMenuContent = ({\n className,\n children,\n align = 'start',\n alignOffset = 4,\n side = 'right',\n sideOffset = 0,\n ...props\n}: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) => {\n useExposedFocusGuards();\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Positioner\n className=\"isolate z-50 outline-none\"\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n >\n <ContextMenuPrimitive.Popup\n data-slot=\"context-menu-content\"\n className={cn(\n 'z-50 flex max-h-(--available-height) origin-(--transform-origin) flex-col overflow-hidden duration-100',\n POPUP_FRAME_CLASS,\n POPUP_LIST_WIDTH_CLASS,\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'motion-reduce:animate-none',\n className,\n )}\n {...props}\n >\n {/* A menu that outgrows the window scrolls in a ScrollArea like every other popup list, not in a native\n scroll box; the padding sits on the content so the cap counts it. */}\n <ScrollArea type=\"always\" fade focusable={false} className={POPUP_LIST_HEIGHT_CLASS} viewportClassName=\"scroll-py-1\">\n <div className=\"p-1\">{children}</div>\n </ScrollArea>\n </ContextMenuPrimitive.Popup>\n </ContextMenuPrimitive.Positioner>\n </ContextMenuPrimitive.Portal>\n );\n};\n\nexport const ContextMenuGroup = ({ ...props }: ContextMenuPrimitive.Group.Props) => {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n};\n\nexport const ContextMenuLabel = ({\n className,\n inset,\n ...props\n}: ContextMenuPrimitive.GroupLabel.Props & {\n inset?: boolean;\n}) => {\n return (\n <ContextMenuPrimitive.GroupLabel\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn(POPUP_GROUP_LABEL_CLASS, 'data-[inset=true]:pl-7', className)}\n {...props}\n />\n );\n};\n\nexport const ContextMenuItem = ({\n className,\n inset,\n variant = 'default',\n ...props\n}: ContextMenuPrimitive.Item.Props & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) => {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/context-menu-item',\n popupItemClass(),\n 'data-[inset=true]:pl-7',\n // A destructive item keeps its own colour, and its own highlight with it, as in DropdownMenu.\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:[&>svg]:text-destructive',\n 'data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const ContextMenuSub = ({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) => {\n return <ContextMenuPrimitive.SubmenuRoot data-slot=\"context-menu-sub\" {...props} />;\n};\n\nexport const ContextMenuSubTrigger = ({\n className,\n inset,\n children,\n ...props\n}: ContextMenuPrimitive.SubmenuTrigger.Props & {\n inset?: boolean;\n}) => {\n return (\n <ContextMenuPrimitive.SubmenuTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n popupItemClass(),\n // An open submenu holds its trigger in the highlight while the pointer is down in its panel.\n 'data-[inset=true]:pl-7 data-popup-open:bg-foreground/6 data-popup-open:[&>svg]:text-foreground',\n className,\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto\" />\n </ContextMenuPrimitive.SubmenuTrigger>\n );\n};\n\nexport const ContextMenuSubContent = ({ ...props }: React.ComponentProps<typeof ContextMenuContent>) => {\n return <ContextMenuContent data-slot=\"context-menu-sub-content\" className=\"shadow-lg\" side=\"right\" {...props} />;\n};\n\nexport const ContextMenuCheckboxItem = ({\n className,\n children,\n checked,\n inset,\n ...props\n}: ContextMenuPrimitive.CheckboxItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(popupItemClass('base-ui', true), 'data-checked:font-medium data-[inset=true]:pl-7', className)}\n checked={checked}\n {...props}\n >\n <span className={POPUP_ITEM_INDICATOR_CLASS}>\n <ContextMenuPrimitive.CheckboxItemIndicator>\n <IconCheck />\n </ContextMenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n};\n\nexport const ContextMenuRadioGroup = ({ ...props }: ContextMenuPrimitive.RadioGroup.Props) => {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n};\n\nexport const ContextMenuRadioItem = ({\n className,\n children,\n inset,\n ...props\n}: ContextMenuPrimitive.RadioItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(popupItemClass('base-ui', true), 'data-checked:font-medium data-[inset=true]:pl-7', className)}\n {...props}\n >\n <span className={POPUP_ITEM_INDICATOR_CLASS}>\n <ContextMenuPrimitive.RadioItemIndicator>\n <IconCheck />\n </ContextMenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n};\n\nexport const ContextMenuSeparator = ({ className, ...props }: ContextMenuPrimitive.Separator.Props) => {\n return <ContextMenuPrimitive.Separator data-slot=\"context-menu-separator\" className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />;\n};\n\nexport const ContextMenuShortcut = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn('ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground', className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;;AAiBA,IAAa,iBAAe,EAAE,GAAG,YAA6C;CAC5E,OAAO,oBAAC,YAAqB,MAAtB;EAA2B,aAAU;EAAe,GAAI;CAAQ,CAAA;AACzE;AAEA,IAAa,qBAAqB,EAAE,GAAG,YAA+C;CACpF,OAAO,oBAAC,YAAqB,QAAtB;EAA6B,aAAU;EAAsB,GAAI;CAAQ,CAAA;AAClF;AAEA,IAAa,sBAAsB,EAAE,WAAW,GAAG,YAAgD;CACjG,OAAO,oBAAC,YAAqB,SAAtB;EAA8B,aAAU;EAAuB,WAAW,GAAG,eAAe,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC7H;AAEA,IAAa,sBAAsB,EACjC,WACA,UACA,QAAQ,SACR,cAAc,GACd,OAAO,SACP,aAAa,GACb,GAAG,YACkI;CACrI,sBAAsB;CACtB,OACE,oBAAC,YAAqB,QAAtB,EAAA,UACE,oBAAC,YAAqB,YAAtB;EACE,WAAU;EACH;EACM;EACP;EACM;EAEZ,UAAA,oBAAC,YAAqB,OAAtB;GACE,aAAU;GACV,WAAW,GACT,0GACA,mBACA,wBACA,+XACA,8BACA,SACF;GACA,GAAI;GAIJ,UAAA,oBAAC,YAAD;IAAY,MAAK;IAAS,MAAA;IAAK,WAAW;IAAO,WAAW;IAAyB,mBAAkB;IACrG,UAAA,oBAAC,OAAD;KAAK,WAAU;KAAO;IAAc,CAAA;GAC1B,CAAA;EACc,CAAA;CACG,CAAA,EACN,CAAA;AAEjC;AAEA,IAAa,oBAAoB,EAAE,GAAG,YAA8C;CAClF,OAAO,oB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,CAAA,EAC8B,CAAA;EACxC,CAAA,GACL,QACgC;;AAEvC;AAEA,IAAa,yBAAyB,EAAE,GAAG,YAAmD;CAC5F,OAAO,oBAAC,YAAqB,YAAtB;EAAiC,aAAU;EAA2B,GAAI;CAAQ,CAAA;AAC3F;AAEA,IAAa,wBAAwB,EACnC,WACA,UACA,OACA,GAAG,YAGC;CACJ,OACE,qBAAC,YAAqB,WAAtB;EACE,aAAU;EACV,cAAY;EACZ,WAAW,GAAG,eAAe,WAAW,IAAI,GAAG,mDAAmD,SAAS;EAC3G,GAAI;EAJN,UAAA,CAME,oBAAC,QAAD;GAAM,WAAW;GACf,UAAA,oBAAC,YAAqB,oBAAtB,EAAA,UACE,oBAAC,WAAD,CAAY,CAAA,EAC2B,CAAA;EACrC,CAAA,GACL,QAC6B;;AAEpC;AAEA,IAAa,wBAAwB,EAAE,WAAW,GAAG,YAAkD;CACrG,OAAO,oBAAC,YAAqB,WAAtB;EAAgC,aAAU;EAAyB,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC/I;AAEA,IAAa,uBAAuB,EAAE,WAAW,GAAG,YAA0C;CAC5F,OACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GAAG,8GAA8G,SAAS;EACrI,GAAI;CACL,CAAA;AAEL"}
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { useExposedFocusGuards } from "../../../lib/focus-guards.js";
3
3
  import { ScrollArea } from "../scroll-area/scroll-area.js";
4
- import { POPUP_GROUP_LABEL_CLASS, POPUP_ITEM_INDICATOR_CLASS, popupItemClass } from "../../../lib/popup-list.js";
4
+ import { POPUP_FRAME_CLASS, POPUP_GROUP_LABEL_CLASS, POPUP_ITEM_INDICATOR_CLASS, POPUP_LIST_HEIGHT_CLASS, POPUP_LIST_WIDTH_CLASS, popupItemClass } from "../../../lib/popup-list.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { IconCheck, IconChevronRight } from "@tabler/icons-react";
7
7
  import { Menu } from "@base-ui/react/menu";
@@ -45,13 +45,14 @@ var DropdownMenuContent = ({ align = "start", alignOffset = 0, side = "bottom",
45
45
  sideOffset,
46
46
  children: /* @__PURE__ */ jsx(Menu.Popup, {
47
47
  "data-slot": "dropdown-menu-content",
48
- className: cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", "motion-reduce:animate-none", className),
48
+ className: cn("z-50 flex max-h-(--available-height) origin-(--transform-origin) flex-col overflow-hidden duration-100", POPUP_FRAME_CLASS, POPUP_LIST_WIDTH_CLASS, "data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", "motion-reduce:animate-none", className),
49
49
  ...props,
50
50
  children: /* @__PURE__ */ jsx(ScrollArea, {
51
51
  type: "always",
52
52
  fade: true,
53
53
  focusable: false,
54
- className: "max-h-inherit",
54
+ className: POPUP_LIST_HEIGHT_CLASS,
55
+ viewportClassName: "scroll-py-1",
55
56
  children: /* @__PURE__ */ jsx("div", {
56
57
  className: "p-1",
57
58
  children
@@ -101,7 +102,7 @@ var DropdownMenuSubTrigger = ({ className, inset, children, ...props }) => {
101
102
  var DropdownMenuSubContent = ({ align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props }) => {
102
103
  return /* @__PURE__ */ jsx(DropdownMenuContent, {
103
104
  "data-slot": "dropdown-menu-sub-content",
104
- className: cn("w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "motion-reduce:animate-none", className),
105
+ className: cn("shadow-lg", className),
105
106
  align,
106
107
  alignOffset,
107
108
  side,
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","names":[],"sources":["../../../../../../../ui/src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { Menu as MenuPrimitive } from '@base-ui/react/menu';\nimport { useExposedFocusGuards } from '@edyn/ui/lib/focus-guards';\nimport { POPUP_GROUP_LABEL_CLASS, POPUP_ITEM_INDICATOR_CLASS, popupItemClass } from '@edyn/ui/lib/popup-list';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck, IconChevronRight } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport { ScrollArea } from '../scroll-area';\n\nexport const DropdownMenu = ({ ...props }: MenuPrimitive.Root.Props) => {\n return <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n};\n\nexport const DropdownMenuPortal = ({ ...props }: MenuPrimitive.Portal.Props) => {\n return <MenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n};\n\nexport const DropdownMenuTrigger = ({ ...props }: MenuPrimitive.Trigger.Props) => {\n return <MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n};\n\n/**\n * Scrolls inside a DS ScrollArea like the other popup lists, with the bar shown\n * for as long as the menu overflows and a fade on whichever end is cut off.\n *\n * Base UI puts `role=\"menu\"` on this popup itself and offers no inner list part\n * to move it onto, so the ScrollArea sits INSIDE the role. That is only legal\n * because ScrollArea drops the `role=\"presentation\"` Base UI gives its root,\n * viewport and content: a menu may not own presentation wrappers (axe reports\n * a critical aria-required-children violation), but it may own plain divs.\n * e2e/a11y.spec.ts scans the open menu in both themes to keep it that way.\n */\nexport const DropdownMenuContent = ({\n align = 'start',\n alignOffset = 0,\n side = 'bottom',\n sideOffset = 4,\n className,\n children,\n ...props\n}: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) => {\n useExposedFocusGuards();\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.Positioner className=\"isolate z-50 outline-none\" align={align} alignOffset={alignOffset} side={side} sideOffset={sideOffset}>\n <MenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={cn(\n 'z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95',\n 'motion-reduce:animate-none',\n className,\n )}\n {...props}\n >\n {/* max-h-inherit hands the positioner's measured height to the element that\n scrolls; the padding sits on the content so the cap is the popup's exactly. */}\n <ScrollArea type=\"always\" fade focusable={false} className=\"max-h-inherit\">\n <div className=\"p-1\">{children}</div>\n </ScrollArea>\n </MenuPrimitive.Popup>\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n );\n};\n\nexport const DropdownMenuGroup = ({ ...props }: MenuPrimitive.Group.Props) => {\n return <MenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n};\n\nexport const DropdownMenuLabel = ({\n className,\n inset,\n ...props\n}: MenuPrimitive.GroupLabel.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(POPUP_GROUP_LABEL_CLASS, 'data-[inset=true]:pl-7', className)}\n {...props}\n />\n );\n};\n\nexport const DropdownMenuItem = ({\n className,\n inset,\n variant = 'default',\n ...props\n}: MenuPrimitive.Item.Props & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) => {\n return (\n <MenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/dropdown-menu-item',\n popupItemClass(),\n 'data-[inset=true]:pl-7',\n // A destructive item keeps its own colour, and its own highlight with it:\n // the shared translucent one would make it read like any other item.\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:[&>svg]:text-destructive',\n 'data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const DropdownMenuSub = ({ ...props }: MenuPrimitive.SubmenuRoot.Props) => {\n return <MenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />;\n};\n\nexport const DropdownMenuSubTrigger = ({\n className,\n inset,\n children,\n ...props\n}: MenuPrimitive.SubmenuTrigger.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n popupItemClass(),\n // An open submenu holds its trigger in the highlight while the pointer is\n // down in its panel.\n 'data-[inset=true]:pl-7 data-popup-open:bg-foreground/6 data-popup-open:[&>svg]:text-foreground',\n className,\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto\" />\n </MenuPrimitive.SubmenuTrigger>\n );\n};\n\nexport const DropdownMenuSubContent = ({\n align = 'start',\n alignOffset = -3,\n side = 'right',\n sideOffset = 0,\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuContent>) => {\n return (\n <DropdownMenuContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'motion-reduce:animate-none',\n className,\n )}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n {...props}\n />\n );\n};\n\nexport const DropdownMenuCheckboxItem = ({\n className,\n children,\n checked,\n inset,\n ...props\n}: MenuPrimitive.CheckboxItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={cn(popupItemClass('base-ui', true), 'data-checked:font-medium data-[inset=true]:pl-7', className)}\n checked={checked}\n {...props}\n >\n <span className={POPUP_ITEM_INDICATOR_CLASS} data-slot=\"dropdown-menu-checkbox-item-indicator\">\n <MenuPrimitive.CheckboxItemIndicator>\n <IconCheck />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n );\n};\n\nexport const DropdownMenuRadioGroup = ({ ...props }: MenuPrimitive.RadioGroup.Props) => {\n return <MenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n};\n\nexport const DropdownMenuRadioItem = ({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={cn(popupItemClass('base-ui', true), 'data-checked:font-medium data-[inset=true]:pl-7', className)}\n {...props}\n >\n <span className={POPUP_ITEM_INDICATOR_CLASS} data-slot=\"dropdown-menu-radio-item-indicator\">\n <MenuPrimitive.RadioItemIndicator>\n <IconCheck />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n );\n};\n\nexport const DropdownMenuSeparator = ({ className, ...props }: MenuPrimitive.Separator.Props) => {\n return <MenuPrimitive.Separator data-slot=\"dropdown-menu-separator\" className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />;\n};\n\nexport const DropdownMenuShortcut = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground', className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;AAQA,IAAa,gBAAgB,EAAE,GAAG,YAAsC;CACtE,OAAO,oBAAC,KAAc,MAAf;EAAoB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACnE;AAEA,IAAa,sBAAsB,EAAE,GAAG,YAAwC;CAC9E,OAAO,oBAAC,KAAc,QAAf;EAAsB,aAAU;EAAuB,GAAI;CAAQ,CAAA;AAC5E;AAEA,IAAa,uBAAuB,EAAE,GAAG,YAAyC;CAChF,OAAO,oBAAC,KAAc,SAAf;EAAuB,aAAU;EAAwB,GAAI;CAAQ,CAAA;AAC9E;;;;;;;;;;;;AAaA,IAAa,uBAAuB,EAClC,QAAQ,SACR,cAAc,GACd,OAAO,UACP,aAAa,GACb,WACA,UACA,GAAG,YACoH;CACvH,sBAAsB;CACtB,OACE,oBAAC,KAAc,QAAf,EAAA,UACE,oBAAC,KAAc,YAAf;EAA0B,WAAU;EAAmC;EAAoB;EAAmB;EAAkB;EAC9H,UAAA,oBAAC,KAAc,OAAf;GACE,aAAU;GACV,WAAW,GACT,+mBACA,8BACA,SACF;GAC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,CAAA;AAEL;AAEA,IAAa,4BAA4B,EACvC,WACA,UACA,SACA,OACA,GAAG,YAGC;CACJ,OACE,qBAAC,KAAc,cAAf;EACE,aAAU;EACV,cAAY;EACZ,WAAW,GAAG,eAAe,WAAW,IAAI,GAAG,mDAAmD,SAAS;EAClG;EACT,GAAI;EALN,UAAA,CAOE,oBAAC,QAAD;GAAM,WAAW;GAA4B,aAAU;GACrD,UAAA,oBAAC,KAAc,uBAAf,EAAA,UACE,oBAAC,WAAD,CAAY,CAAA,EACuB,CAAA;EACjC,CAAA,GACL,QACyB;;AAEhC;AAEA,IAAa,0BAA0B,EAAE,GAAG,YAA4C;CACtF,OAAO,oBAAC,KAAc,YAAf;EAA0B,aAAU;EAA4B,GAAI;CAAQ,CAAA;AACrF;AAEA,IAAa,yBAAyB,EACpC,WACA,UACA,OACA,GAAG,YAGC;CACJ,OACE,qBAAC,KAAc,WAAf;EACE,aAAU;EACV,cAAY;EACZ,WAAW,GAAG,eAAe,WAAW,IAAI,GAAG,mDAAmD,SAAS;EAC3G,GAAI;EAJN,UAAA,CAME,oBAAC,QAAD;GAAM,WAAW;GAA4B,aAAU;GACrD,UAAA,oBAAC,KAAc,oBAAf,EAAA,UACE,oBAAC,WAAD,CAAY,CAAA,EACoB,CAAA;EAC9B,CAAA,GACL,QACsB;;AAE7B;AAEA,IAAa,yBAAyB,EAAE,WAAW,GAAG,YAA2C;CAC/F,OAAO,oBAAC,KAAc,WAAf;EAAyB,aAAU;EAA0B,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;CAAQ,CAAA;AACzI;AAEA,IAAa,wBAAwB,EAAE,WAAW,GAAG,YAA0C;CAC7F,OACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GAAG,+GAA+G,SAAS;EACtI,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"dropdown-menu.js","names":[],"sources":["../../../../../../../ui/src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { Menu as MenuPrimitive } from '@base-ui/react/menu';\nimport { useExposedFocusGuards } from '@edyn/ui/lib/focus-guards';\nimport {\n POPUP_FRAME_CLASS,\n POPUP_GROUP_LABEL_CLASS,\n POPUP_ITEM_INDICATOR_CLASS,\n POPUP_LIST_HEIGHT_CLASS,\n POPUP_LIST_WIDTH_CLASS,\n popupItemClass,\n} from '@edyn/ui/lib/popup-list';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck, IconChevronRight } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport { ScrollArea } from '../scroll-area';\n\nexport const DropdownMenu = ({ ...props }: MenuPrimitive.Root.Props) => {\n return <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n};\n\nexport const DropdownMenuPortal = ({ ...props }: MenuPrimitive.Portal.Props) => {\n return <MenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n};\n\nexport const DropdownMenuTrigger = ({ ...props }: MenuPrimitive.Trigger.Props) => {\n return <MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n};\n\n/**\n * Scrolls inside a DS ScrollArea like the other popup lists, with the bar shown\n * for as long as the menu overflows and a fade on whichever end is cut off.\n *\n * Base UI puts `role=\"menu\"` on this popup itself and offers no inner list part\n * to move it onto, so the ScrollArea sits INSIDE the role. That is only legal\n * because ScrollArea drops the `role=\"presentation\"` Base UI gives its root,\n * viewport and content: a menu may not own presentation wrappers (axe reports\n * a critical aria-required-children violation), but it may own plain divs.\n * e2e/a11y.spec.ts scans the open menu in both themes to keep it that way.\n */\nexport const DropdownMenuContent = ({\n align = 'start',\n alignOffset = 0,\n side = 'bottom',\n sideOffset = 4,\n className,\n children,\n ...props\n}: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) => {\n useExposedFocusGuards();\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.Positioner className=\"isolate z-50 outline-none\" align={align} alignOffset={alignOffset} side={side} sideOffset={sideOffset}>\n <MenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={cn(\n 'z-50 flex max-h-(--available-height) origin-(--transform-origin) flex-col overflow-hidden duration-100',\n POPUP_FRAME_CLASS,\n POPUP_LIST_WIDTH_CLASS,\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95',\n 'motion-reduce:animate-none',\n className,\n )}\n {...props}\n >\n {/* POPUP_LIST_HEIGHT_CLASS caps the element that scrolls at eight rows, or at the whole rows the\n positioner's measured height allows; the padding sits on the content so the cap counts it. */}\n <ScrollArea type=\"always\" fade focusable={false} className={POPUP_LIST_HEIGHT_CLASS} viewportClassName=\"scroll-py-1\">\n <div className=\"p-1\">{children}</div>\n </ScrollArea>\n </MenuPrimitive.Popup>\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n );\n};\n\nexport const DropdownMenuGroup = ({ ...props }: MenuPrimitive.Group.Props) => {\n return <MenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n};\n\nexport const DropdownMenuLabel = ({\n className,\n inset,\n ...props\n}: MenuPrimitive.GroupLabel.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(POPUP_GROUP_LABEL_CLASS, 'data-[inset=true]:pl-7', className)}\n {...props}\n />\n );\n};\n\nexport const DropdownMenuItem = ({\n className,\n inset,\n variant = 'default',\n ...props\n}: MenuPrimitive.Item.Props & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) => {\n return (\n <MenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/dropdown-menu-item',\n popupItemClass(),\n 'data-[inset=true]:pl-7',\n // A destructive item keeps its own colour, and its own highlight with it:\n // the shared translucent one would make it read like any other item.\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:[&>svg]:text-destructive',\n 'data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const DropdownMenuSub = ({ ...props }: MenuPrimitive.SubmenuRoot.Props) => {\n return <MenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />;\n};\n\nexport const DropdownMenuSubTrigger = ({\n className,\n inset,\n children,\n ...props\n}: MenuPrimitive.SubmenuTrigger.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n popupItemClass(),\n // An open submenu holds its trigger in the highlight while the pointer is\n // down in its panel.\n 'data-[inset=true]:pl-7 data-popup-open:bg-foreground/6 data-popup-open:[&>svg]:text-foreground',\n className,\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto\" />\n </MenuPrimitive.SubmenuTrigger>\n );\n};\n\nexport const DropdownMenuSubContent = ({\n align = 'start',\n alignOffset = -3,\n side = 'right',\n sideOffset = 0,\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuContent>) => {\n return (\n <DropdownMenuContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn('shadow-lg', className)}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n {...props}\n />\n );\n};\n\nexport const DropdownMenuCheckboxItem = ({\n className,\n children,\n checked,\n inset,\n ...props\n}: MenuPrimitive.CheckboxItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={cn(popupItemClass('base-ui', true), 'data-checked:font-medium data-[inset=true]:pl-7', className)}\n checked={checked}\n {...props}\n >\n <span className={POPUP_ITEM_INDICATOR_CLASS} data-slot=\"dropdown-menu-checkbox-item-indicator\">\n <MenuPrimitive.CheckboxItemIndicator>\n <IconCheck />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n );\n};\n\nexport const DropdownMenuRadioGroup = ({ ...props }: MenuPrimitive.RadioGroup.Props) => {\n return <MenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n};\n\nexport const DropdownMenuRadioItem = ({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={cn(popupItemClass('base-ui', true), 'data-checked:font-medium data-[inset=true]:pl-7', className)}\n {...props}\n >\n <span className={POPUP_ITEM_INDICATOR_CLASS} data-slot=\"dropdown-menu-radio-item-indicator\">\n <MenuPrimitive.RadioItemIndicator>\n <IconCheck />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n );\n};\n\nexport const DropdownMenuSeparator = ({ className, ...props }: MenuPrimitive.Separator.Props) => {\n return <MenuPrimitive.Separator data-slot=\"dropdown-menu-separator\" className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />;\n};\n\nexport const DropdownMenuShortcut = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground', className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;AAeA,IAAa,gBAAgB,EAAE,GAAG,YAAsC;CACtE,OAAO,oBAAC,KAAc,MAAf;EAAoB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACnE;AAEA,IAAa,sBAAsB,EAAE,GAAG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AW;GAA4B,aAAU;GACrD,UAAA,oBAAC,KAAc,oBAAf,EAAA,UACE,oBAAC,WAAD,CAAY,CAAA,EACoB,CAAA;EAC9B,CAAA,GACL,QACsB;;AAE7B;AAEA,IAAa,yBAAyB,EAAE,WAAW,GAAG,YAA2C;CAC/F,OAAO,oBAAC,KAAc,WAAf;EAAyB,aAAU;EAA0B,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;CAAQ,CAAA;AACzI;AAEA,IAAa,wBAAwB,EAAE,WAAW,GAAG,YAA0C;CAC7F,OACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GAAG,+GAA+G,SAAS;EACtI,GAAI;CACL,CAAA;AAEL"}
@@ -44,7 +44,7 @@ var MenubarContent = ({ className, align = "start", alignOffset = -4, sideOffset
44
44
  align,
45
45
  alignOffset,
46
46
  sideOffset,
47
- className: cn("min-w-36 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95", "motion-reduce:animate-none", className),
47
+ className,
48
48
  ...props
49
49
  });
50
50
  };
@@ -1 +1 @@
1
- {"version":3,"file":"menubar.js","names":[],"sources":["../../../../../../../ui/src/components/ui/menubar/menubar.tsx"],"sourcesContent":["'use client';\n\nimport { Menu as MenuPrimitive } from '@base-ui/react/menu';\nimport { Menubar as MenubarPrimitive } from '@base-ui/react/menubar';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from '../dropdown-menu';\n\nexport const Menubar = ({ className, ...props }: MenubarPrimitive.Props) => {\n return <MenubarPrimitive data-slot=\"menubar\" className={cn('flex h-8 items-center gap-0.5 rounded-lg border p-[3px]', className)} {...props} />;\n};\n\nexport const MenubarMenu = ({ ...props }: React.ComponentProps<typeof DropdownMenu>) => {\n return <DropdownMenu data-slot=\"menubar-menu\" {...props} />;\n};\n\nexport const MenubarGroup = ({ ...props }: React.ComponentProps<typeof DropdownMenuGroup>) => {\n return <DropdownMenuGroup data-slot=\"menubar-group\" {...props} />;\n};\n\nexport const MenubarPortal = ({ ...props }: React.ComponentProps<typeof DropdownMenuPortal>) => {\n return <DropdownMenuPortal data-slot=\"menubar-portal\" {...props} />;\n};\n\nexport const MenubarTrigger = ({ className, ...props }: React.ComponentProps<typeof DropdownMenuTrigger>) => {\n return (\n <DropdownMenuTrigger\n data-slot=\"menubar-trigger\"\n className={cn(\n 'flex items-center rounded-sm px-1.5 py-[2px] text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const MenubarContent = ({\n className,\n align = 'start',\n alignOffset = -4,\n sideOffset = 8,\n ...props\n}: React.ComponentProps<typeof DropdownMenuContent>) => {\n return (\n <DropdownMenuContent\n data-slot=\"menubar-content\"\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n 'min-w-36 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95',\n 'motion-reduce:animate-none',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const MenubarItem = ({ className, inset, variant = 'default', ...props }: React.ComponentProps<typeof DropdownMenuItem>) => {\n return (\n <DropdownMenuItem\n data-slot=\"menubar-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/menubar-item gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[inset=true]:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!\",\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const MenubarCheckboxItem = ({\n className,\n children,\n checked,\n inset,\n ...props\n}: MenuPrimitive.CheckboxItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"menubar-checkbox-item\"\n data-inset={inset}\n className={cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-[inset=true]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4\">\n <MenuPrimitive.CheckboxItemIndicator>\n <IconCheck />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n );\n};\n\nexport const MenubarRadioGroup = ({ ...props }: React.ComponentProps<typeof DropdownMenuRadioGroup>) => {\n return <DropdownMenuRadioGroup data-slot=\"menubar-radio-group\" {...props} />;\n};\n\nexport const MenubarRadioItem = ({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"menubar-radio-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-[inset=true]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4\">\n <MenuPrimitive.RadioItemIndicator>\n <IconCheck />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n );\n};\n\nexport const MenubarLabel = ({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuLabel> & {\n inset?: boolean;\n}) => {\n return (\n <DropdownMenuLabel\n data-slot=\"menubar-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-sm font-medium data-[inset=true]:pl-7', className)}\n {...props}\n />\n );\n};\n\nexport const MenubarSeparator = ({ className, ...props }: React.ComponentProps<typeof DropdownMenuSeparator>) => {\n return <DropdownMenuSeparator data-slot=\"menubar-separator\" className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />;\n};\n\nexport const MenubarShortcut = ({ className, ...props }: React.ComponentProps<typeof DropdownMenuShortcut>) => {\n return (\n <DropdownMenuShortcut\n data-slot=\"menubar-shortcut\"\n className={cn('ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground', className)}\n {...props}\n />\n );\n};\n\nexport const MenubarSub = ({ ...props }: React.ComponentProps<typeof DropdownMenuSub>) => {\n return <DropdownMenuSub data-slot=\"menubar-sub\" {...props} />;\n};\n\nexport const MenubarSubTrigger = ({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuSubTrigger> & {\n inset?: boolean;\n}) => {\n return (\n <DropdownMenuSubTrigger\n data-slot=\"menubar-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const MenubarSubContent = ({ className, ...props }: React.ComponentProps<typeof DropdownMenuSubContent>) => {\n return (\n <DropdownMenuSubContent\n data-slot=\"menubar-sub-content\"\n className={cn(\n 'min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'motion-reduce:animate-none',\n className,\n )}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;AAuBA,IAAa,aAAW,EAAE,WAAW,GAAG,YAAoC;CAC1E,OAAO,oBAAC,SAAD;EAAkB,aAAU;EAAU,WAAW,GAAG,2DAA2D,SAAS;EAAG,GAAI;CAAQ,CAAA;AAChJ;AAEA,IAAa,eAAe,EAAE,GAAG,YAAuD;CACtF,OAAO,oBAAC,cAAD;EAAc,aAAU;EAAe,GAAI;CAAQ,CAAA;AAC5D;AAEA,IAAa,gBAAgB,EAAE,GAAG,YAA4D;CAC5F,OAAO,oBAAC,mBAAD;EAAmB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AAClE;AAEA,IAAa,iBAAiB,EAAE,GAAG,YAA6D;CAC9F,OAAO,oBAAC,oBAAD;EAAoB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACpE;AAEA,IAAa,kBAAkB,EAAE,WAAW,GAAG,YAA8D;CAC3G,OACE,oBAAC,qBAAD;EACE,aAAU;EAC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ACZ,WAAW,GAAG,0DAA0D,SAAS;EACjF,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,oBAAoB,EAAE,WAAW,GAAG,YAAgE;CAC/G,OAAO,oBAAC,uBAAD;EAAuB,aAAU;EAAoB,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;CAAQ,CAAA;AACjI;AAEA,IAAa,mBAAmB,EAAE,WAAW,GAAG,YAA+D;CAC7G,OACE,oBAAC,sBAAD;EACE,aAAU;EACV,WAAW,GAAG,yGAAyG,SAAS;EAChI,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,cAAc,EAAE,GAAG,YAA0D;CACxF,OAAO,oBAAC,iBAAD;EAAiB,aAAU;EAAc,GAAI;CAAQ,CAAA;AAC9D;AAEA,IAAa,qBAAqB,EAChC,WACA,OACA,GAAG,YAGC;CACJ,OACE,oBAAC,wBAAD;EACE,aAAU;EACV,cAAY;EACZ,WAAW,GACT,wMACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,qBAAqB,EAAE,WAAW,GAAG,YAAiE;CACjH,OACE,oBAAC,wBAAD;EACE,aAAU;EACV,WAAW,GACT,gZACA,8BACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"menubar.js","names":[],"sources":["../../../../../../../ui/src/components/ui/menubar/menubar.tsx"],"sourcesContent":["'use client';\n\nimport { Menu as MenuPrimitive } from '@base-ui/react/menu';\nimport { Menubar as MenubarPrimitive } from '@base-ui/react/menubar';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconCheck } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from '../dropdown-menu';\n\nexport const Menubar = ({ className, ...props }: MenubarPrimitive.Props) => {\n return <MenubarPrimitive data-slot=\"menubar\" className={cn('flex h-8 items-center gap-0.5 rounded-lg border p-[3px]', className)} {...props} />;\n};\n\nexport const MenubarMenu = ({ ...props }: React.ComponentProps<typeof DropdownMenu>) => {\n return <DropdownMenu data-slot=\"menubar-menu\" {...props} />;\n};\n\nexport const MenubarGroup = ({ ...props }: React.ComponentProps<typeof DropdownMenuGroup>) => {\n return <DropdownMenuGroup data-slot=\"menubar-group\" {...props} />;\n};\n\nexport const MenubarPortal = ({ ...props }: React.ComponentProps<typeof DropdownMenuPortal>) => {\n return <DropdownMenuPortal data-slot=\"menubar-portal\" {...props} />;\n};\n\nexport const MenubarTrigger = ({ className, ...props }: React.ComponentProps<typeof DropdownMenuTrigger>) => {\n return (\n <DropdownMenuTrigger\n data-slot=\"menubar-trigger\"\n className={cn(\n 'flex items-center rounded-sm px-1.5 py-[2px] text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const MenubarContent = ({\n className,\n align = 'start',\n alignOffset = -4,\n sideOffset = 8,\n ...props\n}: React.ComponentProps<typeof DropdownMenuContent>) => {\n return (\n <DropdownMenuContent\n data-slot=\"menubar-content\"\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={className}\n {...props}\n />\n );\n};\n\nexport const MenubarItem = ({ className, inset, variant = 'default', ...props }: React.ComponentProps<typeof DropdownMenuItem>) => {\n return (\n <DropdownMenuItem\n data-slot=\"menubar-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/menubar-item gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[inset=true]:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!\",\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const MenubarCheckboxItem = ({\n className,\n children,\n checked,\n inset,\n ...props\n}: MenuPrimitive.CheckboxItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"menubar-checkbox-item\"\n data-inset={inset}\n className={cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-[inset=true]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4\">\n <MenuPrimitive.CheckboxItemIndicator>\n <IconCheck />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n );\n};\n\nexport const MenubarRadioGroup = ({ ...props }: React.ComponentProps<typeof DropdownMenuRadioGroup>) => {\n return <DropdownMenuRadioGroup data-slot=\"menubar-radio-group\" {...props} />;\n};\n\nexport const MenubarRadioItem = ({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean;\n}) => {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"menubar-radio-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-[inset=true]:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4\">\n <MenuPrimitive.RadioItemIndicator>\n <IconCheck />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n );\n};\n\nexport const MenubarLabel = ({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuLabel> & {\n inset?: boolean;\n}) => {\n return (\n <DropdownMenuLabel\n data-slot=\"menubar-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-sm font-medium data-[inset=true]:pl-7', className)}\n {...props}\n />\n );\n};\n\nexport const MenubarSeparator = ({ className, ...props }: React.ComponentProps<typeof DropdownMenuSeparator>) => {\n return <DropdownMenuSeparator data-slot=\"menubar-separator\" className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />;\n};\n\nexport const MenubarShortcut = ({ className, ...props }: React.ComponentProps<typeof DropdownMenuShortcut>) => {\n return (\n <DropdownMenuShortcut\n data-slot=\"menubar-shortcut\"\n className={cn('ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground', className)}\n {...props}\n />\n );\n};\n\nexport const MenubarSub = ({ ...props }: React.ComponentProps<typeof DropdownMenuSub>) => {\n return <DropdownMenuSub data-slot=\"menubar-sub\" {...props} />;\n};\n\nexport const MenubarSubTrigger = ({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuSubTrigger> & {\n inset?: boolean;\n}) => {\n return (\n <DropdownMenuSubTrigger\n data-slot=\"menubar-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground data-[inset=true]:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const MenubarSubContent = ({ className, ...props }: React.ComponentProps<typeof DropdownMenuSubContent>) => {\n return (\n <DropdownMenuSubContent\n data-slot=\"menubar-sub-content\"\n className={cn(\n 'min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'motion-reduce:animate-none',\n className,\n )}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;AAuBA,IAAa,aAAW,EAAE,WAAW,GAAG,YAAoC;CAC1E,OAAO,oBAAC,SAAD;EAAkB,aAAU;EAAU,WAAW,GAAG,2DAA2D,SAAS;EAAG,GAAI;CAAQ,CAAA;AAChJ;AAEA,IAAa,eAAe,EAAE,GAAG,YAAuD;CACtF,OAAO,oBAAC,cAAD;EAAc,aAAU;EAAe,GAAI;CAAQ,CAAA;AAC5D;AAEA,IAAa,gBAAgB,EAAE,GAAG,YAA4D;CAC5F,OAAO,oBAAC,mBAAD;EAAmB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AAClE;AAEA,IAAa,iBAAiB,EAAE,GAAG,YAA6D;CAC9F,OAAO,oBAAC,oBAAD;EAAoB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACpE;AAEA,IAAa,kBAAkB,EAAE,WAAW,GAAG,YAA8D;CAC3G,OACE,oBAAC,qBAAD;EACE,aAAU;EACV,WAAW,GACT,qIACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,kBAAkB,EAC7B,WACA,QAAQ,SACR,cAAc,IACd,aAAa,GACb,GAAG,YACmD;CACtD,OACE,oBAAC,qBAAD;EACE,aAAU;EACH;EACM;EACD;EACD;EACX,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,eAAe,EAAE,WAAW,OAAO,UAAU,WAAW,GAAG,YAA2D;CACjI,OACE,oBAAC,kBAAD;EACE,aAAU;EACV,cAAY;EACZ,gBAAc;EACd,WAAW,GACT,4fACA,SACF;EACA,GAAI;CACL,CAAA;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iBAAD;EAAiB,aAAU;EAAc,GAAI;CAAQ,CAAA;AAC9D;AAEA,IAAa,qBAAqB,EAChC,WACA,OACA,GAAG,YAGC;CACJ,OACE,oBAAC,wBAAD;EACE,aAAU;EACV,cAAY;EACZ,WAAW,GACT,wMACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,qBAAqB,EAAE,WAAW,GAAG,YAAiE;CACjH,OACE,oBAAC,wBAAD;EACE,aAAU;EACV,WAAW,GACT,gZACA,8BACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -103,7 +103,7 @@ var ScrollArea$1 = ({ className, children, orientation = "vertical", type = "hov
103
103
  "data-scroll-restoration-id": scrollRestorationId,
104
104
  ...NO_ROLE,
105
105
  ...focusable ? null : NO_TAB_STOP,
106
- className: cn("max-h-inherit w-full rounded-[inherit]", orientation === "vertical" && "overflow-x-hidden!", orientation === "horizontal" && "overflow-y-hidden!", viewportClassName ?? viewPortClassName),
106
+ className: cn("max-h-inherit w-full rounded-[inherit]", orientation === "vertical" && "overflow-x-hidden!", orientation === "horizontal" && "overflow-y-hidden!", orientation !== "vertical" && "data-has-overflow-x:pb-(--scroll-bar-reserve)", viewportClassName ?? viewPortClassName),
107
107
  children: /* @__PURE__ */ jsx(ScrollArea.Content, {
108
108
  ...NO_ROLE,
109
109
  style: orientation === "vertical" ? { minWidth: 0 } : void 0,
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-area.js","names":[],"sources":["../../../../../../../ui/src/components/ui/scroll-area/scroll-area.tsx"],"sourcesContent":["import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area';\nimport { useMergedRefs } from '@edyn/ui/hooks/use-merged-refs';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { type ComponentProps, type RefObject, useEffect, useRef } from 'react';\n\n/**\n * When the bar shows: 'hover' on area hover or while scrolling (default),\n * 'scroll' only while scrolling, 'always' permanent. In every mode the bar is\n * mounted only while that axis actually overflows, so 'always' means \"always\n * when there is something to scroll\", never a bar on a list that fits.\n */\nexport type TScrollbarVisibility = 'hover' | 'scroll' | 'always';\n\n/**\n * Surface the edge fades blended into, back when they were painted.\n *\n * @deprecated The fades are cut into the content by a mask, so they match any\n * surface without being told which one. Still accepted, and ignored.\n */\nexport type TScrollAreaFadeFrom = 'card' | 'background' | 'sidebar' | 'popover';\n\nexport interface IScrollBarProps extends ComponentProps<typeof BaseScrollArea.Scrollbar> {\n visibility?: TScrollbarVisibility;\n}\n\nexport const ScrollBar = ({ className, orientation = 'vertical', visibility = 'hover', ...props }: IScrollBarProps) => {\n return (\n <BaseScrollArea.Scrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={cn(\n 'peer/scrollbar z-100 flex touch-none select-none motion-safe:transition-opacity motion-safe:duration-150',\n // Size, gap and start read --scroll-bar-size, --scroll-bar-gap and --scroll-bar-start (see scroll-bar.css), whose\n // defaults are the 8px bar flush with the box that it has always been.\n orientation === 'vertical' &&\n 'h-(--scroll-bar-length) w-(--scroll-bar-size) me-(--scroll-bar-gap) mt-(--scroll-bar-offset-top) border-l border-l-transparent p-px',\n orientation === 'horizontal' &&\n 'h-(--scroll-bar-size) ms-(--scroll-bar-gap) me-(--scroll-bar-gap) mb-(--scroll-bar-gap) flex-col border-t border-t-transparent p-px',\n visibility !== 'always' && 'opacity-0 data-scrolling:opacity-100',\n visibility === 'hover' && 'data-hovering:opacity-100 group-hover/scroll-area:opacity-100',\n className,\n )}\n {...props}\n >\n <BaseScrollArea.Thumb className=\"relative flex-1 rounded-full bg-muted-foreground/50 transition-colors hover:bg-muted-foreground/70 data-scrolling:bg-muted-foreground/70\" />\n </BaseScrollArea.Scrollbar>\n );\n};\n\nexport interface IScrollAreaProps extends ComponentProps<typeof BaseScrollArea.Root> {\n /** Which axes get a styled scrollbar; content decides what actually overflows. */\n orientation?: 'horizontal' | 'vertical' | 'both';\n /** Scrollbar reveal behavior (mirrors the Radix ScrollArea `type` prop). */\n type?: TScrollbarVisibility;\n /** Edge fades hinting at clipped content; each one shows only while its own edge hides something. */\n fade?: boolean;\n /**\n * @deprecated No longer read. The fades mask the content, so they sit correctly\n * on any surface; passing this does nothing and is safe to delete.\n */\n fadeFrom?: TScrollAreaFadeFrom;\n /** Places both bars, for a host that gives them a gutter of their own (a sidebar menu). */\n scrollbarClassName?: string;\n viewportId?: string;\n /** Access to the scrollable viewport (e.g. to reset scroll position on route changes). */\n viewportRef?: RefObject<HTMLDivElement | null>;\n viewportClassName?: string;\n /** Published on the viewport as data-scroll-restoration-id, for a router that restores scroll position. */\n scrollRestorationId?: string;\n /**\n * Whether the viewport is a tab stop of its own (default). Turn it off inside a\n * widget that already owns focus, a menu above all: its items are the tab\n * stops, and a focusable wrapper between the role and its items is both\n * redundant and an aria-required-children violation.\n */\n focusable?: boolean;\n /** @deprecated Use `viewportId`. */\n viewPortId?: string;\n /** @deprecated Use `viewportRef`. */\n viewPortRef?: RefObject<HTMLDivElement | null>;\n /** @deprecated Use `viewportClassName`. */\n viewPortClassName?: string;\n /** Places the vertical bar only; `scrollbarClassName` covers both. */\n scrollVerticalClassName?: string;\n /** Places the horizontal bar only; `scrollbarClassName` covers both. */\n scrollHorizontalClassName?: string;\n}\n\n/**\n * Which axes fade, published for scroll-fade.css to key its mask off. The\n * stylesheet reaches this element's own viewport through a child combinator, so a\n * ScrollArea nested in another one cannot pick up its ancestor's edges.\n */\n/**\n * Base UI gives the root, the viewport and the content `role=\"presentation\"`. On\n * a div that changes nothing for a screen reader, but it is an EXPLICIT role, and\n * axe treats explicit presentation children as foreign to a parent that owns\n * required children. A ScrollArea inside `role=\"menu\"` or `role=\"listbox\"` then\n * fails as a critical aria-required-children violation, while the same div with\n * no role passes straight through. Clearing it is what makes a ScrollArea legal\n * in a popup list. A spread because the literal `role={undefined}` is flagged by\n * the a11y lint rule, which cannot tell it from an invalid role.\n */\nconst NO_ROLE = { role: undefined } as const;\n\n/** Base UI makes the viewport a tab stop (0, or -1 with nothing to scroll); undefined takes that away. */\nconst NO_TAB_STOP = { tabIndex: undefined } as const;\n\nconst FADE_AXIS = {\n vertical: 'block',\n horizontal: 'inline',\n both: 'both',\n} as const;\n\n/**\n * Themed scroll container (Base UI): overflowing content scrolls INSIDE the component\n * with a slim overlay scrollbar instead of exposing a native browser scrollbar. House\n * rule: wide/tall content (tables, lists, code) always goes through this, never a bare\n * overflow-* utility.\n *\n * Cap the height with a plain class on the component itself, e.g.\n * `<ScrollArea className=\"max-h-88\">`. The viewport picks the cap up through\n * `max-h-inherit`, which matters because the viewport is the element that actually\n * scrolls: a cap that lands only on the root leaves tall content spilling out\n * underneath with no scrollbar, and that reads as a working height right up until the\n * content outgrows it.\n *\n * `fade` fades out each edge that is currently hiding content, rather than always\n * fading one: a permanent fade is a lie half the time, dimming the last row that fits\n * and promising more below when the reader is already at the end. It is cut into the\n * content by a mask (@edyn/theme/scroll-fade.css), so it needs no surface colour and\n * reads correctly over a tint, a gradient or a glow. A host that keeps something\n * unscrolled at the top, such as a sticky table header, exempts that band by setting\n * --scroll-fade-offset on the ScrollArea. The static faded-* utilities in\n * @edyn/theme/utilities.css are the other tool, for DECORATIVE edges that do not\n * track scroll position.\n *\n * The viewport publishes its size as --scroll-area-width/--scroll-area-height CSS vars\n * so children can size against the visible area.\n */\nexport const ScrollArea = ({\n className,\n children,\n orientation = 'vertical',\n type = 'hover',\n fade = false,\n fadeFrom = 'card',\n scrollbarClassName,\n viewportId,\n viewportRef,\n viewportClassName,\n scrollRestorationId,\n focusable = true,\n viewPortId,\n viewPortRef,\n viewPortClassName,\n scrollVerticalClassName,\n scrollHorizontalClassName,\n ...props\n}: IScrollAreaProps) => {\n const refInner = useRef<HTMLDivElement | null>(null);\n // The viewPort* spellings are the pre-rc.4 names, kept so existing callers\n // keep working; the viewport* ones match the rest of the ecosystem.\n const refsViewport = useMergedRefs(refInner, viewportRef ?? viewPortRef);\n\n useEffect(() => {\n const el = refInner.current;\n if (!el) {\n return;\n }\n const observer = new ResizeObserver(() => {\n el.style.setProperty('--scroll-area-width', `${el.clientWidth}px`);\n el.style.setProperty('--scroll-area-height', `${el.clientHeight}px`);\n });\n observer.observe(el);\n return () => {\n observer.disconnect();\n };\n }, []);\n\n return (\n <BaseScrollArea.Root\n data-slot=\"scroll-area\"\n // Everything inside clips at this box, so a focus ring drawn outside an\n // element at the edge would be cut off; see @edyn/theme/focus.css.\n data-focus=\"inset\"\n // The single-row grid is load-bearing rather than tidying. `h-full` on the viewport\n // cannot be trusted to size it: a percentage height only resolves against a definite\n // containing block, and a host that sizes this by flex inside a max-height column\n // (`min-h-0 flex-1`) is not definite, so the viewport fell back to auto and grew to\n // its content instead of scrolling. A grid item stretches to its track, and the track\n // is sized from the root's used height, which flex has already settled. `grid-rows-1`\n // is `repeat(1, minmax(0, 1fr))`: one track that may shrink below its content.\n className={cn('group/scroll-area relative grid min-w-0 grid-rows-1 overflow-hidden', className)}\n data-fade={fade ? FADE_AXIS[orientation] : undefined}\n {...NO_ROLE}\n {...props}\n >\n {(orientation === 'vertical' || orientation === 'both') && (\n <ScrollBar orientation=\"vertical\" visibility={type} className={cn(scrollbarClassName, scrollVerticalClassName)} />\n )}\n {(orientation === 'horizontal' || orientation === 'both') && (\n <ScrollBar orientation=\"horizontal\" visibility={type} className={cn(scrollbarClassName, scrollHorizontalClassName)} />\n )}\n <BaseScrollArea.Corner />\n <BaseScrollArea.Viewport\n data-slot=\"scroll-area-viewport\"\n id={viewportId ?? viewPortId}\n ref={refsViewport}\n data-scroll-restoration-id={scrollRestorationId}\n {...NO_ROLE}\n {...(focusable ? null : NO_TAB_STOP)}\n // One axis means one axis. Base UI leaves both axes scrollable, so a\n // vertical list could still be dragged sideways, and anything that put a\n // row in view (focus moving, scrollIntoView with inline: nearest) slid\n // the whole list across. The clamp is marked important because Base UI\n // sets the viewport's overflow itself.\n className={cn(\n 'max-h-inherit w-full rounded-[inherit]',\n orientation === 'vertical' && 'overflow-x-hidden!',\n orientation === 'horizontal' && 'overflow-y-hidden!',\n viewportClassName ?? viewPortClassName,\n )}\n >\n {/* Content is NOT optional: it carries the ResizeObserver that recomputes the\n thumb when the CONTENT resizes without the viewport resizing (e.g. a route\n swap to a shorter page). Without it the thumb keeps the previous page's\n geometry and a fully-visible page still shows a scrollbar.\n\n A vertical scroller also pins its content to the viewport's width, so a\n long label truncates instead of widening the list and inventing a\n horizontal scroll. Base UI sets min-width: fit-content inline, which is\n what makes that happen and why this is an inline style too. */}\n <BaseScrollArea.Content {...NO_ROLE} style={orientation === 'vertical' ? { minWidth: 0 } : undefined}>\n {children}\n </BaseScrollArea.Content>\n </BaseScrollArea.Viewport>\n </BaseScrollArea.Root>\n );\n};\n"],"mappings":";;;;;;AAyBA,IAAa,aAAa,EAAE,WAAW,cAAc,YAAY,aAAa,SAAS,GAAG,YAA6B;CACrH,OACE,oBAAC,WAAe,WAAhB;EACE,aAAU;EACG;EACb,WAAW,GACT,4GAGA,gBAAgB,cACd,uIACF,gBAAgB,gBACd,uIACF,eAAe,YAAY,wCAC3B,eAAe,WAAW,iEAC1B,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,WAAe,OAAhB,EAAsB,WAAU,2IAA4I,CAAA;CACpJ,CAAA;AAE9B;;;;;;;;;;;;;;;;AAwDA,IAAM,UAAU,EAAE,MAAM,KAAA,EAAU;;AAGlC,IAAM,cAAc,EAAE,UAAU,KAAA,EAAU;AAE1C,IAAM,YAAY;CAChB,UAAU;CACV,YAAY;CACZ,MAAM;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAa,gBAAc,EACzB,WACA,UACA,cAAc,YACd,OAAO,SACP,OAAO,OACP,WAAW,QACX,oBACA,YACA,aACA,mBACA,qBACA,YAAY,MACZ,YACA,aACA,mBACA,yBACA,2BACA,GAAG,YACmB;CACtB,MAAM,WAAW,OAA8B,IAAI;CAGnD,MAAM,eAAe,cAAc,UAAU,eAAe,WAAW;CAEvE,gBAAgB;EACd,MAAM,KAAK,SAAS;EACpB,IAAI,CAAC,IACH;EAEF,MAAM,WAAW,IAAI,qBAAqB;GACxC,GAAG,MAAM,YAAY,uBAAuB,GAAG,GAAG,YAAY,GAAG;GACjE,GAAG,MAAM,YAAY,wBAAwB,GAAG,GAAG,aAAa,GAAG;EACrE,CAAC;EACD,SAAS,QAAQ,EAAE;EACnB,aAAa;GACX,SAAS,WAAW;EACtB;CACF,GAAG,CAAC,CAAC;CAEL,OACE,qBAAC,WAAe,MAAhB;EACE,aAAU;EAGV,cAAW;EAQX,WAAW,GAAG,uEAAuE,SAAS;EAC9F,aAAW,OAAO,UAAU,eAAe,KAAA;EAC3C,GAAI;EACJ,GAAI;EAfN,UAAA;IAiBI,gBAAgB,cAAc,gBAAgB,WAC9C,oBAAC,WAAD;IAAW,aAAY;IAAW,YAAY;IAAM,WAAW,GAAG,oBAAoB,uBAAuB;GAAI,CAAA;IAEjH,gBAAgB,gBAAgB,gBAAgB,WAChD,oBAAC,WAAD;IAAW,aAAY;IAAa,YAAY;IAAM,WAAW,GAAG,oBAAoB,yBAAyB;GAAI,CAAA;GAEvH,oBAAC,WAAe,QAAhB,CAAwB,CAAA;GACxB,oBAAC,WAAe,UAAhB;IACE,aAAU;IACV,IAAI,cAAc;IAClB,KAAK;IACL,8BAA4B;IAC5B,GAAI;IACJ,GAAK,YAAY,OAAO;IAMxB,WAAW,GACT,0CACA,gBAAgB,cAAc,sBAC9B,gBAAgB,gBAAgB,sBAChC,qBAAqB,iBACvB;IAWA,UAAA,oBAAC,WAAe,SAAhB;KAAwB,GAAI;KAAS,OAAO,gBAAgB,aAAa,EAAE,UAAU,EAAE,IAAI,KAAA;KACxF;IACqB,CAAA;GACD,CAAA;EACN;;AAEzB"}
1
+ {"version":3,"file":"scroll-area.js","names":[],"sources":["../../../../../../../ui/src/components/ui/scroll-area/scroll-area.tsx"],"sourcesContent":["import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area';\nimport { useMergedRefs } from '@edyn/ui/hooks/use-merged-refs';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { type ComponentProps, type RefObject, useEffect, useRef } from 'react';\n\n/**\n * When the bar shows: 'hover' on area hover or while scrolling (default),\n * 'scroll' only while scrolling, 'always' permanent. In every mode the bar is\n * mounted only while that axis actually overflows, so 'always' means \"always\n * when there is something to scroll\", never a bar on a list that fits.\n */\nexport type TScrollbarVisibility = 'hover' | 'scroll' | 'always';\n\n/**\n * Surface the edge fades blended into, back when they were painted.\n *\n * @deprecated The fades are cut into the content by a mask, so they match any\n * surface without being told which one. Still accepted, and ignored.\n */\nexport type TScrollAreaFadeFrom = 'card' | 'background' | 'sidebar' | 'popover';\n\nexport interface IScrollBarProps extends ComponentProps<typeof BaseScrollArea.Scrollbar> {\n visibility?: TScrollbarVisibility;\n}\n\nexport const ScrollBar = ({ className, orientation = 'vertical', visibility = 'hover', ...props }: IScrollBarProps) => {\n return (\n <BaseScrollArea.Scrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={cn(\n 'peer/scrollbar z-100 flex touch-none select-none motion-safe:transition-opacity motion-safe:duration-150',\n // Size, gap and start read --scroll-bar-size, --scroll-bar-gap and --scroll-bar-start (see scroll-bar.css), whose\n // defaults are the 8px bar flush with the box that it has always been.\n orientation === 'vertical' &&\n 'h-(--scroll-bar-length) w-(--scroll-bar-size) me-(--scroll-bar-gap) mt-(--scroll-bar-offset-top) border-l border-l-transparent p-px',\n orientation === 'horizontal' &&\n 'h-(--scroll-bar-size) ms-(--scroll-bar-gap) me-(--scroll-bar-gap) mb-(--scroll-bar-gap) flex-col border-t border-t-transparent p-px',\n visibility !== 'always' && 'opacity-0 data-scrolling:opacity-100',\n visibility === 'hover' && 'data-hovering:opacity-100 group-hover/scroll-area:opacity-100',\n className,\n )}\n {...props}\n >\n <BaseScrollArea.Thumb className=\"relative flex-1 rounded-full bg-muted-foreground/50 transition-colors hover:bg-muted-foreground/70 data-scrolling:bg-muted-foreground/70\" />\n </BaseScrollArea.Scrollbar>\n );\n};\n\nexport interface IScrollAreaProps extends ComponentProps<typeof BaseScrollArea.Root> {\n /** Which axes get a styled scrollbar; content decides what actually overflows. */\n orientation?: 'horizontal' | 'vertical' | 'both';\n /** Scrollbar reveal behavior (mirrors the Radix ScrollArea `type` prop). */\n type?: TScrollbarVisibility;\n /** Edge fades hinting at clipped content; each one shows only while its own edge hides something. */\n fade?: boolean;\n /**\n * @deprecated No longer read. The fades mask the content, so they sit correctly\n * on any surface; passing this does nothing and is safe to delete.\n */\n fadeFrom?: TScrollAreaFadeFrom;\n /** Places both bars, for a host that gives them a gutter of their own (a sidebar menu). */\n scrollbarClassName?: string;\n viewportId?: string;\n /** Access to the scrollable viewport (e.g. to reset scroll position on route changes). */\n viewportRef?: RefObject<HTMLDivElement | null>;\n viewportClassName?: string;\n /** Published on the viewport as data-scroll-restoration-id, for a router that restores scroll position. */\n scrollRestorationId?: string;\n /**\n * Whether the viewport is a tab stop of its own (default). Turn it off inside a\n * widget that already owns focus, a menu above all: its items are the tab\n * stops, and a focusable wrapper between the role and its items is both\n * redundant and an aria-required-children violation.\n */\n focusable?: boolean;\n /** @deprecated Use `viewportId`. */\n viewPortId?: string;\n /** @deprecated Use `viewportRef`. */\n viewPortRef?: RefObject<HTMLDivElement | null>;\n /** @deprecated Use `viewportClassName`. */\n viewPortClassName?: string;\n /** Places the vertical bar only; `scrollbarClassName` covers both. */\n scrollVerticalClassName?: string;\n /** Places the horizontal bar only; `scrollbarClassName` covers both. */\n scrollHorizontalClassName?: string;\n}\n\n/**\n * Which axes fade, published for scroll-fade.css to key its mask off. The\n * stylesheet reaches this element's own viewport through a child combinator, so a\n * ScrollArea nested in another one cannot pick up its ancestor's edges.\n */\n/**\n * Base UI gives the root, the viewport and the content `role=\"presentation\"`. On\n * a div that changes nothing for a screen reader, but it is an EXPLICIT role, and\n * axe treats explicit presentation children as foreign to a parent that owns\n * required children. A ScrollArea inside `role=\"menu\"` or `role=\"listbox\"` then\n * fails as a critical aria-required-children violation, while the same div with\n * no role passes straight through. Clearing it is what makes a ScrollArea legal\n * in a popup list. A spread because the literal `role={undefined}` is flagged by\n * the a11y lint rule, which cannot tell it from an invalid role.\n */\nconst NO_ROLE = { role: undefined } as const;\n\n/** Base UI makes the viewport a tab stop (0, or -1 with nothing to scroll); undefined takes that away. */\nconst NO_TAB_STOP = { tabIndex: undefined } as const;\n\nconst FADE_AXIS = {\n vertical: 'block',\n horizontal: 'inline',\n both: 'both',\n} as const;\n\n/**\n * Themed scroll container (Base UI): overflowing content scrolls INSIDE the component\n * with a slim overlay scrollbar instead of exposing a native browser scrollbar. House\n * rule: wide/tall content (tables, lists, code) always goes through this, never a bare\n * overflow-* utility.\n *\n * Cap the height with a plain class on the component itself, e.g.\n * `<ScrollArea className=\"max-h-88\">`. The viewport picks the cap up through\n * `max-h-inherit`, which matters because the viewport is the element that actually\n * scrolls: a cap that lands only on the root leaves tall content spilling out\n * underneath with no scrollbar, and that reads as a working height right up until the\n * content outgrows it.\n *\n * `fade` fades out each edge that is currently hiding content, rather than always\n * fading one: a permanent fade is a lie half the time, dimming the last row that fits\n * and promising more below when the reader is already at the end. It is cut into the\n * content by a mask (@edyn/theme/scroll-fade.css), so it needs no surface colour and\n * reads correctly over a tint, a gradient or a glow. A host that keeps something\n * unscrolled at the top, such as a sticky table header, exempts that band by setting\n * --scroll-fade-offset on the ScrollArea. The static faded-* utilities in\n * @edyn/theme/utilities.css are the other tool, for DECORATIVE edges that do not\n * track scroll position.\n *\n * The viewport publishes its size as --scroll-area-width/--scroll-area-height CSS vars\n * so children can size against the visible area.\n */\nexport const ScrollArea = ({\n className,\n children,\n orientation = 'vertical',\n type = 'hover',\n fade = false,\n fadeFrom = 'card',\n scrollbarClassName,\n viewportId,\n viewportRef,\n viewportClassName,\n scrollRestorationId,\n focusable = true,\n viewPortId,\n viewPortRef,\n viewPortClassName,\n scrollVerticalClassName,\n scrollHorizontalClassName,\n ...props\n}: IScrollAreaProps) => {\n const refInner = useRef<HTMLDivElement | null>(null);\n // The viewPort* spellings are the pre-rc.4 names, kept so existing callers\n // keep working; the viewport* ones match the rest of the ecosystem.\n const refsViewport = useMergedRefs(refInner, viewportRef ?? viewPortRef);\n\n useEffect(() => {\n const el = refInner.current;\n if (!el) {\n return;\n }\n const observer = new ResizeObserver(() => {\n el.style.setProperty('--scroll-area-width', `${el.clientWidth}px`);\n el.style.setProperty('--scroll-area-height', `${el.clientHeight}px`);\n });\n observer.observe(el);\n return () => {\n observer.disconnect();\n };\n }, []);\n\n return (\n <BaseScrollArea.Root\n data-slot=\"scroll-area\"\n // Everything inside clips at this box, so a focus ring drawn outside an\n // element at the edge would be cut off; see @edyn/theme/focus.css.\n data-focus=\"inset\"\n // The single-row grid is load-bearing rather than tidying. `h-full` on the viewport\n // cannot be trusted to size it: a percentage height only resolves against a definite\n // containing block, and a host that sizes this by flex inside a max-height column\n // (`min-h-0 flex-1`) is not definite, so the viewport fell back to auto and grew to\n // its content instead of scrolling. A grid item stretches to its track, and the track\n // is sized from the root's used height, which flex has already settled. `grid-rows-1`\n // is `repeat(1, minmax(0, 1fr))`: one track that may shrink below its content.\n className={cn('group/scroll-area relative grid min-w-0 grid-rows-1 overflow-hidden', className)}\n data-fade={fade ? FADE_AXIS[orientation] : undefined}\n {...NO_ROLE}\n {...props}\n >\n {(orientation === 'vertical' || orientation === 'both') && (\n <ScrollBar orientation=\"vertical\" visibility={type} className={cn(scrollbarClassName, scrollVerticalClassName)} />\n )}\n {(orientation === 'horizontal' || orientation === 'both') && (\n <ScrollBar orientation=\"horizontal\" visibility={type} className={cn(scrollbarClassName, scrollHorizontalClassName)} />\n )}\n <BaseScrollArea.Corner />\n <BaseScrollArea.Viewport\n data-slot=\"scroll-area-viewport\"\n id={viewportId ?? viewPortId}\n ref={refsViewport}\n data-scroll-restoration-id={scrollRestorationId}\n {...NO_ROLE}\n {...(focusable ? null : NO_TAB_STOP)}\n // One axis means one axis. Base UI leaves both axes scrollable, so a\n // vertical list could still be dragged sideways, and anything that put a\n // row in view (focus moving, scrollIntoView with inline: nearest) slid\n // the whole list across. The clamp is marked important because Base UI\n // sets the viewport's overflow itself.\n className={cn(\n 'max-h-inherit w-full rounded-[inherit]',\n orientation === 'vertical' && 'overflow-x-hidden!',\n orientation === 'horizontal' && 'overflow-y-hidden!',\n // The horizontal bar overlays the foot of the viewport, over whatever the last row is. While the content overflows\n // sideways the viewport keeps the bar's height clear below it, so the last row can always be scrolled up out from\n // under the bar (and a short one stands above it).\n orientation !== 'vertical' && 'data-has-overflow-x:pb-(--scroll-bar-reserve)',\n viewportClassName ?? viewPortClassName,\n )}\n >\n {/* Content is NOT optional: it carries the ResizeObserver that recomputes the\n thumb when the CONTENT resizes without the viewport resizing (e.g. a route\n swap to a shorter page). Without it the thumb keeps the previous page's\n geometry and a fully-visible page still shows a scrollbar.\n\n A vertical scroller also pins its content to the viewport's width, so a\n long label truncates instead of widening the list and inventing a\n horizontal scroll. Base UI sets min-width: fit-content inline, which is\n what makes that happen and why this is an inline style too. */}\n <BaseScrollArea.Content {...NO_ROLE} style={orientation === 'vertical' ? { minWidth: 0 } : undefined}>\n {children}\n </BaseScrollArea.Content>\n </BaseScrollArea.Viewport>\n </BaseScrollArea.Root>\n );\n};\n"],"mappings":";;;;;;AAyBA,IAAa,aAAa,EAAE,WAAW,cAAc,YAAY,aAAa,SAAS,GAAG,YAA6B;CACrH,OACE,oBAAC,WAAe,WAAhB;EACE,aAAU;EACG;EACb,WAAW,GACT,4GAGA,gBAAgB,cACd,uIACF,gBAAgB,gBACd,uIACF,eAAe,YAAY,wCAC3B,eAAe,WAAW,iEAC1B,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,WAAe,OAAhB,EAAsB,WAAU,2IAA4I,CAAA;CACpJ,CAAA;AAE9B;;;;;;;;;;;;;;;;AAwDA,IAAM,UAAU,EAAE,MAAM,KAAA,EAAU;;AAGlC,IAAM,cAAc,EAAE,UAAU,KAAA,EAAU;AAE1C,IAAM,YAAY;CAChB,UAAU;CACV,YAAY;CACZ,MAAM;AACR;;;;;;;;;;;;;;;;;;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BAAC,WAAe,SAAhB;KAAwB,GAAI;KAAS,OAAO,gBAAgB,aAAa,EAAE,UAAU,EAAE,IAAI,KAAA;KACxF;IACqB,CAAA;GACD,CAAA;EACN;;AAEzB"}
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { useExposedFocusGuards } from "../../../lib/focus-guards.js";
3
3
  import { ScrollArea } from "../scroll-area/scroll-area.js";
4
- import { POPUP_ITEM_INDICATOR_CLASS, popupItemClass } from "../../../lib/popup-list.js";
4
+ import { POPUP_FRAME_CLASS, POPUP_GROUP_LABEL_CLASS, POPUP_ITEM_INDICATOR_CLASS, POPUP_LIST_HEIGHT_CLASS, POPUP_LIST_WIDTH_CLASS, popupItemClass } from "../../../lib/popup-list.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { IconCheck, IconChevronDown } from "@tabler/icons-react";
7
7
  import { Select } from "@base-ui/react/select";
@@ -42,15 +42,16 @@ var SelectContent = ({ className, children, portalContainer, ...props }) => {
42
42
  alignItemWithTrigger: false,
43
43
  children: /* @__PURE__ */ jsx(Select.Popup, {
44
44
  "data-slot": "select-content",
45
- className: cn("z-50 min-w-[var(--anchor-width)] overflow-hidden rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none", "origin-[var(--transform-origin)]", "transition-[transform,scale,opacity] motion-reduce:animate-none motion-reduce:transition-none data-open:scale-100 data-open:opacity-100 data-closed:scale-95 data-closed:opacity-0 data-open:animate-in data-closed:animate-out data-open:fade-in-0 data-closed:fade-out-0", className),
45
+ className: cn("z-50 flex max-h-(--available-height) flex-col overflow-hidden", POPUP_FRAME_CLASS, POPUP_LIST_WIDTH_CLASS, "origin-[var(--transform-origin)]", "transition-[transform,scale,opacity] motion-reduce:animate-none motion-reduce:transition-none data-open:scale-100 data-open:opacity-100 data-closed:scale-95 data-closed:opacity-0 data-open:animate-in data-closed:animate-out data-open:fade-in-0 data-closed:fade-out-0", className),
46
46
  ...props,
47
47
  children: /* @__PURE__ */ jsx(ScrollArea, {
48
48
  type: "always",
49
49
  fade: true,
50
- fadeFrom: "popover",
51
- className: "max-h-(--available-height)",
50
+ className: POPUP_LIST_HEIGHT_CLASS,
51
+ viewportClassName: "scroll-py-1",
52
52
  children: /* @__PURE__ */ jsx(Select.List, {
53
53
  "data-slot": "select-list",
54
+ className: "p-1",
54
55
  children
55
56
  })
56
57
  })
@@ -61,14 +62,14 @@ var SelectContent = ({ className, children, portalContainer, ...props }) => {
61
62
  var SelectGroup = ({ className, ...props }) => {
62
63
  return /* @__PURE__ */ jsx(Select.Group, {
63
64
  "data-slot": "select-group",
64
- className: cn("flex flex-col gap-0.5", className),
65
+ className,
65
66
  ...props
66
67
  });
67
68
  };
68
69
  var SelectLabel = ({ className, ...props }) => {
69
70
  return /* @__PURE__ */ jsx(Select.GroupLabel, {
70
71
  "data-slot": "select-label",
71
- className: cn("px-2 py-1 text-xs font-semibold text-muted-foreground", className),
72
+ className: cn(POPUP_GROUP_LABEL_CLASS, className),
72
73
  ...props
73
74
  });
74
75
  };