asheeui 0.6.15 → 0.7.0

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 (183) hide show
  1. package/dist/AsheeUIProvider.js +22 -24
  2. package/dist/components/accordion/Accordion.js +79 -173
  3. package/dist/components/accordion/accordion-config.js +12 -13
  4. package/dist/components/accordion/accordion-styles.js +21 -24
  5. package/dist/components/autocomplete/Autocomplete.js +78 -136
  6. package/dist/components/autocomplete/autocomplete-config.js +7 -12
  7. package/dist/components/button/Button.d.ts +29 -1
  8. package/dist/components/button/Button.d.ts.map +1 -1
  9. package/dist/components/button/Button.js +47 -108
  10. package/dist/components/button/button-config.js +16 -17
  11. package/dist/components/button/button-styles.js +10 -11
  12. package/dist/components/card/Card.d.ts +36 -16
  13. package/dist/components/card/Card.d.ts.map +1 -1
  14. package/dist/components/card/Card.js +115 -205
  15. package/dist/components/card/card-config.js +24 -21
  16. package/dist/components/card/card-styles.js +19 -22
  17. package/dist/components/carousel/Carousel.js +123 -248
  18. package/dist/components/carousel/carousel-config.js +24 -25
  19. package/dist/components/carousel/carousel-styles.js +14 -16
  20. package/dist/components/chip/Chip.js +84 -191
  21. package/dist/components/chip/chip-config.js +13 -14
  22. package/dist/components/chip/chip-styles.js +22 -26
  23. package/dist/components/date-picker/Calendar.d.ts +3 -3
  24. package/dist/components/date-picker/Calendar.d.ts.map +1 -1
  25. package/dist/components/date-picker/Calendar.js +141 -222
  26. package/dist/components/date-picker/DatePicker.d.ts +5 -5
  27. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  28. package/dist/components/date-picker/DatePicker.js +122 -220
  29. package/dist/components/date-picker/TimeSpinner.js +58 -82
  30. package/dist/components/date-picker/date-picker-config.d.ts +4 -4
  31. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  32. package/dist/components/date-picker/date-picker-config.js +10 -11
  33. package/dist/components/date-picker/date-picker-styles.js +44 -45
  34. package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
  35. package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
  36. package/dist/components/date-picker/date-picker.helpers.js +74 -102
  37. package/dist/components/drawer/Drawer.d.ts +26 -8
  38. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  39. package/dist/components/drawer/Drawer.js +54 -131
  40. package/dist/components/drawer/drawer-config.js +14 -15
  41. package/dist/components/drawer/drawer-styles.js +38 -42
  42. package/dist/components/field/FieldShell.js +49 -56
  43. package/dist/components/field/field-config.js +17 -18
  44. package/dist/components/field/field-styles.js +8 -8
  45. package/dist/components/image/Image.d.ts +7 -7
  46. package/dist/components/image/Image.d.ts.map +1 -1
  47. package/dist/components/image/Image.js +65 -132
  48. package/dist/components/image/image-config.js +17 -18
  49. package/dist/components/image/image-styles.js +14 -15
  50. package/dist/components/input/Input.js +65 -150
  51. package/dist/components/input/PasswordInput.js +30 -49
  52. package/dist/components/input/input-config.js +7 -7
  53. package/dist/components/input/input-styles.js +9 -10
  54. package/dist/components/keyboard/KeyboardContext.js +10 -11
  55. package/dist/components/keyboard/KeyboardProvider.js +100 -181
  56. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  57. package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
  58. package/dist/components/keyboard/keyboard-config.js +59 -57
  59. package/dist/components/keyboard/keyboard-styles.js +10 -11
  60. package/dist/components/keyboard/use-keyboard-field.js +29 -21
  61. package/dist/components/link/Link.js +47 -137
  62. package/dist/components/link/link-config.js +14 -15
  63. package/dist/components/link/link-styles.js +25 -29
  64. package/dist/components/marquee/Marquee.js +55 -144
  65. package/dist/components/marquee/marquee-config.js +18 -19
  66. package/dist/components/marquee/marquee-styles.js +13 -15
  67. package/dist/components/modal/Modal.d.ts +26 -10
  68. package/dist/components/modal/Modal.d.ts.map +1 -1
  69. package/dist/components/modal/Modal.js +56 -136
  70. package/dist/components/modal/modal-config.js +15 -16
  71. package/dist/components/modal/modal-styles.js +13 -14
  72. package/dist/components/multi-select/MultiSelect.d.ts +18 -2
  73. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  74. package/dist/components/multi-select/MultiSelect.js +149 -283
  75. package/dist/components/multi-select/multi-select-config.d.ts +23 -18
  76. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  77. package/dist/components/multi-select/multi-select-config.js +18 -21
  78. package/dist/components/multi-select/multi-select-styles.js +17 -20
  79. package/dist/components/radio/Radio.js +43 -80
  80. package/dist/components/radio/RadioGroup.js +57 -155
  81. package/dist/components/radio/radio-config.js +15 -16
  82. package/dist/components/radio/radio-context.js +6 -6
  83. package/dist/components/radio/radio-styles.js +55 -60
  84. package/dist/components/resizable-screen/ResizableScreen.js +87 -177
  85. package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
  86. package/dist/components/select/Select.d.ts +3 -2
  87. package/dist/components/select/Select.d.ts.map +1 -1
  88. package/dist/components/select/Select.js +97 -195
  89. package/dist/components/select/select-config.js +8 -9
  90. package/dist/components/select/select-styles.js +5 -5
  91. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  92. package/dist/components/select-menu/SelectMenu.js +102 -196
  93. package/dist/components/select-menu/select-menu-config.js +12 -12
  94. package/dist/components/select-menu/use-select-floating.d.ts +11 -1
  95. package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
  96. package/dist/components/select-menu/use-select-floating.js +41 -48
  97. package/dist/components/sidebar/Sidebar.d.ts +43 -22
  98. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  99. package/dist/components/sidebar/Sidebar.js +146 -331
  100. package/dist/components/sidebar/sidebar-config.d.ts +98 -31
  101. package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
  102. package/dist/components/sidebar/sidebar-config.js +47 -33
  103. package/dist/components/sidebar/sidebar-styles.js +27 -32
  104. package/dist/components/spinner/spinner-config.js +12 -13
  105. package/dist/components/spinner/spinner-styles.js +13 -14
  106. package/dist/components/spinner/spinner.js +39 -82
  107. package/dist/components/switch/Switch.js +62 -154
  108. package/dist/components/switch/switch-config.js +11 -12
  109. package/dist/components/switch/switch-styles.js +14 -16
  110. package/dist/components/table/Table.js +64 -186
  111. package/dist/components/table/table-config.js +17 -18
  112. package/dist/components/table/table-styles.js +48 -52
  113. package/dist/components/tabs/Tabs.d.ts +16 -8
  114. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  115. package/dist/components/tabs/Tabs.js +93 -208
  116. package/dist/components/tabs/tabs-config.d.ts +42 -20
  117. package/dist/components/tabs/tabs-config.d.ts.map +1 -1
  118. package/dist/components/tabs/tabs-config.js +26 -18
  119. package/dist/components/tabs/tabs-styles.js +15 -17
  120. package/dist/components/textarea/Textarea.js +52 -138
  121. package/dist/components/textarea/textarea-config.js +10 -11
  122. package/dist/components/textarea/textarea-styles.js +9 -10
  123. package/dist/components/toast/ToastContext.js +22 -26
  124. package/dist/components/toast/ToastItem.js +82 -144
  125. package/dist/components/toast/ToastProvider.d.ts.map +1 -1
  126. package/dist/components/toast/ToastProvider.js +128 -190
  127. package/dist/components/toast/toast-config.js +23 -24
  128. package/dist/components/toast/toast-styles.js +50 -55
  129. package/dist/components/toast/use-pausable-timeout.js +17 -13
  130. package/dist/components/tooltip/Tooltip.d.ts +5 -0
  131. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  132. package/dist/components/tooltip/Tooltip.js +68 -158
  133. package/dist/components/tooltip/tooltip-config.d.ts +25 -0
  134. package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
  135. package/dist/components/tooltip/tooltip-config.js +26 -22
  136. package/dist/components/tooltip/tooltip-styles.js +15 -17
  137. package/dist/config/default-config.js +11 -34
  138. package/dist/config/resolve-color.js +23 -23
  139. package/dist/config/resolve-config.d.ts.map +1 -1
  140. package/dist/config/resolve-config.js +14 -12
  141. package/dist/icons/ArrowLeftIcon.js +16 -19
  142. package/dist/icons/CalendarIcon.js +43 -24
  143. package/dist/icons/CheckIcon.js +16 -19
  144. package/dist/icons/ChevronDownIcon.js +15 -21
  145. package/dist/icons/ChevronLeftIcon.js +16 -19
  146. package/dist/icons/ChevronRightIcon.js +16 -19
  147. package/dist/icons/ChevronUpIcon.js +16 -19
  148. package/dist/icons/ClearIcon.js +26 -22
  149. package/dist/icons/ClockIcon.js +20 -22
  150. package/dist/icons/CloseIcon.js +26 -22
  151. package/dist/icons/ErrorIcon.js +16 -19
  152. package/dist/icons/ExternalLinkIcon.js +25 -23
  153. package/dist/icons/EyeIcon.js +20 -22
  154. package/dist/icons/EyeOffIcon.js +21 -22
  155. package/dist/icons/InfoIcon.js +16 -19
  156. package/dist/icons/SearchIcon.js +25 -22
  157. package/dist/icons/WarningIcon.js +16 -19
  158. package/dist/index.js +65 -163
  159. package/dist/libs/context.js +10 -13
  160. package/dist/libs/index.js +1 -0
  161. package/dist/libs/registry.js +10 -12
  162. package/dist/libs/use-floating-z-index.d.ts +32 -0
  163. package/dist/libs/use-floating-z-index.d.ts.map +1 -0
  164. package/dist/libs/use-floating-z-index.js +16 -0
  165. package/dist/libs/use-isomorphic-layout-effect.js +5 -5
  166. package/dist/scripts/AsheeThemeScript.js +35 -44
  167. package/dist/shared/radius.d.ts.map +1 -1
  168. package/dist/shared/radius.js +12 -13
  169. package/dist/shared/variant.js +46 -134
  170. package/dist/theme/color.js +28 -28
  171. package/dist/theme/controller.d.ts.map +1 -1
  172. package/dist/theme/controller.js +65 -178
  173. package/dist/theme/useTheme.js +13 -44
  174. package/dist/utils/cn.js +7 -7
  175. package/dist/utils/index.d.ts +1 -0
  176. package/dist/utils/index.d.ts.map +1 -1
  177. package/dist/utils/index.js +1 -0
  178. package/dist/utils/merge-object.js +13 -14
  179. package/dist/utils/resolve-token.js +11 -14
  180. package/dist/utils/stacking.d.ts +76 -0
  181. package/dist/utils/stacking.d.ts.map +1 -0
  182. package/dist/utils/stacking.js +34 -0
  183. package/package.json +12 -11
@@ -1,138 +1,50 @@
1
1
  "use client";
2
- import { cn as r } from "../utils/cn.js";
3
- const e = "transition-all duration-200 ease-in-out", b = {
4
- none: r(e, "bg-background text-foreground hover:bg-background/80"),
5
- primary: r(e, "bg-primary text-foreground hover:bg-primary/80"),
6
- secondary: r(
7
- e,
8
- "bg-secondary text-foreground hover:bg-secondary/80"
9
- ),
10
- danger: r(e, "bg-danger text-foreground hover:bg-danger/80"),
11
- warning: r(e, "bg-warning text-foreground hover:bg-warning/80"),
12
- success: r(e, "bg-success text-foreground hover:bg-success/80")
13
- }, o = {
14
- none: r(
15
- e,
16
- "bg-transparent text-foreground hover:bg-foreground/20 hover:text-foreground"
17
- ),
18
- primary: r(
19
- e,
20
- "bg-transparent text-primary hover:bg-primary/20 hover:text-primary"
21
- ),
22
- secondary: r(
23
- e,
24
- "bg-transparent text-foreground hover:bg-secondary/20 hover:text-foreground"
25
- ),
26
- danger: r(
27
- e,
28
- "bg-transparent text-danger hover:bg-danger/20 hover:text-danger"
29
- ),
30
- warning: r(
31
- e,
32
- "bg-transparent text-warning hover:bg-warning/20 hover:text-warning"
33
- ),
34
- success: r(
35
- e,
36
- "bg-transparent text-success hover:bg-success/20 hover:text-success"
37
- )
38
- }, t = {
39
- none: r(
40
- e,
41
- o.primary,
42
- "border-2 border-background hover:border-background/60"
43
- ),
44
- primary: r(
45
- e,
46
- o.primary,
47
- "border-2 border-primary hover:border-primary/60"
48
- ),
49
- secondary: r(
50
- e,
51
- o.secondary,
52
- "border-2 border-border hover:border-border/60"
53
- ),
54
- danger: r(
55
- e,
56
- o.danger,
57
- "border-2 border-danger hover:border-danger/60"
58
- ),
59
- warning: r(
60
- e,
61
- o.warning,
62
- "border-2 border-warning hover:border-warning/60"
63
- ),
64
- success: r(
65
- e,
66
- o.success,
67
- "border-2 border-success hover:border-success/60"
68
- )
69
- }, c = {
70
- none: r(
71
- e,
72
- "bg-secondary/40 text-foreground border-2 border-transparent hover:bg-secondary/60 hover:border-secondary/40"
73
- ),
74
- primary: r(
75
- e,
76
- "bg-primary/10 text-primary border-2 border-primary/20 hover:bg-primary/20 hover:border-primary/40"
77
- ),
78
- secondary: r(
79
- e,
80
- "bg-secondary/15 text-foreground border-2 border-secondary/30 hover:bg-secondary/25 hover:border-secondary/50"
81
- ),
82
- danger: r(
83
- e,
84
- "bg-danger/10 text-danger border-2 border-danger/20 hover:bg-danger/20 hover:border-danger/40"
85
- ),
86
- warning: r(
87
- e,
88
- "bg-warning/10 text-warning border-2 border-warning/20 hover:bg-warning/20 hover:border-warning/40"
89
- ),
90
- success: r(
91
- e,
92
- "bg-success/10 text-success border-2 border-success/20 hover:bg-success/20 hover:border-success/40"
93
- )
94
- }, n = "border-b-2 border-t-0 border-x-0 rounded-none bg-transparent shadow-none", i = {
95
- none: r(
96
- e,
97
- n,
98
- "border-background text-foreground hover:border-background/80"
99
- ),
100
- primary: r(
101
- e,
102
- n,
103
- "border-primary text-primary hover:border-primary/80"
104
- ),
105
- secondary: r(
106
- e,
107
- n,
108
- "border-secondary text-secondary hover:border-secondary/80"
109
- ),
110
- danger: r(
111
- e,
112
- n,
113
- "border-danger text-danger hover:border-danger/80"
114
- ),
115
- warning: r(
116
- e,
117
- n,
118
- "border-warning text-warning hover:border-warning/80"
119
- ),
120
- success: r(
121
- e,
122
- n,
123
- "border-success text-success hover:border-success/80"
124
- )
2
+ import { cn as e } from "../utils/cn.js";
3
+ //#region src/shared/variant.ts
4
+ var t = "transition-all duration-200 ease-in-out", n = {
5
+ none: e(t, "bg-background text-foreground hover:bg-background/80"),
6
+ primary: e(t, "bg-primary text-foreground hover:bg-primary/80"),
7
+ secondary: e(t, "bg-secondary text-foreground hover:bg-secondary/80"),
8
+ danger: e(t, "bg-danger text-foreground hover:bg-danger/80"),
9
+ warning: e(t, "bg-warning text-foreground hover:bg-warning/80"),
10
+ success: e(t, "bg-success text-foreground hover:bg-success/80")
11
+ }, r = {
12
+ none: e(t, "bg-transparent text-foreground hover:bg-foreground/20 hover:text-foreground"),
13
+ primary: e(t, "bg-transparent text-primary hover:bg-primary/20 hover:text-primary"),
14
+ secondary: e(t, "bg-transparent text-foreground hover:bg-secondary/20 hover:text-foreground"),
15
+ danger: e(t, "bg-transparent text-danger hover:bg-danger/20 hover:text-danger"),
16
+ warning: e(t, "bg-transparent text-warning hover:bg-warning/20 hover:text-warning"),
17
+ success: e(t, "bg-transparent text-success hover:bg-success/20 hover:text-success")
18
+ }, i = {
19
+ none: e(t, r.primary, "border-2 border-background hover:border-background/60"),
20
+ primary: e(t, r.primary, "border-2 border-primary hover:border-primary/60"),
21
+ secondary: e(t, r.secondary, "border-2 border-border hover:border-border/60"),
22
+ danger: e(t, r.danger, "border-2 border-danger hover:border-danger/60"),
23
+ warning: e(t, r.warning, "border-2 border-warning hover:border-warning/60"),
24
+ success: e(t, r.success, "border-2 border-success hover:border-success/60")
125
25
  }, a = {
126
- solid: b,
127
- ghost: o,
128
- bordered: t,
129
- faded: c,
130
- underlined: i
26
+ none: e(t, "bg-secondary/40 text-foreground border-2 border-transparent hover:bg-secondary/60 hover:border-secondary/40"),
27
+ primary: e(t, "bg-primary/10 text-primary border-2 border-primary/20 hover:bg-primary/20 hover:border-primary/40"),
28
+ secondary: e(t, "bg-secondary/15 text-foreground border-2 border-secondary/30 hover:bg-secondary/25 hover:border-secondary/50"),
29
+ danger: e(t, "bg-danger/10 text-danger border-2 border-danger/20 hover:bg-danger/20 hover:border-danger/40"),
30
+ warning: e(t, "bg-warning/10 text-warning border-2 border-warning/20 hover:bg-warning/20 hover:border-warning/40"),
31
+ success: e(t, "bg-success/10 text-success border-2 border-success/20 hover:bg-success/20 hover:border-success/40")
32
+ }, o = "border-b-2 border-t-0 border-x-0 rounded-none bg-transparent shadow-none", s = {
33
+ solid: n,
34
+ ghost: r,
35
+ bordered: i,
36
+ faded: a,
37
+ underlined: {
38
+ none: e(t, o, "border-background text-foreground hover:border-background/80"),
39
+ primary: e(t, o, "border-primary text-primary hover:border-primary/80"),
40
+ secondary: e(t, o, "border-secondary text-secondary hover:border-secondary/80"),
41
+ danger: e(t, o, "border-danger text-danger hover:border-danger/80"),
42
+ warning: e(t, o, "border-warning text-warning hover:border-warning/80"),
43
+ success: e(t, o, "border-success text-success hover:border-success/80")
44
+ }
131
45
  };
132
- function h(s, g) {
133
- var d;
134
- return ((d = a[s]) == null ? void 0 : d[g]) ?? a.bordered.secondary;
46
+ function c(e, t) {
47
+ return s[e]?.[t] ?? s.bordered.secondary;
135
48
  }
136
- export {
137
- h as resolveVariantClass
138
- };
49
+ //#endregion
50
+ export { c as resolveVariantClass };
@@ -1,30 +1,30 @@
1
1
  "use client";
2
- const r = {
3
- light: {
4
- background: "#ffffff",
5
- foreground: "#000000",
6
- primary: "#2563eb",
7
- secondary: "#f3f4f6",
8
- border: "#d5d5d5",
9
- danger: "#dc2626",
10
- warning: "#d97706",
11
- success: "#16a34a",
12
- scrollbarThumb: "#3b82f6",
13
- scrollbarTrack: "transparent"
14
- },
15
- dark: {
16
- background: "#111111",
17
- foreground: "#ffffff",
18
- primary: "#005bc4",
19
- secondary: "#262626",
20
- border: "#2a2a2a",
21
- danger: "#ef4444",
22
- warning: "#f59e0b",
23
- success: "#22c55e",
24
- scrollbarThumb: "#1e40af",
25
- scrollbarTrack: "#1f293700"
26
- }
27
- };
28
- export {
29
- r as defaultColorConfig
2
+ //#region src/theme/color.ts
3
+ var e = {
4
+ light: {
5
+ background: "#ffffff",
6
+ foreground: "#000000",
7
+ primary: "#2563eb",
8
+ secondary: "#f3f4f6",
9
+ border: "#d5d5d5",
10
+ danger: "#dc2626",
11
+ warning: "#d97706",
12
+ success: "#16a34a",
13
+ scrollbarThumb: "#3b82f6",
14
+ scrollbarTrack: "transparent"
15
+ },
16
+ dark: {
17
+ background: "#111111",
18
+ foreground: "#ffffff",
19
+ primary: "#005bc4",
20
+ secondary: "#262626",
21
+ border: "#2a2a2a",
22
+ danger: "#ef4444",
23
+ warning: "#f59e0b",
24
+ success: "#22c55e",
25
+ scrollbarThumb: "#1e40af",
26
+ scrollbarTrack: "#1f293700"
27
+ }
30
28
  };
29
+ //#endregion
30
+ export { e as defaultColorConfig };
@@ -1 +1 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AI,OAAO,cAAc,KAAG,IAAI,CAExC;IAEF;;;OAGG;IACH,YAAY,QAAO,cAAc,CAAmB;IAEpD;;;;;OAKG;IACH,gBAAgB,QAAO,SAAS,CAAkB;IAElD;;;;OAIG;IACH,QAAQ,GAAI,WAAW,cAAc,KAAG,IAAI,CAS1C;IAEF;;;;;OAKG;IACH,SAAS,GAAI,UAAU,QAAQ,KAAG,CAAC,MAAM,IAAI,CAAC,CAG5C;IAEF;;;OAGG;IACH,kBAAkB,QAAO,SAAS,MAAM,EAAE,CAAyB;IAEnE;;;;;OAKG;IACH,WAAW,QAAO,IAAI,CAWpB;IAEF;;;;OAIG;IACH,OAAO,CAAC,kBAAkB,CAMxB;IAEF;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IAKhB;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO;IAOf;;;;;OAKG;IACH,OAAO,CAAC,OAAO;IAKf;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;CA+BvB;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
@@ -1,179 +1,66 @@
1
1
  "use client";
2
- var r = Object.defineProperty;
3
- var d = (n, e, t) => e in n ? r(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
- var s = (n, e, t) => d(n, typeof e != "symbol" ? e + "" : e, t);
5
- const o = "ashee-theme", c = "(prefers-color-scheme: dark)", h = "theme-";
6
- class m {
7
- constructor() {
8
- /**
9
- * The user's selected theme preference, which may be "system"
10
- * or a specific theme name.
11
- */
12
- s(this, "selection", "light");
13
- /**
14
- * The final resolved theme name after applying the selection
15
- * and resolving "system" to either "light" or "dark".
16
- */
17
- s(this, "resolved", "light");
18
- /**
19
- * The default theme configured when the controller was initialized.
20
- * Used as a fallback when the stored preference is invalid.
21
- */
22
- s(this, "defaultTheme", "light");
23
- /**
24
- * The list of available themes in the application.
25
- * Used for validation and cycling through themes.
26
- */
27
- s(this, "availableThemes", []);
28
- /**
29
- * Set of listener functions that are called when the theme changes.
30
- */
31
- s(this, "listeners", /* @__PURE__ */ new Set());
32
- /**
33
- * MediaQueryList for detecting system dark mode preference.
34
- * Null when running in a non-browser environment.
35
- */
36
- s(this, "mediaQuery", null);
37
- /**
38
- * Seeds the default theme. Kept for backward compatibility - prefer
39
- * `configure()`, which also validates the stored selection against the
40
- * available theme map.
41
- *
42
- * @deprecated Use `configure()` instead for complete initialization.
43
- */
44
- s(this, "setDefault", (e) => {
45
- this.configure({ defaultTheme: e, themes: this.availableThemes });
46
- });
47
- /**
48
- * Returns the current theme selection.
49
- * @returns The current selected theme, which may be "system" or a specific theme name.
50
- */
51
- s(this, "getSelection", () => this.selection);
52
- /**
53
- * Returns the resolved theme name after applying the selection.
54
- * If the selection is "system", this will resolve to either "light" or "dark"
55
- * based on the system preference.
56
- * @returns The resolved theme name.
57
- */
58
- s(this, "getResolvedTheme", () => this.resolved);
59
- /**
60
- * Sets the theme selection and persists it to localStorage.
61
- * The provided selection is validated and sanitized before applying.
62
- * @param selection - The theme to select, either "system" or a theme name.
63
- */
64
- s(this, "setTheme", (e) => {
65
- const t = this.sanitize(e);
66
- this.selection = t, typeof window < "u" && window.localStorage.setItem(o, t), this.applySelection(), this.listeners.forEach((i) => {
67
- i();
68
- });
69
- });
70
- /**
71
- * Subscribes a listener to theme changes.
72
- * The listener will be called whenever the theme selection or resolved theme changes.
73
- * @param listener - The function to call when the theme changes.
74
- * @returns An unsubscribe function that removes the listener.
75
- */
76
- s(this, "subscribe", (e) => (this.listeners.add(e), () => this.listeners.delete(e)));
77
- /**
78
- * Returns the list of available theme names.
79
- * @returns The list of available themes configured in the controller.
80
- */
81
- s(this, "getAvailableThemes", () => this.availableThemes);
82
- /**
83
- * Cycles to the next theme in sequence (including "system" mode by default).
84
- * Loops back to the start when reaching the end of the available themes list.
85
- * The "system" option is not included in the toggle sequence; only specific
86
- * theme names are cycled through.
87
- */
88
- s(this, "toggleTheme", () => {
89
- const e = Array.from(new Set(this.availableThemes)).filter(
90
- (l) => l !== "system"
91
- ), t = e.indexOf(this.selection), i = t === -1 ? 0 : (t + 1) % e.length;
92
- this.setTheme(e[i]);
93
- });
94
- /**
95
- * Handles system dark mode preference changes.
96
- * Only re-applies the theme if the current selection is "system",
97
- * ensuring the resolved theme stays in sync with system changes.
98
- */
99
- s(this, "handleSystemChange", () => {
100
- this.selection === "system" && (this.applySelection(), this.listeners.forEach((e) => {
101
- e();
102
- }));
103
- });
104
- typeof window > "u" || (this.mediaQuery = window.matchMedia(c), this.mediaQuery.addEventListener("change", this.handleSystemChange));
105
- }
106
- /**
107
- * Seeds the controller with the resolved theme config and applies the theme.
108
- *
109
- * - Uses `localStorage["ashee-theme"]` when it holds a valid selection.
110
- * - Falls back to `config.theme.defaultTheme` on first visit.
111
- * - Clears stale/invalid values from storage.
112
- * - Never writes to storage (only `setTheme` persists user intent).
113
- */
114
- configure({ defaultTheme: e, themes: t }) {
115
- if (this.defaultTheme = e, this.availableThemes = t, typeof window > "u") {
116
- console.log(
117
- "[Theme] Running in non-browser environment, skipping localStorage operations."
118
- );
119
- return;
120
- }
121
- const i = window.localStorage.getItem(o), l = i !== null && this.isValid(i);
122
- l || i !== null && (console.log(
123
- "[Theme] Invalid stored theme, removing from localStorage."
124
- ), window.localStorage.removeItem(o)), this.selection = l ? i : e, this.applySelection(), this.listeners.forEach((a) => {
125
- a();
126
- });
127
- }
128
- /**
129
- * Validates a theme selection and returns a valid fallback if necessary.
130
- * @param selection - The theme selection to sanitize.
131
- * @returns A valid theme selection, falling back to the default theme
132
- * if the provided selection is invalid.
133
- */
134
- sanitize(e) {
135
- return this.isValid(e) ? e : this.defaultTheme;
136
- }
137
- /**
138
- * Checks whether a theme selection is valid.
139
- * "system" is always valid. Other theme names are valid if they exist
140
- * in the available themes list. If no available themes are configured,
141
- * any selection is considered valid.
142
- * @param selection - The theme selection to validate.
143
- * @returns True if the selection is valid, false otherwise.
144
- */
145
- isValid(e) {
146
- return e === "system" ? !0 : this.availableThemes.length > 0 ? this.availableThemes.includes(e) : !0;
147
- }
148
- /**
149
- * Resolves a theme selection to an actual theme name.
150
- * If the selection is "system", resolves based on the system preference.
151
- * @param selection - The theme selection to resolve.
152
- * @returns The resolved theme name.
153
- */
154
- resolve(e) {
155
- var t;
156
- return e !== "system" ? e : (t = this.mediaQuery) != null && t.matches ? "dark" : "light";
157
- }
158
- /**
159
- * Applies the current theme selection by updating the DOM.
160
- * This method sanitizes the selection, resolves it to a theme name,
161
- * and applies the appropriate CSS class to the document root.
162
- * It ensures that only valid theme classes are applied and removes
163
- * any previously applied theme classes.
164
- */
165
- applySelection() {
166
- const e = this.sanitize(this.selection);
167
- let t = this.resolve(e);
168
- if (this.availableThemes.length > 0 && !this.availableThemes.includes(t) && (t = this.availableThemes.includes(this.defaultTheme) ? this.defaultTheme : this.availableThemes[0]), this.resolved = t, typeof document > "u") return;
169
- const i = document.documentElement, l = `${h}${t}`;
170
- for (const a of Array.from(i.classList))
171
- a.startsWith(h) && i.classList.remove(a);
172
- i.classList.add(l);
173
- }
174
- }
175
- const f = new m();
176
- export {
177
- o as THEME_STORAGE_KEY,
178
- f as themeController
179
- };
2
+ //#region src/theme/controller.ts
3
+ var e = "ashee-theme", t = "theme-", n = new class {
4
+ selection = "light";
5
+ resolved = "light";
6
+ defaultTheme = "light";
7
+ availableThemes = [];
8
+ listeners = /* @__PURE__ */ new Set();
9
+ mediaQuery = null;
10
+ constructor() {
11
+ typeof window > "u" || (this.mediaQuery = window.matchMedia("(prefers-color-scheme: dark)"), this.mediaQuery.addEventListener("change", this.handleSystemChange));
12
+ }
13
+ configure({ defaultTheme: t, themes: n }) {
14
+ if (this.defaultTheme = t, this.availableThemes = n, typeof window > "u") {
15
+ console.log("[Theme] Running in non-browser environment, skipping localStorage operations.");
16
+ return;
17
+ }
18
+ let r = window.localStorage.getItem(e), i = r !== null && this.isValid(r);
19
+ i || r !== null && (console.log("[Theme] Invalid stored theme, removing from localStorage."), window.localStorage.removeItem(e)), this.selection = i ? r : t, this.applySelection(), this.listeners.forEach((e) => {
20
+ e();
21
+ });
22
+ }
23
+ setDefault = (e) => {
24
+ this.configure({
25
+ defaultTheme: e,
26
+ themes: this.availableThemes
27
+ });
28
+ };
29
+ getSelection = () => this.selection;
30
+ getResolvedTheme = () => this.resolved;
31
+ setTheme = (t) => {
32
+ let n = this.sanitize(t);
33
+ this.selection = n, typeof window < "u" && window.localStorage.setItem(e, n), this.applySelection(), this.listeners.forEach((e) => {
34
+ e();
35
+ });
36
+ };
37
+ subscribe = (e) => (this.listeners.add(e), () => this.listeners.delete(e));
38
+ getAvailableThemes = () => this.availableThemes;
39
+ toggleTheme = () => {
40
+ let e = Array.from(new Set(this.availableThemes)).filter((e) => e !== "system"), t = e.indexOf(this.selection), n = t === -1 ? 0 : (t + 1) % e.length;
41
+ this.setTheme(e[n]);
42
+ };
43
+ handleSystemChange = () => {
44
+ this.selection === "system" && (this.applySelection(), this.listeners.forEach((e) => {
45
+ e();
46
+ }));
47
+ };
48
+ sanitize(e) {
49
+ return this.isValid(e) ? e : this.defaultTheme;
50
+ }
51
+ isValid(e) {
52
+ return e === "system" ? !0 : this.availableThemes.length > 0 ? this.availableThemes.includes(e) : !0;
53
+ }
54
+ resolve(e) {
55
+ return e === "system" ? this.mediaQuery?.matches ? "dark" : "light" : e;
56
+ }
57
+ applySelection() {
58
+ let e = this.sanitize(this.selection), n = this.resolve(e);
59
+ if (this.availableThemes.length > 0 && !this.availableThemes.includes(n) && (n = this.availableThemes.includes(this.defaultTheme) ? this.defaultTheme : this.availableThemes[0]), this.resolved = n, typeof document > "u") return;
60
+ let r = document.documentElement, i = `${t}${n}`;
61
+ for (let e of Array.from(r.classList)) e.startsWith(t) && r.classList.remove(e);
62
+ r.classList.add(i);
63
+ }
64
+ }();
65
+ //#endregion
66
+ export { e as THEME_STORAGE_KEY, n as themeController };
@@ -1,47 +1,16 @@
1
1
  "use client";
2
- import { useSyncExternalStore as t } from "react";
2
+ "use client";
3
3
  import { themeController as e } from "./controller.js";
4
- function r() {
5
- const o = t(
6
- e.subscribe,
7
- e.getSelection,
8
- () => "light"
9
- ), l = t(
10
- e.subscribe,
11
- e.getResolvedTheme,
12
- () => "light"
13
- );
14
- return {
15
- /**
16
- * The user's current theme selection.
17
- * This can be either a specific theme name or "system".
18
- */
19
- theme: o,
20
- /**
21
- * The resolved theme name after applying the selection.
22
- * If the selection is "system", this resolves to either "light" or "dark"
23
- * based on the system preference.
24
- */
25
- resolvedTheme: l,
26
- /**
27
- * Function to set the theme selection.
28
- * This persists the selection to localStorage and applies the theme.
29
- * @param selection - The theme to select, either "system" or a theme name.
30
- */
31
- setTheme: e.setTheme,
32
- /**
33
- * Function to cycle to the next available theme.
34
- * This cycles through all available theme names, excluding "system".
35
- * Loops back to the start when reaching the end of the list.
36
- */
37
- toggleTheme: e.toggleTheme,
38
- /**
39
- * The list of available theme names in the application.
40
- * This does not include "system" as it is not a theme name.
41
- */
42
- availableThemes: e.getAvailableThemes()
43
- };
4
+ import { useSyncExternalStore as t } from "react";
5
+ //#region src/theme/useTheme.ts
6
+ function n() {
7
+ return {
8
+ theme: t(e.subscribe, e.getSelection, () => "light"),
9
+ resolvedTheme: t(e.subscribe, e.getResolvedTheme, () => "light"),
10
+ setTheme: e.setTheme,
11
+ toggleTheme: e.toggleTheme,
12
+ availableThemes: e.getAvailableThemes()
13
+ };
44
14
  }
45
- export {
46
- r as useTheme
47
- };
15
+ //#endregion
16
+ export { n as useTheme };
package/dist/utils/cn.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { clsx as t } from "clsx";
3
- import { twMerge as e } from "tailwind-merge";
4
- function c(...r) {
5
- return e(t(r));
2
+ import { clsx as e } from "clsx";
3
+ import { twMerge as t } from "tailwind-merge";
4
+ //#region src/utils/cn.ts
5
+ function n(...n) {
6
+ return t(e(n));
6
7
  }
7
- export {
8
- c as cn
9
- };
8
+ //#endregion
9
+ export { n as cn };
@@ -1,4 +1,5 @@
1
1
  export { cn } from './cn';
2
2
  export { mergeObject } from './merge-object';
3
+ export { ASHEE_GLOBAL_LAYER, ASHEE_LAYER, establishesStackingContext, resolveBaseZIndex, resolveFloatingZIndex, } from './stacking';
3
4
  export type { DeepPartial } from './types';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from "./cn.js";
2
2
  export * from "./merge-object.js";
3
3
  export * from "./resolve-token.js";
4
+ export * from "./stacking.js";
@@ -1,17 +1,16 @@
1
1
  "use client";
2
- function u(e) {
3
- return typeof e == "object" && e !== null && !Array.isArray(e);
2
+ //#region src/utils/merge-object.ts
3
+ function e(e) {
4
+ return typeof e == "object" && !!e && !Array.isArray(e);
4
5
  }
5
- function l(e, n) {
6
- if (!n)
7
- return e;
8
- const o = { ...e }, s = e, i = n;
9
- for (const t of Object.keys(n)) {
10
- const c = i[t], r = s[t];
11
- c !== void 0 && (u(r) && u(c) ? o[t] = l(r, c) : o[t] = c);
12
- }
13
- return o;
6
+ function t(n, r) {
7
+ if (!r) return n;
8
+ let i = { ...n }, a = n, o = r;
9
+ for (let n of Object.keys(r)) {
10
+ let r = o[n], s = a[n];
11
+ r !== void 0 && (i[n] = e(s) && e(r) ? t(s, r) : r);
12
+ }
13
+ return i;
14
14
  }
15
- export {
16
- l as mergeObject
17
- };
15
+ //#endregion
16
+ export { t as mergeObject };