@seed-design/react 0.0.30 → 0.0.32

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.
@@ -7,6 +7,7 @@ const jsxRuntime = require('react/jsx-runtime');
7
7
  const clsx = require('clsx');
8
8
  const React = require('react');
9
9
  const styled = require('../../utils/styled.cjs');
10
+ const reactSlot = require('@radix-ui/react-slot');
10
11
 
11
12
  function _interopNamespaceDefault(e) {
12
13
  const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
@@ -29,7 +30,10 @@ const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
29
30
 
30
31
  const Box = React__namespace.forwardRef((props, ref) => {
31
32
  const { style, restProps } = styled.useStyleProps(props);
32
- const { as: Comp = "div", className, ...nativeProps } = restProps;
33
+ const { as: Comp = "div", asChild = false, className, ...nativeProps } = restProps;
34
+ if (asChild) {
35
+ return /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ref, className: clsx("seed-box", className), style, ...nativeProps });
36
+ }
33
37
  return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ref, className: clsx("seed-box", className), style, ...nativeProps });
34
38
  });
35
39
 
@@ -2,6 +2,7 @@ import { StyleProps } from '../../utils/styled';
2
2
  import * as React from "react";
3
3
  export interface BoxProps extends StyleProps, Omit<React.HTMLAttributes<HTMLDivElement>, "color"> {
4
4
  as?: React.ElementType;
5
+ asChild?: boolean;
5
6
  }
6
7
  export declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<HTMLDivElement>>;
7
8
  //# sourceMappingURL=Box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,WAAW,QAAS,SAAQ,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC/F,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACxB;AAED,eAAO,MAAM,GAAG,iFAKd,CAAC"}
1
+ {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGpE,MAAM,WAAW,QAAS,SAAQ,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC/F,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAEvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,GAAG,iFAWd,CAAC"}
@@ -3,10 +3,14 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import clsx from 'clsx';
4
4
  import * as React from 'react';
5
5
  import { useStyleProps } from '../../utils/styled.js';
6
+ import { Slot } from '@radix-ui/react-slot';
6
7
 
7
8
  const Box = React.forwardRef((props, ref) => {
8
9
  const { style, restProps } = useStyleProps(props);
9
- const { as: Comp = "div", className, ...nativeProps } = restProps;
10
+ const { as: Comp = "div", asChild = false, className, ...nativeProps } = restProps;
11
+ if (asChild) {
12
+ return /* @__PURE__ */ jsx(Slot, { ref, className: clsx("seed-box", className), style, ...nativeProps });
13
+ }
10
14
  return /* @__PURE__ */ jsx(Comp, { ref, className: clsx("seed-box", className), style, ...nativeProps });
11
15
  });
12
16
 
@@ -14,7 +14,7 @@ export declare const IconRequired: ({ children, enabled, }: {
14
14
  }) => import("react/jsx-runtime").JSX.Element;
15
15
  export interface IconProps {
16
16
  svg: React.ReactNode;
17
- size?: Dimension | string;
17
+ size?: Dimension | (string & {});
18
18
  color?: ScopedColorFg | ScopedColorPalette;
19
19
  }
20
20
  export declare const Icon: ForwardRefExoticComponent<IconProps & RefAttributes<SVGSVGElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI1F,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,2GAatB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,2GAatB,CAAC;AAIF,eAAO,MAAM,YAAY,GAAI,wBAG1B;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,4CAsDjD,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;IAErB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAE1B,KAAK,CAAC,EAAE,aAAa,GAAG,kBAAkB,CAAC;CAC5C;AAED,eAAO,MAAM,IAAI,qGA+BhB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAC9C,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAC1D,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,OAAO,oHAe/D"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI1F,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,2GAatB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,2GAatB,CAAC;AAIF,eAAO,MAAM,YAAY,GAAI,wBAG1B;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,4CAsDjD,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;IAErB,IAAI,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAEjC,KAAK,CAAC,EAAE,aAAa,GAAG,kBAAkB,CAAC;CAC5C;AAED,eAAO,MAAM,IAAI,qGA+BhB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAC9C,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAC1D,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,OAAO,oHAe/D"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const Tabs = require('./Tabs.cjs');
6
+ const reactTabs = require('@seed-design/react-tabs');
6
7
 
7
8
 
8
9
 
@@ -13,3 +14,7 @@ exports.Indicator = Tabs.TabsIndicator;
13
14
  exports.List = Tabs.TabsList;
14
15
  exports.Root = Tabs.TabsRoot;
15
16
  exports.Trigger = Tabs.TabsTrigger;
17
+ Object.defineProperty(exports, "carouselPreventDrag", {
18
+ enumerable: true,
19
+ get: () => reactTabs.tabsCarouselPreventDrag
20
+ });
@@ -1,2 +1,3 @@
1
1
  export { TabsContent as Content, TabsIndicator as Indicator, TabsList as List, TabsRoot as Root, TabsCarouselCamera as CarouselCamera, TabsCarousel as Carousel, TabsTrigger as Trigger, type TabsContentProps as ContentProps, type TabsIndicatorProps as IndicatorProps, type TabsListProps as ListProps, type TabsRootProps as RootProps, type TabsCarouselCameraProps as CarouselCameraProps, type TabsCarouselProps as CarouselProps, type TabsTriggerProps as TriggerProps, } from './Tabs';
2
+ export { tabsCarouselPreventDrag as carouselPreventDrag } from '@seed-design/react-tabs';
2
3
  //# sourceMappingURL=Tabs.namespace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,OAAO,EACtB,aAAa,IAAI,SAAS,EAC1B,QAAQ,IAAI,IAAI,EAChB,QAAQ,IAAI,IAAI,EAChB,kBAAkB,IAAI,cAAc,EACpC,YAAY,IAAI,QAAQ,EACxB,WAAW,IAAI,OAAO,EACtB,KAAK,gBAAgB,IAAI,YAAY,EACrC,KAAK,kBAAkB,IAAI,cAAc,EACzC,KAAK,aAAa,IAAI,SAAS,EAC/B,KAAK,aAAa,IAAI,SAAS,EAC/B,KAAK,uBAAuB,IAAI,mBAAmB,EACnD,KAAK,iBAAiB,IAAI,aAAa,EACvC,KAAK,gBAAgB,IAAI,YAAY,GACtC,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"Tabs.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,OAAO,EACtB,aAAa,IAAI,SAAS,EAC1B,QAAQ,IAAI,IAAI,EAChB,QAAQ,IAAI,IAAI,EAChB,kBAAkB,IAAI,cAAc,EACpC,YAAY,IAAI,QAAQ,EACxB,WAAW,IAAI,OAAO,EACtB,KAAK,gBAAgB,IAAI,YAAY,EACrC,KAAK,kBAAkB,IAAI,cAAc,EACzC,KAAK,aAAa,IAAI,SAAS,EAC/B,KAAK,aAAa,IAAI,SAAS,EAC/B,KAAK,uBAAuB,IAAI,mBAAmB,EACnD,KAAK,iBAAiB,IAAI,aAAa,EACvC,KAAK,gBAAgB,IAAI,YAAY,GACtC,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,uBAAuB,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1 +1,2 @@
1
1
  export { TabsCarousel as Carousel, TabsCarouselCamera as CarouselCamera, TabsContent as Content, TabsIndicator as Indicator, TabsList as List, TabsRoot as Root, TabsTrigger as Trigger } from './Tabs.js';
2
+ export { tabsCarouselPreventDrag as carouselPreventDrag } from '@seed-design/react-tabs';
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const Tabs = require('./Tabs.cjs');
6
+ const reactTabs = require('@seed-design/react-tabs');
6
7
  const Tabs_namespace = require('./Tabs.namespace.cjs');
7
8
 
8
9
 
@@ -14,4 +15,8 @@ exports.TabsIndicator = Tabs.TabsIndicator;
14
15
  exports.TabsList = Tabs.TabsList;
15
16
  exports.TabsRoot = Tabs.TabsRoot;
16
17
  exports.TabsTrigger = Tabs.TabsTrigger;
18
+ Object.defineProperty(exports, "tabsCarouselPreventDrag", {
19
+ enumerable: true,
20
+ get: () => reactTabs.tabsCarouselPreventDrag
21
+ });
17
22
  exports.Tabs = Tabs_namespace;
@@ -1,3 +1,4 @@
1
1
  export { TabsContent, TabsIndicator, TabsList, TabsRoot, TabsCarouselCamera, TabsCarousel, TabsTrigger, type TabsContentProps, type TabsIndicatorProps, type TabsListProps, type TabsRootProps, type TabsCarouselCameraProps, type TabsCarouselProps, type TabsTriggerProps, } from './Tabs';
2
+ export { tabsCarouselPreventDrag } from '@seed-design/react-tabs';
2
3
  export * as Tabs from './Tabs.namespace';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger } from './Tabs.js';
2
+ export { tabsCarouselPreventDrag } from '@seed-design/react-tabs';
2
3
  import * as Tabs_namespace from './Tabs.namespace.js';
3
4
  export { Tabs_namespace as Tabs };
@@ -43,44 +43,48 @@ function mapMaxLines(maxLines) {
43
43
  }
44
44
  return "multi";
45
45
  }
46
- const Text = ({
47
- as,
48
- color,
49
- textStyle,
50
- fontSize,
51
- lineHeight,
52
- fontWeight,
53
- maxLines,
54
- children,
55
- className,
56
- style,
57
- ...otherProps
58
- }) => {
59
- const Comp = as || "span";
60
- const textClassName = React.useMemo(
61
- () => text.text({
62
- textStyle,
63
- maxLines: mapMaxLines(maxLines)
64
- }),
65
- [textStyle, maxLines]
66
- );
67
- return /* @__PURE__ */ jsxRuntime.jsx(
68
- Comp,
69
- {
70
- className: clsx(textClassName, className),
71
- style: {
72
- "--seed-max-lines": maxLines,
73
- "--seed-text-color": handleColor(color),
74
- "--seed-font-size": handleFontSize(fontSize),
75
- "--seed-line-height": handleLineHeight(lineHeight ?? fontSize),
76
- "--seed-font-weight": handleFontWeight(fontWeight),
77
- "--seed-text-align": otherProps.align,
78
- ...style
79
- },
80
- ...otherProps,
81
- children
82
- }
83
- );
84
- };
46
+ const Text = React.forwardRef(
47
+ ({
48
+ as,
49
+ color,
50
+ textStyle,
51
+ fontSize,
52
+ lineHeight,
53
+ fontWeight,
54
+ maxLines,
55
+ children,
56
+ className,
57
+ style,
58
+ ...otherProps
59
+ }, ref) => {
60
+ const Comp = as || "span";
61
+ const textClassName = React.useMemo(
62
+ () => text.text({
63
+ textStyle,
64
+ maxLines: mapMaxLines(maxLines)
65
+ }),
66
+ [textStyle, maxLines]
67
+ );
68
+ return /* @__PURE__ */ jsxRuntime.jsx(
69
+ Comp,
70
+ {
71
+ ref,
72
+ className: clsx(textClassName, className),
73
+ style: {
74
+ "--seed-max-lines": maxLines,
75
+ "--seed-text-color": handleColor(color),
76
+ "--seed-font-size": handleFontSize(fontSize),
77
+ "--seed-line-height": handleLineHeight(lineHeight ?? fontSize),
78
+ "--seed-font-weight": handleFontWeight(fontWeight),
79
+ "--seed-text-align": otherProps.align,
80
+ ...style
81
+ },
82
+ ...otherProps,
83
+ children
84
+ }
85
+ );
86
+ }
87
+ );
88
+ Text.displayName = "Text";
85
89
 
86
90
  exports.Text = Text;
@@ -32,5 +32,5 @@ export interface TextProps extends Omit<TextVariantProps, "maxLines">, React.HTM
32
32
  */
33
33
  align?: "left" | "center" | "right";
34
34
  }
35
- export declare const Text: ({ as, color, textStyle, fontSize, lineHeight, fontWeight, maxLines, children, className, style, ...otherProps }: TextProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>>;
36
36
  //# 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;AAoCpC,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EACxC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACvC;;;OAGG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAEhG;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,GAAG,kBAAkB,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AAYD,eAAO,MAAM,IAAI,GAAI,iHAYlB,SAAS,4CA8BX,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;AAoCpC,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EACxC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACvC;;;OAGG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAEhG;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,GAAG,kBAAkB,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AAYD,eAAO,MAAM,IAAI,mFAiDhB,CAAC"}
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { text } from '@seed-design/css/recipes/text';
4
4
  import { vars } from '@seed-design/css/vars';
5
5
  import clsx from 'clsx';
6
- import { useMemo } from 'react';
6
+ import { forwardRef, useMemo } from 'react';
7
7
 
8
8
  function handleColor(color) {
9
9
  if (!color) {
@@ -39,44 +39,48 @@ function mapMaxLines(maxLines) {
39
39
  }
40
40
  return "multi";
41
41
  }
42
- const Text = ({
43
- as,
44
- color,
45
- textStyle,
46
- fontSize,
47
- lineHeight,
48
- fontWeight,
49
- maxLines,
50
- children,
51
- className,
52
- style,
53
- ...otherProps
54
- }) => {
55
- const Comp = as || "span";
56
- const textClassName = useMemo(
57
- () => text({
58
- textStyle,
59
- maxLines: mapMaxLines(maxLines)
60
- }),
61
- [textStyle, maxLines]
62
- );
63
- return /* @__PURE__ */ jsx(
64
- Comp,
65
- {
66
- className: clsx(textClassName, className),
67
- style: {
68
- "--seed-max-lines": maxLines,
69
- "--seed-text-color": handleColor(color),
70
- "--seed-font-size": handleFontSize(fontSize),
71
- "--seed-line-height": handleLineHeight(lineHeight ?? fontSize),
72
- "--seed-font-weight": handleFontWeight(fontWeight),
73
- "--seed-text-align": otherProps.align,
74
- ...style
75
- },
76
- ...otherProps,
77
- children
78
- }
79
- );
80
- };
42
+ const Text = forwardRef(
43
+ ({
44
+ as,
45
+ color,
46
+ textStyle,
47
+ fontSize,
48
+ lineHeight,
49
+ fontWeight,
50
+ maxLines,
51
+ children,
52
+ className,
53
+ style,
54
+ ...otherProps
55
+ }, ref) => {
56
+ const Comp = as || "span";
57
+ const textClassName = useMemo(
58
+ () => text({
59
+ textStyle,
60
+ maxLines: mapMaxLines(maxLines)
61
+ }),
62
+ [textStyle, maxLines]
63
+ );
64
+ return /* @__PURE__ */ jsx(
65
+ Comp,
66
+ {
67
+ ref,
68
+ className: clsx(textClassName, className),
69
+ style: {
70
+ "--seed-max-lines": maxLines,
71
+ "--seed-text-color": handleColor(color),
72
+ "--seed-font-size": handleFontSize(fontSize),
73
+ "--seed-line-height": handleLineHeight(lineHeight ?? fontSize),
74
+ "--seed-font-weight": handleFontWeight(fontWeight),
75
+ "--seed-text-align": otherProps.align,
76
+ ...style
77
+ },
78
+ ...otherProps,
79
+ children
80
+ }
81
+ );
82
+ }
83
+ );
84
+ Text.displayName = "Text";
81
85
 
82
86
  export { Text };
@@ -71,6 +71,7 @@ const Stack = require('./Stack/Stack.cjs');
71
71
  const Switch = require('./Switch/Switch.cjs');
72
72
  const Switch_namespace = require('./Switch/Switch.namespace.cjs');
73
73
  const Tabs = require('./Tabs/Tabs.cjs');
74
+ const reactTabs = require('@seed-design/react-tabs');
74
75
  const Tabs_namespace = require('./Tabs/Tabs.namespace.cjs');
75
76
  const Text = require('./Text/Text.cjs');
76
77
  const TextField = require('./TextField/TextField.cjs');
@@ -275,6 +276,10 @@ exports.TabsIndicator = Tabs.TabsIndicator;
275
276
  exports.TabsList = Tabs.TabsList;
276
277
  exports.TabsRoot = Tabs.TabsRoot;
277
278
  exports.TabsTrigger = Tabs.TabsTrigger;
279
+ Object.defineProperty(exports, "tabsCarouselPreventDrag", {
280
+ enumerable: true,
281
+ get: () => reactTabs.tabsCarouselPreventDrag
282
+ });
278
283
  exports.Tabs = Tabs_namespace;
279
284
  exports.Text = Text.Text;
280
285
  exports.TextFieldCharacterCount = TextField.TextFieldCharacterCount;
@@ -86,6 +86,7 @@ export { SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchThumb
86
86
  import * as Switch_namespace from './Switch/Switch.namespace.js';
87
87
  export { Switch_namespace as Switch };
88
88
  export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger } from './Tabs/Tabs.js';
89
+ export { tabsCarouselPreventDrag } from '@seed-design/react-tabs';
89
90
  import * as Tabs_namespace from './Tabs/Tabs.namespace.js';
90
91
  export { Tabs_namespace as Tabs };
91
92
  export { Text } from './Text/Text.js';
package/lib/index.cjs CHANGED
@@ -71,6 +71,7 @@ const Stack = require('./components/Stack/Stack.cjs');
71
71
  const Switch = require('./components/Switch/Switch.cjs');
72
72
  const Switch_namespace = require('./components/Switch/Switch.namespace.cjs');
73
73
  const Tabs = require('./components/Tabs/Tabs.cjs');
74
+ const reactTabs = require('@seed-design/react-tabs');
74
75
  const Tabs_namespace = require('./components/Tabs/Tabs.namespace.cjs');
75
76
  const Text = require('./components/Text/Text.cjs');
76
77
  const TextField = require('./components/TextField/TextField.cjs');
@@ -275,6 +276,10 @@ exports.TabsIndicator = Tabs.TabsIndicator;
275
276
  exports.TabsList = Tabs.TabsList;
276
277
  exports.TabsRoot = Tabs.TabsRoot;
277
278
  exports.TabsTrigger = Tabs.TabsTrigger;
279
+ Object.defineProperty(exports, "tabsCarouselPreventDrag", {
280
+ enumerable: true,
281
+ get: () => reactTabs.tabsCarouselPreventDrag
282
+ });
278
283
  exports.Tabs = Tabs_namespace;
279
284
  exports.Text = Text.Text;
280
285
  exports.TextFieldCharacterCount = TextField.TextFieldCharacterCount;
package/lib/index.js CHANGED
@@ -86,6 +86,7 @@ export { SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchThumb
86
86
  import * as Switch_namespace from './components/Switch/Switch.namespace.js';
87
87
  export { Switch_namespace as Switch };
88
88
  export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger } from './components/Tabs/Tabs.js';
89
+ export { tabsCarouselPreventDrag } from '@seed-design/react-tabs';
89
90
  import * as Tabs_namespace from './components/Tabs/Tabs.namespace.js';
90
91
  export { Tabs_namespace as Tabs };
91
92
  export { Text } from './components/Text/Text.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-design/react",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/daangn/seed-design.git",
@@ -51,18 +51,18 @@
51
51
  "@seed-design/react-segmented-control": "0.0.5",
52
52
  "@seed-design/react-snackbar": "0.0.5",
53
53
  "@seed-design/react-switch": "0.0.4",
54
- "@seed-design/react-tabs": "0.0.7",
54
+ "@seed-design/react-tabs": "0.0.8",
55
55
  "@seed-design/react-text-field": "0.0.4",
56
56
  "@seed-design/react-toggle": "0.0.4",
57
57
  "clsx": "^2.1.1"
58
58
  },
59
59
  "peerDependencies": {
60
- "@seed-design/css": "0.0.30",
60
+ "@seed-design/css": "0.0.31",
61
61
  "react": ">=18.0.0",
62
62
  "react-dom": ">=18.0.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@seed-design/css": "0.0.30",
65
+ "@seed-design/css": "0.0.31",
66
66
  "@vitejs/plugin-react": "^4.4.1",
67
67
  "globby": "^14.1.0",
68
68
  "react": "^19.1.0",
@@ -1,14 +1,23 @@
1
1
  import clsx from "clsx";
2
2
  import * as React from "react";
3
3
  import { useStyleProps, type StyleProps } from "../../utils/styled";
4
+ import { Slot } from "@radix-ui/react-slot";
4
5
 
5
6
  export interface BoxProps extends StyleProps, Omit<React.HTMLAttributes<HTMLDivElement>, "color"> {
6
7
  as?: React.ElementType;
8
+
9
+ asChild?: boolean;
7
10
  }
8
11
 
9
12
  export const Box = React.forwardRef<HTMLDivElement, BoxProps>((props, ref) => {
10
13
  const { style, restProps } = useStyleProps(props);
11
- const { as: Comp = "div", className, ...nativeProps } = restProps;
14
+ const { as: Comp = "div", asChild = false, className, ...nativeProps } = restProps;
15
+
16
+ if (asChild) {
17
+ return (
18
+ <Slot ref={ref} className={clsx("seed-box", className)} style={style} {...nativeProps} />
19
+ );
20
+ }
12
21
 
13
22
  return <Comp ref={ref} className={clsx("seed-box", className)} style={style} {...nativeProps} />;
14
23
  });
@@ -106,7 +106,7 @@ export const IconRequired = ({
106
106
  export interface IconProps {
107
107
  svg: React.ReactNode;
108
108
 
109
- size?: Dimension | string;
109
+ size?: Dimension | (string & {});
110
110
 
111
111
  color?: ScopedColorFg | ScopedColorPalette;
112
112
  }
@@ -14,3 +14,5 @@ export {
14
14
  type TabsCarouselProps as CarouselProps,
15
15
  type TabsTriggerProps as TriggerProps,
16
16
  } from "./Tabs";
17
+
18
+ export { tabsCarouselPreventDrag as carouselPreventDrag } from "@seed-design/react-tabs";
@@ -15,4 +15,6 @@ export {
15
15
  type TabsTriggerProps,
16
16
  } from "./Tabs";
17
17
 
18
+ export { tabsCarouselPreventDrag } from "@seed-design/react-tabs";
19
+
18
20
  export * as Tabs from "./Tabs.namespace";
@@ -9,7 +9,7 @@ import {
9
9
  } from "@seed-design/css/vars";
10
10
  import clsx from "clsx";
11
11
  import type * as React from "react";
12
- import { useMemo } from "react";
12
+ import { forwardRef, useMemo } from "react";
13
13
 
14
14
  function handleColor(color: string | undefined) {
15
15
  if (!color) {
@@ -94,46 +94,55 @@ function mapMaxLines(maxLines: number | undefined): "none" | "single" | "multi"
94
94
  return "multi";
95
95
  }
96
96
 
97
- export const Text = ({
98
- as,
99
- color,
100
- textStyle,
101
- fontSize,
102
- lineHeight,
103
- fontWeight,
104
- maxLines,
105
- children,
106
- className,
107
- style,
108
- ...otherProps
109
- }: TextProps) => {
110
- const Comp = as || "span";
111
- const textClassName = useMemo(
112
- () =>
113
- text({
114
- textStyle,
115
- maxLines: mapMaxLines(maxLines),
116
- }),
117
- [textStyle, maxLines],
118
- );
97
+ export const Text = forwardRef<HTMLSpanElement, TextProps>(
98
+ (
99
+ {
100
+ as,
101
+ color,
102
+ textStyle,
103
+ fontSize,
104
+ lineHeight,
105
+ fontWeight,
106
+ maxLines,
107
+ children,
108
+ className,
109
+ style,
110
+ ...otherProps
111
+ },
112
+ ref,
113
+ ) => {
114
+ const Comp = as || "span";
115
+ const textClassName = useMemo(
116
+ () =>
117
+ text({
118
+ textStyle,
119
+ maxLines: mapMaxLines(maxLines),
120
+ }),
121
+ [textStyle, maxLines],
122
+ );
119
123
 
120
- return (
121
- <Comp
122
- className={clsx(textClassName, className)}
123
- style={
124
- {
125
- "--seed-max-lines": maxLines,
126
- "--seed-text-color": handleColor(color),
127
- "--seed-font-size": handleFontSize(fontSize),
128
- "--seed-line-height": handleLineHeight(lineHeight ?? fontSize),
129
- "--seed-font-weight": handleFontWeight(fontWeight),
130
- "--seed-text-align": otherProps.align,
131
- ...style,
132
- } as React.CSSProperties
133
- }
134
- {...otherProps}
135
- >
136
- {children}
137
- </Comp>
138
- );
139
- };
124
+ return (
125
+ <Comp
126
+ // @ts-ignore: We might need overloading for ref types, not a big deal for now.
127
+ ref={ref}
128
+ className={clsx(textClassName, className)}
129
+ style={
130
+ {
131
+ "--seed-max-lines": maxLines,
132
+ "--seed-text-color": handleColor(color),
133
+ "--seed-font-size": handleFontSize(fontSize),
134
+ "--seed-line-height": handleLineHeight(lineHeight ?? fontSize),
135
+ "--seed-font-weight": handleFontWeight(fontWeight),
136
+ "--seed-text-align": otherProps.align,
137
+ ...style,
138
+ } as React.CSSProperties
139
+ }
140
+ {...otherProps}
141
+ >
142
+ {children}
143
+ </Comp>
144
+ );
145
+ },
146
+ );
147
+
148
+ Text.displayName = "Text";