reshaped 2.2.0 → 2.2.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 +4 -12
- package/LICENSE-SOURCE.md +40 -0
- package/LICENSE.md +21 -37
- package/bin/clean.sh +1 -0
- package/bin/release-source.sh +7 -0
- package/bundle.css +1 -1
- package/bundle.js +8 -8
- package/components/Actionable/Actionable.module.css +1 -1
- package/components/Checkbox/Checkbox.module.css +1 -1
- package/components/DropdownMenu/DropdownMenu.js +1 -1
- package/components/Radio/Radio.module.css +1 -1
- package/components/Select/Select.js +1 -1
- package/components/Slider/Slider.module.css +1 -1
- package/components/Switch/Switch.module.css +1 -1
- package/components/_private/Flyout/Flyout.types.d.ts +2 -0
- package/components/_private/Flyout/FlyoutContent.js +4 -2
- package/components/_private/Flyout/FlyoutControlled.js +8 -1
- package/config/next.d.ts +4 -5
- package/config/next.js +21 -7
- package/package.json +8 -8
- package/cli/theming/definitions/minimal.d.ts +0 -3
- package/cli/theming/definitions/minimal.js +0 -80
- package/styles/aspectRatio/index.test.d.ts +0 -1
- package/styles/aspectRatio/index.test.js +0 -24
- package/styles/bleed/index.test.d.ts +0 -1
- package/styles/bleed/index.test.js +0 -24
- package/styles/height/index.test.d.ts +0 -1
- package/styles/height/index.test.js +0 -27
- package/styles/inset/index.test.d.ts +0 -1
- package/styles/inset/index.test.js +0 -27
- package/styles/maxHeight/index.test.d.ts +0 -1
- package/styles/maxHeight/index.test.js +0 -27
- package/styles/maxWidth/index.test.d.ts +0 -1
- package/styles/maxWidth/index.test.js +0 -27
- package/styles/padding/index.test.d.ts +0 -1
- package/styles/padding/index.test.js +0 -24
- package/styles/position/index.test.d.ts +0 -1
- package/styles/position/index.test.js +0 -21
- package/styles/radius/index.test.d.ts +0 -1
- package/styles/radius/index.test.js +0 -24
- package/styles/width/index.test.d.ts +0 -1
- package/styles/width/index.test.js +0 -27
- package/themes/minimal/theme.css +0 -1
- package/utilities/testPresets.d.ts +0 -25
- package/utilities/testPresets.js +0 -76
- package/utilities/tests/Chain.test.d.ts +0 -1
- package/utilities/tests/Chain.test.js +0 -45
- /package/bin/{copy-release.sh → release-copy.sh} +0 -0
@@ -1 +1 @@
|
|
1
|
-
.root{-webkit-tap-highlight-color:
|
1
|
+
.root{-webkit-tap-highlight-color:transparent;background:none;border:0;color:inherit;display:inline-block;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-align:initial;text-decoration:none;vertical-align:top}.root:focus{outline:none;z-index:var(--rs-z-index-raised)}[role=button].root,button.root{cursor:pointer}.root.--disabled,.root[disabled]{cursor:not-allowed}.root.--disabled:active,.root[disabled]:active{transform:none}.--full-width{width:100%}[data-rs-keyboard] .root:focus{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--inset:focus{box-shadow:var(--rs-focus-inset-shadow)}[data-rs-keyboard] .root.--radius-inherit:focus{box-shadow:none}[data-rs-keyboard] .root.--radius-inherit:focus>*{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--radius-inherit.--inset:focus>*{box-shadow:var(--rs-focus-inset-shadow)}
|
@@ -1 +1 @@
|
|
1
|
-
.root{align-items:center;cursor:pointer;display:inline-flex;gap:var(--rs-unit-x2);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.icon{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:indeterminate+.decorator,.root.--error .input:indeterminate+.decorator,.root.--error:hover .input:indeterminate+.decorator,.root:hover .input:indeterminate+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary)}.input:indeterminate+.decorator:before,.root.--error .input:indeterminate+.decorator:before,.root.--error:hover .input:indeterminate+.decorator:before,.root:hover .input:indeterminate+.decorator:before{background:var(--rs-color-on-background-primary);border-radius:999px;content:"";height:2px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--rs-unit-x2)}.input:checked+.decorator,.root.--error .input:checked+.decorator,.root.--error:hover .input:checked+.decorator,.root:hover .input:checked+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.input:checked+.decorator .icon,.root.--error .input:checked+.decorator .icon,.root.--error:hover .input:checked+.decorator .icon,.root:hover .input:checked+.decorator .icon{opacity:1;transform:translate(-50%,-50%) scale(1)}.root.--error .decorator{border-color:var(--rs-color-border-critical)}.root.--disabled{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.root.--disabled .decorator,.root.--disabled .input:checked+.decorator,.root.--disabled:hover .decorator,.root.--disabled:hover .input:checked+.decorator{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled);color:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator,.root.--disabled .input:indeterminate+.decorator,.root.--disabled:hover .input:checked+.decorator,.root.--disabled:hover .input:indeterminate+.decorator{background:var(--rs-color-background-disabled);border-color:transparent}.root.--disabled .input:indeterminate+.decorator:before{background:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator:after{background:var(--rs-color-border-disabled)}
|
1
|
+
.root{-webkit-tap-highlight-color:transparent;align-items:center;cursor:pointer;display:inline-flex;gap:var(--rs-unit-x2);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.icon{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:indeterminate+.decorator,.root.--error .input:indeterminate+.decorator,.root.--error:hover .input:indeterminate+.decorator,.root:hover .input:indeterminate+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary)}.input:indeterminate+.decorator:before,.root.--error .input:indeterminate+.decorator:before,.root.--error:hover .input:indeterminate+.decorator:before,.root:hover .input:indeterminate+.decorator:before{background:var(--rs-color-on-background-primary);border-radius:999px;content:"";height:2px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--rs-unit-x2)}.input:checked+.decorator,.root.--error .input:checked+.decorator,.root.--error:hover .input:checked+.decorator,.root:hover .input:checked+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.input:checked+.decorator .icon,.root.--error .input:checked+.decorator .icon,.root.--error:hover .input:checked+.decorator .icon,.root:hover .input:checked+.decorator .icon{opacity:1;transform:translate(-50%,-50%) scale(1)}.root.--error .decorator{border-color:var(--rs-color-border-critical)}.root.--disabled{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.root.--disabled .decorator,.root.--disabled .input:checked+.decorator,.root.--disabled:hover .decorator,.root.--disabled:hover .input:checked+.decorator{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled);color:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator,.root.--disabled .input:indeterminate+.decorator,.root.--disabled:hover .input:checked+.decorator,.root.--disabled:hover .input:indeterminate+.decorator{background:var(--rs-color-background-disabled);border-color:transparent}.root.--disabled .input:indeterminate+.decorator:before{background:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator:after{background:var(--rs-color-border-disabled)}
|
@@ -57,7 +57,7 @@ const DropdownMenuItem = (props) => {
|
|
57
57
|
if (onClick)
|
58
58
|
onClick(e);
|
59
59
|
};
|
60
|
-
return (React.createElement(MenuItem, Object.assign({}, props, { roundedCorners: true, className: s.item, attributes: Object.assign(
|
60
|
+
return (React.createElement(MenuItem, Object.assign({}, props, { roundedCorners: true, className: s.item, attributes: Object.assign({ role: "menuitem" }, props.attributes), onClick: handleClick })));
|
61
61
|
};
|
62
62
|
const DropdownMenuSubMenu = (props) => {
|
63
63
|
const { children } = props;
|
@@ -1 +1 @@
|
|
1
|
-
.root{align-items:center;cursor:pointer;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .input:not(:checked)+.decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:50%;height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.decorator:after{background:var(--rs-color-on-background-primary);border-radius:50%;content:"";height:var(--rs-unit-x2);left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform;width:var(--rs-unit-x2)}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:checked+.decorator,.root.--error .input:checked+.decorator,.root.--error:hover .input:checked+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary);border-width:2px}.input:checked+.decorator:after,.root.--error .input:checked+.decorator:after,.root.--error:hover .input:checked+.decorator:after{opacity:1;transform:translate(-50%,-50%) scale(1)}.text{margin-inline-start:var(--rs-unit-x2)}.root.--error .decorator,.root.--error:hover .input+.decorator{border-color:var(--rs-color-border-critical)}.root.--disabled{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.root.--disabled .decorator,.root.--disabled .input:checked+.decorator,.root.--disabled:hover .input+.decorator{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled)}.root.--disabled .input:checked+.decorator{border-color:transparent}.root.--disabled .input:checked+.decorator:after{background:var(--rs-color-border-disabled)}
|
1
|
+
.root{-webkit-tap-highlight-color:transparent;align-items:center;cursor:pointer;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .input:not(:checked)+.decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:50%;height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.decorator:after{background:var(--rs-color-on-background-primary);border-radius:50%;content:"";height:var(--rs-unit-x2);left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform;width:var(--rs-unit-x2)}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:checked+.decorator,.root.--error .input:checked+.decorator,.root.--error:hover .input:checked+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary);border-width:2px}.input:checked+.decorator:after,.root.--error .input:checked+.decorator:after,.root.--error:hover .input:checked+.decorator:after{opacity:1;transform:translate(-50%,-50%) scale(1)}.text{margin-inline-start:var(--rs-unit-x2)}.root.--error .decorator,.root.--error:hover .input+.decorator{border-color:var(--rs-color-border-critical)}.root.--disabled{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.root.--disabled .decorator,.root.--disabled .input:checked+.decorator,.root.--disabled:hover .input+.decorator{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled)}.root.--disabled .input:checked+.decorator{border-color:transparent}.root.--disabled .input:checked+.decorator:after{background:var(--rs-color-border-disabled)}
|
@@ -52,7 +52,7 @@ const Select = (props) => {
|
|
52
52
|
children || (placeholder ? React.createElement(Text, { color: "neutral-faded" }, placeholder) : null)),
|
53
53
|
React.createElement("input", { type: "hidden", value: value, name: name }))),
|
54
54
|
React.createElement("div", { className: s.arrow },
|
55
|
-
React.createElement(Icon, { svg: IconArrow, color: "neutral-faded", size: responsivePropDependency(size, (size) => {
|
55
|
+
React.createElement(Icon, { svg: IconArrow, color: disabled ? "disabled" : "neutral-faded", size: responsivePropDependency(size, (size) => {
|
56
56
|
return size === "large" || size === "xlarge" ? 5 : 4;
|
57
57
|
}) }))));
|
58
58
|
};
|
@@ -1 +1 @@
|
|
1
|
-
.root{align-items:center;cursor:pointer;display:flex;height:var(--rs-unit-x4)}.bar,.root{position:relative}.bar{background:var(--rs-color-background-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-unit-x1);width:100%}.bar,.input{overflow:hidden}.input{height:1px;opacity:0;pointer-events:none;position:absolute;width:1px}.selection{background:var(--rs-color-background-primary);height:100%;position:absolute}.tooltip{background:var(--rs-color-background-elevation-overlay);border-radius:var(--rs-unit-radius-small);bottom:100%;box-shadow:var(--rs-shadow-overlay);color:var(--rs-color-foreground-neutral);left:50%;opacity:0;padding:calc(var(--rs-unit-x1) / 2) var(--rs-unit-x1);transform:translate(-50%);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform;-webkit-user-select:none;-moz-user-select:none;user-select:none}.thumb,.tooltip{position:absolute}.thumb{height:100%;width:0}.thumb:before{background:var(--rs-color-background-primary);border-radius:999px;box-shadow:0 0 0 2px var(--rs-color-background-elevation-base);box-sizing:border-box;height:var(--rs-unit-x4);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:box-shadow;width:var(--rs-unit-x4)}.thumb:after,.thumb:before{content:"";left:0;position:absolute;top:50%;transform:translate(-50%,-50%)}.thumb:after{cursor:grab;height:var(--rs-unit-x9);width:var(--rs-unit-x9)}.thumb:hover .tooltip{opacity:1;transform:translate(-50%,calc(var(--rs-unit-x1) * -1))}.input:focus+.thumb:after,.thumb--active:after{cursor:grabbing}.input:focus+.thumb:before,.thumb--active:before{box-shadow:0 0 0 1px var(--rs-color-background-elevation-base)}.input:focus+.thumb .tooltip,.thumb--active .tooltip{opacity:1;transform:translate(-50%,calc(var(--rs-unit-x1) * -1)) scale(1.1)!important}.--disabled{cursor:not-allowed}.--disabled .bar{background-color:var(--rs-color-background-disabled)}.--disabled .selection,.--disabled .thumb:before{background-color:var(--rs-color-foreground-disabled)}.--disabled .thumb:after{cursor:not-allowed}.--disabled .thumb:hover .tooltip{opacity:0}
|
1
|
+
.root{align-items:center;cursor:pointer;display:flex;height:var(--rs-unit-x4);-webkit-user-select:none;-moz-user-select:none;user-select:none}.bar,.root{position:relative}.bar{background:var(--rs-color-background-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-unit-x1);width:100%}.bar,.input{overflow:hidden}.input{height:1px;opacity:0;pointer-events:none;position:absolute;width:1px}.selection{background:var(--rs-color-background-primary);height:100%;position:absolute}.tooltip{background:var(--rs-color-background-elevation-overlay);border-radius:var(--rs-unit-radius-small);bottom:100%;box-shadow:var(--rs-shadow-overlay);color:var(--rs-color-foreground-neutral);left:50%;opacity:0;padding:calc(var(--rs-unit-x1) / 2) var(--rs-unit-x1);transform:translate(-50%);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform;-webkit-user-select:none;-moz-user-select:none;user-select:none}.thumb,.tooltip{position:absolute}.thumb{height:100%;width:0}.thumb:before{background:var(--rs-color-background-primary);border-radius:999px;box-shadow:0 0 0 2px var(--rs-color-background-elevation-base);box-sizing:border-box;height:var(--rs-unit-x4);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:box-shadow;width:var(--rs-unit-x4)}.thumb:after,.thumb:before{content:"";left:0;position:absolute;top:50%;transform:translate(-50%,-50%)}.thumb:after{cursor:grab;height:var(--rs-unit-x9);width:var(--rs-unit-x9)}.thumb:hover .tooltip{opacity:1;transform:translate(-50%,calc(var(--rs-unit-x1) * -1))}.input:focus+.thumb:after,.thumb--active:after{cursor:grabbing}.input:focus+.thumb:before,.thumb--active:before{box-shadow:0 0 0 1px var(--rs-color-background-elevation-base)}.input:focus+.thumb .tooltip,.thumb--active .tooltip{opacity:1;transform:translate(-50%,calc(var(--rs-unit-x1) * -1)) scale(1.1)!important}.--disabled{cursor:not-allowed}.--disabled .bar{background-color:var(--rs-color-background-disabled)}.--disabled .selection,.--disabled .thumb:before{background-color:var(--rs-color-foreground-disabled)}.--disabled .thumb:after{cursor:not-allowed}.--disabled .thumb:hover .tooltip{opacity:0}
|
@@ -1 +1 @@
|
|
1
|
-
.root{align-items:center;display:inline-flex;gap:var(--rs-unit-x2);position:relative;vertical-align:top}.input{border:0;height:1px;left:0;opacity:0;outline:none;position:absolute;top:0;width:1px}.input:checked+.area{background:var(--rs-color-background-primary);border-color:transparent}.input:checked+.area .thumb{transform:translateX(var(--rs-unit-x3))}[dir=rtl] .input:checked+.area .thumb{transform:translateX(calc(var(--rs-unit-x3) * -1))}[data-rs-keyboard] .input:focus+.area{box-shadow:var(--rs-focus-shadow)}.input[disabled]+.area{background:var(--rs-color-background-disabled);cursor:not-allowed}.input[disabled]+.area .thumb{opacity:.8}.input[disabled]:checked+.area{background:var(--rs-color-background-primary);opacity:.4}.input[disabled]:checked+.area .thumb{opacity:1}.area{align-items:center;background:var(--rs-color-background-neutral);border:2px solid transparent;border-radius:calc(var(--rs-unit-x1) * 5 / 2);box-sizing:border-box;cursor:pointer;display:flex;height:calc(var(--rs-unit-x1) * 5);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background,border;width:calc(var(--rs-unit-x1) * 8)}.thumb{background:var(--rs-color-white);border-radius:50%;box-shadow:var(--rs-shadow-raised);height:var(--rs-unit-x4);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:transform;width:var(--rs-unit-x4)}.root--size-small .area{height:calc(var(--rs-unit-x1) * 4);width:calc(var(--rs-unit-x1) * 6)}.root--size-small .thumb{height:var(--rs-unit-x3);width:var(--rs-unit-x3)}.root--size-small .input:checked+.area .thumb{transform:translateX(var(--rs-unit-x2))}[dir=rtl] .root--size-small .input:checked+.area .thumb{transform:translateX(calc(var(--rs-unit-x2) * -1))}.root--reversed{flex-direction:row-reverse}
|
1
|
+
.root{-webkit-tap-highlight-color:transparent;align-items:center;display:inline-flex;gap:var(--rs-unit-x2);position:relative;vertical-align:top}.input{border:0;height:1px;left:0;opacity:0;outline:none;position:absolute;top:0;width:1px}.input:checked+.area{background:var(--rs-color-background-primary);border-color:transparent}.input:checked+.area .thumb{transform:translateX(var(--rs-unit-x3))}[dir=rtl] .input:checked+.area .thumb{transform:translateX(calc(var(--rs-unit-x3) * -1))}[data-rs-keyboard] .input:focus+.area{box-shadow:var(--rs-focus-shadow)}.input[disabled]+.area{background:var(--rs-color-background-disabled);cursor:not-allowed}.input[disabled]+.area .thumb{opacity:.8}.input[disabled]:checked+.area{background:var(--rs-color-background-primary);opacity:.4}.input[disabled]:checked+.area .thumb{opacity:1}.area{align-items:center;background:var(--rs-color-background-neutral);border:2px solid transparent;border-radius:calc(var(--rs-unit-x1) * 5 / 2);box-sizing:border-box;cursor:pointer;display:flex;height:calc(var(--rs-unit-x1) * 5);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background,border;width:calc(var(--rs-unit-x1) * 8)}.thumb{background:var(--rs-color-white);border-radius:50%;box-shadow:var(--rs-shadow-raised);height:var(--rs-unit-x4);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:transform;width:var(--rs-unit-x4)}.root--size-small .area{height:calc(var(--rs-unit-x1) * 4);width:calc(var(--rs-unit-x1) * 6)}.root--size-small .thumb{height:var(--rs-unit-x3);width:var(--rs-unit-x3)}.root--size-small .input:checked+.area .thumb{transform:translateX(var(--rs-unit-x2))}[dir=rtl] .root--size-small .input:checked+.area .thumb{transform:translateX(calc(var(--rs-unit-x2) * -1))}.root--reversed{flex-direction:row-reverse}
|
@@ -73,5 +73,7 @@ export type ContextProps = {
|
|
73
73
|
handleClick: () => void;
|
74
74
|
handleBlur: (e: React.FocusEvent) => void;
|
75
75
|
handleFocus: () => void;
|
76
|
+
handleContentMouseDown: () => void;
|
77
|
+
handleContentMouseUp: () => void;
|
76
78
|
} & Pick<Props, "triggerType" | "contentClassName" | "contentAttributes" | "trapFocusMode" | "contentGap">;
|
77
79
|
export {};
|
@@ -7,7 +7,7 @@ import { useFlyoutContext } from "./Flyout.context.js";
|
|
7
7
|
import s from "./Flyout.module.css";
|
8
8
|
const FlyoutContent = (props) => {
|
9
9
|
const { children, className, attributes } = props;
|
10
|
-
const { flyout, id, flyoutElRef, handleTransitionEnd, triggerType, handleMouseEnter, handleMouseLeave, contentGap, contentClassName, contentAttributes, trapFocusMode, } = useFlyoutContext();
|
10
|
+
const { flyout, id, flyoutElRef, handleTransitionEnd, triggerType, handleMouseEnter, handleMouseLeave, handleContentMouseDown, handleContentMouseUp, contentGap, contentClassName, contentAttributes, trapFocusMode, } = useFlyoutContext();
|
11
11
|
const { styles, status, position } = flyout;
|
12
12
|
const [mounted, setMounted] = React.useState(false);
|
13
13
|
useIsomorphicLayoutEffect(() => {
|
@@ -33,7 +33,9 @@ const FlyoutContent = (props) => {
|
|
33
33
|
else if (trapFocusMode === "action-menu") {
|
34
34
|
role = "menu";
|
35
35
|
}
|
36
|
-
const content = (
|
36
|
+
const content = (
|
37
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
38
|
+
React.createElement("div", { className: contentClassNames, style: Object.assign(Object.assign({}, styles), { "--rs-flyout-gap": contentGap }), ref: flyoutElRef, onTransitionEnd: handleTransitionEnd, onMouseEnter: triggerType === "hover" ? handleMouseEnter : undefined, onMouseLeave: triggerType === "hover" ? handleMouseLeave : undefined, onMouseDown: handleContentMouseDown, onTouchStart: handleContentMouseDown, onMouseUp: handleContentMouseUp, onTouchEnd: handleContentMouseUp },
|
37
39
|
React.createElement("div", Object.assign({ role: role }, attributes, { id: id, "aria-modal": triggerType === "click", style: contentAttributes === null || contentAttributes === void 0 ? void 0 : contentAttributes.style, className: innerClassNames }), children)));
|
38
40
|
return React.createElement(Portal, null, content);
|
39
41
|
};
|
@@ -21,6 +21,7 @@ const FlyoutRoot = (props) => {
|
|
21
21
|
const timerRef = React.useRef();
|
22
22
|
const releaseFocusRef = React.useRef(null);
|
23
23
|
const lockedRef = React.useRef(false);
|
24
|
+
const lockedBlurEffects = React.useRef(false);
|
24
25
|
const shouldReturnFocusRef = React.useRef(true);
|
25
26
|
const flyout = useFlyout(triggerElRef, flyoutElRef, {
|
26
27
|
width,
|
@@ -70,7 +71,9 @@ const FlyoutRoot = (props) => {
|
|
70
71
|
// Empty flyouts don't move the focus so they have to be closed on blur
|
71
72
|
focusedContent ||
|
72
73
|
// Content menu keeps the focus on the original trigger so moving the focus away from it shouldn't close it
|
73
|
-
(triggerType === "hover" && trapFocusMode === "content-menu")
|
74
|
+
(triggerType === "hover" && trapFocusMode === "content-menu") ||
|
75
|
+
// Prevent from closing in case user interacts with items inside content
|
76
|
+
lockedBlurEffects.current) {
|
74
77
|
return;
|
75
78
|
}
|
76
79
|
handleClose();
|
@@ -94,6 +97,8 @@ const FlyoutRoot = (props) => {
|
|
94
97
|
handleClose();
|
95
98
|
}
|
96
99
|
}, [status, handleOpen, handleClose]);
|
100
|
+
const handleContentMouseDown = () => (lockedBlurEffects.current = true);
|
101
|
+
const handleContentMouseUp = () => (lockedBlurEffects.current = false);
|
97
102
|
/**
|
98
103
|
* Control the display based on the props
|
99
104
|
*/
|
@@ -204,6 +209,8 @@ const FlyoutRoot = (props) => {
|
|
204
209
|
handleMouseLeave,
|
205
210
|
handleTransitionEnd,
|
206
211
|
handleClick: handleTriggerClick,
|
212
|
+
handleContentMouseDown,
|
213
|
+
handleContentMouseUp,
|
207
214
|
triggerType,
|
208
215
|
trapFocusMode,
|
209
216
|
contentGap,
|
package/config/next.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
};
|
1
|
+
/**
|
2
|
+
* TODO: Work in progress
|
3
|
+
* Needs named exports support before we can use it
|
4
|
+
*/
|
package/config/next.js
CHANGED
@@ -1,8 +1,22 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
exports
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
/**
|
3
|
+
* TODO: Work in progress
|
4
|
+
* Needs named exports support before we can use it
|
5
|
+
*/
|
6
|
+
// export const config = {
|
7
|
+
// modularizeImports: {
|
8
|
+
// reshaped: {
|
9
|
+
// transform: {
|
10
|
+
// // Utilities
|
11
|
+
// // classNames: "reshaped/utilities/classNames",
|
12
|
+
// // Hooks
|
13
|
+
// useToast: "reshaped/components/Toast",
|
14
|
+
// useFormControl: "reshaped/components/FormControl",
|
15
|
+
// useTheme: "reshaped/components/Theme",
|
16
|
+
// "use.*": "reshaped/hooks/{{ member }}",
|
17
|
+
// // Components
|
18
|
+
// "*": "reshaped/components/{{ member }}",
|
19
|
+
// },
|
20
|
+
// },
|
21
|
+
// },
|
22
|
+
// };
|
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.2.
|
4
|
+
"version": "2.2.1",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
6
6
|
"email": "hello@reshaped.so",
|
7
7
|
"homepage": "https://reshaped.so",
|
@@ -65,8 +65,8 @@
|
|
65
65
|
"release:lib": "yarn build && yarn publish",
|
66
66
|
"release:beta": "yarn build && yarn publish --tag beta",
|
67
67
|
"release:test": "yarn build && yarn pack --filename reshaped-test.tgz",
|
68
|
-
"release:source": "
|
69
|
-
"release:copy": "sh ./bin/copy
|
68
|
+
"release:source": "sh ./bin/release-source.sh",
|
69
|
+
"release:copy": "sh ./bin/release-copy.sh",
|
70
70
|
"chromatic": "chromatic -b build:chromatic --project-token=$(cat .chromatic)",
|
71
71
|
"test:vrt": "yarn chromatic",
|
72
72
|
"test:unit": "jest --config tools/jest/jest.config.js",
|
@@ -80,9 +80,9 @@
|
|
80
80
|
],
|
81
81
|
"devDependencies": {
|
82
82
|
"@size-limit/preset-big-lib": "8.2.6",
|
83
|
-
"@storybook/addon-a11y": "7.
|
84
|
-
"@storybook/react": "7.
|
85
|
-
"@storybook/react-vite": "7.
|
83
|
+
"@storybook/addon-a11y": "7.2.1",
|
84
|
+
"@storybook/react": "7.2.1",
|
85
|
+
"@storybook/react-vite": "7.2.1",
|
86
86
|
"@testing-library/jest-dom": "5.17.0",
|
87
87
|
"@testing-library/react": "14.0.0",
|
88
88
|
"@testing-library/user-event": "14.4.3",
|
@@ -97,7 +97,7 @@
|
|
97
97
|
"chromatic": "6.20.0",
|
98
98
|
"eslint": "8.46.0",
|
99
99
|
"eslint-config-airbnb-typescript": "17.1.0",
|
100
|
-
"eslint-config-prettier": "
|
100
|
+
"eslint-config-prettier": "9.0.0",
|
101
101
|
"eslint-plugin-import": "2.28.0",
|
102
102
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
103
103
|
"eslint-plugin-prettier": "5.0.0",
|
@@ -118,7 +118,7 @@
|
|
118
118
|
"react-dom": "18.2.0",
|
119
119
|
"resolve-tspaths": "0.8.14",
|
120
120
|
"size-limit": "8.2.6",
|
121
|
-
"storybook": "7.
|
121
|
+
"storybook": "7.2.1",
|
122
122
|
"stylelint": "15.10.2",
|
123
123
|
"stylelint-config-prettier": "9.0.5",
|
124
124
|
"stylelint-config-standard": "34.0.0",
|
@@ -1,80 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const reshaped_1 = __importDefault(require("./reshaped"));
|
7
|
-
const theme = Object.assign(Object.assign({}, reshaped_1.default), { color: Object.assign(Object.assign({}, reshaped_1.default.color), { foregroundNeutral: {
|
8
|
-
hex: "#161a26",
|
9
|
-
hexDark: "#f2f3f5",
|
10
|
-
}, foregroundNeutralFaded: {
|
11
|
-
hex: "#717787",
|
12
|
-
hexDark: "#9f9e9e",
|
13
|
-
}, foregroundPrimary: {
|
14
|
-
hex: "#2383e2",
|
15
|
-
hexDark: "#5098ff",
|
16
|
-
}, foregroundDisabled: {
|
17
|
-
hex: "#d4d0d0",
|
18
|
-
hexDark: "#656565",
|
19
|
-
}, backgroundPrimary: {
|
20
|
-
hex: "#2383e2",
|
21
|
-
hexDark: "#4281DB",
|
22
|
-
}, backgroundPrimaryFaded: {
|
23
|
-
hex: "#e5f4fb",
|
24
|
-
hexDark: "#1e2c45",
|
25
|
-
}, backgroundPrimaryHighlighted: {
|
26
|
-
hex: "#3273CC",
|
27
|
-
hexDark: "#3273CC",
|
28
|
-
}, backgroundElevationBase: {
|
29
|
-
hex: "#ffffff",
|
30
|
-
hexDark: "#232323",
|
31
|
-
}, backgroundElevationRaised: {
|
32
|
-
hex: "#ffffff",
|
33
|
-
hexDark: "#262626",
|
34
|
-
}, backgroundElevationOverlay: {
|
35
|
-
hex: "#ffffff",
|
36
|
-
hexDark: "#292929",
|
37
|
-
}, backgroundNeutral: {
|
38
|
-
hex: "#e3e3e5",
|
39
|
-
hexDark: "#4f5155",
|
40
|
-
}, backgroundNeutralFaded: {
|
41
|
-
hex: "#f2f3f5",
|
42
|
-
hexDark: "#34363f",
|
43
|
-
}, backgroundNeutralHighlighted: {
|
44
|
-
hex: "#dedee1",
|
45
|
-
hexDark: "#595c60",
|
46
|
-
}, backgroundPage: {
|
47
|
-
hex: "#ffffff",
|
48
|
-
hexDark: "#191919",
|
49
|
-
}, backgroundPageFaded: {
|
50
|
-
hex: "#F7F7F5",
|
51
|
-
hexDark: "#202020",
|
52
|
-
}, backgroundDisabled: {
|
53
|
-
hex: "#ECEEF3",
|
54
|
-
hexDark: "#313131",
|
55
|
-
}, backgroundDisabledFaded: {
|
56
|
-
hex: "#F4F5F7",
|
57
|
-
hexDark: "#262626",
|
58
|
-
}, borderPrimary: {
|
59
|
-
hex: "#3D76C7",
|
60
|
-
hexDark: "#5A91E0",
|
61
|
-
}, borderPrimaryFaded: {
|
62
|
-
hex: "#c6d9f4",
|
63
|
-
hexDark: "#163a6a",
|
64
|
-
}, borderNeutral: {
|
65
|
-
hex: "#d2d2d2",
|
66
|
-
hexDark: "#414141",
|
67
|
-
}, borderNeutralFaded: {
|
68
|
-
hex: "#E2E2E2",
|
69
|
-
hexDark: "#464646",
|
70
|
-
}, borderDisabled: {
|
71
|
-
hex: "#E2E2E2",
|
72
|
-
hexDark: "#404040",
|
73
|
-
} }), unit: Object.assign(Object.assign({}, reshaped_1.default.unit), { radiusSmall: {
|
74
|
-
px: 2,
|
75
|
-
}, radiusMedium: {
|
76
|
-
px: 4,
|
77
|
-
}, radiusLarge: {
|
78
|
-
px: 6,
|
79
|
-
} }) });
|
80
|
-
exports.default = theme;
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,24 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getAspectRatioStyles from "./index.js";
|
11
|
-
describe("Styles/AspectRatio", () => {
|
12
|
-
test("handles positive value", () => {
|
13
|
-
expect(getAspectRatioStyles(1 / 2)).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles 0 value", () => {
|
16
|
-
expect(getAspectRatioStyles(0)).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles undefined value", () => {
|
19
|
-
expect(getAspectRatioStyles()).toMatchSnapshot();
|
20
|
-
});
|
21
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
-
expect(getAspectRatioStyles({ s: 4, m: 0, l: 2 })).toMatchSnapshot();
|
23
|
-
}));
|
24
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,24 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getBleedStyles from "./index.js";
|
11
|
-
describe("Styles/Bleed", () => {
|
12
|
-
test("handles positive value", () => {
|
13
|
-
expect(getBleedStyles(4)).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles 0 value", () => {
|
16
|
-
expect(getBleedStyles(0)).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles undefined value", () => {
|
19
|
-
expect(getBleedStyles()).toMatchSnapshot();
|
20
|
-
});
|
21
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
-
expect(getBleedStyles({ s: 4, m: 0, l: 2 })).toMatchSnapshot();
|
23
|
-
}));
|
24
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,27 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getHeightStyles from "./index.js";
|
11
|
-
describe("Styles/Height", () => {
|
12
|
-
test("handles px value", () => {
|
13
|
-
expect(getHeightStyles("50px")).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles % value", () => {
|
16
|
-
expect(getHeightStyles("50%")).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles unit value", () => {
|
19
|
-
expect(getHeightStyles(5)).toMatchSnapshot();
|
20
|
-
});
|
21
|
-
test("handles undefined value", () => {
|
22
|
-
expect(getHeightStyles()).toMatchSnapshot();
|
23
|
-
});
|
24
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
-
expect(getHeightStyles({ s: "50px", l: "50%" })).toMatchSnapshot();
|
26
|
-
}));
|
27
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,27 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getInsetStyles from "./index.js";
|
11
|
-
describe("Styles/Inset", () => {
|
12
|
-
test("handles positive value", () => {
|
13
|
-
expect(getInsetStyles(4)).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles 0 value", () => {
|
16
|
-
expect(getInsetStyles(0)).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles undefined value", () => {
|
19
|
-
expect(getInsetStyles()).toMatchSnapshot();
|
20
|
-
});
|
21
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
-
expect(getInsetStyles({ s: 4, m: 0, l: 2 })).toMatchSnapshot();
|
23
|
-
}));
|
24
|
-
test("handles value width defined side", () => {
|
25
|
-
expect(getInsetStyles(4, "start")).toMatchSnapshot();
|
26
|
-
});
|
27
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,27 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getMaxHeightStyles from "./index.js";
|
11
|
-
describe("Styles/MaxHeight", () => {
|
12
|
-
test("handles px value", () => {
|
13
|
-
expect(getMaxHeightStyles("50px")).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles % value", () => {
|
16
|
-
expect(getMaxHeightStyles("50%")).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles unit value", () => {
|
19
|
-
expect(getMaxHeightStyles(5)).toMatchSnapshot();
|
20
|
-
});
|
21
|
-
test("handles undefined value", () => {
|
22
|
-
expect(getMaxHeightStyles()).toMatchSnapshot();
|
23
|
-
});
|
24
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
-
expect(getMaxHeightStyles({ s: "50px", l: "50%" })).toMatchSnapshot();
|
26
|
-
}));
|
27
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,27 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getMaxWidthStyles from "./index.js";
|
11
|
-
describe("Styles/MaxWidth", () => {
|
12
|
-
test("handles px value", () => {
|
13
|
-
expect(getMaxWidthStyles("50px")).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles % value", () => {
|
16
|
-
expect(getMaxWidthStyles("50%")).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles unit value", () => {
|
19
|
-
expect(getMaxWidthStyles(5)).toMatchSnapshot();
|
20
|
-
});
|
21
|
-
test("handles undefined value", () => {
|
22
|
-
expect(getMaxWidthStyles()).toMatchSnapshot();
|
23
|
-
});
|
24
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
-
expect(getMaxWidthStyles({ s: "50px", l: "50%" })).toMatchSnapshot();
|
26
|
-
}));
|
27
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,24 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getPaddingStyles from "./index.js";
|
11
|
-
describe("Styles/Padding", () => {
|
12
|
-
test("handles positive value", () => {
|
13
|
-
expect(getPaddingStyles(4)).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles 0 value", () => {
|
16
|
-
expect(getPaddingStyles(0)).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles undefined value", () => {
|
19
|
-
expect(getPaddingStyles()).toMatchSnapshot();
|
20
|
-
});
|
21
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
-
expect(getPaddingStyles({ s: 4, m: 0, l: 2 })).toMatchSnapshot();
|
23
|
-
}));
|
24
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getPositionStyles from "./index.js";
|
11
|
-
describe("Styles/Position", () => {
|
12
|
-
test("handles value", () => {
|
13
|
-
expect(getPositionStyles("absolute")).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles undefined value", () => {
|
16
|
-
expect(getPositionStyles()).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
-
expect(getPositionStyles({ s: "absolute", l: "fixed" })).toMatchSnapshot();
|
20
|
-
}));
|
21
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,24 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getRadiusStyles from "./index.js";
|
11
|
-
describe("Styles/Radius", () => {
|
12
|
-
test("handles value", () => {
|
13
|
-
expect(getRadiusStyles("large")).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles none", () => {
|
16
|
-
expect(getRadiusStyles("none")).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles undefined value", () => {
|
19
|
-
expect(getRadiusStyles()).toMatchSnapshot();
|
20
|
-
});
|
21
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
-
expect(getRadiusStyles({ s: "small", m: "none", l: "circular" })).toMatchSnapshot();
|
23
|
-
}));
|
24
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,27 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import getWidthStyles from "./index.js";
|
11
|
-
describe("Styles/Width", () => {
|
12
|
-
test("handles px value", () => {
|
13
|
-
expect(getWidthStyles("50px")).toMatchSnapshot();
|
14
|
-
});
|
15
|
-
test("handles % value", () => {
|
16
|
-
expect(getWidthStyles("50%")).toMatchSnapshot();
|
17
|
-
});
|
18
|
-
test("handles unit value", () => {
|
19
|
-
expect(getWidthStyles(5)).toMatchSnapshot();
|
20
|
-
});
|
21
|
-
test("handles undefined value", () => {
|
22
|
-
expect(getWidthStyles()).toMatchSnapshot();
|
23
|
-
});
|
24
|
-
test("handles responsive value", () => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
-
expect(getWidthStyles({ s: "50px", l: "50%" })).toMatchSnapshot();
|
26
|
-
}));
|
27
|
-
});
|