@naminc/vnui 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +8 -2
- package/bin.mjs +275 -0
- package/package.json +36 -4
- package/registry/address-picker.json +64 -0
- package/registry/bank-selector.json +58 -0
- package/registry/currency-input.json +52 -0
- package/registry/lunar-date-picker.json +52 -0
- package/registry/phone-input.json +52 -0
- package/registry/registry.json +363 -0
- package/registry/tax-code-input.json +52 -0
- package/registry/vietnamese-search.json +46 -0
- package/registry/vietqr.json +44 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry.json",
|
|
3
|
+
"name": "vnui",
|
|
4
|
+
"homepage": "http://localhost:3000",
|
|
5
|
+
"items": [
|
|
6
|
+
{
|
|
7
|
+
"name": "phone-input",
|
|
8
|
+
"type": "registry:block",
|
|
9
|
+
"title": "Phone Input",
|
|
10
|
+
"dependencies": [],
|
|
11
|
+
"devDependencies": [],
|
|
12
|
+
"files": [
|
|
13
|
+
{
|
|
14
|
+
"path": "components/phone-input.tsx",
|
|
15
|
+
"type": "registry:file",
|
|
16
|
+
"target": "@components/vnui/components/phone-input.tsx"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "lib/phone.ts",
|
|
20
|
+
"type": "registry:file",
|
|
21
|
+
"target": "@components/vnui/lib/phone.ts"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"path": "lib/state.ts",
|
|
25
|
+
"type": "registry:file",
|
|
26
|
+
"target": "@components/vnui/lib/state.ts"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"path": "lib/validity.ts",
|
|
30
|
+
"type": "registry:file",
|
|
31
|
+
"target": "@components/vnui/lib/validity.ts"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "components/styles.css",
|
|
35
|
+
"type": "registry:file",
|
|
36
|
+
"target": "@components/vnui/components/styles.css"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "components/styles.css.d.ts",
|
|
40
|
+
"type": "registry:file",
|
|
41
|
+
"target": "@components/vnui/components/styles.css.d.ts"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"path": "LICENSE",
|
|
45
|
+
"type": "registry:file",
|
|
46
|
+
"target": "@components/vnui/LICENSE"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "currency-input",
|
|
52
|
+
"type": "registry:block",
|
|
53
|
+
"title": "Currency Input",
|
|
54
|
+
"dependencies": [],
|
|
55
|
+
"devDependencies": [],
|
|
56
|
+
"files": [
|
|
57
|
+
{
|
|
58
|
+
"path": "components/currency-input.tsx",
|
|
59
|
+
"type": "registry:file",
|
|
60
|
+
"target": "@components/vnui/components/currency-input.tsx"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"path": "lib/currency.ts",
|
|
64
|
+
"type": "registry:file",
|
|
65
|
+
"target": "@components/vnui/lib/currency.ts"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"path": "lib/state.ts",
|
|
69
|
+
"type": "registry:file",
|
|
70
|
+
"target": "@components/vnui/lib/state.ts"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"path": "lib/validity.ts",
|
|
74
|
+
"type": "registry:file",
|
|
75
|
+
"target": "@components/vnui/lib/validity.ts"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"path": "components/styles.css",
|
|
79
|
+
"type": "registry:file",
|
|
80
|
+
"target": "@components/vnui/components/styles.css"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"path": "components/styles.css.d.ts",
|
|
84
|
+
"type": "registry:file",
|
|
85
|
+
"target": "@components/vnui/components/styles.css.d.ts"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"path": "LICENSE",
|
|
89
|
+
"type": "registry:file",
|
|
90
|
+
"target": "@components/vnui/LICENSE"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "address-picker",
|
|
96
|
+
"type": "registry:block",
|
|
97
|
+
"title": "Address Picker",
|
|
98
|
+
"dependencies": [],
|
|
99
|
+
"devDependencies": [],
|
|
100
|
+
"files": [
|
|
101
|
+
{
|
|
102
|
+
"path": "components/address-picker.tsx",
|
|
103
|
+
"type": "registry:file",
|
|
104
|
+
"target": "@components/vnui/components/address-picker.tsx"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"path": "data/addresses.ts",
|
|
108
|
+
"type": "registry:file",
|
|
109
|
+
"target": "@components/vnui/data/addresses.ts"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"path": "components/combobox.tsx",
|
|
113
|
+
"type": "registry:file",
|
|
114
|
+
"target": "@components/vnui/components/combobox.tsx"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"path": "lib/search.ts",
|
|
118
|
+
"type": "registry:file",
|
|
119
|
+
"target": "@components/vnui/lib/search.ts"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"path": "components/styles.css",
|
|
123
|
+
"type": "registry:file",
|
|
124
|
+
"target": "@components/vnui/components/styles.css"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"path": "components/styles.css.d.ts",
|
|
128
|
+
"type": "registry:file",
|
|
129
|
+
"target": "@components/vnui/components/styles.css.d.ts"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"path": "lib/state.ts",
|
|
133
|
+
"type": "registry:file",
|
|
134
|
+
"target": "@components/vnui/lib/state.ts"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"path": "lib/address.ts",
|
|
138
|
+
"type": "registry:file",
|
|
139
|
+
"target": "@components/vnui/lib/address.ts"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"path": "LICENSE",
|
|
143
|
+
"type": "registry:file",
|
|
144
|
+
"target": "@components/vnui/LICENSE"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "bank-selector",
|
|
150
|
+
"type": "registry:block",
|
|
151
|
+
"title": "Bank Selector",
|
|
152
|
+
"dependencies": [],
|
|
153
|
+
"devDependencies": [],
|
|
154
|
+
"files": [
|
|
155
|
+
{
|
|
156
|
+
"path": "components/bank-selector.tsx",
|
|
157
|
+
"type": "registry:file",
|
|
158
|
+
"target": "@components/vnui/components/bank-selector.tsx"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"path": "lib/banks.ts",
|
|
162
|
+
"type": "registry:file",
|
|
163
|
+
"target": "@components/vnui/lib/banks.ts"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"path": "lib/search.ts",
|
|
167
|
+
"type": "registry:file",
|
|
168
|
+
"target": "@components/vnui/lib/search.ts"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"path": "components/combobox.tsx",
|
|
172
|
+
"type": "registry:file",
|
|
173
|
+
"target": "@components/vnui/components/combobox.tsx"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"path": "components/styles.css",
|
|
177
|
+
"type": "registry:file",
|
|
178
|
+
"target": "@components/vnui/components/styles.css"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"path": "components/styles.css.d.ts",
|
|
182
|
+
"type": "registry:file",
|
|
183
|
+
"target": "@components/vnui/components/styles.css.d.ts"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"path": "lib/state.ts",
|
|
187
|
+
"type": "registry:file",
|
|
188
|
+
"target": "@components/vnui/lib/state.ts"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"path": "LICENSE",
|
|
192
|
+
"type": "registry:file",
|
|
193
|
+
"target": "@components/vnui/LICENSE"
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "vietqr",
|
|
199
|
+
"type": "registry:block",
|
|
200
|
+
"title": "VietQR",
|
|
201
|
+
"dependencies": [
|
|
202
|
+
"qrcode@1.5.4"
|
|
203
|
+
],
|
|
204
|
+
"devDependencies": [
|
|
205
|
+
"@types/qrcode@1.5.6"
|
|
206
|
+
],
|
|
207
|
+
"files": [
|
|
208
|
+
{
|
|
209
|
+
"path": "components/vietqr.tsx",
|
|
210
|
+
"type": "registry:file",
|
|
211
|
+
"target": "@components/vnui/components/vietqr.tsx"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"path": "lib/vietqr.ts",
|
|
215
|
+
"type": "registry:file",
|
|
216
|
+
"target": "@components/vnui/lib/vietqr.ts"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"path": "components/styles.css",
|
|
220
|
+
"type": "registry:file",
|
|
221
|
+
"target": "@components/vnui/components/styles.css"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"path": "components/styles.css.d.ts",
|
|
225
|
+
"type": "registry:file",
|
|
226
|
+
"target": "@components/vnui/components/styles.css.d.ts"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"path": "LICENSE",
|
|
230
|
+
"type": "registry:file",
|
|
231
|
+
"target": "@components/vnui/LICENSE"
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"name": "tax-code-input",
|
|
237
|
+
"type": "registry:block",
|
|
238
|
+
"title": "Tax Code Input",
|
|
239
|
+
"dependencies": [],
|
|
240
|
+
"devDependencies": [],
|
|
241
|
+
"files": [
|
|
242
|
+
{
|
|
243
|
+
"path": "components/tax-code-input.tsx",
|
|
244
|
+
"type": "registry:file",
|
|
245
|
+
"target": "@components/vnui/components/tax-code-input.tsx"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"path": "lib/tax.ts",
|
|
249
|
+
"type": "registry:file",
|
|
250
|
+
"target": "@components/vnui/lib/tax.ts"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"path": "lib/state.ts",
|
|
254
|
+
"type": "registry:file",
|
|
255
|
+
"target": "@components/vnui/lib/state.ts"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"path": "lib/validity.ts",
|
|
259
|
+
"type": "registry:file",
|
|
260
|
+
"target": "@components/vnui/lib/validity.ts"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"path": "components/styles.css",
|
|
264
|
+
"type": "registry:file",
|
|
265
|
+
"target": "@components/vnui/components/styles.css"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"path": "components/styles.css.d.ts",
|
|
269
|
+
"type": "registry:file",
|
|
270
|
+
"target": "@components/vnui/components/styles.css.d.ts"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"path": "LICENSE",
|
|
274
|
+
"type": "registry:file",
|
|
275
|
+
"target": "@components/vnui/LICENSE"
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "lunar-date-picker",
|
|
281
|
+
"type": "registry:block",
|
|
282
|
+
"title": "Lunar Date Picker",
|
|
283
|
+
"dependencies": [],
|
|
284
|
+
"devDependencies": [],
|
|
285
|
+
"files": [
|
|
286
|
+
{
|
|
287
|
+
"path": "components/lunar-date-picker.tsx",
|
|
288
|
+
"type": "registry:file",
|
|
289
|
+
"target": "@components/vnui/components/lunar-date-picker.tsx"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"path": "components/lunar-editor.tsx",
|
|
293
|
+
"type": "registry:file",
|
|
294
|
+
"target": "@components/vnui/components/lunar-editor.tsx"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"path": "lib/lunar.ts",
|
|
298
|
+
"type": "registry:file",
|
|
299
|
+
"target": "@components/vnui/lib/lunar.ts"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"path": "lib/state.ts",
|
|
303
|
+
"type": "registry:file",
|
|
304
|
+
"target": "@components/vnui/lib/state.ts"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"path": "components/styles.css",
|
|
308
|
+
"type": "registry:file",
|
|
309
|
+
"target": "@components/vnui/components/styles.css"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"path": "components/styles.css.d.ts",
|
|
313
|
+
"type": "registry:file",
|
|
314
|
+
"target": "@components/vnui/components/styles.css.d.ts"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"path": "LICENSE",
|
|
318
|
+
"type": "registry:file",
|
|
319
|
+
"target": "@components/vnui/LICENSE"
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"name": "vietnamese-search",
|
|
325
|
+
"type": "registry:block",
|
|
326
|
+
"title": "Vietnamese Search",
|
|
327
|
+
"dependencies": [],
|
|
328
|
+
"devDependencies": [],
|
|
329
|
+
"files": [
|
|
330
|
+
{
|
|
331
|
+
"path": "components/vietnamese-search.tsx",
|
|
332
|
+
"type": "registry:file",
|
|
333
|
+
"target": "@components/vnui/components/vietnamese-search.tsx"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"path": "lib/search.ts",
|
|
337
|
+
"type": "registry:file",
|
|
338
|
+
"target": "@components/vnui/lib/search.ts"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"path": "lib/state.ts",
|
|
342
|
+
"type": "registry:file",
|
|
343
|
+
"target": "@components/vnui/lib/state.ts"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"path": "components/styles.css",
|
|
347
|
+
"type": "registry:file",
|
|
348
|
+
"target": "@components/vnui/components/styles.css"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"path": "components/styles.css.d.ts",
|
|
352
|
+
"type": "registry:file",
|
|
353
|
+
"target": "@components/vnui/components/styles.css.d.ts"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"path": "LICENSE",
|
|
357
|
+
"type": "registry:file",
|
|
358
|
+
"target": "@components/vnui/LICENSE"
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
]
|
|
363
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "tax-code-input",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"title": "Tax Code Input",
|
|
6
|
+
"dependencies": [],
|
|
7
|
+
"devDependencies": [],
|
|
8
|
+
"files": [
|
|
9
|
+
{
|
|
10
|
+
"path": "components/tax-code-input.tsx",
|
|
11
|
+
"type": "registry:file",
|
|
12
|
+
"target": "@components/vnui/components/tax-code-input.tsx",
|
|
13
|
+
"content": "\"use client\";\nimport { useId, useState } from \"react\";\nimport { taxCodeError, type TaxCodeType } from \"../lib/tax\";\nimport { useValue, type ValueProps } from \"../lib/state\";\nimport { useValidity } from \"../lib/validity\";\nimport \"./styles.css\";\nexport function TaxCodeInput(p: ValueProps<string> & { type?: TaxCodeType }) {\n const [v, set] = useValue(p, \"\");\n const [touched, touch] = useState(false);\n const id = useId(),\n message = v ? taxCodeError(v, p.type) : null;\n const input = useValidity(message ?? \"\");\n const error = touched && message;\n return (\n <div className={\"vn-field \" + (p.className || \"\")}>\n <label htmlFor={id}>{p.label || \"Tax identifier\"}</label>\n <input\n id={id}\n ref={input}\n onInvalid={() => touch(true)}\n name={p.name}\n disabled={p.disabled}\n value={v}\n onChange={(e) => set(e.target.value)}\n onBlur={() => touch(true)}\n placeholder=\"10, 12 or 13 digits\"\n inputMode=\"numeric\"\n aria-invalid={!!error}\n aria-describedby={error ? id + \"-err\" : undefined}\n />\n {error && (\n <small role=\"alert\" id={id + \"-err\"}>\n {error}\n </small>\n )}\n </div>\n );\n}\n"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"path": "lib/tax.ts",
|
|
17
|
+
"type": "registry:file",
|
|
18
|
+
"target": "@components/vnui/lib/tax.ts",
|
|
19
|
+
"content": "export type TaxCodeType = \"auto\" | \"organization\" | \"branch\" | \"personal\";\n\nexport function taxCodeError(\n input: string,\n type: TaxCodeType = \"auto\",\n): string | null {\n const value = input.trim();\n if (!value) return \"Enter a tax identifier.\";\n if (type === \"personal\" || (type === \"auto\" && /^\\d{12}$/.test(value))) {\n return /^\\d{12}$/.test(value)\n ? null\n : \"Enter a 12-digit personal identification number.\";\n }\n const parts = /^(\\d{10})(?:-?(\\d{3}))?$/.exec(value);\n if (!parts)\n return \"Use 10 digits for an organization or append a three-digit branch suffix.\";\n const [, base, branch] = parts;\n if (type === \"branch\" && !branch)\n return \"Append the three-digit branch suffix.\";\n if (type === \"organization\" && branch)\n return \"Use the 10-digit organization code.\";\n if (branch === \"000\") return \"The branch suffix must be between 001 and 999.\";\n if (base.slice(2, 9) === \"0000000\")\n return \"The seven-digit registration sequence must be nonzero.\";\n const weights = [31, 29, 23, 19, 17, 13, 7, 5, 3];\n const sum = weights.reduce(\n (total, weight, index) => total + weight * Number(base[index]),\n 0,\n );\n return 10 - (sum % 11) === Number(base[9])\n ? null\n : \"The tax code check digit does not match.\";\n}\n\nexport function validateTaxCode(\n input: string,\n type: TaxCodeType = \"auto\",\n): boolean {\n return taxCodeError(input, type) === null;\n}\n"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "lib/state.ts",
|
|
23
|
+
"type": "registry:file",
|
|
24
|
+
"target": "@components/vnui/lib/state.ts",
|
|
25
|
+
"content": "\"use client\";\nimport { useState } from \"react\";\nexport type ValueProps<T> = {\n value?: T;\n defaultValue?: T;\n onValueChange?: (value: T) => void;\n className?: string;\n label?: string;\n name?: string;\n disabled?: boolean;\n};\nexport function useValue<T>(\n props: ValueProps<T>,\n fallback: T,\n): [T, (v: T) => void] {\n const [local, setLocal] = useState<T>(\n props.defaultValue === undefined ? fallback : props.defaultValue,\n );\n return [\n props.value === undefined ? local : props.value,\n (v: T) => {\n if (props.value === undefined) setLocal(v);\n props.onValueChange?.(v);\n },\n ];\n}\n"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"path": "lib/validity.ts",
|
|
29
|
+
"type": "registry:file",
|
|
30
|
+
"target": "@components/vnui/lib/validity.ts",
|
|
31
|
+
"content": "\"use client\";\nimport { useImperativeHandle, useLayoutEffect, useRef, type Ref } from \"react\";\n/** Keep native form submission and a form library's focus ref in sync with validation. */\nexport function useValidity(\n message: string,\n forwarded?: Ref<HTMLInputElement>,\n) {\n const input = useRef<HTMLInputElement>(null);\n useImperativeHandle(forwarded, () => input.current!, []);\n useLayoutEffect(() => {\n input.current?.setCustomValidity(message);\n }, [message]);\n return input;\n}\n"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "components/styles.css",
|
|
35
|
+
"type": "registry:file",
|
|
36
|
+
"target": "@components/vnui/components/styles.css",
|
|
37
|
+
"content": ".vn-bank-symbol {\n font: 600 0.7rem/1.2 system-ui;\n letter-spacing: 0.02em;\n color: var(--vn-ink, CanvasText);\n padding: 3px 5px;\n margin-left: 0.7rem;\n border: 1px solid var(--vn-border, #888);\n border-radius: 3px;\n}\n.vn-bank-symbol img {\n object-fit: contain;\n}\n.vn-lunar-fields {\n display: grid;\n grid-template-columns: 1fr 1fr 1.4fr;\n gap: 0.5rem;\n}\n.vn-field .vn-apply {\n justify-self: start;\n border: 1px solid var(--vn-border, #777);\n border-radius: 4px;\n padding: 5px 10px;\n font-size: 0.82rem;\n background: var(--vn-input, Canvas);\n color: inherit;\n cursor: pointer;\n}\n.vn-stack,\n.vn-field,\n.vn-qr {\n display: grid;\n gap: 0.55rem;\n min-width: 0;\n}\n.vn-stack {\n gap: 1rem;\n}\n.vn-field label,\n.vn-qr figcaption {\n font: 500 0.81rem/1.5 var(--font-geist-sans, system-ui);\n color: inherit;\n}\n.vn-field input:not([type=\"hidden\"]):not([type=\"checkbox\"]),\n.vn-entry {\n border: 1px solid var(--vn-border, #747474);\n background: var(--vn-input, Canvas);\n color: var(--vn-ink, CanvasText);\n border-radius: 6px;\n min-width: 0;\n width: 100%;\n box-sizing: border-box;\n font: 400 0.91rem/1.3 var(--font-geist-mono, monospace);\n height: 42px;\n padding: 0 0.8rem;\n}\n.vn-lunar-leap {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n justify-self: start;\n font-size: 0.875rem;\n cursor: pointer;\n}\n.vn-field .vn-lunar-leap input[type=\"checkbox\"] {\n width: 1rem;\n height: 1rem;\n margin: 0;\n padding: 0;\n accent-color: var(--vn-focus, #67ab94);\n}\n.vn-entry {\n display: flex;\n align-items: center;\n padding: 0;\n overflow: hidden;\n}\n.vn-entry input:not([type=\"hidden\"]) {\n border: 0;\n background: transparent;\n flex: 1;\n outline: none;\n}\n.vn-entry:focus-within,\n.vn-field > input:focus-visible {\n outline: 2px solid var(--vn-focus, #67ab94);\n outline-offset: 2px;\n}\n.vn-field small,\n.vn-qr small {\n color: var(--vn-error, #e08a85);\n}\n.vn-unit,\n.vn-chevron {\n padding: 0 0.8rem;\n color: var(--muted, inherit);\n}\n.vn-country {\n display: flex;\n gap: 0.4rem;\n align-items: center;\n font: 500 0.75rem system-ui;\n margin-left: 0.75rem;\n padding-right: 0.7rem;\n border-right: 1px solid var(--vn-border, #777);\n}\n.vn-country i {\n font: normal 11px/13px sans-serif;\n color: #ffde78;\n background: #b84244;\n padding: 0 3px;\n border-radius: 2px;\n}\n.vn-combo {\n position: relative;\n}\n.vn-options {\n position: absolute;\n z-index: 12;\n top: 100%;\n margin-top: 4px;\n left: 0;\n right: 0;\n background: var(--vn-input, Canvas);\n color: var(--vn-ink, CanvasText);\n border: 1px solid var(--vn-border, #777);\n border-radius: 6px;\n padding: 4px;\n max-height: 220px;\n overflow: auto;\n text-align: left;\n}\n.vn-options > div {\n padding: 0.5rem;\n cursor: pointer;\n font-size: 0.875rem;\n}\n.vn-options > [data-active=\"true\"],\n.vn-options > div:hover {\n background: var(--vn-highlight, Highlight);\n color: var(--vn-highlight-ink, HighlightText);\n}\n.vn-matches {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.vn-matches li {\n padding: 0.45rem 0;\n}\n.vn-matches mark {\n background: #b3e3c7;\n color: #173222;\n}\n.vn-qr {\n justify-items: start;\n margin: 0;\n}\n.vn-qr img {\n max-width: 100%;\n height: auto;\n}\n.vn-qr a {\n margin-right: 1rem;\n text-decoration: underline;\n font-size: 0.85rem;\n}\n.vn-field output {\n font-family: monospace;\n font-size: 0.9rem;\n}\n"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"path": "components/styles.css.d.ts",
|
|
41
|
+
"type": "registry:file",
|
|
42
|
+
"target": "@components/vnui/components/styles.css.d.ts",
|
|
43
|
+
"content": "/** Side-effect stylesheet import for strict TypeScript consumers. */\nexport {};\n"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"path": "LICENSE",
|
|
47
|
+
"type": "registry:file",
|
|
48
|
+
"target": "@components/vnui/LICENSE",
|
|
49
|
+
"content": "MIT License\r\n\r\nCopyright (c) 2026 Ngo Dinh Nam\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "vietnamese-search",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"title": "Vietnamese Search",
|
|
6
|
+
"dependencies": [],
|
|
7
|
+
"devDependencies": [],
|
|
8
|
+
"files": [
|
|
9
|
+
{
|
|
10
|
+
"path": "components/vietnamese-search.tsx",
|
|
11
|
+
"type": "registry:file",
|
|
12
|
+
"target": "@components/vnui/components/vietnamese-search.tsx",
|
|
13
|
+
"content": "\"use client\";\nimport { useId } from \"react\";\nimport { matchRanges } from \"../lib/search\";\nimport { useValue, type ValueProps } from \"../lib/state\";\nimport \"./styles.css\";\nexport function VietnameseSearch(\n p: ValueProps<string> & { items: readonly string[]; fuzzy?: boolean },\n) {\n const [v, set] = useValue(p, \"\");\n const id = useId();\n const results = p.items\n .map((text, i) => ({ text, i, r: matchRanges(text, v, p.fuzzy) }))\n .filter((x) => !v.trim() || x.r.length);\n return (\n <div className={\"vn-field \" + (p.className || \"\")}>\n <label htmlFor={id}>{p.label || \"Search\"}</label>\n <input\n type=\"search\"\n id={id}\n name={p.name}\n disabled={p.disabled}\n value={v}\n onChange={(e) => set(e.target.value)}\n />\n <ul className=\"vn-matches\">\n {results.map(({ text, i, r }) => {\n let at = 0;\n const chunks = r.map(([a, b]) => {\n const prev = text.slice(at, a);\n at = b;\n return (\n <span key={a}>\n {prev}\n <mark>{text.slice(a, b)}</mark>\n </span>\n );\n });\n return (\n <li key={i}>\n {chunks}\n {text.slice(at)}\n </li>\n );\n })}\n </ul>\n {!results.length && <small role=\"status\">No matches</small>}\n </div>\n );\n}\n"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"path": "lib/search.ts",
|
|
17
|
+
"type": "registry:file",
|
|
18
|
+
"target": "@components/vnui/lib/search.ts",
|
|
19
|
+
"content": "export function normalizeVietnamese(input: string) {\n return input\n .normalize(\"NFD\")\n .replace(/\\p{M}/gu, \"\")\n .replace(/[đĐ]/g, \"d\")\n .toLowerCase();\n}\nexport function matchRanges(\n text: string,\n query: string,\n fuzzy = false,\n): [number, number][] {\n const q = Array.from(normalizeVietnamese(query.trim()));\n if (!q.length) return [];\n const chars: string[] = [],\n bounds: [number, number][] = [];\n for (const m of text.matchAll(/\\P{M}\\p{M}*|\\p{M}+/gu)) {\n for (const c of normalizeVietnamese(m[0])) {\n chars.push(c);\n bounds.push([m.index, m.index + m[0].length]);\n }\n }\n const out: [number, number][] = [];\n let start = -1;\n for (let i = 0; i <= chars.length - q.length; i++) {\n if (q.every((v, j) => v === chars[i + j])) {\n out.push([bounds[i][0], bounds[i + q.length - 1][1]]);\n i += q.length - 1;\n }\n }\n if (out.length || !fuzzy) return out;\n for (const c of q) {\n start = chars.indexOf(c, start + 1);\n if (start < 0) return [];\n out.push(bounds[start]);\n }\n return out;\n}\n"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "lib/state.ts",
|
|
23
|
+
"type": "registry:file",
|
|
24
|
+
"target": "@components/vnui/lib/state.ts",
|
|
25
|
+
"content": "\"use client\";\nimport { useState } from \"react\";\nexport type ValueProps<T> = {\n value?: T;\n defaultValue?: T;\n onValueChange?: (value: T) => void;\n className?: string;\n label?: string;\n name?: string;\n disabled?: boolean;\n};\nexport function useValue<T>(\n props: ValueProps<T>,\n fallback: T,\n): [T, (v: T) => void] {\n const [local, setLocal] = useState<T>(\n props.defaultValue === undefined ? fallback : props.defaultValue,\n );\n return [\n props.value === undefined ? local : props.value,\n (v: T) => {\n if (props.value === undefined) setLocal(v);\n props.onValueChange?.(v);\n },\n ];\n}\n"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"path": "components/styles.css",
|
|
29
|
+
"type": "registry:file",
|
|
30
|
+
"target": "@components/vnui/components/styles.css",
|
|
31
|
+
"content": ".vn-bank-symbol {\n font: 600 0.7rem/1.2 system-ui;\n letter-spacing: 0.02em;\n color: var(--vn-ink, CanvasText);\n padding: 3px 5px;\n margin-left: 0.7rem;\n border: 1px solid var(--vn-border, #888);\n border-radius: 3px;\n}\n.vn-bank-symbol img {\n object-fit: contain;\n}\n.vn-lunar-fields {\n display: grid;\n grid-template-columns: 1fr 1fr 1.4fr;\n gap: 0.5rem;\n}\n.vn-field .vn-apply {\n justify-self: start;\n border: 1px solid var(--vn-border, #777);\n border-radius: 4px;\n padding: 5px 10px;\n font-size: 0.82rem;\n background: var(--vn-input, Canvas);\n color: inherit;\n cursor: pointer;\n}\n.vn-stack,\n.vn-field,\n.vn-qr {\n display: grid;\n gap: 0.55rem;\n min-width: 0;\n}\n.vn-stack {\n gap: 1rem;\n}\n.vn-field label,\n.vn-qr figcaption {\n font: 500 0.81rem/1.5 var(--font-geist-sans, system-ui);\n color: inherit;\n}\n.vn-field input:not([type=\"hidden\"]):not([type=\"checkbox\"]),\n.vn-entry {\n border: 1px solid var(--vn-border, #747474);\n background: var(--vn-input, Canvas);\n color: var(--vn-ink, CanvasText);\n border-radius: 6px;\n min-width: 0;\n width: 100%;\n box-sizing: border-box;\n font: 400 0.91rem/1.3 var(--font-geist-mono, monospace);\n height: 42px;\n padding: 0 0.8rem;\n}\n.vn-lunar-leap {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n justify-self: start;\n font-size: 0.875rem;\n cursor: pointer;\n}\n.vn-field .vn-lunar-leap input[type=\"checkbox\"] {\n width: 1rem;\n height: 1rem;\n margin: 0;\n padding: 0;\n accent-color: var(--vn-focus, #67ab94);\n}\n.vn-entry {\n display: flex;\n align-items: center;\n padding: 0;\n overflow: hidden;\n}\n.vn-entry input:not([type=\"hidden\"]) {\n border: 0;\n background: transparent;\n flex: 1;\n outline: none;\n}\n.vn-entry:focus-within,\n.vn-field > input:focus-visible {\n outline: 2px solid var(--vn-focus, #67ab94);\n outline-offset: 2px;\n}\n.vn-field small,\n.vn-qr small {\n color: var(--vn-error, #e08a85);\n}\n.vn-unit,\n.vn-chevron {\n padding: 0 0.8rem;\n color: var(--muted, inherit);\n}\n.vn-country {\n display: flex;\n gap: 0.4rem;\n align-items: center;\n font: 500 0.75rem system-ui;\n margin-left: 0.75rem;\n padding-right: 0.7rem;\n border-right: 1px solid var(--vn-border, #777);\n}\n.vn-country i {\n font: normal 11px/13px sans-serif;\n color: #ffde78;\n background: #b84244;\n padding: 0 3px;\n border-radius: 2px;\n}\n.vn-combo {\n position: relative;\n}\n.vn-options {\n position: absolute;\n z-index: 12;\n top: 100%;\n margin-top: 4px;\n left: 0;\n right: 0;\n background: var(--vn-input, Canvas);\n color: var(--vn-ink, CanvasText);\n border: 1px solid var(--vn-border, #777);\n border-radius: 6px;\n padding: 4px;\n max-height: 220px;\n overflow: auto;\n text-align: left;\n}\n.vn-options > div {\n padding: 0.5rem;\n cursor: pointer;\n font-size: 0.875rem;\n}\n.vn-options > [data-active=\"true\"],\n.vn-options > div:hover {\n background: var(--vn-highlight, Highlight);\n color: var(--vn-highlight-ink, HighlightText);\n}\n.vn-matches {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.vn-matches li {\n padding: 0.45rem 0;\n}\n.vn-matches mark {\n background: #b3e3c7;\n color: #173222;\n}\n.vn-qr {\n justify-items: start;\n margin: 0;\n}\n.vn-qr img {\n max-width: 100%;\n height: auto;\n}\n.vn-qr a {\n margin-right: 1rem;\n text-decoration: underline;\n font-size: 0.85rem;\n}\n.vn-field output {\n font-family: monospace;\n font-size: 0.9rem;\n}\n"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "components/styles.css.d.ts",
|
|
35
|
+
"type": "registry:file",
|
|
36
|
+
"target": "@components/vnui/components/styles.css.d.ts",
|
|
37
|
+
"content": "/** Side-effect stylesheet import for strict TypeScript consumers. */\nexport {};\n"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"path": "LICENSE",
|
|
41
|
+
"type": "registry:file",
|
|
42
|
+
"target": "@components/vnui/LICENSE",
|
|
43
|
+
"content": "MIT License\r\n\r\nCopyright (c) 2026 Ngo Dinh Nam\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "vietqr",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"title": "VietQR",
|
|
6
|
+
"dependencies": [
|
|
7
|
+
"qrcode@1.5.4"
|
|
8
|
+
],
|
|
9
|
+
"devDependencies": [
|
|
10
|
+
"@types/qrcode@1.5.6"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
{
|
|
14
|
+
"path": "components/vietqr.tsx",
|
|
15
|
+
"type": "registry:file",
|
|
16
|
+
"target": "@components/vnui/components/vietqr.tsx",
|
|
17
|
+
"content": "\"use client\";\nimport { useEffect, useId, useState } from \"react\";\nimport { buildVietQR, type VietQRInput } from \"../lib/vietqr\";\nimport \"./styles.css\";\nexport function VietQR({\n size = 192,\n className = \"\",\n ...input\n}: VietQRInput & { size?: number; className?: string }) {\n let payload = \"\",\n error = \"\";\n try {\n payload = buildVietQR(input);\n } catch (e) {\n error = e instanceof Error ? e.message : \"Invalid transfer details\";\n }\n const id = useId();\n const [image, setImage] = useState({\n payload: \"\",\n svg: \"\",\n png: \"\",\n error: \"\",\n });\n useEffect(() => {\n let active = true;\n if (payload)\n import(\"qrcode\")\n .then(async ({ default: qr }) => {\n const opts = {\n margin: 4,\n width: Math.max(240, size),\n errorCorrectionLevel: \"M\" as const,\n };\n const [svg, png] = await Promise.all([\n qr.toString(payload, { ...opts, type: \"svg\" }),\n qr.toDataURL(payload, opts),\n ]);\n if (active)\n setImage({\n payload,\n svg:\n \"data:image/svg+xml;charset=utf-8,\" + encodeURIComponent(svg),\n png,\n error: \"\",\n });\n })\n .catch(() => {\n if (active)\n setImage({\n payload,\n svg: \"\",\n png: \"\",\n error: \"Cannot render QR code.\",\n });\n });\n return () => {\n active = false;\n };\n }, [payload, size]);\n const current = payload && image.payload === payload;\n return (\n <figure className={\"vn-qr \" + className} aria-labelledby={id}>\n <figcaption id={id}>VietQR</figcaption>\n {error ? (\n <small role=\"alert\">{error}</small>\n ) : current && image.svg ? (\n <>\n <picture>\n <img\n width={size}\n height={size}\n src={image.svg}\n alt=\"Bank transfer payment instructions\"\n />\n </picture>\n <div>\n <a download=\"vietqr.png\" href={image.png}>\n Download PNG\n </a>\n <a download=\"vietqr.svg\" href={image.svg}>\n SVG\n </a>\n </div>\n </>\n ) : (\n <span role=\"status\">{(current && image.error) || \"Generating…\"}</span>\n )}\n </figure>\n );\n}\n"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "lib/vietqr.ts",
|
|
21
|
+
"type": "registry:file",
|
|
22
|
+
"target": "@components/vnui/lib/vietqr.ts",
|
|
23
|
+
"content": "export interface VietQRInput {\n bankBin: string;\n accountNumber: string;\n amount?: string | number | bigint;\n description?: string;\n}\n\n/** CRC-16/IBM-3740 (CCITT-FALSE), initial 0xffff, polynomial 0x1021. */\nexport function crc16(input: string): string {\n let crc = 0xffff;\n for (const byte of new TextEncoder().encode(input)) {\n crc ^= byte << 8;\n for (let bit = 0; bit < 8; bit++) {\n crc = (crc & 0x8000 ? (crc << 1) ^ 0x1021 : crc << 1) & 0xffff;\n }\n }\n return crc.toString(16).toUpperCase().padStart(4, \"0\");\n}\n\nfunction field(id: string, value: string): string {\n return id + String(value.length).padStart(2, \"0\") + value;\n}\n\nexport function buildVietQR({\n bankBin,\n accountNumber,\n amount,\n description = \"\",\n}: VietQRInput): string {\n if (!/^\\d{6}$/.test(bankBin))\n throw new RangeError(\"Enter a six-digit bank BIN.\");\n if (!/^[A-Za-z0-9]{1,19}$/.test(accountNumber))\n throw new RangeError(\n \"Use 1–19 letters or digits for the receiving account.\",\n );\n const amountText = amount === undefined ? \"\" : String(amount);\n if (amount !== undefined && !/^[1-9]\\d{0,12}$/.test(amountText)) {\n throw new RangeError(\n \"Enter a positive whole VND amount of up to 13 digits.\",\n );\n }\n if (!/^[A-Za-z0-9 .,/()-]{0,25}$/.test(description)) {\n throw new RangeError(\n \"Use up to 25 unaccented letters, digits, spaces, or .,/()- in the description.\",\n );\n }\n const beneficiary = field(\"00\", bankBin) + field(\"01\", accountNumber);\n const network =\n field(\"00\", \"A000000727\") +\n field(\"01\", beneficiary) +\n field(\"02\", \"QRIBFTTA\");\n const encoded =\n field(\"00\", \"01\") +\n field(\"01\", amountText ? \"12\" : \"11\") +\n field(\"38\", network) +\n field(\"53\", \"704\") +\n (amountText ? field(\"54\", amountText) : \"\") +\n field(\"58\", \"VN\") +\n (description ? field(\"62\", field(\"08\", description)) : \"\") +\n \"6304\";\n return encoded + crc16(encoded);\n}\n\n/** Checks only the checksum. A valid CRC carries no information about the payee. */\nexport function validateVietQRChecksum(payload: string): boolean {\n return (\n /6304[0-9A-F]{4}$/.test(payload) &&\n crc16(payload.slice(0, -4)) === payload.slice(-4)\n );\n}\n"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "components/styles.css",
|
|
27
|
+
"type": "registry:file",
|
|
28
|
+
"target": "@components/vnui/components/styles.css",
|
|
29
|
+
"content": ".vn-bank-symbol {\n font: 600 0.7rem/1.2 system-ui;\n letter-spacing: 0.02em;\n color: var(--vn-ink, CanvasText);\n padding: 3px 5px;\n margin-left: 0.7rem;\n border: 1px solid var(--vn-border, #888);\n border-radius: 3px;\n}\n.vn-bank-symbol img {\n object-fit: contain;\n}\n.vn-lunar-fields {\n display: grid;\n grid-template-columns: 1fr 1fr 1.4fr;\n gap: 0.5rem;\n}\n.vn-field .vn-apply {\n justify-self: start;\n border: 1px solid var(--vn-border, #777);\n border-radius: 4px;\n padding: 5px 10px;\n font-size: 0.82rem;\n background: var(--vn-input, Canvas);\n color: inherit;\n cursor: pointer;\n}\n.vn-stack,\n.vn-field,\n.vn-qr {\n display: grid;\n gap: 0.55rem;\n min-width: 0;\n}\n.vn-stack {\n gap: 1rem;\n}\n.vn-field label,\n.vn-qr figcaption {\n font: 500 0.81rem/1.5 var(--font-geist-sans, system-ui);\n color: inherit;\n}\n.vn-field input:not([type=\"hidden\"]):not([type=\"checkbox\"]),\n.vn-entry {\n border: 1px solid var(--vn-border, #747474);\n background: var(--vn-input, Canvas);\n color: var(--vn-ink, CanvasText);\n border-radius: 6px;\n min-width: 0;\n width: 100%;\n box-sizing: border-box;\n font: 400 0.91rem/1.3 var(--font-geist-mono, monospace);\n height: 42px;\n padding: 0 0.8rem;\n}\n.vn-lunar-leap {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n justify-self: start;\n font-size: 0.875rem;\n cursor: pointer;\n}\n.vn-field .vn-lunar-leap input[type=\"checkbox\"] {\n width: 1rem;\n height: 1rem;\n margin: 0;\n padding: 0;\n accent-color: var(--vn-focus, #67ab94);\n}\n.vn-entry {\n display: flex;\n align-items: center;\n padding: 0;\n overflow: hidden;\n}\n.vn-entry input:not([type=\"hidden\"]) {\n border: 0;\n background: transparent;\n flex: 1;\n outline: none;\n}\n.vn-entry:focus-within,\n.vn-field > input:focus-visible {\n outline: 2px solid var(--vn-focus, #67ab94);\n outline-offset: 2px;\n}\n.vn-field small,\n.vn-qr small {\n color: var(--vn-error, #e08a85);\n}\n.vn-unit,\n.vn-chevron {\n padding: 0 0.8rem;\n color: var(--muted, inherit);\n}\n.vn-country {\n display: flex;\n gap: 0.4rem;\n align-items: center;\n font: 500 0.75rem system-ui;\n margin-left: 0.75rem;\n padding-right: 0.7rem;\n border-right: 1px solid var(--vn-border, #777);\n}\n.vn-country i {\n font: normal 11px/13px sans-serif;\n color: #ffde78;\n background: #b84244;\n padding: 0 3px;\n border-radius: 2px;\n}\n.vn-combo {\n position: relative;\n}\n.vn-options {\n position: absolute;\n z-index: 12;\n top: 100%;\n margin-top: 4px;\n left: 0;\n right: 0;\n background: var(--vn-input, Canvas);\n color: var(--vn-ink, CanvasText);\n border: 1px solid var(--vn-border, #777);\n border-radius: 6px;\n padding: 4px;\n max-height: 220px;\n overflow: auto;\n text-align: left;\n}\n.vn-options > div {\n padding: 0.5rem;\n cursor: pointer;\n font-size: 0.875rem;\n}\n.vn-options > [data-active=\"true\"],\n.vn-options > div:hover {\n background: var(--vn-highlight, Highlight);\n color: var(--vn-highlight-ink, HighlightText);\n}\n.vn-matches {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.vn-matches li {\n padding: 0.45rem 0;\n}\n.vn-matches mark {\n background: #b3e3c7;\n color: #173222;\n}\n.vn-qr {\n justify-items: start;\n margin: 0;\n}\n.vn-qr img {\n max-width: 100%;\n height: auto;\n}\n.vn-qr a {\n margin-right: 1rem;\n text-decoration: underline;\n font-size: 0.85rem;\n}\n.vn-field output {\n font-family: monospace;\n font-size: 0.9rem;\n}\n"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"path": "components/styles.css.d.ts",
|
|
33
|
+
"type": "registry:file",
|
|
34
|
+
"target": "@components/vnui/components/styles.css.d.ts",
|
|
35
|
+
"content": "/** Side-effect stylesheet import for strict TypeScript consumers. */\nexport {};\n"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"path": "LICENSE",
|
|
39
|
+
"type": "registry:file",
|
|
40
|
+
"target": "@components/vnui/LICENSE",
|
|
41
|
+
"content": "MIT License\r\n\r\nCopyright (c) 2026 Ngo Dinh Nam\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|