@khanacademy/wonder-blocks-icon-button 12.0.4 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$css.log +1 -1
- package/CHANGELOG.md +189 -0
- package/dist/es/index.css +1363 -0
- package/dist/es/index.css.map +1 -0
- package/dist/es/index.js +15 -10
- package/dist/index.css +1363 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +15 -10
- package/package.json +18 -11
|
@@ -0,0 +1,1363 @@
|
|
|
1
|
+
@layer shared {/**
|
|
2
|
+
* The build wraps every `*.module.css` in `@layer shared`, so this file becomes
|
|
3
|
+
* `@layer shared { @layer reset { … } }` — the sub-layer `shared.reset`.
|
|
4
|
+
* Component styles have no inner layer, so they sit directly in `shared`, and
|
|
5
|
+
* rules directly in a layer outrank that layer's named sub-layers. The cascade
|
|
6
|
+
* is therefore decided by the layer, not by bundle order.
|
|
7
|
+
*
|
|
8
|
+
* This mirrors `button-unstyled.module.css`, but the property set is the one
|
|
9
|
+
* `IconButtonUnstyled` previously shipped — it has `background: none` and lacks
|
|
10
|
+
* `user-select` / the `-webkit-tap-highlight-color` rule that `ButtonUnstyled`
|
|
11
|
+
* carries. Those differences are pre-existing and deliberately preserved here
|
|
12
|
+
* so this migration stays visually neutral.
|
|
13
|
+
*/@layer reset {
|
|
14
|
+
.wb-icon-button-unstyled-reset-bb91df26 {
|
|
15
|
+
position: relative;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
border: none;
|
|
22
|
+
background: none;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
outline: none;
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
|
|
28
|
+
/* Removes the 300ms click delay on mobile browsers by indicating that
|
|
29
|
+
* "double-tap to zoom" shouldn't be used on this element. */
|
|
30
|
+
touch-action: manipulation;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@layer shared {/**
|
|
36
|
+
* IconButton styles
|
|
37
|
+
*
|
|
38
|
+
* Every value a variant axis can change goes through a `--wb-c-icon-button--*`
|
|
39
|
+
* custom property ("component token"), as `Button` and `NodeIconButton` do. The
|
|
40
|
+
* double dash keeps the namespace distinct from the codegen'd theme tokens
|
|
41
|
+
* these read from (`--wb-c-icon-button-iconButton-*`, `--wb-semanticColor-*`).
|
|
42
|
+
*
|
|
43
|
+
* --wb-c-icon-button--size target area, block + inline (size)
|
|
44
|
+
* --wb-c-icon-button--icon-size icon block + inline size (size)
|
|
45
|
+
* --wb-c-icon-button--border-width-rest per-state widths (kind)
|
|
46
|
+
* --wb-c-icon-button--border-width-hover
|
|
47
|
+
* --wb-c-icon-button--border-width-press
|
|
48
|
+
* --wb-c-icon-button--outline-offset primary's outline offset (kind)
|
|
49
|
+
*
|
|
50
|
+
* per-state colours (kind × actionType):
|
|
51
|
+
* --wb-c-icon-button--color-background-rest
|
|
52
|
+
* --wb-c-icon-button--color-foreground-rest
|
|
53
|
+
* --wb-c-icon-button--color-border-rest
|
|
54
|
+
* --wb-c-icon-button--color-background-hover
|
|
55
|
+
* --wb-c-icon-button--color-foreground-hover
|
|
56
|
+
* --wb-c-icon-button--color-border-hover
|
|
57
|
+
* --wb-c-icon-button--color-background-press
|
|
58
|
+
* --wb-c-icon-button--color-foreground-press
|
|
59
|
+
* --wb-c-icon-button--color-border-press
|
|
60
|
+
*
|
|
61
|
+
* disabled colours (kind):
|
|
62
|
+
* --wb-c-icon-button--color-background-disabled
|
|
63
|
+
* --wb-c-icon-button--color-foreground-disabled
|
|
64
|
+
* --wb-c-icon-button--color-border-disabled
|
|
65
|
+
*
|
|
66
|
+
* Axis classes assign tokens and nothing else (composed through the `style`
|
|
67
|
+
* prop — `processStyleList` routes class-name strings to `className`);
|
|
68
|
+
* `.button` and its states only read them. Declaring the axes first and
|
|
69
|
+
* `.button` last is therefore cascade-neutral. Colour is the one axis that
|
|
70
|
+
* isn't orthogonal — the semantic tokens are keyed by `kind` *and* `actionType`
|
|
71
|
+
* — so its nine cells are compound selectors nested in their kind.
|
|
72
|
+
*
|
|
73
|
+
* Nesting is native CSS: every `&` is explicit and resolves to the flat
|
|
74
|
+
* selector it replaces, at the same specificity. State rules qualify the kind
|
|
75
|
+
* with `:where(…)`, so they all sit at equal specificity and source order
|
|
76
|
+
* decides — hover → active → focus → disabled, so focus survives hover/press
|
|
77
|
+
* and disabled resets everything. Disabled is the `[aria-disabled="true"]`
|
|
78
|
+
* attribute `icon-button-unstyled` sets, which keeps the element focusable.
|
|
79
|
+
* Tokens resolve against the per-theme `[data-wb-theme]` blocks, and the build
|
|
80
|
+
* wraps every rule in `@layer shared { … }`.
|
|
81
|
+
*//*
|
|
82
|
+
* Cross-package focus-visible mixin.
|
|
83
|
+
*
|
|
84
|
+
* Authors include the mixin via:
|
|
85
|
+
*
|
|
86
|
+
* @import "@khanacademy/wonder-blocks-styles/focus-styles.css";
|
|
87
|
+
*
|
|
88
|
+
* .my-component:focus-visible {
|
|
89
|
+
* @apply --wb-focus-visible;
|
|
90
|
+
* }
|
|
91
|
+
*
|
|
92
|
+
* postcss-import resolves the @import through the workspace and
|
|
93
|
+
* @csstools/postcss-mixins expands the @apply at build time
|
|
94
|
+
* (CSS Mixins Level 1 syntax — note the leading `--` on the name).
|
|
95
|
+
*//**
|
|
96
|
+
* Axis classes: the only rules that assign component tokens.
|
|
97
|
+
*
|
|
98
|
+
* `kind` owns the per-state border widths, primary's outline offset and the
|
|
99
|
+
* disabled colours. The `kind × actionType` colour cells are nested inside the
|
|
100
|
+
* kind they belong to.
|
|
101
|
+
*/.wb-icon-button-primary-3a82137e {
|
|
102
|
+
--wb-c-icon-button--border-width-rest: var(
|
|
103
|
+
--wb-c-icon-button-iconButton-root-border-width-primary-default
|
|
104
|
+
);
|
|
105
|
+
--wb-c-icon-button--border-width-hover: var(
|
|
106
|
+
--wb-c-icon-button-iconButton-root-border-width-primary-hover
|
|
107
|
+
);
|
|
108
|
+
--wb-c-icon-button--border-width-press: var(
|
|
109
|
+
--wb-c-icon-button-iconButton-root-border-width-primary-press
|
|
110
|
+
);
|
|
111
|
+
--wb-c-icon-button--outline-offset: var(
|
|
112
|
+
--wb-c-icon-button-iconButton-root-border-offset-primary
|
|
113
|
+
);
|
|
114
|
+
--wb-c-icon-button--color-background-disabled: var(--wb-semanticColor-action-primary-disabled-background);
|
|
115
|
+
--wb-c-icon-button--color-foreground-disabled: var(--wb-semanticColor-action-primary-disabled-foreground);
|
|
116
|
+
--wb-c-icon-button--color-border-disabled: var(--wb-semanticColor-action-primary-disabled-border);
|
|
117
|
+
|
|
118
|
+
&.wb-icon-button-progressive-3a82137e {
|
|
119
|
+
--wb-c-icon-button--color-background-rest: var(--wb-semanticColor-action-primary-progressive-default-background);
|
|
120
|
+
--wb-c-icon-button--color-foreground-rest: var(--wb-semanticColor-action-primary-progressive-default-foreground);
|
|
121
|
+
--wb-c-icon-button--color-border-rest: var(--wb-semanticColor-action-primary-progressive-default-border);
|
|
122
|
+
--wb-c-icon-button--color-background-hover: var(--wb-semanticColor-action-primary-progressive-hover-background);
|
|
123
|
+
--wb-c-icon-button--color-foreground-hover: var(--wb-semanticColor-action-primary-progressive-hover-foreground);
|
|
124
|
+
--wb-c-icon-button--color-border-hover: var(--wb-semanticColor-action-primary-progressive-hover-border);
|
|
125
|
+
--wb-c-icon-button--color-background-press: var(--wb-semanticColor-action-primary-progressive-press-background);
|
|
126
|
+
--wb-c-icon-button--color-foreground-press: var(--wb-semanticColor-action-primary-progressive-press-foreground);
|
|
127
|
+
--wb-c-icon-button--color-border-press: var(--wb-semanticColor-action-primary-progressive-press-border);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&.wb-icon-button-destructive-3a82137e {
|
|
131
|
+
--wb-c-icon-button--color-background-rest: var(--wb-semanticColor-action-primary-destructive-default-background);
|
|
132
|
+
--wb-c-icon-button--color-foreground-rest: var(--wb-semanticColor-action-primary-destructive-default-foreground);
|
|
133
|
+
--wb-c-icon-button--color-border-rest: var(--wb-semanticColor-action-primary-destructive-default-border);
|
|
134
|
+
--wb-c-icon-button--color-background-hover: var(--wb-semanticColor-action-primary-destructive-hover-background);
|
|
135
|
+
--wb-c-icon-button--color-foreground-hover: var(--wb-semanticColor-action-primary-destructive-hover-foreground);
|
|
136
|
+
--wb-c-icon-button--color-border-hover: var(--wb-semanticColor-action-primary-destructive-hover-border);
|
|
137
|
+
--wb-c-icon-button--color-background-press: var(--wb-semanticColor-action-primary-destructive-press-background);
|
|
138
|
+
--wb-c-icon-button--color-foreground-press: var(--wb-semanticColor-action-primary-destructive-press-foreground);
|
|
139
|
+
--wb-c-icon-button--color-border-press: var(--wb-semanticColor-action-primary-destructive-press-border);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&.wb-icon-button-neutral-3a82137e {
|
|
143
|
+
--wb-c-icon-button--color-background-rest: var(--wb-semanticColor-action-primary-neutral-default-background);
|
|
144
|
+
--wb-c-icon-button--color-foreground-rest: var(--wb-semanticColor-action-primary-neutral-default-foreground);
|
|
145
|
+
--wb-c-icon-button--color-border-rest: var(--wb-semanticColor-action-primary-neutral-default-border);
|
|
146
|
+
--wb-c-icon-button--color-background-hover: var(--wb-semanticColor-action-primary-neutral-hover-background);
|
|
147
|
+
--wb-c-icon-button--color-foreground-hover: var(--wb-semanticColor-action-primary-neutral-hover-foreground);
|
|
148
|
+
--wb-c-icon-button--color-border-hover: var(--wb-semanticColor-action-primary-neutral-hover-border);
|
|
149
|
+
--wb-c-icon-button--color-background-press: var(--wb-semanticColor-action-primary-neutral-press-background);
|
|
150
|
+
--wb-c-icon-button--color-foreground-press: var(--wb-semanticColor-action-primary-neutral-press-foreground);
|
|
151
|
+
--wb-c-icon-button--color-border-press: var(--wb-semanticColor-action-primary-neutral-press-border);
|
|
152
|
+
}
|
|
153
|
+
}.wb-icon-button-secondary-3a82137e {
|
|
154
|
+
--wb-c-icon-button--border-width-rest: var(
|
|
155
|
+
--wb-c-icon-button-iconButton-root-border-width-secondary-default
|
|
156
|
+
);
|
|
157
|
+
--wb-c-icon-button--border-width-hover: var(
|
|
158
|
+
--wb-c-icon-button-iconButton-root-border-width-secondary-hover
|
|
159
|
+
);
|
|
160
|
+
--wb-c-icon-button--border-width-press: var(
|
|
161
|
+
--wb-c-icon-button-iconButton-root-border-width-secondary-press
|
|
162
|
+
);
|
|
163
|
+
--wb-c-icon-button--outline-offset: var(
|
|
164
|
+
--wb-c-icon-button-iconButton-root-border-offset-secondary
|
|
165
|
+
);
|
|
166
|
+
--wb-c-icon-button--color-background-disabled: var(--wb-semanticColor-action-secondary-disabled-background);
|
|
167
|
+
--wb-c-icon-button--color-foreground-disabled: var(--wb-semanticColor-action-secondary-disabled-foreground);
|
|
168
|
+
--wb-c-icon-button--color-border-disabled: var(--wb-semanticColor-action-secondary-disabled-border);
|
|
169
|
+
|
|
170
|
+
&.wb-icon-button-progressive-3a82137e {
|
|
171
|
+
--wb-c-icon-button--color-background-rest: var(--wb-semanticColor-action-secondary-progressive-default-background);
|
|
172
|
+
--wb-c-icon-button--color-foreground-rest: var(--wb-semanticColor-action-secondary-progressive-default-foreground);
|
|
173
|
+
--wb-c-icon-button--color-border-rest: var(--wb-semanticColor-action-secondary-progressive-default-border);
|
|
174
|
+
--wb-c-icon-button--color-background-hover: var(--wb-semanticColor-action-secondary-progressive-hover-background);
|
|
175
|
+
--wb-c-icon-button--color-foreground-hover: var(--wb-semanticColor-action-secondary-progressive-hover-foreground);
|
|
176
|
+
--wb-c-icon-button--color-border-hover: var(--wb-semanticColor-action-secondary-progressive-hover-border);
|
|
177
|
+
--wb-c-icon-button--color-background-press: var(--wb-semanticColor-action-secondary-progressive-press-background);
|
|
178
|
+
--wb-c-icon-button--color-foreground-press: var(--wb-semanticColor-action-secondary-progressive-press-foreground);
|
|
179
|
+
--wb-c-icon-button--color-border-press: var(--wb-semanticColor-action-secondary-progressive-press-border);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&.wb-icon-button-destructive-3a82137e {
|
|
183
|
+
--wb-c-icon-button--color-background-rest: var(--wb-semanticColor-action-secondary-destructive-default-background);
|
|
184
|
+
--wb-c-icon-button--color-foreground-rest: var(--wb-semanticColor-action-secondary-destructive-default-foreground);
|
|
185
|
+
--wb-c-icon-button--color-border-rest: var(--wb-semanticColor-action-secondary-destructive-default-border);
|
|
186
|
+
--wb-c-icon-button--color-background-hover: var(--wb-semanticColor-action-secondary-destructive-hover-background);
|
|
187
|
+
--wb-c-icon-button--color-foreground-hover: var(--wb-semanticColor-action-secondary-destructive-hover-foreground);
|
|
188
|
+
--wb-c-icon-button--color-border-hover: var(--wb-semanticColor-action-secondary-destructive-hover-border);
|
|
189
|
+
--wb-c-icon-button--color-background-press: var(--wb-semanticColor-action-secondary-destructive-press-background);
|
|
190
|
+
--wb-c-icon-button--color-foreground-press: var(--wb-semanticColor-action-secondary-destructive-press-foreground);
|
|
191
|
+
--wb-c-icon-button--color-border-press: var(--wb-semanticColor-action-secondary-destructive-press-border);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&.wb-icon-button-neutral-3a82137e {
|
|
195
|
+
--wb-c-icon-button--color-background-rest: var(--wb-semanticColor-action-secondary-neutral-default-background);
|
|
196
|
+
--wb-c-icon-button--color-foreground-rest: var(--wb-semanticColor-action-secondary-neutral-default-foreground);
|
|
197
|
+
--wb-c-icon-button--color-border-rest: var(--wb-semanticColor-action-secondary-neutral-default-border);
|
|
198
|
+
--wb-c-icon-button--color-background-hover: var(--wb-semanticColor-action-secondary-neutral-hover-background);
|
|
199
|
+
--wb-c-icon-button--color-foreground-hover: var(--wb-semanticColor-action-secondary-neutral-hover-foreground);
|
|
200
|
+
--wb-c-icon-button--color-border-hover: var(--wb-semanticColor-action-secondary-neutral-hover-border);
|
|
201
|
+
--wb-c-icon-button--color-background-press: var(--wb-semanticColor-action-secondary-neutral-press-background);
|
|
202
|
+
--wb-c-icon-button--color-foreground-press: var(--wb-semanticColor-action-secondary-neutral-press-foreground);
|
|
203
|
+
--wb-c-icon-button--color-border-press: var(--wb-semanticColor-action-secondary-neutral-press-border);
|
|
204
|
+
}
|
|
205
|
+
}.wb-icon-button-tertiary-3a82137e {
|
|
206
|
+
--wb-c-icon-button--border-width-rest: var(
|
|
207
|
+
--wb-c-icon-button-iconButton-root-border-width-tertiary-default
|
|
208
|
+
);
|
|
209
|
+
--wb-c-icon-button--border-width-hover: var(
|
|
210
|
+
--wb-c-icon-button-iconButton-root-border-width-tertiary-hover
|
|
211
|
+
);
|
|
212
|
+
--wb-c-icon-button--border-width-press: var(
|
|
213
|
+
--wb-c-icon-button-iconButton-root-border-width-tertiary-press
|
|
214
|
+
);
|
|
215
|
+
--wb-c-icon-button--outline-offset: var(
|
|
216
|
+
--wb-c-icon-button-iconButton-root-border-offset-tertiary
|
|
217
|
+
);
|
|
218
|
+
--wb-c-icon-button--color-background-disabled: var(--wb-semanticColor-action-tertiary-disabled-background);
|
|
219
|
+
--wb-c-icon-button--color-foreground-disabled: var(--wb-semanticColor-action-tertiary-disabled-foreground);
|
|
220
|
+
--wb-c-icon-button--color-border-disabled: var(--wb-semanticColor-action-tertiary-disabled-border);
|
|
221
|
+
|
|
222
|
+
&.wb-icon-button-progressive-3a82137e {
|
|
223
|
+
--wb-c-icon-button--color-background-rest: var(--wb-semanticColor-action-tertiary-progressive-default-background);
|
|
224
|
+
--wb-c-icon-button--color-foreground-rest: var(--wb-semanticColor-action-tertiary-progressive-default-foreground);
|
|
225
|
+
--wb-c-icon-button--color-border-rest: var(--wb-semanticColor-action-tertiary-progressive-default-border);
|
|
226
|
+
--wb-c-icon-button--color-background-hover: var(--wb-semanticColor-action-tertiary-progressive-hover-background);
|
|
227
|
+
--wb-c-icon-button--color-foreground-hover: var(--wb-semanticColor-action-tertiary-progressive-hover-foreground);
|
|
228
|
+
--wb-c-icon-button--color-border-hover: var(--wb-semanticColor-action-tertiary-progressive-hover-border);
|
|
229
|
+
--wb-c-icon-button--color-background-press: var(--wb-semanticColor-action-tertiary-progressive-press-background);
|
|
230
|
+
--wb-c-icon-button--color-foreground-press: var(--wb-semanticColor-action-tertiary-progressive-press-foreground);
|
|
231
|
+
--wb-c-icon-button--color-border-press: var(--wb-semanticColor-action-tertiary-progressive-press-border);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
&.wb-icon-button-destructive-3a82137e {
|
|
235
|
+
--wb-c-icon-button--color-background-rest: var(--wb-semanticColor-action-tertiary-destructive-default-background);
|
|
236
|
+
--wb-c-icon-button--color-foreground-rest: var(--wb-semanticColor-action-tertiary-destructive-default-foreground);
|
|
237
|
+
--wb-c-icon-button--color-border-rest: var(--wb-semanticColor-action-tertiary-destructive-default-border);
|
|
238
|
+
--wb-c-icon-button--color-background-hover: var(--wb-semanticColor-action-tertiary-destructive-hover-background);
|
|
239
|
+
--wb-c-icon-button--color-foreground-hover: var(--wb-semanticColor-action-tertiary-destructive-hover-foreground);
|
|
240
|
+
--wb-c-icon-button--color-border-hover: var(--wb-semanticColor-action-tertiary-destructive-hover-border);
|
|
241
|
+
--wb-c-icon-button--color-background-press: var(--wb-semanticColor-action-tertiary-destructive-press-background);
|
|
242
|
+
--wb-c-icon-button--color-foreground-press: var(--wb-semanticColor-action-tertiary-destructive-press-foreground);
|
|
243
|
+
--wb-c-icon-button--color-border-press: var(--wb-semanticColor-action-tertiary-destructive-press-border);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&.wb-icon-button-neutral-3a82137e {
|
|
247
|
+
--wb-c-icon-button--color-background-rest: var(--wb-semanticColor-action-tertiary-neutral-default-background);
|
|
248
|
+
--wb-c-icon-button--color-foreground-rest: var(--wb-semanticColor-action-tertiary-neutral-default-foreground);
|
|
249
|
+
--wb-c-icon-button--color-border-rest: var(--wb-semanticColor-action-tertiary-neutral-default-border);
|
|
250
|
+
--wb-c-icon-button--color-background-hover: var(--wb-semanticColor-action-tertiary-neutral-hover-background);
|
|
251
|
+
--wb-c-icon-button--color-foreground-hover: var(--wb-semanticColor-action-tertiary-neutral-hover-foreground);
|
|
252
|
+
--wb-c-icon-button--color-border-hover: var(--wb-semanticColor-action-tertiary-neutral-hover-border);
|
|
253
|
+
--wb-c-icon-button--color-background-press: var(--wb-semanticColor-action-tertiary-neutral-press-background);
|
|
254
|
+
--wb-c-icon-button--color-foreground-press: var(--wb-semanticColor-action-tertiary-neutral-press-foreground);
|
|
255
|
+
--wb-c-icon-button--color-border-press: var(--wb-semanticColor-action-tertiary-neutral-press-border);
|
|
256
|
+
}
|
|
257
|
+
}/**
|
|
258
|
+
* `size` owns the target area and the icon size. Unlike `Button` there is no
|
|
259
|
+
* base size — the component always applies exactly one of these.
|
|
260
|
+
*/.wb-icon-button-xsmall-3a82137e {
|
|
261
|
+
--wb-c-icon-button--size: var(
|
|
262
|
+
--wb-c-icon-button-iconButton-root-sizing-xsmall
|
|
263
|
+
);
|
|
264
|
+
--wb-c-icon-button--icon-size: var(
|
|
265
|
+
--wb-c-icon-button-iconButton-icon-sizing-xsmall
|
|
266
|
+
);
|
|
267
|
+
}.wb-icon-button-small-3a82137e {
|
|
268
|
+
--wb-c-icon-button--size: var(
|
|
269
|
+
--wb-c-icon-button-iconButton-root-sizing-small
|
|
270
|
+
);
|
|
271
|
+
--wb-c-icon-button--icon-size: var(
|
|
272
|
+
--wb-c-icon-button-iconButton-icon-sizing-small
|
|
273
|
+
);
|
|
274
|
+
}.wb-icon-button-medium-3a82137e {
|
|
275
|
+
--wb-c-icon-button--size: var(
|
|
276
|
+
--wb-c-icon-button-iconButton-root-sizing-medium
|
|
277
|
+
);
|
|
278
|
+
--wb-c-icon-button--icon-size: var(
|
|
279
|
+
--wb-c-icon-button-iconButton-icon-sizing-medium
|
|
280
|
+
);
|
|
281
|
+
}.wb-icon-button-large-3a82137e {
|
|
282
|
+
--wb-c-icon-button--size: var(
|
|
283
|
+
--wb-c-icon-button-iconButton-root-sizing-large
|
|
284
|
+
);
|
|
285
|
+
--wb-c-icon-button--icon-size: var(
|
|
286
|
+
--wb-c-icon-button-iconButton-icon-sizing-large
|
|
287
|
+
);
|
|
288
|
+
}/**
|
|
289
|
+
* The button itself. Reads the tokens the axis classes assign — never assigns
|
|
290
|
+
* them.
|
|
291
|
+
*/.wb-icon-button-button-3a82137e {
|
|
292
|
+
/* Layout. The target area is square. */
|
|
293
|
+
block-size: var(--wb-c-icon-button--size);
|
|
294
|
+
inline-size: var(--wb-c-icon-button--size);
|
|
295
|
+
|
|
296
|
+
/* Theming, driven by the colour tokens set by the variant classes. */
|
|
297
|
+
border-radius: var(--wb-c-icon-button-iconButton-root-border-radius-default);
|
|
298
|
+
border-style: solid;
|
|
299
|
+
border-width: var(--wb-c-icon-button--border-width-rest);
|
|
300
|
+
border-color: var(--wb-c-icon-button--color-border-rest);
|
|
301
|
+
background: var(--wb-c-icon-button--color-background-rest);
|
|
302
|
+
color: var(--wb-c-icon-button--color-foreground-rest);
|
|
303
|
+
|
|
304
|
+
&:hover {
|
|
305
|
+
background: var(--wb-c-icon-button--color-background-hover);
|
|
306
|
+
border-radius: var(--wb-c-icon-button-iconButton-root-border-radius-hover);
|
|
307
|
+
color: var(--wb-c-icon-button--color-foreground-hover);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
&:where(.wb-icon-button-primary-3a82137e):hover {
|
|
311
|
+
outline: var(--wb-c-icon-button--border-width-hover) solid
|
|
312
|
+
var(--wb-c-icon-button--color-border-hover);
|
|
313
|
+
outline-offset: var(--wb-c-icon-button--outline-offset);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
&:where(.wb-icon-button-secondary-3a82137e, .wb-icon-button-tertiary-3a82137e):hover {
|
|
317
|
+
border: var(--wb-c-icon-button--border-width-hover) solid
|
|
318
|
+
var(--wb-c-icon-button--color-border-hover);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* Prevents hover from being "sticky" on touch devices (e.g. mobile). */
|
|
322
|
+
@media not (hover: hover) {
|
|
323
|
+
&:hover {
|
|
324
|
+
background-color: var(--wb-semanticColor-core-transparent);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Active / pressed. `:active` covers pointer presses, `.pressed` covers
|
|
330
|
+
* programmatic (keyboard) presses from `IconButtonUnstyled`'s `onPress`.
|
|
331
|
+
*/
|
|
332
|
+
&:active,
|
|
333
|
+
&.wb-icon-button-pressed-3a82137e {
|
|
334
|
+
background: var(--wb-c-icon-button--color-background-press);
|
|
335
|
+
border-radius: var(--wb-c-icon-button-iconButton-root-border-radius-press);
|
|
336
|
+
color: var(--wb-c-icon-button--color-foreground-press);
|
|
337
|
+
|
|
338
|
+
/* Animation */
|
|
339
|
+
transition: border-radius 0.1s ease-in-out;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
&:where(.wb-icon-button-primary-3a82137e):active,
|
|
343
|
+
&:where(.wb-icon-button-primary-3a82137e).wb-icon-button-pressed-3a82137e {
|
|
344
|
+
border: none;
|
|
345
|
+
outline: var(--wb-c-icon-button--border-width-press) solid
|
|
346
|
+
var(--wb-c-icon-button--color-border-press);
|
|
347
|
+
outline-offset: var(--wb-c-icon-button--outline-offset);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
&:where(.wb-icon-button-secondary-3a82137e, .wb-icon-button-tertiary-3a82137e):active,
|
|
351
|
+
&:where(.wb-icon-button-secondary-3a82137e, .wb-icon-button-tertiary-3a82137e).wb-icon-button-pressed-3a82137e {
|
|
352
|
+
border: var(--wb-c-icon-button--border-width-press) solid
|
|
353
|
+
var(--wb-c-icon-button--color-border-press);
|
|
354
|
+
outline: none;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Focus. Declared after hover / active, which sit at the same specificity
|
|
359
|
+
* (their kind qualifier is `:where(…)`), so the ring keeps priority when a
|
|
360
|
+
* button is focused *and* hovered or pressed.
|
|
361
|
+
*/
|
|
362
|
+
&:focus-visible {
|
|
363
|
+
box-shadow: 0 0 0 var(--wb-border-width-medium)
|
|
364
|
+
var(--wb-semanticColor-focus-inner);
|
|
365
|
+
outline: var(--wb-border-width-medium) solid
|
|
366
|
+
var(--wb-semanticColor-focus-outer);
|
|
367
|
+
outline-offset: var(--wb-border-width-medium);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** Disabled. Declared last so it resets hover / active / focus. */
|
|
371
|
+
&[aria-disabled="true"] {
|
|
372
|
+
cursor: not-allowed;
|
|
373
|
+
|
|
374
|
+
/* Longhands, not the `border` shorthand, so `.button`'s `solid` style
|
|
375
|
+
* survives. */
|
|
376
|
+
border-width: var(--wb-c-icon-button--border-width-rest);
|
|
377
|
+
border-color: var(--wb-c-icon-button--color-border-disabled);
|
|
378
|
+
background: var(--wb-c-icon-button--color-background-disabled);
|
|
379
|
+
color: var(--wb-c-icon-button--color-foreground-disabled);
|
|
380
|
+
|
|
381
|
+
/* Reset hover / active back to the rest state. */
|
|
382
|
+
&:hover,
|
|
383
|
+
&:active {
|
|
384
|
+
border-width: var(--wb-c-icon-button--border-width-rest);
|
|
385
|
+
border-color: var(--wb-c-icon-button--color-border-disabled);
|
|
386
|
+
border-radius: var(
|
|
387
|
+
--wb-c-icon-button-iconButton-root-border-radius-default
|
|
388
|
+
);
|
|
389
|
+
background: var(--wb-c-icon-button--color-background-disabled);
|
|
390
|
+
color: var(--wb-c-icon-button--color-foreground-disabled);
|
|
391
|
+
outline: none;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* A disabled button still gets the focus ring. Spelled out separately
|
|
396
|
+
* because the `:hover` reset above outranks `.button:focus-visible`.
|
|
397
|
+
*/
|
|
398
|
+
&:focus-visible {
|
|
399
|
+
box-shadow: 0 0 0 var(--wb-border-width-medium)
|
|
400
|
+
var(--wb-semanticColor-focus-inner);
|
|
401
|
+
outline: var(--wb-border-width-medium) solid
|
|
402
|
+
var(--wb-semanticColor-focus-outer);
|
|
403
|
+
outline-offset: var(--wb-border-width-medium);
|
|
404
|
+
|
|
405
|
+
border-width: var(--wb-c-icon-button--border-width-rest);
|
|
406
|
+
border-color: var(--wb-c-icon-button--color-border-disabled);
|
|
407
|
+
background: var(--wb-c-icon-button--color-background-disabled);
|
|
408
|
+
color: var(--wb-c-icon-button--color-foreground-disabled);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Icon. Qualified with `.button` on purpose: `PhosphorIcon` ships
|
|
414
|
+
* single-class `.small` / `.medium` rules in the same `@layer shared`, so
|
|
415
|
+
* at equal specificity stylesheet load order would decide the winner.
|
|
416
|
+
*/
|
|
417
|
+
& .wb-icon-button-icon-3a82137e {
|
|
418
|
+
inline-size: var(--wb-c-icon-button--icon-size);
|
|
419
|
+
block-size: var(--wb-c-icon-button--icon-size);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
@layer shared {/**
|
|
425
|
+
* ActivityIconButton styles
|
|
426
|
+
*
|
|
427
|
+
* Every value a variant axis can change goes through a
|
|
428
|
+
* `--wb-c-activity-icon-button--*` custom property ("component token"), as
|
|
429
|
+
* `IconButton` does. The double dash keeps the namespace distinct from the
|
|
430
|
+
* codegen'd theme tokens these read from (`--wb-c-icon-button-*`,
|
|
431
|
+
* `--wb-semanticColor-*`).
|
|
432
|
+
*
|
|
433
|
+
* structural (identical across every variant, assigned on `.button`):
|
|
434
|
+
* --wb-c-activity-icon-button--box-border-width
|
|
435
|
+
* --wb-c-activity-icon-button--box-shadow-y-rest
|
|
436
|
+
* --wb-c-activity-icon-button--box-shadow-y-hover
|
|
437
|
+
* --wb-c-activity-icon-button--box-shadow-y-press
|
|
438
|
+
*
|
|
439
|
+
* root text colour (actionType):
|
|
440
|
+
* --wb-c-activity-icon-button--label-color-foreground
|
|
441
|
+
*
|
|
442
|
+
* per-state box colours (actionType × kind):
|
|
443
|
+
* --wb-c-activity-icon-button--box-color-background-rest
|
|
444
|
+
* --wb-c-activity-icon-button--box-color-foreground-rest
|
|
445
|
+
* --wb-c-activity-icon-button--box-color-border-rest
|
|
446
|
+
* --wb-c-activity-icon-button--box-color-shadow-rest
|
|
447
|
+
* --wb-c-activity-icon-button--box-color-background-hover
|
|
448
|
+
* --wb-c-activity-icon-button--box-color-foreground-hover
|
|
449
|
+
* --wb-c-activity-icon-button--box-color-border-hover
|
|
450
|
+
* --wb-c-activity-icon-button--box-color-shadow-hover
|
|
451
|
+
* --wb-c-activity-icon-button--box-color-background-press
|
|
452
|
+
* --wb-c-activity-icon-button--box-color-foreground-press
|
|
453
|
+
* --wb-c-activity-icon-button--box-color-border-press
|
|
454
|
+
* --wb-c-activity-icon-button--box-color-shadow-press
|
|
455
|
+
*
|
|
456
|
+
* disabled box colours (kind):
|
|
457
|
+
* --wb-c-activity-icon-button--box-color-background-disabled
|
|
458
|
+
* --wb-c-activity-icon-button--box-color-foreground-disabled
|
|
459
|
+
* --wb-c-activity-icon-button--box-color-border-disabled
|
|
460
|
+
* --wb-c-activity-icon-button--box-color-shadow-disabled
|
|
461
|
+
*
|
|
462
|
+
* Axis classes assign colour tokens and nothing else (composed through the
|
|
463
|
+
* `style` prop — `processStyleList` routes class-name strings to `className`);
|
|
464
|
+
* `.button` and its states only read them. Declaring the axes first and
|
|
465
|
+
* `.button` last is therefore cascade-neutral. Colour is the one axis that
|
|
466
|
+
* isn't orthogonal — the chonky tokens are keyed by `actionType` *and* `kind`
|
|
467
|
+
* (`--wb-semanticColor-chonky-<actionType>-<property>-<kind>-<state>`) — so
|
|
468
|
+
* its six cells are compound selectors nested in their actionType.
|
|
469
|
+
*
|
|
470
|
+
* Nesting is native CSS: every `&` is explicit and resolves to the flat
|
|
471
|
+
* selector it replaces, at the same specificity. The box state rules all sit
|
|
472
|
+
* at equal specificity, so source order decides — hover → active → disabled →
|
|
473
|
+
* focus, so press survives hover, disabled resets both, and the focus ring
|
|
474
|
+
* survives all of them. Disabled is the `[aria-disabled="true"]` attribute
|
|
475
|
+
* `icon-button-unstyled` sets, which keeps the element focusable. Tokens
|
|
476
|
+
* resolve against the per-theme `[data-wb-theme]` blocks, and the build wraps
|
|
477
|
+
* every rule in `@layer shared { … }`.
|
|
478
|
+
*//*
|
|
479
|
+
* Cross-package focus-visible mixin.
|
|
480
|
+
*
|
|
481
|
+
* Authors include the mixin via:
|
|
482
|
+
*
|
|
483
|
+
* @import "@khanacademy/wonder-blocks-styles/focus-styles.css";
|
|
484
|
+
*
|
|
485
|
+
* .my-component:focus-visible {
|
|
486
|
+
* @apply --wb-focus-visible;
|
|
487
|
+
* }
|
|
488
|
+
*
|
|
489
|
+
* postcss-import resolves the @import through the workspace and
|
|
490
|
+
* @csstools/postcss-mixins expands the @apply at build time
|
|
491
|
+
* (CSS Mixins Level 1 syntax — note the leading `--` on the name).
|
|
492
|
+
*//**
|
|
493
|
+
* Axis classes: the only rules that assign colour tokens.
|
|
494
|
+
*
|
|
495
|
+
* `actionType` owns the root text colour. The `actionType × kind` box colour
|
|
496
|
+
* cells are nested inside the actionType they belong to.
|
|
497
|
+
*/.wb-activity-icon-button-progressive-407b6d48 {
|
|
498
|
+
--wb-c-activity-icon-button--label-color-foreground: var(
|
|
499
|
+
--wb-c-icon-button-activityIconButton-label-color-progressive
|
|
500
|
+
);
|
|
501
|
+
|
|
502
|
+
&.wb-activity-icon-button-primary-407b6d48 {
|
|
503
|
+
--wb-c-activity-icon-button--box-color-background-rest: var(--wb-semanticColor-chonky-progressive-background-primary-rest);
|
|
504
|
+
--wb-c-activity-icon-button--box-color-foreground-rest: var(--wb-semanticColor-chonky-progressive-foreground-primary-rest);
|
|
505
|
+
--wb-c-activity-icon-button--box-color-border-rest: var(--wb-semanticColor-chonky-progressive-border-primary-rest);
|
|
506
|
+
--wb-c-activity-icon-button--box-color-shadow-rest: var(--wb-semanticColor-chonky-progressive-shadow-primary-rest);
|
|
507
|
+
--wb-c-activity-icon-button--box-color-background-hover: var(--wb-semanticColor-chonky-progressive-background-primary-hover);
|
|
508
|
+
--wb-c-activity-icon-button--box-color-foreground-hover: var(--wb-semanticColor-chonky-progressive-foreground-primary-hover);
|
|
509
|
+
--wb-c-activity-icon-button--box-color-border-hover: var(--wb-semanticColor-chonky-progressive-border-primary-hover);
|
|
510
|
+
--wb-c-activity-icon-button--box-color-shadow-hover: var(--wb-semanticColor-chonky-progressive-shadow-primary-hover);
|
|
511
|
+
--wb-c-activity-icon-button--box-color-background-press: var(--wb-semanticColor-chonky-progressive-background-primary-press);
|
|
512
|
+
--wb-c-activity-icon-button--box-color-foreground-press: var(--wb-semanticColor-chonky-progressive-foreground-primary-press);
|
|
513
|
+
--wb-c-activity-icon-button--box-color-border-press: var(--wb-semanticColor-chonky-progressive-border-primary-press);
|
|
514
|
+
--wb-c-activity-icon-button--box-color-shadow-press: var(--wb-semanticColor-chonky-progressive-shadow-primary-press);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
&.wb-activity-icon-button-secondary-407b6d48 {
|
|
518
|
+
--wb-c-activity-icon-button--box-color-background-rest: var(--wb-semanticColor-chonky-progressive-background-secondary-rest);
|
|
519
|
+
--wb-c-activity-icon-button--box-color-foreground-rest: var(--wb-semanticColor-chonky-progressive-foreground-secondary-rest);
|
|
520
|
+
--wb-c-activity-icon-button--box-color-border-rest: var(--wb-semanticColor-chonky-progressive-border-secondary-rest);
|
|
521
|
+
--wb-c-activity-icon-button--box-color-shadow-rest: var(--wb-semanticColor-chonky-progressive-shadow-secondary-rest);
|
|
522
|
+
--wb-c-activity-icon-button--box-color-background-hover: var(--wb-semanticColor-chonky-progressive-background-secondary-hover);
|
|
523
|
+
--wb-c-activity-icon-button--box-color-foreground-hover: var(--wb-semanticColor-chonky-progressive-foreground-secondary-hover);
|
|
524
|
+
--wb-c-activity-icon-button--box-color-border-hover: var(--wb-semanticColor-chonky-progressive-border-secondary-hover);
|
|
525
|
+
--wb-c-activity-icon-button--box-color-shadow-hover: var(--wb-semanticColor-chonky-progressive-shadow-secondary-hover);
|
|
526
|
+
--wb-c-activity-icon-button--box-color-background-press: var(--wb-semanticColor-chonky-progressive-background-secondary-press);
|
|
527
|
+
--wb-c-activity-icon-button--box-color-foreground-press: var(--wb-semanticColor-chonky-progressive-foreground-secondary-press);
|
|
528
|
+
--wb-c-activity-icon-button--box-color-border-press: var(--wb-semanticColor-chonky-progressive-border-secondary-press);
|
|
529
|
+
--wb-c-activity-icon-button--box-color-shadow-press: var(--wb-semanticColor-chonky-progressive-shadow-secondary-press);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
&.wb-activity-icon-button-tertiary-407b6d48 {
|
|
533
|
+
--wb-c-activity-icon-button--box-color-background-rest: var(--wb-semanticColor-chonky-progressive-background-tertiary-rest);
|
|
534
|
+
--wb-c-activity-icon-button--box-color-foreground-rest: var(--wb-semanticColor-chonky-progressive-foreground-tertiary-rest);
|
|
535
|
+
--wb-c-activity-icon-button--box-color-border-rest: var(--wb-semanticColor-chonky-progressive-border-tertiary-rest);
|
|
536
|
+
--wb-c-activity-icon-button--box-color-shadow-rest: var(--wb-semanticColor-chonky-progressive-shadow-tertiary-rest);
|
|
537
|
+
--wb-c-activity-icon-button--box-color-background-hover: var(--wb-semanticColor-chonky-progressive-background-tertiary-hover);
|
|
538
|
+
--wb-c-activity-icon-button--box-color-foreground-hover: var(--wb-semanticColor-chonky-progressive-foreground-tertiary-hover);
|
|
539
|
+
--wb-c-activity-icon-button--box-color-border-hover: var(--wb-semanticColor-chonky-progressive-border-tertiary-hover);
|
|
540
|
+
--wb-c-activity-icon-button--box-color-shadow-hover: var(--wb-semanticColor-chonky-progressive-shadow-tertiary-hover);
|
|
541
|
+
--wb-c-activity-icon-button--box-color-background-press: var(--wb-semanticColor-chonky-progressive-background-tertiary-press);
|
|
542
|
+
--wb-c-activity-icon-button--box-color-foreground-press: var(--wb-semanticColor-chonky-progressive-foreground-tertiary-press);
|
|
543
|
+
--wb-c-activity-icon-button--box-color-border-press: var(--wb-semanticColor-chonky-progressive-border-tertiary-press);
|
|
544
|
+
--wb-c-activity-icon-button--box-color-shadow-press: var(--wb-semanticColor-chonky-progressive-shadow-tertiary-press);
|
|
545
|
+
}
|
|
546
|
+
}.wb-activity-icon-button-neutral-407b6d48 {
|
|
547
|
+
--wb-c-activity-icon-button--label-color-foreground: var(
|
|
548
|
+
--wb-semanticColor-core-foreground-neutral-default
|
|
549
|
+
);
|
|
550
|
+
|
|
551
|
+
&.wb-activity-icon-button-primary-407b6d48 {
|
|
552
|
+
--wb-c-activity-icon-button--box-color-background-rest: var(--wb-semanticColor-chonky-neutral-background-primary-rest);
|
|
553
|
+
--wb-c-activity-icon-button--box-color-foreground-rest: var(--wb-semanticColor-chonky-neutral-foreground-primary-rest);
|
|
554
|
+
--wb-c-activity-icon-button--box-color-border-rest: var(--wb-semanticColor-chonky-neutral-border-primary-rest);
|
|
555
|
+
--wb-c-activity-icon-button--box-color-shadow-rest: var(--wb-semanticColor-chonky-neutral-shadow-primary-rest);
|
|
556
|
+
--wb-c-activity-icon-button--box-color-background-hover: var(--wb-semanticColor-chonky-neutral-background-primary-hover);
|
|
557
|
+
--wb-c-activity-icon-button--box-color-foreground-hover: var(--wb-semanticColor-chonky-neutral-foreground-primary-hover);
|
|
558
|
+
--wb-c-activity-icon-button--box-color-border-hover: var(--wb-semanticColor-chonky-neutral-border-primary-hover);
|
|
559
|
+
--wb-c-activity-icon-button--box-color-shadow-hover: var(--wb-semanticColor-chonky-neutral-shadow-primary-hover);
|
|
560
|
+
--wb-c-activity-icon-button--box-color-background-press: var(--wb-semanticColor-chonky-neutral-background-primary-press);
|
|
561
|
+
--wb-c-activity-icon-button--box-color-foreground-press: var(--wb-semanticColor-chonky-neutral-foreground-primary-press);
|
|
562
|
+
--wb-c-activity-icon-button--box-color-border-press: var(--wb-semanticColor-chonky-neutral-border-primary-press);
|
|
563
|
+
--wb-c-activity-icon-button--box-color-shadow-press: var(--wb-semanticColor-chonky-neutral-shadow-primary-press);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
&.wb-activity-icon-button-secondary-407b6d48 {
|
|
567
|
+
--wb-c-activity-icon-button--box-color-background-rest: var(--wb-semanticColor-chonky-neutral-background-secondary-rest);
|
|
568
|
+
--wb-c-activity-icon-button--box-color-foreground-rest: var(--wb-semanticColor-chonky-neutral-foreground-secondary-rest);
|
|
569
|
+
--wb-c-activity-icon-button--box-color-border-rest: var(--wb-semanticColor-chonky-neutral-border-secondary-rest);
|
|
570
|
+
--wb-c-activity-icon-button--box-color-shadow-rest: var(--wb-semanticColor-chonky-neutral-shadow-secondary-rest);
|
|
571
|
+
--wb-c-activity-icon-button--box-color-background-hover: var(--wb-semanticColor-chonky-neutral-background-secondary-hover);
|
|
572
|
+
--wb-c-activity-icon-button--box-color-foreground-hover: var(--wb-semanticColor-chonky-neutral-foreground-secondary-hover);
|
|
573
|
+
--wb-c-activity-icon-button--box-color-border-hover: var(--wb-semanticColor-chonky-neutral-border-secondary-hover);
|
|
574
|
+
--wb-c-activity-icon-button--box-color-shadow-hover: var(--wb-semanticColor-chonky-neutral-shadow-secondary-hover);
|
|
575
|
+
--wb-c-activity-icon-button--box-color-background-press: var(--wb-semanticColor-chonky-neutral-background-secondary-press);
|
|
576
|
+
--wb-c-activity-icon-button--box-color-foreground-press: var(--wb-semanticColor-chonky-neutral-foreground-secondary-press);
|
|
577
|
+
--wb-c-activity-icon-button--box-color-border-press: var(--wb-semanticColor-chonky-neutral-border-secondary-press);
|
|
578
|
+
--wb-c-activity-icon-button--box-color-shadow-press: var(--wb-semanticColor-chonky-neutral-shadow-secondary-press);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
&.wb-activity-icon-button-tertiary-407b6d48 {
|
|
582
|
+
--wb-c-activity-icon-button--box-color-background-rest: var(--wb-semanticColor-chonky-neutral-background-tertiary-rest);
|
|
583
|
+
--wb-c-activity-icon-button--box-color-foreground-rest: var(--wb-semanticColor-chonky-neutral-foreground-tertiary-rest);
|
|
584
|
+
--wb-c-activity-icon-button--box-color-border-rest: var(--wb-semanticColor-chonky-neutral-border-tertiary-rest);
|
|
585
|
+
--wb-c-activity-icon-button--box-color-shadow-rest: var(--wb-semanticColor-chonky-neutral-shadow-tertiary-rest);
|
|
586
|
+
--wb-c-activity-icon-button--box-color-background-hover: var(--wb-semanticColor-chonky-neutral-background-tertiary-hover);
|
|
587
|
+
--wb-c-activity-icon-button--box-color-foreground-hover: var(--wb-semanticColor-chonky-neutral-foreground-tertiary-hover);
|
|
588
|
+
--wb-c-activity-icon-button--box-color-border-hover: var(--wb-semanticColor-chonky-neutral-border-tertiary-hover);
|
|
589
|
+
--wb-c-activity-icon-button--box-color-shadow-hover: var(--wb-semanticColor-chonky-neutral-shadow-tertiary-hover);
|
|
590
|
+
--wb-c-activity-icon-button--box-color-background-press: var(--wb-semanticColor-chonky-neutral-background-tertiary-press);
|
|
591
|
+
--wb-c-activity-icon-button--box-color-foreground-press: var(--wb-semanticColor-chonky-neutral-foreground-tertiary-press);
|
|
592
|
+
--wb-c-activity-icon-button--box-color-border-press: var(--wb-semanticColor-chonky-neutral-border-tertiary-press);
|
|
593
|
+
--wb-c-activity-icon-button--box-color-shadow-press: var(--wb-semanticColor-chonky-neutral-shadow-tertiary-press);
|
|
594
|
+
}
|
|
595
|
+
}/**
|
|
596
|
+
* `kind` owns the disabled box colours, which depend on `kind` only.
|
|
597
|
+
*/.wb-activity-icon-button-primary-407b6d48 {
|
|
598
|
+
--wb-c-activity-icon-button--box-color-background-disabled: var(--wb-semanticColor-chonky-disabled-background-primary);
|
|
599
|
+
--wb-c-activity-icon-button--box-color-foreground-disabled: var(--wb-semanticColor-chonky-disabled-foreground-primary);
|
|
600
|
+
--wb-c-activity-icon-button--box-color-border-disabled: var(--wb-semanticColor-chonky-disabled-border-primary);
|
|
601
|
+
--wb-c-activity-icon-button--box-color-shadow-disabled: var(--wb-semanticColor-chonky-disabled-shadow-primary);
|
|
602
|
+
}.wb-activity-icon-button-secondary-407b6d48 {
|
|
603
|
+
--wb-c-activity-icon-button--box-color-background-disabled: var(--wb-semanticColor-chonky-disabled-background-secondary);
|
|
604
|
+
--wb-c-activity-icon-button--box-color-foreground-disabled: var(--wb-semanticColor-chonky-disabled-foreground-secondary);
|
|
605
|
+
--wb-c-activity-icon-button--box-color-border-disabled: var(--wb-semanticColor-chonky-disabled-border-secondary);
|
|
606
|
+
--wb-c-activity-icon-button--box-color-shadow-disabled: var(--wb-semanticColor-chonky-disabled-shadow-secondary);
|
|
607
|
+
}.wb-activity-icon-button-tertiary-407b6d48 {
|
|
608
|
+
--wb-c-activity-icon-button--box-color-background-disabled: var(--wb-semanticColor-chonky-disabled-background-tertiary);
|
|
609
|
+
--wb-c-activity-icon-button--box-color-foreground-disabled: var(--wb-semanticColor-chonky-disabled-foreground-tertiary);
|
|
610
|
+
--wb-c-activity-icon-button--box-color-border-disabled: var(--wb-semanticColor-chonky-disabled-border-tertiary);
|
|
611
|
+
--wb-c-activity-icon-button--box-color-shadow-disabled: var(--wb-semanticColor-chonky-disabled-shadow-tertiary);
|
|
612
|
+
}/**
|
|
613
|
+
* The button itself. Assigns the structural tokens and reads the colour tokens
|
|
614
|
+
* the axis classes assign — never assigns those. Custom properties inherit, so
|
|
615
|
+
* the box and label pick up whichever variant classes the root carries.
|
|
616
|
+
*/.wb-activity-icon-button-button-407b6d48 {
|
|
617
|
+
--wb-c-activity-icon-button--box-border-width: var(--wb-border-width-thin);
|
|
618
|
+
|
|
619
|
+
/* NOTE: We use px units to prevent a bug in Safari where the shadow
|
|
620
|
+
* animation flickers when using rem units. */
|
|
621
|
+
--wb-c-activity-icon-button--box-shadow-y-rest: 6px;
|
|
622
|
+
--wb-c-activity-icon-button--box-shadow-y-hover: 8px;
|
|
623
|
+
--wb-c-activity-icon-button--box-shadow-y-press: var(--wb-sizing-size_0);
|
|
624
|
+
|
|
625
|
+
/* Used for the focus ring. */
|
|
626
|
+
border-radius: var(--wb-border-radius-radius_120);
|
|
627
|
+
color: var(--wb-c-activity-icon-button--label-color-foreground);
|
|
628
|
+
|
|
629
|
+
/* Layout */
|
|
630
|
+
flex-direction: column;
|
|
631
|
+
gap: var(--wb-sizing-size_020);
|
|
632
|
+
|
|
633
|
+
/* Putting an arbitrary max inline size to prevent the button from
|
|
634
|
+
* stretching to fill the parent. */
|
|
635
|
+
max-inline-size: 200px;
|
|
636
|
+
place-self: flex-start center;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* The "chonky" box. Qualified with `.button` on purpose: `View`
|
|
640
|
+
* (`.default`) ships single-class rules in the same `@layer shared` that
|
|
641
|
+
* set some of the same properties, so at equal specificity stylesheet load
|
|
642
|
+
* order would decide the winner.
|
|
643
|
+
*/
|
|
644
|
+
& .wb-activity-icon-button-box-407b6d48 {
|
|
645
|
+
/* Layout */
|
|
646
|
+
border-radius: var(--wb-border-radius-radius_120);
|
|
647
|
+
margin-block-end: var(--wb-c-activity-icon-button--box-shadow-y-rest);
|
|
648
|
+
padding-block: var(--wb-sizing-size_140);
|
|
649
|
+
padding-inline: var(--wb-sizing-size_200);
|
|
650
|
+
inline-size: var(--wb-sizing-size_640);
|
|
651
|
+
align-items: center;
|
|
652
|
+
justify-content: center;
|
|
653
|
+
|
|
654
|
+
/* Theming */
|
|
655
|
+
background: var(--wb-c-activity-icon-button--box-color-background-rest);
|
|
656
|
+
border: var(--wb-c-activity-icon-button--box-border-width) solid
|
|
657
|
+
var(--wb-c-activity-icon-button--box-color-border-rest);
|
|
658
|
+
color: var(--wb-c-activity-icon-button--box-color-foreground-rest);
|
|
659
|
+
|
|
660
|
+
/* Gives the button a "chonky" look and feel. */
|
|
661
|
+
box-shadow: 0 var(--wb-c-activity-icon-button--box-shadow-y-rest) 0 0
|
|
662
|
+
var(--wb-c-activity-icon-button--box-color-shadow-rest);
|
|
663
|
+
|
|
664
|
+
/* Motion */
|
|
665
|
+
transition: all 0.12s ease-out;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
@media not (hover: hover) {
|
|
669
|
+
& .wb-activity-icon-button-box-407b6d48 {
|
|
670
|
+
transition: none;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Hover. Deliberately *not* gated behind `@media (hover: hover)` — only
|
|
676
|
+
* the transition above is. The box lifts by the difference between the
|
|
677
|
+
* hover and rest shadow depths so its top edge stays put.
|
|
678
|
+
*/
|
|
679
|
+
&:hover .wb-activity-icon-button-box-407b6d48 {
|
|
680
|
+
background: var(--wb-c-activity-icon-button--box-color-background-hover);
|
|
681
|
+
border: var(--wb-c-activity-icon-button--box-border-width) solid
|
|
682
|
+
var(--wb-c-activity-icon-button--box-color-border-hover);
|
|
683
|
+
box-shadow: 0 var(--wb-c-activity-icon-button--box-shadow-y-hover) 0 0
|
|
684
|
+
var(--wb-c-activity-icon-button--box-color-shadow-hover);
|
|
685
|
+
color: var(--wb-c-activity-icon-button--box-color-foreground-hover);
|
|
686
|
+
transform: translateY(
|
|
687
|
+
calc(
|
|
688
|
+
(
|
|
689
|
+
var(--wb-c-activity-icon-button--box-shadow-y-hover) -
|
|
690
|
+
var(--wb-c-activity-icon-button--box-shadow-y-rest)
|
|
691
|
+
) * -1
|
|
692
|
+
)
|
|
693
|
+
);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Active / pressed. `:active` covers pointer presses, `.pressed` covers
|
|
698
|
+
* programmatic (keyboard) presses from `IconButtonUnstyled`'s `onPress`.
|
|
699
|
+
* The box drops by the rest shadow depth so it looks pushed flat against
|
|
700
|
+
* the shadow.
|
|
701
|
+
*/
|
|
702
|
+
&:active .wb-activity-icon-button-box-407b6d48,
|
|
703
|
+
&.wb-activity-icon-button-pressed-407b6d48 .wb-activity-icon-button-box-407b6d48 {
|
|
704
|
+
background: var(--wb-c-activity-icon-button--box-color-background-press);
|
|
705
|
+
border: var(--wb-c-activity-icon-button--box-border-width) solid
|
|
706
|
+
var(--wb-c-activity-icon-button--box-color-border-press);
|
|
707
|
+
box-shadow: 0 var(--wb-c-activity-icon-button--box-shadow-y-press) 0 0
|
|
708
|
+
var(--wb-c-activity-icon-button--box-color-shadow-press);
|
|
709
|
+
color: var(--wb-c-activity-icon-button--box-color-foreground-press);
|
|
710
|
+
transform: translateY(
|
|
711
|
+
var(--wb-c-activity-icon-button--box-shadow-y-rest)
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/** Disabled. Declared after hover / active so it resets them. */
|
|
716
|
+
&[aria-disabled="true"] {
|
|
717
|
+
cursor: not-allowed;
|
|
718
|
+
color: var(--wb-semanticColor-core-foreground-disabled-default);
|
|
719
|
+
outline: none;
|
|
720
|
+
transform: none;
|
|
721
|
+
|
|
722
|
+
/* Only exist to outrank the hover / active rules above. */
|
|
723
|
+
&:hover,
|
|
724
|
+
&:active {
|
|
725
|
+
outline: none;
|
|
726
|
+
transform: none;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
& .wb-activity-icon-button-box-407b6d48,
|
|
730
|
+
&:hover .wb-activity-icon-button-box-407b6d48,
|
|
731
|
+
&:active .wb-activity-icon-button-box-407b6d48 {
|
|
732
|
+
background: var(
|
|
733
|
+
--wb-c-activity-icon-button--box-color-background-disabled
|
|
734
|
+
);
|
|
735
|
+
|
|
736
|
+
/* Longhands, not the `border` shorthand, so `.box`'s `solid`
|
|
737
|
+
* style survives. */
|
|
738
|
+
border-width: var(--wb-c-activity-icon-button--box-border-width);
|
|
739
|
+
border-color: var(
|
|
740
|
+
--wb-c-activity-icon-button--box-color-border-disabled
|
|
741
|
+
);
|
|
742
|
+
box-shadow: 0 var(--wb-c-activity-icon-button--box-shadow-y-rest) 0
|
|
743
|
+
0 var(--wb-c-activity-icon-button--box-color-shadow-disabled);
|
|
744
|
+
color: var(--wb-c-activity-icon-button--box-color-foreground-disabled);
|
|
745
|
+
transform: none;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Focus. Declared last so the ring survives hover / press / disabled.
|
|
751
|
+
*/
|
|
752
|
+
&:focus-visible {
|
|
753
|
+
box-shadow: 0 0 0 var(--wb-border-width-medium)
|
|
754
|
+
var(--wb-semanticColor-focus-inner);
|
|
755
|
+
outline: var(--wb-border-width-medium) solid
|
|
756
|
+
var(--wb-semanticColor-focus-outer);
|
|
757
|
+
outline-offset: var(--wb-border-width-medium);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* A disabled button still gets the focus ring. Spelled out separately
|
|
762
|
+
* because the disabled `:hover` reset above outranks
|
|
763
|
+
* `.button:focus-visible`.
|
|
764
|
+
*/
|
|
765
|
+
&[aria-disabled="true"]:focus-visible {
|
|
766
|
+
box-shadow: 0 0 0 var(--wb-border-width-medium)
|
|
767
|
+
var(--wb-semanticColor-focus-inner);
|
|
768
|
+
outline: var(--wb-border-width-medium) solid
|
|
769
|
+
var(--wb-semanticColor-focus-outer);
|
|
770
|
+
outline-offset: var(--wb-border-width-medium);
|
|
771
|
+
|
|
772
|
+
transform: none;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Label. Qualified with `.button` for the same reason as `.box`:
|
|
777
|
+
* `BodyText` (`.smallSemi`) ships single-class rules in the same
|
|
778
|
+
* `@layer shared`.
|
|
779
|
+
*/
|
|
780
|
+
& .wb-activity-icon-button-label-407b6d48 {
|
|
781
|
+
margin: 0;
|
|
782
|
+
text-align: center;
|
|
783
|
+
|
|
784
|
+
/* Text clipping. Restricted to a maximum of 2 lines.
|
|
785
|
+
* @see https://css-tricks.com/line-clampin/#aa-the-standardized-way */
|
|
786
|
+
display: -webkit-box;
|
|
787
|
+
-webkit-box-orient: vertical;
|
|
788
|
+
-webkit-line-clamp: 2;
|
|
789
|
+
overflow: hidden;
|
|
790
|
+
|
|
791
|
+
/* Label fitting for long (esp. translated) labels: prefer locale-aware
|
|
792
|
+
* hyphenation, then fall back to breaking long words so nothing
|
|
793
|
+
* overflows. `word-break: normal` is required so hyphens can win —
|
|
794
|
+
* `break-word` would force a hard break first.
|
|
795
|
+
* @see WB-2354 */
|
|
796
|
+
hyphens: auto;
|
|
797
|
+
word-break: normal;
|
|
798
|
+
overflow-wrap: break-word;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
@layer shared {/**
|
|
804
|
+
* ConversationIconButton styles
|
|
805
|
+
*
|
|
806
|
+
* Every value a variant axis can change goes through a
|
|
807
|
+
* `--wb-c-conversation-icon-button--*` custom property ("component token"), as
|
|
808
|
+
* `Button` and `IconButton` do. The double dash keeps the namespace distinct
|
|
809
|
+
* from the `--wb-*` tokens these read from.
|
|
810
|
+
*
|
|
811
|
+
* structural (identical across every variant, assigned on `.button`):
|
|
812
|
+
* --wb-c-conversation-icon-button--padding
|
|
813
|
+
* --wb-c-conversation-icon-button--border-width-rest
|
|
814
|
+
* --wb-c-conversation-icon-button--border-width-press
|
|
815
|
+
*
|
|
816
|
+
* per-state colours (kind × actionType):
|
|
817
|
+
* --wb-c-conversation-icon-button--color-background-rest
|
|
818
|
+
* --wb-c-conversation-icon-button--color-foreground-rest
|
|
819
|
+
* --wb-c-conversation-icon-button--color-border-rest
|
|
820
|
+
* --wb-c-conversation-icon-button--color-background-hover
|
|
821
|
+
* --wb-c-conversation-icon-button--color-foreground-hover
|
|
822
|
+
* --wb-c-conversation-icon-button--color-border-hover
|
|
823
|
+
* --wb-c-conversation-icon-button--color-background-press
|
|
824
|
+
* --wb-c-conversation-icon-button--color-foreground-press
|
|
825
|
+
* --wb-c-conversation-icon-button--color-border-press
|
|
826
|
+
*
|
|
827
|
+
* disabled colours (kind):
|
|
828
|
+
* --wb-c-conversation-icon-button--color-background-disabled
|
|
829
|
+
* --wb-c-conversation-icon-button--color-foreground-disabled
|
|
830
|
+
* --wb-c-conversation-icon-button--color-border-disabled
|
|
831
|
+
*
|
|
832
|
+
* Axis classes assign colour tokens and nothing else (composed through the
|
|
833
|
+
* `style` prop — `processStyleList` routes class-name strings to `className`);
|
|
834
|
+
* `.button` and its states only read them. Declaring the axes first and
|
|
835
|
+
* `.button` last is therefore cascade-neutral. Colour is the one axis that
|
|
836
|
+
* isn't orthogonal — the semantic tokens are keyed by `kind` *and*
|
|
837
|
+
* `actionType` — so its six cells are compound selectors nested in their kind.
|
|
838
|
+
*
|
|
839
|
+
* Unlike `IconButton`, the border widths and radius don't vary by `kind`, so
|
|
840
|
+
* the structural tokens are assigned once on `.button` and the radius is
|
|
841
|
+
* written directly.
|
|
842
|
+
*
|
|
843
|
+
* Nesting is native CSS: every `&` is explicit and resolves to the flat
|
|
844
|
+
* selector it replaces, at the same specificity. State rules all sit at equal
|
|
845
|
+
* specificity, so source order decides — hover → active → focus → disabled, so
|
|
846
|
+
* focus survives hover/press and disabled resets everything. Disabled is the
|
|
847
|
+
* `[aria-disabled="true"]` attribute `icon-button-unstyled` sets, which keeps
|
|
848
|
+
* the element focusable. Tokens resolve against the per-theme `[data-wb-theme]`
|
|
849
|
+
* blocks, and the build wraps every rule in `@layer shared { … }`.
|
|
850
|
+
*//*
|
|
851
|
+
* Cross-package focus-visible mixin.
|
|
852
|
+
*
|
|
853
|
+
* Authors include the mixin via:
|
|
854
|
+
*
|
|
855
|
+
* @import "@khanacademy/wonder-blocks-styles/focus-styles.css";
|
|
856
|
+
*
|
|
857
|
+
* .my-component:focus-visible {
|
|
858
|
+
* @apply --wb-focus-visible;
|
|
859
|
+
* }
|
|
860
|
+
*
|
|
861
|
+
* postcss-import resolves the @import through the workspace and
|
|
862
|
+
* @csstools/postcss-mixins expands the @apply at build time
|
|
863
|
+
* (CSS Mixins Level 1 syntax — note the leading `--` on the name).
|
|
864
|
+
*//**
|
|
865
|
+
* Axis classes: the only rules that assign colour tokens.
|
|
866
|
+
*
|
|
867
|
+
* `kind` owns the disabled colours. The `kind × actionType` colour cells are
|
|
868
|
+
* nested inside the kind they belong to.
|
|
869
|
+
*/.wb-conversation-icon-button-primary-b6abbc31 {
|
|
870
|
+
--wb-c-conversation-icon-button--color-background-disabled: var(--wb-semanticColor-action-primary-disabled-background);
|
|
871
|
+
--wb-c-conversation-icon-button--color-foreground-disabled: var(--wb-semanticColor-action-primary-disabled-foreground);
|
|
872
|
+
--wb-c-conversation-icon-button--color-border-disabled: var(--wb-semanticColor-action-primary-disabled-border);
|
|
873
|
+
|
|
874
|
+
&.wb-conversation-icon-button-progressive-b6abbc31 {
|
|
875
|
+
--wb-c-conversation-icon-button--color-background-rest: var(--wb-semanticColor-action-primary-progressive-default-background);
|
|
876
|
+
--wb-c-conversation-icon-button--color-foreground-rest: var(--wb-semanticColor-action-primary-progressive-default-foreground);
|
|
877
|
+
--wb-c-conversation-icon-button--color-border-rest: var(--wb-semanticColor-action-primary-progressive-default-border);
|
|
878
|
+
--wb-c-conversation-icon-button--color-background-hover: var(--wb-semanticColor-action-primary-progressive-hover-background);
|
|
879
|
+
--wb-c-conversation-icon-button--color-foreground-hover: var(--wb-semanticColor-action-primary-progressive-hover-foreground);
|
|
880
|
+
--wb-c-conversation-icon-button--color-border-hover: var(--wb-semanticColor-action-primary-progressive-hover-border);
|
|
881
|
+
--wb-c-conversation-icon-button--color-background-press: var(--wb-semanticColor-action-primary-progressive-press-background);
|
|
882
|
+
--wb-c-conversation-icon-button--color-foreground-press: var(--wb-semanticColor-action-primary-progressive-press-foreground);
|
|
883
|
+
--wb-c-conversation-icon-button--color-border-press: var(--wb-semanticColor-action-primary-progressive-press-border);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
&.wb-conversation-icon-button-neutral-b6abbc31 {
|
|
887
|
+
--wb-c-conversation-icon-button--color-background-rest: var(--wb-semanticColor-action-primary-neutral-default-background);
|
|
888
|
+
--wb-c-conversation-icon-button--color-foreground-rest: var(--wb-semanticColor-action-primary-neutral-default-foreground);
|
|
889
|
+
--wb-c-conversation-icon-button--color-border-rest: var(--wb-semanticColor-action-primary-neutral-default-border);
|
|
890
|
+
--wb-c-conversation-icon-button--color-background-hover: var(--wb-semanticColor-action-primary-neutral-hover-background);
|
|
891
|
+
--wb-c-conversation-icon-button--color-foreground-hover: var(--wb-semanticColor-action-primary-neutral-hover-foreground);
|
|
892
|
+
--wb-c-conversation-icon-button--color-border-hover: var(--wb-semanticColor-action-primary-neutral-hover-border);
|
|
893
|
+
--wb-c-conversation-icon-button--color-background-press: var(--wb-semanticColor-action-primary-neutral-press-background);
|
|
894
|
+
--wb-c-conversation-icon-button--color-foreground-press: var(--wb-semanticColor-action-primary-neutral-press-foreground);
|
|
895
|
+
--wb-c-conversation-icon-button--color-border-press: var(--wb-semanticColor-action-primary-neutral-press-border);
|
|
896
|
+
}
|
|
897
|
+
}.wb-conversation-icon-button-secondary-b6abbc31 {
|
|
898
|
+
--wb-c-conversation-icon-button--color-background-disabled: var(--wb-semanticColor-action-secondary-disabled-background);
|
|
899
|
+
--wb-c-conversation-icon-button--color-foreground-disabled: var(--wb-semanticColor-action-secondary-disabled-foreground);
|
|
900
|
+
--wb-c-conversation-icon-button--color-border-disabled: var(--wb-semanticColor-action-secondary-disabled-border);
|
|
901
|
+
|
|
902
|
+
&.wb-conversation-icon-button-progressive-b6abbc31 {
|
|
903
|
+
--wb-c-conversation-icon-button--color-background-rest: var(--wb-semanticColor-action-secondary-progressive-default-background);
|
|
904
|
+
--wb-c-conversation-icon-button--color-foreground-rest: var(--wb-semanticColor-action-secondary-progressive-default-foreground);
|
|
905
|
+
--wb-c-conversation-icon-button--color-border-rest: var(--wb-semanticColor-action-secondary-progressive-default-border);
|
|
906
|
+
--wb-c-conversation-icon-button--color-background-hover: var(--wb-semanticColor-action-secondary-progressive-hover-background);
|
|
907
|
+
--wb-c-conversation-icon-button--color-foreground-hover: var(--wb-semanticColor-action-secondary-progressive-hover-foreground);
|
|
908
|
+
--wb-c-conversation-icon-button--color-border-hover: var(--wb-semanticColor-action-secondary-progressive-hover-border);
|
|
909
|
+
--wb-c-conversation-icon-button--color-background-press: var(--wb-semanticColor-action-secondary-progressive-press-background);
|
|
910
|
+
--wb-c-conversation-icon-button--color-foreground-press: var(--wb-semanticColor-action-secondary-progressive-press-foreground);
|
|
911
|
+
--wb-c-conversation-icon-button--color-border-press: var(--wb-semanticColor-action-secondary-progressive-press-border);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
&.wb-conversation-icon-button-neutral-b6abbc31 {
|
|
915
|
+
--wb-c-conversation-icon-button--color-background-rest: var(--wb-semanticColor-action-secondary-neutral-default-background);
|
|
916
|
+
--wb-c-conversation-icon-button--color-foreground-rest: var(--wb-semanticColor-action-secondary-neutral-default-foreground);
|
|
917
|
+
--wb-c-conversation-icon-button--color-border-rest: var(--wb-semanticColor-action-secondary-neutral-default-border);
|
|
918
|
+
--wb-c-conversation-icon-button--color-background-hover: var(--wb-semanticColor-action-secondary-neutral-hover-background);
|
|
919
|
+
--wb-c-conversation-icon-button--color-foreground-hover: var(--wb-semanticColor-action-secondary-neutral-hover-foreground);
|
|
920
|
+
--wb-c-conversation-icon-button--color-border-hover: var(--wb-semanticColor-action-secondary-neutral-hover-border);
|
|
921
|
+
--wb-c-conversation-icon-button--color-background-press: var(--wb-semanticColor-action-secondary-neutral-press-background);
|
|
922
|
+
--wb-c-conversation-icon-button--color-foreground-press: var(--wb-semanticColor-action-secondary-neutral-press-foreground);
|
|
923
|
+
--wb-c-conversation-icon-button--color-border-press: var(--wb-semanticColor-action-secondary-neutral-press-border);
|
|
924
|
+
}
|
|
925
|
+
}.wb-conversation-icon-button-tertiary-b6abbc31 {
|
|
926
|
+
--wb-c-conversation-icon-button--color-background-disabled: var(--wb-semanticColor-action-tertiary-disabled-background);
|
|
927
|
+
--wb-c-conversation-icon-button--color-foreground-disabled: var(--wb-semanticColor-action-tertiary-disabled-foreground);
|
|
928
|
+
--wb-c-conversation-icon-button--color-border-disabled: var(--wb-semanticColor-action-tertiary-disabled-border);
|
|
929
|
+
|
|
930
|
+
&.wb-conversation-icon-button-progressive-b6abbc31 {
|
|
931
|
+
--wb-c-conversation-icon-button--color-background-rest: var(--wb-semanticColor-action-tertiary-progressive-default-background);
|
|
932
|
+
--wb-c-conversation-icon-button--color-foreground-rest: var(--wb-semanticColor-action-tertiary-progressive-default-foreground);
|
|
933
|
+
--wb-c-conversation-icon-button--color-border-rest: var(--wb-semanticColor-action-tertiary-progressive-default-border);
|
|
934
|
+
--wb-c-conversation-icon-button--color-background-hover: var(--wb-semanticColor-action-tertiary-progressive-hover-background);
|
|
935
|
+
--wb-c-conversation-icon-button--color-foreground-hover: var(--wb-semanticColor-action-tertiary-progressive-hover-foreground);
|
|
936
|
+
--wb-c-conversation-icon-button--color-border-hover: var(--wb-semanticColor-action-tertiary-progressive-hover-border);
|
|
937
|
+
--wb-c-conversation-icon-button--color-background-press: var(--wb-semanticColor-action-tertiary-progressive-press-background);
|
|
938
|
+
--wb-c-conversation-icon-button--color-foreground-press: var(--wb-semanticColor-action-tertiary-progressive-press-foreground);
|
|
939
|
+
--wb-c-conversation-icon-button--color-border-press: var(--wb-semanticColor-action-tertiary-progressive-press-border);
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
&.wb-conversation-icon-button-neutral-b6abbc31 {
|
|
943
|
+
--wb-c-conversation-icon-button--color-background-rest: var(--wb-semanticColor-action-tertiary-neutral-default-background);
|
|
944
|
+
--wb-c-conversation-icon-button--color-foreground-rest: var(--wb-semanticColor-action-tertiary-neutral-default-foreground);
|
|
945
|
+
--wb-c-conversation-icon-button--color-border-rest: var(--wb-semanticColor-action-tertiary-neutral-default-border);
|
|
946
|
+
--wb-c-conversation-icon-button--color-background-hover: var(--wb-semanticColor-action-tertiary-neutral-hover-background);
|
|
947
|
+
--wb-c-conversation-icon-button--color-foreground-hover: var(--wb-semanticColor-action-tertiary-neutral-hover-foreground);
|
|
948
|
+
--wb-c-conversation-icon-button--color-border-hover: var(--wb-semanticColor-action-tertiary-neutral-hover-border);
|
|
949
|
+
--wb-c-conversation-icon-button--color-background-press: var(--wb-semanticColor-action-tertiary-neutral-press-background);
|
|
950
|
+
--wb-c-conversation-icon-button--color-foreground-press: var(--wb-semanticColor-action-tertiary-neutral-press-foreground);
|
|
951
|
+
--wb-c-conversation-icon-button--color-border-press: var(--wb-semanticColor-action-tertiary-neutral-press-border);
|
|
952
|
+
}
|
|
953
|
+
}/**
|
|
954
|
+
* The button itself. Assigns the structural tokens and reads the colour tokens
|
|
955
|
+
* the axis classes assign — never assigns those.
|
|
956
|
+
*/.wb-conversation-icon-button-button-b6abbc31 {
|
|
957
|
+
--wb-c-conversation-icon-button--padding: var(--wb-sizing-size_100);
|
|
958
|
+
--wb-c-conversation-icon-button--border-width-rest: var(
|
|
959
|
+
--wb-border-width-thin
|
|
960
|
+
);
|
|
961
|
+
--wb-c-conversation-icon-button--border-width-press: var(
|
|
962
|
+
--wb-border-width-medium
|
|
963
|
+
);
|
|
964
|
+
|
|
965
|
+
/* Layout */
|
|
966
|
+
border-radius: var(--wb-border-radius-radius_full);
|
|
967
|
+
padding: var(--wb-c-conversation-icon-button--padding);
|
|
968
|
+
place-self: center;
|
|
969
|
+
|
|
970
|
+
/* Theming, driven by the colour tokens set by the variant classes. */
|
|
971
|
+
border-style: solid;
|
|
972
|
+
border-width: var(--wb-c-conversation-icon-button--border-width-rest);
|
|
973
|
+
border-color: var(--wb-c-conversation-icon-button--color-border-rest);
|
|
974
|
+
background: var(--wb-c-conversation-icon-button--color-background-rest);
|
|
975
|
+
color: var(--wb-c-conversation-icon-button--color-foreground-rest);
|
|
976
|
+
|
|
977
|
+
/* The hover border width matches the rest width, so the box doesn't
|
|
978
|
+
* shift. */
|
|
979
|
+
&:hover {
|
|
980
|
+
background: var(--wb-c-conversation-icon-button--color-background-hover);
|
|
981
|
+
border-width: var(--wb-c-conversation-icon-button--border-width-rest);
|
|
982
|
+
border-color: var(--wb-c-conversation-icon-button--color-border-hover);
|
|
983
|
+
color: var(--wb-c-conversation-icon-button--color-foreground-hover);
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/* Prevents hover from being "sticky" on touch devices (e.g. mobile). */
|
|
987
|
+
@media not (hover: hover) {
|
|
988
|
+
&:hover {
|
|
989
|
+
background-color: var(--wb-semanticColor-core-transparent);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* Active / pressed. `:active` covers pointer presses, `.pressed` covers
|
|
995
|
+
* programmatic (keyboard) presses from `IconButtonUnstyled`'s `onPress`.
|
|
996
|
+
*
|
|
997
|
+
* The press border is one step thicker than the rest border, so the
|
|
998
|
+
* padding shrinks by the same 1px to keep the outer size stable.
|
|
999
|
+
*/
|
|
1000
|
+
&:active,
|
|
1001
|
+
&.wb-conversation-icon-button-pressed-b6abbc31 {
|
|
1002
|
+
background: var(--wb-c-conversation-icon-button--color-background-press);
|
|
1003
|
+
border-width: var(--wb-c-conversation-icon-button--border-width-press);
|
|
1004
|
+
border-color: var(--wb-c-conversation-icon-button--color-border-press);
|
|
1005
|
+
color: var(--wb-c-conversation-icon-button--color-foreground-press);
|
|
1006
|
+
padding: calc(var(--wb-c-conversation-icon-button--padding) - 1px);
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* Focus. Declared after hover / active, which sit at the same specificity,
|
|
1011
|
+
* so the ring keeps priority when a button is focused *and* hovered or
|
|
1012
|
+
* pressed.
|
|
1013
|
+
*/
|
|
1014
|
+
&:focus-visible {
|
|
1015
|
+
box-shadow: 0 0 0 var(--wb-border-width-medium)
|
|
1016
|
+
var(--wb-semanticColor-focus-inner);
|
|
1017
|
+
outline: var(--wb-border-width-medium) solid
|
|
1018
|
+
var(--wb-semanticColor-focus-outer);
|
|
1019
|
+
outline-offset: var(--wb-border-width-medium);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/** Disabled. Declared last so it resets hover / active / focus. */
|
|
1023
|
+
&[aria-disabled="true"] {
|
|
1024
|
+
cursor: not-allowed;
|
|
1025
|
+
padding: var(--wb-c-conversation-icon-button--padding);
|
|
1026
|
+
|
|
1027
|
+
/* Longhands, not the `border` shorthand, so `.button`'s `solid` style
|
|
1028
|
+
* survives. */
|
|
1029
|
+
border-width: var(--wb-c-conversation-icon-button--border-width-rest);
|
|
1030
|
+
border-color: var(--wb-c-conversation-icon-button--color-border-disabled);
|
|
1031
|
+
background: var(--wb-c-conversation-icon-button--color-background-disabled);
|
|
1032
|
+
color: var(--wb-c-conversation-icon-button--color-foreground-disabled);
|
|
1033
|
+
|
|
1034
|
+
/* Reset hover / active back to the rest state. */
|
|
1035
|
+
&:hover,
|
|
1036
|
+
&:active {
|
|
1037
|
+
padding: var(--wb-c-conversation-icon-button--padding);
|
|
1038
|
+
border-width: var(
|
|
1039
|
+
--wb-c-conversation-icon-button--border-width-rest
|
|
1040
|
+
);
|
|
1041
|
+
border-color: var(
|
|
1042
|
+
--wb-c-conversation-icon-button--color-border-disabled
|
|
1043
|
+
);
|
|
1044
|
+
background: var(
|
|
1045
|
+
--wb-c-conversation-icon-button--color-background-disabled
|
|
1046
|
+
);
|
|
1047
|
+
color: var(--wb-c-conversation-icon-button--color-foreground-disabled);
|
|
1048
|
+
outline: none;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* A disabled button still gets the focus ring. Spelled out separately
|
|
1053
|
+
* because the `:hover` reset above outranks `.button:focus-visible`.
|
|
1054
|
+
*/
|
|
1055
|
+
&:focus-visible {
|
|
1056
|
+
box-shadow: 0 0 0 var(--wb-border-width-medium)
|
|
1057
|
+
var(--wb-semanticColor-focus-inner);
|
|
1058
|
+
outline: var(--wb-border-width-medium) solid
|
|
1059
|
+
var(--wb-semanticColor-focus-outer);
|
|
1060
|
+
outline-offset: var(--wb-border-width-medium);
|
|
1061
|
+
|
|
1062
|
+
padding: var(--wb-c-conversation-icon-button--padding);
|
|
1063
|
+
border-width: var(
|
|
1064
|
+
--wb-c-conversation-icon-button--border-width-rest
|
|
1065
|
+
);
|
|
1066
|
+
border-color: var(
|
|
1067
|
+
--wb-c-conversation-icon-button--color-border-disabled
|
|
1068
|
+
);
|
|
1069
|
+
background: var(
|
|
1070
|
+
--wb-c-conversation-icon-button--color-background-disabled
|
|
1071
|
+
);
|
|
1072
|
+
color: var(--wb-c-conversation-icon-button--color-foreground-disabled);
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Icon. Only applied to custom (non-Phosphor) icons — a string `icon`
|
|
1078
|
+
* renders a `PhosphorIcon` at `size="small"`, which sizes itself.
|
|
1079
|
+
*
|
|
1080
|
+
* Qualified with `.button` on purpose: `PhosphorIcon` ships single-class
|
|
1081
|
+
* rules in the same `@layer shared`, so at equal specificity stylesheet
|
|
1082
|
+
* load order would decide the winner.
|
|
1083
|
+
*/
|
|
1084
|
+
& .wb-conversation-icon-button-icon-b6abbc31 {
|
|
1085
|
+
inline-size: var(--wb-sizing-size_160);
|
|
1086
|
+
block-size: var(--wb-sizing-size_160);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
@layer shared {/**
|
|
1092
|
+
* NodeIconButton styles
|
|
1093
|
+
*
|
|
1094
|
+
* Every value a variant axis can change goes through a
|
|
1095
|
+
* `--wb-c-node-icon-button--*` custom property ("component token"), as
|
|
1096
|
+
* `IconButton` does. Unlike the rest of the button family these names are
|
|
1097
|
+
* public: the `tokens` prop maps its camelCase keys onto them (via
|
|
1098
|
+
* `mapTokensToVariables`), so they keep their existing spelling.
|
|
1099
|
+
*
|
|
1100
|
+
* --wb-c-node-icon-button--box-padding (size)
|
|
1101
|
+
* --wb-c-node-icon-button--box-shadow-y-rest (size)
|
|
1102
|
+
* --wb-c-node-icon-button--box-shadow-y-hover (size)
|
|
1103
|
+
* --wb-c-node-icon-button--box-shadow-y-press (size)
|
|
1104
|
+
* --wb-c-node-icon-button--icon-size (size)
|
|
1105
|
+
* --wb-c-node-icon-button--box-foreground (actionType)
|
|
1106
|
+
* --wb-c-node-icon-button--box-background (actionType)
|
|
1107
|
+
* --wb-c-node-icon-button--box-shadow-color (actionType)
|
|
1108
|
+
*
|
|
1109
|
+
* Axis classes assign tokens and nothing else (composed through the `style`
|
|
1110
|
+
* prop — `processStyleList` routes class-name strings to `className`);
|
|
1111
|
+
* `.button` and its states only read them. Declaring the axes first and
|
|
1112
|
+
* `.button` last is therefore cascade-neutral. The two axes are fully
|
|
1113
|
+
* orthogonal — `size` owns the geometry, `actionType` the colours — so there
|
|
1114
|
+
* is no compound colour matrix. The component always applies exactly one class
|
|
1115
|
+
* per axis, so `.large` and `.notStarted` *are* the defaults.
|
|
1116
|
+
*
|
|
1117
|
+
* The `tokens` prop still overrides any of these: `mapTokensToVariables` emits
|
|
1118
|
+
* unlayered declarations, which win over these `@layer shared` rules
|
|
1119
|
+
* regardless of specificity.
|
|
1120
|
+
*
|
|
1121
|
+
* Nesting is native CSS: every `&` is explicit and resolves to the flat
|
|
1122
|
+
* selector it replaces, at the same specificity. The box state rules sit at
|
|
1123
|
+
* equal specificity, so source order decides — hover → active → disabled →
|
|
1124
|
+
* focus, so press survives hover, disabled resets both, and the focus ring
|
|
1125
|
+
* survives all of them. The one deliberate exception is the disabled
|
|
1126
|
+
* pointer-press rule; see the comment on it. Disabled is the
|
|
1127
|
+
* `[aria-disabled="true"]` attribute `icon-button-unstyled` sets, which keeps
|
|
1128
|
+
* the element focusable. Tokens resolve against the per-theme
|
|
1129
|
+
* `[data-wb-theme]` blocks, and the build wraps every rule in
|
|
1130
|
+
* `@layer shared { … }`.
|
|
1131
|
+
*//*
|
|
1132
|
+
* Cross-package focus-visible mixin.
|
|
1133
|
+
*
|
|
1134
|
+
* Authors include the mixin via:
|
|
1135
|
+
*
|
|
1136
|
+
* @import "@khanacademy/wonder-blocks-styles/focus-styles.css";
|
|
1137
|
+
*
|
|
1138
|
+
* .my-component:focus-visible {
|
|
1139
|
+
* @apply --wb-focus-visible;
|
|
1140
|
+
* }
|
|
1141
|
+
*
|
|
1142
|
+
* postcss-import resolves the @import through the workspace and
|
|
1143
|
+
* @csstools/postcss-mixins expands the @apply at build time
|
|
1144
|
+
* (CSS Mixins Level 1 syntax — note the leading `--` on the name).
|
|
1145
|
+
*//**
|
|
1146
|
+
* Axis classes: the only rules that assign component tokens.
|
|
1147
|
+
*
|
|
1148
|
+
* `size` owns the box geometry and the icon size.
|
|
1149
|
+
*
|
|
1150
|
+
* NOTE: The shadow depths use px units to prevent a bug in Safari where the
|
|
1151
|
+
* shadow animation flickers when using rem units.
|
|
1152
|
+
*/.wb-node-icon-button-large-624b30d4 {
|
|
1153
|
+
--wb-c-node-icon-button--icon-size: var(--wb-sizing-size_480);
|
|
1154
|
+
--wb-c-node-icon-button--box-padding: var(--wb-sizing-size_100);
|
|
1155
|
+
--wb-c-node-icon-button--box-shadow-y-rest: 6px;
|
|
1156
|
+
--wb-c-node-icon-button--box-shadow-y-hover: 8px;
|
|
1157
|
+
--wb-c-node-icon-button--box-shadow-y-press: var(--wb-sizing-size_0);
|
|
1158
|
+
}.wb-node-icon-button-small-624b30d4 {
|
|
1159
|
+
--wb-c-node-icon-button--icon-size: var(--wb-sizing-size_240);
|
|
1160
|
+
--wb-c-node-icon-button--box-padding: var(--wb-sizing-size_0);
|
|
1161
|
+
--wb-c-node-icon-button--box-shadow-y-rest: 2px;
|
|
1162
|
+
--wb-c-node-icon-button--box-shadow-y-hover: 4px;
|
|
1163
|
+
--wb-c-node-icon-button--box-shadow-y-press: var(--wb-sizing-size_0);
|
|
1164
|
+
}/**
|
|
1165
|
+
* `actionType` owns the box colours.
|
|
1166
|
+
*/.wb-node-icon-button-notStarted-624b30d4 {
|
|
1167
|
+
--wb-c-node-icon-button--box-foreground: var(
|
|
1168
|
+
--wb-semanticColor-learning-foreground-progress-notStarted-strong
|
|
1169
|
+
);
|
|
1170
|
+
--wb-c-node-icon-button--box-background: var(
|
|
1171
|
+
--wb-semanticColor-learning-background-progress-notStarted-default
|
|
1172
|
+
);
|
|
1173
|
+
--wb-c-node-icon-button--box-shadow-color: var(
|
|
1174
|
+
--wb-semanticColor-learning-shadow-progress-notStarted-default
|
|
1175
|
+
);
|
|
1176
|
+
}.wb-node-icon-button-attempted-624b30d4 {
|
|
1177
|
+
--wb-c-node-icon-button--box-foreground: var(
|
|
1178
|
+
--wb-semanticColor-learning-foreground-progress-attempted-strong
|
|
1179
|
+
);
|
|
1180
|
+
--wb-c-node-icon-button--box-background: var(
|
|
1181
|
+
--wb-semanticColor-learning-background-progress-attempted-default
|
|
1182
|
+
);
|
|
1183
|
+
--wb-c-node-icon-button--box-shadow-color: var(
|
|
1184
|
+
--wb-semanticColor-learning-shadow-progress-attempted-default
|
|
1185
|
+
);
|
|
1186
|
+
}.wb-node-icon-button-complete-624b30d4 {
|
|
1187
|
+
--wb-c-node-icon-button--box-foreground: var(
|
|
1188
|
+
--wb-semanticColor-learning-foreground-progress-complete-strong
|
|
1189
|
+
);
|
|
1190
|
+
--wb-c-node-icon-button--box-background: var(
|
|
1191
|
+
--wb-semanticColor-learning-background-progress-complete-default
|
|
1192
|
+
);
|
|
1193
|
+
--wb-c-node-icon-button--box-shadow-color: var(
|
|
1194
|
+
--wb-semanticColor-learning-shadow-progress-complete-default
|
|
1195
|
+
);
|
|
1196
|
+
}/**
|
|
1197
|
+
* The button itself. Reads the tokens the axis classes assign — never assigns
|
|
1198
|
+
* them. Custom properties inherit, so the box and icon pick up whichever
|
|
1199
|
+
* variant classes the root carries (including any `tokens` prop overrides).
|
|
1200
|
+
*/.wb-node-icon-button-button-624b30d4 {
|
|
1201
|
+
/* Theming. Used for the focus ring. */
|
|
1202
|
+
border-radius: var(--wb-border-radius-radius_full);
|
|
1203
|
+
|
|
1204
|
+
/* Layout */
|
|
1205
|
+
flex-direction: column;
|
|
1206
|
+
gap: var(--wb-sizing-size_020);
|
|
1207
|
+
place-self: flex-start center;
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* The "chonky" box. Qualified with `.button` on purpose: `View`
|
|
1211
|
+
* (`.default`) ships single-class rules in the same `@layer shared` that
|
|
1212
|
+
* set some of the same properties, so at equal specificity stylesheet load
|
|
1213
|
+
* order would decide the winner.
|
|
1214
|
+
*/
|
|
1215
|
+
& .wb-node-icon-button-box-624b30d4 {
|
|
1216
|
+
/* Layout */
|
|
1217
|
+
border-radius: var(--wb-border-radius-radius_full);
|
|
1218
|
+
padding: var(--wb-c-node-icon-button--box-padding);
|
|
1219
|
+
inline-size: 100%;
|
|
1220
|
+
block-size: 100%;
|
|
1221
|
+
align-items: center;
|
|
1222
|
+
justify-content: center;
|
|
1223
|
+
|
|
1224
|
+
/* Theming */
|
|
1225
|
+
background: var(--wb-c-node-icon-button--box-background);
|
|
1226
|
+
color: var(--wb-c-node-icon-button--box-foreground);
|
|
1227
|
+
|
|
1228
|
+
/* Gives the button a "chonky" look and feel. */
|
|
1229
|
+
margin-block-end: var(--wb-c-node-icon-button--box-shadow-y-rest);
|
|
1230
|
+
box-shadow: 0 var(--wb-c-node-icon-button--box-shadow-y-rest) 0 0
|
|
1231
|
+
var(--wb-c-node-icon-button--box-shadow-color);
|
|
1232
|
+
|
|
1233
|
+
/* Motion. NOTE: We only want to transition the properties that are
|
|
1234
|
+
* being animated. */
|
|
1235
|
+
transition: 0.12s ease-out;
|
|
1236
|
+
transition-property: box-shadow, transform, margin-block-end;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
@media not (hover: hover) {
|
|
1240
|
+
& .wb-node-icon-button-box-624b30d4 {
|
|
1241
|
+
transition: none;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Hover. The box lifts by the difference between the hover and rest
|
|
1247
|
+
* shadow depths so its top edge stays put.
|
|
1248
|
+
*/
|
|
1249
|
+
&:hover .wb-node-icon-button-box-624b30d4 {
|
|
1250
|
+
box-shadow: 0 var(--wb-c-node-icon-button--box-shadow-y-hover) 0 0
|
|
1251
|
+
var(--wb-c-node-icon-button--box-shadow-color);
|
|
1252
|
+
transform: translateY(
|
|
1253
|
+
calc(
|
|
1254
|
+
(
|
|
1255
|
+
var(--wb-c-node-icon-button--box-shadow-y-hover) -
|
|
1256
|
+
var(--wb-c-node-icon-button--box-shadow-y-rest)
|
|
1257
|
+
) * -1
|
|
1258
|
+
)
|
|
1259
|
+
);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* Active / pressed. `:active` covers pointer presses, `.pressed` covers
|
|
1264
|
+
* programmatic (keyboard) presses from `IconButtonUnstyled`'s `onPress`.
|
|
1265
|
+
* The box drops by the rest shadow depth so it looks pushed flat against
|
|
1266
|
+
* the shadow.
|
|
1267
|
+
*/
|
|
1268
|
+
&:active .wb-node-icon-button-box-624b30d4,
|
|
1269
|
+
&.wb-node-icon-button-pressed-624b30d4 .wb-node-icon-button-box-624b30d4 {
|
|
1270
|
+
box-shadow: 0 var(--wb-c-node-icon-button--box-shadow-y-press) 0 0
|
|
1271
|
+
var(--wb-c-node-icon-button--box-shadow-color);
|
|
1272
|
+
transform: translateY(var(--wb-c-node-icon-button--box-shadow-y-rest));
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/** Disabled. Declared after hover / active so it resets them. */
|
|
1276
|
+
&[aria-disabled="true"] {
|
|
1277
|
+
cursor: not-allowed;
|
|
1278
|
+
outline: none;
|
|
1279
|
+
transform: none;
|
|
1280
|
+
|
|
1281
|
+
/* Only exist to outrank the hover / active rules above. */
|
|
1282
|
+
&:hover,
|
|
1283
|
+
&:active {
|
|
1284
|
+
outline: none;
|
|
1285
|
+
transform: none;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
& .wb-node-icon-button-box-624b30d4,
|
|
1289
|
+
&:hover .wb-node-icon-button-box-624b30d4 {
|
|
1290
|
+
background: var(
|
|
1291
|
+
--wb-semanticColor-chonky-disabled-background-primary
|
|
1292
|
+
);
|
|
1293
|
+
box-shadow: 0 var(--wb-c-node-icon-button--box-shadow-y-rest) 0 0
|
|
1294
|
+
var(--wb-semanticColor-chonky-disabled-shadow-primary);
|
|
1295
|
+
color: var(--wb-semanticColor-chonky-disabled-foreground-primary);
|
|
1296
|
+
transform: none;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Disabled + pointer-press. A disabled box deliberately still "drops"
|
|
1301
|
+
* when pressed with the pointer, keeping its disabled colours — the
|
|
1302
|
+
* previous implementation reset the box's hover state but not its
|
|
1303
|
+
* active state, and that is preserved on purpose rather than
|
|
1304
|
+
* harmonised with `ActivityIconButton` (which resets both).
|
|
1305
|
+
*
|
|
1306
|
+
* It has to be spelled out rather than just omitted from the reset
|
|
1307
|
+
* above: `.button:active .box` and the disabled `.box` rule sit at
|
|
1308
|
+
* equal specificity, so the later disabled rule would otherwise
|
|
1309
|
+
* flatten the box. One extra pseudo-class lets this win while leaving
|
|
1310
|
+
* the disabled background and foreground in place. The shadow uses the
|
|
1311
|
+
* `actionType` shadow colour, not the disabled one, as the previous
|
|
1312
|
+
* implementation did.
|
|
1313
|
+
*
|
|
1314
|
+
* Keyboard presses are unaffected: `node-icon-button` only applies
|
|
1315
|
+
* `.pressed` when the button is not disabled.
|
|
1316
|
+
*/
|
|
1317
|
+
&:active .wb-node-icon-button-box-624b30d4 {
|
|
1318
|
+
box-shadow: 0 var(--wb-c-node-icon-button--box-shadow-y-press) 0 0
|
|
1319
|
+
var(--wb-c-node-icon-button--box-shadow-color);
|
|
1320
|
+
transform: translateY(
|
|
1321
|
+
var(--wb-c-node-icon-button--box-shadow-y-rest)
|
|
1322
|
+
);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Focus. Declared last so the ring survives hover / press / disabled.
|
|
1328
|
+
*/
|
|
1329
|
+
&:focus-visible {
|
|
1330
|
+
box-shadow: 0 0 0 var(--wb-border-width-medium)
|
|
1331
|
+
var(--wb-semanticColor-focus-inner);
|
|
1332
|
+
outline: var(--wb-border-width-medium) solid
|
|
1333
|
+
var(--wb-semanticColor-focus-outer);
|
|
1334
|
+
outline-offset: var(--wb-border-width-medium);
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* A disabled button still gets the focus ring. Spelled out separately
|
|
1339
|
+
* because the disabled `:hover` reset above outranks
|
|
1340
|
+
* `.button:focus-visible`.
|
|
1341
|
+
*/
|
|
1342
|
+
&[aria-disabled="true"]:focus-visible {
|
|
1343
|
+
box-shadow: 0 0 0 var(--wb-border-width-medium)
|
|
1344
|
+
var(--wb-semanticColor-focus-inner);
|
|
1345
|
+
outline: var(--wb-border-width-medium) solid
|
|
1346
|
+
var(--wb-semanticColor-focus-outer);
|
|
1347
|
+
outline-offset: var(--wb-border-width-medium);
|
|
1348
|
+
|
|
1349
|
+
transform: none;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
/**
|
|
1353
|
+
* Icon. Qualified with `.button` for the same reason as `.box`:
|
|
1354
|
+
* `PhosphorIcon` ships single-class rules in the same `@layer shared`.
|
|
1355
|
+
*/
|
|
1356
|
+
& .wb-node-icon-button-icon-624b30d4 {
|
|
1357
|
+
inline-size: var(--wb-c-node-icon-button--icon-size);
|
|
1358
|
+
block-size: var(--wb-c-node-icon-button--icon-size);
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
/*# sourceMappingURL=index.css.map */
|