@uniai-fe/uds-primitives 0.4.7 → 0.4.8

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.
@@ -5,13 +5,17 @@ import type {
5
5
  TabsTriggerProps,
6
6
  } from "@radix-ui/react-tabs";
7
7
  import type { ReactNode } from "react";
8
+ import type { SlotTextProps } from "../../slot";
8
9
 
9
- export const TAB_VARIANTS = ["line", "fill"] as const;
10
- export const TAB_SCALES = ["small", "medium", "large"] as const;
11
-
12
- export type TabVariant = (typeof TAB_VARIANTS)[number];
13
- export type TabScale = (typeof TAB_SCALES)[number];
10
+ export type TabVariant = "line" | "fill";
11
+ export type TabScale = "small" | "medium" | "large";
14
12
 
13
+ /**
14
+ * Tab Types; Root props
15
+ * @property {TabVariant} [variant] line / fill 스타일 변형
16
+ * @property {TabScale} [scale] small / medium / large 스케일
17
+ * @property {string} [color] 활성 색상(CSS 변수 포함)
18
+ */
15
19
  export interface TabRootProps extends TabsProps {
16
20
  /**
17
21
  * line / fill 스타일 토글. 기본 line.
@@ -27,6 +31,13 @@ export interface TabRootProps extends TabsProps {
27
31
  color?: string;
28
32
  }
29
33
 
34
+ /**
35
+ * Tab Types; List props
36
+ * @property {TabVariant} [variant] 루트 variant override
37
+ * @property {TabScale} [scale] 루트 scale override
38
+ * @property {string} [color] 리스트 단위 활성 색상 override
39
+ * @property {boolean} [fullWidth] true면 trigger를 균등 분배
40
+ */
30
41
  export interface TabListProps extends TabsListProps {
31
42
  /**
32
43
  * 루트와 동일한 variant를 재지정할 수 있다.
@@ -46,6 +57,10 @@ export interface TabListProps extends TabsListProps {
46
57
  fullWidth?: boolean;
47
58
  }
48
59
 
60
+ /**
61
+ * Tab Types; Trigger props
62
+ * @property {React.ReactNode} [icon] 라벨 앞에 표시할 아이콘
63
+ */
49
64
  export interface TabTriggerProps extends TabsTriggerProps {
50
65
  /**
51
66
  * label 앞에 표시할 아이콘.
@@ -53,4 +68,12 @@ export interface TabTriggerProps extends TabsTriggerProps {
53
68
  icon?: ReactNode;
54
69
  }
55
70
 
56
- export type TabContentProps = TabsContentProps;
71
+ /**
72
+ * Tab Types; Content props
73
+ */
74
+ export interface TabContentProps extends TabsContentProps {}
75
+
76
+ /**
77
+ * Tab Types; Label props
78
+ */
79
+ export type TabLabelProps = SlotTextProps;
@@ -5,16 +5,11 @@ interface TabContextValue {
5
5
  variant: TabVariant;
6
6
  color: string;
7
7
  scale: TabScale;
8
- setSharedConfig?: (
9
- nextVariant: TabVariant,
10
- nextColor: string,
11
- nextScale: TabScale,
12
- ) => void;
13
8
  }
14
9
 
15
10
  const DEFAULT_TAB_CONTEXT_VALUE: TabContextValue = {
16
11
  variant: "line",
17
- color: "var(--tab-color-active-default, #1a6aff)",
12
+ color: "var(--tab-color-active-default)",
18
13
  scale: "medium",
19
14
  };
20
15
 
@@ -1,4 +0,0 @@
1
- /**
2
- * TODO(badge): 접근성/상태 계산 hook을 정의한다.
3
- */
4
- export {};
File without changes
@@ -1,21 +0,0 @@
1
- import clsx from "clsx";
2
- import type { BadgeClassNameOptions } from "../types";
3
-
4
- const BADGE_CLASSNAME = "badge";
5
-
6
- /**
7
- * Badge 데이터 축을 className 구조로 묶어서 Story/override 시 일관되게 쓴다.
8
- */
9
- const composeBadgeClassName = ({
10
- size,
11
- style,
12
- className,
13
- }: BadgeClassNameOptions) =>
14
- clsx(
15
- BADGE_CLASSNAME,
16
- `${BADGE_CLASSNAME}--size-${size}`,
17
- `${BADGE_CLASSNAME}--style-${style}`,
18
- className,
19
- );
20
-
21
- export { BADGE_CLASSNAME, composeBadgeClassName };
@@ -1,4 +0,0 @@
1
- /**
2
- * TODO(tab-menu): 접근성/상태 계산 hook을 정의한다.
3
- */
4
- export {};