@kubex/zinc 1.0.25 → 1.0.99
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/.claude/project.md +556 -0
- package/.github/workflows/js_build_and_deploy.yaml +9 -10
- package/dist/custom-elements.json +13575 -8856
- package/dist/vscode.html-custom-data.json +583 -48
- package/dist/web-types.json +1441 -181
- package/dist/zn.d.ts +1645 -660
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +1412 -893
- package/docs/_utilities/code-previews.cjs +10 -1
- package/docs/assets/scripts/docs.js +42 -18
- package/docs/data/data-table.json +229 -66
- package/docs/data/empty.json +6 -0
- package/docs/data/products-table.json +41 -193
- package/docs/pages/components/action-bar.md +121 -6
- package/docs/pages/components/alert.md +118 -15
- package/docs/pages/components/animated-button.md +299 -0
- package/docs/pages/components/audio-select.md +534 -0
- package/docs/pages/components/bulk-actions.md +79 -5
- package/docs/pages/components/button-group.md +235 -27
- package/docs/pages/components/button.md +139 -1
- package/docs/pages/components/chart.md +365 -9
- package/docs/pages/components/checkbox.md +387 -58
- package/docs/pages/components/chip.md +253 -33
- package/docs/pages/components/collapsible.md +393 -46
- package/docs/pages/components/cols.md +152 -30
- package/docs/pages/components/confirm.md +182 -16
- package/docs/pages/components/copy-button.md +169 -6
- package/docs/pages/components/data-select.md +194 -15
- package/docs/pages/components/data-table-filter.md +96 -5
- package/docs/pages/components/data-table-search.md +451 -0
- package/docs/pages/components/data-table-sort.md +66 -5
- package/docs/pages/components/data-table.md +727 -66
- package/docs/pages/components/datepicker.md +402 -7
- package/docs/pages/components/defined-label.md +120 -5
- package/docs/pages/components/dialog.md +339 -59
- package/docs/pages/components/dropdown.md +366 -11
- package/docs/pages/components/editor.md +604 -7
- package/docs/pages/components/empty-state.md +315 -16
- package/docs/pages/components/expanding-action.md +212 -28
- package/docs/pages/components/file.md +421 -12
- package/docs/pages/components/filter-container.md +158 -5
- package/docs/pages/components/filter-wrapper.md +167 -6
- package/docs/pages/components/form-group.md +383 -6
- package/docs/pages/components/hover-container.md +237 -6
- package/docs/pages/components/icon-picker.md +121 -0
- package/docs/pages/components/icon.md +454 -48
- package/docs/pages/components/inline-edit.md +787 -19
- package/docs/pages/components/input-group.md +207 -13
- package/docs/pages/components/input.md +194 -0
- package/docs/pages/components/item.md +18 -0
- package/docs/pages/components/key-container.md +115 -0
- package/docs/pages/components/key.md +101 -0
- package/docs/pages/components/menu.md +512 -6
- package/docs/pages/components/note.md +239 -36
- package/docs/pages/components/opt-group.md +107 -0
- package/docs/pages/components/pagination.md +332 -6
- package/docs/pages/components/pane.md +222 -6
- package/docs/pages/components/panel.md +213 -26
- package/docs/pages/components/popup.md +1354 -6
- package/docs/pages/components/priority-list.md +233 -0
- package/docs/pages/components/progress-bar.md +387 -6
- package/docs/pages/components/radio-group.md +242 -5
- package/docs/pages/components/radio.md +474 -6
- package/docs/pages/components/rating.md +331 -7
- package/docs/pages/components/reveal.md +524 -6
- package/docs/pages/components/scroll-container.md +552 -6
- package/docs/pages/components/select.md +762 -160
- package/docs/pages/components/skeleton.md +473 -30
- package/docs/pages/components/slideout.md +261 -5
- package/docs/pages/components/sp.md +99 -41
- package/docs/pages/components/split-button.md +347 -9
- package/docs/pages/components/split-pane.md +445 -6
- package/docs/pages/components/stat.md +549 -9
- package/docs/pages/components/status-indicator.md +230 -1
- package/docs/pages/components/stepper.md +563 -6
- package/docs/pages/components/tabs.md +439 -13
- package/docs/pages/components/textarea.md +415 -17
- package/docs/pages/components/tile.md +385 -26
- package/docs/pages/components/toggle.md +424 -6
- package/docs/pages/components/tooltip.md +367 -0
- package/docs/pages/components/translation-group.md +210 -0
- package/docs/pages/components/translations.md +319 -19
- package/docs/pages/components/vertical-stepper.md +401 -8
- package/docs/pages/components/well.md +300 -3
- package/docs/pages/getting-started/form-controls.md +162 -0
- package/docs/pages/index.md +116 -15
- package/package.json +5 -6
- package/scss/_global-spacing.scss +4 -0
- package/scss/_root.scss +2 -2
- package/scss/boot.scss +19 -0
- package/scss/shared/layout.scss +5 -0
- package/scss/themes/_light.scss +3 -3
- package/src/components/alert/alert.scss +1 -0
- package/src/components/animated-button/README.md +306 -0
- package/src/components/animated-button/animated-button.component.ts +229 -0
- package/src/components/animated-button/animated-button.scss +228 -0
- package/src/components/animated-button/animated-button.test.ts +143 -0
- package/src/components/animated-button/index.ts +12 -0
- package/src/components/button/button.component.ts +5 -0
- package/src/components/button-group/button-group.component.ts +25 -13
- package/src/components/button-group/button-group.scss +6 -0
- package/src/components/checkbox/checkbox.component.ts +4 -0
- package/src/components/checkbox/checkbox.scss +7 -4
- package/src/components/checkbox-group/checkbox-group.scss +7 -0
- package/src/components/chip/chip.component.ts +7 -2
- package/src/components/chip/chip.scss +16 -2
- package/src/components/collapsible/collapsible.component.ts +27 -20
- package/src/components/cols/cols.component.ts +14 -2
- package/src/components/cols/cols.scss +6 -12
- package/src/components/confirm/confirm.component.ts +7 -0
- package/src/components/copy-button/copy-button.component.ts +12 -11
- package/src/components/data-select/data-select.component.ts +215 -44
- package/src/components/data-select/data-select.scss +66 -6
- package/src/components/data-select/providers/currency-data-provider.ts +20 -6
- package/src/components/data-select/providers/provider.ts +1 -0
- package/src/components/data-select/providers/us-state-data-provider.ts +68 -0
- package/src/components/data-table/data-table.component.ts +81 -22
- package/src/components/data-table-search/data-table-search.component.ts +184 -0
- package/src/components/data-table-search/data-table-search.scss +17 -0
- package/src/components/data-table-search/data-table-search.test.ts +11 -0
- package/src/components/data-table-search/index.ts +12 -0
- package/src/components/datepicker/datepicker.component.ts +347 -13
- package/src/components/dialog/dialog.component.ts +1 -1
- package/src/components/empty-state/empty-state.scss +6 -1
- package/src/components/header/header.scss +3 -3
- package/src/components/icon/icon.component.ts +23 -1
- package/src/components/icon/icon.scss +23 -0
- package/src/components/icon-picker/brand-icons.ts +24 -0
- package/src/components/icon-picker/icon-picker.component.ts +407 -0
- package/src/components/icon-picker/icon-picker.scss +205 -0
- package/src/components/icon-picker/index.ts +12 -0
- package/src/components/icon-picker/line-icons.ts +612 -0
- package/src/components/icon-picker/material-icons.ts +14543 -0
- package/src/components/inline-edit/inline-edit.component.ts +190 -46
- package/src/components/inline-edit/inline-edit.scss +29 -0
- package/src/components/inline-edit/inline-edit.test.ts +314 -1
- package/src/components/input/input.component.ts +324 -5
- package/src/components/input/input.scss +87 -0
- package/src/components/input-group/input-group.component.ts +28 -7
- package/src/components/input-group/input-group.scss +48 -10
- package/src/components/item/item.component.ts +24 -3
- package/src/components/item/item.scss +18 -0
- package/src/components/key/index.ts +12 -0
- package/src/components/key/key.component.ts +47 -0
- package/src/components/key/key.scss +38 -0
- package/src/components/key-container/index.ts +12 -0
- package/src/components/key-container/key-container.component.ts +142 -0
- package/src/components/key-container/key-container.scss +33 -0
- package/src/components/menu-item/menu-item.component.ts +20 -0
- package/src/components/menu-item/menu-item.scss +69 -2
- package/src/components/navbar/navbar.component.ts +103 -11
- package/src/components/navbar/navbar.scss +6 -1
- package/src/components/opt-group/index.ts +12 -0
- package/src/components/opt-group/opt-group.component.ts +74 -0
- package/src/components/opt-group/opt-group.scss +37 -0
- package/src/components/opt-group/opt-group.test.ts +27 -0
- package/src/components/option/option.component.ts +1 -16
- package/src/components/option/option.scss +4 -0
- package/src/components/panel/panel.component.ts +10 -8
- package/src/components/panel/panel.scss +20 -0
- package/src/components/priority-list/index.ts +12 -0
- package/src/components/priority-list/priority-list.component.ts +611 -0
- package/src/components/priority-list/priority-list.scss +185 -0
- package/src/components/priority-list/priority-list.test.ts +139 -0
- package/src/components/progress-bar/progress-bar.component.ts +22 -16
- package/src/components/radio/radio.scss +10 -3
- package/src/components/select/select.component.ts +812 -72
- package/src/components/select/select.scss +108 -2
- package/src/components/select/select.test.ts +147 -2
- package/src/components/settings-container/settings-container.component.ts +44 -19
- package/src/components/settings-container/settings-container.scss +1 -1
- package/src/components/skeleton/skeleton.component.ts +6 -1
- package/src/components/slideout/slideout.scss +8 -3
- package/src/components/sp/sp.component.ts +3 -1
- package/src/components/sp/sp.scss +19 -0
- package/src/components/stepper/stepper.component.ts +16 -10
- package/src/components/textarea/textarea.scss +0 -4
- package/src/components/tile/tile.component.ts +12 -3
- package/src/components/tile/tile.scss +1 -1
- package/src/components/timer/timer.component.ts +15 -2
- package/src/components/toggle/toggle.component.ts +29 -26
- package/src/components/toggle/toggle.scss +13 -1
- package/src/components/translation-group/index.ts +12 -0
- package/src/components/translation-group/translation-group.component.ts +207 -0
- package/src/components/translation-group/translation-group.scss +8 -0
- package/src/components/translations/translations.component.ts +90 -44
- package/src/components/translations/translations.scss +4 -0
- package/src/components/vertical-stepper/vertical-stepper.component.ts +14 -9
- package/src/events/events.ts +12 -7
- package/src/events/zn-language-change.ts +7 -0
- package/src/events/zn-purchase.ts +11 -0
- package/src/events/zn-redirect.ts +7 -0
- package/src/events/zn-reorder.ts +7 -0
- package/src/events/zn-search-change.ts +11 -0
- package/src/events/zn-submit.ts +1 -1
- package/src/form-control.scss +4 -0
- package/src/internal/form-navigation.ts +510 -0
- package/src/internal/form.ts +6 -0
- package/src/zinc.ts +91 -83
|
@@ -1,61 +1,281 @@
|
|
|
1
1
|
---
|
|
2
2
|
meta:
|
|
3
3
|
title: Chip
|
|
4
|
-
description:
|
|
4
|
+
description: Chips are compact elements that represent labels, tags, categories, or other small pieces of information.
|
|
5
5
|
layout: component
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
```html:preview
|
|
9
|
-
|
|
10
|
-
<zn-chip>
|
|
9
|
+
<zn-chip>Default Chip</zn-chip>
|
|
10
|
+
<zn-chip type="primary">Primary</zn-chip>
|
|
11
11
|
<zn-chip type="info">Info</zn-chip>
|
|
12
|
+
<zn-chip type="success">Success</zn-chip>
|
|
12
13
|
<zn-chip type="warning">Warning</zn-chip>
|
|
13
|
-
<zn-chip type="transparent">Transparent</zn-chip>
|
|
14
14
|
<zn-chip type="error">Error</zn-chip>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Examples
|
|
18
|
+
|
|
19
|
+
### Basic Chips
|
|
20
|
+
|
|
21
|
+
A basic chip displays text content with default neutral styling.
|
|
22
|
+
|
|
23
|
+
```html:preview
|
|
24
|
+
<zn-chip>Basic Chip</zn-chip>
|
|
25
|
+
<zn-chip>Category</zn-chip>
|
|
26
|
+
<zn-chip>Tag</zn-chip>
|
|
27
|
+
<zn-chip>Label</zn-chip>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Types
|
|
31
|
+
|
|
32
|
+
Use the `type` attribute to change the semantic color and styling of the chip. Available types are: `neutral` (default), `primary`, `info`, `success`, `warning`, `error`, `transparent`, and `custom`.
|
|
33
|
+
|
|
34
|
+
```html:preview
|
|
35
|
+
<zn-chip type="neutral">Neutral</zn-chip>
|
|
15
36
|
<zn-chip type="primary">Primary</zn-chip>
|
|
16
|
-
<zn-chip type="
|
|
37
|
+
<zn-chip type="info">Info</zn-chip>
|
|
38
|
+
<zn-chip type="success">Success</zn-chip>
|
|
39
|
+
<zn-chip type="warning">Warning</zn-chip>
|
|
40
|
+
<zn-chip type="error">Error</zn-chip>
|
|
41
|
+
<zn-chip type="transparent">Transparent</zn-chip>
|
|
42
|
+
```
|
|
17
43
|
|
|
18
|
-
|
|
44
|
+
### With Icons
|
|
19
45
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<zn-chip icon="home"
|
|
24
|
-
<zn-chip icon="
|
|
25
|
-
<zn-chip icon="
|
|
26
|
-
<zn-chip icon="
|
|
27
|
-
<
|
|
46
|
+
Use the `icon` attribute to add an icon to the chip. Icons appear on the left side of the chip content.
|
|
47
|
+
|
|
48
|
+
```html:preview
|
|
49
|
+
<zn-chip icon="home">Home</zn-chip>
|
|
50
|
+
<zn-chip icon="person" type="primary">User</zn-chip>
|
|
51
|
+
<zn-chip icon="check_circle" type="success">Verified</zn-chip>
|
|
52
|
+
<zn-chip icon="info" type="info">Information</zn-chip>
|
|
53
|
+
<zn-chip icon="warning" type="warning">Warning</zn-chip>
|
|
54
|
+
<zn-chip icon="error" type="error">Error</zn-chip>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Caption
|
|
58
|
+
|
|
59
|
+
Use the `caption` attribute to prepend a label, giving the chip a "Key: Value" style.
|
|
60
|
+
|
|
61
|
+
```html:preview
|
|
62
|
+
<zn-chip caption="Router">Sandbanx-Connector</zn-chip>
|
|
63
|
+
<zn-chip caption="Status" type="success">Active</zn-chip>
|
|
64
|
+
<zn-chip caption="Region" type="info">EU-West</zn-chip>
|
|
65
|
+
<zn-chip caption="Priority" type="warning" icon="flag">High</zn-chip>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Icon Size
|
|
69
|
+
|
|
70
|
+
Use the `icon-size` attribute to control the size of the icon within the chip.
|
|
71
|
+
|
|
72
|
+
```html:preview
|
|
73
|
+
<zn-chip icon="star" icon-size="14">Small Icon</zn-chip>
|
|
74
|
+
<zn-chip icon="star" icon-size="18">Default Icon</zn-chip>
|
|
75
|
+
<zn-chip icon="star" icon-size="24">Large Icon</zn-chip>
|
|
76
|
+
```
|
|
28
77
|
|
|
78
|
+
### Icon-Only Chips
|
|
79
|
+
|
|
80
|
+
Chips can be used with just an icon by omitting the text content.
|
|
81
|
+
|
|
82
|
+
```html:preview
|
|
29
83
|
<zn-chip icon="home"></zn-chip>
|
|
30
|
-
<zn-chip icon="
|
|
31
|
-
<zn-chip icon="
|
|
32
|
-
<zn-chip icon="
|
|
33
|
-
<zn-chip icon="
|
|
34
|
-
<zn-chip icon="
|
|
35
|
-
|
|
84
|
+
<zn-chip icon="person" type="primary"></zn-chip>
|
|
85
|
+
<zn-chip icon="favorite" type="error"></zn-chip>
|
|
86
|
+
<zn-chip icon="star" type="warning"></zn-chip>
|
|
87
|
+
<zn-chip icon="settings" type="info"></zn-chip>
|
|
88
|
+
<zn-chip icon="check_circle" type="success"></zn-chip>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Sizes
|
|
92
|
+
|
|
93
|
+
Use the `size` attribute to control the chip's size. Available sizes are `small`, `medium`, and `large`.
|
|
94
|
+
|
|
95
|
+
```html:preview
|
|
96
|
+
<zn-chip size="small">Small</zn-chip>
|
|
97
|
+
<zn-chip>Default</zn-chip>
|
|
98
|
+
<zn-chip size="medium">Medium</zn-chip>
|
|
99
|
+
<zn-chip size="large">Large</zn-chip>
|
|
100
|
+
<br /><br />
|
|
101
|
+
<zn-chip size="small" icon="home">Small</zn-chip>
|
|
102
|
+
<zn-chip icon="home">Default</zn-chip>
|
|
103
|
+
<zn-chip size="medium" icon="home">Medium</zn-chip>
|
|
104
|
+
<zn-chip size="large" icon="home">Large</zn-chip>
|
|
105
|
+
```
|
|
36
106
|
|
|
37
|
-
|
|
107
|
+
### Removable Chips
|
|
38
108
|
|
|
39
|
-
|
|
109
|
+
Chips can include an action button, typically used for removing or closing the chip. Use the `action` slot to add interactive elements.
|
|
110
|
+
|
|
111
|
+
```html:preview
|
|
112
|
+
<zn-chip icon="tag" type="info">
|
|
113
|
+
Removable Tag
|
|
114
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
115
|
+
</zn-chip>
|
|
116
|
+
<zn-chip icon="label" type="success">
|
|
117
|
+
Another Tag
|
|
118
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
119
|
+
</zn-chip>
|
|
120
|
+
<zn-chip icon="bookmark" type="warning">
|
|
121
|
+
Bookmark
|
|
40
122
|
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
41
|
-
Info
|
|
42
123
|
</zn-chip>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Action Slot
|
|
127
|
+
|
|
128
|
+
The `action` slot can be used for any interactive element, not just close buttons.
|
|
43
129
|
|
|
44
|
-
|
|
45
|
-
<zn-chip icon="
|
|
46
|
-
|
|
47
|
-
<zn-
|
|
48
|
-
|
|
130
|
+
```html:preview
|
|
131
|
+
<zn-chip icon="notifications" type="primary">
|
|
132
|
+
Notifications
|
|
133
|
+
<zn-button icon="settings" slot="action" size="content" icon-size="14" color="transparent"></zn-button>
|
|
134
|
+
</zn-chip>
|
|
135
|
+
<zn-chip icon="download" type="info">
|
|
136
|
+
Download
|
|
137
|
+
<zn-button icon="arrow_drop_down" slot="action" size="content" icon-size="16" color="transparent"></zn-button>
|
|
138
|
+
</zn-chip>
|
|
49
139
|
```
|
|
50
140
|
|
|
51
|
-
|
|
141
|
+
### Flush Spacing
|
|
142
|
+
|
|
143
|
+
Use the `flush`, `flush-x`, or `flush-y` attributes to remove padding from the chip.
|
|
144
|
+
|
|
145
|
+
```html:preview
|
|
146
|
+
<div style="display: flex; gap: 8px; align-items: center;">
|
|
147
|
+
<zn-chip>Default Padding</zn-chip>
|
|
148
|
+
<zn-chip flush>Flush</zn-chip>
|
|
149
|
+
<zn-chip flush-x>Flush X</zn-chip>
|
|
150
|
+
<zn-chip flush-y>Flush Y</zn-chip>
|
|
151
|
+
</div>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Custom Color
|
|
155
|
+
|
|
156
|
+
Use the `custom` type with the `--chip-color-override` CSS variable to create chips with custom colors.
|
|
157
|
+
|
|
158
|
+
```html:preview
|
|
159
|
+
<zn-chip type="custom" style="--chip-color-override: #8b5cf6;">Custom Purple</zn-chip>
|
|
160
|
+
<zn-chip type="custom" style="--chip-color-override: #ec4899;">Custom Pink</zn-chip>
|
|
161
|
+
<zn-chip type="custom" style="--chip-color-override: #10b981;">Custom Green</zn-chip>
|
|
162
|
+
<zn-chip type="custom" icon="palette" style="--chip-color-override: #f59e0b;">Custom Orange</zn-chip>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Transparent Chips
|
|
52
166
|
|
|
53
|
-
|
|
167
|
+
Transparent chips have no background or border, useful for subtle labeling.
|
|
54
168
|
|
|
55
|
-
|
|
169
|
+
```html:preview
|
|
170
|
+
<zn-chip type="transparent">Transparent</zn-chip>
|
|
171
|
+
<zn-chip icon="label" type="transparent">Tag</zn-chip>
|
|
172
|
+
<zn-chip icon="category" type="transparent">Category</zn-chip>
|
|
173
|
+
<zn-chip icon="bookmark" type="transparent">Bookmark</zn-chip>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Chip Groups
|
|
177
|
+
|
|
178
|
+
Chips work well when grouped together to represent multiple tags or categories.
|
|
179
|
+
|
|
180
|
+
```html:preview
|
|
181
|
+
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
|
182
|
+
<zn-chip icon="code" type="primary">JavaScript</zn-chip>
|
|
183
|
+
<zn-chip icon="code" type="primary">TypeScript</zn-chip>
|
|
184
|
+
<zn-chip icon="code" type="primary">Python</zn-chip>
|
|
185
|
+
<zn-chip icon="code" type="primary">Go</zn-chip>
|
|
186
|
+
<zn-chip icon="code" type="primary">Rust</zn-chip>
|
|
187
|
+
</div>
|
|
188
|
+
<br />
|
|
189
|
+
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
|
190
|
+
<zn-chip icon="tag" type="info">
|
|
191
|
+
Frontend
|
|
192
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
193
|
+
</zn-chip>
|
|
194
|
+
<zn-chip icon="tag" type="info">
|
|
195
|
+
Backend
|
|
196
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
197
|
+
</zn-chip>
|
|
198
|
+
<zn-chip icon="tag" type="info">
|
|
199
|
+
Database
|
|
200
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
201
|
+
</zn-chip>
|
|
202
|
+
<zn-chip icon="tag" type="info">
|
|
203
|
+
DevOps
|
|
204
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
205
|
+
</zn-chip>
|
|
206
|
+
</div>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Status Indicators
|
|
56
210
|
|
|
57
|
-
|
|
211
|
+
Chips are excellent for displaying status information with appropriate semantic colors.
|
|
212
|
+
|
|
213
|
+
```html:preview
|
|
214
|
+
<div style="display: flex; gap: 8px; flex-direction: column; align-items: flex-start;">
|
|
215
|
+
<zn-chip icon="check_circle" type="success">Active</zn-chip>
|
|
216
|
+
<zn-chip icon="schedule" type="warning">Pending</zn-chip>
|
|
217
|
+
<zn-chip icon="cancel" type="error">Inactive</zn-chip>
|
|
218
|
+
<zn-chip icon="info" type="info">In Review</zn-chip>
|
|
219
|
+
<zn-chip icon="block">Blocked</zn-chip>
|
|
220
|
+
</div>
|
|
221
|
+
```
|
|
58
222
|
|
|
59
|
-
|
|
223
|
+
### User Tags
|
|
224
|
+
|
|
225
|
+
Chips can be used to display user information or assignments.
|
|
226
|
+
|
|
227
|
+
```html:preview
|
|
228
|
+
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
|
229
|
+
<zn-chip icon="person" type="primary">John Doe</zn-chip>
|
|
230
|
+
<zn-chip icon="person" type="primary">Jane Smith</zn-chip>
|
|
231
|
+
<zn-chip icon="person" type="primary">Bob Johnson</zn-chip>
|
|
232
|
+
<zn-chip icon="person" type="primary">
|
|
233
|
+
Alice Williams
|
|
234
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
235
|
+
</zn-chip>
|
|
236
|
+
</div>
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Interactive Example
|
|
240
|
+
|
|
241
|
+
Here's a complete example demonstrating removable chips with JavaScript interaction.
|
|
242
|
+
|
|
243
|
+
```html:preview
|
|
244
|
+
<div id="chip-container" style="display: flex; gap: 8px; flex-wrap: wrap;">
|
|
245
|
+
<zn-chip icon="tag" type="info">
|
|
246
|
+
Design
|
|
247
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
248
|
+
</zn-chip>
|
|
249
|
+
<zn-chip icon="tag" type="info">
|
|
250
|
+
Development
|
|
251
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
252
|
+
</zn-chip>
|
|
253
|
+
<zn-chip icon="tag" type="info">
|
|
254
|
+
Testing
|
|
255
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
256
|
+
</zn-chip>
|
|
257
|
+
<zn-chip icon="tag" type="info">
|
|
258
|
+
Documentation
|
|
259
|
+
<zn-button icon="close" slot="action" size="content" icon-size="12" color="transparent"></zn-button>
|
|
260
|
+
</zn-chip>
|
|
261
|
+
</div>
|
|
262
|
+
|
|
263
|
+
<script type="module">
|
|
264
|
+
const container = document.getElementById('chip-container');
|
|
265
|
+
|
|
266
|
+
container.addEventListener('click', (e) => {
|
|
267
|
+
const button = e.target.closest('zn-button');
|
|
268
|
+
if (button && button.hasAttribute('slot') && button.getAttribute('slot') === 'action') {
|
|
269
|
+
const chip = button.closest('zn-chip');
|
|
270
|
+
if (chip) {
|
|
271
|
+
chip.style.transition = 'opacity 0.2s, transform 0.2s';
|
|
272
|
+
chip.style.opacity = '0';
|
|
273
|
+
chip.style.transform = 'scale(0.8)';
|
|
274
|
+
setTimeout(() => chip.remove(), 200);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
</script>
|
|
279
|
+
```
|
|
60
280
|
|
|
61
281
|
|