@wpic/ui 0.3.15 → 0.4.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 +23 -0
- package/COMPONENTS.md +635 -0
- package/dist/components/WAlert.vue.d.ts +7 -7
- package/dist/components/WBadge.vue.d.ts +12 -3
- package/dist/components/WBanner.vue.d.ts +21 -2
- package/dist/components/WTag.vue.d.ts +22 -4
- package/dist/components/semantic/styles.d.ts +153 -0
- package/dist/index.d.ts +1 -0
- package/dist/wpic-ui.cjs +61 -61
- package/dist/wpic-ui.css +1 -1
- package/dist/wpic-ui.js +3383 -3344
- package/package.json +7 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.4.0 — 2026-09-08
|
|
4
|
+
|
|
5
|
+
### Banners, tags and badges
|
|
6
|
+
|
|
7
|
+
- Shared Tailwind palettes reproduce the approved Analyze light/dark laboratory: blue information, yellow attention, emerald success and rose error.
|
|
8
|
+
- `WBanner` adds title, lead, actions slot, optional dismissal and an explicit theme override while retaining slot-only usage.
|
|
9
|
+
- `WTag` adds controlled checkable tags, configurable selected color, normal/muted unselected appearance and a true disabled state. The selection indicator is a 14px circle with the approved larger check. Borders use 5% opacity.
|
|
10
|
+
- `WBadge` uses stronger light fills, semibold light labels and the approved bottom padding. Adds a compact `count` option and explicit theme selection.
|
|
11
|
+
- `theme="auto"` follows `.dark`; explicit `light`/`dark` values support previews without inheriting the host theme.
|
|
12
|
+
- Editable and removable tags remain supported; combined interactions no longer create nested buttons. `WAlert` now delegates to `WBanner` and retains its props, slot and close event.
|
|
13
|
+
- Published documentation defines when to use each component. Browser coverage checks distributed CSS without host Tailwind, themes, selection, keyboard interaction, disabled controls, popover editing, removal and dismissal.
|
|
14
|
+
|
|
15
|
+
### Adoption notes
|
|
16
|
+
|
|
17
|
+
This minor release intentionally updates appearance. The default tag and badge label size is now `text-xs`; badges use slightly more bottom padding. `WBadge.bordered` remains opt-in for compatibility (enable it for the laboratory treatment). Existing `WTag` variants, editable string model, remove event and compact size remain available. `primary` badges retain their inverted neutral appearance. Muted tags are selectable, not disabled.
|
|
18
|
+
|
|
19
|
+
Import `@wpic/ui/style.css` alongside the components. No host Tailwind source scanning is required. See `COMPONENTS.md` for examples and API details.
|
|
20
|
+
|
|
21
|
+
### Verification
|
|
22
|
+
|
|
23
|
+
Run `npm run build` followed by `npm run test:semantic`. The browser tests use Google Chrome (`npx playwright install chrome` if needed). Open `/test-ui/semantic.html` with `npm run test:ui` for the standalone package showcase.
|
package/COMPONENTS.md
ADDED
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
# COMPONENTS.md — wpic-ui component reference
|
|
2
|
+
Use this as reference when writing Vue components. Updated for 0.4.0.
|
|
3
|
+
|
|
4
|
+
## Banners, tags and badges: usage
|
|
5
|
+
|
|
6
|
+
| Component | Purpose | Examples |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| `WBanner` | Explain a contextual message, optionally with an action | Import failed; data updated |
|
|
9
|
+
| `WTag` | Categorize an item or select a category filter | Tmall, Japan, Advertising |
|
|
10
|
+
| `WBadge` | Indicate a read-only status or count | Completed, Needs review, 3 |
|
|
11
|
+
|
|
12
|
+
Tags use neutral or blue categories by default. Checkable tags may use a configurable selection color; that color indicates selection, not severity. `uncheckedAppearance="muted"` only changes appearance: the tag remains clickable and keyboard accessible. Use `disabled` to actually prevent interaction. Several tags may describe the same item.
|
|
13
|
+
|
|
14
|
+
Badges use neutral for no severity, blue for information, yellow for attention, emerald for success and rose for error. Keep a visible label or accessible count context; color alone is insufficient. Status badges belong next to the item they describe. They are not buttons.
|
|
15
|
+
|
|
16
|
+
All three components accept `theme="auto"` (default, follows an ancestor `.dark`), `theme="light"` or `theme="dark"`. Explicit themes stay independent of the application theme, including a light preview within a dark page. Import `@wpic/ui/style.css`; the package contains the required Tailwind utilities, so host source scanning is unnecessary.
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<WBanner variant="warning" title="Attention needed" lead="Review this before continuing."
|
|
20
|
+
dismissible @close="showBanner = false" v-if="showBanner">
|
|
21
|
+
Check the source data before publishing.
|
|
22
|
+
<template #actions><WButton @click="review">Review data</WButton></template>
|
|
23
|
+
</WBanner>
|
|
24
|
+
<WTag variant="info">Advertising</WTag>
|
|
25
|
+
<WTag checkable v-model:checked="selected" checked-variant="success" unchecked-appearance="muted">Tmall</WTag>
|
|
26
|
+
<WBadge variant="success" :icon="CircleCheck" bordered>Completed</WBadge>
|
|
27
|
+
<WBadge variant="warning" count bordered aria-label="3 reports need review">3</WBadge>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`WBanner` emits `close`; the parent owns dismissal and restoration. `WAlert` is retained as a compatibility wrapper around `WBanner`. Prefer `WBanner` for new contextual messages.
|
|
31
|
+
|
|
32
|
+
## WAlert
|
|
33
|
+
|
|
34
|
+
**Import:** `import { WAlert } from '@wpic/ui'`
|
|
35
|
+
|
|
36
|
+
**Props:**
|
|
37
|
+
```ts
|
|
38
|
+
variant?: 'info' | 'success' | 'warning' | 'error'
|
|
39
|
+
title?: string
|
|
40
|
+
dismissible?: boolean
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Emits:**
|
|
44
|
+
```ts
|
|
45
|
+
close: []
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## WAvatar
|
|
51
|
+
|
|
52
|
+
**Import:** `import { WAvatar } from '@wpic/ui'`
|
|
53
|
+
|
|
54
|
+
**Props:**
|
|
55
|
+
```ts
|
|
56
|
+
name: string
|
|
57
|
+
src?: string
|
|
58
|
+
size?: 'sm' | 'md' | 'lg'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## WBadge
|
|
64
|
+
|
|
65
|
+
**Import:** `import { WBadge } from '@wpic/ui'`
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
variant?: 'default' | 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info'
|
|
69
|
+
size?: 'sm' | 'md' // default md; sm retains the compact 10px label
|
|
70
|
+
icon?: Component
|
|
71
|
+
dot?: boolean
|
|
72
|
+
bordered?: boolean // default false, preserving existing callers
|
|
73
|
+
count?: boolean // centered compact counter
|
|
74
|
+
theme?: 'auto' | 'light' | 'dark'
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Light badges have stronger fills and semibold labels. Default badges use `text-xs`, top padding `0.125rem` and bottom padding `2.5px`. `primary` retains its inverted neutral treatment.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## WBanner
|
|
82
|
+
|
|
83
|
+
**Import:** `import { WBanner } from '@wpic/ui'`
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
variant?: 'info' | 'warning' | 'error' | 'success' // default info
|
|
87
|
+
icon?: Component
|
|
88
|
+
title?: string
|
|
89
|
+
lead?: string
|
|
90
|
+
dismissible?: boolean // default false
|
|
91
|
+
dismissLabel?: string // default "Dismiss"; localize in the caller
|
|
92
|
+
theme?: 'auto' | 'light' | 'dark'
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Slots: default (body or standalone message), `actions`. Emits `close`. Warnings and errors use `role="alert"`; information and success use `role="status"`. Existing slot-only content is supported.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## WButton
|
|
100
|
+
|
|
101
|
+
**Import:** `import { WButton } from '@wpic/ui'`
|
|
102
|
+
|
|
103
|
+
**Props:**
|
|
104
|
+
```ts
|
|
105
|
+
variant?: 'primary' | 'secondary' | 'destructive' | 'ghost' | 'outline'
|
|
106
|
+
size?: 'xs' | 'sm' | 'md' | 'lg'
|
|
107
|
+
loading?: boolean
|
|
108
|
+
disabled?: boolean
|
|
109
|
+
icon?: object | Function
|
|
110
|
+
href?: string
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Emits:**
|
|
114
|
+
```ts
|
|
115
|
+
click: [e: MouseEvent]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## WCard
|
|
121
|
+
|
|
122
|
+
**Import:** `import { WCard } from '@wpic/ui'`
|
|
123
|
+
|
|
124
|
+
**Props:**
|
|
125
|
+
```ts
|
|
126
|
+
title?: string
|
|
127
|
+
empty?: boolean
|
|
128
|
+
noPadding?: boolean
|
|
129
|
+
bodyClass?: string
|
|
130
|
+
borderless?: boolean
|
|
131
|
+
headerDivider?: boolean // defaults to true
|
|
132
|
+
padding?: 'sm' | 'md' | 'lg' // shared header/body/footer spacing; defaults to md
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## WCheckbox
|
|
138
|
+
|
|
139
|
+
**Import:** `import { WCheckbox } from '@wpic/ui'`
|
|
140
|
+
|
|
141
|
+
**Props:**
|
|
142
|
+
```ts
|
|
143
|
+
disabled?: boolean
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## WEmptyState
|
|
149
|
+
|
|
150
|
+
**Import:** `import { WEmptyState } from '@wpic/ui'`
|
|
151
|
+
|
|
152
|
+
**Props:**
|
|
153
|
+
```ts
|
|
154
|
+
icon?: Component
|
|
155
|
+
title: string
|
|
156
|
+
description?: string
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## WFileList
|
|
162
|
+
|
|
163
|
+
**Import:** `import { WFileList } from '@wpic/ui'`
|
|
164
|
+
|
|
165
|
+
**Props:**
|
|
166
|
+
```ts
|
|
167
|
+
files: any[]
|
|
168
|
+
nameKey?: string
|
|
169
|
+
idKey?: string
|
|
170
|
+
statusKey?: string
|
|
171
|
+
selectedId?: number | string | null
|
|
172
|
+
removable?: boolean
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Emits:**
|
|
176
|
+
```ts
|
|
177
|
+
select: [item: any]
|
|
178
|
+
remove: [item: any]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## WFilter
|
|
184
|
+
|
|
185
|
+
**Import:** `import { WFilter } from '@wpic/ui'`
|
|
186
|
+
|
|
187
|
+
**Emits:**
|
|
188
|
+
```ts
|
|
189
|
+
'update:modelValue': [value: T]
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## WFormLabel
|
|
195
|
+
|
|
196
|
+
**Import:** `import { WFormLabel } from '@wpic/ui'`
|
|
197
|
+
|
|
198
|
+
**Props:**
|
|
199
|
+
```ts
|
|
200
|
+
required?: boolean
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## WImageTile
|
|
206
|
+
|
|
207
|
+
**Import:** `import { WImageTile } from '@wpic/ui'`
|
|
208
|
+
|
|
209
|
+
**Props:**
|
|
210
|
+
```ts
|
|
211
|
+
src: string
|
|
212
|
+
selected?: boolean
|
|
213
|
+
alt?: string
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Emits:**
|
|
217
|
+
```ts
|
|
218
|
+
click: []
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## WInput
|
|
224
|
+
|
|
225
|
+
**Import:** `import { WInput } from '@wpic/ui'`
|
|
226
|
+
|
|
227
|
+
**Props:**
|
|
228
|
+
```ts
|
|
229
|
+
icon?: object | Function
|
|
230
|
+
label?: string
|
|
231
|
+
placeholder?: string
|
|
232
|
+
required?: boolean
|
|
233
|
+
type?: string
|
|
234
|
+
disabled?: boolean
|
|
235
|
+
size?: 'sm' | 'md' | 'lg'
|
|
236
|
+
clearable?: boolean
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## WModal
|
|
242
|
+
|
|
243
|
+
**Import:** `import { WModal } from '@wpic/ui'`
|
|
244
|
+
|
|
245
|
+
**Props:**
|
|
246
|
+
```ts
|
|
247
|
+
title?: string
|
|
248
|
+
subtitle?: string
|
|
249
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'
|
|
250
|
+
zIndex?: string
|
|
251
|
+
hideClose?: boolean
|
|
252
|
+
noPadding?: boolean
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Emits:**
|
|
256
|
+
```ts
|
|
257
|
+
close: []
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## WOptionPopover
|
|
263
|
+
|
|
264
|
+
**Import:** `import { WOptionPopover } from '@wpic/ui'`
|
|
265
|
+
|
|
266
|
+
**Props:**
|
|
267
|
+
```ts
|
|
268
|
+
modelValue: string | null
|
|
269
|
+
options: PopoverOption[]
|
|
270
|
+
anchor: HTMLElement | null
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
**Emits:**
|
|
274
|
+
```ts
|
|
275
|
+
'update:modelValue': [value: string]
|
|
276
|
+
'close': []
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## WPagination
|
|
282
|
+
|
|
283
|
+
**Import:** `import { WPagination } from '@wpic/ui'`
|
|
284
|
+
|
|
285
|
+
**Props:**
|
|
286
|
+
```ts
|
|
287
|
+
modelValue: number
|
|
288
|
+
total: number
|
|
289
|
+
limit?: number
|
|
290
|
+
syncUrl?: boolean // default: true; automatically false inside WModal
|
|
291
|
+
queryParam?: string // default: 'page'
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Emits:**
|
|
295
|
+
```ts
|
|
296
|
+
'update:modelValue': [p: number]
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## WPillGroup
|
|
302
|
+
|
|
303
|
+
**Import:** `import { WPillGroup } from '@wpic/ui'`
|
|
304
|
+
|
|
305
|
+
**Props:**
|
|
306
|
+
```ts
|
|
307
|
+
options: Option[]
|
|
308
|
+
multiple?: boolean
|
|
309
|
+
size?: 'sm' | 'md'
|
|
310
|
+
disabled?: boolean
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## WPopover
|
|
316
|
+
|
|
317
|
+
**Import:** `import { WPopover } from '@wpic/ui'`
|
|
318
|
+
|
|
319
|
+
**Props:**
|
|
320
|
+
```ts
|
|
321
|
+
open: boolean
|
|
322
|
+
anchor: HTMLElement | null
|
|
323
|
+
placement?: 'top' | 'bottom' | 'left' | 'right' | 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end'
|
|
324
|
+
width?: string
|
|
325
|
+
minWidth?: string
|
|
326
|
+
maxHeight?: string
|
|
327
|
+
offset?: number
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**Emits:**
|
|
331
|
+
```ts
|
|
332
|
+
close: []
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## WProgress
|
|
338
|
+
|
|
339
|
+
**Import:** `import { WProgress } from '@wpic/ui'`
|
|
340
|
+
|
|
341
|
+
**Props:**
|
|
342
|
+
```ts
|
|
343
|
+
value: number
|
|
344
|
+
max?: number
|
|
345
|
+
color?: string
|
|
346
|
+
size?: 'sm' | 'md' | 'lg'
|
|
347
|
+
label?: string
|
|
348
|
+
animated?: boolean
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## WSearchSelect
|
|
354
|
+
|
|
355
|
+
**Import:** `import { WSearchSelect } from '@wpic/ui'`
|
|
356
|
+
|
|
357
|
+
**Props:**
|
|
358
|
+
```ts
|
|
359
|
+
modelValue?: string | number | (string | number)[]
|
|
360
|
+
options?: Option[]
|
|
361
|
+
placeholder?: string
|
|
362
|
+
size?: 'sm' | 'md' | 'lg'
|
|
363
|
+
multiple?: boolean
|
|
364
|
+
maxLabels?: number
|
|
365
|
+
pinnedOptions?: Option[]
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**Emits:**
|
|
369
|
+
```ts
|
|
370
|
+
'update:modelValue': [v: any]
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## WSelect
|
|
376
|
+
|
|
377
|
+
**Import:** `import { WSelect } from '@wpic/ui'`
|
|
378
|
+
|
|
379
|
+
**Props:**
|
|
380
|
+
```ts
|
|
381
|
+
modelValue?: string | number | (string | number)[] | null
|
|
382
|
+
options?: OptionRaw[]
|
|
383
|
+
multiple?: boolean
|
|
384
|
+
searchable?: boolean
|
|
385
|
+
label?: string
|
|
386
|
+
placeholder?: string
|
|
387
|
+
allLabel?: string
|
|
388
|
+
maxLabels?: number
|
|
389
|
+
error?: boolean
|
|
390
|
+
disabled?: boolean
|
|
391
|
+
size?: 'sm' | 'md' | 'lg'
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Emits:**
|
|
395
|
+
```ts
|
|
396
|
+
'update:modelValue': [v: any]
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## WSidePanel
|
|
402
|
+
|
|
403
|
+
**Import:** `import { WSidePanel } from '@wpic/ui'`
|
|
404
|
+
|
|
405
|
+
**Props:**
|
|
406
|
+
```ts
|
|
407
|
+
open: boolean
|
|
408
|
+
title?: string
|
|
409
|
+
subtitle?: string
|
|
410
|
+
width?: string // e.g. '420px', '560px' — default 420px
|
|
411
|
+
zIndex?: number // default 50
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
**Emits:**
|
|
415
|
+
```ts
|
|
416
|
+
close: []
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## WSkeleton
|
|
422
|
+
|
|
423
|
+
**Import:** `import { WSkeleton } from '@wpic/ui'`
|
|
424
|
+
|
|
425
|
+
**Props:**
|
|
426
|
+
```ts
|
|
427
|
+
width?: string
|
|
428
|
+
height?: string
|
|
429
|
+
rounded?: string
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## WSpinner
|
|
435
|
+
|
|
436
|
+
**Import:** `import { WSpinner } from '@wpic/ui'`
|
|
437
|
+
|
|
438
|
+
**Props:**
|
|
439
|
+
```ts
|
|
440
|
+
size?: 'sm' | 'md' | 'lg' // default 'md'
|
|
441
|
+
tone?: 'primary' | 'muted' // default 'primary'
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## WLoader
|
|
447
|
+
|
|
448
|
+
**Import:** `import { WLoader } from '@wpic/ui'`
|
|
449
|
+
|
|
450
|
+
**Props:**
|
|
451
|
+
```ts
|
|
452
|
+
text?: string // default 'Loading...'
|
|
453
|
+
size?: 'sm' | 'md' | 'lg' // default 'md'
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
---
|
|
457
|
+
|
|
458
|
+
## WSlidePanel
|
|
459
|
+
|
|
460
|
+
**Import:** `import { WSlidePanel } from '@wpic/ui'`
|
|
461
|
+
|
|
462
|
+
**Props:**
|
|
463
|
+
```ts
|
|
464
|
+
modelValue: boolean
|
|
465
|
+
title?: string
|
|
466
|
+
width?: string
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
**Emits:**
|
|
470
|
+
```ts
|
|
471
|
+
'update:modelValue': [v: boolean]
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## WSlider
|
|
477
|
+
|
|
478
|
+
**Import:** `import { WSlider } from '@wpic/ui'`
|
|
479
|
+
|
|
480
|
+
**Props:**
|
|
481
|
+
```ts
|
|
482
|
+
min?: number
|
|
483
|
+
max?: number
|
|
484
|
+
step?: number
|
|
485
|
+
disabled?: boolean
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
## WStatCard
|
|
491
|
+
|
|
492
|
+
**Import:** `import { WStatCard } from '@wpic/ui'`
|
|
493
|
+
|
|
494
|
+
**Props:**
|
|
495
|
+
```ts
|
|
496
|
+
label: string
|
|
497
|
+
value: string | number
|
|
498
|
+
unit?: string
|
|
499
|
+
color?: string
|
|
500
|
+
sub?: string
|
|
501
|
+
subColor?: string
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
## WTable
|
|
507
|
+
|
|
508
|
+
**Import:** `import { WTable } from '@wpic/ui'`
|
|
509
|
+
|
|
510
|
+
**Props:**
|
|
511
|
+
```ts
|
|
512
|
+
data?: Record<string, unknown>[]
|
|
513
|
+
columns: WTableColumn[]
|
|
514
|
+
loading?: boolean
|
|
515
|
+
emptyText?: string
|
|
516
|
+
pageSize?: number
|
|
517
|
+
searchPlaceholder?: string
|
|
518
|
+
rowClickable?: boolean
|
|
519
|
+
showHeader?: boolean
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
**Emits:**
|
|
523
|
+
```ts
|
|
524
|
+
'row-click': [row: Record<string, unknown>]
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
## WTag
|
|
530
|
+
|
|
531
|
+
**Import:** `import { WTag } from '@wpic/ui'`
|
|
532
|
+
|
|
533
|
+
```ts
|
|
534
|
+
variant?: 'default' | 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info' | 'overlay' | 'teal' | 'meta'
|
|
535
|
+
size?: 'sm' | 'md'
|
|
536
|
+
theme?: 'auto' | 'light' | 'dark'
|
|
537
|
+
checkable?: boolean
|
|
538
|
+
checked?: boolean // v-model:checked; controlled by the caller
|
|
539
|
+
checkedVariant?: 'neutral' | 'info' | 'warning' | 'success' | 'error' // default neutral
|
|
540
|
+
uncheckedAppearance?: 'normal' | 'muted' // default normal
|
|
541
|
+
disabled?: boolean
|
|
542
|
+
editable?: boolean
|
|
543
|
+
modelValue?: string | null
|
|
544
|
+
options?: PopoverOption[]
|
|
545
|
+
removable?: boolean
|
|
546
|
+
removeLabel?: string // default "Remove tag"; provide contextual/localized labels
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
Emits `update:checked(boolean)`, `update:modelValue(string)` and `remove()`.
|
|
550
|
+
|
|
551
|
+
Checkable tags are native toggle buttons with `aria-pressed`, a 14px circle, and a custom check. They support Space and Enter. Checkable takes precedence over editable; use one interaction mode at a time. Editable tags retain the option popover. Removable interactive tags use sibling buttons, avoiding nested buttons. Disabled tags block selection, editing and removal. Borders remain subtle (5% opacity).
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
555
|
+
## WTagInput
|
|
556
|
+
|
|
557
|
+
**Import:** `import { WTagInput } from '@wpic/ui'`
|
|
558
|
+
|
|
559
|
+
**Props:**
|
|
560
|
+
```ts
|
|
561
|
+
modelValue?: WTagItem[]
|
|
562
|
+
locale?: string
|
|
563
|
+
locales?: string[]
|
|
564
|
+
recentKey?: string
|
|
565
|
+
/** Called for typeahead suggestions; return matching tags */
|
|
566
|
+
searchFn?: (q: string, locale: string) => Promise<WTagItem[]>
|
|
567
|
+
/** Called on Enter with raw input; return a resolved/new tag with translations */
|
|
568
|
+
resolveFn?: (input: string, locale: string) => Promise<WTagItem>
|
|
569
|
+
/** Called to persist add/remove; throw to signal failure (triggers rollback) */
|
|
570
|
+
mutateFn?: (action: 'add' | 'remove', tag: WTagItem) => Promise<void>
|
|
571
|
+
placeholder?: string
|
|
572
|
+
labelRecent?: string
|
|
573
|
+
labelAutoTranslated?: string
|
|
574
|
+
labelAlreadyAdded?: string
|
|
575
|
+
labelExisting?: string
|
|
576
|
+
labelNew?: string
|
|
577
|
+
labelEdit?: string
|
|
578
|
+
labelCancel?: string
|
|
579
|
+
labelConfirm?: string
|
|
580
|
+
labelErrorResolving?: string
|
|
581
|
+
labelErrorAdding?: string
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
**Emits:**
|
|
585
|
+
```ts
|
|
586
|
+
'update:modelValue': [tags: WTagItem[]]
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
## WTextarea
|
|
592
|
+
|
|
593
|
+
**Import:** `import { WTextarea } from '@wpic/ui'`
|
|
594
|
+
|
|
595
|
+
**Props:**
|
|
596
|
+
```ts
|
|
597
|
+
modelValue?: string
|
|
598
|
+
placeholder?: string
|
|
599
|
+
rows?: number
|
|
600
|
+
disabled?: boolean
|
|
601
|
+
error?: boolean
|
|
602
|
+
label?: string
|
|
603
|
+
resize?: 'none' | 'vertical' | 'both'
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
**Emits:**
|
|
607
|
+
```ts
|
|
608
|
+
'update:modelValue': [string]
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
---
|
|
612
|
+
|
|
613
|
+
## WToggle
|
|
614
|
+
|
|
615
|
+
**Import:** `import { WToggle } from '@wpic/ui'`
|
|
616
|
+
|
|
617
|
+
**Props:**
|
|
618
|
+
```ts
|
|
619
|
+
disabled?: boolean
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
---
|
|
623
|
+
|
|
624
|
+
## WTooltip
|
|
625
|
+
|
|
626
|
+
**Import:** `import { WTooltip } from '@wpic/ui'`
|
|
627
|
+
|
|
628
|
+
**Props:**
|
|
629
|
+
```ts
|
|
630
|
+
content: string
|
|
631
|
+
placement?: 'top' | 'bottom' | 'left' | 'right'
|
|
632
|
+
delay?: number
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
---
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
import { WTheme } from './semantic/styles';
|
|
2
|
+
/** Compatibility entry point. Prefer WBanner for new contextual messages. */
|
|
1
3
|
type __VLS_Props = {
|
|
2
4
|
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
3
5
|
title?: string;
|
|
4
6
|
dismissible?: boolean;
|
|
7
|
+
theme?: WTheme;
|
|
5
8
|
};
|
|
6
|
-
declare var
|
|
9
|
+
declare var __VLS_9: {};
|
|
7
10
|
type __VLS_Slots = {} & {
|
|
8
|
-
default?: (props: typeof
|
|
11
|
+
default?: (props: typeof __VLS_9) => any;
|
|
9
12
|
};
|
|
10
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
14
|
close: () => any;
|
|
12
15
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
16
|
onClose?: (() => any) | undefined;
|
|
14
|
-
}>, {
|
|
15
|
-
variant: "info" | "success" | "warning" | "error";
|
|
16
|
-
dismissible: boolean;
|
|
17
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
19
19
|
export default _default;
|
|
20
20
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
+
import { WTheme } from './semantic/styles';
|
|
2
3
|
type __VLS_Props = {
|
|
3
|
-
variant?: 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
4
|
+
variant?: 'default' | 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
4
5
|
size?: 'sm' | 'md';
|
|
5
6
|
dot?: boolean;
|
|
6
7
|
icon?: Component;
|
|
7
|
-
/**
|
|
8
|
+
/** Defaults to false for compatibility. Enable for the outlined lab treatment. */
|
|
8
9
|
bordered?: boolean;
|
|
10
|
+
/** Compact numerical indicator; provide an accessible label when context is not visible. */
|
|
11
|
+
count?: boolean;
|
|
12
|
+
theme?: WTheme;
|
|
9
13
|
};
|
|
10
14
|
declare var __VLS_5: {};
|
|
11
15
|
type __VLS_Slots = {} & {
|
|
12
16
|
default?: (props: typeof __VLS_5) => any;
|
|
13
17
|
};
|
|
14
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
18
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
+
variant: "default" | "neutral" | "primary" | "success" | "warning" | "error" | "info";
|
|
20
|
+
size: "sm" | "md";
|
|
21
|
+
theme: WTheme;
|
|
22
|
+
bordered: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
24
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
25
|
export default _default;
|
|
17
26
|
type __VLS_WithSlots<T, S> = T & {
|