@uniai-fe/uds-primitives 0.4.6 → 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.
- package/dist/styles.css +251 -139
- package/package.json +1 -1
- package/src/components/badge/index.tsx +1 -3
- package/src/components/badge/markup/Badge.tsx +26 -15
- package/src/components/badge/styles/badge.scss +244 -0
- package/src/components/badge/styles/index.scss +2 -187
- package/src/components/badge/styles/variables.scss +41 -0
- package/src/components/badge/types/index.ts +3 -77
- package/src/components/badge/types/options.ts +25 -0
- package/src/components/badge/types/props.ts +53 -0
- package/src/components/select/styles/select.scss +1 -1
- package/src/components/tab/index.tsx +1 -2
- package/src/components/tab/markup/Label.tsx +22 -0
- package/src/components/tab/markup/TabList.tsx +27 -29
- package/src/components/tab/markup/TabRoot.tsx +16 -71
- package/src/components/tab/markup/TabTrigger.tsx +2 -15
- package/src/components/tab/styles/index.scss +2 -198
- package/src/components/tab/styles/tab.scss +190 -0
- package/src/components/tab/styles/variables.scss +39 -0
- package/src/components/tab/types/index.ts +29 -6
- package/src/components/tab/utils/tab-context.ts +1 -6
- package/src/components/badge/hooks/index.ts +0 -4
- package/src/components/badge/img/.gitkeep +0 -0
- package/src/components/badge/utils/index.ts +0 -21
- package/src/components/tab/hooks/index.ts +0 -4
|
@@ -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
|
|
10
|
-
export
|
|
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
|
-
|
|
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
|
|
12
|
+
color: "var(--tab-color-active-default)",
|
|
18
13
|
scale: "medium",
|
|
19
14
|
};
|
|
20
15
|
|
|
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 };
|