@seed-design/react 0.0.7 → 0.0.9

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 (111) hide show
  1. package/lib/components/ActionButton/ActionButton.cjs +2 -4
  2. package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
  3. package/lib/components/ActionButton/ActionButton.js +2 -4
  4. package/lib/components/ActionChip/ActionChip.cjs +2 -2
  5. package/lib/components/ActionChip/ActionChip.js +2 -2
  6. package/lib/components/ActionSheet/ActionSheet.cjs +2 -2
  7. package/lib/components/ActionSheet/ActionSheet.js +2 -2
  8. package/lib/components/Badge/Badge.cjs +2 -2
  9. package/lib/components/Badge/Badge.d.ts.map +1 -1
  10. package/lib/components/Badge/Badge.js +2 -2
  11. package/lib/components/ControlChip/ControlChip.cjs +2 -2
  12. package/lib/components/ControlChip/ControlChip.js +2 -2
  13. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +2 -2
  14. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +2 -2
  15. package/lib/components/ExtendedFab/ExtendedFab.cjs +2 -2
  16. package/lib/components/ExtendedFab/ExtendedFab.js +2 -2
  17. package/lib/components/Fab/Fab.cjs +2 -2
  18. package/lib/components/Fab/Fab.d.ts.map +1 -1
  19. package/lib/components/Fab/Fab.js +2 -2
  20. package/lib/components/LinkContent/LinkContent.cjs +2 -2
  21. package/lib/components/LinkContent/LinkContent.js +2 -2
  22. package/lib/components/MannerTemp/MannerTemp.cjs +19 -0
  23. package/lib/components/MannerTemp/MannerTemp.d.ts +7 -0
  24. package/lib/components/MannerTemp/MannerTemp.d.ts.map +1 -0
  25. package/lib/components/MannerTemp/MannerTemp.js +15 -0
  26. package/lib/components/MannerTemp/MannerTempEmote.cjs +632 -0
  27. package/lib/components/MannerTemp/MannerTempEmote.d.ts +7 -0
  28. package/lib/components/MannerTemp/MannerTempEmote.d.ts.map +1 -0
  29. package/lib/components/MannerTemp/MannerTempEmote.js +627 -0
  30. package/lib/components/MannerTemp/index.cjs +11 -0
  31. package/lib/components/MannerTemp/index.d.ts +3 -0
  32. package/lib/components/MannerTemp/index.d.ts.map +1 -0
  33. package/lib/components/MannerTemp/index.js +2 -0
  34. package/lib/components/MannerTempBadge/MannerTempBadge.cjs +2 -2
  35. package/lib/components/MannerTempBadge/MannerTempBadge.d.ts.map +1 -1
  36. package/lib/components/MannerTempBadge/MannerTempBadge.js +2 -2
  37. package/lib/components/NotificationBadge/NotificationBadge.cjs +43 -0
  38. package/lib/components/NotificationBadge/NotificationBadge.d.ts +11 -0
  39. package/lib/components/NotificationBadge/NotificationBadge.d.ts.map +1 -0
  40. package/lib/components/NotificationBadge/NotificationBadge.js +20 -0
  41. package/lib/components/NotificationBadge/index.cjs +10 -0
  42. package/lib/components/NotificationBadge/index.d.ts +2 -0
  43. package/lib/components/NotificationBadge/index.d.ts.map +1 -0
  44. package/lib/components/NotificationBadge/index.js +1 -0
  45. package/lib/components/ReactionButton/ReactionButton.cjs +2 -4
  46. package/lib/components/ReactionButton/ReactionButton.d.ts.map +1 -1
  47. package/lib/components/ReactionButton/ReactionButton.js +2 -4
  48. package/lib/components/SelectBox/CheckSelectBox.cjs +3 -3
  49. package/lib/components/SelectBox/CheckSelectBox.js +3 -3
  50. package/lib/components/SelectBox/RadioSelectBox.cjs +3 -3
  51. package/lib/components/SelectBox/RadioSelectBox.js +3 -3
  52. package/lib/components/Skeleton/Skeleton.cjs +2 -2
  53. package/lib/components/Skeleton/Skeleton.d.ts.map +1 -1
  54. package/lib/components/Skeleton/Skeleton.js +2 -2
  55. package/lib/components/Snackbar/Snackbar.cjs +2 -2
  56. package/lib/components/Snackbar/Snackbar.js +2 -2
  57. package/lib/components/Tabs/Tabs.cjs +1 -11
  58. package/lib/components/Tabs/Tabs.d.ts +9 -13
  59. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  60. package/lib/components/Tabs/Tabs.js +2 -11
  61. package/lib/components/Tabs/Tabs.namespace.cjs +0 -1
  62. package/lib/components/Tabs/Tabs.namespace.d.ts +1 -1
  63. package/lib/components/Tabs/Tabs.namespace.d.ts.map +1 -1
  64. package/lib/components/Tabs/Tabs.namespace.js +1 -1
  65. package/lib/components/Tabs/index.cjs +0 -1
  66. package/lib/components/Tabs/index.d.ts +1 -1
  67. package/lib/components/Tabs/index.d.ts.map +1 -1
  68. package/lib/components/Tabs/index.js +1 -1
  69. package/lib/components/ToggleButton/ToggleButton.cjs +3 -5
  70. package/lib/components/ToggleButton/ToggleButton.d.ts +1 -1
  71. package/lib/components/ToggleButton/ToggleButton.d.ts.map +1 -1
  72. package/lib/components/ToggleButton/ToggleButton.js +3 -5
  73. package/lib/components/index.cjs +7 -1
  74. package/lib/components/index.d.ts +2 -0
  75. package/lib/components/index.d.ts.map +1 -1
  76. package/lib/components/index.js +4 -1
  77. package/lib/index.cjs +7 -1
  78. package/lib/index.js +4 -1
  79. package/lib/utils/createRecipeContext.cjs +6 -41
  80. package/lib/utils/createRecipeContext.d.ts +4 -12
  81. package/lib/utils/createRecipeContext.d.ts.map +1 -1
  82. package/lib/utils/createRecipeContext.js +6 -41
  83. package/lib/utils/createWithStateProps.cjs +1 -1
  84. package/lib/utils/createWithStateProps.js +1 -1
  85. package/package.json +3 -3
  86. package/src/components/ActionButton/ActionButton.tsx +12 -17
  87. package/src/components/ActionChip/ActionChip.tsx +2 -2
  88. package/src/components/ActionSheet/ActionSheet.tsx +2 -2
  89. package/src/components/Badge/Badge.tsx +2 -2
  90. package/src/components/ControlChip/ControlChip.tsx +2 -2
  91. package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +2 -2
  92. package/src/components/ExtendedFab/ExtendedFab.tsx +2 -2
  93. package/src/components/Fab/Fab.tsx +2 -2
  94. package/src/components/LinkContent/LinkContent.tsx +2 -2
  95. package/src/components/MannerTemp/MannerTemp.tsx +25 -0
  96. package/src/components/MannerTemp/MannerTempEmote.tsx +464 -0
  97. package/src/components/MannerTemp/index.ts +2 -0
  98. package/src/components/MannerTempBadge/MannerTempBadge.tsx +2 -2
  99. package/src/components/NotificationBadge/NotificationBadge.tsx +47 -0
  100. package/src/components/NotificationBadge/index.ts +6 -0
  101. package/src/components/ReactionButton/ReactionButton.tsx +8 -13
  102. package/src/components/SelectBox/CheckSelectBox.tsx +3 -3
  103. package/src/components/SelectBox/RadioSelectBox.tsx +3 -3
  104. package/src/components/Skeleton/Skeleton.tsx +2 -2
  105. package/src/components/Snackbar/Snackbar.tsx +2 -2
  106. package/src/components/Tabs/Tabs.namespace.ts +0 -2
  107. package/src/components/Tabs/Tabs.tsx +1 -22
  108. package/src/components/Tabs/index.ts +0 -2
  109. package/src/components/ToggleButton/ToggleButton.tsx +9 -14
  110. package/src/components/index.ts +2 -0
  111. package/src/utils/createRecipeContext.tsx +12 -72
@@ -47,7 +47,10 @@ import * as InlineBanner_namespace from './InlineBanner/InlineBanner.namespace.j
47
47
  export { InlineBanner_namespace as InlineBanner };
48
48
  export { LinkContent } from './LinkContent/LinkContent.js';
49
49
  export { LoadingIndicator } from './LoadingIndicator/LoadingIndicator.js';
50
+ export { MannerTemp } from './MannerTemp/MannerTemp.js';
51
+ export { MannerTempEmote } from './MannerTemp/MannerTempEmote.js';
50
52
  export { MannerTempBadge } from './MannerTempBadge/MannerTempBadge.js';
53
+ export { NotificationBadge, NotificationBadgePositioner } from './NotificationBadge/NotificationBadge.js';
51
54
  export { ProgressCircleRange, ProgressCircleRoot, ProgressCircleTrack } from './ProgressCircle/ProgressCircle.js';
52
55
  import * as ProgressCircle_namespace from './ProgressCircle/ProgressCircle.namespace.js';
53
56
  export { ProgressCircle_namespace as ProgressCircle };
@@ -74,7 +77,7 @@ export { Stack } from './Stack/Stack.js';
74
77
  export { SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchThumb } from './Switch/Switch.js';
75
78
  import * as Switch_namespace from './Switch/Switch.namespace.js';
76
79
  export { Switch_namespace as Switch };
77
- export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger, TabsTriggerNotification } from './Tabs/Tabs.js';
80
+ export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger } from './Tabs/Tabs.js';
78
81
  import * as Tabs_namespace from './Tabs/Tabs.namespace.js';
79
82
  export { Tabs_namespace as Tabs };
80
83
  export { Text } from './Text/Text.js';
package/lib/index.cjs CHANGED
@@ -40,7 +40,10 @@ const InlineBanner = require('./components/InlineBanner/InlineBanner.cjs');
40
40
  const InlineBanner_namespace = require('./components/InlineBanner/InlineBanner.namespace.cjs');
41
41
  const LinkContent = require('./components/LinkContent/LinkContent.cjs');
42
42
  const LoadingIndicator = require('./components/LoadingIndicator/LoadingIndicator.cjs');
43
+ const MannerTemp = require('./components/MannerTemp/MannerTemp.cjs');
44
+ const MannerTempEmote = require('./components/MannerTemp/MannerTempEmote.cjs');
43
45
  const MannerTempBadge = require('./components/MannerTempBadge/MannerTempBadge.cjs');
46
+ const NotificationBadge = require('./components/NotificationBadge/NotificationBadge.cjs');
44
47
  const ProgressCircle = require('./components/ProgressCircle/ProgressCircle.cjs');
45
48
  const ProgressCircle_namespace = require('./components/ProgressCircle/ProgressCircle.namespace.cjs');
46
49
  const PullToRefresh = require('./components/PullToRefresh/PullToRefresh.cjs');
@@ -185,7 +188,11 @@ exports.InlineBannerTitle = InlineBanner.InlineBannerTitle;
185
188
  exports.InlineBanner = InlineBanner_namespace;
186
189
  exports.LinkContent = LinkContent.LinkContent;
187
190
  exports.LoadingIndicator = LoadingIndicator.LoadingIndicator;
191
+ exports.MannerTemp = MannerTemp.MannerTemp;
192
+ exports.MannerTempEmote = MannerTempEmote.MannerTempEmote;
188
193
  exports.MannerTempBadge = MannerTempBadge.MannerTempBadge;
194
+ exports.NotificationBadge = NotificationBadge.NotificationBadge;
195
+ exports.NotificationBadgePositioner = NotificationBadge.NotificationBadgePositioner;
189
196
  exports.ProgressCircleRange = ProgressCircle.ProgressCircleRange;
190
197
  exports.ProgressCircleRoot = ProgressCircle.ProgressCircleRoot;
191
198
  exports.ProgressCircleTrack = ProgressCircle.ProgressCircleTrack;
@@ -248,7 +255,6 @@ exports.TabsIndicator = Tabs.TabsIndicator;
248
255
  exports.TabsList = Tabs.TabsList;
249
256
  exports.TabsRoot = Tabs.TabsRoot;
250
257
  exports.TabsTrigger = Tabs.TabsTrigger;
251
- exports.TabsTriggerNotification = Tabs.TabsTriggerNotification;
252
258
  exports.Tabs = Tabs_namespace;
253
259
  exports.Text = Text.Text;
254
260
  exports.TextFieldCharacterCount = TextField.TextFieldCharacterCount;
package/lib/index.js CHANGED
@@ -47,7 +47,10 @@ import * as InlineBanner_namespace from './components/InlineBanner/InlineBanner.
47
47
  export { InlineBanner_namespace as InlineBanner };
48
48
  export { LinkContent } from './components/LinkContent/LinkContent.js';
49
49
  export { LoadingIndicator } from './components/LoadingIndicator/LoadingIndicator.js';
50
+ export { MannerTemp } from './components/MannerTemp/MannerTemp.js';
51
+ export { MannerTempEmote } from './components/MannerTemp/MannerTempEmote.js';
50
52
  export { MannerTempBadge } from './components/MannerTempBadge/MannerTempBadge.js';
53
+ export { NotificationBadge, NotificationBadgePositioner } from './components/NotificationBadge/NotificationBadge.js';
51
54
  export { ProgressCircleRange, ProgressCircleRoot, ProgressCircleTrack } from './components/ProgressCircle/ProgressCircle.js';
52
55
  import * as ProgressCircle_namespace from './components/ProgressCircle/ProgressCircle.namespace.js';
53
56
  export { ProgressCircle_namespace as ProgressCircle };
@@ -74,7 +77,7 @@ export { Stack } from './components/Stack/Stack.js';
74
77
  export { SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchThumb } from './components/Switch/Switch.js';
75
78
  import * as Switch_namespace from './components/Switch/Switch.namespace.js';
76
79
  export { Switch_namespace as Switch };
77
- export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger, TabsTriggerNotification } from './components/Tabs/Tabs.js';
80
+ export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger } from './components/Tabs/Tabs.js';
78
81
  import * as Tabs_namespace from './components/Tabs/Tabs.namespace.js';
79
82
  export { Tabs_namespace as Tabs };
80
83
  export { Text } from './components/Text/Text.js';
@@ -7,41 +7,14 @@ const clsx = require('clsx');
7
7
  const React = require('react');
8
8
 
9
9
  function createRecipeContext(recipe) {
10
- const ClassNameContext = React.createContext(null);
11
10
  const PropsContext = React.createContext(null);
12
- const ClassNameProvider = ({
13
- children,
14
- value
15
- }) => {
16
- return /* @__PURE__ */ jsxRuntime.jsx(ClassNameContext.Provider, { value, children });
17
- };
18
11
  const PropsProvider = ({ children, value }) => {
19
12
  return /* @__PURE__ */ jsxRuntime.jsx(PropsContext.Provider, { value, children });
20
13
  };
21
- function useClassName() {
22
- const context = React.useContext(ClassNameContext);
23
- if (context === null) {
24
- throw new Error(
25
- "useClassName must be used within a ClassNameProvider. Did you forget to wrap your component in a ClassNameProvider?"
26
- );
27
- }
28
- return context;
29
- }
30
14
  function useProps() {
31
15
  return React.useContext(PropsContext);
32
16
  }
33
- const withRootProvider = (Component, options) => {
34
- const { defaultProps } = options ?? {};
35
- const StyledComponent = (innerProps) => {
36
- const props = { ...defaultProps ?? {}, ...useProps(), ...innerProps };
37
- const [variantProps, otherProps] = recipe.splitVariantProps(props);
38
- const className = recipe(variantProps);
39
- return /* @__PURE__ */ jsxRuntime.jsx(ClassNameProvider, { value: className, children: /* @__PURE__ */ jsxRuntime.jsx(Component, { ...otherProps, className: clsx(className, props.className) }) });
40
- };
41
- StyledComponent.displayName = Component.displayName || Component.name;
42
- return StyledComponent;
43
- };
44
- const withProvider = (Component, options) => {
17
+ const withContext = (Component, options) => {
45
18
  const { defaultProps } = options ?? {};
46
19
  const StyledComponent = React.forwardRef((innerProps, ref) => {
47
20
  const props = { ...defaultProps ?? {}, ...useProps(), ...innerProps };
@@ -52,22 +25,14 @@ function createRecipeContext(recipe) {
52
25
  StyledComponent.displayName = Component.displayName || Component.name;
53
26
  return StyledComponent;
54
27
  };
55
- const withContext = (Component) => {
56
- const StyledComponent = React.forwardRef((props, ref) => {
57
- const className = useClassName();
58
- return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, ...props, className: clsx(className, props.className) });
59
- });
60
- StyledComponent.displayName = Component.displayName || Component.name;
61
- return StyledComponent;
62
- };
28
+ function withPropsProvider() {
29
+ return PropsProvider;
30
+ }
63
31
  return {
64
- ClassNameProvider,
65
32
  PropsProvider,
66
- useClassName,
67
33
  useProps,
68
- withRootProvider,
69
- withProvider,
70
- withContext
34
+ withContext,
35
+ withPropsProvider
71
36
  };
72
37
  }
73
38
 
@@ -1,24 +1,16 @@
1
- type Recipe<Props extends Record<string, string | boolean | undefined>, ClassName extends string> = ((props?: Props) => ClassName) & {
1
+ type Recipe<Props extends Record<string, string | boolean | undefined>> = ((props?: Props) => string) & {
2
2
  splitVariantProps: <T extends Props>(props: T) => [Props, Omit<T, keyof Props>];
3
3
  };
4
- export declare function createRecipeContext<Props extends Record<string, string | boolean | undefined>, ClassName extends string>(recipe: Recipe<Props, ClassName>): {
5
- ClassNameProvider: ({ children, value, }: {
6
- children: React.ReactNode;
7
- value: ClassName;
8
- }) => import("react/jsx-runtime").JSX.Element;
4
+ export declare function createRecipeContext<Props extends Record<string, string | boolean | undefined>>(recipe: Recipe<Props>): {
9
5
  PropsProvider: ({ children, value }: {
10
6
  children: React.ReactNode;
11
7
  value: Props;
12
8
  }) => import("react/jsx-runtime").JSX.Element;
13
- useClassName: () => ClassName;
14
9
  useProps: () => Props | null;
15
- withRootProvider: <P>(Component: React.ElementType<any>, options?: {
16
- defaultProps?: Partial<P>;
17
- }) => React.ForwardRefExoticComponent<React.PropsWithoutRef<P>>;
18
- withProvider: <T, P>(Component: React.ElementType<any>, options?: {
10
+ withContext: <T, P>(Component: React.ElementType<any>, options?: {
19
11
  defaultProps?: Partial<P>;
20
12
  }) => React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>;
21
- withContext: <T, P>(Component: React.ElementType<any>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>;
13
+ withPropsProvider: <P>() => React.Provider<Partial<P>>;
22
14
  };
23
15
  export {};
24
16
  //# sourceMappingURL=createRecipeContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createRecipeContext.d.ts","sourceRoot":"","sources":["../../src/utils/createRecipeContext.tsx"],"names":[],"mappings":"AAGA,KAAK,MAAM,CACT,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,EAC1D,SAAS,SAAS,MAAM,IACtB,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,SAAS,CAAC,GAAG;IACnC,iBAAiB,EAAE,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,CAAC,CAAC;CACjF,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,EAC1D,SAAS,SAAS,MAAM,EACxB,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC;8CAO7B;QACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;QAC1B,KAAK,EAAE,SAAS,CAAC;KAClB;yCAI2C;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE;;;uBAkB7D,CAAC,aACd,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,YACvB;QACR,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;KAC3B,KACA,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;mBAoBtC,CAAC,EAAE,CAAC,aACb,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,YACvB;QACR,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;KAC3B,KACA,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;kBAgBhE,CAAC,EAAE,CAAC,aACZ,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,KAChC,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;EAoBtF"}
1
+ {"version":3,"file":"createRecipeContext.d.ts","sourceRoot":"","sources":["../../src/utils/createRecipeContext.tsx"],"names":[],"mappings":"AAGA,KAAK,MAAM,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CACzE,KAAK,CAAC,EAAE,KAAK,KACV,MAAM,CAAC,GAAG;IACb,iBAAiB,EAAE,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,CAAC,CAAC;CACjF,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,EAC5F,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;yCAIuB;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE;;kBAQlE,CAAC,EAAE,CAAC,aACZ,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,YACvB;QACR,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;KAC3B,KACA,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;wBAgB1D,CAAC,OAAK,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;EAU5D"}
@@ -3,41 +3,14 @@ import clsx from 'clsx';
3
3
  import { createContext, forwardRef, useContext } from 'react';
4
4
 
5
5
  function createRecipeContext(recipe) {
6
- const ClassNameContext = createContext(null);
7
6
  const PropsContext = createContext(null);
8
- const ClassNameProvider = ({
9
- children,
10
- value
11
- }) => {
12
- return /* @__PURE__ */ jsx(ClassNameContext.Provider, { value, children });
13
- };
14
7
  const PropsProvider = ({ children, value }) => {
15
8
  return /* @__PURE__ */ jsx(PropsContext.Provider, { value, children });
16
9
  };
17
- function useClassName() {
18
- const context = useContext(ClassNameContext);
19
- if (context === null) {
20
- throw new Error(
21
- "useClassName must be used within a ClassNameProvider. Did you forget to wrap your component in a ClassNameProvider?"
22
- );
23
- }
24
- return context;
25
- }
26
10
  function useProps() {
27
11
  return useContext(PropsContext);
28
12
  }
29
- const withRootProvider = (Component, options) => {
30
- const { defaultProps } = options ?? {};
31
- const StyledComponent = (innerProps) => {
32
- const props = { ...defaultProps ?? {}, ...useProps(), ...innerProps };
33
- const [variantProps, otherProps] = recipe.splitVariantProps(props);
34
- const className = recipe(variantProps);
35
- return /* @__PURE__ */ jsx(ClassNameProvider, { value: className, children: /* @__PURE__ */ jsx(Component, { ...otherProps, className: clsx(className, props.className) }) });
36
- };
37
- StyledComponent.displayName = Component.displayName || Component.name;
38
- return StyledComponent;
39
- };
40
- const withProvider = (Component, options) => {
13
+ const withContext = (Component, options) => {
41
14
  const { defaultProps } = options ?? {};
42
15
  const StyledComponent = forwardRef((innerProps, ref) => {
43
16
  const props = { ...defaultProps ?? {}, ...useProps(), ...innerProps };
@@ -48,22 +21,14 @@ function createRecipeContext(recipe) {
48
21
  StyledComponent.displayName = Component.displayName || Component.name;
49
22
  return StyledComponent;
50
23
  };
51
- const withContext = (Component) => {
52
- const StyledComponent = forwardRef((props, ref) => {
53
- const className = useClassName();
54
- return /* @__PURE__ */ jsx(Component, { ref, ...props, className: clsx(className, props.className) });
55
- });
56
- StyledComponent.displayName = Component.displayName || Component.name;
57
- return StyledComponent;
58
- };
24
+ function withPropsProvider() {
25
+ return PropsProvider;
26
+ }
59
27
  return {
60
- ClassNameProvider,
61
28
  PropsProvider,
62
- useClassName,
63
29
  useProps,
64
- withRootProvider,
65
- withProvider,
66
- withContext
30
+ withContext,
31
+ withPropsProvider
67
32
  };
68
33
  }
69
34
 
@@ -6,7 +6,7 @@ const jsxRuntime = require('react/jsx-runtime');
6
6
  const React = require('react');
7
7
 
8
8
  function createWithStateProps(useContexts, options) {
9
- const strict = options?.strict ?? true;
9
+ const strict = true;
10
10
  return function withStateProps(Component) {
11
11
  const Node = React.forwardRef((props, ref) => {
12
12
  const stateProps = {};
@@ -2,7 +2,7 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
 
4
4
  function createWithStateProps(useContexts, options) {
5
- const strict = options?.strict ?? true;
5
+ const strict = true;
6
6
  return function withStateProps(Component) {
7
7
  const Node = forwardRef((props, ref) => {
8
8
  const stateProps = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-design/react",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/daangn/seed-design.git",
@@ -55,12 +55,12 @@
55
55
  "clsx": "^2.1.1"
56
56
  },
57
57
  "peerDependencies": {
58
- "@seed-design/css": "0.0.7",
58
+ "@seed-design/css": "0.0.9",
59
59
  "react": ">=18.0.0",
60
60
  "react-dom": ">=18.0.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@seed-design/css": "0.0.7",
63
+ "@seed-design/css": "0.0.9",
64
64
  "globby": "^14.1.0",
65
65
  "vite": "^6.1.1",
66
66
  "vite-plugin-dts": "^4.5.0"
@@ -5,7 +5,6 @@ import {
5
5
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
6
6
  import clsx from "clsx";
7
7
  import * as React from "react";
8
- import { createRecipeContext } from "../../utils/createRecipeContext";
9
8
  import { IconRequired } from "../Icon/Icon";
10
9
  import {
11
10
  PendingButtonProvider,
@@ -13,8 +12,6 @@ import {
13
12
  type UsePendingButtonProps,
14
13
  } from "../LoadingIndicator/usePendingButton";
15
14
 
16
- const { ClassNameProvider } = createRecipeContext(actionButton);
17
-
18
15
  export interface ActionButtonProps
19
16
  extends ActionButtonVariantProps,
20
17
  UsePendingButtonProps,
@@ -36,20 +33,18 @@ export const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProp
36
33
  }
37
34
 
38
35
  return (
39
- <ClassNameProvider value={recipeClassName}>
40
- <PendingButtonProvider value={api}>
41
- <IconRequired enabled={layout === "iconOnly"}>
42
- <Primitive.button
43
- ref={ref}
44
- className={clsx(recipeClassName, className)}
45
- {...api.stateProps}
46
- {...otherProps}
47
- >
48
- {children}
49
- </Primitive.button>
50
- </IconRequired>
51
- </PendingButtonProvider>
52
- </ClassNameProvider>
36
+ <PendingButtonProvider value={api}>
37
+ <IconRequired enabled={layout === "iconOnly"}>
38
+ <Primitive.button
39
+ ref={ref}
40
+ className={clsx(recipeClassName, className)}
41
+ {...api.stateProps}
42
+ {...otherProps}
43
+ >
44
+ {children}
45
+ </Primitive.button>
46
+ </IconRequired>
47
+ </PendingButtonProvider>
53
48
  );
54
49
  },
55
50
  );
@@ -4,7 +4,7 @@ import type * as React from "react";
4
4
  import { createRecipeContext } from "../../utils/createRecipeContext";
5
5
  import { withIconRequired } from "../Icon/Icon";
6
6
 
7
- const { withProvider } = createRecipeContext(actionChip);
7
+ const { withContext } = createRecipeContext(actionChip);
8
8
 
9
9
  export interface ActionChipProps
10
10
  extends ActionChipVariantProps,
@@ -12,7 +12,7 @@ export interface ActionChipProps
12
12
  React.ButtonHTMLAttributes<HTMLButtonElement> {}
13
13
 
14
14
  export const ActionChip = withIconRequired(
15
- withProvider<HTMLButtonElement, ActionChipProps>(Primitive.button),
15
+ withContext<HTMLButtonElement, ActionChipProps>(Primitive.button),
16
16
  (props: ActionChipProps) => props.layout === "iconOnly",
17
17
  );
18
18
  ActionChip.displayName = "ActionChip";
@@ -11,7 +11,7 @@ import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
11
11
  import { createWithStateProps } from "../../utils/createWithStateProps";
12
12
 
13
13
  const { withRootProvider, withContext } = createSlotRecipeContext(actionSheet);
14
- const { withProvider: withItemProvider } = createRecipeContext(actionSheetItem);
14
+ const { withContext: withItemContext } = createRecipeContext(actionSheetItem);
15
15
  const withStateProps = createWithStateProps([useDialogContext]);
16
16
 
17
17
  ////////////////////////////////////////////////////////////////////////////////////
@@ -103,7 +103,7 @@ export interface ActionSheetItemProps
103
103
  ActionSheetItemVariantProps,
104
104
  React.HTMLAttributes<HTMLButtonElement> {}
105
105
 
106
- export const ActionSheetItem = withItemProvider<HTMLButtonElement, ActionSheetItemProps>(
106
+ export const ActionSheetItem = withItemContext<HTMLButtonElement, ActionSheetItemProps>(
107
107
  withStateProps(Primitive.button),
108
108
  );
109
109
 
@@ -3,7 +3,7 @@ import { badge, type BadgeVariantProps } from "@seed-design/css/recipes/badge";
3
3
  import type * as React from "react";
4
4
  import { createRecipeContext } from "../../utils/createRecipeContext";
5
5
 
6
- const { withProvider } = createRecipeContext(badge);
6
+ const { withContext } = createRecipeContext(badge);
7
7
 
8
8
  ////////////////////////////////////////////////////////////////////////////////////
9
9
 
@@ -12,4 +12,4 @@ export interface BadgeProps
12
12
  PrimitiveProps,
13
13
  React.HTMLAttributes<HTMLSpanElement> {}
14
14
 
15
- export const Badge = withProvider<HTMLSpanElement, BadgeProps>(Primitive.span);
15
+ export const Badge = withContext<HTMLSpanElement, BadgeProps>(Primitive.span);
@@ -4,7 +4,7 @@ import type * as React from "react";
4
4
  import { createRecipeContext } from "../../utils/createRecipeContext";
5
5
  import { withIconRequired } from "../Icon/Icon";
6
6
 
7
- const { withProvider } = createRecipeContext(controlChip);
7
+ const { withContext } = createRecipeContext(controlChip);
8
8
 
9
9
  export interface ControlChipBaseProps extends PrimitiveProps, ControlChipVariantProps {}
10
10
 
@@ -13,6 +13,6 @@ export interface ControlChipProps
13
13
  React.HTMLAttributes<HTMLButtonElement> {}
14
14
 
15
15
  export const ControlChip = withIconRequired(
16
- withProvider<HTMLButtonElement, ControlChipProps>(Primitive.button),
16
+ withContext<HTMLButtonElement, ControlChipProps>(Primitive.button),
17
17
  (props: ControlChipProps) => props.layout === "iconOnly",
18
18
  );
@@ -14,7 +14,7 @@ import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
14
14
  import { createWithStateProps } from "../../utils/createWithStateProps";
15
15
 
16
16
  const { withRootProvider, withContext } = createSlotRecipeContext(extendedActionSheet);
17
- const { withProvider: withItemProvider } = createRecipeContext(extendedActionSheetItem);
17
+ const { withContext: withItemContext } = createRecipeContext(extendedActionSheetItem);
18
18
  const withStateProps = createWithStateProps([useDialogContext]);
19
19
 
20
20
  ////////////////////////////////////////////////////////////////////////////////////
@@ -113,7 +113,7 @@ export interface ExtendedActionSheetItemProps
113
113
  ExtendedActionSheetItemVariantProps,
114
114
  React.HTMLAttributes<HTMLButtonElement> {}
115
115
 
116
- export const ExtendedActionSheetItem = withItemProvider<
116
+ export const ExtendedActionSheetItem = withItemContext<
117
117
  HTMLButtonElement,
118
118
  ExtendedActionSheetItemProps
119
119
  >(withStateProps(Primitive.button));
@@ -2,7 +2,7 @@ import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
2
2
  import { extendedFab, type ExtendedFabVariantProps } from "@seed-design/css/recipes/extended-fab";
3
3
  import { createRecipeContext } from "../../utils/createRecipeContext";
4
4
 
5
- const { withProvider } = createRecipeContext(extendedFab);
5
+ const { withContext } = createRecipeContext(extendedFab);
6
6
 
7
7
  ////////////////////////////////////////////////////////////////////////////////////
8
8
 
@@ -11,7 +11,7 @@ export interface ExtendedFabProps
11
11
  PrimitiveProps,
12
12
  React.ButtonHTMLAttributes<HTMLButtonElement> {}
13
13
 
14
- export const ExtendedFab = withProvider<HTMLButtonElement, ExtendedFabProps>(Primitive.button, {
14
+ export const ExtendedFab = withContext<HTMLButtonElement, ExtendedFabProps>(Primitive.button, {
15
15
  defaultProps: {
16
16
  variant: "neutralSolid",
17
17
  size: "medium",
@@ -3,7 +3,7 @@ import { fab, type FabVariantProps } from "@seed-design/css/recipes/fab";
3
3
  import type * as React from "react";
4
4
  import { createRecipeContext } from "../../utils/createRecipeContext";
5
5
 
6
- const { withProvider } = createRecipeContext(fab);
6
+ const { withContext } = createRecipeContext(fab);
7
7
 
8
8
  ////////////////////////////////////////////////////////////////////////////////////
9
9
 
@@ -12,4 +12,4 @@ export interface FabProps
12
12
  PrimitiveProps,
13
13
  React.ButtonHTMLAttributes<HTMLButtonElement> {}
14
14
 
15
- export const Fab = withProvider<HTMLButtonElement, FabProps>(Primitive.button);
15
+ export const Fab = withContext<HTMLButtonElement, FabProps>(Primitive.button);
@@ -4,7 +4,7 @@ import { createRecipeContext } from "../../utils/createRecipeContext";
4
4
  import type * as React from "react";
5
5
  import { withStyleProps, type StyleProps } from "../../utils/styled";
6
6
 
7
- const { withProvider } = createRecipeContext(linkContent);
7
+ const { withContext } = createRecipeContext(linkContent);
8
8
 
9
9
  export interface LinkContentProps
10
10
  extends LinkContentVariantProps,
@@ -12,6 +12,6 @@ export interface LinkContentProps
12
12
  Pick<StyleProps, "color">,
13
13
  Omit<React.HTMLAttributes<HTMLSpanElement>, "color"> {}
14
14
 
15
- export const LinkContent = withProvider<HTMLButtonElement, LinkContentProps>(
15
+ export const LinkContent = withContext<HTMLButtonElement, LinkContentProps>(
16
16
  withStyleProps(Primitive.span),
17
17
  );
@@ -0,0 +1,25 @@
1
+ import { mannerTemp, type MannerTempVariantProps } from "@seed-design/css/recipes/manner-temp";
2
+ import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
3
+ import type * as React from "react";
4
+ import { forwardRef, useMemo } from "react";
5
+ import { createRecipeContext } from "../../utils/createRecipeContext";
6
+ import { MannerTempEmotePropsProvider } from "./MannerTempEmote";
7
+
8
+ const { withContext } = createRecipeContext(mannerTemp);
9
+
10
+ export interface MannerTempProps
11
+ extends MannerTempVariantProps,
12
+ PrimitiveProps,
13
+ React.HTMLAttributes<HTMLSpanElement> {}
14
+
15
+ const MannerTempBase = withContext<HTMLSpanElement, MannerTempProps>(Primitive.span);
16
+
17
+ export const MannerTemp = forwardRef<HTMLSpanElement, MannerTempProps>((props, ref) => {
18
+ const emoteProps = useMemo(() => ({ level: props.level }), [props.level]);
19
+
20
+ return (
21
+ <MannerTempEmotePropsProvider value={emoteProps}>
22
+ <MannerTempBase {...props} ref={ref} />
23
+ </MannerTempEmotePropsProvider>
24
+ );
25
+ });