@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,416 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "JxDialog",
4
+ "tagName": "jx-dialog",
5
+ "observedAttributes": [
6
+ "headline",
7
+ "confirm-label",
8
+ "secondary-label",
9
+ "cancel-label",
10
+ "destructive",
11
+ "dismissible",
12
+ "size"
13
+ ],
14
+ "$elements": [
15
+ {
16
+ "$ref": "./jx-button.json"
17
+ }
18
+ ],
19
+ "state": {
20
+ "headline": {
21
+ "type": "string",
22
+ "default": "",
23
+ "attribute": "headline",
24
+ "description": "The dialog's title, which is also its accessible name. Empty for a dialog named by its content."
25
+ },
26
+ "confirmLabel": {
27
+ "type": "string",
28
+ "default": "OK",
29
+ "attribute": "confirm-label",
30
+ "description": "The primary button's text; empty for no primary button."
31
+ },
32
+ "secondaryLabel": {
33
+ "type": "string",
34
+ "default": "",
35
+ "attribute": "secondary-label",
36
+ "description": "A third answer beside confirm and cancel, such as Discard; empty for none."
37
+ },
38
+ "cancelLabel": {
39
+ "type": "string",
40
+ "default": "Cancel",
41
+ "attribute": "cancel-label",
42
+ "description": "The cancel button's text; empty for no cancel button."
43
+ },
44
+ "destructive": {
45
+ "type": "boolean",
46
+ "default": false,
47
+ "attribute": "destructive",
48
+ "description": "The primary action destroys something: its button draws in the negative variant, and the dialog opens with CANCEL focused instead of it, so a reader who answers with Enter does not destroy anything."
49
+ },
50
+ "dismissible": {
51
+ "type": "boolean",
52
+ "default": false,
53
+ "attribute": "dismissible",
54
+ "description": "A click outside the dialog closes it, as Escape always does. Off for an answer the reader must give."
55
+ },
56
+ "size": {
57
+ "type": "string",
58
+ "default": "sm",
59
+ "attribute": "size",
60
+ "description": "sm, md or lg: the dialog's width."
61
+ },
62
+ "open": {
63
+ "type": "boolean",
64
+ "default": false,
65
+ "description": "Whether the dialog is showing. Read-only state, mirrored from the platform: open it with showModal(host) from the behaviours module, or with a --show invoker command aimed at the element."
66
+ },
67
+ "hasHeadline": {
68
+ "$expression": {
69
+ "operator": "!==",
70
+ "target": {
71
+ "$ref": "#/state/headline"
72
+ },
73
+ "value": ""
74
+ }
75
+ },
76
+ "hasConfirm": {
77
+ "$expression": {
78
+ "operator": "!==",
79
+ "target": {
80
+ "$ref": "#/state/confirmLabel"
81
+ },
82
+ "value": ""
83
+ }
84
+ },
85
+ "hasSecondary": {
86
+ "$expression": {
87
+ "operator": "!==",
88
+ "target": {
89
+ "$ref": "#/state/secondaryLabel"
90
+ },
91
+ "value": ""
92
+ }
93
+ },
94
+ "hasCancel": {
95
+ "$expression": {
96
+ "operator": "!==",
97
+ "target": {
98
+ "$ref": "#/state/cancelLabel"
99
+ },
100
+ "value": ""
101
+ }
102
+ },
103
+ "confirmVariant": "${state.destructive ? 'negative' : 'accent'}",
104
+ "closedby": "${state.dismissible ? 'any' : 'closerequest'}",
105
+ "onToggle": {
106
+ "$prototype": "Function",
107
+ "$src": "jx-ui:/behaviors/dialog.ts",
108
+ "$export": "onToggle",
109
+ "description": "The platform's toggle on the inner dialog, mirrored into open."
110
+ },
111
+ "onNativeCancel": {
112
+ "$prototype": "Function",
113
+ "$src": "jx-ui:/behaviors/dialog.ts",
114
+ "$export": "onNativeCancel",
115
+ "description": "Escape or a light dismissal: the platform closes the dialog, and the element dispatches cancel.",
116
+ "emits": [
117
+ {
118
+ "name": "cancel",
119
+ "description": "The reader declined: Escape, a dismissal, or the cancel button."
120
+ }
121
+ ]
122
+ },
123
+ "onNativeClose": {
124
+ "$prototype": "Function",
125
+ "$src": "jx-ui:/behaviors/dialog.ts",
126
+ "$export": "onNativeClose",
127
+ "description": "The platform's close, whatever closed it, dispatched as close.",
128
+ "emits": [
129
+ {
130
+ "name": "close",
131
+ "description": "The dialog closed, for any reason."
132
+ }
133
+ ]
134
+ },
135
+ "onCommand": {
136
+ "$prototype": "Function",
137
+ "$src": "jx-ui:/behaviors/dialog.ts",
138
+ "$export": "onCommand",
139
+ "description": "An invoker command aimed at the element: --show opens it modally, --close closes it."
140
+ },
141
+ "onConfirm": {
142
+ "$prototype": "Function",
143
+ "$src": "jx-ui:/behaviors/dialog.ts",
144
+ "$export": "onConfirm",
145
+ "description": "The primary button: dispatches confirm and leaves closing to the host, so a refused value can keep the dialog open.",
146
+ "emits": [
147
+ {
148
+ "name": "confirm",
149
+ "description": "The primary button was activated."
150
+ }
151
+ ]
152
+ },
153
+ "onSecondary": {
154
+ "$prototype": "Function",
155
+ "$src": "jx-ui:/behaviors/dialog.ts",
156
+ "$export": "onSecondary",
157
+ "description": "The secondary button: dispatches secondary.",
158
+ "emits": [
159
+ {
160
+ "name": "secondary",
161
+ "description": "The secondary button was activated."
162
+ }
163
+ ]
164
+ },
165
+ "onCancelClick": {
166
+ "$prototype": "Function",
167
+ "$src": "jx-ui:/behaviors/dialog.ts",
168
+ "$export": "onCancelClick",
169
+ "description": "The cancel button: dispatches cancel and closes the dialog."
170
+ },
171
+ "onMount": {
172
+ "$prototype": "Function",
173
+ "body": [
174
+ {
175
+ "dispatchEvent": "jx-ready",
176
+ "bubbles": true
177
+ }
178
+ ],
179
+ "description": "Announces that the element has rendered and carries its native dialog, so a host may open it."
180
+ }
181
+ },
182
+ "oncommand": {
183
+ "$ref": "#/state/onCommand"
184
+ },
185
+ "attributes": {
186
+ "data-size": "${state.size}",
187
+ "data-open": "${state.open ? '' : null}",
188
+ "data-destructive": "${state.destructive ? '' : null}"
189
+ },
190
+ "style": {
191
+ "display": "contents",
192
+ "&[hidden]": {
193
+ "display": "none"
194
+ },
195
+ "& > [part=\"dialog\"]": {
196
+ "boxSizing": "border-box",
197
+ "width": "min(90vw, 24rem)",
198
+ "maxHeight": "85vh",
199
+ "margin": "auto",
200
+ "padding": "0",
201
+ "border": "1px solid var(--jx-border)",
202
+ "borderRadius": "var(--jx-radius-md)",
203
+ "background": "var(--jx-bg-overlay)",
204
+ "color": "var(--jx-fg)",
205
+ "boxShadow": "var(--jx-shadow-dialog)",
206
+ "fontFamily": "var(--jx-font-sans)",
207
+ "fontSize": "var(--jx-text-md)",
208
+ "lineHeight": "var(--jx-leading-md)",
209
+ "overflow": "auto",
210
+ "&::backdrop": {
211
+ "background": "rgba(0, 0, 0, 0.4)"
212
+ },
213
+ ":focus-visible": {
214
+ "outline": "var(--jx-focus-ring)"
215
+ }
216
+ },
217
+ "&[data-size=\"md\"] > [part=\"dialog\"]": {
218
+ "width": "min(90vw, 32rem)"
219
+ },
220
+ "&[data-size=\"lg\"] > [part=\"dialog\"]": {
221
+ "width": "min(90vw, 44rem)"
222
+ },
223
+ "& [part=\"header\"]": {
224
+ "padding": "var(--jx-space-5) var(--jx-space-5) 0"
225
+ },
226
+ "& [part=\"header\"]:empty": {
227
+ "display": "none"
228
+ },
229
+ "& [part=\"headline\"]": {
230
+ "margin": "0",
231
+ "fontSize": "var(--jx-text-lg)",
232
+ "lineHeight": "var(--jx-leading-lg)",
233
+ "fontWeight": "600"
234
+ },
235
+ "& [part=\"body\"]": {
236
+ "padding": "var(--jx-space-4) var(--jx-space-5)"
237
+ },
238
+ "& [part=\"footer\"]": {
239
+ "display": "flex",
240
+ "justifyContent": "flex-end",
241
+ "alignItems": "center",
242
+ "gap": "var(--jx-space-2)",
243
+ "padding": "0 var(--jx-space-5) var(--jx-space-5)"
244
+ },
245
+ "& [part=\"secondary\"]": {
246
+ "marginRight": "auto"
247
+ },
248
+ "& [part=\"secondary-slot\"], & [part=\"cancel-slot\"], & [part=\"confirm-slot\"]": {
249
+ "display": "contents"
250
+ }
251
+ },
252
+ "children": [
253
+ {
254
+ "tagName": "dialog",
255
+ "attributes": {
256
+ "part": "dialog",
257
+ "closedby": "${state.closedby}",
258
+ "aria-label": "${state.headline || null}"
259
+ },
260
+ "ontoggle": {
261
+ "$ref": "#/state/onToggle"
262
+ },
263
+ "oncancel": {
264
+ "$ref": "#/state/onNativeCancel"
265
+ },
266
+ "onclose": {
267
+ "$ref": "#/state/onNativeClose"
268
+ },
269
+ "children": [
270
+ {
271
+ "tagName": "header",
272
+ "attributes": {
273
+ "part": "header"
274
+ },
275
+ "$switch": {
276
+ "$ref": "#/state/hasHeadline"
277
+ },
278
+ "cases": {
279
+ "true": {
280
+ "tagName": "h2",
281
+ "attributes": {
282
+ "part": "headline"
283
+ },
284
+ "textContent": "${state.headline}"
285
+ }
286
+ }
287
+ },
288
+ {
289
+ "tagName": "div",
290
+ "attributes": {
291
+ "part": "body"
292
+ },
293
+ "children": [
294
+ {
295
+ "tagName": "slot"
296
+ }
297
+ ]
298
+ },
299
+ {
300
+ "tagName": "footer",
301
+ "attributes": {
302
+ "part": "footer"
303
+ },
304
+ "children": [
305
+ {
306
+ "tagName": "div",
307
+ "attributes": {
308
+ "role": "none",
309
+ "part": "secondary-slot"
310
+ },
311
+ "$switch": {
312
+ "$ref": "#/state/hasSecondary"
313
+ },
314
+ "cases": {
315
+ "true": {
316
+ "tagName": "jx-button",
317
+ "$props": {
318
+ "quiet": true
319
+ },
320
+ "attributes": {
321
+ "part": "secondary"
322
+ },
323
+ "onclick": {
324
+ "$ref": "#/state/onSecondary"
325
+ },
326
+ "children": [
327
+ {
328
+ "tagName": "span",
329
+ "textContent": "${state.secondaryLabel}",
330
+ "attributes": {
331
+ "part": "secondary-label"
332
+ }
333
+ }
334
+ ]
335
+ }
336
+ }
337
+ },
338
+ {
339
+ "tagName": "div",
340
+ "attributes": {
341
+ "role": "none",
342
+ "part": "cancel-slot"
343
+ },
344
+ "$switch": {
345
+ "$ref": "#/state/hasCancel"
346
+ },
347
+ "cases": {
348
+ "true": {
349
+ "tagName": "jx-button",
350
+ "attributes": {
351
+ "part": "cancel",
352
+ "autofocus": "${state.destructive ? '' : null}"
353
+ },
354
+ "onclick": {
355
+ "$ref": "#/state/onCancelClick"
356
+ },
357
+ "children": [
358
+ {
359
+ "tagName": "span",
360
+ "textContent": "${state.cancelLabel}",
361
+ "attributes": {
362
+ "part": "cancel-label"
363
+ }
364
+ }
365
+ ]
366
+ }
367
+ }
368
+ },
369
+ {
370
+ "tagName": "div",
371
+ "attributes": {
372
+ "role": "none",
373
+ "part": "confirm-slot"
374
+ },
375
+ "$switch": {
376
+ "$ref": "#/state/hasConfirm"
377
+ },
378
+ "cases": {
379
+ "true": {
380
+ "tagName": "jx-button",
381
+ "$props": {
382
+ "variant": {
383
+ "$ref": "#/state/confirmVariant"
384
+ }
385
+ },
386
+ "attributes": {
387
+ "part": "confirm",
388
+ "autofocus": "${state.destructive ? null : ''}"
389
+ },
390
+ "onclick": {
391
+ "$ref": "#/state/onConfirm"
392
+ },
393
+ "children": [
394
+ {
395
+ "tagName": "span",
396
+ "textContent": "${state.confirmLabel}",
397
+ "attributes": {
398
+ "part": "confirm-label"
399
+ }
400
+ }
401
+ ]
402
+ }
403
+ }
404
+ }
405
+ ]
406
+ },
407
+ {
408
+ "tagName": "div",
409
+ "attributes": {
410
+ "part": "overlay-slot"
411
+ }
412
+ }
413
+ ]
414
+ }
415
+ ]
416
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "JxDivider",
4
+ "tagName": "jx-divider",
5
+ "observedAttributes": ["orientation"],
6
+ "state": {
7
+ "orientation": {
8
+ "type": "string",
9
+ "default": "horizontal",
10
+ "attribute": "orientation",
11
+ "description": "horizontal or vertical."
12
+ }
13
+ },
14
+ "attributes": {
15
+ "orientation": "${state.orientation}"
16
+ },
17
+ "style": {
18
+ "display": "block",
19
+ "&[hidden]": {
20
+ "display": "none"
21
+ },
22
+ "flex": "none",
23
+ "margin": "var(--jx-space-1) 0",
24
+ "& > [part=\"rule\"]": {
25
+ "margin": "0",
26
+ "border": "0",
27
+ "borderTop": "1px solid var(--jx-border)"
28
+ },
29
+ "&[orientation=\"vertical\"]": {
30
+ "display": "flex",
31
+ "alignSelf": "stretch",
32
+ "margin": "0 var(--jx-space-1)"
33
+ },
34
+ "&[orientation=\"vertical\"][hidden]": {
35
+ "display": "none"
36
+ },
37
+ "&[orientation=\"vertical\"] > [part=\"rule\"]": {
38
+ "borderTop": "0",
39
+ "borderLeft": "1px solid var(--jx-border)"
40
+ }
41
+ },
42
+ "children": [
43
+ {
44
+ "tagName": "hr",
45
+ "attributes": {
46
+ "part": "rule",
47
+ "role": "separator",
48
+ "aria-orientation": "${state.orientation}"
49
+ }
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "JxDot",
4
+ "tagName": "jx-dot",
5
+ "observedAttributes": ["tone"],
6
+ "state": {
7
+ "tone": {
8
+ "type": "string",
9
+ "default": "",
10
+ "attribute": "tone",
11
+ "description": "danger, success or warning. Anything else, the empty default included, is the neutral disc."
12
+ }
13
+ },
14
+ "attributes": {
15
+ "tone": "${state.tone || null}"
16
+ },
17
+ "style": {
18
+ "display": "inline-block",
19
+ "&[hidden]": {
20
+ "display": "none"
21
+ },
22
+ "flex": "none",
23
+ "width": "6px",
24
+ "height": "6px",
25
+ "borderRadius": "50%",
26
+ "background": "var(--jx-fg-muted)",
27
+ "&[tone=\"danger\"]": {
28
+ "background": "var(--jx-danger)"
29
+ },
30
+ "&[tone=\"success\"]": {
31
+ "background": "var(--jx-success)"
32
+ },
33
+ "&[tone=\"warning\"]": {
34
+ "background": "var(--jx-warning)"
35
+ }
36
+ },
37
+ "children": []
38
+ }
@@ -0,0 +1,162 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "JxField",
4
+ "tagName": "jx-field",
5
+ "observedAttributes": ["label", "description", "required", "invalid", "warning", "span"],
6
+ "state": {
7
+ "label": {
8
+ "type": "string",
9
+ "default": "",
10
+ "attribute": "label",
11
+ "description": "The visible label in the left column. It is drawn into the element's own label node, and that node's id is what names the slotted control — so the text is the accessible name without the consumer writing an id anywhere."
12
+ },
13
+ "description": {
14
+ "type": "string",
15
+ "default": "",
16
+ "attribute": "description",
17
+ "description": "A sentence under the row explaining the control. It is the FALLBACK of the help slot, so slotting richer help replaces it rather than stacking with it, and an empty description leaves the help line with nothing in it — which is exactly what [part=\"help\"]:empty keys on to take the line out of flow. The control is pointed at the sentence only when the line HAS something in it at mount — an empty one would be a reference to an empty paragraph, which the four classes never wrote. A sentence that starts empty and fills later should therefore be SLOTTED into help, whose presence the row can see, rather than passed here."
18
+ },
19
+ "required": {
20
+ "type": "boolean",
21
+ "default": false,
22
+ "attribute": "required",
23
+ "description": "Draws the required mark after the label. The mark is DRAWN, in content with an empty alt string, never appended to the label text: the label is the control's accessible name, and an asterisk inside that name is read out as a word. Marking the row does not make the control required — say so on the control as well, which is the element that validates."
24
+ },
25
+ "invalid": {
26
+ "type": "boolean",
27
+ "default": false,
28
+ "attribute": "invalid",
29
+ "description": "The row's value is refused: the label and the help sentence both draw in the danger colour. This is the whole of the old .jx-help-text--error class, folded in as a state of the row rather than a second class on the sentence. It says nothing to assistive technology — aria-invalid belongs on the control that holds the value."
30
+ },
31
+ "warning": {
32
+ "type": "boolean",
33
+ "default": false,
34
+ "attribute": "warning",
35
+ "description": "The row's value is accepted but worth a second look: the label draws in the warning colour. The help sentence is left alone, because a warning is a shade on the name rather than a correction of the sentence under it."
36
+ },
37
+ "span": {
38
+ "type": "boolean",
39
+ "default": false,
40
+ "attribute": "span",
41
+ "description": "Collapses the row to ONE column: the label sits above the control and reads from the left. It is the shape a long label, a wide control or a checkbox list needs, and it is a property of the row rather than of anything in it."
42
+ },
43
+ "uid": {
44
+ "type": "string",
45
+ "default": "",
46
+ "description": "This row's own id stem, minted on mount. The label node and the help sentence take their ids from it, and the slotted control is handed those ids as its labelledby and describedby props."
47
+ },
48
+ "onMount": {
49
+ "$prototype": "Function",
50
+ "$src": "jx-ui:/behaviors/textfield.ts",
51
+ "$export": "nameFieldControl",
52
+ "description": "Mints the row's id stem and names the slotted control with it. A document cannot do either: the closed operator set has no counter, and no body can write a property on an element other than the one whose handler is running. It runs once, over what is slotted then: a control APPENDED to the row afterwards lands outside the control part, unplaced and unnamed. Keep the control in the document and switch its state rather than adding it later."
53
+ }
54
+ },
55
+ "attributes": {
56
+ "data-span": "${state.span ? '' : null}",
57
+ "data-required": "${state.required ? '' : null}",
58
+ "data-invalid": "${state.invalid ? '' : null}",
59
+ "data-warning": "${state.warning ? '' : null}"
60
+ },
61
+ "style": {
62
+ "display": "grid",
63
+ "gridTemplateColumns": "var(--jx-field-label-w) minmax(0, 1fr)",
64
+ "columnGap": "var(--jx-space-3)",
65
+ "rowGap": "var(--jx-space-1)",
66
+ "alignItems": "center",
67
+ "padding": "var(--jx-space-1) 0",
68
+ "minWidth": "0",
69
+ "&[hidden]": {
70
+ "display": "none"
71
+ },
72
+ "&[data-span]": {
73
+ "gridTemplateColumns": "minmax(0, 1fr)"
74
+ },
75
+ "& > [part=\"label\"]": {
76
+ "display": "block",
77
+ "width": "var(--jx-field-label-w)",
78
+ "minWidth": "0",
79
+ "textAlign": "right",
80
+ "color": "var(--jx-fg-dim)",
81
+ "fontFamily": "var(--jx-font-sans)",
82
+ "fontSize": "var(--jx-text-md)",
83
+ "lineHeight": "var(--jx-leading-md)",
84
+ "overflow": "hidden",
85
+ "textOverflow": "ellipsis",
86
+ "whiteSpace": "nowrap"
87
+ },
88
+ "&[data-span] > [part=\"label\"]": {
89
+ "width": "auto",
90
+ "textAlign": "left"
91
+ },
92
+ "&[data-invalid] > [part=\"label\"]": {
93
+ "color": "var(--jx-danger)"
94
+ },
95
+ "&[data-warning] > [part=\"label\"]": {
96
+ "color": "var(--jx-warning)"
97
+ },
98
+ "&[data-required] > [part=\"label\"]": {
99
+ "::after": {
100
+ "content": "\"*\" / \"\"",
101
+ "color": "var(--jx-danger)",
102
+ "marginInlineStart": "var(--jx-space-1)"
103
+ }
104
+ },
105
+ "& > [part=\"control\"]": {
106
+ "display": "contents"
107
+ },
108
+ "& > [part=\"help\"]": {
109
+ "gridColumn": "1 / -1",
110
+ "margin": "0",
111
+ "minWidth": "0",
112
+ "color": "var(--jx-fg-dim)",
113
+ "fontFamily": "var(--jx-font-sans)",
114
+ "fontSize": "var(--jx-text-sm)",
115
+ "lineHeight": "var(--jx-leading-sm)"
116
+ },
117
+ "& > [part=\"help\"]:empty": {
118
+ "display": "none"
119
+ },
120
+ "&[data-invalid] > [part=\"help\"]": {
121
+ "color": "var(--jx-danger)"
122
+ }
123
+ },
124
+ "children": [
125
+ {
126
+ "tagName": "label",
127
+ "attributes": {
128
+ "part": "label",
129
+ "id": "${state.uid ? state.uid + '-label' : null}"
130
+ },
131
+ "textContent": "${state.label}"
132
+ },
133
+ {
134
+ "tagName": "div",
135
+ "attributes": {
136
+ "part": "control",
137
+ "role": "none"
138
+ },
139
+ "children": [
140
+ {
141
+ "tagName": "slot"
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ "tagName": "p",
147
+ "attributes": {
148
+ "part": "help",
149
+ "id": "${state.uid ? state.uid + '-help' : null}"
150
+ },
151
+ "children": [
152
+ {
153
+ "tagName": "slot",
154
+ "attributes": {
155
+ "name": "help"
156
+ },
157
+ "children": ["${state.description}"]
158
+ }
159
+ ]
160
+ }
161
+ ]
162
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "JxKbd",
4
+ "tagName": "jx-kbd",
5
+ "style": {
6
+ "display": "inline-block",
7
+ "&[hidden]": {
8
+ "display": "none"
9
+ },
10
+ "padding": "0 var(--jx-space-2)",
11
+ "border": "1px solid var(--jx-border)",
12
+ "borderRadius": "var(--jx-radius-xs)",
13
+ "background": "var(--jx-bg-panel)",
14
+ "color": "var(--jx-fg-dim)",
15
+ "fontFamily": "var(--jx-font-mono)",
16
+ "fontSize": "var(--jx-text-xs)",
17
+ "lineHeight": "var(--jx-leading-sm)"
18
+ },
19
+ "children": [
20
+ {
21
+ "tagName": "slot"
22
+ }
23
+ ]
24
+ }