@uniai-fe/uds-primitives 0.1.13 → 0.2.0
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/README.md +2 -2
- package/dist/styles.css +1112 -385
- package/package.json +12 -15
- package/src/components/button/index.scss +1 -0
- package/src/components/button/markup/{ButtonRounded.tsx → Rounded.tsx} +1 -1
- package/src/components/button/markup/{ButtonText.tsx → Text.tsx} +1 -1
- package/src/components/button/markup/index.ts +3 -3
- package/src/components/button/styles/button.scss +113 -229
- package/src/components/button/styles/round-button.scss +11 -14
- package/src/components/button/styles/text-button.scss +23 -23
- package/src/components/button/styles/variables.scss +145 -0
- package/src/components/dropdown/index.tsx +3 -3
- package/src/components/dropdown/markup/Template.tsx +61 -0
- package/src/components/dropdown/markup/foundation/Container.tsx +97 -0
- package/src/components/dropdown/markup/foundation/MenuItem.tsx +107 -0
- package/src/components/dropdown/markup/foundation/MenuList.tsx +27 -0
- package/src/components/dropdown/markup/foundation/Provider.tsx +46 -0
- package/src/components/dropdown/markup/foundation/Root.tsx +30 -0
- package/src/components/dropdown/markup/foundation/Trigger.tsx +34 -0
- package/src/components/dropdown/markup/foundation/index.tsx +25 -0
- package/src/components/dropdown/markup/index.tsx +8 -2
- package/src/components/dropdown/styles/dropdown.scss +166 -0
- package/src/components/dropdown/styles/index.scss +2 -0
- package/src/components/dropdown/styles/variables.scss +40 -0
- package/src/components/dropdown/types/base.ts +18 -0
- package/src/components/dropdown/types/index.ts +2 -4
- package/src/components/dropdown/types/props.ts +174 -0
- package/src/components/dropdown/utils/index.ts +1 -4
- package/src/components/dropdown/utils/refs.ts +20 -0
- package/src/components/form/index.scss +1 -0
- package/src/components/form/index.tsx +18 -2
- package/src/components/form/markup/form-field/Body.tsx +18 -0
- package/src/components/form/markup/form-field/Container.tsx +58 -0
- package/src/components/form/markup/form-field/Footer.tsx +21 -0
- package/src/components/form/markup/form-field/Header.tsx +39 -0
- package/src/components/form/markup/form-field/Template.tsx +56 -0
- package/src/components/form/markup/form-field/index.tsx +22 -0
- package/src/components/form/styles/form-field/layout.scss +67 -0
- package/src/components/form/styles/form-field/variables.scss +17 -0
- package/src/components/form/styles/index.scss +2 -0
- package/src/components/form/types/index.ts +1 -0
- package/src/components/form/types/props.ts +125 -0
- package/src/components/form/utils/form-field.ts +42 -0
- package/src/components/input/hooks/index.ts +1 -4
- package/src/components/input/hooks/useDigitField.ts +63 -0
- package/src/components/input/img/calendar/calendar.svg +7 -0
- package/src/components/input/img/calendar/chevron-down.svg +3 -0
- package/src/components/input/img/calendar/chevron-left.svg +3 -0
- package/src/components/input/img/calendar/chevron-right.svg +3 -0
- package/src/components/input/img/calendar/chevron-up.svg +3 -0
- package/src/components/input/index.tsx +2 -1
- package/src/components/input/markup/calendar/Base.tsx +329 -0
- package/src/components/input/markup/calendar/index.tsx +8 -0
- package/src/components/input/markup/{text/InputUtilityButton.tsx → foundation/Button.tsx} +5 -15
- package/src/components/input/markup/foundation/Input.tsx +245 -0
- package/src/components/input/markup/foundation/SideSlot.tsx +30 -0
- package/src/components/input/markup/foundation/StatusIcon.tsx +21 -0
- package/src/components/input/markup/foundation/Utility.tsx +103 -0
- package/src/components/input/markup/foundation/index.tsx +15 -0
- package/src/components/input/markup/index.tsx +11 -1
- package/src/components/input/markup/text/AuthCode.tsx +41 -59
- package/src/components/input/markup/text/Email.tsx +25 -115
- package/src/components/input/markup/text/Password.tsx +30 -39
- package/src/components/input/markup/text/Phone.tsx +35 -122
- package/src/components/input/markup/text/Search.tsx +17 -18
- package/src/components/input/markup/text/index.ts +15 -12
- package/src/components/input/styles/calendar.scss +110 -0
- package/src/components/input/styles/foundation.scss +345 -0
- package/src/components/input/styles/index.scss +4 -476
- package/src/components/input/styles/text.scss +89 -0
- package/src/components/input/styles/variables.scss +41 -0
- package/src/components/input/types/calendar.ts +208 -0
- package/src/components/input/types/foundation.ts +194 -0
- package/src/components/input/types/hooks.ts +43 -0
- package/src/components/input/types/index.ts +5 -87
- package/src/components/input/types/text.ts +203 -0
- package/src/components/input/types/verification.ts +23 -0
- package/src/components/input/utils/index.tsx +1 -0
- package/src/components/input/utils/verification.tsx +35 -0
- package/src/components/select/hooks/index.ts +43 -2
- package/src/components/select/img/chevron/primary/large.svg +3 -0
- package/src/components/select/img/chevron/primary/medium.svg +3 -0
- package/src/components/select/img/chevron/primary/small.svg +3 -0
- package/src/components/select/img/chevron/secondary/large.svg +3 -0
- package/src/components/select/img/chevron/secondary/medium.svg +3 -0
- package/src/components/select/img/chevron/secondary/small.svg +3 -0
- package/src/components/select/img/remove.svg +3 -0
- package/src/components/select/index.scss +2 -1
- package/src/components/select/index.tsx +5 -0
- package/src/components/select/markup/Default.tsx +154 -0
- package/src/components/select/markup/foundation/Base.tsx +90 -0
- package/src/components/select/markup/foundation/Container.tsx +30 -0
- package/src/components/select/markup/foundation/Icon.tsx +78 -0
- package/src/components/select/markup/foundation/Selected.tsx +34 -0
- package/src/components/select/markup/foundation/index.ts +2 -0
- package/src/components/select/markup/index.tsx +36 -2
- package/src/components/select/markup/multiple/Multiple.tsx +205 -0
- package/src/components/select/markup/multiple/SelectedChip.tsx +58 -0
- package/src/components/select/markup/multiple/index.ts +2 -0
- package/src/components/select/styles/select.scss +316 -0
- package/src/components/select/styles/variables.scss +91 -0
- package/src/components/select/types/base.ts +34 -0
- package/src/components/select/types/icon.ts +45 -0
- package/src/components/select/types/index.ts +5 -4
- package/src/components/select/types/multiple.ts +57 -0
- package/src/components/select/types/props.ts +208 -0
- package/src/components/select/types/trigger.ts +196 -0
- package/src/index.scss +3 -2
- package/src/components/input/markup/text/Base.tsx +0 -454
- package/src/components/input/utils/index.ts +0 -60
- package/src/components/select/styles/index.scss +0 -0
- /package/src/components/button/markup/{ButtonDefault.tsx → Base.tsx} +0 -0
- /package/src/components/form/{Provider.tsx → markup/Provider.tsx} +0 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
.select {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: var(--spacing-gap-2);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.select-block {
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.select-button {
|
|
13
|
+
--select-icon-fill: var(--select-icon-color-default);
|
|
14
|
+
display: flex;
|
|
15
|
+
width: 100%;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: var(--select-primary-gap-inline);
|
|
18
|
+
min-height: var(--select-primary-height-medium);
|
|
19
|
+
padding: var(--select-primary-padding-block)
|
|
20
|
+
var(--select-primary-padding-inline);
|
|
21
|
+
border: var(--select-primary-border-width-default) solid
|
|
22
|
+
var(--select-primary-color-border);
|
|
23
|
+
border-radius: var(--select-primary-radius-medium);
|
|
24
|
+
background-color: var(--input-surface-color);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
transition:
|
|
27
|
+
border-color 150ms ease,
|
|
28
|
+
background-color 150ms ease,
|
|
29
|
+
color 150ms ease;
|
|
30
|
+
text-align: left;
|
|
31
|
+
|
|
32
|
+
&[data-size="small"] {
|
|
33
|
+
min-height: var(--select-primary-height-small);
|
|
34
|
+
border-radius: var(--select-primary-radius-small);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&[data-size="large"] {
|
|
38
|
+
min-height: var(--select-primary-height-large);
|
|
39
|
+
border-radius: var(--select-primary-radius-large);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&[data-multiple="true"] {
|
|
43
|
+
align-items: center;
|
|
44
|
+
flex-wrap: nowrap;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[data-priority="secondary"] {
|
|
49
|
+
width: fit-content;
|
|
50
|
+
max-width: 100%;
|
|
51
|
+
min-height: auto;
|
|
52
|
+
border: none;
|
|
53
|
+
border-radius: var(--select-secondary-radius);
|
|
54
|
+
padding: var(--select-secondary-padding-block)
|
|
55
|
+
var(--select-secondary-padding-inline);
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
gap: var(--select-secondary-gap);
|
|
58
|
+
position: relative;
|
|
59
|
+
--select-icon-fill: currentColor;
|
|
60
|
+
transition:
|
|
61
|
+
background-color 150ms ease,
|
|
62
|
+
color 150ms ease;
|
|
63
|
+
|
|
64
|
+
&:hover:not([data-state="disabled"]) {
|
|
65
|
+
background-color: var(--select-color-surface-secondary-hover);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:active:not([data-state="disabled"]) {
|
|
69
|
+
background-color: var(--select-color-surface-secondary-active);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&[data-state="focused"],
|
|
73
|
+
&[data-open="true"] {
|
|
74
|
+
background-color: var(--select-color-surface-secondary-hover);
|
|
75
|
+
|
|
76
|
+
&::after {
|
|
77
|
+
height: var(--select-secondary-underline-width-focus);
|
|
78
|
+
background-color: var(--select-color-border-secondary-focused);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&[data-state="disabled"],
|
|
83
|
+
&:disabled {
|
|
84
|
+
color: var(--color-label-disabled);
|
|
85
|
+
cursor: not-allowed;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:not([data-priority="secondary"])[data-state="focused"],
|
|
90
|
+
&:not([data-priority="secondary"])[data-open="true"],
|
|
91
|
+
&:not([data-priority="secondary"]):focus-visible {
|
|
92
|
+
border-color: var(--select-primary-color-border-focused);
|
|
93
|
+
border-width: var(--select-primary-border-width-focus);
|
|
94
|
+
--select-icon-fill: var(--select-icon-color-focused);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// &:not([data-priority="secondary"]):hover:not(:disabled) {
|
|
98
|
+
// }
|
|
99
|
+
|
|
100
|
+
&:not([data-priority="secondary"])[data-state="disabled"],
|
|
101
|
+
&:not([data-priority="secondary"]):disabled {
|
|
102
|
+
border-color: var(--select-primary-color-border-disabled);
|
|
103
|
+
background-color: var(--select-primary-color-surface-disabled);
|
|
104
|
+
cursor: not-allowed;
|
|
105
|
+
--select-icon-fill: var(--select-icon-color-disabled);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&[data-priority="secondary"][data-state="disabled"],
|
|
109
|
+
&[data-priority="secondary"]:disabled {
|
|
110
|
+
border-color: transparent;
|
|
111
|
+
background-color: var(--select-color-surface-secondary-disabled);
|
|
112
|
+
|
|
113
|
+
&::after {
|
|
114
|
+
background-color: var(--select-color-border-secondary-disabled);
|
|
115
|
+
height: var(--select-secondary-underline-width-default);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.select-value {
|
|
121
|
+
flex: 1 1 auto;
|
|
122
|
+
min-width: 0;
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
gap: var(--spacing-gap-2);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.select-label {
|
|
129
|
+
flex: 1 1 auto;
|
|
130
|
+
min-width: 0;
|
|
131
|
+
font-family: var(--font-body-medium-family);
|
|
132
|
+
font-size: var(--select-text-medium-size);
|
|
133
|
+
font-weight: var(--select-text-medium-weight);
|
|
134
|
+
line-height: var(--select-text-medium-line-height);
|
|
135
|
+
letter-spacing: var(--select-text-medium-letter-spacing);
|
|
136
|
+
color: var(--select-primary-color-text);
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
text-overflow: ellipsis;
|
|
139
|
+
white-space: nowrap;
|
|
140
|
+
|
|
141
|
+
.select-button[data-priority="secondary"] & {
|
|
142
|
+
color: var(--select-secondary-color-text);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.select-button[data-state="focused"] &,
|
|
146
|
+
.select-button[data-open="true"] & {
|
|
147
|
+
color: var(--select-primary-color-text-focused);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.select-button[data-state="disabled"] & {
|
|
151
|
+
color: var(--select-primary-color-text-disabled);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.select-button[data-priority="secondary"][data-state="disabled"] & {
|
|
155
|
+
color: var(--color-label-disabled);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.select-label-placeholder {
|
|
160
|
+
color: var(--select-primary-color-placeholder);
|
|
161
|
+
|
|
162
|
+
.select-button[data-priority="secondary"] & {
|
|
163
|
+
color: var(--select-secondary-color-placeholder);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.select-button[data-size="small"] .select-label {
|
|
168
|
+
font-size: var(--select-text-small-size);
|
|
169
|
+
line-height: var(--select-text-small-line-height);
|
|
170
|
+
letter-spacing: var(--select-text-small-letter-spacing);
|
|
171
|
+
font-weight: var(--select-text-small-weight);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.select-button[data-size="large"] .select-label {
|
|
175
|
+
font-size: var(--select-text-large-size);
|
|
176
|
+
line-height: var(--select-text-large-line-height);
|
|
177
|
+
letter-spacing: var(--select-text-large-letter-spacing);
|
|
178
|
+
font-weight: var(--select-text-large-weight);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.select-button[data-priority="secondary"][data-size="large"] .select-label {
|
|
182
|
+
font-weight: 600;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.select-tags {
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-wrap: nowrap;
|
|
188
|
+
gap: var(--select-multiple-chip-gap);
|
|
189
|
+
align-items: center;
|
|
190
|
+
min-width: 0;
|
|
191
|
+
flex: 1 1 auto;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.select-tag {
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
gap: var(--select-multiple-chip-gap);
|
|
198
|
+
padding: var(--select-multiple-chip-padding-block)
|
|
199
|
+
var(--select-multiple-chip-padding-inline);
|
|
200
|
+
border-radius: var(--select-multiple-chip-radius);
|
|
201
|
+
border: 1px solid
|
|
202
|
+
var(
|
|
203
|
+
--select-multiple-chip-border-color,
|
|
204
|
+
var(--color-border-standard-cool-gray)
|
|
205
|
+
);
|
|
206
|
+
background-color: var(--select-multiple-chip-surface);
|
|
207
|
+
color: var(--select-multiple-chip-color);
|
|
208
|
+
font-size: var(--select-multiple-chip-font-size);
|
|
209
|
+
line-height: var(--select-multiple-chip-line-height);
|
|
210
|
+
font-weight: var(--select-multiple-chip-font-weight);
|
|
211
|
+
white-space: nowrap;
|
|
212
|
+
min-height: var(--select-multiple-chip-height);
|
|
213
|
+
|
|
214
|
+
&:focus-within {
|
|
215
|
+
border-color: var(--select-color-border-secondary-focused);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&[data-removable="true"] {
|
|
219
|
+
padding-right: var(--spacing-padding-2);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.select-tag[data-kind="summary"],
|
|
224
|
+
.select-tag-summary {
|
|
225
|
+
background-color: var(--select-multiple-chip-summary-surface);
|
|
226
|
+
border-color: var(--select-multiple-chip-summary-border-color);
|
|
227
|
+
color: var(--select-multiple-chip-summary-color);
|
|
228
|
+
padding: var(--select-multiple-chip-summary-padding-block)
|
|
229
|
+
var(--select-multiple-chip-summary-padding-inline);
|
|
230
|
+
border-radius: var(--select-multiple-chip-summary-radius);
|
|
231
|
+
font-size: var(--select-multiple-chip-summary-font-size);
|
|
232
|
+
line-height: var(--select-multiple-chip-summary-line-height);
|
|
233
|
+
font-weight: var(--select-multiple-chip-summary-font-weight);
|
|
234
|
+
min-height: auto;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.select-tag-label {
|
|
238
|
+
display: flex;
|
|
239
|
+
align-items: center;
|
|
240
|
+
gap: var(--spacing-gap-1);
|
|
241
|
+
min-width: 0;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.select-tag-suffix {
|
|
245
|
+
color: var(--select-multiple-chip-suffix-color);
|
|
246
|
+
font-size: inherit;
|
|
247
|
+
line-height: inherit;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.select-tag-remove {
|
|
251
|
+
display: flex;
|
|
252
|
+
align-items: center;
|
|
253
|
+
justify-content: center;
|
|
254
|
+
width: var(--select-icon-size-small);
|
|
255
|
+
height: var(--select-icon-size-small);
|
|
256
|
+
border: none;
|
|
257
|
+
background-color: transparent;
|
|
258
|
+
padding: 0;
|
|
259
|
+
cursor: pointer;
|
|
260
|
+
color: var(--select-multiple-chip-remove-color);
|
|
261
|
+
flex-shrink: 0;
|
|
262
|
+
border-radius: 9999px;
|
|
263
|
+
transition: color 150ms ease;
|
|
264
|
+
|
|
265
|
+
&:focus-visible {
|
|
266
|
+
outline: 0.2rem solid var(--color-border-strong);
|
|
267
|
+
outline-offset: 0.1rem;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
&:hover {
|
|
271
|
+
color: var(--select-multiple-chip-remove-hover-color);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
svg {
|
|
275
|
+
width: 100%;
|
|
276
|
+
height: 100%;
|
|
277
|
+
|
|
278
|
+
path {
|
|
279
|
+
fill: currentColor;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.select-icon {
|
|
285
|
+
flex-shrink: 0;
|
|
286
|
+
width: var(--select-icon-size-medium);
|
|
287
|
+
height: var(--select-icon-size-medium);
|
|
288
|
+
display: flex;
|
|
289
|
+
align-items: center;
|
|
290
|
+
justify-content: center;
|
|
291
|
+
margin-left: auto;
|
|
292
|
+
|
|
293
|
+
&[data-size="small"] {
|
|
294
|
+
width: var(--select-icon-size-small);
|
|
295
|
+
height: var(--select-icon-size-small);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&[data-size="large"] {
|
|
299
|
+
width: var(--select-icon-size-large);
|
|
300
|
+
height: var(--select-icon-size-large);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
[data-open="true"] & {
|
|
304
|
+
transform: rotate(180deg);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
svg {
|
|
308
|
+
display: block;
|
|
309
|
+
width: 100%;
|
|
310
|
+
height: 100%;
|
|
311
|
+
|
|
312
|
+
path {
|
|
313
|
+
fill: var(--select-icon-fill);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* Select tokens mapped to Input primary tokens for visual parity */
|
|
2
|
+
:root {
|
|
3
|
+
--select-primary-height-small: var(--input-default-height-small);
|
|
4
|
+
--select-primary-height-medium: var(--input-default-height-medium);
|
|
5
|
+
--select-primary-height-large: var(--input-default-height-large);
|
|
6
|
+
|
|
7
|
+
--select-primary-radius-small: var(--input-default-radius-base);
|
|
8
|
+
--select-primary-radius-medium: var(--input-default-radius-base);
|
|
9
|
+
--select-primary-radius-large: var(--input-default-radius-base);
|
|
10
|
+
|
|
11
|
+
--select-primary-padding-inline: var(--input-default-padding-inline);
|
|
12
|
+
--select-primary-padding-block: var(--input-default-padding-block);
|
|
13
|
+
--select-primary-gap-inline: var(--input-default-gap);
|
|
14
|
+
--select-primary-border-width-default: var(--input-border-width-default);
|
|
15
|
+
--select-primary-border-width-focus: var(--input-border-width-emphasis);
|
|
16
|
+
|
|
17
|
+
--select-secondary-radius: var(--theme-radius-medium-1);
|
|
18
|
+
--select-secondary-padding-inline: var(--spacing-padding-4);
|
|
19
|
+
--select-secondary-padding-block: var(--spacing-padding-2);
|
|
20
|
+
--select-secondary-gap: var(--spacing-gap-2);
|
|
21
|
+
--select-secondary-underline-width-default: 1px;
|
|
22
|
+
--select-secondary-underline-width-focus: 1.4px;
|
|
23
|
+
--select-text-small-size: 15px;
|
|
24
|
+
--select-text-small-line-height: 1.4;
|
|
25
|
+
--select-text-small-letter-spacing: 0.2px;
|
|
26
|
+
--select-text-small-weight: 400;
|
|
27
|
+
--select-text-medium-size: var(--font-body-medium-size);
|
|
28
|
+
--select-text-medium-line-height: var(--font-body-medium-line-height);
|
|
29
|
+
--select-text-medium-letter-spacing: 0;
|
|
30
|
+
--select-text-medium-weight: 400;
|
|
31
|
+
--select-text-large-size: var(--font-body-large-size);
|
|
32
|
+
--select-text-large-line-height: var(--font-body-large-line-height);
|
|
33
|
+
--select-text-large-letter-spacing: 0;
|
|
34
|
+
--select-text-large-weight: 400;
|
|
35
|
+
|
|
36
|
+
--select-icon-size-small: 1.6rem;
|
|
37
|
+
--select-icon-size-medium: 2rem;
|
|
38
|
+
--select-icon-size-large: 2rem;
|
|
39
|
+
|
|
40
|
+
--select-primary-color-placeholder: var(--input-placeholder-color);
|
|
41
|
+
--select-primary-color-text: var(--color-label-alternative);
|
|
42
|
+
--select-primary-color-text-focused: var(--color-label-strong);
|
|
43
|
+
--select-primary-color-text-disabled: var(--color-label-disabled);
|
|
44
|
+
--select-primary-color-border: var(--input-border-color);
|
|
45
|
+
--select-primary-color-border-focused: var(--input-border-active-color);
|
|
46
|
+
--select-primary-color-border-disabled: var(--input-border-disabled-color);
|
|
47
|
+
--select-color-border-secondary: var(--input-border-color);
|
|
48
|
+
--select-color-border-secondary-hover: var(--input-border-active-color);
|
|
49
|
+
--select-color-border-secondary-focused: var(--input-border-active-color);
|
|
50
|
+
--select-color-border-secondary-disabled: var(
|
|
51
|
+
--input-border-underline-disabled-color
|
|
52
|
+
);
|
|
53
|
+
--select-primary-color-surface-disabled: var(--input-surface-disabled-color);
|
|
54
|
+
--select-secondary-color-text: var(--color-label-standard);
|
|
55
|
+
--select-secondary-color-placeholder: var(--color-label-alternative);
|
|
56
|
+
--select-color-surface-secondary: transparent;
|
|
57
|
+
--select-color-surface-secondary-hover: var(--color-surface-static-cool-gray);
|
|
58
|
+
--select-color-surface-secondary-active: var(--color-surface-standard);
|
|
59
|
+
--select-color-surface-secondary-disabled: var(--color-surface-neutral);
|
|
60
|
+
|
|
61
|
+
--select-icon-color-default: var(--color-cool-gray-75);
|
|
62
|
+
--select-icon-color-focused: var(--color-cool-gray-20);
|
|
63
|
+
--select-icon-color-disabled: var(--color-cool-gray-85);
|
|
64
|
+
|
|
65
|
+
/* Multi select chip */
|
|
66
|
+
--select-multiple-chip-gap: var(--spacing-gap-2);
|
|
67
|
+
--select-multiple-chip-padding-inline: var(--spacing-padding-4);
|
|
68
|
+
--select-multiple-chip-padding-block: 0px;
|
|
69
|
+
--select-multiple-chip-radius: var(--theme-radius-medium-2);
|
|
70
|
+
--select-multiple-chip-font-size: var(--font-body-small-size);
|
|
71
|
+
--select-multiple-chip-line-height: var(--font-body-small-line-height);
|
|
72
|
+
--select-multiple-chip-font-weight: 400;
|
|
73
|
+
--select-multiple-chip-height: 29px;
|
|
74
|
+
--select-multiple-chip-color: var(--color-primary-default);
|
|
75
|
+
--select-multiple-chip-suffix-color: var(--color-label-alternative);
|
|
76
|
+
--select-multiple-chip-surface: var(--color-surface-static-blue);
|
|
77
|
+
--select-multiple-chip-border-color: transparent; // var(--color-border-standard-cool-gray);
|
|
78
|
+
--select-multiple-chip-remove-color: var(--color-label-strong);
|
|
79
|
+
--select-multiple-chip-remove-hover-color: var(--color-label-strong);
|
|
80
|
+
--select-multiple-chip-summary-color: var(--color-label-standard);
|
|
81
|
+
--select-multiple-chip-summary-surface: var(--color-surface-standard);
|
|
82
|
+
--select-multiple-chip-summary-border-color: transparent;
|
|
83
|
+
--select-multiple-chip-summary-padding-inline: var(--spacing-padding-4);
|
|
84
|
+
--select-multiple-chip-summary-padding-block: var(--spacing-padding-2);
|
|
85
|
+
--select-multiple-chip-summary-radius: var(--theme-radius-medium-1);
|
|
86
|
+
--select-multiple-chip-summary-font-size: var(--font-body-medium-size);
|
|
87
|
+
--select-multiple-chip-summary-line-height: var(
|
|
88
|
+
--font-body-medium-line-height
|
|
89
|
+
);
|
|
90
|
+
--select-multiple-chip-summary-font-weight: 400;
|
|
91
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select priority scale
|
|
3
|
+
* @typedef {"primary" | "secondary"} SelectPriority
|
|
4
|
+
* - primary: input primary 스타일과 동일한 기본 형태
|
|
5
|
+
* - secondary: borderless + underline 스타일
|
|
6
|
+
*/
|
|
7
|
+
export type SelectPriority = "primary" | "secondary";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Select size scale
|
|
11
|
+
* @typedef {"small" | "medium" | "large"} SelectSize
|
|
12
|
+
* - small: 컴팩트 레이아웃
|
|
13
|
+
* - medium: 기본 사이즈
|
|
14
|
+
* - large: 확장 레이아웃
|
|
15
|
+
*/
|
|
16
|
+
export type SelectSize = "small" | "medium" | "large";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Select visual state
|
|
20
|
+
* @typedef {"default" | "focused" | "disabled"} SelectState
|
|
21
|
+
* - default: 기본 상태
|
|
22
|
+
* - focused: focus/open 상태
|
|
23
|
+
* - disabled: 비활성 상태
|
|
24
|
+
*/
|
|
25
|
+
export type SelectState = "default" | "focused" | "disabled";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Select trigger button type
|
|
29
|
+
* @typedef {"button" | "submit" | "reset"} SelectTriggerButtonType
|
|
30
|
+
* - button: 기본 trigger type
|
|
31
|
+
* - submit: form submit trigger
|
|
32
|
+
* - reset: form reset trigger
|
|
33
|
+
*/
|
|
34
|
+
export type SelectTriggerButtonType = "button" | "submit" | "reset";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ElementType } from "react";
|
|
2
|
+
|
|
3
|
+
import type { SelectPriority, SelectSize } from "./base";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Select 아이콘 사이즈 맵
|
|
7
|
+
* @property {ElementType} small small 사이즈 아이콘 컴포넌트
|
|
8
|
+
* @property {ElementType} medium medium 사이즈 아이콘 컴포넌트
|
|
9
|
+
* @property {ElementType} large large 사이즈 아이콘 컴포넌트
|
|
10
|
+
*/
|
|
11
|
+
export type SelectIconSizeMap = Record<SelectSize, ElementType>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Select 아이콘 priority 맵
|
|
15
|
+
* @property {SelectIconSizeMap} primary primary priority용 아이콘 컬렉션
|
|
16
|
+
* @property {SelectIconSizeMap} secondary secondary priority용 아이콘 컬렉션
|
|
17
|
+
*/
|
|
18
|
+
export type SelectIconPriorityMap = Record<SelectPriority, SelectIconSizeMap>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Select multi remove priority 맵
|
|
22
|
+
* @property {SelectIconSizeMap} primary primary priority remove 아이콘
|
|
23
|
+
*/
|
|
24
|
+
export interface SelectIconRemovePriorityMap {
|
|
25
|
+
/**
|
|
26
|
+
* primary priority remove 아이콘
|
|
27
|
+
*/
|
|
28
|
+
primary: SelectIconSizeMap;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Select 아이콘 전체 컬렉션
|
|
33
|
+
* @property {SelectIconPriorityMap} Chevron trigger Chevron 아이콘 세트
|
|
34
|
+
* @property {SelectIconRemovePriorityMap} Remove multi select remove 아이콘 세트
|
|
35
|
+
*/
|
|
36
|
+
export interface SelectIconCollection {
|
|
37
|
+
/**
|
|
38
|
+
* trigger Chevron 아이콘 세트
|
|
39
|
+
*/
|
|
40
|
+
Chevron: SelectIconPriorityMap;
|
|
41
|
+
/**
|
|
42
|
+
* multi select remove 아이콘 세트
|
|
43
|
+
*/
|
|
44
|
+
Remove: SelectIconRemovePriorityMap;
|
|
45
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
export type * from "./base";
|
|
2
|
+
export type * from "./icon";
|
|
3
|
+
export type * from "./props";
|
|
4
|
+
export type * from "./trigger";
|
|
5
|
+
export type * from "./multiple";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Select multiple chip props
|
|
5
|
+
* @property {ReactNode} label 표시할 라벨
|
|
6
|
+
* @property {ReactNode} [suffix] 라벨 뒤에 붙는 서브 라벨
|
|
7
|
+
* @property {boolean} [removable] remove 버튼 노출 여부
|
|
8
|
+
* @property {() => void} [onRemove] remove 클릭 핸들러
|
|
9
|
+
*/
|
|
10
|
+
export interface SelectMultipleChipProps {
|
|
11
|
+
/**
|
|
12
|
+
* 표시할 라벨
|
|
13
|
+
*/
|
|
14
|
+
label: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* 라벨 뒤에 붙는 서브 라벨
|
|
17
|
+
*/
|
|
18
|
+
suffix?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* remove 버튼 노출 여부
|
|
21
|
+
*/
|
|
22
|
+
removable?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* remove 클릭 핸들러
|
|
25
|
+
*/
|
|
26
|
+
onRemove?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* chip 용도 구분(default: value chip, summary: +n more)
|
|
29
|
+
*/
|
|
30
|
+
kind?: "value" | "summary";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Select multiple tag 데이터
|
|
35
|
+
* @property {ReactNode} label chip 라벨
|
|
36
|
+
* @property {ReactNode} [suffix] 서브 라벨
|
|
37
|
+
* @property {boolean} [removable] remove 버튼 노출 여부
|
|
38
|
+
* @property {() => void} [onRemove] remove 핸들러
|
|
39
|
+
*/
|
|
40
|
+
export interface SelectMultipleTag {
|
|
41
|
+
/**
|
|
42
|
+
* chip 라벨
|
|
43
|
+
*/
|
|
44
|
+
label: ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* 서브 라벨
|
|
47
|
+
*/
|
|
48
|
+
suffix?: ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* remove 버튼 노출 여부
|
|
51
|
+
*/
|
|
52
|
+
removable?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* remove 핸들러
|
|
55
|
+
*/
|
|
56
|
+
onRemove?: () => void;
|
|
57
|
+
}
|