@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.
Files changed (146) hide show
  1. package/lib/components/ActionButton/ActionButton.cjs +6 -6
  2. package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
  3. package/lib/components/ActionButton/ActionButton.js +6 -6
  4. package/lib/components/ActionChip/ActionChip.cjs +4 -4
  5. package/lib/components/ActionChip/ActionChip.d.ts +1 -1
  6. package/lib/components/ActionChip/ActionChip.d.ts.map +1 -1
  7. package/lib/components/ActionChip/ActionChip.js +4 -4
  8. package/lib/components/ActionSheet/ActionSheet.cjs +7 -7
  9. package/lib/components/ActionSheet/ActionSheet.d.ts +2 -2
  10. package/lib/components/ActionSheet/ActionSheet.d.ts.map +1 -1
  11. package/lib/components/ActionSheet/ActionSheet.js +7 -7
  12. package/lib/components/Avatar/Avatar.cjs +2 -2
  13. package/lib/components/Avatar/Avatar.js +2 -2
  14. package/lib/components/Badge/Badge.cjs +3 -3
  15. package/lib/components/Badge/Badge.d.ts.map +1 -1
  16. package/lib/components/Badge/Badge.js +3 -3
  17. package/lib/components/BottomSheet/BottomSheet.cjs +2 -2
  18. package/lib/components/BottomSheet/BottomSheet.js +2 -2
  19. package/lib/components/Callout/Callout.cjs +2 -2
  20. package/lib/components/Callout/Callout.js +2 -2
  21. package/lib/components/Checkbox/Checkbox.cjs +2 -2
  22. package/lib/components/Checkbox/Checkbox.js +2 -2
  23. package/lib/components/ChipTabs/ChipTabs.cjs +2 -2
  24. package/lib/components/ChipTabs/ChipTabs.js +2 -2
  25. package/lib/components/ControlChip/ControlChip.cjs +3 -3
  26. package/lib/components/ControlChip/ControlChip.js +3 -3
  27. package/lib/components/Dialog/Dialog.cjs +2 -2
  28. package/lib/components/Dialog/Dialog.js +2 -2
  29. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +5 -4
  30. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts.map +1 -1
  31. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +5 -4
  32. package/lib/components/ExtendedFab/ExtendedFab.cjs +7 -11
  33. package/lib/components/ExtendedFab/ExtendedFab.d.ts.map +1 -1
  34. package/lib/components/ExtendedFab/ExtendedFab.js +7 -11
  35. package/lib/components/Fab/Fab.cjs +3 -3
  36. package/lib/components/Fab/Fab.d.ts.map +1 -1
  37. package/lib/components/Fab/Fab.js +3 -3
  38. package/lib/components/HelpBubble/HelpBubble.cjs +8 -3
  39. package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
  40. package/lib/components/HelpBubble/HelpBubble.js +8 -3
  41. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.cjs +2 -2
  42. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.js +2 -2
  43. package/lib/components/InlineBanner/InlineBanner.cjs +2 -2
  44. package/lib/components/InlineBanner/InlineBanner.js +2 -2
  45. package/lib/components/LinkContent/LinkContent.cjs +3 -4
  46. package/lib/components/LinkContent/LinkContent.d.ts.map +1 -1
  47. package/lib/components/LinkContent/LinkContent.js +3 -4
  48. package/lib/components/LoadingIndicator/usePendingButton.d.ts +57 -57
  49. package/lib/components/MannerTempBadge/MannerTempBadge.cjs +4 -7
  50. package/lib/components/MannerTempBadge/MannerTempBadge.d.ts +1 -1
  51. package/lib/components/MannerTempBadge/MannerTempBadge.d.ts.map +1 -1
  52. package/lib/components/MannerTempBadge/MannerTempBadge.js +4 -7
  53. package/lib/components/ProgressCircle/ProgressCircle.cjs +2 -2
  54. package/lib/components/ProgressCircle/ProgressCircle.js +2 -2
  55. package/lib/components/PullToRefresh/PullToRefresh.cjs +2 -2
  56. package/lib/components/PullToRefresh/PullToRefresh.js +2 -2
  57. package/lib/components/ReactionButton/ReactionButton.cjs +5 -5
  58. package/lib/components/ReactionButton/ReactionButton.js +5 -5
  59. package/lib/components/SegmentedControl/SegmentedControl.cjs +2 -2
  60. package/lib/components/SegmentedControl/SegmentedControl.js +2 -2
  61. package/lib/components/SelectBox/CheckSelectBox.cjs +8 -8
  62. package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
  63. package/lib/components/SelectBox/CheckSelectBox.js +8 -8
  64. package/lib/components/SelectBox/RadioSelectBox.cjs +7 -7
  65. package/lib/components/SelectBox/RadioSelectBox.d.ts.map +1 -1
  66. package/lib/components/SelectBox/RadioSelectBox.js +7 -7
  67. package/lib/components/Skeleton/Skeleton.cjs +3 -6
  68. package/lib/components/Skeleton/Skeleton.d.ts.map +1 -1
  69. package/lib/components/Skeleton/Skeleton.js +3 -6
  70. package/lib/components/Snackbar/Snackbar.cjs +20 -24
  71. package/lib/components/Snackbar/Snackbar.d.ts +3 -3
  72. package/lib/components/Snackbar/Snackbar.d.ts.map +1 -1
  73. package/lib/components/Snackbar/Snackbar.js +21 -25
  74. package/lib/components/Snackbar/Snackbar.namespace.cjs +1 -1
  75. package/lib/components/Snackbar/Snackbar.namespace.d.ts +1 -1
  76. package/lib/components/Snackbar/Snackbar.namespace.d.ts.map +1 -1
  77. package/lib/components/Snackbar/Snackbar.namespace.js +1 -1
  78. package/lib/components/Snackbar/index.cjs +1 -1
  79. package/lib/components/Snackbar/index.d.ts +1 -1
  80. package/lib/components/Snackbar/index.d.ts.map +1 -1
  81. package/lib/components/Snackbar/index.js +1 -1
  82. package/lib/components/Switch/Switch.cjs +2 -2
  83. package/lib/components/Switch/Switch.js +2 -2
  84. package/lib/components/Tabs/Tabs.cjs +2 -2
  85. package/lib/components/Tabs/Tabs.js +2 -2
  86. package/lib/components/Text/Text.cjs +2 -2
  87. package/lib/components/Text/Text.js +2 -2
  88. package/lib/components/TextField/TextField.cjs +2 -2
  89. package/lib/components/TextField/TextField.js +2 -2
  90. package/lib/components/ToggleButton/ToggleButton.cjs +5 -5
  91. package/lib/components/ToggleButton/ToggleButton.js +5 -5
  92. package/lib/components/VisuallyHidden/VisuallyHidden.cjs +8 -8
  93. package/lib/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
  94. package/lib/components/VisuallyHidden/VisuallyHidden.js +7 -7
  95. package/lib/components/index.cjs +1 -1
  96. package/lib/components/index.js +1 -1
  97. package/lib/components/private/useDismissible.d.ts +123 -123
  98. package/lib/index.cjs +1 -1
  99. package/lib/index.js +1 -1
  100. package/lib/utils/createRecipeContext.cjs +74 -0
  101. package/lib/utils/createRecipeContext.d.ts +24 -0
  102. package/lib/utils/createRecipeContext.d.ts.map +1 -0
  103. package/lib/utils/createRecipeContext.js +70 -0
  104. package/lib/utils/{createStyleContext.cjs → createSlotRecipeContext.cjs} +2 -2
  105. package/lib/utils/{createStyleContext.d.ts → createSlotRecipeContext.d.ts} +3 -3
  106. package/lib/utils/createSlotRecipeContext.d.ts.map +1 -0
  107. package/lib/utils/{createStyleContext.js → createSlotRecipeContext.js} +2 -2
  108. package/package.json +3 -3
  109. package/src/components/ActionButton/ActionButton.tsx +7 -7
  110. package/src/components/ActionChip/ActionChip.tsx +4 -4
  111. package/src/components/ActionSheet/ActionSheet.tsx +6 -6
  112. package/src/components/Avatar/Avatar.tsx +2 -2
  113. package/src/components/Badge/Badge.tsx +3 -3
  114. package/src/components/BottomSheet/BottomSheet.tsx +2 -2
  115. package/src/components/Callout/Callout.tsx +2 -2
  116. package/src/components/Checkbox/Checkbox.tsx +2 -2
  117. package/src/components/ChipTabs/ChipTabs.tsx +2 -2
  118. package/src/components/ControlChip/ControlChip.tsx +3 -3
  119. package/src/components/Dialog/Dialog.tsx +2 -2
  120. package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +5 -4
  121. package/src/components/ExtendedFab/ExtendedFab.tsx +7 -11
  122. package/src/components/Fab/Fab.tsx +3 -3
  123. package/src/components/HelpBubble/HelpBubble.tsx +7 -4
  124. package/src/components/IdentityPlaceholder/IdentityPlaceholder.tsx +2 -2
  125. package/src/components/InlineBanner/InlineBanner.tsx +2 -2
  126. package/src/components/LinkContent/LinkContent.tsx +2 -4
  127. package/src/components/MannerTempBadge/MannerTempBadge.tsx +4 -7
  128. package/src/components/ProgressCircle/ProgressCircle.tsx +2 -2
  129. package/src/components/PullToRefresh/PullToRefresh.tsx +2 -2
  130. package/src/components/ReactionButton/ReactionButton.tsx +6 -6
  131. package/src/components/SegmentedControl/SegmentedControl.tsx +2 -2
  132. package/src/components/SelectBox/CheckSelectBox.tsx +7 -7
  133. package/src/components/SelectBox/RadioSelectBox.tsx +6 -6
  134. package/src/components/Skeleton/Skeleton.tsx +3 -6
  135. package/src/components/Snackbar/Snackbar.namespace.ts +2 -2
  136. package/src/components/Snackbar/Snackbar.tsx +22 -23
  137. package/src/components/Snackbar/index.ts +2 -2
  138. package/src/components/Switch/Switch.tsx +2 -2
  139. package/src/components/Tabs/Tabs.tsx +2 -2
  140. package/src/components/Text/Text.tsx +2 -2
  141. package/src/components/TextField/TextField.tsx +2 -2
  142. package/src/components/ToggleButton/ToggleButton.tsx +6 -6
  143. package/src/components/VisuallyHidden/VisuallyHidden.tsx +6 -8
  144. package/src/utils/createRecipeContext.tsx +114 -0
  145. package/src/utils/{createStyleContext.tsx → createSlotRecipeContext.tsx} +3 -3
  146. 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 { createStyleContext } from '../../utils/createStyleContext.js';
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 } = createStyleContext(textField);
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 createStyleContext = require('../../utils/createStyleContext.cjs');
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 { ClassNamesProvider } = createStyleContext.createStyleContext(toggleButton.toggleButton);
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 classNames = toggleButton.toggleButton({ variant, size });
35
+ const recipeClassName = toggleButton.toggleButton({ variant, size });
36
36
  const api = usePendingButton.usePendingButton({ loading, disabled: otherProps.disabled });
37
- return /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(usePendingButton.PendingButtonProvider, { value: api, children: /* @__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(classNames.root, className),
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 { createStyleContext } from '../../utils/createStyleContext.js';
6
+ import { createRecipeContext } from '../../utils/createRecipeContext.js';
7
7
  import { usePendingButton, PendingButtonProvider } from '../LoadingIndicator/usePendingButton.js';
8
8
 
9
- const { ClassNamesProvider } = createStyleContext(toggleButton);
9
+ const { ClassNameProvider } = createRecipeContext(toggleButton);
10
10
  const ToggleButton = React.forwardRef(
11
11
  ({ variant = "brandSolid", size = "small", loading = false, className, ...otherProps }, ref) => {
12
- const classNames = toggleButton({ variant, size });
12
+ const recipeClassName = toggleButton({ variant, size });
13
13
  const api = usePendingButton({ loading, disabled: otherProps.disabled });
14
- return /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(PendingButtonProvider, { value: api, children: /* @__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(classNames.root, className),
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 visuallyHidden = require('@seed-design/css/recipes/visually-hidden');
7
- const createStyleContext = require('../../utils/createStyleContext.cjs');
8
-
9
- const { withProvider } = createStyleContext.createStyleContext(visuallyHidden.visuallyHidden);
10
- const VisuallyHidden = withProvider(
11
- reactPrimitive.Primitive.div,
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":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAKpC,MAAM,WAAW,mBAAoB,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAEpG,eAAO,MAAM,cAAc,4FAG1B,CAAC"}
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 { visuallyHidden } from '@seed-design/css/recipes/visually-hidden';
3
- import { createStyleContext } from '../../utils/createStyleContext.js';
4
+ import { forwardRef } from 'react';
4
5
 
5
- const { withProvider } = createStyleContext(visuallyHidden);
6
- const VisuallyHidden = withProvider(
7
- Primitive.div,
8
- "root"
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 };
@@ -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.SnackbarCloseButton = Snackbar.SnackbarCloseButton;
224
+ exports.SnackbarHiddenCloseButton = Snackbar.SnackbarHiddenCloseButton;
225
225
  exports.SnackbarMessage = Snackbar.SnackbarMessage;
226
226
  exports.SnackbarPrefixIcon = Snackbar.SnackbarPrefixIcon;
227
227
  exports.SnackbarRegion = Snackbar.SnackbarRegion;
@@ -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, SnackbarCloseButton, SnackbarMessage, SnackbarPrefixIcon, SnackbarRegion, SnackbarRenderer, SnackbarRoot, SnackbarRootProvider } from './Snackbar/Snackbar.js';
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';