@uniai-fe/uds-primitives 0.3.8 → 0.3.10
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 +42 -6
- package/package.json +1 -1
- package/src/components/checkbox/styles/index.scss +4 -3
- package/src/components/form/markup/form-field/Container.tsx +2 -0
- package/src/components/form/markup/form-field/Template.tsx +1 -0
- package/src/components/form/styles/form-field/layout.scss +9 -0
- package/src/components/form/styles/form-field/variables.scss +1 -0
- package/src/components/form/types/props.ts +11 -0
- package/src/components/radio/styles/index.scss +3 -3
- package/src/components/select/markup/foundation/Base.tsx +1 -1
- package/src/components/select/styles/select.scss +31 -0
- package/src/components/select/styles/variables.scss +6 -0
- package/src/components/select/types/base.ts +3 -2
package/dist/styles.css
CHANGED
|
@@ -177,10 +177,10 @@
|
|
|
177
177
|
--theme-checkbox-frame-size-large: 24px;
|
|
178
178
|
--theme-checkbox-indicator-size-medium: 16px;
|
|
179
179
|
--theme-checkbox-indicator-size-large: 20px;
|
|
180
|
-
--theme-checkbox-control-radius-medium: var(--theme-radius-
|
|
181
|
-
--theme-checkbox-control-radius-large: var(--theme-radius-
|
|
180
|
+
--theme-checkbox-control-radius-medium: var(--theme-radius-20x20);
|
|
181
|
+
--theme-checkbox-control-radius-large: var(--theme-radius-24x24);
|
|
182
182
|
--theme-checkbox-border-width: 1.4px;
|
|
183
|
-
--theme-checkbox-border-color: var(--color-border-
|
|
183
|
+
--theme-checkbox-border-color: var(--color-border-standard-cool-gray);
|
|
184
184
|
--theme-checkbox-border-selected: var(--color-primary-default);
|
|
185
185
|
--theme-checkbox-surface: var(--color-common-100);
|
|
186
186
|
--theme-checkbox-surface-selected: var(--color-primary-default);
|
|
@@ -294,6 +294,7 @@
|
|
|
294
294
|
--form-field-helper-font-weight: 400;
|
|
295
295
|
--form-field-helper-line-height: var(--font-caption-medium-line-height);
|
|
296
296
|
--form-field-helper-color: var(--color-label-neutral);
|
|
297
|
+
--form-field-helper-error-color: var(--color-feedback-error);
|
|
297
298
|
--info-box-background-color: var(--color-blue-99);
|
|
298
299
|
--info-box-border-color: var(--color-secondary-standard);
|
|
299
300
|
--info-box-icon-color: var(--color-feedback-information);
|
|
@@ -416,11 +417,11 @@
|
|
|
416
417
|
--theme-radio-indicator-border-width: 1.4px;
|
|
417
418
|
--theme-radio-indicator-border-width-selected-medium: 4px;
|
|
418
419
|
--theme-radio-indicator-border-width-selected-large: 6px;
|
|
419
|
-
--theme-radio-border-color: var(--color-border-
|
|
420
|
+
--theme-radio-border-color: var(--color-border-standard-cool-gray);
|
|
420
421
|
--theme-radio-border-selected: var(--color-primary-default);
|
|
421
422
|
--theme-radio-surface-selected: var(--color-primary-default);
|
|
422
|
-
--theme-radio-surface-disabled: var(--color-
|
|
423
|
-
--theme-radio-border-disabled: var(--color-border-
|
|
423
|
+
--theme-radio-surface-disabled: var(--color-state-static-disabled);
|
|
424
|
+
--theme-radio-border-disabled: var(--color-border-standard-cool-gray);
|
|
424
425
|
--theme-radio-disabled-selected-fill: var(--color-primary-default);
|
|
425
426
|
--theme-radio-label-color: var(--color-label-strong);
|
|
426
427
|
--theme-radio-label-disabled: var(--color-label-disabled);
|
|
@@ -458,6 +459,7 @@
|
|
|
458
459
|
--select-table-radius: var(--input-table-radius-base);
|
|
459
460
|
--select-table-border-default-color: var(--input-border-table-default-color);
|
|
460
461
|
--select-table-border-focus-color: var(--input-border-active-color);
|
|
462
|
+
--select-table-border-error-color: var(--input-border-error-color);
|
|
461
463
|
--select-table-border-disabled-color: var(--input-border-disabled-color);
|
|
462
464
|
--select-table-border-readonly-color: var(
|
|
463
465
|
--select-table-border-disabled-color
|
|
@@ -468,6 +470,7 @@
|
|
|
468
470
|
--select-table-surface-disabled-color
|
|
469
471
|
);
|
|
470
472
|
--select-table-color-text: var(--input-text-color);
|
|
473
|
+
--select-table-color-text-error: var(--input-label-error-color);
|
|
471
474
|
--select-table-color-text-readonly: var(--select-primary-color-text-readonly);
|
|
472
475
|
--select-table-color-placeholder: var(--input-placeholder-color);
|
|
473
476
|
--select-table-icon-color-default: var(--select-icon-color-default);
|
|
@@ -507,19 +510,23 @@
|
|
|
507
510
|
--select-primary-color-surface: var(--input-surface-color);
|
|
508
511
|
--select-primary-color-text: var(--color-label-alternative);
|
|
509
512
|
--select-primary-color-text-focused: var(--color-label-strong);
|
|
513
|
+
--select-primary-color-text-error: var(--input-label-error-color);
|
|
510
514
|
--select-primary-color-text-disabled: var(--color-label-disabled);
|
|
511
515
|
--select-primary-color-text-readonly: var(--color-label-strong);
|
|
512
516
|
--select-primary-color-border: var(--input-border-color);
|
|
513
517
|
--select-primary-color-border-focused: var(--input-border-active-color);
|
|
518
|
+
--select-primary-color-border-error: var(--input-border-error-color);
|
|
514
519
|
--select-primary-color-border-disabled: var(--input-border-disabled-color);
|
|
515
520
|
--select-color-border-secondary: var(--input-border-color);
|
|
516
521
|
--select-color-border-secondary-hover: var(--input-border-active-color);
|
|
517
522
|
--select-color-border-secondary-focused: var(--input-border-active-color);
|
|
523
|
+
--select-color-border-secondary-error: var(--input-border-error-color);
|
|
518
524
|
--select-color-border-secondary-disabled: var(
|
|
519
525
|
--input-border-underline-disabled-color
|
|
520
526
|
);
|
|
521
527
|
--select-primary-color-surface-disabled: var(--input-surface-disabled-color);
|
|
522
528
|
--select-secondary-color-text: var(--color-label-standard);
|
|
529
|
+
--select-secondary-color-text-error: var(--input-label-error-color);
|
|
523
530
|
--select-secondary-color-text-disabled: var(--color-label-disabled);
|
|
524
531
|
--select-secondary-color-text-readonly: var(
|
|
525
532
|
--select-primary-color-text-readonly
|
|
@@ -2305,6 +2312,11 @@ figure.chip {
|
|
|
2305
2312
|
color: var(--form-field-helper-color);
|
|
2306
2313
|
}
|
|
2307
2314
|
|
|
2315
|
+
.form-field-container[data-state=error] .form-field-footer p,
|
|
2316
|
+
.form-field-container[data-state=error] .form-field-footer span {
|
|
2317
|
+
color: var(--form-field-helper-error-color);
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2308
2320
|
|
|
2309
2321
|
|
|
2310
2322
|
.info-box {
|
|
@@ -3684,6 +3696,21 @@ figure.chip {
|
|
|
3684
3696
|
border-width: var(--select-primary-border-width-focus);
|
|
3685
3697
|
--select-icon-fill: var(--select-table-icon-color-focused);
|
|
3686
3698
|
}
|
|
3699
|
+
.select-button:not([data-priority=secondary])[data-state=error] {
|
|
3700
|
+
border-color: var(--select-primary-color-border-error);
|
|
3701
|
+
--select-icon-fill: var(--select-icon-color-default);
|
|
3702
|
+
}
|
|
3703
|
+
.select-button[data-priority=secondary][data-state=error] {
|
|
3704
|
+
color: var(--select-secondary-color-text-error);
|
|
3705
|
+
}
|
|
3706
|
+
.select-button[data-priority=secondary][data-state=error]::after {
|
|
3707
|
+
height: var(--select-secondary-underline-width-focus);
|
|
3708
|
+
background-color: var(--select-color-border-secondary-error);
|
|
3709
|
+
}
|
|
3710
|
+
.select-button[data-priority=table][data-state=error] {
|
|
3711
|
+
border-color: var(--select-table-border-error-color);
|
|
3712
|
+
--select-icon-fill: var(--select-table-icon-color-default);
|
|
3713
|
+
}
|
|
3687
3714
|
.select-button:not([data-priority=secondary])[data-readonly=true] {
|
|
3688
3715
|
border-color: var(--select-primary-color-border-disabled);
|
|
3689
3716
|
background-color: var(--select-primary-color-surface-disabled);
|
|
@@ -3759,6 +3786,9 @@ figure.chip {
|
|
|
3759
3786
|
.select-button[data-state=focused] .select-label, .select-button[data-open=true] .select-label {
|
|
3760
3787
|
color: var(--select-primary-color-text-focused);
|
|
3761
3788
|
}
|
|
3789
|
+
.select-button[data-state=error] .select-label {
|
|
3790
|
+
color: var(--select-primary-color-text-error);
|
|
3791
|
+
}
|
|
3762
3792
|
.select-button[data-state=disabled] .select-label {
|
|
3763
3793
|
color: var(--select-primary-color-text-disabled);
|
|
3764
3794
|
}
|
|
@@ -3768,9 +3798,15 @@ figure.chip {
|
|
|
3768
3798
|
.select-button[data-priority=secondary][data-state=disabled] .select-label {
|
|
3769
3799
|
color: var(--select-secondary-color-text-disabled);
|
|
3770
3800
|
}
|
|
3801
|
+
.select-button[data-priority=secondary][data-state=error] .select-label {
|
|
3802
|
+
color: var(--select-secondary-color-text-error);
|
|
3803
|
+
}
|
|
3771
3804
|
.select-button[data-priority=secondary][data-readonly=true] .select-label {
|
|
3772
3805
|
color: var(--select-secondary-color-text-readonly);
|
|
3773
3806
|
}
|
|
3807
|
+
.select-button[data-priority=table][data-state=error] .select-label {
|
|
3808
|
+
color: var(--select-table-color-text-error);
|
|
3809
|
+
}
|
|
3774
3810
|
|
|
3775
3811
|
.select-label-placeholder {
|
|
3776
3812
|
color: var(--select-primary-color-placeholder);
|
package/package.json
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
--theme-checkbox-frame-size-large: 24px;
|
|
4
4
|
--theme-checkbox-indicator-size-medium: 16px;
|
|
5
5
|
--theme-checkbox-indicator-size-large: 20px;
|
|
6
|
-
|
|
7
|
-
--theme-checkbox-control-radius-
|
|
6
|
+
// 변경: foundation에 존재하는 radius 토큰으로 정렬하고 fallback 값을 제거한다.
|
|
7
|
+
--theme-checkbox-control-radius-medium: var(--theme-radius-20x20);
|
|
8
|
+
--theme-checkbox-control-radius-large: var(--theme-radius-24x24);
|
|
8
9
|
--theme-checkbox-border-width: 1.4px;
|
|
9
|
-
--theme-checkbox-border-color: var(--color-border-
|
|
10
|
+
--theme-checkbox-border-color: var(--color-border-standard-cool-gray);
|
|
10
11
|
--theme-checkbox-border-selected: var(--color-primary-default);
|
|
11
12
|
--theme-checkbox-surface: var(--color-common-100);
|
|
12
13
|
--theme-checkbox-surface-selected: var(--color-primary-default);
|
|
@@ -25,6 +25,7 @@ const FormFieldContainer = forwardRef<HTMLElement, FormFieldContainerProps>(
|
|
|
25
25
|
className,
|
|
26
26
|
children,
|
|
27
27
|
width,
|
|
28
|
+
state = "default",
|
|
28
29
|
style,
|
|
29
30
|
...containerProps
|
|
30
31
|
},
|
|
@@ -43,6 +44,7 @@ const FormFieldContainer = forwardRef<HTMLElement, FormFieldContainerProps>(
|
|
|
43
44
|
<ComponentTag
|
|
44
45
|
ref={ref}
|
|
45
46
|
data-width={getFormFieldWidthAttr(width)}
|
|
47
|
+
data-state={state}
|
|
46
48
|
className={clsx("form-field form-field-container", className)}
|
|
47
49
|
style={mergedStyle}
|
|
48
50
|
{...containerProps}
|
|
@@ -18,6 +18,7 @@ import FormFieldContainer from "./Container";
|
|
|
18
18
|
* @property {FormFieldHeaderProps} [headerProps] 헤더 속성
|
|
19
19
|
* @property {FormFieldFooterProps} [footerProps] 푸터 속성
|
|
20
20
|
* @property {FormFieldWidth} [width] form field 너비 옵션
|
|
21
|
+
* @property {FormFieldState} [state] visual state
|
|
21
22
|
* @property {React.HTMLAttributes<HTMLElement>} [containerProps] container 속성
|
|
22
23
|
* @property {React.ReactNode} children
|
|
23
24
|
*/
|
|
@@ -11,6 +11,11 @@ import type { ElementType } from "react";
|
|
|
11
11
|
*/
|
|
12
12
|
export type FormFieldWidth = "full" | "fit" | "fill" | "auto" | number | string;
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Form; field state option
|
|
16
|
+
*/
|
|
17
|
+
export type FormFieldState = "default" | "error";
|
|
18
|
+
|
|
14
19
|
/**
|
|
15
20
|
* Form.Field Header props; `Header.tsx`에서 label/description/meta를 제어한다.
|
|
16
21
|
* @property {string} [className] 헤더 wrapper className
|
|
@@ -78,6 +83,7 @@ export interface FormFieldFooterProps extends React.HTMLAttributes<HTMLElement>
|
|
|
78
83
|
* @property {string} [className] container className
|
|
79
84
|
* @property {React.ElementType} [as] container 태그
|
|
80
85
|
* @property {FormFieldWidth} [width] width 옵션(full/fit/fill/auto/custom)
|
|
86
|
+
* @property {FormFieldState} [state] visual state
|
|
81
87
|
* @property {React.ReactNode} children Body에 전달될 콘텐츠
|
|
82
88
|
*/
|
|
83
89
|
export interface FormFieldContainerProps extends React.HTMLAttributes<HTMLElement> {
|
|
@@ -93,6 +99,10 @@ export interface FormFieldContainerProps extends React.HTMLAttributes<HTMLElemen
|
|
|
93
99
|
* width 옵션
|
|
94
100
|
*/
|
|
95
101
|
width?: FormFieldWidth;
|
|
102
|
+
/**
|
|
103
|
+
* visual state
|
|
104
|
+
*/
|
|
105
|
+
state?: FormFieldState;
|
|
96
106
|
/**
|
|
97
107
|
* 필드 children
|
|
98
108
|
*/
|
|
@@ -107,6 +117,7 @@ export interface FormFieldContainerProps extends React.HTMLAttributes<HTMLElemen
|
|
|
107
117
|
* @property {string} [className] container className
|
|
108
118
|
* @property {React.ElementType} [as] container 태그
|
|
109
119
|
* @property {FormFieldWidth} [width] width 옵션(full/fit/fill/auto/custom)
|
|
120
|
+
* @property {FormFieldState} [state] visual state
|
|
110
121
|
* @property {React.ReactNode} children Body에 전달될 콘텐츠
|
|
111
122
|
*/
|
|
112
123
|
export interface FormFieldTemplateProps extends FormFieldContainerProps {
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
--theme-radio-indicator-border-width: 1.4px;
|
|
7
7
|
--theme-radio-indicator-border-width-selected-medium: 4px;
|
|
8
8
|
--theme-radio-indicator-border-width-selected-large: 6px;
|
|
9
|
-
--theme-radio-border-color: var(--color-border-
|
|
9
|
+
--theme-radio-border-color: var(--color-border-standard-cool-gray);
|
|
10
10
|
--theme-radio-border-selected: var(--color-primary-default);
|
|
11
11
|
--theme-radio-surface-selected: var(--color-primary-default);
|
|
12
|
-
--theme-radio-surface-disabled: var(--color-
|
|
13
|
-
--theme-radio-border-disabled: var(--color-border-
|
|
12
|
+
--theme-radio-surface-disabled: var(--color-state-static-disabled);
|
|
13
|
+
--theme-radio-border-disabled: var(--color-border-standard-cool-gray);
|
|
14
14
|
--theme-radio-disabled-selected-fill: var(--color-primary-default);
|
|
15
15
|
--theme-radio-label-color: var(--color-label-strong);
|
|
16
16
|
--theme-radio-label-disabled: var(--color-label-disabled);
|
|
@@ -13,7 +13,7 @@ import type { SelectTriggerBaseProps } from "../../types/trigger";
|
|
|
13
13
|
* @param {SelectTriggerBaseProps} props trigger base props
|
|
14
14
|
* @param {"primary" | "secondary" | "table"} [props.priority="primary"] 스타일 우선순위
|
|
15
15
|
* @param {"small" | "medium" | "large"} [props.size="medium"] 높이 스케일
|
|
16
|
-
* @param {"default" | "focused" | "disabled"} [props.state="default"] 시각 상태
|
|
16
|
+
* @param {"default" | "focused" | "error" | "disabled"} [props.state="default"] 시각 상태
|
|
17
17
|
* @param {boolean} [props.open=false] dropdown open 상태
|
|
18
18
|
* @param {boolean} [props.block=false] block 레이아웃 여부
|
|
19
19
|
* @param {boolean} [props.multiple=false] multi select 여부
|
|
@@ -133,6 +133,25 @@
|
|
|
133
133
|
--select-icon-fill: var(--select-table-icon-color-focused);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
&:not([data-priority="secondary"])[data-state="error"] {
|
|
137
|
+
border-color: var(--select-primary-color-border-error);
|
|
138
|
+
--select-icon-fill: var(--select-icon-color-default);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&[data-priority="secondary"][data-state="error"] {
|
|
142
|
+
color: var(--select-secondary-color-text-error);
|
|
143
|
+
|
|
144
|
+
&::after {
|
|
145
|
+
height: var(--select-secondary-underline-width-focus);
|
|
146
|
+
background-color: var(--select-color-border-secondary-error);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&[data-priority="table"][data-state="error"] {
|
|
151
|
+
border-color: var(--select-table-border-error-color);
|
|
152
|
+
--select-icon-fill: var(--select-table-icon-color-default);
|
|
153
|
+
}
|
|
154
|
+
|
|
136
155
|
&:not([data-priority="secondary"])[data-readonly="true"] {
|
|
137
156
|
border-color: var(--select-primary-color-border-disabled);
|
|
138
157
|
background-color: var(--select-primary-color-surface-disabled);
|
|
@@ -227,6 +246,10 @@
|
|
|
227
246
|
color: var(--select-primary-color-text-focused);
|
|
228
247
|
}
|
|
229
248
|
|
|
249
|
+
.select-button[data-state="error"] & {
|
|
250
|
+
color: var(--select-primary-color-text-error);
|
|
251
|
+
}
|
|
252
|
+
|
|
230
253
|
.select-button[data-state="disabled"] & {
|
|
231
254
|
color: var(--select-primary-color-text-disabled);
|
|
232
255
|
}
|
|
@@ -239,9 +262,17 @@
|
|
|
239
262
|
color: var(--select-secondary-color-text-disabled);
|
|
240
263
|
}
|
|
241
264
|
|
|
265
|
+
.select-button[data-priority="secondary"][data-state="error"] & {
|
|
266
|
+
color: var(--select-secondary-color-text-error);
|
|
267
|
+
}
|
|
268
|
+
|
|
242
269
|
.select-button[data-priority="secondary"][data-readonly="true"] & {
|
|
243
270
|
color: var(--select-secondary-color-text-readonly);
|
|
244
271
|
}
|
|
272
|
+
|
|
273
|
+
.select-button[data-priority="table"][data-state="error"] & {
|
|
274
|
+
color: var(--select-table-color-text-error);
|
|
275
|
+
}
|
|
245
276
|
}
|
|
246
277
|
|
|
247
278
|
.select-label-placeholder {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
--select-table-radius: var(--input-table-radius-base);
|
|
30
30
|
--select-table-border-default-color: var(--input-border-table-default-color);
|
|
31
31
|
--select-table-border-focus-color: var(--input-border-active-color);
|
|
32
|
+
--select-table-border-error-color: var(--input-border-error-color);
|
|
32
33
|
--select-table-border-disabled-color: var(--input-border-disabled-color);
|
|
33
34
|
--select-table-border-readonly-color: var(
|
|
34
35
|
--select-table-border-disabled-color
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
--select-table-surface-disabled-color
|
|
40
41
|
);
|
|
41
42
|
--select-table-color-text: var(--input-text-color);
|
|
43
|
+
--select-table-color-text-error: var(--input-label-error-color);
|
|
42
44
|
--select-table-color-text-readonly: var(--select-primary-color-text-readonly);
|
|
43
45
|
--select-table-color-placeholder: var(--input-placeholder-color);
|
|
44
46
|
--select-table-icon-color-default: var(--select-icon-color-default);
|
|
@@ -80,19 +82,23 @@
|
|
|
80
82
|
--select-primary-color-surface: var(--input-surface-color);
|
|
81
83
|
--select-primary-color-text: var(--color-label-alternative);
|
|
82
84
|
--select-primary-color-text-focused: var(--color-label-strong);
|
|
85
|
+
--select-primary-color-text-error: var(--input-label-error-color);
|
|
83
86
|
--select-primary-color-text-disabled: var(--color-label-disabled);
|
|
84
87
|
--select-primary-color-text-readonly: var(--color-label-strong);
|
|
85
88
|
--select-primary-color-border: var(--input-border-color);
|
|
86
89
|
--select-primary-color-border-focused: var(--input-border-active-color);
|
|
90
|
+
--select-primary-color-border-error: var(--input-border-error-color);
|
|
87
91
|
--select-primary-color-border-disabled: var(--input-border-disabled-color);
|
|
88
92
|
--select-color-border-secondary: var(--input-border-color);
|
|
89
93
|
--select-color-border-secondary-hover: var(--input-border-active-color);
|
|
90
94
|
--select-color-border-secondary-focused: var(--input-border-active-color);
|
|
95
|
+
--select-color-border-secondary-error: var(--input-border-error-color);
|
|
91
96
|
--select-color-border-secondary-disabled: var(
|
|
92
97
|
--input-border-underline-disabled-color
|
|
93
98
|
);
|
|
94
99
|
--select-primary-color-surface-disabled: var(--input-surface-disabled-color);
|
|
95
100
|
--select-secondary-color-text: var(--color-label-standard);
|
|
101
|
+
--select-secondary-color-text-error: var(--input-label-error-color);
|
|
96
102
|
--select-secondary-color-text-disabled: var(--color-label-disabled);
|
|
97
103
|
--select-secondary-color-text-readonly: var(
|
|
98
104
|
--select-primary-color-text-readonly
|
|
@@ -18,12 +18,13 @@ export type SelectSize = "small" | "medium" | "large";
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Select visual state
|
|
21
|
-
* @typedef {"default" | "focused" | "disabled"} SelectState
|
|
21
|
+
* @typedef {"default" | "focused" | "error" | "disabled"} SelectState
|
|
22
22
|
* - default: 기본 상태
|
|
23
23
|
* - focused: focus/open 상태
|
|
24
|
+
* - error: 에러 상태
|
|
24
25
|
* - disabled: 비활성 상태
|
|
25
26
|
*/
|
|
26
|
-
export type SelectState = "default" | "focused" | "disabled";
|
|
27
|
+
export type SelectState = "default" | "focused" | "error" | "disabled";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Select trigger button type
|