@jxsuite/ui 0.0.0 → 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/components/jx-accordion-item.json +281 -0
- package/components/jx-accordion.json +33 -0
- package/components/jx-action-button.json +261 -33
- package/components/jx-action-group.json +123 -0
- package/components/jx-button.json +133 -25
- package/components/jx-checkbox.json +215 -0
- package/components/jx-color-area.json +263 -0
- package/components/jx-color-field.json +565 -0
- package/components/jx-color-slider.json +216 -0
- package/components/jx-combobox.json +544 -0
- package/components/jx-dialog.json +416 -0
- package/components/jx-divider.json +52 -0
- package/components/jx-dot.json +38 -0
- package/components/jx-field.json +162 -0
- package/components/jx-kbd.json +24 -0
- package/components/jx-listbox.json +76 -0
- package/components/jx-menu-item.json +5 -12
- package/components/jx-menu.json +45 -6
- package/components/jx-number-field.json +441 -0
- package/components/jx-option.json +350 -0
- package/components/jx-popover.json +227 -0
- package/components/jx-select.json +637 -0
- package/components/jx-spinner.json +129 -0
- package/components/jx-split.json +221 -0
- package/components/jx-swatch-group.json +107 -0
- package/components/jx-swatch.json +262 -0
- package/components/jx-switch.json +253 -0
- package/components/jx-tab-panel.json +58 -0
- package/components/jx-tab.json +296 -0
- package/components/jx-tabs.json +124 -0
- package/components/jx-textfield.json +639 -0
- package/components/jx-toast-host.json +121 -0
- package/components/jx-toast.json +255 -0
- package/components/jx-toolbar.json +81 -0
- package/components/jx-tooltip.json +207 -0
- package/components/jx-tree-item.json +325 -0
- package/components/jx-tree.json +202 -0
- package/icons/list.json +4 -0
- package/icons/manifest.json +12 -0
- package/package.json +27 -5
- package/project.json +164 -153
- package/src/behaviors/action-group.ts +255 -0
- package/src/behaviors/color-area.ts +303 -0
- package/src/behaviors/color-field.ts +465 -0
- package/src/behaviors/color-slider.ts +154 -0
- package/src/behaviors/combobox.ts +474 -0
- package/src/behaviors/dialog.ts +137 -0
- package/src/behaviors/listbox.ts +118 -0
- package/src/behaviors/menu.ts +80 -48
- package/src/behaviors/number-field.ts +161 -0
- package/src/behaviors/popover.ts +399 -0
- package/src/behaviors/select.ts +154 -0
- package/src/behaviors/split.ts +478 -0
- package/src/behaviors/swatch-group.ts +297 -0
- package/src/behaviors/tabs.ts +319 -0
- package/src/behaviors/textfield.ts +164 -0
- package/src/behaviors/toast-host.ts +241 -0
- package/src/behaviors/toast.ts +261 -0
- package/src/behaviors/toolbar.ts +413 -0
- package/src/behaviors/tooltip.ts +715 -0
- package/src/behaviors/tree.ts +830 -0
- package/src/color.ts +433 -0
- package/src/documents.ts +91 -1
- package/src/index.ts +41 -1
- package/src/loaders.ts +47 -0
- package/src/testing/anchor-support.ts +28 -0
- package/src/testing/popover-shim.ts +39 -6
- package/src/theme.ts +30 -6
- package/stylebook/jx-accordion-item.json +195 -0
- package/stylebook/jx-accordion.json +220 -0
- package/stylebook/jx-action-button.json +191 -23
- package/stylebook/jx-action-group.json +335 -0
- package/stylebook/jx-button.json +129 -26
- package/stylebook/jx-checkbox.json +245 -0
- package/stylebook/jx-color-area.json +272 -0
- package/stylebook/jx-color-field.json +261 -0
- package/stylebook/jx-color-slider.json +220 -0
- package/stylebook/jx-combobox.json +332 -0
- package/stylebook/jx-dialog.json +186 -0
- package/stylebook/jx-divider.json +125 -0
- package/stylebook/jx-dot.json +92 -0
- package/stylebook/jx-field.json +313 -0
- package/stylebook/jx-icon.json +4 -0
- package/stylebook/jx-kbd.json +90 -0
- package/stylebook/jx-listbox.json +337 -0
- package/stylebook/jx-menu.json +0 -1
- package/stylebook/jx-number-field.json +203 -0
- package/stylebook/jx-option.json +285 -0
- package/stylebook/jx-popover.json +123 -0
- package/stylebook/jx-select.json +407 -0
- package/stylebook/jx-spinner.json +111 -0
- package/stylebook/jx-split.json +170 -0
- package/stylebook/jx-swatch-group.json +175 -0
- package/stylebook/jx-swatch.json +249 -0
- package/stylebook/jx-switch.json +240 -0
- package/stylebook/jx-tab-panel.json +147 -0
- package/stylebook/jx-tab.json +201 -0
- package/stylebook/jx-tabs.json +278 -0
- package/stylebook/jx-textfield.json +309 -0
- package/stylebook/jx-toast-host.json +157 -0
- package/stylebook/jx-toast.json +266 -0
- package/stylebook/jx-toolbar.json +435 -0
- package/stylebook/jx-tooltip.json +162 -0
- package/stylebook/jx-tree-item.json +258 -0
- package/stylebook/jx-tree.json +429 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jxsuite.com/schema/v1",
|
|
3
|
+
"$id": "StylebookOption",
|
|
4
|
+
"tagName": "main",
|
|
5
|
+
"$elements": [
|
|
6
|
+
{
|
|
7
|
+
"$ref": "../components/jx-icon.json"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"$ref": "../components/jx-kbd.json"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"$ref": "../components/jx-option.json"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"$ref": "../components/jx-listbox.json"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"state": {
|
|
20
|
+
"picked": "",
|
|
21
|
+
"note": {
|
|
22
|
+
"$prototype": "Function",
|
|
23
|
+
"body": [
|
|
24
|
+
{
|
|
25
|
+
"operator": "=",
|
|
26
|
+
"target": {
|
|
27
|
+
"$ref": "#/state/picked"
|
|
28
|
+
},
|
|
29
|
+
"value": {
|
|
30
|
+
"$ref": "event#/detail"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"style": {
|
|
37
|
+
"fontFamily": "var(--jx-font-sans)",
|
|
38
|
+
"fontSize": "var(--jx-text-md)",
|
|
39
|
+
"color": "var(--jx-fg)",
|
|
40
|
+
"background": "var(--jx-bg)",
|
|
41
|
+
"padding": "var(--jx-space-6)",
|
|
42
|
+
"minHeight": "100vh",
|
|
43
|
+
"& > h1": {
|
|
44
|
+
"fontSize": "var(--jx-text-lg)",
|
|
45
|
+
"fontWeight": "600",
|
|
46
|
+
"margin": "0 0 var(--jx-space-5)"
|
|
47
|
+
},
|
|
48
|
+
"& > h2": {
|
|
49
|
+
"fontSize": "var(--jx-text-md)",
|
|
50
|
+
"fontWeight": "600",
|
|
51
|
+
"margin": "var(--jx-space-6) 0 var(--jx-space-3)"
|
|
52
|
+
},
|
|
53
|
+
"& > p": {
|
|
54
|
+
"color": "var(--jx-fg-dim)",
|
|
55
|
+
"margin": "0 0 var(--jx-space-5)"
|
|
56
|
+
},
|
|
57
|
+
"& jx-listbox": {
|
|
58
|
+
"width": "420px",
|
|
59
|
+
"maxWidth": "100%",
|
|
60
|
+
"padding": "var(--jx-space-2)",
|
|
61
|
+
"border": "1px solid var(--jx-border)",
|
|
62
|
+
"borderRadius": "var(--jx-radius-md)",
|
|
63
|
+
"background": "var(--jx-bg-overlay)"
|
|
64
|
+
},
|
|
65
|
+
"& > [part=\"picked\"]": {
|
|
66
|
+
"margin": "var(--jx-space-3) 0 0",
|
|
67
|
+
"color": "var(--jx-fg-muted)",
|
|
68
|
+
"fontSize": "var(--jx-text-sm)"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"children": [
|
|
72
|
+
{
|
|
73
|
+
"tagName": "h1",
|
|
74
|
+
"textContent": "jx-option"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"tagName": "p",
|
|
78
|
+
"textContent": "One row of a jx-listbox, and never of a select: a custom element inside a <select> renders, reads convincingly in the accessibility tree and cannot be picked at all, which is why a conformance rule now refuses one. A row's words are its label attribute rather than slotted content, so a badge beside them can never become its name."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"tagName": "h2",
|
|
82
|
+
"textContent": "The channels a row can carry"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"tagName": "p",
|
|
86
|
+
"textContent": "A label, a muted description at the end of the row, a glyph in slot=icon and one control or mark in slot=end. Each unused channel draws no box, because a slot leaves no node and the container asks its own :empty."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"tagName": "jx-listbox",
|
|
90
|
+
"attributes": {
|
|
91
|
+
"id": "option-channels"
|
|
92
|
+
},
|
|
93
|
+
"$props": {
|
|
94
|
+
"label": "Commands",
|
|
95
|
+
"active": "option-channels-o1"
|
|
96
|
+
},
|
|
97
|
+
"onselect": {
|
|
98
|
+
"$ref": "#/state/note"
|
|
99
|
+
},
|
|
100
|
+
"children": [
|
|
101
|
+
{
|
|
102
|
+
"tagName": "jx-option",
|
|
103
|
+
"attributes": {
|
|
104
|
+
"id": "option-channels-o0"
|
|
105
|
+
},
|
|
106
|
+
"$props": {
|
|
107
|
+
"value": "open",
|
|
108
|
+
"label": "Open file…"
|
|
109
|
+
},
|
|
110
|
+
"children": [
|
|
111
|
+
{
|
|
112
|
+
"tagName": "jx-icon",
|
|
113
|
+
"attributes": {
|
|
114
|
+
"slot": "icon"
|
|
115
|
+
},
|
|
116
|
+
"$props": {
|
|
117
|
+
"name": "folder-open"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"tagName": "jx-kbd",
|
|
122
|
+
"attributes": {
|
|
123
|
+
"slot": "end"
|
|
124
|
+
},
|
|
125
|
+
"textContent": "⌘O"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"tagName": "jx-option",
|
|
131
|
+
"attributes": {
|
|
132
|
+
"id": "option-channels-o1"
|
|
133
|
+
},
|
|
134
|
+
"$props": {
|
|
135
|
+
"value": "save",
|
|
136
|
+
"label": "Save",
|
|
137
|
+
"description": "~/src/index.jx"
|
|
138
|
+
},
|
|
139
|
+
"children": [
|
|
140
|
+
{
|
|
141
|
+
"tagName": "jx-icon",
|
|
142
|
+
"attributes": {
|
|
143
|
+
"slot": "icon"
|
|
144
|
+
},
|
|
145
|
+
"$props": {
|
|
146
|
+
"name": "floppy-disk"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"tagName": "jx-option",
|
|
153
|
+
"$props": {
|
|
154
|
+
"value": "plain",
|
|
155
|
+
"label": "A row with nothing else on it"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"tagName": "jx-option",
|
|
160
|
+
"$props": {
|
|
161
|
+
"value": "locked",
|
|
162
|
+
"label": "Publish",
|
|
163
|
+
"description": "no project open",
|
|
164
|
+
"disabled": true
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"tagName": "p",
|
|
171
|
+
"attributes": {
|
|
172
|
+
"part": "picked"
|
|
173
|
+
},
|
|
174
|
+
"textContent": "Picked: ${state.picked}"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"tagName": "h2",
|
|
178
|
+
"textContent": "A row that is its own preview"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"tagName": "p",
|
|
182
|
+
"textContent": "face, swatch, line, weight, slant, variant, transform and decoration are the same drawing channels a jx-select row carries, under the same token names: each reaches its own span as a custom property set inline, so seventy rows intern the rules two rows do. The five typographic ones change how the label is drawn and never its words, which is what lets a list of weights read as its weights."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"tagName": "jx-listbox",
|
|
186
|
+
"attributes": {
|
|
187
|
+
"id": "option-previews"
|
|
188
|
+
},
|
|
189
|
+
"$props": {
|
|
190
|
+
"label": "Styles"
|
|
191
|
+
},
|
|
192
|
+
"children": [
|
|
193
|
+
{
|
|
194
|
+
"tagName": "jx-option",
|
|
195
|
+
"$props": {
|
|
196
|
+
"value": "Georgia, serif",
|
|
197
|
+
"label": "Georgia",
|
|
198
|
+
"face": "Georgia, serif"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"tagName": "jx-option",
|
|
203
|
+
"$props": {
|
|
204
|
+
"value": "mono",
|
|
205
|
+
"label": "Courier New",
|
|
206
|
+
"face": "\"Courier New\", monospace"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"tagName": "jx-option",
|
|
211
|
+
"$props": {
|
|
212
|
+
"value": "danger",
|
|
213
|
+
"label": "Danger",
|
|
214
|
+
"swatch": "var(--jx-danger)"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"tagName": "jx-option",
|
|
219
|
+
"$props": {
|
|
220
|
+
"value": "accent",
|
|
221
|
+
"label": "Accent",
|
|
222
|
+
"swatch": "var(--jx-accent)"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"tagName": "jx-option",
|
|
227
|
+
"$props": {
|
|
228
|
+
"value": "dashed",
|
|
229
|
+
"label": "Dashed",
|
|
230
|
+
"line": "dashed"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"tagName": "jx-option",
|
|
235
|
+
"$props": {
|
|
236
|
+
"value": "double",
|
|
237
|
+
"label": "Double",
|
|
238
|
+
"line": "double"
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"tagName": "jx-option",
|
|
243
|
+
"$props": {
|
|
244
|
+
"value": "700",
|
|
245
|
+
"label": "Bold",
|
|
246
|
+
"weight": "700",
|
|
247
|
+
"face": "Georgia, serif"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"tagName": "jx-option",
|
|
252
|
+
"$props": {
|
|
253
|
+
"value": "italic",
|
|
254
|
+
"label": "Italic",
|
|
255
|
+
"slant": "italic"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"tagName": "jx-option",
|
|
260
|
+
"$props": {
|
|
261
|
+
"value": "small-caps",
|
|
262
|
+
"label": "Small caps",
|
|
263
|
+
"variant": "small-caps"
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"tagName": "jx-option",
|
|
268
|
+
"$props": {
|
|
269
|
+
"value": "uppercase",
|
|
270
|
+
"label": "Uppercase",
|
|
271
|
+
"transform": "uppercase"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"tagName": "jx-option",
|
|
276
|
+
"$props": {
|
|
277
|
+
"value": "underline wavy",
|
|
278
|
+
"label": "Underline wavy",
|
|
279
|
+
"decoration": "underline wavy"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
]
|
|
285
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jxsuite.com/schema/v1",
|
|
3
|
+
"$id": "StylebookPopover",
|
|
4
|
+
"tagName": "main",
|
|
5
|
+
"$elements": [
|
|
6
|
+
{
|
|
7
|
+
"$ref": "../components/jx-checkbox.json"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"$ref": "../components/jx-popover.json"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"state": {
|
|
14
|
+
"grid": true,
|
|
15
|
+
"guides": false,
|
|
16
|
+
"rulers": false
|
|
17
|
+
},
|
|
18
|
+
"style": {
|
|
19
|
+
"fontFamily": "var(--jx-font-sans)",
|
|
20
|
+
"fontSize": "var(--jx-text-md)",
|
|
21
|
+
"color": "var(--jx-fg)",
|
|
22
|
+
"background": "var(--jx-bg)",
|
|
23
|
+
"padding": "var(--jx-space-6)",
|
|
24
|
+
"minHeight": "100vh",
|
|
25
|
+
"& > h1": {
|
|
26
|
+
"fontSize": "var(--jx-text-lg)",
|
|
27
|
+
"fontWeight": "600",
|
|
28
|
+
"margin": "0 0 var(--jx-space-5)"
|
|
29
|
+
},
|
|
30
|
+
"& > h2": {
|
|
31
|
+
"fontSize": "var(--jx-text-md)",
|
|
32
|
+
"fontWeight": "600",
|
|
33
|
+
"color": "var(--jx-fg-dim)",
|
|
34
|
+
"margin": "var(--jx-space-6) 0 var(--jx-space-3)"
|
|
35
|
+
},
|
|
36
|
+
"& > p": {
|
|
37
|
+
"color": "var(--jx-fg-dim)",
|
|
38
|
+
"margin": "0 0 var(--jx-space-5)"
|
|
39
|
+
},
|
|
40
|
+
"& button": {
|
|
41
|
+
"font": "inherit",
|
|
42
|
+
"color": "var(--jx-fg)",
|
|
43
|
+
"background": "var(--jx-bg-input)",
|
|
44
|
+
"border": "1px solid var(--jx-border)",
|
|
45
|
+
"borderRadius": "var(--jx-radius-sm)",
|
|
46
|
+
"padding": "var(--jx-space-2) var(--jx-space-4)"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"children": [
|
|
50
|
+
{
|
|
51
|
+
"tagName": "h1",
|
|
52
|
+
"textContent": "jx-popover"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"tagName": "p",
|
|
56
|
+
"textContent": "A panel is a native auto popover with one unnamed slot. Light dismiss, Escape and focus restoration are the platform's; the element adds no key of its own. It is placed by measured viewport coordinates, and the gap between it and its trigger is the --jx-popover-offset token."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"tagName": "h2",
|
|
60
|
+
"textContent": "A named panel of controls"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"tagName": "p",
|
|
64
|
+
"textContent": "A panel holding controls MUST set label: it becomes a named role=\"group\", so the panel announces a boundary on entry. An unnamed group is invisible to every gate, which is why the element cannot leave this to the consumer's judgement alone."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"tagName": "button",
|
|
68
|
+
"attributes": {
|
|
69
|
+
"popovertarget": "stylebook-popover-grid"
|
|
70
|
+
},
|
|
71
|
+
"textContent": "Grid options…"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"tagName": "jx-popover",
|
|
75
|
+
"attributes": {
|
|
76
|
+
"id": "stylebook-popover-grid"
|
|
77
|
+
},
|
|
78
|
+
"$props": {
|
|
79
|
+
"label": "Grid options",
|
|
80
|
+
"x": 24,
|
|
81
|
+
"y": 200,
|
|
82
|
+
"arrow": true
|
|
83
|
+
},
|
|
84
|
+
"children": [
|
|
85
|
+
{
|
|
86
|
+
"tagName": "jx-checkbox",
|
|
87
|
+
"$props": {
|
|
88
|
+
"checked": {
|
|
89
|
+
"$ref": "#/state/grid"
|
|
90
|
+
},
|
|
91
|
+
"label": "Show grid"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"tagName": "jx-checkbox",
|
|
96
|
+
"$props": {
|
|
97
|
+
"checked": {
|
|
98
|
+
"$ref": "#/state/guides"
|
|
99
|
+
},
|
|
100
|
+
"label": "Show guides"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"tagName": "jx-checkbox",
|
|
105
|
+
"$props": {
|
|
106
|
+
"checked": {
|
|
107
|
+
"$ref": "#/state/rulers"
|
|
108
|
+
},
|
|
109
|
+
"label": "Show rulers"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"tagName": "h2",
|
|
116
|
+
"textContent": "How a page opens one"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"tagName": "p",
|
|
120
|
+
"textContent": "The trigger above is a raw <button popovertarget>, which every caller of the overlay lints accepts. So is $props: { popovertarget } on a kit button, because the lints read a node's attributes and never its $props. The third spelling, popovertarget in a kit button's attributes, DEPENDS ON THE CALLER: the rule judges the tag the document writes rather than the tag the definition renders, so a caller that names the kit's invoker tags (Studio does) reports nothing, and a caller that names none reports invoker-not-button."
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
}
|