reshaped 3.1.3 → 3.1.5
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 +23 -0
- package/dist/bundle.css +1 -1
- package/dist/bundle.d.ts +1 -1
- package/dist/bundle.js +11 -11
- package/dist/cjs/config/tailwind.js +5 -9
- package/dist/cjs/themes/_generator/tokens/font/font.transforms.js +1 -1
- package/dist/cjs/themes/_generator/utilities/generateColors.js +2 -2
- package/dist/cjs/themes/figma/theme.css +1 -1
- package/dist/cjs/themes/reshaped/theme.css +1 -1
- package/dist/cjs/themes/slate/theme.css +1 -1
- package/dist/components/Accordion/tests/Accordion.stories.js +33 -19
- package/dist/components/Autocomplete/Autocomplete.js +22 -18
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +4 -2
- package/dist/components/Autocomplete/index.d.ts +1 -1
- package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +1 -0
- package/dist/components/Autocomplete/tests/Autocomplete.stories.js +81 -0
- package/dist/components/Badge/Badge.module.css +1 -1
- package/dist/components/Badge/Badge.types.d.ts +1 -1
- package/dist/components/Button/tests/Button.stories.js +1 -1
- package/dist/components/Dismissible/Dismissible.module.css +1 -1
- package/dist/components/FileUpload/FileUpload.js +8 -2
- package/dist/components/FileUpload/FileUpload.types.d.ts +2 -0
- package/dist/components/FileUpload/tests/FileUpload.stories.d.ts +1 -0
- package/dist/components/FileUpload/tests/FileUpload.stories.js +10 -0
- package/dist/components/Image/Image.js +3 -1
- package/dist/components/Loader/tests/Loader.stories.js +1 -1
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/Modal/Modal.module.css +1 -1
- package/dist/components/Modal/Modal.types.d.ts +7 -3
- package/dist/components/Modal/tests/Modal.stories.d.ts +1 -0
- package/dist/components/Modal/tests/Modal.stories.js +27 -0
- package/dist/components/Overlay/Overlay.js +5 -5
- package/dist/components/Overlay/Overlay.module.css +1 -1
- package/dist/components/Overlay/Overlay.types.d.ts +4 -1
- package/dist/components/Overlay/index.d.ts +1 -1
- package/dist/components/Reshaped/Reshaped.css +1 -1
- package/dist/components/Reshaped/Reshaped.js +3 -3
- package/dist/components/Reshaped/Reshaped.module.css +1 -1
- package/dist/components/Reshaped/Reshaped.types.d.ts +4 -3
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Switch/tests/Switch.stories.js +5 -0
- package/dist/components/Table/Table.js +6 -4
- package/dist/components/Table/Table.module.css +1 -1
- package/dist/components/Table/Table.types.d.ts +6 -1
- package/dist/components/TextField/TextField.js +5 -6
- package/dist/components/TextField/TextField.module.css +1 -1
- package/dist/components/TextField/TextField.types.d.ts +2 -0
- package/dist/components/TextField/tests/TextField.stories.d.ts +1 -1
- package/dist/components/TextField/tests/TextField.stories.js +6 -2
- package/dist/components/Theme/GlobalColorMode.js +3 -2
- package/dist/components/Theme/Theme.d.ts +1 -0
- package/dist/components/Theme/Theme.js +13 -12
- package/dist/components/Theme/Theme.types.d.ts +4 -0
- package/dist/components/Theme/Theme.utilities.d.ts +1 -0
- package/dist/components/Theme/Theme.utilities.js +1 -0
- package/dist/components/Theme/index.d.ts +1 -1
- package/dist/components/Theme/index.js +1 -1
- package/dist/components/Toast/Toast.types.d.ts +1 -1
- package/dist/components/Toast/tests/Toast.stories.js +16 -0
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Tooltip/Tooltip.types.d.ts +1 -1
- package/dist/components/_private/Aligner/Aligner.module.css +1 -1
- package/dist/components/_private/Flyout/FlyoutControlled.js +1 -3
- package/dist/components/_private/Flyout/tests/Flyout.stories.js +6 -0
- package/dist/components/_private/Portal/Portal.types.d.ts +2 -2
- package/dist/config/tailwind.js +5 -9
- package/dist/constants/keys.d.ts +1 -0
- package/dist/constants/keys.js +1 -0
- package/dist/hooks/_private/useSingletonHotkeys.d.ts +3 -3
- package/dist/hooks/_private/useSingletonHotkeys.js +1 -1
- package/dist/hooks/tests/useHotkeys.stories.js +3 -0
- package/dist/hooks/useDrag.d.ts +1 -1
- package/dist/hooks/useResponsiveClientValue.js +3 -3
- package/dist/icons/Plus.d.ts +2 -0
- package/dist/icons/Plus.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/themes/_generator/tokens/font/font.transforms.js +1 -1
- package/dist/themes/_generator/utilities/generateColors.js +2 -2
- package/dist/themes/figma/theme.css +1 -1
- package/dist/themes/reshaped/theme.css +1 -1
- package/dist/themes/slate/theme.css +1 -1
- package/package.json +2 -1
@@ -40,7 +40,7 @@ const ModalSubtitle = (props) => {
|
|
40
40
|
return (_jsx(Text, { variant: "body-3", color: "neutral-faded", attributes: { id: `${id}-subtitle` }, children: children }));
|
41
41
|
};
|
42
42
|
const Modal = (props) => {
|
43
|
-
const { children, onClose, onOpen, active, size, padding = 4, position = "center", transparentOverlay, blurredOverlay, ariaLabel, autoFocus = true, disableSwipeGesture, disableCloseOnOutsideClick, overlayClassName, className, attributes, } = props;
|
43
|
+
const { children, onClose, onOpen, active, size, padding = 4, position = "center", overflow, transparentOverlay, blurredOverlay, ariaLabel, autoFocus = true, disableSwipeGesture, disableCloseOnOutsideClick, overlayClassName, className, attributes, } = props;
|
44
44
|
const onCloseRef = useHandlerRef(onClose);
|
45
45
|
const id = useElementId();
|
46
46
|
const clientPosition = useResponsiveClientValue(position);
|
@@ -112,7 +112,7 @@ const Modal = (props) => {
|
|
112
112
|
// Changing to a different direction will keep the modal opened
|
113
113
|
const shouldClose = clientPosition === "start" ? dragDirectionRef.current < 0 : dragDirectionRef.current > 0;
|
114
114
|
if (Math.abs(dragDistanceRef.current) > DRAG_THRESHOLD && shouldClose) {
|
115
|
-
onCloseRef.current?.();
|
115
|
+
onCloseRef.current?.({ reason: "drag" });
|
116
116
|
}
|
117
117
|
else {
|
118
118
|
resetDragData();
|
@@ -168,7 +168,7 @@ const Modal = (props) => {
|
|
168
168
|
return (_jsx(Overlay, { onClose: onClose, onOpen: onOpen, disableCloseOnClick: disableCloseOnOutsideClick, active: active, transparent: transparentOverlay || hideProgress, blurred: blurredOverlay, className: overlayClassName, attributes: {
|
169
169
|
onTouchStart: handleDragStart,
|
170
170
|
}, children: ({ active }) => {
|
171
|
-
const rootClassNames = classNames(s.root, className, paddingStyles?.classNames, active && s["--active"], dragging && s["--dragging"], responsiveClassNames(s, "--position", position));
|
171
|
+
const rootClassNames = classNames(s.root, className, paddingStyles?.classNames, active && s["--active"], dragging && s["--dragging"], overflow && s[`--overflow-${overflow}`], responsiveClassNames(s, "--position", position));
|
172
172
|
return (_jsx(Context.Provider, { value: value, children: _jsx("div", { ...attributes, style: {
|
173
173
|
...paddingStyles?.variables,
|
174
174
|
...responsiveVariables("--rs-modal-size", size),
|
@@ -1 +1 @@
|
|
1
|
-
.root{background:var(--rs-color-background-elevation-overlay);box-shadow:var(--rs-shadow-overlay);color:var(--rs-color-foreground-neutral);transition:var(--rs-easing-accelerate) var(--rs-duration-medium);transition-property:transform,opacity;will-change:transform}.root:focus-visible{box-shadow:var(--rs-focus-shadow);outline:none}.root{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);--rs-modal-size-m:var(--rs-modal-size-s);--rs-modal-size-l:var(--rs-modal-size-m);--rs-modal-size-xl:var(--rs-modal-size-l);--rs-modal-size:var(--rs-modal-size-s)}.--position-center{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:var(--rs-radius-large);height:auto;inset:0;margin:var(--rs-unit-x4);max-height:none;max-width:calc(100vw - var(--rs-unit-x8));opacity:0;overflow:hidden;position:relative;transform:scale(.96);width:var(--rs-modal-size)}.--position-center.--active,[dir=rtl] .--position-center.--active{opacity:1;transform:translate(0) scale(1)!important}.--position-bottom{--rs-modal-size-s:auto;border-radius:var(--rs-radius-large) var(--rs-radius-large) 0 0;height:var(--rs-modal-size);inset:0;inset-block-start:auto;margin:0;margin-top:var(--rs-unit-x4);max-height:calc(100vh - var(--rs-unit-x4));max-width:100%;opacity:1;overflow:auto;position:fixed;transform:translateY(100%);width:100%}.--position-bottom.--active,[dir=rtl] .--position-bottom.--active{transform:translateY(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-start{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-end:auto;margin:0;margin-inline-end:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(-100%);width:var(--rs-modal-size)}[dir=rtl] .--position-start{transform:translate(100%)}.--position-start.--active,[dir=rtl] .--position-start.--active{transform:translate(min(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-end{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-start:auto;margin:0;margin-inline-start:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(100%);width:var(--rs-modal-size)}[dir=rtl] .--position-end{transform:translate(-100%)}.--position-end.--active,[dir=rtl] .--position-end.--active{transform:translate(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-full-screen{--rs-modal-size-s:100%;border-radius:0;height:100%;inset:0;inset-block-start:auto;margin:0;max-height:100%;max-width:100%;opacity:0;overflow:auto;position:fixed;transform:translateY(var(--rs-unit-x4));width:100%}.--position-full-screen.--active,[dir=rtl] .--position-full-screen.--active{opacity:1;transform:translate(0)!important}.--active,[dir=rtl] .--active{transition-timing-function:var(--rs-easing-decelerate)}.--dragging{transition:none}@media (--rs-viewport-m ){.root{--rs-modal-size:var(--rs-modal-size-m)}.--position-center--m{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:var(--rs-radius-large);height:auto;inset:0;margin:var(--rs-unit-x4);max-height:none;max-width:calc(100vw - var(--rs-unit-x8));opacity:0;overflow:hidden;position:relative;transform:scale(.96);width:var(--rs-modal-size)}.--position-center--m.--active,[dir=rtl] .--position-center--m.--active{opacity:1;transform:translate(0) scale(1)!important}.--position-bottom--m{--rs-modal-size-s:auto;border-radius:var(--rs-radius-large) var(--rs-radius-large) 0 0;height:var(--rs-modal-size);inset:0;inset-block-start:auto;margin:0;margin-top:var(--rs-unit-x4);max-height:calc(100vh - var(--rs-unit-x4));max-width:100%;opacity:1;overflow:auto;position:fixed;transform:translateY(100%);width:100%}.--position-bottom--m.--active,[dir=rtl] .--position-bottom--m.--active{transform:translateY(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-start--m{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-end:auto;margin:0;margin-inline-end:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(-100%);width:var(--rs-modal-size)}[dir=rtl] .--position-start--m{transform:translate(100%)}.--position-start--m.--active,[dir=rtl] .--position-start--m.--active{transform:translate(min(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-end--m{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-start:auto;margin:0;margin-inline-start:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(100%);width:var(--rs-modal-size)}[dir=rtl] .--position-end--m{transform:translate(-100%)}.--position-end--m.--active,[dir=rtl] .--position-end--m.--active{transform:translate(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-full-screen--m{--rs-modal-size-s:100%;border-radius:0;height:100%;inset:0;inset-block-start:auto;margin:0;max-height:100%;max-width:100%;opacity:0;overflow:auto;position:fixed;transform:translateY(var(--rs-unit-x4));width:100%}.--position-full-screen--m.--active,[dir=rtl] .--position-full-screen--m.--active{opacity:1;transform:translate(0)!important}}@media (--rs-viewport-l ){.root{--rs-modal-size:var(--rs-modal-size-l)}.--position-center--l{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:var(--rs-radius-large);height:auto;inset:0;margin:var(--rs-unit-x4);max-height:none;max-width:calc(100vw - var(--rs-unit-x8));opacity:0;overflow:hidden;position:relative;transform:scale(.96);width:var(--rs-modal-size)}.--position-center--l.--active,[dir=rtl] .--position-center--l.--active{opacity:1;transform:translate(0) scale(1)!important}.--position-bottom--l{--rs-modal-size-s:auto;border-radius:var(--rs-radius-large) var(--rs-radius-large) 0 0;height:var(--rs-modal-size);inset:0;inset-block-start:auto;margin:0;margin-top:var(--rs-unit-x4);max-height:calc(100vh - var(--rs-unit-x4));max-width:100%;opacity:1;overflow:auto;position:fixed;transform:translateY(100%);width:100%}.--position-bottom--l.--active,[dir=rtl] .--position-bottom--l.--active{transform:translateY(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-start--l{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-end:auto;margin:0;margin-inline-end:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(-100%);width:var(--rs-modal-size)}[dir=rtl] .--position-start--l{transform:translate(100%)}.--position-start--l.--active,[dir=rtl] .--position-start--l.--active{transform:translate(min(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-end--l{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-start:auto;margin:0;margin-inline-start:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(100%);width:var(--rs-modal-size)}[dir=rtl] .--position-end--l{transform:translate(-100%)}.--position-end--l.--active,[dir=rtl] .--position-end--l.--active{transform:translate(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-full-screen--l{--rs-modal-size-s:100%;border-radius:0;height:100%;inset:0;inset-block-start:auto;margin:0;max-height:100%;max-width:100%;opacity:0;overflow:auto;position:fixed;transform:translateY(var(--rs-unit-x4));width:100%}.--position-full-screen--l.--active,[dir=rtl] .--position-full-screen--l.--active{opacity:1;transform:translate(0)!important}}@media (--rs-viewport-xl ){.root{--rs-modal-size:var(--rs-modal-size-xl)}.--position-center--xl{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:var(--rs-radius-large);height:auto;inset:0;margin:var(--rs-unit-x4);max-height:none;max-width:calc(100vw - var(--rs-unit-x8));opacity:0;overflow:hidden;position:relative;transform:scale(.96);width:var(--rs-modal-size)}.--position-center--xl.--active,[dir=rtl] .--position-center--xl.--active{opacity:1;transform:translate(0) scale(1)!important}.--position-bottom--xl{--rs-modal-size-s:auto;border-radius:var(--rs-radius-large) var(--rs-radius-large) 0 0;height:var(--rs-modal-size);inset:0;inset-block-start:auto;margin:0;margin-top:var(--rs-unit-x4);max-height:calc(100vh - var(--rs-unit-x4));max-width:100%;opacity:1;overflow:auto;position:fixed;transform:translateY(100%);width:100%}.--position-bottom--xl.--active,[dir=rtl] .--position-bottom--xl.--active{transform:translateY(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-start--xl{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-end:auto;margin:0;margin-inline-end:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(-100%);width:var(--rs-modal-size)}[dir=rtl] .--position-start--xl{transform:translate(100%)}.--position-start--xl.--active,[dir=rtl] .--position-start--xl.--active{transform:translate(min(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-end--xl{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-start:auto;margin:0;margin-inline-start:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(100%);width:var(--rs-modal-size)}[dir=rtl] .--position-end--xl{transform:translate(-100%)}.--position-end--xl.--active,[dir=rtl] .--position-end--xl.--active{transform:translate(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-full-screen--xl{--rs-modal-size-s:100%;border-radius:0;height:100%;inset:0;inset-block-start:auto;margin:0;max-height:100%;max-width:100%;opacity:0;overflow:auto;position:fixed;transform:translateY(var(--rs-unit-x4));width:100%}.--position-full-screen--xl.--active,[dir=rtl] .--position-full-screen--xl.--active{opacity:1;transform:translate(0)!important}}
|
1
|
+
.root{background:var(--rs-color-background-elevation-overlay);box-shadow:var(--rs-shadow-overlay);color:var(--rs-color-foreground-neutral);transition:var(--rs-easing-accelerate) var(--rs-duration-medium);transition-property:transform,opacity;will-change:transform}.root:focus-visible{box-shadow:var(--rs-focus-shadow);outline:none}.root{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);--rs-modal-size-m:var(--rs-modal-size-s);--rs-modal-size-l:var(--rs-modal-size-m);--rs-modal-size-xl:var(--rs-modal-size-l);--rs-modal-size:var(--rs-modal-size-s)}.--position-center{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:var(--rs-radius-large);height:auto;inset:0;margin:var(--rs-unit-x4);max-height:none;max-width:calc(100vw - var(--rs-unit-x8));opacity:0;overflow:hidden;position:relative;transform:scale(.96);width:var(--rs-modal-size)}.--position-center.--active,[dir=rtl] .--position-center.--active{opacity:1;transform:translate(0) scale(1)!important}.--position-bottom{--rs-modal-size-s:auto;border-radius:var(--rs-radius-large) var(--rs-radius-large) 0 0;height:var(--rs-modal-size);inset:0;inset-block-start:auto;margin:0;margin-top:var(--rs-unit-x4);max-height:calc(100vh - var(--rs-unit-x4));max-width:100%;opacity:1;overflow:auto;position:fixed;transform:translateY(100%);width:100%}.--position-bottom.--active,[dir=rtl] .--position-bottom.--active{transform:translateY(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-start{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-end:auto;margin:0;margin-inline-end:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(-100%);width:var(--rs-modal-size)}[dir=rtl] .--position-start{transform:translate(100%)}.--position-start.--active,[dir=rtl] .--position-start.--active{transform:translate(min(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-end{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-start:auto;margin:0;margin-inline-start:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(100%);width:var(--rs-modal-size)}[dir=rtl] .--position-end{transform:translate(-100%)}.--position-end.--active,[dir=rtl] .--position-end.--active{transform:translate(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-full-screen{--rs-modal-size-s:100%;border-radius:0;height:100%;inset:0;inset-block-start:auto;margin:0;max-height:100%;max-width:100%;opacity:0;overflow:auto;position:fixed;transform:translateY(var(--rs-unit-x4));width:100%}.--position-full-screen.--active,[dir=rtl] .--position-full-screen.--active{opacity:1;transform:translate(0)!important}.--active,[dir=rtl] .--active{transition-timing-function:var(--rs-easing-decelerate)}.--dragging{transition:none}.--overflow-visible{overflow:visible}@media (--rs-viewport-m ){.root{--rs-modal-size:var(--rs-modal-size-m)}.--position-center--m{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:var(--rs-radius-large);height:auto;inset:0;margin:var(--rs-unit-x4);max-height:none;max-width:calc(100vw - var(--rs-unit-x8));opacity:0;overflow:hidden;position:relative;transform:scale(.96);width:var(--rs-modal-size)}.--position-center--m.--active,[dir=rtl] .--position-center--m.--active{opacity:1;transform:translate(0) scale(1)!important}.--position-bottom--m{--rs-modal-size-s:auto;border-radius:var(--rs-radius-large) var(--rs-radius-large) 0 0;height:var(--rs-modal-size);inset:0;inset-block-start:auto;margin:0;margin-top:var(--rs-unit-x4);max-height:calc(100vh - var(--rs-unit-x4));max-width:100%;opacity:1;overflow:auto;position:fixed;transform:translateY(100%);width:100%}.--position-bottom--m.--active,[dir=rtl] .--position-bottom--m.--active{transform:translateY(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-start--m{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-end:auto;margin:0;margin-inline-end:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(-100%);width:var(--rs-modal-size)}[dir=rtl] .--position-start--m{transform:translate(100%)}.--position-start--m.--active,[dir=rtl] .--position-start--m.--active{transform:translate(min(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-end--m{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-start:auto;margin:0;margin-inline-start:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(100%);width:var(--rs-modal-size)}[dir=rtl] .--position-end--m{transform:translate(-100%)}.--position-end--m.--active,[dir=rtl] .--position-end--m.--active{transform:translate(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-full-screen--m{--rs-modal-size-s:100%;border-radius:0;height:100%;inset:0;inset-block-start:auto;margin:0;max-height:100%;max-width:100%;opacity:0;overflow:auto;position:fixed;transform:translateY(var(--rs-unit-x4));width:100%}.--position-full-screen--m.--active,[dir=rtl] .--position-full-screen--m.--active{opacity:1;transform:translate(0)!important}}@media (--rs-viewport-l ){.root{--rs-modal-size:var(--rs-modal-size-l)}.--position-center--l{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:var(--rs-radius-large);height:auto;inset:0;margin:var(--rs-unit-x4);max-height:none;max-width:calc(100vw - var(--rs-unit-x8));opacity:0;overflow:hidden;position:relative;transform:scale(.96);width:var(--rs-modal-size)}.--position-center--l.--active,[dir=rtl] .--position-center--l.--active{opacity:1;transform:translate(0) scale(1)!important}.--position-bottom--l{--rs-modal-size-s:auto;border-radius:var(--rs-radius-large) var(--rs-radius-large) 0 0;height:var(--rs-modal-size);inset:0;inset-block-start:auto;margin:0;margin-top:var(--rs-unit-x4);max-height:calc(100vh - var(--rs-unit-x4));max-width:100%;opacity:1;overflow:auto;position:fixed;transform:translateY(100%);width:100%}.--position-bottom--l.--active,[dir=rtl] .--position-bottom--l.--active{transform:translateY(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-start--l{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-end:auto;margin:0;margin-inline-end:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(-100%);width:var(--rs-modal-size)}[dir=rtl] .--position-start--l{transform:translate(100%)}.--position-start--l.--active,[dir=rtl] .--position-start--l.--active{transform:translate(min(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-end--l{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-start:auto;margin:0;margin-inline-start:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(100%);width:var(--rs-modal-size)}[dir=rtl] .--position-end--l{transform:translate(-100%)}.--position-end--l.--active,[dir=rtl] .--position-end--l.--active{transform:translate(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-full-screen--l{--rs-modal-size-s:100%;border-radius:0;height:100%;inset:0;inset-block-start:auto;margin:0;max-height:100%;max-width:100%;opacity:0;overflow:auto;position:fixed;transform:translateY(var(--rs-unit-x4));width:100%}.--position-full-screen--l.--active,[dir=rtl] .--position-full-screen--l.--active{opacity:1;transform:translate(0)!important}}@media (--rs-viewport-xl ){.root{--rs-modal-size:var(--rs-modal-size-xl)}.--position-center--xl{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:var(--rs-radius-large);height:auto;inset:0;margin:var(--rs-unit-x4);max-height:none;max-width:calc(100vw - var(--rs-unit-x8));opacity:0;overflow:hidden;position:relative;transform:scale(.96);width:var(--rs-modal-size)}.--position-center--xl.--active,[dir=rtl] .--position-center--xl.--active{opacity:1;transform:translate(0) scale(1)!important}.--position-bottom--xl{--rs-modal-size-s:auto;border-radius:var(--rs-radius-large) var(--rs-radius-large) 0 0;height:var(--rs-modal-size);inset:0;inset-block-start:auto;margin:0;margin-top:var(--rs-unit-x4);max-height:calc(100vh - var(--rs-unit-x4));max-width:100%;opacity:1;overflow:auto;position:fixed;transform:translateY(100%);width:100%}.--position-bottom--xl.--active,[dir=rtl] .--position-bottom--xl.--active{transform:translateY(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-start--xl{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-end:auto;margin:0;margin-inline-end:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(-100%);width:var(--rs-modal-size)}[dir=rtl] .--position-start--xl{transform:translate(100%)}.--position-start--xl.--active,[dir=rtl] .--position-start--xl.--active{transform:translate(min(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-end--xl{--rs-modal-size-s:calc(var(--rs-unit-x1) * 100);border-radius:0;height:100%;inset:0;inset-inline-start:auto;margin:0;margin-inline-start:var(--rs-unit-x4);max-height:100%;max-width:calc(100vw - var(--rs-unit-x4));opacity:1;overflow:auto;position:fixed;transform:translate(100%);width:var(--rs-modal-size)}[dir=rtl] .--position-end--xl{transform:translate(-100%)}.--position-end--xl.--active,[dir=rtl] .--position-end--xl.--active{transform:translate(max(var(--rs-modal-drag,0px),0px)) scale(1)!important}.--position-full-screen--xl{--rs-modal-size-s:100%;border-radius:0;height:100%;inset:0;inset-block-start:auto;margin:0;max-height:100%;max-width:100%;opacity:0;overflow:auto;position:fixed;transform:translateY(var(--rs-unit-x4));width:100%}.--position-full-screen--xl.--active,[dir=rtl] .--position-full-screen--xl.--active{opacity:1;transform:translate(0)!important}}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type * as G from "../../types/global";
|
3
|
-
import type { OverlayProps } from "../Overlay";
|
3
|
+
import type { OverlayProps, OverlayCloseReason } from "../Overlay";
|
4
4
|
export type Context = {
|
5
5
|
id: string;
|
6
6
|
titleMounted: boolean;
|
@@ -19,6 +19,10 @@ export type Props = {
|
|
19
19
|
position?: G.Responsive<"center" | "end" | "bottom" | "start" | "full-screen">;
|
20
20
|
size?: G.Responsive<string>;
|
21
21
|
padding?: G.Responsive<number>;
|
22
|
+
overflow?: "visible";
|
23
|
+
onClose?: (args: {
|
24
|
+
reason: OverlayCloseReason | "drag";
|
25
|
+
}) => void;
|
22
26
|
transparentOverlay?: boolean;
|
23
27
|
blurredOverlay?: boolean;
|
24
28
|
disableSwipeGesture?: boolean;
|
@@ -28,6 +32,6 @@ export type Props = {
|
|
28
32
|
className?: G.ClassName;
|
29
33
|
overlayClassName?: G.ClassName;
|
30
34
|
attributes?: G.Attributes<"div"> & {
|
31
|
-
ref?: React.RefObject<HTMLDivElement
|
35
|
+
ref?: React.RefObject<HTMLDivElement>;
|
32
36
|
};
|
33
|
-
} & Pick<OverlayProps, "
|
37
|
+
} & Pick<OverlayProps, "onOpen" | "active">;
|
@@ -17,6 +17,7 @@ export default _default;
|
|
17
17
|
export declare const position: () => React.JSX.Element;
|
18
18
|
export declare const size: () => React.JSX.Element;
|
19
19
|
export declare const padding: () => React.JSX.Element;
|
20
|
+
export declare const overflow: () => React.JSX.Element;
|
20
21
|
export declare const composition: () => React.JSX.Element;
|
21
22
|
export declare const overlay: () => React.JSX.Element;
|
22
23
|
export declare const flags: () => React.JSX.Element;
|
@@ -89,6 +89,33 @@ export const padding = () => (<Example>
|
|
89
89
|
<Demo padding={{ s: 2, m: 6 }}/>
|
90
90
|
</Example.Item>
|
91
91
|
</Example>);
|
92
|
+
export const overflow = () => (<Example>
|
93
|
+
<Example.Item title="default overflow">
|
94
|
+
<Demo>
|
95
|
+
<div style={{
|
96
|
+
position: "absolute",
|
97
|
+
top: -32,
|
98
|
+
left: -32,
|
99
|
+
height: 100,
|
100
|
+
width: 100,
|
101
|
+
background: "tomato",
|
102
|
+
}}/>
|
103
|
+
</Demo>
|
104
|
+
</Example.Item>
|
105
|
+
|
106
|
+
<Example.Item title="overflow: visible">
|
107
|
+
<Demo overflow="visible">
|
108
|
+
<div style={{
|
109
|
+
position: "absolute",
|
110
|
+
top: -32,
|
111
|
+
left: -32,
|
112
|
+
height: 100,
|
113
|
+
width: 100,
|
114
|
+
background: "tomato",
|
115
|
+
}}/>
|
116
|
+
</Demo>
|
117
|
+
</Example.Item>
|
118
|
+
</Example>);
|
92
119
|
export const composition = () => (<Example>
|
93
120
|
<Example.Item title="title, subtitle, dismissible">
|
94
121
|
<Demo title="Modal title" subtitle="Modal subtitle"/>
|
@@ -35,10 +35,10 @@ const Overlay = (props) => {
|
|
35
35
|
return;
|
36
36
|
return firstChild.contains(el);
|
37
37
|
};
|
38
|
-
const close = React.useCallback(() => {
|
38
|
+
const close = React.useCallback((reason) => {
|
39
39
|
if (!visible || !isDismissible())
|
40
40
|
return;
|
41
|
-
onCloseRef.current?.();
|
41
|
+
onCloseRef.current?.({ reason });
|
42
42
|
}, [visible, isDismissible, onCloseRef]);
|
43
43
|
const handleMouseDown = (event) => {
|
44
44
|
isMouseDownValidRef.current = !isInsideChild(event.target);
|
@@ -48,10 +48,10 @@ const Overlay = (props) => {
|
|
48
48
|
const shouldClose = isMouseDownValidRef.current && isMouseUpValid && !clickThrough;
|
49
49
|
if (!shouldClose || disableCloseOnClick)
|
50
50
|
return;
|
51
|
-
close();
|
51
|
+
close("overlay-click");
|
52
52
|
};
|
53
53
|
const handleTransitionEnd = (e) => {
|
54
|
-
if (e.propertyName !== "
|
54
|
+
if (e.propertyName !== "opacity" || e.target !== e.currentTarget)
|
55
55
|
return;
|
56
56
|
setAnimated(false);
|
57
57
|
if (visible)
|
@@ -60,7 +60,7 @@ const Overlay = (props) => {
|
|
60
60
|
unlockScroll();
|
61
61
|
remove();
|
62
62
|
};
|
63
|
-
useHotkeys({ Escape: close }, [close]);
|
63
|
+
useHotkeys({ Escape: () => close("escape-key") }, [close]);
|
64
64
|
React.useEffect(() => {
|
65
65
|
setAnimated(true);
|
66
66
|
if (active && !rendered)
|
@@ -1 +1 @@
|
|
1
|
-
.root{overflow:auto;-webkit-overflow-scrolling:touch;background-color:rgba(var(--rs-color-rgb-black),0);color:var(--rs-color-white);cursor:default!important;inset:-1px;opacity:0;outline:none;position:fixed;z-index:var(--rs-z-index-overlay)}.wrapper{display:table;height:100%;width:100%}.inner{display:table-cell;text-align:center}.content,.inner{vertical-align:middle}.content{display:inline-block;text-align:initial}.root.--visible{background-color:rgba(var(--rs-color-rgb-black),var(--rs-overlay-opacity));opacity:1}.root.--click-through{color:inherit;pointer-events:none}.root.--blurred{backdrop-filter:blur(3px)}.root.--click-through .content,.root.--click-through>:not(.wrapper){pointer-events:all}.root.--animated{transition:var(--rs-duration-medium) var(--rs-easing-accelerate);transition-property:background-color,
|
1
|
+
.root{overflow:auto;-webkit-overflow-scrolling:touch;background-color:rgba(var(--rs-color-rgb-black),0);color:var(--rs-color-white);cursor:default!important;inset:-1px;opacity:0;outline:none;position:fixed;z-index:var(--rs-z-index-overlay)}.wrapper{display:table;height:100%;width:100%}.inner{display:table-cell;text-align:center}.content,.inner{vertical-align:middle}.content{display:inline-block;text-align:initial}.root.--visible{background-color:rgba(var(--rs-color-rgb-black),var(--rs-overlay-opacity));opacity:1}.root.--click-through{color:inherit;pointer-events:none}.root.--blurred{backdrop-filter:blur(3px)}.root.--click-through .content,.root.--click-through>:not(.wrapper){pointer-events:all}.root.--animated{transition:var(--rs-duration-medium) var(--rs-easing-accelerate);transition-property:background-color,opacity}.root.--animated.--visible{transition-timing-function:var(--rs-easing-decelerate)}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type * as G from "../../types/global";
|
3
|
+
export type CloseReason = "overlay-click" | "escape-key";
|
3
4
|
export type Props = {
|
4
5
|
transparent?: boolean | number;
|
5
6
|
blurred?: boolean;
|
@@ -7,7 +8,9 @@ export type Props = {
|
|
7
8
|
active: boolean;
|
8
9
|
}) => React.ReactNode);
|
9
10
|
active?: boolean;
|
10
|
-
onClose?: (
|
11
|
+
onClose?: (args: {
|
12
|
+
reason: CloseReason;
|
13
|
+
}) => void;
|
11
14
|
onOpen?: () => void;
|
12
15
|
disableCloseOnClick?: boolean;
|
13
16
|
className?: G.ClassName;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { default } from "./Overlay";
|
2
|
-
export type { Props as OverlayProps } from "./Overlay.types";
|
2
|
+
export type { Props as OverlayProps, CloseReason as OverlayCloseReason } from "./Overlay.types";
|
@@ -1 +1 @@
|
|
1
|
-
:root{--rs-z-index-raised:5;--rs-z-index-flyout:80;--rs-z-index-fixed:90;--rs-z-index-overlay:100;--rs-z-index-notification:110}@layer rs.reset{blockquote,body,dd,dl,figcaption,figure,h1,h2,h3,h4,h5,h6,li,ol,p,ul{margin:0;padding:0}ol[class],ul[class]{list-style:none}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}fieldset{border:0;margin:0;padding:0}img{display:block;max-width:100%}button,input,select,textarea{font:inherit}option{background:var(--rs-color-background-elevation-base)}label{cursor:pointer}input::placeholder,textarea::placeholder{color:var(--rs-color-foreground-neutral-faded);opacity:.5}html{-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;font-
|
1
|
+
:root{--rs-z-index-raised:5;--rs-z-index-flyout:80;--rs-z-index-fixed:90;--rs-z-index-overlay:100;--rs-z-index-notification:110}@layer rs.reset{[data-rs-theme] blockquote,[data-rs-theme] body,[data-rs-theme] dd,[data-rs-theme] dl,[data-rs-theme] figcaption,[data-rs-theme] figure,[data-rs-theme] h1,[data-rs-theme] h2,[data-rs-theme] h3,[data-rs-theme] h4,[data-rs-theme] h5,[data-rs-theme] h6,[data-rs-theme] li,[data-rs-theme] ol,[data-rs-theme] p,[data-rs-theme] ul{margin:0;padding:0}[data-rs-theme] ol[class],[data-rs-theme] ul[class]{list-style:none}[data-rs-theme] textarea{resize:vertical}[data-rs-theme] table{border-collapse:collapse;border-spacing:0}[data-rs-theme] fieldset{border:0;margin:0;padding:0}[data-rs-theme] img{display:block;max-width:100%}[data-rs-theme] button,[data-rs-theme] input,[data-rs-theme] select,[data-rs-theme] textarea{font:inherit}[data-rs-theme] option{background:var(--rs-color-background-elevation-base)}[data-rs-theme] label{cursor:pointer}[data-rs-theme] input::placeholder,[data-rs-theme] textarea::placeholder{color:var(--rs-color-foreground-neutral-faded);opacity:.5}html[data-rs-theme]{-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;font-size:100%;text-rendering:optimizelegibility;touch-action:manipulation}[data-rs-theme] *{box-sizing:border-box}[data-rs-theme] body,html[data-rs-theme]{background:var(--rs-color-background-page);color:var(--rs-color-foreground-neutral);height:100%;scroll-behavior:smooth}}[data-rs-theme] body,[data-rs-theme]:not(html){font-family:var(--rs-font-family-body);font-size:var(--rs-font-size-body-3);font-weight:var(--rs-font-weight-regular);letter-spacing:var(--rs-letter-spacing-body-3);line-height:var(--rs-line-height-body-3)}[data-rs-color-mode=light]{color-scheme:light}[data-rs-color-mode=dark]{color-scheme:dark}@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}[data-rs-no-transition] *,[data-rs-no-transition] :after,[data-rs-no-transition] :before{transition:none!important}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
3
3
|
import { classNames } from "../../utilities/helpers.js";
|
4
|
-
import
|
4
|
+
import { GlobalColorMode, PrivateTheme } from "../Theme/index.js";
|
5
5
|
import { ToastProvider } from "../Toast/index.js";
|
6
6
|
import useSingletonKeyboardMode from "../../hooks/_private/useSingletonKeyboardMode.js";
|
7
7
|
import { SingletonEnvironmentContext, useSingletonRTL, } from "../../hooks/_private/useSingletonEnvironment.js";
|
@@ -15,8 +15,8 @@ const ReshapedInner = (props) => {
|
|
15
15
|
return (_jsx(SingletonEnvironmentContext.Provider, { value: { rtl: rtlState, defaultViewport }, children: _jsx(SingletonHotkeysProvider, { children: _jsx(ToastProvider, { options: toastOptions, children: children }) }) }));
|
16
16
|
};
|
17
17
|
const Reshaped = (props) => {
|
18
|
-
const { theme, defaultTheme = "reshaped", defaultColorMode, className } = props;
|
18
|
+
const { theme, defaultTheme = "reshaped", defaultColorMode, scoped, className } = props;
|
19
19
|
const rootClassNames = classNames(s.root, className);
|
20
|
-
return (_jsx(GlobalColorMode, { defaultMode: defaultColorMode, children: _jsx(
|
20
|
+
return (_jsx(GlobalColorMode, { defaultMode: defaultColorMode, children: _jsx(PrivateTheme, { name: theme, defaultName: defaultTheme, className: rootClassNames, scoped: scoped, children: _jsx(ReshapedInner, { ...props, children: props.children }) }) }));
|
21
21
|
};
|
22
22
|
export default Reshaped;
|
@@ -1 +1 @@
|
|
1
|
-
.root{color:inherit;
|
1
|
+
.root{color:inherit;display:contents}
|
@@ -4,11 +4,12 @@ import type { ToastProviderProps } from "../Toast";
|
|
4
4
|
import type * as G from "../../types/global";
|
5
5
|
export type Props = {
|
6
6
|
children?: React.ReactNode;
|
7
|
+
theme?: NonNullable<ThemeProps["name"]>;
|
8
|
+
defaultTheme?: NonNullable<ThemeProps["defaultName"]>;
|
7
9
|
defaultRTL?: boolean;
|
8
10
|
defaultColorMode?: GlobalColorModeProps["defaultMode"];
|
9
11
|
defaultViewport?: G.Viewport;
|
10
|
-
className?: G.ClassName;
|
11
|
-
theme?: NonNullable<ThemeProps["name"]>;
|
12
|
-
defaultTheme?: NonNullable<ThemeProps["defaultName"]>;
|
13
12
|
toastOptions?: ToastProviderProps["options"];
|
13
|
+
scoped?: boolean;
|
14
|
+
className?: G.ClassName;
|
14
15
|
};
|
@@ -21,6 +21,6 @@ const Switch = (props) => {
|
|
21
21
|
checked: event.target.checked,
|
22
22
|
});
|
23
23
|
};
|
24
|
-
return (_jsxs("label", { ...attributes, className: rootClassNames, children: [_jsx("input", { type: "checkbox", ...inputAttributes, className: s.input, name: name, checked: checked, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus || inputAttributes?.onFocus, onBlur: onBlur || inputAttributes?.onBlur, id: id }), _jsx("span", { className: s.area, "aria-hidden": "true", children: _jsx("span", { className: s.thumb }) }), children && (_jsx(Text, { variant: size === "small" ? "caption-1" : "body-3", weight: "medium", children: children }))] }));
|
24
|
+
return (_jsxs("label", { ...attributes, className: rootClassNames, children: [_jsx("input", { type: "checkbox", ...inputAttributes, className: s.input, name: name, checked: checked, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus || inputAttributes?.onFocus, onBlur: onBlur || inputAttributes?.onBlur, id: id }), _jsx("span", { className: s.area, "aria-hidden": "true", children: _jsx("span", { className: s.thumb }) }), children && (_jsx(Text, { variant: size === "small" ? "caption-1" : "body-3", weight: "medium", color: disabled ? "disabled" : undefined, children: children }))] }));
|
25
25
|
};
|
26
26
|
export default Switch;
|
@@ -60,4 +60,9 @@ export const disabled = () => (<Example>
|
|
60
60
|
<Example.Item title="disabled, selected">
|
61
61
|
<Switch name="active" disabled defaultChecked inputAttributes={{ "aria-label": "test switch" }}/>
|
62
62
|
</Example.Item>
|
63
|
+
<Example.Item title="disabled, with label">
|
64
|
+
<Switch name="active" disabled>
|
65
|
+
Switch
|
66
|
+
</Switch>
|
67
|
+
</Example.Item>
|
63
68
|
</Example>);
|
@@ -5,11 +5,11 @@ import getWidthStyles from "../../styles/width/index.js";
|
|
5
5
|
import getMinWidthStyles from "../../styles/minWidth/index.js";
|
6
6
|
import s from "./Table.module.css";
|
7
7
|
const TableCellPrivate = (props) => {
|
8
|
-
const { minWidth, rowSpan, colSpan, align, verticalAlign, tagName: TagName, padding, paddingInline, paddingBlock, children, attributes, } = props;
|
8
|
+
const { minWidth, rowSpan, colSpan, align, verticalAlign, tagName: TagName, padding, paddingInline, paddingBlock, children, className, attributes, } = props;
|
9
9
|
const width = props.width === "auto" ? "0px" : props.width;
|
10
10
|
const widthStyles = getWidthStyles(width);
|
11
11
|
const minWidthStyles = getMinWidthStyles(minWidth || width);
|
12
|
-
const headingClassNames = classNames(s.cell, widthStyles?.classNames, minWidthStyles?.classNames, (width === 0 || width === "0px") && s["cell--width-auto"], align && s[`cell--align-${align}`], verticalAlign && s[`cell--valign-${verticalAlign}`]);
|
12
|
+
const headingClassNames = classNames(s.cell, widthStyles?.classNames, minWidthStyles?.classNames, (width === 0 || width === "0px") && s["cell--width-auto"], align && s[`cell--align-${align}`], verticalAlign && s[`cell--valign-${verticalAlign}`], className);
|
13
13
|
const headingStyle = {
|
14
14
|
...widthStyles?.variables,
|
15
15
|
...minWidthStyles?.variables,
|
@@ -30,10 +30,12 @@ const TableRow = (props) => {
|
|
30
30
|
return (_jsx("tr", { ...attributes, className: rowClassNames, children: children }));
|
31
31
|
};
|
32
32
|
const TableBody = (props) => {
|
33
|
-
|
33
|
+
const { children, attributes, className } = props;
|
34
|
+
return (_jsx("tbody", { ...attributes, className: classNames(className), children: children }));
|
34
35
|
};
|
35
36
|
const TableHead = (props) => {
|
36
|
-
|
37
|
+
const { children, attributes, className } = props;
|
38
|
+
return (_jsx("thead", { ...attributes, className: classNames(className), children: children }));
|
37
39
|
};
|
38
40
|
const Table = (props) => {
|
39
41
|
const { children, border, columnBorder, className, attributes } = props;
|
@@ -1 +1 @@
|
|
1
|
-
.root{margin:0 calc(var(--rs-unit-x4) * -1);mask-image:linear-gradient(to right,transparent 0,#000 var(--rs-unit-x4),#000 calc(100% - var(--rs-unit-x4)),transparent 100%);overflow:auto;padding:0 var(--rs-unit-x4)}.table{border-collapse:separate;min-width:100%;overflow:hidden}.row{transition:background-color var(--rs-duration-fast) var(--rs-easing-standard)}.cell{--rs-table-p-vertical-s:3;--rs-table-p-horizontal-s:4;padding:calc(var(--rs-unit-x1) * var(--rs-table-p-vertical-s)) calc(var(--rs-unit-x1) * var(--rs-table-p-horizontal-s));text-align:start;vertical-align:top}.cell:not(:last-child){padding-inline-end:0}.row:not(:first-child) .cell{border-top:1px solid var(--rs-color-border-neutral-faded)}.cell--align-start{text-align:start}.cell--align-center{text-align:center}.cell--align-end{text-align:end}.cell--valign-start{vertical-align:top}.cell--valign-center{vertical-align:middle}.cell--valign-end{vertical-align:bottom}.cell--width-auto{white-space:nowrap}.--row-highlighted{background-color:rgba(var(--rs-color-rgb-background-neutral),
|
1
|
+
.root{margin:0 calc(var(--rs-unit-x4) * -1);mask-image:linear-gradient(to right,transparent 0,#000 var(--rs-unit-x4),#000 calc(100% - var(--rs-unit-x4)),transparent 100%);overflow:auto;padding:0 var(--rs-unit-x4)}.table{border-collapse:separate;min-width:100%;overflow:hidden}.row{transition:background-color var(--rs-duration-fast) var(--rs-easing-standard)}.cell{--rs-table-p-vertical-s:3;--rs-table-p-horizontal-s:4;padding:calc(var(--rs-unit-x1) * var(--rs-table-p-vertical-s)) calc(var(--rs-unit-x1) * var(--rs-table-p-horizontal-s));text-align:start;vertical-align:top}.cell:not(:last-child){padding-inline-end:0}.row:not(:first-child) .cell{border-top:1px solid var(--rs-color-border-neutral-faded)}.cell--align-start{text-align:start}.cell--align-center{text-align:center}.cell--align-end{text-align:end}.cell--valign-start{vertical-align:top}.cell--valign-center{vertical-align:middle}.cell--valign-end{vertical-align:bottom}.cell--width-auto{white-space:nowrap}.--row-highlighted{background-color:rgba(var(--rs-color-rgb-background-neutral),32%)}.--border-outer .table{border:1px solid var(--rs-color-border-neutral-faded);border-radius:var(--rs-radius-medium)}.--border-column .cell:not(:first-child){border-inline-start:1px solid var(--rs-color-border-neutral-faded)}.--border-column .cell:not(:last-child){padding-inline-end:calc(var(--rs-unit-x1) * var(--rs-table-p-horizontal-s))}
|
@@ -23,6 +23,7 @@ export type CellProps = {
|
|
23
23
|
width?: "auto" | string | number;
|
24
24
|
minWidth?: string | number;
|
25
25
|
children?: React.ReactNode;
|
26
|
+
className?: G.ClassName;
|
26
27
|
attributes?: G.Attributes<"td">;
|
27
28
|
};
|
28
29
|
export type HeadingProps = CellProps & {
|
@@ -30,10 +31,14 @@ export type HeadingProps = CellProps & {
|
|
30
31
|
};
|
31
32
|
export type BodyProps = {
|
32
33
|
children: React.ReactNode;
|
34
|
+
className?: G.ClassName;
|
35
|
+
attributes?: G.Attributes<"tbody">;
|
33
36
|
};
|
34
37
|
export type HeadProps = {
|
35
38
|
children: React.ReactNode;
|
39
|
+
className?: G.ClassName;
|
40
|
+
attributes?: G.Attributes<"thead">;
|
36
41
|
};
|
37
|
-
export type PrivateCellProps =
|
42
|
+
export type PrivateCellProps = CellProps & {
|
38
43
|
tagName: "td" | "th";
|
39
44
|
};
|
@@ -10,9 +10,8 @@ const TextFieldSlot = (props) => {
|
|
10
10
|
const { slot, icon, size, affix, position } = props;
|
11
11
|
if (!icon && !slot && !affix)
|
12
12
|
return null;
|
13
|
-
const attachmentClassNames = classNames(s.attachment, s[`attachment--position-${position}`]);
|
14
13
|
const content = [
|
15
|
-
slot && (_jsx("div", { className: s.slot, children: slot }, "slot")),
|
14
|
+
slot && (_jsx("div", { className: classNames(s.slot, s[`slot--position-${position}`]), children: slot }, "slot")),
|
16
15
|
icon && (_jsx("div", { className: s.icon, children: _jsx(Icon, { size: responsivePropDependency(size, (size) => {
|
17
16
|
if (size === "large")
|
18
17
|
return 5;
|
@@ -20,19 +19,19 @@ const TextFieldSlot = (props) => {
|
|
20
19
|
return 6;
|
21
20
|
return 4;
|
22
21
|
}), svg: icon }) }, "icon")),
|
23
|
-
affix && (_jsx("div", { className: s.affix, children: affix }, "affix")),
|
22
|
+
affix && (_jsx("div", { className: classNames(s.affix, s[`affix--position-${position}`]), children: affix }, "affix")),
|
24
23
|
].filter(Boolean);
|
25
|
-
return
|
24
|
+
return position === "end" ? content.reverse() : content;
|
26
25
|
};
|
27
26
|
const TextField = (props) => {
|
28
|
-
const { onChange, onFocus, onBlur, name, value, defaultValue, placeholder, icon, endIcon, startSlot, endSlot, prefix, suffix, size = "medium", variant = "outline", className, attributes, } = props;
|
27
|
+
const { onChange, onFocus, onBlur, name, value, defaultValue, placeholder, icon, endIcon, startSlot, endSlot, prefix, suffix, size = "medium", variant = "outline", focused, multiline, className, attributes, } = props;
|
29
28
|
const formControl = useFormControl();
|
30
29
|
const id = useElementId(props.id);
|
31
30
|
const inputId = formControl?.attributes.id || props.inputAttributes?.id || id;
|
32
31
|
const disabled = formControl?.disabled || props.disabled;
|
33
32
|
const hasError = formControl?.hasError || props.hasError;
|
34
33
|
const inputAttributes = { ...props.inputAttributes, ...formControl?.attributes };
|
35
|
-
const rootClassName = classNames(s.root, className, size && responsiveClassNames(s, "--size", size), hasError && s["--status-error"], disabled && s["--disabled"], variant && s[`--variant-${variant}`]);
|
34
|
+
const rootClassName = classNames(s.root, className, size && responsiveClassNames(s, "--size", size), hasError && s["--status-error"], disabled && s["--disabled"], focused && s["--focused"], multiline && s["--multiline"], variant && s[`--variant-${variant}`]);
|
36
35
|
const handleChange = (event) => {
|
37
36
|
if (!onChange)
|
38
37
|
return;
|
@@ -1 +1 @@
|
|
1
|
-
.root{--rs-p-
|
1
|
+
.root{--rs-p-h:var(--rs-text-field-gap);background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);display:flex;gap:var(--rs-text-field-gap);padding:calc(var(--rs-unit-x1) - 1px) var(--rs-text-field-gap);position:relative;row-gap:var(--rs-unit-x1);z-index:0}.root:not(:has(button:focus,a:focus,[tabindex="0"]:focus)):focus-within{border-color:var(--rs-color-border-primary);box-shadow:0 0 0 1px var(--rs-color-border-primary)}.root.--multiline{flex-wrap:wrap}.root.--multiline .input{width:auto}.input{background:none;border:none;box-sizing:border-box;color:var(--rs-color-foreground-neutral);flex-grow:1;font-family:var(--rs-font-family-body);font-weight:var(--rs-font-weight-regular);margin:calc(var(--rs-unit-x1) * -1) calc(var(--rs-text-field-gap) * -1);outline:none;padding-inline:var(--rs-text-field-gap);position:relative;width:100%;z-index:1}.input:-webkit-autofill{-webkit-background-clip:text;-webkit-text-fill-color:var(--rs-color-foreground-neutral)}.affix,.icon,.slot{align-items:center;display:flex;flex-shrink:0;min-height:calc(var(--rs-text-field-line-height) + var(--rs-unit-x1) * 2);position:relative;z-index:5}.slot--position-end{margin-inline-end:calc(var(--rs-unit-x1) * -1)}.icon{pointer-events:none}.affix{color:var(--rs-color-foreground-neutral-faded)}.affix.affix--position-start{padding-inline-end:var(--rs-text-field-gap)}.affix.affix--position-start:after{border-inline-end:1px solid var(--rs-color-border-neutral-faded);content:"";inset-block:var(--rs-unit-x1);inset-inline-end:0;position:absolute}.affix.affix--position-end{padding-inline-start:var(--rs-text-field-gap)}.affix.affix--position-end:after{border-inline-start:1px solid var(--rs-color-border-neutral-faded);content:"";inset-block:var(--rs-unit-x1);inset-inline-start:0;position:absolute}.root.--disabled{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled)}.root.--disabled,.root.--disabled .input{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.--size-medium{--rs-text-field-gap:var(--rs-unit-x2);--rs-text-field-line-height:var(--rs-line-height-body-3);border-radius:var(--rs-radius-small)}.--size-medium .input{padding-block:var(--rs-unit-x2)}.--size-medium .affix,.--size-medium .input{font-size:var(--rs-font-size-body-3);letter-spacing:var(--rs-letter-spacing-body-3);line-height:var(--rs-line-height-body-3)}.--size-large{--rs-text-field-gap:var(--rs-unit-x3);--rs-text-field-line-height:var(--rs-line-height-body-2);border-radius:var(--rs-radius-medium)}.--size-large .input{padding-block:var(--rs-unit-x3)}.--size-large .affix,.--size-large .input{font-size:var(--rs-font-size-body-2);letter-spacing:var(--rs-letter-spacing-body-2);line-height:var(--rs-line-height-body-2)}.--size-xlarge{--rs-text-field-gap:var(--rs-unit-x4);--rs-text-field-line-height:var(--rs-line-height-body-2);border-radius:var(--rs-radius-medium)}.--size-xlarge .input{padding-block:var(--rs-unit-x4)}.--size-xlarge .affix,.--size-xlarge .input{font-size:var(--rs-font-size-body-2);letter-spacing:var(--rs-letter-spacing-body-2);line-height:var(--rs-line-height-body-2)}.root.--variant-faded{background:var(--rs-color-background-neutral-faded);border-color:transparent}.root.--variant-faded:focus-within{border-color:var(--rs-color-border-primary)}.root.--variant-headless{background:transparent;border-color:transparent}.root.--variant-headless.--status-error,.root.--variant-headless.--status-error:focus-within,.root.--variant-headless:focus-within{border-color:transparent;box-shadow:none}.root.--status-error{border-color:var(--rs-color-border-critical)}.root.--status-error:focus-within{border-color:var(--rs-color-border-primary)}@media (--rs-viewport-s ) and (hover:none){.input{font-size:var(--rs-font-size-body-2)!important}}@media (--rs-viewport-m ){.--size-medium--m{--rs-text-field-gap:var(--rs-unit-x2);--rs-text-field-line-height:var(--rs-line-height-body-3);border-radius:var(--rs-radius-small)}.--size-medium--m .input{padding-block:var(--rs-unit-x2)}.--size-medium--m .affix,.--size-medium--m .input{font-size:var(--rs-font-size-body-3);letter-spacing:var(--rs-letter-spacing-body-3);line-height:var(--rs-line-height-body-3)}.--size-large--m{--rs-text-field-gap:var(--rs-unit-x3);--rs-text-field-line-height:var(--rs-line-height-body-2);border-radius:var(--rs-radius-medium)}.--size-large--m .input{padding-block:var(--rs-unit-x3)}.--size-large--m .affix,.--size-large--m .input{font-size:var(--rs-font-size-body-2);letter-spacing:var(--rs-letter-spacing-body-2);line-height:var(--rs-line-height-body-2)}.--size-xlarge--m{--rs-text-field-gap:var(--rs-unit-x4);--rs-text-field-line-height:var(--rs-line-height-body-2);border-radius:var(--rs-radius-medium)}.--size-xlarge--m .input{padding-block:var(--rs-unit-x4)}.--size-xlarge--m .affix,.--size-xlarge--m .input{font-size:var(--rs-font-size-body-2);letter-spacing:var(--rs-letter-spacing-body-2);line-height:var(--rs-line-height-body-2)}}@media (--rs-viewport-l ){.--size-medium--l{--rs-text-field-gap:var(--rs-unit-x2);--rs-text-field-line-height:var(--rs-line-height-body-3);border-radius:var(--rs-radius-small)}.--size-medium--l .input{padding-block:var(--rs-unit-x2)}.--size-medium--l .affix,.--size-medium--l .input{font-size:var(--rs-font-size-body-3);letter-spacing:var(--rs-letter-spacing-body-3);line-height:var(--rs-line-height-body-3)}.--size-large--l{--rs-text-field-gap:var(--rs-unit-x3);--rs-text-field-line-height:var(--rs-line-height-body-2);border-radius:var(--rs-radius-medium)}.--size-large--l .input{padding-block:var(--rs-unit-x3)}.--size-large--l .affix,.--size-large--l .input{font-size:var(--rs-font-size-body-2);letter-spacing:var(--rs-letter-spacing-body-2);line-height:var(--rs-line-height-body-2)}.--size-xlarge--l{--rs-text-field-gap:var(--rs-unit-x4);--rs-text-field-line-height:var(--rs-line-height-body-2);border-radius:var(--rs-radius-medium)}.--size-xlarge--l .input{padding-block:var(--rs-unit-x4)}.--size-xlarge--l .affix,.--size-xlarge--l .input{font-size:var(--rs-font-size-body-2);letter-spacing:var(--rs-letter-spacing-body-2);line-height:var(--rs-line-height-body-2)}}@media (--rs-viewport-xl ){.--size-medium--xl{--rs-text-field-gap:var(--rs-unit-x2);--rs-text-field-line-height:var(--rs-line-height-body-3);border-radius:var(--rs-radius-small)}.--size-medium--xl .input{padding-block:var(--rs-unit-x2)}.--size-medium--xl .affix,.--size-medium--xl .input{font-size:var(--rs-font-size-body-3);letter-spacing:var(--rs-letter-spacing-body-3);line-height:var(--rs-line-height-body-3)}.--size-large--xl{--rs-text-field-gap:var(--rs-unit-x3);--rs-text-field-line-height:var(--rs-line-height-body-2);border-radius:var(--rs-radius-medium)}.--size-large--xl .input{padding-block:var(--rs-unit-x3)}.--size-large--xl .affix,.--size-large--xl .input{font-size:var(--rs-font-size-body-2);letter-spacing:var(--rs-letter-spacing-body-2);line-height:var(--rs-line-height-body-2)}.--size-xlarge--xl{--rs-text-field-gap:var(--rs-unit-x4);--rs-text-field-line-height:var(--rs-line-height-body-2);border-radius:var(--rs-radius-medium)}.--size-xlarge--xl .input{padding-block:var(--rs-unit-x4)}.--size-xlarge--xl .affix,.--size-xlarge--xl .input{font-size:var(--rs-font-size-body-2);letter-spacing:var(--rs-letter-spacing-body-2);line-height:var(--rs-line-height-body-2)}}
|
@@ -15,7 +15,7 @@ export declare const value: () => import("react").JSX.Element;
|
|
15
15
|
export declare const variants: () => import("react").JSX.Element;
|
16
16
|
export declare const disabled: () => import("react").JSX.Element;
|
17
17
|
export declare const error: () => import("react").JSX.Element;
|
18
|
-
export declare const
|
18
|
+
export declare const attachments: () => import("react").JSX.Element;
|
19
19
|
export declare const size: () => import("react").JSX.Element;
|
20
20
|
export declare const affixes: () => import("react").JSX.Element;
|
21
21
|
export declare const slots: () => import("react").JSX.Element;
|
@@ -49,7 +49,7 @@ export const error = () => (<Example>
|
|
49
49
|
<TextField name="Name" placeholder="Enter your name" hasError/>
|
50
50
|
</Example.Item>
|
51
51
|
</Example>);
|
52
|
-
export const
|
52
|
+
export const attachments = () => (<Example>
|
53
53
|
<Example.Item title="icon">
|
54
54
|
<TextField name="Name" placeholder="Enter your name" value="Reshaped" icon={IconZap}/>
|
55
55
|
</Example.Item>
|
@@ -60,6 +60,10 @@ export const icon = () => (<Example>
|
|
60
60
|
<Example.Item title="width affixes">
|
61
61
|
<TextField name="Name" placeholder="Enter your name" value="Reshaped" endIcon={IconZap} icon={IconZap} prefix="Estimated value" suffix="m2"/>
|
62
62
|
</Example.Item>
|
63
|
+
|
64
|
+
<Example.Item title="multine">
|
65
|
+
<TextField name="Name" placeholder="Enter your name" value="Reshaped" endIcon={IconZap} icon={IconZap} prefix="Estimated value" suffix="m2" multiline/>
|
66
|
+
</Example.Item>
|
63
67
|
</Example>);
|
64
68
|
export const size = () => (<Example>
|
65
69
|
<Example.Item title="size: medium">
|
@@ -89,7 +93,7 @@ export const affixes = () => (<Example>
|
|
89
93
|
</Example>);
|
90
94
|
export const slots = () => (<Example>
|
91
95
|
<Example.Item title={["startSlot", "vertical and horizontal padding aligned"]}>
|
92
|
-
<TextField name="Name" placeholder="Enter your name" value="Reshaped" startSlot={<Placeholder h={
|
96
|
+
<TextField name="Name" placeholder="Enter your name" value="Reshaped" startSlot={<Placeholder h={20}/>}/>
|
93
97
|
</Example.Item>
|
94
98
|
<Example.Item title={["endSlot", "vertical and horizontal padding aligned"]}>
|
95
99
|
<TextField name="Name" placeholder="Enter your name" value="Reshaped" endSlot={<Button icon={IconZap} size="small" onClick={() => { }}/>}/>
|
@@ -4,11 +4,12 @@ import React from "react";
|
|
4
4
|
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
5
5
|
import { enableTransitions, disableTransitions, onNextFrame } from "../../utilities/animation.js";
|
6
6
|
import { GlobalColorModeContext } from "./Theme.context.js";
|
7
|
+
import { getRootThemeEl } from "./Theme.utilities.js";
|
7
8
|
const GlobalColorMode = (props) => {
|
8
9
|
const { defaultMode, children } = props;
|
9
10
|
const [mode, setMode] = React.useState(defaultMode || "light");
|
10
11
|
const changeColorMode = React.useCallback((targetMode) => {
|
11
|
-
|
12
|
+
getRootThemeEl().setAttribute("data-rs-color-mode", targetMode);
|
12
13
|
setMode((prevMode) => {
|
13
14
|
if (prevMode !== targetMode) {
|
14
15
|
// Avoid components styles animating when switching to another color mode
|
@@ -27,7 +28,7 @@ const GlobalColorMode = (props) => {
|
|
27
28
|
* This could happen if we're receiving the mode on the client but before React hydration
|
28
29
|
*/
|
29
30
|
useIsomorphicLayoutEffect(() => {
|
30
|
-
const nextColorMode =
|
31
|
+
const nextColorMode = getRootThemeEl().getAttribute("data-rs-color-mode");
|
31
32
|
if (nextColorMode)
|
32
33
|
changeColorMode(nextColorMode);
|
33
34
|
}, []);
|
@@ -4,10 +4,12 @@ import React from "react";
|
|
4
4
|
import { classNames } from "../../utilities/helpers.js";
|
5
5
|
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
6
6
|
import { ThemeContext } from "./Theme.context.js";
|
7
|
+
import { getRootThemeEl } from "./Theme.utilities.js";
|
7
8
|
import { useTheme, useGlobalColorMode } from "./useTheme.js";
|
8
9
|
import s from "./Theme.module.css";
|
9
|
-
const Theme = (props) => {
|
10
|
-
|
10
|
+
const Theme = (props) => _jsx(PrivateTheme, { ...props });
|
11
|
+
export const PrivateTheme = (props) => {
|
12
|
+
const { name, defaultName, colorMode, scoped, children, className } = props;
|
11
13
|
const [mounted, setMounted] = React.useState(false);
|
12
14
|
const [stateTheme, setStateTheme] = React.useState(defaultName);
|
13
15
|
const globalColorMode = useGlobalColorMode();
|
@@ -36,16 +38,15 @@ const Theme = (props) => {
|
|
36
38
|
useIsomorphicLayoutEffect(() => {
|
37
39
|
if (!document || !isRootProvider)
|
38
40
|
return;
|
39
|
-
const
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
const themeRootEl = getRootThemeEl();
|
42
|
+
const hasColorModeApplied = themeRootEl.getAttribute("data-rs-color-mode");
|
43
|
+
themeRootEl.setAttribute("data-rs-theme", usedTheme);
|
44
|
+
if (!hasColorModeApplied)
|
45
|
+
themeRootEl.setAttribute("data-rs-color-mode", usedColorMode);
|
44
46
|
return () => {
|
45
|
-
|
46
|
-
if (!hasColorModeApplied)
|
47
|
-
|
48
|
-
}
|
47
|
+
themeRootEl.removeAttribute("data-rs-theme");
|
48
|
+
if (!hasColorModeApplied)
|
49
|
+
themeRootEl.removeAttribute("data-rs-color-mode");
|
49
50
|
};
|
50
51
|
}, [usedTheme, usedColorMode, isRootProvider]);
|
51
52
|
const value = React.useMemo(() => ({
|
@@ -55,6 +56,6 @@ const Theme = (props) => {
|
|
55
56
|
setTheme,
|
56
57
|
setRootTheme,
|
57
58
|
}), [usedTheme, usedColorMode, setTheme, setRootTheme, rootTheme]);
|
58
|
-
return (_jsx(ThemeContext.Provider, { value: value, children: _jsx("div", { className: rootClassNames, "data-rs-theme": isRootProvider ? undefined : usedTheme, "data-rs-color-mode": isRootProvider || (!colorMode && !mounted) ? undefined : usedColorMode, children: children }) }));
|
59
|
+
return (_jsx(ThemeContext.Provider, { value: value, children: _jsx("div", { className: rootClassNames, "data-rs-root": scoped ? true : undefined, "data-rs-theme": isRootProvider ? undefined : usedTheme, "data-rs-color-mode": isRootProvider || (!colorMode && !mounted) ? undefined : usedColorMode, children: children }) }));
|
59
60
|
};
|
60
61
|
export default Theme;
|
@@ -20,7 +20,11 @@ export type Props = {
|
|
20
20
|
className?: G.ClassName;
|
21
21
|
children?: React.ReactNode;
|
22
22
|
};
|
23
|
+
export type PrivateProps = Props & {
|
24
|
+
scoped?: boolean;
|
25
|
+
};
|
23
26
|
export type GlobalColorModeProps = {
|
24
27
|
defaultMode?: ColorMode;
|
28
|
+
scoped?: boolean;
|
25
29
|
children?: React.ReactNode;
|
26
30
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const getRootThemeEl: () => Element;
|
@@ -0,0 +1 @@
|
|
1
|
+
export const getRootThemeEl = () => document.querySelector("[data-rs-root]") || document.documentElement;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { default } from "./Theme";
|
1
|
+
export { default, PrivateTheme } from "./Theme";
|
2
2
|
export { default as GlobalColorMode } from "./GlobalColorMode";
|
3
3
|
export { useTheme } from "./useTheme";
|
4
4
|
export type { Props as ThemeProps, GlobalColorModeProps } from "./Theme.types";
|
@@ -13,7 +13,7 @@ export type Props = {
|
|
13
13
|
text?: React.ReactNode;
|
14
14
|
children?: React.ReactNode;
|
15
15
|
actionsSlot?: React.ReactNode;
|
16
|
-
color?: "neutral" | "primary" | "critical" | "positive" | "inverted";
|
16
|
+
color?: "neutral" | "primary" | "critical" | "positive" | "warning" | "inverted";
|
17
17
|
className?: G.ClassName;
|
18
18
|
attributes?: G.Attributes<"div">;
|
19
19
|
};
|