@khanacademy/wonder-blocks-modal 8.10.6 → 9.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 +129 -0
- package/dist/components/modal-header.d.ts +5 -0
- package/dist/es/index.css +618 -0
- package/dist/es/index.css.map +1 -0
- package/dist/es/index.js +50 -24
- package/dist/index.css +618 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +53 -27
- package/dist/util/small-screen-styles.d.ts +44 -0
- package/package.json +19 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @khanacademy/wonder-blocks-modal@
|
|
2
|
+
> @khanacademy/wonder-blocks-modal@9.0.0 build:css /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-modal
|
|
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-modal/dist/css
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,134 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-modal
|
|
2
2
|
|
|
3
|
+
## 9.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
|
+
- 64734d2: Migrate `wonder-blocks-modal` from Aphrodite to CSS Modules (WB-2333, CSS
|
|
32
|
+
Modules Phase 5 / Wave E). The public component API is unchanged: same props,
|
|
33
|
+
same DOM structure, and the same `style` / `styles` overrides.
|
|
34
|
+
|
|
35
|
+
- Styling now lives in a colocated `*.module.css` per component. Theming is
|
|
36
|
+
unchanged: the theme-dependent values still come from the `--wb-c-modal-*`
|
|
37
|
+
variables that `build:css` emits from `src/theme/*`.
|
|
38
|
+
- Every rule is nested under a `.root` marker class on its component's root
|
|
39
|
+
`View`, so the overrides of `View`, typography and `IconButton` styles win on
|
|
40
|
+
specificity rather than stylesheet load order.
|
|
41
|
+
- Styles that one component passes into another (`OnePaneDialog` →
|
|
42
|
+
`ModalDialog`, `ModalPanel` → `ModalContent`, `DrawerDialog` →
|
|
43
|
+
`FlexibleDialog`) live in the receiving component's module, so source order
|
|
44
|
+
reproduces the old Aphrodite merge order.
|
|
45
|
+
- `DrawerBackdrop`'s fade is now a CSS `@keyframes` animation. The `animated`
|
|
46
|
+
prop still gates it, and the drawer panel's slide animation is unchanged.
|
|
47
|
+
- The small-screen rules for elements a consumer can style (screens ≤ 767px
|
|
48
|
+
wide or ≤ 500px tall, and ≤ 681px for `DrawerDialog`) stay plain style
|
|
49
|
+
objects in `util/small-screen-styles.ts`. A consumer's `style` still goes
|
|
50
|
+
through Aphrodite, which would outrank any `@layer shared` rule, so this keeps
|
|
51
|
+
today's behavior: those rules still beat a consumer's base `width`, `height`,
|
|
52
|
+
`overflow`, `flex-direction`, `padding-inline` and min/max inline size on
|
|
53
|
+
small screens.
|
|
54
|
+
- **Behavior change:** a consumer override that sets one of those properties
|
|
55
|
+
inside its _own_ media query (as an Aphrodite `StyleSheet` style) no longer
|
|
56
|
+
wins on small screens; Modal's small-screen rule does. Plain-object
|
|
57
|
+
overrides are unaffected.
|
|
58
|
+
- The package now ships `dist/index.css` (auto side-effect import) and exposes
|
|
59
|
+
it via the new `@khanacademy/wonder-blocks-modal/css` subpath. `aphrodite` is
|
|
60
|
+
dropped from `peerDependencies`.
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- 0c6d97d: Add `breakpoint.width` CSS variables to `@khanacademy/wonder-blocks-tokens/styles.css`
|
|
65
|
+
(e.g. `--wb-breakpoint-width-mdMin: 682px`), defined once on `:root`.
|
|
66
|
+
`DrawerDialog` now uses `--wb-breakpoint-width-xsMax` / `--wb-breakpoint-width-smMax`
|
|
67
|
+
instead of hard-coded pixel widths.
|
|
68
|
+
- 9652f57: Load each package's CSS after the CSS of the Wonder Blocks packages it depends
|
|
69
|
+
on. The published JS imported its own `index.css` before its dependencies, so
|
|
70
|
+
bundlers emitted, for example, Button's CSS before Typography's. Both sit in
|
|
71
|
+
`@layer shared` with single-class selectors, so the later `BodyText` rule won and
|
|
72
|
+
Button labels lost their own `font-weight`, `line-height` and `font-size`. The CSS
|
|
73
|
+
import now comes after the dependency imports, matching the source order that
|
|
74
|
+
Storybook already uses.
|
|
75
|
+
- 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`.
|
|
76
|
+
- b66b7b7: Extend `processStyleList` to accept CSS Module class names (WB-2325, CSS
|
|
77
|
+
Modules Phase 1).
|
|
78
|
+
|
|
79
|
+
- `StyleType` is widened to also accept `string` (and nested arrays of
|
|
80
|
+
strings). Existing `CSSProperties` / falsy / nested-array values continue
|
|
81
|
+
to work unchanged.
|
|
82
|
+
- `processStyleList` now sorts each leaf into one of three buckets:
|
|
83
|
+
Aphrodite stylesheets (detected via the existing `_definition` symbol)
|
|
84
|
+
→ `css(...)`; plain strings → appended to `className`; plain objects
|
|
85
|
+
without `_definition` → forwarded as inline `style`. Non-string,
|
|
86
|
+
non-object truthy leaves are silently ignored.
|
|
87
|
+
|
|
88
|
+
The Cell / DatePicker / Modal patches are call-site fixes for latent
|
|
89
|
+
spread-of-`StyleType` bugs that the widened union now flags at type-check
|
|
90
|
+
time. Behavior is preserved or improved (no more accidental `{0: 'f',
|
|
91
|
+
1: 'o', ...}` results when a non-object slips into a spread).
|
|
92
|
+
|
|
93
|
+
- 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.
|
|
94
|
+
- Updated dependencies [0c6d97d]
|
|
95
|
+
- Updated dependencies [185dbbc]
|
|
96
|
+
- Updated dependencies [0b6c478]
|
|
97
|
+
- Updated dependencies [9652f57]
|
|
98
|
+
- Updated dependencies [aa5a8e1]
|
|
99
|
+
- Updated dependencies [f52e4cd]
|
|
100
|
+
- Updated dependencies [f52e4cd]
|
|
101
|
+
- Updated dependencies [647e025]
|
|
102
|
+
- Updated dependencies [b66b7b7]
|
|
103
|
+
- Updated dependencies [b43cd7b]
|
|
104
|
+
- Updated dependencies [3f9b565]
|
|
105
|
+
- Updated dependencies [3e08381]
|
|
106
|
+
- Updated dependencies [dbb8f0f]
|
|
107
|
+
- Updated dependencies [378e580]
|
|
108
|
+
- Updated dependencies [bcc10a1]
|
|
109
|
+
- Updated dependencies [6eb8e6d]
|
|
110
|
+
- Updated dependencies [ea22448]
|
|
111
|
+
- Updated dependencies [ad52f4b]
|
|
112
|
+
- Updated dependencies [9c09ca7]
|
|
113
|
+
- Updated dependencies [a1002be]
|
|
114
|
+
- Updated dependencies [e4f0a12]
|
|
115
|
+
- Updated dependencies [415b002]
|
|
116
|
+
- @khanacademy/wonder-blocks-tokens@18.3.0
|
|
117
|
+
- @khanacademy/wonder-blocks-core@13.0.0
|
|
118
|
+
- @khanacademy/wonder-blocks-breadcrumbs@4.0.0
|
|
119
|
+
- @khanacademy/wonder-blocks-icon-button@13.0.0
|
|
120
|
+
- @khanacademy/wonder-blocks-layout@5.0.0
|
|
121
|
+
- @khanacademy/wonder-blocks-typography@6.0.0
|
|
122
|
+
- @khanacademy/wonder-blocks-styles@1.0.0
|
|
123
|
+
- @khanacademy/wonder-blocks-announcer@1.1.3
|
|
124
|
+
|
|
125
|
+
## 8.10.7
|
|
126
|
+
|
|
127
|
+
### Patch Changes
|
|
128
|
+
|
|
129
|
+
- Updated dependencies [5d07224]
|
|
130
|
+
- @khanacademy/wonder-blocks-layout@4.0.0
|
|
131
|
+
|
|
3
132
|
## 8.10.6
|
|
4
133
|
|
|
5
134
|
### Patch Changes
|
|
@@ -78,3 +78,8 @@ type Props = Common | WithSubtitle | WithBreadcrumbs;
|
|
|
78
78
|
*/
|
|
79
79
|
export default function ModalHeader(props: Props): React.JSX.Element;
|
|
80
80
|
export {};
|
|
81
|
+
/**
|
|
82
|
+
* Media query for small screens.
|
|
83
|
+
* TODO(WB-1655): Change this to use the theme instead (inside themedStylesFn).
|
|
84
|
+
* e.g. `[theme.breakpoints.small]: {...}`
|
|
85
|
+
*/
|