@codefast/ui 0.9.2 → 0.9.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 (184) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +1 -1
  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 +1 -1
  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 +3 -3
  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 +1 -1
  32. package/dist/components/command.js +3 -3
  33. package/dist/components/context-menu.js +1 -1
  34. package/dist/components/dialog.js +2 -2
  35. package/dist/components/drawer.d.ts +2 -2
  36. package/dist/components/drawer.js +2 -2
  37. package/dist/components/dropdown-menu.js +1 -1
  38. package/dist/components/empty.d.ts +1 -1
  39. package/dist/components/empty.js +2 -2
  40. package/dist/components/field.d.ts +2 -2
  41. package/dist/components/field.js +4 -4
  42. package/dist/components/form.js +2 -2
  43. package/dist/components/hover-card.js +1 -1
  44. package/dist/components/input-group.d.ts +4 -4
  45. package/dist/components/input-group.js +5 -5
  46. package/dist/components/input-number.d.ts +1 -1
  47. package/dist/components/input-number.js +4 -4
  48. package/dist/components/input-otp.js +1 -1
  49. package/dist/components/input-password.d.ts +1 -1
  50. package/dist/components/input-password.js +1 -1
  51. package/dist/components/input-search.d.ts +1 -1
  52. package/dist/components/input-search.js +1 -1
  53. package/dist/components/input.js +1 -1
  54. package/dist/components/item.d.ts +2 -2
  55. package/dist/components/item.js +3 -3
  56. package/dist/components/kbd.js +1 -1
  57. package/dist/components/label.js +1 -1
  58. package/dist/components/marker.d.ts +1 -1
  59. package/dist/components/marker.js +2 -2
  60. package/dist/components/menubar.js +1 -1
  61. package/dist/components/message-scroller.d.ts +3 -3
  62. package/dist/components/message-scroller.js +3 -3
  63. package/dist/components/message.js +1 -1
  64. package/dist/components/native-select.js +1 -1
  65. package/dist/components/navigation-menu.js +2 -2
  66. package/dist/components/pagination.d.ts +2 -2
  67. package/dist/components/pagination.js +2 -2
  68. package/dist/components/popover.js +1 -1
  69. package/dist/components/progress-circle.d.ts +2 -2
  70. package/dist/components/progress-circle.js +3 -3
  71. package/dist/components/progress.js +1 -1
  72. package/dist/components/radio-cards.js +2 -2
  73. package/dist/components/radio-group.js +1 -1
  74. package/dist/components/radio.js +1 -1
  75. package/dist/components/resizable.js +1 -1
  76. package/dist/components/scroll-area.d.ts +1 -1
  77. package/dist/components/scroll-area.js +2 -2
  78. package/dist/components/select.js +1 -1
  79. package/dist/components/separator.d.ts +1 -1
  80. package/dist/components/separator.js +2 -2
  81. package/dist/components/sheet.d.ts +2 -2
  82. package/dist/components/sheet.js +3 -3
  83. package/dist/components/sidebar.d.ts +5 -5
  84. package/dist/components/sidebar.js +9 -9
  85. package/dist/components/skeleton.js +1 -1
  86. package/dist/components/slider.js +1 -1
  87. package/dist/components/spinner.js +1 -1
  88. package/dist/components/switch.js +1 -1
  89. package/dist/components/table.js +1 -1
  90. package/dist/components/tabs.d.ts +1 -1
  91. package/dist/components/tabs.js +2 -2
  92. package/dist/components/textarea.js +1 -1
  93. package/dist/components/toggle-group.d.ts +2 -2
  94. package/dist/components/toggle-group.js +2 -2
  95. package/dist/components/toggle.d.ts +1 -1
  96. package/dist/components/toggle.js +1 -1
  97. package/dist/components/tooltip.js +1 -1
  98. package/dist/hooks/use-is-mobile.js +1 -1
  99. package/dist/hooks/use-message-scroller-commands.d.ts +2 -2
  100. package/dist/hooks/use-message-scroller-commands.js +2 -2
  101. package/dist/hooks/use-message-scroller-controller.d.ts +2 -2
  102. package/dist/hooks/use-message-scroller-controller.js +4 -4
  103. package/dist/hooks/use-message-scroller-refs.d.ts +1 -1
  104. package/dist/hooks/use-message-scroller-refs.js +3 -3
  105. package/dist/index.d.ts +180 -180
  106. package/dist/index.js +93 -93
  107. package/dist/lib/message-scroller/geometry.d.ts +1 -1
  108. package/dist/lib/message-scroller/geometry.js +1 -1
  109. package/dist/lib/message-scroller/stores.d.ts +1 -1
  110. package/dist/lib/message-scroller/stores.js +1 -1
  111. package/dist/lib/message-scroller/types.d.ts +1 -1
  112. package/dist/primitives/input-number.d.ts +1 -1
  113. package/dist/primitives/input-number.js +2 -2
  114. package/dist/primitives/message-scroller.d.ts +6 -6
  115. package/dist/primitives/message-scroller.js +3 -3
  116. package/dist/variants/alert.d.ts +1 -1
  117. package/dist/variants/alert.js +1 -1
  118. package/dist/variants/attachment.d.ts +1 -1
  119. package/dist/variants/attachment.js +1 -1
  120. package/dist/variants/badge.d.ts +1 -1
  121. package/dist/variants/badge.js +1 -1
  122. package/dist/variants/bubble.d.ts +1 -1
  123. package/dist/variants/bubble.js +1 -1
  124. package/dist/variants/button-group.d.ts +1 -1
  125. package/dist/variants/button-group.js +1 -1
  126. package/dist/variants/button.d.ts +1 -1
  127. package/dist/variants/button.js +1 -1
  128. package/dist/variants/empty.d.ts +1 -1
  129. package/dist/variants/empty.js +1 -1
  130. package/dist/variants/field.d.ts +1 -1
  131. package/dist/variants/field.js +1 -1
  132. package/dist/variants/input-group.d.ts +1 -1
  133. package/dist/variants/input-group.js +1 -1
  134. package/dist/variants/item.d.ts +1 -1
  135. package/dist/variants/item.js +1 -1
  136. package/dist/variants/marker.d.ts +1 -1
  137. package/dist/variants/marker.js +1 -1
  138. package/dist/variants/navigation-menu.d.ts +1 -1
  139. package/dist/variants/navigation-menu.js +1 -1
  140. package/dist/variants/progress-circle.d.ts +1 -1
  141. package/dist/variants/progress-circle.js +1 -1
  142. package/dist/variants/scroll-area.d.ts +1 -1
  143. package/dist/variants/scroll-area.js +1 -1
  144. package/dist/variants/separator.d.ts +1 -1
  145. package/dist/variants/separator.js +1 -1
  146. package/dist/variants/sheet.d.ts +1 -1
  147. package/dist/variants/sheet.js +1 -1
  148. package/dist/variants/sidebar.d.ts +1 -1
  149. package/dist/variants/sidebar.js +1 -1
  150. package/dist/variants/tabs.d.ts +1 -1
  151. package/dist/variants/tabs.js +1 -1
  152. package/dist/variants/toggle.d.ts +1 -1
  153. package/dist/variants/toggle.js +1 -1
  154. package/package.json +9 -8
  155. package/src/css/foundation/base.css +68 -0
  156. package/src/css/foundation/motion.css +65 -0
  157. package/src/css/foundation/source.css +10 -0
  158. package/src/css/foundation/tokens.css +83 -0
  159. package/src/css/foundation/utilities.css +451 -0
  160. package/src/css/foundation/variants.css +108 -0
  161. package/src/css/preset.css +14 -0
  162. package/src/css/style.css +11 -0
  163. package/src/css/themes/amber.css +105 -0
  164. package/src/css/themes/blue.css +105 -0
  165. package/src/css/themes/cyan.css +105 -0
  166. package/src/css/themes/emerald.css +105 -0
  167. package/src/css/themes/fuchsia.css +105 -0
  168. package/src/css/themes/gray.css +105 -0
  169. package/src/css/themes/green.css +105 -0
  170. package/src/css/themes/indigo.css +105 -0
  171. package/src/css/themes/lime.css +105 -0
  172. package/src/css/themes/neutral.css +105 -0
  173. package/src/css/themes/orange.css +105 -0
  174. package/src/css/themes/pink.css +105 -0
  175. package/src/css/themes/purple.css +105 -0
  176. package/src/css/themes/red.css +105 -0
  177. package/src/css/themes/rose.css +105 -0
  178. package/src/css/themes/sky.css +105 -0
  179. package/src/css/themes/slate.css +105 -0
  180. package/src/css/themes/stone.css +105 -0
  181. package/src/css/themes/teal.css +105 -0
  182. package/src/css/themes/violet.css +105 -0
  183. package/src/css/themes/yellow.css +105 -0
  184. 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,108 @@
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
+ /* -------------------------------------------------------------------------
31
+ * State — boolean & Radix data-state
32
+ *
33
+ * Block variants match both Radix data-state="…" and boolean data-* attrs
34
+ * so components can use one shorthand regardless of attribute source.
35
+ * ------------------------------------------------------------------------- */
36
+
37
+ /* Matches Radix data-state="open" and boolean data-open (not "false"). */
38
+ @custom-variant data-open {
39
+ &:where([data-state="open"]),
40
+ &:where([data-open]:not([data-open="false"])) {
41
+ @slot;
42
+ }
43
+ }
44
+
45
+ @custom-variant data-closed {
46
+ &:where([data-state="closed"]),
47
+ &:where([data-closed]:not([data-closed="false"])) {
48
+ @slot;
49
+ }
50
+ }
51
+
52
+ @custom-variant data-checked {
53
+ &:where([data-state="checked"]),
54
+ &:where([data-checked]:not([data-checked="false"])) {
55
+ @slot;
56
+ }
57
+ }
58
+
59
+ @custom-variant data-unchecked {
60
+ &:where([data-state="unchecked"]),
61
+ &:where([data-unchecked]:not([data-unchecked="false"])) {
62
+ @slot;
63
+ }
64
+ }
65
+
66
+ @custom-variant data-indeterminate {
67
+ &:where([data-state="indeterminate"]),
68
+ &:where([data-indeterminate]:not([data-indeterminate="false"])) {
69
+ @slot;
70
+ }
71
+ }
72
+
73
+ /* data-selected only matches explicit true, not bare data-selected. */
74
+ @custom-variant data-selected {
75
+ &:where([data-state="selected"]),
76
+ &:where([data-selected="true"]) {
77
+ @slot;
78
+ }
79
+ }
80
+
81
+ @custom-variant data-active {
82
+ &:where([data-state="active"]),
83
+ &:where([data-active]:not([data-active="false"])) {
84
+ @slot;
85
+ }
86
+ }
87
+
88
+ @custom-variant data-disabled {
89
+ &:where([data-disabled="true"]),
90
+ &:where([data-disabled]:not([data-disabled="false"])) {
91
+ @slot;
92
+ }
93
+ }
94
+
95
+ @custom-variant data-focused {
96
+ &:where([data-focused="true"]),
97
+ &:where([data-focused]:not([data-focused="false"])) {
98
+ @slot;
99
+ }
100
+ }
101
+
102
+ /* ── State — Radix-only (no boolean data-* equivalent) ───────────────────────────────────────────────────────────── */
103
+
104
+ @custom-variant data-on (&:where([data-state="on"]));
105
+ @custom-variant data-collapsed (&:where([data-state="collapsed"]));
106
+ @custom-variant data-hidden (&:where([data-state="hidden"]));
107
+ @custom-variant data-visible (&:where([data-state="visible"]));
108
+ @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";
@@ -0,0 +1,105 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Amber theme
3
+ *
4
+ * Color tokens for the amber palette across the light (`:root`) and
5
+ * `.dark` variants. Trailing comments note the source
6
+ * palette swatch for each value.
7
+ * ------------------------------------------------------------------------- */
8
+
9
+ :root {
10
+ /* ── Surfaces & semantic colors ────────────────────────────────────────────────────────────────────────────────── */
11
+
12
+ --background: oklch(1 0 0); /* --color-zinc-50 */
13
+ --foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
14
+
15
+ --primary: oklch(0.67 0.16 58); /* --color-amber-600 */
16
+ --primary-foreground: oklch(0.99 0.02 95); /* --color-amber-50 */
17
+
18
+ --secondary: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
19
+ --secondary-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
20
+
21
+ --destructive: oklch(0.577 0.245 27.325); /* --color-red-600 */
22
+
23
+ --muted: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
24
+ --muted-foreground: oklch(0.552 0.016 285.938); /* --color-zinc-500 */
25
+
26
+ --accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
27
+ --accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
28
+
29
+ --popover: oklch(1 0 0); /* --color-zinc-50 */
30
+ --popover-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
31
+
32
+ --card: oklch(1 0 0); /* --color-zinc-50 */
33
+ --card-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
34
+
35
+ /* ── Form & focus ──────────────────────────────────────────────────────────────────────────────────────────────── */
36
+
37
+ --border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
38
+ --input: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
39
+ --ring: oklch(0.84 0.16 84); /* --color-amber-400 */
40
+
41
+ /* ── Sidebar ───────────────────────────────────────────────────────────────────────────────────────────────────── */
42
+
43
+ --sidebar: oklch(0.985 0 0); /* --color-zinc-50 */
44
+ --sidebar-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
45
+ --sidebar-primary: oklch(0.67 0.16 58); /* --color-amber-600 */
46
+ --sidebar-primary-foreground: oklch(0.99 0.02 95); /* --color-amber-50 */
47
+ --sidebar-accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
48
+ --sidebar-accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
49
+ --sidebar-border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
50
+ --sidebar-ring: oklch(0.84 0.16 84); /* --color-amber-400 */
51
+
52
+ /* ── Charts ────────────────────────────────────────────────────────────────────────────────────────────────────── */
53
+
54
+ --chart-1: oklch(0.88 0.15 92); /* --color-amber-300 */
55
+ --chart-2: oklch(0.77 0.16 70); /* --color-amber-500 */
56
+ --chart-3: oklch(0.67 0.16 58); /* --color-amber-600 */
57
+ --chart-4: oklch(0.56 0.15 49); /* --color-amber-700 */
58
+ --chart-5: oklch(0.47 0.12 46); /* --color-amber-800 */
59
+ }
60
+
61
+ .dark {
62
+ /* Dark variant — overrides the light tokens above. */
63
+
64
+ --background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
65
+ --foreground: oklch(0.985 0 0); /* --color-zinc-50 */
66
+
67
+ --primary: oklch(0.77 0.16 70); /* --color-amber-500 */
68
+ --primary-foreground: oklch(0.99 0.02 95); /* --color-amber-50 */
69
+
70
+ --secondary: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
71
+ --secondary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
72
+
73
+ --destructive: oklch(0.704 0.191 22.216); /* --color-red-400 */
74
+
75
+ --muted: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
76
+ --muted-foreground: oklch(0.705 0.015 286.067); /* --color-zinc-400 */
77
+
78
+ --accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
79
+ --accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
80
+
81
+ --popover: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
82
+ --popover-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
83
+
84
+ --card: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
85
+ --card-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
86
+
87
+ --border: oklch(1 0 0 / 10%); /* --color-white */
88
+ --input: oklch(1 0 0 / 15%); /* --color-white */
89
+ --ring: oklch(0.41 0.11 46); /* --color-amber-900 */
90
+
91
+ --sidebar: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
92
+ --sidebar-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
93
+ --sidebar-primary: oklch(0.77 0.16 70); /* --color-amber-500 */
94
+ --sidebar-primary-foreground: oklch(0.99 0.02 95); /* --color-amber-50 */
95
+ --sidebar-accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
96
+ --sidebar-accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
97
+ --sidebar-border: oklch(1 0 0 / 10%); /* --color-white */
98
+ --sidebar-ring: oklch(0.41 0.11 46); /* --color-amber-900 */
99
+
100
+ --chart-1: oklch(0.88 0.15 92); /* --color-amber-300 */
101
+ --chart-2: oklch(0.77 0.16 70); /* --color-amber-500 */
102
+ --chart-3: oklch(0.67 0.16 58); /* --color-amber-600 */
103
+ --chart-4: oklch(0.56 0.15 49); /* --color-amber-700 */
104
+ --chart-5: oklch(0.47 0.12 46); /* --color-amber-800 */
105
+ }