@seed-design/react 0.0.14 → 0.0.17
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 +4 -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 +4 -1
- 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/Divider/Divider.cjs +4 -3
- package/lib/components/Divider/Divider.d.ts +3 -3
- package/lib/components/Divider/Divider.d.ts.map +1 -1
- package/lib/components/Divider/Divider.js +4 -3
- 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/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/SelectBox/CheckSelectBox.d.ts +1 -1
- 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/index.cjs +2 -0
- package/lib/components/index.js +1 -1
- package/lib/index.cjs +2 -0
- package/lib/index.js +1 -1
- 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 +6 -5
- package/src/components/ActionButton/ActionButton.tsx +5 -1
- package/src/components/Columns/Columns.tsx +13 -2
- package/src/components/Divider/Divider.tsx +7 -6
- package/src/components/Flex/Flex.tsx +44 -4
- 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/utils/styled.tsx +208 -74
|
@@ -9,6 +9,7 @@ const clsx = require('clsx');
|
|
|
9
9
|
const React = require('react');
|
|
10
10
|
const Icon = require('../Icon/Icon.cjs');
|
|
11
11
|
const usePendingButton = require('../LoadingIndicator/usePendingButton.cjs');
|
|
12
|
+
const styled = require('../../utils/styled.cjs');
|
|
12
13
|
|
|
13
14
|
function _interopNamespaceDefault(e) {
|
|
14
15
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -33,6 +34,7 @@ const ActionButton = React__namespace.forwardRef(
|
|
|
33
34
|
({ variant, size, loading = false, layout = "withText", className, children, ...otherProps }, ref) => {
|
|
34
35
|
const recipeClassName = actionButton.actionButton({ variant, layout, size });
|
|
35
36
|
const api = usePendingButton.usePendingButton({ loading, disabled: otherProps.disabled });
|
|
37
|
+
const { style, restProps } = styled.useStyleProps(otherProps);
|
|
36
38
|
if (layout === "iconOnly" && !(otherProps["aria-label"] || otherProps["aria-labelledby"])) {
|
|
37
39
|
console.warn(
|
|
38
40
|
"When layout is 'iconOnly', 'aria-label' or 'aria-labelledby' should be provided."
|
|
@@ -43,8 +45,9 @@ const ActionButton = React__namespace.forwardRef(
|
|
|
43
45
|
{
|
|
44
46
|
ref,
|
|
45
47
|
className: clsx(recipeClassName, className),
|
|
48
|
+
style,
|
|
46
49
|
...api.stateProps,
|
|
47
|
-
...
|
|
50
|
+
...restProps,
|
|
48
51
|
children
|
|
49
52
|
}
|
|
50
53
|
) }) });
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ActionButtonVariantProps } from '@seed-design/css/recipes/action-button';
|
|
2
2
|
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
3
3
|
import { UsePendingButtonProps } from '../LoadingIndicator/usePendingButton';
|
|
4
|
+
import { StyleProps } from '../../utils/styled';
|
|
4
5
|
import * as React from "react";
|
|
5
|
-
export interface ActionButtonProps extends ActionButtonVariantProps, UsePendingButtonProps, PrimitiveProps, React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
export interface ActionButtonProps extends ActionButtonVariantProps, UsePendingButtonProps, PrimitiveProps, Pick<StyleProps, "flexGrow">, React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
7
|
}
|
|
7
8
|
export declare const ActionButton: React.ForwardRefExoticComponent<ActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
9
|
//# sourceMappingURL=ActionButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,WAAW,iBACf,SAAQ,wBAAwB,EAC9B,qBAAqB,EACrB,cAAc,EACd,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EAC5B,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;CAAG;AAEpD,eAAO,MAAM,YAAY,6FA+BxB,CAAC"}
|
|
@@ -5,11 +5,13 @@ import clsx from 'clsx';
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { IconRequired } from '../Icon/Icon.js';
|
|
7
7
|
import { usePendingButton, PendingButtonProvider } from '../LoadingIndicator/usePendingButton.js';
|
|
8
|
+
import { useStyleProps } from '../../utils/styled.js';
|
|
8
9
|
|
|
9
10
|
const ActionButton = React.forwardRef(
|
|
10
11
|
({ variant, size, loading = false, layout = "withText", className, children, ...otherProps }, ref) => {
|
|
11
12
|
const recipeClassName = actionButton({ variant, layout, size });
|
|
12
13
|
const api = usePendingButton({ loading, disabled: otherProps.disabled });
|
|
14
|
+
const { style, restProps } = useStyleProps(otherProps);
|
|
13
15
|
if (layout === "iconOnly" && !(otherProps["aria-label"] || otherProps["aria-labelledby"])) {
|
|
14
16
|
console.warn(
|
|
15
17
|
"When layout is 'iconOnly', 'aria-label' or 'aria-labelledby' should be provided."
|
|
@@ -20,8 +22,9 @@ const ActionButton = React.forwardRef(
|
|
|
20
22
|
{
|
|
21
23
|
ref,
|
|
22
24
|
className: clsx(recipeClassName, className),
|
|
25
|
+
style,
|
|
23
26
|
...api.stateProps,
|
|
24
|
-
...
|
|
27
|
+
...restProps,
|
|
25
28
|
children
|
|
26
29
|
}
|
|
27
30
|
) }) });
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { BoxProps } from '../Box/Box';
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `HStack` instead.
|
|
5
|
+
*/
|
|
3
6
|
export interface ColumnsProps extends Omit<BoxProps, "display" | "direction"> {
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `HStack` instead.
|
|
10
|
+
*/
|
|
5
11
|
export declare const Columns: React.ForwardRefExoticComponent<ColumnsProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `HStack` instead.
|
|
14
|
+
*/
|
|
6
15
|
export interface ColumnProps extends Omit<BoxProps, "display" | "flexDirection" | "width"> {
|
|
7
16
|
width?: BoxProps["width"] | "content";
|
|
8
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `HStack` instead.
|
|
20
|
+
*/
|
|
9
21
|
export declare const Column: React.ForwardRefExoticComponent<ColumnProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
22
|
//# sourceMappingURL=Columns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Columns.d.ts","sourceRoot":"","sources":["../../../src/components/Columns/Columns.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,WAAW,CAAC;CAAG;AAEhF,eAAO,MAAM,OAAO,qFAWlB,CAAC;AAEH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,eAAe,GAAG,OAAO,CAAC;IACxF,KAAK,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;CACvC;
|
|
1
|
+
{"version":3,"file":"Columns.d.ts","sourceRoot":"","sources":["../../../src/components/Columns/Columns.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,WAAW,CAAC;CAAG;AAEhF;;GAEG;AACH,eAAO,MAAM,OAAO,qFAWlB,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,eAAe,GAAG,OAAO,CAAC;IACxF,KAAK,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;CACvC;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,oFAcjB,CAAC"}
|
|
@@ -26,15 +26,16 @@ function _interopNamespaceDefault(e) {
|
|
|
26
26
|
const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
27
27
|
|
|
28
28
|
const Divider = React__namespace.forwardRef((props, ref) => {
|
|
29
|
-
const { as = "hr",
|
|
29
|
+
const { as = "hr", color = "stroke.neutral", thickness = 1, ...rest } = props;
|
|
30
30
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
31
|
Box.Box,
|
|
32
32
|
{
|
|
33
33
|
ref,
|
|
34
34
|
as,
|
|
35
35
|
display: "block",
|
|
36
|
-
borderColor,
|
|
37
|
-
borderWidth,
|
|
36
|
+
borderColor: color,
|
|
37
|
+
borderWidth: 0,
|
|
38
|
+
borderBottomWidth: thickness,
|
|
38
39
|
...rest
|
|
39
40
|
}
|
|
40
41
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BoxProps } from '../Box/Box';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
export interface DividerProps
|
|
3
|
+
export interface DividerProps {
|
|
4
4
|
/**
|
|
5
5
|
* @default "hr"
|
|
6
6
|
*/
|
|
@@ -8,11 +8,11 @@ export interface DividerProps extends Omit<BoxProps, "display"> {
|
|
|
8
8
|
/**
|
|
9
9
|
* @default "stroke.neutral"
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
color?: BoxProps["borderColor"];
|
|
12
12
|
/**
|
|
13
13
|
* @default 1
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
thickness?: BoxProps["borderBottomWidth"];
|
|
16
16
|
}
|
|
17
17
|
export declare const Divider: React.ForwardRefExoticComponent<DividerProps & React.RefAttributes<HTMLHRElement>>;
|
|
18
18
|
//# sourceMappingURL=Divider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;CAC3C;AAED,eAAO,MAAM,OAAO,oFAclB,CAAC"}
|
|
@@ -3,15 +3,16 @@ import * as React from 'react';
|
|
|
3
3
|
import { Box } from '../Box/Box.js';
|
|
4
4
|
|
|
5
5
|
const Divider = React.forwardRef((props, ref) => {
|
|
6
|
-
const { as = "hr",
|
|
6
|
+
const { as = "hr", color = "stroke.neutral", thickness = 1, ...rest } = props;
|
|
7
7
|
return /* @__PURE__ */ jsx(
|
|
8
8
|
Box,
|
|
9
9
|
{
|
|
10
10
|
ref,
|
|
11
11
|
as,
|
|
12
12
|
display: "block",
|
|
13
|
-
borderColor,
|
|
14
|
-
borderWidth,
|
|
13
|
+
borderColor: color,
|
|
14
|
+
borderWidth: 0,
|
|
15
|
+
borderBottomWidth: thickness,
|
|
15
16
|
...rest
|
|
16
17
|
}
|
|
17
18
|
);
|
|
@@ -26,8 +26,21 @@ function _interopNamespaceDefault(e) {
|
|
|
26
26
|
const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
27
27
|
|
|
28
28
|
const Flex = React__namespace.forwardRef((props, ref) => {
|
|
29
|
-
const { direction, wrap, ...rest } = props;
|
|
30
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
|
+
const { direction, wrap, align, justify, grow, shrink, ...rest } = props;
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
+
Box.Box,
|
|
32
|
+
{
|
|
33
|
+
ref,
|
|
34
|
+
display: "flex",
|
|
35
|
+
flexDirection: direction,
|
|
36
|
+
flexWrap: wrap === true ? "wrap" : wrap,
|
|
37
|
+
alignItems: align,
|
|
38
|
+
justifyContent: justify,
|
|
39
|
+
flexGrow: grow === true ? 1 : grow,
|
|
40
|
+
flexShrink: shrink,
|
|
41
|
+
...rest
|
|
42
|
+
}
|
|
43
|
+
);
|
|
31
44
|
});
|
|
32
45
|
|
|
33
46
|
exports.Flex = Flex;
|
|
@@ -5,8 +5,32 @@ export interface FlexProps extends Omit<BoxProps, "display"> {
|
|
|
5
5
|
* @default "flex"
|
|
6
6
|
*/
|
|
7
7
|
display?: "flex" | "none";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Shorthand for `flexDirection`.
|
|
10
|
+
*/
|
|
11
|
+
direction?: BoxProps["flexDirection"];
|
|
12
|
+
/**
|
|
13
|
+
* Shorthand for `flexWrap`.
|
|
14
|
+
* If true, flex-wrap will be set to `wrap`.
|
|
15
|
+
*/
|
|
16
|
+
wrap?: BoxProps["flexWrap"] | true;
|
|
17
|
+
/**
|
|
18
|
+
* Shorthand for `alignItems`.
|
|
19
|
+
*/
|
|
20
|
+
align?: BoxProps["alignItems"];
|
|
21
|
+
/**
|
|
22
|
+
* Shorthand for `justifyContent`.
|
|
23
|
+
*/
|
|
24
|
+
justify?: BoxProps["justifyContent"];
|
|
25
|
+
/**
|
|
26
|
+
* Shorthand for `flexGrow`.
|
|
27
|
+
* If true, flex-grow will be set to `1`.
|
|
28
|
+
*/
|
|
29
|
+
grow?: BoxProps["flexGrow"] | true;
|
|
30
|
+
/**
|
|
31
|
+
* Shorthand for `flexShrink`.
|
|
32
|
+
*/
|
|
33
|
+
shrink?: BoxProps["flexShrink"];
|
|
10
34
|
}
|
|
11
35
|
export declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
36
|
//# sourceMappingURL=Flex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC1D;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B,SAAS,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC1D;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAEtC;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;IAE/B;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAErC;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,IAAI,kFAgBf,CAAC"}
|
|
@@ -3,8 +3,21 @@ import * as React from 'react';
|
|
|
3
3
|
import { Box } from '../Box/Box.js';
|
|
4
4
|
|
|
5
5
|
const Flex = React.forwardRef((props, ref) => {
|
|
6
|
-
const { direction, wrap, ...rest } = props;
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
+
const { direction, wrap, align, justify, grow, shrink, ...rest } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
Box,
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
display: "flex",
|
|
12
|
+
flexDirection: direction,
|
|
13
|
+
flexWrap: wrap === true ? "wrap" : wrap,
|
|
14
|
+
alignItems: align,
|
|
15
|
+
justifyContent: justify,
|
|
16
|
+
flexGrow: grow === true ? 1 : grow,
|
|
17
|
+
flexShrink: shrink,
|
|
18
|
+
...rest
|
|
19
|
+
}
|
|
20
|
+
);
|
|
8
21
|
});
|
|
9
22
|
|
|
10
23
|
export { Flex };
|
|
@@ -33,8 +33,8 @@ const Inline = React__namespace.forwardRef((props, ref) => {
|
|
|
33
33
|
display: "flex",
|
|
34
34
|
flexDirection: "row",
|
|
35
35
|
flexWrap: "wrap",
|
|
36
|
-
alignItems: "
|
|
37
|
-
justifyContent: "
|
|
36
|
+
alignItems: "flex-start",
|
|
37
|
+
justifyContent: "flex-start",
|
|
38
38
|
...props
|
|
39
39
|
}
|
|
40
40
|
);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { BoxProps } from '../Box/Box';
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `HStack` instead.
|
|
5
|
+
*/
|
|
3
6
|
export interface InlineProps extends Omit<BoxProps, "display" | "direction" | "flexWrap"> {
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `HStack` instead.
|
|
10
|
+
*/
|
|
5
11
|
export declare const Inline: React.ForwardRefExoticComponent<InlineProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
12
|
//# sourceMappingURL=Inline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../src/components/Inline/Inline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;CAAG;AAE5F,eAAO,MAAM,MAAM,oFAYjB,CAAC"}
|
|
1
|
+
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../src/components/Inline/Inline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;CAAG;AAE5F;;GAEG;AACH,eAAO,MAAM,MAAM,oFAYjB,CAAC"}
|
|
@@ -10,8 +10,8 @@ const Inline = React.forwardRef((props, ref) => {
|
|
|
10
10
|
display: "flex",
|
|
11
11
|
flexDirection: "row",
|
|
12
12
|
flexWrap: "wrap",
|
|
13
|
-
alignItems: "
|
|
14
|
-
justifyContent: "
|
|
13
|
+
alignItems: "flex-start",
|
|
14
|
+
justifyContent: "flex-start",
|
|
15
15
|
...props
|
|
16
16
|
}
|
|
17
17
|
);
|
|
@@ -6,7 +6,7 @@ export interface CheckSelectBoxGroupProps extends PrimitiveProps, React.HTMLAttr
|
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* CheckSelectBoxGroup is a simple div wrapper for future extensibility.
|
|
9
|
-
* It does not have spacing by default, nesting <
|
|
9
|
+
* It does not have spacing by default, nesting <VStack> under it is recommended.
|
|
10
10
|
*/
|
|
11
11
|
export declare const CheckSelectBoxGroup: ForwardRefExoticComponent<CheckSelectBoxGroupProps & RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export interface CheckSelectBoxRootProps extends CheckboxPrimitive.RootProps {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
const React = require('react');
|
|
7
|
-
const
|
|
7
|
+
const Flex = require('../Flex/Flex.cjs');
|
|
8
8
|
|
|
9
9
|
function _interopNamespaceDefault(e) {
|
|
10
10
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -26,7 +26,15 @@ function _interopNamespaceDefault(e) {
|
|
|
26
26
|
const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
27
27
|
|
|
28
28
|
const Stack = React__namespace.forwardRef((props, ref) => {
|
|
29
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Flex.Flex, { ref, display: "flex", flexDirection: "column", ...props });
|
|
30
|
+
});
|
|
31
|
+
const VStack = React__namespace.forwardRef((props, ref) => {
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Flex.Flex, { ref, display: "flex", flexDirection: "column", ...props });
|
|
33
|
+
});
|
|
34
|
+
const HStack = React__namespace.forwardRef((props, ref) => {
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Flex.Flex, { ref, display: "flex", flexDirection: "row", ...props });
|
|
30
36
|
});
|
|
31
37
|
|
|
38
|
+
exports.HStack = HStack;
|
|
32
39
|
exports.Stack = Stack;
|
|
40
|
+
exports.VStack = VStack;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlexProps } from '../Flex';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `VStack` instead.
|
|
5
|
+
*/
|
|
6
|
+
export interface StackProps extends Omit<FlexProps, "flexDirection"> {
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `VStack` instead.
|
|
10
|
+
*/
|
|
5
11
|
export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export interface VStackProps extends Omit<FlexProps, "flexDirection"> {
|
|
13
|
+
}
|
|
14
|
+
export declare const VStack: React.ForwardRefExoticComponent<VStackProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export interface HStackProps extends Omit<FlexProps, "flexDirection"> {
|
|
16
|
+
}
|
|
17
|
+
export declare const HStack: React.ForwardRefExoticComponent<HStackProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
18
|
//# sourceMappingURL=Stack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC;CAAG;AAEvE;;GAEG;AACH,eAAO,MAAM,KAAK,mFAEhB,CAAC;AAEH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC;CAAG;AAExE,eAAO,MAAM,MAAM,oFAEjB,CAAC;AAEH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC;CAAG;AAExE,eAAO,MAAM,MAAM,oFAEjB,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Flex } from '../Flex/Flex.js';
|
|
4
4
|
|
|
5
5
|
const Stack = React.forwardRef((props, ref) => {
|
|
6
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
+
return /* @__PURE__ */ jsx(Flex, { ref, display: "flex", flexDirection: "column", ...props });
|
|
7
|
+
});
|
|
8
|
+
const VStack = React.forwardRef((props, ref) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(Flex, { ref, display: "flex", flexDirection: "column", ...props });
|
|
10
|
+
});
|
|
11
|
+
const HStack = React.forwardRef((props, ref) => {
|
|
12
|
+
return /* @__PURE__ */ jsx(Flex, { ref, display: "flex", flexDirection: "row", ...props });
|
|
7
13
|
});
|
|
8
14
|
|
|
9
|
-
export { Stack };
|
|
15
|
+
export { HStack, Stack, VStack };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Stack, type StackProps } from './Stack';
|
|
1
|
+
export { Stack, VStack, HStack, type StackProps, type VStackProps, type HStackProps, } from './Stack';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Stack } from './Stack.js';
|
|
1
|
+
export { HStack, Stack, VStack } from './Stack.js';
|
package/lib/components/index.cjs
CHANGED
|
@@ -242,7 +242,9 @@ Object.defineProperty(exports, "useSnackbarContext", {
|
|
|
242
242
|
});
|
|
243
243
|
exports.useSnackbarAdapter = useSnackbarAdapter.useSnackbarAdapter;
|
|
244
244
|
exports.Snackbar = Snackbar_namespace;
|
|
245
|
+
exports.HStack = Stack.HStack;
|
|
245
246
|
exports.Stack = Stack.Stack;
|
|
247
|
+
exports.VStack = Stack.VStack;
|
|
246
248
|
exports.SwitchControl = Switch.SwitchControl;
|
|
247
249
|
exports.SwitchHiddenInput = Switch.SwitchHiddenInput;
|
|
248
250
|
exports.SwitchLabel = Switch.SwitchLabel;
|
package/lib/components/index.js
CHANGED
|
@@ -74,7 +74,7 @@ export { useSnackbarContext } from '@seed-design/react-snackbar';
|
|
|
74
74
|
export { useSnackbarAdapter } from './Snackbar/useSnackbarAdapter.js';
|
|
75
75
|
import * as Snackbar_namespace from './Snackbar/Snackbar.namespace.js';
|
|
76
76
|
export { Snackbar_namespace as Snackbar };
|
|
77
|
-
export { Stack } from './Stack/Stack.js';
|
|
77
|
+
export { HStack, Stack, VStack } from './Stack/Stack.js';
|
|
78
78
|
export { SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchThumb } from './Switch/Switch.js';
|
|
79
79
|
import * as Switch_namespace from './Switch/Switch.namespace.js';
|
|
80
80
|
export { Switch_namespace as Switch };
|
package/lib/index.cjs
CHANGED
|
@@ -242,7 +242,9 @@ Object.defineProperty(exports, "useSnackbarContext", {
|
|
|
242
242
|
});
|
|
243
243
|
exports.useSnackbarAdapter = useSnackbarAdapter.useSnackbarAdapter;
|
|
244
244
|
exports.Snackbar = Snackbar_namespace;
|
|
245
|
+
exports.HStack = Stack.HStack;
|
|
245
246
|
exports.Stack = Stack.Stack;
|
|
247
|
+
exports.VStack = Stack.VStack;
|
|
246
248
|
exports.SwitchControl = Switch.SwitchControl;
|
|
247
249
|
exports.SwitchHiddenInput = Switch.SwitchHiddenInput;
|
|
248
250
|
exports.SwitchLabel = Switch.SwitchLabel;
|
package/lib/index.js
CHANGED
|
@@ -74,7 +74,7 @@ export { useSnackbarContext } from '@seed-design/react-snackbar';
|
|
|
74
74
|
export { useSnackbarAdapter } from './components/Snackbar/useSnackbarAdapter.js';
|
|
75
75
|
import * as Snackbar_namespace from './components/Snackbar/Snackbar.namespace.js';
|
|
76
76
|
export { Snackbar_namespace as Snackbar };
|
|
77
|
-
export { Stack } from './components/Stack/Stack.js';
|
|
77
|
+
export { HStack, Stack, VStack } from './components/Stack/Stack.js';
|
|
78
78
|
export { SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchThumb } from './components/Switch/Switch.js';
|
|
79
79
|
import * as Switch_namespace from './components/Switch/Switch.namespace.js';
|
|
80
80
|
export { Switch_namespace as Switch };
|
package/lib/utils/styled.cjs
CHANGED
|
@@ -11,7 +11,7 @@ function handleColor(color) {
|
|
|
11
11
|
return void 0;
|
|
12
12
|
}
|
|
13
13
|
const [type, value] = color.split(".");
|
|
14
|
-
return vars.vars.$color[type][value] ??
|
|
14
|
+
return vars.vars.$color[type]?.[value] ?? color;
|
|
15
15
|
}
|
|
16
16
|
function handleDimension(dimension) {
|
|
17
17
|
if (dimension == null) {
|
|
@@ -36,52 +36,94 @@ function handleDisplay(display) {
|
|
|
36
36
|
if (!display) {
|
|
37
37
|
return void 0;
|
|
38
38
|
}
|
|
39
|
+
if (process.env.NODE_ENV !== "production") {
|
|
40
|
+
if (display === "inlineFlex" || display === "inlineBlock") {
|
|
41
|
+
console.warn(
|
|
42
|
+
`[SEED Design System] ${display} is deprecated. Use inline-flex or inline-block instead.`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
39
46
|
return {
|
|
40
|
-
block: "block",
|
|
41
47
|
flex: "flex",
|
|
42
48
|
inlineFlex: "inline-flex",
|
|
43
|
-
inline
|
|
49
|
+
// @deprecated Use `inline-flex` instead.
|
|
44
50
|
inlineBlock: "inline-block",
|
|
51
|
+
// @deprecated Use `inline-block` instead.
|
|
45
52
|
none: "none"
|
|
46
|
-
}[display];
|
|
53
|
+
}[display] ?? display;
|
|
47
54
|
}
|
|
48
55
|
function handleFlexDirection(flexDirection) {
|
|
49
56
|
if (!flexDirection) {
|
|
50
57
|
return void 0;
|
|
51
58
|
}
|
|
59
|
+
if (process.env.NODE_ENV !== "production") {
|
|
60
|
+
if (flexDirection === "rowReverse" || flexDirection === "columnReverse") {
|
|
61
|
+
console.warn(
|
|
62
|
+
`[SEED Design System] ${flexDirection} is deprecated. Use row-reverse or column-reverse instead.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
52
66
|
return {
|
|
53
67
|
row: "row",
|
|
54
68
|
column: "column",
|
|
55
69
|
rowReverse: "row-reverse",
|
|
70
|
+
// @deprecated Use `row-reverse` instead.
|
|
56
71
|
columnReverse: "column-reverse"
|
|
57
|
-
|
|
72
|
+
// @deprecated Use `column-reverse` instead.
|
|
73
|
+
}[flexDirection] ?? flexDirection;
|
|
58
74
|
}
|
|
59
75
|
function handleJustifyContent(justifyContent) {
|
|
60
76
|
if (!justifyContent) {
|
|
61
77
|
return void 0;
|
|
62
78
|
}
|
|
79
|
+
if (process.env.NODE_ENV !== "production") {
|
|
80
|
+
if (justifyContent === "flexStart" || justifyContent === "flexEnd") {
|
|
81
|
+
console.warn(
|
|
82
|
+
`[SEED Design System] ${justifyContent} is deprecated. Use flex-start or flex-end instead.`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (justifyContent === "spaceBetween" || justifyContent === "spaceAround") {
|
|
86
|
+
console.warn(
|
|
87
|
+
`[SEED Design System] ${justifyContent} is deprecated. Use space-between or space-around instead.`
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
63
91
|
return {
|
|
64
92
|
flexStart: "flex-start",
|
|
93
|
+
// @deprecated Use `flex-start` instead.
|
|
65
94
|
flexEnd: "flex-end",
|
|
95
|
+
// @deprecated Use `flex-end` instead.
|
|
66
96
|
center: "center",
|
|
67
97
|
spaceBetween: "space-between",
|
|
98
|
+
// @deprecated Use `space-between` instead.
|
|
68
99
|
spaceAround: "space-around"
|
|
69
|
-
|
|
100
|
+
// @deprecated Use `space-around` instead.
|
|
101
|
+
}[justifyContent] ?? justifyContent;
|
|
70
102
|
}
|
|
71
103
|
function handleAlignItems(alignItems) {
|
|
72
104
|
if (!alignItems) {
|
|
73
105
|
return void 0;
|
|
74
106
|
}
|
|
107
|
+
if (process.env.NODE_ENV !== "production") {
|
|
108
|
+
if (alignItems === "flexStart" || alignItems === "flexEnd") {
|
|
109
|
+
console.warn(
|
|
110
|
+
`[SEED Design System] ${alignItems} is deprecated. Use flex-start or flex-end instead.`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
75
114
|
return {
|
|
76
115
|
flexStart: "flex-start",
|
|
116
|
+
// @deprecated Use `flex-start` instead.
|
|
77
117
|
flexEnd: "flex-end",
|
|
118
|
+
// @deprecated Use `flex-end` instead.
|
|
78
119
|
center: "center",
|
|
79
120
|
stretch: "stretch"
|
|
80
|
-
}[alignItems];
|
|
121
|
+
}[alignItems] ?? alignItems;
|
|
81
122
|
}
|
|
82
123
|
function useStyleProps(props) {
|
|
83
124
|
const {
|
|
84
125
|
background,
|
|
126
|
+
bg,
|
|
85
127
|
color,
|
|
86
128
|
borderColor,
|
|
87
129
|
borderWidth,
|
|
@@ -107,6 +149,13 @@ function useStyleProps(props) {
|
|
|
107
149
|
paddingRight,
|
|
108
150
|
paddingBottom,
|
|
109
151
|
paddingLeft,
|
|
152
|
+
p,
|
|
153
|
+
px,
|
|
154
|
+
py,
|
|
155
|
+
pt,
|
|
156
|
+
pr,
|
|
157
|
+
pb,
|
|
158
|
+
pl,
|
|
110
159
|
bottom,
|
|
111
160
|
left,
|
|
112
161
|
right,
|
|
@@ -129,7 +178,7 @@ function useStyleProps(props) {
|
|
|
129
178
|
} = props;
|
|
130
179
|
return {
|
|
131
180
|
style: {
|
|
132
|
-
"--seed-box-background": handleColor(background),
|
|
181
|
+
"--seed-box-background": handleColor(background ?? bg),
|
|
133
182
|
"--seed-box-color": handleColor(color),
|
|
134
183
|
"--seed-box-border-color": handleColor(borderColor),
|
|
135
184
|
"--seed-box-border-width": borderWidth !== void 0 ? `${borderWidth}px` : void 0,
|
|
@@ -148,13 +197,13 @@ function useStyleProps(props) {
|
|
|
148
197
|
"--seed-box-height": handleDimension(height),
|
|
149
198
|
"--seed-box-min-height": handleDimension(minHeight),
|
|
150
199
|
"--seed-box-max-height": handleDimension(maxHeight),
|
|
151
|
-
"--seed-box-padding": handleDimension(padding),
|
|
152
|
-
"--seed-box-padding-x": handleDimension(paddingX),
|
|
153
|
-
"--seed-box-padding-y": handleDimension(paddingY),
|
|
154
|
-
"--seed-box-padding-top": handleDimension(paddingTop),
|
|
155
|
-
"--seed-box-padding-right": handleDimension(paddingRight),
|
|
156
|
-
"--seed-box-padding-bottom": handleDimension(paddingBottom),
|
|
157
|
-
"--seed-box-padding-left": handleDimension(paddingLeft),
|
|
200
|
+
"--seed-box-padding": handleDimension(padding ?? p),
|
|
201
|
+
"--seed-box-padding-x": handleDimension(paddingX ?? px),
|
|
202
|
+
"--seed-box-padding-y": handleDimension(paddingY ?? py),
|
|
203
|
+
"--seed-box-padding-top": handleDimension(paddingTop ?? pt),
|
|
204
|
+
"--seed-box-padding-right": handleDimension(paddingRight ?? pr),
|
|
205
|
+
"--seed-box-padding-bottom": handleDimension(paddingBottom ?? pb),
|
|
206
|
+
"--seed-box-padding-left": handleDimension(paddingLeft ?? pl),
|
|
158
207
|
"--seed-box-top": top,
|
|
159
208
|
"--seed-box-left": left,
|
|
160
209
|
"--seed-box-right": right,
|