reshaped 3.10.0-canary.6 → 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.
Files changed (174) hide show
  1. package/dist/bundle.d.ts +4 -11
  2. package/dist/bundle.js +2 -2
  3. package/dist/components/Accordion/Accordion.types.d.ts +3 -2
  4. package/dist/components/Accordion/AccordionControlled.js +1 -2
  5. package/dist/components/Accordion/AccordionTrigger.js +1 -1
  6. package/dist/components/ActionBar/ActionBar.js +1 -1
  7. package/dist/components/ActionBar/ActionBar.types.d.ts +3 -2
  8. package/dist/components/Actionable/Actionable.d.ts +2 -2
  9. package/dist/components/Actionable/Actionable.js +1 -1
  10. package/dist/components/Actionable/Actionable.types.d.ts +1 -1
  11. package/dist/components/Actionable/index.d.ts +1 -1
  12. package/dist/components/Alert/Alert.types.d.ts +3 -2
  13. package/dist/components/Autocomplete/Autocomplete.js +1 -3
  14. package/dist/components/Avatar/Avatar.js +1 -1
  15. package/dist/components/Avatar/Avatar.types.d.ts +5 -4
  16. package/dist/components/Badge/Badge.js +1 -1
  17. package/dist/components/Badge/Badge.types.d.ts +4 -4
  18. package/dist/components/Badge/BadgeContainer.js +1 -1
  19. package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
  20. package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +3 -3
  21. package/dist/components/Button/Button.js +1 -1
  22. package/dist/components/Button/Button.types.d.ts +3 -2
  23. package/dist/components/Button/ButtonGroup.js +1 -1
  24. package/dist/components/Calendar/CalendarDate.js +1 -1
  25. package/dist/components/Calendar/useCalendarKeyboardNavigation.js +1 -1
  26. package/dist/components/Card/Card.d.ts +6 -14
  27. package/dist/components/Card/Card.js +1 -1
  28. package/dist/components/Card/Card.types.d.ts +4 -3
  29. package/dist/components/Carousel/Carousel.js +2 -4
  30. package/dist/components/Carousel/Carousel.types.d.ts +3 -2
  31. package/dist/components/Carousel/CarouselControl.js +1 -2
  32. package/dist/components/Checkbox/Checkbox.js +1 -2
  33. package/dist/components/Checkbox/Checkbox.types.d.ts +4 -3
  34. package/dist/components/Container/Container.js +1 -1
  35. package/dist/components/Container/Container.types.d.ts +3 -2
  36. package/dist/components/ContextMenu/ContextMenu.js +1 -2
  37. package/dist/components/Dismissible/Dismissible.js +1 -1
  38. package/dist/components/Dismissible/Dismissible.types.d.ts +3 -3
  39. package/dist/components/Divider/Divider.js +1 -1
  40. package/dist/components/Divider/Divider.types.d.ts +3 -2
  41. package/dist/components/DropdownMenu/DropdownMenu.js +1 -3
  42. package/dist/components/FileUpload/FileUpload.js +1 -2
  43. package/dist/components/FileUpload/FileUpload.types.d.ts +4 -3
  44. package/dist/components/Flyout/Flyout.types.d.ts +6 -6
  45. package/dist/components/Flyout/FlyoutContent.js +1 -2
  46. package/dist/components/Flyout/FlyoutControlled.js +2 -6
  47. package/dist/components/Flyout/useFlyout.d.ts +2 -2
  48. package/dist/components/Flyout/useFlyout.js +2 -2
  49. package/dist/components/Flyout/utilities/safeArea.d.ts +2 -2
  50. package/dist/components/Grid/Grid.js +1 -1
  51. package/dist/components/Grid/Grid.types.d.ts +5 -4
  52. package/dist/components/Hidden/Hidden.js +1 -1
  53. package/dist/components/HiddenInput/HiddenInput.js +1 -1
  54. package/dist/components/HiddenInput/HiddenInput.types.d.ts +3 -2
  55. package/dist/components/Hotkey/Hotkey.js +1 -1
  56. package/dist/components/Hotkey/Hotkey.types.d.ts +3 -3
  57. package/dist/components/Icon/Icon.js +1 -1
  58. package/dist/components/Icon/Icon.types.d.ts +3 -2
  59. package/dist/components/Image/Image.js +1 -1
  60. package/dist/components/Image/Image.types.d.ts +5 -4
  61. package/dist/components/Link/Link.js +1 -1
  62. package/dist/components/Loader/Loader.js +1 -1
  63. package/dist/components/Loader/Loader.types.d.ts +3 -2
  64. package/dist/components/MenuItem/MenuItem.js +1 -1
  65. package/dist/components/MenuItem/MenuItem.types.d.ts +3 -2
  66. package/dist/components/Modal/Modal.js +2 -3
  67. package/dist/components/Modal/Modal.types.d.ts +4 -3
  68. package/dist/components/NumberField/NumberFieldControlled.js +1 -2
  69. package/dist/components/Overlay/Overlay.js +4 -10
  70. package/dist/components/Overlay/Overlay.types.d.ts +3 -3
  71. package/dist/components/Pagination/Pagination.types.d.ts +3 -3
  72. package/dist/components/PinField/PinField.types.d.ts +4 -3
  73. package/dist/components/PinField/PinFieldControlled.js +1 -1
  74. package/dist/components/Popover/Popover.js +1 -1
  75. package/dist/components/Progress/Progress.js +1 -1
  76. package/dist/components/Progress/Progress.types.d.ts +3 -3
  77. package/dist/components/ProgressIndicator/ProgressIndicator.js +1 -1
  78. package/dist/components/ProgressIndicator/ProgressIndicator.types.d.ts +3 -3
  79. package/dist/components/Radio/Radio.js +1 -1
  80. package/dist/components/Radio/Radio.types.d.ts +4 -3
  81. package/dist/components/RadioGroup/RadioGroup.types.d.ts +3 -2
  82. package/dist/components/Reshaped/Reshaped.js +4 -11
  83. package/dist/components/Reshaped/Reshaped.types.d.ts +3 -2
  84. package/dist/components/Resizable/Resizable.js +1 -1
  85. package/dist/components/Resizable/ResizableHandle.js +1 -1
  86. package/dist/components/Scrim/Scrim.js +1 -1
  87. package/dist/components/Scrim/Scrim.types.d.ts +4 -4
  88. package/dist/components/ScrollArea/ScrollArea.js +2 -4
  89. package/dist/components/ScrollArea/ScrollArea.types.d.ts +5 -3
  90. package/dist/components/Select/Select.types.d.ts +5 -4
  91. package/dist/components/Select/SelectNative.js +1 -1
  92. package/dist/components/Select/SelectRoot.js +1 -1
  93. package/dist/components/Skeleton/Skeleton.js +1 -1
  94. package/dist/components/Skeleton/Skeleton.types.d.ts +3 -3
  95. package/dist/components/Slider/Slider.types.d.ts +3 -3
  96. package/dist/components/Slider/SliderControlled.js +2 -4
  97. package/dist/components/Slider/SliderThumb.js +1 -1
  98. package/dist/components/Stepper/Stepper.types.d.ts +5 -4
  99. package/dist/components/Switch/Switch.js +1 -1
  100. package/dist/components/Switch/Switch.types.d.ts +4 -3
  101. package/dist/components/Table/Table.js +1 -1
  102. package/dist/components/Table/Table.types.d.ts +12 -12
  103. package/dist/components/Tabs/Tabs.types.d.ts +6 -6
  104. package/dist/components/Tabs/TabsItem.js +2 -3
  105. package/dist/components/Tabs/TabsList.js +1 -4
  106. package/dist/components/Tabs/TabsPanel.js +2 -2
  107. package/dist/components/Text/Text.js +1 -1
  108. package/dist/components/Text/Text.types.d.ts +3 -2
  109. package/dist/components/TextArea/TextArea.js +1 -1
  110. package/dist/components/TextArea/TextArea.types.d.ts +5 -4
  111. package/dist/components/TextField/TextField.js +1 -1
  112. package/dist/components/TextField/TextField.types.d.ts +4 -3
  113. package/dist/components/Theme/GlobalColorMode.js +1 -1
  114. package/dist/components/Theme/Theme.js +1 -2
  115. package/dist/components/Theme/Theme.types.d.ts +2 -1
  116. package/dist/components/Timeline/Timeline.js +1 -1
  117. package/dist/components/Timeline/Timeline.types.d.ts +5 -5
  118. package/dist/components/Toast/Toast.types.d.ts +3 -3
  119. package/dist/components/Toast/ToastContainer.js +2 -3
  120. package/dist/components/Toast/ToastRegion.js +2 -2
  121. package/dist/components/ToggleButton/ToggleButtonUncontrolled.js +1 -1
  122. package/dist/components/ToggleButtonGroup/ToggleButtonGroupControlled.js +1 -1
  123. package/dist/components/View/View.js +1 -1
  124. package/dist/components/View/View.types.d.ts +5 -4
  125. package/dist/components/_private/Aligner/Aligner.js +1 -1
  126. package/dist/components/_private/Aligner/Aligner.types.d.ts +3 -3
  127. package/dist/components/_private/Expandable/Expandable.js +2 -2
  128. package/dist/components/_private/Expandable/Expandable.types.d.ts +2 -2
  129. package/dist/components/_private/Portal/Portal.js +1 -2
  130. package/dist/hooks/_private/useDrag.js +2 -4
  131. package/dist/hooks/_private/useFadeSide.js +2 -3
  132. package/dist/hooks/_private/useSingletonViewport.d.ts +10 -0
  133. package/dist/hooks/_private/useSingletonViewport.js +52 -0
  134. package/dist/hooks/useResponsiveClientValue.js +15 -53
  135. package/dist/hooks/useViewport.d.ts +2 -0
  136. package/dist/hooks/useViewport.js +6 -0
  137. package/dist/index.d.ts +4 -11
  138. package/dist/index.js +2 -10
  139. package/dist/styles/mixin.d.ts +2 -2
  140. package/dist/styles/types.d.ts +2 -1
  141. package/dist/tests/ThemesPlayground.js +1 -1
  142. package/dist/types/global.d.ts +0 -15
  143. package/dist/utilities/props.d.ts +2 -1
  144. package/package.json +2 -2
  145. package/dist/core/Actionable/Actionable.d.ts +0 -4
  146. package/dist/core/Actionable/Actionable.js +0 -73
  147. package/dist/core/Actionable/Actionable.types.d.ts +0 -34
  148. package/dist/core/Actionable/Actionable.types.js +0 -1
  149. package/dist/core/Actionable/index.d.ts +0 -2
  150. package/dist/core/Actionable/index.js +0 -1
  151. package/dist/hooks/_private/useSingletonEnvironment.d.ts +0 -9
  152. package/dist/hooks/_private/useSingletonEnvironment.js +0 -33
  153. package/dist/hooks/_private/useSingletonHotkeys.d.ts +0 -35
  154. package/dist/hooks/_private/useSingletonHotkeys.js +0 -191
  155. package/dist/hooks/_private/useSingletonKeyboardMode.d.ts +0 -13
  156. package/dist/hooks/_private/useSingletonKeyboardMode.js +0 -58
  157. package/dist/hooks/useHandlerRef.d.ts +0 -8
  158. package/dist/hooks/useHandlerRef.js +0 -16
  159. package/dist/hooks/useHotkeys.d.ts +0 -11
  160. package/dist/hooks/useHotkeys.js +0 -27
  161. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +0 -3
  162. package/dist/hooks/useIsomorphicLayoutEffect.js +0 -4
  163. package/dist/hooks/useKeyboardArrowNavigation.d.ts +0 -9
  164. package/dist/hooks/useKeyboardArrowNavigation.js +0 -62
  165. package/dist/hooks/useKeyboardMode.d.ts +0 -7
  166. package/dist/hooks/useKeyboardMode.js +0 -13
  167. package/dist/hooks/useOnClickOutside.d.ts +0 -5
  168. package/dist/hooks/useOnClickOutside.js +0 -63
  169. package/dist/hooks/useRTL.d.ts +0 -2
  170. package/dist/hooks/useRTL.js +0 -7
  171. package/dist/hooks/useScrollLock.d.ts +0 -10
  172. package/dist/hooks/useScrollLock.js +0 -25
  173. package/dist/hooks/useToggle.d.ts +0 -7
  174. package/dist/hooks/useToggle.js +0 -19
@@ -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,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/utilities";
4
- import { disableScroll, enableScroll } from "@reshaped/utilities/internal";
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: 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,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/utilities";
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/utilities";
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,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { classNames } from "@reshaped/utilities";
2
+ import { classNames } from "@reshaped/headless";
3
3
  import View from "../View/index.js";
4
4
  import s from "./Skeleton.module.css";
5
5
  const Skeleton = (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)));
@@ -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/utilities";
4
- import { disableScroll, enableScroll } from "@reshaped/utilities/internal";
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/utilities";
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?: 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,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/utilities";
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?: 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
  /** 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/utilities";
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 * as G from "../../types/global";
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?: G.ClassName;
11
+ className?: ClassName;
12
12
  /** Additional attributes for the root element */
13
- attributes?: G.Attributes<"div">;
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?: G.ClassName;
23
+ className?: ClassName;
24
24
  /** Additional attributes for the row element */
25
- attributes?: G.Attributes<"tr">;
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?: G.ClassName;
49
+ className?: ClassName;
50
50
  /** Additional attributes for the cell element */
51
- attributes?: G.Attributes<"td">;
51
+ attributes?: Attributes<"td">;
52
52
  };
53
53
  export type HeadingProps = CellProps & {
54
54
  /** Additional attributes for the heading element */
55
- attributes?: G.Attributes<"th">;
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?: G.ClassName;
61
+ className?: ClassName;
62
62
  /** Additional attributes for the body element */
63
- attributes?: G.Attributes<"tbody">;
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?: G.ClassName;
69
+ className?: ClassName;
70
70
  /** Additional attributes for the head element */
71
- attributes?: G.Attributes<"thead">;
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?: G.Attributes<"div">;
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?: G.ClassName;
29
+ className?: ClassName;
30
30
  /** Additional attributes for the list element */
31
- attributes?: G.Attributes<"div">;
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?: G.ClassName;
39
+ className?: ClassName;
40
40
  /** Additional attributes for the panel element */
41
- attributes?: G.Attributes<"div">;
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/utilities";
4
- import { findParent } from "@reshaped/utilities/internal";
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/utilities";
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/utilities";
4
- import { getFocusableElements } from "@reshaped/utilities/internal";
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/utilities";
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?: G.ClassName;
27
+ className?: ClassName;
27
28
  /** Additional attributes for the root element */
28
- attributes?: G.Attributes<TagName>;
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/utilities";
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 { type FormControlProps } from "../FormControl";
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?: G.ClassName;
30
+ className?: ClassName;
30
31
  /** Additional attributes for the root element */
31
- attributes?: G.Attributes<"div">;
32
+ attributes?: Attributes<"div">;
32
33
  /** Additional attributes for the input element */
33
- inputAttributes?: G.Attributes<"textarea">;
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/utilities";
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";
@@ -1,3 +1,4 @@
1
+ import type { Attributes, ClassName } from "@reshaped/headless";
1
2
  import type { FormControlProps } from "../FormControl";
2
3
  import type { IconProps } from "../Icon";
3
4
  import type React from "react";
@@ -49,11 +50,11 @@ export type BaseProps = {
49
50
  /** Callback when the text field is blurred */
50
51
  onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
51
52
  /** Additional classname for the root element */
52
- className?: G.ClassName;
53
+ className?: ClassName;
53
54
  /** Additional attributes for the root element */
54
- attributes?: G.Attributes<"div">;
55
+ attributes?: Attributes<"div">;
55
56
  /** Additional attributes for the input element */
56
- inputAttributes?: G.Attributes<"input">;
57
+ inputAttributes?: Attributes<"input">;
57
58
  } & Pick<FormControlProps, "hasError">;
58
59
  export type ControlledProps = BaseProps & {
59
60
  /** Value of the text field, enables controlled mode */
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useIsomorphicLayoutEffect } from "@reshaped/headless";
3
4
  import React from "react";
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
7
  import { getRootThemeEl } from "./Theme.utilities.js";
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { classNames } from "@reshaped/utilities";
3
+ import { classNames, useIsomorphicLayoutEffect } from "@reshaped/headless";
4
4
  import React from "react";
5
- import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
6
5
  import { ThemeContext } from "./Theme.context.js";
7
6
  import s from "./Theme.module.css";
8
7
  import { getRootThemeEl } from "./Theme.utilities.js";
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import * as G from "../../types/global";
3
+ import type { ClassName } from "@reshaped/headless";
3
4
  export type GlobalColorModeContextData = {
4
5
  mode: G.ColorMode;
5
6
  setMode: (mode: G.ColorMode) => void;
@@ -20,7 +21,7 @@ export type Props = {
20
21
  /** Color mode to use */
21
22
  colorMode?: G.ColorMode | "inverted";
22
23
  /** Additional classname for the root element */
23
- className?: G.ClassName;
24
+ className?: ClassName;
24
25
  /** Node for inserting children */
25
26
  children?: React.ReactNode;
26
27
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { classNames } from "@reshaped/utilities";
2
+ import { classNames } from "@reshaped/headless";
3
3
  import React, { isValidElement } from "react";
4
4
  import View from "../View/index.js";
5
5
  import s from "./Timeline.module.css";
@@ -1,12 +1,12 @@
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 Props = {
4
4
  /** Node for inserting children */
5
5
  children?: React.ReactNode;
6
6
  /** Additional classname for the root element */
7
- className?: G.ClassName;
7
+ className?: ClassName;
8
8
  /** Additional attributes for the root element */
9
- attributes?: G.Attributes<"ul">;
9
+ attributes?: Attributes<"ul">;
10
10
  };
11
11
  export type ItemProps = {
12
12
  /** Node for rendering custom item markers */
@@ -14,7 +14,7 @@ export type ItemProps = {
14
14
  /** Node for inserting children */
15
15
  children?: React.ReactNode;
16
16
  /** Additional classname for the item element */
17
- className?: G.ClassName;
17
+ className?: ClassName;
18
18
  /** Additional attributes for the item element */
19
- attributes?: G.Attributes<"li">;
19
+ attributes?: Attributes<"li">;
20
20
  };
@@ -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 Status = "entering" | "entered" | "exited";
5
5
  export type TimeoutAlias = "short" | "long";
6
6
  export type Timeout = TimeoutAlias | number;
@@ -27,9 +27,9 @@ export type Props = {
27
27
  */
28
28
  color?: "neutral" | "primary" | "critical" | "positive" | "warning" | "inverted";
29
29
  /** Additional classname for the root element */
30
- className?: G.ClassName;
30
+ className?: ClassName;
31
31
  /** Additional attributes for the root element */
32
- attributes?: G.Attributes<"div">;
32
+ attributes?: Attributes<"div">;
33
33
  };
34
34
  export type ProviderProps = {
35
35
  /** Node for inserting children */
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { TrapFocus } from "@reshaped/utilities";
4
- import { classNames } from "@reshaped/utilities";
5
- import { checkKeyboardMode } from "@reshaped/utilities/internal";
3
+ import { TrapFocus, classNames } from "@reshaped/headless";
4
+ import { checkKeyboardMode } from "@reshaped/headless/internal";
6
5
  import React from "react";
7
6
  import { onNextFrame } from "../../utilities/animation.js";
8
7
  import Toast from "./Toast.js";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { classNames } from "@reshaped/utilities";
4
- import { focusableSelector } from "@reshaped/utilities/internal";
3
+ import { classNames } from "@reshaped/headless";
4
+ import { focusableSelector } from "@reshaped/headless/internal";
5
5
  import React from "react";
6
6
  import ToastContext from "./Toast.context.js";
7
7
  import s from "./Toast.module.css";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import useToggle from "../../hooks/useToggle.js";
3
+ import { useToggle } from "@reshaped/headless";
4
4
  import ToggleButtonControlled from "./ToggleButtonControlled.js";
5
5
  const ToggleButtonUncontrolled = (props) => {
6
6
  const { defaultChecked, onChange, ...buttonProps } = props;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useKeyboardArrowNavigation } from "@reshaped/headless";
3
4
  import React from "react";
4
5
  import Button from "../Button/index.js";
5
- import useKeyboardArrowNavigation from "../../hooks/useKeyboardArrowNavigation.js";
6
6
  import Context from "./ToggleButtonGroup.context.js";
7
7
  const ToggleButtonGroupControlled = (props) => {
8
8
  const { onChange, value, selectionMode = "single", children, color, selectedColor, ...buttonGroupProps } = props;
@@ -1,6 +1,6 @@
1
1
  import { createElement as _createElement } from "react";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { classNames } from "@reshaped/utilities";
3
+ import { classNames } from "@reshaped/headless";
4
4
  import React, { isValidElement } from "react";
5
5
  import Divider from "../Divider/index.js";
6
6
  import Hidden from "../Hidden/index.js";