@exsto/ds 0.0.1-rc.13 → 0.0.1-rc.14

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 (185) hide show
  1. package/dist/date-picker.js +1 -344
  2. package/dist/index.js +75 -4513
  3. package/dist/rich-text-editor.js +3 -904
  4. package/dist/source-hash.txt +1 -1
  5. package/dist/styles.css +5 -19
  6. package/dist/theme.css +2 -1
  7. package/dist/ui/src/components/edyn/animated-number/animated-number.js +108 -0
  8. package/dist/ui/src/components/edyn/animated-number/animated-number.js.map +1 -0
  9. package/dist/ui/src/components/edyn/audio-player/audio-player.js +86 -0
  10. package/dist/ui/src/components/edyn/audio-player/audio-player.js.map +1 -0
  11. package/dist/ui/src/components/edyn/date-picker/date-picker.js +250 -0
  12. package/dist/ui/src/components/edyn/date-picker/date-picker.js.map +1 -0
  13. package/dist/ui/src/components/edyn/date-picker/date-text.js +105 -0
  14. package/dist/ui/src/components/edyn/date-picker/date-text.js.map +1 -0
  15. package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.js +59 -0
  16. package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.js.map +1 -0
  17. package/dist/ui/src/components/edyn/initials-avatar/initials-avatar.js +86 -0
  18. package/dist/ui/src/components/edyn/initials-avatar/initials-avatar.js.map +1 -0
  19. package/dist/ui/src/components/edyn/multi-select/multi-select.js +332 -0
  20. package/dist/ui/src/components/edyn/multi-select/multi-select.js.map +1 -0
  21. package/dist/ui/src/components/edyn/progress-line/progress-line.js +100 -0
  22. package/dist/ui/src/components/edyn/progress-line/progress-line.js.map +1 -0
  23. package/dist/ui/src/components/edyn/rich-text-content/allow-list.js +37 -0
  24. package/dist/ui/src/components/edyn/rich-text-content/allow-list.js.map +1 -0
  25. package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.js +124 -0
  26. package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.js.map +1 -0
  27. package/dist/ui/src/components/edyn/rich-text-editor/extensions.js +124 -0
  28. package/dist/ui/src/components/edyn/rich-text-editor/extensions.js.map +1 -0
  29. package/dist/ui/src/components/edyn/rich-text-editor/mention-list.js +232 -0
  30. package/dist/ui/src/components/edyn/rich-text-editor/mention-list.js.map +1 -0
  31. package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.js +244 -0
  32. package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.js.map +1 -0
  33. package/dist/ui/src/components/edyn/rich-text-editor/serialize.js +55 -0
  34. package/dist/ui/src/components/edyn/rich-text-editor/serialize.js.map +1 -0
  35. package/dist/ui/src/components/edyn/rich-text-editor/sync.js +34 -0
  36. package/dist/ui/src/components/edyn/rich-text-editor/sync.js.map +1 -0
  37. package/dist/ui/src/components/edyn/rich-text-editor/toolbar.js +235 -0
  38. package/dist/ui/src/components/edyn/rich-text-editor/toolbar.js.map +1 -0
  39. package/dist/ui/src/components/edyn/rich-text-editor/types.js +26 -0
  40. package/dist/ui/src/components/edyn/rich-text-editor/types.js.map +1 -0
  41. package/dist/ui/src/components/edyn/video-player/video-player.js +132 -0
  42. package/dist/ui/src/components/edyn/video-player/video-player.js.map +1 -0
  43. package/dist/ui/src/components/ui/accordion/accordion.js +83 -0
  44. package/dist/ui/src/components/ui/accordion/accordion.js.map +1 -0
  45. package/dist/ui/src/components/ui/alert/alert.js +47 -0
  46. package/dist/ui/src/components/ui/alert/alert.js.map +1 -0
  47. package/dist/ui/src/components/ui/alert-dialog/alert-dialog.js +95 -0
  48. package/dist/ui/src/components/ui/alert-dialog/alert-dialog.js.map +1 -0
  49. package/dist/ui/src/components/ui/aspect-ratio/aspect-ratio.js +15 -0
  50. package/dist/ui/src/components/ui/aspect-ratio/aspect-ratio.js.map +1 -0
  51. package/dist/ui/src/components/ui/attachment/attachment.js +105 -0
  52. package/dist/ui/src/components/ui/attachment/attachment.js.map +1 -0
  53. package/dist/ui/src/components/ui/avatar/avatar.js +51 -0
  54. package/dist/ui/src/components/ui/avatar/avatar.js.map +1 -0
  55. package/dist/ui/src/components/ui/badge/badge.js +47 -0
  56. package/dist/ui/src/components/ui/badge/badge.js.map +1 -0
  57. package/dist/ui/src/components/ui/breadcrumb/breadcrumb.js +73 -0
  58. package/dist/ui/src/components/ui/breadcrumb/breadcrumb.js.map +1 -0
  59. package/dist/ui/src/components/ui/bubble/bubble.js +74 -0
  60. package/dist/ui/src/components/ui/bubble/bubble.js.map +1 -0
  61. package/dist/{chunks/input-syWxjY2U.js → ui/src/components/ui/button/button.js} +3 -82
  62. package/dist/ui/src/components/ui/button/button.js.map +1 -0
  63. package/dist/ui/src/components/ui/button-group/button-group.js +37 -0
  64. package/dist/ui/src/components/ui/button-group/button-group.js.map +1 -0
  65. package/dist/{chunks/date-range-picker-CWVcHgy2.js → ui/src/components/ui/calendar/calendar.js} +6 -100
  66. package/dist/ui/src/components/ui/calendar/calendar.js.map +1 -0
  67. package/dist/ui/src/components/ui/card/card.js +57 -0
  68. package/dist/ui/src/components/ui/card/card.js.map +1 -0
  69. package/dist/ui/src/components/ui/carousel/carousel.js +136 -0
  70. package/dist/ui/src/components/ui/carousel/carousel.js.map +1 -0
  71. package/dist/ui/src/components/ui/chart/chart.js +168 -0
  72. package/dist/ui/src/components/ui/chart/chart.js.map +1 -0
  73. package/dist/ui/src/components/ui/checkbox/checkbox.js +21 -0
  74. package/dist/ui/src/components/ui/checkbox/checkbox.js.map +1 -0
  75. package/dist/ui/src/components/ui/collapsible/collapsible.js +26 -0
  76. package/dist/ui/src/components/ui/collapsible/collapsible.js.map +1 -0
  77. package/dist/ui/src/components/ui/combobox/combobox.js +85 -0
  78. package/dist/ui/src/components/ui/combobox/combobox.js.map +1 -0
  79. package/dist/ui/src/components/ui/command/command.js +118 -0
  80. package/dist/ui/src/components/ui/command/command.js.map +1 -0
  81. package/dist/ui/src/components/ui/context-menu/context-menu.js +134 -0
  82. package/dist/ui/src/components/ui/context-menu/context-menu.js.map +1 -0
  83. package/dist/ui/src/components/ui/dialog/dialog.js +92 -0
  84. package/dist/ui/src/components/ui/dialog/dialog.js.map +1 -0
  85. package/dist/ui/src/components/ui/direction/direction.js +2 -0
  86. package/dist/ui/src/components/ui/drawer/drawer.js +86 -0
  87. package/dist/ui/src/components/ui/drawer/drawer.js.map +1 -0
  88. package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js +160 -0
  89. package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.js.map +1 -0
  90. package/dist/ui/src/components/ui/empty/empty.js +61 -0
  91. package/dist/ui/src/components/ui/empty/empty.js.map +1 -0
  92. package/dist/ui/src/components/ui/field/field.js +36 -0
  93. package/dist/ui/src/components/ui/field/field.js.map +1 -0
  94. package/dist/ui/src/components/ui/hover-card/hover-card.js +38 -0
  95. package/dist/ui/src/components/ui/hover-card/hover-card.js.map +1 -0
  96. package/dist/ui/src/components/ui/indicator/indicator.js +79 -0
  97. package/dist/ui/src/components/ui/indicator/indicator.js.map +1 -0
  98. package/dist/ui/src/components/ui/input/input.js +16 -0
  99. package/dist/ui/src/components/ui/input/input.js.map +1 -0
  100. package/dist/ui/src/components/ui/input-group/input-group.js +77 -0
  101. package/dist/ui/src/components/ui/input-group/input-group.js.map +1 -0
  102. package/dist/ui/src/components/ui/input-otp/input-otp.js +48 -0
  103. package/dist/ui/src/components/ui/input-otp/input-otp.js.map +1 -0
  104. package/dist/ui/src/components/ui/item/item.js +122 -0
  105. package/dist/ui/src/components/ui/item/item.js.map +1 -0
  106. package/dist/ui/src/components/ui/kbd/kbd.js +21 -0
  107. package/dist/ui/src/components/ui/kbd/kbd.js.map +1 -0
  108. package/dist/ui/src/components/ui/label/label.js +14 -0
  109. package/dist/ui/src/components/ui/label/label.js.map +1 -0
  110. package/dist/ui/src/components/ui/marker/marker.js +44 -0
  111. package/dist/ui/src/components/ui/marker/marker.js.map +1 -0
  112. package/dist/ui/src/components/ui/menubar/menubar.js +137 -0
  113. package/dist/ui/src/components/ui/menubar/menubar.js.map +1 -0
  114. package/dist/ui/src/components/ui/message/message.js +50 -0
  115. package/dist/ui/src/components/ui/message/message.js.map +1 -0
  116. package/dist/ui/src/components/ui/message-scroller/message-scroller.js +61 -0
  117. package/dist/ui/src/components/ui/message-scroller/message-scroller.js.map +1 -0
  118. package/dist/ui/src/components/ui/native-select/native-select.js +39 -0
  119. package/dist/ui/src/components/ui/native-select/native-select.js.map +1 -0
  120. package/dist/ui/src/components/ui/navigation-menu/navigation-menu.js +84 -0
  121. package/dist/ui/src/components/ui/navigation-menu/navigation-menu.js.map +1 -0
  122. package/dist/ui/src/components/ui/pagination/pagination.js +104 -0
  123. package/dist/ui/src/components/ui/pagination/pagination.js.map +1 -0
  124. package/dist/ui/src/components/ui/popover/popover.js +56 -0
  125. package/dist/ui/src/components/ui/popover/popover.js.map +1 -0
  126. package/dist/ui/src/components/ui/progress/progress.js +70 -0
  127. package/dist/ui/src/components/ui/progress/progress.js.map +1 -0
  128. package/dist/ui/src/components/ui/questionnaire/questionnaire.js +171 -0
  129. package/dist/ui/src/components/ui/questionnaire/questionnaire.js.map +1 -0
  130. package/dist/ui/src/components/ui/radio-group/radio-group.js +29 -0
  131. package/dist/ui/src/components/ui/radio-group/radio-group.js.map +1 -0
  132. package/dist/ui/src/components/ui/resizable/resizable.js +29 -0
  133. package/dist/ui/src/components/ui/resizable/resizable.js.map +1 -0
  134. package/dist/ui/src/components/ui/scroll-area/scroll-area.js +119 -0
  135. package/dist/ui/src/components/ui/scroll-area/scroll-area.js.map +1 -0
  136. package/dist/ui/src/components/ui/select/select.js +99 -0
  137. package/dist/ui/src/components/ui/select/select.js.map +1 -0
  138. package/dist/ui/src/components/ui/separator/separator.js +30 -0
  139. package/dist/ui/src/components/ui/separator/separator.js.map +1 -0
  140. package/dist/ui/src/components/ui/sheet/sheet.js +89 -0
  141. package/dist/ui/src/components/ui/sheet/sheet.js.map +1 -0
  142. package/dist/ui/src/components/ui/sidebar/sidebar.js +383 -0
  143. package/dist/ui/src/components/ui/sidebar/sidebar.js.map +1 -0
  144. package/dist/ui/src/components/ui/skeleton/skeleton.js +14 -0
  145. package/dist/ui/src/components/ui/skeleton/skeleton.js.map +1 -0
  146. package/dist/ui/src/components/ui/slider/slider.js +49 -0
  147. package/dist/ui/src/components/ui/slider/slider.js.map +1 -0
  148. package/dist/ui/src/components/ui/spinner/spinner.js +28 -0
  149. package/dist/ui/src/components/ui/spinner/spinner.js.map +1 -0
  150. package/dist/ui/src/components/ui/switch/switch.js +20 -0
  151. package/dist/ui/src/components/ui/switch/switch.js.map +1 -0
  152. package/dist/ui/src/components/ui/table/table.js +68 -0
  153. package/dist/ui/src/components/ui/table/table.js.map +1 -0
  154. package/dist/ui/src/components/ui/tabs/tabs.js +50 -0
  155. package/dist/ui/src/components/ui/tabs/tabs.js.map +1 -0
  156. package/dist/ui/src/components/ui/textarea/textarea.js +14 -0
  157. package/dist/ui/src/components/ui/textarea/textarea.js.map +1 -0
  158. package/dist/ui/src/components/ui/toast/toast.js +124 -0
  159. package/dist/ui/src/components/ui/toast/toast.js.map +1 -0
  160. package/dist/ui/src/components/ui/toggle/toggle.js +37 -0
  161. package/dist/ui/src/components/ui/toggle/toggle.js.map +1 -0
  162. package/dist/ui/src/components/ui/toggle-group/toggle-group.js +56 -0
  163. package/dist/ui/src/components/ui/toggle-group/toggle-group.js.map +1 -0
  164. package/dist/ui/src/components/ui/tooltip/tooltip.js +42 -0
  165. package/dist/ui/src/components/ui/tooltip/tooltip.js.map +1 -0
  166. package/dist/ui/src/hooks/use-media-player.js +140 -0
  167. package/dist/ui/src/hooks/use-media-player.js.map +1 -0
  168. package/dist/ui/src/hooks/use-merged-refs.js +18 -0
  169. package/dist/ui/src/hooks/use-merged-refs.js.map +1 -0
  170. package/dist/ui/src/hooks/use-mobile.js +20 -0
  171. package/dist/ui/src/hooks/use-mobile.js.map +1 -0
  172. package/dist/ui/src/lib/first-weekday.js +34 -0
  173. package/dist/ui/src/lib/first-weekday.js.map +1 -0
  174. package/dist/ui/src/lib/popup-list.js +26 -0
  175. package/dist/ui/src/lib/popup-list.js.map +1 -0
  176. package/dist/ui/src/lib/utils.js +21 -0
  177. package/dist/ui/src/lib/utils.js.map +1 -0
  178. package/package.json +1 -1
  179. package/dist/chunks/date-range-picker-CWVcHgy2.js.map +0 -1
  180. package/dist/chunks/input-syWxjY2U.js.map +0 -1
  181. package/dist/chunks/toggle-Bxg8P-61.js +0 -490
  182. package/dist/chunks/toggle-Bxg8P-61.js.map +0 -1
  183. package/dist/date-picker.js.map +0 -1
  184. package/dist/index.js.map +0 -1
  185. package/dist/rich-text-editor.js.map +0 -1
@@ -0,0 +1,56 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Popover } from "@base-ui/react/popover";
4
+ //#region ../ui/src/components/ui/popover/popover.tsx
5
+ var Popover$1 = ({ ...props }) => {
6
+ return /* @__PURE__ */ jsx(Popover.Root, {
7
+ "data-slot": "popover",
8
+ ...props
9
+ });
10
+ };
11
+ var PopoverTrigger = ({ ...props }) => {
12
+ return /* @__PURE__ */ jsx(Popover.Trigger, {
13
+ "data-slot": "popover-trigger",
14
+ ...props
15
+ });
16
+ };
17
+ var PopoverContent = ({ className, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, anchor, ...props }) => {
18
+ return /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
19
+ align,
20
+ alignOffset,
21
+ anchor,
22
+ side,
23
+ sideOffset,
24
+ className: "isolate z-50",
25
+ children: /* @__PURE__ */ jsx(Popover.Popup, {
26
+ "data-slot": "popover-content",
27
+ className: cn("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 motion-reduce:animate-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", className),
28
+ ...props
29
+ })
30
+ }) });
31
+ };
32
+ var PopoverHeader = ({ className, ...props }) => {
33
+ return /* @__PURE__ */ jsx("div", {
34
+ "data-slot": "popover-header",
35
+ className: cn("flex flex-col gap-0.5 text-sm", className),
36
+ ...props
37
+ });
38
+ };
39
+ var PopoverTitle = ({ className, ...props }) => {
40
+ return /* @__PURE__ */ jsx(Popover.Title, {
41
+ "data-slot": "popover-title",
42
+ className: cn("font-medium", className),
43
+ ...props
44
+ });
45
+ };
46
+ var PopoverDescription = ({ className, ...props }) => {
47
+ return /* @__PURE__ */ jsx(Popover.Description, {
48
+ "data-slot": "popover-description",
49
+ className: cn("text-muted-foreground", className),
50
+ ...props
51
+ });
52
+ };
53
+ //#endregion
54
+ export { Popover$1 as Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
55
+
56
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.js","names":[],"sources":["../../../../../../../ui/src/components/ui/popover/popover.tsx"],"sourcesContent":["import { Popover as PopoverPrimitive } from '@base-ui/react/popover';\nimport { cn } from '@edyn/ui/lib/utils';\nimport type * as React from 'react';\n\nexport const Popover = ({ ...props }: PopoverPrimitive.Root.Props) => {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n};\n\nexport const PopoverTrigger = ({ ...props }: PopoverPrimitive.Trigger.Props) => {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n};\n\nexport const PopoverContent = ({\n className,\n align = 'center',\n alignOffset = 0,\n side = 'bottom',\n sideOffset = 4,\n anchor,\n ...props\n}: PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'anchor' | 'side' | 'sideOffset'>) => {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n data-slot=\"popover-content\"\n className={cn(\n 'z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 motion-reduce:animate-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 className,\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n );\n};\n\nexport const PopoverHeader = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"popover-header\" className={cn('flex flex-col gap-0.5 text-sm', className)} {...props} />;\n};\n\nexport const PopoverTitle = ({ className, ...props }: PopoverPrimitive.Title.Props) => {\n return <PopoverPrimitive.Title data-slot=\"popover-title\" className={cn('font-medium', className)} {...props} />;\n};\n\nexport const PopoverDescription = ({ className, ...props }: PopoverPrimitive.Description.Props) => {\n return <PopoverPrimitive.Description data-slot=\"popover-description\" className={cn('text-muted-foreground', className)} {...props} />;\n};\n"],"mappings":";;;;AAIA,IAAa,aAAW,EAAE,GAAG,YAAyC;CACpE,OAAO,oBAAC,QAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ,CAAA;AAChE;AAEA,IAAa,kBAAkB,EAAE,GAAG,YAA4C;CAC9E,OAAO,oBAAC,QAAiB,SAAlB;EAA0B,aAAU;EAAkB,GAAI;CAAQ,CAAA;AAC3E;AAEA,IAAa,kBAAkB,EAC7B,WACA,QAAQ,UACR,cAAc,GACd,OAAO,UACP,aAAa,GACb,QACA,GAAG,YACqI;CACxI,OACE,oBAAC,QAAiB,QAAlB,EAAA,UACE,oBAAC,QAAiB,YAAlB;EACS;EACM;EACL;EACF;EACM;EACZ,WAAU;EAEV,UAAA,oBAAC,QAAiB,OAAlB;GACE,aAAU;GACV,WAAW,GACT,klBACA,SACF;GACA,GAAI;EACL,CAAA;CAC0B,CAAA,EACN,CAAA;AAE7B;AAEA,IAAa,iBAAiB,EAAE,WAAW,GAAG,YAAyC;CACrF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAiB,WAAW,GAAG,iCAAiC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAChH;AAEA,IAAa,gBAAgB,EAAE,WAAW,GAAG,YAA0C;CACrF,OAAO,oBAAC,QAAiB,OAAlB;EAAwB,aAAU;EAAgB,WAAW,GAAG,eAAe,SAAS;EAAG,GAAI;CAAQ,CAAA;AAChH;AAEA,IAAa,sBAAsB,EAAE,WAAW,GAAG,YAAgD;CACjG,OAAO,oBAAC,QAAiB,aAAlB;EAA8B,aAAU;EAAsB,WAAW,GAAG,yBAAyB,SAAS;EAAG,GAAI;CAAQ,CAAA;AACtI"}
@@ -0,0 +1,70 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { cva } from "class-variance-authority";
4
+ import { Progress } from "@base-ui/react/progress";
5
+ //#region ../ui/src/components/ui/progress/progress.tsx
6
+ /**
7
+ * The tones: a closed set of semantic colours rather than a class string, so a bar cannot carry a
8
+ * colour the theme does not define and dark mode and a re-theme keep working. Each is the theme token
9
+ * the fill uses; the track is a 20% tint of the same token.
10
+ */
11
+ var TONE_TOKEN = {
12
+ default: "var(--primary)",
13
+ info: "var(--info)",
14
+ success: "var(--success)",
15
+ warning: "var(--warning)",
16
+ destructive: "var(--destructive)"
17
+ };
18
+ /**
19
+ * Colours an app can set without a class string. --progress-color replaces the fill (any colour, such as an
20
+ * app's own status tokens); --progress-track replaces the track, which does not follow the fill: an app
21
+ * that wants a neutral track sets it to var(--muted). Both are read where the bar is, so they follow the
22
+ * theme and can be set on :root or on any ancestor.
23
+ */
24
+ var progressFill = (tone) => `var(--progress-color, ${TONE_TOKEN[tone]})`;
25
+ var progressTrack = (tone) => `var(--progress-track, color-mix(in oklab, ${TONE_TOKEN[tone]} 20%, transparent))`;
26
+ /**
27
+ * How the fill eases its width. The defaults are the 300ms ease-in-out it always had; an app retunes them
28
+ * with --progress-duration and --progress-ease, or turns the easing off with `animated={false}` when the
29
+ * number it shows is itself animated and the bar is driven from the same clock.
30
+ */
31
+ var PROGRESS_DURATION = "var(--progress-duration, 300ms)";
32
+ var PROGRESS_EASE = "var(--progress-ease, cubic-bezier(0.4, 0, 0.2, 1))";
33
+ var progressTrackVariants = cva("relative w-full overflow-hidden rounded-full", {
34
+ variants: { size: {
35
+ sm: "h-1",
36
+ default: "h-2"
37
+ } },
38
+ defaultVariants: { size: "default" }
39
+ });
40
+ var Progress$1 = ({ value = null, tone = "default", size, animated = true, className, ...props }) => {
41
+ const fillStyle = {
42
+ backgroundColor: progressFill(tone),
43
+ ...value != null ? { width: `${value}%` } : null,
44
+ ...animated ? {
45
+ transitionDuration: PROGRESS_DURATION,
46
+ transitionTimingFunction: PROGRESS_EASE
47
+ } : null
48
+ };
49
+ return /* @__PURE__ */ jsx(Progress.Root, {
50
+ "data-slot": "progress",
51
+ value: value ?? null,
52
+ className: cn("w-full", className),
53
+ ...props,
54
+ children: /* @__PURE__ */ jsx(Progress.Track, {
55
+ "data-slot": "progress-track",
56
+ className: progressTrackVariants({ size }),
57
+ style: { backgroundColor: progressTrack(tone) },
58
+ children: /* @__PURE__ */ jsx(Progress.Indicator, {
59
+ "data-slot": "progress-indicator",
60
+ "data-tone": tone,
61
+ className: cn("h-full rounded-full motion-reduce:transition-none motion-reduce:animate-none data-indeterminate:w-1/3 data-indeterminate:animate-[progress-indeterminate_1.5s_ease-in-out_infinite]", animated ? "transition-[width] duration-300 ease-in-out" : "transition-none"),
62
+ style: fillStyle
63
+ })
64
+ })
65
+ });
66
+ };
67
+ //#endregion
68
+ export { PROGRESS_DURATION, PROGRESS_EASE, Progress$1 as Progress, progressFill, progressTrack };
69
+
70
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.js","names":[],"sources":["../../../../../../../ui/src/components/ui/progress/progress.tsx"],"sourcesContent":["import { Progress as ProgressPrimitive } from '@base-ui/react/progress';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type { CSSProperties } from 'react';\n\n/**\n * The tones: a closed set of semantic colours rather than a class string, so a bar cannot carry a\n * colour the theme does not define and dark mode and a re-theme keep working. Each is the theme token\n * the fill uses; the track is a 20% tint of the same token.\n */\nconst TONE_TOKEN = {\n default: 'var(--primary)',\n info: 'var(--info)',\n success: 'var(--success)',\n warning: 'var(--warning)',\n destructive: 'var(--destructive)',\n} as const;\n\nexport type TProgressTone = keyof typeof TONE_TOKEN;\n\n/**\n * Colours an app can set without a class string. --progress-color replaces the fill (any colour, such as an\n * app's own status tokens); --progress-track replaces the track, which does not follow the fill: an app\n * that wants a neutral track sets it to var(--muted). Both are read where the bar is, so they follow the\n * theme and can be set on :root or on any ancestor.\n */\nexport const progressFill = (tone: TProgressTone): string => `var(--progress-color, ${TONE_TOKEN[tone]})`;\n\nexport const progressTrack = (tone: TProgressTone): string => `var(--progress-track, color-mix(in oklab, ${TONE_TOKEN[tone]} 20%, transparent))`;\n\n/**\n * How the fill eases its width. The defaults are the 300ms ease-in-out it always had; an app retunes them\n * with --progress-duration and --progress-ease, or turns the easing off with `animated={false}` when the\n * number it shows is itself animated and the bar is driven from the same clock.\n */\nexport const PROGRESS_DURATION = 'var(--progress-duration, 300ms)';\nexport const PROGRESS_EASE = 'var(--progress-ease, cubic-bezier(0.4, 0, 0.2, 1))';\n\nconst progressTrackVariants = cva('relative w-full overflow-hidden rounded-full', {\n variants: {\n size: {\n sm: 'h-1',\n default: 'h-2',\n },\n },\n defaultVariants: { size: 'default' },\n});\n\nexport interface IProgressProps extends Omit<ProgressPrimitive.Root.Props, 'value'> {\n value?: number | null;\n /** The bar's colour: a share of a total reads as `warning` when nearly used up, `success` when done. */\n tone?: TProgressTone;\n /** 4px (`sm`) or 8px (default) tall. */\n size?: VariantProps<typeof progressTrackVariants>['size'];\n /**\n * Whether the fill eases when `value` changes. Turn it off when the value already moves smoothly\n * (driven from an animated number's clock), or the bar eases a second time behind it.\n */\n animated?: boolean;\n}\n\nexport const Progress = ({ value = null, tone = 'default', size, animated = true, className, ...props }: IProgressProps) => {\n const fillStyle: CSSProperties = {\n backgroundColor: progressFill(tone),\n ...(value != null ? { width: `${value}%` } : null),\n ...(animated ? { transitionDuration: PROGRESS_DURATION, transitionTimingFunction: PROGRESS_EASE } : null),\n };\n return (\n <ProgressPrimitive.Root data-slot=\"progress\" value={value ?? null} className={cn('w-full', className)} {...props}>\n <ProgressPrimitive.Track\n data-slot=\"progress-track\"\n className={progressTrackVariants({ size })}\n style={{ backgroundColor: progressTrack(tone) }}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n data-tone={tone}\n className={cn(\n 'h-full rounded-full motion-reduce:transition-none motion-reduce:animate-none data-indeterminate:w-1/3 data-indeterminate:animate-[progress-indeterminate_1.5s_ease-in-out_infinite]',\n animated ? 'transition-[width] duration-300 ease-in-out' : 'transition-none',\n )}\n style={fillStyle}\n />\n </ProgressPrimitive.Track>\n </ProgressPrimitive.Root>\n );\n};\n"],"mappings":";;;;;;;;;;AAUA,IAAM,aAAa;CACjB,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,aAAa;AACf;;;;;;;AAUA,IAAa,gBAAgB,SAAgC,yBAAyB,WAAW,MAAM;AAEvG,IAAa,iBAAiB,SAAgC,6CAA6C,WAAW,MAAM;;;;;;AAO5H,IAAa,oBAAoB;AACjC,IAAa,gBAAgB;AAE7B,IAAM,wBAAwB,IAAI,gDAAgD;CAChF,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,SAAS;CACX,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;AAeD,IAAa,cAAY,EAAE,QAAQ,MAAM,OAAO,WAAW,MAAM,WAAW,MAAM,WAAW,GAAG,YAA4B;CAC1H,MAAM,YAA2B;EAC/B,iBAAiB,aAAa,IAAI;EAClC,GAAI,SAAS,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;EAC7C,GAAI,WAAW;GAAE,oBAAoB;GAAmB,0BAA0B;EAAc,IAAI;CACtG;CACA,OACE,oBAAC,SAAkB,MAAnB;EAAwB,aAAU;EAAW,OAAO,SAAS;EAAM,WAAW,GAAG,UAAU,SAAS;EAAG,GAAI;EACzG,UAAA,oBAAC,SAAkB,OAAnB;GACE,aAAU;GACV,WAAW,sBAAsB,EAAE,KAAK,CAAC;GACzC,OAAO,EAAE,iBAAiB,cAAc,IAAI,EAAE;GAE9C,UAAA,oBAAC,SAAkB,WAAnB;IACE,aAAU;IACV,aAAW;IACX,WAAW,GACT,uLACA,WAAW,gDAAgD,iBAC7D;IACA,OAAO;GACR,CAAA;EACsB,CAAA;CACH,CAAA;AAE5B"}
@@ -0,0 +1,171 @@
1
+ "use client";
2
+ import { cn } from "../../../lib/utils.js";
3
+ import { buttonVariants } from "../button/button.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { IconCheck } from "@tabler/icons-react";
6
+ import { Questionnaire } from "@shadcn/react/questionnaire";
7
+ //#region ../ui/src/components/ui/questionnaire/questionnaire.tsx
8
+ var Questionnaire$1 = ({ className, ...props }) => {
9
+ return /* @__PURE__ */ jsx(Questionnaire.Root, {
10
+ "data-slot": "questionnaire",
11
+ className: cn("flex w-full min-w-0 flex-col gap-4", className),
12
+ ...props
13
+ });
14
+ };
15
+ var QuestionnaireProgress = ({ className, ...props }) => {
16
+ return /* @__PURE__ */ jsx(Questionnaire.Progress, {
17
+ "data-slot": "questionnaire-progress",
18
+ className: cn("min-h-[1lh] w-fit min-w-[14ch] text-xs font-medium text-muted-foreground tabular-nums", className),
19
+ ...props
20
+ });
21
+ };
22
+ var QuestionnaireItem = ({ className, ...props }) => {
23
+ return /* @__PURE__ */ jsx(Questionnaire.Item, {
24
+ "data-slot": "questionnaire-item",
25
+ className: cn("flex min-w-0 flex-col gap-4 border-0 p-0 outline-none", className),
26
+ ...props
27
+ });
28
+ };
29
+ var QuestionnaireTitle = ({ className, ...props }) => {
30
+ return /* @__PURE__ */ jsx(Questionnaire.Title, {
31
+ "data-slot": "questionnaire-title",
32
+ className: cn("font-heading text-base leading-snug font-medium text-pretty [&:not(:has(~[data-slot=questionnaire-description]))]:mb-4", className),
33
+ ...props
34
+ });
35
+ };
36
+ var QuestionnaireDescription = ({ className, ...props }) => {
37
+ return /* @__PURE__ */ jsx(Questionnaire.Description, {
38
+ "data-slot": "questionnaire-description",
39
+ className: cn("text-sm text-pretty text-muted-foreground", className),
40
+ ...props
41
+ });
42
+ };
43
+ var QuestionnaireChoices = ({ className, ...props }) => {
44
+ return /* @__PURE__ */ jsx(Questionnaire.Choices, {
45
+ "data-slot": "questionnaire-choices",
46
+ className: cn("group/questionnaire-choices grid min-w-0 gap-2", className),
47
+ ...props
48
+ });
49
+ };
50
+ var QuestionnaireChoice = ({ children, className, ...props }) => {
51
+ return /* @__PURE__ */ jsxs(Questionnaire.Choice, {
52
+ "data-slot": "questionnaire-choice",
53
+ className: cn("group/questionnaire-choice relative flex min-h-11 cursor-pointer items-start gap-2.5 rounded-lg border border-input bg-transparent px-3 py-2.5 text-start text-sm transition-colors outline-none select-none hover:bg-muted/50 has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-3 has-[>input:focus-visible]:ring-ring/50 data-invalid:border-destructive dark:bg-input/20 data-checked:border-primary/40 data-checked:bg-muted dark:data-checked:bg-muted", "data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50", className),
54
+ ...props,
55
+ children: [
56
+ /* @__PURE__ */ jsx(Questionnaire.ChoiceInput, {
57
+ "data-slot": "questionnaire-choice-input",
58
+ className: "absolute inset-0 z-10 size-full cursor-pointer opacity-0"
59
+ }),
60
+ /* @__PURE__ */ jsxs("span", {
61
+ "aria-hidden": "true",
62
+ "data-slot": "questionnaire-choice-indicator",
63
+ className: "pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-[4px] border border-input group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[type=radio]/questionnaire-choice:rounded-full group-data-checked/questionnaire-choice:border-primary group-data-checked/questionnaire-choice:bg-primary group-data-checked/questionnaire-choice:text-primary-foreground dark:bg-input/30 dark:group-data-checked/questionnaire-choice:bg-primary",
64
+ children: [/* @__PURE__ */ jsx("span", {
65
+ "data-slot": "questionnaire-choice-indicator-dot",
66
+ className: "hidden size-2 rounded-full bg-primary-foreground group-data-[type=checkbox]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block"
67
+ }), /* @__PURE__ */ jsx(IconCheck, {
68
+ "data-slot": "questionnaire-choice-indicator-check",
69
+ className: "hidden size-3.5 group-data-[type=radio]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block"
70
+ })]
71
+ }),
72
+ /* @__PURE__ */ jsx(Questionnaire.ChoiceLabel, {
73
+ "data-slot": "questionnaire-choice-label",
74
+ className: "flex min-w-0 flex-1 flex-col gap-0.5 leading-snug",
75
+ children
76
+ }),
77
+ /* @__PURE__ */ jsx(Questionnaire.ChoiceShortcut, {
78
+ "data-slot": "questionnaire-choice-shortcut",
79
+ className: "pointer-events-none ms-auto hidden size-5 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-md border border-input bg-background font-mono text-[0.625rem] leading-none font-medium text-muted-foreground group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[shortcut]/questionnaire-choice:inline-flex"
80
+ })
81
+ ]
82
+ });
83
+ };
84
+ var QuestionnaireChoiceDescription = ({ className, ...props }) => {
85
+ return /* @__PURE__ */ jsx("span", {
86
+ "data-slot": "questionnaire-choice-description",
87
+ className: cn("text-muted-foreground", className),
88
+ ...props
89
+ });
90
+ };
91
+ var QuestionnaireInput = ({ className, ...props }) => {
92
+ return /* @__PURE__ */ jsx("div", {
93
+ "data-slot": "questionnaire-input-wrapper",
94
+ className: "group/questionnaire-input relative w-full min-w-0",
95
+ children: /* @__PURE__ */ jsx(Questionnaire.Input, {
96
+ "data-slot": "questionnaire-input",
97
+ className: cn("h-8 min-h-11 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-[color,box-shadow,background-color] outline-none 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 sm:min-h-0 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", "selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground", className),
98
+ ...props
99
+ })
100
+ });
101
+ };
102
+ var QuestionnaireError = ({ className, ...props }) => {
103
+ return /* @__PURE__ */ jsx(Questionnaire.Error, {
104
+ "data-slot": "questionnaire-error",
105
+ className: cn("mt-2 text-sm text-destructive", className),
106
+ ...props
107
+ });
108
+ };
109
+ var QuestionnaireActions = ({ className, ...props }) => {
110
+ return /* @__PURE__ */ jsx("div", {
111
+ "data-slot": "questionnaire-actions",
112
+ className: cn("grid min-h-11 w-full grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2 sm:min-h-8", className),
113
+ ...props
114
+ });
115
+ };
116
+ var QuestionnairePrevious = ({ children, className, size = "default", variant = "outline", ...props }) => {
117
+ return /* @__PURE__ */ jsx(Questionnaire.Previous, {
118
+ "data-slot": "questionnaire-previous",
119
+ "data-size": size,
120
+ "data-variant": variant,
121
+ className: cn(buttonVariants({
122
+ size,
123
+ variant
124
+ }), "col-start-1 row-start-1 min-h-11 justify-self-start sm:min-h-0", className),
125
+ ...props,
126
+ children: children ?? "Previous"
127
+ });
128
+ };
129
+ var QuestionnaireSkip = ({ children, className, size = "default", variant = "outline", ...props }) => {
130
+ return /* @__PURE__ */ jsx(Questionnaire.Skip, {
131
+ "data-slot": "questionnaire-skip",
132
+ "data-size": size,
133
+ "data-variant": variant,
134
+ className: cn(buttonVariants({
135
+ size,
136
+ variant
137
+ }), "col-start-2 row-start-1 min-h-11 justify-self-end sm:min-h-0", className),
138
+ ...props,
139
+ children: children ?? "Skip"
140
+ });
141
+ };
142
+ var QuestionnaireNext = ({ children, className, size = "default", variant = "default", ...props }) => {
143
+ return /* @__PURE__ */ jsx(Questionnaire.Next, {
144
+ "data-slot": "questionnaire-next",
145
+ "data-size": size,
146
+ "data-variant": variant,
147
+ className: cn(buttonVariants({
148
+ size,
149
+ variant
150
+ }), "col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0", className),
151
+ ...props,
152
+ children: children ?? "Next"
153
+ });
154
+ };
155
+ var QuestionnaireSubmit = ({ children, className, size = "default", variant = "default", ...props }) => {
156
+ return /* @__PURE__ */ jsx(Questionnaire.Submit, {
157
+ "data-slot": "questionnaire-submit",
158
+ "data-size": size,
159
+ "data-variant": variant,
160
+ className: cn(buttonVariants({
161
+ size,
162
+ variant
163
+ }), "col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0", className),
164
+ ...props,
165
+ children: children ?? "Submit"
166
+ });
167
+ };
168
+ //#endregion
169
+ export { Questionnaire$1 as Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle };
170
+
171
+ //# sourceMappingURL=questionnaire.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questionnaire.js","names":[],"sources":["../../../../../../../ui/src/components/ui/questionnaire/questionnaire.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@edyn/ui/lib/utils';\nimport { Questionnaire as QuestionnairePrimitive } from '@shadcn/react/questionnaire';\nimport { IconCheck } from '@tabler/icons-react';\nimport type * as React from 'react';\nimport { type Button, buttonVariants } from '../button';\n\nexport const Questionnaire = ({ className, ...props }: React.ComponentProps<typeof QuestionnairePrimitive.Root>) => {\n return <QuestionnairePrimitive.Root data-slot=\"questionnaire\" className={cn('flex w-full min-w-0 flex-col gap-4', className)} {...props} />;\n};\n\nexport const QuestionnaireProgress = ({ className, ...props }: React.ComponentProps<typeof QuestionnairePrimitive.Progress>) => {\n return (\n <QuestionnairePrimitive.Progress\n data-slot=\"questionnaire-progress\"\n className={cn('min-h-[1lh] w-fit min-w-[14ch] text-xs font-medium text-muted-foreground tabular-nums', className)}\n {...props}\n />\n );\n};\n\nexport const QuestionnaireItem = ({ className, ...props }: React.ComponentProps<typeof QuestionnairePrimitive.Item>) => {\n return (\n <QuestionnairePrimitive.Item\n data-slot=\"questionnaire-item\"\n className={cn('flex min-w-0 flex-col gap-4 border-0 p-0 outline-none', className)}\n {...props}\n />\n );\n};\n\nexport const QuestionnaireTitle = ({ className, ...props }: React.ComponentProps<typeof QuestionnairePrimitive.Title>) => {\n return (\n <QuestionnairePrimitive.Title\n data-slot=\"questionnaire-title\"\n className={cn(\n 'font-heading text-base leading-snug font-medium text-pretty [&:not(:has(~[data-slot=questionnaire-description]))]:mb-4',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const QuestionnaireDescription = ({ className, ...props }: React.ComponentProps<typeof QuestionnairePrimitive.Description>) => {\n return (\n <QuestionnairePrimitive.Description\n data-slot=\"questionnaire-description\"\n className={cn('text-sm text-pretty text-muted-foreground', className)}\n {...props}\n />\n );\n};\n\nexport const QuestionnaireChoices = ({ className, ...props }: React.ComponentProps<typeof QuestionnairePrimitive.Choices>) => {\n return (\n <QuestionnairePrimitive.Choices\n data-slot=\"questionnaire-choices\"\n className={cn('group/questionnaire-choices grid min-w-0 gap-2', className)}\n {...props}\n />\n );\n};\n\nexport const QuestionnaireChoice = ({ children, className, ...props }: React.ComponentProps<typeof QuestionnairePrimitive.Choice>) => {\n return (\n <QuestionnairePrimitive.Choice\n data-slot=\"questionnaire-choice\"\n className={cn(\n 'group/questionnaire-choice relative flex min-h-11 cursor-pointer items-start gap-2.5 rounded-lg border border-input bg-transparent px-3 py-2.5 text-start text-sm transition-colors outline-none select-none hover:bg-muted/50 has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-3 has-[>input:focus-visible]:ring-ring/50 data-invalid:border-destructive dark:bg-input/20 data-checked:border-primary/40 data-checked:bg-muted dark:data-checked:bg-muted',\n 'data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <QuestionnairePrimitive.ChoiceInput\n data-slot=\"questionnaire-choice-input\"\n className=\"absolute inset-0 z-10 size-full cursor-pointer opacity-0\"\n />\n <span\n aria-hidden=\"true\"\n data-slot=\"questionnaire-choice-indicator\"\n className=\"pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-[4px] border border-input group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[type=radio]/questionnaire-choice:rounded-full group-data-checked/questionnaire-choice:border-primary group-data-checked/questionnaire-choice:bg-primary group-data-checked/questionnaire-choice:text-primary-foreground dark:bg-input/30 dark:group-data-checked/questionnaire-choice:bg-primary\"\n >\n <span\n data-slot=\"questionnaire-choice-indicator-dot\"\n className=\"hidden size-2 rounded-full bg-primary-foreground group-data-[type=checkbox]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block\"\n />\n <IconCheck\n data-slot=\"questionnaire-choice-indicator-check\"\n className=\"hidden size-3.5 group-data-[type=radio]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block\"\n />\n </span>\n <QuestionnairePrimitive.ChoiceLabel data-slot=\"questionnaire-choice-label\" className=\"flex min-w-0 flex-1 flex-col gap-0.5 leading-snug\">\n {children}\n </QuestionnairePrimitive.ChoiceLabel>\n <QuestionnairePrimitive.ChoiceShortcut\n data-slot=\"questionnaire-choice-shortcut\"\n className=\"pointer-events-none ms-auto hidden size-5 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-md border border-input bg-background font-mono text-[0.625rem] leading-none font-medium text-muted-foreground group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[shortcut]/questionnaire-choice:inline-flex\"\n />\n </QuestionnairePrimitive.Choice>\n );\n};\n\nexport const QuestionnaireChoiceDescription = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return <span data-slot=\"questionnaire-choice-description\" className={cn('text-muted-foreground', className)} {...props} />;\n};\n\nexport const QuestionnaireInput = ({ className, ...props }: React.ComponentProps<typeof QuestionnairePrimitive.Input>) => {\n return (\n <div data-slot=\"questionnaire-input-wrapper\" className=\"group/questionnaire-input relative w-full min-w-0\">\n <QuestionnairePrimitive.Input\n data-slot=\"questionnaire-input\"\n className={cn(\n 'h-8 min-h-11 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-[color,box-shadow,background-color] outline-none 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 sm:min-h-0 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 'selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground',\n className,\n )}\n {...props}\n />\n </div>\n );\n};\n\nexport const QuestionnaireError = ({ className, ...props }: React.ComponentProps<typeof QuestionnairePrimitive.Error>) => {\n return <QuestionnairePrimitive.Error data-slot=\"questionnaire-error\" className={cn('mt-2 text-sm text-destructive', className)} {...props} />;\n};\n\nexport const QuestionnaireActions = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"questionnaire-actions\"\n className={cn('grid min-h-11 w-full grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2 sm:min-h-8', className)}\n {...props}\n />\n );\n};\n\nexport const QuestionnairePrevious = ({\n children,\n className,\n size = 'default',\n variant = 'outline',\n ...props\n}: React.ComponentProps<typeof QuestionnairePrimitive.Previous> & Pick<React.ComponentProps<typeof Button>, 'size' | 'variant'>) => {\n return (\n <QuestionnairePrimitive.Previous\n data-slot=\"questionnaire-previous\"\n data-size={size}\n data-variant={variant}\n className={cn(buttonVariants({ size, variant }), 'col-start-1 row-start-1 min-h-11 justify-self-start sm:min-h-0', className)}\n {...props}\n >\n {children ?? 'Previous'}\n </QuestionnairePrimitive.Previous>\n );\n};\n\nexport const QuestionnaireSkip = ({\n children,\n className,\n size = 'default',\n variant = 'outline',\n ...props\n}: React.ComponentProps<typeof QuestionnairePrimitive.Skip> & Pick<React.ComponentProps<typeof Button>, 'size' | 'variant'>) => {\n return (\n <QuestionnairePrimitive.Skip\n data-slot=\"questionnaire-skip\"\n data-size={size}\n data-variant={variant}\n className={cn(buttonVariants({ size, variant }), 'col-start-2 row-start-1 min-h-11 justify-self-end sm:min-h-0', className)}\n {...props}\n >\n {children ?? 'Skip'}\n </QuestionnairePrimitive.Skip>\n );\n};\n\nexport const QuestionnaireNext = ({\n children,\n className,\n size = 'default',\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof QuestionnairePrimitive.Next> & Pick<React.ComponentProps<typeof Button>, 'size' | 'variant'>) => {\n return (\n <QuestionnairePrimitive.Next\n data-slot=\"questionnaire-next\"\n data-size={size}\n data-variant={variant}\n className={cn(buttonVariants({ size, variant }), 'col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0', className)}\n {...props}\n >\n {children ?? 'Next'}\n </QuestionnairePrimitive.Next>\n );\n};\n\nexport const QuestionnaireSubmit = ({\n children,\n className,\n size = 'default',\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof QuestionnairePrimitive.Submit> & Pick<React.ComponentProps<typeof Button>, 'size' | 'variant'>) => {\n return (\n <QuestionnairePrimitive.Submit\n data-slot=\"questionnaire-submit\"\n data-size={size}\n data-variant={variant}\n className={cn(buttonVariants({ size, variant }), 'col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0', className)}\n {...props}\n >\n {children ?? 'Submit'}\n </QuestionnairePrimitive.Submit>\n );\n};\n"],"mappings":";;;;;;;AAQA,IAAa,mBAAiB,EAAE,WAAW,GAAG,YAAsE;CAClH,OAAO,oBAAC,cAAuB,MAAxB;EAA6B,aAAU;EAAgB,WAAW,GAAG,sCAAsC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC5I;AAEA,IAAa,yBAAyB,EAAE,WAAW,GAAG,YAA0E;CAC9H,OACE,oBAAC,cAAuB,UAAxB;EACE,aAAU;EACV,WAAW,GAAG,yFAAyF,SAAS;EAChH,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,qBAAqB,EAAE,WAAW,GAAG,YAAsE;CACtH,OACE,oBAAC,cAAuB,MAAxB;EACE,aAAU;EACV,WAAW,GAAG,yDAAyD,SAAS;EAChF,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,sBAAsB,EAAE,WAAW,GAAG,YAAuE;CACxH,OACE,oBAAC,cAAuB,OAAxB;EACE,aAAU;EACV,WAAW,GACT,0HACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,4BAA4B,EAAE,WAAW,GAAG,YAA6E;CACpI,OACE,oBAAC,cAAuB,aAAxB;EACE,aAAU;EACV,WAAW,GAAG,6CAA6C,SAAS;EACpE,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,wBAAwB,EAAE,WAAW,GAAG,YAAyE;CAC5H,OACE,oBAAC,cAAuB,SAAxB;EACE,aAAU;EACV,WAAW,GAAG,kDAAkD,SAAS;EACzE,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,uBAAuB,EAAE,UAAU,WAAW,GAAG,YAAwE;CACpI,OACE,qBAAC,cAAuB,QAAxB;EACE,aAAU;EACV,WAAW,GACT,odACA,+FACA,SACF;EACA,GAAI;EAPN,UAAA;GASE,oBAAC,cAAuB,aAAxB;IACE,aAAU;IACV,WAAU;GACX,CAAA;GACD,qBAAC,QAAD;IACE,eAAY;IACZ,aAAU;IACV,WAAU;IAHZ,UAAA,CAKE,oBAAC,QAAD;KACE,aAAU;KACV,WAAU;IACX,CAAA,GACD,oBAAC,WAAD;KACE,aAAU;KACV,WAAU;IACX,CAAA,CACG;;GACN,oBAAC,cAAuB,aAAxB;IAAoC,aAAU;IAA6B,WAAU;IAClF;GACiC,CAAA;GACpC,oBAAC,cAAuB,gBAAxB;IACE,aAAU;IACV,WAAU;GACX,CAAA;EAC4B;;AAEnC;AAEA,IAAa,kCAAkC,EAAE,WAAW,GAAG,YAA0C;CACvG,OAAO,oBAAC,QAAD;EAAM,aAAU;EAAmC,WAAW,GAAG,yBAAyB,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC3H;AAEA,IAAa,sBAAsB,EAAE,WAAW,GAAG,YAAuE;CACxH,OACE,oBAAC,OAAD;EAAK,aAAU;EAA8B,WAAU;EACrD,UAAA,oBAAC,cAAuB,OAAxB;GACE,aAAU;GACV,WAAW,GACT,+iBACA,4FACA,SACF;GACA,GAAI;EACL,CAAA;CACE,CAAA;AAET;AAEA,IAAa,sBAAsB,EAAE,WAAW,GAAG,YAAuE;CACxH,OAAO,oBAAC,cAAuB,OAAxB;EAA8B,aAAU;EAAsB,WAAW,GAAG,iCAAiC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC9I;AAEA,IAAa,wBAAwB,EAAE,WAAW,GAAG,YAAyC;CAC5F,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,0FAA0F,SAAS;EACjH,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,yBAAyB,EACpC,UACA,WACA,OAAO,WACP,UAAU,WACV,GAAG,YAC+H;CAClI,OACE,oBAAC,cAAuB,UAAxB;EACE,aAAU;EACV,aAAW;EACX,gBAAc;EACd,WAAW,GAAG,eAAe;GAAE;GAAM;EAAQ,CAAC,GAAG,kEAAkE,SAAS;EAC5H,GAAI;EAEH,UAAA,YAAY;CACkB,CAAA;AAErC;AAEA,IAAa,qBAAqB,EAChC,UACA,WACA,OAAO,WACP,UAAU,WACV,GAAG,YAC2H;CAC9H,OACE,oBAAC,cAAuB,MAAxB;EACE,aAAU;EACV,aAAW;EACX,gBAAc;EACd,WAAW,GAAG,eAAe;GAAE;GAAM;EAAQ,CAAC,GAAG,gEAAgE,SAAS;EAC1H,GAAI;EAEH,UAAA,YAAY;CACc,CAAA;AAEjC;AAEA,IAAa,qBAAqB,EAChC,UACA,WACA,OAAO,WACP,UAAU,WACV,GAAG,YAC2H;CAC9H,OACE,oBAAC,cAAuB,MAAxB;EACE,aAAU;EACV,aAAW;EACX,gBAAc;EACd,WAAW,GAAG,eAAe;GAAE;GAAM;EAAQ,CAAC,GAAG,gEAAgE,SAAS;EAC1H,GAAI;EAEH,UAAA,YAAY;CACc,CAAA;AAEjC;AAEA,IAAa,uBAAuB,EAClC,UACA,WACA,OAAO,WACP,UAAU,WACV,GAAG,YAC6H;CAChI,OACE,oBAAC,cAAuB,QAAxB;EACE,aAAU;EACV,aAAW;EACX,gBAAc;EACd,WAAW,GAAG,eAAe;GAAE;GAAM;EAAQ,CAAC,GAAG,gEAAgE,SAAS;EAC1H,GAAI;EAEH,UAAA,YAAY;CACgB,CAAA;AAEnC"}
@@ -0,0 +1,29 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Radio } from "@base-ui/react/radio";
4
+ import { RadioGroup } from "@base-ui/react/radio-group";
5
+ //#region ../ui/src/components/ui/radio-group/radio-group.tsx
6
+ var RadioGroup$1 = ({ className, orientation = "vertical", ...props }) => {
7
+ return /* @__PURE__ */ jsx(RadioGroup, {
8
+ "data-slot": "radio-group",
9
+ "data-orientation": orientation,
10
+ "aria-orientation": orientation,
11
+ className: cn("grid w-full gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:items-center", className),
12
+ ...props
13
+ });
14
+ };
15
+ var RadioGroupItem = ({ className, ...props }) => {
16
+ return /* @__PURE__ */ jsx(Radio.Root, {
17
+ "data-slot": "radio-group-item",
18
+ className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-full border border-input transition-colors outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40", className),
19
+ ...props,
20
+ children: /* @__PURE__ */ jsx(Radio.Indicator, {
21
+ "data-slot": "radio-group-item-indicator",
22
+ className: "flex size-2 shrink-0 rounded-full bg-primary transition-none"
23
+ })
24
+ });
25
+ };
26
+ //#endregion
27
+ export { RadioGroup$1 as RadioGroup, RadioGroupItem };
28
+
29
+ //# sourceMappingURL=radio-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-group.js","names":[],"sources":["../../../../../../../ui/src/components/ui/radio-group/radio-group.tsx"],"sourcesContent":["import { Radio } from '@base-ui/react/radio';\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';\n\nimport { cn } from '@edyn/ui/lib/utils';\n\nexport interface IRadioGroupProps extends RadioGroupPrimitive.Props {\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport const RadioGroup = ({ className, orientation = 'vertical', ...props }: IRadioGroupProps) => {\n return (\n <RadioGroupPrimitive\n data-slot=\"radio-group\"\n data-orientation={orientation}\n aria-orientation={orientation}\n className={cn('grid w-full gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:items-center', className)}\n {...props}\n />\n );\n};\n\nexport interface IRadioGroupItemProps extends Radio.Root.Props {\n className?: string;\n}\n\nexport const RadioGroupItem = ({ className, ...props }: IRadioGroupItemProps) => {\n return (\n <Radio.Root\n data-slot=\"radio-group-item\"\n className={cn(\n 'peer relative flex size-4 shrink-0 items-center justify-center rounded-full border border-input transition-colors outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40',\n className,\n )}\n {...props}\n >\n <Radio.Indicator data-slot=\"radio-group-item-indicator\" className=\"flex size-2 shrink-0 rounded-full bg-primary transition-none\" />\n </Radio.Root>\n );\n};\n"],"mappings":";;;;;AASA,IAAa,gBAAc,EAAE,WAAW,cAAc,YAAY,GAAG,YAA8B;CACjG,OACE,oBAAC,YAAD;EACE,aAAU;EACV,oBAAkB;EAClB,oBAAkB;EAClB,WAAW,GAAG,mGAAmG,SAAS;EAC1H,GAAI;CACL,CAAA;AAEL;AAMA,IAAa,kBAAkB,EAAE,WAAW,GAAG,YAAkC;CAC/E,OACE,oBAAC,MAAM,MAAP;EACE,aAAU;EACV,WAAW,GACT,mcACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,MAAM,WAAP;GAAiB,aAAU;GAA6B,WAAU;EAAgE,CAAA;CACxH,CAAA;AAEhB"}
@@ -0,0 +1,29 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import * as ResizablePrimitive from "react-resizable-panels";
4
+ //#region ../ui/src/components/ui/resizable/resizable.tsx
5
+ var ResizablePanelGroup = ({ className, ...props }) => {
6
+ return /* @__PURE__ */ jsx(ResizablePrimitive.Group, {
7
+ "data-slot": "resizable-panel-group",
8
+ className: cn("flex h-full w-full aria-[orientation=vertical]:flex-col", className),
9
+ ...props
10
+ });
11
+ };
12
+ var ResizablePanel = ({ ...props }) => {
13
+ return /* @__PURE__ */ jsx(ResizablePrimitive.Panel, {
14
+ "data-slot": "resizable-panel",
15
+ ...props
16
+ });
17
+ };
18
+ var ResizableHandle = ({ withHandle, className, ...props }) => {
19
+ return /* @__PURE__ */ jsx(ResizablePrimitive.Separator, {
20
+ "data-slot": "resizable-handle",
21
+ className: cn("relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90", className),
22
+ ...props,
23
+ children: withHandle && /* @__PURE__ */ jsx("div", { className: "z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border" })
24
+ });
25
+ };
26
+ //#endregion
27
+ export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
28
+
29
+ //# sourceMappingURL=resizable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable.js","names":[],"sources":["../../../../../../../ui/src/components/ui/resizable/resizable.tsx"],"sourcesContent":["import { cn } from '@edyn/ui/lib/utils';\nimport * as ResizablePrimitive from 'react-resizable-panels';\n\nexport const ResizablePanelGroup = ({ className, ...props }: ResizablePrimitive.GroupProps) => {\n return (\n <ResizablePrimitive.Group\n data-slot=\"resizable-panel-group\"\n className={cn('flex h-full w-full aria-[orientation=vertical]:flex-col', className)}\n {...props}\n />\n );\n};\n\nexport const ResizablePanel = ({ ...props }: ResizablePrimitive.PanelProps) => {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />;\n};\n\nexport const ResizableHandle = ({\n withHandle,\n className,\n ...props\n}: ResizablePrimitive.SeparatorProps & {\n withHandle?: boolean;\n}) => {\n return (\n <ResizablePrimitive.Separator\n data-slot=\"resizable-handle\"\n className={cn(\n 'relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90',\n className,\n )}\n {...props}\n >\n {withHandle && <div className=\"z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border\" />}\n </ResizablePrimitive.Separator>\n );\n};\n"],"mappings":";;;;AAGA,IAAa,uBAAuB,EAAE,WAAW,GAAG,YAA2C;CAC7F,OACE,oBAAC,mBAAmB,OAApB;EACE,aAAU;EACV,WAAW,GAAG,2DAA2D,SAAS;EAClF,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,kBAAkB,EAAE,GAAG,YAA2C;CAC7E,OAAO,oBAAC,mBAAmB,OAApB;EAA0B,aAAU;EAAkB,GAAI;CAAQ,CAAA;AAC3E;AAEA,IAAa,mBAAmB,EAC9B,YACA,WACA,GAAG,YAGC;CACJ,OACE,oBAAC,mBAAmB,WAApB;EACE,aAAU;EACV,WAAW,GACT,wkBACA,SACF;EACA,GAAI;EAEH,UAAA,cAAc,oBAAC,OAAD,EAAK,WAAU,kDAAmD,CAAA;CACrD,CAAA;AAElC"}
@@ -0,0 +1,119 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { useMergedRefs } from "../../../hooks/use-merged-refs.js";
3
+ import { useEffect, useRef } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { ScrollArea } from "@base-ui/react/scroll-area";
6
+ //#region ../ui/src/components/ui/scroll-area/scroll-area.tsx
7
+ var ScrollBar = ({ className, orientation = "vertical", visibility = "hover", ...props }) => {
8
+ return /* @__PURE__ */ jsx(ScrollArea.Scrollbar, {
9
+ "data-slot": "scroll-area-scrollbar",
10
+ orientation,
11
+ className: cn("peer/scrollbar z-100 flex touch-none select-none motion-safe:transition-opacity motion-safe:duration-150", orientation === "vertical" && "h-(--scroll-bar-length) w-(--scroll-bar-size) me-(--scroll-bar-gap) mt-(--scroll-bar-offset-top) border-l border-l-transparent p-px", orientation === "horizontal" && "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", visibility !== "always" && "opacity-0 data-scrolling:opacity-100", visibility === "hover" && "data-hovering:opacity-100 group-hover/scroll-area:opacity-100", className),
12
+ ...props,
13
+ children: /* @__PURE__ */ jsx(ScrollArea.Thumb, { className: "relative flex-1 rounded-full bg-muted-foreground/50 transition-colors hover:bg-muted-foreground/70 data-scrolling:bg-muted-foreground/70" })
14
+ });
15
+ };
16
+ /**
17
+ * Which axes fade, published for scroll-fade.css to key its mask off. The
18
+ * stylesheet reaches this element's own viewport through a child combinator, so a
19
+ * ScrollArea nested in another one cannot pick up its ancestor's edges.
20
+ */
21
+ /**
22
+ * Base UI gives the root, the viewport and the content `role="presentation"`. On
23
+ * a div that changes nothing for a screen reader, but it is an EXPLICIT role, and
24
+ * axe treats explicit presentation children as foreign to a parent that owns
25
+ * required children. A ScrollArea inside `role="menu"` or `role="listbox"` then
26
+ * fails as a critical aria-required-children violation, while the same div with
27
+ * no role passes straight through. Clearing it is what makes a ScrollArea legal
28
+ * in a popup list. A spread because the literal `role={undefined}` is flagged by
29
+ * the a11y lint rule, which cannot tell it from an invalid role.
30
+ */
31
+ var NO_ROLE = { role: void 0 };
32
+ /** Base UI makes the viewport a tab stop (0, or -1 with nothing to scroll); undefined takes that away. */
33
+ var NO_TAB_STOP = { tabIndex: void 0 };
34
+ var FADE_AXIS = {
35
+ vertical: "block",
36
+ horizontal: "inline",
37
+ both: "both"
38
+ };
39
+ /**
40
+ * Themed scroll container (Base UI): overflowing content scrolls INSIDE the component
41
+ * with a slim overlay scrollbar instead of exposing a native browser scrollbar. House
42
+ * rule: wide/tall content (tables, lists, code) always goes through this, never a bare
43
+ * overflow-* utility.
44
+ *
45
+ * Cap the height with a plain class on the component itself, e.g.
46
+ * `<ScrollArea className="max-h-88">`. The viewport picks the cap up through
47
+ * `max-h-inherit`, which matters because the viewport is the element that actually
48
+ * scrolls: a cap that lands only on the root leaves tall content spilling out
49
+ * underneath with no scrollbar, and that reads as a working height right up until the
50
+ * content outgrows it.
51
+ *
52
+ * `fade` fades out each edge that is currently hiding content, rather than always
53
+ * fading one: a permanent fade is a lie half the time, dimming the last row that fits
54
+ * and promising more below when the reader is already at the end. It is cut into the
55
+ * content by a mask (@edyn/theme/scroll-fade.css), so it needs no surface colour and
56
+ * reads correctly over a tint, a gradient or a glow. A host that keeps something
57
+ * unscrolled at the top, such as a sticky table header, exempts that band by setting
58
+ * --scroll-fade-offset on the ScrollArea. The static faded-* utilities in
59
+ * @edyn/theme/utilities.css are the other tool, for DECORATIVE edges that do not
60
+ * track scroll position.
61
+ *
62
+ * The viewport publishes its size as --scroll-area-width/--scroll-area-height CSS vars
63
+ * so children can size against the visible area.
64
+ */
65
+ var ScrollArea$1 = ({ className, children, orientation = "vertical", type = "hover", fade = false, fadeFrom = "card", scrollbarClassName, viewportId, viewportRef, viewportClassName, scrollRestorationId, focusable = true, viewPortId, viewPortRef, viewPortClassName, scrollVerticalClassName, scrollHorizontalClassName, ...props }) => {
66
+ const refInner = useRef(null);
67
+ const refsViewport = useMergedRefs(refInner, viewportRef ?? viewPortRef);
68
+ useEffect(() => {
69
+ const el = refInner.current;
70
+ if (!el) return;
71
+ const observer = new ResizeObserver(() => {
72
+ el.style.setProperty("--scroll-area-width", `${el.clientWidth}px`);
73
+ el.style.setProperty("--scroll-area-height", `${el.clientHeight}px`);
74
+ });
75
+ observer.observe(el);
76
+ return () => {
77
+ observer.disconnect();
78
+ };
79
+ }, []);
80
+ return /* @__PURE__ */ jsxs(ScrollArea.Root, {
81
+ "data-slot": "scroll-area",
82
+ "data-focus": "inset",
83
+ className: cn("group/scroll-area relative grid min-w-0 grid-rows-1 overflow-hidden", className),
84
+ "data-fade": fade ? FADE_AXIS[orientation] : void 0,
85
+ ...NO_ROLE,
86
+ ...props,
87
+ children: [
88
+ (orientation === "vertical" || orientation === "both") && /* @__PURE__ */ jsx(ScrollBar, {
89
+ orientation: "vertical",
90
+ visibility: type,
91
+ className: cn(scrollbarClassName, scrollVerticalClassName)
92
+ }),
93
+ (orientation === "horizontal" || orientation === "both") && /* @__PURE__ */ jsx(ScrollBar, {
94
+ orientation: "horizontal",
95
+ visibility: type,
96
+ className: cn(scrollbarClassName, scrollHorizontalClassName)
97
+ }),
98
+ /* @__PURE__ */ jsx(ScrollArea.Corner, {}),
99
+ /* @__PURE__ */ jsx(ScrollArea.Viewport, {
100
+ "data-slot": "scroll-area-viewport",
101
+ id: viewportId ?? viewPortId,
102
+ ref: refsViewport,
103
+ "data-scroll-restoration-id": scrollRestorationId,
104
+ ...NO_ROLE,
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),
107
+ children: /* @__PURE__ */ jsx(ScrollArea.Content, {
108
+ ...NO_ROLE,
109
+ style: orientation === "vertical" ? { minWidth: 0 } : void 0,
110
+ children
111
+ })
112
+ })
113
+ ]
114
+ });
115
+ };
116
+ //#endregion
117
+ export { ScrollArea$1 as ScrollArea, ScrollBar };
118
+
119
+ //# sourceMappingURL=scroll-area.js.map
@@ -0,0 +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"}