@kubex/zinc 1.1.185 → 2.0.1

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 (358) hide show
  1. package/.browserslistrc +2 -0
  2. package/.github/workflows/js_build_and_deploy.yaml +54 -1
  3. package/.github/workflows/test.yaml +27 -0
  4. package/dist/chunks/zn.UWJLIXDT.js +1 -0
  5. package/dist/custom-elements.json +10319 -2666
  6. package/dist/vscode.html-custom-data.json +1012 -57
  7. package/dist/web-types.json +2097 -145
  8. package/dist/zn.d.ts +2294 -416
  9. package/dist/zn.min.css +1 -1
  10. package/dist/zn.min.js +2310 -1637
  11. package/docs/_includes/default.njk +4 -1
  12. package/docs/assets/scripts/docs.js +22 -6
  13. package/docs/assets/styles/docs.css +9 -2
  14. package/docs/data/report-table-day-compare.json +380 -0
  15. package/docs/data/report-table.json +314 -0
  16. package/docs/pages/components/avatar-group.md +57 -0
  17. package/docs/pages/components/badge.md +67 -0
  18. package/docs/pages/components/button.md +41 -1
  19. package/docs/pages/components/chat-message.md +16 -0
  20. package/docs/pages/components/checkbox.md +1 -1
  21. package/docs/pages/components/chip.md +25 -13
  22. package/docs/pages/components/color-picker.md +37 -0
  23. package/docs/pages/components/copy-button.md +2 -2
  24. package/docs/pages/components/data-table-filter.md +33 -50
  25. package/docs/pages/components/data-table-search.md +4 -4
  26. package/docs/pages/components/data-table.md +27 -3
  27. package/docs/pages/components/date-range.md +116 -0
  28. package/docs/pages/components/dialog.md +29 -37
  29. package/docs/pages/components/diff-row.md +28 -0
  30. package/docs/pages/components/diff.md +46 -0
  31. package/docs/pages/components/editor.md +55 -0
  32. package/docs/pages/components/icon.md +46 -1
  33. package/docs/pages/components/input.md +30 -11
  34. package/docs/pages/components/item.md +35 -0
  35. package/docs/pages/components/key-value.md +25 -0
  36. package/docs/pages/components/menu.md +74 -7
  37. package/docs/pages/components/nav-item.md +15 -0
  38. package/docs/pages/components/nav-list.md +132 -0
  39. package/docs/pages/components/navbar.md +100 -1
  40. package/docs/pages/components/page.md +242 -74
  41. package/docs/pages/components/priority-list.md +43 -5
  42. package/docs/pages/components/query-builder.md +23 -0
  43. package/docs/pages/components/radio-group.md +33 -1
  44. package/docs/pages/components/radio.md +1 -1
  45. package/docs/pages/components/report-table.md +202 -0
  46. package/docs/pages/components/stat.md +30 -0
  47. package/docs/pages/components/tile.md +11 -0
  48. package/docs/pages/components/tooltip.md +1 -1
  49. package/docs/pages/components/translation-grid.md +86 -0
  50. package/docs/pages/components/vertical-stepper.md +108 -64
  51. package/package.json +2 -1
  52. package/scss/_global-spacing.scss +2 -2
  53. package/scss/_root.scss +11 -171
  54. package/scss/boot.scss +14 -0
  55. package/scss/mixins/_helper-mixins.scss +24 -2
  56. package/scss/mixins/_motion-mixins.scss +126 -0
  57. package/scss/mixins/_spacing-mixins.scss +4 -3
  58. package/scss/mixins/_tab-indicator-mixins.scss +12 -0
  59. package/scss/mixins/_typography-mixins.scss +1 -1
  60. package/scss/mixins/index.scss +14 -0
  61. package/scss/shared/_base.scss +32 -1
  62. package/scss/shared/_button-mixin.scss +7 -5
  63. package/scss/shared/_table.scss +35 -4
  64. package/scss/shared/nav.scss +4 -0
  65. package/scss/shared/shimmer.scss +1 -1
  66. package/scss/table-controls.scss +206 -0
  67. package/scss/themes/_dark.scss +1 -3
  68. package/scss/themes/_index.scss +1 -1
  69. package/scss/themes/_light.scss +46 -6
  70. package/scss/themes/_modes.scss +11 -11
  71. package/scss/themes/_openbyte.scss +944 -0
  72. package/scss/themes/_typography.scss +4 -2
  73. package/scss/variables/index.scss +0 -9
  74. package/src/components/alert/alert.component.ts +14 -4
  75. package/src/components/alert/alert.scss +55 -69
  76. package/src/components/alert/alert.test.ts +8 -0
  77. package/src/components/animated-button/animated-button.component.ts +3 -2
  78. package/src/components/animated-button/animated-button.scss +6 -23
  79. package/src/components/animated-button/animated-button.test.ts +4 -3
  80. package/src/components/avatar-group/avatar-group.component.ts +84 -0
  81. package/src/components/avatar-group/avatar-group.scss +54 -0
  82. package/src/components/avatar-group/avatar-group.test.ts +59 -0
  83. package/src/components/avatar-group/index.ts +12 -0
  84. package/src/components/badge/badge.component.ts +49 -0
  85. package/src/components/badge/badge.scss +80 -0
  86. package/src/components/badge/badge.test.ts +34 -0
  87. package/src/components/badge/index.ts +12 -0
  88. package/src/components/bulk-actions/bulk-actions.component.ts +14 -2
  89. package/src/components/button/button.component.ts +228 -8
  90. package/src/components/button/button.scss +115 -32
  91. package/src/components/button/button.test.ts +122 -0
  92. package/src/components/button-menu/button-menu.component.ts +32 -11
  93. package/src/components/button-menu/button-menu.scss +5 -1
  94. package/src/components/channel-tile/channel-tile.component.ts +34 -27
  95. package/src/components/channel-tile/channel-tile.scss +76 -43
  96. package/src/components/chart/builders.test.ts +46 -0
  97. package/src/components/chart/builders.ts +27 -3
  98. package/src/components/chart/chart-live.test.ts +4 -6
  99. package/src/components/chart/chart.component.ts +125 -5
  100. package/src/components/chart/chart.scss +121 -0
  101. package/src/components/chart/chart.test.ts +81 -0
  102. package/src/components/chat-message/chat-message.component.ts +21 -1
  103. package/src/components/chat-message/chat-message.scss +13 -2
  104. package/src/components/chat-message/chat-message.test.ts +9 -0
  105. package/src/components/checkbox/checkbox.component.ts +61 -27
  106. package/src/components/checkbox/checkbox.scss +58 -25
  107. package/src/components/checkbox-group/checkbox-group.component.ts +7 -1
  108. package/src/components/chip/chip.component.ts +11 -1
  109. package/src/components/chip/chip.scss +91 -26
  110. package/src/components/chip/chip.test.ts +17 -0
  111. package/src/components/collapsible/collapsible.component.ts +17 -3
  112. package/src/components/collapsible/collapsible.scss +19 -10
  113. package/src/components/color-picker/color-picker.component.ts +277 -0
  114. package/src/components/color-picker/color-picker.scss +141 -0
  115. package/src/components/color-picker/color-picker.test.ts +57 -0
  116. package/src/components/color-picker/index.ts +12 -0
  117. package/src/components/cols/cols.component.ts +10 -0
  118. package/src/components/cols/cols.test.ts +17 -0
  119. package/src/components/confirm/confirm.component.ts +20 -6
  120. package/src/components/confirm/confirm.test.ts +52 -0
  121. package/src/components/content-block/content-block.component.ts +38 -9
  122. package/src/components/content-block/content-block.scss +11 -5
  123. package/src/components/content-block/content-block.test.ts +26 -0
  124. package/src/components/copy-button/copy-button.component.ts +2 -2
  125. package/src/components/copy-button/copy-button.scss +17 -4
  126. package/src/components/data-select/data-select.component.ts +3 -1
  127. package/src/components/data-table/data-table.component.ts +362 -140
  128. package/src/components/data-table/data-table.scss +136 -60
  129. package/src/components/data-table/data-table.test.ts +356 -4
  130. package/src/components/data-table-filter/data-table-filter.component.ts +426 -406
  131. package/src/components/data-table-filter/data-table-filter.scss +176 -148
  132. package/src/components/data-table-filter/data-table-filter.test.ts +271 -273
  133. package/src/components/data-table-search/data-table-search.component.ts +4 -2
  134. package/src/components/data-table-search/data-table-search.scss +8 -1
  135. package/src/components/data-table-search/data-table-search.test.ts +29 -0
  136. package/src/components/date-range/date-range-math.test.ts +78 -0
  137. package/src/components/date-range/date-range-math.ts +105 -0
  138. package/src/components/date-range/date-range.component.ts +375 -0
  139. package/src/components/date-range/date-range.scss +272 -0
  140. package/src/components/date-range/date-range.test.ts +247 -0
  141. package/src/components/date-range/index.ts +12 -0
  142. package/src/components/datepicker/datepicker.component.ts +44 -7
  143. package/src/components/datepicker/datepicker.scss +9 -0
  144. package/src/components/datepicker/datepicker.test.ts +2 -2
  145. package/src/components/dialog/dialog.component.ts +38 -19
  146. package/src/components/dialog/dialog.scss +65 -36
  147. package/src/components/dialog/dialog.test.ts +14 -0
  148. package/src/components/diff/diff.component.ts +55 -0
  149. package/src/components/diff/diff.scss +46 -0
  150. package/src/components/diff/diff.test.ts +15 -0
  151. package/src/components/diff/index.ts +12 -0
  152. package/src/components/diff-row/diff-row.component.ts +75 -0
  153. package/src/components/diff-row/diff-row.scss +70 -0
  154. package/src/components/diff-row/diff-row.test.ts +37 -0
  155. package/src/components/diff-row/index.ts +12 -0
  156. package/src/components/dropdown/dropdown.component.ts +12 -10
  157. package/src/components/dropdown/dropdown.scss +2 -0
  158. package/src/components/editor/editor.component.ts +159 -11
  159. package/src/components/editor/editor.scss +250 -1
  160. package/src/components/editor/editor.test.ts +31 -3
  161. package/src/components/editor/modules/ai/panel/ai-panel.scss +0 -1
  162. package/src/components/editor/modules/attachment/attachment.ts +53 -31
  163. package/src/components/editor/modules/context-menu/context-menu.ts +17 -0
  164. package/src/components/editor/modules/dialog/dialog.component.ts +23 -1
  165. package/src/components/editor/modules/dialog/dialog.test.ts +28 -0
  166. package/src/components/editor/modules/emoji/emoji.ts +4 -5
  167. package/src/components/editor/modules/merge-field/merge-field.ts +83 -0
  168. package/src/components/editor/modules/toolbar/toolbar.component.ts +121 -68
  169. package/src/components/editor/modules/toolbar/toolbar.scss +38 -0
  170. package/src/components/editor/modules/toolbar/toolbar.ts +25 -1
  171. package/src/components/empty-state/empty-state.component.ts +6 -1
  172. package/src/components/empty-state/empty-state.scss +21 -4
  173. package/src/components/expanding-action/expanding-action.component.ts +22 -34
  174. package/src/components/expanding-action/expanding-action.scss +3 -45
  175. package/src/components/expanding-action/expanding-action.test.ts +2 -1
  176. package/src/components/file/file.component.ts +30 -2
  177. package/src/components/file/file.scss +6 -0
  178. package/src/components/flow-builder/flow-builder.component.ts +36 -3
  179. package/src/components/flow-builder/flow-builder.scss +0 -6
  180. package/src/components/flow-builder/modules/flow-canvas/flow-canvas.component.ts +8 -0
  181. package/src/components/flow-builder/modules/flow-canvas/flow-canvas.scss +10 -5
  182. package/src/components/flow-builder/modules/flow-node/flow-node.component.ts +17 -0
  183. package/src/components/flow-builder/modules/flow-node/flow-node.scss +10 -0
  184. package/src/components/form-actions/form-actions.component.ts +48 -2
  185. package/src/components/form-actions/form-actions.scss +1 -1
  186. package/src/components/form-group/form-group.component.ts +10 -3
  187. package/src/components/form-group/form-group.scss +37 -4
  188. package/src/components/form-group/form-group.test.ts +10 -0
  189. package/src/components/header/header.component.ts +11 -4
  190. package/src/components/header/header.scss +47 -5
  191. package/src/components/hover-container/hover-container.component.ts +4 -5
  192. package/src/components/icon/icon.component.ts +95 -9
  193. package/src/components/icon/icon.scss +70 -6
  194. package/src/components/icon/icon.test.ts +55 -0
  195. package/src/components/icon-picker/icon-picker.component.ts +35 -1
  196. package/src/components/inline-edit/inline-edit.component.ts +38 -8
  197. package/src/components/inline-edit/inline-edit.scss +128 -19
  198. package/src/components/input/input.component.ts +173 -297
  199. package/src/components/input/input.scss +65 -43
  200. package/src/components/input/input.test.ts +86 -4
  201. package/src/components/item/item.component.ts +12 -0
  202. package/src/components/item/item.scss +102 -3
  203. package/src/components/item/item.test.ts +23 -0
  204. package/src/components/key/key.component.ts +2 -2
  205. package/src/components/key/key.scss +11 -0
  206. package/src/components/key-value/index.ts +12 -0
  207. package/src/components/key-value/key-value.component.ts +160 -0
  208. package/src/components/key-value/key-value.scss +20 -0
  209. package/src/components/key-value/key-value.test.ts +22 -0
  210. package/src/components/markdown-editor/markdown-editor.component.ts +8 -1
  211. package/src/components/menu/menu.component.ts +21 -2
  212. package/src/components/menu/menu.scss +43 -23
  213. package/src/components/menu/menu.test.ts +33 -0
  214. package/src/components/menu-item/menu-item.component.ts +13 -2
  215. package/src/components/menu-item/menu-item.scss +56 -23
  216. package/src/components/menu-item/menu-item.test.ts +31 -0
  217. package/src/components/menu-item/submenu-controller.ts +25 -15
  218. package/src/components/menu-label/index.ts +12 -0
  219. package/src/components/menu-label/menu-label.component.ts +30 -0
  220. package/src/components/menu-label/menu-label.scss +18 -0
  221. package/src/components/nav-item/index.ts +12 -0
  222. package/src/components/nav-item/nav-item.component.ts +83 -0
  223. package/src/components/nav-item/nav-item.scss +128 -0
  224. package/src/components/nav-list/index.ts +12 -0
  225. package/src/components/nav-list/nav-list.component.ts +313 -0
  226. package/src/components/nav-list/nav-list.scss +87 -0
  227. package/src/components/nav-list/nav-list.test.ts +250 -0
  228. package/src/components/navbar/navbar.component.ts +235 -171
  229. package/src/components/navbar/navbar.scss +333 -169
  230. package/src/components/navbar/navbar.test.ts +63 -143
  231. package/src/components/page/page.component.ts +114 -29
  232. package/src/components/page/page.scss +223 -95
  233. package/src/components/page/page.test.ts +214 -3
  234. package/src/components/page-builder/page-builder.component.ts +51 -5
  235. package/src/components/page-builder/page-builder.scss +6 -1
  236. package/src/components/page-nav/page-nav.component.ts +25 -3
  237. package/src/components/page-nav/page-nav.scss +10 -2
  238. package/src/components/pagination/pagination.scss +1 -1
  239. package/src/components/panel/panel.component.ts +14 -13
  240. package/src/components/panel/panel.scss +14 -10
  241. package/src/components/panel/panel.test.ts +42 -0
  242. package/src/components/popup/popup.component.ts +20 -13
  243. package/src/components/popup/popup.test.ts +21 -1
  244. package/src/components/priority-list/priority-list.component.ts +157 -172
  245. package/src/components/priority-list/priority-list.scss +113 -17
  246. package/src/components/priority-list/priority-list.test.ts +301 -3
  247. package/src/components/progress-bar/progress-bar.component.ts +1 -1
  248. package/src/components/progress-bar/progress-bar.scss +16 -4
  249. package/src/components/progress-tile/progress-tile.scss +1 -1
  250. package/src/components/query-builder/query-builder.component.ts +85 -10
  251. package/src/components/query-builder/query-builder.scss +7 -1
  252. package/src/components/query-builder/query-builder.test.ts +40 -0
  253. package/src/components/radio/radio.component.ts +57 -18
  254. package/src/components/radio/radio.scss +101 -26
  255. package/src/components/radio-group/radio-group.component.ts +45 -7
  256. package/src/components/radio-group/radio-group.scss +17 -0
  257. package/src/components/radio-group/radio-group.test.ts +63 -2
  258. package/src/components/rating/rating.component.ts +23 -0
  259. package/src/components/rating/rating.scss +1 -1
  260. package/src/components/remarkd-editor/remarkd-editor.component.ts +60 -5
  261. package/src/components/remarkd-editor/remarkd-editor.scss +12 -4
  262. package/src/components/report-table/index.ts +12 -0
  263. package/src/components/report-table/report-format.test.ts +86 -0
  264. package/src/components/report-table/report-format.ts +72 -0
  265. package/src/components/report-table/report-math.test.ts +74 -0
  266. package/src/components/report-table/report-math.ts +252 -0
  267. package/src/components/report-table/report-table.component.ts +681 -0
  268. package/src/components/report-table/report-table.scss +328 -0
  269. package/src/components/report-table/report-table.test.ts +702 -0
  270. package/src/components/reveal/reveal.component.ts +15 -1
  271. package/src/components/reveal/reveal.scss +5 -0
  272. package/src/components/schedule-builder/schedule-builder.component.ts +23 -8
  273. package/src/components/scroll-container/scroll-container.component.ts +19 -1
  274. package/src/components/scroll-container/scroll-container.scss +6 -1
  275. package/src/components/select/select.component.ts +52 -36
  276. package/src/components/select/select.scss +42 -25
  277. package/src/components/select/select.test.ts +14 -2
  278. package/src/components/settings-container/settings-container.scss +18 -5
  279. package/src/components/sidebar/sidebar.component.ts +8 -1
  280. package/src/components/sidebar/sidebar.scss +6 -1
  281. package/src/components/skeleton/skeleton.component.ts +3 -3
  282. package/src/components/skeleton/skeleton.scss +6 -6
  283. package/src/components/skeleton/skeleton.test.ts +9 -0
  284. package/src/components/slash-menu/slash-menu.scss +1 -1
  285. package/src/components/slideout/slideout.component.ts +20 -3
  286. package/src/components/slideout/slideout.scss +13 -6
  287. package/src/components/slideout/slideout.test.ts +19 -0
  288. package/src/components/split-button/split-button.component.ts +1 -1
  289. package/src/components/split-pane/split-pane.component.ts +71 -8
  290. package/src/components/split-pane/split-pane.scss +145 -41
  291. package/src/components/split-pane/split-pane.test.ts +23 -3
  292. package/src/components/stat/stat.component.ts +209 -14
  293. package/src/components/stat/stat.scss +305 -5
  294. package/src/components/stat/stat.test.ts +143 -2
  295. package/src/components/status-indicator/status-indicator.scss +22 -21
  296. package/src/components/stepper/stepper.scss +3 -3
  297. package/src/components/tab/tab.component.ts +1 -0
  298. package/src/components/table/table.component.ts +12 -1
  299. package/src/components/table/table.scss +21 -13
  300. package/src/components/table/table.test.ts +17 -0
  301. package/src/components/tabs/tabs.component.ts +150 -37
  302. package/src/components/tabs/tabs.scss +48 -7
  303. package/src/components/tabs/tabs.test.ts +169 -0
  304. package/src/components/textarea/textarea.component.ts +25 -3
  305. package/src/components/textarea/textarea.scss +10 -0
  306. package/src/components/textarea/textarea.test.ts +8 -4
  307. package/src/components/theme-editor/theme-editor.scss +0 -6
  308. package/src/components/tile/tile.component.ts +32 -2
  309. package/src/components/tile/tile.scss +40 -7
  310. package/src/components/tile/tile.test.ts +10 -0
  311. package/src/components/toggle/toggle.component.ts +23 -7
  312. package/src/components/toggle/toggle.scss +36 -29
  313. package/src/components/toggle/toggle.test.ts +17 -0
  314. package/src/components/tooltip/tooltip.component.ts +3 -0
  315. package/src/components/tooltip/tooltip.scss +11 -6
  316. package/src/components/tooltip/tooltip.test.ts +12 -0
  317. package/src/components/translation-field/index.ts +12 -0
  318. package/src/components/translation-field/translation-field.component.ts +55 -0
  319. package/src/components/translation-field/translation-field.scss +101 -0
  320. package/src/components/translation-fields/index.ts +12 -0
  321. package/src/components/translation-fields/translation-fields.component.ts +80 -0
  322. package/src/components/translation-fields/translation-fields.scss +60 -0
  323. package/src/components/translation-grid/index.ts +12 -0
  324. package/src/components/translation-grid/translation-grid.component.ts +157 -0
  325. package/src/components/translation-grid/translation-grid.scss +138 -0
  326. package/src/components/translation-grid/translation-grid.test.ts +28 -0
  327. package/src/components/vertical-stepper/vertical-stepper.component.ts +35 -9
  328. package/src/components/vertical-stepper/vertical-stepper.scss +110 -39
  329. package/src/components/vertical-stepper/vertical-stepper.test.ts +35 -0
  330. package/src/components/well/well.scss +2 -2
  331. package/src/events/events.ts +2 -0
  332. package/src/events/zn-chart-click.ts +13 -0
  333. package/src/events/zn-report-change.ts +7 -0
  334. package/src/form-control.scss +36 -3
  335. package/src/internal/anchored-popover.ts +175 -0
  336. package/src/internal/animate.ts +19 -5
  337. package/src/internal/cosmic-border.ts +15 -0
  338. package/src/internal/form.ts +1 -1
  339. package/src/internal/hover-intent.ts +15 -0
  340. package/src/internal/input-modality.ts +15 -0
  341. package/src/internal/pointer-intent.ts +37 -0
  342. package/src/internal/reorder.ts +632 -0
  343. package/src/internal/scroll.ts +51 -3
  344. package/src/internal/selection-card.ts +1 -1
  345. package/src/internal/tab-indicator.ts +92 -0
  346. package/src/internal/table-sort.ts +25 -0
  347. package/src/internal/table-tabs.ts +108 -0
  348. package/src/internal/test-drag.ts +35 -0
  349. package/src/internal/theme-openbyte.test.ts +126 -0
  350. package/src/internal/theme.ts +4 -4
  351. package/src/internal/zinc-element.ts +2 -2
  352. package/src/selection-card.scss +25 -0
  353. package/src/types/web-test-runner-commands.d.ts +1 -0
  354. package/src/utilities/color.test.ts +43 -0
  355. package/src/utilities/color.ts +189 -0
  356. package/src/zinc.ts +14 -0
  357. package/.github/workflows/eleventy_build.yml +0 -42
  358. package/scss/themes/_aura.scss +0 -114
@@ -87,8 +87,8 @@ Use the `src` attribute to change the copy icon.
87
87
  Use the `size` attribute to control the icon size.
88
88
 
89
89
  ```html:preview
90
- <zn-copy-button value="Small icon" size="16"></zn-copy-button>
91
- <zn-copy-button value="Default size" size="24"></zn-copy-button>
90
+ <zn-copy-button value="Small icon" size="12"></zn-copy-button>
91
+ <zn-copy-button value="Default size" size="16"></zn-copy-button>
92
92
  <zn-copy-button value="Large icon" size="32"></zn-copy-button>
93
93
  <zn-copy-button value="Extra large" size="48"></zn-copy-button>
94
94
  ```
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  meta:
3
3
  title: Data Table Filter
4
- description: An inline filter bar for data tables. Each active filter is a pill whose dropdown sets its value, alongside an add-filter control and a clear.
4
+ description: The filter for data tables. A funnel opens a builder of field, operator and value rules, and the rules that apply show as removable chips.
5
5
  layout: component
6
6
  ---
7
7
 
@@ -12,60 +12,56 @@ layout: component
12
12
  </zn-data-table-filter>
13
13
  ```
14
14
 
15
- Filters render inline rather than in a slideout. Each active filter is a pill showing its name, and its value once set; the pill's dropdown lists the filter's `options` as checkable values, or a text input for a filter that declares none. Each pill carries an X that drops that filter. `+ Add filter` lists the filters that are not yet active, and `Clear` removes them all.
15
+ The funnel opens a popover headed **Filters · Show records that match all of these**. Each row is a rule: pick a field, an operator and a value, or remove the row with its trash button. **+ Add filter** adds a row for a field not yet used, and **Clear all** removes every rule. Nothing reaches the table until **Apply**, which closes the popover and applies every rule that has a field, an operator and a value; while any row is still empty the heading says so. Closing the popover with Escape or a click outside it discards the edits.
16
16
 
17
- A filter starts on its **first declared operator**. Declare more than one and the pill offers a choice: a value editor gets a row of operator chips above it, an options menu lists the operators above its values, and the pill then reads `Age ≥ 18` rather than `Age: 18`. Switching operator keeps the value — a date is re-encoded for the new comparator.
17
+ The rules that apply show as chips after the funnel, and the funnel's badge counts them. A chip's text opens the popover again, and its X removes that rule. Inside a [`zn-data-table`](/components/data-table#filtering) or [`zn-report-table`](/components/report-table) the funnel sits in the header and the chips get a row of their own under it.
18
18
 
19
- Declare `in` or `nin` to let a filter hold several values at once — the pill then counts them, e.g. `Role (2)`, and its dropdown stays open so you can pick more. Any other operator holds a single value: the dropdown closes on select, and picking the same value again clears it.
19
+ A rule starts on its field's **first declared operator**, and the operator list offers the rest. Picking another field resets the operator and the value. The value control follows the field:
20
20
 
21
- Picking a filter from `+ Add filter` opens its pill straight away, with a text field focused, so naming a filter and giving it a value is one pass. A typed value is one value however many spaces it contains; only a comma starts another.
21
+ - A field with `options`, or a `bool` field, gets a select. With `in` or `nin` it becomes a multi-select.
22
+ - A `number` field gets a number input, and a `date` or `dateTime` field a date input.
23
+ - Any other field gets a text input. With `in` or `nin`, separate values with commas.
22
24
 
23
- `default-filters` takes a comma-separated list of filter ids to show a pill for up front. Inside a `zn-data-table` the bar is hidden until the header's filter toggle is clicked, and `activeCount` reports how many filters currently hold a value.
25
+ With more than eight fields, the field select is searchable: open it and type, and the placeholder reads `Search N fields...`.
26
+
27
+ `default-filters` takes a comma-separated list of field ids. When the popover opens with nothing applied, it starts with an empty row for each of them, rather than one blank row.
24
28
 
25
29
  ```html:preview
26
30
  <zn-data-table-filter
27
31
  default-filters="status"
28
32
  filters='[
29
- {"id":"status","name":"Status","options":{"open":"Open","closed":"Closed"},"operators":["eq"]},
30
- {"id":"tag","name":"Tag","options":{"bug":"Bug","chore":"Chore","feature":"Feature"},"operators":["in"]},
31
- {"id":"owner","name":"Owner","operators":["contains"]}
33
+ {"id":"status","name":"Status","options":{"open":"Open","closed":"Closed"},"operators":["eq","neq"]},
34
+ {"id":"tag","name":"Tag","options":{"bug":"Bug","chore":"Chore","feature":"Feature"},"operators":["in","nin"]},
35
+ {"id":"owner","name":"Owner","operators":["contains","eq"]}
32
36
  ]'>
33
37
  </zn-data-table-filter>
34
38
  ```
35
39
 
36
- The component emits `zn-filter-change` and exposes the query on `value`, encoded exactly as `zn-query-builder` encodes it — base64 of `[{key, comparator, value}]` — so a backend built against the query builder needs no changes.
40
+ The component emits `zn-filter-change` and exposes the query on `value`, encoded as `zn-query-builder` encodes it: base64 of `[{key, comparator, value}]`, or `''` when no rule applies. It only emits when that value changes. A multi-select's values are joined with spaces, and `activeCount` reports how many rules apply.
41
+
42
+ Setting `value` from outside rebuilds the rules, so a filter restored from a shared URL through `zn-data-table`'s [`sharable`](/components/data-table#shareable-url-state) sync shows its chips straight away.
37
43
 
38
- Setting `value` round-trips: assigning that same base64 string back — for example restoring it from a shared URL via `zn-data-table`'s [`sharable`](/components/data-table#shareable-url-state) sync — rebuilds the active pills, so the bar reopens in the state it was encoded in. Restoration needs the `filters` schema present to resolve each key, and it stands down once any filter already holds a value, so a shared filter still wins over an empty `default-filters` pill while a filter the user is mid-way through setting is never clobbered.
44
+ ### Typeahead
39
45
 
40
- One caveat: a restored **date** filter shows its raw encoded value on the pill (a timestamp, or a minutes-from-now offset) rather than a formatted date, because the human-readable label is not part of the encoded query. The filter still applies correctly; only the pill text differs until the value is re-picked.
46
+ Inside a `zn-data-table`, a text field suggests values from the rows the table has already loaded, matched case-insensitively against what has been typed, keyed on the column whose name matches the field's id. Set `suggestions` yourself, as `{[fieldId]: string[]}`, to offer something else.
41
47
 
42
- ### Long Option Lists
48
+ ### Showing the Chips Elsewhere
43
49
 
44
- An option list caps its height at 320px and scrolls inside the panel rather than running off the
45
- screen, with the scrollbar drawn rather than left to the platform's overlay one. Past eight options
46
- the pill also gains a search field, merged into the top of the panel and pinned there, that narrows
47
- the list case-insensitively.
50
+ Set another filter as a filter's `source` property and it shows only that filter's chips, while that filter stops showing its own. The tables use this to keep the funnel in their header and the chips in a row under it.
48
51
 
49
52
  ```html:preview
50
- <zn-data-table-filter
51
- default-filters="category"
52
- filters='[
53
- {"id":"category","name":"Category","operators":["eq","in"],"options":{
54
- "how-to":"How To","linux":"Linux","beta":"Beta","router":"Router","tv":"TV","other":"Other",
55
- "mac":"Mac Hotspot Shield","general":"General","android":"Android Hotspot Shield",
56
- "educational":"Educational","windows":"Windows Hotspot Shield","ios":"iOS",
57
- "getting-started":"Getting Started","payments":"Payments & Subscriptions",
58
- "accounts":"Manage Account & Devices","troubleshoot":"Troubleshoot issues",
59
- "releases":"Release Notes","archived":"Archived Articles","internal":"Internal Information",
60
- "tutorials":"Tutorials"}}
61
- ]'>
62
- </zn-data-table-filter>
53
+ <div>
54
+ <zn-data-table-filter id="chips-source"
55
+ filters='[{"id":"status","name":"Status","options":{"open":"Open","closed":"Closed"},"operators":["eq"]}]'>
56
+ </zn-data-table-filter>
57
+ <zn-data-table-filter id="chips-row"></zn-data-table-filter>
58
+ </div>
59
+
60
+ <script>
61
+ document.getElementById('chips-row').source = document.getElementById('chips-source');
62
+ </script>
63
63
  ```
64
64
 
65
- ### Typeahead
66
-
67
- Inside a `zn-data-table` a text filter suggests values from the rows the table has already loaded, matched case-insensitively against what has been typed, keyed on the column whose name matches the filter's id. Set `suggestions` yourself — `{[filterId]: string[]}` — to offer something else.
68
-
69
65
  ## Examples
70
66
 
71
67
  ### Basic Text Filters
@@ -81,8 +77,7 @@ Create simple text-based filters with equality and fuzzy search operators.
81
77
 
82
78
  ### Number Filters with Operators
83
79
 
84
- Use number type filters with comparison operators like equal, greater than, less than. The pill's
85
- editor shows a chip per operator; `>`, `≥`, `<` and `≤` keep their symbols, and the rest read as words.
80
+ Use number fields with comparison operators: they read `is more than`, `is at least`, `is less than` and `is at most`.
86
81
 
87
82
  ```html:preview
88
83
  <zn-data-table-filter
@@ -93,10 +88,9 @@ editor shows a chip per operator; `>`, `≥`, `<` and `≤` keep their symbols,
93
88
 
94
89
  ### Date Filters
95
90
 
96
- Filter by dates with before, after, and equal operators. A `date` pill opens a calendar and closes
97
- once a day is picked; a `dateTime` pill adds a time selector and stays open while it's set.
91
+ Filter by dates with before, after and equal operators. A `date` field takes a date, and a `dateTime` field a date and a time.
98
92
 
99
- Values are encoded the way `zn-query-builder` encodes them, so `dateSubmitFormat` picks the wire
93
+ Values are encoded the way `zn-query-builder` encodes them, and changing the operator re-encodes the date. `dateSubmitFormat` picks the wire
100
94
  format: `legacy` (the default — seconds for `eq`/`neq`, otherwise minutes from now, negated for
101
95
  `before`), `timestamp` (milliseconds) or `iso`.
102
96
 
@@ -118,17 +112,6 @@ Use predefined options for select-based filtering.
118
112
  </zn-data-table-filter>
119
113
  ```
120
114
 
121
- ### Limited Options Display
122
-
123
- Control how many options are initially visible using `maxOptionsVisible`.
124
-
125
- ```html:preview
126
- <zn-data-table-filter
127
- filters="[{&quot;id&quot;:&quot;category&quot;,&quot;name&quot;:&quot;Category&quot;,&quot;options&quot;:{&quot;cat1&quot;:&quot;Category 1&quot;,&quot;cat2&quot;:&quot;Category 2&quot;,&quot;cat3&quot;:&quot;Category 3&quot;,&quot;cat4&quot;:&quot;Category 4&quot;,&quot;cat5&quot;:&quot;Category 5&quot;,&quot;cat6&quot;:&quot;Category 6&quot;},&quot;maxOptionsVisible&quot;:3,&quot;operators&quot;:[&quot;eq&quot;,&quot;in&quot;]}]"
128
- name="limited-options">
129
- </zn-data-table-filter>
130
- ```
131
-
132
115
  ### Mixed Filter Types
133
116
 
134
117
  Combine different field types in a single filter component.
@@ -9,7 +9,7 @@ layout: component
9
9
 
10
10
  ### Basic Search
11
11
 
12
- Use the `zn-data-table-search` component to provide search functionality for data tables. The component includes a search input with a trailing search icon and is clearable by default.
12
+ Use the `zn-data-table-search` component to provide search functionality for data tables. The component includes a search input with a leading search icon and is clearable by default.
13
13
 
14
14
  ```html:preview
15
15
  <zn-data-table-search></zn-data-table-search>
@@ -30,7 +30,7 @@ Use the `placeholder` attribute to customize the input placeholder text.
30
30
  ### Help Text
31
31
 
32
32
  Use the `help-text` attribute to explain what can be searched. It shows an information icon inside the search field,
33
- before the search icon, and reads out as a tooltip on hover or focus.
33
+ after the input text, and reads out as a tooltip on hover or focus.
34
34
 
35
35
  ```html:preview
36
36
  <zn-data-table-search
@@ -402,7 +402,7 @@ Use the `getFormData()` method to retrieve all form data from the search compone
402
402
  The component is built with accessibility in mind:
403
403
 
404
404
  - Uses semantic HTML with proper input type (`search`)
405
- - Includes a visible trailing search icon for visual recognition
405
+ - Includes a visible leading search icon for visual recognition
406
406
  - Supports keyboard navigation and clearing via the clearable input
407
407
  - Integrates with form validation and submission
408
408
  - Explains what is searchable through the help-text attribute, shown from an information icon
@@ -449,4 +449,4 @@ The component is built with accessibility in mind:
449
449
  ## Dependencies
450
450
 
451
451
  - `zn-input` - Used for the search input field
452
- - `zn-icon` - Used for the trailing search icon
452
+ - `zn-icon` - Used for the leading search icon
@@ -23,6 +23,8 @@ fullWidth: true
23
23
  </zn-data-table>
24
24
  ```
25
25
 
26
+ For reports grouped by a dimension over a date range, with grouped headings and a total row, use [Report Table](/components/report-table).
27
+
26
28
  ## Examples
27
29
 
28
30
  ### Basic Data Table
@@ -415,9 +417,9 @@ Or use the built-in empty state with custom text:
415
417
 
416
418
  ### Filtering
417
419
 
418
- Add filtering with the `zn-data-table-filter` component. The header carries a filter toggle beside the refresh button; clicking it reveals a row between the header and the rows holding the `filter` slot, where the filter component shows one pill per active filter alongside add-filter and clear controls. The row stays hidden until the toggle is clicked, and the toggle carries a count of the filters currently applied. Use `default-filters` to show a pill for a filter before the user adds it.
420
+ Add filtering with the [`zn-data-table-filter`](/components/data-table-filter) component in the `filter` slot. It is a funnel in the header, after the search and before the column picker and refresh, with a badge counting the rules that apply. The funnel opens a popover of field / operator / value rules, and each rule that applies shows as a chip in a row under the tabs, with a remove button and Clear all. The row is there only while rules apply. The rules are sent as `filter`. Use `default-filters` to offer a rule for a field when the popover opens with nothing applied.
419
421
 
420
- The table also feeds the bar typeahead values for its text filters, taken from the rows it has loaded and keyed on the column whose name matches the filter's id.
422
+ The table also feeds a slotted filter typeahead values for its text fields, taken from the rows it has loaded and keyed on the column whose name matches the field's id.
421
423
 
422
424
  :::tip
423
425
  In this preview, filter parameters are sent with the request but the static data file returns the same results regardless. With a real server endpoint, results would be filtered based on the applied criteria.
@@ -450,6 +452,27 @@ In this preview, filter parameters are sent with the request but the static data
450
452
  </zn-data-table>
451
453
  ```
452
454
 
455
+ Without a slotted filter, set `filter-fields` to the fields and the table renders the funnel itself, in the same place. Its applied rules also reset the table to page 1.
456
+
457
+ ```html:preview
458
+ <zn-data-table
459
+ standalone
460
+ caption="Users"
461
+ data-uri="/data/data-table.json"
462
+ method="GET"
463
+ headers='[
464
+ {"key":"name","label":"Name"},
465
+ {"key":"email","label":"Email"},
466
+ {"key":"status","label":"Status"}
467
+ ]'
468
+ filter-fields='[
469
+ {"id":"name","name":"Name","operators":["contains","eq"]},
470
+ {"id":"status","name":"Status","options":{"active":"Active","inactive":"Inactive"},"operators":["eq","neq"]}
471
+ ]'>
472
+ <zn-data-table-search slot="search" placeholder="Search..."></zn-data-table-search>
473
+ </zn-data-table>
474
+ ```
475
+
453
476
  ### Filter Top Slot
454
477
 
455
478
  Add complex filtering options above the table using the `filter-top` slot. Perfect for search forms and advanced filters.
@@ -781,7 +804,7 @@ Cells support various styling options through the data response format. Each cel
781
804
  "id": "1",
782
805
  "cells": [
783
806
  {"text": "John Doe", "column": "name", "style": "bold"},
784
- {"text": "Active", "column": "status", "chipColor": "success"},
807
+ {"text": "Active", "column": "status", "badgeType": "success"},
785
808
  {"text": "admin@example.com", "column": "email", "copyable": true},
786
809
  {"text": "View", "column": "action", "uri": "/users/1", "color": "info"}
787
810
  ]
@@ -799,6 +822,7 @@ Available cell properties:
799
822
  - `style`: Comma-separated styles (bold, italic, mono, code, border, center)
800
823
  - `color`: Text color
801
824
  - `chipColor`: Renders as a chip with specified color
825
+ - `badgeType`: Renders as a badge of the given type (`neutral`, `success`, `warning`, `danger`, `info` or `ai`)
802
826
  - `uri`: Makes cell content a link
803
827
  - `target`: Link target attribute
804
828
  - `copyable`: Adds a copy button
@@ -0,0 +1,116 @@
1
+ ---
2
+ meta:
3
+ title: Date Range
4
+ description: A button showing a date range that opens a two-month calendar with quick ranges.
5
+ layout: component
6
+ ---
7
+
8
+ ```html:preview
9
+ <zn-date-range from="2026-10-07" to="2026-10-20"></zn-date-range>
10
+ ```
11
+
12
+ ## Examples
13
+
14
+ ### Basic Date Range
15
+
16
+ Click the button to open the picker. A quick range on the left applies straight away. On the calendar, click a first day and then a last day, then press Apply. The dates can also be typed in the From and To fields. Escape, Cancel or a click outside closes the picker without changing anything.
17
+
18
+ When `from` and `to` are missing, the range is today.
19
+
20
+ ```html:preview
21
+ <zn-date-range></zn-date-range>
22
+ ```
23
+
24
+ ### Limiting the Range
25
+
26
+ Use `max` and `min` to limit which days can be picked. Days outside the limits are greyed out.
27
+
28
+ ```html:preview
29
+ <zn-date-range from="2026-10-01" to="2026-10-15" min="2026-09-01" max="2026-10-20"></zn-date-range>
30
+ ```
31
+
32
+ ### Custom Quick Ranges
33
+
34
+ Pass `presets` as a JSON array of `{label, from, to}` to replace the default quick ranges (Today, Yesterday, Last 7, 14 and 30 days, This month, Last month and Last 90 days). Quick ranges are cut to `min` and `max`; one that lies wholly outside them is greyed out.
35
+
36
+ ```html:preview
37
+ <zn-date-range from="2026-07-01" to="2026-09-30"
38
+ presets='[
39
+ {"label":"Q1 2026","from":"2026-01-01","to":"2026-03-31"},
40
+ {"label":"Q2 2026","from":"2026-04-01","to":"2026-06-30"},
41
+ {"label":"Q3 2026","from":"2026-07-01","to":"2026-09-30"}
42
+ ]'></zn-date-range>
43
+ ```
44
+
45
+ ### Note
46
+
47
+ Use `note` for a short line under the calendar, such as how the range is used.
48
+
49
+ ```html:preview
50
+ <zn-date-range from="2026-10-19" to="2026-10-20" note="Day Compare sets the first day against the last."></zn-date-range>
51
+ ```
52
+
53
+ ### Forms
54
+
55
+ Give the date range a `name` and it submits `name[from]` and `name[to]` with its form.
56
+
57
+ ```html:preview
58
+ <form class="date-range-form">
59
+ <zn-date-range name="period" from="2026-10-01" to="2026-10-20"></zn-date-range>
60
+ <br><br>
61
+ <zn-button type="submit" color="primary">Submit</zn-button>
62
+ <pre class="date-range-form__output"></pre>
63
+ </form>
64
+
65
+ <script type="module">
66
+ const form = document.querySelector('.date-range-form');
67
+ const output = form.querySelector('.date-range-form__output');
68
+
69
+ form.addEventListener('submit', event => {
70
+ event.preventDefault();
71
+ output.textContent = [...new FormData(form)].map(([key, value]) => `${key} = ${value}`).join('\n');
72
+ });
73
+ </script>
74
+ ```
75
+
76
+ ### Listening for Changes
77
+
78
+ `zn-change` is emitted when a range is applied, by Apply or a quick range, with `{from, to}` in its detail. Picking days without pressing Apply does not emit it.
79
+
80
+ ```html:preview
81
+ <div class="date-range-events">
82
+ <zn-date-range from="2026-10-13" to="2026-10-20"></zn-date-range>
83
+ <p class="date-range-events__output">Pick a range and press Apply.</p>
84
+ </div>
85
+
86
+ <script type="module">
87
+ const container = document.querySelector('.date-range-events');
88
+ const output = container.querySelector('.date-range-events__output');
89
+
90
+ container.querySelector('zn-date-range').addEventListener('zn-change', event => {
91
+ output.textContent = `Applied ${event.detail.from} to ${event.detail.to}`;
92
+ });
93
+ </script>
94
+ ```
95
+
96
+ ### Opening from Script
97
+
98
+ Call `show()` and `hide()` to open and close the picker.
99
+
100
+ ```html:preview
101
+ <div class="date-range-methods">
102
+ <zn-date-range from="2026-10-13" to="2026-10-20"></zn-date-range>
103
+ <zn-button size="small" color="secondary">Open picker</zn-button>
104
+ </div>
105
+
106
+ <script type="module">
107
+ const container = document.querySelector('.date-range-methods');
108
+ const range = container.querySelector('zn-date-range');
109
+
110
+ container.querySelector('zn-button').addEventListener('click', async event => {
111
+ event.stopPropagation();
112
+ await customElements.whenDefined('zn-date-range');
113
+ range.show();
114
+ });
115
+ </script>
116
+ ```
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  meta:
3
3
  title: Dialog
4
- description: 'Dialogs, also called "modals", appear above the page and require the users immediate attention.'
4
+ description: 'Dialogs, also called "modals", appear above the page and require the user''s immediate attention.'
5
5
  layout: component
6
6
  ---
7
7
 
@@ -9,28 +9,19 @@ layout: component
9
9
 
10
10
  ### Basic Dialog
11
11
 
12
- This is a basic dialog. It has a trigger button that opens the dialog. The dialog has a close button and two buttons in
13
- the footer.
12
+ Use a dialog only for a decision that blocks the flow. Set `trigger` to the `id` of the element that opens it. The
13
+ header has a close button, and the footer holds the actions: the one that dismisses the dialog first, then the one that
14
+ carries out the decision.
14
15
 
15
16
  ```html:preview
16
- <zn-button id="dialog-trigger">Open Basic dialog</zn-button>
17
- <zn-dialog class="dialog-basic" trigger="dialog-trigger" label="Dialog">
18
- This is the dialog's body.
17
+ <zn-button id="dialog-trigger">Issue refund</zn-button>
18
+ <zn-dialog trigger="dialog-trigger" label="Issue a refund?" size="small">
19
+ <zn-icon src="undo" slot="header-icon"></zn-icon>
20
+ <p>$9.95 will be returned to Visa •••• 4242. This can't be undone.</p>
21
+ <zn-input label="Amount" value="$9.95"></zn-input>
19
22
 
20
- <zn-button color="default" slot="footer">Do Something</zn-button>
21
- <zn-button color="secondary" slot="footer" dialog-closer>Close Dialog</zn-button>
22
- </zn-dialog>
23
- ```
24
-
25
- ## test
26
-
27
- ```html:preview
28
- <zn-button id="dialog-trigger">Open Basic dialog</zn-button>
29
- <zn-dialog class="dialog-basic" trigger="dialog-trigger" label="Verify longdomainwhitlotsofcharacters.somethignsomewhere.dev">
30
- This is the dialog's body.
31
-
32
- <zn-button color="default" slot="footer">Do Something</zn-button>
33
- <zn-button color="secondary" slot="footer" dialog-closer>Close Dialog</zn-button>
23
+ <zn-button color="secondary" slot="footer" dialog-closer>Cancel</zn-button>
24
+ <zn-button slot="footer">Issue refund</zn-button>
34
25
  </zn-dialog>
35
26
  ```
36
27
 
@@ -70,7 +61,7 @@ styled based on the dialog variant.
70
61
 
71
62
  #### Default Variant
72
63
 
73
- Use the default variant for confirmation of neutral actions like submitting a form or displaying informational content.
64
+ Use the default variant to confirm a neutral action, such as submitting a form, or to show information.
74
65
 
75
66
  ```html:preview
76
67
  <zn-button id="dialog-default-trigger">Open Default Dialog</zn-button>
@@ -85,7 +76,7 @@ Use the default variant for confirmation of neutral actions like submitting a fo
85
76
 
86
77
  #### Warning Variant
87
78
 
88
- Use the warning variant for confirmation of destructive actions like deleting or canceling something.
79
+ Use the warning variant to confirm a destructive action, such as deleting or cancelling something.
89
80
 
90
81
  ```html:preview
91
82
  <zn-button id="dialog-warning-trigger">Open Warning Dialog</zn-button>
@@ -94,14 +85,15 @@ Use the warning variant for confirmation of destructive actions like deleting or
94
85
  This action cannot be undone. Are you sure you want to delete this item?
95
86
 
96
87
  <zn-button color="secondary" slot="footer" dialog-closer>Cancel</zn-button>
97
- <zn-button color="warning" slot="footer">Delete</zn-button>
88
+ <zn-button color="error" slot="footer">Delete</zn-button>
98
89
  </zn-dialog>
99
90
  ```
100
91
 
101
92
  #### Announcement Variant
102
93
 
103
- Use the announcement variant for special announcements, feature introductions, or welcome messages. This variant
104
- supports additional slots for intro text and footer text.
94
+ Use the announcement variant for an announcement, a feature introduction or a welcome message. The icon, label and
95
+ body are centred, with the `announcement-intro` slot above the label and the `footer-text` slot below the footer
96
+ buttons. It has no close button, so give it a footer action that closes it.
105
97
 
106
98
  ```html:preview
107
99
  <zn-button id="dialog-announcement-trigger">Open Announcement</zn-button>
@@ -152,12 +144,12 @@ attribute to control the dialog width.
152
144
 
153
145
  ### Custom Width
154
146
 
155
- You can set a custom dialog width using the `--width` CSS custom property. Note that the dialog will automatically
156
- shrink to accommodate smaller screens.
147
+ Set `size="custom"` and the `--width` CSS custom property to give the dialog its own width. The size presets set their
148
+ own width, which takes precedence over `--width`. The dialog shrinks to fit smaller screens.
157
149
 
158
150
  ```html:preview
159
151
  <zn-button id="dialog-custom-width-trigger">Open Custom Width Dialog</zn-button>
160
- <zn-dialog trigger="dialog-custom-width-trigger" label="Custom Width" style="--width: 800px;">
152
+ <zn-dialog trigger="dialog-custom-width-trigger" label="Custom Width" size="custom" style="--width: 800px;">
161
153
  <zn-icon src="info" slot="header-icon"></zn-icon>
162
154
  This dialog has a custom width of 800px set using the --width CSS property.
163
155
 
@@ -202,11 +194,11 @@ is used for screen readers even when visually hidden.
202
194
  ```html:preview
203
195
  <zn-button id="dialog-no-header-trigger">Open No Header Dialog</zn-button>
204
196
  <zn-dialog trigger="dialog-no-header-trigger" label="Dialog without header" no-header>
205
- <p>This dialog has no header. Notice there's no close button, so we've added one in the footer.</p>
197
+ <p>This dialog has no header, so there's no close button. The footer has one instead.</p>
206
198
  <p>The label attribute is still required for accessibility, even though it's not visible.</p>
207
199
 
208
- <zn-button color="default" slot="footer">Continue</zn-button>
209
200
  <zn-button color="secondary" slot="footer" dialog-closer>Close</zn-button>
201
+ <zn-button color="default" slot="footer">Continue</zn-button>
210
202
  </zn-dialog>
211
203
  ```
212
204
 
@@ -229,7 +221,7 @@ Use the `header-actions` slot to add buttons or other interactive elements to th
229
221
 
230
222
  ### Dialogs as Forms
231
223
 
232
- Use dialogs as forms when you need to collect information from users. This example shows a dialog with a form inside it.
224
+ Place the dialog inside a `<form>` to collect information. A footer button with `type="submit"` submits the form.
233
225
 
234
226
  ```html:preview
235
227
  <form method="post" action="#" style="display: inline-block">
@@ -242,7 +234,7 @@ Use dialogs as forms when you need to collect information from users. This examp
242
234
  label-tooltip="This information will be displayed on your public profile"
243
235
  help-text="All fields marked with an asterisk are required">
244
236
 
245
- <div class="form-spacing">
237
+ <div>
246
238
  <zn-input type="text" name="name" label="Name" required></zn-input>
247
239
  <zn-select label="Favorite Animal" clearable required>
248
240
  <zn-option value="birds">Birds</zn-option>
@@ -255,7 +247,6 @@ Use dialogs as forms when you need to collect information from users. This examp
255
247
 
256
248
  <zn-checkbox required>I agree to the terms and conditions</zn-checkbox>
257
249
 
258
- <br>
259
250
  <zn-checkbox-group label="Interests" help-text="Select at least one" label-tooltip="Choose your areas of interest"
260
251
  required>
261
252
  <zn-checkbox value="technology">Technology</zn-checkbox>
@@ -415,20 +406,20 @@ on its cancel button.
415
406
  <zn-icon src="info" slot="header-icon"></zn-icon>
416
407
  <p>Any element with the dialog-closer attribute will close this dialog when clicked.</p>
417
408
 
418
- <zn-button color="default" slot="footer">This Won't Close</zn-button>
419
409
  <zn-button color="secondary" slot="footer" dialog-closer>This Will Close</zn-button>
410
+ <zn-button color="default" slot="footer">This Won't Close</zn-button>
420
411
  </zn-dialog>
421
412
  ```
422
413
 
423
414
  ### Cosmic Effect
424
415
 
425
- Add the `cosmic` attribute to apply a special visual effect to the dialog backdrop.
416
+ Add the `cosmic` attribute to draw an animated gradient border around the dialog.
426
417
 
427
418
  ```html:preview
428
419
  <zn-button id="dialog-cosmic-trigger">Open Cosmic Dialog</zn-button>
429
420
  <zn-dialog trigger="dialog-cosmic-trigger" label="Cosmic Dialog" cosmic>
430
421
  <zn-icon src="star" slot="header-icon"></zn-icon>
431
- This dialog has the cosmic effect applied to the backdrop.
422
+ This dialog has the cosmic border.
432
423
 
433
424
  <zn-button color="secondary" slot="footer" dialog-closer>Close</zn-button>
434
425
  </zn-dialog>
@@ -436,7 +427,8 @@ Add the `cosmic` attribute to apply a special visual effect to the dialog backdr
436
427
 
437
428
  ### Customizing Spacing
438
429
 
439
- Use CSS custom properties to customize the padding in different areas of the dialog.
430
+ Set `--header-spacing`, `--body-spacing` and `--footer-spacing` on a dialog to change the padding of its header,
431
+ body and footer. To restyle every dialog, a theme sets the `--zn-dialog-*` tokens listed under Custom Properties.
440
432
 
441
433
  ```html:preview
442
434
  <zn-button id="dialog-spacing-trigger">Open Dialog</zn-button>
@@ -0,0 +1,28 @@
1
+ ---
2
+ meta:
3
+ title: Diff Row
4
+ description: One aligned row of a diff, showing the same item in both versions and tinted by how it changed.
5
+ layout: component
6
+ ---
7
+
8
+ ```html:preview
9
+ <zn-diff before-caption="Before" after-caption="After">
10
+ <zn-diff-row caption="Section" heading></zn-diff-row>
11
+ <zn-diff-row caption="Unchanged">
12
+ <span slot="before">Same value</span>
13
+ <span slot="after">Same value</span>
14
+ </zn-diff-row>
15
+ <zn-diff-row caption="Changed" change="changed">
16
+ <span slot="before">Old value</span>
17
+ <span slot="after">New value</span>
18
+ </zn-diff-row>
19
+ <zn-diff-row caption="Added" change="added">
20
+ <span slot="after">New item</span>
21
+ </zn-diff-row>
22
+ <zn-diff-row caption="Removed" change="removed">
23
+ <span slot="before">Old item</span>
24
+ </zn-diff-row>
25
+ </zn-diff>
26
+ ```
27
+
28
+ Use `heading` for a row that names the group below it. `change` is `changed`, `added` or `removed`; leave it out for an unchanged item.
@@ -0,0 +1,46 @@
1
+ ---
2
+ meta:
3
+ title: Diff
4
+ description: Diffs compare two versions side by side, one column each, with every item aligned and tinted by how it changed.
5
+ layout: component
6
+ ---
7
+
8
+ ```html:preview
9
+ <zn-diff before-caption="Version 2" before-description="Published 30 Sep 2026"
10
+ after-caption="Version 3" after-description="Published 12 Oct 2026">
11
+ <zn-badge slot="after" type="success">Live</zn-badge>
12
+ <zn-diff-row caption="Settings" heading></zn-diff-row>
13
+ <zn-diff-row caption="Passing score" change="changed">
14
+ <span slot="before">75%</span>
15
+ <span slot="after">80%</span>
16
+ </zn-diff-row>
17
+ <zn-diff-row caption="Minimum scorer level">
18
+ <span slot="before">Senior scorer</span>
19
+ <span slot="after">Senior scorer</span>
20
+ </zn-diff-row>
21
+ <zn-diff-row caption="Resolution" heading></zn-diff-row>
22
+ <zn-diff-row caption="Was personal data shared correctly?" change="added">
23
+ <span slot="after">Yes / No · Compliance · score +15</span>
24
+ </zn-diff-row>
25
+ <zn-diff-row caption="Thanked the customer" change="removed" after-placeholder="Removed in version 3">
26
+ <span slot="before">Yes / No · Empathy · score +5</span>
27
+ </zn-diff-row>
28
+ </zn-diff>
29
+ ```
30
+
31
+ ## Examples
32
+
33
+ ### Placeholders
34
+
35
+ An added item has nothing on the left and a removed item nothing on the right; that side is hatched with a placeholder. Set `before-placeholder` or `after-placeholder` to name the version.
36
+
37
+ ```html:preview
38
+ <zn-diff before-caption="Version 1" after-caption="Version 2">
39
+ <zn-diff-row caption="Closing tone" change="added" before-placeholder="Not in version 1">
40
+ <span slot="after">Sad / Neutral / Happy · score +25</span>
41
+ </zn-diff-row>
42
+ <zn-diff-row caption="Offered a survey" change="removed" after-placeholder="Removed in version 2">
43
+ <span slot="before">Yes / No · score +5</span>
44
+ </zn-diff-row>
45
+ </zn-diff>
46
+ ```