@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.
Files changed (105) hide show
  1. package/components/jx-accordion-item.json +281 -0
  2. package/components/jx-accordion.json +33 -0
  3. package/components/jx-action-button.json +261 -33
  4. package/components/jx-action-group.json +123 -0
  5. package/components/jx-button.json +133 -25
  6. package/components/jx-checkbox.json +215 -0
  7. package/components/jx-color-area.json +263 -0
  8. package/components/jx-color-field.json +565 -0
  9. package/components/jx-color-slider.json +216 -0
  10. package/components/jx-combobox.json +544 -0
  11. package/components/jx-dialog.json +416 -0
  12. package/components/jx-divider.json +52 -0
  13. package/components/jx-dot.json +38 -0
  14. package/components/jx-field.json +162 -0
  15. package/components/jx-kbd.json +24 -0
  16. package/components/jx-listbox.json +76 -0
  17. package/components/jx-menu-item.json +5 -12
  18. package/components/jx-menu.json +45 -6
  19. package/components/jx-number-field.json +441 -0
  20. package/components/jx-option.json +350 -0
  21. package/components/jx-popover.json +227 -0
  22. package/components/jx-select.json +637 -0
  23. package/components/jx-spinner.json +129 -0
  24. package/components/jx-split.json +221 -0
  25. package/components/jx-swatch-group.json +107 -0
  26. package/components/jx-swatch.json +262 -0
  27. package/components/jx-switch.json +253 -0
  28. package/components/jx-tab-panel.json +58 -0
  29. package/components/jx-tab.json +296 -0
  30. package/components/jx-tabs.json +124 -0
  31. package/components/jx-textfield.json +639 -0
  32. package/components/jx-toast-host.json +121 -0
  33. package/components/jx-toast.json +255 -0
  34. package/components/jx-toolbar.json +81 -0
  35. package/components/jx-tooltip.json +207 -0
  36. package/components/jx-tree-item.json +325 -0
  37. package/components/jx-tree.json +202 -0
  38. package/icons/list.json +4 -0
  39. package/icons/manifest.json +12 -0
  40. package/package.json +27 -5
  41. package/project.json +164 -153
  42. package/src/behaviors/action-group.ts +255 -0
  43. package/src/behaviors/color-area.ts +303 -0
  44. package/src/behaviors/color-field.ts +465 -0
  45. package/src/behaviors/color-slider.ts +154 -0
  46. package/src/behaviors/combobox.ts +474 -0
  47. package/src/behaviors/dialog.ts +137 -0
  48. package/src/behaviors/listbox.ts +118 -0
  49. package/src/behaviors/menu.ts +80 -48
  50. package/src/behaviors/number-field.ts +161 -0
  51. package/src/behaviors/popover.ts +399 -0
  52. package/src/behaviors/select.ts +154 -0
  53. package/src/behaviors/split.ts +478 -0
  54. package/src/behaviors/swatch-group.ts +297 -0
  55. package/src/behaviors/tabs.ts +319 -0
  56. package/src/behaviors/textfield.ts +164 -0
  57. package/src/behaviors/toast-host.ts +241 -0
  58. package/src/behaviors/toast.ts +261 -0
  59. package/src/behaviors/toolbar.ts +413 -0
  60. package/src/behaviors/tooltip.ts +715 -0
  61. package/src/behaviors/tree.ts +830 -0
  62. package/src/color.ts +433 -0
  63. package/src/documents.ts +91 -1
  64. package/src/index.ts +41 -1
  65. package/src/loaders.ts +47 -0
  66. package/src/testing/anchor-support.ts +28 -0
  67. package/src/testing/popover-shim.ts +39 -6
  68. package/src/theme.ts +30 -6
  69. package/stylebook/jx-accordion-item.json +195 -0
  70. package/stylebook/jx-accordion.json +220 -0
  71. package/stylebook/jx-action-button.json +191 -23
  72. package/stylebook/jx-action-group.json +335 -0
  73. package/stylebook/jx-button.json +129 -26
  74. package/stylebook/jx-checkbox.json +245 -0
  75. package/stylebook/jx-color-area.json +272 -0
  76. package/stylebook/jx-color-field.json +261 -0
  77. package/stylebook/jx-color-slider.json +220 -0
  78. package/stylebook/jx-combobox.json +332 -0
  79. package/stylebook/jx-dialog.json +186 -0
  80. package/stylebook/jx-divider.json +125 -0
  81. package/stylebook/jx-dot.json +92 -0
  82. package/stylebook/jx-field.json +313 -0
  83. package/stylebook/jx-icon.json +4 -0
  84. package/stylebook/jx-kbd.json +90 -0
  85. package/stylebook/jx-listbox.json +337 -0
  86. package/stylebook/jx-menu.json +0 -1
  87. package/stylebook/jx-number-field.json +203 -0
  88. package/stylebook/jx-option.json +285 -0
  89. package/stylebook/jx-popover.json +123 -0
  90. package/stylebook/jx-select.json +407 -0
  91. package/stylebook/jx-spinner.json +111 -0
  92. package/stylebook/jx-split.json +170 -0
  93. package/stylebook/jx-swatch-group.json +175 -0
  94. package/stylebook/jx-swatch.json +249 -0
  95. package/stylebook/jx-switch.json +240 -0
  96. package/stylebook/jx-tab-panel.json +147 -0
  97. package/stylebook/jx-tab.json +201 -0
  98. package/stylebook/jx-tabs.json +278 -0
  99. package/stylebook/jx-textfield.json +309 -0
  100. package/stylebook/jx-toast-host.json +157 -0
  101. package/stylebook/jx-toast.json +266 -0
  102. package/stylebook/jx-toolbar.json +435 -0
  103. package/stylebook/jx-tooltip.json +162 -0
  104. package/stylebook/jx-tree-item.json +258 -0
  105. package/stylebook/jx-tree.json +429 -0
@@ -0,0 +1,429 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "StylebookTree",
4
+ "tagName": "main",
5
+ "$elements": [
6
+ {
7
+ "$ref": "../components/jx-icon.json"
8
+ },
9
+ {
10
+ "$ref": "../components/jx-tree-item.json"
11
+ },
12
+ {
13
+ "$ref": "../components/jx-tree.json"
14
+ }
15
+ ],
16
+ "state": {
17
+ "outline": [
18
+ {
19
+ "key": "body",
20
+ "label": "body",
21
+ "level": 1,
22
+ "posinset": 1,
23
+ "setsize": 1,
24
+ "expanded": "true"
25
+ },
26
+ {
27
+ "key": "header",
28
+ "label": "header",
29
+ "level": 2,
30
+ "posinset": 1,
31
+ "setsize": 3,
32
+ "expanded": "false"
33
+ },
34
+ {
35
+ "key": "main",
36
+ "label": "main",
37
+ "level": 2,
38
+ "posinset": 2,
39
+ "setsize": 3,
40
+ "expanded": "true"
41
+ },
42
+ {
43
+ "key": "hero",
44
+ "label": "Hero",
45
+ "level": 3,
46
+ "posinset": 1,
47
+ "setsize": 2,
48
+ "expanded": ""
49
+ },
50
+ {
51
+ "key": "prose",
52
+ "label": "Article body",
53
+ "level": 3,
54
+ "posinset": 2,
55
+ "setsize": 2,
56
+ "expanded": ""
57
+ },
58
+ {
59
+ "key": "footer",
60
+ "label": "footer",
61
+ "level": 2,
62
+ "posinset": 3,
63
+ "setsize": 3,
64
+ "expanded": ""
65
+ }
66
+ ],
67
+ "files": [
68
+ {
69
+ "key": "src",
70
+ "label": "src",
71
+ "level": 1,
72
+ "posinset": 41,
73
+ "setsize": 4096,
74
+ "expanded": "true",
75
+ "icon": "folder"
76
+ },
77
+ {
78
+ "key": "src/index.page.json",
79
+ "label": "index.page.json",
80
+ "level": 2,
81
+ "posinset": 1,
82
+ "setsize": 812,
83
+ "expanded": "",
84
+ "icon": "file"
85
+ },
86
+ {
87
+ "key": "src/about.page.json",
88
+ "label": "about.page.json",
89
+ "level": 2,
90
+ "posinset": 2,
91
+ "setsize": 812,
92
+ "expanded": "",
93
+ "icon": "file"
94
+ },
95
+ {
96
+ "key": "src/pricing.page.json",
97
+ "label": "pricing.page.json",
98
+ "level": 2,
99
+ "posinset": 3,
100
+ "setsize": 812,
101
+ "expanded": "",
102
+ "icon": "file"
103
+ }
104
+ ],
105
+ "current": "body",
106
+ "picked": "body",
107
+ "mode": "replace",
108
+ "anchor": "body",
109
+ "asked": "nothing yet",
110
+ "beyond": "nothing yet",
111
+ "onChange": {
112
+ "$prototype": "Function",
113
+ "body": [
114
+ {
115
+ "operator": "=",
116
+ "target": {
117
+ "$ref": "#/state/current"
118
+ },
119
+ "value": {
120
+ "$ref": "event#/detail"
121
+ }
122
+ }
123
+ ]
124
+ },
125
+ "onSelect": {
126
+ "$prototype": "Function",
127
+ "body": [
128
+ {
129
+ "operator": "=",
130
+ "target": {
131
+ "$ref": "#/state/picked"
132
+ },
133
+ "value": {
134
+ "$ref": "event#/detail/value"
135
+ }
136
+ },
137
+ {
138
+ "operator": "=",
139
+ "target": {
140
+ "$ref": "#/state/mode"
141
+ },
142
+ "value": {
143
+ "$ref": "event#/detail/mode"
144
+ }
145
+ },
146
+ {
147
+ "operator": "=",
148
+ "target": {
149
+ "$ref": "#/state/anchor"
150
+ },
151
+ "value": {
152
+ "$ref": "event#/detail/anchor"
153
+ }
154
+ }
155
+ ]
156
+ },
157
+ "onExpand": {
158
+ "$prototype": "Function",
159
+ "body": [
160
+ {
161
+ "operator": "=",
162
+ "target": {
163
+ "$ref": "#/state/asked"
164
+ },
165
+ "value": {
166
+ "$ref": "event#/detail/value"
167
+ }
168
+ }
169
+ ]
170
+ },
171
+ "onMove": {
172
+ "$prototype": "Function",
173
+ "body": [
174
+ {
175
+ "operator": "=",
176
+ "target": {
177
+ "$ref": "#/state/beyond"
178
+ },
179
+ "value": {
180
+ "$ref": "event#/detail/key"
181
+ }
182
+ }
183
+ ]
184
+ }
185
+ },
186
+ "style": {
187
+ "fontFamily": "var(--jx-font-sans)",
188
+ "fontSize": "var(--jx-text-md)",
189
+ "color": "var(--jx-fg)",
190
+ "background": "var(--jx-bg)",
191
+ "padding": "var(--jx-space-6)",
192
+ "minHeight": "100vh",
193
+ "& > h1": {
194
+ "fontSize": "var(--jx-text-lg)",
195
+ "fontWeight": "600",
196
+ "margin": "0 0 var(--jx-space-5)"
197
+ },
198
+ "& > h2": {
199
+ "fontSize": "var(--jx-text-md)",
200
+ "fontWeight": "600",
201
+ "margin": "var(--jx-space-6) 0 var(--jx-space-3)"
202
+ },
203
+ "& > p": {
204
+ "color": "var(--jx-fg-dim)",
205
+ "margin": "0 0 var(--jx-space-5)",
206
+ "maxWidth": "72ch"
207
+ },
208
+ "& jx-tree": {
209
+ "maxWidth": "280px",
210
+ "border": "1px solid var(--jx-border)",
211
+ "borderRadius": "var(--jx-radius-sm)",
212
+ "background": "var(--jx-bg-panel)",
213
+ "padding": "var(--jx-space-1) 0"
214
+ },
215
+ "& [part=\"scroller\"]": {
216
+ "$description": "The tree owns no scrollbar, so the windowed example supplies one — which is exactly the arrangement a host is in.",
217
+ "maxWidth": "280px",
218
+ "maxHeight": "120px",
219
+ "overflowY": "auto",
220
+ "border": "1px solid var(--jx-border)",
221
+ "borderRadius": "var(--jx-radius-sm)",
222
+ "background": "var(--jx-bg-panel)"
223
+ },
224
+ "& [part=\"scroller\"] jx-tree": {
225
+ "maxWidth": "none",
226
+ "border": "0",
227
+ "borderRadius": "0"
228
+ }
229
+ },
230
+ "children": [
231
+ {
232
+ "tagName": "h1",
233
+ "textContent": "jx-tree"
234
+ },
235
+ {
236
+ "tagName": "p",
237
+ "textContent": "The host IS the tree and its rows are its own children, with nothing generic between them. Rows are FLAT and already projected: each carries its own level, position and set size, because a windowed tree draws a slice of a model that may be thousands of rows long."
238
+ },
239
+ {
240
+ "tagName": "h2",
241
+ "textContent": "An outline"
242
+ },
243
+ {
244
+ "tagName": "p",
245
+ "textContent": "Arrows walk the rows and do not wrap. Right opens a closed row and steps into an open one; Left closes an open row and steps out of a closed one. Caret: ${state.current}. Last expand asked for: ${state.asked}."
246
+ },
247
+ {
248
+ "tagName": "jx-tree",
249
+ "attributes": {
250
+ "label": "Document outline",
251
+ "current": "${state.current}"
252
+ },
253
+ "onchange": {
254
+ "$ref": "#/state/onChange"
255
+ },
256
+ "onselect": {
257
+ "$ref": "#/state/onSelect"
258
+ },
259
+ "onexpand": {
260
+ "$ref": "#/state/onExpand"
261
+ },
262
+ "children": [
263
+ {
264
+ "$prototype": "Array",
265
+ "items": {
266
+ "$ref": "#/state/outline"
267
+ },
268
+ "key": {
269
+ "$ref": "$map/item/key"
270
+ },
271
+ "map": {
272
+ "tagName": "jx-tree-item",
273
+ "$props": {
274
+ "value": {
275
+ "$ref": "$map/item/key"
276
+ },
277
+ "label": {
278
+ "$ref": "$map/item/label"
279
+ },
280
+ "level": {
281
+ "$ref": "$map/item/level"
282
+ },
283
+ "posinset": {
284
+ "$ref": "$map/item/posinset"
285
+ },
286
+ "setsize": {
287
+ "$ref": "$map/item/setsize"
288
+ },
289
+ "expanded": {
290
+ "$ref": "$map/item/expanded"
291
+ },
292
+ "selected": "${state.picked === $map.item.key}"
293
+ }
294
+ }
295
+ }
296
+ ]
297
+ },
298
+ {
299
+ "tagName": "h2",
300
+ "textContent": "Multiple selection"
301
+ },
302
+ {
303
+ "tagName": "p",
304
+ "textContent": "Shift extends from the anchor, Ctrl or Cmd toggles, a plain move replaces. The element dispatches the INTENT and the host resolves it, because the rows a range covers are exactly the ones a windowed tree may not have drawn. Last intent: ${state.mode} of ${state.picked}, anchored at ${state.anchor}."
305
+ },
306
+ {
307
+ "tagName": "jx-tree",
308
+ "attributes": {
309
+ "label": "Outline, multi-select",
310
+ "multiple": ""
311
+ },
312
+ "onselect": {
313
+ "$ref": "#/state/onSelect"
314
+ },
315
+ "children": [
316
+ {
317
+ "$prototype": "Array",
318
+ "items": {
319
+ "$ref": "#/state/outline"
320
+ },
321
+ "key": {
322
+ "$ref": "$map/item/key"
323
+ },
324
+ "map": {
325
+ "tagName": "jx-tree-item",
326
+ "$props": {
327
+ "value": {
328
+ "$ref": "$map/item/key"
329
+ },
330
+ "label": {
331
+ "$ref": "$map/item/label"
332
+ },
333
+ "level": {
334
+ "$ref": "$map/item/level"
335
+ },
336
+ "posinset": {
337
+ "$ref": "$map/item/posinset"
338
+ },
339
+ "setsize": {
340
+ "$ref": "$map/item/setsize"
341
+ },
342
+ "expanded": {
343
+ "$ref": "$map/item/expanded"
344
+ },
345
+ "grip": true
346
+ }
347
+ }
348
+ }
349
+ ]
350
+ },
351
+ {
352
+ "tagName": "h2",
353
+ "textContent": "Windowed"
354
+ },
355
+ {
356
+ "tagName": "p",
357
+ "textContent": "Four rows of a project holding 812 files, with the rest reserved as two spacers. The counts a reader hears are the MODEL's; a caret move past a spacer dispatches move rather than clamping, and the host scrolls. Last move the slice could not answer: ${state.beyond}."
358
+ },
359
+ {
360
+ "tagName": "div",
361
+ "attributes": {
362
+ "part": "scroller"
363
+ },
364
+ "children": [
365
+ {
366
+ "tagName": "jx-tree",
367
+ "attributes": {
368
+ "label": "Project files",
369
+ "padtop": "960",
370
+ "padbottom": "18480"
371
+ },
372
+ "onmove": {
373
+ "$ref": "#/state/onMove"
374
+ },
375
+ "onselect": {
376
+ "$ref": "#/state/onSelect"
377
+ },
378
+ "children": [
379
+ {
380
+ "$prototype": "Array",
381
+ "items": {
382
+ "$ref": "#/state/files"
383
+ },
384
+ "key": {
385
+ "$ref": "$map/item/key"
386
+ },
387
+ "map": {
388
+ "tagName": "jx-tree-item",
389
+ "$props": {
390
+ "value": {
391
+ "$ref": "$map/item/key"
392
+ },
393
+ "label": {
394
+ "$ref": "$map/item/label"
395
+ },
396
+ "level": {
397
+ "$ref": "$map/item/level"
398
+ },
399
+ "posinset": {
400
+ "$ref": "$map/item/posinset"
401
+ },
402
+ "setsize": {
403
+ "$ref": "$map/item/setsize"
404
+ },
405
+ "expanded": {
406
+ "$ref": "$map/item/expanded"
407
+ }
408
+ },
409
+ "children": [
410
+ {
411
+ "tagName": "jx-icon",
412
+ "attributes": {
413
+ "slot": "icon"
414
+ },
415
+ "$props": {
416
+ "name": {
417
+ "$ref": "$map/item/icon"
418
+ }
419
+ }
420
+ }
421
+ ]
422
+ }
423
+ }
424
+ ]
425
+ }
426
+ ]
427
+ }
428
+ ]
429
+ }