@seed-design/react 1.0.5 → 1.0.6
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/Article/Article.cjs +45 -0
- package/lib/components/Article/Article.d.ts +6 -0
- package/lib/components/Article/Article.d.ts.map +1 -0
- package/lib/components/Article/Article.js +22 -0
- package/lib/components/Article/index.cjs +9 -0
- package/lib/components/Article/index.d.ts +2 -0
- package/lib/components/Article/index.d.ts.map +1 -0
- package/lib/components/Article/index.js +1 -0
- package/lib/components/TagGroup/TagGroup.cjs +35 -0
- package/lib/components/TagGroup/TagGroup.d.ts +12 -0
- package/lib/components/TagGroup/TagGroup.d.ts.map +1 -0
- package/lib/components/TagGroup/TagGroup.js +30 -0
- package/lib/components/TagGroup/TagGroup.namespace.cjs +10 -0
- package/lib/components/TagGroup/TagGroup.namespace.d.ts +2 -0
- package/lib/components/TagGroup/TagGroup.namespace.d.ts.map +1 -0
- package/lib/components/TagGroup/TagGroup.namespace.js +1 -0
- package/lib/components/TagGroup/index.cjs +12 -0
- package/lib/components/TagGroup/index.d.ts +3 -0
- package/lib/components/TagGroup/index.d.ts.map +1 -0
- package/lib/components/TagGroup/index.js +3 -0
- package/lib/components/Text/Text.cjs +6 -1
- package/lib/components/Text/Text.d.ts +10 -1
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.js +6 -1
- package/lib/components/index.cjs +7 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +4 -0
- package/lib/index.cjs +7 -0
- package/lib/index.js +4 -0
- package/package.json +4 -3
- package/src/components/Article/Article.tsx +19 -0
- package/src/components/Article/index.ts +1 -0
- package/src/components/TagGroup/TagGroup.namespace.ts +6 -0
- package/src/components/TagGroup/TagGroup.tsx +60 -0
- package/src/components/TagGroup/index.ts +8 -0
- package/src/components/Text/Text.tsx +26 -7
- package/src/components/index.ts +2 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const React = require('react');
|
|
8
|
+
const Box = require('../Box/Box.cjs');
|
|
9
|
+
const clsx = require('clsx');
|
|
10
|
+
const article = require('@seed-design/css/recipes/article');
|
|
11
|
+
|
|
12
|
+
function _interopNamespaceDefault(e) {
|
|
13
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
14
|
+
if (e) {
|
|
15
|
+
for (const k in e) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: () => e[k]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
n.default = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
30
|
+
|
|
31
|
+
const Article = React__namespace.forwardRef(
|
|
32
|
+
({ as = "article", className, ...props }, ref) => {
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
+
Box.Box,
|
|
35
|
+
{
|
|
36
|
+
as,
|
|
37
|
+
ref,
|
|
38
|
+
className: clsx(article.article(), className),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
exports.Article = Article;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BoxProps } from '../Box/Box';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface ArticleProps extends BoxProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const Article: React.ForwardRefExoticComponent<ArticleProps & React.RefAttributes<HTMLElement>>;
|
|
6
|
+
//# sourceMappingURL=Article.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Article.d.ts","sourceRoot":"","sources":["../../../src/components/Article/Article.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAIhD,MAAM,WAAW,YAAa,SAAQ,QAAQ;CAAG;AAEjD,eAAO,MAAM,OAAO,kFAWnB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Box } from '../Box/Box.js';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { article } from '@seed-design/css/recipes/article';
|
|
7
|
+
|
|
8
|
+
const Article = React.forwardRef(
|
|
9
|
+
({ as = "article", className, ...props }, ref) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Box,
|
|
12
|
+
{
|
|
13
|
+
as,
|
|
14
|
+
ref,
|
|
15
|
+
className: clsx(article(), className),
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export { Article };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Article/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Article } from './Article.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const reactPrimitive = require('@seed-design/react-primitive');
|
|
8
|
+
const tagGroup = require('@seed-design/css/recipes/tag-group');
|
|
9
|
+
const tagGroupItem = require('@seed-design/css/recipes/tag-group-item');
|
|
10
|
+
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
11
|
+
const React = require('react');
|
|
12
|
+
const clsx = require('clsx');
|
|
13
|
+
const splitMultipleVariantsProps = require('../../utils/splitMultipleVariantsProps.cjs');
|
|
14
|
+
const domUtils = require('@seed-design/dom-utils');
|
|
15
|
+
|
|
16
|
+
const { PropsProvider, useProps } = createRecipeContext.createRecipeContext(tagGroupItem.tagGroupItem);
|
|
17
|
+
const TagGroupRoot = React.forwardRef(
|
|
18
|
+
({ className, children, separator = " · ", ...props }, ref) => {
|
|
19
|
+
const [{ tagGroup: tagGroupVariantProps, tagGroupItem: tagGroupItemVariantProps }, otherProps] = splitMultipleVariantsProps.splitMultipleVariantsProps(props, { tagGroup: tagGroup.tagGroup, tagGroupItem: tagGroupItem.tagGroupItem });
|
|
20
|
+
const classNames = tagGroup.tagGroup(tagGroupVariantProps);
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PropsProvider, { value: tagGroupItemVariantProps, children: /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.span, { ref, className: clsx(classNames.root, className), ...otherProps, children: React.Children.map(children, (child, index) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
22
|
+
index > 0 && /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.span, { "aria-hidden": true, className: classNames.separator, children: separator }),
|
|
23
|
+
child
|
|
24
|
+
] })) }) });
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const TagGroupItem = React.forwardRef((props, ref) => {
|
|
28
|
+
const parentVariantProps = useProps();
|
|
29
|
+
const [variantProps, { className, ...otherProps }] = tagGroupItem.tagGroupItem.splitVariantProps(props);
|
|
30
|
+
const recipeClassName = tagGroupItem.tagGroupItem(domUtils.mergeProps(parentVariantProps, variantProps));
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.span, { ref, className: clsx(recipeClassName, className), ...otherProps });
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
exports.TagGroupItem = TagGroupItem;
|
|
35
|
+
exports.TagGroupRoot = TagGroupRoot;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
2
|
+
import { TagGroupVariantProps } from '@seed-design/css/recipes/tag-group';
|
|
3
|
+
import { TagGroupItemVariantProps } from '@seed-design/css/recipes/tag-group-item';
|
|
4
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
5
|
+
export interface TagGroupRootProps extends TagGroupVariantProps, TagGroupItemVariantProps, PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
6
|
+
separator?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const TagGroupRoot: ForwardRefExoticComponent<TagGroupRootProps & RefAttributes<HTMLSpanElement>>;
|
|
9
|
+
export interface TagGroupItemProps extends TagGroupItemVariantProps, PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
10
|
+
}
|
|
11
|
+
export declare const TagGroupItem: ForwardRefExoticComponent<TagGroupItemProps & RefAttributes<HTMLSpanElement>>;
|
|
12
|
+
//# sourceMappingURL=TagGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagGroup.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/TagGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,yCAAyC,CAAC;AASjD,MAAM,WAAW,iBACf,SAAQ,oBAAoB,EAC1B,wBAAwB,EACxB,cAAc,EACd,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACvC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,YAAY,+GAuBxB,CAAC;AAEF,MAAM,WAAW,iBACf,SAAQ,wBAAwB,EAC9B,cAAc,EACd,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,YAAY,+GAOvB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { Primitive } from '@seed-design/react-primitive';
|
|
4
|
+
import { tagGroup } from '@seed-design/css/recipes/tag-group';
|
|
5
|
+
import { tagGroupItem } from '@seed-design/css/recipes/tag-group-item';
|
|
6
|
+
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
7
|
+
import { forwardRef, Children } from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
import { splitMultipleVariantsProps } from '../../utils/splitMultipleVariantsProps.js';
|
|
10
|
+
import { mergeProps } from '@seed-design/dom-utils';
|
|
11
|
+
|
|
12
|
+
const { PropsProvider, useProps } = createRecipeContext(tagGroupItem);
|
|
13
|
+
const TagGroupRoot = forwardRef(
|
|
14
|
+
({ className, children, separator = " · ", ...props }, ref) => {
|
|
15
|
+
const [{ tagGroup: tagGroupVariantProps, tagGroupItem: tagGroupItemVariantProps }, otherProps] = splitMultipleVariantsProps(props, { tagGroup, tagGroupItem });
|
|
16
|
+
const classNames = tagGroup(tagGroupVariantProps);
|
|
17
|
+
return /* @__PURE__ */ jsx(PropsProvider, { value: tagGroupItemVariantProps, children: /* @__PURE__ */ jsx(Primitive.span, { ref, className: clsx(classNames.root, className), ...otherProps, children: Children.map(children, (child, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
index > 0 && /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, className: classNames.separator, children: separator }),
|
|
19
|
+
child
|
|
20
|
+
] })) }) });
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
const TagGroupItem = forwardRef((props, ref) => {
|
|
24
|
+
const parentVariantProps = useProps();
|
|
25
|
+
const [variantProps, { className, ...otherProps }] = tagGroupItem.splitVariantProps(props);
|
|
26
|
+
const recipeClassName = tagGroupItem(mergeProps(parentVariantProps, variantProps));
|
|
27
|
+
return /* @__PURE__ */ jsx(Primitive.span, { ref, className: clsx(recipeClassName, className), ...otherProps });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export { TagGroupItem, TagGroupRoot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagGroup.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/TagGroup.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,IAAI,EACpB,YAAY,IAAI,IAAI,EACpB,KAAK,iBAAiB,IAAI,SAAS,EACnC,KAAK,iBAAiB,IAAI,SAAS,GACpC,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TagGroupItem as Item, TagGroupRoot as Root } from './TagGroup.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const TagGroup = require('./TagGroup.cjs');
|
|
6
|
+
const TagGroup_namespace = require('./TagGroup.namespace.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.TagGroupItem = TagGroup.TagGroupItem;
|
|
11
|
+
exports.TagGroupRoot = TagGroup.TagGroupRoot;
|
|
12
|
+
exports.TagGroup = TagGroup_namespace;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC"}
|
|
@@ -53,6 +53,9 @@ const Text = React.forwardRef(
|
|
|
53
53
|
fontWeight,
|
|
54
54
|
maxLines,
|
|
55
55
|
textDecorationLine,
|
|
56
|
+
align,
|
|
57
|
+
userSelect,
|
|
58
|
+
whiteSpace,
|
|
56
59
|
children,
|
|
57
60
|
className,
|
|
58
61
|
style,
|
|
@@ -78,7 +81,9 @@ const Text = React.forwardRef(
|
|
|
78
81
|
"--seed-font-size": handleFontSize(fontSize),
|
|
79
82
|
"--seed-line-height": handleLineHeight(lineHeight ?? fontSize),
|
|
80
83
|
"--seed-font-weight": handleFontWeight(fontWeight),
|
|
81
|
-
"--seed-text-align":
|
|
84
|
+
"--seed-text-align": align,
|
|
85
|
+
"--seed-user-select": userSelect,
|
|
86
|
+
"--seed-white-space": whiteSpace,
|
|
82
87
|
...style
|
|
83
88
|
},
|
|
84
89
|
...otherProps,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TextVariantProps } from '@seed-design/css/recipes/text';
|
|
2
2
|
import { FontSize, FontWeight, LineHeight, ScopedColorFg, ScopedColorPalette } from '@seed-design/css/vars';
|
|
3
3
|
import type * as React from "react";
|
|
4
|
+
import type * as CSS from "csstype";
|
|
4
5
|
export interface TextProps extends Omit<TextVariantProps, "maxLines">, React.HTMLAttributes<HTMLSpanElement> {
|
|
5
6
|
/**
|
|
6
7
|
* The element to render as
|
|
@@ -30,7 +31,15 @@ export interface TextProps extends Omit<TextVariantProps, "maxLines">, React.HTM
|
|
|
30
31
|
/**
|
|
31
32
|
* The alignment of the text.
|
|
32
33
|
*/
|
|
33
|
-
align?: "left" | "center" | "right"
|
|
34
|
+
align?: Extract<CSS.Property.TextAlign, "left" | "center" | "right">;
|
|
35
|
+
/**
|
|
36
|
+
* The user-select behavior of the text.
|
|
37
|
+
*/
|
|
38
|
+
userSelect?: Extract<CSS.Property.UserSelect, "none" | "text" | "auto">;
|
|
39
|
+
/**
|
|
40
|
+
* The white-space behavior of the text.
|
|
41
|
+
*/
|
|
42
|
+
whiteSpace?: Extract<CSS.Property.WhiteSpace, "normal" | "nowrap" | "pre" | "pre-wrap" | "pre-line" | "break-spaces">;
|
|
34
43
|
}
|
|
35
44
|
export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
36
45
|
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,KAAK,GAAG,MAAM,SAAS,CAAC;AAmCpC,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EACxC,KAAK,CAAC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
|
className,
|
|
54
57
|
style,
|
|
@@ -74,7 +77,9 @@ const Text = forwardRef(
|
|
|
74
77
|
"--seed-font-size": handleFontSize(fontSize),
|
|
75
78
|
"--seed-line-height": handleLineHeight(lineHeight ?? fontSize),
|
|
76
79
|
"--seed-font-weight": handleFontWeight(fontWeight),
|
|
77
|
-
"--seed-text-align":
|
|
80
|
+
"--seed-text-align": align,
|
|
81
|
+
"--seed-user-select": userSelect,
|
|
82
|
+
"--seed-white-space": whiteSpace,
|
|
78
83
|
...style
|
|
79
84
|
},
|
|
80
85
|
...otherProps,
|
package/lib/components/index.cjs
CHANGED
|
@@ -6,6 +6,7 @@ const ActionButton = require('./ActionButton/ActionButton.cjs');
|
|
|
6
6
|
const ActionChip = require('./ActionChip/ActionChip.cjs');
|
|
7
7
|
const ActionSheet = require('./ActionSheet/ActionSheet.cjs');
|
|
8
8
|
const ActionSheet_namespace = require('./ActionSheet/ActionSheet.namespace.cjs');
|
|
9
|
+
const Article = require('./Article/Article.cjs');
|
|
9
10
|
const Avatar = require('./Avatar/Avatar.cjs');
|
|
10
11
|
const Avatar_namespace = require('./Avatar/Avatar.namespace.cjs');
|
|
11
12
|
const Badge = require('./Badge/Badge.cjs');
|
|
@@ -85,6 +86,8 @@ const Switch_namespace = require('./Switch/Switch.namespace.cjs');
|
|
|
85
86
|
const Tabs = require('./Tabs/Tabs.cjs');
|
|
86
87
|
const reactTabs = require('@seed-design/react-tabs');
|
|
87
88
|
const Tabs_namespace = require('./Tabs/Tabs.namespace.cjs');
|
|
89
|
+
const TagGroup = require('./TagGroup/TagGroup.cjs');
|
|
90
|
+
const TagGroup_namespace = require('./TagGroup/TagGroup.namespace.cjs');
|
|
88
91
|
const Text = require('./Text/Text.cjs');
|
|
89
92
|
const TextField = require('./TextField/TextField.cjs');
|
|
90
93
|
const TextField_namespace = require('./TextField/TextField.namespace.cjs');
|
|
@@ -107,6 +110,7 @@ exports.ActionSheetRoot = ActionSheet.ActionSheetRoot;
|
|
|
107
110
|
exports.ActionSheetTitle = ActionSheet.ActionSheetTitle;
|
|
108
111
|
exports.ActionSheetTrigger = ActionSheet.ActionSheetTrigger;
|
|
109
112
|
exports.ActionSheet = ActionSheet_namespace;
|
|
113
|
+
exports.Article = Article.Article;
|
|
110
114
|
exports.AvatarBadge = Avatar.AvatarBadge;
|
|
111
115
|
exports.AvatarFallback = Avatar.AvatarFallback;
|
|
112
116
|
exports.AvatarImage = Avatar.AvatarImage;
|
|
@@ -333,6 +337,9 @@ Object.defineProperty(exports, "tabsCarouselPreventDrag", {
|
|
|
333
337
|
get: () => reactTabs.tabsCarouselPreventDrag
|
|
334
338
|
});
|
|
335
339
|
exports.Tabs = Tabs_namespace;
|
|
340
|
+
exports.TagGroupItem = TagGroup.TagGroupItem;
|
|
341
|
+
exports.TagGroupRoot = TagGroup.TagGroupRoot;
|
|
342
|
+
exports.TagGroup = TagGroup_namespace;
|
|
336
343
|
exports.Text = Text.Text;
|
|
337
344
|
exports.TextFieldCharacterCount = TextField.TextFieldCharacterCount;
|
|
338
345
|
exports.TextFieldCharacterCountArea = TextField.TextFieldCharacterCountArea;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './ActionButton';
|
|
2
2
|
export * from './ActionChip';
|
|
3
3
|
export * from './ActionSheet';
|
|
4
|
+
export * from './Article';
|
|
4
5
|
export * from './Avatar';
|
|
5
6
|
export * from './Badge';
|
|
6
7
|
export * from './BottomSheet';
|
|
@@ -49,6 +50,7 @@ export * from './Snackbar';
|
|
|
49
50
|
export * from './Stack';
|
|
50
51
|
export * from './Switch';
|
|
51
52
|
export * from './Tabs';
|
|
53
|
+
export * from './TagGroup';
|
|
52
54
|
export * from './Text';
|
|
53
55
|
export * from './TextField';
|
|
54
56
|
export * from './ToggleButton';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,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Ac,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { ActionChip } from './ActionChip/ActionChip.js';
|
|
|
3
3
|
export { ActionSheetBackdrop, ActionSheetCloseButton, ActionSheetContent, ActionSheetDescription, ActionSheetHeader, ActionSheetItem, ActionSheetList, ActionSheetPositioner, ActionSheetRoot, ActionSheetTitle, ActionSheetTrigger } from './ActionSheet/ActionSheet.js';
|
|
4
4
|
import * as ActionSheet_namespace from './ActionSheet/ActionSheet.namespace.js';
|
|
5
5
|
export { ActionSheet_namespace as ActionSheet };
|
|
6
|
+
export { Article } from './Article/Article.js';
|
|
6
7
|
export { AvatarBadge, AvatarFallback, AvatarImage, AvatarRoot, AvatarStack } from './Avatar/Avatar.js';
|
|
7
8
|
import * as Avatar_namespace from './Avatar/Avatar.namespace.js';
|
|
8
9
|
export { Avatar_namespace as Avatar };
|
|
@@ -106,6 +107,9 @@ export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList,
|
|
|
106
107
|
export { tabsCarouselPreventDrag } from '@seed-design/react-tabs';
|
|
107
108
|
import * as Tabs_namespace from './Tabs/Tabs.namespace.js';
|
|
108
109
|
export { Tabs_namespace as Tabs };
|
|
110
|
+
export { TagGroupItem, TagGroupRoot } from './TagGroup/TagGroup.js';
|
|
111
|
+
import * as TagGroup_namespace from './TagGroup/TagGroup.namespace.js';
|
|
112
|
+
export { TagGroup_namespace as TagGroup };
|
|
109
113
|
export { Text } from './Text/Text.js';
|
|
110
114
|
export { TextFieldCharacterCount, TextFieldCharacterCountArea, TextFieldDescription, TextFieldErrorIcon, TextFieldErrorMessage, TextFieldField, TextFieldFooter, TextFieldHeader, TextFieldIndicator, TextFieldInput, TextFieldLabel, TextFieldMaxCharacterCount, TextFieldPrefixIcon, TextFieldPrefixText, TextFieldRoot, TextFieldSuffixIcon, TextFieldSuffixText, TextFieldTextarea } from './TextField/TextField.js';
|
|
111
115
|
import * as TextField_namespace from './TextField/TextField.namespace.js';
|
package/lib/index.cjs
CHANGED
|
@@ -6,6 +6,7 @@ const ActionButton = require('./components/ActionButton/ActionButton.cjs');
|
|
|
6
6
|
const ActionChip = require('./components/ActionChip/ActionChip.cjs');
|
|
7
7
|
const ActionSheet = require('./components/ActionSheet/ActionSheet.cjs');
|
|
8
8
|
const ActionSheet_namespace = require('./components/ActionSheet/ActionSheet.namespace.cjs');
|
|
9
|
+
const Article = require('./components/Article/Article.cjs');
|
|
9
10
|
const Avatar = require('./components/Avatar/Avatar.cjs');
|
|
10
11
|
const Avatar_namespace = require('./components/Avatar/Avatar.namespace.cjs');
|
|
11
12
|
const Badge = require('./components/Badge/Badge.cjs');
|
|
@@ -85,6 +86,8 @@ const Switch_namespace = require('./components/Switch/Switch.namespace.cjs');
|
|
|
85
86
|
const Tabs = require('./components/Tabs/Tabs.cjs');
|
|
86
87
|
const reactTabs = require('@seed-design/react-tabs');
|
|
87
88
|
const Tabs_namespace = require('./components/Tabs/Tabs.namespace.cjs');
|
|
89
|
+
const TagGroup = require('./components/TagGroup/TagGroup.cjs');
|
|
90
|
+
const TagGroup_namespace = require('./components/TagGroup/TagGroup.namespace.cjs');
|
|
88
91
|
const Text = require('./components/Text/Text.cjs');
|
|
89
92
|
const TextField = require('./components/TextField/TextField.cjs');
|
|
90
93
|
const TextField_namespace = require('./components/TextField/TextField.namespace.cjs');
|
|
@@ -107,6 +110,7 @@ exports.ActionSheetRoot = ActionSheet.ActionSheetRoot;
|
|
|
107
110
|
exports.ActionSheetTitle = ActionSheet.ActionSheetTitle;
|
|
108
111
|
exports.ActionSheetTrigger = ActionSheet.ActionSheetTrigger;
|
|
109
112
|
exports.ActionSheet = ActionSheet_namespace;
|
|
113
|
+
exports.Article = Article.Article;
|
|
110
114
|
exports.AvatarBadge = Avatar.AvatarBadge;
|
|
111
115
|
exports.AvatarFallback = Avatar.AvatarFallback;
|
|
112
116
|
exports.AvatarImage = Avatar.AvatarImage;
|
|
@@ -333,6 +337,9 @@ Object.defineProperty(exports, "tabsCarouselPreventDrag", {
|
|
|
333
337
|
get: () => reactTabs.tabsCarouselPreventDrag
|
|
334
338
|
});
|
|
335
339
|
exports.Tabs = Tabs_namespace;
|
|
340
|
+
exports.TagGroupItem = TagGroup.TagGroupItem;
|
|
341
|
+
exports.TagGroupRoot = TagGroup.TagGroupRoot;
|
|
342
|
+
exports.TagGroup = TagGroup_namespace;
|
|
336
343
|
exports.Text = Text.Text;
|
|
337
344
|
exports.TextFieldCharacterCount = TextField.TextFieldCharacterCount;
|
|
338
345
|
exports.TextFieldCharacterCountArea = TextField.TextFieldCharacterCountArea;
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { ActionChip } from './components/ActionChip/ActionChip.js';
|
|
|
3
3
|
export { ActionSheetBackdrop, ActionSheetCloseButton, ActionSheetContent, ActionSheetDescription, ActionSheetHeader, ActionSheetItem, ActionSheetList, ActionSheetPositioner, ActionSheetRoot, ActionSheetTitle, ActionSheetTrigger } from './components/ActionSheet/ActionSheet.js';
|
|
4
4
|
import * as ActionSheet_namespace from './components/ActionSheet/ActionSheet.namespace.js';
|
|
5
5
|
export { ActionSheet_namespace as ActionSheet };
|
|
6
|
+
export { Article } from './components/Article/Article.js';
|
|
6
7
|
export { AvatarBadge, AvatarFallback, AvatarImage, AvatarRoot, AvatarStack } from './components/Avatar/Avatar.js';
|
|
7
8
|
import * as Avatar_namespace from './components/Avatar/Avatar.namespace.js';
|
|
8
9
|
export { Avatar_namespace as Avatar };
|
|
@@ -106,6 +107,9 @@ export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList,
|
|
|
106
107
|
export { tabsCarouselPreventDrag } from '@seed-design/react-tabs';
|
|
107
108
|
import * as Tabs_namespace from './components/Tabs/Tabs.namespace.js';
|
|
108
109
|
export { Tabs_namespace as Tabs };
|
|
110
|
+
export { TagGroupItem, TagGroupRoot } from './components/TagGroup/TagGroup.js';
|
|
111
|
+
import * as TagGroup_namespace from './components/TagGroup/TagGroup.namespace.js';
|
|
112
|
+
export { TagGroup_namespace as TagGroup };
|
|
109
113
|
export { Text } from './components/Text/Text.js';
|
|
110
114
|
export { TextFieldCharacterCount, TextFieldCharacterCountArea, TextFieldDescription, TextFieldErrorIcon, TextFieldErrorMessage, TextFieldField, TextFieldFooter, TextFieldHeader, TextFieldIndicator, TextFieldInput, TextFieldLabel, TextFieldMaxCharacterCount, TextFieldPrefixIcon, TextFieldPrefixText, TextFieldRoot, TextFieldSuffixIcon, TextFieldSuffixText, TextFieldTextarea } from './components/TextField/TextField.js';
|
|
111
115
|
import * as TextField_namespace from './components/TextField/TextField.namespace.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -58,16 +58,17 @@
|
|
|
58
58
|
"clsx": "^2.1.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@seed-design/css": "1.0.
|
|
61
|
+
"@seed-design/css": "1.0.6",
|
|
62
62
|
"react": ">=18.0.0",
|
|
63
63
|
"react-dom": ">=18.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@seed-design/css": "1.0.
|
|
66
|
+
"@seed-design/css": "1.0.6",
|
|
67
67
|
"@types/react": "^19.2.2",
|
|
68
68
|
"@types/react-dom": "^19.2.1",
|
|
69
69
|
"@vitejs/plugin-react": "^5.0.0",
|
|
70
70
|
"ajv": "^8.17.1",
|
|
71
|
+
"csstype": "^3.1.3",
|
|
71
72
|
"globby": "^15.0.0",
|
|
72
73
|
"react": "^19.1.0",
|
|
73
74
|
"react-dom": "^19.1.0",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Box, type BoxProps } from "../Box/Box";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { article } from "@seed-design/css/recipes/article";
|
|
5
|
+
|
|
6
|
+
export interface ArticleProps extends BoxProps {}
|
|
7
|
+
|
|
8
|
+
export const Article = React.forwardRef<HTMLElement, ArticleProps>(
|
|
9
|
+
({ as = "article", className, ...props }, ref) => {
|
|
10
|
+
return (
|
|
11
|
+
<Box
|
|
12
|
+
as={as}
|
|
13
|
+
ref={ref as React.ForwardedRef<HTMLDivElement>}
|
|
14
|
+
className={clsx(article(), className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Article, type ArticleProps } from "./Article";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
|
+
import { tagGroup, type TagGroupVariantProps } from "@seed-design/css/recipes/tag-group";
|
|
3
|
+
import {
|
|
4
|
+
tagGroupItem,
|
|
5
|
+
type TagGroupItemVariantProps,
|
|
6
|
+
} from "@seed-design/css/recipes/tag-group-item";
|
|
7
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
8
|
+
import { forwardRef, Children } from "react";
|
|
9
|
+
import clsx from "clsx";
|
|
10
|
+
import { splitMultipleVariantsProps } from "../../utils/splitMultipleVariantsProps";
|
|
11
|
+
import { mergeProps } from "@seed-design/dom-utils";
|
|
12
|
+
|
|
13
|
+
const { PropsProvider, useProps } = createRecipeContext(tagGroupItem);
|
|
14
|
+
|
|
15
|
+
export interface TagGroupRootProps
|
|
16
|
+
extends TagGroupVariantProps,
|
|
17
|
+
TagGroupItemVariantProps,
|
|
18
|
+
PrimitiveProps,
|
|
19
|
+
React.HTMLAttributes<HTMLSpanElement> {
|
|
20
|
+
separator?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const TagGroupRoot = forwardRef<HTMLSpanElement, TagGroupRootProps>(
|
|
24
|
+
({ className, children, separator = " · ", ...props }, ref) => {
|
|
25
|
+
const [{ tagGroup: tagGroupVariantProps, tagGroupItem: tagGroupItemVariantProps }, otherProps] =
|
|
26
|
+
splitMultipleVariantsProps(props, { tagGroup, tagGroupItem });
|
|
27
|
+
const classNames = tagGroup(tagGroupVariantProps);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<PropsProvider value={tagGroupItemVariantProps}>
|
|
31
|
+
<Primitive.span ref={ref} className={clsx(classNames.root, className)} {...otherProps}>
|
|
32
|
+
{Children.map(children, (child, index) => (
|
|
33
|
+
<>
|
|
34
|
+
{index > 0 && (
|
|
35
|
+
<Primitive.span aria-hidden className={classNames.separator}>
|
|
36
|
+
{separator}
|
|
37
|
+
</Primitive.span>
|
|
38
|
+
)}
|
|
39
|
+
{child}
|
|
40
|
+
</>
|
|
41
|
+
))}
|
|
42
|
+
</Primitive.span>
|
|
43
|
+
</PropsProvider>
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export interface TagGroupItemProps
|
|
49
|
+
extends TagGroupItemVariantProps,
|
|
50
|
+
PrimitiveProps,
|
|
51
|
+
React.HTMLAttributes<HTMLSpanElement> {}
|
|
52
|
+
|
|
53
|
+
export const TagGroupItem = forwardRef<HTMLSpanElement, TagGroupItemProps>((props, ref) => {
|
|
54
|
+
const parentVariantProps = useProps();
|
|
55
|
+
|
|
56
|
+
const [variantProps, { className, ...otherProps }] = tagGroupItem.splitVariantProps(props);
|
|
57
|
+
const recipeClassName = tagGroupItem(mergeProps(parentVariantProps, variantProps));
|
|
58
|
+
|
|
59
|
+
return <Primitive.span ref={ref} className={clsx(recipeClassName, className)} {...otherProps} />;
|
|
60
|
+
});
|
|
@@ -10,13 +10,14 @@ import {
|
|
|
10
10
|
import clsx from "clsx";
|
|
11
11
|
import type * as React from "react";
|
|
12
12
|
import { forwardRef, useMemo } from "react";
|
|
13
|
+
import type * as CSS from "csstype";
|
|
13
14
|
|
|
14
15
|
function handleColor(color: string | undefined) {
|
|
15
16
|
if (!color) {
|
|
16
17
|
return undefined;
|
|
17
18
|
}
|
|
18
19
|
const [type, value] = color.split(".");
|
|
19
|
-
// @ts-
|
|
20
|
+
// @ts-expect-error
|
|
20
21
|
return vars.$color[type]?.[value] ?? color;
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -24,7 +25,7 @@ function handleFontWeight(fontWeight: string | undefined) {
|
|
|
24
25
|
if (!fontWeight) {
|
|
25
26
|
return undefined;
|
|
26
27
|
}
|
|
27
|
-
// @ts-
|
|
28
|
+
// @ts-expect-error
|
|
28
29
|
return vars.$fontWeight[fontWeight] ?? undefined;
|
|
29
30
|
}
|
|
30
31
|
|
|
@@ -32,7 +33,7 @@ function handleFontSize(size: string | undefined) {
|
|
|
32
33
|
if (!size) {
|
|
33
34
|
return undefined;
|
|
34
35
|
}
|
|
35
|
-
// @ts-
|
|
36
|
+
// @ts-expect-error
|
|
36
37
|
return vars.$fontSize[size] ?? size;
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -40,7 +41,7 @@ function handleLineHeight(lineHeight: string | undefined) {
|
|
|
40
41
|
if (!lineHeight) {
|
|
41
42
|
return undefined;
|
|
42
43
|
}
|
|
43
|
-
// @ts-
|
|
44
|
+
// @ts-expect-error
|
|
44
45
|
return vars.$lineHeight[lineHeight] ?? lineHeight;
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -81,7 +82,20 @@ export interface TextProps
|
|
|
81
82
|
/**
|
|
82
83
|
* The alignment of the text.
|
|
83
84
|
*/
|
|
84
|
-
align?: "left" | "center" | "right"
|
|
85
|
+
align?: Extract<CSS.Property.TextAlign, "left" | "center" | "right">;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The user-select behavior of the text.
|
|
89
|
+
*/
|
|
90
|
+
userSelect?: Extract<CSS.Property.UserSelect, "none" | "text" | "auto">;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The white-space behavior of the text.
|
|
94
|
+
*/
|
|
95
|
+
whiteSpace?: Extract<
|
|
96
|
+
CSS.Property.WhiteSpace,
|
|
97
|
+
"normal" | "nowrap" | "pre" | "pre-wrap" | "pre-line" | "break-spaces"
|
|
98
|
+
>;
|
|
85
99
|
}
|
|
86
100
|
|
|
87
101
|
function mapMaxLines(maxLines: number | undefined): "none" | "single" | "multi" {
|
|
@@ -105,6 +119,9 @@ export const Text = forwardRef<HTMLSpanElement, TextProps>(
|
|
|
105
119
|
fontWeight,
|
|
106
120
|
maxLines,
|
|
107
121
|
textDecorationLine,
|
|
122
|
+
align,
|
|
123
|
+
userSelect,
|
|
124
|
+
whiteSpace,
|
|
108
125
|
children,
|
|
109
126
|
className,
|
|
110
127
|
style,
|
|
@@ -125,7 +142,7 @@ export const Text = forwardRef<HTMLSpanElement, TextProps>(
|
|
|
125
142
|
|
|
126
143
|
return (
|
|
127
144
|
<Comp
|
|
128
|
-
// @ts-
|
|
145
|
+
// @ts-expect-error: We might need overloading for ref types, not a big deal for now.
|
|
129
146
|
ref={ref}
|
|
130
147
|
className={clsx(textClassName, className)}
|
|
131
148
|
style={
|
|
@@ -135,7 +152,9 @@ export const Text = forwardRef<HTMLSpanElement, TextProps>(
|
|
|
135
152
|
"--seed-font-size": handleFontSize(fontSize),
|
|
136
153
|
"--seed-line-height": handleLineHeight(lineHeight ?? fontSize),
|
|
137
154
|
"--seed-font-weight": handleFontWeight(fontWeight),
|
|
138
|
-
"--seed-text-align":
|
|
155
|
+
"--seed-text-align": align,
|
|
156
|
+
"--seed-user-select": userSelect,
|
|
157
|
+
"--seed-white-space": whiteSpace,
|
|
139
158
|
...style,
|
|
140
159
|
} as React.CSSProperties
|
|
141
160
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./ActionButton";
|
|
2
2
|
export * from "./ActionChip";
|
|
3
3
|
export * from "./ActionSheet";
|
|
4
|
+
export * from "./Article";
|
|
4
5
|
export * from "./Avatar";
|
|
5
6
|
export * from "./Badge";
|
|
6
7
|
export * from "./BottomSheet";
|
|
@@ -49,6 +50,7 @@ export * from "./Snackbar";
|
|
|
49
50
|
export * from "./Stack";
|
|
50
51
|
export * from "./Switch";
|
|
51
52
|
export * from "./Tabs";
|
|
53
|
+
export * from "./TagGroup";
|
|
52
54
|
export * from "./Text";
|
|
53
55
|
export * from "./TextField";
|
|
54
56
|
export * from "./ToggleButton";
|