@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,20 +1,251 @@
|
|
|
1
1
|
---
|
|
2
2
|
meta:
|
|
3
3
|
title: Hover Container
|
|
4
|
-
description:
|
|
4
|
+
description: A popup container component that displays additional content when triggered by hover, focus, or click events. Supports multiple placements, custom positioning, and automatic hiding on blur or escape.
|
|
5
5
|
layout: component
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
```html:preview
|
|
9
|
-
<zn-hover-container
|
|
9
|
+
<zn-hover-container content="This is helpful information that appears on hover">
|
|
10
|
+
<zn-button slot="anchor">Hover over me</zn-button>
|
|
11
|
+
</zn-hover-container>
|
|
10
12
|
```
|
|
11
13
|
|
|
12
14
|
## Examples
|
|
13
15
|
|
|
14
|
-
###
|
|
16
|
+
### Basic Usage
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
Display content when hovering over an element.
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
```html:preview
|
|
21
|
+
<zn-hover-container content="This is a helpful tooltip">
|
|
22
|
+
<zn-button slot="anchor">Hover me</zn-button>
|
|
23
|
+
</zn-hover-container>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Custom Content Slot
|
|
27
|
+
|
|
28
|
+
Use the content slot for rich HTML content.
|
|
29
|
+
|
|
30
|
+
```html:preview
|
|
31
|
+
<zn-hover-container>
|
|
32
|
+
<zn-button slot="anchor">Hover for details</zn-button>
|
|
33
|
+
<div slot="content">
|
|
34
|
+
<h4 style="margin: 0 0 5px 0;">Important Information</h4>
|
|
35
|
+
<p style="margin: 0;">This is detailed information with <strong>formatting</strong>.</p>
|
|
36
|
+
</div>
|
|
37
|
+
</zn-hover-container>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Different Placements
|
|
41
|
+
|
|
42
|
+
Control where the hover container appears using the `placement` attribute.
|
|
43
|
+
|
|
44
|
+
```html:preview
|
|
45
|
+
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
|
|
46
|
+
<zn-hover-container content="Appears on top" placement="top">
|
|
47
|
+
<zn-button slot="anchor">Top</zn-button>
|
|
48
|
+
</zn-hover-container>
|
|
49
|
+
|
|
50
|
+
<zn-hover-container content="Appears on right" placement="right">
|
|
51
|
+
<zn-button slot="anchor">Right</zn-button>
|
|
52
|
+
</zn-hover-container>
|
|
53
|
+
|
|
54
|
+
<zn-hover-container content="Appears on bottom" placement="bottom">
|
|
55
|
+
<zn-button slot="anchor">Bottom</zn-button>
|
|
56
|
+
</zn-hover-container>
|
|
57
|
+
|
|
58
|
+
<zn-hover-container content="Appears on left" placement="left">
|
|
59
|
+
<zn-button slot="anchor">Left</zn-button>
|
|
60
|
+
</zn-hover-container>
|
|
61
|
+
</div>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Placement Variations
|
|
65
|
+
|
|
66
|
+
Use placement variations for more precise positioning.
|
|
67
|
+
|
|
68
|
+
```html:preview
|
|
69
|
+
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
|
|
70
|
+
<zn-hover-container content="Top Start" placement="top-start">
|
|
71
|
+
<zn-button slot="anchor">Top Start</zn-button>
|
|
72
|
+
</zn-hover-container>
|
|
73
|
+
|
|
74
|
+
<zn-hover-container content="Top End" placement="top-end">
|
|
75
|
+
<zn-button slot="anchor">Top End</zn-button>
|
|
76
|
+
</zn-hover-container>
|
|
77
|
+
|
|
78
|
+
<zn-hover-container content="Bottom Start" placement="bottom-start">
|
|
79
|
+
<zn-button slot="anchor">Bottom Start</zn-button>
|
|
80
|
+
</zn-hover-container>
|
|
81
|
+
|
|
82
|
+
<zn-hover-container content="Bottom End" placement="bottom-end">
|
|
83
|
+
<zn-button slot="anchor">Bottom End</zn-button>
|
|
84
|
+
</zn-hover-container>
|
|
85
|
+
</div>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Click Trigger
|
|
89
|
+
|
|
90
|
+
Change the trigger to click instead of hover.
|
|
91
|
+
|
|
92
|
+
```html:preview
|
|
93
|
+
<zn-hover-container trigger="click" content="Click to toggle this message">
|
|
94
|
+
<zn-button slot="anchor">Click me</zn-button>
|
|
95
|
+
</zn-hover-container>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Focus Trigger
|
|
99
|
+
|
|
100
|
+
Trigger on focus events, useful for form inputs.
|
|
101
|
+
|
|
102
|
+
```html:preview
|
|
103
|
+
<zn-hover-container trigger="focus" content="This field is required and must be a valid email">
|
|
104
|
+
<zn-input slot="anchor" label="Email" placeholder="Enter email"></zn-input>
|
|
105
|
+
</zn-hover-container>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Multiple Triggers
|
|
109
|
+
|
|
110
|
+
Combine multiple trigger types.
|
|
111
|
+
|
|
112
|
+
```html:preview
|
|
113
|
+
<zn-hover-container trigger="hover focus" content="Appears on hover or focus">
|
|
114
|
+
<zn-input slot="anchor" label="Username" placeholder="Enter username"></zn-input>
|
|
115
|
+
</zn-hover-container>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Custom Distance
|
|
119
|
+
|
|
120
|
+
Adjust the distance from the anchor using the `distance` attribute.
|
|
121
|
+
|
|
122
|
+
```html:preview
|
|
123
|
+
<div style="display: flex; gap: 20px;">
|
|
124
|
+
<zn-hover-container distance="0" content="No distance">
|
|
125
|
+
<zn-button slot="anchor">Distance: 0</zn-button>
|
|
126
|
+
</zn-hover-container>
|
|
127
|
+
|
|
128
|
+
<zn-hover-container distance="10" content="10px distance">
|
|
129
|
+
<zn-button slot="anchor">Distance: 10</zn-button>
|
|
130
|
+
</zn-hover-container>
|
|
131
|
+
|
|
132
|
+
<zn-hover-container distance="20" content="20px distance">
|
|
133
|
+
<zn-button slot="anchor">Distance: 20</zn-button>
|
|
134
|
+
</zn-hover-container>
|
|
135
|
+
</div>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Skidding
|
|
139
|
+
|
|
140
|
+
Offset the hover container along the anchor using the `skidding` attribute.
|
|
141
|
+
|
|
142
|
+
```html:preview
|
|
143
|
+
<div style="display: flex; gap: 20px;">
|
|
144
|
+
<zn-hover-container skidding="-20" content="Skidded left">
|
|
145
|
+
<zn-button slot="anchor">Skid Left</zn-button>
|
|
146
|
+
</zn-hover-container>
|
|
147
|
+
|
|
148
|
+
<zn-hover-container skidding="20" content="Skidded right">
|
|
149
|
+
<zn-button slot="anchor">Skid Right</zn-button>
|
|
150
|
+
</zn-hover-container>
|
|
151
|
+
</div>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Disabled State
|
|
155
|
+
|
|
156
|
+
Disable the hover container to prevent it from showing.
|
|
157
|
+
|
|
158
|
+
```html:preview
|
|
159
|
+
<zn-hover-container disabled content="This won't show">
|
|
160
|
+
<zn-button slot="anchor" disabled>Disabled</zn-button>
|
|
161
|
+
</zn-hover-container>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Without Hoisting
|
|
165
|
+
|
|
166
|
+
Disable hoisting to keep the popup within the document flow.
|
|
167
|
+
|
|
168
|
+
```html:preview
|
|
169
|
+
<zn-hover-container hoist="false" content="This popup stays in the document flow">
|
|
170
|
+
<zn-button slot="anchor">No Hoist</zn-button>
|
|
171
|
+
</zn-hover-container>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Icon with Help Text
|
|
19
175
|
|
|
20
|
-
|
|
176
|
+
Add help information to icons.
|
|
177
|
+
|
|
178
|
+
```html:preview
|
|
179
|
+
<div style="display: flex; align-items: center; gap: 10px;">
|
|
180
|
+
<span>Password Requirements</span>
|
|
181
|
+
<zn-hover-container trigger="hover focus">
|
|
182
|
+
<zn-icon slot="anchor" src="help" size="20" style="color: var(--zn-color-info-500); cursor: help;"></zn-icon>
|
|
183
|
+
<div slot="content" style="max-width: 200px;">
|
|
184
|
+
<ul style="margin: 0; padding-left: 20px;">
|
|
185
|
+
<li>At least 8 characters</li>
|
|
186
|
+
<li>One uppercase letter</li>
|
|
187
|
+
<li>One number</li>
|
|
188
|
+
<li>One special character</li>
|
|
189
|
+
</ul>
|
|
190
|
+
</div>
|
|
191
|
+
</zn-hover-container>
|
|
192
|
+
</div>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Form Field Help
|
|
196
|
+
|
|
197
|
+
Provide contextual help for form fields.
|
|
198
|
+
|
|
199
|
+
```html:preview
|
|
200
|
+
<div class="form-spacing">
|
|
201
|
+
<div style="display: flex; align-items: center; gap: 5px;">
|
|
202
|
+
<zn-input label="API Key" placeholder="Enter your API key"></zn-input>
|
|
203
|
+
<zn-hover-container trigger="click" placement="right">
|
|
204
|
+
<zn-button slot="anchor" icon="info" color="transparent" size="small"></zn-button>
|
|
205
|
+
<div slot="content" style="max-width: 250px; padding: 10px;">
|
|
206
|
+
<h4 style="margin: 0 0 5px 0;">Finding your API Key</h4>
|
|
207
|
+
<p style="margin: 0; font-size: 0.9em;">Go to Settings > Developer > API Keys to generate a new key.</p>
|
|
208
|
+
</div>
|
|
209
|
+
</zn-hover-container>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Status Indicator
|
|
215
|
+
|
|
216
|
+
Add explanations to status indicators.
|
|
217
|
+
|
|
218
|
+
```html:preview
|
|
219
|
+
<div style="display: flex; gap: 15px; align-items: center;">
|
|
220
|
+
<zn-hover-container content="System operational">
|
|
221
|
+
<zn-badge slot="anchor" color="success">Online</zn-badge>
|
|
222
|
+
</zn-hover-container>
|
|
223
|
+
|
|
224
|
+
<zn-hover-container content="Experiencing issues">
|
|
225
|
+
<zn-badge slot="anchor" color="warning">Degraded</zn-badge>
|
|
226
|
+
</zn-hover-container>
|
|
227
|
+
|
|
228
|
+
<zn-hover-container content="Service unavailable">
|
|
229
|
+
<zn-badge slot="anchor" color="error">Offline</zn-badge>
|
|
230
|
+
</zn-hover-container>
|
|
231
|
+
</div>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Complex Content
|
|
235
|
+
|
|
236
|
+
Display detailed information with formatted content.
|
|
237
|
+
|
|
238
|
+
```html:preview
|
|
239
|
+
<zn-hover-container trigger="click" placement="bottom-start">
|
|
240
|
+
<zn-button slot="anchor" icon="info">View Details</zn-button>
|
|
241
|
+
<div slot="content" style="padding: 15px; max-width: 300px;">
|
|
242
|
+
<h3 style="margin: 0 0 10px 0;">Product Details</h3>
|
|
243
|
+
<div style="display: grid; gap: 5px; font-size: 0.9em;">
|
|
244
|
+
<div><strong>SKU:</strong> ABC-12345</div>
|
|
245
|
+
<div><strong>Price:</strong> $99.99</div>
|
|
246
|
+
<div><strong>Stock:</strong> 42 units</div>
|
|
247
|
+
<div><strong>Category:</strong> Electronics</div>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
</zn-hover-container>
|
|
251
|
+
```
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
meta:
|
|
3
|
+
title: Icon Picker
|
|
4
|
+
description: Icon pickers allow users to select an icon, library, and colour via a modal dialog.
|
|
5
|
+
layout: component
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Examples
|
|
9
|
+
|
|
10
|
+
### Basic Icon Picker
|
|
11
|
+
|
|
12
|
+
A basic icon picker with a label. Click the trigger to open the selection dialog.
|
|
13
|
+
|
|
14
|
+
```html:preview
|
|
15
|
+
<zn-icon-picker name="basic" label="Choose an Icon"></zn-icon-picker>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### With a Pre-selected Icon
|
|
19
|
+
|
|
20
|
+
Set the `icon` and `library` attributes to pre-populate the picker.
|
|
21
|
+
|
|
22
|
+
```html:preview
|
|
23
|
+
<zn-icon-picker name="preset" label="Page Icon" icon="home" library="material"></zn-icon-picker>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### With Colour
|
|
27
|
+
|
|
28
|
+
Set the `color` attribute to apply a colour to the icon.
|
|
29
|
+
|
|
30
|
+
```html:preview
|
|
31
|
+
<zn-icon-picker name="colored" label="Coloured Icon" icon="star" library="material" color="#e91e63"></zn-icon-picker>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Without Colour Option
|
|
35
|
+
|
|
36
|
+
Use the `no-color` attribute to hide the colour picker from the selection dialog.
|
|
37
|
+
|
|
38
|
+
```html:preview
|
|
39
|
+
<zn-icon-picker name="no-color" label="Icon Only" icon="settings" no-color></zn-icon-picker>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Without Library Option
|
|
43
|
+
|
|
44
|
+
Use the `no-library` attribute to hide the library selector, locking it to the default library.
|
|
45
|
+
|
|
46
|
+
```html:preview
|
|
47
|
+
<zn-icon-picker name="no-lib" label="Default Library Only" icon="check_circle" no-library></zn-icon-picker>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Without Colour or Library
|
|
51
|
+
|
|
52
|
+
Both options can be removed together for a minimal icon-only picker.
|
|
53
|
+
|
|
54
|
+
```html:preview
|
|
55
|
+
<zn-icon-picker name="minimal" label="Minimal Picker" icon="edit" no-color no-library></zn-icon-picker>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Brand Icons
|
|
59
|
+
|
|
60
|
+
Pre-select the `brands` library to show Kubex brand icons.
|
|
61
|
+
|
|
62
|
+
```html:preview
|
|
63
|
+
<zn-icon-picker name="brand" label="Brand Icon" icon="chargehive" library="brands"></zn-icon-picker>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Line Icons
|
|
67
|
+
|
|
68
|
+
Use the `line` library for Lineicons.
|
|
69
|
+
|
|
70
|
+
```html:preview
|
|
71
|
+
<zn-icon-picker name="line" label="Line Icon" icon="heart" library="line"></zn-icon-picker>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Gravatar
|
|
75
|
+
|
|
76
|
+
Use the `gravatar` library to display a Gravatar from an email address.
|
|
77
|
+
|
|
78
|
+
```html:preview
|
|
79
|
+
<zn-icon-picker name="grav" label="Gravatar" icon="user@example.com" library="gravatar" no-color></zn-icon-picker>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Avatar
|
|
83
|
+
|
|
84
|
+
Use the `avatar` library to generate initials from a name.
|
|
85
|
+
|
|
86
|
+
```html:preview
|
|
87
|
+
<zn-icon-picker name="av" label="Avatar" icon="John Smith" library="avatar" no-color></zn-icon-picker>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Help Text
|
|
91
|
+
|
|
92
|
+
Add descriptive text below the picker with the `help-text` attribute.
|
|
93
|
+
|
|
94
|
+
```html:preview
|
|
95
|
+
<zn-icon-picker name="help" label="Navigation Icon" help-text="This icon will be displayed in the sidebar menu"></zn-icon-picker>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Disabled
|
|
99
|
+
|
|
100
|
+
Use the `disabled` attribute to prevent interaction.
|
|
101
|
+
|
|
102
|
+
```html:preview
|
|
103
|
+
<zn-icon-picker name="disabled" label="Disabled Picker" icon="lock" disabled></zn-icon-picker>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### In a Form
|
|
107
|
+
|
|
108
|
+
The icon picker integrates with forms using hidden inputs. The field names follow the pattern `{name}[icon]`, `{name}[library]`, and `{name}[color]`.
|
|
109
|
+
|
|
110
|
+
```html:preview
|
|
111
|
+
<form id="icon-form" onsubmit="return false;">
|
|
112
|
+
<zn-icon-picker name="menu-icon" label="Menu Icon" icon="dashboard" library="material" color="#1976d2"></zn-icon-picker>
|
|
113
|
+
<br>
|
|
114
|
+
<zn-button type="submit" onclick="
|
|
115
|
+
const form = document.getElementById('icon-form');
|
|
116
|
+
const data = new FormData(form);
|
|
117
|
+
const entries = [...data.entries()].map(([k,v]) => k + ': ' + v).join('\n');
|
|
118
|
+
alert(entries);
|
|
119
|
+
">Show Form Data</zn-button>
|
|
120
|
+
</form>
|
|
121
|
+
```
|