@codefast/ui 0.9.2 → 0.10.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 (188) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +3 -0
  3. package/dist/components/accordion.js +1 -1
  4. package/dist/components/alert-dialog.d.ts +1 -1
  5. package/dist/components/alert-dialog.js +2 -2
  6. package/dist/components/alert.d.ts +1 -1
  7. package/dist/components/alert.js +2 -2
  8. package/dist/components/attachment.d.ts +2 -2
  9. package/dist/components/attachment.js +3 -3
  10. package/dist/components/avatar.js +1 -1
  11. package/dist/components/badge.d.ts +1 -1
  12. package/dist/components/badge.js +1 -1
  13. package/dist/components/breadcrumb.js +3 -3
  14. package/dist/components/bubble.d.ts +1 -1
  15. package/dist/components/bubble.js +2 -2
  16. package/dist/components/button-group.d.ts +2 -2
  17. package/dist/components/button-group.js +3 -3
  18. package/dist/components/button.d.ts +1 -1
  19. package/dist/components/button.js +1 -1
  20. package/dist/components/calendar.d.ts +1 -1
  21. package/dist/components/calendar.js +3 -3
  22. package/dist/components/card.js +1 -1
  23. package/dist/components/carousel.d.ts +1 -1
  24. package/dist/components/carousel.js +17 -26
  25. package/dist/components/chart.js +1 -1
  26. package/dist/components/checkbox-cards.d.ts +1 -1
  27. package/dist/components/checkbox-cards.js +3 -3
  28. package/dist/components/checkbox-group.d.ts +1 -1
  29. package/dist/components/checkbox-group.js +2 -2
  30. package/dist/components/checkbox.js +1 -1
  31. package/dist/components/command.d.ts +8 -2
  32. package/dist/components/command.js +5 -5
  33. package/dist/components/context-menu.js +1 -1
  34. package/dist/components/dialog.d.ts +14 -2
  35. package/dist/components/dialog.js +6 -6
  36. package/dist/components/drawer.d.ts +2 -2
  37. package/dist/components/drawer.js +2 -2
  38. package/dist/components/dropdown-menu.js +1 -1
  39. package/dist/components/empty.d.ts +1 -1
  40. package/dist/components/empty.js +2 -2
  41. package/dist/components/field.d.ts +2 -2
  42. package/dist/components/field.js +4 -4
  43. package/dist/components/form.js +2 -2
  44. package/dist/components/hover-card.js +1 -1
  45. package/dist/components/input-group.d.ts +4 -4
  46. package/dist/components/input-group.js +5 -5
  47. package/dist/components/input-number.d.ts +2 -2
  48. package/dist/components/input-number.js +6 -6
  49. package/dist/components/input-otp.js +1 -1
  50. package/dist/components/input-password.d.ts +16 -3
  51. package/dist/components/input-password.js +3 -3
  52. package/dist/components/input-search.d.ts +8 -2
  53. package/dist/components/input-search.js +3 -3
  54. package/dist/components/input.js +1 -1
  55. package/dist/components/item.d.ts +2 -2
  56. package/dist/components/item.js +3 -3
  57. package/dist/components/kbd.js +1 -1
  58. package/dist/components/label.js +1 -1
  59. package/dist/components/marker.d.ts +1 -1
  60. package/dist/components/marker.js +2 -2
  61. package/dist/components/menubar.js +1 -1
  62. package/dist/components/message-scroller.d.ts +3 -3
  63. package/dist/components/message-scroller.js +3 -3
  64. package/dist/components/message.js +1 -1
  65. package/dist/components/native-select.js +1 -1
  66. package/dist/components/navigation-menu.js +2 -2
  67. package/dist/components/pagination.d.ts +2 -2
  68. package/dist/components/pagination.js +3 -3
  69. package/dist/components/popover.js +1 -1
  70. package/dist/components/progress-circle.d.ts +2 -2
  71. package/dist/components/progress-circle.js +3 -3
  72. package/dist/components/progress.d.ts +6 -1
  73. package/dist/components/progress.js +12 -4
  74. package/dist/components/radio-cards.js +2 -2
  75. package/dist/components/radio-group.js +1 -1
  76. package/dist/components/radio.js +1 -1
  77. package/dist/components/resizable.js +1 -1
  78. package/dist/components/scroll-area.d.ts +1 -1
  79. package/dist/components/scroll-area.js +2 -2
  80. package/dist/components/select.js +1 -1
  81. package/dist/components/separator.d.ts +1 -1
  82. package/dist/components/separator.js +2 -2
  83. package/dist/components/sheet.d.ts +9 -3
  84. package/dist/components/sheet.js +5 -5
  85. package/dist/components/sidebar.d.ts +19 -7
  86. package/dist/components/sidebar.js +66 -32
  87. package/dist/components/skeleton.js +1 -1
  88. package/dist/components/slider.js +1 -1
  89. package/dist/components/spinner.js +1 -1
  90. package/dist/components/switch.js +1 -1
  91. package/dist/components/table.js +1 -1
  92. package/dist/components/tabs.d.ts +1 -1
  93. package/dist/components/tabs.js +2 -2
  94. package/dist/components/textarea.js +1 -1
  95. package/dist/components/toggle-group.d.ts +2 -2
  96. package/dist/components/toggle-group.js +2 -2
  97. package/dist/components/toggle.d.ts +1 -1
  98. package/dist/components/toggle.js +1 -1
  99. package/dist/components/tooltip.js +1 -1
  100. package/dist/hooks/use-is-mobile.js +1 -1
  101. package/dist/hooks/use-media-query.d.ts +3 -3
  102. package/dist/hooks/use-media-query.js +15 -32
  103. package/dist/hooks/use-message-scroller-commands.d.ts +2 -2
  104. package/dist/hooks/use-message-scroller-commands.js +2 -2
  105. package/dist/hooks/use-message-scroller-controller.d.ts +2 -2
  106. package/dist/hooks/use-message-scroller-controller.js +4 -4
  107. package/dist/hooks/use-message-scroller-refs.d.ts +1 -1
  108. package/dist/hooks/use-message-scroller-refs.js +3 -3
  109. package/dist/index.d.ts +180 -180
  110. package/dist/index.js +93 -93
  111. package/dist/lib/message-scroller/geometry.d.ts +1 -1
  112. package/dist/lib/message-scroller/geometry.js +1 -1
  113. package/dist/lib/message-scroller/stores.d.ts +1 -1
  114. package/dist/lib/message-scroller/stores.js +1 -1
  115. package/dist/lib/message-scroller/types.d.ts +1 -1
  116. package/dist/primitives/input-number.d.ts +6 -6
  117. package/dist/primitives/input-number.js +6 -6
  118. package/dist/primitives/message-scroller.d.ts +6 -6
  119. package/dist/primitives/message-scroller.js +3 -3
  120. package/dist/variants/alert.d.ts +1 -1
  121. package/dist/variants/alert.js +1 -1
  122. package/dist/variants/attachment.d.ts +1 -1
  123. package/dist/variants/attachment.js +1 -1
  124. package/dist/variants/badge.d.ts +1 -1
  125. package/dist/variants/badge.js +1 -1
  126. package/dist/variants/bubble.d.ts +1 -1
  127. package/dist/variants/bubble.js +1 -1
  128. package/dist/variants/button-group.d.ts +1 -1
  129. package/dist/variants/button-group.js +1 -1
  130. package/dist/variants/button.d.ts +1 -1
  131. package/dist/variants/button.js +1 -1
  132. package/dist/variants/empty.d.ts +1 -1
  133. package/dist/variants/empty.js +1 -1
  134. package/dist/variants/field.d.ts +1 -1
  135. package/dist/variants/field.js +1 -1
  136. package/dist/variants/input-group.d.ts +1 -1
  137. package/dist/variants/input-group.js +1 -1
  138. package/dist/variants/item.d.ts +1 -1
  139. package/dist/variants/item.js +1 -1
  140. package/dist/variants/marker.d.ts +1 -1
  141. package/dist/variants/marker.js +1 -1
  142. package/dist/variants/navigation-menu.d.ts +1 -1
  143. package/dist/variants/navigation-menu.js +1 -1
  144. package/dist/variants/progress-circle.d.ts +1 -1
  145. package/dist/variants/progress-circle.js +1 -1
  146. package/dist/variants/scroll-area.d.ts +1 -1
  147. package/dist/variants/scroll-area.js +1 -1
  148. package/dist/variants/separator.d.ts +1 -1
  149. package/dist/variants/separator.js +1 -1
  150. package/dist/variants/sheet.d.ts +1 -1
  151. package/dist/variants/sheet.js +1 -1
  152. package/dist/variants/sidebar.d.ts +1 -1
  153. package/dist/variants/sidebar.js +1 -1
  154. package/dist/variants/tabs.d.ts +1 -1
  155. package/dist/variants/tabs.js +1 -1
  156. package/dist/variants/toggle.d.ts +1 -1
  157. package/dist/variants/toggle.js +1 -1
  158. package/package.json +8 -7
  159. package/src/css/foundation/base.css +68 -0
  160. package/src/css/foundation/motion.css +65 -0
  161. package/src/css/foundation/source.css +14 -0
  162. package/src/css/foundation/tokens.css +83 -0
  163. package/src/css/foundation/utilities.css +451 -0
  164. package/src/css/foundation/variants.css +121 -0
  165. package/src/css/preset.css +14 -0
  166. package/src/css/style.css +11 -0
  167. package/src/css/themes/amber.css +105 -0
  168. package/src/css/themes/blue.css +105 -0
  169. package/src/css/themes/cyan.css +105 -0
  170. package/src/css/themes/emerald.css +105 -0
  171. package/src/css/themes/fuchsia.css +105 -0
  172. package/src/css/themes/gray.css +105 -0
  173. package/src/css/themes/green.css +105 -0
  174. package/src/css/themes/indigo.css +105 -0
  175. package/src/css/themes/lime.css +105 -0
  176. package/src/css/themes/neutral.css +105 -0
  177. package/src/css/themes/orange.css +105 -0
  178. package/src/css/themes/pink.css +105 -0
  179. package/src/css/themes/purple.css +105 -0
  180. package/src/css/themes/red.css +105 -0
  181. package/src/css/themes/rose.css +105 -0
  182. package/src/css/themes/sky.css +105 -0
  183. package/src/css/themes/slate.css +105 -0
  184. package/src/css/themes/stone.css +105 -0
  185. package/src/css/themes/teal.css +105 -0
  186. package/src/css/themes/violet.css +105 -0
  187. package/src/css/themes/yellow.css +105 -0
  188. package/src/css/themes/zinc.css +105 -0
@@ -0,0 +1,451 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Utilities
3
+ *
4
+ * Scroll-aware edge fades and text shimmer, shared by the chat components
5
+ * (attachment, message, message-scroller) and usable on any scroller.
6
+ *
7
+ * `scroll-fade*` masks the content edges and tracks scroll position via
8
+ * `animation-timeline: scroll()`, degrading to a static fade where the
9
+ * feature is unsupported. `shimmer` clips a moving highlight to text for
10
+ * loading states. Both mirror in RTL.
11
+ *
12
+ * Vendored from an external Tailwind preset (scroll-fade, shimmer). Keep
13
+ * faithful so upstream fixes re-apply mechanically.
14
+ * ------------------------------------------------------------------------- */
15
+
16
+ /* scroll-fade */
17
+ @property --scroll-fade-t {
18
+ syntax: "<length-percentage>";
19
+ inherits: false;
20
+ initial-value: 0px;
21
+ }
22
+ @property --scroll-fade-b {
23
+ syntax: "<length-percentage>";
24
+ inherits: false;
25
+ initial-value: 0px;
26
+ }
27
+ @property --scroll-fade-s {
28
+ syntax: "<length-percentage>";
29
+ inherits: false;
30
+ initial-value: 0px;
31
+ }
32
+ @property --scroll-fade-e {
33
+ syntax: "<length-percentage>";
34
+ inherits: false;
35
+ initial-value: 0px;
36
+ }
37
+ @property --scroll-fade-mask {
38
+ syntax: "*";
39
+ inherits: false;
40
+ }
41
+
42
+ @theme inline {
43
+ @keyframes scroll-fade-reveal-t {
44
+ from {
45
+ --scroll-fade-t: 0px;
46
+ }
47
+ to {
48
+ --scroll-fade-t: var(--_scroll-fade-size-t, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
49
+ }
50
+ }
51
+ @keyframes scroll-fade-reveal-b {
52
+ from {
53
+ --scroll-fade-b: var(--_scroll-fade-size-b, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
54
+ }
55
+ to {
56
+ --scroll-fade-b: 0px;
57
+ }
58
+ }
59
+ @keyframes scroll-fade-reveal-s {
60
+ from {
61
+ --scroll-fade-s: 0px;
62
+ }
63
+ to {
64
+ --scroll-fade-s: var(--_scroll-fade-size-s, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
65
+ }
66
+ }
67
+ @keyframes scroll-fade-reveal-e {
68
+ from {
69
+ --scroll-fade-e: var(--_scroll-fade-size-e, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
70
+ }
71
+ to {
72
+ --scroll-fade-e: 0px;
73
+ }
74
+ }
75
+ }
76
+
77
+ @utility scroll-fade {
78
+ --_scroll-fade-size-t: var(--scroll-fade-t-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
79
+ --_scroll-fade-size-b: var(--scroll-fade-b-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
80
+ --scroll-fade-block: linear-gradient(
81
+ to bottom,
82
+ transparent 0,
83
+ #000 var(--scroll-fade-t, 0px),
84
+ #000 calc(100% - var(--scroll-fade-b, 0px)),
85
+ transparent 100%
86
+ );
87
+ -webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
88
+ mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
89
+ -webkit-mask-composite: source-in;
90
+ mask-composite: intersect;
91
+ -webkit-mask-repeat: no-repeat;
92
+ mask-repeat: no-repeat;
93
+
94
+ @supports (animation-timeline: scroll()) {
95
+ animation:
96
+ scroll-fade-reveal-t 1ms ease-in-out,
97
+ scroll-fade-reveal-b 1ms ease-in-out;
98
+ animation-timeline: scroll(self y), scroll(self y);
99
+ animation-range:
100
+ 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
101
+ calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
102
+ animation-fill-mode: both;
103
+ }
104
+
105
+ @supports not (animation-timeline: scroll()) {
106
+ --scroll-fade-t: var(--_scroll-fade-size-t);
107
+ --scroll-fade-b: var(--_scroll-fade-size-b);
108
+ }
109
+ }
110
+
111
+ @utility scroll-fade-y {
112
+ --_scroll-fade-size-t: var(--scroll-fade-t-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
113
+ --_scroll-fade-size-b: var(--scroll-fade-b-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
114
+ --scroll-fade-block: linear-gradient(
115
+ to bottom,
116
+ transparent 0,
117
+ #000 var(--scroll-fade-t, 0px),
118
+ #000 calc(100% - var(--scroll-fade-b, 0px)),
119
+ transparent 100%
120
+ );
121
+ -webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
122
+ mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
123
+ -webkit-mask-composite: source-in;
124
+ mask-composite: intersect;
125
+ -webkit-mask-repeat: no-repeat;
126
+ mask-repeat: no-repeat;
127
+
128
+ @supports (animation-timeline: scroll()) {
129
+ animation:
130
+ scroll-fade-reveal-t 1ms ease-in-out,
131
+ scroll-fade-reveal-b 1ms ease-in-out;
132
+ animation-timeline: scroll(self y), scroll(self y);
133
+ animation-range:
134
+ 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
135
+ calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
136
+ animation-fill-mode: both;
137
+ }
138
+
139
+ @supports not (animation-timeline: scroll()) {
140
+ --scroll-fade-t: var(--_scroll-fade-size-t);
141
+ --scroll-fade-b: var(--_scroll-fade-size-b);
142
+ }
143
+ }
144
+
145
+ @utility scroll-fade-x {
146
+ --_scroll-fade-size-s: var(--scroll-fade-s-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
147
+ --_scroll-fade-size-e: var(--scroll-fade-e-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
148
+ --scroll-fade-inline: linear-gradient(
149
+ to right,
150
+ transparent 0,
151
+ #000 var(--scroll-fade-s, 0px),
152
+ #000 calc(100% - var(--scroll-fade-e, 0px)),
153
+ transparent 100%
154
+ );
155
+ &:where([dir="rtl"], [dir="rtl"] *) {
156
+ --scroll-fade-inline: linear-gradient(
157
+ to left,
158
+ transparent 0,
159
+ #000 var(--scroll-fade-s, 0px),
160
+ #000 calc(100% - var(--scroll-fade-e, 0px)),
161
+ transparent 100%
162
+ );
163
+ }
164
+ -webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
165
+ mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
166
+ -webkit-mask-composite: source-in;
167
+ mask-composite: intersect;
168
+ -webkit-mask-repeat: no-repeat;
169
+ mask-repeat: no-repeat;
170
+
171
+ @supports (animation-timeline: scroll()) {
172
+ animation:
173
+ scroll-fade-reveal-s 1ms ease-in-out,
174
+ scroll-fade-reveal-e 1ms ease-in-out;
175
+ animation-timeline: scroll(self inline), scroll(self inline);
176
+ animation-range:
177
+ 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
178
+ calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
179
+ animation-fill-mode: both;
180
+ }
181
+
182
+ @supports not (animation-timeline: scroll()) {
183
+ --scroll-fade-s: var(--_scroll-fade-size-s);
184
+ --scroll-fade-e: var(--_scroll-fade-size-e);
185
+ }
186
+ }
187
+
188
+ @utility scroll-fade-t {
189
+ --_scroll-fade-size-t: var(--scroll-fade-t-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
190
+ --scroll-fade-mask: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-t, 0px), #000 100%);
191
+ -webkit-mask-image: var(--scroll-fade-mask);
192
+ mask-image: var(--scroll-fade-mask);
193
+ -webkit-mask-composite: source-in;
194
+ mask-composite: intersect;
195
+ -webkit-mask-repeat: no-repeat;
196
+ mask-repeat: no-repeat;
197
+
198
+ @supports (animation-timeline: scroll()) {
199
+ animation: scroll-fade-reveal-t 1ms ease-in-out;
200
+ animation-timeline: scroll(self y);
201
+ animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
202
+ animation-fill-mode: both;
203
+ }
204
+
205
+ @supports not (animation-timeline: scroll()) {
206
+ --scroll-fade-t: var(--_scroll-fade-size-t);
207
+ }
208
+ }
209
+
210
+ @utility scroll-fade-b {
211
+ --_scroll-fade-size-b: var(--scroll-fade-b-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
212
+ --scroll-fade-mask: linear-gradient(to bottom, #000 0, #000 calc(100% - var(--scroll-fade-b, 0px)), transparent 100%);
213
+ -webkit-mask-image: var(--scroll-fade-mask);
214
+ mask-image: var(--scroll-fade-mask);
215
+ -webkit-mask-composite: source-in;
216
+ mask-composite: intersect;
217
+ -webkit-mask-repeat: no-repeat;
218
+ mask-repeat: no-repeat;
219
+
220
+ @supports (animation-timeline: scroll()) {
221
+ animation: scroll-fade-reveal-b 1ms ease-in-out;
222
+ animation-timeline: scroll(self y);
223
+ animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
224
+ animation-fill-mode: both;
225
+ }
226
+
227
+ @supports not (animation-timeline: scroll()) {
228
+ --scroll-fade-b: var(--_scroll-fade-size-b);
229
+ }
230
+ }
231
+
232
+ @utility scroll-fade-l {
233
+ --_scroll-fade-size-s: var(--scroll-fade-s-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
234
+ --scroll-fade-mask: linear-gradient(to right, transparent 0, #000 var(--scroll-fade-s, 0px), #000 100%);
235
+ -webkit-mask-image: var(--scroll-fade-mask);
236
+ mask-image: var(--scroll-fade-mask);
237
+ -webkit-mask-composite: source-in;
238
+ mask-composite: intersect;
239
+ -webkit-mask-repeat: no-repeat;
240
+ mask-repeat: no-repeat;
241
+
242
+ @supports (animation-timeline: scroll()) {
243
+ animation: scroll-fade-reveal-s 1ms ease-in-out;
244
+ animation-timeline: scroll(self x);
245
+ animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
246
+ animation-fill-mode: both;
247
+ }
248
+
249
+ @supports not (animation-timeline: scroll()) {
250
+ --scroll-fade-s: var(--_scroll-fade-size-s);
251
+ }
252
+ }
253
+
254
+ @utility scroll-fade-r {
255
+ --_scroll-fade-size-e: var(--scroll-fade-e-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
256
+ --scroll-fade-mask: linear-gradient(to right, #000 0, #000 calc(100% - var(--scroll-fade-e, 0px)), transparent 100%);
257
+ -webkit-mask-image: var(--scroll-fade-mask);
258
+ mask-image: var(--scroll-fade-mask);
259
+ -webkit-mask-composite: source-in;
260
+ mask-composite: intersect;
261
+ -webkit-mask-repeat: no-repeat;
262
+ mask-repeat: no-repeat;
263
+
264
+ @supports (animation-timeline: scroll()) {
265
+ animation: scroll-fade-reveal-e 1ms ease-in-out;
266
+ animation-timeline: scroll(self x);
267
+ animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
268
+ animation-fill-mode: both;
269
+ }
270
+
271
+ @supports not (animation-timeline: scroll()) {
272
+ --scroll-fade-e: var(--_scroll-fade-size-e);
273
+ }
274
+ }
275
+
276
+ @utility scroll-fade-s {
277
+ --_scroll-fade-size-s: var(--scroll-fade-s-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
278
+ --scroll-fade-mask: linear-gradient(to right, transparent 0, #000 var(--scroll-fade-s, 0px), #000 100%);
279
+ &:where([dir="rtl"], [dir="rtl"] *) {
280
+ --scroll-fade-mask: linear-gradient(to left, transparent 0, #000 var(--scroll-fade-s, 0px), #000 100%);
281
+ }
282
+ -webkit-mask-image: var(--scroll-fade-mask);
283
+ mask-image: var(--scroll-fade-mask);
284
+ -webkit-mask-composite: source-in;
285
+ mask-composite: intersect;
286
+ -webkit-mask-repeat: no-repeat;
287
+ mask-repeat: no-repeat;
288
+
289
+ @supports (animation-timeline: scroll()) {
290
+ animation: scroll-fade-reveal-s 1ms ease-in-out;
291
+ animation-timeline: scroll(self inline);
292
+ animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
293
+ animation-fill-mode: both;
294
+ }
295
+
296
+ @supports not (animation-timeline: scroll()) {
297
+ --scroll-fade-s: var(--_scroll-fade-size-s);
298
+ }
299
+ }
300
+
301
+ @utility scroll-fade-e {
302
+ --_scroll-fade-size-e: var(--scroll-fade-e-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
303
+ --scroll-fade-mask: linear-gradient(to right, #000 0, #000 calc(100% - var(--scroll-fade-e, 0px)), transparent 100%);
304
+ &:where([dir="rtl"], [dir="rtl"] *) {
305
+ --scroll-fade-mask: linear-gradient(to left, #000 0, #000 calc(100% - var(--scroll-fade-e, 0px)), transparent 100%);
306
+ }
307
+ -webkit-mask-image: var(--scroll-fade-mask);
308
+ mask-image: var(--scroll-fade-mask);
309
+ -webkit-mask-composite: source-in;
310
+ mask-composite: intersect;
311
+ -webkit-mask-repeat: no-repeat;
312
+ mask-repeat: no-repeat;
313
+
314
+ @supports (animation-timeline: scroll()) {
315
+ animation: scroll-fade-reveal-e 1ms ease-in-out;
316
+ animation-timeline: scroll(self inline);
317
+ animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
318
+ animation-fill-mode: both;
319
+ }
320
+
321
+ @supports not (animation-timeline: scroll()) {
322
+ --scroll-fade-e: var(--_scroll-fade-size-e);
323
+ }
324
+ }
325
+
326
+ @utility scroll-fade-* {
327
+ --scroll-fade-size: calc(var(--spacing) * --value(integer));
328
+ --scroll-fade-size: --value([length], [percentage]);
329
+ }
330
+
331
+ @utility scroll-fade-t-* {
332
+ --scroll-fade-t-size: calc(var(--spacing) * --value(integer));
333
+ --scroll-fade-t-size: --value([length], [percentage]);
334
+ }
335
+
336
+ @utility scroll-fade-b-* {
337
+ --scroll-fade-b-size: calc(var(--spacing) * --value(integer));
338
+ --scroll-fade-b-size: --value([length], [percentage]);
339
+ }
340
+
341
+ @utility scroll-fade-s-* {
342
+ --scroll-fade-s-size: calc(var(--spacing) * --value(integer));
343
+ --scroll-fade-s-size: --value([length], [percentage]);
344
+ }
345
+
346
+ @utility scroll-fade-e-* {
347
+ --scroll-fade-e-size: calc(var(--spacing) * --value(integer));
348
+ --scroll-fade-e-size: --value([length], [percentage]);
349
+ }
350
+
351
+ @utility scroll-fade-none {
352
+ --scroll-fade-mask: none;
353
+ }
354
+
355
+ /* shimmer */
356
+ @property --shimmer-angle {
357
+ syntax: "<angle>";
358
+ inherits: true;
359
+ initial-value: 20deg;
360
+ }
361
+ @property --shimmer-image {
362
+ syntax: "*";
363
+ inherits: false;
364
+ }
365
+ @property --shimmer-text-fill {
366
+ syntax: "*";
367
+ inherits: false;
368
+ }
369
+
370
+ @theme inline {
371
+ @keyframes tw-shimmer {
372
+ from {
373
+ background-position: 100% 0;
374
+ }
375
+ to {
376
+ background-position: 0 0;
377
+ }
378
+ }
379
+ }
380
+
381
+ @utility shimmer {
382
+ --_spread: var(--shimmer-spread, calc(3ch + 40px));
383
+ --_base: currentColor;
384
+ --_highlight: var(--shimmer-color, oklch(from currentColor l c h / calc(alpha * 0.2)));
385
+
386
+ background-image: var(
387
+ --shimmer-image,
388
+ linear-gradient(
389
+ calc(90deg + var(--shimmer-angle)),
390
+ var(--_base) calc(50% - var(--_spread)),
391
+ color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * 0.5),
392
+ var(--_highlight) 50%,
393
+ color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * 0.5),
394
+ var(--_base) calc(50% + var(--_spread))
395
+ )
396
+ );
397
+ background-repeat: no-repeat;
398
+ background-size: calc(200% + var(--_spread) * 2) 100%;
399
+ background-position: 0 0;
400
+ background-clip: text;
401
+ -webkit-background-clip: text;
402
+ -webkit-text-fill-color: var(--shimmer-text-fill, transparent);
403
+ animation: tw-shimmer var(--shimmer-duration, 2s) linear infinite;
404
+
405
+ @variant dark {
406
+ --_highlight: var(--shimmer-color, oklch(from currentColor max(0.8, calc(l + 0.4)) c h / calc(alpha + 0.4)));
407
+ }
408
+
409
+ &:where([dir="rtl"], [dir="rtl"] *) {
410
+ animation-direction: reverse;
411
+ }
412
+ }
413
+
414
+ @utility shimmer-once {
415
+ animation-iteration-count: 1;
416
+ }
417
+
418
+ @utility shimmer-reverse {
419
+ animation-direction: reverse;
420
+ }
421
+
422
+ @utility shimmer-none {
423
+ --shimmer-image: none;
424
+ --shimmer-text-fill: currentColor;
425
+ }
426
+
427
+ @utility shimmer-color-* {
428
+ --shimmer-color: --value(--color, [color]);
429
+ --shimmer-color: color-mix(in oklch, --value(--color, [color]) calc(--modifier(integer) * 1%), transparent);
430
+ }
431
+
432
+ @utility shimmer-duration-* {
433
+ --shimmer-duration: calc(--value(integer) * 1ms);
434
+ }
435
+
436
+ @utility shimmer-spread-* {
437
+ --shimmer-spread: calc(var(--spacing) * --value(integer));
438
+ --shimmer-spread: --value([length], [percentage]);
439
+ }
440
+
441
+ @utility shimmer-angle-* {
442
+ --shimmer-angle: calc(--value(integer) * 1deg);
443
+ }
444
+
445
+ @media (prefers-reduced-motion: reduce) {
446
+ .shimmer {
447
+ animation: none;
448
+ background-image: none;
449
+ -webkit-text-fill-color: currentColor;
450
+ }
451
+ }
@@ -0,0 +1,121 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Variants
3
+ *
4
+ * Custom Tailwind variants for @codefast/ui. Prefer these over verbose
5
+ * arbitrary variants (`data-[state=open]:`, `data-[side=left]:`).
6
+ *
7
+ * Shorthand usage (composes with group-, peer-, in-, has- modifiers):
8
+ * data-open: → [data-state="open"] or [data-open]:not([data-open="false"])
9
+ * group-data-disabled: → ancestor .group with matching data-disabled
10
+ * in-data-side-left: → ancestor with [data-side="left"]
11
+ * ------------------------------------------------------------------------- */
12
+
13
+ /* ── Theme ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
14
+
15
+ /* Class-only — matches the token themes, which switch on `.dark` (no prefers-color-scheme arm).
16
+ `@codefast/theme` always resolves the scheme to an explicit `.dark`/`.light` class (SSR included),
17
+ so the OS media query is never the deciding factor and would only desync utilities from tokens. */
18
+ @custom-variant dark (&:where(.dark, .dark *));
19
+
20
+ /* ── Layout — orientation & placement (Radix Popper) ─────────────────────────────────────────────────────────────── */
21
+
22
+ @custom-variant data-horizontal (&:where([data-orientation="horizontal"]));
23
+ @custom-variant data-vertical (&:where([data-orientation="vertical"]));
24
+
25
+ @custom-variant data-side-top (&:where([data-side="top"]));
26
+ @custom-variant data-side-right (&:where([data-side="right"]));
27
+ @custom-variant data-side-bottom (&:where([data-side="bottom"]));
28
+ @custom-variant data-side-left (&:where([data-side="left"]));
29
+
30
+ /* ── Layout — sidebar breakpoint ─────────────────────────────────────────────────────────────────────────────────── */
31
+
32
+ /* Mints the `sidebar:` variant: the width from which `Sidebar` docks instead of opening as a sheet. An app moves it
33
+ with its own `@theme { --breakpoint-sidebar: … }`, placed before or after this preset. */
34
+ @theme default {
35
+ --breakpoint-sidebar: 48rem;
36
+ }
37
+
38
+ /* The resolved breakpoint, which `SidebarProvider` reads to match the same media query in JS. */
39
+ :root {
40
+ --sidebar-breakpoint: --theme(--breakpoint-sidebar inline);
41
+ }
42
+
43
+ /* -------------------------------------------------------------------------
44
+ * State — boolean & Radix data-state
45
+ *
46
+ * Block variants match both Radix data-state="…" and boolean data-* attrs
47
+ * so components can use one shorthand regardless of attribute source.
48
+ * ------------------------------------------------------------------------- */
49
+
50
+ /* Matches Radix data-state="open" and boolean data-open (not "false"). */
51
+ @custom-variant data-open {
52
+ &:where([data-state="open"]),
53
+ &:where([data-open]:not([data-open="false"])) {
54
+ @slot;
55
+ }
56
+ }
57
+
58
+ @custom-variant data-closed {
59
+ &:where([data-state="closed"]),
60
+ &:where([data-closed]:not([data-closed="false"])) {
61
+ @slot;
62
+ }
63
+ }
64
+
65
+ @custom-variant data-checked {
66
+ &:where([data-state="checked"]),
67
+ &:where([data-checked]:not([data-checked="false"])) {
68
+ @slot;
69
+ }
70
+ }
71
+
72
+ @custom-variant data-unchecked {
73
+ &:where([data-state="unchecked"]),
74
+ &:where([data-unchecked]:not([data-unchecked="false"])) {
75
+ @slot;
76
+ }
77
+ }
78
+
79
+ @custom-variant data-indeterminate {
80
+ &:where([data-state="indeterminate"]),
81
+ &:where([data-indeterminate]:not([data-indeterminate="false"])) {
82
+ @slot;
83
+ }
84
+ }
85
+
86
+ /* data-selected only matches explicit true, not bare data-selected. */
87
+ @custom-variant data-selected {
88
+ &:where([data-state="selected"]),
89
+ &:where([data-selected="true"]) {
90
+ @slot;
91
+ }
92
+ }
93
+
94
+ @custom-variant data-active {
95
+ &:where([data-state="active"]),
96
+ &:where([data-active]:not([data-active="false"])) {
97
+ @slot;
98
+ }
99
+ }
100
+
101
+ @custom-variant data-disabled {
102
+ &:where([data-disabled="true"]),
103
+ &:where([data-disabled]:not([data-disabled="false"])) {
104
+ @slot;
105
+ }
106
+ }
107
+
108
+ @custom-variant data-focused {
109
+ &:where([data-focused="true"]),
110
+ &:where([data-focused]:not([data-focused="false"])) {
111
+ @slot;
112
+ }
113
+ }
114
+
115
+ /* ── State — Radix-only (no boolean data-* equivalent) ───────────────────────────────────────────────────────────── */
116
+
117
+ @custom-variant data-on (&:where([data-state="on"]));
118
+ @custom-variant data-collapsed (&:where([data-state="collapsed"]));
119
+ @custom-variant data-hidden (&:where([data-state="hidden"]));
120
+ @custom-variant data-visible (&:where([data-state="visible"]));
121
+ @custom-variant data-delayed-open (&:where([data-state="delayed-open"]));
@@ -0,0 +1,14 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Foundation preset
3
+ *
4
+ * Aggregates the foundation layers in cascade order. Import this from an app
5
+ * after `tailwindcss` and a theme to pull in @codefast/ui's variants, tokens,
6
+ * motion, utilities, and base styles.
7
+ * ------------------------------------------------------------------------- */
8
+
9
+ @import "./foundation/source.css";
10
+ @import "./foundation/variants.css";
11
+ @import "./foundation/tokens.css";
12
+ @import "./foundation/motion.css";
13
+ @import "./foundation/utilities.css";
14
+ @import "./foundation/base.css";
@@ -0,0 +1,11 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Entry stylesheet
3
+ *
4
+ * The default, batteries-included entry point: Tailwind core, the neutral
5
+ * theme, and the @codefast/ui foundation preset. Apps that want a different
6
+ * theme import `tailwindcss`, their chosen theme, and `./preset.css` directly.
7
+ * ------------------------------------------------------------------------- */
8
+
9
+ @import "tailwindcss";
10
+ @import "./themes/neutral.css";
11
+ @import "./preset.css";