@khanacademy/wonder-blocks-dropdown 11.0.4 → 12.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @khanacademy/wonder-blocks-dropdown@11.0.4 build:css /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-dropdown
2
+ > @khanacademy/wonder-blocks-dropdown@12.0.0 build:css /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-dropdown
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-dropdown/dist/css
package/CHANGELOG.md CHANGED
@@ -1,5 +1,190 @@
1
1
  # @khanacademy/wonder-blocks-dropdown
2
2
 
3
+ ## 12.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
+ - be9c311: Migrate `Combobox` (with its live region and selected-items group) from
32
+ Aphrodite to CSS Modules (WB-2485, CSS Modules Phase 5 / Wave H). The public
33
+ API is unchanged, including the `style` override on the input, which still
34
+ wins over the built-in styles.
35
+
36
+ - `combobox.module.css`, `combobox-multiple-selection.module.css` and
37
+ `combobox-live-region.module.css` replace the Aphrodite stylesheets. They
38
+ read the same `--wb-*` / `--wb-c-dropdown-*` variables, so theming is
39
+ unchanged.
40
+ - Combobox overrides `View`, `TextField`, `IconButton`, `Button`, `Listbox`
41
+ and `Cell` classes in the same `@layer shared`. Its rules nest under marker
42
+ classes (`.root` on the wrapper and the selected-items group, `.menu` on the
43
+ portaled listbox) so they win on specificity rather than stylesheet load
44
+ order. The input and toggle-button state resets repeat the `TextField` /
45
+ `IconButton` state selectors under the marker, so they keep beating them as
46
+ the unlayered Aphrodite styles did.
47
+ - The package now ships its bundled stylesheet at `dist/index.css`, which the
48
+ JS entry imports automatically.
49
+
50
+ - b8a32c8: Migrate `DropdownCore` (the menu shared by `SingleSelect`, `MultiSelect` and
51
+ `ActionMenu`) and `ActionMenu` from Aphrodite to CSS Modules (WB-2485, CSS
52
+ Modules Phase 5 / Wave H). The public API is unchanged, including the `style` and
53
+ `dropdownStyle` overrides, which still win over the built-in styles.
54
+
55
+ - `dropdown-core.module.css` and `action-menu.module.css` replace the
56
+ Aphrodite stylesheets. They read the same `--wb-*` / `--wb-c-dropdown-*`
57
+ variables, so theming is unchanged.
58
+ - The menu container is portaled, so its rules nest under a `.menu` marker
59
+ class on the container. They override `View`, `BodyText` and `SearchField`
60
+ classes in the same `@layer shared` on specificity, not stylesheet load
61
+ order.
62
+ - Removed unused Aphrodite styles (`srOnly` in DropdownCore; `caret` and
63
+ `opener` in ActionMenu).
64
+ - The package now ships its bundled stylesheet at `dist/index.css`, which the
65
+ JS entry imports automatically.
66
+
67
+ - 14e0d32: Migrate `OptionItem`, `ActionItem`, `SeparatorItem` and `Listbox` (plus the
68
+ internal `Check` / `Checkbox` indicators) from Aphrodite to CSS Modules
69
+ (WB-2485, CSS Modules Phase 5 / Wave H). The public API is unchanged: same
70
+ props, same DOM structure, same `style` overrides.
71
+
72
+ - Each component gets its own module (`option-item`, `check`, `checkbox`,
73
+ `action-item`, `separator-item` and `listbox` `.module.css`), replacing
74
+ the Aphrodite stylesheets. They read the same `--wb-*` / `--wb-c-dropdown-*` variables, so
75
+ theming (default / thunderblocks / syl-dark) is unchanged.
76
+ - The items override `Cell`, `View`, `PhosphorIcon` and `BodyText` classes,
77
+ which live in the same `@layer shared`. Every rule is nested under a `.root`
78
+ marker class so it wins on specificity, not on stylesheet load order. The
79
+ Aphrodite version was unlayered `!important` and beat every Cell state rule,
80
+ so the item focus/press rules also cover Cell's `:focus-visible:active`
81
+ combination.
82
+ - The dropdown theme adds `item.sizing.height` (40px), exposed to CSS as
83
+ `--wb-c-dropdown-item-sizing-height`. `ActionItem` reads its minimum height
84
+ from it, and `DROPDOWN_ITEM_HEIGHT` in JS comes from the same value, so the
85
+ two can't drift apart.
86
+ - The package now ships its bundled stylesheet at `dist/index.css`, which the
87
+ JS entry imports automatically.
88
+ - **Behavior change:** a consumer `style` passed to `Listbox` that sets `color`
89
+ now also applies when the listbox is disabled. Before, the disabled colour
90
+ won. Consumer overrides are unlayered and now outrank the component's
91
+ layered state styles for the same property.
92
+
93
+ - d5316c4: Migrate `SelectOpener` (the default `SingleSelect` / `MultiSelect` opener) and
94
+ `CustomOpener` from Aphrodite to CSS Modules (WB-2485, CSS Modules Phase 5 /
95
+ Wave H). The public API is unchanged.
96
+
97
+ - `select-opener.module.css` and `custom-opener.module.css` replace the
98
+ Aphrodite stylesheets. They read the same `--wb-*` / `--wb-c-dropdown-*`
99
+ variables, so theming is unchanged. Focus rings use the shared
100
+ `--wb-focus-visible` mixin.
101
+ - The opener's modifier classes are declared in the old style-array order, so
102
+ every combination of disabled / readOnly / error / placeholder / pressed
103
+ resolves as before.
104
+ - The package now ships its bundled stylesheet at `dist/index.css`, which the
105
+ JS entry imports automatically. It's also exported as the
106
+ `@khanacademy/wonder-blocks-dropdown/css` subpath, and `sideEffects` is set
107
+ so bundlers keep the side-effect import.
108
+ - Note for apps with global button CSS: Aphrodite emitted the opener styles
109
+ unlayered and with `!important`, whereas the CSS Modules build emits them in
110
+ `@layer shared`. Unlayered page CSS that targets `button` or
111
+ `[type="button"]` (e.g. Tailwind v3 preflight, normalize.css, legacy
112
+ `button {}` rules) now wins over `SelectOpener` and `CustomOpener` styles
113
+ such as border, background, padding and color, regardless of specificity.
114
+ Scope that CSS or move it into a cascade layer.
115
+ - **Behavior change:** if a `CustomOpener` consumer's `styles.root` sets
116
+ `outline` or `box-shadow` at rest, that value now also applies while the
117
+ opener is focused, replacing the built-in focus ring. Before, the built-in
118
+ `:focus-visible` ring won. Consumer styles are unlayered and now outrank the
119
+ component's layered state styles for the same property. Consumers that want
120
+ a custom resting `box-shadow` and the WB focus ring should set the ring on
121
+ their own `:focus-visible`.
122
+
123
+ ### Patch Changes
124
+
125
+ - 9652f57: Load each package's CSS after the CSS of the Wonder Blocks packages it depends
126
+ on. The published JS imported its own `index.css` before its dependencies, so
127
+ bundlers emitted, for example, Button's CSS before Typography's. Both sit in
128
+ `@layer shared` with single-class selectors, so the later `BodyText` rule won and
129
+ Button labels lost their own `font-weight`, `line-height` and `font-size`. The CSS
130
+ import now comes after the dependency imports, matching the source order that
131
+ Storybook already uses.
132
+ - aa5a8e1: Drop `aphrodite` from `peerDependencies`. These packages no longer import it
133
+ since their move to CSS Modules. Aphrodite styles passed through `style` props
134
+ still work: `@khanacademy/wonder-blocks-core`, which processes them, keeps
135
+ `aphrodite` as a peer dependency.
136
+ - 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`.
137
+ - 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.
138
+ - b9156f8: Declare `@khanacademy/wonder-blocks-button` as a dependency. `ActionMenu`'s
139
+ opener and `Combobox`'s selected items import `Button`, but the package
140
+ didn't list it, so the build bundled a private copy of `Button` (its JS and,
141
+ since Button's move to CSS Modules, its stylesheet) into the dropdown dist.
142
+ `Button` is now imported from the shared package instead.
143
+ - Updated dependencies [0c6d97d]
144
+ - Updated dependencies [185dbbc]
145
+ - Updated dependencies [0b6c478]
146
+ - Updated dependencies [26cbb7b]
147
+ - Updated dependencies [126a604]
148
+ - Updated dependencies [9652f57]
149
+ - Updated dependencies [aa5a8e1]
150
+ - Updated dependencies [f52e4cd]
151
+ - Updated dependencies [f52e4cd]
152
+ - Updated dependencies [f52e4cd]
153
+ - Updated dependencies [647e025]
154
+ - Updated dependencies [b66b7b7]
155
+ - Updated dependencies [bfd43de]
156
+ - Updated dependencies [e5b3a5e]
157
+ - Updated dependencies [b43cd7b]
158
+ - Updated dependencies [3e08381]
159
+ - Updated dependencies [dbb8f0f]
160
+ - Updated dependencies [7afdf5c]
161
+ - Updated dependencies [378e580]
162
+ - Updated dependencies [64734d2]
163
+ - Updated dependencies [6eb8e6d]
164
+ - Updated dependencies [958a36b]
165
+ - Updated dependencies [ea22448]
166
+ - Updated dependencies [82ae405]
167
+ - Updated dependencies [ad52f4b]
168
+ - Updated dependencies [9c09ca7]
169
+ - Updated dependencies [a1002be]
170
+ - Updated dependencies [e4f0a12]
171
+ - Updated dependencies [e4f0a12]
172
+ - Updated dependencies [415b002]
173
+ - Updated dependencies [44dac93]
174
+ - @khanacademy/wonder-blocks-tokens@18.3.0
175
+ - @khanacademy/wonder-blocks-modal@9.0.0
176
+ - @khanacademy/wonder-blocks-core@13.0.0
177
+ - @khanacademy/wonder-blocks-cell@7.0.0
178
+ - @khanacademy/wonder-blocks-clickable@9.0.0
179
+ - @khanacademy/wonder-blocks-button@12.0.0
180
+ - @khanacademy/wonder-blocks-form@8.0.0
181
+ - @khanacademy/wonder-blocks-icon-button@13.0.0
182
+ - @khanacademy/wonder-blocks-icon@7.0.0
183
+ - @khanacademy/wonder-blocks-search-field@6.0.0
184
+ - @khanacademy/wonder-blocks-typography@6.0.0
185
+ - @khanacademy/wonder-blocks-styles@1.0.0
186
+ - @khanacademy/wonder-blocks-announcer@1.1.3
187
+
3
188
  ## 11.0.4
4
189
 
5
190
  ### Patch Changes
package/dist/css/vars.css CHANGED
@@ -12,7 +12,8 @@
12
12
  --wb-c-dropdown-item-layout-padding-block: var(--wb-sizing-size_100);
13
13
  --wb-c-dropdown-item-layout-padding-inlineStart: var(--wb-sizing-size_080);
14
14
  --wb-c-dropdown-item-layout-padding-inlineEnd: var(--wb-sizing-size_160);
15
- --wb-c-dropdown-item-font-weight: var(--wb-font-weight-regular);}
15
+ --wb-c-dropdown-item-font-weight: var(--wb-font-weight-regular);
16
+ --wb-c-dropdown-item-sizing-height: 40px;}
16
17
 
17
18
  [data-wb-theme='syl-dark'] {--wb-c-dropdown-listbox-border-radius: var(--wb-border-radius-radius_080);
18
19
  --wb-c-dropdown-listbox-layout-padding-inline: var(--wb-sizing-size_080);
@@ -28,7 +29,8 @@
28
29
  --wb-c-dropdown-item-layout-padding-block: var(--wb-sizing-size_120);
29
30
  --wb-c-dropdown-item-layout-padding-inlineStart: var(--wb-sizing-size_120);
30
31
  --wb-c-dropdown-item-layout-padding-inlineEnd: var(--wb-sizing-size_120);
31
- --wb-c-dropdown-item-font-weight: var(--wb-font-weight-semi);}
32
+ --wb-c-dropdown-item-font-weight: var(--wb-font-weight-semi);
33
+ --wb-c-dropdown-item-sizing-height: 40px;}
32
34
 
33
35
  [data-wb-theme='thunderblocks'] {--wb-c-dropdown-listbox-border-radius: var(--wb-border-radius-radius_080);
34
36
  --wb-c-dropdown-listbox-layout-padding-inline: var(--wb-sizing-size_080);
@@ -44,4 +46,5 @@
44
46
  --wb-c-dropdown-item-layout-padding-block: var(--wb-sizing-size_120);
45
47
  --wb-c-dropdown-item-layout-padding-inlineStart: var(--wb-sizing-size_120);
46
48
  --wb-c-dropdown-item-layout-padding-inlineEnd: var(--wb-sizing-size_120);
47
- --wb-c-dropdown-item-font-weight: var(--wb-font-weight-semi);}
49
+ --wb-c-dropdown-item-font-weight: var(--wb-font-weight-semi);
50
+ --wb-c-dropdown-item-sizing-height: 40px;}