reshaped 2.11.0 → 2.11.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 +1 -36
- package/bundle.css +1 -1
- package/bundle.js +3 -3
- package/components/Actionable/Actionable.js +4 -4
- package/components/Actionable/tests/Actionable.stories.js +1 -1
- package/components/MenuItem/tests/MenuItem.stories.js +1 -1
- package/components/PinField/PinFieldControlled.js +2 -2
- package/components/PinField/tests/PinField.stories.js +2 -2
- package/components/_private/Expandable/Expandable.js +7 -3
- package/components/_private/Expandable/Expandable.module.css +1 -1
- package/package.json +1 -1
@@ -45,10 +45,10 @@ const Actionable = forwardRef((props, ref) => {
|
|
45
45
|
const isEnter = event.key === keys.ENTER;
|
46
46
|
if (!isSpace && !isEnter)
|
47
47
|
return;
|
48
|
-
if (
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
if (rootAttributes.role !== "button")
|
49
|
+
return;
|
50
|
+
event.preventDefault();
|
51
|
+
handlePress(event);
|
52
52
|
};
|
53
53
|
return (_jsx(TagName, Object.assign({ ref: ref }, rootAttributes, { className: rootClassNames, onClick: handlePress, onKeyDown: handleKeyDown, children: children })));
|
54
54
|
});
|
@@ -62,7 +62,7 @@ export const focusRing = () => (<Example>
|
|
62
62
|
</Example.Item>
|
63
63
|
</Example>);
|
64
64
|
export const edgeCases = () => (<Example>
|
65
|
-
<Example.Item title="
|
65
|
+
<Example.Item title="form submit">
|
66
66
|
<form onSubmit={(e) => {
|
67
67
|
e.preventDefault();
|
68
68
|
alert("Submitted");
|
@@ -14,7 +14,7 @@ export default {
|
|
14
14
|
};
|
15
15
|
export const size = () => (<Example>
|
16
16
|
<Example.Item title="size: small">
|
17
|
-
<MenuItem size="small" icon={IconZap}
|
17
|
+
<MenuItem size="small" icon={IconZap} onClick={() => { }}>
|
18
18
|
Menu item
|
19
19
|
</MenuItem>
|
20
20
|
</Example.Item>
|
@@ -57,8 +57,8 @@ const PinFieldControlled = (props) => {
|
|
57
57
|
el.selectionStart = nextSelectionStart;
|
58
58
|
el.selectionEnd = nextSelectionStart + 1;
|
59
59
|
}
|
60
|
-
setFocusedIndex(el.selectionStart);
|
61
|
-
}, []);
|
60
|
+
setFocusedIndex(Math.min(el.selectionStart, valueLength - 1));
|
61
|
+
}, [valueLength]);
|
62
62
|
/**
|
63
63
|
* Using onNextFrame here to wait for the native behavior first
|
64
64
|
*/
|
@@ -15,8 +15,8 @@ export const base = () => (<Example>
|
|
15
15
|
<PinField name="pin"/>
|
16
16
|
</Example.Item>
|
17
17
|
|
18
|
-
<Example.Item title="defaultValue:
|
19
|
-
<PinField name="pin2" defaultValue="
|
18
|
+
<Example.Item title="defaultValue: 1234">
|
19
|
+
<PinField name="pin2" defaultValue="1234"/>
|
20
20
|
</Example.Item>
|
21
21
|
|
22
22
|
<Example.Item title="value: 12">
|
@@ -7,17 +7,21 @@ import { onNextFrame } from "../../../utilities/animation.js";
|
|
7
7
|
const Expandable = (props) => {
|
8
8
|
const { children, active, attributes } = props;
|
9
9
|
const [animated, setAnimated] = React.useState(false);
|
10
|
-
const rootClassNames = classNames(s.root, active && s["--active"]);
|
10
|
+
const rootClassNames = classNames(s.root, active && animated && s["--active"], !active && !animated && s["--hidden"]);
|
11
11
|
const handleTransitionEnd = (e) => {
|
12
12
|
if (e.propertyName !== "height")
|
13
13
|
return;
|
14
|
+
if (active)
|
15
|
+
return;
|
14
16
|
onNextFrame(() => {
|
15
17
|
setAnimated(false);
|
16
18
|
});
|
17
19
|
};
|
18
20
|
React.useEffect(() => {
|
19
|
-
|
21
|
+
if (!active)
|
22
|
+
return;
|
23
|
+
setAnimated(active);
|
20
24
|
}, [active]);
|
21
|
-
return (_jsx("div", Object.assign({}, attributes, { className: rootClassNames, onTransitionEnd: handleTransitionEnd, role: "region", hidden: !active
|
25
|
+
return (_jsx("div", Object.assign({}, attributes, { className: rootClassNames, onTransitionEnd: handleTransitionEnd, role: "region", hidden: !active, children: _jsx("div", { className: s.inner, children: children }) })));
|
22
26
|
};
|
23
27
|
export default Expandable;
|
@@ -1 +1 @@
|
|
1
|
-
.root{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--rs-duration-slow) var(--rs-easing-standard)}.--active{grid-template-rows:1fr}.inner{overflow:hidden}
|
1
|
+
.root{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--rs-duration-slow) var(--rs-easing-standard)}.--active{grid-template-rows:1fr}.--hidden{display:none}.inner{overflow:hidden}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "reshaped",
|
3
3
|
"description": "Professionally crafted design system in React & Figma for building products of any scale and complexity",
|
4
|
-
"version": "2.11.
|
4
|
+
"version": "2.11.1",
|
5
5
|
"license": "MIT",
|
6
6
|
"email": "hello@reshaped.so",
|
7
7
|
"homepage": "https://reshaped.so",
|