@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
@@ -1,27 +1,8 @@
1
+ import { cn } from "../../../lib/utils.js";
1
2
  import { isValidElement } from "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { Button } from "@base-ui/react/button";
4
- import { clsx } from "clsx";
5
- import { twMerge } from "tailwind-merge";
6
5
  import { cva } from "class-variance-authority";
7
- import { Popover } from "@base-ui/react/popover";
8
- import { Input } from "@base-ui/react/input";
9
- //#region ../ui/src/lib/utils.ts
10
- var cn = (...inputs) => twMerge(clsx(inputs));
11
- /**
12
- * Normalise a size prop to a CSS length.
13
- *
14
- * Bare numbers become px, which is also what a bare numeric *string* means: an
15
- * element attribute arrives as a string, so `width="480"` and `width={480}` have
16
- * to land on the same value. Anything with a unit, a percentage or a keyword
17
- * passes through untouched.
18
- */
19
- var cssLength = (value) => {
20
- if (value == null || value === "") return;
21
- if (typeof value === "number") return Number.isFinite(value) ? `${value}px` : void 0;
22
- return /^-?\d*\.?\d+$/.test(value.trim()) ? `${value.trim()}px` : value;
23
- };
24
- //#endregion
25
6
  //#region ../ui/src/components/ui/button/button.tsx
26
7
  /**
27
8
  * The fill of a disabled Button that has one: muted, whichever way it is disabled (a button's own disabled, Base UI's
@@ -107,66 +88,6 @@ var Button$1 = ({ className, variant = "default", size = "default", ...props })
107
88
  });
108
89
  };
109
90
  //#endregion
110
- //#region ../ui/src/components/ui/popover/popover.tsx
111
- var Popover$1 = ({ ...props }) => {
112
- return /* @__PURE__ */ jsx(Popover.Root, {
113
- "data-slot": "popover",
114
- ...props
115
- });
116
- };
117
- var PopoverTrigger = ({ ...props }) => {
118
- return /* @__PURE__ */ jsx(Popover.Trigger, {
119
- "data-slot": "popover-trigger",
120
- ...props
121
- });
122
- };
123
- var PopoverContent = ({ className, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, anchor, ...props }) => {
124
- return /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
125
- align,
126
- alignOffset,
127
- anchor,
128
- side,
129
- sideOffset,
130
- className: "isolate z-50",
131
- children: /* @__PURE__ */ jsx(Popover.Popup, {
132
- "data-slot": "popover-content",
133
- 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),
134
- ...props
135
- })
136
- }) });
137
- };
138
- var PopoverHeader = ({ className, ...props }) => {
139
- return /* @__PURE__ */ jsx("div", {
140
- "data-slot": "popover-header",
141
- className: cn("flex flex-col gap-0.5 text-sm", className),
142
- ...props
143
- });
144
- };
145
- var PopoverTitle = ({ className, ...props }) => {
146
- return /* @__PURE__ */ jsx(Popover.Title, {
147
- "data-slot": "popover-title",
148
- className: cn("font-medium", className),
149
- ...props
150
- });
151
- };
152
- var PopoverDescription = ({ className, ...props }) => {
153
- return /* @__PURE__ */ jsx(Popover.Description, {
154
- "data-slot": "popover-description",
155
- className: cn("text-muted-foreground", className),
156
- ...props
157
- });
158
- };
159
- //#endregion
160
- //#region ../ui/src/components/ui/input/input.tsx
161
- var Input$1 = ({ className, type, ...props }) => {
162
- return /* @__PURE__ */ jsx(Input, {
163
- type,
164
- "data-slot": "input",
165
- className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground 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", className),
166
- ...props
167
- });
168
- };
169
- //#endregion
170
- export { PopoverHeader as a, Button$1 as c, cssLength as d, PopoverDescription as i, buttonVariants as l, Popover$1 as n, PopoverTitle as o, PopoverContent as r, PopoverTrigger as s, Input$1 as t, cn as u };
91
+ export { Button$1 as Button, buttonVariants };
171
92
 
172
- //# sourceMappingURL=input-syWxjY2U.js.map
93
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","names":[],"sources":["../../../../../../../ui/src/components/ui/button/button.tsx"],"sourcesContent":["import { Button as ButtonPrimitive } from '@base-ui/react/button';\nimport { cn } from '@edyn/ui/lib/utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { isValidElement } from 'react';\n\n/**\n * The fill of a disabled Button that has one: muted, whichever way it is disabled (a button's own disabled, Base UI's\n * data-disabled, or aria-disabled on a link), in the dark theme too, where the variants set their own fill. Ghost and link\n * have no fill to begin with and are given none: a grey box would turn a link into a button.\n */\nconst DISABLED_FILL =\n 'disabled:bg-muted data-disabled:bg-muted aria-disabled:bg-muted dark:disabled:bg-muted dark:data-disabled:bg-muted dark:aria-disabled:bg-muted';\n\nexport const buttonVariants = cva(\n \"group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all motion-reduce:transition-none motion-reduce:transform-none outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:not-aria-disabled:translate-y-px disabled:pointer-events-none disabled:border-transparent disabled:text-foreground/60 disabled:shadow-none disabled:focus-visible:ring-0 dark:disabled:border-transparent data-link-disabled:pointer-events-none data-link-disabled:focus-visible:ring-0 data-disabled:border-transparent data-disabled:text-foreground/60 data-disabled:shadow-none dark:data-disabled:border-transparent aria-disabled:border-transparent aria-disabled:text-foreground/60 aria-disabled:shadow-none dark:aria-disabled:border-transparent aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: `bg-primary text-primary-foreground hover:bg-primary/80 ${DISABLED_FILL}`,\n outline: `border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 ${DISABLED_FILL}`,\n secondary: `bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground ${DISABLED_FILL}`,\n ghost:\n 'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 aria-disabled:hover:bg-transparent dark:aria-disabled:hover:bg-transparent',\n destructive: `bg-destructive/10 text-destructive hover:bg-destructive/15 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/15 dark:hover:bg-destructive/20 dark:focus-visible:ring-destructive/40 ${DISABLED_FILL}`,\n link: 'text-primary underline-offset-4 hover:underline aria-disabled:hover:no-underline',\n },\n size: {\n default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n icon: 'size-8',\n 'icon-xs': \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\n/**\n * Whether this Button is rendering a link rather than a button, so it can keep\n * link semantics. Covers `render={<a href=\"...\" />}` and a routing component\n * that takes an `href` (Next's Link). A component with a different prop for its\n * destination (react-router's `to`) cannot be recognised from here: give those\n * `nativeButton={false} role={undefined}` directly.\n */\nconst rendersALink = (render: ButtonPrimitive.Props['render']): boolean =>\n isValidElement(render) && (render.type === 'a' || typeof (render.props as { href?: unknown }).href === 'string');\n\n/**\n * A link that looks like a button is still a link, and has to be announced as\n * one: it opens in a new tab, it has an address, Enter follows it and Space\n * scrolls the page.\n *\n * Base UI needs telling, in two steps. Rendering an anchor while `nativeButton`\n * is true (its default) warns in development and puts `type=\"button\"` on the\n * anchor; following the warning and passing `nativeButton={false}` then adds\n * `role=\"button\"`, which is what takes the link semantics away. So this does\n * both: non-native, with the role and the tabindex Base UI would add cleared\n * again. An explicit prop from the caller still wins over either.\n */\nconst LINK_PROPS = { nativeButton: false, role: undefined, tabIndex: undefined } as const;\n\n/**\n * A disabled link is not :disabled (only a form control can be), so the markup has to say it: Base UI already marks it\n * `aria-disabled` and `data-disabled` and stops the click, and this takes it out of the tab order, which LINK_PROPS\n * would otherwise leave to the browser. The href is kept on purpose, so a routing component that requires one keeps\n * working; the pointer is kept off the link by `data-link-disabled:pointer-events-none`, which also covers a middle\n * click and the context menu, and the click and Enter are stopped by Base UI. It is a data attribute of its own, not\n * `aria-disabled`, because an aria-disabled button (`focusableWhenDisabled`) is meant to stay hoverable and focusable so it\n * can say why it cannot act; only a native :disabled button and this link are inert.\n */\nconst DISABLED_LINK_PROPS = { ...LINK_PROPS, tabIndex: -1, 'data-link-disabled': '' } as const;\n\nexport const Button = ({\n className,\n variant = 'default',\n size = 'default',\n ...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) => {\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n {...(rendersALink(props.render) ? (props.disabled ? DISABLED_LINK_PROPS : LINK_PROPS) : {})}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;AAUA,IAAM,gBACJ;AAEF,IAAa,iBAAiB,IAC5B,qoCACA;CACE,UAAU;EACR,SAAS;GACP,SAAS,0DAA0D;GACnE,SAAS,mLAAmL;GAC5L,WAAW,kLAAkL;GAC7L,OACE;GACF,aAAa,+NAA+N;GAC5O,MAAM;EACR;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WAAW;GACX,WAAW;GACX,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;;;;;;;;AASA,IAAM,gBAAgB,WACpB,eAAe,MAAM,MAAM,OAAO,SAAS,OAAO,OAAQ,OAAO,MAA6B,SAAS;;;;;;;;;;;;;AAczG,IAAM,aAAa;CAAE,cAAc;CAAO,MAAM,KAAA;CAAW,UAAU,KAAA;AAAU;;;;;;;;;;AAW/E,IAAM,sBAAsB;CAAE,GAAG;CAAY,UAAU;CAAI,sBAAsB;AAAG;AAEpF,IAAa,YAAU,EACrB,WACA,UAAU,WACV,OAAO,WACP,GAAG,YAC8D;CACjE,OACE,oBAAC,QAAD;EACE,aAAU;EACV,GAAK,aAAa,MAAM,MAAM,IAAK,MAAM,WAAW,sBAAsB,aAAc,CAAC;EACzF,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;EAAU,CAAC,CAAC;EAC1D,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,37 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import * as React from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region ../ui/src/components/ui/button-group/button-group.tsx
5
+ var ButtonGroupContext = React.createContext("horizontal");
6
+ var ButtonGroup = ({ className, orientation = "horizontal", ...props }) => {
7
+ return /* @__PURE__ */ jsx(ButtonGroupContext.Provider, {
8
+ value: orientation,
9
+ children: /* @__PURE__ */ jsx("div", {
10
+ "data-slot": "button-group",
11
+ "data-orientation": orientation,
12
+ className: cn("inline-flex items-center", "[&>*:not(:first-child):not(:last-child)]:rounded-none", "data-[orientation=horizontal]:[&>*:first-child]:rounded-r-none", "data-[orientation=horizontal]:[&>*:last-child]:rounded-l-none", "data-[orientation=horizontal]:[&>*:not(:first-child)]:-ml-px", "data-[orientation=vertical]:flex-col", "data-[orientation=vertical]:[&>*:first-child]:rounded-b-none", "data-[orientation=vertical]:[&>*:last-child]:rounded-t-none", "data-[orientation=vertical]:[&>*:not(:first-child)]:-mt-px", "[&>*]:relative [&>*]:z-0 [&>*:focus-visible]:z-10 [&>*:hover]:z-10", className),
13
+ ...props
14
+ })
15
+ });
16
+ };
17
+ var ButtonGroupSeparator = ({ className, ...props }) => {
18
+ const orientation = React.useContext(ButtonGroupContext);
19
+ return /* @__PURE__ */ jsx("span", {
20
+ "data-slot": "button-group-separator",
21
+ role: "separator",
22
+ "aria-orientation": orientation === "horizontal" ? "vertical" : "horizontal",
23
+ className: cn("inline-flex shrink-0 self-stretch bg-border", "in-data-[orientation=horizontal]:w-px", "in-data-[orientation=vertical]:h-px in-data-[orientation=vertical]:self-auto in-data-[orientation=vertical]:w-full", className),
24
+ ...props
25
+ });
26
+ };
27
+ var ButtonGroupText = ({ className, ...props }) => {
28
+ return /* @__PURE__ */ jsx("span", {
29
+ "data-slot": "button-group-text",
30
+ className: cn("inline-flex shrink-0 items-center justify-center rounded-none border border-border bg-muted px-2.5 text-sm text-muted-foreground select-none", className),
31
+ ...props
32
+ });
33
+ };
34
+ //#endregion
35
+ export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText };
36
+
37
+ //# sourceMappingURL=button-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-group.js","names":[],"sources":["../../../../../../../ui/src/components/ui/button-group/button-group.tsx"],"sourcesContent":["import { cn } from '@edyn/ui/lib/utils';\nimport * as React from 'react';\n\nexport type TButtonGroupOrientation = 'horizontal' | 'vertical';\n\nexport interface IButtonGroupProps extends React.ComponentProps<'div'> {\n orientation?: TButtonGroupOrientation;\n}\n\nconst ButtonGroupContext = React.createContext<TButtonGroupOrientation>('horizontal');\n\nexport const ButtonGroup = ({ className, orientation = 'horizontal', ...props }: IButtonGroupProps) => {\n return (\n <ButtonGroupContext.Provider value={orientation}>\n <div\n data-slot=\"button-group\"\n data-orientation={orientation}\n className={cn(\n 'inline-flex items-center',\n '[&>*:not(:first-child):not(:last-child)]:rounded-none',\n 'data-[orientation=horizontal]:[&>*:first-child]:rounded-r-none',\n 'data-[orientation=horizontal]:[&>*:last-child]:rounded-l-none',\n 'data-[orientation=horizontal]:[&>*:not(:first-child)]:-ml-px',\n 'data-[orientation=vertical]:flex-col',\n 'data-[orientation=vertical]:[&>*:first-child]:rounded-b-none',\n 'data-[orientation=vertical]:[&>*:last-child]:rounded-t-none',\n 'data-[orientation=vertical]:[&>*:not(:first-child)]:-mt-px',\n '[&>*]:relative [&>*]:z-0 [&>*:focus-visible]:z-10 [&>*:hover]:z-10',\n className,\n )}\n {...props}\n />\n </ButtonGroupContext.Provider>\n );\n};\n\nexport interface IButtonGroupSeparatorProps extends React.ComponentProps<'span'> {}\n\nexport const ButtonGroupSeparator = ({ className, ...props }: IButtonGroupSeparatorProps) => {\n const orientation = React.useContext(ButtonGroupContext);\n\n return (\n // biome-ignore lint/a11y/useFocusableInteractive: decorative visual divider between buttons; not an interactive widget\n // biome-ignore lint/a11y/useSemanticElements: <span> is intentional; no semantic HTML equivalent for an inline button-group separator\n <span\n data-slot=\"button-group-separator\"\n // biome-ignore lint/a11y/useAriaPropsForRole: aria-valuenow applies only when separator acts as a range slider; this is a static divider\n role=\"separator\"\n // The separator runs perpendicular to the group's axis.\n aria-orientation={orientation === 'horizontal' ? 'vertical' : 'horizontal'}\n className={cn(\n 'inline-flex shrink-0 self-stretch bg-border',\n 'in-data-[orientation=horizontal]:w-px',\n 'in-data-[orientation=vertical]:h-px in-data-[orientation=vertical]:self-auto in-data-[orientation=vertical]:w-full',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport interface IButtonGroupTextProps extends React.ComponentProps<'span'> {}\n\nexport const ButtonGroupText = ({ className, ...props }: IButtonGroupTextProps) => {\n return (\n <span\n data-slot=\"button-group-text\"\n className={cn(\n 'inline-flex shrink-0 items-center justify-center rounded-none border border-border bg-muted px-2.5 text-sm text-muted-foreground select-none',\n className,\n )}\n {...props}\n />\n );\n};\n"],"mappings":";;;;AASA,IAAM,qBAAqB,MAAM,cAAuC,YAAY;AAEpF,IAAa,eAAe,EAAE,WAAW,cAAc,cAAc,GAAG,YAA+B;CACrG,OACE,oBAAC,mBAAmB,UAApB;EAA6B,OAAO;EAClC,UAAA,oBAAC,OAAD;GACE,aAAU;GACV,oBAAkB;GAClB,WAAW,GACT,4BACA,yDACA,kEACA,iEACA,gEACA,wCACA,gEACA,+DACA,8DACA,sEACA,SACF;GACA,GAAI;EACL,CAAA;CAC0B,CAAA;AAEjC;AAIA,IAAa,wBAAwB,EAAE,WAAW,GAAG,YAAwC;CAC3F,MAAM,cAAc,MAAM,WAAW,kBAAkB;CAEvD,OAGE,oBAAC,QAAD;EACE,aAAU;EAEV,MAAK;EAEL,oBAAkB,gBAAgB,eAAe,aAAa;EAC9D,WAAW,GACT,+CACA,yCACA,sHACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAIA,IAAa,mBAAmB,EAAE,WAAW,GAAG,YAAmC;CACjF,OACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GACT,gJACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -1,7 +1,8 @@
1
- import { c as Button, l as buttonVariants, n as Popover, r as PopoverContent, s as PopoverTrigger, u as cn } from "./input-syWxjY2U.js";
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { Button, buttonVariants } from "../button/button.js";
2
3
  import * as React from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { IconCalendar, IconChevronDown, IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { IconChevronDown, IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
5
6
  import { DayPicker, getDefaultClassNames } from "react-day-picker";
6
7
  //#region ../ui/src/components/ui/calendar/calendar.tsx
7
8
  var Calendar = ({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) => {
@@ -104,101 +105,6 @@ var CalendarDayButton = ({ className, day, modifiers, locale, ...props }) => {
104
105
  });
105
106
  };
106
107
  //#endregion
107
- //#region ../ui/src/hooks/use-mobile.ts
108
- var MOBILE_BREAKPOINT = 768;
109
- var useIsMobile = () => {
110
- const [isMobile, setIsMobile] = React.useState(void 0);
111
- React.useEffect(() => {
112
- const mql = window.matchMedia(`(max-width: 767px)`);
113
- const onChange = () => {
114
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
115
- };
116
- mql.addEventListener("change", onChange);
117
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
118
- return () => mql.removeEventListener("change", onChange);
119
- }, []);
120
- return !!isMobile;
121
- };
122
- //#endregion
123
- //#region ../ui/src/lib/first-weekday.ts
124
- var SUNDAY_FIRST = /* @__PURE__ */ new Set([
125
- "US",
126
- "CA",
127
- "MX",
128
- "BR",
129
- "JP",
130
- "IL",
131
- "IN",
132
- "PH",
133
- "ZA",
134
- "KR",
135
- "TW",
136
- "HK",
137
- "SA"
138
- ]);
139
- /**
140
- * The weekday a locale starts its week on, 0 for Sunday to 6 for Saturday, from Intl, so en-GB starts on Monday and en-US on
141
- * Sunday with no locale data of our own shipped. A browser without week info gets the region's usual start.
142
- */
143
- var firstWeekdayOf = (locale) => {
144
- try {
145
- const info = new Intl.Locale(locale);
146
- const first = info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay;
147
- if (first !== void 0) return first % 7;
148
- return SUNDAY_FIRST.has(info.region ?? "") ? 0 : 1;
149
- } catch {
150
- return 0;
151
- }
152
- };
153
- //#endregion
154
- //#region ../ui/src/components/edyn/date-range-picker/date-range-picker.tsx
155
- var dayToDate = (value) => value === void 0 ? void 0 : /* @__PURE__ */ new Date(`${value}T12:00:00`);
156
- var dateToDay = (date) => date === void 0 ? void 0 : `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
157
- /** A range of calendar days, either end optional; two months side by side, one on a phone. */
158
- var DateRangePicker = ({ id, value, onValueChange, placeholder = "Select date range", locale = "en-GB", summary = "range", "aria-label": ariaLabel, className, ...props }) => {
159
- const isMobile = useIsMobile();
160
- const from = dayToDate(value.from);
161
- const to = dayToDate(value.to);
162
- const format = new Intl.DateTimeFormat(locale, {
163
- day: "2-digit",
164
- month: "short",
165
- year: "numeric"
166
- });
167
- const ends = [from, to].filter((date) => date !== void 0).map((date) => format.format(date));
168
- return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
169
- render: /* @__PURE__ */ jsx(Button, {
170
- ...props,
171
- id,
172
- "aria-label": ariaLabel,
173
- "data-slot": "date-range-picker-trigger",
174
- "data-set": ends.length > 0 ? "" : void 0,
175
- variant: "outline",
176
- className: cn("w-full min-w-0 justify-start font-normal", ends.length === 0 && "text-muted-foreground", className)
177
- }),
178
- children: [/* @__PURE__ */ jsx(IconCalendar, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", {
179
- className: "truncate",
180
- children: ends.length === 0 || summary === "label" ? placeholder : ends.join(" – ")
181
- })]
182
- }), /* @__PURE__ */ jsx(PopoverContent, {
183
- align: "start",
184
- className: "w-auto p-0",
185
- children: /* @__PURE__ */ jsx(Calendar, {
186
- mode: "range",
187
- defaultMonth: from,
188
- numberOfMonths: isMobile ? 1 : 2,
189
- weekStartsOn: firstWeekdayOf(locale),
190
- selected: {
191
- from,
192
- to
193
- },
194
- onSelect: (range) => onValueChange({
195
- from: dateToDay(range?.from),
196
- to: dateToDay(range?.to)
197
- })
198
- })
199
- })] });
200
- };
201
- //#endregion
202
- export { useIsMobile as a, firstWeekdayOf as i, dateToDay as n, Calendar as o, dayToDate as r, CalendarDayButton as s, DateRangePicker as t };
108
+ export { Calendar, CalendarDayButton };
203
109
 
204
- //# sourceMappingURL=date-range-picker-CWVcHgy2.js.map
110
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","names":[],"sources":["../../../../../../../ui/src/components/ui/calendar/calendar.tsx"],"sourcesContent":["import { cn } from '@edyn/ui/lib/utils';\nimport { IconChevronDown, IconChevronLeft, IconChevronRight } from '@tabler/icons-react';\nimport * as React from 'react';\nimport { type DayButton, DayPicker, getDefaultClassNames, type Locale } from 'react-day-picker';\nimport { Button, buttonVariants } from '../button';\n\nexport const Calendar = ({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n locale,\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant'];\n}) => {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n 'group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n locale={locale}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: 'short' }),\n ...formatters,\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn('absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1', defaultClassNames.nav),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_next,\n ),\n month_caption: cn('flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)', defaultClassNames.month_caption),\n dropdowns: cn('flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium', defaultClassNames.dropdowns),\n dropdown_root: cn('relative rounded-(--cell-radius)', defaultClassNames.dropdown_root),\n dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'font-medium select-none',\n captionLayout === 'label'\n ? 'text-sm'\n : 'flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label,\n ),\n month_grid: cn('w-full border-collapse', defaultClassNames.month_grid),\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn('flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none', defaultClassNames.weekday),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn('w-(--cell-size) select-none', defaultClassNames.week_number_header),\n week_number: cn('text-[0.8rem] text-muted-foreground select-none', defaultClassNames.week_number),\n day: cn(\n 'group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)',\n props.showWeekNumber\n ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'\n : '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',\n defaultClassNames.day,\n ),\n range_start: cn(\n 'relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted',\n defaultClassNames.range_start,\n ),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn(\n 'relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted',\n defaultClassNames.range_end,\n ),\n today: cn('rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none', defaultClassNames.today),\n outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return <div data-slot=\"calendar\" ref={rootRef} className={cn(className)} {...props} />;\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === 'left') {\n return <IconChevronLeft className={cn('size-4', className)} {...props} />;\n }\n\n if (orientation === 'right') {\n return <IconChevronRight className={cn('size-4', className)} {...props} />;\n }\n\n return <IconChevronDown className={cn('size-4', className)} {...props} />;\n },\n DayButton: ({ ...props }) => <CalendarDayButton locale={locale} {...props} />,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">{children}</div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n};\n\nexport const CalendarDayButton = ({\n className,\n day,\n modifiers,\n locale,\n ...props\n}: React.ComponentProps<typeof DayButton> & { locale?: Partial<Locale> }) => {\n const defaultClassNames = getDefaultClassNames();\n\n const refButton = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) {\n refButton.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={refButton}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString(locale?.code)}\n data-selected-single={modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle}\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;AAMA,IAAa,YAAY,EACvB,WACA,YACA,kBAAkB,MAClB,gBAAgB,SAChB,gBAAgB,SAChB,QACA,YACA,YACA,GAAG,YAGC;CACJ,MAAM,oBAAoB,qBAAqB;CAE/C,OACE,oB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AY,CAAC,UAAU,eAAe,CAAC,UAAU,aAAa,CAAC,UAAU;EACzG,oBAAkB,UAAU;EAC5B,kBAAgB,UAAU;EAC1B,qBAAmB,UAAU;EAC7B,WAAW,GACT,w7BACA,kBAAkB,KAClB,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,57 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region ../ui/src/components/ui/card/card.tsx
4
+ var Card = ({ className, size = "default", ...props }) => {
5
+ return /* @__PURE__ */ jsx("div", {
6
+ "data-slot": "card",
7
+ "data-size": size,
8
+ className: cn("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className),
9
+ ...props
10
+ });
11
+ };
12
+ var CardHeader = ({ className, ...props }) => {
13
+ return /* @__PURE__ */ jsx("div", {
14
+ "data-slot": "card-header",
15
+ className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3", className),
16
+ ...props
17
+ });
18
+ };
19
+ var CardTitle = ({ className, ...props }) => {
20
+ return /* @__PURE__ */ jsx("div", {
21
+ "data-slot": "card-title",
22
+ className: cn("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className),
23
+ ...props
24
+ });
25
+ };
26
+ var CardDescription = ({ className, ...props }) => {
27
+ return /* @__PURE__ */ jsx("div", {
28
+ "data-slot": "card-description",
29
+ className: cn("text-sm text-muted-foreground", className),
30
+ ...props
31
+ });
32
+ };
33
+ var CardAction = ({ className, ...props }) => {
34
+ return /* @__PURE__ */ jsx("div", {
35
+ "data-slot": "card-action",
36
+ className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
37
+ ...props
38
+ });
39
+ };
40
+ var CardContent = ({ className, ...props }) => {
41
+ return /* @__PURE__ */ jsx("div", {
42
+ "data-slot": "card-content",
43
+ className: cn("px-4 group-data-[size=sm]/card:px-3", className),
44
+ ...props
45
+ });
46
+ };
47
+ var CardFooter = ({ className, ...props }) => {
48
+ return /* @__PURE__ */ jsx("div", {
49
+ "data-slot": "card-footer",
50
+ className: cn("flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3", className),
51
+ ...props
52
+ });
53
+ };
54
+ //#endregion
55
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
56
+
57
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","names":[],"sources":["../../../../../../../ui/src/components/ui/card/card.tsx"],"sourcesContent":["import { cn } from '@edyn/ui/lib/utils';\nimport type * as React from 'react';\n\nexport const Card = ({ className, size = 'default', ...props }: React.ComponentProps<'div'> & { size?: 'default' | 'sm' }) => {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n 'group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const CardHeader = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3',\n className,\n )}\n {...props}\n />\n );\n};\n\nexport const CardTitle = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"card-title\" className={cn('text-base leading-snug font-medium group-data-[size=sm]/card:text-sm', className)} {...props} />;\n};\n\nexport const CardDescription = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"card-description\" className={cn('text-sm text-muted-foreground', className)} {...props} />;\n};\n\nexport const CardAction = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"card-action\" className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)} {...props} />;\n};\n\nexport const CardContent = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"card-content\" className={cn('px-4 group-data-[size=sm]/card:px-3', className)} {...props} />;\n};\n\nexport const CardFooter = ({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3', className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;AAGA,IAAa,QAAQ,EAAE,WAAW,OAAO,WAAW,GAAG,YAAuE;CAC5H,OACE,oBAAC,OAAD;EACE,aAAU;EACV,aAAW;EACX,WAAW,GACT,wVACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAyC;CAClF,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,sSACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,aAAa,EAAE,WAAW,GAAG,YAAyC;CACjF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAa,WAAW,GAAG,wEAAwE,SAAS;EAAG,GAAI;CAAQ,CAAA;AACnJ;AAEA,IAAa,mBAAmB,EAAE,WAAW,GAAG,YAAyC;CACvF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAmB,WAAW,GAAG,iCAAiC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAClH;AAEA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAyC;CAClF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAc,WAAW,GAAG,kEAAkE,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC9I;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAyC;CACnF,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,uCAAuC,SAAS;EAAG,GAAI;CAAQ,CAAA;AACpH;AAEA,IAAa,cAAc,EAAE,WAAW,GAAG,YAAyC;CAClF,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,yFAAyF,SAAS;EAChH,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,136 @@
1
+ "use client";
2
+ import { cn } from "../../../lib/utils.js";
3
+ import { Button } from "../button/button.js";
4
+ import * as React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
7
+ import useEmblaCarousel from "embla-carousel-react";
8
+ //#region ../ui/src/components/ui/carousel/carousel.tsx
9
+ var CarouselContext = React.createContext(null);
10
+ var useCarousel = () => {
11
+ const context = React.useContext(CarouselContext);
12
+ if (!context) throw new Error("useCarousel must be used within a <Carousel />");
13
+ return context;
14
+ };
15
+ var Carousel = ({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) => {
16
+ const [carouselRef, api] = useEmblaCarousel({
17
+ ...opts,
18
+ axis: orientation === "horizontal" ? "x" : "y"
19
+ }, plugins);
20
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false);
21
+ const [canScrollNext, setCanScrollNext] = React.useState(false);
22
+ const onSelect = React.useCallback((api) => {
23
+ if (!api) return;
24
+ setCanScrollPrev(api.canScrollPrev());
25
+ setCanScrollNext(api.canScrollNext());
26
+ }, []);
27
+ const scrollPrev = React.useCallback(() => {
28
+ api?.scrollPrev();
29
+ }, [api]);
30
+ const scrollNext = React.useCallback(() => {
31
+ api?.scrollNext();
32
+ }, [api]);
33
+ const handleKeyDown = React.useCallback((event) => {
34
+ if (event.key === "ArrowLeft") {
35
+ event.preventDefault();
36
+ scrollPrev();
37
+ } else if (event.key === "ArrowRight") {
38
+ event.preventDefault();
39
+ scrollNext();
40
+ }
41
+ }, [scrollPrev, scrollNext]);
42
+ React.useEffect(() => {
43
+ if (!api || !setApi) return;
44
+ setApi(api);
45
+ }, [api, setApi]);
46
+ React.useEffect(() => {
47
+ if (!api) return;
48
+ onSelect(api);
49
+ api.on("reInit", onSelect);
50
+ api.on("select", onSelect);
51
+ return () => {
52
+ api.off("reInit", onSelect);
53
+ api.off("select", onSelect);
54
+ };
55
+ }, [api, onSelect]);
56
+ return /* @__PURE__ */ jsx(CarouselContext.Provider, {
57
+ value: {
58
+ carouselRef,
59
+ api,
60
+ opts,
61
+ orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
62
+ scrollPrev,
63
+ scrollNext,
64
+ canScrollPrev,
65
+ canScrollNext
66
+ },
67
+ children: /* @__PURE__ */ jsx("div", {
68
+ onKeyDownCapture: handleKeyDown,
69
+ className: cn("relative", className),
70
+ role: "region",
71
+ "aria-roledescription": "carousel",
72
+ "data-slot": "carousel",
73
+ ...props,
74
+ children
75
+ })
76
+ });
77
+ };
78
+ var CarouselContent = ({ className, ...props }) => {
79
+ const { carouselRef, orientation } = useCarousel();
80
+ return /* @__PURE__ */ jsx("div", {
81
+ ref: carouselRef,
82
+ className: "overflow-hidden",
83
+ "data-slot": "carousel-content",
84
+ "data-focus": "inset",
85
+ children: /* @__PURE__ */ jsx("div", {
86
+ className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
87
+ ...props
88
+ })
89
+ });
90
+ };
91
+ var CarouselItem = ({ className, ...props }) => {
92
+ const { orientation } = useCarousel();
93
+ return /* @__PURE__ */ jsx("div", {
94
+ role: "group",
95
+ "aria-roledescription": "slide",
96
+ "data-slot": "carousel-item",
97
+ className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className),
98
+ ...props
99
+ });
100
+ };
101
+ var CarouselPrevious = ({ className, variant = "outline", size = "icon-sm", ...props }) => {
102
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
103
+ return /* @__PURE__ */ jsxs(Button, {
104
+ "data-slot": "carousel-previous",
105
+ variant,
106
+ size,
107
+ className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
108
+ disabled: !canScrollPrev,
109
+ onClick: scrollPrev,
110
+ ...props,
111
+ children: [/* @__PURE__ */ jsx(IconChevronLeft, {}), /* @__PURE__ */ jsx("span", {
112
+ className: "sr-only",
113
+ children: "Previous slide"
114
+ })]
115
+ });
116
+ };
117
+ var CarouselNext = ({ className, variant = "outline", size = "icon-sm", ...props }) => {
118
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
119
+ return /* @__PURE__ */ jsxs(Button, {
120
+ "data-slot": "carousel-next",
121
+ variant,
122
+ size,
123
+ className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
124
+ disabled: !canScrollNext,
125
+ onClick: scrollNext,
126
+ ...props,
127
+ children: [/* @__PURE__ */ jsx(IconChevronRight, {}), /* @__PURE__ */ jsx("span", {
128
+ className: "sr-only",
129
+ children: "Next slide"
130
+ })]
131
+ });
132
+ };
133
+ //#endregion
134
+ export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
135
+
136
+ //# sourceMappingURL=carousel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousel.js","names":[],"sources":["../../../../../../../ui/src/components/ui/carousel/carousel.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@edyn/ui/lib/utils';\nimport { IconChevronLeft, IconChevronRight } from '@tabler/icons-react';\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport * as React from 'react';\nimport { Button } from '../button';\n\nexport type TCarouselApi = UseEmblaCarouselType[1];\ntype TUseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype TCarouselOptions = TUseCarouselParameters[0];\ntype TCarouselPlugin = TUseCarouselParameters[1];\n\ntype TCarouselProps = {\n opts?: TCarouselOptions;\n plugins?: TCarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: TCarouselApi) => void;\n};\n\ntype TCarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & TCarouselProps;\n\nconst CarouselContext = React.createContext<TCarouselContextProps | null>(null);\n\nexport const useCarousel = () => {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n};\n\nexport const Carousel = ({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & TCarouselProps) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: TCarouselApi) => {\n if (!api) {\n return;\n }\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api.off('reInit', onSelect);\n api.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n {/* The generated shadcn carousel deliberately uses ARIA carousel semantics on a div. */}\n {/* biome-ignore lint/a11y/useSemanticElements: section would change the public root element. */}\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n};\n\nexport const CarouselContent = ({ className, ...props }: React.ComponentProps<'div'>) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\" data-focus=\"inset\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n );\n};\n\nexport const CarouselItem = ({ className, ...props }: React.ComponentProps<'div'>) => {\n const { orientation } = useCarousel();\n\n return (\n // The generated shadcn carousel deliberately uses the ARIA group role for each slide.\n // biome-ignore lint/a11y/useSemanticElements: fieldset is not an equivalent carousel slide element.\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n {...props}\n />\n );\n};\n\nexport const CarouselPrevious = ({ className, variant = 'outline', size = 'icon-sm', ...props }: React.ComponentProps<typeof Button>) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal' ? 'inset-y-0 -left-12 my-auto' : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <IconChevronLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n};\n\nexport const CarouselNext = ({ className, variant = 'outline', size = 'icon-sm', ...props }: React.ComponentProps<typeof Button>) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal' ? 'inset-y-0 -right-12 my-auto' : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <IconChevronRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n};\n"],"mappings":";;;;;;;;AA6BA,IAAM,kBAAkB,MAAM,cAA4C,IAAI;AAE9E,IAAa,oBAAoB;CAC/B,MAAM,UAAU,MAAM,WAAW,eAAe;CAEhD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,gDAAgD;CAGlE,OAAO;AACT;AAEA,IAAa,YAAY,EACvB,cAAc,cACd,MACA,QACA,SACA,WACA,UACA,GAAG,YAC+C;CAClD,MAAM,CAAC,aAAa,OAAO,iBACzB;EACE,GAAG;EACH,MAAM,gBAAgB,eAAe,MAAM;CAC7C,GACA,OACF;CACA,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAS,KAAK;CAC9D,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAS,KAAK;CAE9D,MAAM,WAAW,MAAM,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