@jxsuite/ui 0.0.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.
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 +268 -34
  4. package/components/jx-action-group.json +131 -0
  5. package/components/jx-button.json +141 -26
  6. package/components/jx-checkbox.json +222 -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 +551 -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 +6 -13
  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 +331 -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 +645 -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 +719 -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,313 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "StylebookField",
4
+ "tagName": "main",
5
+ "$elements": [
6
+ {
7
+ "$ref": "../components/jx-field.json"
8
+ },
9
+ {
10
+ "$ref": "../components/jx-textfield.json"
11
+ },
12
+ {
13
+ "$ref": "../components/jx-checkbox.json"
14
+ },
15
+ {
16
+ "$ref": "../components/jx-switch.json"
17
+ },
18
+ {
19
+ "$ref": "../components/jx-number-field.json"
20
+ }
21
+ ],
22
+ "style": {
23
+ "fontFamily": "var(--jx-font-sans)",
24
+ "fontSize": "var(--jx-text-md)",
25
+ "color": "var(--jx-fg)",
26
+ "background": "var(--jx-bg)",
27
+ "padding": "var(--jx-space-6)",
28
+ "minHeight": "100vh",
29
+ "& > h1": {
30
+ "fontSize": "var(--jx-text-lg)",
31
+ "fontWeight": "600",
32
+ "margin": "0 0 var(--jx-space-5)"
33
+ },
34
+ "& > h2": {
35
+ "fontSize": "var(--jx-text-md)",
36
+ "fontWeight": "600",
37
+ "color": "var(--jx-fg-dim)",
38
+ "margin": "var(--jx-space-6) 0 var(--jx-space-3)"
39
+ },
40
+ "& > p": {
41
+ "color": "var(--jx-fg-dim)",
42
+ "margin": "0 0 var(--jx-space-5)",
43
+ "maxWidth": "60ch"
44
+ },
45
+ "& code": {
46
+ "fontFamily": "var(--jx-font-mono)",
47
+ "color": "var(--jx-tag)"
48
+ }
49
+ },
50
+ "children": [
51
+ {
52
+ "tagName": "h1",
53
+ "textContent": "jx-field"
54
+ },
55
+ {
56
+ "tagName": "p",
57
+ "textContent": "One row of a settings panel: a label, the control it names, and the sentence under both. The row mints its own ids and hands them to the control as labelledby, and as describedby when the help line has something in it — the Visible row below has no sentence, so its box is named and described by nothing. Nothing on this page writes an id."
58
+ },
59
+ {
60
+ "tagName": "h2",
61
+ "textContent": "A row per control"
62
+ },
63
+ {
64
+ "tagName": "div",
65
+ "style": {
66
+ "display": "flex",
67
+ "flexDirection": "column",
68
+ "maxWidth": "420px",
69
+ "margin": "0 0 var(--jx-space-5)"
70
+ },
71
+ "children": [
72
+ {
73
+ "tagName": "jx-field",
74
+ "$props": {
75
+ "label": "Title",
76
+ "description": "Shown in the Library and in the browser tab."
77
+ },
78
+ "children": [
79
+ {
80
+ "tagName": "jx-textfield",
81
+ "$props": {
82
+ "placeholder": "Untitled"
83
+ }
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "tagName": "jx-field",
89
+ "$props": {
90
+ "label": "Columns",
91
+ "description": "Between 1 and 12."
92
+ },
93
+ "children": [
94
+ {
95
+ "tagName": "jx-number-field",
96
+ "$props": {
97
+ "min": "1",
98
+ "max": "12",
99
+ "step": "1",
100
+ "stepper": true,
101
+ "value": "3"
102
+ }
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "tagName": "jx-field",
108
+ "$props": {
109
+ "label": "Visible"
110
+ },
111
+ "children": [
112
+ {
113
+ "tagName": "jx-checkbox",
114
+ "$props": {
115
+ "checked": true
116
+ }
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "tagName": "jx-field",
122
+ "$props": {
123
+ "label": "Minify",
124
+ "description": "Strips whitespace from the built CSS and JavaScript."
125
+ },
126
+ "children": [
127
+ {
128
+ "tagName": "jx-switch"
129
+ }
130
+ ]
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "tagName": "h2",
136
+ "textContent": "Required, invalid and warning"
137
+ },
138
+ {
139
+ "tagName": "p",
140
+ "textContent": "The required mark is drawn in content with an empty alt string, so it never reaches the control's accessible name. Invalid tints the label and the sentence; warning tints the label alone."
141
+ },
142
+ {
143
+ "tagName": "div",
144
+ "style": {
145
+ "display": "flex",
146
+ "flexDirection": "column",
147
+ "maxWidth": "420px",
148
+ "margin": "0 0 var(--jx-space-5)"
149
+ },
150
+ "children": [
151
+ {
152
+ "tagName": "jx-field",
153
+ "$props": {
154
+ "label": "Slug",
155
+ "required": true,
156
+ "description": "The path this page is published at."
157
+ },
158
+ "children": [
159
+ {
160
+ "tagName": "jx-textfield",
161
+ "$props": {
162
+ "value": "about"
163
+ }
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "tagName": "jx-field",
169
+ "$props": {
170
+ "label": "Slug",
171
+ "required": true,
172
+ "invalid": true,
173
+ "description": "A slug cannot contain a space."
174
+ },
175
+ "children": [
176
+ {
177
+ "tagName": "jx-textfield",
178
+ "$props": {
179
+ "value": "about us",
180
+ "invalid": true
181
+ }
182
+ }
183
+ ]
184
+ },
185
+ {
186
+ "tagName": "jx-field",
187
+ "$props": {
188
+ "label": "Alt text",
189
+ "warning": true,
190
+ "description": "An image with no alt text is skipped by a screen reader."
191
+ },
192
+ "children": [
193
+ {
194
+ "tagName": "jx-textfield",
195
+ "$props": {
196
+ "placeholder": "Describe the image"
197
+ }
198
+ }
199
+ ]
200
+ }
201
+ ]
202
+ },
203
+ {
204
+ "tagName": "h2",
205
+ "textContent": "Spanned"
206
+ },
207
+ {
208
+ "tagName": "p",
209
+ "textContent": "span collapses the row to one column: the label sits above the control and reads from the left. It is the shape a long label or a wide control needs."
210
+ },
211
+ {
212
+ "tagName": "div",
213
+ "style": {
214
+ "display": "flex",
215
+ "flexDirection": "column",
216
+ "maxWidth": "420px",
217
+ "margin": "0 0 var(--jx-space-5)"
218
+ },
219
+ "children": [
220
+ {
221
+ "tagName": "jx-field",
222
+ "$props": {
223
+ "span": true,
224
+ "label": "Description used by search engines",
225
+ "description": "Around 155 characters. Longer is truncated in the result."
226
+ },
227
+ "children": [
228
+ {
229
+ "tagName": "jx-textfield",
230
+ "$props": {
231
+ "multiline": true,
232
+ "rows": "3",
233
+ "placeholder": "A sentence about this page"
234
+ }
235
+ }
236
+ ]
237
+ }
238
+ ]
239
+ },
240
+ {
241
+ "tagName": "h2",
242
+ "textContent": "Slotted help, and a native control"
243
+ },
244
+ {
245
+ "tagName": "p",
246
+ "textContent": "Anything slotted into help replaces the description rather than stacking with it. A native control slotted straight in is the one case the row cannot name: nothing in its definition observes labelledby, so it must carry its own aria-labelledby."
247
+ },
248
+ {
249
+ "tagName": "div",
250
+ "style": {
251
+ "display": "flex",
252
+ "flexDirection": "column",
253
+ "maxWidth": "420px"
254
+ },
255
+ "children": [
256
+ {
257
+ "tagName": "jx-field",
258
+ "$props": {
259
+ "label": "Selector",
260
+ "description": "This sentence is replaced by the slotted one."
261
+ },
262
+ "children": [
263
+ {
264
+ "tagName": "jx-textfield",
265
+ "$props": {
266
+ "mono": true,
267
+ "value": "main > .card"
268
+ }
269
+ },
270
+ {
271
+ "tagName": "span",
272
+ "attributes": {
273
+ "slot": "help"
274
+ },
275
+ "children": [
276
+ "Any selector ",
277
+ {
278
+ "tagName": "code",
279
+ "textContent": "querySelector"
280
+ },
281
+ " accepts."
282
+ ]
283
+ }
284
+ ]
285
+ },
286
+ {
287
+ "tagName": "jx-field",
288
+ "$props": {
289
+ "label": "Language"
290
+ },
291
+ "children": [
292
+ {
293
+ "tagName": "select",
294
+ "attributes": {
295
+ "aria-label": "Language"
296
+ },
297
+ "children": [
298
+ {
299
+ "tagName": "option",
300
+ "textContent": "English"
301
+ },
302
+ {
303
+ "tagName": "option",
304
+ "textContent": "Português"
305
+ }
306
+ ]
307
+ }
308
+ ]
309
+ }
310
+ ]
311
+ }
312
+ ]
313
+ }
@@ -29,6 +29,7 @@
29
29
  "arrow-up",
30
30
  "arrows-clockwise",
31
31
  "arrows-horizontal",
32
+ "arrows-in-line-horizontal",
32
33
  "arrows-out",
33
34
  "arrows-out-line-horizontal",
34
35
  "arrows-out-line-vertical",
@@ -54,6 +55,7 @@
54
55
  "export",
55
56
  "eye",
56
57
  "eye-slash",
58
+ "eyedropper",
57
59
  "file",
58
60
  "file-code",
59
61
  "file-text",
@@ -73,6 +75,7 @@
73
75
  "link",
74
76
  "list",
75
77
  "list-bullets",
78
+ "lock-simple",
76
79
  "magnifying-glass",
77
80
  "minus",
78
81
  "paint-brush",
@@ -93,6 +96,7 @@
93
96
  "stack",
94
97
  "stop",
95
98
  "tag",
99
+ "text-a-underline",
96
100
  "text-aa",
97
101
  "text-align-center",
98
102
  "text-align-justify",
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "StylebookKbd",
4
+ "tagName": "main",
5
+ "$elements": [
6
+ { "$ref": "../components/jx-kbd.json" },
7
+ { "$ref": "../components/jx-icon.json" },
8
+ { "$ref": "../components/jx-divider.json" }
9
+ ],
10
+ "state": {
11
+ "chord": ["Ctrl", "Shift", "P"]
12
+ },
13
+ "style": {
14
+ "fontFamily": "var(--jx-font-sans)",
15
+ "fontSize": "var(--jx-text-md)",
16
+ "color": "var(--jx-fg)",
17
+ "background": "var(--jx-bg)",
18
+ "padding": "var(--jx-space-6)",
19
+ "minHeight": "100vh",
20
+ "& > h1": {
21
+ "fontSize": "var(--jx-text-lg)",
22
+ "fontWeight": "600",
23
+ "margin": "0 0 var(--jx-space-5)"
24
+ },
25
+ "& > p": { "color": "var(--jx-fg-dim)", "margin": "0 0 var(--jx-space-5)" },
26
+ "& [role=\"group\"]": {
27
+ "display": "flex",
28
+ "alignItems": "center",
29
+ "gap": "var(--jx-space-3)",
30
+ "margin": "0 0 var(--jx-space-4)"
31
+ },
32
+ "& [role=\"group\"] > span": {
33
+ "width": "120px",
34
+ "color": "var(--jx-fg-muted)",
35
+ "fontSize": "var(--jx-text-sm)"
36
+ },
37
+ "& [data-narrow]": {
38
+ "width": "240px",
39
+ "lineHeight": "var(--jx-leading-md)",
40
+ "padding": "var(--jx-space-3)",
41
+ "border": "1px solid var(--jx-border)",
42
+ "borderRadius": "var(--jx-radius-sm)"
43
+ }
44
+ },
45
+ "children": [
46
+ { "tagName": "h1", "textContent": "jx-kbd" },
47
+ {
48
+ "tagName": "p",
49
+ "textContent": "A key cap. It is an atomic inline box, so it sits on the text baseline and a line break falls between caps rather than through one — which is the whole reason it declares inline-block instead of taking the runtime's block default."
50
+ },
51
+ {
52
+ "tagName": "div",
53
+ "attributes": { "role": "group", "aria-label": "One chord, spelled out" },
54
+ "children": [
55
+ { "tagName": "span", "textContent": "a chord" },
56
+ {
57
+ "$prototype": "Array",
58
+ "items": { "$ref": "#/state/chord" },
59
+ "key": { "$ref": "$map/item" },
60
+ "map": { "tagName": "jx-kbd", "textContent": "${$map.item}" }
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "tagName": "div",
66
+ "attributes": { "role": "group", "aria-label": "Beside a menu label" },
67
+ "children": [
68
+ { "tagName": "span", "textContent": "in a row" },
69
+ { "tagName": "jx-icon", "$props": { "name": "magnifying-glass" } },
70
+ { "tagName": "span", "textContent": "Find in files" },
71
+ { "tagName": "jx-divider", "$props": { "orientation": "vertical" } },
72
+ { "tagName": "jx-kbd", "textContent": "Ctrl" },
73
+ { "tagName": "jx-kbd", "textContent": "F" }
74
+ ]
75
+ },
76
+ {
77
+ "tagName": "p",
78
+ "attributes": { "data-narrow": "" },
79
+ "children": [
80
+ "Press ",
81
+ { "tagName": "jx-kbd", "textContent": "Ctrl" },
82
+ " then ",
83
+ { "tagName": "jx-kbd", "textContent": "Shift" },
84
+ " and finally ",
85
+ { "tagName": "jx-kbd", "textContent": "Enter" },
86
+ " to run the command that is showing."
87
+ ]
88
+ }
89
+ ]
90
+ }