@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @khanacademy/wonder-blocks-icon-button@
|
|
2
|
+
> @khanacademy/wonder-blocks-icon-button@13.0.0 build:css /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-icon-button
|
|
3
3
|
> pnpm exec wonder-blocks-tokens .
|
|
4
4
|
|
|
5
5
|
CSS variables generated successfully in: /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-icon-button/dist/css
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,194 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-icon-button
|
|
2
2
|
|
|
3
|
+
## 13.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 647e025: **Breaking:** this package now styles its components with CSS Modules instead
|
|
8
|
+
of Aphrodite (WB-2120), and its components render unstyled unless its CSS is
|
|
9
|
+
loaded. To set it up:
|
|
10
|
+
|
|
11
|
+
- **Load the CSS.** The JS entry imports `dist/index.css` as a side effect, and
|
|
12
|
+
`"sideEffects": ["**/*.css"]` keeps bundlers from dropping it, so standard
|
|
13
|
+
webpack, Vite and Next.js setups need no change. Builds that can't process
|
|
14
|
+
CSS imports (some SSR or Jest setups) need a CSS loader or mock. The
|
|
15
|
+
stylesheet is also exported as `./css` for apps that load it explicitly.
|
|
16
|
+
- **Declare the cascade layer order** before any Wonder Blocks CSS:
|
|
17
|
+
`@layer reset, shared, shared.base, shared.reset, legacy;`. The component
|
|
18
|
+
rules live in `@layer shared`, so unlayered app CSS now beats them
|
|
19
|
+
regardless of specificity. Overrides passed through `style` / `styles`
|
|
20
|
+
props still go through Aphrodite and keep winning.
|
|
21
|
+
|
|
22
|
+
`filters`, `icon` and `tabs` also gain an `exports` map, so deep imports such
|
|
23
|
+
as `@khanacademy/wonder-blocks-icon/dist/...` no longer resolve. Import from
|
|
24
|
+
the package root or `./css` instead.
|
|
25
|
+
|
|
26
|
+
See the package's other changesets for the precedence edge cases that change
|
|
27
|
+
behavior, and the "Get Started / CSS setup" guide in Storybook.
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- b43cd7b: Migrate `ActivityIconButton` from Aphrodite to CSS Modules (WB-2329, CSS Modules
|
|
32
|
+
Phase 5 / Wave A). The public component API is unchanged — same props, same DOM
|
|
33
|
+
structure, and the same `styles.root` / `styles.box` / `styles.label` overrides
|
|
34
|
+
— so this is an internal styling refactor.
|
|
35
|
+
|
|
36
|
+
- The `actionType × kind` variant matrix now lives in
|
|
37
|
+
`activity-icon-button.module.css`, expressed with
|
|
38
|
+
`--wb-c-activity-icon-button--*` component tokens assigned by per-axis
|
|
39
|
+
classes, so each interactive state (hover / press / disabled / focus) is
|
|
40
|
+
declared once instead of once-per-cell. The per-variant `StyleSheet.create`
|
|
41
|
+
cache (`_generateStyles`) is gone. Theming is unchanged — the module
|
|
42
|
+
references the same `--wb-semanticColor-chonky-*` and
|
|
43
|
+
`--wb-c-icon-button-activityIconButton-label-color-progressive` variables
|
|
44
|
+
that switch on `[data-wb-theme]`.
|
|
45
|
+
- The "chonky" box's hover / press / disabled styling is now driven by
|
|
46
|
+
descendant selectors from the root element rather than by classes toggled in
|
|
47
|
+
JS. The box keeps its plain `chonky` class name in the DOM as a
|
|
48
|
+
consumer/test hook, it just no longer drives styling.
|
|
49
|
+
- A focused _and_ hovered disabled button now keeps the full global focus ring.
|
|
50
|
+
Previously the disabled hover reset stripped its outline (leaving only the
|
|
51
|
+
inner box-shadow), which was an artifact of Aphrodite's rule ordering rather
|
|
52
|
+
than an intentional design. `Button`, `ActivityButton`, `IconButton` and
|
|
53
|
+
`ConversationIconButton` already made the same call.
|
|
54
|
+
|
|
55
|
+
- 3e08381: Migrate `ConversationIconButton` from Aphrodite to CSS Modules (WB-2329, CSS
|
|
56
|
+
Modules Phase 5 / Wave A). The public component API is unchanged — same props,
|
|
57
|
+
same DOM structure, and the same `style` overrides — so this is an internal
|
|
58
|
+
styling refactor.
|
|
59
|
+
|
|
60
|
+
- The `kind × actionType` variant matrix now lives in
|
|
61
|
+
`conversation-icon-button.module.css`, expressed with
|
|
62
|
+
`--wb-c-conversation-icon-button--*` component tokens assigned by per-axis
|
|
63
|
+
classes, so each interactive state (hover / press / disabled / focus) is
|
|
64
|
+
declared once instead of once-per-cell. The per-variant `StyleSheet.create`
|
|
65
|
+
cache (`_generateStyles`) is gone. Theming is unchanged — the module
|
|
66
|
+
references the same `--wb-semanticColor-action-*` variables that switch on
|
|
67
|
+
`[data-wb-theme]`.
|
|
68
|
+
- The border widths and radius are assigned once on the base rule rather than
|
|
69
|
+
once per kind: the Aphrodite `theme` object spelled out all three kinds with
|
|
70
|
+
identical values. Its unused `root.sizing` entry is dropped.
|
|
71
|
+
- A focused _and_ hovered disabled button now keeps the full global focus ring.
|
|
72
|
+
Previously the disabled hover reset stripped its outline, which was an
|
|
73
|
+
artifact of Aphrodite's rule ordering rather than an intentional design.
|
|
74
|
+
`Button`, `ActivityButton` and `IconButton` already made the same call.
|
|
75
|
+
|
|
76
|
+
- 378e580: Migrate `IconButton` from Aphrodite to CSS Modules (WB-2329, CSS Modules Phase
|
|
77
|
+
5 / Wave A). The public component API is unchanged — same props, same DOM
|
|
78
|
+
structure, and the same `style` overrides — so this is an internal styling
|
|
79
|
+
refactor.
|
|
80
|
+
|
|
81
|
+
- The `kind × actionType × size` variant matrix is now expressed in
|
|
82
|
+
`icon-button.module.css` around a component-token surface: every value a
|
|
83
|
+
variant axis can change is a `--wb-c-icon-button--*` custom property, assigned
|
|
84
|
+
by one class per axis value (`.primary`, `.progressive`, `.medium`) and read by
|
|
85
|
+
the base and state rules, so each interactive state is declared once instead
|
|
86
|
+
of once-per-cell. The per-variant `StyleSheet.create` cache
|
|
87
|
+
(`_generateStyles`) is gone. Theming (default / thunderblocks / syl-dark) is
|
|
88
|
+
unchanged — the module references the same `--wb-c-icon-button-iconButton-*`
|
|
89
|
+
and `--wb-semanticColor-action-*` variables that switch on `[data-wb-theme]`.
|
|
90
|
+
- The icon is sized by a `--wb-c-icon-button--icon-size` component token rather
|
|
91
|
+
than an inline style read from the theme object in JS, so `IconChooser` no
|
|
92
|
+
longer imports the theme.
|
|
93
|
+
- `data-kind` is still set on the rendered element and remains available as a
|
|
94
|
+
consumer/test hook, but it no longer drives any styling.
|
|
95
|
+
- The shared element reset (`icon-button-unstyled`) also moves to a CSS Module
|
|
96
|
+
(`icon-button-unstyled.module.css`) rather than staying as unlayered
|
|
97
|
+
Aphrodite (which would otherwise override the layered focus ring and
|
|
98
|
+
borders). It is emitted into the nested layer `shared.reset`, so the
|
|
99
|
+
component styles — which sit directly in `shared` — always outrank it
|
|
100
|
+
regardless of the order the bundler emits the two stylesheets in.
|
|
101
|
+
- A focused _and_ hovered disabled `IconButton` now keeps the full global focus
|
|
102
|
+
ring. Previously the disabled hover reset stripped its outline, which was an
|
|
103
|
+
artifact of Aphrodite's rule ordering rather than an intentional design.
|
|
104
|
+
`Button` and `ActivityButton` already made the same call.
|
|
105
|
+
- The package now ships its bundled stylesheet at `dist/index.css` (imported
|
|
106
|
+
automatically as a side-effect of the JS entry) and exposes it explicitly via
|
|
107
|
+
the new `@khanacademy/wonder-blocks-icon-button/css` subpath. `sideEffects` is
|
|
108
|
+
set so bundlers keep the side-effect import. Standard webpack / Vite / Next.js
|
|
109
|
+
setups pick this up with no changes; SSR consumers that can't process CSS
|
|
110
|
+
imports may need a CSS loader / mock in their build.
|
|
111
|
+
- Note for consumers who override `IconButton` styles: Aphrodite emitted these
|
|
112
|
+
rules unlayered and with `!important`, whereas the CSS Modules build emits
|
|
113
|
+
them in `@layer shared`. Unlayered consumer CSS now wins over `IconButton`'s
|
|
114
|
+
own styles regardless of specificity, so overrides that previously needed
|
|
115
|
+
`!important` may no longer, and stylesheets that were previously losing to
|
|
116
|
+
`IconButton` may now start taking effect. Overrides passed through the `style`
|
|
117
|
+
prop are unaffected — those still route through Aphrodite and continue to win.
|
|
118
|
+
|
|
119
|
+
- 6eb8e6d: Migrate `NodeIconButton` from Aphrodite to CSS Modules (WB-2329, CSS Modules
|
|
120
|
+
Phase 5 / Wave A). This completes the `wonder-blocks-icon-button` package — it
|
|
121
|
+
now has zero `aphrodite` imports. The public component API is unchanged — same
|
|
122
|
+
props, same DOM structure, and the same `styles.root` / `styles.box` /
|
|
123
|
+
`styles.icon` and `tokens` overrides — so this is an internal styling refactor.
|
|
124
|
+
|
|
125
|
+
- `NodeIconButton` already had a `--wb-c-node-icon-button--*` component-token
|
|
126
|
+
surface (it's the component the convention was named after), so the migration
|
|
127
|
+
mostly moves that surface from JS objects (`DEFAULT_TOKENS` + `variants`) into
|
|
128
|
+
`node-icon-button.module.css` variant classes. The two axes are fully
|
|
129
|
+
orthogonal — `size` owns the geometry, `actionType` owns the colours — so
|
|
130
|
+
there's no compound colour matrix. Theming is unchanged.
|
|
131
|
+
- The `tokens` prop keeps working exactly as before: it still routes through
|
|
132
|
+
`mapTokensToVariables` and Aphrodite, whose unlayered declarations override
|
|
133
|
+
the `@layer shared` variant classes.
|
|
134
|
+
- `DEFAULT_TOKENS` is dropped. The component always applies exactly one size
|
|
135
|
+
class and one actionType class, and those duplicated the defaults verbatim.
|
|
136
|
+
- The "chonky" box's hover / press / disabled styling is now driven by
|
|
137
|
+
descendant selectors from the root element rather than by classes toggled in
|
|
138
|
+
JS. The box keeps its plain `chonky` class name in the DOM as a
|
|
139
|
+
consumer/test hook, it just no longer drives styling.
|
|
140
|
+
- A focused _and_ hovered disabled button now keeps the full global focus ring.
|
|
141
|
+
Previously the disabled hover reset stripped its outline, which was an
|
|
142
|
+
artifact of Aphrodite's rule ordering rather than an intentional design.
|
|
143
|
+
`Button`, `ActivityButton`, `IconButton` and `ConversationIconButton` already
|
|
144
|
+
made the same call.
|
|
145
|
+
- Pressing a disabled button with the pointer still applies the pressed "drop"
|
|
146
|
+
styling to the box, keeping its disabled colours. The Aphrodite version reset
|
|
147
|
+
`:hover` on the box but not `:active`, and that behaviour is deliberately
|
|
148
|
+
preserved rather than harmonised with `ActivityIconButton` (which resets
|
|
149
|
+
both).
|
|
150
|
+
|
|
151
|
+
### Patch Changes
|
|
152
|
+
|
|
153
|
+
- 9652f57: Load each package's CSS after the CSS of the Wonder Blocks packages it depends
|
|
154
|
+
on. The published JS imported its own `index.css` before its dependencies, so
|
|
155
|
+
bundlers emitted, for example, Button's CSS before Typography's. Both sit in
|
|
156
|
+
`@layer shared` with single-class selectors, so the later `BodyText` rule won and
|
|
157
|
+
Button labels lost their own `font-weight`, `line-height` and `font-size`. The CSS
|
|
158
|
+
import now comes after the dependency imports, matching the source order that
|
|
159
|
+
Storybook already uses.
|
|
160
|
+
- aa5a8e1: Drop `aphrodite` from `peerDependencies`. These packages no longer import it
|
|
161
|
+
since their move to CSS Modules. Aphrodite styles passed through `style` props
|
|
162
|
+
still work: `@khanacademy/wonder-blocks-core`, which processes them, keeps
|
|
163
|
+
`aphrodite` as a peer dependency.
|
|
164
|
+
- f52e4cd: List the `types` condition first in the `.` export of the package.json (where it wasn't already), so TypeScript picks it before `import`/`require`. Make the `./css` export conditional: `import` now resolves to `dist/es/index.css`, the copy the ESM entry already loads, so importing `./css` alongside the components no longer loads the CSS twice. `require` still resolves to `dist/index.css`.
|
|
165
|
+
- 9c09ca7: Fix Stylelint warnings: use the `border.width.thin` and `border.width.medium` tokens, the `semanticColor.core.transparent` token, and logical properties (`inline-size`/`block-size`) instead of raw values and physical properties, and document the intentional raw values. Rendering is unchanged; the hashed class names change.
|
|
166
|
+
- Updated dependencies [0c6d97d]
|
|
167
|
+
- Updated dependencies [185dbbc]
|
|
168
|
+
- Updated dependencies [0b6c478]
|
|
169
|
+
- Updated dependencies [126a604]
|
|
170
|
+
- Updated dependencies [9652f57]
|
|
171
|
+
- Updated dependencies [aa5a8e1]
|
|
172
|
+
- Updated dependencies [f52e4cd]
|
|
173
|
+
- Updated dependencies [f52e4cd]
|
|
174
|
+
- Updated dependencies [647e025]
|
|
175
|
+
- Updated dependencies [b66b7b7]
|
|
176
|
+
- Updated dependencies [dbb8f0f]
|
|
177
|
+
- Updated dependencies [ea22448]
|
|
178
|
+
- Updated dependencies [82ae405]
|
|
179
|
+
- Updated dependencies [ad52f4b]
|
|
180
|
+
- Updated dependencies [9c09ca7]
|
|
181
|
+
- Updated dependencies [a1002be]
|
|
182
|
+
- Updated dependencies [e4f0a12]
|
|
183
|
+
- Updated dependencies [415b002]
|
|
184
|
+
- Updated dependencies [44dac93]
|
|
185
|
+
- @khanacademy/wonder-blocks-tokens@18.3.0
|
|
186
|
+
- @khanacademy/wonder-blocks-core@13.0.0
|
|
187
|
+
- @khanacademy/wonder-blocks-clickable@9.0.0
|
|
188
|
+
- @khanacademy/wonder-blocks-icon@7.0.0
|
|
189
|
+
- @khanacademy/wonder-blocks-typography@6.0.0
|
|
190
|
+
- @khanacademy/wonder-blocks-styles@1.0.0
|
|
191
|
+
|
|
3
192
|
## 12.0.4
|
|
4
193
|
|
|
5
194
|
### Patch Changes
|