@quieto/ui 0.0.0-stage → 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.
Files changed (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +142 -2
  3. package/custom-elements.json +6126 -0
  4. package/dist/components/qds-accordion/qds-accordion.d.ts +39 -0
  5. package/dist/components/qds-accordion/qds-accordion.d.ts.map +1 -0
  6. package/dist/components/qds-accordion/qds-accordion.js +130 -0
  7. package/dist/components/qds-accordion/qds-accordion.js.map +1 -0
  8. package/dist/components/qds-accordion-item/qds-accordion-item.d.ts +68 -0
  9. package/dist/components/qds-accordion-item/qds-accordion-item.d.ts.map +1 -0
  10. package/dist/components/qds-accordion-item/qds-accordion-item.js +247 -0
  11. package/dist/components/qds-accordion-item/qds-accordion-item.js.map +1 -0
  12. package/dist/components/qds-button/qds-button.d.ts +92 -0
  13. package/dist/components/qds-button/qds-button.d.ts.map +1 -0
  14. package/dist/components/qds-button/qds-button.js +418 -0
  15. package/dist/components/qds-button/qds-button.js.map +1 -0
  16. package/dist/components/qds-card/qds-card.d.ts +48 -0
  17. package/dist/components/qds-card/qds-card.d.ts.map +1 -0
  18. package/dist/components/qds-card/qds-card.js +152 -0
  19. package/dist/components/qds-card/qds-card.js.map +1 -0
  20. package/dist/components/qds-checkbox/qds-checkbox.d.ts +85 -0
  21. package/dist/components/qds-checkbox/qds-checkbox.d.ts.map +1 -0
  22. package/dist/components/qds-checkbox/qds-checkbox.js +316 -0
  23. package/dist/components/qds-checkbox/qds-checkbox.js.map +1 -0
  24. package/dist/components/qds-chip/qds-chip.d.ts +79 -0
  25. package/dist/components/qds-chip/qds-chip.d.ts.map +1 -0
  26. package/dist/components/qds-chip/qds-chip.js +314 -0
  27. package/dist/components/qds-chip/qds-chip.js.map +1 -0
  28. package/dist/components/qds-input/qds-input.d.ts +64 -0
  29. package/dist/components/qds-input/qds-input.d.ts.map +1 -0
  30. package/dist/components/qds-input/qds-input.js +224 -0
  31. package/dist/components/qds-input/qds-input.js.map +1 -0
  32. package/dist/components/qds-modal/qds-modal.d.ts +76 -0
  33. package/dist/components/qds-modal/qds-modal.d.ts.map +1 -0
  34. package/dist/components/qds-modal/qds-modal.js +362 -0
  35. package/dist/components/qds-modal/qds-modal.js.map +1 -0
  36. package/dist/components/qds-progress-bar/qds-progress-bar.d.ts +47 -0
  37. package/dist/components/qds-progress-bar/qds-progress-bar.d.ts.map +1 -0
  38. package/dist/components/qds-progress-bar/qds-progress-bar.js +180 -0
  39. package/dist/components/qds-progress-bar/qds-progress-bar.js.map +1 -0
  40. package/dist/components/qds-radio/qds-radio.d.ts +62 -0
  41. package/dist/components/qds-radio/qds-radio.d.ts.map +1 -0
  42. package/dist/components/qds-radio/qds-radio.js +213 -0
  43. package/dist/components/qds-radio/qds-radio.js.map +1 -0
  44. package/dist/components/qds-radio-group/qds-radio-group.d.ts +72 -0
  45. package/dist/components/qds-radio-group/qds-radio-group.d.ts.map +1 -0
  46. package/dist/components/qds-radio-group/qds-radio-group.js +317 -0
  47. package/dist/components/qds-radio-group/qds-radio-group.js.map +1 -0
  48. package/dist/components/qds-stack/qds-stack.d.ts +46 -0
  49. package/dist/components/qds-stack/qds-stack.d.ts.map +1 -0
  50. package/dist/components/qds-stack/qds-stack.js +149 -0
  51. package/dist/components/qds-stack/qds-stack.js.map +1 -0
  52. package/dist/components/qds-tab/qds-tab.d.ts +55 -0
  53. package/dist/components/qds-tab/qds-tab.d.ts.map +1 -0
  54. package/dist/components/qds-tab/qds-tab.js +162 -0
  55. package/dist/components/qds-tab/qds-tab.js.map +1 -0
  56. package/dist/components/qds-tab-panel/qds-tab-panel.d.ts +32 -0
  57. package/dist/components/qds-tab-panel/qds-tab-panel.d.ts.map +1 -0
  58. package/dist/components/qds-tab-panel/qds-tab-panel.js +72 -0
  59. package/dist/components/qds-tab-panel/qds-tab-panel.js.map +1 -0
  60. package/dist/components/qds-tabs/qds-tabs.d.ts +54 -0
  61. package/dist/components/qds-tabs/qds-tabs.d.ts.map +1 -0
  62. package/dist/components/qds-tabs/qds-tabs.js +196 -0
  63. package/dist/components/qds-tabs/qds-tabs.js.map +1 -0
  64. package/dist/components/qds-text-field/qds-text-field.d.ts +94 -0
  65. package/dist/components/qds-text-field/qds-text-field.d.ts.map +1 -0
  66. package/dist/components/qds-text-field/qds-text-field.js +332 -0
  67. package/dist/components/qds-text-field/qds-text-field.js.map +1 -0
  68. package/dist/components/qds-toggle/qds-toggle.d.ts +68 -0
  69. package/dist/components/qds-toggle/qds-toggle.d.ts.map +1 -0
  70. package/dist/components/qds-toggle/qds-toggle.js +260 -0
  71. package/dist/components/qds-toggle/qds-toggle.js.map +1 -0
  72. package/dist/index.d.ts +50 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +40 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/internal/qds-element.d.ts +31 -0
  77. package/dist/internal/qds-element.d.ts.map +1 -0
  78. package/dist/internal/qds-element.js +68 -0
  79. package/dist/internal/qds-element.js.map +1 -0
  80. package/dist/internal/qds-text-control.d.ts +79 -0
  81. package/dist/internal/qds-text-control.d.ts.map +1 -0
  82. package/dist/internal/qds-text-control.js +159 -0
  83. package/dist/internal/qds-text-control.js.map +1 -0
  84. package/package.json +125 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dillon Schultz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,143 @@
1
- # Temporary Holding Version
1
+ # @quieto/ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Web components for the Quieto Design System, built with [Lit](https://lit.dev) and styled entirely
4
+ by [`@quieto/design-tokens`](https://www.npmjs.com/package/@quieto/design-tokens). They work in any
5
+ framework, or none.
6
+
7
+ ```bash
8
+ npm install @quieto/ui
9
+ ```
10
+
11
+ ## Set up
12
+
13
+ Load the design tokens **once**, at the top of your app, then register the components:
14
+
15
+ ```js
16
+ import '@quieto/design-tokens/css';
17
+ import '@quieto/ui';
18
+ ```
19
+
20
+ ```html
21
+ <qds-button variant="primary">Save</qds-button>
22
+ ```
23
+
24
+ Without the token stylesheet the components still render, from fallback values built into each
25
+ one, but nothing follows your theme and dark mode does nothing. `@quieto/design-tokens` is
26
+ installed with this package, so there is nothing else to add.
27
+
28
+ Importing `@quieto/ui` registers every element. To register only what you use, import components
29
+ one at a time instead:
30
+
31
+ ```js
32
+ import '@quieto/ui/qds-button.js';
33
+ import '@quieto/ui/qds-text-field.js';
34
+ ```
35
+
36
+ ## Components
37
+
38
+ | Element | What it is |
39
+ | --- | --- |
40
+ | `qds-accordion`, `qds-accordion-item` | Collapsible sections. Optionally `exclusive`, so only one is open. |
41
+ | `qds-button` | A button: four variants, three sizes, a loading state. Submits forms. |
42
+ | `qds-card` | A container with media, header, body, and footer regions. |
43
+ | `qds-checkbox` | A checkbox, including the indeterminate state. |
44
+ | `qds-chip` | A compact status or category label. Removable, or `selectable` as a filter chip. |
45
+ | `qds-input` | A bare single-line text input, named by its `label` attribute. |
46
+ | `qds-modal` | A modal dialog, built on the native `<dialog>`. |
47
+ | `qds-progress-bar` | Determinate or indeterminate progress. |
48
+ | `qds-radio-group`, `qds-radio` | A set of options of which one is chosen. |
49
+ | `qds-stack` | Lays its children out with gaps from the spacing scale. |
50
+ | `qds-tabs`, `qds-tab`, `qds-tab-panel` | Tabs, each showing one panel. |
51
+ | `qds-text-field` | A complete text field: visible label, input, hint, and error message. |
52
+ | `qds-toggle` | An on/off switch, for settings that apply immediately. |
53
+
54
+ Every property, attribute, slot, event, CSS part, and CSS custom property is documented in
55
+ `custom-elements.json`, a
56
+ [Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest) that ships
57
+ in this package. Editors and tools that read the format use it for autocomplete.
58
+
59
+ ## Forms
60
+
61
+ The form controls — `qds-checkbox`, `qds-radio-group`, `qds-toggle`, `qds-input`,
62
+ `qds-text-field`, and a `qds-button` with `type="submit"` or `"reset"` — take part in a surrounding
63
+ `<form>` like native controls do, even though their inputs are inside shadow DOM:
64
+
65
+ - they submit their value under their `name`
66
+ - `required`, and the input types' own rules such as `type="email"`, block submission
67
+ - `form.reset()` restores the value the markup declared
68
+ - a `<fieldset disabled>` disables them
69
+
70
+ ```html
71
+ <form>
72
+ <qds-text-field label="Email" name="email" type="email" required></qds-text-field>
73
+ <qds-checkbox name="updates" value="yes">Send me updates</qds-checkbox>
74
+ <qds-button type="submit">Sign up</qds-button>
75
+ </form>
76
+ ```
77
+
78
+ ## Events
79
+
80
+ Components fire events prefixed with `qds-`, such as `qds-change` and `qds-close`. They bubble
81
+ and cross shadow boundaries, so a listener anywhere above the component hears them. `qds-change`
82
+ and `qds-input` fire only for what the user does, not for values your own code sets.
83
+
84
+ ```js
85
+ document.querySelector('qds-toggle').addEventListener('qds-change', (event) => {
86
+ console.log(event.detail.checked);
87
+ });
88
+ ```
89
+
90
+ ## Restyling
91
+
92
+ Each component reads its styles from its own component tokens, the
93
+ `--qds-component-{name}-*` variables in `@quieto/design-tokens`. Overriding one of those variables is
94
+ the supported way to restyle a component, and it applies wherever you set it:
95
+
96
+ ```css
97
+ qds-button.brand {
98
+ --qds-component-button-primary-color-background-rest: var(--qds-color-purple-600);
99
+ --qds-component-button-border-radius: var(--qds-border-radius-full);
100
+ }
101
+ ```
102
+
103
+ For anything the tokens do not cover, components expose CSS parts:
104
+ `qds-button::part(button) { … }`.
105
+
106
+ ## Accessibility
107
+
108
+ Each component follows the matching ARIA pattern: keyboard support, focus management, and the
109
+ right roles and states. A few things are still up to you:
110
+
111
+ - **Name the controls that have no visible label.** `qds-input` and `qds-progress-bar` take a
112
+ `label` attribute, and an icon-only `qds-button` takes `label` too.
113
+ - **Group filter chips.** Wrap a set of `selectable` chips in an element with `role="group"` and an
114
+ `aria-label`, so they are announced together.
115
+ - **Choose heading levels.** Set `heading-level` on `qds-accordion-item` to fit the outline of your
116
+ page.
117
+
118
+ ## Server rendering
119
+
120
+ The components can be server-rendered with
121
+ [`@lit-labs/ssr`](https://www.npmjs.com/package/@lit-labs/ssr) into declarative shadow DOM, so they
122
+ appear styled before any JavaScript runs. Load
123
+ `@lit-labs/ssr-client/lit-element-hydrate-support.js` before `@quieto/ui` on the client, or every
124
+ component renders twice.
125
+
126
+ ## Compatibility
127
+
128
+ - **Browsers:** current versions of Chrome, Edge, Firefox, and Safari. Form participation relies
129
+ on form-associated custom elements: Safari 16.4 and later, Firefox 98 and later.
130
+ - **Modules:** ES modules, unbundled, with bare imports of `lit`. Use a bundler, or an import map.
131
+ - **TypeScript:** types are included, and `HTMLElementTagNameMap` knows every element, so
132
+ `document.querySelector('qds-modal')` is typed.
133
+
134
+ ## Versioning
135
+
136
+ This package is pre-1.0, so **component APIs can change in any minor release.** On `0.x`, npm's
137
+ caret range does not cross a minor version: `^0.1.0` installs `0.1.x` but never `0.2.0`. The
138
+ [changelog](https://github.com/dillonschultz93/qds/blob/main/packages/ui/CHANGELOG.md) lists every
139
+ breaking change.
140
+
141
+ ## License
142
+
143
+ MIT