reshaped 2.10.17 → 2.10.19
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 -0
- package/bundle.css +1 -1
- package/bundle.js +6 -6
- package/components/Calendar/Calendar.module.css +1 -1
- package/components/Modal/Modal.js +11 -7
- package/components/Modal/tests/Modal.stories.js +15 -4
- package/components/PinField/PinFieldControlled.js +1 -3
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
.selection{table-layout:fixed;width:100%}.weekday{color:var(--rs-color-foreground-neutral-faded);font-weight:var(--rs-font-weight-regular);padding-bottom:var(--rs-unit-x2)}.row{border-top:2px solid transparent}[dir=rtl] .control{transform:scaleX(-1)}.cell-button{padding:var(--rs-unit-x2);text-align:center;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:border-radius,background-color,box-shadow}.cell-button[disabled],.cell-button[disabled]:hover{background-color:transparent!important;color:var(--rs-color-foreground-disabled)!important}.cell{padding:0}.cell .cell-button:hover,.cell--in-range .cell-button{background-color:rgba(var(--rs-color-rgb-background-neutral),32%)}.cell--active-end .cell-button,.cell--active-end:hover .cell-button,.cell--active-start .cell-button,.cell--active-start:hover .cell-button{background-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.cell--active-start .cell-button,.cell:first-child .cell-button{border-end-start-radius:var(--rs-unit-radius-small);border-start-start-radius:var(--rs-unit-radius-small)}.cell--active-end .cell-button,.cell--active-start+.cell:hover:not(.cell--in-range) .cell-button,.cell--in-range+.cell:hover:not(.cell--in-range) .cell-button,.cell:last-child .cell-button{border-end-end-radius:var(--rs-unit-radius-small);border-start-end-radius:var(--rs-unit-radius-small)}.cell--active-single+.cell:hover .cell-button,.cell:hover:not(.cell--in-range,.cell--in-range+.cell:hover,.cell--active-start+.cell:hover) .cell-button{border-radius:var(--rs-unit-radius-small)}
|
1
|
+
.selection{table-layout:fixed;width:100%}.weekday{color:var(--rs-color-foreground-neutral-faded);font-weight:var(--rs-font-weight-regular);padding-bottom:var(--rs-unit-x2)}.row{border-top:2px solid transparent}[dir=rtl] .control{transform:scaleX(-1)}.cell-button{padding:var(--rs-unit-x2);text-align:center;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:border-radius,background-color,box-shadow,color}.cell-button[disabled],.cell-button[disabled]:hover{background-color:transparent!important;color:var(--rs-color-foreground-disabled)!important}.cell{padding:0}.cell .cell-button:hover,.cell--in-range .cell-button{background-color:rgba(var(--rs-color-rgb-background-neutral),32%)}.cell--active-end .cell-button,.cell--active-end:hover .cell-button,.cell--active-start .cell-button,.cell--active-start:hover .cell-button{background-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.cell--active-start .cell-button,.cell:first-child .cell-button{border-end-start-radius:var(--rs-unit-radius-small);border-start-start-radius:var(--rs-unit-radius-small)}.cell--active-end .cell-button,.cell--active-start+.cell:hover:not(.cell--in-range) .cell-button,.cell--in-range+.cell:hover:not(.cell--in-range) .cell-button,.cell:last-child .cell-button{border-end-end-radius:var(--rs-unit-radius-small);border-start-end-radius:var(--rs-unit-radius-small)}.cell--active-single+.cell:hover .cell-button,.cell:hover:not(.cell--in-range,.cell--in-range+.cell:hover,.cell--active-start+.cell:hover) .cell-button{border-radius:var(--rs-unit-radius-small)}
|
@@ -67,13 +67,17 @@ const Modal = (props) => {
|
|
67
67
|
setDragDistance(0);
|
68
68
|
};
|
69
69
|
const handleDragStart = (e) => {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
70
|
+
let currentEl = e.target;
|
71
|
+
const rootEl = rootRef.current;
|
72
|
+
while (currentEl && (currentEl === rootEl || (rootEl === null || rootEl === void 0 ? void 0 : rootEl.contains(currentEl)))) {
|
73
|
+
// Prioritize scrolling over modal swiping
|
74
|
+
if (currentEl.scrollTop !== 0 || currentEl.scrollLeft !== 0)
|
75
|
+
return;
|
76
|
+
// Start dragging only when starting on static elements
|
77
|
+
if (currentEl.matches("input,textarea"))
|
78
|
+
return;
|
79
|
+
currentEl = currentEl ? currentEl.parentElement : null;
|
80
|
+
}
|
77
81
|
// Prevent the drag handling when browser tab swiping is triggering
|
78
82
|
if (clientPosition === "start" && e.targetTouches[0].clientX < DRAG_EDGE_BOUNDARY)
|
79
83
|
return;
|
@@ -108,7 +108,8 @@ export const overlay = () => (<Example>
|
|
108
108
|
</Example.Item>
|
109
109
|
</Example>);
|
110
110
|
export const edgeCases = () => {
|
111
|
-
const
|
111
|
+
const menuModalToggle = useToggle();
|
112
|
+
const scrollModalToggle = useToggle();
|
112
113
|
return (<Example>
|
113
114
|
<Example.Item title="trap focus works with custom children components">
|
114
115
|
<Demo title="Modal title">
|
@@ -118,6 +119,16 @@ export const edgeCases = () => {
|
|
118
119
|
</View>
|
119
120
|
</Demo>
|
120
121
|
</Example.Item>
|
122
|
+
<Example.Item title="scrollable area in modal ignores swipe-to-close">
|
123
|
+
<View gap={3} direction="row">
|
124
|
+
<Button onClick={scrollModalToggle.activate}>Open</Button>
|
125
|
+
<Modal active={scrollModalToggle.active} onClose={scrollModalToggle.deactivate} size="300px" position="bottom">
|
126
|
+
<View height="1000px" backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
|
127
|
+
Content
|
128
|
+
</View>
|
129
|
+
</Modal>
|
130
|
+
</View>
|
131
|
+
</Example.Item>
|
121
132
|
<Example.Item title={[
|
122
133
|
"trap focus works correctly when it was already trapped",
|
123
134
|
"focus return back to the dropdown trigger on modal close",
|
@@ -128,11 +139,11 @@ export const edgeCases = () => {
|
|
128
139
|
{(attributes) => <Button attributes={attributes}>Open menu</Button>}
|
129
140
|
</DropdownMenu.Trigger>
|
130
141
|
<DropdownMenu.Content>
|
131
|
-
<DropdownMenu.Item onClick={activate}>Open dialog</DropdownMenu.Item>
|
142
|
+
<DropdownMenu.Item onClick={menuModalToggle.activate}>Open dialog</DropdownMenu.Item>
|
132
143
|
<DropdownMenu.Item>Item 2</DropdownMenu.Item>
|
133
144
|
</DropdownMenu.Content>
|
134
145
|
</DropdownMenu>
|
135
|
-
<Modal active={active} onClose={deactivate}>
|
146
|
+
<Modal active={menuModalToggle.active} onClose={menuModalToggle.deactivate}>
|
136
147
|
<View gap={3}>
|
137
148
|
<DropdownMenu>
|
138
149
|
<DropdownMenu.Trigger>
|
@@ -143,7 +154,7 @@ export const edgeCases = () => {
|
|
143
154
|
<DropdownMenu.Item>Item 2</DropdownMenu.Item>
|
144
155
|
</DropdownMenu.Content>
|
145
156
|
</DropdownMenu>
|
146
|
-
<Button onClick={deactivate}>Close</Button>
|
157
|
+
<Button onClick={menuModalToggle.deactivate}>Close</Button>
|
147
158
|
</View>
|
148
159
|
</Modal>
|
149
160
|
</Example.Item>
|
@@ -156,8 +156,6 @@ const PinFieldControlled = (props) => {
|
|
156
156
|
},
|
157
157
|
}, children: value[i] && _jsx(Text, { variant: responsiveTextVariant, children: value[i] }) }, i));
|
158
158
|
}
|
159
|
-
return (_jsxs(View, { gap: 2, direction: "row", className: [s.root, className], attributes: attributes, children: [nodes, _jsx("input", Object.assign({}, inputAttributes, formControl.attributes, { type: "text",
|
160
|
-
// className={s.input}
|
161
|
-
onFocus: handleFocus, onBlur: handleBlur, onPaste: handlePaste, onInput: handleInput, value: value, name: name, maxLength: valueLength, ref: inputRef, autoComplete: (inputAttributes === null || inputAttributes === void 0 ? void 0 : inputAttributes.autoComplete) || "one-time-code", inputMode: charPattern === "numeric" ? "numeric" : undefined, pattern: `${pattern}{${valueLength}}` }))] }));
|
159
|
+
return (_jsxs(View, { gap: 2, direction: "row", className: [s.root, className], attributes: attributes, children: [nodes, _jsx("input", Object.assign({}, inputAttributes, formControl.attributes, { type: "text", className: s.input, onFocus: handleFocus, onBlur: handleBlur, onPaste: handlePaste, onInput: handleInput, value: value, name: name, maxLength: valueLength, ref: inputRef, autoComplete: (inputAttributes === null || inputAttributes === void 0 ? void 0 : inputAttributes.autoComplete) || "one-time-code", inputMode: charPattern === "numeric" ? "numeric" : undefined, pattern: `${pattern}{${valueLength}}` }))] }));
|
162
160
|
};
|
163
161
|
export default PinFieldControlled;
|
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.10.
|
4
|
+
"version": "2.10.19",
|
5
5
|
"license": "MIT",
|
6
6
|
"email": "hello@reshaped.so",
|
7
7
|
"homepage": "https://reshaped.so",
|