reshaped 3.10.0-canary.5 → 3.10.0-canary.7
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/dist/bundle.css +1 -1
- package/dist/bundle.d.ts +4 -11
- package/dist/bundle.js +2 -2
- package/dist/components/Accordion/Accordion.types.d.ts +3 -2
- package/dist/components/Accordion/AccordionControlled.js +1 -2
- package/dist/components/Accordion/AccordionTrigger.js +1 -1
- package/dist/components/ActionBar/ActionBar.js +1 -1
- package/dist/components/ActionBar/ActionBar.types.d.ts +3 -2
- package/dist/components/Actionable/Actionable.d.ts +2 -2
- package/dist/components/Actionable/Actionable.js +1 -1
- package/dist/components/Actionable/Actionable.types.d.ts +1 -1
- package/dist/components/Actionable/index.d.ts +1 -1
- package/dist/components/Alert/Alert.types.d.ts +3 -2
- package/dist/components/Autocomplete/Autocomplete.js +3 -5
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +1 -1
- package/dist/components/Avatar/Avatar.types.d.ts +5 -4
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/Badge/Badge.types.d.ts +4 -4
- package/dist/components/Badge/BadgeContainer.js +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +3 -3
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.types.d.ts +3 -2
- package/dist/components/Button/ButtonGroup.js +1 -1
- package/dist/components/Calendar/CalendarDate.js +1 -1
- package/dist/components/Calendar/useCalendarKeyboardNavigation.js +1 -1
- package/dist/components/Card/Card.d.ts +6 -14
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/Card/Card.types.d.ts +4 -3
- package/dist/components/Carousel/Carousel.js +2 -4
- package/dist/components/Carousel/Carousel.types.d.ts +3 -2
- package/dist/components/Carousel/CarouselControl.js +1 -2
- package/dist/components/Checkbox/Checkbox.js +1 -2
- package/dist/components/Checkbox/Checkbox.types.d.ts +4 -3
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/Container/Container.types.d.ts +3 -2
- package/dist/components/ContextMenu/ContextMenu.js +1 -2
- package/dist/components/Dismissible/Dismissible.js +1 -1
- package/dist/components/Dismissible/Dismissible.types.d.ts +3 -3
- package/dist/components/Divider/Divider.js +1 -1
- package/dist/components/Divider/Divider.types.d.ts +3 -2
- package/dist/components/DropdownMenu/DropdownMenu.js +1 -3
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +1 -1
- package/dist/components/FileUpload/FileUpload.js +1 -2
- package/dist/components/FileUpload/FileUpload.types.d.ts +4 -3
- package/dist/components/Flyout/Flyout.module.css +1 -1
- package/dist/components/Flyout/Flyout.types.d.ts +9 -7
- package/dist/components/Flyout/FlyoutContent.js +3 -3
- package/dist/components/Flyout/FlyoutControlled.js +4 -7
- package/dist/components/Flyout/useFlyout.d.ts +2 -2
- package/dist/components/Flyout/useFlyout.js +2 -2
- package/dist/components/Flyout/utilities/safeArea.d.ts +2 -2
- package/dist/components/Grid/Grid.js +1 -1
- package/dist/components/Grid/Grid.types.d.ts +5 -4
- package/dist/components/Hidden/Hidden.js +1 -1
- package/dist/components/HiddenInput/HiddenInput.js +1 -1
- package/dist/components/HiddenInput/HiddenInput.types.d.ts +3 -2
- package/dist/components/Hotkey/Hotkey.js +1 -1
- package/dist/components/Hotkey/Hotkey.types.d.ts +3 -3
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Icon/Icon.types.d.ts +3 -2
- package/dist/components/Image/Image.js +1 -1
- package/dist/components/Image/Image.types.d.ts +5 -4
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/Loader/Loader.js +1 -1
- package/dist/components/Loader/Loader.types.d.ts +3 -2
- package/dist/components/MenuItem/MenuItem.js +1 -1
- package/dist/components/MenuItem/MenuItem.types.d.ts +3 -2
- package/dist/components/Modal/Modal.js +6 -6
- package/dist/components/Modal/Modal.types.d.ts +5 -4
- package/dist/components/NumberField/NumberFieldControlled.js +1 -2
- package/dist/components/Overlay/Overlay.js +7 -12
- package/dist/components/Overlay/Overlay.types.d.ts +5 -3
- package/dist/components/Pagination/Pagination.types.d.ts +3 -3
- package/dist/components/PinField/PinField.types.d.ts +4 -3
- package/dist/components/PinField/PinFieldControlled.js +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Popover/Popover.types.d.ts +1 -1
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/Progress/Progress.types.d.ts +3 -3
- package/dist/components/ProgressIndicator/ProgressIndicator.js +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.types.d.ts +3 -3
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/Radio/Radio.types.d.ts +4 -3
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +3 -2
- package/dist/components/Reshaped/Reshaped.js +4 -11
- package/dist/components/Reshaped/Reshaped.types.d.ts +3 -2
- package/dist/components/Resizable/Resizable.js +1 -1
- package/dist/components/Resizable/ResizableHandle.js +1 -1
- package/dist/components/Scrim/Scrim.js +1 -1
- package/dist/components/Scrim/Scrim.types.d.ts +4 -4
- package/dist/components/ScrollArea/ScrollArea.js +2 -4
- package/dist/components/ScrollArea/ScrollArea.types.d.ts +5 -3
- package/dist/components/Select/Select.types.d.ts +5 -4
- package/dist/components/Select/SelectNative.js +1 -1
- package/dist/components/Select/SelectRoot.js +1 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Skeleton/Skeleton.types.d.ts +3 -3
- package/dist/components/Slider/Slider.types.d.ts +3 -3
- package/dist/components/Slider/SliderControlled.js +2 -4
- package/dist/components/Slider/SliderThumb.js +1 -1
- package/dist/components/Stepper/Stepper.types.d.ts +5 -4
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Switch/Switch.types.d.ts +4 -3
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/Table.types.d.ts +12 -12
- package/dist/components/Tabs/Tabs.types.d.ts +6 -6
- package/dist/components/Tabs/TabsItem.js +2 -3
- package/dist/components/Tabs/TabsList.js +1 -4
- package/dist/components/Tabs/TabsPanel.js +2 -2
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/Text/Text.types.d.ts +3 -2
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/TextArea/TextArea.types.d.ts +5 -4
- package/dist/components/TextField/TextField.js +1 -1
- package/dist/components/TextField/TextField.types.d.ts +4 -3
- package/dist/components/Theme/GlobalColorMode.js +1 -1
- package/dist/components/Theme/Theme.js +1 -2
- package/dist/components/Theme/Theme.types.d.ts +2 -1
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/Timeline.types.d.ts +5 -5
- package/dist/components/Toast/Toast.types.d.ts +3 -3
- package/dist/components/Toast/ToastContainer.js +2 -3
- package/dist/components/Toast/ToastRegion.js +2 -2
- package/dist/components/ToggleButton/ToggleButtonUncontrolled.js +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroupControlled.js +1 -1
- package/dist/components/Tooltip/Tooltip.types.d.ts +1 -1
- package/dist/components/View/View.js +1 -1
- package/dist/components/View/View.types.d.ts +5 -4
- package/dist/components/_private/Aligner/Aligner.js +1 -1
- package/dist/components/_private/Aligner/Aligner.types.d.ts +3 -3
- package/dist/components/_private/Expandable/Expandable.js +2 -2
- package/dist/components/_private/Expandable/Expandable.types.d.ts +2 -2
- package/dist/components/_private/Portal/Portal.js +1 -2
- package/dist/hooks/_private/useDrag.js +2 -4
- package/dist/hooks/_private/useFadeSide.js +2 -3
- package/dist/hooks/_private/useSingletonViewport.d.ts +10 -0
- package/dist/hooks/_private/useSingletonViewport.js +52 -0
- package/dist/hooks/useResponsiveClientValue.js +15 -53
- package/dist/hooks/useViewport.d.ts +2 -0
- package/dist/hooks/useViewport.js +6 -0
- package/dist/index.d.ts +4 -11
- package/dist/index.js +2 -10
- package/dist/styles/mixin.d.ts +2 -2
- package/dist/styles/types.d.ts +2 -1
- package/dist/tests/ThemesPlayground.js +1 -1
- package/dist/types/global.d.ts +0 -15
- package/dist/utilities/props.d.ts +2 -1
- package/package.json +2 -2
- package/dist/core/Actionable/Actionable.d.ts +0 -4
- package/dist/core/Actionable/Actionable.js +0 -73
- package/dist/core/Actionable/Actionable.types.d.ts +0 -34
- package/dist/core/Actionable/Actionable.types.js +0 -1
- package/dist/core/Actionable/index.d.ts +0 -2
- package/dist/core/Actionable/index.js +0 -1
- package/dist/hooks/_private/useSingletonEnvironment.d.ts +0 -9
- package/dist/hooks/_private/useSingletonEnvironment.js +0 -33
- package/dist/hooks/_private/useSingletonHotkeys.d.ts +0 -35
- package/dist/hooks/_private/useSingletonHotkeys.js +0 -191
- package/dist/hooks/_private/useSingletonKeyboardMode.d.ts +0 -13
- package/dist/hooks/_private/useSingletonKeyboardMode.js +0 -58
- package/dist/hooks/useHandlerRef.d.ts +0 -8
- package/dist/hooks/useHandlerRef.js +0 -16
- package/dist/hooks/useHotkeys.d.ts +0 -11
- package/dist/hooks/useHotkeys.js +0 -27
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +0 -3
- package/dist/hooks/useIsomorphicLayoutEffect.js +0 -4
- package/dist/hooks/useKeyboardArrowNavigation.d.ts +0 -9
- package/dist/hooks/useKeyboardArrowNavigation.js +0 -62
- package/dist/hooks/useKeyboardMode.d.ts +0 -7
- package/dist/hooks/useKeyboardMode.js +0 -13
- package/dist/hooks/useOnClickOutside.d.ts +0 -5
- package/dist/hooks/useOnClickOutside.js +0 -63
- package/dist/hooks/useRTL.d.ts +0 -2
- package/dist/hooks/useRTL.js +0 -7
- package/dist/hooks/useScrollLock.d.ts +0 -10
- package/dist/hooks/useScrollLock.js +0 -25
- package/dist/hooks/useToggle.d.ts +0 -7
- package/dist/hooks/useToggle.js +0 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
2
2
|
export type Props = {
|
|
3
3
|
/** Value of the progress bar controlling the size of the fill */
|
|
4
4
|
value?: number;
|
|
@@ -15,7 +15,7 @@ export type Props = {
|
|
|
15
15
|
/** aria-label attribute for the root element */
|
|
16
16
|
ariaLabel?: string;
|
|
17
17
|
/** Additional classname for the root element */
|
|
18
|
-
className?:
|
|
18
|
+
className?: ClassName;
|
|
19
19
|
/** Additional attributes for the root element */
|
|
20
|
-
attributes?:
|
|
20
|
+
attributes?: Attributes<"div">;
|
|
21
21
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import s from "./ProgressIndicator.module.css";
|
|
5
5
|
const VISIBLE_ITEMS = 7;
|
|
6
6
|
const HALF_ITEMS = Math.floor(VISIBLE_ITEMS / 2);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
2
2
|
export type Props = {
|
|
3
3
|
/** Total amount of progress indicator dots */
|
|
4
4
|
total: number;
|
|
@@ -11,7 +11,7 @@ export type Props = {
|
|
|
11
11
|
/** aria-label attribute for the root element */
|
|
12
12
|
ariaLabel?: string;
|
|
13
13
|
/** Additional classname for the root element */
|
|
14
|
-
className?:
|
|
14
|
+
className?: ClassName;
|
|
15
15
|
/** Additional attributes for the root element */
|
|
16
|
-
attributes?:
|
|
16
|
+
attributes?: Attributes<"div">;
|
|
17
17
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import { useFormControl } from "../FormControl/index.js";
|
|
5
5
|
import HiddenInput from "../HiddenInput/index.js";
|
|
6
6
|
import { useRadioGroup } from "../RadioGroup/index.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
1
2
|
import type React from "react";
|
|
2
3
|
import type * as G from "../../types/global";
|
|
3
4
|
type BaseProps = {
|
|
@@ -20,11 +21,11 @@ type BaseProps = {
|
|
|
20
21
|
/** Callback when the input is blurred */
|
|
21
22
|
onBlur?: (e: React.FocusEvent) => void;
|
|
22
23
|
/** Additional classname for the root element */
|
|
23
|
-
className?:
|
|
24
|
+
className?: ClassName;
|
|
24
25
|
/** Additional attributes for the root element */
|
|
25
|
-
attributes?:
|
|
26
|
+
attributes?: Attributes<"label">;
|
|
26
27
|
/** Additional attributes for the input element */
|
|
27
|
-
inputAttributes?:
|
|
28
|
+
inputAttributes?: Attributes<"input">;
|
|
28
29
|
};
|
|
29
30
|
export type ControlledProps = BaseProps & {
|
|
30
31
|
checked: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
1
2
|
import type { RadioProps } from "../Radio";
|
|
2
3
|
import type React from "react";
|
|
3
4
|
import type * as G from "../../types/global";
|
|
@@ -15,9 +16,9 @@ type BaseProps = {
|
|
|
15
16
|
/** Callback when the input value changes */
|
|
16
17
|
onChange?: G.ChangeHandler<string>;
|
|
17
18
|
/** Additional classname for the root element */
|
|
18
|
-
className?:
|
|
19
|
+
className?: ClassName;
|
|
19
20
|
/** Additional attributes for the root element */
|
|
20
|
-
attributes?:
|
|
21
|
+
attributes?: Attributes<"div">;
|
|
21
22
|
};
|
|
22
23
|
export type ControlledProps = BaseProps & {
|
|
23
24
|
/** Value of the input element, enables controlled mode */
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { Reshaped as HeadlessReshaped, classNames } from "@reshaped/headless";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { GlobalColorMode, PrivateTheme } from "../Theme/index.js";
|
|
6
6
|
import { useGlobalColorMode } from "../Theme/useTheme.js";
|
|
7
7
|
import { ToastProvider } from "../Toast/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import { SingletonHotkeysProvider } from "../../hooks/_private/useSingletonHotkeys.js";
|
|
10
|
-
import { SingletonKeyboardModeProvider } from "../../hooks/_private/useSingletonKeyboardMode.js";
|
|
8
|
+
import { SingletonViewportProvider } from "../../hooks/_private/useSingletonViewport.js";
|
|
11
9
|
import s from "./Reshaped.module.css";
|
|
12
10
|
import "./Reshaped.css";
|
|
13
|
-
const ReshapedInner = (props) => {
|
|
14
|
-
const { children, defaultRTL, defaultViewport = "s", toastOptions } = props;
|
|
15
|
-
const rtlState = useSingletonEnvironment(defaultRTL);
|
|
16
|
-
return (_jsx(SingletonKeyboardModeProvider, { children: _jsx(SingletonEnvironmentContext.Provider, { value: { rtl: rtlState, defaultViewport }, children: _jsx(SingletonHotkeysProvider, { children: _jsx(ToastProvider, { options: toastOptions, children: children }) }) }) }));
|
|
17
|
-
};
|
|
18
11
|
const Reshaped = (props) => {
|
|
19
|
-
const { theme, defaultTheme = "reshaped", colorMode, defaultColorMode, scoped, className, } = props;
|
|
12
|
+
const { theme, defaultTheme = "reshaped", colorMode, defaultColorMode, defaultViewport, toastOptions, scoped, className, } = props;
|
|
20
13
|
const rootClassNames = classNames(s.root, className);
|
|
21
14
|
const scopeRef = React.useRef(null);
|
|
22
15
|
const parentGlobalColorMode = useGlobalColorMode();
|
|
23
|
-
return (_jsx(GlobalColorMode, { defaultMode: defaultColorMode || parentGlobalColorMode.mode || "light", mode: colorMode, scopeRef: !!parentGlobalColorMode && scoped ? scopeRef : undefined, children: _jsx(PrivateTheme, { name: theme, defaultName: defaultTheme, className: rootClassNames, scoped: scoped, scopeRef: !!parentGlobalColorMode && scoped ? scopeRef : undefined, children: _jsx(
|
|
16
|
+
return (_jsx(HeadlessReshaped, { children: _jsx(GlobalColorMode, { defaultMode: defaultColorMode || parentGlobalColorMode.mode || "light", mode: colorMode, scopeRef: !!parentGlobalColorMode && scoped ? scopeRef : undefined, children: _jsx(PrivateTheme, { name: theme, defaultName: defaultTheme, className: rootClassNames, scoped: scoped, scopeRef: !!parentGlobalColorMode && scoped ? scopeRef : undefined, children: _jsx(SingletonViewportProvider, { defaultViewport: defaultViewport, children: _jsx(ToastProvider, { options: toastOptions, children: props.children }) }) }) }) }));
|
|
24
17
|
};
|
|
25
18
|
Reshaped.displayName = "Reshaped";
|
|
26
19
|
export default Reshaped;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
1
2
|
import type { GlobalColorModeProps, ThemeProps } from "../Theme";
|
|
2
3
|
import type { ToastProviderProps } from "../Toast";
|
|
3
4
|
import type React from "react";
|
|
@@ -22,7 +23,7 @@ export type Props = {
|
|
|
22
23
|
/** Enable scoped mode for applications not using Reshaped provider at the application root */
|
|
23
24
|
scoped?: boolean;
|
|
24
25
|
/** Additional classname for the root element */
|
|
25
|
-
className?:
|
|
26
|
+
className?: ClassName;
|
|
26
27
|
/** Additional attributes for the root element */
|
|
27
|
-
attributes?:
|
|
28
|
+
attributes?: Attributes<"div">;
|
|
28
29
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import View from "../View/index.js";
|
|
6
6
|
import s from "./Resizable.module.css";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import View from "../View/index.js";
|
|
6
6
|
import useDrag from "../../hooks/_private/useDrag.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { classNames } from "@reshaped/
|
|
2
|
+
import { classNames } from "@reshaped/headless";
|
|
3
3
|
import View from "../View/index.js";
|
|
4
4
|
import s from "./Scrim.module.css";
|
|
5
5
|
const Scrim = (props) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
2
3
|
import type { ViewProps } from "../View";
|
|
3
|
-
import type * as G from "../../types/global";
|
|
4
4
|
export type Props = {
|
|
5
5
|
/** Node for inserting content */
|
|
6
6
|
children?: React.ReactNode;
|
|
@@ -9,9 +9,9 @@ export type Props = {
|
|
|
9
9
|
/** Component content position */
|
|
10
10
|
position?: "full" | "top" | "bottom" | "start" | "end";
|
|
11
11
|
/** Additional classname for the scrim element */
|
|
12
|
-
scrimClassName?:
|
|
12
|
+
scrimClassName?: ClassName;
|
|
13
13
|
/** Additional classname for the root element */
|
|
14
|
-
className?:
|
|
14
|
+
className?: ClassName;
|
|
15
15
|
/** Additional attributes for the root element */
|
|
16
|
-
attributes?:
|
|
16
|
+
attributes?: Attributes<"div">;
|
|
17
17
|
} & Pick<ViewProps, "paddingInline" | "paddingBlock" | "padding" | "borderRadius">;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
4
|
-
import { disableScroll, enableScroll } from "@reshaped/
|
|
3
|
+
import { classNames, useIsomorphicLayoutEffect, useHandlerRef } from "@reshaped/headless";
|
|
4
|
+
import { disableScroll, enableScroll } from "@reshaped/headless/internal";
|
|
5
5
|
import React, { forwardRef } from "react";
|
|
6
|
-
import useHandlerRef from "../../hooks/useHandlerRef.js";
|
|
7
|
-
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
8
6
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
9
7
|
import s from "./ScrollArea.module.css";
|
|
10
8
|
const ScrollAreaBar = (props) => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
2
|
+
import type { Coordinates } from "@reshaped/headless/internal";
|
|
1
3
|
import type React from "react";
|
|
2
4
|
import type * as G from "../../types/global";
|
|
3
5
|
export type Props = {
|
|
@@ -6,15 +8,15 @@ export type Props = {
|
|
|
6
8
|
/** Scrollbar visibility behavior based on the user interaction */
|
|
7
9
|
scrollbarDisplay?: "visible" | "hover" | "hidden";
|
|
8
10
|
/** Callback when the scroll area is scrolled */
|
|
9
|
-
onScroll?: (args:
|
|
11
|
+
onScroll?: (args: Coordinates) => void;
|
|
10
12
|
/** Height of the scroll area, literal css value or unit token multiplier */
|
|
11
13
|
height?: G.Responsive<string | number>;
|
|
12
14
|
/** Maximum height of the scroll area, literal css value or unit token multiplier */
|
|
13
15
|
maxHeight?: G.Responsive<string | number>;
|
|
14
16
|
/** Additional classname for the root element */
|
|
15
|
-
className?:
|
|
17
|
+
className?: ClassName;
|
|
16
18
|
/** Additional attributes for the root element */
|
|
17
|
-
attributes?:
|
|
19
|
+
attributes?: Attributes<"div">;
|
|
18
20
|
};
|
|
19
21
|
export type BarProps = {
|
|
20
22
|
ratio: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
3
3
|
import type { ActionableProps } from "../Actionable";
|
|
4
|
+
import type { DropdownMenuProps } from "../DropdownMenu";
|
|
4
5
|
import type { IconProps } from "../Icon";
|
|
5
6
|
import type { MenuItemProps } from "../MenuItem";
|
|
6
7
|
import type * as G from "../../types/global";
|
|
@@ -47,9 +48,9 @@ type BaseFragment = {
|
|
|
47
48
|
/** Callback when the trigger is clicked */
|
|
48
49
|
onClick?: ActionableProps["onClick"];
|
|
49
50
|
/** Additional classname for the root element */
|
|
50
|
-
className?:
|
|
51
|
+
className?: ClassName;
|
|
51
52
|
/** Additional attributes for the root element */
|
|
52
|
-
attributes?:
|
|
53
|
+
attributes?: Attributes<"div">;
|
|
53
54
|
/** Node for inserting children */
|
|
54
55
|
children?: React.ReactNode;
|
|
55
56
|
};
|
|
@@ -72,7 +73,7 @@ export type NativeFragment = {
|
|
|
72
73
|
/** Callback when the input is blurred */
|
|
73
74
|
onBlur?: (e: React.FocusEvent<HTMLSelectElement>) => void;
|
|
74
75
|
/** Additional attributes for the input element */
|
|
75
|
-
inputAttributes?:
|
|
76
|
+
inputAttributes?: Attributes<"select">;
|
|
76
77
|
};
|
|
77
78
|
export type NativeControlledFragment = {
|
|
78
79
|
value: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import s from "./Select.module.css";
|
|
6
6
|
import SelectEndContent from "./SelectEndContent.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import { useFormControl } from "../FormControl/index.js";
|
|
5
5
|
import useElementId from "../../hooks/useElementId.js";
|
|
6
6
|
import { responsiveClassNames } from "../../utilities/props.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
1
2
|
import type { ViewProps } from "../View";
|
|
2
|
-
import type * as G from "../../types/global";
|
|
3
3
|
export type Props = Pick<ViewProps, "width" | "height" | "borderRadius"> & {
|
|
4
4
|
/** Additional classname for the root element */
|
|
5
|
-
className?:
|
|
5
|
+
className?: ClassName;
|
|
6
6
|
/** Additional attributes for the root element */
|
|
7
|
-
attributes?:
|
|
7
|
+
attributes?: Attributes<"div">;
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
2
2
|
export type SingleChangeArgs = {
|
|
3
3
|
/** Value of the slider, enables controlled mode */
|
|
4
4
|
value: number;
|
|
@@ -131,9 +131,9 @@ type BaseProps = {
|
|
|
131
131
|
value: number;
|
|
132
132
|
}) => string) | false;
|
|
133
133
|
/** Additional classname for the root element */
|
|
134
|
-
className?:
|
|
134
|
+
className?: ClassName;
|
|
135
135
|
/** Additional attributes for the root element */
|
|
136
|
-
attributes?:
|
|
136
|
+
attributes?: Attributes<"div">;
|
|
137
137
|
};
|
|
138
138
|
export type ControlledProps = BaseProps & ((ControlledSingleProps & SingleSelectionProps) | (ControlledRangeProps & (RangeSelectionProps | NameRangeSelectionProps)));
|
|
139
139
|
export type UncontrolledProps = BaseProps & ((UncontrolledSingleProps & SingleSelectionProps) | (UncontrolledRangeProps & (RangeSelectionProps | NameRangeSelectionProps)));
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
4
|
-
import { disableScroll, enableScroll } from "@reshaped/
|
|
3
|
+
import { classNames, useRTL, useHandlerRef } from "@reshaped/headless";
|
|
4
|
+
import { disableScroll, enableScroll } from "@reshaped/headless/internal";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { useFormControl } from "../FormControl/index.js";
|
|
7
7
|
import useElementId from "../../hooks/useElementId.js";
|
|
8
|
-
import useHandlerRef from "../../hooks/useHandlerRef.js";
|
|
9
|
-
import useRTL from "../../hooks/useRTL.js";
|
|
10
8
|
import s from "./Slider.module.css";
|
|
11
9
|
import { applyStepToValue, getDragCoord, triggerChangeEvent } from "./Slider.utilities.js";
|
|
12
10
|
import SliderThumb from "./SliderThumb.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import Text from "../Text/index.js";
|
|
6
6
|
import Theme from "../Theme/index.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
1
2
|
import type React from "react";
|
|
2
3
|
import type * as G from "../../types/global";
|
|
3
4
|
export type Props = {
|
|
@@ -12,9 +13,9 @@ export type Props = {
|
|
|
12
13
|
/** Gap between items (default: 3) */
|
|
13
14
|
gap?: G.Responsive<number>;
|
|
14
15
|
/** Additional classname for the root element */
|
|
15
|
-
className?:
|
|
16
|
+
className?: ClassName;
|
|
16
17
|
/** Additional attributes for the root element */
|
|
17
|
-
attributes?:
|
|
18
|
+
attributes?: Attributes<"div">;
|
|
18
19
|
};
|
|
19
20
|
export type ItemProps = {
|
|
20
21
|
/** Id of the item, used for selecting the active item */
|
|
@@ -28,9 +29,9 @@ export type ItemProps = {
|
|
|
28
29
|
/** Node for inserting children */
|
|
29
30
|
children?: React.ReactNode;
|
|
30
31
|
/** Additional classname for the root element */
|
|
31
|
-
className?:
|
|
32
|
+
className?: ClassName;
|
|
32
33
|
/** Additional attributes for the root element */
|
|
33
|
-
attributes?:
|
|
34
|
+
attributes?: Attributes<"div">;
|
|
34
35
|
};
|
|
35
36
|
export type ItemPrivateProps = ItemProps & {
|
|
36
37
|
labelDisplay: Props["labelDisplay"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import { useFormControl } from "../FormControl/index.js";
|
|
5
5
|
import Text from "../Text/index.js";
|
|
6
6
|
import useElementId from "../../hooks/useElementId.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
2
3
|
import type * as G from "../../types/global";
|
|
3
4
|
type BaseProps = {
|
|
4
5
|
/** Node for inserting children */
|
|
@@ -20,11 +21,11 @@ type BaseProps = {
|
|
|
20
21
|
/** Callback when the switch is blurred */
|
|
21
22
|
onBlur?: (e: React.FocusEvent) => void;
|
|
22
23
|
/** Additional classname for the root element */
|
|
23
|
-
className?:
|
|
24
|
+
className?: ClassName;
|
|
24
25
|
/** Additional attributes for the root element */
|
|
25
|
-
attributes?:
|
|
26
|
+
attributes?: Attributes<"label">;
|
|
26
27
|
/** Additional attributes for the input element */
|
|
27
|
-
inputAttributes?:
|
|
28
|
+
inputAttributes?: Attributes<"input">;
|
|
28
29
|
};
|
|
29
30
|
export type ControlledProps = BaseProps & {
|
|
30
31
|
/** Default value of the switch, enables uncontrolled mode */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import React, { isValidElement } from "react";
|
|
5
5
|
import useFadeSide from "../../hooks/_private/useFadeSide.js";
|
|
6
6
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type
|
|
2
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
3
3
|
export type Props = {
|
|
4
4
|
/** Add border around the table */
|
|
5
5
|
border?: boolean;
|
|
@@ -8,9 +8,9 @@ export type Props = {
|
|
|
8
8
|
/** Node for inserting children */
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
/** Additional classname for the root element */
|
|
11
|
-
className?:
|
|
11
|
+
className?: ClassName;
|
|
12
12
|
/** Additional attributes for the root element */
|
|
13
|
-
attributes?:
|
|
13
|
+
attributes?: Attributes<"div">;
|
|
14
14
|
};
|
|
15
15
|
export type RowProps = {
|
|
16
16
|
/** Indicate that the row is selected */
|
|
@@ -20,9 +20,9 @@ export type RowProps = {
|
|
|
20
20
|
/** Node for inserting children */
|
|
21
21
|
children: React.ReactNode;
|
|
22
22
|
/** Additional classname for the row element */
|
|
23
|
-
className?:
|
|
23
|
+
className?: ClassName;
|
|
24
24
|
/** Additional attributes for the row element */
|
|
25
|
-
attributes?:
|
|
25
|
+
attributes?: Attributes<"tr">;
|
|
26
26
|
};
|
|
27
27
|
export type CellProps = {
|
|
28
28
|
/** Align the cell content */
|
|
@@ -46,29 +46,29 @@ export type CellProps = {
|
|
|
46
46
|
/** Node for inserting children */
|
|
47
47
|
children?: React.ReactNode;
|
|
48
48
|
/** Additional classname for the cell element */
|
|
49
|
-
className?:
|
|
49
|
+
className?: ClassName;
|
|
50
50
|
/** Additional attributes for the cell element */
|
|
51
|
-
attributes?:
|
|
51
|
+
attributes?: Attributes<"td">;
|
|
52
52
|
};
|
|
53
53
|
export type HeadingProps = CellProps & {
|
|
54
54
|
/** Additional attributes for the heading element */
|
|
55
|
-
attributes?:
|
|
55
|
+
attributes?: Attributes<"th">;
|
|
56
56
|
};
|
|
57
57
|
export type BodyProps = {
|
|
58
58
|
/** Node for inserting children */
|
|
59
59
|
children: React.ReactNode;
|
|
60
60
|
/** Additional classname for the body element */
|
|
61
|
-
className?:
|
|
61
|
+
className?: ClassName;
|
|
62
62
|
/** Additional attributes for the body element */
|
|
63
|
-
attributes?:
|
|
63
|
+
attributes?: Attributes<"tbody">;
|
|
64
64
|
};
|
|
65
65
|
export type HeadProps = {
|
|
66
66
|
/** Node for inserting children */
|
|
67
67
|
children: React.ReactNode;
|
|
68
68
|
/** Additional classname for the head element */
|
|
69
|
-
className?:
|
|
69
|
+
className?: ClassName;
|
|
70
70
|
/** Additional attributes for the head element */
|
|
71
|
-
attributes?:
|
|
71
|
+
attributes?: Attributes<"thead">;
|
|
72
72
|
};
|
|
73
73
|
export type PrivateCellProps = CellProps & {
|
|
74
74
|
tagName: "td" | "th";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
1
2
|
import type { IconProps } from "../Icon";
|
|
2
3
|
import type React from "react";
|
|
3
|
-
import type * as G from "../../types/global";
|
|
4
4
|
export type SelectionState = {
|
|
5
5
|
left: number;
|
|
6
6
|
top: number;
|
|
@@ -20,15 +20,15 @@ export type ItemProps = {
|
|
|
20
20
|
/** Disable the item user interaction */
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
/** Additional attributes for the item element */
|
|
23
|
-
attributes?:
|
|
23
|
+
attributes?: Attributes<"div">;
|
|
24
24
|
};
|
|
25
25
|
export type ListProps = {
|
|
26
26
|
/** Node for inserting children */
|
|
27
27
|
children?: React.ReactNode;
|
|
28
28
|
/** Additional classname for the list element */
|
|
29
|
-
className?:
|
|
29
|
+
className?: ClassName;
|
|
30
30
|
/** Additional attributes for the list element */
|
|
31
|
-
attributes?:
|
|
31
|
+
attributes?: Attributes<"div">;
|
|
32
32
|
};
|
|
33
33
|
export type PanelProps = {
|
|
34
34
|
/** Value of the panel used for the active panel selection */
|
|
@@ -36,9 +36,9 @@ export type PanelProps = {
|
|
|
36
36
|
/** Node for inserting children */
|
|
37
37
|
children?: React.ReactNode;
|
|
38
38
|
/** Additional classname for the panel element */
|
|
39
|
-
className?:
|
|
39
|
+
className?: ClassName;
|
|
40
40
|
/** Additional attributes for the panel element */
|
|
41
|
-
attributes?:
|
|
41
|
+
attributes?: Attributes<"div">;
|
|
42
42
|
};
|
|
43
43
|
export type BaseProps = {
|
|
44
44
|
/** Node for inserting children */
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
4
|
-
import { findParent } from "@reshaped/
|
|
3
|
+
import { classNames, useIsomorphicLayoutEffect } from "@reshaped/headless";
|
|
4
|
+
import { findParent } from "@reshaped/headless/internal";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import Actionable from "../Actionable/index.js";
|
|
7
7
|
import HiddenInput from "../HiddenInput/index.js";
|
|
8
8
|
import Icon from "../Icon/index.js";
|
|
9
9
|
import Text from "../Text/index.js";
|
|
10
|
-
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
11
10
|
import s from "./Tabs.module.css";
|
|
12
11
|
import { useTabs } from "./TabsContext.js";
|
|
13
12
|
const TabsItem = React.forwardRef((props, ref) => {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames, useIsomorphicLayoutEffect, useRTL, useKeyboardArrowNavigation, } from "@reshaped/headless";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import Actionable from "../Actionable/index.js";
|
|
6
6
|
import Icon from "../Icon/index.js";
|
|
7
7
|
import useFadeSide from "../../hooks/_private/useFadeSide.js";
|
|
8
|
-
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
9
|
-
import useKeyboardArrowNavigation from "../../hooks/useKeyboardArrowNavigation.js";
|
|
10
|
-
import useRTL from "../../hooks/useRTL.js";
|
|
11
8
|
import IconChevronLeft from "../../icons/ChevronLeft.js";
|
|
12
9
|
import IconChevronRight from "../../icons/ChevronRight.js";
|
|
13
10
|
import s from "./Tabs.module.css";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
4
|
-
import { getFocusableElements } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
|
+
import { getFocusableElements } from "@reshaped/headless/internal";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import s from "./Tabs.module.css";
|
|
7
7
|
import { useTabs } from "./TabsContext.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { classNames } from "@reshaped/
|
|
2
|
+
import { classNames } from "@reshaped/headless";
|
|
3
3
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
4
4
|
import { responsiveClassNames } from "../../utilities/props.js";
|
|
5
5
|
import s from "./Text.module.css";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
1
2
|
import type React from "react";
|
|
2
3
|
import type * as G from "../../types/global";
|
|
3
4
|
export type Variant = "title-1" | "title-2" | "title-3" | "title-4" | "title-5" | "title-6" | "featured-1" | "featured-2" | "featured-3" | "body-1" | "body-2" | "body-3" | "caption-1" | "caption-2";
|
|
@@ -23,9 +24,9 @@ export type Props<TagName extends keyof React.JSX.IntrinsicElements | void = voi
|
|
|
23
24
|
/** Node for inserting children */
|
|
24
25
|
children?: React.ReactNode;
|
|
25
26
|
/** Additional classname for the root element */
|
|
26
|
-
className?:
|
|
27
|
+
className?: ClassName;
|
|
27
28
|
/** Additional attributes for the root element */
|
|
28
|
-
attributes?:
|
|
29
|
+
attributes?: Attributes<TagName>;
|
|
29
30
|
/** Render as a different html tag */
|
|
30
31
|
as?: TagName extends keyof React.JSX.IntrinsicElements ? TagName : keyof React.JSX.IntrinsicElements;
|
|
31
32
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { useFormControl } from "../FormControl/index.js";
|
|
6
6
|
import useElementId from "../../hooks/useElementId.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { Attributes, ClassName } from "@reshaped/headless";
|
|
3
|
+
import type { FormControlProps } from "../FormControl";
|
|
3
4
|
import type * as G from "../../types/global";
|
|
4
5
|
type Size = G.Responsive<"medium" | "large" | "xlarge">;
|
|
5
6
|
type BaseProps = {
|
|
@@ -26,11 +27,11 @@ type BaseProps = {
|
|
|
26
27
|
/** Callback when the text area is blurred */
|
|
27
28
|
onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
|
28
29
|
/** Additional classname for the root element */
|
|
29
|
-
className?:
|
|
30
|
+
className?: ClassName;
|
|
30
31
|
/** Additional attributes for the root element */
|
|
31
|
-
attributes?:
|
|
32
|
+
attributes?: Attributes<"div">;
|
|
32
33
|
/** Additional attributes for the input element */
|
|
33
|
-
inputAttributes?:
|
|
34
|
+
inputAttributes?: Attributes<"textarea">;
|
|
34
35
|
/** Enable or disable the text area resizing, supports auto-sizing */
|
|
35
36
|
resize?: "none" | "auto";
|
|
36
37
|
} & Pick<FormControlProps, "hasError">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "@reshaped/
|
|
3
|
+
import { classNames } from "@reshaped/headless";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { useFormControl } from "../FormControl/index.js";
|
|
6
6
|
import Icon from "../Icon/index.js";
|