@seed-design/react 0.0.8 → 0.0.10
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/Icon/Icon.cjs +28 -19
- package/lib/components/Icon/Icon.d.ts +3 -0
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +28 -19
- 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/components/private/useDismissible.d.ts +3 -3
- 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/lib/utils/styled.cjs +2 -0
- package/lib/utils/styled.d.ts +2 -0
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +1 -1
- package/package.json +9 -8
- 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/Icon/Icon.tsx +37 -20
- 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
- package/src/utils/styled.tsx +2 -2
package/lib/utils/styled.cjs
CHANGED
package/lib/utils/styled.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ColorBg, ColorFg, ColorPalette, ColorStroke, Dimension, Radius, SpacingX, SpacingY } from '@seed-design/css/vars';
|
|
2
2
|
import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react';
|
|
3
|
+
export declare function handleColor(color: string | undefined): any;
|
|
4
|
+
export declare function handleDimension(dimension: string | 0 | undefined): any;
|
|
3
5
|
export interface StyleProps {
|
|
4
6
|
background?: `bg.${ColorBg}` | `palette.${ColorPalette}`;
|
|
5
7
|
color?: `fg.${ColorFg}` | `palette.${ColorPalette}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../src/utils/styled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,YAAY,EACZ,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACT,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../src/utils/styled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,YAAY,EACZ,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAI/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,OAOpD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,OAiBhE;AAmED,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,OAAO,EAAE,GAAG,WAAW,YAAY,EAAE,CAAC;IAEzD,KAAK,CAAC,EAAE,MAAM,OAAO,EAAE,GAAG,WAAW,YAAY,EAAE,CAAC;IAEpD,WAAW,CAAC,EAAE,UAAU,WAAW,EAAE,GAAG,WAAW,YAAY,EAAE,CAAC;IAElE,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAEpC,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAEvC,gBAAgB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC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|
+
"version": "0.0.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -40,27 +40,28 @@
|
|
|
40
40
|
"@seed-design/dom-utils": "0.0.1",
|
|
41
41
|
"@seed-design/react-avatar": "0.0.1",
|
|
42
42
|
"@seed-design/react-checkbox": "0.0.1",
|
|
43
|
-
"@seed-design/react-dialog": "0.0.
|
|
44
|
-
"@seed-design/react-popover": "0.0.
|
|
43
|
+
"@seed-design/react-dialog": "0.0.2",
|
|
44
|
+
"@seed-design/react-popover": "0.0.2",
|
|
45
45
|
"@seed-design/react-primitive": "0.0.1",
|
|
46
46
|
"@seed-design/react-progress": "0.0.1",
|
|
47
47
|
"@seed-design/react-pull-to-refresh": "0.0.1",
|
|
48
48
|
"@seed-design/react-radio-group": "0.0.1",
|
|
49
|
-
"@seed-design/react-segmented-control": "0.0.
|
|
50
|
-
"@seed-design/react-snackbar": "0.0.
|
|
49
|
+
"@seed-design/react-segmented-control": "0.0.2",
|
|
50
|
+
"@seed-design/react-snackbar": "0.0.2",
|
|
51
51
|
"@seed-design/react-switch": "0.0.1",
|
|
52
|
-
"@seed-design/react-tabs": "0.0.
|
|
52
|
+
"@seed-design/react-tabs": "0.0.2",
|
|
53
53
|
"@seed-design/react-text-field": "0.0.1",
|
|
54
54
|
"@seed-design/react-toggle": "0.0.1",
|
|
55
55
|
"clsx": "^2.1.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@seed-design/css": "0.0.
|
|
58
|
+
"@seed-design/css": "0.0.10",
|
|
59
59
|
"react": ">=18.0.0",
|
|
60
60
|
"react-dom": ">=18.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@seed-design/css": "0.0.
|
|
63
|
+
"@seed-design/css": "0.0.10",
|
|
64
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
64
65
|
"globby": "^14.1.0",
|
|
65
66
|
"vite": "^6.1.1",
|
|
66
67
|
"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
|
-
<
|
|
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);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Slot } from "@radix-ui/react-slot";
|
|
2
2
|
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
|
|
3
|
+
import type { ColorFg, ColorPalette, Dimension } from "@seed-design/css/vars";
|
|
3
4
|
import { createContext, forwardRef, useCallback, useContext, useMemo, useRef } from "react";
|
|
5
|
+
import { handleColor, handleDimension } from "../../utils/styled";
|
|
4
6
|
|
|
5
7
|
export interface PrefixIconProps {
|
|
6
8
|
svg: React.ReactNode;
|
|
@@ -103,29 +105,44 @@ export const IconRequired = ({
|
|
|
103
105
|
|
|
104
106
|
export interface IconProps {
|
|
105
107
|
svg: React.ReactNode;
|
|
108
|
+
|
|
109
|
+
size?: Dimension | string;
|
|
110
|
+
|
|
111
|
+
color?: `fg.${ColorFg}` | `palette.${ColorPalette}`;
|
|
106
112
|
}
|
|
107
113
|
|
|
108
|
-
export const Icon = forwardRef<SVGSVGElement, IconProps>(
|
|
109
|
-
|
|
114
|
+
export const Icon = forwardRef<SVGSVGElement, IconProps>(
|
|
115
|
+
({ svg, size, color, ...otherProps }, ref) => {
|
|
116
|
+
const context = useContext(IconContext);
|
|
110
117
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
useLayoutEffect(() => {
|
|
119
|
+
context?.register();
|
|
120
|
+
return () => {
|
|
121
|
+
context?.unregister();
|
|
122
|
+
};
|
|
123
|
+
}, [context]);
|
|
124
|
+
|
|
125
|
+
const sizeValue = handleDimension(size);
|
|
126
|
+
const colorValue = handleColor(color);
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<Slot
|
|
130
|
+
ref={ref as React.ForwardedRef<HTMLElement>}
|
|
131
|
+
aria-hidden
|
|
132
|
+
className="seed-icon"
|
|
133
|
+
style={
|
|
134
|
+
{
|
|
135
|
+
"--seed-icon-size": sizeValue,
|
|
136
|
+
"--seed-icon-color": colorValue,
|
|
137
|
+
} as React.CSSProperties
|
|
138
|
+
}
|
|
139
|
+
{...otherProps}
|
|
140
|
+
>
|
|
141
|
+
{svg}
|
|
142
|
+
</Slot>
|
|
143
|
+
);
|
|
144
|
+
},
|
|
145
|
+
);
|
|
129
146
|
|
|
130
147
|
export function withIconRequired<P extends {}, R>(
|
|
131
148
|
Component: React.ComponentType<P & React.RefAttributes<R>>,
|
|
@@ -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
|
+
});
|