@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.
Files changed (199) hide show
  1. package/.claude/project.md +556 -0
  2. package/.github/workflows/js_build_and_deploy.yaml +9 -10
  3. package/dist/custom-elements.json +13575 -8856
  4. package/dist/vscode.html-custom-data.json +583 -48
  5. package/dist/web-types.json +1441 -181
  6. package/dist/zn.d.ts +1645 -660
  7. package/dist/zn.min.css +1 -1
  8. package/dist/zn.min.js +1412 -893
  9. package/docs/_utilities/code-previews.cjs +10 -1
  10. package/docs/assets/scripts/docs.js +42 -18
  11. package/docs/data/data-table.json +229 -66
  12. package/docs/data/empty.json +6 -0
  13. package/docs/data/products-table.json +41 -193
  14. package/docs/pages/components/action-bar.md +121 -6
  15. package/docs/pages/components/alert.md +118 -15
  16. package/docs/pages/components/animated-button.md +299 -0
  17. package/docs/pages/components/audio-select.md +534 -0
  18. package/docs/pages/components/bulk-actions.md +79 -5
  19. package/docs/pages/components/button-group.md +235 -27
  20. package/docs/pages/components/button.md +139 -1
  21. package/docs/pages/components/chart.md +365 -9
  22. package/docs/pages/components/checkbox.md +387 -58
  23. package/docs/pages/components/chip.md +253 -33
  24. package/docs/pages/components/collapsible.md +393 -46
  25. package/docs/pages/components/cols.md +152 -30
  26. package/docs/pages/components/confirm.md +182 -16
  27. package/docs/pages/components/copy-button.md +169 -6
  28. package/docs/pages/components/data-select.md +194 -15
  29. package/docs/pages/components/data-table-filter.md +96 -5
  30. package/docs/pages/components/data-table-search.md +451 -0
  31. package/docs/pages/components/data-table-sort.md +66 -5
  32. package/docs/pages/components/data-table.md +727 -66
  33. package/docs/pages/components/datepicker.md +402 -7
  34. package/docs/pages/components/defined-label.md +120 -5
  35. package/docs/pages/components/dialog.md +339 -59
  36. package/docs/pages/components/dropdown.md +366 -11
  37. package/docs/pages/components/editor.md +604 -7
  38. package/docs/pages/components/empty-state.md +315 -16
  39. package/docs/pages/components/expanding-action.md +212 -28
  40. package/docs/pages/components/file.md +421 -12
  41. package/docs/pages/components/filter-container.md +158 -5
  42. package/docs/pages/components/filter-wrapper.md +167 -6
  43. package/docs/pages/components/form-group.md +383 -6
  44. package/docs/pages/components/hover-container.md +237 -6
  45. package/docs/pages/components/icon-picker.md +121 -0
  46. package/docs/pages/components/icon.md +454 -48
  47. package/docs/pages/components/inline-edit.md +787 -19
  48. package/docs/pages/components/input-group.md +207 -13
  49. package/docs/pages/components/input.md +194 -0
  50. package/docs/pages/components/item.md +18 -0
  51. package/docs/pages/components/key-container.md +115 -0
  52. package/docs/pages/components/key.md +101 -0
  53. package/docs/pages/components/menu.md +512 -6
  54. package/docs/pages/components/note.md +239 -36
  55. package/docs/pages/components/opt-group.md +107 -0
  56. package/docs/pages/components/pagination.md +332 -6
  57. package/docs/pages/components/pane.md +222 -6
  58. package/docs/pages/components/panel.md +213 -26
  59. package/docs/pages/components/popup.md +1354 -6
  60. package/docs/pages/components/priority-list.md +233 -0
  61. package/docs/pages/components/progress-bar.md +387 -6
  62. package/docs/pages/components/radio-group.md +242 -5
  63. package/docs/pages/components/radio.md +474 -6
  64. package/docs/pages/components/rating.md +331 -7
  65. package/docs/pages/components/reveal.md +524 -6
  66. package/docs/pages/components/scroll-container.md +552 -6
  67. package/docs/pages/components/select.md +762 -160
  68. package/docs/pages/components/skeleton.md +473 -30
  69. package/docs/pages/components/slideout.md +261 -5
  70. package/docs/pages/components/sp.md +99 -41
  71. package/docs/pages/components/split-button.md +347 -9
  72. package/docs/pages/components/split-pane.md +445 -6
  73. package/docs/pages/components/stat.md +549 -9
  74. package/docs/pages/components/status-indicator.md +230 -1
  75. package/docs/pages/components/stepper.md +563 -6
  76. package/docs/pages/components/tabs.md +439 -13
  77. package/docs/pages/components/textarea.md +415 -17
  78. package/docs/pages/components/tile.md +385 -26
  79. package/docs/pages/components/toggle.md +424 -6
  80. package/docs/pages/components/tooltip.md +367 -0
  81. package/docs/pages/components/translation-group.md +210 -0
  82. package/docs/pages/components/translations.md +319 -19
  83. package/docs/pages/components/vertical-stepper.md +401 -8
  84. package/docs/pages/components/well.md +300 -3
  85. package/docs/pages/getting-started/form-controls.md +162 -0
  86. package/docs/pages/index.md +116 -15
  87. package/package.json +5 -6
  88. package/scss/_global-spacing.scss +4 -0
  89. package/scss/_root.scss +2 -2
  90. package/scss/boot.scss +19 -0
  91. package/scss/shared/layout.scss +5 -0
  92. package/scss/themes/_light.scss +3 -3
  93. package/src/components/alert/alert.scss +1 -0
  94. package/src/components/animated-button/README.md +306 -0
  95. package/src/components/animated-button/animated-button.component.ts +229 -0
  96. package/src/components/animated-button/animated-button.scss +228 -0
  97. package/src/components/animated-button/animated-button.test.ts +143 -0
  98. package/src/components/animated-button/index.ts +12 -0
  99. package/src/components/button/button.component.ts +5 -0
  100. package/src/components/button-group/button-group.component.ts +25 -13
  101. package/src/components/button-group/button-group.scss +6 -0
  102. package/src/components/checkbox/checkbox.component.ts +4 -0
  103. package/src/components/checkbox/checkbox.scss +7 -4
  104. package/src/components/checkbox-group/checkbox-group.scss +7 -0
  105. package/src/components/chip/chip.component.ts +7 -2
  106. package/src/components/chip/chip.scss +16 -2
  107. package/src/components/collapsible/collapsible.component.ts +27 -20
  108. package/src/components/cols/cols.component.ts +14 -2
  109. package/src/components/cols/cols.scss +6 -12
  110. package/src/components/confirm/confirm.component.ts +7 -0
  111. package/src/components/copy-button/copy-button.component.ts +12 -11
  112. package/src/components/data-select/data-select.component.ts +215 -44
  113. package/src/components/data-select/data-select.scss +66 -6
  114. package/src/components/data-select/providers/currency-data-provider.ts +20 -6
  115. package/src/components/data-select/providers/provider.ts +1 -0
  116. package/src/components/data-select/providers/us-state-data-provider.ts +68 -0
  117. package/src/components/data-table/data-table.component.ts +81 -22
  118. package/src/components/data-table-search/data-table-search.component.ts +184 -0
  119. package/src/components/data-table-search/data-table-search.scss +17 -0
  120. package/src/components/data-table-search/data-table-search.test.ts +11 -0
  121. package/src/components/data-table-search/index.ts +12 -0
  122. package/src/components/datepicker/datepicker.component.ts +347 -13
  123. package/src/components/dialog/dialog.component.ts +1 -1
  124. package/src/components/empty-state/empty-state.scss +6 -1
  125. package/src/components/header/header.scss +3 -3
  126. package/src/components/icon/icon.component.ts +23 -1
  127. package/src/components/icon/icon.scss +23 -0
  128. package/src/components/icon-picker/brand-icons.ts +24 -0
  129. package/src/components/icon-picker/icon-picker.component.ts +407 -0
  130. package/src/components/icon-picker/icon-picker.scss +205 -0
  131. package/src/components/icon-picker/index.ts +12 -0
  132. package/src/components/icon-picker/line-icons.ts +612 -0
  133. package/src/components/icon-picker/material-icons.ts +14543 -0
  134. package/src/components/inline-edit/inline-edit.component.ts +190 -46
  135. package/src/components/inline-edit/inline-edit.scss +29 -0
  136. package/src/components/inline-edit/inline-edit.test.ts +314 -1
  137. package/src/components/input/input.component.ts +324 -5
  138. package/src/components/input/input.scss +87 -0
  139. package/src/components/input-group/input-group.component.ts +28 -7
  140. package/src/components/input-group/input-group.scss +48 -10
  141. package/src/components/item/item.component.ts +24 -3
  142. package/src/components/item/item.scss +18 -0
  143. package/src/components/key/index.ts +12 -0
  144. package/src/components/key/key.component.ts +47 -0
  145. package/src/components/key/key.scss +38 -0
  146. package/src/components/key-container/index.ts +12 -0
  147. package/src/components/key-container/key-container.component.ts +142 -0
  148. package/src/components/key-container/key-container.scss +33 -0
  149. package/src/components/menu-item/menu-item.component.ts +20 -0
  150. package/src/components/menu-item/menu-item.scss +69 -2
  151. package/src/components/navbar/navbar.component.ts +103 -11
  152. package/src/components/navbar/navbar.scss +6 -1
  153. package/src/components/opt-group/index.ts +12 -0
  154. package/src/components/opt-group/opt-group.component.ts +74 -0
  155. package/src/components/opt-group/opt-group.scss +37 -0
  156. package/src/components/opt-group/opt-group.test.ts +27 -0
  157. package/src/components/option/option.component.ts +1 -16
  158. package/src/components/option/option.scss +4 -0
  159. package/src/components/panel/panel.component.ts +10 -8
  160. package/src/components/panel/panel.scss +20 -0
  161. package/src/components/priority-list/index.ts +12 -0
  162. package/src/components/priority-list/priority-list.component.ts +611 -0
  163. package/src/components/priority-list/priority-list.scss +185 -0
  164. package/src/components/priority-list/priority-list.test.ts +139 -0
  165. package/src/components/progress-bar/progress-bar.component.ts +22 -16
  166. package/src/components/radio/radio.scss +10 -3
  167. package/src/components/select/select.component.ts +812 -72
  168. package/src/components/select/select.scss +108 -2
  169. package/src/components/select/select.test.ts +147 -2
  170. package/src/components/settings-container/settings-container.component.ts +44 -19
  171. package/src/components/settings-container/settings-container.scss +1 -1
  172. package/src/components/skeleton/skeleton.component.ts +6 -1
  173. package/src/components/slideout/slideout.scss +8 -3
  174. package/src/components/sp/sp.component.ts +3 -1
  175. package/src/components/sp/sp.scss +19 -0
  176. package/src/components/stepper/stepper.component.ts +16 -10
  177. package/src/components/textarea/textarea.scss +0 -4
  178. package/src/components/tile/tile.component.ts +12 -3
  179. package/src/components/tile/tile.scss +1 -1
  180. package/src/components/timer/timer.component.ts +15 -2
  181. package/src/components/toggle/toggle.component.ts +29 -26
  182. package/src/components/toggle/toggle.scss +13 -1
  183. package/src/components/translation-group/index.ts +12 -0
  184. package/src/components/translation-group/translation-group.component.ts +207 -0
  185. package/src/components/translation-group/translation-group.scss +8 -0
  186. package/src/components/translations/translations.component.ts +90 -44
  187. package/src/components/translations/translations.scss +4 -0
  188. package/src/components/vertical-stepper/vertical-stepper.component.ts +14 -9
  189. package/src/events/events.ts +12 -7
  190. package/src/events/zn-language-change.ts +7 -0
  191. package/src/events/zn-purchase.ts +11 -0
  192. package/src/events/zn-redirect.ts +7 -0
  193. package/src/events/zn-reorder.ts +7 -0
  194. package/src/events/zn-search-change.ts +11 -0
  195. package/src/events/zn-submit.ts +1 -1
  196. package/src/form-control.scss +4 -0
  197. package/src/internal/form-navigation.ts +510 -0
  198. package/src/internal/form.ts +6 -0
  199. package/src/zinc.ts +91 -83
@@ -1,12 +1,11 @@
1
1
  ---
2
2
  meta:
3
3
  title: Button Group
4
- description:
4
+ description: Button groups are used to organize related buttons into a cohesive unit, with options for layout, spacing, and alignment.
5
5
  layout: component
6
6
  ---
7
7
 
8
8
  ```html:preview
9
-
10
9
  <zn-button-group>
11
10
  <zn-button>First</zn-button>
12
11
  <zn-button>Inner 1</zn-button>
@@ -17,62 +16,271 @@ layout: component
17
16
 
18
17
  ## Examples
19
18
 
20
- ### Grow Example
19
+ ### Basic Usage
20
+
21
+ By default, button groups display buttons horizontally with no gaps, creating a seamless connected appearance.
22
+
23
+ ```html:preview
24
+ <zn-button-group>
25
+ <zn-button>Left</zn-button>
26
+ <zn-button>Center</zn-button>
27
+ <zn-button>Right</zn-button>
28
+ </zn-button-group>
29
+ ```
30
+
31
+ ### Direction
32
+
33
+ Use the `direction` attribute to control the orientation of the button group. The default is `horizontal`, but you can set it to `vertical` for a stacked layout.
21
34
 
22
35
  ```html:preview
36
+ <zn-button-group direction="horizontal">
37
+ <zn-button>Horizontal 1</zn-button>
38
+ <zn-button>Horizontal 2</zn-button>
39
+ <zn-button>Horizontal 3</zn-button>
40
+ </zn-button-group>
41
+
42
+ <br />
43
+ <br />
44
+
45
+ <zn-button-group direction="vertical">
46
+ <zn-button>Vertical 1</zn-button>
47
+ <zn-button>Vertical 2</zn-button>
48
+ <zn-button>Vertical 3</zn-button>
49
+ </zn-button-group>
50
+ ```
51
+
52
+ ### Grow
23
53
 
54
+ Use the `grow` attribute to make buttons expand equally to fill the full width of their container. This is useful for creating full-width button groups.
55
+
56
+ ```html:preview
24
57
  <zn-button-group grow>
25
58
  <zn-button>First</zn-button>
26
- <zn-button>Inner 1</zn-button>
27
- <zn-button>Inner 2</zn-button>
28
- <zn-button>Last</zn-button>
59
+ <zn-button>Second</zn-button>
60
+ <zn-button>Third</zn-button>
61
+ <zn-button>Fourth</zn-button>
29
62
  </zn-button-group>
30
63
  ```
31
64
 
32
- ### Start Example
65
+ ### Alignment
66
+
67
+ By default, button groups are right-aligned (flex-end). Use the `start` attribute to align buttons to the left (flex-start).
33
68
 
34
69
  ```html:preview
70
+ <zn-button-group>
71
+ <zn-button>Right Aligned 1</zn-button>
72
+ <zn-button>Right Aligned 2</zn-button>
73
+ <zn-button>Right Aligned 3</zn-button>
74
+ </zn-button-group>
75
+
76
+ <br />
77
+ <br />
35
78
 
36
79
  <zn-button-group start>
37
- <zn-button>First</zn-button>
38
- <zn-button>Inner 1</zn-button>
39
- <zn-button>Inner 2</zn-button>
40
- <zn-button>Last</zn-button>
80
+ <zn-button>Left Aligned 1</zn-button>
81
+ <zn-button>Left Aligned 2</zn-button>
82
+ <zn-button>Left Aligned 3</zn-button>
41
83
  </zn-button-group>
42
84
  ```
43
85
 
44
- ### Gap Example
86
+ ### Spacing
45
87
 
46
- ```html:preview
88
+ Use the `gap` attribute to add spacing between buttons. This creates visual separation while maintaining the logical grouping.
47
89
 
90
+ ```html:preview
48
91
  <zn-button-group gap>
49
92
  <zn-button>First</zn-button>
50
- <zn-button>Inner 1</zn-button>
51
- <zn-button>Inner 2</zn-button>
52
- <zn-button>Last</zn-button>
93
+ <zn-button>Second</zn-button>
94
+ <zn-button>Third</zn-button>
95
+ <zn-button>Fourth</zn-button>
53
96
  </zn-button-group>
54
97
  ```
55
98
 
56
- ### Grow Gap Example
99
+ ### Gap with Grow
57
100
 
58
- ```html:preview
101
+ Combine `gap` and `grow` attributes to create evenly-spaced, full-width button groups.
59
102
 
103
+ ```html:preview
60
104
  <zn-button-group gap grow>
61
105
  <zn-button>First</zn-button>
62
- <zn-button>Inner 1</zn-button>
63
- <zn-button>Inner 2</zn-button>
64
- <zn-button>Last</zn-button>
106
+ <zn-button>Second</zn-button>
107
+ <zn-button>Third</zn-button>
108
+ <zn-button>Fourth</zn-button>
65
109
  </zn-button-group>
66
110
  ```
67
111
 
68
- ### Vertical Example
112
+ ### Button Variants
113
+
114
+ Button groups work with all button variants including colors, sizes, and styles.
69
115
 
70
116
  ```html:preview
117
+ <zn-button-group>
118
+ <zn-button color="default">Default</zn-button>
119
+ <zn-button color="secondary">Secondary</zn-button>
120
+ <zn-button color="success">Success</zn-button>
121
+ </zn-button-group>
71
122
 
72
- <zn-button-group direction="vertical">
73
- <zn-button>First</zn-button>
74
- <zn-button>Inner 1</zn-button>
75
- <zn-button>Inner 2</zn-button>
76
- <zn-button>Last</zn-button>
123
+ <br />
124
+ <br />
125
+
126
+ <zn-button-group gap>
127
+ <zn-button color="error">Error</zn-button>
128
+ <zn-button color="warning">Warning</zn-button>
129
+ <zn-button color="info">Info</zn-button>
130
+ </zn-button-group>
131
+
132
+ <br />
133
+ <br />
134
+
135
+ <zn-button-group>
136
+ <zn-button outline>Outline 1</zn-button>
137
+ <zn-button outline>Outline 2</zn-button>
138
+ <zn-button outline>Outline 3</zn-button>
77
139
  </zn-button-group>
78
140
  ```
141
+
142
+ ### Button Sizes
143
+
144
+ Button groups respect the size of their contained buttons.
145
+
146
+ ```html:preview
147
+ <zn-button-group>
148
+ <zn-button size="small">Small 1</zn-button>
149
+ <zn-button size="small">Small 2</zn-button>
150
+ <zn-button size="small">Small 3</zn-button>
151
+ </zn-button-group>
152
+
153
+ <br />
154
+ <br />
155
+
156
+ <zn-button-group>
157
+ <zn-button size="medium">Medium 1</zn-button>
158
+ <zn-button size="medium">Medium 2</zn-button>
159
+ <zn-button size="medium">Medium 3</zn-button>
160
+ </zn-button-group>
161
+
162
+ <br />
163
+ <br />
164
+
165
+ <zn-button-group>
166
+ <zn-button size="large">Large 1</zn-button>
167
+ <zn-button size="large">Large 2</zn-button>
168
+ <zn-button size="large">Large 3</zn-button>
169
+ </zn-button-group>
170
+ ```
171
+
172
+ ### With Icons
173
+
174
+ Button groups work seamlessly with icon buttons.
175
+
176
+ ```html:preview
177
+ <zn-button-group>
178
+ <zn-button icon="format_bold"></zn-button>
179
+ <zn-button icon="format_italic"></zn-button>
180
+ <zn-button icon="format_underlined"></zn-button>
181
+ <zn-button icon="format_align_left"></zn-button>
182
+ </zn-button-group>
183
+
184
+ <br />
185
+ <br />
186
+
187
+ <zn-button-group gap>
188
+ <zn-button icon="add" color="success">Add</zn-button>
189
+ <zn-button icon="edit" color="info">Edit</zn-button>
190
+ <zn-button icon="delete" color="error">Delete</zn-button>
191
+ </zn-button-group>
192
+ ```
193
+
194
+ ### Vertical with Gap
195
+
196
+ Combine vertical direction with gap for a spaced vertical layout.
197
+
198
+ ```html:preview
199
+ <zn-button-group direction="vertical" gap>
200
+ <zn-button>Option 1</zn-button>
201
+ <zn-button>Option 2</zn-button>
202
+ <zn-button>Option 3</zn-button>
203
+ <zn-button>Option 4</zn-button>
204
+ </zn-button-group>
205
+ ```
206
+
207
+ ### Action Button Groups
208
+
209
+ A common pattern is to use button groups for action buttons like save/cancel or submit/reset combinations.
210
+
211
+ ```html:preview
212
+ <zn-button-group start>
213
+ <zn-button color="transparent">Cancel</zn-button>
214
+ <zn-button color="success">Save Changes</zn-button>
215
+ </zn-button-group>
216
+
217
+ <br />
218
+ <br />
219
+
220
+ <zn-button-group gap>
221
+ <zn-button color="secondary">Reset</zn-button>
222
+ <zn-button color="default">Submit</zn-button>
223
+ </zn-button-group>
224
+ ```
225
+
226
+ ### Segmented Controls
227
+
228
+ Button groups can be used to create segmented control-like interfaces for toggling between views or options.
229
+
230
+ ```html:preview
231
+ <zn-button-group>
232
+ <zn-button>Day</zn-button>
233
+ <zn-button>Week</zn-button>
234
+ <zn-button>Month</zn-button>
235
+ <zn-button>Year</zn-button>
236
+ </zn-button-group>
237
+
238
+ <br />
239
+ <br />
240
+
241
+ <zn-button-group>
242
+ <zn-button icon="view_list">List</zn-button>
243
+ <zn-button icon="grid_view">Grid</zn-button>
244
+ <zn-button icon="view_kanban">Board</zn-button>
245
+ </zn-button-group>
246
+ ```
247
+
248
+ ### Toolbar Pattern
249
+
250
+ Button groups are ideal for creating toolbars with related actions.
251
+
252
+ ```html:preview
253
+ <zn-button-group gap>
254
+ <zn-button icon="undo" color="transparent"></zn-button>
255
+ <zn-button icon="redo" color="transparent"></zn-button>
256
+ </zn-button-group>
257
+
258
+ <zn-button-group>
259
+ <zn-button icon="format_bold"></zn-button>
260
+ <zn-button icon="format_italic"></zn-button>
261
+ <zn-button icon="format_underlined"></zn-button>
262
+ </zn-button-group>
263
+
264
+ <zn-button-group>
265
+ <zn-button icon="format_align_left"></zn-button>
266
+ <zn-button icon="format_align_center"></zn-button>
267
+ <zn-button icon="format_align_right"></zn-button>
268
+ </zn-button-group>
269
+ ```
270
+
271
+ ### Responsive Wrapping
272
+
273
+ Button groups support wrapping by default, allowing buttons to flow to multiple lines on smaller screens.
274
+
275
+ ```html:preview
276
+ <div style="max-width: 300px;">
277
+ <zn-button-group>
278
+ <zn-button>Button 1</zn-button>
279
+ <zn-button>Button 2</zn-button>
280
+ <zn-button>Button 3</zn-button>
281
+ <zn-button>Button 4</zn-button>
282
+ <zn-button>Button 5</zn-button>
283
+ <zn-button>Button 6</zn-button>
284
+ </zn-button-group>
285
+ </div>
286
+ ```
@@ -106,7 +106,7 @@ Use the `text` attribute to set the button's style to text.
106
106
 
107
107
  ### Icon
108
108
 
109
- Use the `icon` attribute to set the button's icon.
109
+ Use the `icon` attribute to add an icon to the button.
110
110
 
111
111
  ```html:preview
112
112
  <zn-button icon="add_circle">Icon</zn-button>
@@ -117,3 +117,141 @@ Use the `icon` attribute to set the button's icon.
117
117
  <zn-button icon="cancel" color="error">Icon</zn-button>
118
118
  <zn-button icon="pending" color="transparent">Icon</zn-button>
119
119
  ```
120
+
121
+ ### Icon-Only Buttons
122
+
123
+ Buttons can be used with just an icon and no text by omitting the button label.
124
+
125
+ ```html:preview
126
+ <zn-button icon="settings"></zn-button>
127
+ <zn-button icon="favorite" color="error"></zn-button>
128
+ <zn-button icon="share" color="success"></zn-button>
129
+ <zn-button icon="add" color="info"></zn-button>
130
+ ```
131
+
132
+ ### Icon Position
133
+
134
+ Use the `icon-position` attribute to control whether the icon appears before or after the button text.
135
+
136
+ ```html:preview
137
+ <zn-button icon="arrow_back" icon-position="left">Back</zn-button>
138
+ <zn-button icon="arrow_forward" icon-position="right">Next</zn-button>
139
+ ```
140
+
141
+ ### Icon Size and Color
142
+
143
+ Use `icon-size` and `icon-color` attributes to customize the icon appearance.
144
+
145
+ ```html:preview
146
+ <zn-button icon="star" icon-size="24" icon-color="warning">Large Star</zn-button>
147
+ <zn-button icon="favorite" icon-size="20" icon-color="error">Favorite</zn-button>
148
+ <zn-button icon="info" icon-size="16" icon-color="info">Info</zn-button>
149
+ ```
150
+
151
+ ### Square Buttons
152
+
153
+ Use the `square` attribute to create square-shaped buttons, useful for icon-only buttons.
154
+
155
+ ```html:preview
156
+ <zn-button icon="delete" square></zn-button>
157
+ <zn-button icon="edit" square color="info"></zn-button>
158
+ <zn-button icon="save" square color="success"></zn-button>
159
+ <zn-button icon="close" square color="error"></zn-button>
160
+ ```
161
+
162
+ ### Grow
163
+
164
+ Use the `grow` attribute to make the button expand to fill its container width.
165
+
166
+ ```html:preview
167
+ <zn-button grow>Full Width Button</zn-button>
168
+ <zn-button grow color="success">Submit Form</zn-button>
169
+ ```
170
+
171
+ ### Loading State
172
+
173
+ Use the `loading` attribute to show a loading state on the button.
174
+
175
+ ```html:preview
176
+ <zn-button loading loading-text="Processing...">Click Me</zn-button>
177
+ <zn-button loading loading-text="Saving" color="success">Save</zn-button>
178
+ <zn-button loading loading-text="Loading" color="info">Load Data</zn-button>
179
+ ```
180
+
181
+ ### Notifications
182
+
183
+ Use the `notification` attribute to display a notification badge on the button. Positive numbers show the count, while negative numbers show a dot indicator.
184
+
185
+ ```html:preview
186
+ <zn-button icon="notifications" notification="5">Notifications</zn-button>
187
+ <zn-button icon="mail" notification="12" color="info">Messages</zn-button>
188
+ <zn-button icon="chat" notification="-1" color="success">Chat</zn-button>
189
+ <zn-button icon="notifications" notification="0">No Notifications</zn-button>
190
+ ```
191
+
192
+ Use `muted-notifications` for a subtle notification style.
193
+
194
+ ```html:preview
195
+ <zn-button icon="notifications" notification="3" muted-notifications>Muted</zn-button>
196
+ ```
197
+
198
+ ### Tooltip
199
+
200
+ Use the `tooltip` attribute to add a tooltip to the button.
201
+
202
+ ```html:preview
203
+ <zn-button icon="info" tooltip="This button provides additional information"></zn-button>
204
+ <zn-button icon="help" tooltip="Click for help" color="info">Help</zn-button>
205
+ ```
206
+
207
+ ### Links
208
+
209
+ Buttons can work as hyperlinks by using the `href` attribute.
210
+
211
+ ```html:preview
212
+ <zn-button href="https://example.com" target="_blank">External Link</zn-button>
213
+ <zn-button href="/dashboard" icon="dashboard">Dashboard</zn-button>
214
+ <zn-button href="/settings" icon="settings" text>Settings</zn-button>
215
+ ```
216
+
217
+ ### Form Integration
218
+
219
+ Buttons can be used in forms with various form-related attributes.
220
+
221
+ ```html:preview
222
+ <form>
223
+ <zn-input name="email" type="email" label="Email" value="test@example.com"></zn-input>
224
+ <br />
225
+ <zn-button type="submit" color="success">Submit</zn-button>
226
+ <zn-button type="reset" color="secondary">Reset</zn-button>
227
+ </form>
228
+ ```
229
+
230
+ You can also override form attributes using `formaction`, `formmethod`, `formenctype`, `formnovalidate`, and `formtarget`.
231
+
232
+ ```html:preview
233
+ <form action="/default" method="post">
234
+ <zn-input name="query" label="Search"></zn-input>
235
+ <br />
236
+ <zn-button type="submit">Default Submit</zn-button>
237
+ <zn-button type="submit" formaction="/search" formmethod="get">Search</zn-button>
238
+ </form>
239
+ ```
240
+
241
+ ### Dropdown Closer
242
+
243
+ Use the `dropdown-closer` attribute to automatically close parent dropdowns when the button is clicked.
244
+
245
+ ```html:preview
246
+ <zn-dropdown>
247
+ <zn-button slot="trigger">Menu</zn-button>
248
+ <zn-menu>
249
+ <zn-menu-item>
250
+ <zn-button dropdown-closer text>Close on Click</zn-button>
251
+ </zn-menu-item>
252
+ <zn-menu-item>
253
+ <zn-button text>Stays Open</zn-button>
254
+ </zn-menu-item>
255
+ </zn-menu>
256
+ </zn-dropdown>
257
+ ```