reshaped 3.9.1-canary.3 → 3.10.0-canary.10

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.
Files changed (229) hide show
  1. package/dist/bundle.css +1 -1
  2. package/dist/bundle.d.ts +5 -12
  3. package/dist/bundle.js +2 -2
  4. package/dist/cli/theming/tailwind.js +1 -0
  5. package/dist/components/Accordion/Accordion.types.d.ts +3 -2
  6. package/dist/components/Accordion/AccordionControlled.js +1 -2
  7. package/dist/components/Accordion/AccordionTrigger.js +1 -1
  8. package/dist/components/ActionBar/ActionBar.js +2 -1
  9. package/dist/components/ActionBar/ActionBar.types.d.ts +3 -2
  10. package/dist/components/Actionable/Actionable.d.ts +2 -2
  11. package/dist/components/Actionable/Actionable.js +1 -1
  12. package/dist/components/Actionable/Actionable.types.d.ts +1 -1
  13. package/dist/components/Actionable/index.d.ts +1 -1
  14. package/dist/components/Alert/Alert.types.d.ts +3 -2
  15. package/dist/components/Autocomplete/Autocomplete.js +3 -5
  16. package/dist/components/Autocomplete/Autocomplete.types.d.ts +1 -1
  17. package/dist/components/Avatar/Avatar.js +2 -1
  18. package/dist/components/Avatar/Avatar.types.d.ts +5 -4
  19. package/dist/components/Badge/Badge.js +1 -1
  20. package/dist/components/Badge/Badge.types.d.ts +4 -4
  21. package/dist/components/Badge/BadgeContainer.js +1 -1
  22. package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
  23. package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +3 -3
  24. package/dist/components/Button/Button.js +2 -1
  25. package/dist/components/Button/Button.types.d.ts +3 -2
  26. package/dist/components/Button/ButtonGroup.js +1 -1
  27. package/dist/components/Calendar/CalendarDate.js +1 -1
  28. package/dist/components/Calendar/useCalendarKeyboardNavigation.js +1 -1
  29. package/dist/components/Card/Card.d.ts +6 -14
  30. package/dist/components/Card/Card.js +1 -1
  31. package/dist/components/Card/Card.types.d.ts +4 -3
  32. package/dist/components/Carousel/Carousel.js +3 -4
  33. package/dist/components/Carousel/Carousel.types.d.ts +3 -2
  34. package/dist/components/Carousel/CarouselControl.js +1 -2
  35. package/dist/components/Checkbox/Checkbox.js +2 -2
  36. package/dist/components/Checkbox/Checkbox.types.d.ts +4 -3
  37. package/dist/components/Container/Container.js +1 -1
  38. package/dist/components/Container/Container.types.d.ts +3 -2
  39. package/dist/components/ContextMenu/ContextMenu.js +1 -2
  40. package/dist/components/Dismissible/Dismissible.js +1 -1
  41. package/dist/components/Dismissible/Dismissible.types.d.ts +3 -3
  42. package/dist/components/Divider/Divider.js +2 -1
  43. package/dist/components/Divider/Divider.types.d.ts +3 -2
  44. package/dist/components/DropdownMenu/DropdownMenu.js +1 -3
  45. package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +1 -1
  46. package/dist/components/FileUpload/FileUpload.js +1 -2
  47. package/dist/components/FileUpload/FileUpload.types.d.ts +4 -3
  48. package/dist/components/Flyout/Flyout.module.css +1 -1
  49. package/dist/components/Flyout/Flyout.types.d.ts +9 -7
  50. package/dist/components/Flyout/FlyoutContent.js +3 -3
  51. package/dist/components/Flyout/FlyoutControlled.js +4 -6
  52. package/dist/components/Flyout/useFlyout.d.ts +2 -2
  53. package/dist/components/Flyout/useFlyout.js +5 -5
  54. package/dist/components/Flyout/utilities/safeArea.d.ts +2 -2
  55. package/dist/components/Flyout/utilities/safeArea.js +0 -14
  56. package/dist/components/Grid/Grid.js +2 -1
  57. package/dist/components/Grid/Grid.types.d.ts +5 -4
  58. package/dist/components/Hidden/Hidden.js +2 -1
  59. package/dist/components/HiddenInput/HiddenInput.js +1 -1
  60. package/dist/components/HiddenInput/HiddenInput.types.d.ts +3 -2
  61. package/dist/components/Hotkey/Hotkey.js +1 -1
  62. package/dist/components/Hotkey/Hotkey.types.d.ts +3 -3
  63. package/dist/components/Icon/Icon.js +1 -1
  64. package/dist/components/Icon/Icon.types.d.ts +3 -2
  65. package/dist/components/Image/Image.js +1 -1
  66. package/dist/components/Image/Image.types.d.ts +5 -4
  67. package/dist/components/Link/Link.js +1 -1
  68. package/dist/components/Loader/Loader.js +2 -1
  69. package/dist/components/Loader/Loader.types.d.ts +3 -2
  70. package/dist/components/MenuItem/MenuItem.js +2 -1
  71. package/dist/components/MenuItem/MenuItem.types.d.ts +3 -2
  72. package/dist/components/Modal/Modal.js +7 -6
  73. package/dist/components/Modal/Modal.types.d.ts +5 -4
  74. package/dist/components/NumberField/NumberFieldControlled.js +1 -2
  75. package/dist/components/Overlay/Overlay.js +7 -12
  76. package/dist/components/Overlay/Overlay.types.d.ts +5 -3
  77. package/dist/components/Pagination/Pagination.types.d.ts +3 -3
  78. package/dist/components/PinField/PinField.types.d.ts +4 -3
  79. package/dist/components/PinField/PinFieldControlled.js +1 -1
  80. package/dist/components/Popover/Popover.js +1 -1
  81. package/dist/components/Popover/Popover.types.d.ts +1 -1
  82. package/dist/components/Progress/Progress.js +1 -1
  83. package/dist/components/Progress/Progress.types.d.ts +3 -3
  84. package/dist/components/ProgressIndicator/ProgressIndicator.js +1 -1
  85. package/dist/components/ProgressIndicator/ProgressIndicator.types.d.ts +3 -3
  86. package/dist/components/Radio/Radio.js +2 -1
  87. package/dist/components/Radio/Radio.types.d.ts +4 -3
  88. package/dist/components/RadioGroup/RadioGroup.types.d.ts +3 -2
  89. package/dist/components/Reshaped/Reshaped.js +4 -11
  90. package/dist/components/Reshaped/Reshaped.types.d.ts +3 -2
  91. package/dist/components/Resizable/Resizable.js +1 -1
  92. package/dist/components/Resizable/ResizableHandle.js +1 -1
  93. package/dist/components/Scrim/Scrim.js +1 -1
  94. package/dist/components/Scrim/Scrim.types.d.ts +4 -4
  95. package/dist/components/ScrollArea/ScrollArea.js +2 -4
  96. package/dist/components/ScrollArea/ScrollArea.types.d.ts +5 -3
  97. package/dist/components/Select/Select.types.d.ts +5 -4
  98. package/dist/components/Select/SelectNative.js +1 -1
  99. package/dist/components/Select/SelectRoot.js +2 -1
  100. package/dist/components/Skeleton/Skeleton.js +1 -1
  101. package/dist/components/Skeleton/Skeleton.types.d.ts +3 -3
  102. package/dist/components/Slider/Slider.types.d.ts +3 -3
  103. package/dist/components/Slider/Slider.utilities.d.ts +7 -0
  104. package/dist/components/Slider/Slider.utilities.js +11 -0
  105. package/dist/components/Slider/SliderControlled.js +15 -8
  106. package/dist/components/Slider/SliderThumb.js +1 -1
  107. package/dist/components/Stepper/Stepper.types.d.ts +5 -4
  108. package/dist/components/Switch/Switch.js +2 -1
  109. package/dist/components/Switch/Switch.types.d.ts +4 -3
  110. package/dist/components/Table/Table.js +2 -1
  111. package/dist/components/Table/Table.types.d.ts +12 -12
  112. package/dist/components/Tabs/Tabs.types.d.ts +6 -6
  113. package/dist/components/Tabs/TabsItem.js +2 -3
  114. package/dist/components/Tabs/TabsList.js +1 -4
  115. package/dist/components/Tabs/TabsPanel.js +2 -2
  116. package/dist/components/Text/Text.js +2 -1
  117. package/dist/components/Text/Text.types.d.ts +3 -2
  118. package/dist/components/TextArea/TextArea.js +2 -1
  119. package/dist/components/TextArea/TextArea.types.d.ts +5 -4
  120. package/dist/components/TextField/TextField.js +2 -1
  121. package/dist/components/TextField/TextField.types.d.ts +4 -3
  122. package/dist/components/Theme/GlobalColorMode.js +1 -1
  123. package/dist/components/Theme/Theme.js +1 -2
  124. package/dist/components/Theme/Theme.types.d.ts +2 -1
  125. package/dist/components/Timeline/Timeline.js +1 -1
  126. package/dist/components/Timeline/Timeline.types.d.ts +5 -5
  127. package/dist/components/Toast/Toast.types.d.ts +3 -3
  128. package/dist/components/Toast/ToastContainer.js +2 -2
  129. package/dist/components/Toast/ToastRegion.js +2 -2
  130. package/dist/components/ToggleButton/ToggleButtonUncontrolled.js +1 -1
  131. package/dist/components/ToggleButtonGroup/ToggleButtonGroupControlled.js +1 -1
  132. package/dist/components/Tooltip/Tooltip.types.d.ts +1 -1
  133. package/dist/components/View/View.js +2 -1
  134. package/dist/components/View/View.types.d.ts +5 -4
  135. package/dist/components/_private/Aligner/Aligner.js +1 -1
  136. package/dist/components/_private/Aligner/Aligner.types.d.ts +3 -3
  137. package/dist/components/_private/Expandable/Expandable.js +2 -2
  138. package/dist/components/_private/Expandable/Expandable.types.d.ts +2 -2
  139. package/dist/components/_private/Portal/Portal.js +1 -2
  140. package/dist/hooks/_private/useDrag.js +2 -4
  141. package/dist/hooks/_private/useFadeSide.js +2 -3
  142. package/dist/hooks/_private/useSingletonViewport.d.ts +10 -0
  143. package/dist/hooks/_private/useSingletonViewport.js +52 -0
  144. package/dist/hooks/useResponsiveClientValue.js +15 -53
  145. package/dist/hooks/useViewport.d.ts +2 -0
  146. package/dist/hooks/useViewport.js +6 -0
  147. package/dist/index.d.ts +5 -12
  148. package/dist/index.js +3 -11
  149. package/dist/styles/mixin.d.ts +2 -2
  150. package/dist/styles/types.d.ts +2 -1
  151. package/dist/tests/ThemesPlayground.js +1 -1
  152. package/dist/themes/figma/tailwind.css +1 -1
  153. package/dist/themes/fragments/twitter/tailwind.css +1 -1
  154. package/dist/themes/reshaped/tailwind.css +1 -1
  155. package/dist/themes/slate/tailwind.css +1 -1
  156. package/dist/types/global.d.ts +0 -15
  157. package/dist/utilities/helpers.d.ts +0 -1
  158. package/dist/utilities/helpers.js +0 -14
  159. package/dist/utilities/props.d.ts +2 -5
  160. package/dist/utilities/props.js +0 -18
  161. package/package.json +4 -4
  162. package/dist/core/Actionable/Actionable.d.ts +0 -4
  163. package/dist/core/Actionable/Actionable.js +0 -73
  164. package/dist/core/Actionable/Actionable.types.d.ts +0 -34
  165. package/dist/core/Actionable/Actionable.types.js +0 -1
  166. package/dist/core/Actionable/index.d.ts +0 -2
  167. package/dist/core/Actionable/index.js +0 -1
  168. package/dist/hooks/_private/useSingletonEnvironment.d.ts +0 -9
  169. package/dist/hooks/_private/useSingletonEnvironment.js +0 -33
  170. package/dist/hooks/_private/useSingletonHotkeys.d.ts +0 -35
  171. package/dist/hooks/_private/useSingletonHotkeys.js +0 -191
  172. package/dist/hooks/_private/useSingletonKeyboardMode.d.ts +0 -13
  173. package/dist/hooks/_private/useSingletonKeyboardMode.js +0 -58
  174. package/dist/hooks/useHandlerRef.d.ts +0 -8
  175. package/dist/hooks/useHandlerRef.js +0 -16
  176. package/dist/hooks/useHotkeys.d.ts +0 -11
  177. package/dist/hooks/useHotkeys.js +0 -27
  178. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +0 -3
  179. package/dist/hooks/useIsomorphicLayoutEffect.js +0 -4
  180. package/dist/hooks/useKeyboardArrowNavigation.d.ts +0 -9
  181. package/dist/hooks/useKeyboardArrowNavigation.js +0 -62
  182. package/dist/hooks/useKeyboardMode.d.ts +0 -7
  183. package/dist/hooks/useKeyboardMode.js +0 -13
  184. package/dist/hooks/useOnClickOutside.d.ts +0 -5
  185. package/dist/hooks/useOnClickOutside.js +0 -63
  186. package/dist/hooks/useRTL.d.ts +0 -2
  187. package/dist/hooks/useRTL.js +0 -7
  188. package/dist/hooks/useScrollLock.d.ts +0 -10
  189. package/dist/hooks/useScrollLock.js +0 -25
  190. package/dist/hooks/useToggle.d.ts +0 -7
  191. package/dist/hooks/useToggle.js +0 -19
  192. package/dist/utilities/Chain.d.ts +0 -20
  193. package/dist/utilities/Chain.js +0 -60
  194. package/dist/utilities/a11y/TrapFocus.d.ts +0 -28
  195. package/dist/utilities/a11y/TrapFocus.js +0 -162
  196. package/dist/utilities/a11y/TrapScreenReader.d.ts +0 -15
  197. package/dist/utilities/a11y/TrapScreenReader.js +0 -42
  198. package/dist/utilities/a11y/focus.d.ts +0 -38
  199. package/dist/utilities/a11y/focus.js +0 -101
  200. package/dist/utilities/a11y/index.d.ts +0 -4
  201. package/dist/utilities/a11y/index.js +0 -3
  202. package/dist/utilities/a11y/keyboardMode.d.ts +0 -3
  203. package/dist/utilities/a11y/keyboardMode.js +0 -10
  204. package/dist/utilities/a11y/types.d.ts +0 -24
  205. package/dist/utilities/a11y/types.js +0 -1
  206. package/dist/utilities/css.d.ts +0 -7
  207. package/dist/utilities/css.js +0 -18
  208. package/dist/utilities/dom/event.d.ts +0 -7
  209. package/dist/utilities/dom/event.js +0 -11
  210. package/dist/utilities/dom/find.d.ts +0 -10
  211. package/dist/utilities/dom/find.js +0 -37
  212. package/dist/utilities/dom/index.d.ts +0 -3
  213. package/dist/utilities/dom/index.js +0 -3
  214. package/dist/utilities/dom/shadowDom.d.ts +0 -1
  215. package/dist/utilities/dom/shadowDom.js +0 -4
  216. package/dist/utilities/platform.d.ts +0 -1
  217. package/dist/utilities/platform.js +0 -16
  218. package/dist/utilities/scroll/disable.d.ts +0 -7
  219. package/dist/utilities/scroll/disable.js +0 -15
  220. package/dist/utilities/scroll/helpers.d.ts +0 -1
  221. package/dist/utilities/scroll/helpers.js +0 -17
  222. package/dist/utilities/scroll/index.d.ts +0 -2
  223. package/dist/utilities/scroll/index.js +0 -2
  224. package/dist/utilities/scroll/lock.d.ts +0 -5
  225. package/dist/utilities/scroll/lock.js +0 -32
  226. package/dist/utilities/scroll/lockSafari.d.ts +0 -2
  227. package/dist/utilities/scroll/lockSafari.js +0 -20
  228. package/dist/utilities/scroll/lockStandard.d.ts +0 -4
  229. package/dist/utilities/scroll/lockStandard.js +0 -15
@@ -1,19 +1,14 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { TrapFocus, useHotkeys, useIsomorphicLayoutEffect, useHandlerRef, useScrollLock, useToggle, } from "@reshaped/headless";
4
+ import { classNames } from "@reshaped/headless";
3
5
  import React from "react";
4
6
  import Portal from "../_private/Portal/index.js";
5
7
  import useIsDismissible from "../../hooks/_private/useIsDismissible.js";
6
- import useHandlerRef from "../../hooks/useHandlerRef.js";
7
- import useHotkeys from "../../hooks/useHotkeys.js";
8
- import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
9
- import useScrollLock from "../../hooks/useScrollLock.js";
10
- import useToggle from "../../hooks/useToggle.js";
11
- import { TrapFocus } from "../../utilities/a11y/index.js";
12
8
  import { onNextFrame } from "../../utilities/animation.js";
13
- import { classNames } from "../../utilities/props.js";
14
9
  import s from "./Overlay.module.css";
15
10
  const Overlay = (props) => {
16
- const { active, children, transparent, blurred, overflow, onClose, onOpen, onAfterClose, onAfterOpen, disableCloseOnClick, containerRef, className, attributes, } = props;
11
+ const { active, children, transparent, blurred, overflow, onClose, onOpen, onAfterClose, onAfterOpen, disableCloseOnClick, containerRef, contained, className, attributes, } = props;
17
12
  // Selectors wrapped with refs to simplify working with useEffect dependency array
18
13
  const onCloseRef = useHandlerRef(onClose);
19
14
  const onOpenRef = useHandlerRef(onOpen);
@@ -32,7 +27,8 @@ const Overlay = (props) => {
32
27
  const { active: rendered, activate: render, deactivate: remove } = useToggle(active || false);
33
28
  const { active: visible, activate: show, deactivate: hide } = useToggle(active || false);
34
29
  const isDismissible = useIsDismissible({ active, contentRef, hasTrigger: false });
35
- const rootClassNames = classNames(s.root, visible && s["--visible"], isTransparent && s["--click-through"], blurred && s["--blurred"], animated && s["--animated"], containerRef && s["--contained"], overflow === "auto" && s["--overflow-auto"], className);
30
+ const shouldBeContained = containerRef && contained !== false;
31
+ const rootClassNames = classNames(s.root, visible && s["--visible"], isTransparent && s["--click-through"], blurred && s["--blurred"], animated && s["--animated"], shouldBeContained && s["--contained"], overflow === "auto" && s["--overflow-auto"], className);
36
32
  const isInsideContent = (el) => {
37
33
  if (!contentRef.current)
38
34
  return;
@@ -100,9 +96,8 @@ const Overlay = (props) => {
100
96
  const containerEl = containerRef?.current;
101
97
  if (containerEl) {
102
98
  originalOverflowRef.current = containerEl.style.overflow;
103
- // eslint-disable-next-line react-hooks/immutability
104
- containerEl.style.overflow = "hidden";
105
- containerEl.style.isolation = "isolate";
99
+ containerEl.style.setProperty("overflow", "hidden");
100
+ containerEl.style.setProperty("isolation", "isolate");
106
101
  setOffset([containerEl.scrollLeft, containerEl.scrollTop]);
107
102
  }
108
103
  trapFocus.trap(contentRef.current, {
@@ -1,5 +1,5 @@
1
+ import type { Attributes, ClassName } from "@reshaped/headless";
1
2
  import type React from "react";
2
- import type * as G from "../../types/global";
3
3
  export type CloseReason = "overlay-click" | "escape-key";
4
4
  export type Props = {
5
5
  /** Make the overlay transparent */
@@ -28,8 +28,10 @@ export type Props = {
28
28
  disableCloseOnClick?: boolean;
29
29
  /** Element to render the component in */
30
30
  containerRef?: React.RefObject<HTMLElement | null>;
31
+ /** Contain the component within the container element. Defaults to true when containerRef is provided */
32
+ contained?: boolean;
31
33
  /** Additional classname for the root element */
32
- className?: G.ClassName;
34
+ className?: ClassName;
33
35
  /** Additional attributes for the root element */
34
- attributes?: G.Attributes<"div">;
36
+ attributes?: Attributes<"div">;
35
37
  };
@@ -1,4 +1,4 @@
1
- import type * as G from "../../types/global";
1
+ import type { Attributes, ClassName } from "@reshaped/headless";
2
2
  export type BaseProps = {
3
3
  /** Total number of pages available */
4
4
  total: number;
@@ -15,9 +15,9 @@ export type BaseProps = {
15
15
  /** aria-label attribute for the next page button */
16
16
  nextAriaLabel: string;
17
17
  /** Additional classname for the root element */
18
- className?: G.ClassName;
18
+ className?: ClassName;
19
19
  /** Additional attributes for the root element */
20
- attributes?: G.Attributes<"div">;
20
+ attributes?: Attributes<"div">;
21
21
  };
22
22
  export type ControlledProps = BaseProps & {
23
23
  /** Currently selected page number, starts with 1, enables controlled mode */
@@ -1,3 +1,4 @@
1
+ import type { Attributes, ClassName } from "@reshaped/headless";
1
2
  import type * as G from "../../types/global";
2
3
  export type Size = "small" | "medium" | "large" | "xlarge";
3
4
  type BaseProps = {
@@ -14,11 +15,11 @@ type BaseProps = {
14
15
  /** Callback when the input value changes */
15
16
  onChange?: G.ChangeHandler<string>;
16
17
  /** Additional attributes for the input element */
17
- inputAttributes?: G.Attributes<"input">;
18
+ inputAttributes?: Attributes<"input">;
18
19
  /** Additional classname for the root element */
19
- className?: G.ClassName;
20
+ className?: ClassName;
20
21
  /** Additional attributes for the root element */
21
- attributes?: G.Attributes<"div">;
22
+ attributes?: Attributes<"div">;
22
23
  };
23
24
  export type ControlledProps = BaseProps & {
24
25
  /** Value of the input element, enables controlled mode */
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useHotkeys } from "@reshaped/headless";
3
4
  import React from "react";
4
5
  import { useFormControl } from "../FormControl/index.js";
5
6
  import Text from "../Text/index.js";
6
7
  import View from "../View/index.js";
7
8
  import * as keys from "../../constants/keys.js";
8
- import useHotkeys from "../../hooks/useHotkeys.js";
9
9
  import { onNextFrame } from "../../utilities/animation.js";
10
10
  import { responsivePropDependency } from "../../utilities/props.js";
11
11
  import { regExpNumericChar, regExpAlphabeticChar, regExpAlphaNumericChar, } from "./PinField.constants.js";
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { classNames } from "@reshaped/headless";
2
3
  import Dismissible from "../Dismissible/index.js";
3
4
  import Flyout, { useFlyoutContext } from "../Flyout/index.js";
4
5
  import { resolveMixin } from "../../styles/mixin.js";
5
- import { classNames } from "../../utilities/props.js";
6
6
  import s from "./Popover.module.css";
7
7
  const Popover = (props) => {
8
8
  const { width, variant = "elevated", triggerType = "click", position = "bottom", elevation, borderRadius, ...flyoutProps } = props;
@@ -1,7 +1,7 @@
1
1
  import type { FlyoutProps, FlyoutInstance } from "../Flyout";
2
2
  import type React from "react";
3
3
  export type Instance = FlyoutInstance;
4
- export type Props = Pick<FlyoutProps, "id" | "position" | "forcePosition" | "fallbackPositions" | "fallbackAdjustLayout" | "fallbackMinWidth" | "fallbackMinHeight" | "onOpen" | "onClose" | "width" | "trapFocusMode" | "active" | "defaultActive" | "contentGap" | "contentShift" | "contentMaxHeight" | "instanceRef" | "triggerType" | "disableHideAnimation" | "disableContentHover" | "disableCloseOnOutsideClick" | "autoFocus" | "containerRef" | "positionRef" | "initialFocusRef" | "originCoordinates"> & {
4
+ export type Props = Pick<FlyoutProps, "id" | "position" | "forcePosition" | "fallbackPositions" | "fallbackAdjustLayout" | "fallbackMinWidth" | "fallbackMinHeight" | "onOpen" | "onClose" | "width" | "trapFocusMode" | "active" | "defaultActive" | "contentGap" | "contentShift" | "contentMaxHeight" | "contentZIndex" | "instanceRef" | "triggerType" | "disableHideAnimation" | "disableContentHover" | "disableCloseOnOutsideClick" | "autoFocus" | "containerRef" | "positionRef" | "initialFocusRef" | "originCoordinates"> & {
5
5
  /** Node for inserting children */
6
6
  children?: React.ReactNode;
7
7
  /** Content element padding, unit token multiplier */
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { classNames } from "../../utilities/props.js";
2
+ import { classNames } from "@reshaped/headless";
3
3
  import s from "./Progress.module.css";
4
4
  const Progress = (props) => {
5
5
  const { value = 0, min = 0, max = 100, color = "primary", size = "medium", duration, ariaLabel, className, attributes, } = props;
@@ -1,4 +1,4 @@
1
- import type * as G from "../../types/global";
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?: G.ClassName;
18
+ className?: ClassName;
19
19
  /** Additional attributes for the root element */
20
- attributes?: G.Attributes<"div">;
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 "../../utilities/props.js";
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 * as G from "../../types/global";
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?: G.ClassName;
14
+ className?: ClassName;
15
15
  /** Additional attributes for the root element */
16
- attributes?: G.Attributes<"div">;
16
+ attributes?: Attributes<"div">;
17
17
  };
@@ -1,10 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { classNames } from "@reshaped/headless";
3
4
  import { useFormControl } from "../FormControl/index.js";
4
5
  import HiddenInput from "../HiddenInput/index.js";
5
6
  import { useRadioGroup } from "../RadioGroup/index.js";
6
7
  import Text from "../Text/index.js";
7
- import { classNames, responsiveClassNames, responsivePropDependency } from "../../utilities/props.js";
8
+ import { responsiveClassNames, responsivePropDependency } from "../../utilities/props.js";
8
9
  import s from "./Radio.module.css";
9
10
  const Radio = (props) => {
10
11
  const { children, value, onChange, onFocus, onBlur, size = "medium", className, attributes, inputAttributes, } = props;
@@ -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?: G.ClassName;
24
+ className?: ClassName;
24
25
  /** Additional attributes for the root element */
25
- attributes?: G.Attributes<"label">;
26
+ attributes?: Attributes<"label">;
26
27
  /** Additional attributes for the input element */
27
- inputAttributes?: G.Attributes<"input">;
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?: G.ClassName;
19
+ className?: ClassName;
19
20
  /** Additional attributes for the root element */
20
- attributes?: G.Attributes<"div">;
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 { Reshaped as HeadlessReshaped, classNames } from "@reshaped/headless";
3
4
  import React from "react";
4
5
  import { GlobalColorMode, PrivateTheme } from "../Theme/index.js";
5
6
  import { useGlobalColorMode } from "../Theme/useTheme.js";
6
7
  import { ToastProvider } from "../Toast/index.js";
7
- import { SingletonEnvironmentContext, useSingletonEnvironment, } from "../../hooks/_private/useSingletonEnvironment.js";
8
- import { SingletonHotkeysProvider } from "../../hooks/_private/useSingletonHotkeys.js";
9
- import { SingletonKeyboardModeProvider } from "../../hooks/_private/useSingletonKeyboardMode.js";
10
- import { classNames } from "../../utilities/props.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(ReshapedInner, { ...props, children: props.children }) }) }));
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?: G.ClassName;
26
+ className?: ClassName;
26
27
  /** Additional attributes for the root element */
27
- attributes?: G.Attributes<"div">;
28
+ attributes?: Attributes<"div">;
28
29
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { classNames } from "@reshaped/headless";
3
4
  import React from "react";
4
5
  import View from "../View/index.js";
5
- import { classNames } from "../../utilities/props.js";
6
6
  import s from "./Resizable.module.css";
7
7
  import { ResizableHandleContext } from "./ResizableHandle.js";
8
8
  export const ResizableItem = () => null;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { classNames } from "@reshaped/headless";
3
4
  import React from "react";
4
5
  import View from "../View/index.js";
5
6
  import useDrag from "../../hooks/_private/useDrag.js";
6
- import { classNames } from "../../utilities/props.js";
7
7
  import s from "./Resizable.module.css";
8
8
  export const ResizableHandleContext = React.createContext({});
9
9
  const ResizableHandle = (props) => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { classNames } from "@reshaped/headless";
2
3
  import View from "../View/index.js";
3
- import { classNames } from "../../utilities/props.js";
4
4
  import s from "./Scrim.module.css";
5
5
  const Scrim = (props) => {
6
6
  const { children, backgroundSlot, position = "cover", paddingInline, paddingBlock, padding, borderRadius, attributes, className, scrimClassName, } = 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?: G.ClassName;
12
+ scrimClassName?: ClassName;
13
13
  /** Additional classname for the root element */
14
- className?: G.ClassName;
14
+ className?: ClassName;
15
15
  /** Additional attributes for the root element */
16
- attributes?: G.Attributes<"div">;
16
+ attributes?: Attributes<"div">;
17
17
  } & Pick<ViewProps, "paddingInline" | "paddingBlock" | "padding" | "borderRadius">;
@@ -1,11 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { classNames, useIsomorphicLayoutEffect, useHandlerRef } from "@reshaped/headless";
4
+ import { disableScroll, enableScroll } from "@reshaped/headless/internal";
3
5
  import React, { forwardRef } from "react";
4
- import useHandlerRef from "../../hooks/useHandlerRef.js";
5
- import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
6
6
  import { resolveMixin } from "../../styles/mixin.js";
7
- import { classNames } from "../../utilities/props.js";
8
- import { disableScroll, enableScroll } from "../../utilities/scroll/index.js";
9
7
  import s from "./ScrollArea.module.css";
10
8
  const ScrollAreaBar = (props) => {
11
9
  const { ratio, position, vertical, onThumbMove } = 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: G.Coordinates) => void;
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?: G.ClassName;
17
+ className?: ClassName;
16
18
  /** Additional attributes for the root element */
17
- attributes?: G.Attributes<"div">;
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 { DropdownMenuProps } from "../DropdownMenu";
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?: G.ClassName;
51
+ className?: ClassName;
51
52
  /** Additional attributes for the root element */
52
- attributes?: G.Attributes<"div">;
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?: G.Attributes<"select">;
76
+ inputAttributes?: Attributes<"select">;
76
77
  };
77
78
  export type NativeControlledFragment = {
78
79
  value: string;
@@ -1,7 +1,7 @@
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/headless";
3
4
  import React from "react";
4
- import { classNames } from "../../utilities/props.js";
5
5
  import s from "./Select.module.css";
6
6
  import SelectEndContent from "./SelectEndContent.js";
7
7
  import SelectStartContent from "./SelectStartContent.js";
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { classNames } from "@reshaped/headless";
3
4
  import { useFormControl } from "../FormControl/index.js";
4
5
  import useElementId from "../../hooks/useElementId.js";
5
- import { classNames, responsiveClassNames } from "../../utilities/props.js";
6
+ import { responsiveClassNames } from "../../utilities/props.js";
6
7
  import s from "./Select.module.css";
7
8
  const SelectRoot = (passedProps) => {
8
9
  const formControl = useFormControl();
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { classNames } from "@reshaped/headless";
2
3
  import View from "../View/index.js";
3
- import { classNames } from "../../utilities/props.js";
4
4
  import s from "./Skeleton.module.css";
5
5
  const Skeleton = (props) => {
6
6
  const { borderRadius = "small", width, height, className, attributes } = props;
@@ -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?: G.ClassName;
5
+ className?: ClassName;
6
6
  /** Additional attributes for the root element */
7
- attributes?: G.Attributes<"div">;
7
+ attributes?: Attributes<"div">;
8
8
  };
@@ -1,4 +1,4 @@
1
- import type * as G from "../../types/global";
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?: G.ClassName;
134
+ className?: ClassName;
135
135
  /** Additional attributes for the root element */
136
- attributes?: G.Attributes<"div">;
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)));
@@ -4,3 +4,10 @@ export declare const getDragCoord: ({ event, vertical, }: {
4
4
  event: MouseEvent | TouchEvent;
5
5
  vertical?: boolean;
6
6
  }) => number;
7
+ /**
8
+ * Workaround for changing a hidden input value with triggering
9
+ * React input onChange and form onChange handlers
10
+ *
11
+ * Based on https://stackoverflow.com/a/60378508
12
+ */
13
+ export declare const triggerChangeEvent: (el: HTMLInputElement, value: string) => void;
@@ -22,3 +22,14 @@ export const getDragCoord = ({ event, vertical, }) => {
22
22
  return event.clientX;
23
23
  return event.changedTouches[0].clientX;
24
24
  };
25
+ /**
26
+ * Workaround for changing a hidden input value with triggering
27
+ * React input onChange and form onChange handlers
28
+ *
29
+ * Based on https://stackoverflow.com/a/60378508
30
+ */
31
+ export const triggerChangeEvent = (el, value) => {
32
+ const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
33
+ nativeInputValueSetter.call(el, value);
34
+ el.dispatchEvent(new Event("change", { bubbles: true }));
35
+ };
@@ -1,15 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { classNames, useRTL, useHandlerRef } from "@reshaped/headless";
4
+ import { disableScroll, enableScroll } from "@reshaped/headless/internal";
3
5
  import React from "react";
4
6
  import { useFormControl } from "../FormControl/index.js";
5
7
  import useElementId from "../../hooks/useElementId.js";
6
- import useHandlerRef from "../../hooks/useHandlerRef.js";
7
- import useRTL from "../../hooks/useRTL.js";
8
- import { triggerChangeEvent } from "../../utilities/dom/index.js";
9
- import { classNames } from "../../utilities/props.js";
10
- import { disableScroll, enableScroll } from "../../utilities/scroll/index.js";
11
8
  import s from "./Slider.module.css";
12
- import { applyStepToValue, getDragCoord } from "./Slider.utilities.js";
9
+ import { applyStepToValue, getDragCoord, triggerChangeEvent } from "./Slider.utilities.js";
13
10
  import SliderThumb from "./SliderThumb.js";
14
11
  const THUMB_SIZE = 16;
15
12
  const SliderControlled = (props) => {
@@ -93,13 +90,18 @@ const SliderControlled = (props) => {
93
90
  // @ts-ignore
94
91
  if (options.commit)
95
92
  onChangeCommitRef.current?.(args);
93
+ // Keyboard changes should commit immediately
94
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
95
+ // @ts-ignore
96
+ if (options.native && !draggingId)
97
+ onChangeCommitRef.current?.(args);
96
98
  // Manually controlled resolving of single/range handlers
97
99
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
98
100
  // @ts-ignore
99
101
  if (options.native)
100
102
  onChangeRef.current?.(args);
101
103
  triggerChangeEvent(minInputRef.current, value.toString());
102
- }, [maxValue, name, minName, maxName, range, onChangeCommitRef, onChangeRef]);
104
+ }, [range, maxValue, name, minName, maxName, draggingId, onChangeCommitRef, onChangeRef]);
103
105
  const handleMaxChange = React.useCallback((value, options = {}) => {
104
106
  const args = range
105
107
  ? { minValue: minValue, maxValue: value, name, minName, maxName }
@@ -109,13 +111,18 @@ const SliderControlled = (props) => {
109
111
  // @ts-ignore
110
112
  if (options.commit)
111
113
  onChangeCommitRef.current?.(args);
114
+ // Keyboard changes should commit immediately
115
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
116
+ // @ts-ignore
117
+ if (options.native && !draggingId)
118
+ onChangeCommitRef.current?.(args);
112
119
  // Manually controlled resolving of single/range handlers
113
120
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
114
121
  // @ts-ignore
115
122
  if (options.native)
116
123
  onChangeRef.current?.(args);
117
124
  triggerChangeEvent(maxInputRef.current, value.toString());
118
- }, [minValue, name, minName, maxName, range, onChangeRef, onChangeCommitRef]);
125
+ }, [range, minValue, name, minName, maxName, onChangeCommitRef, draggingId, onChangeRef]);
119
126
  const handleMouseDown = ({ nativeEvent }) => {
120
127
  if (disabled)
121
128
  return;
@@ -1,9 +1,9 @@
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/headless";
3
4
  import React from "react";
4
5
  import Text from "../Text/index.js";
5
6
  import Theme from "../Theme/index.js";
6
- import { classNames } from "../../utilities/props.js";
7
7
  import s from "./Slider.module.css";
8
8
  import { getPrecision } from "./Slider.utilities.js";
9
9
  const SliderThumb = React.forwardRef((props, ref) => {
@@ -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?: G.ClassName;
16
+ className?: ClassName;
16
17
  /** Additional attributes for the root element */
17
- attributes?: G.Attributes<"div">;
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?: G.ClassName;
32
+ className?: ClassName;
32
33
  /** Additional attributes for the root element */
33
- attributes?: G.Attributes<"div">;
34
+ attributes?: Attributes<"div">;
34
35
  };
35
36
  export type ItemPrivateProps = ItemProps & {
36
37
  labelDisplay: Props["labelDisplay"];
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { classNames } from "@reshaped/headless";
3
4
  import { useFormControl } from "../FormControl/index.js";
4
5
  import Text from "../Text/index.js";
5
6
  import useElementId from "../../hooks/useElementId.js";
6
- import { classNames, responsiveClassNames, responsivePropDependency } from "../../utilities/props.js";
7
+ import { responsiveClassNames, responsivePropDependency } from "../../utilities/props.js";
7
8
  import s from "./Switch.module.css";
8
9
  const Switch = (props) => {
9
10
  const { children, name, checked, size = "medium", reversed, defaultChecked, onChange, onFocus, onBlur, className, attributes, } = props;