gladvn 0.2.35 → 0.2.37
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 +1 -1
- package/package.json +2 -1
- package/scripts/strip-comments.ts +79 -0
- package/src/blocks/auth-form.tsx +34 -30
- package/src/blocks/auth-recovery.tsx +9 -13
- package/src/blocks/auth-split.tsx +46 -36
- package/src/blocks/settings.tsx +84 -117
- package/src/components/macro/alert-preset.tsx +3 -1
- package/src/components/macro/carousel-preset.tsx +0 -1
- package/src/components/macro/checkbox-preset.test.tsx +2 -2
- package/src/components/macro/checkbox-preset.tsx +1 -2
- package/src/components/macro/command-preset.tsx +1 -1
- package/src/components/macro/date-picker.tsx +5 -18
- package/src/components/macro/dialog-preset.tsx +5 -3
- package/src/components/macro/input-preset.tsx +0 -1
- package/src/components/macro/select-preset.tsx +1 -1
- package/src/components/macro/switch-preset.test.tsx +1 -1
- package/src/components/micro/accordion.test.tsx +6 -12
- package/src/components/micro/alert-dialog.tsx +0 -2
- package/src/components/micro/alert.test.tsx +5 -8
- package/src/components/micro/alert.tsx +0 -2
- package/src/components/micro/badge.test.tsx +5 -7
- package/src/components/micro/badge.tsx +1 -3
- package/src/components/micro/button.test.tsx +19 -26
- package/src/components/micro/button.tsx +3 -11
- package/src/components/micro/calendar.tsx +12 -13
- package/src/components/micro/card.test.tsx +3 -5
- package/src/components/micro/carousel.tsx +0 -1
- package/src/components/micro/chart.tsx +3 -2
- package/src/components/micro/checkbox.test.tsx +9 -18
- package/src/components/micro/combobox.tsx +1 -3
- package/src/components/micro/command.tsx +23 -11
- package/src/components/micro/context-menu.tsx +0 -2
- package/src/components/micro/dialog.test.tsx +6 -14
- package/src/components/micro/dialog.tsx +0 -2
- package/src/components/micro/drawer.tsx +0 -3
- package/src/components/micro/dropdown-menu.test.tsx +8 -14
- package/src/components/micro/dropdown-menu.tsx +0 -2
- package/src/components/micro/field.tsx +3 -3
- package/src/components/micro/hover-card.tsx +0 -2
- package/src/components/micro/input-group.tsx +9 -42
- package/src/components/micro/input.test.tsx +15 -24
- package/src/components/micro/navigation-menu.tsx +0 -2
- package/src/components/micro/popover.test.tsx +5 -9
- package/src/components/micro/progress.tsx +5 -1
- package/src/components/micro/select.test.tsx +5 -18
- package/src/components/micro/select.tsx +3 -5
- package/src/components/micro/separator.tsx +1 -1
- package/src/components/micro/sheet.test.tsx +6 -14
- package/src/components/micro/sheet.tsx +0 -2
- package/src/components/micro/sidebar.tsx +5 -6
- package/src/components/micro/sonner.tsx +0 -1
- package/src/components/micro/switch.test.tsx +9 -18
- package/src/components/micro/switch.tsx +1 -1
- package/src/components/micro/tabs.test.tsx +5 -11
- package/src/components/micro/theme-provider.tsx +0 -12
- package/src/components/micro/toggle-group.tsx +1 -12
- package/src/components/micro/tooltip.test.tsx +7 -12
- package/src/dev/App.tsx +6 -6
- package/src/dev/components/BlockViewer.tsx +15 -4
- package/src/dev/components/Container.tsx +20 -0
- package/src/dev/components/GladvnLogo.tsx +3 -9
- package/src/dev/components/code-highlighter.tsx +5 -3
- package/src/dev/components/showcase.tsx +116 -168
- package/src/dev/sections/buttons.tsx +4 -9
- package/src/dev/sections/display.tsx +68 -72
- package/src/dev/sections/feedback.tsx +304 -314
- package/src/dev/sections/forms.tsx +10 -14
- package/src/dev/sections/interactive.tsx +32 -32
- package/src/dev/sections/overview.tsx +2 -10
- package/src/dev/showcase/accordion.tsx +512 -554
- package/src/dev/showcase/alert-dialog.tsx +525 -565
- package/src/dev/showcase/alert.tsx +352 -402
- package/src/dev/showcase/aspect-ratio.tsx +167 -193
- package/src/dev/showcase/avatar.tsx +231 -269
- package/src/dev/showcase/badge.tsx +92 -140
- package/src/dev/showcase/breadcrumb.tsx +113 -135
- package/src/dev/showcase/button.tsx +140 -173
- package/src/dev/showcase/calendar.tsx +187 -237
- package/src/dev/showcase/card.tsx +229 -261
- package/src/dev/showcase/carousel.tsx +288 -315
- package/src/dev/showcase/chart.tsx +44 -50
- package/src/dev/showcase/checkbox.tsx +286 -330
- package/src/dev/showcase/collapsible.tsx +143 -160
- package/src/dev/showcase/combobox.tsx +327 -369
- package/src/dev/showcase/command.tsx +106 -120
- package/src/dev/showcase/context-menu.tsx +93 -107
- package/src/dev/showcase/dialog.tsx +585 -630
- package/src/dev/showcase/drawer.tsx +176 -196
- package/src/dev/showcase/dropdown-menu.tsx +183 -201
- package/src/dev/showcase/empty.tsx +232 -274
- package/src/dev/showcase/hover-card.tsx +153 -180
- package/src/dev/showcase/input-group.tsx +221 -253
- package/src/dev/showcase/input-otp.tsx +204 -250
- package/src/dev/showcase/input.tsx +246 -325
- package/src/dev/showcase/item.tsx +134 -152
- package/src/dev/showcase/kbd.tsx +149 -172
- package/src/dev/showcase/label.tsx +50 -68
- package/src/dev/showcase/menubar.tsx +194 -213
- package/src/dev/showcase/navigation-menu.tsx +119 -133
- package/src/dev/showcase/overview-components/ArchitectureSection.tsx +126 -0
- package/src/dev/showcase/overview-components/CodeBlock.tsx +50 -0
- package/src/dev/showcase/overview-components/ColorPaletteSection.tsx +44 -0
- package/src/dev/showcase/overview-components/DashboardPreview.tsx +159 -0
- package/src/dev/showcase/overview-components/FeatureGridSection.tsx +535 -0
- package/src/dev/showcase/overview-components/FooterCTA.tsx +137 -0
- package/src/dev/showcase/overview-components/HeroSection.tsx +65 -0
- package/src/dev/showcase/overview-components/PrinciplesSection.tsx +128 -0
- package/src/dev/showcase/overview.tsx +21 -1163
- package/src/dev/showcase/pagination.tsx +144 -190
- package/src/dev/showcase/popover.tsx +181 -196
- package/src/dev/showcase/progress.tsx +141 -189
- package/src/dev/showcase/radio-group.tsx +272 -332
- package/src/dev/showcase/resizable.tsx +119 -141
- package/src/dev/showcase/scroll-area.tsx +21 -36
- package/src/dev/showcase/select.tsx +262 -322
- package/src/dev/showcase/separator.tsx +75 -73
- package/src/dev/showcase/sheet.tsx +333 -361
- package/src/dev/showcase/sidebar.tsx +53 -59
- package/src/dev/showcase/skeleton.tsx +93 -112
- package/src/dev/showcase/slider.tsx +244 -296
- package/src/dev/showcase/sonner.tsx +251 -258
- package/src/dev/showcase/spinner.tsx +46 -67
- package/src/dev/showcase/switch.tsx +298 -362
- package/src/dev/showcase/table.tsx +76 -80
- package/src/dev/showcase/tabs.tsx +302 -355
- package/src/dev/showcase/textarea.tsx +240 -293
- package/src/dev/showcase/toast.tsx +48 -54
- package/src/dev/showcase/toggle-group.tsx +104 -129
- package/src/dev/showcase/toggle.tsx +82 -102
- package/src/dev/showcase/tooltip.tsx +173 -192
- package/src/dev/showcase/why.tsx +6 -12
- package/src/hooks/use-mobile.test.ts +3 -2
- package/src/lib/utils.test.ts +5 -4
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
DocsP,
|
|
28
28
|
DocsUl,
|
|
29
29
|
ExampleGrid,
|
|
30
|
-
|
|
30
|
+
ShowcaseExample,
|
|
31
31
|
Showcase,
|
|
32
32
|
ShowcaseDocs
|
|
33
33
|
} from "../../dev/components/showcase";
|
|
@@ -39,13 +39,9 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
39
39
|
const [count, setCount] = useState(0);
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
|
-
<div className="space-y-10
|
|
43
|
-
{/* ── Text / Icon Addons ─────────────────────────────── */}
|
|
42
|
+
<div className="space-y-10">
|
|
44
43
|
<ExampleGrid>
|
|
45
|
-
<
|
|
46
|
-
label="Text Prefix & Suffix"
|
|
47
|
-
description="InputGroupAddon với văn bản — click addon để focus input."
|
|
48
|
-
codeString={`<InputGroup size="md">
|
|
44
|
+
<ShowcaseExample title="Text Prefix & Suffix" description="InputGroupAddon với văn bản — click addon để focus input." code={`<InputGroup size="md">
|
|
49
45
|
<InputGroupAddon>
|
|
50
46
|
<InputGroupText>https://</InputGroupText>
|
|
51
47
|
</InputGroupAddon>
|
|
@@ -56,23 +52,21 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
56
52
|
<InputGroupAddon align="end">
|
|
57
53
|
<InputGroupText>.vn</InputGroupText>
|
|
58
54
|
</InputGroupAddon>
|
|
59
|
-
</InputGroup>`}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
</InputGroup>`} preview={
|
|
56
|
+
<>
|
|
57
|
+
<InputGroup size={globalSize} className="w-full">
|
|
58
|
+
<InputGroupAddon>
|
|
59
|
+
<InputGroupText>https://</InputGroupText>
|
|
60
|
+
</InputGroupAddon>
|
|
61
|
+
<InputGroupInput id="ig-url" placeholder="example.com" />
|
|
62
|
+
<InputGroupAddon align="end">
|
|
63
|
+
<InputGroupText>.vn</InputGroupText>
|
|
64
|
+
</InputGroupAddon>
|
|
65
|
+
</InputGroup>
|
|
66
|
+
</>
|
|
67
|
+
} />
|
|
71
68
|
|
|
72
|
-
<
|
|
73
|
-
label="Icon Prefix & Text Suffix"
|
|
74
|
-
description="InputGroupAddon với icon — thường dùng cho tiền tệ, số lượng."
|
|
75
|
-
codeString={`<InputGroup size="md">
|
|
69
|
+
<ShowcaseExample title="Icon Prefix & Text Suffix" description="InputGroupAddon với icon — thường dùng cho tiền tệ, số lượng." code={`<InputGroup size="md">
|
|
76
70
|
<InputGroupAddon>
|
|
77
71
|
<InputGroupText>
|
|
78
72
|
<DollarSignIcon aria-hidden="true" />
|
|
@@ -82,28 +76,25 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
82
76
|
<InputGroupAddon align="end">
|
|
83
77
|
<InputGroupText>USD</InputGroupText>
|
|
84
78
|
</InputGroupAddon>
|
|
85
|
-
</InputGroup>`}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
79
|
+
</InputGroup>`} preview={
|
|
80
|
+
<>
|
|
81
|
+
<InputGroup size={globalSize} className="w-full">
|
|
82
|
+
<InputGroupAddon>
|
|
83
|
+
<InputGroupText>
|
|
84
|
+
<DollarSignIcon aria-hidden="true" />
|
|
85
|
+
</InputGroupText>
|
|
86
|
+
</InputGroupAddon>
|
|
87
|
+
<InputGroupInput id="ig-price" placeholder="0.00" />
|
|
88
|
+
<InputGroupAddon align="end">
|
|
89
|
+
<InputGroupText>USD</InputGroupText>
|
|
90
|
+
</InputGroupAddon>
|
|
91
|
+
</InputGroup>
|
|
92
|
+
</>
|
|
93
|
+
} />
|
|
99
94
|
</ExampleGrid>
|
|
100
95
|
|
|
101
|
-
{/* ── Icon Buttons (utility) ─────────────────────────── */}
|
|
102
96
|
<ExampleGrid>
|
|
103
|
-
<
|
|
104
|
-
label="Password Toggle"
|
|
105
|
-
description="InputGroupButton icon đặt trực tiếp trong InputGroup — tự có border-l border-l-border phân tách."
|
|
106
|
-
codeString={`const [show, setShow] = useState(false);
|
|
97
|
+
<ShowcaseExample title="Password Toggle" description="InputGroupButton icon đặt trực tiếp trong InputGroup — tự có border-l border-l-border phân tách." code={`const [show, setShow] = useState(false);
|
|
107
98
|
<InputGroup size="md">
|
|
108
99
|
<InputGroupInput
|
|
109
100
|
id="password-input"
|
|
@@ -121,32 +112,30 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
121
112
|
<EyeIcon aria-hidden="true" />
|
|
122
113
|
)}
|
|
123
114
|
</InputGroupButton>
|
|
124
|
-
</InputGroup>`}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
115
|
+
</InputGroup>`} preview={
|
|
116
|
+
<>
|
|
117
|
+
<InputGroup size={globalSize} className="w-full">
|
|
118
|
+
<InputGroupInput
|
|
119
|
+
id="ig-password"
|
|
120
|
+
type={showPassword ? "text" : "password"}
|
|
121
|
+
placeholder="••••••••"
|
|
122
|
+
/>
|
|
123
|
+
<InputGroupButton
|
|
124
|
+
icon
|
|
125
|
+
aria-label={showPassword ? "Hide password" : "Show password"}
|
|
126
|
+
onClick={() => setShowPassword((p) => !p)}
|
|
127
|
+
>
|
|
128
|
+
{showPassword ? (
|
|
129
|
+
<EyeOffIcon aria-hidden="true" />
|
|
130
|
+
) : (
|
|
131
|
+
<EyeIcon aria-hidden="true" />
|
|
132
|
+
)}
|
|
133
|
+
</InputGroupButton>
|
|
134
|
+
</InputGroup>
|
|
135
|
+
</>
|
|
136
|
+
} />
|
|
145
137
|
|
|
146
|
-
<
|
|
147
|
-
label="Clear Button"
|
|
148
|
-
description="InputGroupButton icon để xoá nhanh nội dung — hiện có điều kiện."
|
|
149
|
-
codeString={`const [value, setValue] = useState("");
|
|
138
|
+
<ShowcaseExample title="Clear Button" description="InputGroupButton icon để xoá nhanh nội dung — hiện có điều kiện." code={`const [value, setValue] = useState("");
|
|
150
139
|
<InputGroup size="md">
|
|
151
140
|
<InputGroupAddon>
|
|
152
141
|
<InputGroupText>
|
|
@@ -157,7 +146,7 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
157
146
|
id="search-input"
|
|
158
147
|
value={value}
|
|
159
148
|
onChange={(e) => setValue(e.target.value)}
|
|
160
|
-
placeholder="
|
|
149
|
+
placeholder="Tìm kiếm..."
|
|
161
150
|
/>
|
|
162
151
|
{value && (
|
|
163
152
|
<InputGroupButton
|
|
@@ -168,60 +157,55 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
168
157
|
<XIcon aria-hidden="true" />
|
|
169
158
|
</InputGroupButton>
|
|
170
159
|
)}
|
|
171
|
-
</InputGroup>`}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
160
|
+
</InputGroup>`} preview={
|
|
161
|
+
<>
|
|
162
|
+
<InputGroup size={globalSize} className="w-full">
|
|
163
|
+
<InputGroupAddon>
|
|
164
|
+
<InputGroupText>
|
|
165
|
+
<SearchIcon aria-hidden="true" />
|
|
166
|
+
</InputGroupText>
|
|
167
|
+
</InputGroupAddon>
|
|
168
|
+
<InputGroupInput
|
|
169
|
+
id="ig-search"
|
|
170
|
+
value={clearValue}
|
|
171
|
+
onChange={(e) => setClearValue(e.target.value)}
|
|
172
|
+
placeholder="Tìm kiếm..."
|
|
173
|
+
/>
|
|
174
|
+
{clearValue && (
|
|
175
|
+
<InputGroupButton
|
|
176
|
+
icon
|
|
177
|
+
aria-label="Clear"
|
|
178
|
+
onClick={() => setClearValue("")}
|
|
179
|
+
>
|
|
180
|
+
<XIcon aria-hidden="true" />
|
|
181
|
+
</InputGroupButton>
|
|
182
|
+
)}
|
|
183
|
+
</InputGroup>
|
|
184
|
+
</>
|
|
185
|
+
} />
|
|
196
186
|
</ExampleGrid>
|
|
197
187
|
|
|
198
|
-
{/* ── Text Buttons ───────────────────────────────────── */}
|
|
199
188
|
<ExampleGrid>
|
|
200
|
-
<
|
|
201
|
-
label="Text Button (non-icon)"
|
|
202
|
-
description="InputGroupButton không có prop icon — dùng horizontal padding và font-size từ group."
|
|
203
|
-
codeString={`<InputGroup size="md">
|
|
189
|
+
<ShowcaseExample title="Text Button (non-icon)" description="InputGroupButton không có prop icon — dùng horizontal padding và font-size từ group." code={`<InputGroup size="md">
|
|
204
190
|
<InputGroupInput
|
|
205
191
|
id="find-input"
|
|
206
|
-
placeholder="
|
|
192
|
+
placeholder="Tìm kiếm..."
|
|
207
193
|
/>
|
|
208
194
|
<InputGroupButton variant="solid">
|
|
209
195
|
<SearchIcon aria-hidden="true" /> Find
|
|
210
196
|
</InputGroupButton>
|
|
211
|
-
</InputGroup>`}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
197
|
+
</InputGroup>`} preview={
|
|
198
|
+
<>
|
|
199
|
+
<InputGroup size={globalSize} className="w-full">
|
|
200
|
+
<InputGroupInput id="ig-find" placeholder="Tìm kiếm..." />
|
|
201
|
+
<InputGroupButton variant="solid">
|
|
202
|
+
<SearchIcon aria-hidden="true" /> Find
|
|
203
|
+
</InputGroupButton>
|
|
204
|
+
</InputGroup>
|
|
205
|
+
</>
|
|
206
|
+
} />
|
|
220
207
|
|
|
221
|
-
<
|
|
222
|
-
label="Both Ends — Counter"
|
|
223
|
-
description="Button ở cả 2 đầu — border-r border-r-border (start) và border-l border-l-border (end) tự động theo vị trí DOM."
|
|
224
|
-
codeString={`const [count, setCount] = useState(0);
|
|
208
|
+
<ShowcaseExample title="Both Ends — Counter" description="Button ở cả 2 đầu — border-r border-r-border (start) và border-l border-l-border (end) tự động theo vị trí DOM." code={`const [count, setCount] = useState(0);
|
|
225
209
|
<InputGroup size="md">
|
|
226
210
|
<InputGroupButton
|
|
227
211
|
icon
|
|
@@ -244,45 +228,42 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
244
228
|
>
|
|
245
229
|
<PlusIcon aria-hidden="true" />
|
|
246
230
|
</InputGroupButton>
|
|
247
|
-
</InputGroup>`}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
231
|
+
</InputGroup>`} preview={
|
|
232
|
+
<>
|
|
233
|
+
<InputGroup size={globalSize} className="w-full">
|
|
234
|
+
<InputGroupButton
|
|
235
|
+
icon
|
|
236
|
+
aria-label="Decrement"
|
|
237
|
+
onClick={() => setCount((c) => c - 1)}
|
|
238
|
+
>
|
|
239
|
+
<MinusIcon aria-hidden="true" />
|
|
240
|
+
</InputGroupButton>
|
|
241
|
+
<InputGroupInput
|
|
242
|
+
id="ig-counter"
|
|
243
|
+
type="number"
|
|
244
|
+
value={count}
|
|
245
|
+
onChange={(e) => setCount(Number(e.target.value))}
|
|
246
|
+
className="text-center"
|
|
247
|
+
/>
|
|
248
|
+
<InputGroupButton
|
|
249
|
+
icon
|
|
250
|
+
aria-label="Increment"
|
|
251
|
+
onClick={() => setCount((c) => c + 1)}
|
|
252
|
+
>
|
|
253
|
+
<PlusIcon aria-hidden="true" />
|
|
254
|
+
</InputGroupButton>
|
|
255
|
+
</InputGroup>
|
|
256
|
+
</>
|
|
257
|
+
} />
|
|
273
258
|
</ExampleGrid>
|
|
274
259
|
|
|
275
|
-
{/*
|
|
276
|
-
<ExampleSection
|
|
277
|
-
label="Button Variants"
|
|
278
|
-
description="InputGroupButton hỗ trợ 4 variants: ghost (default), solid, soft, outline. Demo với icon và text mode."
|
|
279
|
-
codeString={`{/* icon mode — 4 variants */}
|
|
260
|
+
<ShowcaseExample title="Button Variants" description="InputGroupButton hỗ trợ 4 variants: ghost (default), solid, soft, outline. Demo với icon và text mode." code={`{/* icon mode — 4 variants */}
|
|
280
261
|
<InputGroup size="md">
|
|
281
262
|
<InputGroupInput placeholder="ghost" />
|
|
282
263
|
<InputGroupButton
|
|
283
264
|
icon
|
|
284
265
|
variant="ghost"
|
|
285
|
-
aria-label="
|
|
266
|
+
aria-label="Tìm kiếm"
|
|
286
267
|
>
|
|
287
268
|
<SearchIcon aria-hidden="true" />
|
|
288
269
|
</InputGroupButton>
|
|
@@ -293,7 +274,7 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
293
274
|
<InputGroupButton
|
|
294
275
|
icon
|
|
295
276
|
variant="solid"
|
|
296
|
-
aria-label="
|
|
277
|
+
aria-label="Tìm kiếm"
|
|
297
278
|
>
|
|
298
279
|
<SearchIcon aria-hidden="true" />
|
|
299
280
|
</InputGroupButton>
|
|
@@ -304,7 +285,7 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
304
285
|
<InputGroupButton
|
|
305
286
|
icon
|
|
306
287
|
variant="soft"
|
|
307
|
-
aria-label="
|
|
288
|
+
aria-label="Tìm kiếm"
|
|
308
289
|
>
|
|
309
290
|
<SearchIcon aria-hidden="true" />
|
|
310
291
|
</InputGroupButton>
|
|
@@ -315,7 +296,7 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
315
296
|
<InputGroupButton
|
|
316
297
|
icon
|
|
317
298
|
variant="outline"
|
|
318
|
-
aria-label="
|
|
299
|
+
aria-label="Tìm kiếm"
|
|
319
300
|
>
|
|
320
301
|
<SearchIcon aria-hidden="true" />
|
|
321
302
|
</InputGroupButton>
|
|
@@ -342,61 +323,56 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
342
323
|
<InputGroupButton variant="outline">
|
|
343
324
|
Go
|
|
344
325
|
</InputGroupButton>
|
|
345
|
-
</InputGroup>`}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
</ExampleSection>
|
|
326
|
+
</InputGroup>`} preview={
|
|
327
|
+
<>
|
|
328
|
+
<div className="grid grid-cols-2 gap-3 sm:grid-cols-4">
|
|
329
|
+
<InputGroup size={globalSize}>
|
|
330
|
+
<InputGroupInput placeholder="ghost" />
|
|
331
|
+
<InputGroupButton icon variant="ghost" aria-label="Tìm kiếm">
|
|
332
|
+
<SearchIcon aria-hidden="true" />
|
|
333
|
+
</InputGroupButton>
|
|
334
|
+
</InputGroup>
|
|
335
|
+
<InputGroup size={globalSize}>
|
|
336
|
+
<InputGroupInput placeholder="solid" />
|
|
337
|
+
<InputGroupButton icon variant="solid" aria-label="Tìm kiếm">
|
|
338
|
+
<SearchIcon aria-hidden="true" />
|
|
339
|
+
</InputGroupButton>
|
|
340
|
+
</InputGroup>
|
|
341
|
+
<InputGroup size={globalSize}>
|
|
342
|
+
<InputGroupInput placeholder="soft" />
|
|
343
|
+
<InputGroupButton icon variant="soft" aria-label="Tìm kiếm">
|
|
344
|
+
<SearchIcon aria-hidden="true" />
|
|
345
|
+
</InputGroupButton>
|
|
346
|
+
</InputGroup>
|
|
347
|
+
<InputGroup size={globalSize}>
|
|
348
|
+
<InputGroupInput placeholder="outline" />
|
|
349
|
+
<InputGroupButton icon variant="outline" aria-label="Tìm kiếm">
|
|
350
|
+
<SearchIcon aria-hidden="true" />
|
|
351
|
+
</InputGroupButton>
|
|
352
|
+
</InputGroup>
|
|
353
|
+
</div><div className="mt-3 grid grid-cols-2 gap-3 sm:grid-cols-4">
|
|
354
|
+
<InputGroup size={globalSize}>
|
|
355
|
+
<InputGroupInput placeholder="ghost text" />
|
|
356
|
+
<InputGroupButton variant="ghost">Go</InputGroupButton>
|
|
357
|
+
</InputGroup>
|
|
358
|
+
<InputGroup size={globalSize}>
|
|
359
|
+
<InputGroupInput placeholder="solid text" />
|
|
360
|
+
<InputGroupButton variant="solid">Go</InputGroupButton>
|
|
361
|
+
</InputGroup>
|
|
362
|
+
<InputGroup size={globalSize}>
|
|
363
|
+
<InputGroupInput placeholder="soft text" />
|
|
364
|
+
<InputGroupButton variant="soft">Go</InputGroupButton>
|
|
365
|
+
</InputGroup>
|
|
366
|
+
<InputGroup size={globalSize}>
|
|
367
|
+
<InputGroupInput placeholder="outline text" />
|
|
368
|
+
<InputGroupButton variant="outline">Go</InputGroupButton>
|
|
369
|
+
</InputGroup>
|
|
370
|
+
</div>
|
|
371
|
+
</>
|
|
372
|
+
} />
|
|
393
373
|
|
|
394
|
-
{/* ── States ─────────────────────────────────────────── */}
|
|
395
374
|
<ExampleGrid>
|
|
396
|
-
<
|
|
397
|
-
label="Disabled"
|
|
398
|
-
description="Trạng thái disabled delegate lên wrapper qua has-disabled: — toàn bộ group mờ đi."
|
|
399
|
-
codeString={`<InputGroup size="md">
|
|
375
|
+
<ShowcaseExample title="Disabled" description="Trạng thái disabled delegate lên wrapper qua has-disabled: — toàn bộ group mờ đi." code={`<InputGroup size="md">
|
|
400
376
|
<InputGroupAddon>
|
|
401
377
|
<InputGroupText>
|
|
402
378
|
<GlobeIcon aria-hidden="true" />
|
|
@@ -407,22 +383,20 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
407
383
|
placeholder="Disabled"
|
|
408
384
|
disabled
|
|
409
385
|
/>
|
|
410
|
-
</InputGroup>`}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
386
|
+
</InputGroup>`} preview={
|
|
387
|
+
<>
|
|
388
|
+
<InputGroup size={globalSize} className="w-full">
|
|
389
|
+
<InputGroupAddon>
|
|
390
|
+
<InputGroupText>
|
|
391
|
+
<GlobeIcon aria-hidden="true" />
|
|
392
|
+
</InputGroupText>
|
|
393
|
+
</InputGroupAddon>
|
|
394
|
+
<InputGroupInput id="ig-disabled" placeholder="Disabled" disabled />
|
|
395
|
+
</InputGroup>
|
|
396
|
+
</>
|
|
397
|
+
} />
|
|
421
398
|
|
|
422
|
-
<
|
|
423
|
-
label="Invalid / Error"
|
|
424
|
-
description="aria-invalid='true' trên input delegate border border-border đỏ lên toàn bộ wrapper qua has-[...aria-invalid]."
|
|
425
|
-
codeString={`<InputGroup size="md">
|
|
399
|
+
<ShowcaseExample title="Invalid / Error" description="aria-invalid='true' trên input delegate border border-border đỏ lên toàn bộ wrapper qua has-[...aria-invalid]." code={`<InputGroup size="md">
|
|
426
400
|
<InputGroupAddon>
|
|
427
401
|
<InputGroupText>$</InputGroupText>
|
|
428
402
|
</InputGroupAddon>
|
|
@@ -432,27 +406,24 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
432
406
|
defaultValue="abc"
|
|
433
407
|
placeholder="0.00"
|
|
434
408
|
/>
|
|
435
|
-
</InputGroup>`}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
409
|
+
</InputGroup>`} preview={
|
|
410
|
+
<>
|
|
411
|
+
<InputGroup size={globalSize} className="w-full">
|
|
412
|
+
<InputGroupAddon>
|
|
413
|
+
<InputGroupText>$</InputGroupText>
|
|
414
|
+
</InputGroupAddon>
|
|
415
|
+
<InputGroupInput
|
|
416
|
+
id="ig-error"
|
|
417
|
+
aria-invalid="true"
|
|
418
|
+
defaultValue="abc"
|
|
419
|
+
placeholder="0.00"
|
|
420
|
+
/>
|
|
421
|
+
</InputGroup>
|
|
422
|
+
</>
|
|
423
|
+
} />
|
|
449
424
|
</ExampleGrid>
|
|
450
425
|
|
|
451
|
-
|
|
452
|
-
<ExampleSection
|
|
453
|
-
label="With Textarea"
|
|
454
|
-
description="InputGroupTextarea — InputGroup wrapper tự co giãn chiều cao với className='h-auto'."
|
|
455
|
-
codeString={`<InputGroup size="md" className="h-auto">
|
|
426
|
+
<ShowcaseExample title="With Textarea" description="InputGroupTextarea — InputGroup wrapper tự co giãn chiều cao với className='h-auto'." code={`<InputGroup size="md" className="h-auto">
|
|
456
427
|
<InputGroupAddon className="self-start">
|
|
457
428
|
<InputGroupText>@</InputGroupText>
|
|
458
429
|
</InputGroupAddon>
|
|
@@ -461,19 +432,20 @@ function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
461
432
|
placeholder="Write a comment..."
|
|
462
433
|
rows={4}
|
|
463
434
|
/>
|
|
464
|
-
</InputGroup>`}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
435
|
+
</InputGroup>`} preview={
|
|
436
|
+
<>
|
|
437
|
+
<InputGroup size={globalSize} className="h-auto w-full">
|
|
438
|
+
<InputGroupAddon className="self-start">
|
|
439
|
+
<InputGroupText>@</InputGroupText>
|
|
440
|
+
</InputGroupAddon>
|
|
441
|
+
<InputGroupTextarea
|
|
442
|
+
id="ig-comment"
|
|
443
|
+
placeholder="Write a comment..."
|
|
444
|
+
rows={4}
|
|
445
|
+
/>
|
|
446
|
+
</InputGroup>
|
|
447
|
+
</>
|
|
448
|
+
} />
|
|
477
449
|
</div>
|
|
478
450
|
);
|
|
479
451
|
}
|
|
@@ -484,7 +456,7 @@ export default function InputGroupShowcase() {
|
|
|
484
456
|
<Showcase
|
|
485
457
|
title="Input Group"
|
|
486
458
|
description="Kết hợp input với text, icon và action button bên trong một wrapper tuyến tính theo size."
|
|
487
|
-
|
|
459
|
+
guideline={
|
|
488
460
|
<ShowcaseDocs>
|
|
489
461
|
<DocsH3>Kiến trúc Self-Contained</DocsH3>
|
|
490
462
|
<DocsP>
|
|
@@ -533,11 +505,7 @@ export default function InputGroupShowcase() {
|
|
|
533
505
|
</DocsP>
|
|
534
506
|
</ShowcaseDocs>
|
|
535
507
|
}
|
|
536
|
-
|
|
537
|
-
{
|
|
538
|
-
label: "Micro (Primitive)",
|
|
539
|
-
content: <InputGroupMicroShowcase globalSize={globalSize} /> },
|
|
540
|
-
]}
|
|
508
|
+
micro={{ content: <InputGroupMicroShowcase globalSize={globalSize} /> }}
|
|
541
509
|
/>
|
|
542
510
|
);
|
|
543
511
|
}
|