@seed-design/react 0.0.8 → 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.
- package/lib/components/ActionButton/ActionButton.cjs +2 -4
- package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
- package/lib/components/ActionButton/ActionButton.js +2 -4
- package/lib/components/ActionChip/ActionChip.cjs +2 -2
- package/lib/components/ActionChip/ActionChip.js +2 -2
- package/lib/components/ActionSheet/ActionSheet.cjs +2 -2
- package/lib/components/ActionSheet/ActionSheet.js +2 -2
- package/lib/components/Badge/Badge.cjs +2 -2
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Badge/Badge.js +2 -2
- package/lib/components/ControlChip/ControlChip.cjs +2 -2
- package/lib/components/ControlChip/ControlChip.js +2 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +2 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +2 -2
- package/lib/components/ExtendedFab/ExtendedFab.cjs +2 -2
- package/lib/components/ExtendedFab/ExtendedFab.js +2 -2
- package/lib/components/Fab/Fab.cjs +2 -2
- package/lib/components/Fab/Fab.d.ts.map +1 -1
- package/lib/components/Fab/Fab.js +2 -2
- package/lib/components/LinkContent/LinkContent.cjs +2 -2
- package/lib/components/LinkContent/LinkContent.js +2 -2
- package/lib/components/MannerTemp/MannerTemp.cjs +19 -0
- package/lib/components/MannerTemp/MannerTemp.d.ts +7 -0
- package/lib/components/MannerTemp/MannerTemp.d.ts.map +1 -0
- package/lib/components/MannerTemp/MannerTemp.js +15 -0
- package/lib/components/MannerTemp/MannerTempEmote.cjs +632 -0
- package/lib/components/MannerTemp/MannerTempEmote.d.ts +7 -0
- package/lib/components/MannerTemp/MannerTempEmote.d.ts.map +1 -0
- package/lib/components/MannerTemp/MannerTempEmote.js +627 -0
- package/lib/components/MannerTemp/index.cjs +11 -0
- package/lib/components/MannerTemp/index.d.ts +3 -0
- package/lib/components/MannerTemp/index.d.ts.map +1 -0
- package/lib/components/MannerTemp/index.js +2 -0
- package/lib/components/MannerTempBadge/MannerTempBadge.cjs +2 -2
- package/lib/components/MannerTempBadge/MannerTempBadge.d.ts.map +1 -1
- package/lib/components/MannerTempBadge/MannerTempBadge.js +2 -2
- package/lib/components/NotificationBadge/NotificationBadge.cjs +2 -2
- package/lib/components/NotificationBadge/NotificationBadge.js +2 -2
- package/lib/components/ReactionButton/ReactionButton.cjs +2 -4
- package/lib/components/ReactionButton/ReactionButton.d.ts.map +1 -1
- package/lib/components/ReactionButton/ReactionButton.js +2 -4
- package/lib/components/SelectBox/CheckSelectBox.cjs +3 -3
- package/lib/components/SelectBox/CheckSelectBox.js +3 -3
- package/lib/components/SelectBox/RadioSelectBox.cjs +3 -3
- package/lib/components/SelectBox/RadioSelectBox.js +3 -3
- package/lib/components/Skeleton/Skeleton.cjs +2 -2
- package/lib/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/components/Skeleton/Skeleton.js +2 -2
- package/lib/components/Snackbar/Snackbar.cjs +2 -2
- package/lib/components/Snackbar/Snackbar.js +2 -2
- package/lib/components/ToggleButton/ToggleButton.cjs +3 -5
- package/lib/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/lib/components/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +3 -5
- package/lib/components/index.cjs +4 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +2 -0
- package/lib/index.cjs +4 -0
- package/lib/index.js +2 -0
- package/lib/utils/createRecipeContext.cjs +6 -41
- package/lib/utils/createRecipeContext.d.ts +4 -12
- package/lib/utils/createRecipeContext.d.ts.map +1 -1
- package/lib/utils/createRecipeContext.js +6 -41
- package/package.json +3 -3
- package/src/components/ActionButton/ActionButton.tsx +12 -17
- package/src/components/ActionChip/ActionChip.tsx +2 -2
- package/src/components/ActionSheet/ActionSheet.tsx +2 -2
- package/src/components/Badge/Badge.tsx +2 -2
- package/src/components/ControlChip/ControlChip.tsx +2 -2
- package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +2 -2
- package/src/components/ExtendedFab/ExtendedFab.tsx +2 -2
- package/src/components/Fab/Fab.tsx +2 -2
- package/src/components/LinkContent/LinkContent.tsx +2 -2
- package/src/components/MannerTemp/MannerTemp.tsx +25 -0
- package/src/components/MannerTemp/MannerTempEmote.tsx +464 -0
- package/src/components/MannerTemp/index.ts +2 -0
- package/src/components/MannerTempBadge/MannerTempBadge.tsx +2 -2
- package/src/components/NotificationBadge/NotificationBadge.tsx +2 -2
- package/src/components/ReactionButton/ReactionButton.tsx +8 -13
- package/src/components/SelectBox/CheckSelectBox.tsx +3 -3
- package/src/components/SelectBox/RadioSelectBox.tsx +3 -3
- package/src/components/Skeleton/Skeleton.tsx +2 -2
- package/src/components/Snackbar/Snackbar.tsx +2 -2
- package/src/components/ToggleButton/ToggleButton.tsx +9 -14
- package/src/components/index.ts +1 -0
- package/src/utils/createRecipeContext.tsx +12 -72
|
@@ -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
|
-
<
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 {
|
|
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
|
-
|
|
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 {
|
|
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 =
|
|
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 {
|
|
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 =
|
|
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 {
|
|
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
|
-
|
|
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 {
|
|
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 =
|
|
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 {
|
|
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 =
|
|
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 {
|
|
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 =
|
|
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 {
|
|
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 =
|
|
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
|
+
});
|