@tangible/ui 0.2.4 → 0.2.6
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/components/ColorPicker/ColorField.d.ts +31 -2
- package/components/ColorPicker/ColorField.js +100 -8
- package/components/Combobox/Combobox.d.ts +1 -1
- package/components/Combobox/Combobox.js +2 -2
- package/components/Combobox/types.d.ts +5 -0
- package/components/Field/Field.d.ts +13 -1
- package/components/Field/Field.js +5 -3
- package/components/GradientPicker/AngleDial.d.ts +14 -0
- package/components/GradientPicker/AngleDial.js +24 -0
- package/components/GradientPicker/GradientBar.d.ts +38 -0
- package/components/GradientPicker/GradientBar.js +130 -0
- package/components/GradientPicker/GradientPicker.d.ts +32 -0
- package/components/GradientPicker/GradientPicker.js +191 -0
- package/components/GradientPicker/index.d.ts +8 -0
- package/components/GradientPicker/index.js +8 -0
- package/components/GradientPicker/labels.d.ts +42 -0
- package/components/GradientPicker/labels.js +31 -0
- package/components/MultiCombobox/MultiCombobox.d.ts +1 -1
- package/components/MultiCombobox/MultiCombobox.js +2 -2
- package/components/MultiCombobox/types.d.ts +5 -0
- package/components/index.d.ts +2 -0
- package/components/index.js +1 -0
- package/package.json +5 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +253 -24
- package/styles/all.expanded.unlayered.css +253 -24
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +9 -1
- package/styles/components/button.scss +4 -3
- package/styles/components/color-picker.scss +11 -1
- package/styles/components/gradient-picker.scss +296 -0
- package/styles/components/icon-button.scss +15 -8
- package/styles/components/notice.scss +12 -7
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/system/_checkerboard.scss +24 -0
- package/styles/system/_tokens.scss +16 -6
- package/styles/system/index.scss +2 -1
- package/tui-manifest.json +96 -5
- package/utils/color/gradient.d.ts +42 -0
- package/utils/color/gradient.js +408 -0
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
@use "./chip-group" as chipgroup;
|
|
10
10
|
@use "./combobox" as combobox;
|
|
11
11
|
@use "./color-picker" as colorpicker;
|
|
12
|
+
@use "./gradient-picker" as gradientpicker;
|
|
12
13
|
@use "./multi-combobox" as multicombobox;
|
|
13
14
|
@use "./content-indicator" as contentindicator;
|
|
14
15
|
@use "./date-picker" as datepicker;
|
|
@@ -49,7 +50,13 @@
|
|
|
49
50
|
|
|
50
51
|
// Components whose runtime markup renders the shared input-core classes
|
|
51
52
|
// (.tui-input etc.) — requesting any of them pulls the input core in.
|
|
52
|
-
|
|
53
|
+
// gradient-picker renders TextInput internally for its numeric fields.
|
|
54
|
+
// NOTE: a subset build requesting gradient-picker must ALSO request
|
|
55
|
+
// color-picker, popover, select, tooltip, button, and icon-button — the
|
|
56
|
+
// panel composes all of them. The dependents mechanism below only covers the
|
|
57
|
+
// input core; extend it to full dependency sets if subset builds become a
|
|
58
|
+
// real workflow (Pager has the same latent gap).
|
|
59
|
+
$-input-dependents: (input, field, text-input, textarea, pager, search-input, gradient-picker);
|
|
53
60
|
|
|
54
61
|
@function -needs-input($only) {
|
|
55
62
|
@if $only == null {
|
|
@@ -77,6 +84,7 @@ $-input-dependents: (input, field, text-input, textarea, pager, search-input);
|
|
|
77
84
|
@if -wants($only, chip-group) { @include chipgroup.styles(); }
|
|
78
85
|
@if -wants($only, combobox) { @include combobox.styles(); }
|
|
79
86
|
@if -wants($only, color-picker) { @include colorpicker.styles(); }
|
|
87
|
+
@if -wants($only, gradient-picker) { @include gradientpicker.styles(); }
|
|
80
88
|
@if -wants($only, multi-combobox) { @include multicombobox.styles(); }
|
|
81
89
|
@if -wants($only, content-indicator) { @include contentindicator.styles(); }
|
|
82
90
|
@if -wants($only, date-picker) { @include datepicker.styles(); }
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
--tui-button-bg-interact
|
|
9
9
|
--tui-button-fg-interact
|
|
10
10
|
--tui-button-border-interact
|
|
11
|
-
--tui-button-fg-active
|
|
12
11
|
--tui-button-icon-scale
|
|
13
12
|
--tui-control-height-xs
|
|
14
13
|
--tui-control-height-sm
|
|
@@ -64,7 +63,6 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
64
63
|
// --tui-button-bg-interact Hover/focus/active background
|
|
65
64
|
// --tui-button-fg-interact Hover/focus/active foreground
|
|
66
65
|
// --tui-button-border-interact Hover/focus/active border
|
|
67
|
-
// --tui-button-fg-active Active/pressed foreground color
|
|
68
66
|
// --tui-button-icon-scale Icon:label size ratio multiplier (default 1.25)
|
|
69
67
|
// --tui-button-font-weight Font weight
|
|
70
68
|
// --tui-button-line-height Line height for button text
|
|
@@ -181,9 +179,12 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
181
179
|
outline-offset: var(--#{sys.$prefix}focus-ring-offset);
|
|
182
180
|
}
|
|
183
181
|
|
|
182
|
+
// Button has no distinct toggle-pressed treatment by design — toggles
|
|
183
|
+
// belong to IconButton/SegmentedControl/Switch/Chip. A stray aria-pressed
|
|
184
|
+
// holds the interact treatment rather than looking untoggled.
|
|
184
185
|
&:is(:active, [aria-pressed="true"]) {
|
|
185
186
|
--_bg: var(--_bg-interact);
|
|
186
|
-
--_fg: var(
|
|
187
|
+
--_fg: var(--_fg-interact);
|
|
187
188
|
--_border: var(--_border-interact);
|
|
188
189
|
}
|
|
189
190
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
--tui-color-slider-radius
|
|
8
8
|
--tui-color-slider-height
|
|
9
9
|
--tui-color-slider-thumb-size
|
|
10
|
+
--tui-color-field-swatch-border
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
@mixin styles() {
|
|
@@ -250,7 +251,10 @@
|
|
|
250
251
|
// Kept in the DOM (so the aria-live region announces on toggle) but
|
|
251
252
|
// collapsed when there's nothing to say. Not display:none — that would
|
|
252
253
|
// remove it from the accessibility tree and defeat the live region.
|
|
254
|
+
// position:absolute takes it out of flow too: a zero-height flex item
|
|
255
|
+
// still claims a gap slot, leaving phantom space after the value row.
|
|
253
256
|
&.is-empty {
|
|
257
|
+
position: absolute;
|
|
254
258
|
block-size: 0;
|
|
255
259
|
overflow: hidden;
|
|
256
260
|
}
|
|
@@ -322,8 +326,13 @@
|
|
|
322
326
|
inline-size: var(--_size);
|
|
323
327
|
block-size: var(--_size);
|
|
324
328
|
border-radius: var(--#{sys.$prefix}radius-sm);
|
|
329
|
+
// Subtle edge so light swatches read against the field. Neutral default,
|
|
330
|
+
// overridable per context (it reads faint on dark themes).
|
|
331
|
+
border: var(--#{sys.$prefix}color-field-swatch-border, var(--#{sys.$prefix}border-width) solid rgb(0 0 0 / 0.3));
|
|
325
332
|
background-color: var(--#{sys.$prefix}color-bg);
|
|
326
|
-
|
|
333
|
+
// First layer: a full gradient value when set (ColorField gradient mode),
|
|
334
|
+
// else the flat colour painted as a degenerate gradient.
|
|
335
|
+
background-image: var(--_swatch-image, linear-gradient(var(--_swatch), var(--_swatch))),
|
|
327
336
|
linear-gradient(45deg, #ccc 25%, transparent 25%),
|
|
328
337
|
linear-gradient(-45deg, #ccc 25%, transparent 25%),
|
|
329
338
|
linear-gradient(45deg, transparent 75%, #ccc 75%),
|
|
@@ -365,6 +374,7 @@
|
|
|
365
374
|
max-inline-size: calc(100vw - 2rem);
|
|
366
375
|
}
|
|
367
376
|
|
|
377
|
+
|
|
368
378
|
@media (forced-colors: active) {
|
|
369
379
|
.#{sys.$prefix}interface .#{sys.$prefix}color-area,
|
|
370
380
|
.#{sys.$prefix}interface .#{sys.$prefix}color-slider {
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
@use "../system" as sys;
|
|
2
|
+
|
|
3
|
+
/* @tui-tokens
|
|
4
|
+
--tui-gradient-bar-height
|
|
5
|
+
--tui-gradient-bar-radius
|
|
6
|
+
--tui-gradient-bar-thumb-size
|
|
7
|
+
--tui-angle-dial-size
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@mixin styles() {
|
|
11
|
+
// ==========================================================================
|
|
12
|
+
// GradientPicker — stop strip + value field + stop list + geometry controls
|
|
13
|
+
// ==========================================================================
|
|
14
|
+
//
|
|
15
|
+
// Like the ColorPicker primitives, thumb chrome (white ring + dark halo) and
|
|
16
|
+
// the alpha checkerboard use fixed neutral values on purpose: they must read
|
|
17
|
+
// on top of an ARBITRARY user gradient, so they can't defer to theme tokens.
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// GradientBar — the stop strip
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-bar {
|
|
23
|
+
--_thumb: var(--#{sys.$prefix}gradient-bar-thumb-size, 16px);
|
|
24
|
+
position: relative;
|
|
25
|
+
height: var(--#{sys.$prefix}gradient-bar-height, 3rem);
|
|
26
|
+
border-radius: var(--#{sys.$prefix}gradient-bar-radius, var(--#{sys.$prefix}radius-md));
|
|
27
|
+
@include sys.alpha-checkerboard(8px);
|
|
28
|
+
cursor: copy; // the track adds a stop where you click
|
|
29
|
+
touch-action: none;
|
|
30
|
+
user-select: none;
|
|
31
|
+
// The gradient IS the content here — Windows High Contrast would strip
|
|
32
|
+
// the track background and thumb fills, leaving an unreadable blank strip.
|
|
33
|
+
forced-color-adjust: none;
|
|
34
|
+
|
|
35
|
+
&.is-disabled {
|
|
36
|
+
opacity: var(--#{sys.$prefix}opacity-disabled);
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-bar__track {
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset: 0;
|
|
44
|
+
border-radius: inherit;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-bar__thumb {
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 50%;
|
|
50
|
+
width: var(--_thumb);
|
|
51
|
+
height: var(--_thumb);
|
|
52
|
+
transform: translate(-50%, -50%);
|
|
53
|
+
border-radius: var(--#{sys.$prefix}radius-full, 999px);
|
|
54
|
+
background: var(--_stop-color);
|
|
55
|
+
border: 2px solid #fff;
|
|
56
|
+
box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35);
|
|
57
|
+
cursor: grab;
|
|
58
|
+
|
|
59
|
+
// Invisible expanded hit area — the visual thumb is 16px but the pointer
|
|
60
|
+
// target must meet the 24px floor (WCAG 2.5.5 / house rule in CLAUDE.md).
|
|
61
|
+
&::before {
|
|
62
|
+
content: "";
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: 50%;
|
|
65
|
+
left: 50%;
|
|
66
|
+
width: max(1.5rem, 100%);
|
|
67
|
+
height: max(1.5rem, 100%);
|
|
68
|
+
transform: translate(-50%, -50%);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.is-active {
|
|
72
|
+
box-shadow: 0 0 0 2px rgb(0 0 0 / 0.5);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:focus-visible {
|
|
76
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
77
|
+
outline-offset: var(--#{sys.$prefix}focus-ring-offset);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// AngleDial — pointer-only companion to the angle input
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
.#{sys.$prefix}interface .#{sys.$prefix}angle-dial {
|
|
85
|
+
position: relative;
|
|
86
|
+
flex: none;
|
|
87
|
+
width: var(--#{sys.$prefix}angle-dial-size, 1.75rem);
|
|
88
|
+
height: var(--#{sys.$prefix}angle-dial-size, 1.75rem);
|
|
89
|
+
border-radius: var(--#{sys.$prefix}radius-full, 999px);
|
|
90
|
+
border: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-border);
|
|
91
|
+
background: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
|
|
92
|
+
cursor: grab;
|
|
93
|
+
touch-action: none;
|
|
94
|
+
user-select: none;
|
|
95
|
+
|
|
96
|
+
&.is-disabled {
|
|
97
|
+
opacity: var(--#{sys.$prefix}opacity-disabled);
|
|
98
|
+
pointer-events: none;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.#{sys.$prefix}interface .#{sys.$prefix}angle-dial__pointer {
|
|
103
|
+
position: absolute;
|
|
104
|
+
inset: 0;
|
|
105
|
+
transform: rotate(var(--_angle, 0deg));
|
|
106
|
+
|
|
107
|
+
&::before {
|
|
108
|
+
content: "";
|
|
109
|
+
position: absolute;
|
|
110
|
+
top: 3px;
|
|
111
|
+
left: 50%;
|
|
112
|
+
width: 5px;
|
|
113
|
+
height: 5px;
|
|
114
|
+
transform: translateX(-50%);
|
|
115
|
+
border-radius: var(--#{sys.$prefix}radius-full, 999px);
|
|
116
|
+
background: var(--#{sys.$prefix}theme-primary-base);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ---------------------------------------------------------------------------
|
|
121
|
+
// GradientPicker composition
|
|
122
|
+
// ---------------------------------------------------------------------------
|
|
123
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: var(--#{sys.$prefix}spacing-sm);
|
|
127
|
+
width: 100%;
|
|
128
|
+
|
|
129
|
+
&.is-disabled {
|
|
130
|
+
opacity: var(--#{sys.$prefix}opacity-disabled);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// The value row — gradient string field + reverse / copy buttons.
|
|
135
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__value {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
gap: var(--#{sys.$prefix}spacing-xxs);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__value-input {
|
|
142
|
+
flex: 1 1 auto;
|
|
143
|
+
min-width: 0;
|
|
144
|
+
min-height: var(--#{sys.$prefix}control-height-sm, 2.25rem);
|
|
145
|
+
padding-inline: var(--#{sys.$prefix}spacing-xs);
|
|
146
|
+
border: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-border);
|
|
147
|
+
border-radius: var(--#{sys.$prefix}radius-md);
|
|
148
|
+
background: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
|
|
149
|
+
color: inherit;
|
|
150
|
+
font: inherit;
|
|
151
|
+
font-size: var(--#{sys.$prefix}typography-size-xs);
|
|
152
|
+
text-overflow: ellipsis;
|
|
153
|
+
|
|
154
|
+
&:focus-visible {
|
|
155
|
+
border-color: var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base));
|
|
156
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
157
|
+
outline-offset: calc(-1 * var(--#{sys.$prefix}border-width));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Small uppercase section/field label (matches the design's control labels).
|
|
162
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__label {
|
|
163
|
+
display: block;
|
|
164
|
+
font-size: var(--#{sys.$prefix}typography-size-xs);
|
|
165
|
+
font-weight: var(--#{sys.$prefix}typography-weight-medium, 500);
|
|
166
|
+
letter-spacing: 0.04em;
|
|
167
|
+
text-transform: uppercase;
|
|
168
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// The stop list — swatch + position + remove per row, then the add button.
|
|
172
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__stops {
|
|
173
|
+
display: flex;
|
|
174
|
+
flex-direction: column;
|
|
175
|
+
gap: var(--#{sys.$prefix}spacing-xxs);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__stop {
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__stop-position {
|
|
185
|
+
flex: 1 1 auto;
|
|
186
|
+
min-width: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Stop swatch — a round colour chip over the alpha checkerboard.
|
|
190
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__swatch {
|
|
191
|
+
flex: none;
|
|
192
|
+
display: inline-flex;
|
|
193
|
+
width: calc(var(--#{sys.$prefix}control-height-sm, 2.25rem) - 2 * var(--#{sys.$prefix}spacing-xxs));
|
|
194
|
+
height: calc(var(--#{sys.$prefix}control-height-sm, 2.25rem) - 2 * var(--#{sys.$prefix}spacing-xxs));
|
|
195
|
+
// WCAG 2.5.5 floor — keep the hit target at least 24px even if the
|
|
196
|
+
// control-height token shrinks in a dense context.
|
|
197
|
+
min-inline-size: 1.5rem;
|
|
198
|
+
min-block-size: 1.5rem;
|
|
199
|
+
padding: 0;
|
|
200
|
+
border: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-border);
|
|
201
|
+
border-radius: var(--#{sys.$prefix}radius-full, 999px);
|
|
202
|
+
overflow: hidden;
|
|
203
|
+
@include sys.alpha-checkerboard(6px);
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
// Keep the colour visible under Windows High Contrast — a swatch with its
|
|
206
|
+
// background stripped is meaningless.
|
|
207
|
+
forced-color-adjust: none;
|
|
208
|
+
|
|
209
|
+
&:focus-visible,
|
|
210
|
+
&[data-popover-open] {
|
|
211
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
212
|
+
outline-offset: var(--#{sys.$prefix}focus-ring-offset);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&:disabled {
|
|
216
|
+
opacity: var(--#{sys.$prefix}opacity-disabled);
|
|
217
|
+
cursor: default;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__swatch-fill {
|
|
222
|
+
flex: 1 1 auto;
|
|
223
|
+
background: var(--_swatch);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__stop-popover {
|
|
227
|
+
inline-size: 20rem;
|
|
228
|
+
max-inline-size: calc(100vw - 2rem);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Geometry controls — type + per-type fields in a two-column grid.
|
|
232
|
+
// minmax(0, …): a bare 1fr is minmax(auto, 1fr), and the angle cell's
|
|
233
|
+
// min-content (the input's intrinsic width + the dial) would refuse to
|
|
234
|
+
// shrink in narrow containers (e.g. the ColorField popover), crushing the
|
|
235
|
+
// type select down to its chevron.
|
|
236
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__geometry {
|
|
237
|
+
display: grid;
|
|
238
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
239
|
+
gap: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
|
|
240
|
+
align-items: end;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__geometry .#{sys.$prefix}input-group {
|
|
244
|
+
// Let the numeric inputs shrink with their grid cell.
|
|
245
|
+
min-width: 0;
|
|
246
|
+
|
|
247
|
+
input {
|
|
248
|
+
min-width: 0;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__field {
|
|
253
|
+
display: flex;
|
|
254
|
+
flex-direction: column;
|
|
255
|
+
gap: var(--#{sys.$prefix}spacing-xxs);
|
|
256
|
+
min-width: 0;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Radial/conic: TYPE takes its own row; the size/position pairs grid below.
|
|
260
|
+
// Linear (.is-linear): TYPE shares the row with ANGLE + dial.
|
|
261
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__type-field {
|
|
262
|
+
grid-column: 1 / -1;
|
|
263
|
+
}
|
|
264
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__geometry.is-linear .#{sys.$prefix}gradient-picker__type-field {
|
|
265
|
+
grid-column: auto;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__angle {
|
|
269
|
+
display: flex;
|
|
270
|
+
align-items: end;
|
|
271
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
272
|
+
|
|
273
|
+
> .#{sys.$prefix}gradient-picker__field {
|
|
274
|
+
flex: 1 1 auto;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Sit the dial on the input's baseline row.
|
|
278
|
+
> .#{sys.$prefix}angle-dial {
|
|
279
|
+
margin-block-end: calc((var(--#{sys.$prefix}control-height-sm, 2.25rem) - var(--#{sys.$prefix}angle-dial-size, 1.75rem)) / 2);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@media (forced-colors: active) {
|
|
284
|
+
// The bar/swatches opt out of forced colors (the colour IS the content),
|
|
285
|
+
// so the focus indicators must be re-asserted in system colors here.
|
|
286
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-bar__thumb {
|
|
287
|
+
&:focus-visible {
|
|
288
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid Highlight;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.#{sys.$prefix}interface .#{sys.$prefix}gradient-picker__swatch:focus-visible {
|
|
293
|
+
outline-color: Highlight;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
--tui-icon-button-radius
|
|
8
8
|
--tui-icon-button-bg-interact
|
|
9
9
|
--tui-icon-button-fg-interact
|
|
10
|
+
--tui-icon-button-bg-pressed
|
|
11
|
+
--tui-icon-button-fg-pressed
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
14
|
@mixin styles() {
|
|
@@ -24,6 +26,8 @@
|
|
|
24
26
|
// --tui-icon-button-radius Border radius
|
|
25
27
|
// --tui-icon-button-bg-interact Hover/focus/active background
|
|
26
28
|
// --tui-icon-button-fg-interact Hover/focus/active icon color
|
|
29
|
+
// --tui-icon-button-bg-pressed Toggled-on (aria-pressed) background
|
|
30
|
+
// --tui-icon-button-fg-pressed Toggled-on (aria-pressed) icon color
|
|
27
31
|
//
|
|
28
32
|
// To override from consuming code:
|
|
29
33
|
// .my-context .tui-icon-button { --tui-icon-button-bg: hotpink; }
|
|
@@ -69,8 +73,11 @@
|
|
|
69
73
|
--_bg-interact: var(--#{sys.$prefix}icon-button-bg-interact, var(--#{sys.$prefix}theme-secondary-subtle));
|
|
70
74
|
--_fg-interact: var(--#{sys.$prefix}icon-button-fg-interact, var(--#{sys.$prefix}color-fg));
|
|
71
75
|
|
|
72
|
-
// Pressed/toggle state — visually distinct from hover
|
|
73
|
-
|
|
76
|
+
// Pressed/toggle state — visually distinct from hover.
|
|
77
|
+
// fg-pressed falls back to the interact color; both resolve on the same
|
|
78
|
+
// element, so per-theme --_fg-interact overrides carry through.
|
|
79
|
+
--_bg-pressed: var(--#{sys.$prefix}icon-button-bg-pressed, var(--#{sys.$prefix}theme-secondary-soft));
|
|
80
|
+
--_fg-pressed: var(--#{sys.$prefix}icon-button-fg-pressed, var(--_fg-interact));
|
|
74
81
|
|
|
75
82
|
// Reset
|
|
76
83
|
appearance: none;
|
|
@@ -131,7 +138,7 @@
|
|
|
131
138
|
|
|
132
139
|
&[aria-pressed="true"] {
|
|
133
140
|
--_bg: var(--_bg-pressed);
|
|
134
|
-
--_fg: var(--_fg-
|
|
141
|
+
--_fg: var(--_fg-pressed);
|
|
135
142
|
}
|
|
136
143
|
|
|
137
144
|
&:where(:disabled, [aria-disabled="true"], .is-disabled) {
|
|
@@ -170,7 +177,7 @@
|
|
|
170
177
|
--_fg: var(--#{sys.$prefix}icon-button-fg, var(--#{sys.$prefix}theme-primary-base));
|
|
171
178
|
--_fg-interact: var(--#{sys.$prefix}icon-button-fg-interact, var(--#{sys.$prefix}theme-primary-strong));
|
|
172
179
|
--_bg-interact: var(--#{sys.$prefix}icon-button-bg-interact, var(--#{sys.$prefix}theme-primary-subtlest));
|
|
173
|
-
--_bg-pressed: var(--#{sys.$prefix}theme-primary-subtle);
|
|
180
|
+
--_bg-pressed: var(--#{sys.$prefix}icon-button-bg-pressed, var(--#{sys.$prefix}theme-primary-subtle));
|
|
174
181
|
}
|
|
175
182
|
|
|
176
183
|
// Status themes (danger/success/warning/info) share one recipe.
|
|
@@ -179,7 +186,7 @@
|
|
|
179
186
|
--_fg: var(--#{sys.$prefix}icon-button-fg, var(--#{sys.$prefix}theme-#{$status}-base));
|
|
180
187
|
--_fg-interact: var(--#{sys.$prefix}icon-button-fg-interact, var(--#{sys.$prefix}theme-#{$status}-strong));
|
|
181
188
|
--_bg-interact: var(--#{sys.$prefix}icon-button-bg-interact, var(--#{sys.$prefix}theme-#{$status}-subtlest));
|
|
182
|
-
--_bg-pressed: var(--#{sys.$prefix}theme-#{$status}-subtle);
|
|
189
|
+
--_bg-pressed: var(--#{sys.$prefix}icon-button-bg-pressed, var(--#{sys.$prefix}theme-#{$status}-subtle));
|
|
183
190
|
}
|
|
184
191
|
}
|
|
185
192
|
|
|
@@ -212,7 +219,7 @@
|
|
|
212
219
|
&.is-style-solid {
|
|
213
220
|
--_bg: var(--#{sys.$prefix}icon-button-bg, var(--#{sys.$prefix}theme-secondary-subtle));
|
|
214
221
|
--_fg: var(--#{sys.$prefix}icon-button-fg, var(--#{sys.$prefix}color-fg));
|
|
215
|
-
--_bg-pressed: var(--#{sys.$prefix}theme-secondary-soft);
|
|
222
|
+
--_bg-pressed: var(--#{sys.$prefix}icon-button-bg-pressed, var(--#{sys.$prefix}theme-secondary-soft));
|
|
216
223
|
|
|
217
224
|
&:hover,
|
|
218
225
|
&:focus-visible,
|
|
@@ -228,7 +235,7 @@
|
|
|
228
235
|
&.is-style-solid.is-theme-primary {
|
|
229
236
|
--_bg: var(--#{sys.$prefix}icon-button-bg, var(--#{sys.$prefix}theme-primary-base));
|
|
230
237
|
--_fg: var(--#{sys.$prefix}icon-button-fg, var(--#{sys.$prefix}color-fg-on-accent));
|
|
231
|
-
--_bg-pressed: var(--#{sys.$prefix}theme-primary-stronger);
|
|
238
|
+
--_bg-pressed: var(--#{sys.$prefix}icon-button-bg-pressed, var(--#{sys.$prefix}theme-primary-stronger));
|
|
232
239
|
|
|
233
240
|
&:hover,
|
|
234
241
|
&:focus-visible,
|
|
@@ -245,7 +252,7 @@
|
|
|
245
252
|
&.is-style-solid.is-theme-#{$status} {
|
|
246
253
|
--_bg: var(--#{sys.$prefix}icon-button-bg, var(--#{sys.$prefix}theme-#{$status}-base));
|
|
247
254
|
--_fg: var(--#{sys.$prefix}icon-button-fg, var(--#{sys.$prefix}color-fg-on-accent));
|
|
248
|
-
--_bg-pressed: var(--#{sys.$prefix}theme-#{$status}-stronger);
|
|
255
|
+
--_bg-pressed: var(--#{sys.$prefix}icon-button-bg-pressed, var(--#{sys.$prefix}theme-#{$status}-stronger));
|
|
249
256
|
|
|
250
257
|
&:hover,
|
|
251
258
|
&:focus-visible,
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
--tui-notice-fg
|
|
10
10
|
--tui-notice-radius
|
|
11
11
|
--tui-notice-padding
|
|
12
|
+
--tui-notice-gap
|
|
13
|
+
--tui-notice-para-gap
|
|
12
14
|
--tui-notice-title-size
|
|
13
15
|
--tui-notice-foot-basis
|
|
14
16
|
*/
|
|
@@ -27,6 +29,8 @@
|
|
|
27
29
|
// --tui-notice-fg Text color
|
|
28
30
|
// --tui-notice-radius Border radius
|
|
29
31
|
// --tui-notice-padding Padding
|
|
32
|
+
// --tui-notice-gap Gap between head items / inner slots (defaults per size preset)
|
|
33
|
+
// --tui-notice-para-gap Spacing between body paragraphs (defaults per size preset)
|
|
30
34
|
// --tui-notice-title-size Title font size (defaults per size preset)
|
|
31
35
|
// --tui-notice-foot-basis Flex basis for foot in inline layout
|
|
32
36
|
//
|
|
@@ -49,9 +53,10 @@
|
|
|
49
53
|
--_padding: var(--#{sys.$prefix}notice-padding, var(--#{sys.$prefix}spacing-md));
|
|
50
54
|
--_foot-basis: var(--#{sys.$prefix}notice-foot-basis, 500px);
|
|
51
55
|
|
|
52
|
-
// Layout
|
|
53
|
-
|
|
54
|
-
--
|
|
56
|
+
// Layout — gap follows the Card treatment: an API token wins across all
|
|
57
|
+
// size presets (they only vary the fallback).
|
|
58
|
+
--_gap: var(--#{sys.$prefix}notice-gap, var(--#{sys.$prefix}spacing-sm));
|
|
59
|
+
--_para-gap: var(--#{sys.$prefix}notice-para-gap, var(--#{sys.$prefix}spacing-sm));
|
|
55
60
|
|
|
56
61
|
container-type: inline-size;
|
|
57
62
|
container-name: tuiNotice;
|
|
@@ -157,8 +162,8 @@
|
|
|
157
162
|
// -------------------------------------------------------------------------
|
|
158
163
|
&.is-size-sm {
|
|
159
164
|
--_padding: var(--#{sys.$prefix}notice-padding, var(--#{sys.$prefix}spacing-sm));
|
|
160
|
-
--_gap: var(--#{sys.$prefix}spacing-xs);
|
|
161
|
-
--_para-gap: var(--#{sys.$prefix}spacing-xs);
|
|
165
|
+
--_gap: var(--#{sys.$prefix}notice-gap, var(--#{sys.$prefix}spacing-xs));
|
|
166
|
+
--_para-gap: var(--#{sys.$prefix}notice-para-gap, var(--#{sys.$prefix}spacing-xs));
|
|
162
167
|
|
|
163
168
|
.#{sys.$prefix}notice__body {
|
|
164
169
|
font-size: var(--#{sys.$prefix}typography-size-sm);
|
|
@@ -167,8 +172,8 @@
|
|
|
167
172
|
|
|
168
173
|
&.is-size-lg {
|
|
169
174
|
--_padding: var(--#{sys.$prefix}notice-padding, var(--#{sys.$prefix}spacing-lg));
|
|
170
|
-
--_gap: var(--#{sys.$prefix}spacing-md);
|
|
171
|
-
--_para-gap: var(--#{sys.$prefix}spacing-md);
|
|
175
|
+
--_gap: var(--#{sys.$prefix}notice-gap, var(--#{sys.$prefix}spacing-md));
|
|
176
|
+
--_para-gap: var(--#{sys.$prefix}notice-para-gap, var(--#{sys.$prefix}spacing-md));
|
|
172
177
|
|
|
173
178
|
.#{sys.$prefix}notice__title {
|
|
174
179
|
font-size: var(--#{sys.$prefix}notice-title-size, var(--#{sys.$prefix}typography-size-lg));
|