@zazz-ui/core 0.1.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/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/sri.json +75 -0
- package/dist/zazz.css +1 -0
- package/dist/zazz.js +1 -0
- package/examples/about.html +590 -0
- package/examples/components.html +1040 -0
- package/examples/forms.html +511 -0
- package/examples/index.html +268 -0
- package/examples/layout.html +320 -0
- package/examples/products.html +846 -0
- package/examples/responsive.html +339 -0
- package/package.json +85 -0
- package/src/base/_layers.css +12 -0
- package/src/base/_layout.css +568 -0
- package/src/base/_reset.css +515 -0
- package/src/base/_typography.css +495 -0
- package/src/base/_utilities.css +6628 -0
- package/src/base/_variables.css +682 -0
- package/src/base/_view-transitions.css +103 -0
- package/src/base/command-score.d.ts +12 -0
- package/src/base/command-score.d.ts.map +1 -0
- package/src/base/command-score.js +151 -0
- package/src/base/command-score.ts +192 -0
- package/src/base/dialog-lifecycle.d.ts +11 -0
- package/src/base/dialog-lifecycle.d.ts.map +1 -0
- package/src/base/dialog-lifecycle.js +65 -0
- package/src/base/dialog-lifecycle.ts +80 -0
- package/src/base/embla.d.ts +90 -0
- package/src/base/embla.d.ts.map +1 -0
- package/src/base/embla.js +643 -0
- package/src/base/embla.ts +791 -0
- package/src/base/hotkeys.d.ts +82 -0
- package/src/base/hotkeys.d.ts.map +1 -0
- package/src/base/hotkeys.js +141 -0
- package/src/base/hotkeys.ts +195 -0
- package/src/base/navigation.d.ts +2 -0
- package/src/base/navigation.d.ts.map +1 -0
- package/src/base/navigation.js +136 -0
- package/src/base/navigation.ts +151 -0
- package/src/base/reveal.d.ts +80 -0
- package/src/base/reveal.d.ts.map +1 -0
- package/src/base/reveal.js +305 -0
- package/src/base/reveal.ts +379 -0
- package/src/base/signals.d.ts +89 -0
- package/src/base/signals.d.ts.map +1 -0
- package/src/base/signals.js +134 -0
- package/src/base/signals.ts +164 -0
- package/src/base/typeahead.d.ts +105 -0
- package/src/base/typeahead.d.ts.map +1 -0
- package/src/base/typeahead.js +411 -0
- package/src/base/typeahead.ts +500 -0
- package/src/base/utils.d.ts +56 -0
- package/src/base/utils.d.ts.map +1 -0
- package/src/base/utils.js +88 -0
- package/src/base/utils.ts +98 -0
- package/src/base/zazz-element.d.ts +44 -0
- package/src/base/zazz-element.d.ts.map +1 -0
- package/src/base/zazz-element.js +59 -0
- package/src/base/zazz-element.ts +73 -0
- package/src/globals.d.ts +148 -0
- package/src/head.d.ts +95 -0
- package/src/head.d.ts.map +1 -0
- package/src/head.js +311 -0
- package/src/head.ts +433 -0
- package/src/index.css +71 -0
- package/src/index.d.ts +36 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +35 -0
- package/src/index.ts +36 -0
- package/src/manifest.d.ts +90 -0
- package/src/manifest.d.ts.map +1 -0
- package/src/manifest.js +614 -0
- package/src/manifest.ts +667 -0
- package/src/primitives/accordion/accordion.css +104 -0
- package/src/primitives/accordion/accordion.html +69 -0
- package/src/primitives/alert-dialog/alert-dialog.css +38 -0
- package/src/primitives/alert-dialog/alert-dialog.html +53 -0
- package/src/primitives/autocomplete/autocomplete-groups.html +77 -0
- package/src/primitives/autocomplete/autocomplete.css +114 -0
- package/src/primitives/autocomplete/autocomplete.d.ts +30 -0
- package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -0
- package/src/primitives/autocomplete/autocomplete.html +66 -0
- package/src/primitives/autocomplete/autocomplete.js +41 -0
- package/src/primitives/autocomplete/autocomplete.ts +46 -0
- package/src/primitives/avatar/avatar.html +44 -0
- package/src/primitives/badge/badge-icon.html +36 -0
- package/src/primitives/badge/badge.css +251 -0
- package/src/primitives/badge/badge.html +7 -0
- package/src/primitives/breadcrumbs/breadcrumbs.html +9 -0
- package/src/primitives/button/button-icon-only.html +84 -0
- package/src/primitives/button/button-icon.html +82 -0
- package/src/primitives/button/button.css +319 -0
- package/src/primitives/button/button.html +8 -0
- package/src/primitives/button-group/button-group-vertical.html +6 -0
- package/src/primitives/button-group/button-group.css +94 -0
- package/src/primitives/button-group/button-group.html +64 -0
- package/src/primitives/card/card-subgrid.html +118 -0
- package/src/primitives/card/card.html +53 -0
- package/src/primitives/carousel/carousel.css +61 -0
- package/src/primitives/carousel/carousel.d.ts +16 -0
- package/src/primitives/carousel/carousel.d.ts.map +1 -0
- package/src/primitives/carousel/carousel.html +315 -0
- package/src/primitives/carousel/carousel.js +73 -0
- package/src/primitives/carousel/carousel.ts +84 -0
- package/src/primitives/checkbox/checkbox-tasklist.html +71 -0
- package/src/primitives/checkbox/checkbox.css +82 -0
- package/src/primitives/checkbox/checkbox.d.ts +21 -0
- package/src/primitives/checkbox/checkbox.d.ts.map +1 -0
- package/src/primitives/checkbox/checkbox.html +17 -0
- package/src/primitives/checkbox/checkbox.js +190 -0
- package/src/primitives/checkbox/checkbox.ts +219 -0
- package/src/primitives/combobox/combobox-multiselect.html +91 -0
- package/src/primitives/combobox/combobox.css +307 -0
- package/src/primitives/combobox/combobox.d.ts +100 -0
- package/src/primitives/combobox/combobox.d.ts.map +1 -0
- package/src/primitives/combobox/combobox.html +73 -0
- package/src/primitives/combobox/combobox.js +503 -0
- package/src/primitives/combobox/combobox.ts +559 -0
- package/src/primitives/command/command-actions.d.ts +31 -0
- package/src/primitives/command/command-actions.d.ts.map +1 -0
- package/src/primitives/command/command-actions.html +89 -0
- package/src/primitives/command/command-actions.js +70 -0
- package/src/primitives/command/command-actions.ts +77 -0
- package/src/primitives/command/command-dialog.html +77 -0
- package/src/primitives/command/command.css +151 -0
- package/src/primitives/command/command.d.ts +52 -0
- package/src/primitives/command/command.d.ts.map +1 -0
- package/src/primitives/command/command.html +119 -0
- package/src/primitives/command/command.js +146 -0
- package/src/primitives/command/command.ts +157 -0
- package/src/primitives/dialog/dialog-with-form.html +200 -0
- package/src/primitives/dialog/dialog.css +229 -0
- package/src/primitives/dialog/dialog.html +90 -0
- package/src/primitives/fields/fields.css +278 -0
- package/src/primitives/input/input-icon-leading.html +19 -0
- package/src/primitives/input/input-icon-trailing.html +18 -0
- package/src/primitives/input/input.css +114 -0
- package/src/primitives/input/input.html +61 -0
- package/src/primitives/input-group/input-group-password-group.html +108 -0
- package/src/primitives/input-group/input-group.css +215 -0
- package/src/primitives/input-group/input-group.html +132 -0
- package/src/primitives/kbd/kbd-group.html +18 -0
- package/src/primitives/kbd/kbd.css +87 -0
- package/src/primitives/kbd/kbd.html +7 -0
- package/src/primitives/lightbox/lightbox.css +459 -0
- package/src/primitives/lightbox/lightbox.d.ts +7 -0
- package/src/primitives/lightbox/lightbox.d.ts.map +1 -0
- package/src/primitives/lightbox/lightbox.html +665 -0
- package/src/primitives/lightbox/lightbox.js +96 -0
- package/src/primitives/lightbox/lightbox.ts +113 -0
- package/src/primitives/menu/menu-interest.html +52 -0
- package/src/primitives/menu/menu.css +55 -0
- package/src/primitives/menu/menu.d.ts +38 -0
- package/src/primitives/menu/menu.d.ts.map +1 -0
- package/src/primitives/menu/menu.html +70 -0
- package/src/primitives/menu/menu.js +117 -0
- package/src/primitives/menu/menu.ts +131 -0
- package/src/primitives/menubar/menubar-help-search.html +103 -0
- package/src/primitives/menubar/menubar.html +166 -0
- package/src/primitives/meter/meter.css +178 -0
- package/src/primitives/meter/meter.html +38 -0
- package/src/primitives/mobile-menu/mobile-menu.css +145 -0
- package/src/primitives/mobile-menu/mobile-menu.html +614 -0
- package/src/primitives/navigation-menu/navigation-menu-featured.html +76 -0
- package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +158 -0
- package/src/primitives/navigation-menu/navigation-menu-interest.html +103 -0
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +141 -0
- package/src/primitives/navigation-menu/navigation-menu-simple.html +96 -0
- package/src/primitives/navigation-menu/navigation-menu.css +295 -0
- package/src/primitives/navigation-menu/navigation-menu.html +576 -0
- package/src/primitives/otp/otp.css +126 -0
- package/src/primitives/otp/otp.d.ts +89 -0
- package/src/primitives/otp/otp.d.ts.map +1 -0
- package/src/primitives/otp/otp.html +22 -0
- package/src/primitives/otp/otp.js +226 -0
- package/src/primitives/otp/otp.ts +279 -0
- package/src/primitives/password-group/password-group.css +238 -0
- package/src/primitives/password-group/password-group.d.ts +25 -0
- package/src/primitives/password-group/password-group.d.ts.map +1 -0
- package/src/primitives/password-group/password-group.html +109 -0
- package/src/primitives/password-group/password-group.js +76 -0
- package/src/primitives/password-group/password-group.ts +95 -0
- package/src/primitives/popover/popover.css +233 -0
- package/src/primitives/progress/progress-indeterminate.html +1 -0
- package/src/primitives/progress/progress.css +105 -0
- package/src/primitives/progress/progress.html +7 -0
- package/src/primitives/prose/prose.html +65 -0
- package/src/primitives/radio/radio.css +84 -0
- package/src/primitives/radio/radio.html +17 -0
- package/src/primitives/reveal/reveal.css +167 -0
- package/src/primitives/select/multiselect.d.ts +43 -0
- package/src/primitives/select/multiselect.d.ts.map +1 -0
- package/src/primitives/select/multiselect.js +147 -0
- package/src/primitives/select/multiselect.ts +188 -0
- package/src/primitives/select/select-align.html +49 -0
- package/src/primitives/select/select-multiple.html +12 -0
- package/src/primitives/select/select-sides.html +65 -0
- package/src/primitives/select/select.css +481 -0
- package/src/primitives/select/select.html +16 -0
- package/src/primitives/separator/separator.css +49 -0
- package/src/primitives/separator/separator.html +16 -0
- package/src/primitives/slider/slider.css +122 -0
- package/src/primitives/slider/slider.html +1 -0
- package/src/primitives/switch/switch.css +126 -0
- package/src/primitives/switch/switch.html +13 -0
- package/src/primitives/table/table-alternating.html +36 -0
- package/src/primitives/table/table-grid.html +30 -0
- package/src/primitives/table/table-size-sm.html +26 -0
- package/src/primitives/table/table.css +158 -0
- package/src/primitives/table/table.html +45 -0
- package/src/primitives/tabs/tabs.css +328 -0
- package/src/primitives/tabs/tabs.d.ts +35 -0
- package/src/primitives/tabs/tabs.d.ts.map +1 -0
- package/src/primitives/tabs/tabs.html +75 -0
- package/src/primitives/tabs/tabs.js +84 -0
- package/src/primitives/tabs/tabs.ts +93 -0
- package/src/primitives/textarea/textarea.css +78 -0
- package/src/primitives/textarea/textarea.html +10 -0
- package/src/primitives/toaster/toaster.css +309 -0
- package/src/primitives/toaster/toaster.d.ts +138 -0
- package/src/primitives/toaster/toaster.d.ts.map +1 -0
- package/src/primitives/toaster/toaster.html +77 -0
- package/src/primitives/toaster/toaster.js +736 -0
- package/src/primitives/toaster/toaster.ts +823 -0
- package/src/primitives/toggle/toggle.css +295 -0
- package/src/primitives/toggle/toggle.html +68 -0
- package/src/primitives/toggle-group/toggle-group-multiple.html +14 -0
- package/src/primitives/toggle-group/toggle-group-vertical.html +14 -0
- package/src/primitives/toggle-group/toggle-group.css +73 -0
- package/src/primitives/toggle-group/toggle-group.html +53 -0
- package/src/primitives/toolbar/toolbar.html +45 -0
- package/src/primitives/tooltip/tooltip-disabled.html +19 -0
- package/src/primitives/tooltip/tooltip-sides.html +57 -0
- package/src/primitives/tooltip/tooltip-with-kbd.html +31 -0
- package/src/primitives/tooltip/tooltip.css +235 -0
- package/src/primitives/tooltip/tooltip.html +12 -0
- package/src/primitives/utilities/aspect-ratio.html +17 -0
- package/src/primitives/utilities/basis.html +27 -0
- package/src/primitives/utilities/col-span.html +23 -0
- package/src/primitives/utilities/compose.html +19 -0
- package/src/primitives/utilities/flex-align.html +26 -0
- package/src/primitives/utilities/flex-direction.html +36 -0
- package/src/primitives/utilities/flex-grow.html +17 -0
- package/src/primitives/utilities/gap.html +62 -0
- package/src/primitives/utilities/grid-cols.html +20 -0
- package/src/primitives/utilities/grid-pile.html +5 -0
- package/src/primitives/utilities/grid-responsive.html +31 -0
- package/src/primitives/utilities/margin-auto.html +13 -0
- package/src/primitives/utilities/object-fit.html +41 -0
- package/src/primitives/utilities/order.html +17 -0
- package/src/primitives/utilities/overflow.html +26 -0
- package/src/primitives/utilities/padding-compose.html +23 -0
- package/src/primitives/utilities/padding.html +30 -0
- package/src/primitives/utilities/position.html +13 -0
- package/src/primitives/utilities/responsive-flex.html +22 -0
- package/src/primitives/utilities/responsive-grid.html +31 -0
- package/src/primitives/utilities/size.html +22 -0
- package/src/primitives/utilities/width.html +22 -0
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<!-- Page-specific tags stay above the generated block -->
|
|
5
|
+
<title>Zazz tests | Overview</title>
|
|
6
|
+
<link rel="prefetch" href="layout.html" />
|
|
7
|
+
|
|
8
|
+
<!-- Shared head, generated from @zazz-ui/core's head contract (src/head.ts). -->
|
|
9
|
+
<!-- Edit nothing between the markers; run `vp run heads` to regenerate. -->
|
|
10
|
+
<!-- zazz:head -->
|
|
11
|
+
<meta charset="utf-8" />
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
13
|
+
<!-- Paint the right theme (background, form controls, scrollbars) before CSS loads -->
|
|
14
|
+
<meta name="color-scheme" content="light dark" />
|
|
15
|
+
<!-- Google Fonts: Geist + Geist Mono (preconnect so the CSS request starts early) -->
|
|
16
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
17
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
18
|
+
<link
|
|
19
|
+
rel="preload"
|
|
20
|
+
as="font"
|
|
21
|
+
type="font/woff2"
|
|
22
|
+
crossorigin
|
|
23
|
+
href="https://fonts.gstatic.com/s/geist/v5/gyByhwUxId8gMEwcGFWNOITd.woff2"
|
|
24
|
+
/>
|
|
25
|
+
<link
|
|
26
|
+
href="https://fonts.googleapis.com/css2?family=Geist+Mono:ital,wght@0,100..900;1,100..900&family=Geist:ital,wght@0,100..900;1,100..900&display=swap"
|
|
27
|
+
rel="stylesheet"
|
|
28
|
+
/>
|
|
29
|
+
<!-- Zazz styles: one bundle (index.css @imports every layer in cascade order) -->
|
|
30
|
+
<link rel="stylesheet" href="../src/index.css" />
|
|
31
|
+
<!-- Import map: bare specifiers in Zazz scripts resolve to pinned, SRI-checked files -->
|
|
32
|
+
<script type="importmap">
|
|
33
|
+
{
|
|
34
|
+
"imports": {
|
|
35
|
+
"signal-polyfill": "https://cdn.jsdelivr.net/npm/signal-polyfill@0.2.2/dist/index.js",
|
|
36
|
+
"embla-carousel": "https://cdn.jsdelivr.net/npm/embla-carousel@8.6.0/esm/embla-carousel.esm.js",
|
|
37
|
+
"embla-carousel-autoplay": "https://cdn.jsdelivr.net/npm/embla-carousel-autoplay@8.6.0/esm/embla-carousel-autoplay.esm.js",
|
|
38
|
+
"embla-carousel-auto-scroll": "https://cdn.jsdelivr.net/npm/embla-carousel-auto-scroll@8.6.0/esm/embla-carousel-auto-scroll.esm.js",
|
|
39
|
+
"embla-carousel-class-names": "https://cdn.jsdelivr.net/npm/embla-carousel-class-names@8.6.0/esm/embla-carousel-class-names.esm.js"
|
|
40
|
+
},
|
|
41
|
+
"integrity": {
|
|
42
|
+
"https://cdn.jsdelivr.net/npm/signal-polyfill@0.2.2/dist/index.js": "sha384-0OqM7OXGT6Oz1z98u/geiFn/FUyz4iWexkXHCvbIGXRRDXl6bp6IKc0j78AQ6DEK",
|
|
43
|
+
"https://cdn.jsdelivr.net/npm/embla-carousel@8.6.0/esm/embla-carousel.esm.js": "sha384-GXjfyU1fSHHeweoYd3rwo7OBKYtkq+JcsDoe8VDRc6znCty2ZTzyVvX1DwqCE+9t",
|
|
44
|
+
"https://cdn.jsdelivr.net/npm/embla-carousel-autoplay@8.6.0/esm/embla-carousel-autoplay.esm.js": "sha384-AX49yBc7zd/CT8ZqNMRiiqqVSV9xfxb27VwEGziPioT3wL4k4C5BW2qwefdWuN4J",
|
|
45
|
+
"https://cdn.jsdelivr.net/npm/embla-carousel-auto-scroll@8.6.0/esm/embla-carousel-auto-scroll.esm.js": "sha384-SPdnL1eic73WfM72zFEf0RJ5PdUC7TL3Yb5jOl1JC3/l4D7EsVxwO8wFnnezlMSu",
|
|
46
|
+
"https://cdn.jsdelivr.net/npm/embla-carousel-class-names@8.6.0/esm/embla-carousel-class-names.esm.js": "sha384-ZWno/FqzYeWE5Ils19GIhep1AZ5bMl0mp9wmm6baTJE4+pjMjOdTnE55SjUQAdVh"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
<link rel="modulepreload" href="../src/index.js" />
|
|
51
|
+
<!-- Polyfills: Popover API + Invoker Commands (command/commandfor) -->
|
|
52
|
+
<script
|
|
53
|
+
src="https://cdn.jsdelivr.net/npm/@oddbird/popover-polyfill@0.7.2/dist/popover.min.js"
|
|
54
|
+
integrity="sha384-pOVHoXRgxuaWHCRM4KSyfyfRTmdxgjVo1Ux78ZKJ+GjUz4zIzXiTa8XXuDF1R1Sd"
|
|
55
|
+
crossorigin="anonymous"
|
|
56
|
+
defer
|
|
57
|
+
></script>
|
|
58
|
+
<script
|
|
59
|
+
type="module"
|
|
60
|
+
src="https://cdn.jsdelivr.net/npm/invokers@2.2.2/dist/esm/production/compatible.js"
|
|
61
|
+
integrity="sha384-7vRXDaS2mcW7LheGSA/rxBwIQNEqmWj0OLEOta/+mvw+9Uf5w1vplA5qg8kLQ99u"
|
|
62
|
+
crossorigin="anonymous"
|
|
63
|
+
defer
|
|
64
|
+
></script>
|
|
65
|
+
<!-- Zazz behavior: one ES module imports every component script in dependency order -->
|
|
66
|
+
<script type="module" src="../src/index.js"></script>
|
|
67
|
+
<!-- Theme: apply the persisted (or preferred) scheme before first paint -->
|
|
68
|
+
<script>
|
|
69
|
+
(() => {
|
|
70
|
+
try {
|
|
71
|
+
const storedTheme = localStorage.getItem("theme");
|
|
72
|
+
const prefersDark = matchMedia("(prefers-color-scheme: dark)").matches;
|
|
73
|
+
const theme = storedTheme ?? (prefersDark ? "dark" : "light");
|
|
74
|
+
document.documentElement.classList.toggle("dark", theme === "dark");
|
|
75
|
+
} catch {
|
|
76
|
+
document.documentElement.classList.toggle(
|
|
77
|
+
"dark",
|
|
78
|
+
matchMedia("(prefers-color-scheme: dark)").matches,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
})();
|
|
82
|
+
</script>
|
|
83
|
+
<!-- /zazz:head -->
|
|
84
|
+
</head>
|
|
85
|
+
|
|
86
|
+
<body class="bg-background">
|
|
87
|
+
<header class="py-md border-b" data-transition-layer="global-header">
|
|
88
|
+
<div class="container">
|
|
89
|
+
<div class="flex items-center justify-between">
|
|
90
|
+
<a href="index.html" class="text-h6 font-black">Zazz tests</a>
|
|
91
|
+
<nav>
|
|
92
|
+
<menu class="flex gap-xs">
|
|
93
|
+
<li>
|
|
94
|
+
<a class="ui-button" data-variant="ghost" data-size="sm" href="index.html"
|
|
95
|
+
>Overview</a
|
|
96
|
+
>
|
|
97
|
+
</li>
|
|
98
|
+
<li>
|
|
99
|
+
<a class="ui-button" data-variant="ghost" data-size="sm" href="about.html">About</a>
|
|
100
|
+
</li>
|
|
101
|
+
<li>
|
|
102
|
+
<a class="ui-button" data-variant="ghost" data-size="sm" href="products.html"
|
|
103
|
+
>Products</a
|
|
104
|
+
>
|
|
105
|
+
</li>
|
|
106
|
+
<li>
|
|
107
|
+
<a class="ui-button" data-variant="ghost" data-size="sm" href="layout.html"
|
|
108
|
+
>Layout</a
|
|
109
|
+
>
|
|
110
|
+
</li>
|
|
111
|
+
<li>
|
|
112
|
+
<a class="ui-button" data-variant="ghost" data-size="sm" href="responsive.html"
|
|
113
|
+
>Responsive</a
|
|
114
|
+
>
|
|
115
|
+
</li>
|
|
116
|
+
<li>
|
|
117
|
+
<a class="ui-button" data-variant="ghost" data-size="sm" href="components.html"
|
|
118
|
+
>Components</a
|
|
119
|
+
>
|
|
120
|
+
</li>
|
|
121
|
+
<li>
|
|
122
|
+
<a class="ui-button" data-variant="ghost" data-size="sm" href="forms.html">Forms</a>
|
|
123
|
+
</li>
|
|
124
|
+
</menu>
|
|
125
|
+
</nav>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</header>
|
|
129
|
+
|
|
130
|
+
<main data-layout="main">
|
|
131
|
+
<section class="py-xl">
|
|
132
|
+
<div class="container" data-container="md">
|
|
133
|
+
<hgroup class="flex flex-col gap-sm pb-md">
|
|
134
|
+
<span class="text-eyebrow">Forms</span>
|
|
135
|
+
<h1 class="text-h1">Fields and validation</h1>
|
|
136
|
+
<p class="text-lg text-muted-foreground">
|
|
137
|
+
Every control shares the <code>--ui-field-*</code> tokens and the
|
|
138
|
+
<code>.ui-field</code> layout. Validation surfaces through <code>:user-invalid</code>,
|
|
139
|
+
so errors appear only after you blur or submit. This form sits in the md band and
|
|
140
|
+
collapses to one column below md.
|
|
141
|
+
</p>
|
|
142
|
+
</hgroup>
|
|
143
|
+
|
|
144
|
+
<form class="grid gap-lg">
|
|
145
|
+
<div class="grid grid-cols-3 grid-flow-row gap-md">
|
|
146
|
+
<!-- Column one: text inputs, select, textarea -->
|
|
147
|
+
<div class="flex flex-col gap-md">
|
|
148
|
+
<div class="ui-field">
|
|
149
|
+
<label data-slot="field-label" for="f-name">Name</label>
|
|
150
|
+
<input
|
|
151
|
+
class="ui-input"
|
|
152
|
+
id="f-name"
|
|
153
|
+
name="name"
|
|
154
|
+
type="text"
|
|
155
|
+
inputmode="text"
|
|
156
|
+
placeholder="Ada Lovelace"
|
|
157
|
+
autocomplete="name"
|
|
158
|
+
autocapitalize="words"
|
|
159
|
+
enterkeyhint="next"
|
|
160
|
+
/>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div class="ui-field">
|
|
164
|
+
<label data-slot="field-label" for="f-email">Email</label>
|
|
165
|
+
<input
|
|
166
|
+
class="ui-input"
|
|
167
|
+
id="f-email"
|
|
168
|
+
name="email"
|
|
169
|
+
type="email"
|
|
170
|
+
inputmode="email"
|
|
171
|
+
required
|
|
172
|
+
placeholder="you@example.com"
|
|
173
|
+
autocomplete="email"
|
|
174
|
+
autocapitalize="off"
|
|
175
|
+
spellcheck="false"
|
|
176
|
+
enterkeyhint="next"
|
|
177
|
+
aria-describedby="f-email-hint"
|
|
178
|
+
/>
|
|
179
|
+
<div data-slot="field-description">
|
|
180
|
+
<span data-slot="field-hint" id="f-email-hint"
|
|
181
|
+
>We'll never sell or share your email address.</span
|
|
182
|
+
>
|
|
183
|
+
<span data-slot="field-error" role="alert"
|
|
184
|
+
>Please enter a valid email address.</span
|
|
185
|
+
>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<div class="ui-field">
|
|
190
|
+
<label data-slot="field-label" for="f-phone">Phone</label>
|
|
191
|
+
<input
|
|
192
|
+
class="ui-input"
|
|
193
|
+
id="f-phone"
|
|
194
|
+
name="phone"
|
|
195
|
+
type="tel"
|
|
196
|
+
inputmode="tel"
|
|
197
|
+
placeholder="+1 (555) 012-3456"
|
|
198
|
+
autocomplete="tel"
|
|
199
|
+
enterkeyhint="next"
|
|
200
|
+
/>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div class="ui-field">
|
|
204
|
+
<label data-slot="field-label" for="f-sort">Sort by</label>
|
|
205
|
+
<select class="ui-select" id="f-sort" name="sort">
|
|
206
|
+
<button>
|
|
207
|
+
<selectedcontent></selectedcontent>
|
|
208
|
+
</button>
|
|
209
|
+
<optgroup class="grid gap-px" label="Sort by">
|
|
210
|
+
<legend class="text-eyebrow text-muted-foreground p-xs">Sort by</legend>
|
|
211
|
+
<option value="recent" selected>Most recent</option>
|
|
212
|
+
<option value="popular">Most popular</option>
|
|
213
|
+
<option value="price-asc">Price: low to high</option>
|
|
214
|
+
<option value="price-desc">Price: high to low</option>
|
|
215
|
+
</optgroup>
|
|
216
|
+
</select>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<div class="ui-field">
|
|
220
|
+
<label data-slot="field-label" for="f-message">Message</label>
|
|
221
|
+
<textarea
|
|
222
|
+
class="ui-textarea"
|
|
223
|
+
id="f-message"
|
|
224
|
+
name="message"
|
|
225
|
+
inputmode="text"
|
|
226
|
+
placeholder="Your message"
|
|
227
|
+
></textarea>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<!-- Column two: input groups, password, choice groups, slider -->
|
|
232
|
+
<div class="flex flex-col gap-md">
|
|
233
|
+
<div class="ui-field">
|
|
234
|
+
<label data-slot="field-label" for="f-search">Search</label>
|
|
235
|
+
<label class="ui-input-group">
|
|
236
|
+
<input
|
|
237
|
+
class="ui-input"
|
|
238
|
+
id="f-search"
|
|
239
|
+
type="search"
|
|
240
|
+
name="q"
|
|
241
|
+
inputmode="search"
|
|
242
|
+
placeholder="Search…"
|
|
243
|
+
autocomplete="off"
|
|
244
|
+
spellcheck="false"
|
|
245
|
+
enterkeyhint="search"
|
|
246
|
+
/>
|
|
247
|
+
<span data-slot="input-group-addon">
|
|
248
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
249
|
+
<rect width="256" height="256" fill="none" />
|
|
250
|
+
<circle
|
|
251
|
+
cx="112"
|
|
252
|
+
cy="112"
|
|
253
|
+
r="80"
|
|
254
|
+
fill="none"
|
|
255
|
+
stroke="currentColor"
|
|
256
|
+
stroke-linecap="round"
|
|
257
|
+
stroke-linejoin="round"
|
|
258
|
+
stroke-width="16"
|
|
259
|
+
/>
|
|
260
|
+
<line
|
|
261
|
+
x1="168.57"
|
|
262
|
+
y1="168.57"
|
|
263
|
+
x2="224"
|
|
264
|
+
y2="224"
|
|
265
|
+
fill="none"
|
|
266
|
+
stroke="currentColor"
|
|
267
|
+
stroke-linecap="round"
|
|
268
|
+
stroke-linejoin="round"
|
|
269
|
+
stroke-width="16"
|
|
270
|
+
/>
|
|
271
|
+
</svg>
|
|
272
|
+
</span>
|
|
273
|
+
</label>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<div class="ui-field">
|
|
277
|
+
<label data-slot="field-label" for="f-url">Website</label>
|
|
278
|
+
<label class="ui-input-group">
|
|
279
|
+
<input
|
|
280
|
+
class="ui-input"
|
|
281
|
+
id="f-url"
|
|
282
|
+
type="url"
|
|
283
|
+
name="url"
|
|
284
|
+
inputmode="url"
|
|
285
|
+
required
|
|
286
|
+
placeholder="https://zazz.sh"
|
|
287
|
+
autocomplete="url"
|
|
288
|
+
autocapitalize="off"
|
|
289
|
+
spellcheck="false"
|
|
290
|
+
enterkeyhint="go"
|
|
291
|
+
aria-describedby="f-url-hint"
|
|
292
|
+
/>
|
|
293
|
+
<span data-slot="input-group-addon">
|
|
294
|
+
<span data-slot="input-group-text">https://</span>
|
|
295
|
+
</span>
|
|
296
|
+
<span data-slot="input-group-addon" data-align="inline-end">
|
|
297
|
+
<button class="ui-button" data-variant="primary" data-size="sm" type="submit">
|
|
298
|
+
Apply
|
|
299
|
+
</button>
|
|
300
|
+
</span>
|
|
301
|
+
</label>
|
|
302
|
+
<div data-slot="field-description">
|
|
303
|
+
<span data-slot="field-hint" id="f-url-hint"
|
|
304
|
+
>Where people can find you online.</span
|
|
305
|
+
>
|
|
306
|
+
<span data-slot="field-error" role="alert"
|
|
307
|
+
>Enter a valid URL, e.g. https://zazz.sh.</span
|
|
308
|
+
>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
<div class="ui-field">
|
|
313
|
+
<label data-slot="field-label" for="f-password">Password</label>
|
|
314
|
+
<ui-password>
|
|
315
|
+
<label class="ui-password-group">
|
|
316
|
+
<input
|
|
317
|
+
class="ui-input"
|
|
318
|
+
id="f-password"
|
|
319
|
+
name="password"
|
|
320
|
+
type="password"
|
|
321
|
+
autocomplete="new-password"
|
|
322
|
+
minlength="8"
|
|
323
|
+
required
|
|
324
|
+
placeholder="••••••••"
|
|
325
|
+
aria-describedby="f-password-hint f-password-warning"
|
|
326
|
+
/>
|
|
327
|
+
<span data-slot="password-group-addon" data-align="inline-end">
|
|
328
|
+
<button
|
|
329
|
+
class="ui-button"
|
|
330
|
+
data-slot="password-group-toggle"
|
|
331
|
+
type="button"
|
|
332
|
+
data-variant="ghost"
|
|
333
|
+
data-size="icon-sm"
|
|
334
|
+
aria-pressed="false"
|
|
335
|
+
aria-label="Show password"
|
|
336
|
+
aria-describedby="f-password-warning"
|
|
337
|
+
>
|
|
338
|
+
<svg
|
|
339
|
+
data-slot="password-group-icon password-group-icon-show"
|
|
340
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
341
|
+
viewBox="0 0 256 256"
|
|
342
|
+
aria-hidden="true"
|
|
343
|
+
>
|
|
344
|
+
<rect width="256" height="256" fill="none" />
|
|
345
|
+
<path
|
|
346
|
+
d="M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Z"
|
|
347
|
+
fill="none"
|
|
348
|
+
stroke="currentColor"
|
|
349
|
+
stroke-linecap="round"
|
|
350
|
+
stroke-linejoin="round"
|
|
351
|
+
stroke-width="16"
|
|
352
|
+
/>
|
|
353
|
+
<circle
|
|
354
|
+
cx="128"
|
|
355
|
+
cy="128"
|
|
356
|
+
r="40"
|
|
357
|
+
fill="none"
|
|
358
|
+
stroke="currentColor"
|
|
359
|
+
stroke-linecap="round"
|
|
360
|
+
stroke-linejoin="round"
|
|
361
|
+
stroke-width="16"
|
|
362
|
+
/>
|
|
363
|
+
</svg>
|
|
364
|
+
<svg
|
|
365
|
+
data-slot="password-group-icon password-group-icon-hide"
|
|
366
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
367
|
+
viewBox="0 0 256 256"
|
|
368
|
+
aria-hidden="true"
|
|
369
|
+
>
|
|
370
|
+
<rect width="256" height="256" fill="none" />
|
|
371
|
+
<line
|
|
372
|
+
x1="48"
|
|
373
|
+
y1="40"
|
|
374
|
+
x2="208"
|
|
375
|
+
y2="216"
|
|
376
|
+
fill="none"
|
|
377
|
+
stroke="currentColor"
|
|
378
|
+
stroke-linecap="round"
|
|
379
|
+
stroke-linejoin="round"
|
|
380
|
+
stroke-width="16"
|
|
381
|
+
/>
|
|
382
|
+
<path
|
|
383
|
+
d="M154.9,157.6A40,40,0,0,1,101,98.4"
|
|
384
|
+
fill="none"
|
|
385
|
+
stroke="currentColor"
|
|
386
|
+
stroke-linecap="round"
|
|
387
|
+
stroke-linejoin="round"
|
|
388
|
+
stroke-width="16"
|
|
389
|
+
/>
|
|
390
|
+
<path
|
|
391
|
+
d="M73.8,69.7C33.6,90.6,16,128,16,128s32,72,112,72a118.1,118.1,0,0,0,54.1-12.8"
|
|
392
|
+
fill="none"
|
|
393
|
+
stroke="currentColor"
|
|
394
|
+
stroke-linecap="round"
|
|
395
|
+
stroke-linejoin="round"
|
|
396
|
+
stroke-width="16"
|
|
397
|
+
/>
|
|
398
|
+
<path
|
|
399
|
+
d="M208.6,169.1C229.8,149.1,240,128,240,128S208,56,128,56a126,126,0,0,0-20.5,1.6"
|
|
400
|
+
fill="none"
|
|
401
|
+
stroke="currentColor"
|
|
402
|
+
stroke-linecap="round"
|
|
403
|
+
stroke-linejoin="round"
|
|
404
|
+
stroke-width="16"
|
|
405
|
+
/>
|
|
406
|
+
</svg>
|
|
407
|
+
</button>
|
|
408
|
+
</span>
|
|
409
|
+
</label>
|
|
410
|
+
</ui-password>
|
|
411
|
+
<div data-slot="field-description">
|
|
412
|
+
<span data-slot="field-hint" id="f-password-hint"
|
|
413
|
+
>Use eight or more characters.</span
|
|
414
|
+
>
|
|
415
|
+
<span data-slot="field-error" role="alert"
|
|
416
|
+
>Password must be at least 8 characters.</span
|
|
417
|
+
>
|
|
418
|
+
</div>
|
|
419
|
+
<span class="sr-only" id="f-password-warning">
|
|
420
|
+
Warning: showing the password makes it visible to anyone near your screen.
|
|
421
|
+
</span>
|
|
422
|
+
</div>
|
|
423
|
+
|
|
424
|
+
<fieldset class="ui-field-group">
|
|
425
|
+
<legend>Preferences</legend>
|
|
426
|
+
<div class="flex flex-col gap-xs">
|
|
427
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
428
|
+
<input type="checkbox" name="preferences-newsletter" />
|
|
429
|
+
<span data-slot="field-label">Subscribe to the newsletter</span>
|
|
430
|
+
</label>
|
|
431
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
432
|
+
<input type="checkbox" name="preferences-terms" checked />
|
|
433
|
+
<span data-slot="field-label">Accept terms & conditions</span>
|
|
434
|
+
</label>
|
|
435
|
+
</div>
|
|
436
|
+
</fieldset>
|
|
437
|
+
|
|
438
|
+
<fieldset class="ui-radio-group">
|
|
439
|
+
<legend>Plan</legend>
|
|
440
|
+
<div class="flex flex-col gap-xs">
|
|
441
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
442
|
+
<input class="ui-radio" type="radio" name="plan" value="starter" />
|
|
443
|
+
<span data-slot="field-label">Starter</span>
|
|
444
|
+
</label>
|
|
445
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
446
|
+
<input class="ui-radio" type="radio" name="plan" value="pro" checked />
|
|
447
|
+
<span data-slot="field-label">Pro</span>
|
|
448
|
+
</label>
|
|
449
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
450
|
+
<input class="ui-radio" type="radio" name="plan" value="team" />
|
|
451
|
+
<span data-slot="field-label">Team</span>
|
|
452
|
+
</label>
|
|
453
|
+
</div>
|
|
454
|
+
</fieldset>
|
|
455
|
+
|
|
456
|
+
<fieldset class="ui-field-group">
|
|
457
|
+
<legend>Notifications</legend>
|
|
458
|
+
<div class="flex flex-col gap-xs">
|
|
459
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
460
|
+
<input type="checkbox" role="switch" name="notifications-email" />
|
|
461
|
+
<span data-slot="field-label">Email notifications</span>
|
|
462
|
+
</label>
|
|
463
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
464
|
+
<input type="checkbox" role="switch" name="notifications-2fa" checked />
|
|
465
|
+
<span data-slot="field-label">Two-factor authentication</span>
|
|
466
|
+
</label>
|
|
467
|
+
</div>
|
|
468
|
+
</fieldset>
|
|
469
|
+
|
|
470
|
+
<div class="ui-field">
|
|
471
|
+
<label data-slot="field-label" for="f-volume">Volume</label>
|
|
472
|
+
<input
|
|
473
|
+
class="max-w-full"
|
|
474
|
+
id="f-volume"
|
|
475
|
+
type="range"
|
|
476
|
+
min="0"
|
|
477
|
+
max="100"
|
|
478
|
+
step="10"
|
|
479
|
+
value="50"
|
|
480
|
+
/>
|
|
481
|
+
</div>
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
|
|
485
|
+
<!-- Actions span both columns -->
|
|
486
|
+
<div class="flex items-center justify-end gap-xs">
|
|
487
|
+
<button class="ui-button" type="reset">Reset</button>
|
|
488
|
+
<button class="ui-button" data-variant="primary" type="submit">Create account</button>
|
|
489
|
+
</div>
|
|
490
|
+
</form>
|
|
491
|
+
</div>
|
|
492
|
+
</section>
|
|
493
|
+
</main>
|
|
494
|
+
|
|
495
|
+
<footer class="border-t" data-transition-layer="global-footer">
|
|
496
|
+
<div class="container py-xl">
|
|
497
|
+
<div class="flex items-center justify-between gap-md">
|
|
498
|
+
<div class="text-h6 font-black">Zazz tests</div>
|
|
499
|
+
<menu class="flex gap-sm">
|
|
500
|
+
<li><a class="ui-button" data-variant="link" href="about.html">About</a></li>
|
|
501
|
+
<li><a class="ui-button" data-variant="link" href="layout.html">Layout</a></li>
|
|
502
|
+
<li><a class="ui-button" data-variant="link" href="responsive.html">Responsive</a></li>
|
|
503
|
+
<li><a class="ui-button" data-variant="link" href="products.html">Products</a></li>
|
|
504
|
+
<li><a class="ui-button" data-variant="link" href="components.html">Components</a></li>
|
|
505
|
+
<li><a class="ui-button" data-variant="link" href="forms.html">Forms</a></li>
|
|
506
|
+
</menu>
|
|
507
|
+
</div>
|
|
508
|
+
</div>
|
|
509
|
+
</footer>
|
|
510
|
+
</body>
|
|
511
|
+
</html>
|