@blankways/ui 0.0.0-stage → 0.1.0-alpha.1

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 (216) hide show
  1. package/README.md +228 -2
  2. package/dist/cli/cli.options.d.ts +5 -0
  3. package/dist/cli/cli.options.js +53 -0
  4. package/dist/cli/cli.registry.d.ts +6 -0
  5. package/dist/cli/cli.registry.js +37 -0
  6. package/dist/cli/cli.types.d.ts +32 -0
  7. package/dist/cli/cli.types.js +1 -0
  8. package/dist/cli/index.d.ts +3 -0
  9. package/dist/cli/index.js +3 -0
  10. package/dist/cli.d.ts +2 -0
  11. package/dist/cli.js +47 -0
  12. package/dist/commands/add.command.d.ts +2 -0
  13. package/dist/commands/add.command.js +101 -0
  14. package/dist/commands/doctor.command.d.ts +3 -0
  15. package/dist/commands/doctor.command.js +92 -0
  16. package/dist/commands/index.d.ts +6 -0
  17. package/dist/commands/index.js +6 -0
  18. package/dist/commands/init.command.d.ts +2 -0
  19. package/dist/commands/init.command.js +38 -0
  20. package/dist/commands/list.command.d.ts +2 -0
  21. package/dist/commands/list.command.js +54 -0
  22. package/dist/commands/meta.command.d.ts +1 -0
  23. package/dist/commands/meta.command.js +19 -0
  24. package/dist/commands/styles.command.d.ts +6 -0
  25. package/dist/commands/styles.command.js +68 -0
  26. package/dist/config/config.helpers.d.ts +7 -0
  27. package/dist/config/config.helpers.js +63 -0
  28. package/dist/config/framework.helpers.d.ts +3 -0
  29. package/dist/config/framework.helpers.js +14 -0
  30. package/dist/config/index.d.ts +2 -0
  31. package/dist/config/index.js +2 -0
  32. package/dist/constants/cli.constants.d.ts +9 -0
  33. package/dist/constants/cli.constants.js +15 -0
  34. package/dist/constants/framework.constants.d.ts +3 -0
  35. package/dist/constants/framework.constants.js +2 -0
  36. package/dist/constants/index.d.ts +2 -0
  37. package/dist/constants/index.js +2 -0
  38. package/dist/doctor/checks/entries.check.d.ts +1 -0
  39. package/dist/doctor/checks/entries.check.js +21 -0
  40. package/dist/doctor/checks/icons.check.d.ts +1 -0
  41. package/dist/doctor/checks/icons.check.js +55 -0
  42. package/dist/doctor/checks/imports.check.d.ts +1 -0
  43. package/dist/doctor/checks/imports.check.js +45 -0
  44. package/dist/doctor/checks/index.d.ts +7 -0
  45. package/dist/doctor/checks/index.js +7 -0
  46. package/dist/doctor/checks/motion.check.d.ts +1 -0
  47. package/dist/doctor/checks/motion.check.js +66 -0
  48. package/dist/doctor/checks/peers.check.d.ts +1 -0
  49. package/dist/doctor/checks/peers.check.js +55 -0
  50. package/dist/doctor/checks/styles.check.d.ts +1 -0
  51. package/dist/doctor/checks/styles.check.js +45 -0
  52. package/dist/doctor/checks/themes.check.d.ts +1 -0
  53. package/dist/doctor/checks/themes.check.js +64 -0
  54. package/dist/doctor/doctor.helpers.d.ts +6 -0
  55. package/dist/doctor/doctor.helpers.js +39 -0
  56. package/dist/doctor/doctor.registry.d.ts +10 -0
  57. package/dist/doctor/doctor.registry.js +24 -0
  58. package/dist/doctor/doctor.types.d.ts +27 -0
  59. package/dist/doctor/doctor.types.js +1 -0
  60. package/dist/doctor/index.d.ts +3 -0
  61. package/dist/doctor/index.js +3 -0
  62. package/dist/errors/cli-error.d.ts +3 -0
  63. package/dist/errors/cli-error.js +6 -0
  64. package/dist/errors/index.d.ts +1 -0
  65. package/dist/errors/index.js +1 -0
  66. package/dist/helpers/args.helpers.d.ts +4 -0
  67. package/dist/helpers/args.helpers.js +75 -0
  68. package/dist/helpers/help.helpers.d.ts +1 -0
  69. package/dist/helpers/help.helpers.js +30 -0
  70. package/dist/helpers/index.d.ts +5 -0
  71. package/dist/helpers/index.js +5 -0
  72. package/dist/helpers/package.helpers.d.ts +2 -0
  73. package/dist/helpers/package.helpers.js +12 -0
  74. package/dist/helpers/path.helpers.d.ts +3 -0
  75. package/dist/helpers/path.helpers.js +15 -0
  76. package/dist/helpers/styles.helpers.d.ts +21 -0
  77. package/dist/helpers/styles.helpers.js +164 -0
  78. package/dist/index.d.ts +9 -0
  79. package/dist/index.js +9 -0
  80. package/dist/registry/index.d.ts +1 -0
  81. package/dist/registry/index.js +1 -0
  82. package/dist/registry/registry.helpers.d.ts +22 -0
  83. package/dist/registry/registry.helpers.js +328 -0
  84. package/dist/registry-data/README.md +71 -0
  85. package/dist/registry-data/avatar/Avatar.tsx +64 -0
  86. package/dist/registry-data/avatar/component.json +30 -0
  87. package/dist/registry-data/avatar/index.ts +1 -0
  88. package/dist/registry-data/badge/Badge.tsx +76 -0
  89. package/dist/registry-data/badge/component.json +30 -0
  90. package/dist/registry-data/badge/index.ts +1 -0
  91. package/dist/registry-data/brand-logo/BrandLogo.tsx +24 -0
  92. package/dist/registry-data/brand-logo/component.json +26 -0
  93. package/dist/registry-data/brand-logo/index.ts +1 -0
  94. package/dist/registry-data/button/Button.tsx +76 -0
  95. package/dist/registry-data/button/component.json +33 -0
  96. package/dist/registry-data/button/index.ts +1 -0
  97. package/dist/registry-data/button-link/ButtonLink.tsx +83 -0
  98. package/dist/registry-data/button-link/component.json +33 -0
  99. package/dist/registry-data/button-link/index.ts +5 -0
  100. package/dist/registry-data/button-styles/component.json +19 -0
  101. package/dist/registry-data/button-styles/index.ts +45 -0
  102. package/dist/registry-data/cn/cn.ts +6 -0
  103. package/dist/registry-data/cn/component.json +16 -0
  104. package/dist/registry-data/confirm-dialog/ConfirmDialog.tsx +134 -0
  105. package/dist/registry-data/confirm-dialog/component.json +34 -0
  106. package/dist/registry-data/confirm-dialog/index.ts +1 -0
  107. package/dist/registry-data/container/Container.tsx +22 -0
  108. package/dist/registry-data/container/component.json +28 -0
  109. package/dist/registry-data/container/index.ts +1 -0
  110. package/dist/registry-data/cursor-glow/CursorGlow.tsx +29 -0
  111. package/dist/registry-data/cursor-glow/component.json +28 -0
  112. package/dist/registry-data/cursor-glow/index.ts +1 -0
  113. package/dist/registry-data/dropdown-menu/DropdownMenu.tsx +157 -0
  114. package/dist/registry-data/dropdown-menu/component.json +34 -0
  115. package/dist/registry-data/dropdown-menu/index.ts +5 -0
  116. package/dist/registry-data/empty-state/EmptyState.tsx +92 -0
  117. package/dist/registry-data/empty-state/component.json +30 -0
  118. package/dist/registry-data/empty-state/index.ts +5 -0
  119. package/dist/registry-data/eyebrow/Eyebrow.tsx +68 -0
  120. package/dist/registry-data/eyebrow/component.json +30 -0
  121. package/dist/registry-data/eyebrow/index.ts +1 -0
  122. package/dist/registry-data/field-styles/component.json +19 -0
  123. package/dist/registry-data/field-styles/index.ts +42 -0
  124. package/dist/registry-data/form-dialog/FormDialog.tsx +128 -0
  125. package/dist/registry-data/form-dialog/component.json +34 -0
  126. package/dist/registry-data/form-dialog/index.ts +1 -0
  127. package/dist/registry-data/icons/component.json +22 -0
  128. package/dist/registry-data/icons/index.ts +21 -0
  129. package/dist/registry-data/icons-form/component.json +17 -0
  130. package/dist/registry-data/icons-form/index.ts +1 -0
  131. package/dist/registry-data/icons-sidebar/component.json +17 -0
  132. package/dist/registry-data/icons-sidebar/index.ts +1 -0
  133. package/dist/registry-data/icons-theme/component.json +17 -0
  134. package/dist/registry-data/icons-theme/index.ts +1 -0
  135. package/dist/registry-data/icons-toast/component.json +17 -0
  136. package/dist/registry-data/icons-toast/index.ts +1 -0
  137. package/dist/registry-data/info-dialog/InfoDialog.tsx +119 -0
  138. package/dist/registry-data/info-dialog/component.json +36 -0
  139. package/dist/registry-data/info-dialog/index.ts +1 -0
  140. package/dist/registry-data/input/Input.tsx +96 -0
  141. package/dist/registry-data/input/component.json +33 -0
  142. package/dist/registry-data/input/index.ts +1 -0
  143. package/dist/registry-data/multi-combobox/MultiCombobox.tsx +205 -0
  144. package/dist/registry-data/multi-combobox/component.json +35 -0
  145. package/dist/registry-data/multi-combobox/index.ts +5 -0
  146. package/dist/registry-data/remote-provider/RemoteProvider.tsx +8 -0
  147. package/dist/registry-data/remote-provider/component.json +25 -0
  148. package/dist/registry-data/remote-provider/index.ts +3 -0
  149. package/dist/registry-data/reveal/Reveal.tsx +22 -0
  150. package/dist/registry-data/reveal/component.json +30 -0
  151. package/dist/registry-data/reveal/index.ts +1 -0
  152. package/dist/registry-data/section/Section.tsx +80 -0
  153. package/dist/registry-data/section/component.json +30 -0
  154. package/dist/registry-data/section/index.ts +1 -0
  155. package/dist/registry-data/section-heading/SectionHeading.tsx +105 -0
  156. package/dist/registry-data/section-heading/component.json +32 -0
  157. package/dist/registry-data/section-heading/index.ts +1 -0
  158. package/dist/registry-data/select/Select.tsx +197 -0
  159. package/dist/registry-data/select/component.json +34 -0
  160. package/dist/registry-data/select/index.ts +1 -0
  161. package/dist/registry-data/sidebar/Sidebar.tsx +432 -0
  162. package/dist/registry-data/sidebar/SidebarCollapsible.tsx +77 -0
  163. package/dist/registry-data/sidebar/SidebarParts.tsx +373 -0
  164. package/dist/registry-data/sidebar/component.json +47 -0
  165. package/dist/registry-data/sidebar/index.ts +4 -0
  166. package/dist/registry-data/sidebar/useSidebar.ts +29 -0
  167. package/dist/registry-data/styles-base/component.json +19 -0
  168. package/dist/registry-data/styles-base/index.css +67 -0
  169. package/dist/registry-data/styles-components/component.json +19 -0
  170. package/dist/registry-data/styles-components/index.css +30 -0
  171. package/dist/registry-data/styles-motion/component.json +20 -0
  172. package/dist/registry-data/styles-motion/index.css +381 -0
  173. package/dist/registry-data/styles-tokens/component.json +17 -0
  174. package/dist/registry-data/styles-tokens/index.css +77 -0
  175. package/dist/registry-data/styles-utilities/component.json +19 -0
  176. package/dist/registry-data/styles-utilities/index.css +29 -0
  177. package/dist/registry-data/switch/Switch.tsx +91 -0
  178. package/dist/registry-data/switch/component.json +34 -0
  179. package/dist/registry-data/switch/index.ts +1 -0
  180. package/dist/registry-data/tabs/Tabs.tsx +226 -0
  181. package/dist/registry-data/tabs/component.json +32 -0
  182. package/dist/registry-data/tabs/index.ts +1 -0
  183. package/dist/registry-data/textarea/Textarea.tsx +94 -0
  184. package/dist/registry-data/textarea/component.json +33 -0
  185. package/dist/registry-data/textarea/index.ts +1 -0
  186. package/dist/registry-data/theme-core/component.json +17 -0
  187. package/dist/registry-data/theme-core/theme.ts +84 -0
  188. package/dist/registry-data/theme-dark/component.json +19 -0
  189. package/dist/registry-data/theme-dark/index.ts +7 -0
  190. package/dist/registry-data/theme-light/component.json +19 -0
  191. package/dist/registry-data/theme-light/index.ts +7 -0
  192. package/dist/registry-data/theme-provider/ThemeContext.tsx +177 -0
  193. package/dist/registry-data/theme-provider/component.json +30 -0
  194. package/dist/registry-data/theme-provider/index.ts +2 -0
  195. package/dist/registry-data/theme-selector/ThemeSelector.tsx +269 -0
  196. package/dist/registry-data/theme-selector/component.json +35 -0
  197. package/dist/registry-data/theme-selector/selector.ts +1 -0
  198. package/dist/registry-data/theme-system/component.json +19 -0
  199. package/dist/registry-data/theme-system/index.ts +7 -0
  200. package/dist/registry-data/theme-toggle/ThemeToggle.tsx +71 -0
  201. package/dist/registry-data/theme-toggle/component.json +31 -0
  202. package/dist/registry-data/theme-toggle/toggle.ts +1 -0
  203. package/dist/registry-data/toast/Toast.tsx +260 -0
  204. package/dist/registry-data/toast/ToastTypeIcon.tsx +83 -0
  205. package/dist/registry-data/toast/component.json +43 -0
  206. package/dist/registry-data/toast/index.ts +3 -0
  207. package/dist/registry-data/toast/useToast.ts +47 -0
  208. package/dist/types/cli.types.d.ts +6 -0
  209. package/dist/types/cli.types.js +1 -0
  210. package/dist/types/config.types.d.ts +41 -0
  211. package/dist/types/config.types.js +1 -0
  212. package/dist/types/index.d.ts +3 -0
  213. package/dist/types/index.js +3 -0
  214. package/dist/types/registry.types.d.ts +37 -0
  215. package/dist/types/registry.types.js +1 -0
  216. package/package.json +35 -3
@@ -0,0 +1,381 @@
1
+ @theme {
2
+ /* Generic speed scale: use the closest speed, never a purpose-named duration. */
3
+ --motion-quick: 100ms;
4
+ --motion-fast: 250ms;
5
+ --motion-base: 500ms;
6
+ --motion-slow: 1000ms;
7
+ --motion-long: 5000ms;
8
+
9
+ --motion-index: 0;
10
+ --motion-active-index: 0;
11
+ --motion-tab-count: 2;
12
+ --motion-drawer-offset: -100%;
13
+
14
+ --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
15
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
16
+
17
+ --motion-press: 0.97;
18
+ --motion-lift: -2px;
19
+ }
20
+
21
+ @keyframes bw-fade-in {
22
+ from { opacity: 0; }
23
+ to { opacity: 1; }
24
+ }
25
+
26
+ @keyframes bw-fade-out {
27
+ from { opacity: 1; }
28
+ to { opacity: 0; }
29
+ }
30
+
31
+ @keyframes bw-slide-up {
32
+ from {
33
+ opacity: 0;
34
+ transform: translate3d(0, 12px, 0);
35
+ }
36
+ to {
37
+ opacity: 1;
38
+ transform: translate3d(0, 0, 0);
39
+ }
40
+ }
41
+
42
+ @keyframes bw-pop-in {
43
+ 0% {
44
+ opacity: 0;
45
+ transform: scale(0.94) translate3d(0, 8px, 0);
46
+ }
47
+ 70% {
48
+ opacity: 1;
49
+ transform: scale(1.01) translate3d(0, 0, 0);
50
+ }
51
+ 100% {
52
+ opacity: 1;
53
+ transform: scale(1) translate3d(0, 0, 0);
54
+ }
55
+ }
56
+
57
+ @keyframes bw-pop-out {
58
+ from {
59
+ opacity: 1;
60
+ transform: scale(1) translate3d(0, 0, 0);
61
+ }
62
+ to {
63
+ opacity: 0;
64
+ transform: scale(0.98) translate3d(0, 4px, 0);
65
+ }
66
+ }
67
+
68
+ @keyframes bw-ripple {
69
+ from {
70
+ opacity: 0.32;
71
+ transform: scale(0);
72
+ }
73
+ to {
74
+ opacity: 0;
75
+ transform: scale(2.6);
76
+ }
77
+ }
78
+
79
+ @keyframes bw-toast-in {
80
+ from {
81
+ opacity: 0;
82
+ transform: translate3d(0, 10px, 0) scale(0.98);
83
+ }
84
+ to {
85
+ opacity: 1;
86
+ transform: translate3d(0, 0, 0) scale(1);
87
+ }
88
+ }
89
+
90
+ @keyframes bw-progress {
91
+ from { transform: scaleX(1); }
92
+ to { transform: scaleX(0); }
93
+ }
94
+
95
+ @keyframes bw-check {
96
+ to { stroke-dashoffset: 0; }
97
+ }
98
+
99
+ @keyframes bw-shake {
100
+ 0%, 100% { transform: translateX(0); }
101
+ 25% { transform: translateX(-4px); }
102
+ 75% { transform: translateX(4px); }
103
+ }
104
+
105
+ @keyframes bw-drawer-in {
106
+ from { transform: translateX(var(--drawer-x, var(--motion-drawer-offset))); }
107
+ to { transform: translateX(0); }
108
+ }
109
+
110
+ @keyframes bw-theme-wipe {
111
+ from { clip-path: circle(0 at 50% 50%); }
112
+ to { clip-path: circle(150% at 50% 50%); }
113
+ }
114
+
115
+ @layer utilities {
116
+ .motion-color {
117
+ transition-property: color, background-color, border-color, box-shadow, fill, stroke;
118
+ transition-duration: var(--motion-fast);
119
+ transition-timing-function: var(--ease-out);
120
+ }
121
+
122
+ .motion-fade {
123
+ transition-property: opacity;
124
+ transition-duration: var(--motion-fast);
125
+ transition-timing-function: var(--ease-out);
126
+ }
127
+
128
+ .motion-fade-slow {
129
+ transition-property: opacity;
130
+ transition-duration: var(--motion-slow);
131
+ transition-timing-function: var(--ease-out);
132
+ }
133
+
134
+ .motion-transform {
135
+ transition-property: transform, translate;
136
+ transition-duration: var(--motion-fast);
137
+ transition-timing-function: var(--ease-out);
138
+ }
139
+
140
+ .motion-press {
141
+ transition-property: transform, background-color, border-color, color, opacity;
142
+ transition-duration: var(--motion-fast);
143
+ transition-timing-function: var(--ease-out);
144
+ }
145
+
146
+ .motion-press:active {
147
+ transform: scale(var(--motion-press));
148
+ }
149
+
150
+ .motion-lift {
151
+ transition-property: transform, background-color, border-color, color, box-shadow;
152
+ transition-duration: var(--motion-base);
153
+ transition-timing-function: var(--ease-out);
154
+ }
155
+
156
+ .motion-lift:hover {
157
+ transform: translateY(var(--motion-lift));
158
+ }
159
+
160
+ .motion-focus {
161
+ transition-property: border-color, box-shadow, background-color;
162
+ transition-duration: var(--motion-fast);
163
+ transition-timing-function: var(--ease-out);
164
+ }
165
+
166
+ .motion-focus:focus-visible {
167
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand-500) 18%, transparent);
168
+ }
169
+
170
+ .motion-icon-swap {
171
+ display: inline-flex;
172
+ animation: bw-pop-in var(--motion-fast) var(--ease-out) both;
173
+ }
174
+
175
+ .motion-ripple {
176
+ isolation: isolate;
177
+ overflow: hidden;
178
+ position: relative;
179
+ }
180
+
181
+ .motion-ripple::after {
182
+ background: radial-gradient(
183
+ circle at center,
184
+ color-mix(in srgb, currentColor 22%, transparent),
185
+ transparent 70%
186
+ );
187
+ border-radius: inherit;
188
+ content: '';
189
+ inset: 0;
190
+ opacity: 0;
191
+ pointer-events: none;
192
+ position: absolute;
193
+ transform: scale(0);
194
+ }
195
+
196
+ .motion-ripple:active::after {
197
+ animation: bw-ripple var(--motion-slow) var(--ease-out);
198
+ }
199
+
200
+ .reveal-up {
201
+ opacity: 1;
202
+ }
203
+
204
+ @supports (animation-timeline: view()) {
205
+ .reveal-up {
206
+ animation: bw-slide-up linear both;
207
+ animation-delay: var(--delay, 0ms);
208
+ animation-range: entry 5% cover 25%;
209
+ animation-timeline: view();
210
+ }
211
+ }
212
+
213
+ .stagger-children > * {
214
+ animation: bw-fade-in var(--motion-slow) var(--ease-out) both;
215
+ animation-delay: calc(var(--index, var(--motion-index)) * var(--motion-quick));
216
+ }
217
+
218
+ .stagger-words > .stagger-word {
219
+ display: inline-block;
220
+ animation: bw-fade-in var(--motion-fast) var(--ease-out) both;
221
+ animation-delay: calc(var(--index, var(--motion-index)) * var(--motion-quick));
222
+ }
223
+
224
+ .surface-enter[data-state='open'],
225
+ .surface-enter[data-state='visible'],
226
+ .popup-enter[data-state='open'] {
227
+ opacity: 1;
228
+ transform: none;
229
+ }
230
+
231
+ @supports (transition-behavior: allow-discrete) {
232
+ .surface-enter[data-state='open'],
233
+ .surface-enter[data-state='visible'],
234
+ .popup-enter[data-state='open'] {
235
+ transition:
236
+ opacity var(--motion-base) var(--ease-out),
237
+ transform var(--motion-base) var(--ease-out);
238
+ }
239
+
240
+ @starting-style {
241
+ .surface-enter[data-state='open'],
242
+ .surface-enter[data-state='visible'],
243
+ .popup-enter[data-state='open'] {
244
+ opacity: 0;
245
+ transform: translate3d(0, 12px, 0) scale(0.96);
246
+ }
247
+ }
248
+ }
249
+
250
+ .surface-enter[data-state='closed'],
251
+ .popup-enter[data-state='closed'] {
252
+ animation: bw-pop-out var(--motion-fast) var(--ease-in-out) both;
253
+ }
254
+
255
+ .backdrop-enter[data-state='open'] {
256
+ animation: bw-fade-in var(--motion-fast) var(--ease-out) both;
257
+ }
258
+
259
+ .toast-enter[data-state='open'] {
260
+ animation: bw-toast-in var(--motion-slow) var(--ease-out) both;
261
+ animation-delay: calc(var(--index, var(--motion-index)) * var(--motion-quick));
262
+ }
263
+
264
+ .toast-enter[data-state='closed'] {
265
+ animation: bw-fade-out var(--motion-fast) var(--ease-in-out) both;
266
+ }
267
+
268
+ .toast-card:hover .progress-life {
269
+ animation-play-state: paused;
270
+ }
271
+
272
+ .progress-life {
273
+ transform-origin: left;
274
+ animation: bw-progress var(--life, var(--motion-long)) linear forwards;
275
+ }
276
+
277
+ .check-draw svg path:last-child {
278
+ stroke-dasharray: 24;
279
+ stroke-dashoffset: 24;
280
+ animation: bw-check var(--motion-base) var(--ease-out) var(--motion-fast) forwards;
281
+ }
282
+
283
+ .shake {
284
+ animation: bw-shake var(--motion-base) var(--ease-in-out);
285
+ }
286
+
287
+ .accordion-panel {
288
+ display: grid;
289
+ grid-template-rows: 0fr;
290
+ opacity: 0;
291
+ transition:
292
+ grid-template-rows var(--motion-base) var(--ease-out),
293
+ opacity var(--motion-base) var(--ease-out);
294
+ }
295
+
296
+ .accordion-panel[data-open='true'] {
297
+ grid-template-rows: 1fr;
298
+ opacity: 1;
299
+ }
300
+
301
+ .accordion-panel > * {
302
+ min-height: 0;
303
+ overflow: hidden;
304
+ }
305
+
306
+ .tabs-indicator {
307
+ position: absolute;
308
+ z-index: 0;
309
+ top: 0.188rem;
310
+ bottom: 0.188rem;
311
+ left: 0.188rem;
312
+ width: calc((100% - 0.375rem) / var(--tab-count, var(--motion-tab-count)));
313
+ background: var(--color-paper);
314
+ border-radius: 1rem;
315
+ box-shadow: 0 0 0 1px var(--color-line), 0 1px 2px rgb(0 0 0 / 0.06);
316
+ pointer-events: none;
317
+ transform: translateX(calc(var(--active-index, var(--motion-active-index)) * 100%));
318
+ transition: transform var(--motion-base) var(--ease-out);
319
+ }
320
+
321
+ .sidebar-drawer[data-state='open'] {
322
+ animation: bw-drawer-in var(--motion-base) var(--ease-out) both;
323
+ }
324
+
325
+ .sidebar-panel {
326
+ transition:
327
+ transform var(--motion-base) var(--ease-out),
328
+ opacity var(--motion-base) var(--ease-out);
329
+ }
330
+
331
+ .sidebar-panel[data-collapsible='offcanvas'][data-state='collapsed'] {
332
+ opacity: 0;
333
+ pointer-events: none;
334
+ transform: translateX(var(--sidebar-hidden-x, -100%));
335
+ }
336
+
337
+ .sidebar-label {
338
+ transition:
339
+ opacity var(--motion-fast) var(--ease-out),
340
+ translate var(--motion-fast) var(--ease-out);
341
+ }
342
+
343
+ .sidebar-chevron {
344
+ transition: transform var(--motion-fast) var(--ease-out);
345
+ }
346
+
347
+ .sidebar-chevron[data-open='true'] {
348
+ transform: rotate(90deg);
349
+ }
350
+
351
+ .sidebar-highlight {
352
+ position: relative;
353
+ }
354
+
355
+ .sidebar-highlight::before {
356
+ background: var(--color-brand-500);
357
+ border-radius: 999px;
358
+ content: '';
359
+ height: 55%;
360
+ left: 0;
361
+ position: absolute;
362
+ top: 50%;
363
+ transform: translateY(-50%) scaleY(0);
364
+ transition: transform var(--motion-base) var(--ease-out);
365
+ width: 2px;
366
+ }
367
+
368
+ .sidebar-highlight[data-active='true']::before {
369
+ transform: translateY(-50%) scaleY(1);
370
+ }
371
+ }
372
+
373
+ @media (prefers-reduced-motion: no-preference) {
374
+ ::view-transition-old(root) {
375
+ animation: bw-fade-out var(--motion-fast) var(--ease-out) both;
376
+ }
377
+
378
+ ::view-transition-new(root) {
379
+ animation: bw-theme-wipe var(--motion-slow) var(--ease-out) both;
380
+ }
381
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "styles-tokens",
3
+ "kind": "style",
4
+ "framework": "react",
5
+ "description": "Theme-aware design tokens: colors, radius and sidebar variables.",
6
+ "dependencies": [],
7
+ "peers": [
8
+ "tailwindcss"
9
+ ],
10
+ "suggestions": [],
11
+ "files": [
12
+ {
13
+ "source": "index.css",
14
+ "target": "styles/tokens.css"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,77 @@
1
+ @theme {
2
+ --font-sans:
3
+ system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
4
+ sans-serif;
5
+
6
+ --color-ink: var(--theme-ink);
7
+ --color-ink-soft: var(--theme-ink-soft);
8
+ --color-ink-muted: var(--theme-ink-muted);
9
+ --color-paper: var(--theme-paper);
10
+ --color-surface: var(--theme-surface);
11
+ --color-surface-2: var(--theme-surface-2);
12
+ --color-line: var(--theme-line);
13
+ --color-line-strong: var(--theme-line-strong);
14
+
15
+ --color-contrast: var(--theme-contrast);
16
+ --color-on-contrast: var(--theme-on-contrast);
17
+
18
+ --color-accent: var(--theme-accent);
19
+ --color-accent-soft: var(--theme-accent-soft);
20
+ --color-accent-soft-fg: var(--theme-accent-soft-fg);
21
+ --color-accent-on-contrast: var(--theme-accent-on-contrast);
22
+
23
+ --color-brand-50: #f5f5f5;
24
+ --color-brand-100: #e6e6e6;
25
+ --color-brand-200: #d1d1d1;
26
+ --color-brand-300: #b3b3b3;
27
+ --color-brand-400: #737373;
28
+ --color-brand-500: #595959;
29
+
30
+ --radius-4xl: 1rem;
31
+
32
+ --color-sidebar: var(--theme-surface);
33
+ --color-sidebar-foreground: var(--theme-ink);
34
+ --color-sidebar-accent: var(--theme-surface-2);
35
+ --color-sidebar-accent-foreground: var(--theme-ink);
36
+ --color-sidebar-active: var(--theme-accent-soft);
37
+ --color-sidebar-border: var(--theme-line);
38
+ --color-sidebar-ring: var(--color-brand-500);
39
+ }
40
+
41
+ :root {
42
+ --theme-ink: #111111;
43
+ --theme-ink-soft: #444444;
44
+ --theme-ink-muted: #6b6b6b;
45
+ --theme-paper: #ffffff;
46
+ --theme-surface: #f7f7f7;
47
+ --theme-surface-2: #efefef;
48
+ --theme-line: rgb(17 17 17 / 0.1);
49
+ --theme-line-strong: rgb(17 17 17 / 0.18);
50
+ --theme-contrast: #111111;
51
+ --theme-on-contrast: #ffffff;
52
+ --theme-accent: #111111;
53
+ --theme-accent-soft: #eeeeee;
54
+ --theme-accent-soft-fg: #111111;
55
+ --theme-accent-on-contrast: #d6d6d6;
56
+ --theme-grid: rgb(17 17 17 / 0.05);
57
+ --theme-shadow: rgb(17 17 17 / 0.45);
58
+ }
59
+
60
+ :root[data-theme='dark'] {
61
+ --theme-ink: #f5f5f5;
62
+ --theme-ink-soft: #c7c7c7;
63
+ --theme-ink-muted: #9a9a9a;
64
+ --theme-paper: #0a0a0a;
65
+ --theme-surface: #121212;
66
+ --theme-surface-2: #1c1c1c;
67
+ --theme-line: rgb(255 255 255 / 0.12);
68
+ --theme-line-strong: rgb(255 255 255 / 0.24);
69
+ --theme-contrast: #171717;
70
+ --theme-on-contrast: #f5f5f5;
71
+ --theme-accent: #f5f5f5;
72
+ --theme-accent-soft: rgb(255 255 255 / 0.1);
73
+ --theme-accent-soft-fg: #f5f5f5;
74
+ --theme-accent-on-contrast: #b8b8b8;
75
+ --theme-grid: rgb(255 255 255 / 0.06);
76
+ --theme-shadow: rgb(0 0 0 / 0.6);
77
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "styles-utilities",
3
+ "kind": "style",
4
+ "framework": "react",
5
+ "description": "Small background grid and mask utilities for decorative sections.",
6
+ "dependencies": [],
7
+ "peers": [
8
+ "tailwindcss"
9
+ ],
10
+ "suggestions": [
11
+ "styles-tokens"
12
+ ],
13
+ "files": [
14
+ {
15
+ "source": "index.css",
16
+ "target": "styles/utilities.css"
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,29 @@
1
+ @layer utilities {
2
+ .bg-grid {
3
+ background-image:
4
+ linear-gradient(to right, var(--theme-grid) 1px, transparent 1px),
5
+ linear-gradient(to bottom, var(--theme-grid) 1px, transparent 1px);
6
+ background-size: 64px 64px;
7
+ }
8
+
9
+ .bg-grid-inverse {
10
+ background-image:
11
+ linear-gradient(to right, rgb(255 255 255 / 0.06) 1px, transparent 1px),
12
+ linear-gradient(to bottom, rgb(255 255 255 / 0.06) 1px, transparent 1px);
13
+ background-size: 56px 56px;
14
+ }
15
+
16
+ .mask-fade-x {
17
+ mask-image: linear-gradient(
18
+ to right,
19
+ transparent,
20
+ black 8%,
21
+ black 92%,
22
+ transparent
23
+ );
24
+ }
25
+
26
+ .mask-fade-b {
27
+ mask-image: linear-gradient(to bottom, black 60%, transparent);
28
+ }
29
+ }
@@ -0,0 +1,91 @@
1
+ import { useEffect, useMemo, useRef } from 'react'
2
+ import type { ReactNode } from 'react'
3
+ import { State, type StateId } from '@blankways/state'
4
+ import { useAttributes, useState, type ReactiveAttributes } from '@blankways/state-react'
5
+ import { cn } from '../../internals/cn.js'
6
+ import { Check } from '../../icons/form.js'
7
+
8
+ export type SwitchProps = {
9
+ checked?: boolean | StateId<boolean>
10
+ onCheckedChange?: (checked: boolean) => void
11
+ disabled?: boolean
12
+ label?: ReactNode
13
+ /** Shows a Check inside the thumb when on. */
14
+ showCheck?: boolean
15
+ className?: string
16
+ 'aria-label'?: string
17
+ }
18
+
19
+ /** Native on/off switch; works with a plain boolean or a reactive boolean. */
20
+ export function Switch({
21
+ checked = false,
22
+ onCheckedChange,
23
+ disabled = false,
24
+ label,
25
+ showCheck = false,
26
+ className,
27
+ 'aria-label': ariaLabel,
28
+ }: SwitchProps) {
29
+ const checkedState = useState<boolean>(
30
+ typeof checked === 'number' ? State.get(checked) : checked,
31
+ )
32
+
33
+ useEffect(() => {
34
+ if (typeof checked === 'boolean') State.set(checkedState, checked)
35
+ }, [checked, checkedState])
36
+
37
+ const ref = useRef<HTMLButtonElement | null>(null)
38
+ const attributes = useMemo<ReactiveAttributes<HTMLButtonElement>>(
39
+ () => ({
40
+ 'aria-checked': checkedState,
41
+ 'data-checked': checkedState,
42
+ }),
43
+ [checkedState],
44
+ )
45
+ useAttributes(ref, attributes)
46
+
47
+ const toggle = () => {
48
+ const next = !State.get(checkedState)
49
+ State.set(checkedState, next)
50
+ onCheckedChange?.(next)
51
+ }
52
+
53
+ const control = (
54
+ <button
55
+ ref={ref}
56
+ type="button"
57
+ role="switch"
58
+ aria-label={ariaLabel}
59
+ aria-checked={typeof checked === 'boolean' ? checked : undefined}
60
+ data-checked={typeof checked === 'boolean' ? String(checked) : undefined}
61
+ disabled={disabled}
62
+ onClick={toggle}
63
+ className={cn(
64
+ 'motion-press group peer relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border border-line-strong bg-surface-2 p-[0.094rem] outline-none',
65
+ 'focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2 focus-visible:ring-offset-paper',
66
+ 'data-[checked=true]:border-transparent data-[checked=true]:bg-brand-500 disabled:cursor-not-allowed disabled:opacity-50',
67
+ className,
68
+ )}
69
+ >
70
+ <span className="pointer-events-none block size-[1.15rem] rounded-full bg-white shadow-sm ring-0 motion-transform group-data-[checked=true]:translate-x-5">
71
+ {showCheck ? (
72
+ <Check
73
+ className="size-3 text-[#111111] opacity-0 motion-fade group-data-[checked=true]:opacity-100"
74
+ aria-hidden="true"
75
+ />
76
+ ) : null}
77
+ </span>
78
+ </button>
79
+ )
80
+
81
+ if (label !== undefined) {
82
+ return (
83
+ <span className="inline-flex items-center gap-3">
84
+ {control}
85
+ <span className="text-sm text-ink">{label}</span>
86
+ </span>
87
+ )
88
+ }
89
+
90
+ return control
91
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "switch",
3
+ "kind": "component",
4
+ "framework": "react",
5
+ "description": "Native role=switch control with a reactive checked state.",
6
+ "dependencies": [
7
+ "cn",
8
+ "icons-form",
9
+ "styles-motion"
10
+ ],
11
+ "peers": [
12
+ "@blankways/state",
13
+ "@blankways/state-react@0.1.0-alpha.1",
14
+ "react",
15
+ "lucide-react"
16
+ ],
17
+ "suggestions": [
18
+ "styles-tokens",
19
+ "styles-base",
20
+ "styles-components",
21
+ "styles-utilities",
22
+ "styles-motion"
23
+ ],
24
+ "files": [
25
+ {
26
+ "source": "Switch.tsx",
27
+ "target": "components/switch/Switch.tsx"
28
+ },
29
+ {
30
+ "source": "index.ts",
31
+ "target": "components/switch/index.ts"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1 @@
1
+ export { Switch, type SwitchProps } from './Switch.js'