asheeui 0.6.2 → 0.6.3

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 (281) hide show
  1. package/dist/AsheeUIProvider.d.ts +34 -0
  2. package/dist/AsheeUIProvider.d.ts.map +1 -1
  3. package/dist/components/accordion/Accordion.d.ts +55 -44
  4. package/dist/components/accordion/Accordion.d.ts.map +1 -1
  5. package/dist/components/accordion/Accordion.js +27 -27
  6. package/dist/components/accordion/accordion-config.d.ts +41 -12
  7. package/dist/components/accordion/accordion-config.d.ts.map +1 -1
  8. package/dist/components/accordion/accordion-styles.d.ts +20 -0
  9. package/dist/components/accordion/accordion-styles.d.ts.map +1 -1
  10. package/dist/components/accordion/accordion-styles.js +1 -1
  11. package/dist/components/autocomplete/Autocomplete.d.ts +59 -39
  12. package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
  13. package/dist/components/autocomplete/Autocomplete.js +98 -91
  14. package/dist/components/autocomplete/autocomplete-config.d.ts +9 -62
  15. package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
  16. package/dist/components/autocomplete/autocomplete-config.js +6 -21
  17. package/dist/components/button/Button.d.ts +50 -51
  18. package/dist/components/button/Button.d.ts.map +1 -1
  19. package/dist/components/button/Button.js +19 -19
  20. package/dist/components/button/button-config.d.ts +23 -15
  21. package/dist/components/button/button-config.d.ts.map +1 -1
  22. package/dist/components/button/button-styles.d.ts +11 -1
  23. package/dist/components/button/button-styles.d.ts.map +1 -1
  24. package/dist/components/card/Card.d.ts +85 -43
  25. package/dist/components/card/Card.d.ts.map +1 -1
  26. package/dist/components/card/Card.js +49 -49
  27. package/dist/components/card/card-config.d.ts +35 -18
  28. package/dist/components/card/card-config.d.ts.map +1 -1
  29. package/dist/components/card/card-config.js +0 -2
  30. package/dist/components/card/card-styles.d.ts +17 -1
  31. package/dist/components/card/card-styles.d.ts.map +1 -1
  32. package/dist/components/carousel/Carousel.d.ts +107 -12
  33. package/dist/components/carousel/Carousel.d.ts.map +1 -1
  34. package/dist/components/carousel/Carousel.js +63 -64
  35. package/dist/components/carousel/carousel-config.d.ts +94 -7
  36. package/dist/components/carousel/carousel-config.d.ts.map +1 -1
  37. package/dist/components/carousel/carousel-config.js +6 -4
  38. package/dist/components/carousel/carousel-styles.d.ts +32 -1
  39. package/dist/components/carousel/carousel-styles.d.ts.map +1 -1
  40. package/dist/components/chip/Chip.d.ts +55 -34
  41. package/dist/components/chip/Chip.d.ts.map +1 -1
  42. package/dist/components/chip/Chip.js +71 -72
  43. package/dist/components/chip/chip-config.d.ts +29 -15
  44. package/dist/components/chip/chip-config.d.ts.map +1 -1
  45. package/dist/components/chip/chip-config.js +5 -6
  46. package/dist/components/chip/chip-styles.d.ts +21 -1
  47. package/dist/components/chip/chip-styles.d.ts.map +1 -1
  48. package/dist/components/date-picker/DatePicker.d.ts +166 -2
  49. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  50. package/dist/components/date-picker/DatePicker.js +110 -99
  51. package/dist/components/date-picker/date-picker-config.d.ts +31 -0
  52. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  53. package/dist/components/date-picker/date-picker-config.js +8 -16
  54. package/dist/components/date-picker/date-picker-styles.d.ts +21 -1
  55. package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
  56. package/dist/components/date-picker/date-picker-styles.js +7 -11
  57. package/dist/components/drawer/Drawer.d.ts +97 -7
  58. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  59. package/dist/components/drawer/Drawer.js +9 -9
  60. package/dist/components/drawer/drawer-config.d.ts +54 -1
  61. package/dist/components/drawer/drawer-config.d.ts.map +1 -1
  62. package/dist/components/drawer/drawer-styles.d.ts +21 -0
  63. package/dist/components/drawer/drawer-styles.d.ts.map +1 -1
  64. package/dist/components/field/FieldShell.d.ts +86 -0
  65. package/dist/components/field/FieldShell.d.ts.map +1 -1
  66. package/dist/components/field/field-config.d.ts +66 -3
  67. package/dist/components/field/field-config.d.ts.map +1 -1
  68. package/dist/components/field/field-config.js +2 -1
  69. package/dist/components/field/field-styles.d.ts +22 -0
  70. package/dist/components/field/field-styles.d.ts.map +1 -1
  71. package/dist/components/field/field-styles.js +10 -0
  72. package/dist/components/field/index.js +1 -0
  73. package/dist/components/image/Image.d.ts +35 -28
  74. package/dist/components/image/Image.d.ts.map +1 -1
  75. package/dist/components/image/Image.js +7 -7
  76. package/dist/components/image/image-config.d.ts +25 -7
  77. package/dist/components/image/image-config.d.ts.map +1 -1
  78. package/dist/components/image/image-styles.d.ts +9 -0
  79. package/dist/components/image/image-styles.d.ts.map +1 -1
  80. package/dist/components/input/Input.d.ts +117 -10
  81. package/dist/components/input/Input.d.ts.map +1 -1
  82. package/dist/components/input/Input.js +20 -20
  83. package/dist/components/input/PasswordInput.d.ts +48 -0
  84. package/dist/components/input/PasswordInput.d.ts.map +1 -1
  85. package/dist/components/input/input-config.d.ts +10 -1
  86. package/dist/components/input/input-config.d.ts.map +1 -1
  87. package/dist/components/input/input-config.js +5 -8
  88. package/dist/components/input/input-styles.d.ts +10 -0
  89. package/dist/components/input/input-styles.d.ts.map +1 -1
  90. package/dist/components/input/input-styles.js +5 -9
  91. package/dist/components/keyboard/OnScreenKeyboard.d.ts +58 -8
  92. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  93. package/dist/components/keyboard/OnScreenKeyboard.js +49 -48
  94. package/dist/components/keyboard/index.js +1 -1
  95. package/dist/components/keyboard/keyboard-config.d.ts +88 -3
  96. package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
  97. package/dist/components/keyboard/{default-keyboard-config.js → keyboard-config.js} +7 -1
  98. package/dist/components/keyboard/keyboard-context.d.ts +103 -13
  99. package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
  100. package/dist/components/keyboard/keyboard-context.js +66 -68
  101. package/dist/components/keyboard/use-keyboard-field.d.ts +37 -0
  102. package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
  103. package/dist/components/link/Link.d.ts +118 -9
  104. package/dist/components/link/Link.d.ts.map +1 -1
  105. package/dist/components/link/Link.js +29 -30
  106. package/dist/components/link/link-config.d.ts +58 -5
  107. package/dist/components/link/link-config.d.ts.map +1 -1
  108. package/dist/components/link/link-styles.d.ts +24 -4
  109. package/dist/components/link/link-styles.d.ts.map +1 -1
  110. package/dist/components/marquee/Marquee.d.ts +77 -8
  111. package/dist/components/marquee/Marquee.d.ts.map +1 -1
  112. package/dist/components/marquee/Marquee.js +5 -5
  113. package/dist/components/marquee/marquee-config.d.ts +74 -0
  114. package/dist/components/marquee/marquee-config.d.ts.map +1 -1
  115. package/dist/components/marquee/marquee-styles.d.ts +12 -0
  116. package/dist/components/marquee/marquee-styles.d.ts.map +1 -1
  117. package/dist/components/modal/Modal.d.ts +113 -25
  118. package/dist/components/modal/Modal.d.ts.map +1 -1
  119. package/dist/components/modal/Modal.js +75 -82
  120. package/dist/components/modal/modal-config.d.ts +59 -1
  121. package/dist/components/modal/modal-config.d.ts.map +1 -1
  122. package/dist/components/modal/modal-styles.d.ts +8 -1
  123. package/dist/components/modal/modal-styles.d.ts.map +1 -1
  124. package/dist/components/modal/modal-styles.js +4 -11
  125. package/dist/components/multi-select/MultiSelect.d.ts +152 -23
  126. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  127. package/dist/components/multi-select/MultiSelect.js +195 -217
  128. package/dist/components/multi-select/multi-select-config.d.ts +61 -23
  129. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  130. package/dist/components/multi-select/multi-select-config.js +16 -25
  131. package/dist/components/multi-select/multi-select-styles.d.ts +17 -0
  132. package/dist/components/multi-select/multi-select-styles.d.ts.map +1 -1
  133. package/dist/components/multi-select/multi-select-styles.js +9 -13
  134. package/dist/components/radio/Radio.d.ts +137 -13
  135. package/dist/components/radio/Radio.d.ts.map +1 -1
  136. package/dist/components/radio/Radio.js +66 -141
  137. package/dist/components/radio/RadioGroup.d.ts +88 -23
  138. package/dist/components/radio/RadioGroup.d.ts.map +1 -1
  139. package/dist/components/radio/RadioGroup.js +141 -66
  140. package/dist/components/radio/radio-config.d.ts +36 -11
  141. package/dist/components/radio/radio-config.d.ts.map +1 -1
  142. package/dist/components/radio/radio-config.js +9 -11
  143. package/dist/components/radio/radio-context.d.ts +44 -1
  144. package/dist/components/radio/radio-context.d.ts.map +1 -1
  145. package/dist/components/radio/radio-styles.d.ts +24 -1
  146. package/dist/components/radio/radio-styles.d.ts.map +1 -1
  147. package/dist/components/resizable-screen/ResizableScreen.d.ts +79 -32
  148. package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
  149. package/dist/components/resizable-screen/ResizableScreen.js +77 -72
  150. package/dist/components/resizable-screen/resizable-screen-config.d.ts +62 -0
  151. package/dist/components/resizable-screen/resizable-screen-config.d.ts.map +1 -1
  152. package/dist/components/scrollbar/scrollbar-config.d.ts +44 -9
  153. package/dist/components/scrollbar/scrollbar-config.d.ts.map +1 -1
  154. package/dist/components/select/Select.d.ts +157 -17
  155. package/dist/components/select/Select.d.ts.map +1 -1
  156. package/dist/components/select/Select.js +141 -152
  157. package/dist/components/select/select-config.d.ts +26 -19
  158. package/dist/components/select/select-config.d.ts.map +1 -1
  159. package/dist/components/select/select-config.js +5 -21
  160. package/dist/components/select/select-styles.d.ts +10 -0
  161. package/dist/components/select/select-styles.d.ts.map +1 -1
  162. package/dist/components/select/select-styles.js +5 -9
  163. package/dist/components/select-menu/SelectMenu.d.ts +125 -8
  164. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  165. package/dist/components/select-menu/SelectMenu.js +107 -79
  166. package/dist/components/select-menu/index.d.ts +2 -0
  167. package/dist/components/select-menu/index.d.ts.map +1 -1
  168. package/dist/components/select-menu/index.js +1 -0
  169. package/dist/components/select-menu/select-menu-config.d.ts +82 -0
  170. package/dist/components/select-menu/select-menu-config.d.ts.map +1 -0
  171. package/dist/components/select-menu/select-menu-config.js +12 -0
  172. package/dist/components/sidebar/Sidebar.d.ts +151 -51
  173. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  174. package/dist/components/sidebar/Sidebar.js +211 -232
  175. package/dist/components/sidebar/sidebar-config.d.ts +140 -21
  176. package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
  177. package/dist/components/sidebar/sidebar-config.js +9 -12
  178. package/dist/components/sidebar/sidebar-styles.d.ts +24 -0
  179. package/dist/components/sidebar/sidebar-styles.d.ts.map +1 -1
  180. package/dist/components/spinner/spinner-config.d.ts +15 -9
  181. package/dist/components/spinner/spinner-config.d.ts.map +1 -1
  182. package/dist/components/spinner/spinner-styles.d.ts +10 -3
  183. package/dist/components/spinner/spinner-styles.d.ts.map +1 -1
  184. package/dist/components/spinner/spinner.d.ts +27 -20
  185. package/dist/components/spinner/spinner.d.ts.map +1 -1
  186. package/dist/components/spinner/spinner.js +18 -18
  187. package/dist/components/switch/Switch.d.ts +109 -9
  188. package/dist/components/switch/Switch.d.ts.map +1 -1
  189. package/dist/components/switch/Switch.js +19 -19
  190. package/dist/components/switch/switch-config.d.ts +20 -6
  191. package/dist/components/switch/switch-config.d.ts.map +1 -1
  192. package/dist/components/switch/switch-config.js +8 -16
  193. package/dist/components/switch/switch-styles.d.ts +17 -0
  194. package/dist/components/switch/switch-styles.d.ts.map +1 -1
  195. package/dist/components/table/Table.d.ts +101 -28
  196. package/dist/components/table/Table.d.ts.map +1 -1
  197. package/dist/components/table/Table.js +56 -56
  198. package/dist/components/table/table-config.d.ts +75 -8
  199. package/dist/components/table/table-config.d.ts.map +1 -1
  200. package/dist/components/table/table-styles.d.ts +25 -6
  201. package/dist/components/table/table-styles.d.ts.map +1 -1
  202. package/dist/components/tabs/Tabs.d.ts +84 -31
  203. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  204. package/dist/components/tabs/Tabs.js +44 -44
  205. package/dist/components/tabs/tabs-config.d.ts +102 -9
  206. package/dist/components/tabs/tabs-config.d.ts.map +1 -1
  207. package/dist/components/tabs/tabs-styles.d.ts +16 -4
  208. package/dist/components/tabs/tabs-styles.d.ts.map +1 -1
  209. package/dist/components/textarea/Textarea.d.ts +105 -11
  210. package/dist/components/textarea/Textarea.d.ts.map +1 -1
  211. package/dist/components/textarea/Textarea.js +27 -24
  212. package/dist/components/textarea/textarea-config.d.ts +21 -0
  213. package/dist/components/textarea/textarea-config.d.ts.map +1 -1
  214. package/dist/components/textarea/textarea-config.js +8 -16
  215. package/dist/components/textarea/textarea-styles.d.ts +9 -0
  216. package/dist/components/textarea/textarea-styles.d.ts.map +1 -1
  217. package/dist/components/textarea/textarea-styles.js +5 -9
  218. package/dist/components/toast/ToastItem.d.ts +58 -4
  219. package/dist/components/toast/ToastItem.d.ts.map +1 -1
  220. package/dist/components/toast/ToastItem.js +18 -18
  221. package/dist/components/toast/toast-config.d.ts +104 -6
  222. package/dist/components/toast/toast-config.d.ts.map +1 -1
  223. package/dist/components/toast/toast-context.d.ts +123 -11
  224. package/dist/components/toast/toast-context.d.ts.map +1 -1
  225. package/dist/components/toast/toast-context.js +19 -19
  226. package/dist/components/toast/toast-styles.d.ts +27 -5
  227. package/dist/components/toast/toast-styles.d.ts.map +1 -1
  228. package/dist/components/toast/use-pausable-timeout.d.ts +29 -0
  229. package/dist/components/toast/use-pausable-timeout.d.ts.map +1 -1
  230. package/dist/components/tooltip/Tooltip.d.ts +76 -16
  231. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  232. package/dist/components/tooltip/Tooltip.js +25 -25
  233. package/dist/components/tooltip/tooltip-config.d.ts +73 -3
  234. package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
  235. package/dist/components/tooltip/tooltip-styles.d.ts +12 -0
  236. package/dist/components/tooltip/tooltip-styles.d.ts.map +1 -1
  237. package/dist/config/config.d.ts +50 -2
  238. package/dist/config/config.d.ts.map +1 -1
  239. package/dist/config/default-config.d.ts +5 -0
  240. package/dist/config/default-config.d.ts.map +1 -1
  241. package/dist/config/default-config.js +23 -0
  242. package/dist/config/define-config.d.ts +23 -0
  243. package/dist/config/define-config.d.ts.map +1 -1
  244. package/dist/config/resolve-color.d.ts +25 -0
  245. package/dist/config/resolve-color.d.ts.map +1 -1
  246. package/dist/config/resolve-config.d.ts +23 -0
  247. package/dist/config/resolve-config.d.ts.map +1 -1
  248. package/dist/index.css +43 -7
  249. package/dist/index.d.ts +30 -2
  250. package/dist/index.d.ts.map +1 -1
  251. package/dist/index.js +120 -115
  252. package/dist/libs/context.d.ts +50 -1
  253. package/dist/libs/context.d.ts.map +1 -1
  254. package/dist/libs/registry.d.ts +61 -5
  255. package/dist/libs/registry.d.ts.map +1 -1
  256. package/dist/libs/use-isomorphic-layout-effect.d.ts +18 -0
  257. package/dist/libs/use-isomorphic-layout-effect.d.ts.map +1 -1
  258. package/dist/shared/index.d.ts +3 -0
  259. package/dist/shared/index.d.ts.map +1 -0
  260. package/dist/shared/radius.d.ts +37 -1
  261. package/dist/shared/radius.d.ts.map +1 -1
  262. package/dist/shared/variant.d.ts +31 -0
  263. package/dist/shared/variant.d.ts.map +1 -1
  264. package/dist/shared/variant.js +132 -45
  265. package/dist/theme/color.d.ts +89 -1
  266. package/dist/theme/color.d.ts.map +1 -1
  267. package/dist/theme/controller.d.ts +121 -0
  268. package/dist/theme/controller.d.ts.map +1 -1
  269. package/dist/theme/controller.js +84 -0
  270. package/dist/theme/useTheme.d.ts +68 -0
  271. package/dist/theme/useTheme.d.ts.map +1 -1
  272. package/dist/theme/useTheme.js +23 -0
  273. package/dist/utils/index.d.ts +0 -7
  274. package/dist/utils/index.d.ts.map +1 -1
  275. package/dist/utils/resolve-token.d.ts +101 -0
  276. package/dist/utils/resolve-token.d.ts.map +1 -1
  277. package/package.json +1 -1
  278. package/dist/components/keyboard/default-keyboard-config.d.ts +0 -10
  279. package/dist/components/keyboard/default-keyboard-config.d.ts.map +0 -1
  280. package/dist/shared/size.d.ts +0 -2
  281. package/dist/shared/size.d.ts.map +0 -1
@@ -1,14 +1,83 @@
1
1
  import { ReactNode } from 'react';
2
- import { MarqueeAxis, MarqueeDirection, MarqueeSpeedPreset } from './marquee-config';
3
- export interface MarqueeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
2
+ import { MarqueeConfig } from './marquee-config';
3
+ type BaseMarqueeProps = MarqueeConfig & Omit<React.HTMLAttributes<HTMLDivElement>, "children">;
4
+ /**
5
+ * Configuration options for the Marquee component.
6
+ */
7
+ export interface MarqueeProps extends BaseMarqueeProps {
8
+ /**
9
+ * The content to display in the marquee.
10
+ * An array of React nodes that will be repeated for continuous scrolling.
11
+ */
4
12
  children: ReactNode[];
5
- axis?: MarqueeAxis;
6
- direction?: MarqueeDirection;
7
- speed?: MarqueeSpeedPreset | number;
8
- gap?: string;
9
- pauseOnHover?: boolean;
10
- fadeEdges?: boolean;
13
+ /**
14
+ * Extra classes applied to each item.
15
+ */
11
16
  itemClassName?: string;
12
17
  }
18
+ /**
19
+ * An animated scrolling container that displays content in a continuous loop.
20
+ *
21
+ * Marquee renders its children in a horizontal or vertical scrolling animation
22
+ * that loops infinitely. It duplicates the content to create a seamless effect,
23
+ * and supports configurable speed, direction, gap, pause on hover, and edge
24
+ * fading.
25
+ *
26
+ * The component uses CSS keyframe animations for performance and smooth
27
+ * scrolling. It automatically handles the duplication of content to create
28
+ * the infinite scroll effect.
29
+ *
30
+ * @param props - Marquee configuration options and HTML div props.
31
+ * @param props.children - An array of React nodes to display.
32
+ * @param props.axis - The axis of the marquee. Defaults to "x".
33
+ * @param props.direction - The scroll direction. Defaults to "forward".
34
+ * @param props.speed - The animation speed. Defaults to "normal".
35
+ * @param props.gap - The gap between items. Defaults to "1.5rem".
36
+ * @param props.pauseOnHover - Whether to pause on hover. Defaults to false.
37
+ * @param props.fadeEdges - Whether to fade edges. Defaults to false.
38
+ * @param props.itemClassName - Extra classes for each item.
39
+ * @param props.className - Extra classes for the container.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * import { Marquee } from "asheeui";
44
+ *
45
+ * export function Example() {
46
+ * const logos = [
47
+ * <div key="1">Logo 1</div>,
48
+ * <div key="2">Logo 2</div>,
49
+ * <div key="3">Logo 3</div>,
50
+ * ];
51
+ *
52
+ * return (
53
+ * <Marquee
54
+ * speed="slow"
55
+ * gap="2rem"
56
+ * pauseOnHover
57
+ * fadeEdges
58
+ * >
59
+ * {logos}
60
+ * </Marquee>
61
+ * );
62
+ * }
63
+ * ```
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * // Vertical marquee
68
+ * <Marquee
69
+ * axis="y"
70
+ * direction="reverse"
71
+ * speed={20}
72
+ * gap="1rem"
73
+ * >
74
+ * {items}
75
+ * </Marquee>
76
+ * ```
77
+ *
78
+ * @see MarqueeConfig - The configuration type for component defaults.
79
+ * @see useAsheeConfig - Hook for accessing the global configuration.
80
+ */
13
81
  export declare const Marquee: import('react').ForwardRefExoticComponent<MarqueeProps & import('react').RefAttributes<HTMLDivElement>>;
82
+ export {};
14
83
  //# sourceMappingURL=Marquee.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Marquee.d.ts","sourceRoot":"","sources":["../../../src/components/marquee/Marquee.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAI5E,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAO1B,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9D,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,KAAK,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAAC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,OAAO,yGAsKnB,CAAC"}
1
+ {"version":3,"file":"Marquee.d.ts","sourceRoot":"","sources":["../../../src/components/marquee/Marquee.tsx"],"names":[],"mappings":"AAUA,OAAO,EAA8B,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAI5E,OAAO,EAGL,KAAK,aAAa,EAGnB,MAAM,kBAAkB,CAAC;AAO1B,KAAK,gBAAgB,GAAG,aAAa,GACnC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD;;;OAGG;IACH,QAAQ,EAAE,SAAS,EAAE,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,eAAO,MAAM,OAAO,yGAoKnB,CAAC"}
@@ -12,8 +12,8 @@ const j = Q(
12
12
  axis: y,
13
13
  direction: x,
14
14
  speed: A,
15
- gap: h,
16
- pauseOnHover: S,
15
+ gap: S,
16
+ pauseOnHover: h,
17
17
  fadeEdges: _,
18
18
  className: N,
19
19
  itemClassName: c,
@@ -36,12 +36,12 @@ const j = Q(
36
36
  void 0,
37
37
  o.speed
38
38
  ), d = a(
39
- h,
39
+ S,
40
40
  e == null ? void 0 : e.gap,
41
41
  void 0,
42
42
  o.gap
43
43
  ), M = a(
44
- S,
44
+ h,
45
45
  e == null ? void 0 : e.pauseOnHover,
46
46
  void 0,
47
47
  o.pauseOnHover
@@ -79,7 +79,7 @@ const j = Q(
79
79
  {
80
80
  ref: D,
81
81
  className: s(
82
- "group relative overflow-hidden",
82
+ "group relative overflow-clip",
83
83
  t ? "h-full" : "w-full",
84
84
  N
85
85
  ),
@@ -1,15 +1,89 @@
1
+ /**
2
+ * Marquee component configuration for AsheeUI.
3
+ * This file defines the configuration types and defaults for the Marquee
4
+ * component, including axis, direction, speed, gap, and edge fading options.
5
+ * It registers the default configuration with the component registry and
6
+ * provides fallback values for the cascade resolution system.
7
+ */
8
+ /**
9
+ * The axis of the marquee animation.
10
+ * - `x`: Horizontal scrolling.
11
+ * - `y`: Vertical scrolling.
12
+ */
1
13
  export type MarqueeAxis = "x" | "y";
14
+ /**
15
+ * The direction of the marquee animation.
16
+ * - `forward`: Scrolls from right to left (x) or bottom to top (y).
17
+ * - `reverse`: Scrolls from left to right (x) or top to bottom (y).
18
+ */
2
19
  export type MarqueeDirection = "forward" | "reverse";
20
+ /**
21
+ * Speed presets for the marquee.
22
+ * - `slow`: 50 seconds for a full cycle.
23
+ * - `normal`: 30 seconds for a full cycle.
24
+ * - `fast`: 15 seconds for a full cycle.
25
+ */
3
26
  export type MarqueeSpeedPreset = "slow" | "normal" | "fast";
27
+ /**
28
+ * Theme configuration options for the Marquee component.
29
+ *
30
+ * Set under `components.marquee` in the AsheeUI config. Values feed the
31
+ * component-level fallback tier of the theme cascade.
32
+ */
4
33
  export interface MarqueeConfig {
34
+ /**
35
+ * The axis of the marquee animation.
36
+ * Controls whether the marquee scrolls horizontally or vertically.
37
+ *
38
+ * @default "x"
39
+ */
5
40
  axis?: MarqueeAxis;
41
+ /**
42
+ * The direction of the marquee animation.
43
+ * Controls the scroll direction.
44
+ *
45
+ * @default "forward"
46
+ */
6
47
  direction?: MarqueeDirection;
48
+ /**
49
+ * The speed of the marquee animation.
50
+ * Can be a preset value ("slow", "normal", "fast") or a number
51
+ * representing the duration in seconds for a full cycle.
52
+ *
53
+ * @default "normal"
54
+ */
7
55
  speed?: MarqueeSpeedPreset | number;
56
+ /**
57
+ * The gap between marquee items.
58
+ * Accepts any valid CSS gap value.
59
+ *
60
+ * @default "1.5rem"
61
+ */
8
62
  gap?: string;
63
+ /**
64
+ * Whether the marquee pauses on hover.
65
+ * When true, the animation stops when hovering over the marquee.
66
+ *
67
+ * @default false
68
+ */
9
69
  pauseOnHover?: boolean;
70
+ /**
71
+ * Whether the marquee has fading edges.
72
+ * When true, the edges of the marquee fade to transparent.
73
+ *
74
+ * @default false
75
+ */
10
76
  fadeEdges?: boolean;
11
77
  }
78
+ /**
79
+ * Default config values registered for the Marquee component.
80
+ */
12
81
  export declare const defaultMarqueeConfig: MarqueeConfig;
82
+ /**
83
+ * Hard fallback values used when no config tier provides a value.
84
+ * These values are used when instance props, component config,
85
+ * and global defaults are all undefined.
86
+ */
13
87
  export declare const FALLBACK_MARQUEE_CONFIG: {
14
88
  readonly axis: MarqueeAxis;
15
89
  readonly direction: MarqueeDirection;
@@ -1 +1 @@
1
- {"version":3,"file":"marquee-config.d.ts","sourceRoot":"","sources":["../../../src/components/marquee/marquee-config.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,CAAC;AACpC,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,KAAK,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAAC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,oBAAoB,EAAE,aAOlC,CAAC;AAEF,eAAO,MAAM,uBAAuB;mBACrB,WAAW;wBACA,gBAAgB;oBACrB,kBAAkB;;;;CAI7B,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,OAAO,EAAE,aAAa,CAAC;KACxB;CACF"}
1
+ {"version":3,"file":"marquee-config.d.ts","sourceRoot":"","sources":["../../../src/components/marquee/marquee-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,CAAC;AAEpC;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAErD;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAAC;IAEpC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAOlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;mBACrB,WAAW;wBACA,gBAAgB;oBACrB,kBAAkB;;;;CAI7B,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,OAAO,EAAE,aAAa,CAAC;KACxB;CACF"}
@@ -1,5 +1,17 @@
1
1
  import { MarqueeAxis, MarqueeSpeedPreset } from './marquee-config';
2
+ /**
3
+ * Duration in seconds for each speed preset.
4
+ * Higher values mean slower animation.
5
+ */
2
6
  export declare const MARQUEE_SPEED_PRESETS: Record<MarqueeSpeedPreset, number>;
7
+ /**
8
+ * CSS classes for the start edge fade gradient.
9
+ * Creates a fade effect at the beginning of the scroll direction.
10
+ */
3
11
  export declare const MARQUEE_FADE_START_CLASS: Record<MarqueeAxis, string>;
12
+ /**
13
+ * CSS classes for the end edge fade gradient.
14
+ * Creates a fade effect at the end of the scroll direction.
15
+ */
4
16
  export declare const MARQUEE_FADE_END_CLASS: Record<MarqueeAxis, string>;
5
17
  //# sourceMappingURL=marquee-styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"marquee-styles.d.ts","sourceRoot":"","sources":["../../../src/components/marquee/marquee-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAExE,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAIpE,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAGhE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAG9D,CAAC"}
1
+ {"version":3,"file":"marquee-styles.d.ts","sourceRoot":"","sources":["../../../src/components/marquee/marquee-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAIpE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAGhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAG9D,CAAC"}
@@ -1,38 +1,126 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
- import { Radius } from '../../shared/radius';
3
- import { ModalPosition, ModalSizeKey } from './modal-config';
4
- export interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "size"> {
5
- /** Controls open visibility state. */
2
+ import { ModalConfig } from './modal-config';
3
+ type BaseModalProps = ModalConfig & Omit<HTMLAttributes<HTMLDivElement>, "size">;
4
+ /**
5
+ * Configuration options for the Modal component.
6
+ */
7
+ export interface ModalProps extends BaseModalProps {
8
+ /**
9
+ * Controls open visibility state.
10
+ * When true, the modal is rendered and visible.
11
+ */
6
12
  isOpen: boolean;
7
- /** Close event callback. */
13
+ /**
14
+ * Close event callback.
15
+ * Called when the modal should close (backdrop click, Escape key).
16
+ */
8
17
  onClose?: () => void;
9
- /** Modal inner content. */
18
+ /**
19
+ * Modal inner content.
20
+ * The content to display inside the modal.
21
+ */
10
22
  children: ReactNode;
11
- /** Modal content width override. */
23
+ /**
24
+ * Modal content width override.
25
+ * Accepts any CSS width value (e.g., "500px", "80%").
26
+ * Overrides the size prop.
27
+ */
12
28
  width?: string;
13
- /** Modal content height override. */
29
+ /**
30
+ * Modal content height override.
31
+ * Accepts any CSS height value (e.g., "400px", "auto").
32
+ */
14
33
  height?: string;
15
- /** Padding token or CSS string override. */
16
- padding?: string;
17
- /** Modal size scale token key. */
18
- size?: ModalSizeKey;
19
- /** Vertical placement position. */
20
- position?: ModalPosition;
21
- /** Radius scale token for modal content box. */
22
- radius?: Radius;
23
- /** Enable/disable pop animation. Default: true */
24
- animated?: boolean;
25
- /** Close modal when clicking dark backdrop overlay. Default: true. */
26
- closeOnBackdropClick?: boolean;
27
- /** Close modal on Escape key press. Default: true. */
28
- closeOnEscape?: boolean;
29
- /** Backdrop overlay custom class name. */
34
+ /**
35
+ * Backdrop overlay custom class name.
36
+ * Extra classes applied to the backdrop element.
37
+ */
30
38
  overlayClassName?: string;
31
- /** Content container custom class name. */
39
+ /**
40
+ * Content container custom class name.
41
+ * Extra classes applied to the modal content container.
42
+ */
32
43
  contentClassName?: string;
33
44
  }
34
- export declare function Modal({ isOpen, onClose, children, width, height, padding, size, position: positionProp, radius, animated: animatedProp, closeOnBackdropClick: closeOnBackdropClickProp, closeOnEscape: closeOnEscapeProp, overlayClassName: overlayClassNameProp, contentClassName: contentClassNameProp, className, style, ...props }: ModalProps): import("react").JSX.Element | null;
45
+ /**
46
+ * A dialog overlay with backdrop, scroll locking, and configurable animations.
47
+ *
48
+ * Modal renders a dialog that appears over the page content with a backdrop.
49
+ * It supports size, position, radius, animation, and behavior options. The
50
+ * component automatically locks body scroll when open, handles Escape key
51
+ * dismissal, and supports click-outside-to-close functionality.
52
+ *
53
+ * The modal manages its own animation states using a two-phase rendering
54
+ * approach: it renders the modal with an enter animation when opened, and
55
+ * plays an exit animation before removing from the DOM when closed.
56
+ *
57
+ * Visual tokens resolve through the standard AsheeUI cascade: prop,
58
+ * component config, global theme defaults, and the built-in fallback.
59
+ *
60
+ * @param props - Modal configuration options and HTML div props.
61
+ * @param props.isOpen - Whether the modal is open.
62
+ * @param props.onClose - Callback fired when the modal should close.
63
+ * @param props.size - Size of the modal. Defaults to "md".
64
+ * @param props.position - Position of the modal. Defaults to "center".
65
+ * @param props.radius - Corner rounding. Defaults to "lg".
66
+ * @param props.animated - Whether the modal has animations. Defaults to true.
67
+ * @param props.closeOnBackdropClick - Whether clicking the backdrop closes the modal. Defaults to true.
68
+ * @param props.closeOnEscape - Whether pressing Escape closes the modal. Defaults to true.
69
+ * @param props.width - Width override for the modal.
70
+ * @param props.height - Height override for the modal.
71
+ * @param props.overlayClassName - Extra classes for the backdrop.
72
+ * @param props.contentClassName - Extra classes for the content container.
73
+ * @param props.children - The modal content.
74
+ *
75
+ * @example
76
+ * ```tsx
77
+ * import { Modal, Button } from "asheeui";
78
+ * import { useState } from "react";
79
+ *
80
+ * export function Example() {
81
+ * const [isOpen, setIsOpen] = useState(false);
82
+ *
83
+ * return (
84
+ * <>
85
+ * <Button onClick={() => setIsOpen(true)}>Open Modal</Button>
86
+ * <Modal
87
+ * isOpen={isOpen}
88
+ * onClose={() => setIsOpen(false)}
89
+ * size="lg"
90
+ * position="center"
91
+ * >
92
+ * <div className="p-6">
93
+ * <h2 className="text-xl font-bold">Modal Title</h2>
94
+ * <p className="mt-2">Modal content goes here.</p>
95
+ * <Button onClick={() => setIsOpen(false)}>Close</Button>
96
+ * </div>
97
+ * </Modal>
98
+ * </>
99
+ * );
100
+ * }
101
+ * ```
102
+ *
103
+ * @example
104
+ * ```tsx
105
+ * // Top-positioned modal with custom width
106
+ * <Modal
107
+ * isOpen={isOpen}
108
+ * onClose={onClose}
109
+ * position="top"
110
+ * width="600px"
111
+ * radius="md"
112
+ * closeOnBackdropClick={false}
113
+ * >
114
+ * {content}
115
+ * </Modal>
116
+ * ```
117
+ *
118
+ * @see ModalConfig - The configuration type for component defaults.
119
+ * @see useAsheeConfig - Hook for accessing the global configuration.
120
+ */
121
+ export declare function Modal({ isOpen, onClose, children, width, height, size, position: positionProp, radius, animated: animatedProp, closeOnBackdropClick: closeOnBackdropClickProp, closeOnEscape: closeOnEscapeProp, overlayClassName: overlayClassNameProp, contentClassName: contentClassNameProp, className, style, ...props }: ModalProps): import("react").JSX.Element | null;
35
122
  export declare namespace Modal {
36
123
  var displayName: string;
37
124
  }
125
+ export {};
38
126
  //# sourceMappingURL=Modal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAOhE,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAOxB,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACpD,sCAAsC;IACtC,MAAM,EAAE,OAAO,CAAC;IAEhB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,2BAA2B;IAC3B,QAAQ,EAAE,SAAS,CAAC;IAEpB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEzB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,sEAAsE;IACtE,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EAAE,YAAY,EACtB,MAAM,EACN,QAAQ,EAAE,YAAY,EACtB,oBAAoB,EAAE,wBAAwB,EAC9C,aAAa,EAAE,iBAAiB,EAChC,gBAAgB,EAAE,oBAAoB,EACtC,gBAAgB,EAAE,oBAAoB,EACtC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,UAAU,sCAmLZ;yBArMe,KAAK"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AASf,OAAO,EAEL,KAAK,WAAW,EAGjB,MAAM,gBAAgB,CAAC;AAGxB,KAAK,cAAc,GAAG,WAAW,GAC/B,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AACH,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,IAAI,EACJ,QAAQ,EAAE,YAAY,EACtB,MAAM,EACN,QAAQ,EAAE,YAAY,EACtB,oBAAoB,EAAE,wBAAwB,EAC9C,aAAa,EAAE,iBAAiB,EAChC,gBAAgB,EAAE,oBAAoB,EACtC,gBAAgB,EAAE,oBAAoB,EACtC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,UAAU,sCAyKZ;yBA1Le,KAAK"}
@@ -1,152 +1,145 @@
1
1
  "use client";
2
- import { jsxs as W, jsx as w } from "react/jsx-runtime";
3
- import { useState as S, useEffect as d } from "react";
4
- import { useAsheeConfig as X } from "../../libs/context.js";
5
- import { RADIUS_CLASS as J } from "../../shared/radius.js";
6
- import { resolveCascade as r, resolveRadiusKey as Q, resolveClassKey as c } from "../../utils/resolve-token.js";
2
+ import { jsxs as P, jsx as k } from "react/jsx-runtime";
3
+ import { useState as b, useEffect as d } from "react";
4
+ import { useAsheeConfig as U } from "../../libs/context.js";
5
+ import { resolveCascade as a, resolveRadiusKey as W, resolveClassKey as w } from "../../utils/resolve-token.js";
7
6
  import { FALLBACK_MODAL_CONFIG as o } from "./modal-config.js";
8
- import { MODAL_MAX_WIDTH_CLASS as V, MODAL_PADDING_CLASS as Y, MODAL_POSITION_CLASS as L } from "./modal-styles.js";
9
- import { cn as m } from "../../utils/cn.js";
10
- function Z({
7
+ import { MODAL_MAX_WIDTH_CLASS as X, MODAL_POSITION_CLASS as A } from "./modal-styles.js";
8
+ import { RADIUS_CLASS as J } from "../../shared/radius.js";
9
+ import { cn as i } from "../../utils/cn.js";
10
+ function Q({
11
11
  isOpen: t,
12
- onClose: a,
13
- children: O,
14
- width: u,
15
- height: _,
16
- padding: n,
12
+ onClose: s,
13
+ children: S,
14
+ width: c,
15
+ height: L,
17
16
  size: x,
18
- position: D,
19
- radius: N,
20
- animated: h,
21
- closeOnBackdropClick: C,
22
- closeOnEscape: E,
17
+ position: O,
18
+ radius: h,
19
+ animated: E,
20
+ closeOnBackdropClick: N,
21
+ closeOnEscape: _,
23
22
  overlayClassName: M,
24
23
  contentClassName: z,
25
- className: I,
26
- style: B,
27
- ...K
24
+ className: B,
25
+ style: C,
26
+ ...D
28
27
  }) {
29
- var b;
30
- const f = X(), e = (b = f.components) == null ? void 0 : b.modal, [p, v] = S(!1), [R, i] = S(t), y = r(
28
+ var y;
29
+ const m = U(), e = (y = m.components) == null ? void 0 : y.modal, [u, f] = b(!1), [I, n] = b(t), K = a(
31
30
  x,
32
31
  e == null ? void 0 : e.size,
33
32
  void 0,
34
33
  o.size
35
- ), T = r(
36
- D,
34
+ ), R = a(
35
+ O,
37
36
  e == null ? void 0 : e.position,
38
37
  void 0,
39
38
  o.position
40
- ), j = r(
41
- C,
39
+ ), T = a(
40
+ N,
42
41
  e == null ? void 0 : e.closeOnBackdropClick,
43
42
  void 0,
44
43
  o.closeOnBackdropClick
45
- ), k = r(
46
- E,
44
+ ), p = a(
45
+ _,
47
46
  e == null ? void 0 : e.closeOnEscape,
48
47
  void 0,
49
48
  o.closeOnEscape
50
- ), F = Q(
51
- N,
49
+ ), g = W(
50
+ h,
52
51
  e == null ? void 0 : e.radius,
53
- f.defaultRadius,
52
+ m.defaultRadius,
54
53
  o.radius
55
- ), l = r(
56
- h,
54
+ ), l = a(
55
+ E,
57
56
  e == null ? void 0 : e.animated,
58
57
  void 0,
59
58
  o.animated
60
- ), g = u ? "" : c(
61
- y,
62
- V,
63
- o.size
64
- ), G = n ? "" : c(
65
- y,
66
- Y,
59
+ ), j = c ? "" : w(
60
+ K,
61
+ X,
67
62
  o.size
68
- ), P = c(
69
- F,
63
+ ), F = w(
64
+ g,
70
65
  J,
71
66
  o.radius
72
- ), q = L[T] ?? L.center;
67
+ ), q = A[R] ?? A.center;
73
68
  if (d(() => {
74
69
  if (t)
75
- i(!0), requestAnimationFrame(() => {
76
- v(!1);
70
+ n(!0), requestAnimationFrame(() => {
71
+ f(!1);
77
72
  });
78
73
  else if (l) {
79
- v(!0);
80
- const s = setTimeout(() => {
81
- i(!1);
74
+ f(!0);
75
+ const r = setTimeout(() => {
76
+ n(!1);
82
77
  }, 200);
83
- return () => clearTimeout(s);
78
+ return () => clearTimeout(r);
84
79
  } else
85
- i(!1);
80
+ n(!1);
86
81
  }, [t, l]), d(() => {
87
- if (!t || !k || !a) return;
88
- const s = (U) => {
89
- U.key === "Escape" && a();
82
+ if (!t || !p || !s) return;
83
+ const r = (H) => {
84
+ H.key === "Escape" && s();
90
85
  };
91
- return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
92
- }, [t, k, a]), d(() => {
86
+ return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
87
+ }, [t, p, s]), d(() => {
93
88
  if (!t) return;
94
- const s = document.body.style.overflow;
89
+ const r = document.body.style.overflow;
95
90
  return document.body.style.overflow = "hidden", () => {
96
- document.body.style.overflow = s;
91
+ document.body.style.overflow = r;
97
92
  };
98
- }, [t]), !R) return null;
99
- const A = () => l ? p ? "animate-backdrop-out" : "animate-backdrop-in" : "", H = () => l ? p ? "animate-modal-out" : "animate-modal-in" : "";
100
- return /* @__PURE__ */ W(
93
+ }, [t]), !I) return null;
94
+ const v = () => l ? u ? "animate-backdrop-out" : "animate-backdrop-in" : "", G = () => l ? u ? "animate-modal-out" : "animate-modal-in" : "";
95
+ return /* @__PURE__ */ P(
101
96
  "div",
102
97
  {
103
98
  role: "dialog",
104
99
  "aria-modal": "true",
105
- className: m(
100
+ className: i(
106
101
  "fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 overflow-y-auto",
107
- A()
102
+ v()
108
103
  ),
109
104
  children: [
110
- /* @__PURE__ */ w(
105
+ /* @__PURE__ */ k(
111
106
  "button",
112
107
  {
113
108
  type: "button",
114
- onClick: j ? a : void 0,
115
- className: m(
109
+ onClick: T ? s : void 0,
110
+ className: i(
116
111
  "fixed inset-0 bg-background/80 backdrop-blur-xs dark:bg-black/70",
117
112
  M,
118
- A()
113
+ v()
119
114
  )
120
115
  }
121
116
  ),
122
- /* @__PURE__ */ w(
117
+ /* @__PURE__ */ k(
123
118
  "div",
124
119
  {
125
- className: m(
120
+ className: i(
126
121
  "relative z-10 w-full bg-background text-foreground overflow-y-auto max-h-[90vh]",
127
122
  q,
128
- g,
129
- G,
130
- P,
123
+ j,
124
+ F,
131
125
  z,
132
- H(),
133
- I
126
+ G(),
127
+ B
134
128
  ),
135
129
  style: {
136
- width: u,
137
- height: _,
138
- ...n ? { padding: n } : {},
139
- ...B
130
+ width: c,
131
+ height: L,
132
+ ...C
140
133
  },
141
- ...K,
142
- children: O
134
+ ...D,
135
+ children: S
143
136
  }
144
137
  )
145
138
  ]
146
139
  }
147
140
  );
148
141
  }
149
- Z.displayName = "Modal";
142
+ Q.displayName = "Modal";
150
143
  export {
151
- Z as Modal
144
+ Q as Modal
152
145
  };