@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.
Files changed (134) hide show
  1. package/lib/components/ActionButton/ActionButton.cjs +5 -1
  2. package/lib/components/ActionButton/ActionButton.d.ts +2 -1
  3. package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
  4. package/lib/components/ActionButton/ActionButton.js +5 -1
  5. package/lib/components/ActionChip/ActionChip.cjs +1 -0
  6. package/lib/components/ActionChip/ActionChip.js +1 -0
  7. package/lib/components/ActionSheet/ActionSheet.cjs +2 -0
  8. package/lib/components/ActionSheet/ActionSheet.js +2 -0
  9. package/lib/components/Avatar/Avatar.cjs +2 -0
  10. package/lib/components/Avatar/Avatar.js +2 -0
  11. package/lib/components/Badge/Badge.cjs +1 -0
  12. package/lib/components/Badge/Badge.js +1 -0
  13. package/lib/components/BottomSheet/BottomSheet.cjs +1 -0
  14. package/lib/components/BottomSheet/BottomSheet.js +1 -0
  15. package/lib/components/Callout/Callout.cjs +1 -0
  16. package/lib/components/Callout/Callout.js +1 -0
  17. package/lib/components/Checkbox/Checkbox.cjs +1 -0
  18. package/lib/components/Checkbox/Checkbox.js +1 -0
  19. package/lib/components/ChipTabs/ChipTabs.cjs +1 -0
  20. package/lib/components/ChipTabs/ChipTabs.js +1 -0
  21. package/lib/components/Columns/Columns.cjs +1 -1
  22. package/lib/components/Columns/Columns.d.ts +12 -0
  23. package/lib/components/Columns/Columns.d.ts.map +1 -1
  24. package/lib/components/Columns/Columns.js +1 -1
  25. package/lib/components/ControlChip/ControlChip.cjs +1 -0
  26. package/lib/components/ControlChip/ControlChip.js +1 -0
  27. package/lib/components/Dialog/Dialog.cjs +1 -0
  28. package/lib/components/Dialog/Dialog.js +1 -0
  29. package/lib/components/Divider/Divider.cjs +44 -0
  30. package/lib/components/Divider/Divider.d.ts +18 -0
  31. package/lib/components/Divider/Divider.d.ts.map +1 -0
  32. package/lib/components/Divider/Divider.js +21 -0
  33. package/lib/components/Divider/index.cjs +9 -0
  34. package/lib/components/Divider/index.d.ts +2 -0
  35. package/lib/components/Divider/index.d.ts.map +1 -0
  36. package/lib/components/Divider/index.js +1 -0
  37. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +2 -0
  38. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +2 -0
  39. package/lib/components/ExtendedFab/ExtendedFab.cjs +1 -0
  40. package/lib/components/ExtendedFab/ExtendedFab.js +1 -0
  41. package/lib/components/Fab/Fab.cjs +1 -0
  42. package/lib/components/Fab/Fab.js +1 -0
  43. package/lib/components/Flex/Flex.cjs +15 -2
  44. package/lib/components/Flex/Flex.d.ts +26 -2
  45. package/lib/components/Flex/Flex.d.ts.map +1 -1
  46. package/lib/components/Flex/Flex.js +15 -2
  47. package/lib/components/HelpBubble/HelpBubble.cjs +1 -5
  48. package/lib/components/HelpBubble/HelpBubble.d.ts +0 -3
  49. package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
  50. package/lib/components/HelpBubble/HelpBubble.js +2 -5
  51. package/lib/components/HelpBubble/HelpBubble.namespace.cjs +0 -1
  52. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts +1 -1
  53. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts.map +1 -1
  54. package/lib/components/HelpBubble/HelpBubble.namespace.js +1 -1
  55. package/lib/components/HelpBubble/index.cjs +0 -1
  56. package/lib/components/HelpBubble/index.d.ts +1 -1
  57. package/lib/components/HelpBubble/index.d.ts.map +1 -1
  58. package/lib/components/HelpBubble/index.js +1 -1
  59. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.cjs +1 -0
  60. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.js +1 -0
  61. package/lib/components/Inline/Inline.cjs +2 -2
  62. package/lib/components/Inline/Inline.d.ts +6 -0
  63. package/lib/components/Inline/Inline.d.ts.map +1 -1
  64. package/lib/components/Inline/Inline.js +2 -2
  65. package/lib/components/InlineBanner/InlineBanner.cjs +1 -0
  66. package/lib/components/InlineBanner/InlineBanner.js +1 -0
  67. package/lib/components/LinkContent/LinkContent.cjs +1 -0
  68. package/lib/components/LinkContent/LinkContent.js +1 -0
  69. package/lib/components/MannerTemp/MannerTemp.cjs +1 -0
  70. package/lib/components/MannerTemp/MannerTemp.js +1 -0
  71. package/lib/components/MannerTempBadge/MannerTempBadge.cjs +1 -0
  72. package/lib/components/MannerTempBadge/MannerTempBadge.js +1 -0
  73. package/lib/components/NotificationBadge/NotificationBadge.cjs +2 -0
  74. package/lib/components/NotificationBadge/NotificationBadge.js +2 -0
  75. package/lib/components/ProgressCircle/ProgressCircle.cjs +1 -0
  76. package/lib/components/ProgressCircle/ProgressCircle.js +1 -0
  77. package/lib/components/PullToRefresh/PullToRefresh.cjs +1 -0
  78. package/lib/components/PullToRefresh/PullToRefresh.js +1 -0
  79. package/lib/components/ReactionButton/ReactionButton.cjs +1 -0
  80. package/lib/components/ReactionButton/ReactionButton.js +1 -0
  81. package/lib/components/SegmentedControl/SegmentedControl.cjs +1 -0
  82. package/lib/components/SegmentedControl/SegmentedControl.js +1 -0
  83. package/lib/components/SelectBox/CheckSelectBox.cjs +2 -0
  84. package/lib/components/SelectBox/CheckSelectBox.d.ts +1 -1
  85. package/lib/components/SelectBox/CheckSelectBox.js +2 -0
  86. package/lib/components/SelectBox/RadioSelectBox.cjs +2 -0
  87. package/lib/components/SelectBox/RadioSelectBox.js +2 -0
  88. package/lib/components/Skeleton/Skeleton.cjs +1 -0
  89. package/lib/components/Skeleton/Skeleton.js +1 -0
  90. package/lib/components/Snackbar/Snackbar.cjs +2 -0
  91. package/lib/components/Snackbar/Snackbar.js +2 -0
  92. package/lib/components/Stack/Stack.cjs +10 -2
  93. package/lib/components/Stack/Stack.d.ts +14 -2
  94. package/lib/components/Stack/Stack.d.ts.map +1 -1
  95. package/lib/components/Stack/Stack.js +9 -3
  96. package/lib/components/Stack/index.cjs +2 -0
  97. package/lib/components/Stack/index.d.ts +1 -1
  98. package/lib/components/Stack/index.d.ts.map +1 -1
  99. package/lib/components/Stack/index.js +1 -1
  100. package/lib/components/Switch/Switch.cjs +1 -0
  101. package/lib/components/Switch/Switch.js +1 -0
  102. package/lib/components/Tabs/Tabs.cjs +1 -0
  103. package/lib/components/Tabs/Tabs.js +1 -0
  104. package/lib/components/Text/Text.cjs +1 -0
  105. package/lib/components/Text/Text.js +1 -0
  106. package/lib/components/TextField/TextField.cjs +1 -0
  107. package/lib/components/TextField/TextField.js +1 -0
  108. package/lib/components/ToggleButton/ToggleButton.cjs +1 -0
  109. package/lib/components/ToggleButton/ToggleButton.js +1 -0
  110. package/lib/components/index.cjs +4 -1
  111. package/lib/components/index.d.ts +1 -0
  112. package/lib/components/index.d.ts.map +1 -1
  113. package/lib/components/index.js +3 -2
  114. package/lib/index.cjs +4 -1
  115. package/lib/index.js +3 -2
  116. package/lib/utils/styled.cjs +64 -15
  117. package/lib/utils/styled.d.ts +63 -31
  118. package/lib/utils/styled.d.ts.map +1 -1
  119. package/lib/utils/styled.js +64 -15
  120. package/package.json +7 -5
  121. package/src/components/ActionButton/ActionButton.tsx +5 -1
  122. package/src/components/Columns/Columns.tsx +13 -2
  123. package/src/components/Divider/Divider.tsx +35 -0
  124. package/src/components/Divider/index.ts +1 -0
  125. package/src/components/Flex/Flex.tsx +44 -4
  126. package/src/components/HelpBubble/HelpBubble.namespace.ts +0 -2
  127. package/src/components/HelpBubble/HelpBubble.tsx +0 -11
  128. package/src/components/HelpBubble/index.ts +0 -2
  129. package/src/components/Inline/Inline.tsx +8 -2
  130. package/src/components/SelectBox/CheckSelectBox.tsx +1 -1
  131. package/src/components/Stack/Stack.tsx +21 -3
  132. package/src/components/Stack/index.ts +8 -1
  133. package/src/components/index.ts +1 -0
  134. 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
- {...otherProps}
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="flexStart"
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
- // TODO: do we need fractional width support?
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
- direction?: "row" | "column" | "rowReverse" | "columnReverse";
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
- wrap?: "wrap" | "nowrap";
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 <Box ref={ref} display="flex" flexDirection={direction} flexWrap={wrap} {...rest} />;
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="flexStart"
14
- justifyContent="flexStart"
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 <Stack> under it is recommended.
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 { Box, type BoxProps } from "../Box/Box";
2
+ import { Flex, type FlexProps } from "../Flex";
3
3
 
4
- export interface StackProps extends Omit<BoxProps, "display" | "direction"> {}
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 <Box ref={ref} display="flex" flexDirection="column" {...props} />;
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
  });
@@ -1 +1,8 @@
1
- export { Stack, type StackProps } from "./Stack";
1
+ export {
2
+ Stack,
3
+ VStack,
4
+ HStack,
5
+ type StackProps,
6
+ type VStackProps,
7
+ type HStackProps,
8
+ } from "./Stack";
@@ -14,6 +14,7 @@ export * from "./ConsistentWidth";
14
14
  export * from "./ControlChip";
15
15
  export * from "./Count";
16
16
  export * from "./Dialog";
17
+ export * from "./Divider";
17
18
  export * from "./ExtendedActionSheet";
18
19
  export * from "./ExtendedFab";
19
20
  export * from "./Fab";