@tasteee/zest 0.1.0 → 0.2.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 CHANGED
@@ -1,204 +1,113 @@
1
- # @tasteee/zest
2
-
3
- > ⚠️ **Pre-release do not consume yet.** Zest is under active development
4
- > and published for early testing only. APIs, tag names, attributes, and
5
- > design tokens may change without notice between versions. Don't depend on
6
- > it in production until 1.0.
7
-
8
- A gorgeous, dark-themed, fully-featured, framework-agnostic web component
9
- library — 135+ custom elements covering layout, forms, overlays, navigation,
10
- data display, and more. Use it in plain HTML, React, Vue, Svelte, Solid, or
11
- anywhere else custom elements work (which is everywhere).
12
-
13
- Zest is built with [Atomico](https://atomicojs.dev) and ships as a **single
14
- self-contained ESM bundle with zero runtime dependencies** — Atomico and the
15
- syntax-highlighting libraries are bundled in at build time. There is no
16
- peer-dependency dance, no plugin, no framework adapter, and no per-component
17
- imports to manage.
18
-
19
- ## Install
20
-
21
- ```sh
22
- npm install @tasteee/zest
23
- # or: pnpm add @tasteee/zest
24
- ```
25
-
26
- ## Two imports, that's it
27
-
28
- ```js
29
- import '@tasteee/zest' // registers every <z-*> element
30
- import '@tasteee/zest/ink.css' // design tokens: CSS custom properties + fonts
31
- ```
32
-
33
- - **`@tasteee/zest`** is a side-effect import. It calls
34
- `customElements.define(...)` for every element — after that, `<z-button>`,
35
- `<z-dialog>`, `<z-stack>`, etc. just work as HTML tags. Each component
36
- carries its own encapsulated styles in its shadow DOM, so nothing leaks in
37
- or out.
38
-
39
- - **`@tasteee/zest/ink.css`** defines the document-level design tokens
40
- (colors, spacing, typography custom properties) that the components read via
41
- `var(--token)`, and loads the DM Sans / DM Mono fonts.
42
-
43
- ## A taste
44
-
45
- Everything is just HTML. Attributes follow one consistent grammar across the
46
- whole library: `tone` picks the color family, `kind` picks the visual
47
- treatment, `size` picks the scale, and boolean states are `is-*` flags.
48
-
49
- ```html
50
- <z-button tone="primary">Save</z-button>
51
- <z-button tone="danger" kind="outline">Delete</z-button>
52
- <z-button kind="ghost" size="small">Cancel</z-button>
53
- <z-button tone="primary" is-loading>Saving…</z-button>
54
- ```
55
-
56
- Layout is declarative — no wrapper CSS required. `gap` and the `inset*` props
57
- take a size token (`2xs` `xs` `sm` `md` `lg` `xl` `2xl`…) or any CSS length:
58
-
59
- ```html
60
- <z-stack gap="md">
61
- <z-card>One</z-card>
62
- <z-card>Two</z-card>
63
- </z-stack>
64
-
65
- <z-stack is-row gap="sm" aligns-y="center" aligns-x="between">
66
- <z-text weight="bold">Left</z-text>
67
- <z-badge tone="success" label="Right"></z-badge>
68
- </z-stack>
69
- ```
70
-
71
- Overlays build on the platform. `z-dialog` wraps the native `<dialog>`
72
- element, so focus trapping, Esc-to-close, and top-layer stacking come for
73
- free wire it up entirely in markup with slots:
74
-
75
- ```html
76
- <z-dialog heading="Edit profile" description="Update your details.">
77
- <z-button slot="trigger">Edit</z-button>
78
-
79
- <z-input placeholder="Name"></z-input>
80
-
81
- <div slot="footer">
82
- <z-button kind="outline" tone="neutral">Cancel</z-button>
83
- <z-button tone="primary">Save</z-button>
84
- </div>
85
- </z-dialog>
86
- ```
87
-
88
- Form controls emit `change` events with the value in `event.detail`. Rich
89
- data (like option lists) is passed as a property:
90
-
91
- ```html
92
- <z-select placeholder="Pick a fruit"></z-select>
93
- <z-switch is-checked></z-switch>
94
- <z-input placeholder="Email" type="email" is-required></z-input>
95
- ```
96
-
97
- ```js
98
- const select = document.querySelector('z-select')
99
- select.options = [
100
- { value: 'apple', label: 'Apple' },
101
- { value: 'pear', label: 'Pear' }
102
- ]
103
- select.addEventListener('change', (e) => console.log(e.detail.value))
104
- ```
105
-
106
- ## Features
107
-
108
- - **Framework-agnostic** custom elements work natively in every framework
109
- and in plain HTML. No adapters, no wrappers.
110
- - **Zero runtime dependencies** — one bundled ESM file; nothing else lands in
111
- your `node_modules` graph.
112
- - **One consistent API grammar** — `tone` / `kind` / `size` / `is-*` mean the
113
- same thing on every component, so learning one component teaches you all of
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
@@ -3193,9 +3193,9 @@
3193
3193
  },
3194
3194
  {
3195
3195
  "kind": "field",
3196
- "name": "wrap",
3196
+ "name": "noWrap",
3197
3197
  "type": {
3198
- "text": "string"
3198
+ "text": "boolean"
3199
3199
  }
3200
3200
  },
3201
3201
  {
@@ -3250,10 +3250,10 @@
3250
3250
  }
3251
3251
  },
3252
3252
  {
3253
- "name": "wrap",
3254
- "fieldName": "wrap",
3253
+ "name": "no-wrap",
3254
+ "fieldName": "noWrap",
3255
3255
  "type": {
3256
- "text": "string"
3256
+ "text": "boolean"
3257
3257
  }
3258
3258
  },
3259
3259
  {
@@ -5183,6 +5183,13 @@
5183
5183
  "text": "boolean"
5184
5184
  }
5185
5185
  },
5186
+ {
5187
+ "kind": "field",
5188
+ "name": "files",
5189
+ "type": {
5190
+ "text": "array"
5191
+ }
5192
+ },
5186
5193
  {
5187
5194
  "kind": "field",
5188
5195
  "name": "drop",
@@ -5190,6 +5197,13 @@
5190
5197
  "text": "string"
5191
5198
  }
5192
5199
  },
5200
+ {
5201
+ "kind": "field",
5202
+ "name": "clear",
5203
+ "type": {
5204
+ "text": "string"
5205
+ }
5206
+ },
5193
5207
  {
5194
5208
  "kind": "field",
5195
5209
  "name": "reject",
@@ -5234,6 +5248,13 @@
5234
5248
  "text": "boolean"
5235
5249
  }
5236
5250
  },
5251
+ {
5252
+ "name": "files",
5253
+ "fieldName": "files",
5254
+ "type": {
5255
+ "text": "array"
5256
+ }
5257
+ },
5237
5258
  {
5238
5259
  "name": "drop",
5239
5260
  "fieldName": "drop",
@@ -5241,6 +5262,13 @@
5241
5262
  "text": "string"
5242
5263
  }
5243
5264
  },
5265
+ {
5266
+ "name": "clear",
5267
+ "fieldName": "clear",
5268
+ "type": {
5269
+ "text": "string"
5270
+ }
5271
+ },
5244
5272
  {
5245
5273
  "name": "reject",
5246
5274
  "fieldName": "reject",
@@ -10471,6 +10499,20 @@
10471
10499
  "text": "string"
10472
10500
  }
10473
10501
  },
10502
+ {
10503
+ "kind": "field",
10504
+ "name": "spaceLeft",
10505
+ "type": {
10506
+ "text": "string"
10507
+ }
10508
+ },
10509
+ {
10510
+ "kind": "field",
10511
+ "name": "spaceRight",
10512
+ "type": {
10513
+ "text": "string"
10514
+ }
10515
+ },
10474
10516
  {
10475
10517
  "kind": "field",
10476
10518
  "name": "container",
@@ -10508,6 +10550,20 @@
10508
10550
  "text": "string"
10509
10551
  }
10510
10552
  },
10553
+ {
10554
+ "name": "space-left",
10555
+ "fieldName": "spaceLeft",
10556
+ "type": {
10557
+ "text": "string"
10558
+ }
10559
+ },
10560
+ {
10561
+ "name": "space-right",
10562
+ "fieldName": "spaceRight",
10563
+ "type": {
10564
+ "text": "string"
10565
+ }
10566
+ },
10511
10567
  {
10512
10568
  "name": "container",
10513
10569
  "fieldName": "container",
@@ -2,7 +2,9 @@ export declare const ZBentoGrid: import("atomico/types/dom").Atomico<{
2
2
  props: {
3
3
  columns: NumberConstructor;
4
4
  rowHeight: StringConstructor;
5
- gap: StringConstructor;
5
+ gap: {
6
+ readonly type: StringConstructor;
7
+ };
6
8
  isHidden: {
7
9
  type: BooleanConstructor;
8
10
  reflect: true;
@@ -20,7 +20,9 @@ export declare const ZCard: import("atomico/types/dom").Atomico<{
20
20
  type: BooleanConstructor;
21
21
  reflect: true;
22
22
  };
23
- gap: StringConstructor;
23
+ gap: {
24
+ readonly type: StringConstructor;
25
+ };
24
26
  };
25
27
  styles: CSSStyleSheet;
26
28
  }>;
@@ -3,11 +3,13 @@ export declare const ZCluster: import("atomico/types/dom").Atomico<{
3
3
  inset: StringConstructor;
4
4
  insetX: StringConstructor;
5
5
  insetY: StringConstructor;
6
- gap: StringConstructor;
6
+ gap: {
7
+ readonly type: StringConstructor;
8
+ };
7
9
  alignsX: StringConstructor;
8
10
  alignsY: StringConstructor;
9
- wrap: {
10
- type: StringConstructor;
11
+ noWrap: {
12
+ type: BooleanConstructor;
11
13
  reflect: true;
12
14
  };
13
15
  fullWidth: {
@@ -1,7 +1,9 @@
1
1
  export declare const ZContainer: import("atomico/types/dom").Atomico<{
2
2
  props: {
3
3
  size: StringConstructor;
4
- gutter: StringConstructor;
4
+ gutter: {
5
+ readonly type: StringConstructor;
6
+ };
5
7
  center: {
6
8
  type: BooleanConstructor;
7
9
  reflect: true;
@@ -3,7 +3,9 @@ export declare const ZDock: import("atomico/types/dom").Atomico<{
3
3
  magnification: NumberConstructor;
4
4
  distance: NumberConstructor;
5
5
  itemSize: StringConstructor;
6
- gap: StringConstructor;
6
+ gap: {
7
+ readonly type: StringConstructor;
8
+ };
7
9
  floating: {
8
10
  type: BooleanConstructor;
9
11
  reflect: true;
@@ -20,9 +20,13 @@ export declare const ZDropzone: import("atomico/types/dom").Atomico<{
20
20
  type: BooleanConstructor;
21
21
  reflect: true;
22
22
  };
23
+ files: {
24
+ type: ArrayConstructor;
25
+ };
23
26
  drop: import("atomico/types/schema").EventProp<{
24
27
  files: File[];
25
28
  }>;
29
+ clear: import("atomico/types/schema").EventProp<void>;
26
30
  reject: import("atomico/types/schema").EventProp<{
27
31
  files: File[];
28
32
  reason: string;
@@ -5,9 +5,15 @@ export declare const ZGrid: import("atomico/types/dom").Atomico<{
5
5
  insetY: StringConstructor;
6
6
  columns: StringConstructor;
7
7
  minColumnWidth: StringConstructor;
8
- gap: StringConstructor;
9
- gapX: StringConstructor;
10
- gapY: StringConstructor;
8
+ gap: {
9
+ readonly type: StringConstructor;
10
+ };
11
+ gapX: {
12
+ readonly type: StringConstructor;
13
+ };
14
+ gapY: {
15
+ readonly type: StringConstructor;
16
+ };
11
17
  alignsX: StringConstructor;
12
18
  alignsY: StringConstructor;
13
19
  fullWidth: {
@@ -1,7 +1,9 @@
1
1
  export declare const ZMarquee: import("atomico/types/dom").Atomico<{
2
2
  props: {
3
3
  duration: NumberConstructor;
4
- gap: StringConstructor;
4
+ gap: {
5
+ readonly type: StringConstructor;
6
+ };
5
7
  reverse: {
6
8
  type: BooleanConstructor;
7
9
  reflect: true;
@@ -1,10 +1,24 @@
1
1
  export declare const ZSection: import("atomico/types/dom").Atomico<{
2
2
  props: {
3
- space: StringConstructor;
4
- spaceTop: StringConstructor;
5
- spaceBottom: StringConstructor;
3
+ space: {
4
+ readonly type: StringConstructor;
5
+ };
6
+ spaceTop: {
7
+ readonly type: StringConstructor;
8
+ };
9
+ spaceBottom: {
10
+ readonly type: StringConstructor;
11
+ };
12
+ spaceLeft: {
13
+ readonly type: StringConstructor;
14
+ };
15
+ spaceRight: {
16
+ readonly type: StringConstructor;
17
+ };
6
18
  container: StringConstructor;
7
- gutter: StringConstructor;
19
+ gutter: {
20
+ readonly type: StringConstructor;
21
+ };
8
22
  };
9
23
  styles: CSSStyleSheet[];
10
24
  }>;
@@ -11,7 +11,9 @@ export declare const ZStack: import("atomico/types/dom").Atomico<{
11
11
  type: BooleanConstructor;
12
12
  reflect: true;
13
13
  };
14
- gap: StringConstructor;
14
+ gap: {
15
+ readonly type: StringConstructor;
16
+ };
15
17
  alignsX: StringConstructor;
16
18
  alignsY: StringConstructor;
17
19
  wrap: {
@@ -4,6 +4,10 @@ export declare const resolveRadius: (value?: string) => string | undefined;
4
4
  export declare const resolveJustify: (value?: string) => string | undefined;
5
5
  export declare const resolveAlign: (value?: string) => string | undefined;
6
6
  export declare const resolveGridAlign: (value?: string) => string | undefined;
7
+ export declare const coerceSize: (value?: string | number) => string | undefined;
8
+ export declare const sizeProp: {
9
+ readonly type: StringConstructor;
10
+ };
7
11
  export declare const resolveEdge: (value?: string) => string | undefined;
8
12
  type InsetPropsT = {
9
13
  inset?: string;