@tasteee/zest 0.1.0 → 0.3.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/README.md +113 -204
- package/custom-elements.json +405 -5
- package/dist/components/z-bento-grid.d.ts +3 -1
- package/dist/components/z-card.d.ts +3 -1
- package/dist/components/z-cluster.d.ts +5 -3
- package/dist/components/z-column.d.ts +31 -0
- package/dist/components/z-container.d.ts +3 -1
- package/dist/components/z-dock.d.ts +3 -1
- package/dist/components/z-dropzone.d.ts +4 -0
- package/dist/components/z-grid.d.ts +9 -3
- package/dist/components/z-marquee.d.ts +3 -1
- package/dist/components/z-row.d.ts +31 -0
- package/dist/components/z-section.d.ts +18 -4
- package/dist/components/z-stack.d.ts +3 -1
- package/dist/index.d.ts +2 -0
- package/dist/shared/layout-schema.d.ts +4 -0
- package/dist/zest.js +3248 -3092
- package/package.json +71 -85
package/README.md
CHANGED
|
@@ -1,204 +1,113 @@
|
|
|
1
|
-
# @tasteee/zest
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
them.
|
|
115
|
-
- **A real design system** — a shared token scale (colors, spacing,
|
|
116
|
-
typography) drives every component via CSS custom properties, so overriding
|
|
117
|
-
a token restyles the whole library.
|
|
118
|
-
- **Platform-first** — dialogs use `<dialog>`, popovers and menus follow
|
|
119
|
-
native focus and keyboard conventions (arrow keys, Enter/Space, Esc).
|
|
120
|
-
- **Shadow DOM encapsulation** — component styles can't collide with your
|
|
121
|
-
app's CSS, and vice versa.
|
|
122
|
-
- **TypeScript + editor tooling** — ships `.d.ts` declarations and a
|
|
123
|
-
[Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest)
|
|
124
|
-
(`custom-elements.json`), so editors that read the manifest autocomplete
|
|
125
|
-
tag names and attributes.
|
|
126
|
-
|
|
127
|
-
## Using it everywhere
|
|
128
|
-
|
|
129
|
-
### React
|
|
130
|
-
|
|
131
|
-
```jsx
|
|
132
|
-
import '@tasteee/zest'
|
|
133
|
-
import '@tasteee/zest/ink.css'
|
|
134
|
-
|
|
135
|
-
export function App() {
|
|
136
|
-
return (
|
|
137
|
-
<z-button tone="primary" onClick={() => console.log('clicked')}>
|
|
138
|
-
Click me
|
|
139
|
-
</z-button>
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Plain HTML
|
|
145
|
-
|
|
146
|
-
The bundle is ESM, so the script tag must be `type="module"`:
|
|
147
|
-
|
|
148
|
-
```html
|
|
149
|
-
<link rel="stylesheet" href="/node_modules/@tasteee/zest/dist/ink.css" />
|
|
150
|
-
<script type="module" src="/node_modules/@tasteee/zest/dist/zest.js"></script>
|
|
151
|
-
|
|
152
|
-
<z-button tone="primary">Click me</z-button>
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### From a CDN (no build step at all)
|
|
156
|
-
|
|
157
|
-
```html
|
|
158
|
-
<link rel="stylesheet" href="https://esm.sh/@tasteee/zest/ink.css" />
|
|
159
|
-
<script type="module" src="https://esm.sh/@tasteee/zest"></script>
|
|
160
|
-
|
|
161
|
-
<z-button tone="primary">Click me</z-button>
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Components
|
|
165
|
-
|
|
166
|
-
Foundation `z-box` `z-text` `z-card` `z-line` `z-separator` ·
|
|
167
|
-
Layout `z-stack` `z-grid` `z-cluster` `z-center` `z-container` `z-section`
|
|
168
|
-
`z-surface` `z-scroll` `z-spacer` ·
|
|
169
|
-
Actions `z-button` `z-button-group` `z-toggle` `z-toggle-group` `z-link` ·
|
|
170
|
-
Forms `z-input` `z-textarea` `z-checkbox` `z-switch` `z-radio` `z-radio-group`
|
|
171
|
-
`z-slider` `z-select` `z-combobox` `z-color-picker` `z-input-otp` ·
|
|
172
|
-
Data display `z-badge` `z-avatar` `z-progress` `z-skeleton` `z-table`
|
|
173
|
-
`z-pagination` `z-stat` ·
|
|
174
|
-
Navigation `z-breadcrumbs` `z-tabs` `z-collapsible` `z-accordion` `z-menu`
|
|
175
|
-
`z-nav-menu` `z-sidebar` ·
|
|
176
|
-
Overlays `z-tooltip` `z-popover` `z-hover-card` `z-dialog` `z-alert-dialog`
|
|
177
|
-
`z-alert` `z-sheet` `z-drawer` `z-context-menu` `z-toast` `z-command` ·
|
|
178
|
-
Specialized `z-empty-state` `z-scroll-area` `z-code-block` `z-post-meta`
|
|
179
|
-
`z-carousel` `z-chart` `z-terminal` `z-piano-roll` `z-pattern-roll`
|
|
180
|
-
|
|
181
|
-
…and many more. Every component has a doc page in [`docs/`](./docs) with
|
|
182
|
-
examples, attribute tables, and event references.
|
|
183
|
-
|
|
184
|
-
## Local development
|
|
185
|
-
|
|
186
|
-
```sh
|
|
187
|
-
pnpm install
|
|
188
|
-
pnpm dev # rebuilds dist/ on change (vite build --watch)
|
|
189
|
-
pnpm build # dist/zest.js + dist/ink.css + dist/*.d.ts + custom-elements.json
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## Publishing
|
|
193
|
-
|
|
194
|
-
Run from this directory (`packages/zest`):
|
|
195
|
-
|
|
196
|
-
```sh
|
|
197
|
-
npm publish
|
|
198
|
-
# prepublishOnly runs the full build automatically
|
|
199
|
-
# publishConfig.access is "public"
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## License
|
|
203
|
-
|
|
204
|
-
MIT
|
|
1
|
+
# @tasteee/zest
|
|
2
|
+
|
|
3
|
+
A gorgeous, dark theme, fully-featured, framework-agnostic web component library.Use it in in plain HTML, React, Vue, Svelte, or anywhere else.
|
|
4
|
+
|
|
5
|
+
The components are built with [Atomico](https://atomicojs.dev) and ship as a
|
|
6
|
+
single self-contained bundle with **zero runtime dependencies** (Atomico and the
|
|
7
|
+
syntax-highlighting deps are bundled in at build time).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @tasteee/zest
|
|
13
|
+
# or: pnpm add @tasteee/zest
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import '@tasteee/zest' // registers every <z-*> element
|
|
20
|
+
import '@tasteee/zest/ink.css' // design tokens: CSS custom properties + fonts
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- **`@tasteee/zest`** runs the side-effectful registration. Importing it calls
|
|
24
|
+
`customElements.define(...)` for all elements. There's nothing else to wire
|
|
25
|
+
up. Each component carries its own encapsulated styles inside its shadow DOM.
|
|
26
|
+
|
|
27
|
+
- **`@tasteee/zest/ink.css`** defines the document-level design tokens (colors,
|
|
28
|
+
spacing, typography custom properties) that the components read via
|
|
29
|
+
`var(--token)`. It also loads the DM Sans / DM Mono fonts from Google Fonts.
|
|
30
|
+
|
|
31
|
+
TODO: Make it so fonts can be opted into, rather than automatic.
|
|
32
|
+
|
|
33
|
+
### React
|
|
34
|
+
|
|
35
|
+
```jsx
|
|
36
|
+
import '@tasteee/zest'
|
|
37
|
+
import '@tasteee/zest/ink.css'
|
|
38
|
+
|
|
39
|
+
export function App() {
|
|
40
|
+
return (
|
|
41
|
+
<z-button kind="primary" onClick={() => console.log('clicked')}>
|
|
42
|
+
Click me
|
|
43
|
+
</z-button>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Plain HTML
|
|
49
|
+
|
|
50
|
+
(script must be `type="module"` since the bundle is ESM)
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<link rel="stylesheet" href="/node_modules/@tasteee/zest/dist/ink.css" />
|
|
54
|
+
<script type="module" src="/node_modules/@tasteee/zest/dist/zest.js"></script>
|
|
55
|
+
<z-button kind="primary">Click me</z-button>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### From a CDN (no build step)
|
|
59
|
+
|
|
60
|
+
A CDN resolves the package name for you, so here you can use it directly:
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<link rel="stylesheet" href="https://esm.sh/@tasteee/zest/ink.css" />
|
|
64
|
+
<script type="module" src="https://esm.sh/@tasteee/zest"></script>
|
|
65
|
+
|
|
66
|
+
<z-button kind="primary">Click me</z-button>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## TypeScript & editor support
|
|
70
|
+
|
|
71
|
+
The package ships type declarations (`dist/index.d.ts`) and a
|
|
72
|
+
[Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest)
|
|
73
|
+
at `custom-elements.json` (referenced via the `customElements` field in
|
|
74
|
+
`package.json`). Editors and tools that read the manifest get tag-name and
|
|
75
|
+
attribute autocompletion for the `<z-*>` elements.
|
|
76
|
+
|
|
77
|
+
## Components
|
|
78
|
+
|
|
79
|
+
Foundation `z-box` `z-text` `z-card` `z-line` `z-separator` ·
|
|
80
|
+
Layout `z-stack` `z-grid` `z-cluster` `z-center` `z-container` `z-section`
|
|
81
|
+
`z-surface` `z-scroll` `z-spacer` ·
|
|
82
|
+
Actions `z-button` `z-button-group` `z-toggle` `z-toggle-group` `z-link` ·
|
|
83
|
+
Forms `z-input` `z-textarea` `z-checkbox` `z-switch` `z-radio` `z-radio-group`
|
|
84
|
+
`z-slider` `z-select` `z-combobox` `z-color-picker` `z-input-otp` ·
|
|
85
|
+
Data display `z-badge` `z-avatar` `z-progress` `z-skeleton` `z-table`
|
|
86
|
+
`z-pagination` `z-stat` ·
|
|
87
|
+
Navigation `z-breadcrumbs` `z-tabs` `z-collapsible` `z-accordion` `z-menu`
|
|
88
|
+
`z-nav-menu` `z-sidebar` ·
|
|
89
|
+
Overlays `z-tooltip` `z-popover` `z-hover-card` `z-dialog` `z-alert-dialog`
|
|
90
|
+
`z-alert` `z-sheet` `z-drawer` `z-context-menu` `z-toast` `z-command` ·
|
|
91
|
+
Specialized `z-empty-state` `z-scroll-area` `z-code-block` `z-post-meta`
|
|
92
|
+
`z-carousel` `z-chart`
|
|
93
|
+
|
|
94
|
+
## Local development
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
pnpm install
|
|
98
|
+
pnpm dev # rebuilds dist/ on change (vite build --watch)
|
|
99
|
+
pnpm build # dist/zest.js + dist/ink.css + dist/*.d.ts + custom-elements.json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Publishing
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
pnpm build
|
|
106
|
+
npm publish
|
|
107
|
+
# prepublishOnly runs the build
|
|
108
|
+
# publishConfig.access is "public"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT
|