@zazz-ui/core 0.4.1 → 0.5.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.
- package/AUTHORING.md +158 -0
- package/CHANGELOG.md +345 -0
- package/README.md +55 -23
- package/dist/scroll-state-C8mA5gq6.js +1 -0
- package/dist/sri.json +124 -72
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +116794 -0
- package/editor/zazz.html-data.json +1683 -0
- package/editor/zazz.language-data.json +5001 -0
- package/editor/zazz.lint-data.json +152 -0
- package/package.json +12 -5
- package/src/base/_breakpoints.css +12 -0
- package/src/base/_layers.css +8 -9
- package/src/base/_properties-2xl.css +171 -0
- package/src/base/_properties-active.css +107 -0
- package/src/base/_properties-checked.css +107 -0
- package/src/base/_properties-current.css +107 -0
- package/src/base/_properties-disabled.css +107 -0
- package/src/base/_properties-focus-visible.css +107 -0
- package/src/base/_properties-focus-within.css +107 -0
- package/src/base/_properties-hover.css +107 -0
- package/src/base/_properties-lg.css +171 -0
- package/src/base/_properties-md.css +171 -0
- package/src/base/_properties-open.css +107 -0
- package/src/base/_properties-sm.css +171 -0
- package/src/base/_properties-starting.css +55 -0
- package/src/base/_properties-stuck.css +55 -0
- package/src/base/_properties-xl.css +171 -0
- package/src/base/_properties.css +555 -0
- package/src/base/_reset.css +67 -75
- package/src/base/_switches.css +145 -0
- package/src/base/_typography.css +437 -370
- package/src/base/_utilities-box.css +142 -0
- package/src/base/_utilities-color.css +290 -0
- package/src/base/_utilities-effects.css +235 -0
- package/src/base/_utilities-flow.css +312 -0
- package/src/base/_utilities-grid.css +143 -0
- package/src/base/_utilities-margin.css +376 -0
- package/src/base/_utilities-pseudo.css +426 -0
- package/src/base/_utilities-sizing.css +259 -0
- package/src/base/_utilities-spacing.css +190 -0
- package/src/base/_utilities-tier-2xl.css +93 -0
- package/src/base/_utilities-tier-active.css +61 -0
- package/src/base/_utilities-tier-checked.css +61 -0
- package/src/base/_utilities-tier-current.css +61 -0
- package/src/base/_utilities-tier-disabled.css +61 -0
- package/src/base/_utilities-tier-focus-visible.css +61 -0
- package/src/base/_utilities-tier-focus-within.css +61 -0
- package/src/base/_utilities-tier-hover.css +63 -0
- package/src/base/_utilities-tier-lg.css +93 -0
- package/src/base/_utilities-tier-md.css +93 -0
- package/src/base/_utilities-tier-open.css +61 -0
- package/src/base/_utilities-tier-sm.css +93 -0
- package/src/base/_utilities-tier-starting.css +35 -0
- package/src/base/_utilities-tier-stuck.css +114 -0
- package/src/base/_utilities-tier-xl.css +93 -0
- package/src/base/_utilities-typography.css +141 -0
- package/src/base/_variables.css +323 -372
- package/src/base/_view-transitions.css +10 -12
- package/src/base/command-score.d.ts.map +1 -1
- package/src/base/command-score.js +1 -2
- package/src/base/command-score.ts +1 -2
- package/src/base/dialog-lifecycle.js +1 -1
- package/src/base/dialog-lifecycle.ts +1 -1
- package/src/base/embla.d.ts +6 -7
- package/src/base/embla.d.ts.map +1 -1
- package/src/base/embla.js +89 -55
- package/src/base/embla.ts +89 -55
- package/src/base/hotkeys.d.ts +0 -5
- package/src/base/hotkeys.d.ts.map +1 -1
- package/src/base/hotkeys.ts +0 -5
- package/src/base/navigation.d.ts +12 -1
- package/src/base/navigation.d.ts.map +1 -1
- package/src/base/navigation.js +229 -86
- package/src/base/navigation.ts +224 -92
- package/src/base/reveal.js +14 -14
- package/src/base/reveal.ts +14 -14
- package/src/base/scroll-state.d.ts +21 -0
- package/src/base/scroll-state.d.ts.map +1 -0
- package/src/base/scroll-state.js +177 -0
- package/src/base/scroll-state.ts +188 -0
- package/src/base/signals.d.ts +1 -2
- package/src/base/signals.d.ts.map +1 -1
- package/src/base/signals.js +4 -6
- package/src/base/signals.ts +4 -6
- package/src/base/style-format.d.ts +33 -0
- package/src/base/style-format.d.ts.map +1 -0
- package/src/base/style-format.js +160 -0
- package/src/base/style-format.ts +180 -0
- package/src/base/typeahead.d.ts +19 -4
- package/src/base/typeahead.d.ts.map +1 -1
- package/src/base/typeahead.js +68 -21
- package/src/base/typeahead.ts +73 -23
- package/src/base/utilities.d.ts +188 -0
- package/src/base/utilities.d.ts.map +1 -0
- package/src/base/utilities.js +750 -0
- package/src/base/utilities.ts +865 -0
- package/src/base/utils.d.ts +3 -7
- package/src/base/utils.d.ts.map +1 -1
- package/src/base/utils.js +4 -8
- package/src/base/utils.ts +4 -8
- package/src/base/zazz-element.d.ts +14 -8
- package/src/base/zazz-element.d.ts.map +1 -1
- package/src/base/zazz-element.js +14 -8
- package/src/base/zazz-element.ts +15 -8
- package/src/globals.d.ts +1 -1
- package/src/head.d.ts +50 -4
- package/src/head.d.ts.map +1 -1
- package/src/head.js +119 -38
- package/src/head.ts +172 -41
- package/src/index.css +57 -14
- package/src/index.js +5 -0
- package/src/index.ts +6 -0
- package/src/manifest.d.ts +36 -5
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +150 -6
- package/src/manifest.ts +167 -9
- package/src/primitives/accordion/accordion.css +18 -17
- package/src/primitives/accordion/accordion.html +42 -9
- package/src/primitives/alert-dialog/alert-dialog.css +13 -13
- package/src/primitives/alert-dialog/alert-dialog.html +26 -12
- package/src/primitives/autocomplete/autocomplete-groups.html +64 -33
- package/src/primitives/autocomplete/autocomplete.css +43 -39
- package/src/primitives/autocomplete/autocomplete.d.ts +6 -5
- package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -1
- package/src/primitives/autocomplete/autocomplete.html +38 -26
- package/src/primitives/autocomplete/autocomplete.js +6 -5
- package/src/primitives/autocomplete/autocomplete.ts +6 -5
- package/src/primitives/avatar/avatar.html +110 -15
- package/src/primitives/badge/badge-icon.html +22 -8
- package/src/primitives/badge/badge.css +401 -128
- package/src/primitives/badge/badge.html +12 -6
- package/src/primitives/breadcrumbs/breadcrumbs.html +25 -5
- package/src/primitives/button/button-icon-only.html +17 -11
- package/src/primitives/button/button-icon.html +9 -3
- package/src/primitives/button/button.css +408 -164
- package/src/primitives/button/button.html +14 -7
- package/src/primitives/button-group/button-group-vertical.html +5 -5
- package/src/primitives/button-group/button-group.css +61 -31
- package/src/primitives/button-group/button-group.html +18 -12
- package/src/primitives/callout/callout.css +114 -0
- package/src/primitives/callout/callout.html +188 -0
- package/src/primitives/card/card-subgrid.html +249 -34
- package/src/primitives/card/card.css +125 -0
- package/src/primitives/card/card.html +141 -20
- package/src/primitives/carousel/carousel.css +30 -20
- package/src/primitives/carousel/carousel.d.ts +7 -10
- package/src/primitives/carousel/carousel.d.ts.map +1 -1
- package/src/primitives/carousel/carousel.html +420 -84
- package/src/primitives/carousel/carousel.js +1 -1
- package/src/primitives/carousel/carousel.ts +8 -11
- package/src/primitives/checkbox/checkbox-tasklist.html +6 -6
- package/src/primitives/checkbox/checkbox.css +98 -40
- package/src/primitives/checkbox/checkbox.d.ts.map +1 -1
- package/src/primitives/checkbox/checkbox.html +13 -8
- package/src/primitives/checkbox/checkbox.js +7 -9
- package/src/primitives/checkbox/checkbox.ts +7 -15
- package/src/primitives/combobox/combobox-multiselect.html +53 -33
- package/src/primitives/combobox/combobox.css +145 -122
- package/src/primitives/combobox/combobox.d.ts +12 -11
- package/src/primitives/combobox/combobox.d.ts.map +1 -1
- package/src/primitives/combobox/combobox.html +48 -28
- package/src/primitives/combobox/combobox.js +46 -51
- package/src/primitives/combobox/combobox.ts +48 -55
- package/src/primitives/command/command-actions.d.ts +2 -3
- package/src/primitives/command/command-actions.d.ts.map +1 -1
- package/src/primitives/command/command-actions.html +48 -33
- package/src/primitives/command/command-actions.js +12 -10
- package/src/primitives/command/command-actions.ts +12 -13
- package/src/primitives/command/command-dialog.html +49 -25
- package/src/primitives/command/command.css +52 -42
- package/src/primitives/command/command.d.ts +10 -7
- package/src/primitives/command/command.d.ts.map +1 -1
- package/src/primitives/command/command.html +95 -46
- package/src/primitives/command/command.js +30 -13
- package/src/primitives/command/command.ts +30 -12
- package/src/primitives/debug/audit-core.d.ts +64 -0
- package/src/primitives/debug/audit-core.d.ts.map +1 -0
- package/src/primitives/debug/audit-core.js +356 -0
- package/src/primitives/debug/audit-core.ts +535 -0
- package/src/primitives/debug/debug.d.ts +50 -0
- package/src/primitives/debug/debug.d.ts.map +1 -0
- package/src/primitives/debug/debug.js +168 -0
- package/src/primitives/debug/debug.ts +211 -0
- package/src/primitives/dialog/dialog-with-form.html +67 -45
- package/src/primitives/dialog/dialog.css +87 -61
- package/src/primitives/dialog/dialog.html +25 -17
- package/src/primitives/fields/fields.css +108 -134
- package/src/primitives/fields/fields.html +39 -0
- package/src/primitives/input/input-icon-leading.html +3 -3
- package/src/primitives/input/input-icon-trailing.html +3 -3
- package/src/primitives/input/input.css +87 -49
- package/src/primitives/input/input.html +15 -15
- package/src/primitives/input-group/input-group-password-group.html +15 -15
- package/src/primitives/input-group/input-group.css +118 -75
- package/src/primitives/input-group/input-group.html +42 -30
- package/src/primitives/kbd/kbd-group.html +15 -2
- package/src/primitives/kbd/kbd.css +44 -31
- package/src/primitives/kbd/kbd.html +7 -1
- package/src/primitives/layout/layout.css +159 -0
- package/src/primitives/layout/layout.html +35 -0
- package/src/primitives/lightbox/lightbox.css +178 -105
- package/src/primitives/lightbox/lightbox.d.ts.map +1 -1
- package/src/primitives/lightbox/lightbox.html +138 -166
- package/src/primitives/lightbox/lightbox.js +10 -13
- package/src/primitives/lightbox/lightbox.ts +12 -13
- package/src/primitives/menu/menu-interest.html +60 -18
- package/src/primitives/menu/menu.css +22 -17
- package/src/primitives/menu/menu.d.ts +5 -5
- package/src/primitives/menu/menu.html +195 -40
- package/src/primitives/menu/menu.js +8 -8
- package/src/primitives/menu/menu.ts +8 -8
- package/src/primitives/menubar/menubar-help-search.html +78 -32
- package/src/primitives/menubar/menubar.html +166 -38
- package/src/primitives/meter/meter.css +41 -38
- package/src/primitives/meter/meter.html +44 -9
- package/src/primitives/mobile-menu/mobile-menu.css +47 -40
- package/src/primitives/mobile-menu/mobile-menu.html +1460 -179
- package/src/primitives/navigation-menu/navigation-menu-featured.html +155 -33
- package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +222 -47
- package/src/primitives/navigation-menu/navigation-menu-interest.html +130 -38
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +402 -72
- package/src/primitives/navigation-menu/navigation-menu-simple.html +90 -40
- package/src/primitives/navigation-menu/navigation-menu.css +104 -106
- package/src/primitives/navigation-menu/navigation-menu.html +554 -158
- package/src/primitives/otp/otp.css +43 -44
- package/src/primitives/otp/otp.d.ts +4 -5
- package/src/primitives/otp/otp.d.ts.map +1 -1
- package/src/primitives/otp/otp.html +7 -6
- package/src/primitives/otp/otp.js +13 -18
- package/src/primitives/otp/otp.ts +12 -19
- package/src/primitives/password-group/password-group.css +132 -107
- package/src/primitives/password-group/password-group.d.ts.map +1 -1
- package/src/primitives/password-group/password-group.html +23 -16
- package/src/primitives/password-group/password-group.js +11 -12
- package/src/primitives/password-group/password-group.ts +11 -12
- package/src/primitives/popover/popover.css +88 -95
- package/src/primitives/popover/popover.html +18 -0
- package/src/primitives/progress/progress-indeterminate.html +1 -1
- package/src/primitives/progress/progress.css +34 -35
- package/src/primitives/progress/progress.html +18 -4
- package/src/primitives/prose/prose.html +19 -12
- package/src/primitives/radio/radio.css +83 -46
- package/src/primitives/radio/radio.html +16 -11
- package/src/primitives/reveal/reveal.css +37 -46
- package/src/primitives/reveal/reveal.html +15 -0
- package/src/primitives/scroll-fade/scroll-fade.css +115 -0
- package/src/primitives/scroll-fade/scroll-fade.html +69 -0
- package/src/primitives/select/multiselect.d.ts +8 -10
- package/src/primitives/select/multiselect.d.ts.map +1 -1
- package/src/primitives/select/multiselect.js +23 -27
- package/src/primitives/select/multiselect.ts +23 -29
- package/src/primitives/select/select-align.html +79 -16
- package/src/primitives/select/select-multiple.html +8 -4
- package/src/primitives/select/select-sides.html +104 -21
- package/src/primitives/select/select.css +297 -186
- package/src/primitives/select/select.html +24 -5
- package/src/primitives/separator/separator.css +15 -18
- package/src/primitives/separator/separator.html +37 -10
- package/src/primitives/slider/slider.css +48 -38
- package/src/primitives/slider/slider.html +9 -1
- package/src/primitives/style-guard/style-guard.d.ts +19 -0
- package/src/primitives/style-guard/style-guard.d.ts.map +1 -0
- package/src/primitives/style-guard/style-guard.js +125 -0
- package/src/primitives/style-guard/style-guard.ts +153 -0
- package/src/primitives/switch/switch.css +42 -33
- package/src/primitives/switch/switch.html +11 -6
- package/src/primitives/table/table-alternating.html +1 -1
- package/src/primitives/table/table-grid.html +5 -5
- package/src/primitives/table/table-size-sm.html +1 -1
- package/src/primitives/table/table.css +64 -61
- package/src/primitives/table/table.html +7 -7
- package/src/primitives/tabs/tabs.css +167 -166
- package/src/primitives/tabs/tabs.d.ts +10 -11
- package/src/primitives/tabs/tabs.d.ts.map +1 -1
- package/src/primitives/tabs/tabs.html +192 -36
- package/src/primitives/tabs/tabs.js +14 -15
- package/src/primitives/tabs/tabs.ts +14 -15
- package/src/primitives/textarea/textarea.css +69 -44
- package/src/primitives/textarea/textarea.html +3 -3
- package/src/primitives/toaster/toaster.css +90 -92
- package/src/primitives/toaster/toaster.d.ts +0 -6
- package/src/primitives/toaster/toaster.d.ts.map +1 -1
- package/src/primitives/toaster/toaster.html +22 -18
- package/src/primitives/toaster/toaster.js +64 -72
- package/src/primitives/toaster/toaster.ts +71 -87
- package/src/primitives/toggle/toggle.css +368 -153
- package/src/primitives/toggle/toggle.html +27 -9
- package/src/primitives/toggle-group/toggle-group-multiple.html +3 -3
- package/src/primitives/toggle-group/toggle-group-vertical.html +4 -4
- package/src/primitives/toggle-group/toggle-group.css +76 -26
- package/src/primitives/toggle-group/toggle-group.html +3 -3
- package/src/primitives/toolbar/toolbar.html +35 -13
- package/src/primitives/tooltip/tooltip-disabled.html +3 -3
- package/src/primitives/tooltip/tooltip-sides.html +36 -14
- package/src/primitives/tooltip/tooltip-with-kbd.html +5 -5
- package/src/primitives/tooltip/tooltip.css +111 -80
- package/src/primitives/tooltip/tooltip.html +3 -3
- package/src/primitives/utilities/aspect-ratio.html +51 -7
- package/src/primitives/utilities/basis.html +64 -11
- package/src/primitives/utilities/col-span.html +65 -9
- package/src/primitives/utilities/compose.html +48 -10
- package/src/primitives/utilities/flex-align.html +89 -19
- package/src/primitives/utilities/flex-direction.html +111 -13
- package/src/primitives/utilities/flex-grow.html +41 -7
- package/src/primitives/utilities/gap.html +158 -19
- package/src/primitives/utilities/grid-cols.html +75 -7
- package/src/primitives/utilities/grid-responsive.html +111 -12
- package/src/primitives/utilities/margin-auto.html +38 -7
- package/src/primitives/utilities/object-fit.html +75 -13
- package/src/primitives/utilities/order.html +40 -4
- package/src/primitives/utilities/overflow.html +74 -20
- package/src/primitives/utilities/padding-compose.html +67 -10
- package/src/primitives/utilities/padding.html +84 -13
- package/src/primitives/utilities/pile.html +29 -0
- package/src/primitives/utilities/position.html +65 -8
- package/src/primitives/utilities/responsive-flex.html +54 -7
- package/src/primitives/utilities/responsive-grid.html +115 -12
- package/src/primitives/utilities/size.html +120 -16
- package/src/primitives/utilities/width.html +123 -16
- package/examples/about.html +0 -583
- package/examples/components.html +0 -1028
- package/examples/forms.html +0 -504
- package/examples/index.html +0 -261
- package/examples/layout.html +0 -313
- package/examples/products.html +0 -839
- package/examples/responsive.html +0 -332
- package/src/base/_layout.css +0 -571
- package/src/base/_utilities.css +0 -6758
- package/src/primitives/utilities/grid-pile.html +0 -5
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview `<ui-debug>`: audits utilities in `style` attributes.
|
|
4
|
+
* @description Development only. On a listed domain the element walks every
|
|
5
|
+
* element once, and again on mutation, and warns about the mistakes the
|
|
6
|
+
* generated gates cannot report: an unknown utility, a wrong mode, a tier without
|
|
7
|
+
* a base, a modifier the family lacks, a base utility that flattens a state a
|
|
8
|
+
* primitive's hook covers, a raw property shadowing a utility, a
|
|
9
|
+
* whitespace form the gates cannot match, and a `data-<name>-*` attribute
|
|
10
|
+
* outside its identity. On an unlisted domain it removes itself and logs
|
|
11
|
+
* {@link DEBUG_WARNING} once. Identities and hooks are read from the page's
|
|
12
|
+
* stylesheets, so the audit needs no manifest. The checks live in
|
|
13
|
+
* `audit-core.ts`, which the html lint rules (`@zazz-ui/eslint-plugin`) share.
|
|
14
|
+
* @example
|
|
15
|
+
* <ui-debug data-debug-domains="localhost, staging.example.com"></ui-debug>
|
|
16
|
+
*/
|
|
17
|
+
import { ZazzElement, defineZazzElement } from "../../base/zazz-element.js";
|
|
18
|
+
import { auditNode, auditPersistence, carriesIdentity, } from "./audit-core.js";
|
|
19
|
+
/** A live element as the audit core reads it. */
|
|
20
|
+
function auditNodeOf(el) {
|
|
21
|
+
return {
|
|
22
|
+
getAttribute: (name) => el.getAttribute(name),
|
|
23
|
+
getAttributeNames: () => el.getAttributeNames(),
|
|
24
|
+
withinIdentity: (name, identities) => {
|
|
25
|
+
for (let node = el; node; node = node.parentElement) {
|
|
26
|
+
if (carriesIdentity(node.tagName, node.getAttribute("data-ui"), name, identities))
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Identity tokens and state-bearing hooks, read from the page's stylesheets. */
|
|
34
|
+
function fromStylesheets() {
|
|
35
|
+
const identities = new Set();
|
|
36
|
+
const hooks = {};
|
|
37
|
+
const hookPattern = /--ui-([a-z]+(?:-[a-z]+)*?)-([a-z-]+?)--(hover|active|focus-visible|focus-within|checked|open|disabled)\b/g;
|
|
38
|
+
for (const sheet of document.styleSheets) {
|
|
39
|
+
let rules;
|
|
40
|
+
try {
|
|
41
|
+
rules = sheet.cssRules;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
for (const rule of rules) {
|
|
47
|
+
const text = rule.cssText;
|
|
48
|
+
for (const m of text.matchAll(/\[data-ui~="([^"]+)"\]/g))
|
|
49
|
+
identities.add(m[1]);
|
|
50
|
+
for (const m of text.matchAll(hookPattern)) {
|
|
51
|
+
const list = (hooks[m[1]] ??= []);
|
|
52
|
+
if (!list.includes(`${m[2]}--${m[3]}`))
|
|
53
|
+
list.push(`${m[2]}--${m[3]}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return { identities: [...identities], hooks };
|
|
58
|
+
}
|
|
59
|
+
/** Audits every element under `root` (inclusive) and returns the findings. */
|
|
60
|
+
export function audit(root, options = {}) {
|
|
61
|
+
const sheets = options.hooks && options.identities ? null : fromStylesheets();
|
|
62
|
+
const resolved = {
|
|
63
|
+
hooks: options.hooks ?? sheets.hooks,
|
|
64
|
+
identities: options.identities ?? sheets.identities,
|
|
65
|
+
};
|
|
66
|
+
const context = { ...resolved, isColor: (value) => CSS.supports("color", value) };
|
|
67
|
+
const found = [];
|
|
68
|
+
for (const el of [root, ...root.querySelectorAll("*")]) {
|
|
69
|
+
if (el.tagName === "UI-DEBUG")
|
|
70
|
+
continue;
|
|
71
|
+
for (const { message, rule } of auditNode(auditNodeOf(el), context))
|
|
72
|
+
found.push({ el, message, rule });
|
|
73
|
+
}
|
|
74
|
+
return found;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Calls out what survives an in-page navigation: on a `data-ui-navigation="swap"`
|
|
78
|
+
* page, which `data-ui-persist` elements are kept and which
|
|
79
|
+
* `data-ui-persist-scroll` elements carry their scroll offset; warnings for
|
|
80
|
+
* persistence that cannot work as written.
|
|
81
|
+
*/
|
|
82
|
+
export function navigationReport(doc) {
|
|
83
|
+
const swap = doc.documentElement.getAttribute("data-ui-navigation") === "swap";
|
|
84
|
+
const idOf = (attribute) => (el) => el.getAttribute(attribute) ?? "";
|
|
85
|
+
const persists = idOf("data-ui-persist");
|
|
86
|
+
const owner = (el) => (el ? { id: persists(el), self: false } : null);
|
|
87
|
+
const persisted = auditPersistence(swap, [...doc.querySelectorAll("[data-ui-persist]")], persists, (el) => owner(el.parentElement?.closest("[data-ui-persist]")));
|
|
88
|
+
const scrolled = auditPersistence(swap, [...doc.querySelectorAll("[data-ui-persist-scroll]")], idOf("data-ui-persist-scroll"), (el) => el.hasAttribute("data-ui-persist")
|
|
89
|
+
? { id: persists(el), self: true }
|
|
90
|
+
: owner(el.closest("[data-ui-persist]")), "data-ui-persist-scroll");
|
|
91
|
+
const warnings = [...persisted.warnings, ...scrolled.warnings];
|
|
92
|
+
if (!swap)
|
|
93
|
+
return { notes: [], warnings };
|
|
94
|
+
const kept = persisted.kept;
|
|
95
|
+
const ids = (els, attribute) => els.map((el) => `"${el.getAttribute(attribute)}"`).join(", ");
|
|
96
|
+
const one = scrolled.kept.length === 1;
|
|
97
|
+
const scroll = scrolled.kept.length
|
|
98
|
+
? ` ${scrolled.kept.length} element${one ? " comes" : "s come"} from the next page but keep${one ? "s its" : " their"} scroll offset (${ids(scrolled.kept, "data-ui-persist-scroll")}).`
|
|
99
|
+
: "";
|
|
100
|
+
const notes = [
|
|
101
|
+
{
|
|
102
|
+
message: (kept.length
|
|
103
|
+
? `In-page navigation is on. ${kept.length} element${kept.length === 1 ? " persists" : "s persist"} across navigations (${ids(kept, "data-ui-persist")}); everything else is replaced by the next page.`
|
|
104
|
+
: "In-page navigation is on, and nothing persists: every navigation replaces the whole body.") +
|
|
105
|
+
scroll,
|
|
106
|
+
elements: [...kept, ...scrolled.kept],
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
return { notes, warnings };
|
|
110
|
+
}
|
|
111
|
+
export const DEBUG_WARNING = 'Style utility debug tools are still loaded in this domain, but not enabled. If this is intentional, you can ignore this warning by setting data-debug-warnings="false".';
|
|
112
|
+
let warnedOnce = false;
|
|
113
|
+
class UiDebug extends ZazzElement {
|
|
114
|
+
setup(signal) {
|
|
115
|
+
const domains = (this.getAttribute("data-debug-domains") ?? "")
|
|
116
|
+
.split(",")
|
|
117
|
+
.map((domain) => domain.trim())
|
|
118
|
+
.filter(Boolean);
|
|
119
|
+
if (!domains.includes(location.hostname)) {
|
|
120
|
+
if (this.getAttribute("data-debug-warnings") !== "false" && !warnedOnce) {
|
|
121
|
+
warnedOnce = true;
|
|
122
|
+
console.warn(DEBUG_WARNING);
|
|
123
|
+
}
|
|
124
|
+
this.remove();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const reported = new WeakMap();
|
|
128
|
+
const navigation = navigationReport(document);
|
|
129
|
+
for (const { message, elements } of navigation.notes)
|
|
130
|
+
console.info(`[ui-debug] ${message}`, ...elements);
|
|
131
|
+
const report = () => {
|
|
132
|
+
for (const { el, message } of [
|
|
133
|
+
...audit(document.body),
|
|
134
|
+
...navigationReport(document).warnings,
|
|
135
|
+
]) {
|
|
136
|
+
const seen = reported.get(el) ?? new Set();
|
|
137
|
+
if (seen.has(message))
|
|
138
|
+
continue;
|
|
139
|
+
seen.add(message);
|
|
140
|
+
reported.set(el, seen);
|
|
141
|
+
console.warn(`[ui-debug] ${message}`, el);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
let frame = 0;
|
|
145
|
+
const observer = new MutationObserver(() => {
|
|
146
|
+
if (frame)
|
|
147
|
+
return;
|
|
148
|
+
frame = requestAnimationFrame(() => {
|
|
149
|
+
frame = 0;
|
|
150
|
+
report();
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
observer.observe(document.body, {
|
|
154
|
+
attributes: true,
|
|
155
|
+
attributeFilter: ["style", "data-ui"],
|
|
156
|
+
childList: true,
|
|
157
|
+
subtree: true,
|
|
158
|
+
});
|
|
159
|
+
signal.addEventListener("abort", () => {
|
|
160
|
+
observer.disconnect();
|
|
161
|
+
if (frame)
|
|
162
|
+
cancelAnimationFrame(frame);
|
|
163
|
+
});
|
|
164
|
+
report();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
defineZazzElement("ui-debug", UiDebug);
|
|
168
|
+
export { UiDebug };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview `<ui-debug>`: audits utilities in `style` attributes.
|
|
5
|
+
* @description Development only. On a listed domain the element walks every
|
|
6
|
+
* element once, and again on mutation, and warns about the mistakes the
|
|
7
|
+
* generated gates cannot report: an unknown utility, a wrong mode, a tier without
|
|
8
|
+
* a base, a modifier the family lacks, a base utility that flattens a state a
|
|
9
|
+
* primitive's hook covers, a raw property shadowing a utility, a
|
|
10
|
+
* whitespace form the gates cannot match, and a `data-<name>-*` attribute
|
|
11
|
+
* outside its identity. On an unlisted domain it removes itself and logs
|
|
12
|
+
* {@link DEBUG_WARNING} once. Identities and hooks are read from the page's
|
|
13
|
+
* stylesheets, so the audit needs no manifest. The checks live in
|
|
14
|
+
* `audit-core.ts`, which the html lint rules (`@zazz-ui/eslint-plugin`) share.
|
|
15
|
+
* @example
|
|
16
|
+
* <ui-debug data-debug-domains="localhost, staging.example.com"></ui-debug>
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { ZazzElement, defineZazzElement } from "../../base/zazz-element.ts";
|
|
20
|
+
import {
|
|
21
|
+
auditNode,
|
|
22
|
+
auditPersistence,
|
|
23
|
+
carriesIdentity,
|
|
24
|
+
type AuditNode,
|
|
25
|
+
type RuleId,
|
|
26
|
+
} from "./audit-core.ts";
|
|
27
|
+
|
|
28
|
+
export interface Warning {
|
|
29
|
+
el: Element;
|
|
30
|
+
message: string;
|
|
31
|
+
rule: RuleId;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface AuditOptions {
|
|
35
|
+
/** State-bearing hooks per identity as `<utility>--<state>` (`bg--hover`); default: the page's stylesheets. */
|
|
36
|
+
hooks?: Record<string, string[]>;
|
|
37
|
+
/** Identity tokens the kit declares (`button`, `field-group`); default: the page's stylesheets. */
|
|
38
|
+
identities?: string[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** A live element as the audit core reads it. */
|
|
42
|
+
function auditNodeOf(el: Element): AuditNode {
|
|
43
|
+
return {
|
|
44
|
+
getAttribute: (name) => el.getAttribute(name),
|
|
45
|
+
getAttributeNames: () => el.getAttributeNames(),
|
|
46
|
+
withinIdentity: (name, identities) => {
|
|
47
|
+
for (let node: Element | null = el; node; node = node.parentElement) {
|
|
48
|
+
if (carriesIdentity(node.tagName, node.getAttribute("data-ui"), name, identities))
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Identity tokens and state-bearing hooks, read from the page's stylesheets. */
|
|
57
|
+
function fromStylesheets(): { identities: string[]; hooks: Record<string, string[]> } {
|
|
58
|
+
const identities = new Set<string>();
|
|
59
|
+
const hooks: Record<string, string[]> = {};
|
|
60
|
+
const hookPattern =
|
|
61
|
+
/--ui-([a-z]+(?:-[a-z]+)*?)-([a-z-]+?)--(hover|active|focus-visible|focus-within|checked|open|disabled)\b/g;
|
|
62
|
+
for (const sheet of document.styleSheets) {
|
|
63
|
+
let rules: CSSRuleList;
|
|
64
|
+
try {
|
|
65
|
+
rules = sheet.cssRules;
|
|
66
|
+
} catch {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
for (const rule of rules) {
|
|
70
|
+
const text = rule.cssText;
|
|
71
|
+
for (const m of text.matchAll(/\[data-ui~="([^"]+)"\]/g)) identities.add(m[1]!);
|
|
72
|
+
for (const m of text.matchAll(hookPattern)) {
|
|
73
|
+
const list = (hooks[m[1]!] ??= []);
|
|
74
|
+
if (!list.includes(`${m[2]}--${m[3]}`)) list.push(`${m[2]}--${m[3]}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { identities: [...identities], hooks };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Audits every element under `root` (inclusive) and returns the findings. */
|
|
82
|
+
export function audit(root: Element, options: AuditOptions = {}): Warning[] {
|
|
83
|
+
const sheets = options.hooks && options.identities ? null : fromStylesheets();
|
|
84
|
+
const resolved: Required<AuditOptions> = {
|
|
85
|
+
hooks: options.hooks ?? sheets!.hooks,
|
|
86
|
+
identities: options.identities ?? sheets!.identities,
|
|
87
|
+
};
|
|
88
|
+
const context = { ...resolved, isColor: (value: string) => CSS.supports("color", value) };
|
|
89
|
+
const found: Warning[] = [];
|
|
90
|
+
for (const el of [root, ...root.querySelectorAll("*")]) {
|
|
91
|
+
if (el.tagName === "UI-DEBUG") continue;
|
|
92
|
+
for (const { message, rule } of auditNode(auditNodeOf(el), context))
|
|
93
|
+
found.push({ el, message, rule });
|
|
94
|
+
}
|
|
95
|
+
return found;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface Note {
|
|
99
|
+
message: string;
|
|
100
|
+
elements: Element[];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Calls out what survives an in-page navigation: on a `data-ui-navigation="swap"`
|
|
105
|
+
* page, which `data-ui-persist` elements are kept and which
|
|
106
|
+
* `data-ui-persist-scroll` elements carry their scroll offset; warnings for
|
|
107
|
+
* persistence that cannot work as written.
|
|
108
|
+
*/
|
|
109
|
+
export function navigationReport(doc: Document): { notes: Note[]; warnings: Warning[] } {
|
|
110
|
+
const swap = doc.documentElement.getAttribute("data-ui-navigation") === "swap";
|
|
111
|
+
const idOf = (attribute: string) => (el: Element) => el.getAttribute(attribute) ?? "";
|
|
112
|
+
const persists = idOf("data-ui-persist");
|
|
113
|
+
const owner = (el: Element | null | undefined) => (el ? { id: persists(el), self: false } : null);
|
|
114
|
+
const persisted = auditPersistence(
|
|
115
|
+
swap,
|
|
116
|
+
[...doc.querySelectorAll("[data-ui-persist]")],
|
|
117
|
+
persists,
|
|
118
|
+
(el) => owner(el.parentElement?.closest("[data-ui-persist]")),
|
|
119
|
+
);
|
|
120
|
+
const scrolled = auditPersistence(
|
|
121
|
+
swap,
|
|
122
|
+
[...doc.querySelectorAll("[data-ui-persist-scroll]")],
|
|
123
|
+
idOf("data-ui-persist-scroll"),
|
|
124
|
+
(el) =>
|
|
125
|
+
el.hasAttribute("data-ui-persist")
|
|
126
|
+
? { id: persists(el), self: true }
|
|
127
|
+
: owner(el.closest("[data-ui-persist]")),
|
|
128
|
+
"data-ui-persist-scroll",
|
|
129
|
+
);
|
|
130
|
+
const warnings = [...persisted.warnings, ...scrolled.warnings];
|
|
131
|
+
if (!swap) return { notes: [], warnings };
|
|
132
|
+
const kept = persisted.kept;
|
|
133
|
+
const ids = (els: Element[], attribute: string) =>
|
|
134
|
+
els.map((el) => `"${el.getAttribute(attribute)}"`).join(", ");
|
|
135
|
+
const one = scrolled.kept.length === 1;
|
|
136
|
+
const scroll = scrolled.kept.length
|
|
137
|
+
? ` ${scrolled.kept.length} element${one ? " comes" : "s come"} from the next page but keep${one ? "s its" : " their"} scroll offset (${ids(scrolled.kept, "data-ui-persist-scroll")}).`
|
|
138
|
+
: "";
|
|
139
|
+
const notes: Note[] = [
|
|
140
|
+
{
|
|
141
|
+
message:
|
|
142
|
+
(kept.length
|
|
143
|
+
? `In-page navigation is on. ${kept.length} element${kept.length === 1 ? " persists" : "s persist"} across navigations (${ids(kept, "data-ui-persist")}); everything else is replaced by the next page.`
|
|
144
|
+
: "In-page navigation is on, and nothing persists: every navigation replaces the whole body.") +
|
|
145
|
+
scroll,
|
|
146
|
+
elements: [...kept, ...scrolled.kept],
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
return { notes, warnings };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const DEBUG_WARNING =
|
|
153
|
+
'Style utility debug tools are still loaded in this domain, but not enabled. If this is intentional, you can ignore this warning by setting data-debug-warnings="false".';
|
|
154
|
+
|
|
155
|
+
let warnedOnce = false;
|
|
156
|
+
|
|
157
|
+
class UiDebug extends ZazzElement {
|
|
158
|
+
protected setup(signal: AbortSignal): void {
|
|
159
|
+
const domains = (this.getAttribute("data-debug-domains") ?? "")
|
|
160
|
+
.split(",")
|
|
161
|
+
.map((domain) => domain.trim())
|
|
162
|
+
.filter(Boolean);
|
|
163
|
+
if (!domains.includes(location.hostname)) {
|
|
164
|
+
if (this.getAttribute("data-debug-warnings") !== "false" && !warnedOnce) {
|
|
165
|
+
warnedOnce = true;
|
|
166
|
+
console.warn(DEBUG_WARNING);
|
|
167
|
+
}
|
|
168
|
+
this.remove();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const reported = new WeakMap<Element, Set<string>>();
|
|
172
|
+
const navigation = navigationReport(document);
|
|
173
|
+
for (const { message, elements } of navigation.notes)
|
|
174
|
+
console.info(`[ui-debug] ${message}`, ...elements);
|
|
175
|
+
const report = () => {
|
|
176
|
+
for (const { el, message } of [
|
|
177
|
+
...audit(document.body),
|
|
178
|
+
...navigationReport(document).warnings,
|
|
179
|
+
]) {
|
|
180
|
+
const seen = reported.get(el) ?? new Set<string>();
|
|
181
|
+
if (seen.has(message)) continue;
|
|
182
|
+
seen.add(message);
|
|
183
|
+
reported.set(el, seen);
|
|
184
|
+
console.warn(`[ui-debug] ${message}`, el);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
let frame = 0;
|
|
188
|
+
const observer = new MutationObserver(() => {
|
|
189
|
+
if (frame) return;
|
|
190
|
+
frame = requestAnimationFrame(() => {
|
|
191
|
+
frame = 0;
|
|
192
|
+
report();
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
observer.observe(document.body, {
|
|
196
|
+
attributes: true,
|
|
197
|
+
attributeFilter: ["style", "data-ui"],
|
|
198
|
+
childList: true,
|
|
199
|
+
subtree: true,
|
|
200
|
+
});
|
|
201
|
+
signal.addEventListener("abort", () => {
|
|
202
|
+
observer.disconnect();
|
|
203
|
+
if (frame) cancelAnimationFrame(frame);
|
|
204
|
+
});
|
|
205
|
+
report();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
defineZazzElement("ui-debug", UiDebug);
|
|
210
|
+
|
|
211
|
+
export { UiDebug };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<button
|
|
1
|
+
<button data-ui="button" type="button" command="show-modal" commandfor="form-dialog-1">
|
|
2
2
|
New project
|
|
3
3
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
4
4
|
<rect width="256" height="256" fill="none" />
|
|
@@ -26,22 +26,44 @@
|
|
|
26
26
|
/>
|
|
27
27
|
</svg>
|
|
28
28
|
</button>
|
|
29
|
-
<dialog id="form-dialog-1"
|
|
30
|
-
<div data-slot="
|
|
31
|
-
<header data-slot="
|
|
32
|
-
<h2
|
|
33
|
-
|
|
29
|
+
<dialog id="form-dialog-1" data-ui="dialog" closedby="any" data-dialog-size="article">
|
|
30
|
+
<div data-dialog-slot="content">
|
|
31
|
+
<header data-dialog-slot="header">
|
|
32
|
+
<h2
|
|
33
|
+
style="
|
|
34
|
+
--font-size: var(--font-size-lg);
|
|
35
|
+
--font-weight: strong;
|
|
36
|
+
--font-family: var(--font-family-heading);
|
|
37
|
+
"
|
|
38
|
+
>
|
|
39
|
+
New project
|
|
40
|
+
</h2>
|
|
41
|
+
<p style="--text: var(--color-muted-foreground)">
|
|
34
42
|
Add a project to your workspace. You can change these settings later.
|
|
35
43
|
</p>
|
|
36
44
|
</header>
|
|
37
|
-
<form
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
<form
|
|
46
|
+
id="f-new-project-1"
|
|
47
|
+
style="
|
|
48
|
+
--display: flex-col;
|
|
49
|
+
--gap: 6;
|
|
50
|
+
"
|
|
51
|
+
data-dialog-slot="body"
|
|
52
|
+
method="dialog"
|
|
53
|
+
>
|
|
54
|
+
<fieldset data-ui="field-group">
|
|
55
|
+
<legend data-ui="sr-only">Contact</legend>
|
|
56
|
+
<div
|
|
57
|
+
style="
|
|
58
|
+
--display: grid;
|
|
59
|
+
--grid-cols: 2;
|
|
60
|
+
--gap: 4;
|
|
61
|
+
"
|
|
62
|
+
>
|
|
63
|
+
<div data-ui="field">
|
|
64
|
+
<label data-field-slot="label" for="fd-name">Name</label>
|
|
43
65
|
<input
|
|
44
|
-
|
|
66
|
+
data-ui="input"
|
|
45
67
|
id="fd-name"
|
|
46
68
|
name="name"
|
|
47
69
|
type="text"
|
|
@@ -50,10 +72,10 @@
|
|
|
50
72
|
required
|
|
51
73
|
/>
|
|
52
74
|
</div>
|
|
53
|
-
<div
|
|
54
|
-
<label data-slot="
|
|
75
|
+
<div data-ui="field">
|
|
76
|
+
<label data-field-slot="label" for="fd-email">Email</label>
|
|
55
77
|
<input
|
|
56
|
-
|
|
78
|
+
data-ui="input"
|
|
57
79
|
id="fd-email"
|
|
58
80
|
name="email"
|
|
59
81
|
type="email"
|
|
@@ -63,25 +85,25 @@
|
|
|
63
85
|
autocomplete="email"
|
|
64
86
|
aria-describedby="fd-email-hint"
|
|
65
87
|
/>
|
|
66
|
-
<div data-slot="
|
|
67
|
-
<span data-slot="
|
|
88
|
+
<div data-field-slot="description">
|
|
89
|
+
<span data-field-slot="hint" id="fd-email-hint"
|
|
68
90
|
>We'll only use this to send receipts.</span
|
|
69
91
|
>
|
|
70
|
-
<span data-slot="
|
|
92
|
+
<span data-field-slot="error" role="alert">Please enter a valid email address.</span>
|
|
71
93
|
</div>
|
|
72
94
|
</div>
|
|
73
|
-
<label
|
|
74
|
-
<span data-slot="
|
|
75
|
-
<div
|
|
95
|
+
<label data-ui="field" style="--col-span: 2">
|
|
96
|
+
<span data-field-slot="label">Repository</span>
|
|
97
|
+
<div data-ui="input-group">
|
|
76
98
|
<input
|
|
77
|
-
|
|
99
|
+
data-ui="input"
|
|
78
100
|
type="search"
|
|
79
101
|
name="repo"
|
|
80
102
|
id="fd-repo"
|
|
81
103
|
inputmode="search"
|
|
82
104
|
placeholder="Search repositories…"
|
|
83
105
|
/>
|
|
84
|
-
<span data-
|
|
106
|
+
<span data-input-group-slot="addon">
|
|
85
107
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
86
108
|
<rect width="256" height="256" fill="none" />
|
|
87
109
|
<circle
|
|
@@ -112,11 +134,11 @@
|
|
|
112
134
|
</div>
|
|
113
135
|
</fieldset>
|
|
114
136
|
|
|
115
|
-
<fieldset
|
|
116
|
-
<div
|
|
117
|
-
<label data-slot="
|
|
137
|
+
<fieldset data-ui="field-group">
|
|
138
|
+
<div data-ui="field">
|
|
139
|
+
<label data-field-slot="label" for="fd-message">Description</label>
|
|
118
140
|
<textarea
|
|
119
|
-
|
|
141
|
+
data-ui="textarea"
|
|
120
142
|
id="fd-message"
|
|
121
143
|
name="description"
|
|
122
144
|
inputmode="text"
|
|
@@ -125,26 +147,26 @@
|
|
|
125
147
|
</div>
|
|
126
148
|
</fieldset>
|
|
127
149
|
|
|
128
|
-
<fieldset
|
|
150
|
+
<fieldset data-ui="radio-group">
|
|
129
151
|
<legend>Billing</legend>
|
|
130
|
-
<label
|
|
131
|
-
<input
|
|
132
|
-
<span data-slot="
|
|
152
|
+
<label data-ui="field" data-field-orientation="horizontal">
|
|
153
|
+
<input data-ui="radio" type="radio" name="billing" value="monthly" />
|
|
154
|
+
<span data-field-slot="label">Monthly billing</span>
|
|
133
155
|
</label>
|
|
134
|
-
<label
|
|
135
|
-
<input
|
|
136
|
-
<span data-slot="
|
|
156
|
+
<label data-ui="field" data-field-orientation="horizontal">
|
|
157
|
+
<input data-ui="radio" type="radio" name="billing" value="annual" checked />
|
|
158
|
+
<span data-field-slot="label">Annual billing</span>
|
|
137
159
|
</label>
|
|
138
160
|
</fieldset>
|
|
139
161
|
|
|
140
|
-
<label
|
|
162
|
+
<label data-ui="field" data-field-orientation="horizontal">
|
|
141
163
|
<input type="checkbox" name="terms" required />
|
|
142
|
-
<span data-slot="
|
|
164
|
+
<span data-field-slot="label">Accept terms & conditions</span>
|
|
143
165
|
</label>
|
|
144
166
|
</form>
|
|
145
|
-
<footer data-slot="
|
|
167
|
+
<footer data-dialog-slot="footer">
|
|
146
168
|
<button
|
|
147
|
-
|
|
169
|
+
data-ui="button"
|
|
148
170
|
type="button"
|
|
149
171
|
value="cancel"
|
|
150
172
|
commandfor="form-dialog-1"
|
|
@@ -153,8 +175,8 @@
|
|
|
153
175
|
Cancel
|
|
154
176
|
</button>
|
|
155
177
|
<button
|
|
156
|
-
|
|
157
|
-
data-variant="primary"
|
|
178
|
+
data-ui="button"
|
|
179
|
+
data-button-variant="primary"
|
|
158
180
|
type="submit"
|
|
159
181
|
form="f-new-project-1"
|
|
160
182
|
value="save"
|
|
@@ -163,10 +185,10 @@
|
|
|
163
185
|
</button>
|
|
164
186
|
</footer>
|
|
165
187
|
<button
|
|
166
|
-
|
|
167
|
-
data-slot="
|
|
168
|
-
data-size="icon"
|
|
169
|
-
data-variant="ghost"
|
|
188
|
+
data-ui="button"
|
|
189
|
+
data-dialog-slot="close"
|
|
190
|
+
data-button-size="icon"
|
|
191
|
+
data-button-variant="ghost"
|
|
170
192
|
type="button"
|
|
171
193
|
commandfor="form-dialog-1"
|
|
172
194
|
command="close"
|