@kubex/zinc 1.0.24 → 1.0.98
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 +13431 -8728
- package/dist/vscode.html-custom-data.json +571 -37
- package/dist/web-types.json +1439 -181
- package/dist/zn.d.ts +1642 -661
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +1407 -887
- 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/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 -18
- 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 +82 -23
- 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 +328 -5
- package/src/components/input/input.scss +100 -4
- 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 +11 -2
- package/src/components/item/item.scss +7 -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 -8
- 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 -42
- package/src/components/translations/translations.scss +5 -1
- 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,51 +1,350 @@
|
|
|
1
1
|
---
|
|
2
2
|
meta:
|
|
3
3
|
title: Empty State
|
|
4
|
-
description:
|
|
4
|
+
description: Empty states are used to communicate that there's no content to display and guide users on what to do next.
|
|
5
5
|
layout: component
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
```html:preview
|
|
9
9
|
<zn-empty-state
|
|
10
|
-
caption="
|
|
11
|
-
description="
|
|
10
|
+
caption="No items found"
|
|
11
|
+
description="There are no items to display at this time."
|
|
12
12
|
type="primary"
|
|
13
|
-
icon="
|
|
13
|
+
icon="inbox">
|
|
14
14
|
</zn-empty-state>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
Empty states appear when a list, table, or other container has no content to show. They help users understand why content is missing and often provide actions to resolve the empty state.
|
|
18
|
+
|
|
17
19
|
## Examples
|
|
18
20
|
|
|
19
|
-
###
|
|
21
|
+
### Basic Empty State
|
|
22
|
+
|
|
23
|
+
A basic empty state with a caption and description.
|
|
24
|
+
|
|
25
|
+
```html:preview
|
|
26
|
+
<zn-empty-state
|
|
27
|
+
caption="No data available"
|
|
28
|
+
description="Start by adding your first item to see it here."
|
|
29
|
+
icon="data_usage">
|
|
30
|
+
</zn-empty-state>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Without Icon
|
|
34
|
+
|
|
35
|
+
Empty states can be displayed without an icon if you prefer a more minimal look.
|
|
20
36
|
|
|
21
37
|
```html:preview
|
|
38
|
+
<zn-empty-state
|
|
39
|
+
caption="Nothing to show"
|
|
40
|
+
description="Your content will appear here once available.">
|
|
41
|
+
</zn-empty-state>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Types
|
|
22
45
|
|
|
46
|
+
Use the `type` attribute to apply semantic styling to the empty state. Available types are `primary`, `info`, and `error`.
|
|
47
|
+
|
|
48
|
+
```html:preview
|
|
49
|
+
<zn-empty-state
|
|
50
|
+
caption="Primary State"
|
|
51
|
+
description="This is a primary empty state."
|
|
52
|
+
type="primary"
|
|
53
|
+
icon="lightbulb">
|
|
54
|
+
</zn-empty-state>
|
|
55
|
+
<br />
|
|
56
|
+
<zn-empty-state
|
|
57
|
+
caption="Info State"
|
|
58
|
+
description="This provides informational context."
|
|
59
|
+
type="info"
|
|
60
|
+
icon="info">
|
|
61
|
+
</zn-empty-state>
|
|
62
|
+
<br />
|
|
23
63
|
<zn-empty-state
|
|
24
|
-
caption="
|
|
25
|
-
description="
|
|
26
|
-
|
|
64
|
+
caption="Error State"
|
|
65
|
+
description="Something went wrong and no content could be loaded."
|
|
66
|
+
type="error"
|
|
67
|
+
icon="error">
|
|
68
|
+
</zn-empty-state>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### With Action Buttons
|
|
72
|
+
|
|
73
|
+
Use the default slot to add action buttons that help users resolve the empty state.
|
|
74
|
+
|
|
75
|
+
```html:preview
|
|
76
|
+
<zn-empty-state
|
|
77
|
+
caption="No files uploaded"
|
|
78
|
+
description="Upload your first file to get started."
|
|
79
|
+
icon="cloud_upload">
|
|
80
|
+
<zn-button color="primary">Upload File</zn-button>
|
|
81
|
+
</zn-empty-state>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### With Multiple Actions
|
|
85
|
+
|
|
86
|
+
Combine multiple buttons using the button group component for more complex actions.
|
|
87
|
+
|
|
88
|
+
```html:preview
|
|
89
|
+
<zn-empty-state
|
|
90
|
+
caption="No results found"
|
|
91
|
+
description="Try adjusting your search or filter criteria."
|
|
92
|
+
icon="search_off">
|
|
27
93
|
<zn-button-group>
|
|
28
|
-
<zn-button>
|
|
29
|
-
<zn-button>
|
|
94
|
+
<zn-button color="primary">Clear Filters</zn-button>
|
|
95
|
+
<zn-button color="secondary">New Search</zn-button>
|
|
30
96
|
</zn-button-group>
|
|
31
97
|
</zn-empty-state>
|
|
32
98
|
```
|
|
33
99
|
|
|
34
100
|
### Padded
|
|
35
101
|
|
|
36
|
-
|
|
102
|
+
Use the `padded` attribute to add extra spacing around the empty state content. This is useful when the empty state is displayed within a container that needs additional visual breathing room.
|
|
37
103
|
|
|
104
|
+
```html:preview
|
|
38
105
|
<zn-empty-state
|
|
39
106
|
padded
|
|
40
107
|
type="primary"
|
|
41
|
-
caption="
|
|
42
|
-
description="
|
|
43
|
-
icon="
|
|
108
|
+
caption="No notifications"
|
|
109
|
+
description="You're all caught up! Check back later for new updates."
|
|
110
|
+
icon="notifications_none">
|
|
111
|
+
<zn-button color="primary">Manage Settings</zn-button>
|
|
112
|
+
</zn-empty-state>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Using Slots
|
|
116
|
+
|
|
117
|
+
Empty states support slots for more flexible content customization. You can use the `caption` and `description` slots to provide rich HTML content.
|
|
118
|
+
|
|
119
|
+
#### Caption Slot
|
|
120
|
+
|
|
121
|
+
```html:preview
|
|
122
|
+
<zn-empty-state icon="folder_open" type="info">
|
|
123
|
+
<div slot="caption">
|
|
124
|
+
<strong>No Projects Found</strong>
|
|
125
|
+
</div>
|
|
126
|
+
<div slot="description">
|
|
127
|
+
Projects you create will appear here.
|
|
128
|
+
</div>
|
|
129
|
+
<zn-button color="info">Create Project</zn-button>
|
|
130
|
+
</zn-empty-state>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### Rich Description Content
|
|
134
|
+
|
|
135
|
+
```html:preview
|
|
136
|
+
<zn-empty-state caption="Welcome!" icon="waving_hand" type="primary">
|
|
137
|
+
<div slot="description">
|
|
138
|
+
<p>Get started by creating your first resource.</p>
|
|
139
|
+
<p>Need help? <a href="#">View documentation</a></p>
|
|
140
|
+
</div>
|
|
141
|
+
<zn-button-group>
|
|
142
|
+
<zn-button color="primary">Get Started</zn-button>
|
|
143
|
+
<zn-button color="secondary">Take Tour</zn-button>
|
|
144
|
+
</zn-button-group>
|
|
145
|
+
</zn-empty-state>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Common Use Cases
|
|
149
|
+
|
|
150
|
+
### No Search Results
|
|
151
|
+
|
|
152
|
+
```html:preview
|
|
153
|
+
<zn-empty-state
|
|
154
|
+
caption="No results match your search"
|
|
155
|
+
description="We couldn't find anything matching your search criteria. Try different keywords or clear your filters."
|
|
156
|
+
icon="search_off"
|
|
157
|
+
type="info">
|
|
158
|
+
<zn-button-group>
|
|
159
|
+
<zn-button color="info">Clear Search</zn-button>
|
|
160
|
+
<zn-button color="secondary">Reset Filters</zn-button>
|
|
161
|
+
</zn-button-group>
|
|
162
|
+
</zn-empty-state>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Empty List
|
|
166
|
+
|
|
167
|
+
```html:preview
|
|
168
|
+
<zn-empty-state
|
|
169
|
+
caption="No items yet"
|
|
170
|
+
description="Start building your collection by adding your first item."
|
|
171
|
+
icon="add_circle"
|
|
172
|
+
type="primary">
|
|
173
|
+
<zn-button color="primary" icon="add">Add Item</zn-button>
|
|
174
|
+
</zn-empty-state>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Connection Error
|
|
178
|
+
|
|
179
|
+
```html:preview
|
|
180
|
+
<zn-empty-state
|
|
181
|
+
caption="Connection failed"
|
|
182
|
+
description="Unable to load data. Please check your internet connection and try again."
|
|
183
|
+
icon="cloud_off"
|
|
184
|
+
type="error">
|
|
44
185
|
<zn-button-group>
|
|
45
|
-
<zn-button>
|
|
46
|
-
<zn-button>
|
|
186
|
+
<zn-button color="error">Retry</zn-button>
|
|
187
|
+
<zn-button color="secondary">Go Back</zn-button>
|
|
47
188
|
</zn-button-group>
|
|
48
189
|
</zn-empty-state>
|
|
49
190
|
```
|
|
50
191
|
|
|
192
|
+
### Permission Denied
|
|
193
|
+
|
|
194
|
+
```html:preview
|
|
195
|
+
<zn-empty-state
|
|
196
|
+
caption="Access denied"
|
|
197
|
+
description="You don't have permission to view this content. Contact your administrator for access."
|
|
198
|
+
icon="lock"
|
|
199
|
+
type="error">
|
|
200
|
+
<zn-button color="secondary">Back to Dashboard</zn-button>
|
|
201
|
+
</zn-empty-state>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Empty Inbox
|
|
205
|
+
|
|
206
|
+
```html:preview
|
|
207
|
+
<zn-empty-state
|
|
208
|
+
padded
|
|
209
|
+
caption="All clear!"
|
|
210
|
+
description="You have no new messages. Enjoy your day!"
|
|
211
|
+
icon="mark_email_read"
|
|
212
|
+
type="info">
|
|
213
|
+
<zn-button color="info" text>Compose Message</zn-button>
|
|
214
|
+
</zn-empty-state>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### No Data Available
|
|
218
|
+
|
|
219
|
+
```html:preview
|
|
220
|
+
<zn-empty-state
|
|
221
|
+
caption="No data to display"
|
|
222
|
+
description="Data will appear here once it becomes available. This may take a few moments."
|
|
223
|
+
icon="hourglass_empty"
|
|
224
|
+
type="info">
|
|
225
|
+
<zn-button color="secondary" icon="refresh">Refresh</zn-button>
|
|
226
|
+
</zn-empty-state>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### First Time User
|
|
230
|
+
|
|
231
|
+
```html:preview
|
|
232
|
+
<zn-empty-state
|
|
233
|
+
padded
|
|
234
|
+
caption="Welcome aboard!"
|
|
235
|
+
description="Let's get you started with a quick tour of the features."
|
|
236
|
+
icon="celebration"
|
|
237
|
+
type="primary">
|
|
238
|
+
<zn-button-group>
|
|
239
|
+
<zn-button color="primary" icon="play_arrow">Start Tour</zn-button>
|
|
240
|
+
<zn-button color="secondary" icon="close">Skip</zn-button>
|
|
241
|
+
</zn-button-group>
|
|
242
|
+
</zn-empty-state>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Empty Cart
|
|
246
|
+
|
|
247
|
+
```html:preview
|
|
248
|
+
<zn-empty-state
|
|
249
|
+
caption="Your cart is empty"
|
|
250
|
+
description="Add items to your cart to continue shopping."
|
|
251
|
+
icon="shopping_cart"
|
|
252
|
+
type="primary">
|
|
253
|
+
<zn-button color="primary" icon="storefront">Continue Shopping</zn-button>
|
|
254
|
+
</zn-empty-state>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### No Favorites
|
|
258
|
+
|
|
259
|
+
```html:preview
|
|
260
|
+
<zn-empty-state
|
|
261
|
+
caption="No favorites yet"
|
|
262
|
+
description="Items you mark as favorites will appear here for quick access."
|
|
263
|
+
icon="favorite_border"
|
|
264
|
+
type="info">
|
|
265
|
+
<zn-button color="info" text icon="explore">Explore Items</zn-button>
|
|
266
|
+
</zn-empty-state>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Maintenance Mode
|
|
270
|
+
|
|
271
|
+
```html:preview
|
|
272
|
+
<zn-empty-state
|
|
273
|
+
padded
|
|
274
|
+
caption="Under maintenance"
|
|
275
|
+
description="We're currently performing scheduled maintenance. Please check back shortly."
|
|
276
|
+
icon="construction"
|
|
277
|
+
type="info">
|
|
278
|
+
<zn-button color="secondary" icon="schedule">Check Status</zn-button>
|
|
279
|
+
</zn-empty-state>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Deleted Items
|
|
283
|
+
|
|
284
|
+
```html:preview
|
|
285
|
+
<zn-empty-state
|
|
286
|
+
caption="No items in trash"
|
|
287
|
+
description="Deleted items will appear here and can be restored within 30 days."
|
|
288
|
+
icon="delete_outline"
|
|
289
|
+
type="primary">
|
|
290
|
+
</zn-empty-state>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Completed Tasks
|
|
294
|
+
|
|
295
|
+
```html:preview
|
|
296
|
+
<zn-empty-state
|
|
297
|
+
padded
|
|
298
|
+
caption="All tasks completed!"
|
|
299
|
+
description="Great job! You've finished all your tasks. Take a break or add new ones."
|
|
300
|
+
icon="task_alt"
|
|
301
|
+
type="info">
|
|
302
|
+
<zn-button-group>
|
|
303
|
+
<zn-button color="info" icon="add">Add Task</zn-button>
|
|
304
|
+
<zn-button color="secondary" text>View Completed</zn-button>
|
|
305
|
+
</zn-button-group>
|
|
306
|
+
</zn-empty-state>
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Best Practices
|
|
310
|
+
|
|
311
|
+
### Helpful Icons
|
|
312
|
+
|
|
313
|
+
Choose icons that clearly communicate the empty state's context. For example, use `inbox` for empty inboxes, `search_off` for no search results, and `cloud_off` for connection errors.
|
|
314
|
+
|
|
315
|
+
```html:preview
|
|
316
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem;">
|
|
317
|
+
<zn-empty-state caption="No messages" description="Your inbox is empty." icon="inbox"></zn-empty-state>
|
|
318
|
+
<zn-empty-state caption="Search failed" description="No results found." icon="search_off"></zn-empty-state>
|
|
319
|
+
<zn-empty-state caption="Offline" description="No connection." icon="cloud_off" type="error"></zn-empty-state>
|
|
320
|
+
</div>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Clear Actions
|
|
324
|
+
|
|
325
|
+
Always provide clear next steps when possible. Tell users what they can do to resolve the empty state.
|
|
326
|
+
|
|
327
|
+
```html:preview
|
|
328
|
+
<zn-empty-state
|
|
329
|
+
caption="No team members"
|
|
330
|
+
description="Invite team members to start collaborating on projects together."
|
|
331
|
+
icon="group_add"
|
|
332
|
+
type="primary">
|
|
333
|
+
<zn-button color="primary" icon="person_add">Invite Team Member</zn-button>
|
|
334
|
+
</zn-empty-state>
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Appropriate Tone
|
|
338
|
+
|
|
339
|
+
Match the tone of your message to the context. Celebratory for completed tasks, helpful for new users, and informative for errors.
|
|
340
|
+
|
|
341
|
+
```html:preview
|
|
342
|
+
<zn-empty-state
|
|
343
|
+
padded
|
|
344
|
+
caption="You're a star!"
|
|
345
|
+
description="All invoices are paid and up to date. Keep up the great work!"
|
|
346
|
+
icon="stars"
|
|
347
|
+
type="info">
|
|
348
|
+
</zn-empty-state>
|
|
349
|
+
```
|
|
51
350
|
|
|
@@ -1,55 +1,239 @@
|
|
|
1
1
|
---
|
|
2
2
|
meta:
|
|
3
3
|
title: Expanding Action
|
|
4
|
-
description:
|
|
4
|
+
description: An expandable action button component that reveals content either in a dropdown panel or inline. Supports dynamic content loading, notification badges, and two display methods - drop and fill.
|
|
5
5
|
layout: component
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
```html:preview
|
|
9
|
-
<zn-expanding-action icon="new_label"
|
|
10
|
-
uri=""
|
|
9
|
+
<zn-expanding-action icon="new_label"
|
|
11
10
|
method="fill"
|
|
12
|
-
count-uri=""
|
|
13
11
|
prefetch>
|
|
14
12
|
This is the content here, this will probably be loaded from one of the URIs.
|
|
15
13
|
if count uri is set, use that to retrieve the number to display as a notification
|
|
16
|
-
if prefetch is set, we need to
|
|
14
|
+
if prefetch is set, we need to load the uri which should have the count with it.
|
|
17
15
|
</zn-expanding-action>
|
|
18
16
|
```
|
|
19
17
|
|
|
20
|
-
##
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
### Drop Method
|
|
21
|
+
|
|
22
|
+
Use the `method="drop"` to display content in a dropdown panel when the icon is clicked.
|
|
23
|
+
|
|
24
|
+
```html:preview
|
|
25
|
+
<zn-expanding-action icon="notifications"
|
|
26
|
+
method="drop">
|
|
27
|
+
<div style="padding: 15px; min-width: 250px;">
|
|
28
|
+
<h4>Notifications</h4>
|
|
29
|
+
<p>You have 3 new messages</p>
|
|
30
|
+
<p>2 tasks are due today</p>
|
|
31
|
+
</div>
|
|
32
|
+
</zn-expanding-action>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Fill Method
|
|
36
|
+
|
|
37
|
+
Use the `method="fill"` to display content inline, expanding horizontally.
|
|
38
|
+
|
|
39
|
+
```html:preview
|
|
40
|
+
<zn-expanding-action icon="add"
|
|
41
|
+
method="fill">
|
|
42
|
+
<div style="padding: 10px;">
|
|
43
|
+
<p>This content expands inline when clicked</p>
|
|
44
|
+
</div>
|
|
45
|
+
</zn-expanding-action>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### With Notification Count
|
|
49
|
+
|
|
50
|
+
Display a notification badge using the `count` attribute.
|
|
51
|
+
|
|
52
|
+
```html:preview
|
|
53
|
+
<zn-expanding-action icon="mail"
|
|
54
|
+
method="drop"
|
|
55
|
+
count="5">
|
|
56
|
+
<div style="padding: 15px; min-width: 250px;">
|
|
57
|
+
<h4>Inbox</h4>
|
|
58
|
+
<p>You have 5 unread messages</p>
|
|
59
|
+
</div>
|
|
60
|
+
</zn-expanding-action>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### With Custom Color
|
|
64
|
+
|
|
65
|
+
Set the icon color using the `color` attribute.
|
|
66
|
+
|
|
67
|
+
```html:preview
|
|
68
|
+
<zn-expanding-action icon="warning"
|
|
69
|
+
method="drop"
|
|
70
|
+
color="warning"
|
|
71
|
+
count="2">
|
|
72
|
+
<div style="padding: 15px; min-width: 250px;">
|
|
73
|
+
<h4>Warnings</h4>
|
|
74
|
+
<p>2 items require your attention</p>
|
|
75
|
+
</div>
|
|
76
|
+
</zn-expanding-action>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Custom Width
|
|
80
|
+
|
|
81
|
+
Control the dropdown width using the `basis` attribute (for drop method).
|
|
82
|
+
|
|
83
|
+
```html:preview
|
|
84
|
+
<zn-expanding-action icon="menu"
|
|
85
|
+
method="drop"
|
|
86
|
+
basis="400">
|
|
87
|
+
<div style="padding: 15px;">
|
|
88
|
+
<h4>Wide Panel</h4>
|
|
89
|
+
<p>This panel is wider than the default 300px</p>
|
|
90
|
+
</div>
|
|
91
|
+
</zn-expanding-action>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Custom Max Height
|
|
95
|
+
|
|
96
|
+
Limit the content height using the `max-height` attribute.
|
|
97
|
+
|
|
98
|
+
```html:preview
|
|
99
|
+
<zn-expanding-action icon="list"
|
|
100
|
+
method="drop"
|
|
101
|
+
max-height="200">
|
|
102
|
+
<div style="padding: 15px;">
|
|
103
|
+
<h4>Scrollable Content</h4>
|
|
104
|
+
<p>Item 1</p>
|
|
105
|
+
<p>Item 2</p>
|
|
106
|
+
<p>Item 3</p>
|
|
107
|
+
<p>Item 4</p>
|
|
108
|
+
<p>Item 5</p>
|
|
109
|
+
<p>Item 6</p>
|
|
110
|
+
<p>Item 7</p>
|
|
111
|
+
<p>Item 8</p>
|
|
112
|
+
</div>
|
|
113
|
+
</zn-expanding-action>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Multiple Expanding Actions
|
|
117
|
+
|
|
118
|
+
Use multiple expanding actions together.
|
|
21
119
|
|
|
22
120
|
```html:preview
|
|
121
|
+
<div style="display: flex; gap: 10px;">
|
|
122
|
+
<zn-expanding-action icon="notifications"
|
|
123
|
+
method="drop"
|
|
124
|
+
count="3">
|
|
125
|
+
<div style="padding: 15px; min-width: 250px;">
|
|
126
|
+
<h4>Notifications</h4>
|
|
127
|
+
<p>3 new updates</p>
|
|
128
|
+
</div>
|
|
129
|
+
</zn-expanding-action>
|
|
130
|
+
|
|
131
|
+
<zn-expanding-action icon="mail"
|
|
132
|
+
method="drop"
|
|
133
|
+
count="7">
|
|
134
|
+
<div style="padding: 15px; min-width: 250px;">
|
|
135
|
+
<h4>Messages</h4>
|
|
136
|
+
<p>7 unread messages</p>
|
|
137
|
+
</div>
|
|
138
|
+
</zn-expanding-action>
|
|
139
|
+
|
|
140
|
+
<zn-expanding-action icon="settings"
|
|
141
|
+
method="drop">
|
|
142
|
+
<div style="padding: 15px; min-width: 200px;">
|
|
143
|
+
<h4>Settings</h4>
|
|
144
|
+
<p>Configure your preferences</p>
|
|
145
|
+
</div>
|
|
146
|
+
</zn-expanding-action>
|
|
147
|
+
</div>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### In Action Bar
|
|
151
|
+
|
|
152
|
+
Use expanding actions within an action bar for navigation.
|
|
153
|
+
|
|
154
|
+
```html:preview
|
|
155
|
+
<zn-action-bar>
|
|
156
|
+
<zn-dropdown distance="5" slot="menu">
|
|
157
|
+
<zn-button slot="trigger" color="transparent" icon-position="right" icon="arrow_drop_down">
|
|
158
|
+
Dashboard
|
|
159
|
+
</zn-button>
|
|
160
|
+
<zn-menu>
|
|
161
|
+
<zn-menu-item>Overview</zn-menu-item>
|
|
162
|
+
<zn-menu-item>Analytics</zn-menu-item>
|
|
163
|
+
</zn-menu>
|
|
164
|
+
</zn-dropdown>
|
|
165
|
+
|
|
23
166
|
<zn-expanding-action icon="edit_note"
|
|
24
|
-
method="
|
|
25
|
-
count
|
|
26
|
-
slot="actions"
|
|
27
|
-
|
|
28
|
-
|
|
167
|
+
method="drop"
|
|
168
|
+
count="2"
|
|
169
|
+
slot="actions">
|
|
170
|
+
<div style="padding: 15px; min-width: 250px;">
|
|
171
|
+
<h4>Notes</h4>
|
|
172
|
+
<p>2 draft notes</p>
|
|
173
|
+
</div>
|
|
29
174
|
</zn-expanding-action>
|
|
30
175
|
|
|
31
|
-
<zn-expanding-action icon="
|
|
32
|
-
content-uri="/test"
|
|
176
|
+
<zn-expanding-action icon="notifications"
|
|
33
177
|
method="drop"
|
|
178
|
+
count="5"
|
|
34
179
|
slot="actions">
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
180
|
+
<div style="padding: 15px; min-width: 250px;">
|
|
181
|
+
<h4>Alerts</h4>
|
|
182
|
+
<p>5 new notifications</p>
|
|
183
|
+
</div>
|
|
38
184
|
</zn-expanding-action>
|
|
185
|
+
</zn-action-bar>
|
|
39
186
|
```
|
|
40
187
|
|
|
41
|
-
|
|
188
|
+
### With Form Content
|
|
189
|
+
|
|
190
|
+
Include form elements within the expanding action.
|
|
191
|
+
|
|
192
|
+
```html:preview
|
|
193
|
+
<zn-expanding-action icon="add_circle"
|
|
194
|
+
method="drop"
|
|
195
|
+
basis="350">
|
|
196
|
+
<div style="padding: 15px;">
|
|
197
|
+
<h4>Quick Add</h4>
|
|
198
|
+
<form class="form-spacing">
|
|
199
|
+
<zn-input label="Title" required></zn-input>
|
|
200
|
+
<zn-textarea label="Description"></zn-textarea>
|
|
201
|
+
<zn-button type="submit" color="success">Add</zn-button>
|
|
202
|
+
</form>
|
|
203
|
+
</div>
|
|
204
|
+
</zn-expanding-action>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Nested in Defined Label
|
|
208
|
+
|
|
209
|
+
Combine with other components like defined-label.
|
|
42
210
|
|
|
43
211
|
```html:preview
|
|
44
|
-
<zn-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
212
|
+
<zn-expanding-action icon="label"
|
|
213
|
+
method="fill"
|
|
214
|
+
basis="400">
|
|
215
|
+
<zn-defined-label
|
|
216
|
+
allow-custom
|
|
217
|
+
predefined-labels="[{"name":"priority","options":["low","medium","high"]},{"name":"status","options":["open","closed"]}]">
|
|
218
|
+
</zn-defined-label>
|
|
219
|
+
</zn-expanding-action>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### User Profile Menu
|
|
223
|
+
|
|
224
|
+
A practical example for a user profile dropdown.
|
|
225
|
+
|
|
226
|
+
```html:preview
|
|
227
|
+
<zn-expanding-action icon="account_circle"
|
|
228
|
+
method="drop"
|
|
229
|
+
basis="250">
|
|
230
|
+
<div style="padding: 15px;">
|
|
231
|
+
<h4>John Doe</h4>
|
|
232
|
+
<p style="color: var(--zn-color-neutral-500); margin: 0;">john@example.com</p>
|
|
233
|
+
<hr style="margin: 10px 0;">
|
|
234
|
+
<zn-button text color="transparent" style="width: 100%; justify-content: flex-start;">Profile</zn-button>
|
|
235
|
+
<zn-button text color="transparent" style="width: 100%; justify-content: flex-start;">Settings</zn-button>
|
|
236
|
+
<zn-button text color="transparent" style="width: 100%; justify-content: flex-start;">Logout</zn-button>
|
|
237
|
+
</div>
|
|
238
|
+
</zn-expanding-action>
|
|
55
239
|
```
|