@seed-design/react 0.0.4 → 0.0.6
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/lib/components/ActionButton/ActionButton.cjs +6 -6
- package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
- package/lib/components/ActionButton/ActionButton.js +6 -6
- package/lib/components/ActionChip/ActionChip.cjs +4 -4
- package/lib/components/ActionChip/ActionChip.d.ts +1 -1
- package/lib/components/ActionChip/ActionChip.d.ts.map +1 -1
- package/lib/components/ActionChip/ActionChip.js +4 -4
- package/lib/components/ActionSheet/ActionSheet.cjs +7 -7
- package/lib/components/ActionSheet/ActionSheet.d.ts +2 -2
- package/lib/components/ActionSheet/ActionSheet.d.ts.map +1 -1
- package/lib/components/ActionSheet/ActionSheet.js +7 -7
- package/lib/components/Avatar/Avatar.cjs +2 -2
- package/lib/components/Avatar/Avatar.js +2 -2
- package/lib/components/Badge/Badge.cjs +3 -3
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Badge/Badge.js +3 -3
- package/lib/components/BottomSheet/BottomSheet.cjs +2 -2
- package/lib/components/BottomSheet/BottomSheet.js +2 -2
- package/lib/components/Callout/Callout.cjs +2 -2
- package/lib/components/Callout/Callout.js +2 -2
- package/lib/components/Checkbox/Checkbox.cjs +2 -2
- package/lib/components/Checkbox/Checkbox.js +2 -2
- package/lib/components/ChipTabs/ChipTabs.cjs +2 -2
- package/lib/components/ChipTabs/ChipTabs.js +2 -2
- package/lib/components/ControlChip/ControlChip.cjs +3 -3
- package/lib/components/ControlChip/ControlChip.js +3 -3
- package/lib/components/Dialog/Dialog.cjs +2 -2
- package/lib/components/Dialog/Dialog.js +2 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +5 -4
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts.map +1 -1
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +5 -4
- package/lib/components/ExtendedFab/ExtendedFab.cjs +7 -11
- package/lib/components/ExtendedFab/ExtendedFab.d.ts.map +1 -1
- package/lib/components/ExtendedFab/ExtendedFab.js +7 -11
- package/lib/components/Fab/Fab.cjs +3 -3
- package/lib/components/Fab/Fab.d.ts.map +1 -1
- package/lib/components/Fab/Fab.js +3 -3
- package/lib/components/HelpBubble/HelpBubble.cjs +8 -3
- package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
- package/lib/components/HelpBubble/HelpBubble.js +8 -3
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.cjs +2 -2
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.js +2 -2
- package/lib/components/InlineBanner/InlineBanner.cjs +2 -2
- package/lib/components/InlineBanner/InlineBanner.js +2 -2
- package/lib/components/LinkContent/LinkContent.cjs +3 -4
- package/lib/components/LinkContent/LinkContent.d.ts.map +1 -1
- package/lib/components/LinkContent/LinkContent.js +3 -4
- package/lib/components/LoadingIndicator/usePendingButton.d.ts +57 -57
- package/lib/components/MannerTempBadge/MannerTempBadge.cjs +4 -7
- package/lib/components/MannerTempBadge/MannerTempBadge.d.ts +1 -1
- package/lib/components/MannerTempBadge/MannerTempBadge.d.ts.map +1 -1
- package/lib/components/MannerTempBadge/MannerTempBadge.js +4 -7
- package/lib/components/ProgressCircle/ProgressCircle.cjs +2 -2
- package/lib/components/ProgressCircle/ProgressCircle.js +2 -2
- package/lib/components/PullToRefresh/PullToRefresh.cjs +2 -2
- package/lib/components/PullToRefresh/PullToRefresh.js +2 -2
- package/lib/components/ReactionButton/ReactionButton.cjs +5 -5
- package/lib/components/ReactionButton/ReactionButton.js +5 -5
- package/lib/components/SegmentedControl/SegmentedControl.cjs +2 -2
- package/lib/components/SegmentedControl/SegmentedControl.js +2 -2
- package/lib/components/SelectBox/CheckSelectBox.cjs +8 -8
- package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/CheckSelectBox.js +8 -8
- package/lib/components/SelectBox/RadioSelectBox.cjs +7 -7
- package/lib/components/SelectBox/RadioSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/RadioSelectBox.js +7 -7
- package/lib/components/Skeleton/Skeleton.cjs +3 -6
- package/lib/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/components/Skeleton/Skeleton.js +3 -6
- package/lib/components/Snackbar/Snackbar.cjs +20 -24
- package/lib/components/Snackbar/Snackbar.d.ts +3 -3
- package/lib/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/lib/components/Snackbar/Snackbar.js +21 -25
- package/lib/components/Snackbar/Snackbar.namespace.cjs +1 -1
- package/lib/components/Snackbar/Snackbar.namespace.d.ts +1 -1
- package/lib/components/Snackbar/Snackbar.namespace.d.ts.map +1 -1
- package/lib/components/Snackbar/Snackbar.namespace.js +1 -1
- package/lib/components/Snackbar/index.cjs +1 -1
- package/lib/components/Snackbar/index.d.ts +1 -1
- package/lib/components/Snackbar/index.d.ts.map +1 -1
- package/lib/components/Snackbar/index.js +1 -1
- package/lib/components/Switch/Switch.cjs +2 -2
- package/lib/components/Switch/Switch.js +2 -2
- package/lib/components/Tabs/Tabs.cjs +2 -2
- package/lib/components/Tabs/Tabs.js +2 -2
- package/lib/components/Text/Text.cjs +2 -2
- package/lib/components/Text/Text.js +2 -2
- package/lib/components/TextField/TextField.cjs +2 -2
- package/lib/components/TextField/TextField.js +2 -2
- package/lib/components/ToggleButton/ToggleButton.cjs +5 -5
- package/lib/components/ToggleButton/ToggleButton.js +5 -5
- package/lib/components/VisuallyHidden/VisuallyHidden.cjs +8 -8
- package/lib/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/lib/components/VisuallyHidden/VisuallyHidden.js +7 -7
- package/lib/components/index.cjs +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/private/useDismissible.d.ts +123 -123
- package/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/lib/utils/createRecipeContext.cjs +74 -0
- package/lib/utils/createRecipeContext.d.ts +24 -0
- package/lib/utils/createRecipeContext.d.ts.map +1 -0
- package/lib/utils/createRecipeContext.js +70 -0
- package/lib/utils/{createStyleContext.cjs → createSlotRecipeContext.cjs} +2 -2
- package/lib/utils/{createStyleContext.d.ts → createSlotRecipeContext.d.ts} +3 -3
- package/lib/utils/createSlotRecipeContext.d.ts.map +1 -0
- package/lib/utils/{createStyleContext.js → createSlotRecipeContext.js} +2 -2
- package/package.json +3 -3
- package/src/components/ActionButton/ActionButton.tsx +7 -7
- package/src/components/ActionChip/ActionChip.tsx +4 -4
- package/src/components/ActionSheet/ActionSheet.tsx +6 -6
- package/src/components/Avatar/Avatar.tsx +2 -2
- package/src/components/Badge/Badge.tsx +3 -3
- package/src/components/BottomSheet/BottomSheet.tsx +2 -2
- package/src/components/Callout/Callout.tsx +2 -2
- package/src/components/Checkbox/Checkbox.tsx +2 -2
- package/src/components/ChipTabs/ChipTabs.tsx +2 -2
- package/src/components/ControlChip/ControlChip.tsx +3 -3
- package/src/components/Dialog/Dialog.tsx +2 -2
- package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +5 -4
- package/src/components/ExtendedFab/ExtendedFab.tsx +7 -11
- package/src/components/Fab/Fab.tsx +3 -3
- package/src/components/HelpBubble/HelpBubble.tsx +7 -4
- package/src/components/IdentityPlaceholder/IdentityPlaceholder.tsx +2 -2
- package/src/components/InlineBanner/InlineBanner.tsx +2 -2
- package/src/components/LinkContent/LinkContent.tsx +2 -4
- package/src/components/MannerTempBadge/MannerTempBadge.tsx +4 -7
- package/src/components/ProgressCircle/ProgressCircle.tsx +2 -2
- package/src/components/PullToRefresh/PullToRefresh.tsx +2 -2
- package/src/components/ReactionButton/ReactionButton.tsx +6 -6
- package/src/components/SegmentedControl/SegmentedControl.tsx +2 -2
- package/src/components/SelectBox/CheckSelectBox.tsx +7 -7
- package/src/components/SelectBox/RadioSelectBox.tsx +6 -6
- package/src/components/Skeleton/Skeleton.tsx +3 -6
- package/src/components/Snackbar/Snackbar.namespace.ts +2 -2
- package/src/components/Snackbar/Snackbar.tsx +22 -23
- package/src/components/Snackbar/index.ts +2 -2
- package/src/components/Switch/Switch.tsx +2 -2
- package/src/components/Tabs/Tabs.tsx +2 -2
- package/src/components/Text/Text.tsx +2 -2
- package/src/components/TextField/TextField.tsx +2 -2
- package/src/components/ToggleButton/ToggleButton.tsx +6 -6
- package/src/components/VisuallyHidden/VisuallyHidden.tsx +6 -8
- package/src/utils/createRecipeContext.tsx +114 -0
- package/src/utils/{createStyleContext.tsx → createSlotRecipeContext.tsx} +3 -3
- package/lib/utils/createStyleContext.d.ts.map +0 -1
|
@@ -5,12 +5,12 @@ import { TextField, useTextFieldContext } from '@seed-design/react-text-field';
|
|
|
5
5
|
import { textField } from '@seed-design/css/recipes/text-field';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { forwardRef, useRef, useCallback } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
9
9
|
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
10
10
|
import { InternalIcon } from '../private/Icon.js';
|
|
11
11
|
import { composeRefs } from '@radix-ui/react-compose-refs';
|
|
12
12
|
|
|
13
|
-
const { withProvider, withContext, useClassNames } =
|
|
13
|
+
const { withProvider, withContext, useClassNames } = createSlotRecipeContext(textField);
|
|
14
14
|
const withStateProps = createWithStateProps([useTextFieldContext]);
|
|
15
15
|
const TextFieldRoot = withProvider(
|
|
16
16
|
TextField.Root,
|
|
@@ -7,7 +7,7 @@ const reactToggle = require('@seed-design/react-toggle');
|
|
|
7
7
|
const toggleButton = require('@seed-design/css/recipes/toggle-button');
|
|
8
8
|
const clsx = require('clsx');
|
|
9
9
|
const React = require('react');
|
|
10
|
-
const
|
|
10
|
+
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
11
11
|
const usePendingButton = require('../LoadingIndicator/usePendingButton.cjs');
|
|
12
12
|
|
|
13
13
|
function _interopNamespaceDefault(e) {
|
|
@@ -29,16 +29,16 @@ function _interopNamespaceDefault(e) {
|
|
|
29
29
|
|
|
30
30
|
const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
31
31
|
|
|
32
|
-
const {
|
|
32
|
+
const { ClassNameProvider } = createRecipeContext.createRecipeContext(toggleButton.toggleButton);
|
|
33
33
|
const ToggleButton = React__namespace.forwardRef(
|
|
34
34
|
({ variant = "brandSolid", size = "small", loading = false, className, ...otherProps }, ref) => {
|
|
35
|
-
const
|
|
35
|
+
const recipeClassName = toggleButton.toggleButton({ variant, size });
|
|
36
36
|
const api = usePendingButton.usePendingButton({ loading, disabled: otherProps.disabled });
|
|
37
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ClassNameProvider, { value: recipeClassName, children: /* @__PURE__ */ jsxRuntime.jsx(usePendingButton.PendingButtonProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
38
|
reactToggle.Toggle.Root,
|
|
39
39
|
{
|
|
40
40
|
ref,
|
|
41
|
-
className: clsx(
|
|
41
|
+
className: clsx(recipeClassName, className),
|
|
42
42
|
...api.stateProps,
|
|
43
43
|
...otherProps
|
|
44
44
|
}
|
|
@@ -3,19 +3,19 @@ import { Toggle } from '@seed-design/react-toggle';
|
|
|
3
3
|
import { toggleButton } from '@seed-design/css/recipes/toggle-button';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
7
7
|
import { usePendingButton, PendingButtonProvider } from '../LoadingIndicator/usePendingButton.js';
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const { ClassNameProvider } = createRecipeContext(toggleButton);
|
|
10
10
|
const ToggleButton = React.forwardRef(
|
|
11
11
|
({ variant = "brandSolid", size = "small", loading = false, className, ...otherProps }, ref) => {
|
|
12
|
-
const
|
|
12
|
+
const recipeClassName = toggleButton({ variant, size });
|
|
13
13
|
const api = usePendingButton({ loading, disabled: otherProps.disabled });
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
+
return /* @__PURE__ */ jsx(ClassNameProvider, { value: recipeClassName, children: /* @__PURE__ */ jsx(PendingButtonProvider, { value: api, children: /* @__PURE__ */ jsx(
|
|
15
15
|
Toggle.Root,
|
|
16
16
|
{
|
|
17
17
|
ref,
|
|
18
|
-
className: clsx(
|
|
18
|
+
className: clsx(recipeClassName, className),
|
|
19
19
|
...api.stateProps,
|
|
20
20
|
...otherProps
|
|
21
21
|
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const domUtils = require('@seed-design/dom-utils');
|
|
5
7
|
const reactPrimitive = require('@seed-design/react-primitive');
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"root"
|
|
13
|
-
);
|
|
8
|
+
const React = require('react');
|
|
9
|
+
|
|
10
|
+
const VisuallyHidden = React.forwardRef((props, ref) => {
|
|
11
|
+
const { style, ...otherProps } = props;
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.div, { ref, style: { ...domUtils.visuallyHidden, ...style }, ...otherProps });
|
|
13
|
+
});
|
|
14
14
|
|
|
15
15
|
exports.VisuallyHidden = VisuallyHidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisuallyHidden.d.ts","sourceRoot":"","sources":["../../../src/components/VisuallyHidden/VisuallyHidden.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.d.ts","sourceRoot":"","sources":["../../../src/components/VisuallyHidden/VisuallyHidden.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,MAAM,WAAW,mBAAoB,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAEpG,eAAO,MAAM,cAAc,4FAGzB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { visuallyHidden } from '@seed-design/dom-utils';
|
|
1
3
|
import { Primitive } from '@seed-design/react-primitive';
|
|
2
|
-
import {
|
|
3
|
-
import { createStyleContext } from '../../utils/createStyleContext.js';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
Primitive.div,
|
|
8
|
-
|
|
9
|
-
);
|
|
6
|
+
const VisuallyHidden = forwardRef((props, ref) => {
|
|
7
|
+
const { style, ...otherProps } = props;
|
|
8
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ref, style: { ...visuallyHidden, ...style }, ...otherProps });
|
|
9
|
+
});
|
|
10
10
|
|
|
11
11
|
export { VisuallyHidden };
|
package/lib/components/index.cjs
CHANGED
|
@@ -221,7 +221,7 @@ exports.RadioSelectBox = RadioSelectBox_namespace;
|
|
|
221
221
|
exports.Skeleton = Skeleton.Skeleton;
|
|
222
222
|
exports.SnackbarActionButton = Snackbar.SnackbarActionButton;
|
|
223
223
|
exports.SnackbarAvoidOverlap = Snackbar.SnackbarAvoidOverlap;
|
|
224
|
-
exports.
|
|
224
|
+
exports.SnackbarHiddenCloseButton = Snackbar.SnackbarHiddenCloseButton;
|
|
225
225
|
exports.SnackbarMessage = Snackbar.SnackbarMessage;
|
|
226
226
|
exports.SnackbarPrefixIcon = Snackbar.SnackbarPrefixIcon;
|
|
227
227
|
exports.SnackbarRegion = Snackbar.SnackbarRegion;
|
package/lib/components/index.js
CHANGED
|
@@ -65,7 +65,7 @@ export { CheckSelectBox_namespace as CheckSelectBox };
|
|
|
65
65
|
import * as RadioSelectBox_namespace from './SelectBox/RadioSelectBox.namespace.js';
|
|
66
66
|
export { RadioSelectBox_namespace as RadioSelectBox };
|
|
67
67
|
export { Skeleton } from './Skeleton/Skeleton.js';
|
|
68
|
-
export { SnackbarActionButton, SnackbarAvoidOverlap,
|
|
68
|
+
export { SnackbarActionButton, SnackbarAvoidOverlap, SnackbarHiddenCloseButton, SnackbarMessage, SnackbarPrefixIcon, SnackbarRegion, SnackbarRenderer, SnackbarRoot, SnackbarRootProvider } from './Snackbar/Snackbar.js';
|
|
69
69
|
export { useSnackbarContext } from '@seed-design/react-snackbar';
|
|
70
70
|
export { useSnackbarAdapter } from './Snackbar/useSnackbarAdapter.js';
|
|
71
71
|
import * as Snackbar_namespace from './Snackbar/Snackbar.namespace.js';
|