@blankways/ui 0.1.0-alpha.1 → 0.2.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.
- package/README.md +157 -139
- package/dist/cli/cli.options.js +21 -1
- package/dist/cli/cli.types.d.ts +1 -0
- package/dist/cli.js +2 -1
- package/dist/commands/add.command.d.ts +2 -0
- package/dist/commands/add.command.js +30 -82
- package/dist/commands/dev.command.d.ts +3 -0
- package/dist/commands/dev.command.js +76 -0
- package/dist/commands/doctor.command.js +12 -1
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.js +3 -0
- package/dist/commands/init.command.js +15 -10
- package/dist/commands/install.command.d.ts +2 -0
- package/dist/commands/install.command.js +36 -0
- package/dist/commands/list.command.js +10 -5
- package/dist/commands/registry.command.d.ts +2 -0
- package/dist/commands/registry.command.js +69 -0
- package/dist/commands/styles.command.d.ts +1 -2
- package/dist/commands/styles.command.js +15 -39
- package/dist/config/config.helpers.d.ts +4 -1
- package/dist/config/config.helpers.js +61 -8
- package/dist/constants/cli.constants.d.ts +14 -3
- package/dist/constants/cli.constants.js +14 -9
- package/dist/doctor/checks/barrels.check.d.ts +1 -0
- package/dist/doctor/checks/barrels.check.js +60 -0
- package/dist/doctor/checks/contracts.check.d.ts +1 -0
- package/dist/doctor/checks/contracts.check.js +45 -0
- package/dist/doctor/checks/icons.check.js +8 -3
- package/dist/doctor/checks/index.d.ts +3 -0
- package/dist/doctor/checks/index.js +3 -0
- package/dist/doctor/checks/motion.check.js +2 -2
- package/dist/doctor/checks/namespaces.check.d.ts +1 -0
- package/dist/doctor/checks/namespaces.check.js +76 -0
- package/dist/doctor/checks/themes.check.js +18 -40
- package/dist/doctor/doctor.helpers.js +5 -1
- package/dist/doctor/doctor.types.d.ts +4 -0
- package/dist/helpers/args.helpers.d.ts +2 -0
- package/dist/helpers/args.helpers.js +9 -0
- package/dist/helpers/barrels.helpers.d.ts +15 -0
- package/dist/helpers/barrels.helpers.js +157 -0
- package/dist/index.d.ts +12 -9
- package/dist/index.js +11 -9
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.js +2 -0
- package/dist/registry/lockfile.d.ts +18 -0
- package/dist/registry/lockfile.js +32 -0
- package/dist/registry/registry.helpers.d.ts +3 -13
- package/dist/registry/registry.helpers.js +30 -116
- package/dist/registry/registry.providers.d.ts +13 -0
- package/dist/registry/registry.providers.js +159 -0
- package/dist/registry/registry.service.d.ts +14 -0
- package/dist/registry/registry.service.js +126 -0
- package/dist/types/config.types.d.ts +29 -0
- package/dist/types/registry.types.d.ts +31 -0
- package/dist/types/registry.types.js +2 -0
- package/dist/ui-api/index.d.ts +16 -0
- package/dist/ui-api/index.js +30 -0
- package/dist/ui-api/ui-api.d.ts +18 -0
- package/dist/ui-api/ui-api.js +194 -0
- package/package.json +7 -5
- package/styles.css +16 -0
- package/dist/registry-data/README.md +0 -71
- package/dist/registry-data/avatar/Avatar.tsx +0 -64
- package/dist/registry-data/avatar/component.json +0 -30
- package/dist/registry-data/avatar/index.ts +0 -1
- package/dist/registry-data/badge/Badge.tsx +0 -76
- package/dist/registry-data/badge/component.json +0 -30
- package/dist/registry-data/badge/index.ts +0 -1
- package/dist/registry-data/brand-logo/BrandLogo.tsx +0 -24
- package/dist/registry-data/brand-logo/component.json +0 -26
- package/dist/registry-data/brand-logo/index.ts +0 -1
- package/dist/registry-data/button/Button.tsx +0 -76
- package/dist/registry-data/button/component.json +0 -33
- package/dist/registry-data/button/index.ts +0 -1
- package/dist/registry-data/button-link/ButtonLink.tsx +0 -83
- package/dist/registry-data/button-link/component.json +0 -33
- package/dist/registry-data/button-link/index.ts +0 -5
- package/dist/registry-data/button-styles/component.json +0 -19
- package/dist/registry-data/button-styles/index.ts +0 -45
- package/dist/registry-data/cn/cn.ts +0 -6
- package/dist/registry-data/cn/component.json +0 -16
- package/dist/registry-data/confirm-dialog/ConfirmDialog.tsx +0 -134
- package/dist/registry-data/confirm-dialog/component.json +0 -34
- package/dist/registry-data/confirm-dialog/index.ts +0 -1
- package/dist/registry-data/container/Container.tsx +0 -22
- package/dist/registry-data/container/component.json +0 -28
- package/dist/registry-data/container/index.ts +0 -1
- package/dist/registry-data/cursor-glow/CursorGlow.tsx +0 -29
- package/dist/registry-data/cursor-glow/component.json +0 -28
- package/dist/registry-data/cursor-glow/index.ts +0 -1
- package/dist/registry-data/dropdown-menu/DropdownMenu.tsx +0 -157
- package/dist/registry-data/dropdown-menu/component.json +0 -34
- package/dist/registry-data/dropdown-menu/index.ts +0 -5
- package/dist/registry-data/empty-state/EmptyState.tsx +0 -92
- package/dist/registry-data/empty-state/component.json +0 -30
- package/dist/registry-data/empty-state/index.ts +0 -5
- package/dist/registry-data/eyebrow/Eyebrow.tsx +0 -68
- package/dist/registry-data/eyebrow/component.json +0 -30
- package/dist/registry-data/eyebrow/index.ts +0 -1
- package/dist/registry-data/field-styles/component.json +0 -19
- package/dist/registry-data/field-styles/index.ts +0 -42
- package/dist/registry-data/form-dialog/FormDialog.tsx +0 -128
- package/dist/registry-data/form-dialog/component.json +0 -34
- package/dist/registry-data/form-dialog/index.ts +0 -1
- package/dist/registry-data/icons/component.json +0 -22
- package/dist/registry-data/icons/index.ts +0 -21
- package/dist/registry-data/icons-form/component.json +0 -17
- package/dist/registry-data/icons-form/index.ts +0 -1
- package/dist/registry-data/icons-sidebar/component.json +0 -17
- package/dist/registry-data/icons-sidebar/index.ts +0 -1
- package/dist/registry-data/icons-theme/component.json +0 -17
- package/dist/registry-data/icons-theme/index.ts +0 -1
- package/dist/registry-data/icons-toast/component.json +0 -17
- package/dist/registry-data/icons-toast/index.ts +0 -1
- package/dist/registry-data/info-dialog/InfoDialog.tsx +0 -119
- package/dist/registry-data/info-dialog/component.json +0 -36
- package/dist/registry-data/info-dialog/index.ts +0 -1
- package/dist/registry-data/input/Input.tsx +0 -96
- package/dist/registry-data/input/component.json +0 -33
- package/dist/registry-data/input/index.ts +0 -1
- package/dist/registry-data/multi-combobox/MultiCombobox.tsx +0 -205
- package/dist/registry-data/multi-combobox/component.json +0 -35
- package/dist/registry-data/multi-combobox/index.ts +0 -5
- package/dist/registry-data/remote-provider/RemoteProvider.tsx +0 -8
- package/dist/registry-data/remote-provider/component.json +0 -25
- package/dist/registry-data/remote-provider/index.ts +0 -3
- package/dist/registry-data/reveal/Reveal.tsx +0 -22
- package/dist/registry-data/reveal/component.json +0 -30
- package/dist/registry-data/reveal/index.ts +0 -1
- package/dist/registry-data/section/Section.tsx +0 -80
- package/dist/registry-data/section/component.json +0 -30
- package/dist/registry-data/section/index.ts +0 -1
- package/dist/registry-data/section-heading/SectionHeading.tsx +0 -105
- package/dist/registry-data/section-heading/component.json +0 -32
- package/dist/registry-data/section-heading/index.ts +0 -1
- package/dist/registry-data/select/Select.tsx +0 -197
- package/dist/registry-data/select/component.json +0 -34
- package/dist/registry-data/select/index.ts +0 -1
- package/dist/registry-data/sidebar/Sidebar.tsx +0 -432
- package/dist/registry-data/sidebar/SidebarCollapsible.tsx +0 -77
- package/dist/registry-data/sidebar/SidebarParts.tsx +0 -373
- package/dist/registry-data/sidebar/component.json +0 -47
- package/dist/registry-data/sidebar/index.ts +0 -4
- package/dist/registry-data/sidebar/useSidebar.ts +0 -29
- package/dist/registry-data/styles-base/component.json +0 -19
- package/dist/registry-data/styles-base/index.css +0 -67
- package/dist/registry-data/styles-components/component.json +0 -19
- package/dist/registry-data/styles-components/index.css +0 -30
- package/dist/registry-data/styles-motion/component.json +0 -20
- package/dist/registry-data/styles-motion/index.css +0 -381
- package/dist/registry-data/styles-tokens/component.json +0 -17
- package/dist/registry-data/styles-tokens/index.css +0 -77
- package/dist/registry-data/styles-utilities/component.json +0 -19
- package/dist/registry-data/styles-utilities/index.css +0 -29
- package/dist/registry-data/switch/Switch.tsx +0 -91
- package/dist/registry-data/switch/component.json +0 -34
- package/dist/registry-data/switch/index.ts +0 -1
- package/dist/registry-data/tabs/Tabs.tsx +0 -226
- package/dist/registry-data/tabs/component.json +0 -32
- package/dist/registry-data/tabs/index.ts +0 -1
- package/dist/registry-data/textarea/Textarea.tsx +0 -94
- package/dist/registry-data/textarea/component.json +0 -33
- package/dist/registry-data/textarea/index.ts +0 -1
- package/dist/registry-data/theme-core/component.json +0 -17
- package/dist/registry-data/theme-core/theme.ts +0 -84
- package/dist/registry-data/theme-dark/component.json +0 -19
- package/dist/registry-data/theme-dark/index.ts +0 -7
- package/dist/registry-data/theme-light/component.json +0 -19
- package/dist/registry-data/theme-light/index.ts +0 -7
- package/dist/registry-data/theme-provider/ThemeContext.tsx +0 -177
- package/dist/registry-data/theme-provider/component.json +0 -30
- package/dist/registry-data/theme-provider/index.ts +0 -2
- package/dist/registry-data/theme-selector/ThemeSelector.tsx +0 -269
- package/dist/registry-data/theme-selector/component.json +0 -35
- package/dist/registry-data/theme-selector/selector.ts +0 -1
- package/dist/registry-data/theme-system/component.json +0 -19
- package/dist/registry-data/theme-system/index.ts +0 -7
- package/dist/registry-data/theme-toggle/ThemeToggle.tsx +0 -71
- package/dist/registry-data/theme-toggle/component.json +0 -31
- package/dist/registry-data/theme-toggle/toggle.ts +0 -1
- package/dist/registry-data/toast/Toast.tsx +0 -260
- package/dist/registry-data/toast/ToastTypeIcon.tsx +0 -83
- package/dist/registry-data/toast/component.json +0 -43
- package/dist/registry-data/toast/index.ts +0 -3
- package/dist/registry-data/toast/useToast.ts +0 -47
|
@@ -1,381 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Switch, type SwitchProps } from './Switch.js'
|