@kubex/zinc 1.1.184 → 2.0.0
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/.browserslistrc +2 -0
- package/.github/workflows/js_build_and_deploy.yaml +54 -1
- package/.github/workflows/test.yaml +27 -0
- package/dist/chunks/zn.UWJLIXDT.js +1 -0
- package/dist/custom-elements.json +10344 -2583
- package/dist/vscode.html-custom-data.json +1102 -125
- package/dist/web-types.json +2217 -224
- package/dist/zn.d.ts +2306 -417
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +2313 -1635
- package/docs/_includes/default.njk +4 -1
- package/docs/assets/scripts/docs.js +22 -6
- package/docs/assets/styles/docs.css +9 -2
- package/docs/data/report-table-day-compare.json +380 -0
- package/docs/data/report-table.json +314 -0
- package/docs/pages/components/avatar-group.md +57 -0
- package/docs/pages/components/badge.md +67 -0
- package/docs/pages/components/button.md +41 -1
- package/docs/pages/components/chat-message.md +16 -0
- package/docs/pages/components/checkbox.md +1 -1
- package/docs/pages/components/chip.md +25 -13
- package/docs/pages/components/color-picker.md +37 -0
- package/docs/pages/components/copy-button.md +2 -2
- package/docs/pages/components/data-table-filter.md +33 -50
- package/docs/pages/components/data-table-search.md +4 -4
- package/docs/pages/components/data-table.md +27 -3
- package/docs/pages/components/date-range.md +116 -0
- package/docs/pages/components/dialog.md +29 -37
- package/docs/pages/components/diff-row.md +28 -0
- package/docs/pages/components/diff.md +46 -0
- package/docs/pages/components/editor.md +55 -0
- package/docs/pages/components/filter-wrapper.md +20 -0
- package/docs/pages/components/icon.md +46 -1
- package/docs/pages/components/input.md +30 -11
- package/docs/pages/components/item.md +35 -0
- package/docs/pages/components/key-value.md +25 -0
- package/docs/pages/components/menu.md +74 -7
- package/docs/pages/components/nav-item.md +15 -0
- package/docs/pages/components/nav-list.md +132 -0
- package/docs/pages/components/navbar.md +100 -1
- package/docs/pages/components/page.md +242 -74
- package/docs/pages/components/priority-list.md +43 -5
- package/docs/pages/components/query-builder.md +23 -0
- package/docs/pages/components/radio-group.md +33 -1
- package/docs/pages/components/radio.md +1 -1
- package/docs/pages/components/report-table.md +202 -0
- package/docs/pages/components/stat.md +30 -0
- package/docs/pages/components/tile.md +11 -0
- package/docs/pages/components/tooltip.md +1 -1
- package/docs/pages/components/translation-grid.md +86 -0
- package/docs/pages/components/vertical-stepper.md +108 -64
- package/package.json +2 -1
- package/scss/_global-spacing.scss +2 -2
- package/scss/_root.scss +11 -171
- package/scss/boot.scss +14 -0
- package/scss/mixins/_helper-mixins.scss +24 -2
- package/scss/mixins/_motion-mixins.scss +126 -0
- package/scss/mixins/_spacing-mixins.scss +4 -3
- package/scss/mixins/_tab-indicator-mixins.scss +12 -0
- package/scss/mixins/_typography-mixins.scss +1 -1
- package/scss/mixins/index.scss +14 -0
- package/scss/shared/_base.scss +32 -1
- package/scss/shared/_button-mixin.scss +7 -5
- package/scss/shared/_table.scss +35 -4
- package/scss/shared/nav.scss +4 -0
- package/scss/shared/shimmer.scss +1 -1
- package/scss/table-controls.scss +206 -0
- package/scss/themes/_dark.scss +1 -3
- package/scss/themes/_index.scss +1 -1
- package/scss/themes/_light.scss +46 -6
- package/scss/themes/_modes.scss +11 -11
- package/scss/themes/_openbyte.scss +944 -0
- package/scss/themes/_typography.scss +4 -2
- package/scss/variables/index.scss +0 -9
- package/src/components/alert/alert.component.ts +14 -4
- package/src/components/alert/alert.scss +55 -69
- package/src/components/alert/alert.test.ts +8 -0
- package/src/components/animated-button/animated-button.component.ts +3 -2
- package/src/components/animated-button/animated-button.scss +6 -23
- package/src/components/animated-button/animated-button.test.ts +4 -3
- package/src/components/avatar-group/avatar-group.component.ts +84 -0
- package/src/components/avatar-group/avatar-group.scss +54 -0
- package/src/components/avatar-group/avatar-group.test.ts +59 -0
- package/src/components/avatar-group/index.ts +12 -0
- package/src/components/badge/badge.component.ts +49 -0
- package/src/components/badge/badge.scss +80 -0
- package/src/components/badge/badge.test.ts +34 -0
- package/src/components/badge/index.ts +12 -0
- package/src/components/bulk-actions/bulk-actions.component.ts +14 -2
- package/src/components/button/button.component.ts +242 -11
- package/src/components/button/button.scss +133 -25
- package/src/components/button/button.test.ts +122 -0
- package/src/components/button-menu/button-menu.component.ts +32 -11
- package/src/components/button-menu/button-menu.scss +5 -1
- package/src/components/channel-tile/channel-tile.component.ts +34 -27
- package/src/components/channel-tile/channel-tile.scss +76 -43
- package/src/components/chart/builders.test.ts +46 -0
- package/src/components/chart/builders.ts +27 -3
- package/src/components/chart/chart-live.test.ts +4 -6
- package/src/components/chart/chart.component.ts +125 -5
- package/src/components/chart/chart.scss +121 -0
- package/src/components/chart/chart.test.ts +81 -0
- package/src/components/chat-message/chat-message.component.ts +21 -1
- package/src/components/chat-message/chat-message.scss +13 -2
- package/src/components/chat-message/chat-message.test.ts +9 -0
- package/src/components/checkbox/checkbox.component.ts +61 -27
- package/src/components/checkbox/checkbox.scss +58 -25
- package/src/components/checkbox-group/checkbox-group.component.ts +7 -1
- package/src/components/chip/chip.component.ts +11 -1
- package/src/components/chip/chip.scss +91 -26
- package/src/components/chip/chip.test.ts +17 -0
- package/src/components/collapsible/collapsible.component.ts +17 -3
- package/src/components/collapsible/collapsible.scss +19 -10
- package/src/components/color-picker/color-picker.component.ts +277 -0
- package/src/components/color-picker/color-picker.scss +141 -0
- package/src/components/color-picker/color-picker.test.ts +57 -0
- package/src/components/color-picker/index.ts +12 -0
- package/src/components/cols/cols.component.ts +17 -3
- package/src/components/cols/cols.scss +24 -13
- package/src/components/cols/cols.test.ts +33 -0
- package/src/components/confirm/confirm.component.ts +20 -6
- package/src/components/confirm/confirm.test.ts +52 -0
- package/src/components/content-block/content-block.component.ts +38 -9
- package/src/components/content-block/content-block.scss +11 -5
- package/src/components/content-block/content-block.test.ts +26 -0
- package/src/components/copy-button/copy-button.component.ts +2 -2
- package/src/components/copy-button/copy-button.scss +17 -4
- package/src/components/data-select/data-select.component.ts +3 -1
- package/src/components/data-table/data-table.component.ts +364 -142
- package/src/components/data-table/data-table.scss +133 -60
- package/src/components/data-table/data-table.test.ts +356 -4
- package/src/components/data-table-filter/data-table-filter.component.ts +426 -406
- package/src/components/data-table-filter/data-table-filter.scss +176 -148
- package/src/components/data-table-filter/data-table-filter.test.ts +271 -273
- package/src/components/data-table-search/data-table-search.component.ts +4 -2
- package/src/components/data-table-search/data-table-search.scss +8 -1
- package/src/components/data-table-search/data-table-search.test.ts +29 -0
- package/src/components/date-range/date-range-math.test.ts +78 -0
- package/src/components/date-range/date-range-math.ts +105 -0
- package/src/components/date-range/date-range.component.ts +375 -0
- package/src/components/date-range/date-range.scss +272 -0
- package/src/components/date-range/date-range.test.ts +247 -0
- package/src/components/date-range/index.ts +12 -0
- package/src/components/datepicker/datepicker.component.ts +44 -7
- package/src/components/datepicker/datepicker.scss +9 -0
- package/src/components/datepicker/datepicker.test.ts +2 -2
- package/src/components/dialog/dialog.component.ts +38 -19
- package/src/components/dialog/dialog.scss +65 -36
- package/src/components/dialog/dialog.test.ts +14 -0
- package/src/components/diff/diff.component.ts +55 -0
- package/src/components/diff/diff.scss +46 -0
- package/src/components/diff/diff.test.ts +15 -0
- package/src/components/diff/index.ts +12 -0
- package/src/components/diff-row/diff-row.component.ts +75 -0
- package/src/components/diff-row/diff-row.scss +70 -0
- package/src/components/diff-row/diff-row.test.ts +37 -0
- package/src/components/diff-row/index.ts +12 -0
- package/src/components/dropdown/dropdown.component.ts +12 -10
- package/src/components/dropdown/dropdown.scss +2 -0
- package/src/components/editor/editor.component.ts +159 -11
- package/src/components/editor/editor.scss +250 -1
- package/src/components/editor/editor.test.ts +31 -3
- package/src/components/editor/modules/ai/panel/ai-panel.scss +0 -1
- package/src/components/editor/modules/attachment/attachment.ts +53 -31
- package/src/components/editor/modules/context-menu/context-menu.ts +17 -0
- package/src/components/editor/modules/dialog/dialog.component.ts +23 -1
- package/src/components/editor/modules/dialog/dialog.test.ts +28 -0
- package/src/components/editor/modules/emoji/emoji.ts +4 -5
- package/src/components/editor/modules/merge-field/merge-field.ts +83 -0
- package/src/components/editor/modules/toolbar/toolbar.component.ts +121 -68
- package/src/components/editor/modules/toolbar/toolbar.scss +38 -0
- package/src/components/editor/modules/toolbar/toolbar.ts +25 -1
- package/src/components/empty-state/empty-state.component.ts +6 -1
- package/src/components/empty-state/empty-state.scss +21 -4
- package/src/components/expanding-action/expanding-action.component.ts +22 -34
- package/src/components/expanding-action/expanding-action.scss +3 -45
- package/src/components/expanding-action/expanding-action.test.ts +2 -1
- package/src/components/file/file.component.ts +30 -2
- package/src/components/file/file.scss +6 -0
- package/src/components/filter-wrapper/filter-wrapper.component.ts +45 -10
- package/src/components/filter-wrapper/filter-wrapper.test.ts +58 -2
- package/src/components/flow-builder/flow-builder.component.ts +36 -3
- package/src/components/flow-builder/flow-builder.scss +0 -6
- package/src/components/flow-builder/modules/flow-canvas/flow-canvas.component.ts +8 -0
- package/src/components/flow-builder/modules/flow-canvas/flow-canvas.scss +10 -5
- package/src/components/flow-builder/modules/flow-node/flow-node.component.ts +17 -0
- package/src/components/flow-builder/modules/flow-node/flow-node.scss +10 -0
- package/src/components/form-actions/form-actions.component.ts +48 -2
- package/src/components/form-actions/form-actions.scss +1 -1
- package/src/components/form-group/form-group.component.ts +10 -3
- package/src/components/form-group/form-group.scss +37 -4
- package/src/components/form-group/form-group.test.ts +10 -0
- package/src/components/header/header.component.ts +11 -4
- package/src/components/header/header.scss +47 -5
- package/src/components/hover-container/hover-container.component.ts +4 -5
- package/src/components/icon/icon.component.ts +95 -9
- package/src/components/icon/icon.scss +70 -6
- package/src/components/icon/icon.test.ts +55 -0
- package/src/components/icon-picker/icon-picker.component.ts +35 -1
- package/src/components/inline-edit/inline-edit.component.ts +38 -8
- package/src/components/inline-edit/inline-edit.scss +128 -19
- package/src/components/input/input.component.ts +173 -297
- package/src/components/input/input.scss +65 -43
- package/src/components/input/input.test.ts +86 -4
- package/src/components/item/item.component.ts +12 -0
- package/src/components/item/item.scss +102 -3
- package/src/components/item/item.test.ts +23 -0
- package/src/components/key/key.component.ts +2 -2
- package/src/components/key/key.scss +11 -0
- package/src/components/key-value/index.ts +12 -0
- package/src/components/key-value/key-value.component.ts +160 -0
- package/src/components/key-value/key-value.scss +20 -0
- package/src/components/key-value/key-value.test.ts +22 -0
- package/src/components/markdown-editor/markdown-editor.component.ts +8 -1
- package/src/components/menu/menu.component.ts +21 -2
- package/src/components/menu/menu.scss +43 -23
- package/src/components/menu/menu.test.ts +33 -0
- package/src/components/menu-item/menu-item.component.ts +13 -2
- package/src/components/menu-item/menu-item.scss +56 -23
- package/src/components/menu-item/menu-item.test.ts +31 -0
- package/src/components/menu-item/submenu-controller.ts +25 -15
- package/src/components/menu-label/index.ts +12 -0
- package/src/components/menu-label/menu-label.component.ts +30 -0
- package/src/components/menu-label/menu-label.scss +18 -0
- package/src/components/nav-item/index.ts +12 -0
- package/src/components/nav-item/nav-item.component.ts +83 -0
- package/src/components/nav-item/nav-item.scss +128 -0
- package/src/components/nav-list/index.ts +12 -0
- package/src/components/nav-list/nav-list.component.ts +313 -0
- package/src/components/nav-list/nav-list.scss +87 -0
- package/src/components/nav-list/nav-list.test.ts +250 -0
- package/src/components/navbar/navbar.component.ts +235 -171
- package/src/components/navbar/navbar.scss +333 -169
- package/src/components/navbar/navbar.test.ts +63 -143
- package/src/components/page/page.component.ts +114 -29
- package/src/components/page/page.scss +223 -95
- package/src/components/page/page.test.ts +214 -3
- package/src/components/page-builder/page-builder.component.ts +51 -5
- package/src/components/page-builder/page-builder.scss +6 -1
- package/src/components/page-nav/page-nav.component.ts +25 -3
- package/src/components/page-nav/page-nav.scss +10 -2
- package/src/components/pagination/pagination.scss +1 -1
- package/src/components/panel/panel.component.ts +14 -13
- package/src/components/panel/panel.scss +14 -10
- package/src/components/panel/panel.test.ts +42 -0
- package/src/components/popup/popup.component.ts +20 -13
- package/src/components/popup/popup.test.ts +21 -1
- package/src/components/priority-list/priority-list.component.ts +157 -172
- package/src/components/priority-list/priority-list.scss +113 -17
- package/src/components/priority-list/priority-list.test.ts +301 -3
- package/src/components/progress-bar/progress-bar.component.ts +1 -1
- package/src/components/progress-bar/progress-bar.scss +16 -4
- package/src/components/progress-tile/progress-tile.scss +1 -1
- package/src/components/query-builder/query-builder.component.ts +85 -10
- package/src/components/query-builder/query-builder.scss +7 -1
- package/src/components/query-builder/query-builder.test.ts +40 -0
- package/src/components/radio/radio.component.ts +57 -18
- package/src/components/radio/radio.scss +101 -26
- package/src/components/radio-group/radio-group.component.ts +45 -7
- package/src/components/radio-group/radio-group.scss +17 -0
- package/src/components/radio-group/radio-group.test.ts +63 -2
- package/src/components/rating/rating.component.ts +23 -0
- package/src/components/rating/rating.scss +1 -1
- package/src/components/remarkd-editor/remarkd-editor.component.ts +60 -5
- package/src/components/remarkd-editor/remarkd-editor.scss +12 -4
- package/src/components/report-table/index.ts +12 -0
- package/src/components/report-table/report-format.test.ts +86 -0
- package/src/components/report-table/report-format.ts +72 -0
- package/src/components/report-table/report-math.test.ts +74 -0
- package/src/components/report-table/report-math.ts +252 -0
- package/src/components/report-table/report-table.component.ts +681 -0
- package/src/components/report-table/report-table.scss +328 -0
- package/src/components/report-table/report-table.test.ts +702 -0
- package/src/components/reveal/reveal.component.ts +15 -1
- package/src/components/reveal/reveal.scss +5 -0
- package/src/components/schedule-builder/schedule-builder.component.ts +23 -8
- package/src/components/scroll-container/scroll-container.component.ts +19 -1
- package/src/components/scroll-container/scroll-container.scss +6 -1
- package/src/components/select/select.component.ts +52 -36
- package/src/components/select/select.scss +42 -25
- package/src/components/select/select.test.ts +14 -2
- package/src/components/settings-container/settings-container.scss +18 -5
- package/src/components/sidebar/sidebar.component.ts +8 -1
- package/src/components/sidebar/sidebar.scss +6 -1
- package/src/components/skeleton/skeleton.component.ts +3 -3
- package/src/components/skeleton/skeleton.scss +6 -6
- package/src/components/skeleton/skeleton.test.ts +9 -0
- package/src/components/slash-menu/slash-menu.scss +1 -1
- package/src/components/slideout/slideout.component.ts +20 -3
- package/src/components/slideout/slideout.scss +13 -6
- package/src/components/slideout/slideout.test.ts +19 -0
- package/src/components/split-button/split-button.component.ts +1 -1
- package/src/components/split-pane/split-pane.component.ts +71 -8
- package/src/components/split-pane/split-pane.scss +145 -41
- package/src/components/split-pane/split-pane.test.ts +23 -3
- package/src/components/stat/stat.component.ts +209 -14
- package/src/components/stat/stat.scss +305 -5
- package/src/components/stat/stat.test.ts +143 -2
- package/src/components/status-indicator/status-indicator.scss +22 -21
- package/src/components/stepper/stepper.scss +3 -3
- package/src/components/tab/tab.component.ts +1 -0
- package/src/components/table/table.component.ts +12 -1
- package/src/components/table/table.scss +21 -13
- package/src/components/table/table.test.ts +17 -0
- package/src/components/tabs/tabs.component.ts +150 -37
- package/src/components/tabs/tabs.scss +48 -7
- package/src/components/tabs/tabs.test.ts +169 -0
- package/src/components/textarea/textarea.component.ts +25 -3
- package/src/components/textarea/textarea.scss +10 -0
- package/src/components/textarea/textarea.test.ts +8 -4
- package/src/components/theme-editor/theme-editor.scss +0 -6
- package/src/components/tile/tile.component.ts +32 -2
- package/src/components/tile/tile.scss +40 -7
- package/src/components/tile/tile.test.ts +10 -0
- package/src/components/toggle/toggle.component.ts +23 -7
- package/src/components/toggle/toggle.scss +36 -29
- package/src/components/toggle/toggle.test.ts +17 -0
- package/src/components/tooltip/tooltip.component.ts +3 -0
- package/src/components/tooltip/tooltip.scss +11 -6
- package/src/components/tooltip/tooltip.test.ts +12 -0
- package/src/components/translation-field/index.ts +12 -0
- package/src/components/translation-field/translation-field.component.ts +55 -0
- package/src/components/translation-field/translation-field.scss +101 -0
- package/src/components/translation-fields/index.ts +12 -0
- package/src/components/translation-fields/translation-fields.component.ts +80 -0
- package/src/components/translation-fields/translation-fields.scss +60 -0
- package/src/components/translation-grid/index.ts +12 -0
- package/src/components/translation-grid/translation-grid.component.ts +157 -0
- package/src/components/translation-grid/translation-grid.scss +138 -0
- package/src/components/translation-grid/translation-grid.test.ts +28 -0
- package/src/components/vertical-stepper/vertical-stepper.component.ts +35 -9
- package/src/components/vertical-stepper/vertical-stepper.scss +110 -39
- package/src/components/vertical-stepper/vertical-stepper.test.ts +35 -0
- package/src/components/well/well.scss +2 -2
- package/src/events/events.ts +2 -0
- package/src/events/zn-chart-click.ts +13 -0
- package/src/events/zn-report-change.ts +7 -0
- package/src/form-control.scss +36 -3
- package/src/internal/anchored-popover.ts +175 -0
- package/src/internal/animate.ts +19 -5
- package/src/internal/cosmic-border.ts +15 -0
- package/src/internal/form.ts +1 -1
- package/src/internal/hover-intent.ts +15 -0
- package/src/internal/input-modality.ts +15 -0
- package/src/internal/pointer-intent.ts +37 -0
- package/src/internal/reorder.ts +625 -0
- package/src/internal/scroll.ts +51 -3
- package/src/internal/selection-card.ts +1 -1
- package/src/internal/tab-indicator.ts +92 -0
- package/src/internal/table-sort.ts +25 -0
- package/src/internal/table-tabs.ts +108 -0
- package/src/internal/test-drag.ts +35 -0
- package/src/internal/theme-openbyte.test.ts +126 -0
- package/src/internal/theme.ts +4 -4
- package/src/internal/zinc-element.ts +2 -2
- package/src/selection-card.scss +25 -0
- package/src/types/web-test-runner-commands.d.ts +1 -0
- package/src/utilities/color.test.ts +43 -0
- package/src/utilities/color.ts +189 -0
- package/src/zinc.ts +14 -0
- package/.github/workflows/eleventy_build.yml +0 -42
- 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="
|
|
91
|
-
<zn-copy-button value="Default size" size="
|
|
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:
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
44
|
+
### Typeahead
|
|
39
45
|
|
|
40
|
-
|
|
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
|
-
###
|
|
48
|
+
### Showing the Chips Elsewhere
|
|
43
49
|
|
|
44
|
-
|
|
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
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
|
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
|
|
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,
|
|
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="[{"id":"category","name":"Category","options":{"cat1":"Category 1","cat2":"Category 2","cat3":"Category 3","cat4":"Category 4","cat5":"Category 5","cat6":"Category 6"},"maxOptionsVisible":3,"operators":["eq","in"]}]"
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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", "
|
|
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
|
|
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
|
-
|
|
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">
|
|
17
|
-
<zn-dialog
|
|
18
|
-
|
|
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="
|
|
21
|
-
<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
|
|
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
|
|
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="
|
|
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
|
|
104
|
-
|
|
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
|
-
|
|
156
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
+
```
|