@seed-design/react 0.0.13 → 0.0.15
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 +5 -1
- package/lib/components/ActionButton/ActionButton.d.ts +2 -1
- package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
- package/lib/components/ActionButton/ActionButton.js +5 -1
- package/lib/components/ActionChip/ActionChip.cjs +1 -0
- package/lib/components/ActionChip/ActionChip.js +1 -0
- package/lib/components/ActionSheet/ActionSheet.cjs +2 -0
- package/lib/components/ActionSheet/ActionSheet.js +2 -0
- package/lib/components/Avatar/Avatar.cjs +2 -0
- package/lib/components/Avatar/Avatar.js +2 -0
- package/lib/components/Badge/Badge.cjs +1 -0
- package/lib/components/Badge/Badge.js +1 -0
- package/lib/components/BottomSheet/BottomSheet.cjs +1 -0
- package/lib/components/BottomSheet/BottomSheet.js +1 -0
- package/lib/components/Callout/Callout.cjs +1 -0
- package/lib/components/Callout/Callout.js +1 -0
- package/lib/components/Checkbox/Checkbox.cjs +1 -0
- package/lib/components/Checkbox/Checkbox.js +1 -0
- package/lib/components/ChipTabs/ChipTabs.cjs +1 -0
- package/lib/components/ChipTabs/ChipTabs.js +1 -0
- package/lib/components/Columns/Columns.cjs +1 -1
- package/lib/components/Columns/Columns.d.ts +12 -0
- package/lib/components/Columns/Columns.d.ts.map +1 -1
- package/lib/components/Columns/Columns.js +1 -1
- package/lib/components/ControlChip/ControlChip.cjs +1 -0
- package/lib/components/ControlChip/ControlChip.js +1 -0
- package/lib/components/Dialog/Dialog.cjs +1 -0
- package/lib/components/Dialog/Dialog.js +1 -0
- package/lib/components/Divider/Divider.cjs +44 -0
- package/lib/components/Divider/Divider.d.ts +18 -0
- package/lib/components/Divider/Divider.d.ts.map +1 -0
- package/lib/components/Divider/Divider.js +21 -0
- package/lib/components/Divider/index.cjs +9 -0
- package/lib/components/Divider/index.d.ts +2 -0
- package/lib/components/Divider/index.d.ts.map +1 -0
- package/lib/components/Divider/index.js +1 -0
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +2 -0
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +2 -0
- package/lib/components/ExtendedFab/ExtendedFab.cjs +1 -0
- package/lib/components/ExtendedFab/ExtendedFab.js +1 -0
- package/lib/components/Fab/Fab.cjs +1 -0
- package/lib/components/Fab/Fab.js +1 -0
- package/lib/components/Flex/Flex.cjs +15 -2
- package/lib/components/Flex/Flex.d.ts +26 -2
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js +15 -2
- package/lib/components/HelpBubble/HelpBubble.cjs +1 -5
- package/lib/components/HelpBubble/HelpBubble.d.ts +0 -3
- package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
- package/lib/components/HelpBubble/HelpBubble.js +2 -5
- package/lib/components/HelpBubble/HelpBubble.namespace.cjs +0 -1
- package/lib/components/HelpBubble/HelpBubble.namespace.d.ts +1 -1
- package/lib/components/HelpBubble/HelpBubble.namespace.d.ts.map +1 -1
- package/lib/components/HelpBubble/HelpBubble.namespace.js +1 -1
- package/lib/components/HelpBubble/index.cjs +0 -1
- package/lib/components/HelpBubble/index.d.ts +1 -1
- package/lib/components/HelpBubble/index.d.ts.map +1 -1
- package/lib/components/HelpBubble/index.js +1 -1
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.cjs +1 -0
- package/lib/components/IdentityPlaceholder/IdentityPlaceholder.js +1 -0
- package/lib/components/Inline/Inline.cjs +2 -2
- package/lib/components/Inline/Inline.d.ts +6 -0
- package/lib/components/Inline/Inline.d.ts.map +1 -1
- package/lib/components/Inline/Inline.js +2 -2
- package/lib/components/InlineBanner/InlineBanner.cjs +1 -0
- package/lib/components/InlineBanner/InlineBanner.js +1 -0
- package/lib/components/LinkContent/LinkContent.cjs +1 -0
- package/lib/components/LinkContent/LinkContent.js +1 -0
- package/lib/components/MannerTemp/MannerTemp.cjs +1 -0
- package/lib/components/MannerTemp/MannerTemp.js +1 -0
- package/lib/components/MannerTempBadge/MannerTempBadge.cjs +1 -0
- package/lib/components/MannerTempBadge/MannerTempBadge.js +1 -0
- package/lib/components/NotificationBadge/NotificationBadge.cjs +2 -0
- package/lib/components/NotificationBadge/NotificationBadge.js +2 -0
- package/lib/components/ProgressCircle/ProgressCircle.cjs +1 -0
- package/lib/components/ProgressCircle/ProgressCircle.js +1 -0
- package/lib/components/PullToRefresh/PullToRefresh.cjs +1 -0
- package/lib/components/PullToRefresh/PullToRefresh.js +1 -0
- package/lib/components/ReactionButton/ReactionButton.cjs +1 -0
- package/lib/components/ReactionButton/ReactionButton.js +1 -0
- package/lib/components/SegmentedControl/SegmentedControl.cjs +1 -0
- package/lib/components/SegmentedControl/SegmentedControl.js +1 -0
- package/lib/components/SelectBox/CheckSelectBox.cjs +2 -0
- package/lib/components/SelectBox/CheckSelectBox.d.ts +1 -1
- package/lib/components/SelectBox/CheckSelectBox.js +2 -0
- package/lib/components/SelectBox/RadioSelectBox.cjs +2 -0
- package/lib/components/SelectBox/RadioSelectBox.js +2 -0
- package/lib/components/Skeleton/Skeleton.cjs +1 -0
- package/lib/components/Skeleton/Skeleton.js +1 -0
- package/lib/components/Snackbar/Snackbar.cjs +2 -0
- package/lib/components/Snackbar/Snackbar.js +2 -0
- package/lib/components/Stack/Stack.cjs +10 -2
- package/lib/components/Stack/Stack.d.ts +14 -2
- package/lib/components/Stack/Stack.d.ts.map +1 -1
- package/lib/components/Stack/Stack.js +9 -3
- package/lib/components/Stack/index.cjs +2 -0
- package/lib/components/Stack/index.d.ts +1 -1
- package/lib/components/Stack/index.d.ts.map +1 -1
- package/lib/components/Stack/index.js +1 -1
- package/lib/components/Switch/Switch.cjs +1 -0
- package/lib/components/Switch/Switch.js +1 -0
- package/lib/components/Tabs/Tabs.cjs +1 -0
- package/lib/components/Tabs/Tabs.js +1 -0
- package/lib/components/Text/Text.cjs +1 -0
- package/lib/components/Text/Text.js +1 -0
- package/lib/components/TextField/TextField.cjs +1 -0
- package/lib/components/TextField/TextField.js +1 -0
- package/lib/components/ToggleButton/ToggleButton.cjs +1 -0
- package/lib/components/ToggleButton/ToggleButton.js +1 -0
- package/lib/components/index.cjs +4 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +3 -2
- package/lib/index.cjs +4 -1
- package/lib/index.js +3 -2
- package/lib/utils/styled.cjs +64 -15
- package/lib/utils/styled.d.ts +63 -31
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +64 -15
- package/package.json +7 -5
- package/src/components/ActionButton/ActionButton.tsx +5 -1
- package/src/components/Columns/Columns.tsx +13 -2
- package/src/components/Divider/Divider.tsx +35 -0
- package/src/components/Divider/index.ts +1 -0
- package/src/components/Flex/Flex.tsx +44 -4
- package/src/components/HelpBubble/HelpBubble.namespace.ts +0 -2
- package/src/components/HelpBubble/HelpBubble.tsx +0 -11
- package/src/components/HelpBubble/index.ts +0 -2
- package/src/components/Inline/Inline.tsx +8 -2
- package/src/components/SelectBox/CheckSelectBox.tsx +1 -1
- package/src/components/Stack/Stack.tsx +21 -3
- package/src/components/Stack/index.ts +8 -1
- package/src/components/index.ts +1 -0
- package/src/utils/styled.tsx +208 -74
|
@@ -11,11 +11,13 @@ import {
|
|
|
11
11
|
usePendingButton,
|
|
12
12
|
type UsePendingButtonProps,
|
|
13
13
|
} from "../LoadingIndicator/usePendingButton";
|
|
14
|
+
import { useStyleProps, type StyleProps } from "../../utils/styled";
|
|
14
15
|
|
|
15
16
|
export interface ActionButtonProps
|
|
16
17
|
extends ActionButtonVariantProps,
|
|
17
18
|
UsePendingButtonProps,
|
|
18
19
|
PrimitiveProps,
|
|
20
|
+
Pick<StyleProps, "flexGrow">,
|
|
19
21
|
React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
20
22
|
|
|
21
23
|
export const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProps>(
|
|
@@ -25,6 +27,7 @@ export const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProp
|
|
|
25
27
|
) => {
|
|
26
28
|
const recipeClassName = actionButton({ variant, layout, size });
|
|
27
29
|
const api = usePendingButton({ loading, disabled: otherProps.disabled });
|
|
30
|
+
const { style, restProps } = useStyleProps(otherProps);
|
|
28
31
|
|
|
29
32
|
if (layout === "iconOnly" && !(otherProps["aria-label"] || otherProps["aria-labelledby"])) {
|
|
30
33
|
console.warn(
|
|
@@ -38,8 +41,9 @@ export const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProp
|
|
|
38
41
|
<Primitive.button
|
|
39
42
|
ref={ref}
|
|
40
43
|
className={clsx(recipeClassName, className)}
|
|
44
|
+
style={style}
|
|
41
45
|
{...api.stateProps}
|
|
42
|
-
{...
|
|
46
|
+
{...restProps}
|
|
43
47
|
>
|
|
44
48
|
{children}
|
|
45
49
|
</Primitive.button>
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Box, type BoxProps } from "../Box/Box";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `HStack` instead.
|
|
6
|
+
*/
|
|
4
7
|
export interface ColumnsProps extends Omit<BoxProps, "display" | "direction"> {}
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `HStack` instead.
|
|
11
|
+
*/
|
|
6
12
|
export const Columns = React.forwardRef<HTMLDivElement, ColumnsProps>((props, ref) => {
|
|
7
13
|
return (
|
|
8
14
|
<Box
|
|
@@ -10,17 +16,22 @@ export const Columns = React.forwardRef<HTMLDivElement, ColumnsProps>((props, re
|
|
|
10
16
|
display="flex"
|
|
11
17
|
flexDirection="row"
|
|
12
18
|
flexWrap="nowrap"
|
|
13
|
-
justifyContent="
|
|
19
|
+
justifyContent="flex-start"
|
|
14
20
|
{...props}
|
|
15
21
|
/>
|
|
16
22
|
);
|
|
17
23
|
});
|
|
18
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use `HStack` instead.
|
|
27
|
+
*/
|
|
19
28
|
export interface ColumnProps extends Omit<BoxProps, "display" | "flexDirection" | "width"> {
|
|
20
29
|
width?: BoxProps["width"] | "content";
|
|
21
30
|
}
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `HStack` instead.
|
|
34
|
+
*/
|
|
24
35
|
export const Column = React.forwardRef<HTMLDivElement, ColumnProps>((props, ref) => {
|
|
25
36
|
const { width, ...otherProps } = props;
|
|
26
37
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Box, type BoxProps } from "../Box/Box";
|
|
3
|
+
|
|
4
|
+
export interface DividerProps {
|
|
5
|
+
/**
|
|
6
|
+
* @default "hr"
|
|
7
|
+
*/
|
|
8
|
+
as?: "hr" | "div";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @default "stroke.neutral"
|
|
12
|
+
*/
|
|
13
|
+
color?: BoxProps["borderColor"];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @default 1
|
|
17
|
+
*/
|
|
18
|
+
thickness?: BoxProps["borderBottomWidth"];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Divider = React.forwardRef<HTMLHRElement, DividerProps>((props, ref) => {
|
|
22
|
+
const { as = "hr", color = "stroke.neutral", thickness = 1, ...rest } = props;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Box
|
|
26
|
+
ref={ref}
|
|
27
|
+
as={as}
|
|
28
|
+
display="block"
|
|
29
|
+
borderColor={color}
|
|
30
|
+
borderWidth={0}
|
|
31
|
+
borderBottomWidth={thickness}
|
|
32
|
+
{...rest}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Divider, type DividerProps } from "./Divider";
|
|
@@ -7,13 +7,53 @@ export interface FlexProps extends Omit<BoxProps, "display"> {
|
|
|
7
7
|
*/
|
|
8
8
|
display?: "flex" | "none";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Shorthand for `flexDirection`.
|
|
12
|
+
*/
|
|
13
|
+
direction?: BoxProps["flexDirection"];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Shorthand for `flexWrap`.
|
|
17
|
+
* If true, flex-wrap will be set to `wrap`.
|
|
18
|
+
*/
|
|
19
|
+
wrap?: BoxProps["flexWrap"] | true;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Shorthand for `alignItems`.
|
|
23
|
+
*/
|
|
24
|
+
align?: BoxProps["alignItems"];
|
|
11
25
|
|
|
12
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Shorthand for `justifyContent`.
|
|
28
|
+
*/
|
|
29
|
+
justify?: BoxProps["justifyContent"];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Shorthand for `flexGrow`.
|
|
33
|
+
* If true, flex-grow will be set to `1`.
|
|
34
|
+
*/
|
|
35
|
+
grow?: BoxProps["flexGrow"] | true;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Shorthand for `flexShrink`.
|
|
39
|
+
*/
|
|
40
|
+
shrink?: BoxProps["flexShrink"];
|
|
13
41
|
}
|
|
14
42
|
|
|
15
43
|
export const Flex = React.forwardRef<HTMLDivElement, FlexProps>((props, ref) => {
|
|
16
|
-
const { direction, wrap, ...rest } = props;
|
|
44
|
+
const { direction, wrap, align, justify, grow, shrink, ...rest } = props;
|
|
17
45
|
|
|
18
|
-
return
|
|
46
|
+
return (
|
|
47
|
+
<Box
|
|
48
|
+
ref={ref}
|
|
49
|
+
display="flex"
|
|
50
|
+
flexDirection={direction}
|
|
51
|
+
flexWrap={wrap === true ? "wrap" : wrap}
|
|
52
|
+
alignItems={align}
|
|
53
|
+
justifyContent={justify}
|
|
54
|
+
flexGrow={grow === true ? 1 : grow}
|
|
55
|
+
flexShrink={shrink}
|
|
56
|
+
{...rest}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
19
59
|
});
|
|
@@ -2,7 +2,6 @@ export {
|
|
|
2
2
|
HelpBubbleAnchor as Anchor,
|
|
3
3
|
HelpBubbleArrow as Arrow,
|
|
4
4
|
HelpBubbleArrowTip as ArrowTip,
|
|
5
|
-
HelpBubbleBackdrop as Backdrop,
|
|
6
5
|
HelpBubbleCloseButton as CloseButton,
|
|
7
6
|
HelpBubbleContent as Content,
|
|
8
7
|
HelpBubbleDescription as Description,
|
|
@@ -12,7 +11,6 @@ export {
|
|
|
12
11
|
HelpBubbleTrigger as Trigger,
|
|
13
12
|
type HelpBubbleArrowProps as ArrowProps,
|
|
14
13
|
type HelpBubbleArrowTipProps as ArrowTipProps,
|
|
15
|
-
type HelpBubbleBackdropProps as BackdropProps,
|
|
16
14
|
type HelpBubbleCloseButtonProps as CloseButtonProps,
|
|
17
15
|
type HelpBubbleContentProps as ContentProps,
|
|
18
16
|
type HelpBubbleDescriptionProps as DescriptionProps,
|
|
@@ -48,17 +48,6 @@ export const HelpBubblePositioner = withContext<HTMLDivElement, HelpBubblePositi
|
|
|
48
48
|
|
|
49
49
|
////////////////////////////////////////////////////////////////////////////////////
|
|
50
50
|
|
|
51
|
-
export interface HelpBubbleBackdropProps
|
|
52
|
-
extends PrimitiveProps,
|
|
53
|
-
React.HTMLAttributes<HTMLDivElement> {}
|
|
54
|
-
|
|
55
|
-
export const HelpBubbleBackdrop = withContext<HTMLDivElement, HelpBubbleBackdropProps>(
|
|
56
|
-
withStateProps(Primitive.div),
|
|
57
|
-
"backdrop",
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
////////////////////////////////////////////////////////////////////////////////////
|
|
61
|
-
|
|
62
51
|
export interface HelpBubbleContentProps
|
|
63
52
|
extends PrimitiveProps,
|
|
64
53
|
Pick<StyleProps, "maxWidth">,
|
|
@@ -2,7 +2,6 @@ export {
|
|
|
2
2
|
HelpBubbleAnchor,
|
|
3
3
|
HelpBubbleArrow,
|
|
4
4
|
HelpBubbleArrowTip,
|
|
5
|
-
HelpBubbleBackdrop,
|
|
6
5
|
HelpBubbleCloseButton,
|
|
7
6
|
HelpBubbleContent,
|
|
8
7
|
HelpBubbleDescription,
|
|
@@ -13,7 +12,6 @@ export {
|
|
|
13
12
|
type HelpBubbleAnchorProps,
|
|
14
13
|
type HelpBubbleArrowProps,
|
|
15
14
|
type HelpBubbleArrowTipProps,
|
|
16
|
-
type HelpBubbleBackdropProps,
|
|
17
15
|
type HelpBubbleCloseButtonProps,
|
|
18
16
|
type HelpBubbleContentProps,
|
|
19
17
|
type HelpBubbleDescriptionProps,
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Box, type BoxProps } from "../Box/Box";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `HStack` instead.
|
|
6
|
+
*/
|
|
4
7
|
export interface InlineProps extends Omit<BoxProps, "display" | "direction" | "flexWrap"> {}
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `HStack` instead.
|
|
11
|
+
*/
|
|
6
12
|
export const Inline = React.forwardRef<HTMLDivElement, InlineProps>((props, ref) => {
|
|
7
13
|
return (
|
|
8
14
|
<Box
|
|
@@ -10,8 +16,8 @@ export const Inline = React.forwardRef<HTMLDivElement, InlineProps>((props, ref)
|
|
|
10
16
|
display="flex"
|
|
11
17
|
flexDirection="row"
|
|
12
18
|
flexWrap="wrap"
|
|
13
|
-
alignItems="
|
|
14
|
-
justifyContent="
|
|
19
|
+
alignItems="flex-start"
|
|
20
|
+
justifyContent="flex-start"
|
|
15
21
|
{...props}
|
|
16
22
|
/>
|
|
17
23
|
);
|
|
@@ -18,7 +18,7 @@ export interface CheckSelectBoxGroupProps
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* CheckSelectBoxGroup is a simple div wrapper for future extensibility.
|
|
21
|
-
* It does not have spacing by default, nesting <
|
|
21
|
+
* It does not have spacing by default, nesting <VStack> under it is recommended.
|
|
22
22
|
*/
|
|
23
23
|
export const CheckSelectBoxGroup = withGroupContext<HTMLDivElement, CheckSelectBoxGroupProps>(
|
|
24
24
|
forwardRef<HTMLDivElement, CheckSelectBoxGroupProps>((props, ref) => (
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Flex, type FlexProps } from "../Flex";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `VStack` instead.
|
|
6
|
+
*/
|
|
7
|
+
export interface StackProps extends Omit<FlexProps, "flexDirection"> {}
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `VStack` instead.
|
|
11
|
+
*/
|
|
6
12
|
export const Stack = React.forwardRef<HTMLDivElement, StackProps>((props, ref) => {
|
|
7
|
-
return <
|
|
13
|
+
return <Flex ref={ref} display="flex" flexDirection="column" {...props} />;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export interface VStackProps extends Omit<FlexProps, "flexDirection"> {}
|
|
17
|
+
|
|
18
|
+
export const VStack = React.forwardRef<HTMLDivElement, VStackProps>((props, ref) => {
|
|
19
|
+
return <Flex ref={ref} display="flex" flexDirection="column" {...props} />;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export interface HStackProps extends Omit<FlexProps, "flexDirection"> {}
|
|
23
|
+
|
|
24
|
+
export const HStack = React.forwardRef<HTMLDivElement, HStackProps>((props, ref) => {
|
|
25
|
+
return <Flex ref={ref} display="flex" flexDirection="row" {...props} />;
|
|
8
26
|
});
|
package/src/components/index.ts
CHANGED