@chotot/clad-ui 3.0.1 → 3.1.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/CHANGELOG.md +14 -0
- package/dist/components/MultiSearchDropdown/MultiSearchDropdown.cjs +1 -1
- package/dist/components/MultiSearchDropdown/MultiSearchDropdown.es.js +97 -88
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.es.js +80 -45
- package/dist/components/TagCloud/TagCloud.cjs +1 -1
- package/dist/components/TagCloud/TagCloud.d.ts +1 -1
- package/dist/components/TagCloud/TagCloud.es.js +12 -11
- package/dist/components/TagCloud/types.d.ts +5 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/skills/clad-ui/SKILL.md +15 -2
- package/skills/clad-ui/references/components-display-layout.md +1 -0
- package/skills/clad-ui-feedback/SKILL.md +1 -1
- package/skills/migrate-clad-ui-v3/SKILL.md +1 -1
- package/src/styles/base/base.css +1 -0
- package/src/styles/components/button.css +25 -0
- package/src/styles/components/chip.css +35 -0
- package/src/styles/components/drawer.css +9 -0
package/package.json
CHANGED
package/skills/clad-ui/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ metadata:
|
|
|
5
5
|
purpose: Build and style React UI using @chotot/clad-ui (Clad UI v3, Tailwind CSS v4) and @chotot/icons. Use when creating or updating UI components, selecting semantic color/typography tokens, wiring forms, modals, drawers, or tabs. Not for migrating legacy @chotot/clad-ui v2 Linaria code, use migrate-clad-ui-v3 instead.
|
|
6
6
|
type: core
|
|
7
7
|
library: '@chotot/clad-ui'
|
|
8
|
-
library_version: '3.0
|
|
8
|
+
library_version: '3.1.0'
|
|
9
9
|
sources:
|
|
10
10
|
- 'carousell/clad-ui:packages/clad-ui/src/**'
|
|
11
11
|
---
|
|
@@ -48,6 +48,19 @@ Discovery reads (fallback when an edge-case prop or icon name is not in `referen
|
|
|
48
48
|
| Inline banner alert with icon and action | `Announcer` |
|
|
49
49
|
| Raw `<h1>`–`<p>` with manual font sizes/weights | Typography components (`HeaderPage`, `LabelSection`, `BodySection`...) or `text-{header,label,body}-*` |
|
|
50
50
|
|
|
51
|
+
## Typography Hierarchy (24 Components & Utilities)
|
|
52
|
+
|
|
53
|
+
Always compose text using this 6-tier semantic hierarchy instead of raw `text-sm` / `font-bold`:
|
|
54
|
+
|
|
55
|
+
| Tier (Weight / Style) | Components (`@chotot/clad-ui`) | Tailwind Utilities | Typical Role |
|
|
56
|
+
|---|---|---|---|
|
|
57
|
+
| **1. Display** (Bold) | `DisplayPage`, `DisplaySection`, `DisplayCaption`, `DisplayAnnotation`, `DisplayPrice` | `text-display-{page,section,caption,annotation,price}` | Hero headlines, KPI numbers, highlighted listing price (`DisplayPrice`) |
|
|
58
|
+
| **2. Header** (SemiBold) | `HeaderPage`, `HeaderSection`, `HeaderCaption`, `HeaderAnnotation` | `text-header-{page,section,caption,annotation}` | Page (`h1`), modal/drawer, and section (`h2`–`h3`) headings |
|
|
59
|
+
| **3. Label** (Bold) | `LabelPage`, `LabelSection`, `LabelCaption`, `LabelAnnotation` | `text-label-{page,section,caption,annotation}` | Card titles, field/button labels, emphasized inline values |
|
|
60
|
+
| **4. Body** (Regular) | `BodyPage`, `BodySection`, `BodyCaption`, `BodyAnnotation` | `text-body-{page,section,caption,annotation}` | Primary copy, descriptions, list/form content |
|
|
61
|
+
| **5. Note** (Italic) | `NotePage`, `NoteSection`, `NoteCaption` | `text-note-{page,section,caption}` | Secondary hints, disclaimers, timestamps |
|
|
62
|
+
| **6. Tagline** (Medium) | `TaglineSection`, `TaglineCaption`, `TaglineAnnotation`, `TaglineFootext` | `text-tagline-{section,caption,annotation,footext}` | Chips, badges, metadata pills, compact footers |
|
|
63
|
+
|
|
51
64
|
---
|
|
52
65
|
|
|
53
66
|
## Critical API & Event Gotchas
|
|
@@ -80,7 +93,7 @@ Discovery reads (fallback when an edge-case prop or icon name is not in `referen
|
|
|
80
93
|
|---|---|
|
|
81
94
|
| **Tokens** | Bg: `bg-background-{primary,secondary,tertiary,app,brand,brand-light,brand-light-secondary,chotot,info,success,error,warning}` · Text: `text-text-{primary,secondary,tertiary,disabled,blank,brand,on-background,info,success,error,warning}` · Border: `border-border-{divider,thin,regular,bold,active,brand,error,warning}` · Icon: `text-icon-{primary,secondary,tertiary,brand,error,success,warning}` · Typo: `text-{display,header,label,body}-{page,section,caption,annotation}`, `text-tagline-{section,caption,annotation,footext}` · Radius: `rounded-{ad-small,ad,card-small,card,decoration,modal,pill}` · Shadow: `shadow-{below,floating}` |
|
|
82
95
|
| **Buttons** | `<Button color="primary\|info\|success\|error\|neutral\|tertiary" variant="solid\|outline\|tonal" size="sm\|md\|lg\|xl" icon isLoading as="a">` (also accepts `'small\|medium\|large\|xlarge'`) · Aliases: `IconButton`, `GhostButton`, `ButtonLink` |
|
|
83
|
-
| **Chips & Tags** | `<Chip variant="fill\|outline\|ghost" size="sm\|md\|lg" active dropdownIcon icon={…} onClose={(val, e) => …} />` · `<TagCloud options={[{value,label}]} value={v} variant="fill\|outline" multiple maxSelection={n} onChange={e => setV(e.target.value)} />` |
|
|
96
|
+
| **Chips & Tags** | `<Chip variant="fill\|outline\|ghost" size="sm\|md\|lg\|xl" active dropdownIcon icon={…} onClose={(val, e) => …} />` · `<TagCloud options={[{value,label}]} value={v} variant="fill\|outline" size="sm\|md\|lg\|xl" multiple maxSelection={n} onChange={e => setV(e.target.value)} />` |
|
|
84
97
|
| **Badges & Labels** | `<Badge size="sm\|md\|lg\|dot" label="9+" backgroundColor="error\|warning\|info\|success\|neutral" variant="solid\|tonal" borderRadius="pill">{child}</Badge>` · `<TextLabel color="info\|success\|error\|warning\|neutral" type="text\|status" size="md\|sm" label="…" />` · `<ShapeIcon size="xxxs..xxl" radius="circle\|md" bg="brand-light" color="brand"><Icon /></ShapeIcon>` |
|
|
85
98
|
| **Text Inputs** | `<Input label="…" value={v} onChange={e => setV(e.target.value)} status="default\|warning\|error\|success" helptext="…" allowClear showPassword icon={…} />` · `<TextArea label="…" lines={4} value={v} status="default\|warning\|error" onChange={…} characterLimit={300} />` · `<CurrencyInput label="…" value={v} suffix=" đ" status="default\|warning\|error" onChange={e => setV(e.target.value)} onFormatChange={setFormatted} />` |
|
|
86
99
|
| **Input Groups** | `<InputGroup status="default\|error" helptext="…"><Dropdown … /><Input … /></InputGroup>` · `<RangeInput helptext="…"><Input label="Từ" … /><Input label="Đến" … /></RangeInput>` |
|
|
@@ -105,6 +105,7 @@ import { TagCloud } from '@chotot/clad-ui';
|
|
|
105
105
|
| `maxSelection` | `number` | — |
|
|
106
106
|
| `label` / `helptext` | `string` | — |
|
|
107
107
|
| `variant` | `'fill' \| 'outline'` (also accepts `'normal'`) | `'fill'` |
|
|
108
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` |
|
|
108
109
|
| `selectedTextStyle` | `'bold' \| 'normal'` | `'bold'` |
|
|
109
110
|
|
|
110
111
|
---
|
|
@@ -5,7 +5,7 @@ metadata:
|
|
|
5
5
|
purpose: Report bugs, request component/token/icon enhancements, or propose new ideas for @chotot/clad-ui, @chotot/icons, and @chotot/charts by creating structured GitHub issues in carousell/clad-ui. Use when a consumer developer hits a design system bug, missing prop/icon/token, migration blocker, or asks to file feedback/issue for Clad UI.
|
|
6
6
|
type: sub-skill
|
|
7
7
|
library: '@chotot/clad-ui'
|
|
8
|
-
library_version: '3.0
|
|
8
|
+
library_version: '3.1.0'
|
|
9
9
|
requires:
|
|
10
10
|
- clad-ui
|
|
11
11
|
sources:
|
|
@@ -5,7 +5,7 @@ metadata:
|
|
|
5
5
|
purpose: Migrate consumer React/Next.js code from @chotot/clad-ui v2 (Linaria) to @chotot/clad-ui v3 (Tailwind CSS v4) and @chotot/icons. Supports incremental file/feature migration (coexistence via @chotot/clad-ui-v2 alias) and full-repo cutover. Not for building new v3 UI from scratch, use clad-ui instead.
|
|
6
6
|
type: lifecycle
|
|
7
7
|
library: '@chotot/clad-ui'
|
|
8
|
-
library_version: '3.0
|
|
8
|
+
library_version: '3.1.0'
|
|
9
9
|
requires:
|
|
10
10
|
- clad-ui
|
|
11
11
|
sources:
|
package/src/styles/base/base.css
CHANGED
|
@@ -184,9 +184,15 @@
|
|
|
184
184
|
color: var(--solid-fg);
|
|
185
185
|
border-color: var(--solid-border, var(--solid-bg));
|
|
186
186
|
|
|
187
|
+
&:visited,
|
|
188
|
+
&:hover {
|
|
189
|
+
color: var(--solid-fg);
|
|
190
|
+
}
|
|
191
|
+
|
|
187
192
|
@media (hover: hover) {
|
|
188
193
|
&:hover {
|
|
189
194
|
background-color: var(--solid-hover);
|
|
195
|
+
color: var(--solid-fg);
|
|
190
196
|
border-color: var(
|
|
191
197
|
--solid-hover-border,
|
|
192
198
|
var(--solid-border, var(--solid-hover))
|
|
@@ -196,6 +202,7 @@
|
|
|
196
202
|
|
|
197
203
|
&:active {
|
|
198
204
|
background-color: var(--solid-active);
|
|
205
|
+
color: var(--solid-fg);
|
|
199
206
|
border-color: var(
|
|
200
207
|
--solid-active-border,
|
|
201
208
|
var(--solid-border, var(--solid-active))
|
|
@@ -215,9 +222,15 @@
|
|
|
215
222
|
color: var(--text);
|
|
216
223
|
border-color: var(--outline-border, currentColor);
|
|
217
224
|
|
|
225
|
+
&:visited,
|
|
226
|
+
&:hover {
|
|
227
|
+
color: var(--text);
|
|
228
|
+
}
|
|
229
|
+
|
|
218
230
|
@media (hover: hover) {
|
|
219
231
|
&:hover {
|
|
220
232
|
background-color: var(--light-hover);
|
|
233
|
+
color: var(--text);
|
|
221
234
|
border-color: var(
|
|
222
235
|
--outline-hover-border,
|
|
223
236
|
var(--outline-border, currentColor)
|
|
@@ -227,6 +240,7 @@
|
|
|
227
240
|
|
|
228
241
|
&:active {
|
|
229
242
|
background-color: var(--light-active);
|
|
243
|
+
color: var(--text);
|
|
230
244
|
border-color: var(
|
|
231
245
|
--outline-active-border,
|
|
232
246
|
var(--outline-border, currentColor)
|
|
@@ -246,9 +260,15 @@
|
|
|
246
260
|
color: var(--text);
|
|
247
261
|
border-color: var(--tonal-border, var(--tonal-bg));
|
|
248
262
|
|
|
263
|
+
&:visited,
|
|
264
|
+
&:hover {
|
|
265
|
+
color: var(--text);
|
|
266
|
+
}
|
|
267
|
+
|
|
249
268
|
@media (hover: hover) {
|
|
250
269
|
&:hover {
|
|
251
270
|
background-color: var(--light-hover);
|
|
271
|
+
color: var(--text);
|
|
252
272
|
border-color: var(
|
|
253
273
|
--tonal-hover-border,
|
|
254
274
|
var(--tonal-border, var(--tonal-bg))
|
|
@@ -258,6 +278,7 @@
|
|
|
258
278
|
|
|
259
279
|
&:active {
|
|
260
280
|
background-color: var(--light-active);
|
|
281
|
+
color: var(--text);
|
|
261
282
|
border-color: var(
|
|
262
283
|
--tonal-active-border,
|
|
263
284
|
var(--tonal-border, var(--tonal-bg))
|
|
@@ -301,6 +322,10 @@
|
|
|
301
322
|
border-color: var(--default-border, transparent);
|
|
302
323
|
color: var(--default-fg, var(--solid-bg));
|
|
303
324
|
|
|
325
|
+
&:visited {
|
|
326
|
+
color: var(--default-fg, var(--solid-bg));
|
|
327
|
+
}
|
|
328
|
+
|
|
304
329
|
@media (hover: hover) {
|
|
305
330
|
&:hover {
|
|
306
331
|
background-color: var(--default-hover-bg, transparent);
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
@apply relative inline-flex w-fit cursor-pointer items-center justify-center gap-1 rounded-full align-middle;
|
|
5
5
|
background-color: var(--color-background-secondary);
|
|
6
6
|
color: var(--color-text-primary);
|
|
7
|
+
|
|
8
|
+
&:visited,
|
|
9
|
+
&:active,
|
|
10
|
+
&:hover {
|
|
11
|
+
color: var(--color-text-primary);
|
|
12
|
+
}
|
|
7
13
|
}
|
|
8
14
|
|
|
9
15
|
/* ========== Sizes ========== */
|
|
@@ -60,6 +66,11 @@
|
|
|
60
66
|
background-color: var(--color-background-inverted);
|
|
61
67
|
color: var(--color-text-blank);
|
|
62
68
|
|
|
69
|
+
&:visited,
|
|
70
|
+
&:active {
|
|
71
|
+
color: var(--color-text-blank);
|
|
72
|
+
}
|
|
73
|
+
|
|
63
74
|
@media (hover: hover) {
|
|
64
75
|
&:not(.chip--disabled):hover {
|
|
65
76
|
background-color: var(--color-interaction-neutral-hover);
|
|
@@ -71,11 +82,23 @@
|
|
|
71
82
|
/* Higher specificity (2 classes) ensures disabled color beats any 1-class color rule */
|
|
72
83
|
&.chip--disabled {
|
|
73
84
|
color: var(--color-text-disabled);
|
|
85
|
+
|
|
86
|
+
&:visited,
|
|
87
|
+
&:active,
|
|
88
|
+
&:hover {
|
|
89
|
+
color: var(--color-text-disabled);
|
|
90
|
+
}
|
|
74
91
|
}
|
|
75
92
|
|
|
76
93
|
&.chip--active.chip--disabled {
|
|
77
94
|
background-color: var(--color-button-disabled);
|
|
78
95
|
color: var(--color-text-blank);
|
|
96
|
+
|
|
97
|
+
&:visited,
|
|
98
|
+
&:active,
|
|
99
|
+
&:hover {
|
|
100
|
+
color: var(--color-text-blank);
|
|
101
|
+
}
|
|
79
102
|
}
|
|
80
103
|
}
|
|
81
104
|
|
|
@@ -109,6 +132,12 @@
|
|
|
109
132
|
background-color: var(--color-background-secondary);
|
|
110
133
|
border-color: var(--color-border-regular);
|
|
111
134
|
color: var(--color-text-disabled);
|
|
135
|
+
|
|
136
|
+
&:visited,
|
|
137
|
+
&:active,
|
|
138
|
+
&:hover {
|
|
139
|
+
color: var(--color-text-disabled);
|
|
140
|
+
}
|
|
112
141
|
}
|
|
113
142
|
|
|
114
143
|
&.chip--active.chip--disabled {
|
|
@@ -143,6 +172,12 @@
|
|
|
143
172
|
&.chip--disabled {
|
|
144
173
|
background-color: var(--color-background-primary);
|
|
145
174
|
color: var(--color-text-disabled);
|
|
175
|
+
|
|
176
|
+
&:visited,
|
|
177
|
+
&:active,
|
|
178
|
+
&:hover {
|
|
179
|
+
color: var(--color-text-disabled);
|
|
180
|
+
}
|
|
146
181
|
}
|
|
147
182
|
}
|
|
148
183
|
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
left: 0;
|
|
25
25
|
width: 100vw;
|
|
26
26
|
height: 100vh;
|
|
27
|
+
height: 100dvh;
|
|
27
28
|
z-index: 1600;
|
|
28
29
|
min-height: -webkit-fill-available;
|
|
29
30
|
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
left: 0;
|
|
50
51
|
width: 100%;
|
|
51
52
|
max-height: calc(100vh - 12px);
|
|
53
|
+
max-height: calc(100dvh - 12px);
|
|
52
54
|
background-color: var(--color-background-primary);
|
|
53
55
|
border-top-left-radius: 20px;
|
|
54
56
|
border-top-right-radius: 20px;
|
|
@@ -67,6 +69,7 @@
|
|
|
67
69
|
animation: 0.2s ease-out 0s 1 drawer-scale-to-full;
|
|
68
70
|
max-width: 480px;
|
|
69
71
|
max-height: calc(100vh - 80px);
|
|
72
|
+
max-height: calc(100dvh - 80px);
|
|
70
73
|
margin-top: 40px;
|
|
71
74
|
margin-bottom: 40px;
|
|
72
75
|
|
|
@@ -95,12 +98,14 @@
|
|
|
95
98
|
&.half-height {
|
|
96
99
|
height: auto;
|
|
97
100
|
max-height: 50vh;
|
|
101
|
+
max-height: 50dvh;
|
|
98
102
|
transition:
|
|
99
103
|
max-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
100
104
|
transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
101
105
|
|
|
102
106
|
&.is-expanded {
|
|
103
107
|
max-height: calc(100vh - 12px);
|
|
108
|
+
max-height: calc(100dvh - 12px);
|
|
104
109
|
}
|
|
105
110
|
}
|
|
106
111
|
}
|
|
@@ -324,6 +329,7 @@
|
|
|
324
329
|
flex: 1;
|
|
325
330
|
min-height: 0;
|
|
326
331
|
max-height: calc(100vh - 120px);
|
|
332
|
+
max-height: calc(100dvh - 120px);
|
|
327
333
|
padding: 12px 16px;
|
|
328
334
|
margin: 0 -16px 0;
|
|
329
335
|
overflow-y: auto;
|
|
@@ -336,6 +342,7 @@
|
|
|
336
342
|
|
|
337
343
|
&.no-button {
|
|
338
344
|
max-height: calc(100vh - 76px);
|
|
345
|
+
max-height: calc(100dvh - 76px);
|
|
339
346
|
}
|
|
340
347
|
|
|
341
348
|
&.children-overflow-visible {
|
|
@@ -355,9 +362,11 @@
|
|
|
355
362
|
padding: 16px 20px;
|
|
356
363
|
margin: 0 -24px;
|
|
357
364
|
max-height: calc(100vh - 144px);
|
|
365
|
+
max-height: calc(100dvh - 144px);
|
|
358
366
|
|
|
359
367
|
&.no-button {
|
|
360
368
|
max-height: calc(100vh - 88px);
|
|
369
|
+
max-height: calc(100dvh - 88px);
|
|
361
370
|
}
|
|
362
371
|
}
|
|
363
372
|
}
|