@tangible/ui 0.0.18 → 0.0.20
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 +32 -1
- package/components/Avatar/Avatar.d.ts +3 -1
- package/components/Avatar/Avatar.js +6 -25
- package/components/Avatar/index.d.ts +2 -2
- package/components/Avatar/index.js +1 -1
- package/components/Avatar/types.d.ts +8 -8
- package/components/Avatar/types.js +0 -12
- package/components/Icon/Icon.d.ts +10 -1
- package/components/Icon/Icon.js +5 -1
- package/components/Modal/Modal.js +1 -1
- package/components/OverlapStack/OverlapStack.js +4 -2
- package/components/Pager/Pager.js +9 -3
- package/components/Pager/types.d.ts +9 -0
- package/components/Pager/types.js +2 -0
- package/components/Progress/Progress.js +3 -3
- package/components/Rating/Rating.js +4 -2
- package/components/Rating/types.d.ts +5 -1
- package/components/Rating/types.js +1 -0
- package/components/Select/Select.d.ts +1 -1
- package/components/Select/Select.js +5 -3
- package/components/Select/types.d.ts +5 -0
- package/components/StepIndicator/StepIndicator.js +6 -2
- package/components/StepIndicator/types.d.ts +3 -0
- package/components/StepIndicator/types.js +1 -0
- package/components/Table/BulkActionsBar.js +4 -1
- package/components/Table/DataTable.js +8 -5
- package/components/index.d.ts +3 -2
- package/components/index.js +2 -1
- package/package.json +3 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +220 -88
- package/styles/all.expanded.unlayered.css +220 -88
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +98 -71
- package/styles/components/accordion.scss +289 -0
- package/styles/components/avatar.scss +298 -0
- package/styles/components/button.scss +468 -0
- package/styles/components/card.scss +261 -0
- package/styles/components/checkbox.scss +184 -0
- package/styles/components/chip-group.scss +49 -0
- package/styles/components/chip.scss +472 -0
- package/styles/components/combobox.scss +378 -0
- package/styles/components/content-indicator.scss +114 -0
- package/styles/components/dropdown.scss +179 -0
- package/styles/components/field.scss +120 -0
- package/styles/components/icon-button.scss +311 -0
- package/styles/components/icon.scss +42 -0
- package/styles/components/input/index.scss +6 -1
- package/styles/components/modal.scss +312 -0
- package/styles/components/move-handle.scss +383 -0
- package/styles/components/multi-select.scss +449 -0
- package/styles/components/notice.scss +430 -0
- package/styles/components/overlap-stack.scss +82 -0
- package/styles/components/pager.scss +86 -0
- package/styles/components/popover.scss +70 -0
- package/styles/components/progress.scss +403 -0
- package/styles/components/radio.scss +259 -0
- package/styles/components/rating.scss +142 -0
- package/styles/components/segmented-control.scss +285 -0
- package/styles/components/select.scss +386 -0
- package/styles/components/sidebar.scss +240 -0
- package/styles/components/step-indicator.scss +118 -0
- package/styles/components/step-list.scss +130 -0
- package/styles/components/switch.scss +229 -0
- package/styles/components/table.scss +140 -0
- package/styles/components/tabs.scss +297 -0
- package/styles/components/text-input.scss +142 -0
- package/styles/components/textarea.scss +35 -0
- package/styles/components/toolbar.scss +62 -0
- package/styles/components/tooltip.scss +102 -0
- package/styles/core.css +1 -0
- package/styles/core.scss +12 -0
- package/styles/core.unlayered.css +1 -0
- package/styles/index.scss +34 -6
- package/styles/system/_constants.scss +2 -2
- package/styles/system/_motion.scss +20 -18
- package/styles/system/_tokens.scss +89 -10
- package/tui-manifest.json +10 -3
- package/utils/generative.d.ts +16 -0
- package/utils/generative.js +45 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
@use "../system" as sys;
|
|
2
|
+
|
|
3
|
+
/* @tui-tokens
|
|
4
|
+
--tui-button-bg
|
|
5
|
+
--tui-button-fg
|
|
6
|
+
--tui-button-border
|
|
7
|
+
--tui-button-radius
|
|
8
|
+
--tui-button-bg-interact
|
|
9
|
+
--tui-button-fg-interact
|
|
10
|
+
--tui-button-border-interact
|
|
11
|
+
--tui-button-fg-active
|
|
12
|
+
--tui-control-height-sm
|
|
13
|
+
--tui-control-height-md
|
|
14
|
+
--tui-control-height-lg
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Structural constants (em-based scaling, not tokenised)
|
|
18
|
+
$_spacing-inline: 1.2em;
|
|
19
|
+
$_spacing-block: 0.575em;
|
|
20
|
+
|
|
21
|
+
// Typography defaults
|
|
22
|
+
$_typography-size: var(--#{sys.$prefix}button-font-size, var(--#{sys.$prefix}typography-size-md));
|
|
23
|
+
$_typography-weight: var(--#{sys.$prefix}button-font-weight, normal);
|
|
24
|
+
$_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
25
|
+
|
|
26
|
+
// Shared layout + typography between .tui-button and ::file-selector-button
|
|
27
|
+
@mixin button-base {
|
|
28
|
+
font-size: $_typography-size;
|
|
29
|
+
font-weight: $_typography-weight;
|
|
30
|
+
line-height: $_typography-lineHeight;
|
|
31
|
+
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
text-align: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
padding-inline: $_spacing-inline;
|
|
37
|
+
padding-block: $_spacing-block;
|
|
38
|
+
min-height: var(--#{sys.$prefix}control-height-md);
|
|
39
|
+
// gap is intentionally em-based (not tokenised) — scales with font-size so
|
|
40
|
+
// icon-to-label spacing stays proportional across size tiers.
|
|
41
|
+
gap: 0.5em;
|
|
42
|
+
|
|
43
|
+
border-radius: var(--_radius);
|
|
44
|
+
|
|
45
|
+
transition-duration: var(--#{sys.$prefix}motion-duration);
|
|
46
|
+
transition-timing-function: var(--#{sys.$prefix}motion-timing);
|
|
47
|
+
transition-property: border-color, color, background-color;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@mixin styles() {
|
|
51
|
+
// ==========================================================================
|
|
52
|
+
// Button Component
|
|
53
|
+
// ==========================================================================
|
|
54
|
+
//
|
|
55
|
+
// Component API tokens (never defined here, only read via fallback):
|
|
56
|
+
// --tui-button-bg Background color
|
|
57
|
+
// --tui-button-fg Foreground/text color
|
|
58
|
+
// --tui-button-border Border color
|
|
59
|
+
// --tui-button-radius Border radius
|
|
60
|
+
// --tui-button-bg-interact Hover/focus/active background
|
|
61
|
+
// --tui-button-fg-interact Hover/focus/active foreground
|
|
62
|
+
// --tui-button-border-interact Hover/focus/active border
|
|
63
|
+
// --tui-button-fg-active Active/pressed foreground color
|
|
64
|
+
// --tui-button-font-weight Font weight
|
|
65
|
+
// --tui-button-line-height Line height for button text
|
|
66
|
+
// --tui-button-font-size Font size for medium button text
|
|
67
|
+
// --tui-button-font-size-xs Font size for extra-small button text
|
|
68
|
+
// --tui-button-font-size-sm Font size for small button text
|
|
69
|
+
// --tui-button-font-size-lg Font size for large button text
|
|
70
|
+
//
|
|
71
|
+
// Shared control height tokens (read from .tui-interface scope):
|
|
72
|
+
// --tui-control-height-sm Minimum height for sm controls
|
|
73
|
+
// --tui-control-height-md Minimum height for md controls
|
|
74
|
+
// --tui-control-height-lg Minimum height for lg controls
|
|
75
|
+
//
|
|
76
|
+
// To override from consuming code:
|
|
77
|
+
// .my-context .tui-button { --tui-button-bg: hotpink; }
|
|
78
|
+
//
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// Design Decisions
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
//
|
|
83
|
+
// !important usage:
|
|
84
|
+
// background-color, color, and border-color use !important to defeat
|
|
85
|
+
// WordPress core and Gutenberg button styles. In wp-admin context, WP's
|
|
86
|
+
// .button and .components-button styles often have higher specificity or
|
|
87
|
+
// explicit !important rules. Without this, buttons render incorrectly.
|
|
88
|
+
// The :visited anchor rule also uses !important to prevent visited link
|
|
89
|
+
// color from overriding the button's fg color.
|
|
90
|
+
//
|
|
91
|
+
// className prop:
|
|
92
|
+
// The className prop exists for genuine customization needs (positioning,
|
|
93
|
+
// layout integration) but is intentionally NOT the primary customization
|
|
94
|
+
// mechanism. Use component API tokens (--tui-button-*) instead. className
|
|
95
|
+
// allows layout overrides like margin/positioning without fighting the
|
|
96
|
+
// component's internal styling.
|
|
97
|
+
//
|
|
98
|
+
// ==========================================================================
|
|
99
|
+
|
|
100
|
+
// ---------------------------------------------------------------------------
|
|
101
|
+
// Base element resets
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
:where(.#{sys.$prefix}interface) :is(button,[type="button"],[type="submit"]) {
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
font-family: inherit;
|
|
106
|
+
font-size: $_typography-size;
|
|
107
|
+
line-height: $_typography-lineHeight;
|
|
108
|
+
border: unset;
|
|
109
|
+
box-shadow: unset;
|
|
110
|
+
height: auto;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:where(.#{sys.$prefix}interface) :where(a).#{sys.$prefix}button {
|
|
114
|
+
text-decoration: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:where(.#{sys.$prefix}interface) :where(a).#{sys.$prefix}button[aria-disabled="true"] {
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:where(.#{sys.$prefix}interface) :where(a).#{sys.$prefix}button:visited {
|
|
122
|
+
color: var(--_fg) !important;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
// .tui-button
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
// Note: NOT using :where() here - we need real specificity to compete with
|
|
129
|
+
// WordPress theme styles in plugin contexts.
|
|
130
|
+
.#{sys.$prefix}interface .#{sys.$prefix}button {
|
|
131
|
+
// Internal tokens — read component API with fallback to primitives
|
|
132
|
+
--_bg: var(--#{sys.$prefix}button-bg, var(--#{sys.$prefix}theme-primary-base));
|
|
133
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}color-fg-on-accent));
|
|
134
|
+
--_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}theme-primary-base));
|
|
135
|
+
--_radius: var(--#{sys.$prefix}button-radius, var(--#{sys.$prefix}radius-md));
|
|
136
|
+
|
|
137
|
+
// Interact state fallbacks (default to darker variant)
|
|
138
|
+
--_bg-interact: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-primary-stronger));
|
|
139
|
+
--_fg-interact: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
|
|
140
|
+
--_border-interact: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-primary-stronger));
|
|
141
|
+
|
|
142
|
+
// Shared typography, layout, and motion
|
|
143
|
+
@include button-base;
|
|
144
|
+
|
|
145
|
+
// Visual — read from internal tokens (uses !important to defeat WordPress styles)
|
|
146
|
+
background-color: var(--_bg) !important;
|
|
147
|
+
color: var(--_fg) !important;
|
|
148
|
+
border-color: var(--_border) !important;
|
|
149
|
+
border-style: solid;
|
|
150
|
+
border-width: var(--#{sys.$prefix}border-width);
|
|
151
|
+
|
|
152
|
+
.#{sys.$prefix}icon {
|
|
153
|
+
font-size: 1.25em;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// -------------------------------------------------------------------------
|
|
157
|
+
// States
|
|
158
|
+
// -------------------------------------------------------------------------
|
|
159
|
+
&:hover {
|
|
160
|
+
--_bg: var(--_bg-interact);
|
|
161
|
+
--_fg: var(--_fg-interact);
|
|
162
|
+
--_border: var(--_border-interact);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&:focus-visible {
|
|
166
|
+
--_bg: var(--_bg-interact);
|
|
167
|
+
--_fg: var(--_fg-interact);
|
|
168
|
+
--_border: var(--_border-interact);
|
|
169
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
170
|
+
outline-offset: var(--#{sys.$prefix}focus-ring-offset);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
174
|
+
--_bg: var(--_bg-interact);
|
|
175
|
+
--_fg: var(--#{sys.$prefix}button-fg-active, var(--#{sys.$prefix}color-fg-on-accent));
|
|
176
|
+
--_border: var(--_border-interact);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&:where(:disabled, [aria-disabled="true"], .is-disabled) {
|
|
180
|
+
pointer-events: none;
|
|
181
|
+
cursor: not-allowed;
|
|
182
|
+
opacity: var(--#{sys.$prefix}opacity-disabled);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// -------------------------------------------------------------------------
|
|
186
|
+
// Loading state
|
|
187
|
+
// -------------------------------------------------------------------------
|
|
188
|
+
&[data-loading="true"] {
|
|
189
|
+
pointer-events: none;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&[data-loading="true"] > .tui-icon:first-child {
|
|
193
|
+
visibility: hidden;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Spinner replaces left icon position using ::before
|
|
197
|
+
&[data-loading="true"]::before {
|
|
198
|
+
content: "";
|
|
199
|
+
inline-size: 0.75em;
|
|
200
|
+
block-size: 0.75em;
|
|
201
|
+
border: 0.15em solid currentColor;
|
|
202
|
+
border-right-color: transparent;
|
|
203
|
+
border-radius: 50%;
|
|
204
|
+
display: inline-block;
|
|
205
|
+
animation: #{sys.$prefix}spin 0.85s linear infinite;
|
|
206
|
+
|
|
207
|
+
@media (prefers-reduced-motion: reduce) {
|
|
208
|
+
animation: none;
|
|
209
|
+
border-style: dashed;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// -------------------------------------------------------------------------
|
|
214
|
+
// Sizes
|
|
215
|
+
// -------------------------------------------------------------------------
|
|
216
|
+
&.is-width-full {
|
|
217
|
+
width: 100%;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&.is-size-lg {
|
|
221
|
+
font-size: var(--#{sys.$prefix}button-font-size-lg, var(--#{sys.$prefix}typography-size-lg));
|
|
222
|
+
min-height: var(--#{sys.$prefix}control-height-lg);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&.is-size-sm {
|
|
226
|
+
font-size: var(--#{sys.$prefix}button-font-size-sm, var(--#{sys.$prefix}typography-size-sm));
|
|
227
|
+
min-height: var(--#{sys.$prefix}control-height-sm);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// xs is Button-specific and outside the unified control-height system.
|
|
231
|
+
// It uses compact padding and a smaller radius for dense UI contexts
|
|
232
|
+
// (e.g., inline actions, table rows). No shared --tui-control-height-xs token.
|
|
233
|
+
&.is-size-xs {
|
|
234
|
+
--_radius: var(--#{sys.$prefix}button-radius, var(--#{sys.$prefix}radius-sm));
|
|
235
|
+
font-size: var(--#{sys.$prefix}button-font-size-xs, var(--#{sys.$prefix}typography-size-xs));
|
|
236
|
+
padding: var(--#{sys.$prefix}spacing-xxs);
|
|
237
|
+
min-width: 2em;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// -------------------------------------------------------------------------
|
|
241
|
+
// Themes (solid variant)
|
|
242
|
+
// -------------------------------------------------------------------------
|
|
243
|
+
&.is-theme-secondary {
|
|
244
|
+
--_bg: var(--#{sys.$prefix}button-bg, var(--#{sys.$prefix}theme-secondary-subtle));
|
|
245
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-secondary-strongest));
|
|
246
|
+
--_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}theme-secondary-subtle));
|
|
247
|
+
|
|
248
|
+
&:hover,
|
|
249
|
+
&:focus-visible,
|
|
250
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
251
|
+
--_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-secondary-subtlest));
|
|
252
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-primary-base));
|
|
253
|
+
--_border: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-secondary-subtlest));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&.is-theme-danger {
|
|
258
|
+
--_bg: var(--#{sys.$prefix}button-bg, var(--#{sys.$prefix}theme-danger-base));
|
|
259
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}color-fg-on-accent));
|
|
260
|
+
--_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}theme-danger-base));
|
|
261
|
+
|
|
262
|
+
&:hover,
|
|
263
|
+
&:focus-visible,
|
|
264
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
265
|
+
--_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-danger-stronger));
|
|
266
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
|
|
267
|
+
--_border: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-danger-stronger));
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// -------------------------------------------------------------------------
|
|
272
|
+
// Styles
|
|
273
|
+
// -------------------------------------------------------------------------
|
|
274
|
+
&.is-style-outline {
|
|
275
|
+
--_bg: var(--#{sys.$prefix}button-bg, transparent);
|
|
276
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-primary-strong));
|
|
277
|
+
--_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}theme-primary-base));
|
|
278
|
+
|
|
279
|
+
&:hover,
|
|
280
|
+
&:focus-visible,
|
|
281
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
282
|
+
--_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-primary-base));
|
|
283
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
|
|
284
|
+
--_border: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-primary-base));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
&.is-style-outline.is-theme-secondary {
|
|
289
|
+
--_bg: var(--#{sys.$prefix}button-bg, transparent);
|
|
290
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}color-fg));
|
|
291
|
+
--_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}color-border));
|
|
292
|
+
|
|
293
|
+
&:hover,
|
|
294
|
+
&:focus-visible,
|
|
295
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
296
|
+
--_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-secondary-subtle));
|
|
297
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg));
|
|
298
|
+
--_border: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}color-border));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
&.is-style-outline.is-theme-danger {
|
|
303
|
+
--_bg: var(--#{sys.$prefix}button-bg, transparent);
|
|
304
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-danger-strong));
|
|
305
|
+
--_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}theme-danger-base));
|
|
306
|
+
|
|
307
|
+
&:hover,
|
|
308
|
+
&:focus-visible,
|
|
309
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
310
|
+
--_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-danger-base));
|
|
311
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
|
|
312
|
+
--_border: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-danger-base));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Ghost: transparent bg, shows bg on hover (matches IconButton ghost)
|
|
317
|
+
&.is-style-ghost {
|
|
318
|
+
--_bg: var(--#{sys.$prefix}button-bg, transparent);
|
|
319
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}color-fg));
|
|
320
|
+
--_border: transparent;
|
|
321
|
+
|
|
322
|
+
&:hover,
|
|
323
|
+
&:focus-visible,
|
|
324
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
325
|
+
--_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-secondary-subtle));
|
|
326
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg));
|
|
327
|
+
--_border: transparent;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&.is-style-ghost.is-theme-primary {
|
|
332
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-primary-strong));
|
|
333
|
+
|
|
334
|
+
&:hover,
|
|
335
|
+
&:focus-visible,
|
|
336
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
337
|
+
--_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-primary-subtlest));
|
|
338
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-primary-stronger));
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
&.is-style-ghost.is-theme-danger {
|
|
343
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-danger-strong));
|
|
344
|
+
|
|
345
|
+
&:hover,
|
|
346
|
+
&:focus-visible,
|
|
347
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
348
|
+
--_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-danger-subtlest));
|
|
349
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-danger-stronger));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Link: text-link styling, no bg change on hover
|
|
354
|
+
&.is-style-link {
|
|
355
|
+
--_bg: var(--#{sys.$prefix}button-bg, transparent);
|
|
356
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-primary-strong));
|
|
357
|
+
--_border: transparent;
|
|
358
|
+
text-decoration: underline;
|
|
359
|
+
border-width: 0;
|
|
360
|
+
padding: 0;
|
|
361
|
+
|
|
362
|
+
&:hover,
|
|
363
|
+
&:focus-visible,
|
|
364
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
365
|
+
--_bg: var(--#{sys.$prefix}button-bg-interact, transparent);
|
|
366
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-primary-stronger));
|
|
367
|
+
--_border: transparent;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
&.is-style-link.is-theme-secondary {
|
|
372
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-secondary-strong));
|
|
373
|
+
|
|
374
|
+
&:hover,
|
|
375
|
+
&:focus-visible,
|
|
376
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
377
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-secondary-strongest));
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
&.is-style-link.is-theme-danger {
|
|
382
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-danger-strong));
|
|
383
|
+
|
|
384
|
+
&:hover,
|
|
385
|
+
&:focus-visible,
|
|
386
|
+
&:is(:active, [aria-pressed="true"]) {
|
|
387
|
+
--_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-danger-strongest));
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// ---------------------------------------------------------------------------
|
|
393
|
+
// Forced colors (high contrast mode)
|
|
394
|
+
// ---------------------------------------------------------------------------
|
|
395
|
+
@media (forced-colors: active) {
|
|
396
|
+
.#{sys.$prefix}interface .#{sys.$prefix}button {
|
|
397
|
+
forced-color-adjust: none;
|
|
398
|
+
background-color: CanvasText;
|
|
399
|
+
color: Canvas;
|
|
400
|
+
border-color: CanvasText;
|
|
401
|
+
|
|
402
|
+
&:is(:hover, :active) {
|
|
403
|
+
background-color: Highlight;
|
|
404
|
+
border-color: Highlight;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
&:focus-visible {
|
|
408
|
+
outline: 2px solid Highlight;
|
|
409
|
+
outline-offset: 2px;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
&.is-style-link {
|
|
413
|
+
background-color: transparent;
|
|
414
|
+
color: LinkText;
|
|
415
|
+
border-color: transparent;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
&[disabled],
|
|
419
|
+
&.is-disabled {
|
|
420
|
+
color: GrayText;
|
|
421
|
+
border-color: GrayText;
|
|
422
|
+
background-color: Canvas;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// ---------------------------------------------------------------------------
|
|
428
|
+
// File input button
|
|
429
|
+
// ---------------------------------------------------------------------------
|
|
430
|
+
.#{sys.$prefix}interface input[type="file"] {
|
|
431
|
+
// Internal tokens for file button
|
|
432
|
+
--_bg: var(--#{sys.$prefix}button-bg, var(--#{sys.$prefix}theme-primary-base));
|
|
433
|
+
--_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}color-fg-on-accent));
|
|
434
|
+
--_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}theme-primary-base));
|
|
435
|
+
--_radius: var(--#{sys.$prefix}button-radius, var(--#{sys.$prefix}radius-md));
|
|
436
|
+
--_bg-interact: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-primary-stronger));
|
|
437
|
+
--_fg-interact: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
|
|
438
|
+
--_border-interact: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-primary-stronger));
|
|
439
|
+
|
|
440
|
+
&::file-selector-button {
|
|
441
|
+
@include button-base;
|
|
442
|
+
|
|
443
|
+
background-color: var(--_bg);
|
|
444
|
+
color: var(--_fg);
|
|
445
|
+
border: var(--#{sys.$prefix}border-width) solid var(--_border);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
&:hover::file-selector-button {
|
|
449
|
+
background-color: var(--_bg-interact);
|
|
450
|
+
color: var(--_fg-interact);
|
|
451
|
+
border-color: var(--_border-interact);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
&:focus-visible::file-selector-button {
|
|
455
|
+
background-color: var(--_bg-interact);
|
|
456
|
+
color: var(--_fg-interact);
|
|
457
|
+
border-color: var(--_border-interact);
|
|
458
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
459
|
+
outline-offset: var(--#{sys.$prefix}focus-ring-offset);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
&:active::file-selector-button {
|
|
463
|
+
background-color: var(--_bg-interact);
|
|
464
|
+
color: var(--_fg-interact);
|
|
465
|
+
border-color: var(--_border-interact);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|