@marianmeres/stuic 2.65.0 → 3.0.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 (171) hide show
  1. package/README.md +292 -4
  2. package/dist/README.md +41 -18
  3. package/dist/actions/popover/README.md +19 -0
  4. package/dist/actions/popover/index.css +6 -9
  5. package/dist/actions/popover/popover.svelte.js +2 -2
  6. package/dist/actions/tooltip/README.md +18 -0
  7. package/dist/actions/tooltip/index.css +5 -8
  8. package/dist/actions/tooltip/tooltip.svelte.js +1 -1
  9. package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte +9 -10
  10. package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte.d.ts +3 -3
  11. package/dist/components/AlertConfirmPrompt/Current.svelte +15 -17
  12. package/dist/components/AlertConfirmPrompt/Current.svelte.d.ts +5 -3
  13. package/dist/components/AlertConfirmPrompt/acp-icons.js +5 -4
  14. package/dist/components/AlertConfirmPrompt/index.css +62 -0
  15. package/dist/components/AssetsPreview/AssetsPreview.svelte +92 -73
  16. package/dist/components/AssetsPreview/AssetsPreview.svelte.d.ts +1 -0
  17. package/dist/components/AssetsPreview/index.css +59 -0
  18. package/dist/components/Avatar/Avatar.svelte +32 -18
  19. package/dist/components/Avatar/Avatar.svelte.d.ts +1 -0
  20. package/dist/components/Avatar/README.md +166 -0
  21. package/dist/components/Avatar/index.css +128 -0
  22. package/dist/components/Backdrop/Backdrop.svelte +8 -2
  23. package/dist/components/Backdrop/Backdrop.svelte.d.ts +1 -0
  24. package/dist/components/Backdrop/README.md +71 -6
  25. package/dist/components/Backdrop/index.css +29 -0
  26. package/dist/components/Button/Button.svelte +117 -124
  27. package/dist/components/Button/Button.svelte.d.ts +35 -23
  28. package/dist/components/Button/README.md +87 -21
  29. package/dist/components/Button/index.css +473 -9
  30. package/dist/components/Button/index.d.ts +1 -1
  31. package/dist/components/Button/index.js +1 -1
  32. package/dist/components/ButtonGroupRadio/ButtonGroupRadio.svelte +7 -38
  33. package/dist/components/ButtonGroupRadio/README.md +82 -4
  34. package/dist/components/ButtonGroupRadio/index.css +152 -14
  35. package/dist/components/Collapsible/Collapsible.svelte +7 -7
  36. package/dist/components/Collapsible/Collapsible.svelte.d.ts +2 -2
  37. package/dist/components/Collapsible/README.md +34 -2
  38. package/dist/components/Collapsible/index.css +38 -0
  39. package/dist/components/CommandMenu/CommandMenu.svelte +13 -24
  40. package/dist/components/CommandMenu/README.md +39 -0
  41. package/dist/components/CommandMenu/index.css +45 -2
  42. package/dist/components/DismissibleMessage/DismissibleMessage.svelte +53 -50
  43. package/dist/components/DismissibleMessage/DismissibleMessage.svelte.d.ts +6 -5
  44. package/dist/components/DismissibleMessage/README.md +93 -11
  45. package/dist/components/DismissibleMessage/index.css +122 -8
  46. package/dist/components/DismissibleMessage/index.d.ts +1 -1
  47. package/dist/components/DropdownMenu/DropdownMenu.svelte +14 -50
  48. package/dist/components/DropdownMenu/DropdownMenu.svelte.d.ts +6 -6
  49. package/dist/components/DropdownMenu/README.md +132 -0
  50. package/dist/components/DropdownMenu/index.css +231 -27
  51. package/dist/components/Input/FieldAssets.svelte +8 -5
  52. package/dist/components/Input/FieldCheckbox.svelte +7 -44
  53. package/dist/components/Input/FieldFile.svelte +1 -6
  54. package/dist/components/Input/FieldInput.svelte +1 -1
  55. package/dist/components/Input/FieldOptions.svelte +41 -38
  56. package/dist/components/Input/FieldRadios.svelte +7 -16
  57. package/dist/components/Input/FieldSelect.svelte +1 -1
  58. package/dist/components/Input/FieldSwitch.svelte +1 -5
  59. package/dist/components/Input/FieldTextarea.svelte +1 -1
  60. package/dist/components/Input/README.md +194 -0
  61. package/dist/components/Input/_internal/FieldRadioInternal.svelte +2 -40
  62. package/dist/components/Input/_internal/InputWrap.svelte +8 -48
  63. package/dist/components/Input/index.css +522 -127
  64. package/dist/components/ListItemButton/ListItemButton.svelte +37 -73
  65. package/dist/components/ListItemButton/ListItemButton.svelte.d.ts +1 -9
  66. package/dist/components/ListItemButton/README.md +100 -45
  67. package/dist/components/ListItemButton/index.css +175 -56
  68. package/dist/components/ListItemButton/index.d.ts +1 -1
  69. package/dist/components/ListItemButton/index.js +1 -1
  70. package/dist/components/Modal/Modal.svelte +2 -8
  71. package/dist/components/Modal/Modal.svelte.d.ts +1 -0
  72. package/dist/components/Modal/README.md +29 -0
  73. package/dist/components/Modal/index.css +36 -0
  74. package/dist/components/ModalDialog/ModalDialog.svelte +2 -21
  75. package/dist/components/ModalDialog/README.md +35 -0
  76. package/dist/components/ModalDialog/index.css +57 -0
  77. package/dist/components/Notifications/Notifications.svelte +44 -128
  78. package/dist/components/Notifications/Notifications.svelte.d.ts +9 -17
  79. package/dist/components/Notifications/README.md +186 -70
  80. package/dist/components/Notifications/index.css +212 -15
  81. package/dist/components/Progress/README.md +15 -0
  82. package/dist/components/Progress/_internal/Bar.svelte +2 -2
  83. package/dist/components/Progress/index.css +4 -4
  84. package/dist/components/Skeleton/Skeleton.svelte +3 -2
  85. package/dist/components/Skeleton/index.css +11 -14
  86. package/dist/components/Spinner/Spinner.svelte +2 -2
  87. package/dist/components/Spinner/SpinnerCircle.svelte +1 -1
  88. package/dist/components/Switch/README.md +15 -0
  89. package/dist/components/Switch/Switch.svelte +4 -7
  90. package/dist/components/Switch/Switch.svelte.d.ts +1 -1
  91. package/dist/components/Switch/SwitchButton.svelte +4 -5
  92. package/dist/components/Switch/index.css +3 -4
  93. package/dist/components/TabbedMenu/README.md +26 -21
  94. package/dist/components/TabbedMenu/TabbedMenu.svelte +5 -5
  95. package/dist/components/TabbedMenu/index.css +7 -22
  96. package/dist/components/ThemePreview/README.md +289 -0
  97. package/dist/components/ThemePreview/ThemePreview.svelte +341 -0
  98. package/dist/components/ThemePreview/ThemePreview.svelte.d.ts +33 -0
  99. package/dist/components/ThemePreview/index.css +493 -0
  100. package/dist/components/ThemePreview/index.d.ts +1 -0
  101. package/dist/components/ThemePreview/index.js +1 -0
  102. package/dist/components/TwCheck/TwCheck.svelte +4 -4
  103. package/dist/components/TwCheck/index.css +3 -2
  104. package/dist/components/TypeaheadInput/TypeaheadInput.svelte +1 -1
  105. package/dist/components/X/X.svelte +16 -4
  106. package/dist/components/X/X.svelte.d.ts +1 -0
  107. package/dist/icons/index.d.ts +1 -0
  108. package/dist/icons/index.js +1 -0
  109. package/dist/index.css +31 -16
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.js +1 -0
  112. package/dist/themes/blue-orange.css +163 -0
  113. package/dist/themes/blue-orange.d.ts +6 -0
  114. package/dist/themes/blue-orange.js +151 -0
  115. package/dist/themes/cyan-red.css +163 -0
  116. package/dist/themes/cyan-red.d.ts +6 -0
  117. package/dist/themes/cyan-red.js +151 -0
  118. package/dist/themes/cyan-slate.css +163 -0
  119. package/dist/themes/cyan-slate.d.ts +6 -0
  120. package/dist/themes/cyan-slate.js +151 -0
  121. package/dist/themes/emerald-pink.css +163 -0
  122. package/dist/themes/emerald-pink.d.ts +6 -0
  123. package/dist/themes/emerald-pink.js +151 -0
  124. package/dist/themes/fuchsia-emerald.css +163 -0
  125. package/dist/themes/fuchsia-emerald.d.ts +6 -0
  126. package/dist/themes/fuchsia-emerald.js +151 -0
  127. package/dist/themes/gray.css +163 -0
  128. package/dist/themes/gray.d.ts +6 -0
  129. package/dist/themes/gray.js +151 -0
  130. package/dist/themes/indigo-amber.css +163 -0
  131. package/dist/themes/indigo-amber.d.ts +6 -0
  132. package/dist/themes/indigo-amber.js +151 -0
  133. package/dist/themes/neutral.css +163 -0
  134. package/dist/themes/neutral.d.ts +6 -0
  135. package/dist/themes/neutral.js +151 -0
  136. package/dist/themes/pink-emerald.css +163 -0
  137. package/dist/themes/pink-emerald.d.ts +6 -0
  138. package/dist/themes/pink-emerald.js +151 -0
  139. package/dist/themes/purple-yellow.css +163 -0
  140. package/dist/themes/purple-yellow.d.ts +6 -0
  141. package/dist/themes/purple-yellow.js +151 -0
  142. package/dist/themes/rainbow.css +163 -0
  143. package/dist/themes/rainbow.d.ts +6 -0
  144. package/dist/themes/rainbow.js +156 -0
  145. package/dist/themes/red-blue.css +163 -0
  146. package/dist/themes/red-blue.d.ts +6 -0
  147. package/dist/themes/red-blue.js +151 -0
  148. package/dist/themes/red-cyan.css +163 -0
  149. package/dist/themes/red-cyan.d.ts +6 -0
  150. package/dist/themes/red-cyan.js +151 -0
  151. package/dist/themes/rose-teal.css +163 -0
  152. package/dist/themes/rose-teal.d.ts +6 -0
  153. package/dist/themes/rose-teal.js +151 -0
  154. package/dist/themes/sky-amber.css +163 -0
  155. package/dist/themes/sky-amber.d.ts +6 -0
  156. package/dist/themes/sky-amber.js +151 -0
  157. package/dist/themes/slate-cyan.css +163 -0
  158. package/dist/themes/slate-cyan.d.ts +6 -0
  159. package/dist/themes/slate-cyan.js +151 -0
  160. package/dist/themes/tailwind-color-pairs.md +31 -0
  161. package/dist/themes/teal-rose.css +163 -0
  162. package/dist/themes/teal-rose.d.ts +6 -0
  163. package/dist/themes/teal-rose.js +151 -0
  164. package/dist/themes/violet-lime.css +163 -0
  165. package/dist/themes/violet-lime.d.ts +6 -0
  166. package/dist/themes/violet-lime.js +151 -0
  167. package/dist/utils/design-tokens.d.ts +43 -0
  168. package/dist/utils/design-tokens.js +100 -0
  169. package/dist/utils/index.d.ts +1 -0
  170. package/dist/utils/index.js +1 -0
  171. package/package.json +22 -2
@@ -0,0 +1,493 @@
1
+ /* ============================================================================
2
+ THEME PREVIEW COMPONENT
3
+
4
+ This component serves as a reference implementation for stuic theming.
5
+ It demonstrates:
6
+ - Consuming theme tokens (--stuic-color-*)
7
+ - Component-level customization tokens (--stuic-theme-preview-*)
8
+ - Internal variable pattern (--_*)
9
+ - Proper state handling (hover, active, focus)
10
+ - Dark mode compatibility
11
+ ============================================================================ */
12
+
13
+ /* ============================================================================
14
+ COMPONENT TOKENS
15
+
16
+ Define component-level customization tokens in :root.
17
+ Users can override globally: :root { --stuic-theme-preview-radius: 0; }
18
+ Or locally: <ThemePreview style="--stuic-theme-preview-gap: 2rem;">
19
+ ============================================================================ */
20
+
21
+ /* prettier-ignore */
22
+ :root {
23
+ --stuic-theme-preview-radius: var(--radius-md);
24
+ --stuic-theme-preview-gap: 1rem;
25
+ --stuic-theme-preview-transition: 150ms;
26
+
27
+ /* Section-specific tokens that consume theme colors */
28
+ --stuic-theme-preview-header-bg: var(--stuic-color-surface);
29
+ --stuic-theme-preview-header-text: var(--stuic-color-surface-foreground);
30
+ --stuic-theme-preview-sidebar-bg: var(--stuic-color-muted);
31
+ --stuic-theme-preview-sidebar-text: var(--stuic-color-muted-foreground);
32
+ --stuic-theme-preview-sidebar-width: 200px;
33
+ --stuic-theme-preview-main-bg: var(--stuic-color-background);
34
+ --stuic-theme-preview-main-text: var(--stuic-color-foreground);
35
+ --stuic-theme-preview-footer-bg: var(--stuic-color-surface);
36
+ --stuic-theme-preview-footer-text: var(--stuic-color-muted-foreground);
37
+ }
38
+
39
+ /* ============================================================================
40
+ BASE CONTAINER
41
+ ============================================================================ */
42
+
43
+ .stuic-theme-preview {
44
+ display: flex;
45
+ flex-direction: column;
46
+ min-height: 400px;
47
+ border-radius: var(--stuic-theme-preview-radius);
48
+ border: 1px solid var(--stuic-color-border);
49
+ overflow: hidden;
50
+ background: var(--stuic-theme-preview-main-bg);
51
+ color: var(--stuic-theme-preview-main-text);
52
+ }
53
+
54
+ /* ============================================================================
55
+ HEADER
56
+
57
+ Demonstrates: surface, surface-foreground, muted-foreground tokens
58
+ ============================================================================ */
59
+
60
+ .stuic-theme-preview-header {
61
+ background: var(--stuic-theme-preview-header-bg);
62
+ color: var(--stuic-theme-preview-header-text);
63
+ padding: 1rem 1.5rem;
64
+ border-bottom: 1px solid var(--stuic-color-border);
65
+ }
66
+
67
+ .stuic-theme-preview-header .header-content {
68
+ display: flex;
69
+ flex-direction: column;
70
+ gap: 0.25rem;
71
+ }
72
+
73
+ .stuic-theme-preview-header .header-title {
74
+ font-size: 1.25rem;
75
+ font-weight: 600;
76
+ margin: 0;
77
+ color: var(--stuic-color-surface-foreground);
78
+ }
79
+
80
+ .stuic-theme-preview-header .header-subtitle {
81
+ font-size: 0.875rem;
82
+ margin: 0;
83
+ color: var(--stuic-color-muted-foreground);
84
+ }
85
+
86
+ /* ============================================================================
87
+ BODY LAYOUT
88
+ ============================================================================ */
89
+
90
+ .stuic-theme-preview-body {
91
+ display: flex;
92
+ flex: 1;
93
+ min-height: 0;
94
+ }
95
+
96
+ /* ============================================================================
97
+ SIDEBAR
98
+
99
+ Demonstrates: muted, muted-foreground, hover states, active state with primary
100
+ ============================================================================ */
101
+
102
+ .stuic-theme-preview-sidebar {
103
+ width: var(--stuic-theme-preview-sidebar-width);
104
+ background: var(--stuic-theme-preview-sidebar-bg);
105
+ color: var(--stuic-theme-preview-sidebar-text);
106
+ padding: 1rem;
107
+ border-right: 1px solid var(--stuic-color-border);
108
+ display: flex;
109
+ flex-direction: column;
110
+ justify-content: space-between;
111
+ }
112
+
113
+ .stuic-theme-preview-sidebar .sidebar-nav {
114
+ display: flex;
115
+ flex-direction: column;
116
+ gap: 0.5rem;
117
+ }
118
+
119
+ .stuic-theme-preview-sidebar .nav-list {
120
+ list-style: none;
121
+ padding: 0;
122
+ margin: 0;
123
+ display: flex;
124
+ flex-direction: column;
125
+ gap: 0.25rem;
126
+ }
127
+
128
+ .stuic-theme-preview-sidebar .nav-item {
129
+ padding: 0.5rem 0.75rem;
130
+ border-radius: calc(var(--stuic-theme-preview-radius) / 2);
131
+ cursor: pointer;
132
+ transition:
133
+ background var(--stuic-theme-preview-transition),
134
+ color var(--stuic-theme-preview-transition);
135
+ color: var(--stuic-color-foreground);
136
+ }
137
+
138
+ .stuic-theme-preview-sidebar .nav-item:hover {
139
+ background: var(--stuic-color-muted-hover);
140
+ }
141
+
142
+ /* Active state uses primary intent - demonstrates intent for emphasis */
143
+ .stuic-theme-preview-sidebar .nav-item.active {
144
+ background: var(--stuic-color-primary);
145
+ color: var(--stuic-color-primary-foreground);
146
+ }
147
+
148
+ .stuic-theme-preview-sidebar .nav-item.muted {
149
+ color: var(--stuic-color-muted-foreground);
150
+ }
151
+
152
+ .stuic-theme-preview-sidebar .sidebar-footer {
153
+ padding-top: 1rem;
154
+ border-top: 1px solid var(--stuic-color-border);
155
+ }
156
+
157
+ /* ============================================================================
158
+ MAIN CONTENT
159
+
160
+ Demonstrates: background, foreground tokens
161
+ ============================================================================ */
162
+
163
+ .stuic-theme-preview-main {
164
+ flex: 1;
165
+ padding: 1.5rem;
166
+ overflow-y: auto;
167
+ display: flex;
168
+ flex-direction: column;
169
+ gap: 1.5rem;
170
+ background: var(--stuic-theme-preview-main-bg);
171
+ color: var(--stuic-theme-preview-main-text);
172
+ }
173
+
174
+ /* ============================================================================
175
+ SECTIONS
176
+ ============================================================================ */
177
+
178
+ .stuic-theme-preview .preview-section {
179
+ display: flex;
180
+ flex-direction: column;
181
+ gap: 0.75rem;
182
+ }
183
+
184
+ .stuic-theme-preview .section-label {
185
+ font-size: 0.75rem;
186
+ font-weight: 600;
187
+ text-transform: uppercase;
188
+ letter-spacing: 0.05em;
189
+ color: var(--stuic-color-muted-foreground);
190
+ }
191
+
192
+ /* ============================================================================
193
+ BUTTON DEMONSTRATIONS
194
+
195
+ This section demonstrates the INTERNAL VARIABLE PATTERN used by the Button
196
+ component. This is the core theming technique in stuic:
197
+
198
+ 1. Intent selectors set the color palette via --_color, --_fg variables
199
+ 2. Variant selectors determine HOW colors are applied via --_bg, --_text, etc.
200
+ 3. Base styles consume the internal variables
201
+
202
+ This separation allows any intent + variant combination to work automatically.
203
+ ============================================================================ */
204
+
205
+ .stuic-theme-preview .button-grid {
206
+ display: grid;
207
+ grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
208
+ gap: 1rem;
209
+ }
210
+
211
+ .stuic-theme-preview .button-column {
212
+ display: flex;
213
+ flex-direction: column;
214
+ gap: 0.5rem;
215
+ }
216
+
217
+ .stuic-theme-preview .intent-label {
218
+ font-size: 0.75rem;
219
+ color: var(--stuic-color-muted-foreground);
220
+ text-align: center;
221
+ }
222
+
223
+ /* ============================================================================
224
+ ROLE COLOR SWATCHES
225
+
226
+ Demonstrates: background/surface/muted with their paired foregrounds
227
+ ============================================================================ */
228
+
229
+ .stuic-theme-preview .role-colors-grid {
230
+ display: grid;
231
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
232
+ gap: 1rem;
233
+ }
234
+
235
+ .stuic-theme-preview .color-swatch {
236
+ padding: 1rem;
237
+ border-radius: var(--stuic-theme-preview-radius);
238
+ border: 1px solid var(--stuic-color-border);
239
+ display: flex;
240
+ flex-direction: column;
241
+ gap: 0.5rem;
242
+ }
243
+
244
+ .stuic-theme-preview .color-swatch .swatch-label {
245
+ font-size: 0.75rem;
246
+ font-weight: 600;
247
+ opacity: 0.7;
248
+ }
249
+
250
+ /* Each swatch uses its role color as background */
251
+ .stuic-theme-preview .color-swatch.background {
252
+ background: var(--stuic-color-background);
253
+ }
254
+
255
+ .stuic-theme-preview .color-swatch.surface {
256
+ background: var(--stuic-color-surface);
257
+ }
258
+
259
+ .stuic-theme-preview .color-swatch.muted-bg {
260
+ background: var(--stuic-color-muted);
261
+ }
262
+
263
+ /* Text uses the paired foreground colors */
264
+ .stuic-theme-preview .foreground-text {
265
+ color: var(--stuic-color-foreground);
266
+ }
267
+
268
+ .stuic-theme-preview .surface-foreground-text {
269
+ color: var(--stuic-color-surface-foreground);
270
+ }
271
+
272
+ .stuic-theme-preview .muted-foreground-text {
273
+ color: var(--stuic-color-muted-foreground);
274
+ }
275
+
276
+ .stuic-theme-preview .muted-text {
277
+ color: var(--stuic-color-muted-foreground);
278
+ }
279
+
280
+ /* ============================================================================
281
+ BORDER DEMONSTRATIONS
282
+
283
+ Demonstrates: border, border-hover, border-active tokens
284
+ ============================================================================ */
285
+
286
+ .stuic-theme-preview .border-examples {
287
+ display: flex;
288
+ gap: 1rem;
289
+ flex-wrap: wrap;
290
+ }
291
+
292
+ .stuic-theme-preview .border-box {
293
+ padding: 1rem;
294
+ border-radius: var(--stuic-theme-preview-radius);
295
+ background: var(--stuic-color-surface);
296
+ transition: border-color var(--stuic-theme-preview-transition);
297
+ }
298
+
299
+ .stuic-theme-preview .border-box.default {
300
+ border: 2px solid var(--stuic-color-border);
301
+ }
302
+
303
+ .stuic-theme-preview .border-box.hover {
304
+ border: 2px solid var(--stuic-color-border);
305
+ }
306
+
307
+ .stuic-theme-preview .border-box.hover:hover {
308
+ border-color: var(--stuic-color-border-hover);
309
+ }
310
+
311
+ .stuic-theme-preview .border-box.active {
312
+ border: 2px solid var(--stuic-color-border-active);
313
+ }
314
+
315
+ /* ============================================================================
316
+ INPUT DEMONSTRATIONS
317
+
318
+ Demonstrates: input, ring tokens, focus states
319
+ ============================================================================ */
320
+
321
+ .stuic-theme-preview .input-examples {
322
+ display: flex;
323
+ gap: 1rem;
324
+ flex-wrap: wrap;
325
+ }
326
+
327
+ .stuic-theme-preview .input-wrapper {
328
+ flex: 1;
329
+ min-width: 200px;
330
+ }
331
+
332
+ .stuic-theme-preview .preview-input {
333
+ width: 100%;
334
+ padding: 0.625rem 0.75rem;
335
+ font-size: 1rem;
336
+ border-radius: var(--stuic-theme-preview-radius);
337
+ border: 1px solid var(--stuic-color-border);
338
+ background: var(--stuic-color-input);
339
+ color: var(--stuic-color-foreground);
340
+ transition:
341
+ border-color var(--stuic-theme-preview-transition),
342
+ background var(--stuic-theme-preview-transition);
343
+ }
344
+
345
+ .stuic-theme-preview .preview-input::placeholder {
346
+ color: var(--stuic-color-muted-foreground);
347
+ }
348
+
349
+ .stuic-theme-preview .preview-input:hover {
350
+ background: var(--stuic-color-input-hover);
351
+ border-color: var(--stuic-color-border-hover);
352
+ }
353
+
354
+ /* Focus state uses ring token */
355
+ .stuic-theme-preview .preview-input:focus,
356
+ .stuic-theme-preview .preview-input.focus {
357
+ outline: 3px solid var(--stuic-color-ring);
358
+ outline-offset: 0;
359
+ border-color: var(--stuic-color-primary);
360
+ }
361
+
362
+ /* ============================================================================
363
+ HIGHLIGHT BOXES
364
+
365
+ Demonstrates: using intent colors for content areas (soft variant pattern)
366
+ ============================================================================ */
367
+
368
+ .stuic-theme-preview .highlight-box {
369
+ padding: 1rem;
370
+ border-radius: var(--stuic-theme-preview-radius);
371
+ margin-bottom: 0.75rem;
372
+ }
373
+
374
+ .stuic-theme-preview .highlight-box:last-child {
375
+ margin-bottom: 0;
376
+ }
377
+
378
+ .stuic-theme-preview .highlight-box strong {
379
+ display: block;
380
+ margin-bottom: 0.25rem;
381
+ }
382
+
383
+ .stuic-theme-preview .highlight-box p {
384
+ margin: 0;
385
+ font-size: 0.875rem;
386
+ opacity: 0.9;
387
+ }
388
+
389
+ /* Using soft variant pattern for content boxes */
390
+ .stuic-theme-preview .highlight-box.primary {
391
+ background: color-mix(in srgb, var(--stuic-color-primary) 15%, transparent);
392
+ color: var(--stuic-color-primary);
393
+ border: 1px solid color-mix(in srgb, var(--stuic-color-primary) 30%, transparent);
394
+ }
395
+
396
+ .stuic-theme-preview .highlight-box.accent {
397
+ background: color-mix(in srgb, var(--stuic-color-accent) 15%, transparent);
398
+ color: var(--stuic-color-accent);
399
+ border: 1px solid color-mix(in srgb, var(--stuic-color-accent) 30%, transparent);
400
+ }
401
+
402
+ /* ============================================================================
403
+ TYPOGRAPHY SECTION
404
+ ============================================================================ */
405
+
406
+ .stuic-theme-preview .typography-demo {
407
+ display: flex;
408
+ flex-direction: column;
409
+ gap: 0.5rem;
410
+ }
411
+
412
+ .stuic-theme-preview .typography-demo p {
413
+ margin: 0;
414
+ }
415
+
416
+ .stuic-theme-preview .text-foreground {
417
+ color: var(--stuic-color-foreground);
418
+ }
419
+
420
+ .stuic-theme-preview .text-muted {
421
+ color: var(--stuic-color-muted-foreground);
422
+ }
423
+
424
+ .stuic-theme-preview .text-surface-foreground {
425
+ color: var(--stuic-color-surface-foreground);
426
+ }
427
+
428
+ /* ============================================================================
429
+ FOOTER
430
+ ============================================================================ */
431
+
432
+ .stuic-theme-preview-footer {
433
+ background: var(--stuic-theme-preview-footer-bg);
434
+ color: var(--stuic-theme-preview-footer-text);
435
+ padding: 0.75rem 1.5rem;
436
+ border-top: 1px solid var(--stuic-color-border);
437
+ }
438
+
439
+ .stuic-theme-preview-footer .footer-content {
440
+ display: flex;
441
+ align-items: center;
442
+ justify-content: center;
443
+ gap: 0.5rem;
444
+ font-size: 0.875rem;
445
+ }
446
+
447
+ .stuic-theme-preview-footer .footer-divider {
448
+ opacity: 0.3;
449
+ }
450
+
451
+ /* ============================================================================
452
+ DARK MODE COMPATIBILITY
453
+
454
+ The component inherits dark mode behavior from theme tokens automatically.
455
+ When using theme tokens properly (--stuic-color-*), no explicit .dark
456
+ overrides are needed - the theme handles it.
457
+ ============================================================================ */
458
+
459
+ /* ============================================================================
460
+ RESPONSIVE ADJUSTMENTS
461
+ ============================================================================ */
462
+
463
+ @media (max-width: 640px) {
464
+ .stuic-theme-preview-body {
465
+ flex-direction: column;
466
+ }
467
+
468
+ .stuic-theme-preview-sidebar {
469
+ width: 100%;
470
+ border-right: none;
471
+ border-bottom: 1px solid var(--stuic-color-border);
472
+ }
473
+
474
+ .stuic-theme-preview .button-grid {
475
+ grid-template-columns: repeat(2, 1fr);
476
+ }
477
+ }
478
+
479
+ /* ============================================================================
480
+ REDUCED MOTION
481
+
482
+ Respect user preferences for reduced motion.
483
+ ============================================================================ */
484
+
485
+ @media (prefers-reduced-motion: reduce) {
486
+ .stuic-theme-preview,
487
+ .stuic-theme-preview-button,
488
+ .stuic-theme-preview .border-box,
489
+ .stuic-theme-preview .preview-input,
490
+ .stuic-theme-preview-sidebar .nav-item {
491
+ transition: none;
492
+ }
493
+ }
@@ -0,0 +1 @@
1
+ export { default as ThemePreview, type Props as ThemePreviewProps, INTENT_COLORS, BUTTON_VARIANTS, } from "./ThemePreview.svelte";
@@ -0,0 +1 @@
1
+ export { default as ThemePreview, INTENT_COLORS, BUTTON_VARIANTS, } from "./ThemePreview.svelte";
@@ -15,9 +15,9 @@
15
15
  let { class: classProp, children, theme }: Props = $props();
16
16
 
17
17
  const _default = `
18
- stuic-twcheck bg-twcheck-bg
19
- inline-block px-2
20
- text-yellow-300 sm:text-white
18
+ stuic-twcheck bg-(--stuic-twcheck-bg)
19
+ inline-block px-2
20
+ text-yellow-300 sm:text-white
21
21
  text-base sm:text-2xl
22
22
  sm:border-2 border-teal-400
23
23
  `;
@@ -25,7 +25,7 @@
25
25
  const _buildTheme = (theme?: string) => {
26
26
  // simulating missing css var
27
27
  return theme
28
- ? `--color-twcheck-bg: var(--color-foo-bar-baz, var(--color-${theme}-600));`
28
+ ? `--stuic-twcheck-bg: var(--color-foo-bar-baz, var(--color-${theme}-600));`
29
29
  : "";
30
30
  };
31
31
  </script>
@@ -1,3 +1,4 @@
1
- @theme inline {
2
- --color-twcheck-bg: var(--color-twcheck-bg, var(--color-red-600));
1
+ /* TwCheck component tokens */
2
+ :root {
3
+ --stuic-twcheck-bg: var(--stuic-color-primary);
3
4
  }
@@ -156,7 +156,7 @@
156
156
  //
157
157
  let _fixedInputClasses = $derived(
158
158
  twMerge(
159
- "form-input z-10 relative",
159
+ "z-10 relative",
160
160
  classInput,
161
161
  "text-black",
162
162
  "border-0 p-0 bg-transparent block w-full",
@@ -1,14 +1,24 @@
1
1
  <script lang="ts" module>
2
+ import { DevicePointer, twMerge } from "../../index.js";
2
3
  export interface Props {
3
4
  class?: string;
4
5
  strokeWidth?: 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4;
6
+ linecapRound?: boolean;
5
7
  }
6
8
  </script>
7
9
 
8
10
  <script lang="ts">
9
- import { twMerge } from "../../index.js";
11
+ let { class: classProps, strokeWidth, linecapRound = true }: Props = $props();
10
12
 
11
- let { class: classProps, strokeWidth = 3 }: Props = $props();
13
+ // motivation - make it thicker on mobile, especially for weary eyes
14
+ // (note: dp.isCoarse does not say nothing technically about mobile, but in 90% it will)
15
+ // const dp = new DevicePointer();
16
+ // const auto = $derived(dp.isCoarse ? 3 : 2);
17
+
18
+ // if sw not provided use thicker on mobile
19
+ const _strokeWidth = $derived(strokeWidth ?? 2);
20
+
21
+ const _strokeLinecap = $derived(linecapRound ? "round" : "square");
12
22
 
13
23
  // size-6 = 1.5rem = 24px
14
24
  </script>
@@ -16,9 +26,11 @@
16
26
  <svg
17
27
  fill="none"
18
28
  viewBox="0 0 24 24"
19
- stroke-width={strokeWidth}
29
+ stroke-width={_strokeWidth}
20
30
  stroke="currentColor"
21
31
  class={twMerge("inline size-6", classProps)}
22
32
  >
23
- <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
33
+ <!-- iconLucideX -->
34
+ <path stroke-linecap={_strokeLinecap} d="M18 6 6 18" />
35
+ <path stroke-linecap={_strokeLinecap} d="m6 6 12 12" />
24
36
  </svg>
@@ -1,6 +1,7 @@
1
1
  export interface Props {
2
2
  class?: string;
3
3
  strokeWidth?: 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4;
4
+ linecapRound?: boolean;
4
5
  }
5
6
  declare const X: import("svelte").Component<Props, {}, "">;
6
7
  type X = ReturnType<typeof X>;
@@ -36,3 +36,4 @@ export { iconLucideSquare as iconSquare } from "@marianmeres/icons-fns/lucide/ic
36
36
  export { iconLucideMenu as iconMenu } from "@marianmeres/icons-fns/lucide/iconLucideMenu.js";
37
37
  export { iconLucideUser as iconUser } from "@marianmeres/icons-fns/lucide/iconLucideUser.js";
38
38
  export { iconLucideEllipsisVertical as iconEllipsisVertical } from "@marianmeres/icons-fns/lucide/iconLucideEllipsisVertical.js";
39
+ export { iconLucideSettings as iconSettings } from "@marianmeres/icons-fns/lucide/iconLucideSettings.js";
@@ -40,3 +40,4 @@ export { iconLucideSquare as iconSquare } from "@marianmeres/icons-fns/lucide/ic
40
40
  export { iconLucideMenu as iconMenu } from "@marianmeres/icons-fns/lucide/iconLucideMenu.js";
41
41
  export { iconLucideUser as iconUser } from "@marianmeres/icons-fns/lucide/iconLucideUser.js";
42
42
  export { iconLucideEllipsisVertical as iconEllipsisVertical } from "@marianmeres/icons-fns/lucide/iconLucideEllipsisVertical.js";
43
+ export { iconLucideSettings as iconSettings } from "@marianmeres/icons-fns/lucide/iconLucideSettings.js";
package/dist/index.css CHANGED
@@ -6,27 +6,42 @@
6
6
  */
7
7
  /* @import "tailwindcss"; */
8
8
 
9
- @plugin '@tailwindcss/forms';
9
+ /* @plugin '@tailwindcss/forms'; */
10
10
 
11
11
  @custom-variant dark (&:where(.dark, .dark *));
12
12
 
13
13
  @source "./";
14
14
 
15
- /* "components" looks like a better fit here, but forms plugin uses "utilities"
16
- so, since we need to override, sticking with that */
17
- @layer utilities {
18
- @import "./actions/tooltip/index.css";
19
- @import "./components/Button/index.css";
20
- @import "./components/ButtonGroupRadio/index.css";
21
- @import "./components/DismissibleMessage/index.css";
22
- @import "./components/Input/index.css";
23
- @import "./components/ListItemButton/index.css";
24
- @import "./components/Notifications/index.css";
25
- @import "./components/Progress/index.css";
26
- @import "./components/Switch/index.css";
27
- @import "./components/TabbedMenu/index.css";
28
- @import "./components/TwCheck/index.css";
29
- }
15
+ /* Import global design tokens before component styles */
16
+ /* @import "./themes/neutral.css"; */
17
+ /* @import "./themes/gray.css"; */
18
+ @import "./themes/rainbow.css";
19
+ /* @import "./themes/indigo-amber.css"; */
20
+ /* @import "./themes/teal-rose.css"; */
21
+ /* @import "./themes/violet-lime.css"; */
22
+ /* @import "./themes/blue-orange.css"; */
23
+ /* @import "./themes/emerald-pink.css"; */
24
+ /* @import "./themes/sky-amber.css"; */
25
+ /* @import "./themes/fuchsia-emerald.css"; */
26
+ /* @import "./themes/slate-cyan.css"; */
27
+ /* @import "./themes/purple-yellow.css"; */
28
+ /* @import "./themes/cyan-red.css"; */
29
+ /* @import "./themes/red-cyan.css"; */
30
+
31
+ /* Component styles - each file has its own @layer components wrapper */
32
+ @import "./components/Input/index.css";
33
+ @import "./components/ModalDialog/index.css";
34
+ /* @import "./actions/tooltip/index.css"; */
35
+ /* @import "./components/Button/index.css"; */
36
+ /* @import "./components/ButtonGroupRadio/index.css"; */
37
+ /* @import "./components/Collapsible/index.css"; */
38
+ /* @import "./components/DismissibleMessage/index.css"; */
39
+ /* @import "./components/ListItemButton/index.css"; */
40
+ /* @import "./components/Notifications/index.css"; */
41
+ /* @import "./components/Progress/index.css"; */
42
+ /* @import "./components/Switch/index.css"; */
43
+ /* @import "./components/TabbedMenu/index.css"; */
44
+ /* @import "./components/TwCheck/index.css"; */
30
45
 
31
46
  @layer base {
32
47
  button:not(:disabled),
package/dist/index.d.ts CHANGED
@@ -49,6 +49,7 @@ export * from "./components/Spinner/index.js";
49
49
  export * from "./components/Switch/index.js";
50
50
  export * from "./components/TabbedMenu/index.js";
51
51
  export * from "./components/Thc/index.js";
52
+ export * from "./components/ThemePreview/index.js";
52
53
  export * from "./components/TwCheck/index.js";
53
54
  export * from "./components/TypeaheadInput/index.js";
54
55
  export * from "./components/X/index.js";
package/dist/index.js CHANGED
@@ -50,6 +50,7 @@ export * from "./components/Spinner/index.js";
50
50
  export * from "./components/Switch/index.js";
51
51
  export * from "./components/TabbedMenu/index.js";
52
52
  export * from "./components/Thc/index.js";
53
+ export * from "./components/ThemePreview/index.js";
53
54
  export * from "./components/TwCheck/index.js";
54
55
  export * from "./components/TypeaheadInput/index.js";
55
56
  export * from "./components/X/index.js";