reshaped 3.9.1-canary.3 → 3.10.0-canary.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +2 -2
- package/dist/bundle.js +2 -2
- package/dist/components/Accordion/AccordionControlled.js +1 -1
- package/dist/components/Accordion/AccordionTrigger.js +1 -1
- package/dist/components/ActionBar/ActionBar.js +2 -1
- package/dist/components/Avatar/Avatar.js +2 -1
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/Badge/BadgeContainer.js +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Button/Button.js +2 -1
- package/dist/components/Button/ButtonGroup.js +1 -1
- package/dist/components/Calendar/CalendarDate.js +1 -1
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/Carousel/Carousel.js +3 -2
- package/dist/components/Carousel/CarouselControl.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +2 -1
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/Dismissible/Dismissible.js +1 -1
- package/dist/components/Divider/Divider.js +2 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/components/FileUpload/FileUpload.js +1 -1
- package/dist/components/Flyout/Flyout.types.d.ts +1 -1
- package/dist/components/Flyout/FlyoutContent.js +1 -1
- package/dist/components/Flyout/FlyoutControlled.js +2 -1
- package/dist/components/Flyout/useFlyout.js +3 -3
- package/dist/components/Grid/Grid.js +2 -1
- package/dist/components/Hidden/Hidden.js +2 -1
- package/dist/components/HiddenInput/HiddenInput.js +1 -1
- package/dist/components/Hotkey/Hotkey.js +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Image/Image.js +1 -1
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/Loader/Loader.js +2 -1
- package/dist/components/MenuItem/MenuItem.js +2 -1
- package/dist/components/Modal/Modal.js +3 -2
- package/dist/components/Overlay/Overlay.js +2 -2
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.js +1 -1
- package/dist/components/Radio/Radio.js +2 -1
- package/dist/components/Reshaped/Reshaped.js +1 -1
- 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/ScrollArea/ScrollArea.js +2 -2
- package/dist/components/Select/SelectNative.js +1 -1
- package/dist/components/Select/SelectRoot.js +2 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Slider/Slider.utilities.d.ts +7 -0
- package/dist/components/Slider/Slider.utilities.js +11 -0
- package/dist/components/Slider/SliderControlled.js +15 -6
- package/dist/components/Slider/SliderThumb.js +1 -1
- package/dist/components/Switch/Switch.js +2 -1
- package/dist/components/Table/Table.js +2 -1
- package/dist/components/Tabs/TabsItem.js +2 -2
- package/dist/components/Tabs/TabsList.js +1 -1
- package/dist/components/Tabs/TabsPanel.js +2 -2
- package/dist/components/Text/Text.js +2 -1
- package/dist/components/TextArea/TextArea.js +2 -1
- package/dist/components/TextField/TextField.js +2 -1
- package/dist/components/Theme/Theme.js +1 -1
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Toast/ToastContainer.js +3 -2
- package/dist/components/Toast/ToastRegion.js +2 -2
- package/dist/components/View/View.js +2 -1
- package/dist/components/_private/Aligner/Aligner.js +1 -1
- package/dist/components/_private/Expandable/Expandable.js +1 -1
- package/dist/core/Actionable/Actionable.js +1 -1
- package/dist/hooks/_private/useDrag.js +1 -1
- package/dist/hooks/_private/useFadeSide.js +1 -1
- package/dist/hooks/_private/useSingletonKeyboardMode.js +1 -1
- package/dist/hooks/useKeyboardArrowNavigation.js +1 -1
- package/dist/hooks/useScrollLock.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/utilities/helpers.d.ts +0 -1
- package/dist/utilities/helpers.js +0 -14
- package/dist/utilities/props.d.ts +0 -4
- package/dist/utilities/props.js +0 -18
- package/package.json +4 -4
- package/dist/utilities/Chain.d.ts +0 -20
- package/dist/utilities/Chain.js +0 -60
- package/dist/utilities/a11y/TrapFocus.d.ts +0 -28
- package/dist/utilities/a11y/TrapFocus.js +0 -162
- package/dist/utilities/a11y/TrapScreenReader.d.ts +0 -15
- package/dist/utilities/a11y/TrapScreenReader.js +0 -42
- package/dist/utilities/a11y/focus.d.ts +0 -38
- package/dist/utilities/a11y/focus.js +0 -101
- package/dist/utilities/a11y/index.d.ts +0 -4
- package/dist/utilities/a11y/index.js +0 -3
- package/dist/utilities/a11y/keyboardMode.d.ts +0 -3
- package/dist/utilities/a11y/keyboardMode.js +0 -10
- package/dist/utilities/a11y/types.d.ts +0 -24
- package/dist/utilities/a11y/types.js +0 -1
- package/dist/utilities/css.d.ts +0 -7
- package/dist/utilities/css.js +0 -18
- package/dist/utilities/dom/event.d.ts +0 -7
- package/dist/utilities/dom/event.js +0 -11
- package/dist/utilities/dom/find.d.ts +0 -10
- package/dist/utilities/dom/find.js +0 -37
- package/dist/utilities/dom/index.d.ts +0 -3
- package/dist/utilities/dom/index.js +0 -3
- package/dist/utilities/dom/shadowDom.d.ts +0 -1
- package/dist/utilities/dom/shadowDom.js +0 -4
- package/dist/utilities/platform.d.ts +0 -1
- package/dist/utilities/platform.js +0 -16
- package/dist/utilities/scroll/disable.d.ts +0 -7
- package/dist/utilities/scroll/disable.js +0 -15
- package/dist/utilities/scroll/helpers.d.ts +0 -1
- package/dist/utilities/scroll/helpers.js +0 -17
- package/dist/utilities/scroll/index.d.ts +0 -2
- package/dist/utilities/scroll/index.js +0 -2
- package/dist/utilities/scroll/lock.d.ts +0 -5
- package/dist/utilities/scroll/lock.js +0 -32
- package/dist/utilities/scroll/lockSafari.d.ts +0 -2
- package/dist/utilities/scroll/lockSafari.js +0 -20
- package/dist/utilities/scroll/lockStandard.d.ts +0 -4
- package/dist/utilities/scroll/lockStandard.js +0 -15
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import useElementId from "../../hooks/useElementId.js";
|
|
5
6
|
import useHandlerRef from "../../hooks/useHandlerRef.js";
|
|
6
|
-
import { classNames } from "../../utilities/props.js";
|
|
7
7
|
import AccordionContext from "./Accordion.context.js";
|
|
8
8
|
const AccordionControlled = (props) => {
|
|
9
9
|
const { children, onToggle, active, iconPosition, iconSize, gap, className, attributes } = props;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import Actionable from "../Actionable/index.js";
|
|
5
6
|
import Icon from "../Icon/index.js";
|
|
6
7
|
import View from "../View/index.js";
|
|
7
8
|
import IconChevronDown from "../../icons/ChevronDown.js";
|
|
8
|
-
import { classNames } from "../../utilities/props.js";
|
|
9
9
|
import AccordionContext from "./Accordion.context.js";
|
|
10
10
|
import s from "./Accordion.module.css";
|
|
11
11
|
const AccordionTrigger = (props) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import View from "../View/index.js";
|
|
3
|
-
import {
|
|
4
|
+
import { responsiveVariables } from "../../utilities/props.js";
|
|
4
5
|
import s from "./ActionBar.module.css";
|
|
5
6
|
const fullWidthPositions = ["top", "bottom"];
|
|
6
7
|
const ActionBar = (props) => {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import Icon from "../Icon/index.js";
|
|
3
4
|
import Image from "../Image/index.js";
|
|
4
5
|
import View from "../View/index.js";
|
|
5
6
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
6
|
-
import {
|
|
7
|
+
import { responsivePropDependency } from "../../utilities/props.js";
|
|
7
8
|
import s from "./Avatar.module.css";
|
|
8
9
|
const Avatar = (props) => {
|
|
9
10
|
const { color = "neutral", variant, src, size = 12, squared, initials, icon, className, renderImage, imageAttributes, attributes, } = props;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import { forwardRef } from "react";
|
|
3
4
|
import Actionable from "../Actionable/index.js";
|
|
4
5
|
import Icon from "../Icon/index.js";
|
|
5
6
|
import Text from "../Text/index.js";
|
|
6
7
|
import IconClose from "../../icons/Close.js";
|
|
7
|
-
import { classNames } from "../../utilities/props.js";
|
|
8
8
|
import s from "./Badge.module.css";
|
|
9
9
|
const Badge = forwardRef((props, ref) => {
|
|
10
10
|
const { children, color, rounded, size = "medium", icon, endIcon, variant, hidden, highlighted, href, onClick, onDismiss, dismissAriaLabel, className, attributes, as, } = props;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { classNames } from "
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
3
|
import s from "./Badge.module.css";
|
|
4
4
|
const BadgeContainer = (props) => {
|
|
5
5
|
const { children, position = "top-end", overlap, className, attributes } = props;
|
|
@@ -1,5 +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
4
|
import React from "react";
|
|
4
5
|
import Button from "../Button/index.js";
|
|
5
6
|
import Icon from "../Icon/index.js";
|
|
@@ -7,7 +8,6 @@ import Text from "../Text/index.js";
|
|
|
7
8
|
import View from "../View/index.js";
|
|
8
9
|
import IconChevronRight from "../../icons/ChevronRight.js";
|
|
9
10
|
import IconDotsHorizontal from "../../icons/DotsHorizontal.js";
|
|
10
|
-
import { classNames } from "../../utilities/props.js";
|
|
11
11
|
const Breadcrumbs = (props) => {
|
|
12
12
|
const { children, separator, color, defaultVisibleItems, expandAriaLabel, disableExpand, ariaLabel, className, attributes, } = props;
|
|
13
13
|
const visibleItems = defaultVisibleItems && defaultVisibleItems >= 2 ? defaultVisibleItems : null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import { forwardRef } from "react";
|
|
3
4
|
import Actionable from "../Actionable/index.js";
|
|
4
5
|
import Icon from "../Icon/index.js";
|
|
5
6
|
import Loader from "../Loader/index.js";
|
|
6
|
-
import {
|
|
7
|
+
import { responsiveClassNames, responsivePropDependency } from "../../utilities/props.js";
|
|
7
8
|
import s from "./Button.module.css";
|
|
8
9
|
const Button = forwardRef((props, ref) => {
|
|
9
10
|
const { variant = "solid", color = "neutral", elevated, highlighted, fullWidth, loading, loadingAriaLabel, disabled, type, href, size = "medium", children, rounded, onClick, icon, endIcon, stopPropagation, as, render, className, attributes, } = props;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { classNames } from "
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
3
|
import s from "./Button.module.css";
|
|
4
4
|
const ButtonGroup = (props) => {
|
|
5
5
|
const { children, className, attributes } = props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
4
|
import Actionable from "../Actionable/index.js";
|
|
4
|
-
import { classNames } from "../../utilities/props.js";
|
|
5
5
|
import s from "./Calendar.module.css";
|
|
6
6
|
import { getLocalISODate } from "./Calendar.utils.js";
|
|
7
7
|
const CalendarDate = (props) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import { forwardRef } from "react";
|
|
3
4
|
import Actionable from "../Actionable/index.js";
|
|
4
5
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
5
|
-
import { classNames } from "../../utilities/props.js";
|
|
6
6
|
import s from "./Card.module.css";
|
|
7
7
|
const Card = forwardRef((props, ref) => {
|
|
8
8
|
const { padding = 4 } = props;
|
|
@@ -1,11 +1,12 @@
|
|
|
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";
|
|
4
|
+
import { rafThrottle } from "@reshaped/utilities/internal";
|
|
3
5
|
import React from "react";
|
|
4
6
|
import View from "../View/index.js";
|
|
5
7
|
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
6
8
|
import useRTL from "../../hooks/useRTL.js";
|
|
7
|
-
import {
|
|
8
|
-
import { classNames, responsiveVariables, responsiveClassNames } from "../../utilities/props.js";
|
|
9
|
+
import { responsiveVariables, responsiveClassNames } from "../../utilities/props.js";
|
|
9
10
|
import s from "./Carousel.module.css";
|
|
10
11
|
import CarouselControl from "./CarouselControl.js";
|
|
11
12
|
const Carousel = (props) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
4
|
import { forwardRef, useState } from "react";
|
|
4
5
|
import Button from "../Button/index.js";
|
|
5
6
|
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
6
7
|
import IconChevronLeft from "../../icons/ChevronLeft.js";
|
|
7
8
|
import IconChevronRight from "../../icons/ChevronRight.js";
|
|
8
|
-
import { classNames } from "../../utilities/props.js";
|
|
9
9
|
import s from "./Carousel.module.css";
|
|
10
10
|
const CarouselControl = forwardRef((props, ref) => {
|
|
11
11
|
const { type, scrollElRef, oppositeControlElRef, scrollPosition, onClick, isRTL, mounted } = props;
|
|
@@ -1,5 +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
4
|
import React from "react";
|
|
4
5
|
import { useCheckboxGroup } from "../CheckboxGroup/index.js";
|
|
5
6
|
import { useFormControl } from "../FormControl/index.js";
|
|
@@ -8,7 +9,7 @@ import Icon from "../Icon/index.js";
|
|
|
8
9
|
import Text from "../Text/index.js";
|
|
9
10
|
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
10
11
|
import IconCheckmark from "../../icons/Checkmark.js";
|
|
11
|
-
import {
|
|
12
|
+
import { responsiveClassNames, responsivePropDependency } from "../../utilities/props.js";
|
|
12
13
|
import s from "./Checkbox.module.css";
|
|
13
14
|
const Checkbox = (props) => {
|
|
14
15
|
const { children, value, onChange, onFocus, onBlur, indeterminate, size = "medium", className, attributes, inputAttributes, } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import View from "../View/index.js";
|
|
3
|
-
import { classNames } from "../../utilities/props.js";
|
|
4
4
|
import s from "./Container.module.css";
|
|
5
5
|
const Container = (props) => {
|
|
6
6
|
const { children, padding = 4, width, align, justify, height, maxHeight, className, attributes, } = props;
|
|
@@ -1,8 +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";
|
|
3
4
|
import Button from "../Button/index.js";
|
|
4
5
|
import IconClose from "../../icons/Close.js";
|
|
5
|
-
import { classNames } from "../../utilities/props.js";
|
|
6
6
|
import s from "./Dismissible.module.css";
|
|
7
7
|
const Dismissible = (props) => {
|
|
8
8
|
const { children, align, onClose, hideCloseButton, variant, closeAriaLabel, className, attributes, } = props;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import Text from "../Text/index.js";
|
|
3
|
-
import {
|
|
4
|
+
import { responsiveClassNames } from "../../utilities/props.js";
|
|
4
5
|
import s from "./Divider.module.css";
|
|
5
6
|
const Divider = (props) => {
|
|
6
7
|
const { vertical, blank, children, contentPosition = "center", color, offset, className, attributes, } = props;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import { useFlyoutContext } from "../Flyout/index.js";
|
|
5
6
|
import Icon from "../Icon/index.js";
|
|
@@ -9,7 +10,6 @@ import * as keys from "../../constants/keys.js";
|
|
|
9
10
|
import useHotkeys from "../../hooks/useHotkeys.js";
|
|
10
11
|
import useRTL from "../../hooks/useRTL.js";
|
|
11
12
|
import IconChevronRight from "../../icons/ChevronRight.js";
|
|
12
|
-
import { classNames } from "../../utilities/props.js";
|
|
13
13
|
import s from "./DropdownMenu.module.css";
|
|
14
14
|
const DropdownMenuSubContext = React.createContext(null);
|
|
15
15
|
const DropdownMenuSubTriggerContext = React.createContext(false);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
4
|
import HiddenVisually from "../HiddenVisually/index.js";
|
|
4
5
|
import View from "../View/index.js";
|
|
5
6
|
import useToggle from "../../hooks/useToggle.js";
|
|
6
|
-
import { classNames } from "../../utilities/props.js";
|
|
7
7
|
import s from "./FileUpload.module.css";
|
|
8
8
|
export const FileUploadTrigger = (props) => {
|
|
9
9
|
const { children } = props;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import Portal from "../_private/Portal/index.js";
|
|
5
6
|
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
6
|
-
import { classNames } from "../../utilities/props.js";
|
|
7
7
|
import { useFlyoutContext, ContentProvider } from "./Flyout.context.js";
|
|
8
8
|
import s from "./Flyout.module.css";
|
|
9
9
|
import cooldown from "./utilities/cooldown.js";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { TrapFocus } from "@reshaped/utilities";
|
|
4
|
+
import { checkKeyboardMode } from "@reshaped/utilities/internal";
|
|
3
5
|
import React from "react";
|
|
4
6
|
import useIsDismissible from "../../hooks/_private/useIsDismissible.js";
|
|
5
7
|
import usePrevious from "../../hooks/_private/usePrevious.js";
|
|
@@ -8,7 +10,6 @@ import useHandlerRef from "../../hooks/useHandlerRef.js";
|
|
|
8
10
|
import useHotkeys from "../../hooks/useHotkeys.js";
|
|
9
11
|
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
10
12
|
import useOnClickOutside from "../../hooks/useOnClickOutside.js";
|
|
11
|
-
import { TrapFocus, checkKeyboardMode } from "../../utilities/a11y/index.js";
|
|
12
13
|
import { checkTransitions } from "../../utilities/animation.js";
|
|
13
14
|
import * as timeouts from "./Flyout.constants.js";
|
|
14
15
|
import { Provider, useFlyoutTriggerContext, useFlyoutContext, useFlyoutContentContext, } from "./Flyout.context.js";
|
|
@@ -38,7 +38,7 @@ const useFlyout = (args) => {
|
|
|
38
38
|
fallbackMinHeight,
|
|
39
39
|
contentGap: (contentGap ?? 0) * unitModifier,
|
|
40
40
|
contentShift: (contentShift ?? 0) * unitModifier,
|
|
41
|
-
|
|
41
|
+
onDeactivate: handleClose,
|
|
42
42
|
};
|
|
43
43
|
}, [
|
|
44
44
|
cachedFallbackPositions,
|
|
@@ -60,14 +60,14 @@ const useFlyout = (args) => {
|
|
|
60
60
|
if (!flyoutOptions)
|
|
61
61
|
return;
|
|
62
62
|
flyoutRef.current = new Flyout(flyoutOptions);
|
|
63
|
-
const result = flyoutRef.current.
|
|
63
|
+
const result = flyoutRef.current.activate();
|
|
64
64
|
setPosition(result.position);
|
|
65
65
|
setStatus("visible");
|
|
66
66
|
}, [getFlyoutOptions]);
|
|
67
67
|
const remove = useCallback(() => {
|
|
68
68
|
if (!flyoutRef.current)
|
|
69
69
|
return;
|
|
70
|
-
flyoutRef.current.
|
|
70
|
+
flyoutRef.current.deactivate();
|
|
71
71
|
setStatus("idle");
|
|
72
72
|
}, []);
|
|
73
73
|
const updatePosition = useCallback(() => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
3
|
-
import {
|
|
4
|
+
import { responsiveVariables, responsivePropDependency } from "../../utilities/props.js";
|
|
4
5
|
import s from "./Grid.module.css";
|
|
5
6
|
export const GridItem = (props) => {
|
|
6
7
|
const { area, colStart, colEnd, colSpan, rowStart, rowEnd, rowSpan, children, className,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { classNames
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
|
+
import { responsiveClassNames } from "../../utilities/props.js";
|
|
3
4
|
import s from "./Hidden.module.css";
|
|
4
5
|
const Hidden = (props) => {
|
|
5
6
|
const { as: TagName = "div", children, visibility, hide } = props;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import { useCheckboxGroup } from "../CheckboxGroup/index.js";
|
|
3
4
|
import { useFormControl } from "../FormControl/index.js";
|
|
4
5
|
import { useRadioGroup } from "../RadioGroup/index.js";
|
|
5
|
-
import { classNames } from "../../utilities/props.js";
|
|
6
6
|
import s from "./HiddenInput.module.css";
|
|
7
7
|
const HiddenInput = (props) => {
|
|
8
8
|
const { type, value, className, onBlur, onFocus, onChange, attributes } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import Text from "../Text/index.js";
|
|
3
|
-
import { classNames } from "../../utilities/props.js";
|
|
4
4
|
import s from "./Hotkey.module.css";
|
|
5
5
|
const Hotkey = (props) => {
|
|
6
6
|
const { children, active, className, attributes } = props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
4
|
-
import { classNames } from "../../utilities/props.js";
|
|
5
5
|
import s from "./Icon.module.css";
|
|
6
6
|
const Icon = (props) => {
|
|
7
7
|
const { svg: Component, className, color, size = "1em", autoWidth, attributes } = props;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
5
|
-
import { classNames } from "../../utilities/props.js";
|
|
6
6
|
import s from "./Image.module.css";
|
|
7
7
|
const Image = (props) => {
|
|
8
8
|
const { src, alt, width, maxWidth, height, aspectRatio, onLoad, onError, fallback, outline, displayMode = "cover", borderRadius, className, attributes, imageAttributes: passedImageAttributes, renderImage, } = props;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import { forwardRef } from "react";
|
|
3
4
|
import Actionable from "../Actionable/index.js";
|
|
4
5
|
import Icon from "../Icon/index.js";
|
|
5
|
-
import { classNames } from "../../utilities/props.js";
|
|
6
6
|
import s from "./Link.module.css";
|
|
7
7
|
const Link = forwardRef((props, ref) => {
|
|
8
8
|
const { icon, disabled, href, color = "primary", variant = "underline", className, children, attributes, type, onClick, stopPropagation, render, } = props;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { classNames
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
|
+
import { responsiveClassNames } from "../../utilities/props.js";
|
|
3
4
|
import s from "./Loader.module.css";
|
|
4
5
|
const Loader = (props) => {
|
|
5
6
|
const { size = "small", color = "primary", className, attributes } = props;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
2
3
|
import { forwardRef } from "react";
|
|
3
4
|
import Actionable from "../Actionable/index.js";
|
|
4
5
|
import Icon from "../Icon/index.js";
|
|
5
6
|
import View from "../View/index.js";
|
|
6
|
-
import {
|
|
7
|
+
import { responsiveClassNames, responsivePropDependency } from "../../utilities/props.js";
|
|
7
8
|
import s from "./MenuItem.module.css";
|
|
8
9
|
const MenuItem = forwardRef((props, ref) => {
|
|
9
10
|
const { icon, startSlot, endSlot, children, color = "primary", selected, highlighted, disabled, onClick, href, size = "medium", roundedCorners, stopPropagation, as, render, className, attributes, } = props;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
4
|
+
import { enableScroll, disableScroll } from "@reshaped/utilities/internal";
|
|
3
5
|
import React from "react";
|
|
4
6
|
import Overlay from "../Overlay/index.js";
|
|
5
7
|
import Text from "../Text/index.js";
|
|
@@ -7,8 +9,7 @@ import useElementId from "../../hooks/useElementId.js";
|
|
|
7
9
|
import useHandlerRef from "../../hooks/useHandlerRef.js";
|
|
8
10
|
import useResponsiveClientValue from "../../hooks/useResponsiveClientValue.js";
|
|
9
11
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
10
|
-
import {
|
|
11
|
-
import { enableScroll, disableScroll } from "../../utilities/scroll/index.js";
|
|
12
|
+
import { responsiveVariables, responsiveClassNames } from "../../utilities/props.js";
|
|
12
13
|
import s from "./Modal.module.css";
|
|
13
14
|
const DRAG_THRESHOLD = 32;
|
|
14
15
|
const DRAG_OPPOSITE_THRESHOLD = 100;
|
|
@@ -1,5 +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";
|
|
3
5
|
import React from "react";
|
|
4
6
|
import Portal from "../_private/Portal/index.js";
|
|
5
7
|
import useIsDismissible from "../../hooks/_private/useIsDismissible.js";
|
|
@@ -8,9 +10,7 @@ import useHotkeys from "../../hooks/useHotkeys.js";
|
|
|
8
10
|
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
9
11
|
import useScrollLock from "../../hooks/useScrollLock.js";
|
|
10
12
|
import useToggle from "../../hooks/useToggle.js";
|
|
11
|
-
import { TrapFocus } from "../../utilities/a11y/index.js";
|
|
12
13
|
import { onNextFrame } from "../../utilities/animation.js";
|
|
13
|
-
import { classNames } from "../../utilities/props.js";
|
|
14
14
|
import s from "./Overlay.module.css";
|
|
15
15
|
const Overlay = (props) => {
|
|
16
16
|
const { active, children, transparent, blurred, overflow, onClose, onOpen, onAfterClose, onAfterOpen, disableCloseOnClick, containerRef, className, attributes, } = props;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { classNames } from "
|
|
2
|
+
import { classNames } from "@reshaped/utilities";
|
|
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,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classNames } from "
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
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,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/utilities";
|
|
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 {
|
|
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,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import { GlobalColorMode, PrivateTheme } from "../Theme/index.js";
|
|
5
6
|
import { useGlobalColorMode } from "../Theme/useTheme.js";
|
|
@@ -7,7 +8,6 @@ import { ToastProvider } from "../Toast/index.js";
|
|
|
7
8
|
import { SingletonEnvironmentContext, useSingletonEnvironment, } from "../../hooks/_private/useSingletonEnvironment.js";
|
|
8
9
|
import { SingletonHotkeysProvider } from "../../hooks/_private/useSingletonHotkeys.js";
|
|
9
10
|
import { SingletonKeyboardModeProvider } from "../../hooks/_private/useSingletonKeyboardMode.js";
|
|
10
|
-
import { classNames } from "../../utilities/props.js";
|
|
11
11
|
import s from "./Reshaped.module.css";
|
|
12
12
|
import "./Reshaped.css";
|
|
13
13
|
const ReshapedInner = (props) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { classNames } from "@reshaped/utilities";
|
|
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/utilities";
|
|
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/utilities";
|
|
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,11 +1,11 @@
|
|
|
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
5
|
import React, { forwardRef } from "react";
|
|
4
6
|
import useHandlerRef from "../../hooks/useHandlerRef.js";
|
|
5
7
|
import useIsomorphicLayoutEffect from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
6
8
|
import { resolveMixin } from "../../styles/mixin.js";
|
|
7
|
-
import { classNames } from "../../utilities/props.js";
|
|
8
|
-
import { disableScroll, enableScroll } from "../../utilities/scroll/index.js";
|
|
9
9
|
import s from "./ScrollArea.module.css";
|
|
10
10
|
const ScrollAreaBar = (props) => {
|
|
11
11
|
const { ratio, position, vertical, onThumbMove } = props;
|
|
@@ -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/utilities";
|
|
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/utilities";
|
|
3
4
|
import { useFormControl } from "../FormControl/index.js";
|
|
4
5
|
import useElementId from "../../hooks/useElementId.js";
|
|
5
|
-
import {
|
|
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/utilities";
|
|
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;
|
|
@@ -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
|
+
};
|