@seed-design/react 0.0.4 → 0.0.5
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/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 +9 -9
- package/lib/components/Snackbar/Snackbar.d.ts +1 -1
- package/lib/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/lib/components/Snackbar/Snackbar.js +9 -9
- 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 +3 -6
- package/lib/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/lib/components/VisuallyHidden/VisuallyHidden.js +3 -6
- package/lib/components/private/useDismissible.d.ts +3 -3
- 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.tsx +8 -8
- 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 +3 -6
- 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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
1
|
import { actionChip, type ActionChipVariantProps } from "@seed-design/css/recipes/action-chip";
|
|
2
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
3
|
import type * as React from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
5
5
|
import { withIconRequired } from "../Icon/Icon";
|
|
6
6
|
|
|
7
|
-
const { withProvider } =
|
|
7
|
+
const { withProvider } = 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
|
+
withProvider<HTMLButtonElement, ActionChipProps>(Primitive.button),
|
|
16
16
|
(props: ActionChipProps) => props.layout === "iconOnly",
|
|
17
17
|
);
|
|
18
18
|
ActionChip.displayName = "ActionChip";
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { Dialog as DialogPrimitive, useDialogContext } from "@seed-design/react-dialog";
|
|
2
|
-
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
1
|
import { actionSheet, type ActionSheetVariantProps } from "@seed-design/css/recipes/action-sheet";
|
|
4
2
|
import {
|
|
5
3
|
actionSheetItem,
|
|
6
4
|
type ActionSheetItemVariantProps,
|
|
7
5
|
} from "@seed-design/css/recipes/action-sheet-item";
|
|
6
|
+
import { Dialog as DialogPrimitive, useDialogContext } from "@seed-design/react-dialog";
|
|
7
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
8
8
|
import type * as React from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
10
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
10
11
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
11
12
|
|
|
12
|
-
const { withRootProvider, withContext } =
|
|
13
|
-
const { withProvider: withItemProvider } =
|
|
13
|
+
const { withRootProvider, withContext } = createSlotRecipeContext(actionSheet);
|
|
14
|
+
const { withProvider: withItemProvider } = createRecipeContext(actionSheetItem);
|
|
14
15
|
const withStateProps = createWithStateProps([useDialogContext]);
|
|
15
16
|
|
|
16
17
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -104,7 +105,6 @@ export interface ActionSheetItemProps
|
|
|
104
105
|
|
|
105
106
|
export const ActionSheetItem = withItemProvider<HTMLButtonElement, ActionSheetItemProps>(
|
|
106
107
|
withStateProps(Primitive.button),
|
|
107
|
-
"root",
|
|
108
108
|
);
|
|
109
109
|
|
|
110
110
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -5,9 +5,9 @@ import { avatarStack, type AvatarStackVariantProps } from "@seed-design/css/reci
|
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { useMemo } from "react";
|
|
8
|
-
import {
|
|
8
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
9
9
|
|
|
10
|
-
const { PropsProvider, withProvider, withContext } =
|
|
10
|
+
const { PropsProvider, withProvider, withContext } = createSlotRecipeContext(avatar);
|
|
11
11
|
|
|
12
12
|
////////////////////////////////////////////////////////////////////////////////////
|
|
13
13
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
2
|
import { badge, type BadgeVariantProps } from "@seed-design/css/recipes/badge";
|
|
3
3
|
import type * as React from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
5
5
|
|
|
6
|
-
const { withProvider } =
|
|
6
|
+
const { withProvider } = 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 = withProvider<HTMLSpanElement, BadgeProps>(Primitive.span);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Dialog as DialogPrimitive, useDialogContext } from "@seed-design/react-dialog";
|
|
2
2
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
3
|
import { bottomSheet, type BottomSheetVariantProps } from "@seed-design/css/recipes/bottom-sheet";
|
|
4
|
-
import {
|
|
4
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
5
5
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
6
6
|
import { withStyleProps, type StyleProps } from "../../utils/styled";
|
|
7
7
|
|
|
8
|
-
const { withRootProvider, withContext } =
|
|
8
|
+
const { withRootProvider, withContext } = createSlotRecipeContext(bottomSheet);
|
|
9
9
|
const withStateProps = createWithStateProps([useDialogContext]);
|
|
10
10
|
|
|
11
11
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -2,14 +2,14 @@ import type * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
4
4
|
import { callout, type CalloutVariantProps } from "@seed-design/css/recipes/callout";
|
|
5
|
-
import {
|
|
5
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
6
6
|
import {
|
|
7
7
|
DismissibleCloseButton,
|
|
8
8
|
DismissibleRoot,
|
|
9
9
|
type DismissibleRootProps,
|
|
10
10
|
} from "../private/useDismissible";
|
|
11
11
|
|
|
12
|
-
const { withContext, withProvider } =
|
|
12
|
+
const { withContext, withProvider } = createSlotRecipeContext(callout);
|
|
13
13
|
|
|
14
14
|
export interface CalloutRootProps extends CalloutVariantProps, DismissibleRootProps {}
|
|
15
15
|
|
|
@@ -3,11 +3,11 @@ import { Checkbox as CheckboxPrimitive, useCheckboxContext } from "@seed-design/
|
|
|
3
3
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
4
4
|
import { checkbox, type CheckboxVariantProps } from "@seed-design/css/recipes/checkbox";
|
|
5
5
|
import { forwardRef } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
7
7
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
8
8
|
import { InternalIcon } from "../private/Icon";
|
|
9
9
|
|
|
10
|
-
const { withProvider, withContext, useClassNames } =
|
|
10
|
+
const { withProvider, withContext, useClassNames } = createSlotRecipeContext(checkbox);
|
|
11
11
|
const withStateProps = createWithStateProps([useCheckboxContext]);
|
|
12
12
|
|
|
13
13
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { chipTabs, type ChipTabsVariantProps } from "@seed-design/css/recipes/chip-tabs";
|
|
2
2
|
import { Tabs as TabsPrimitive } from "@seed-design/react-tabs";
|
|
3
|
-
import {
|
|
3
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
4
4
|
|
|
5
|
-
const { withProvider, withContext } =
|
|
5
|
+
const { withProvider, withContext } = createSlotRecipeContext(chipTabs);
|
|
6
6
|
|
|
7
7
|
////////////////////////////////////////////////////////////////////////////////////
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { controlChip, type ControlChipVariantProps } from "@seed-design/css/recipes/control-chip";
|
|
2
2
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
3
|
import type * as React from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
5
5
|
import { withIconRequired } from "../Icon/Icon";
|
|
6
6
|
|
|
7
|
-
const { withProvider } =
|
|
7
|
+
const { withProvider } = 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
|
+
withProvider<HTMLButtonElement, ControlChipProps>(Primitive.button),
|
|
17
17
|
(props: ControlChipProps) => props.layout === "iconOnly",
|
|
18
18
|
);
|
|
@@ -2,10 +2,10 @@ import { Dialog as DialogPrimitive, useDialogContext } from "@seed-design/react-
|
|
|
2
2
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
3
|
import { dialog, type DialogVariantProps } from "@seed-design/css/recipes/dialog";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
6
6
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
7
7
|
|
|
8
|
-
const { withRootProvider, withContext } =
|
|
8
|
+
const { withRootProvider, withContext } = createSlotRecipeContext(dialog);
|
|
9
9
|
const withStateProps = createWithStateProps([useDialogContext]);
|
|
10
10
|
|
|
11
11
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -9,11 +9,12 @@ import {
|
|
|
9
9
|
type ExtendedActionSheetItemVariantProps,
|
|
10
10
|
} from "@seed-design/css/recipes/extended-action-sheet-item";
|
|
11
11
|
import type * as React from "react";
|
|
12
|
-
import {
|
|
12
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
13
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
13
14
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
14
15
|
|
|
15
|
-
const { withRootProvider, withContext } =
|
|
16
|
-
const { withProvider: withItemProvider } =
|
|
16
|
+
const { withRootProvider, withContext } = createSlotRecipeContext(extendedActionSheet);
|
|
17
|
+
const { withProvider: withItemProvider } = createRecipeContext(extendedActionSheetItem);
|
|
17
18
|
const withStateProps = createWithStateProps([useDialogContext]);
|
|
18
19
|
|
|
19
20
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -115,7 +116,7 @@ export interface ExtendedActionSheetItemProps
|
|
|
115
116
|
export const ExtendedActionSheetItem = withItemProvider<
|
|
116
117
|
HTMLButtonElement,
|
|
117
118
|
ExtendedActionSheetItemProps
|
|
118
|
-
>(withStateProps(Primitive.button)
|
|
119
|
+
>(withStateProps(Primitive.button));
|
|
119
120
|
|
|
120
121
|
////////////////////////////////////////////////////////////////////////////////////
|
|
121
122
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
2
|
import { extendedFab, type ExtendedFabVariantProps } from "@seed-design/css/recipes/extended-fab";
|
|
3
|
-
import {
|
|
3
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
4
4
|
|
|
5
|
-
const { withProvider } =
|
|
5
|
+
const { withProvider } = createRecipeContext(extendedFab);
|
|
6
6
|
|
|
7
7
|
////////////////////////////////////////////////////////////////////////////////////
|
|
8
8
|
|
|
@@ -11,13 +11,9 @@ export interface ExtendedFabProps
|
|
|
11
11
|
PrimitiveProps,
|
|
12
12
|
React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
13
13
|
|
|
14
|
-
export const ExtendedFab = withProvider<HTMLButtonElement, ExtendedFabProps>(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
defaultProps: {
|
|
19
|
-
variant: "neutralSolid",
|
|
20
|
-
size: "medium",
|
|
21
|
-
},
|
|
14
|
+
export const ExtendedFab = withProvider<HTMLButtonElement, ExtendedFabProps>(Primitive.button, {
|
|
15
|
+
defaultProps: {
|
|
16
|
+
variant: "neutralSolid",
|
|
17
|
+
size: "medium",
|
|
22
18
|
},
|
|
23
|
-
);
|
|
19
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
2
|
import { fab, type FabVariantProps } from "@seed-design/css/recipes/fab";
|
|
3
3
|
import type * as React from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
5
5
|
|
|
6
|
-
const { withProvider } =
|
|
6
|
+
const { withProvider } = 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 = withProvider<HTMLButtonElement, FabProps>(Primitive.button);
|
|
@@ -2,11 +2,11 @@ import { Popover as PopoverPrimitive, usePopoverContext } from "@seed-design/rea
|
|
|
2
2
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
3
|
import { helpBubble, type HelpBubbleVariantProps } from "@seed-design/css/recipes/help-bubble";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
6
6
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
7
7
|
import { withStyleProps, type StyleProps } from "../../utils/styled";
|
|
8
8
|
|
|
9
|
-
const { withRootProvider, withContext } =
|
|
9
|
+
const { withRootProvider, withContext } = createSlotRecipeContext(helpBubble);
|
|
10
10
|
const withStateProps = createWithStateProps([usePopoverContext]);
|
|
11
11
|
|
|
12
12
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -16,7 +16,7 @@ export interface HelpBubbleRootProps extends HelpBubbleVariantProps, PopoverPrim
|
|
|
16
16
|
export const HelpBubbleRoot = withRootProvider<HelpBubbleRootProps>(PopoverPrimitive.Root, {
|
|
17
17
|
defaultProps: {
|
|
18
18
|
placement: "top",
|
|
19
|
-
gutter: 4,
|
|
19
|
+
gutter: 4, // TODO: get value from rootage spec
|
|
20
20
|
overflowPadding: 16,
|
|
21
21
|
arrowPadding: 14,
|
|
22
22
|
flip: true,
|
|
@@ -90,7 +90,10 @@ export interface HelpBubbleArrowTipProps extends React.SVGProps<SVGSVGElement> {
|
|
|
90
90
|
|
|
91
91
|
export const HelpBubbleArrowTip = forwardRef<SVGSVGElement, HelpBubbleArrowTipProps>(
|
|
92
92
|
(props, ref) => {
|
|
93
|
-
const {
|
|
93
|
+
const {
|
|
94
|
+
tipRadius = 2, // TODO: get value from rootage spec
|
|
95
|
+
...otherProps
|
|
96
|
+
} = props;
|
|
94
97
|
const api = usePopoverContext();
|
|
95
98
|
const width = api.rects.arrow?.width || 0;
|
|
96
99
|
const height = api.rects.arrow?.height || 0;
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
import { mergeProps } from "@seed-design/dom-utils";
|
|
6
6
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
7
7
|
import * as React from "react";
|
|
8
|
-
import {
|
|
8
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
9
9
|
|
|
10
|
-
const { useClassNames, withProvider } =
|
|
10
|
+
const { useClassNames, withProvider } = createSlotRecipeContext(identityPlaceholder);
|
|
11
11
|
|
|
12
12
|
export interface IdentityPlaceholderRootProps
|
|
13
13
|
extends IdentityPlaceholderVariantProps,
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
type InlineBannerVariantProps,
|
|
6
6
|
} from "@seed-design/css/recipes/inline-banner";
|
|
7
7
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
8
|
-
import {
|
|
8
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
9
9
|
import {
|
|
10
10
|
DismissibleCloseButton,
|
|
11
11
|
DismissibleRoot,
|
|
12
12
|
type DismissibleRootProps,
|
|
13
13
|
} from "../private/useDismissible";
|
|
14
14
|
|
|
15
|
-
const { withContext, withProvider } =
|
|
15
|
+
const { withContext, withProvider } = createSlotRecipeContext(inlineBanner);
|
|
16
16
|
|
|
17
17
|
export interface InlineBannerRootProps extends InlineBannerVariantProps, DismissibleRootProps {}
|
|
18
18
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { linkContent, type LinkContentVariantProps } from "@seed-design/css/recipes/link-content";
|
|
2
2
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
5
4
|
import type * as React from "react";
|
|
6
5
|
import { withStyleProps, type StyleProps } from "../../utils/styled";
|
|
7
6
|
|
|
8
|
-
const { withProvider } =
|
|
7
|
+
const { withProvider } = createRecipeContext(linkContent);
|
|
9
8
|
|
|
10
9
|
export interface LinkContentProps
|
|
11
10
|
extends LinkContentVariantProps,
|
|
@@ -15,5 +14,4 @@ export interface LinkContentProps
|
|
|
15
14
|
|
|
16
15
|
export const LinkContent = withProvider<HTMLButtonElement, LinkContentProps>(
|
|
17
16
|
withStyleProps(Primitive.span),
|
|
18
|
-
"root",
|
|
19
17
|
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
1
|
import {
|
|
3
2
|
mannerTempBadge,
|
|
4
3
|
type MannerTempBadgeVariantProps,
|
|
5
4
|
} from "@seed-design/css/recipes/manner-temp-badge";
|
|
5
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
6
6
|
import type * as React from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
8
8
|
|
|
9
|
-
const { withProvider } =
|
|
9
|
+
const { withProvider } = createRecipeContext(mannerTempBadge);
|
|
10
10
|
|
|
11
11
|
////////////////////////////////////////////////////////////////////////////////////
|
|
12
12
|
|
|
@@ -15,7 +15,4 @@ export interface MannerTempBadgeProps
|
|
|
15
15
|
PrimitiveProps,
|
|
16
16
|
React.HTMLAttributes<HTMLSpanElement> {}
|
|
17
17
|
|
|
18
|
-
export const MannerTempBadge = withProvider<HTMLSpanElement, MannerTempBadgeProps>(
|
|
19
|
-
Primitive.span,
|
|
20
|
-
"root",
|
|
21
|
-
);
|
|
18
|
+
export const MannerTempBadge = withProvider<HTMLSpanElement, MannerTempBadgeProps>(Primitive.span);
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
progressCircle,
|
|
4
4
|
type ProgressCircleVariantProps,
|
|
5
5
|
} from "@seed-design/css/recipes/progress-circle";
|
|
6
|
-
import {
|
|
6
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
7
7
|
|
|
8
|
-
const { withContext, withProvider } =
|
|
8
|
+
const { withContext, withProvider } = createSlotRecipeContext(progressCircle);
|
|
9
9
|
|
|
10
10
|
export interface ProgressCircleRootProps
|
|
11
11
|
extends ProgressCirclePrimitive.RootProps,
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
pullToRefresh,
|
|
4
4
|
type PullToRefreshVariantProps,
|
|
5
5
|
} from "@seed-design/css/recipes/pull-to-refresh";
|
|
6
|
-
import {
|
|
6
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
7
7
|
|
|
8
|
-
const { withContext, withProvider } =
|
|
8
|
+
const { withContext, withProvider } = createSlotRecipeContext(pullToRefresh);
|
|
9
9
|
|
|
10
10
|
export interface PullToRefreshRootProps
|
|
11
11
|
extends PullToRefreshVariantProps,
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
import { Toggle as TogglePrimitive } from "@seed-design/react-toggle";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import * as React from "react";
|
|
8
|
-
import {
|
|
8
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
9
9
|
import {
|
|
10
10
|
PendingButtonProvider,
|
|
11
11
|
usePendingButton,
|
|
12
12
|
type UsePendingButtonProps,
|
|
13
13
|
} from "../LoadingIndicator/usePendingButton";
|
|
14
14
|
|
|
15
|
-
const {
|
|
15
|
+
const { ClassNameProvider } = createRecipeContext(reactionButton);
|
|
16
16
|
|
|
17
17
|
export interface ReactionButtonProps
|
|
18
18
|
extends ReactionButtonVariantProps,
|
|
@@ -21,20 +21,20 @@ export interface ReactionButtonProps
|
|
|
21
21
|
|
|
22
22
|
export const ReactionButton = React.forwardRef<HTMLButtonElement, ReactionButtonProps>(
|
|
23
23
|
({ size = "small", loading = false, className, ...otherProps }, ref) => {
|
|
24
|
-
const
|
|
24
|
+
const recipeClassName = reactionButton({ size });
|
|
25
25
|
const api = usePendingButton({ loading, disabled: otherProps.disabled });
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
|
-
<
|
|
28
|
+
<ClassNameProvider value={recipeClassName}>
|
|
29
29
|
<PendingButtonProvider value={api}>
|
|
30
30
|
<TogglePrimitive.Root
|
|
31
31
|
ref={ref}
|
|
32
|
-
className={clsx(
|
|
32
|
+
className={clsx(recipeClassName, className)}
|
|
33
33
|
{...api.stateProps}
|
|
34
34
|
{...otherProps}
|
|
35
35
|
/>
|
|
36
36
|
</PendingButtonProvider>
|
|
37
|
-
</
|
|
37
|
+
</ClassNameProvider>
|
|
38
38
|
);
|
|
39
39
|
},
|
|
40
40
|
);
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
} from "@seed-design/css/recipes/segmented-control";
|
|
5
5
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
6
6
|
import { SegmentedControl as SegmentedControlPrimitive } from "@seed-design/react-segmented-control";
|
|
7
|
-
import {
|
|
7
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
8
8
|
|
|
9
|
-
const { withProvider, withContext } =
|
|
9
|
+
const { withProvider, withContext } = createSlotRecipeContext(segmentedControl);
|
|
10
10
|
|
|
11
11
|
export interface SegmentedControlRootProps
|
|
12
12
|
extends SegmentedControlVariantProps,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Checkbox as CheckboxPrimitive, useCheckboxContext } from "@seed-design/react-checkbox";
|
|
2
|
-
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
1
|
import { selectBox } from "@seed-design/css/recipes/select-box";
|
|
4
2
|
import { selectBoxGroup } from "@seed-design/css/recipes/select-box-group";
|
|
5
|
-
import {
|
|
3
|
+
import { Checkbox as CheckboxPrimitive, useCheckboxContext } from "@seed-design/react-checkbox";
|
|
4
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
7
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
6
8
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
7
9
|
import { InternalIcon, type InternalIconProps } from "../private/Icon";
|
|
8
|
-
import { forwardRef } from "react";
|
|
9
10
|
|
|
10
|
-
const { withProvider: withGroupProvider } =
|
|
11
|
-
const { withProvider, withContext } =
|
|
11
|
+
const { withProvider: withGroupProvider } = createRecipeContext(selectBoxGroup);
|
|
12
|
+
const { withProvider, withContext } = createSlotRecipeContext(selectBox);
|
|
12
13
|
const withStateProps = createWithStateProps([useCheckboxContext]);
|
|
13
14
|
|
|
14
15
|
export interface CheckSelectBoxGroupProps
|
|
@@ -23,7 +24,6 @@ export const CheckSelectBoxGroup = withGroupProvider<HTMLDivElement, CheckSelect
|
|
|
23
24
|
forwardRef<HTMLDivElement, CheckSelectBoxGroupProps>((props, ref) => (
|
|
24
25
|
<Primitive.div ref={ref} role="group" {...props} />
|
|
25
26
|
)),
|
|
26
|
-
"root",
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
export interface CheckSelectBoxRootProps extends CheckboxPrimitive.RootProps {}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
+
import { selectBox } from "@seed-design/css/recipes/select-box";
|
|
2
|
+
import { selectBoxGroup } from "@seed-design/css/recipes/select-box-group";
|
|
1
3
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
4
|
import {
|
|
3
5
|
RadioGroup as RadioGroupPrimitive,
|
|
4
6
|
useRadioGroupItemContext,
|
|
5
7
|
} from "@seed-design/react-radio-group";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { createStyleContext } from "../../utils/createStyleContext";
|
|
8
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
9
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
9
10
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
10
11
|
import { InternalIcon, type InternalIconProps } from "../private/Icon";
|
|
11
12
|
|
|
12
|
-
const { withProvider: withGroupProvider } =
|
|
13
|
-
const { withProvider, withContext } =
|
|
13
|
+
const { withProvider: withGroupProvider } = createRecipeContext(selectBoxGroup);
|
|
14
|
+
const { withProvider, withContext } = createSlotRecipeContext(selectBox);
|
|
14
15
|
const withStateProps = createWithStateProps([useRadioGroupItemContext]);
|
|
15
16
|
|
|
16
17
|
export interface RadioSelectBoxRootProps extends RadioGroupPrimitive.RootProps {}
|
|
17
18
|
|
|
18
19
|
export const RadioSelectBoxRoot = withGroupProvider<HTMLDivElement, RadioSelectBoxRootProps>(
|
|
19
20
|
RadioGroupPrimitive.Root,
|
|
20
|
-
"root",
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
export interface RadioSelectBoxItemProps extends RadioGroupPrimitive.ItemProps {}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
2
|
import { skeleton, type SkeletonVariantProps } from "@seed-design/css/recipes/skeleton";
|
|
3
3
|
import type * as React from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
5
5
|
import { withStyleProps, type StyleProps } from "../../utils/styled";
|
|
6
6
|
|
|
7
|
-
const { withProvider } =
|
|
7
|
+
const { withProvider } = createRecipeContext(skeleton);
|
|
8
8
|
|
|
9
9
|
export interface SkeletonProps
|
|
10
10
|
extends SkeletonVariantProps,
|
|
@@ -12,7 +12,4 @@ export interface SkeletonProps
|
|
|
12
12
|
Pick<StyleProps, "height" | "width">,
|
|
13
13
|
Omit<React.HTMLAttributes<HTMLDivElement>, "color"> {}
|
|
14
14
|
|
|
15
|
-
export const Skeleton = withProvider<HTMLDivElement, SkeletonProps>(
|
|
16
|
-
withStyleProps(Primitive.div),
|
|
17
|
-
"root",
|
|
18
|
-
);
|
|
15
|
+
export const Skeleton = withProvider<HTMLDivElement, SkeletonProps>(withStyleProps(Primitive.div));
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
|
-
import { Snackbar as SnackbarPrimitive } from "@seed-design/react-snackbar";
|
|
3
1
|
import { snackbar, type SnackbarVariantProps } from "@seed-design/css/recipes/snackbar";
|
|
4
2
|
import { snackbarRegion } from "@seed-design/css/recipes/snackbar-region";
|
|
5
3
|
import { visuallyHidden } from "@seed-design/css/recipes/visually-hidden";
|
|
4
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
5
|
+
import { Snackbar as SnackbarPrimitive } from "@seed-design/react-snackbar";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import { forwardRef, useMemo } from "react";
|
|
8
|
-
import {
|
|
8
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
9
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
9
10
|
import { InternalIcon, type InternalIconProps } from "../private/Icon";
|
|
10
11
|
|
|
11
|
-
const { withProvider: withRegionProvider } =
|
|
12
|
-
const { withProvider, withContext } =
|
|
12
|
+
const { withProvider: withRegionProvider } = createRecipeContext(snackbarRegion);
|
|
13
|
+
const { withProvider, withContext } = createSlotRecipeContext(snackbar);
|
|
13
14
|
|
|
14
15
|
////////////////////////////////////////////////////////////////////////////////////
|
|
15
16
|
|
|
@@ -23,7 +24,6 @@ export interface SnackbarRegionProps extends SnackbarVariantProps, SnackbarPrimi
|
|
|
23
24
|
|
|
24
25
|
export const SnackbarRegion = withRegionProvider<HTMLDivElement, SnackbarRegionProps>(
|
|
25
26
|
SnackbarPrimitive.Region,
|
|
26
|
-
"root",
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -76,11 +76,11 @@ export interface SnackbarCloseButtonProps extends SnackbarPrimitive.CloseButtonP
|
|
|
76
76
|
export const SnackbarCloseButton = forwardRef<HTMLButtonElement, SnackbarCloseButtonProps>(
|
|
77
77
|
(props, ref) => {
|
|
78
78
|
const { className, ...otherProps } = props;
|
|
79
|
-
const
|
|
79
|
+
const visuallyHiddenClassName = useMemo(() => visuallyHidden(), []);
|
|
80
80
|
return (
|
|
81
81
|
<SnackbarPrimitive.CloseButton
|
|
82
82
|
ref={ref}
|
|
83
|
-
className={clsx(
|
|
83
|
+
className={clsx(visuallyHiddenClassName, className)}
|
|
84
84
|
{...otherProps}
|
|
85
85
|
/>
|
|
86
86
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Switch as SwitchPrimitive, useSwitchContext } from "@seed-design/react-switch";
|
|
2
2
|
import { switchStyle, type SwitchVariantProps } from "@seed-design/css/recipes/switch";
|
|
3
|
-
import {
|
|
3
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
4
4
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
5
5
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
6
6
|
|
|
7
|
-
const { withProvider, withContext } =
|
|
7
|
+
const { withProvider, withContext } = createSlotRecipeContext(switchStyle);
|
|
8
8
|
const withStateProps = createWithStateProps([useSwitchContext]);
|
|
9
9
|
|
|
10
10
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
useTabsTriggerContext,
|
|
6
6
|
} from "@seed-design/react-tabs";
|
|
7
7
|
import { tabs, type TabsVariantProps } from "@seed-design/css/recipes/tabs";
|
|
8
|
-
import {
|
|
8
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
9
9
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
10
10
|
import type React from "react";
|
|
11
11
|
|
|
12
|
-
const { withProvider, withContext } =
|
|
12
|
+
const { withProvider, withContext } = createSlotRecipeContext(tabs);
|
|
13
13
|
const withStateProps = createWithStateProps([useTabsContext, useTabsTriggerContext], {
|
|
14
14
|
strict: false,
|
|
15
15
|
});
|