@khanacademy/wonder-blocks-accordion 2.0.1 → 3.0.1
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/CHANGELOG.md +27 -0
- package/dist/es/index.js +7 -5
- package/dist/index.js +5 -4
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-accordion
|
|
2
2
|
|
|
3
|
+
## 3.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [d23c9c5f]
|
|
8
|
+
- @khanacademy/wonder-blocks-core@11.0.0
|
|
9
|
+
- @khanacademy/wonder-blocks-clickable@5.0.3
|
|
10
|
+
- @khanacademy/wonder-blocks-icon@5.0.3
|
|
11
|
+
- @khanacademy/wonder-blocks-typography@3.0.3
|
|
12
|
+
|
|
13
|
+
## 3.0.0
|
|
14
|
+
|
|
15
|
+
### Major Changes
|
|
16
|
+
|
|
17
|
+
- 56d961f1: - Migrate Wonder Blocks components off old id providers and onto new `Id` component
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- b6009b77: Deprecate the ID provider and unique ID utilities
|
|
22
|
+
- Updated dependencies [b6009b77]
|
|
23
|
+
- Updated dependencies [897686bc]
|
|
24
|
+
- Updated dependencies [56d961f1]
|
|
25
|
+
- @khanacademy/wonder-blocks-core@10.0.0
|
|
26
|
+
- @khanacademy/wonder-blocks-clickable@5.0.2
|
|
27
|
+
- @khanacademy/wonder-blocks-icon@5.0.2
|
|
28
|
+
- @khanacademy/wonder-blocks-typography@3.0.2
|
|
29
|
+
|
|
3
30
|
## 2.0.1
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useId } from 'react';
|
|
2
3
|
import { StyleSheet } from 'aphrodite';
|
|
3
|
-
import { addStyle, View
|
|
4
|
+
import { addStyle, View } from '@khanacademy/wonder-blocks-core';
|
|
4
5
|
import * as tokens from '@khanacademy/wonder-blocks-tokens';
|
|
5
6
|
import { HeadingSmall, Body } from '@khanacademy/wonder-blocks-typography';
|
|
6
7
|
import caretDown from '@phosphor-icons/core/bold/caret-down-bold.svg';
|
|
@@ -316,10 +317,11 @@ const AccordionSection = React.forwardRef(function AccordionSection(props, ref)
|
|
|
316
317
|
ariaProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
317
318
|
const [internalExpanded, setInternalExpanded] = React.useState(expanded != null ? expanded : false);
|
|
318
319
|
const controlledMode = expanded !== undefined && onToggle;
|
|
319
|
-
const
|
|
320
|
-
const sectionId = id != null ? id :
|
|
321
|
-
const
|
|
322
|
-
const
|
|
320
|
+
const uniqueSectionId = useId();
|
|
321
|
+
const sectionId = id != null ? id : uniqueSectionId;
|
|
322
|
+
const uniqueHeaderId = useId();
|
|
323
|
+
const headerId = id ? `${id}-header` : uniqueHeaderId;
|
|
324
|
+
const sectionContentUniqueId = useId();
|
|
323
325
|
const sectionStyles = _generateStyles(cornerKind, isFirstSection, isLastSection);
|
|
324
326
|
const handleClick = () => {
|
|
325
327
|
if (controlledMode) {
|
package/dist/index.js
CHANGED
|
@@ -345,10 +345,11 @@ const AccordionSection = React__namespace.forwardRef(function AccordionSection(p
|
|
|
345
345
|
ariaProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
346
346
|
const [internalExpanded, setInternalExpanded] = React__namespace.useState(expanded != null ? expanded : false);
|
|
347
347
|
const controlledMode = expanded !== undefined && onToggle;
|
|
348
|
-
const
|
|
349
|
-
const sectionId = id != null ? id :
|
|
350
|
-
const
|
|
351
|
-
const
|
|
348
|
+
const uniqueSectionId = React.useId();
|
|
349
|
+
const sectionId = id != null ? id : uniqueSectionId;
|
|
350
|
+
const uniqueHeaderId = React.useId();
|
|
351
|
+
const headerId = id ? `${id}-header` : uniqueHeaderId;
|
|
352
|
+
const sectionContentUniqueId = React.useId();
|
|
352
353
|
const sectionStyles = _generateStyles(cornerKind, isFirstSection, isLastSection);
|
|
353
354
|
const handleClick = () => {
|
|
354
355
|
if (controlledMode) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-accordion",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Accordion components for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@khanacademy/wonder-blocks-clickable": "^5.0.
|
|
20
|
-
"@khanacademy/wonder-blocks-core": "^
|
|
21
|
-
"@khanacademy/wonder-blocks-icon": "^5.0.
|
|
19
|
+
"@khanacademy/wonder-blocks-clickable": "^5.0.3",
|
|
20
|
+
"@khanacademy/wonder-blocks-core": "^11.0.0",
|
|
21
|
+
"@khanacademy/wonder-blocks-icon": "^5.0.3",
|
|
22
22
|
"@khanacademy/wonder-blocks-tokens": "^3.0.0",
|
|
23
|
-
"@khanacademy/wonder-blocks-typography": "^3.0.
|
|
23
|
+
"@khanacademy/wonder-blocks-typography": "^3.0.3"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@phosphor-icons/core": "^2.0.2",
|