@jxsuite/ui 0.0.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/LICENSE +21 -0
- package/README.md +11 -0
- package/components/jx-action-button.json +414 -0
- package/components/jx-button.json +310 -0
- package/components/jx-icon.json +81 -0
- package/components/jx-menu-item.json +265 -0
- package/components/jx-menu.json +122 -0
- package/icons/list.json +102 -0
- package/icons/manifest.json +348 -0
- package/package.json +46 -0
- package/project.json +167 -0
- package/src/behaviors/menu.ts +396 -0
- package/src/documents.ts +23 -0
- package/src/icons-build.ts +74 -0
- package/src/icons.ts +55 -0
- package/src/index.ts +70 -0
- package/src/testing/popover-shim.ts +139 -0
- package/src/theme.ts +63 -0
- package/stylebook/jx-action-button.json +108 -0
- package/stylebook/jx-button.json +104 -0
- package/stylebook/jx-icon.json +208 -0
- package/stylebook/jx-menu-item.json +221 -0
- package/stylebook/jx-menu.json +302 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jxsuite.com/schema/v1",
|
|
3
|
+
"$id": "JxButton",
|
|
4
|
+
"tagName": "jx-button",
|
|
5
|
+
"observedAttributes": [
|
|
6
|
+
"variant",
|
|
7
|
+
"size",
|
|
8
|
+
"quiet",
|
|
9
|
+
"disabled",
|
|
10
|
+
"loading",
|
|
11
|
+
"type",
|
|
12
|
+
"label",
|
|
13
|
+
"labelledby",
|
|
14
|
+
"describedby",
|
|
15
|
+
"popovertarget",
|
|
16
|
+
"popovertargetaction",
|
|
17
|
+
"command",
|
|
18
|
+
"commandfor"
|
|
19
|
+
],
|
|
20
|
+
"$elements": [
|
|
21
|
+
{
|
|
22
|
+
"$ref": "./jx-icon.json"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"state": {
|
|
26
|
+
"variant": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"default": "secondary",
|
|
29
|
+
"attribute": "variant",
|
|
30
|
+
"description": "How much the button asks for: accent (the one primary action on a surface), primary (a solid neutral), secondary (the default outline) or negative (a destructive action)."
|
|
31
|
+
},
|
|
32
|
+
"size": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"default": "md",
|
|
35
|
+
"attribute": "size",
|
|
36
|
+
"description": "sm, md or lg. The control height is the kit's, so a row of controls lines up."
|
|
37
|
+
},
|
|
38
|
+
"quiet": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": false,
|
|
41
|
+
"attribute": "quiet",
|
|
42
|
+
"description": "No fill and no border until hovered: a button that sits in a toolbar or beside text."
|
|
43
|
+
},
|
|
44
|
+
"disabled": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": false,
|
|
47
|
+
"attribute": "disabled",
|
|
48
|
+
"description": "Cannot act. Disabled, never absent; a reason belongs in the surrounding text."
|
|
49
|
+
},
|
|
50
|
+
"loading": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"default": false,
|
|
53
|
+
"attribute": "loading",
|
|
54
|
+
"description": "Working on the last activation: blocks another one, keeps its width, and says so through aria-busy."
|
|
55
|
+
},
|
|
56
|
+
"type": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"default": "button",
|
|
59
|
+
"attribute": "type",
|
|
60
|
+
"description": "The native button type: button, submit or reset."
|
|
61
|
+
},
|
|
62
|
+
"label": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"default": "",
|
|
65
|
+
"attribute": "label",
|
|
66
|
+
"description": "The accessible name when the visible text is not it, or there is none. Forwarded to the inner control as aria-label."
|
|
67
|
+
},
|
|
68
|
+
"labelledby": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"default": "",
|
|
71
|
+
"attribute": "labelledby",
|
|
72
|
+
"description": "Forwarded to the inner control as aria-labelledby."
|
|
73
|
+
},
|
|
74
|
+
"describedby": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"default": "",
|
|
77
|
+
"attribute": "describedby",
|
|
78
|
+
"description": "Forwarded to the inner control as aria-describedby."
|
|
79
|
+
},
|
|
80
|
+
"popovertarget": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"default": "",
|
|
83
|
+
"attribute": "popovertarget",
|
|
84
|
+
"description": "The popover this button invokes; forwarded to the inner control, which is the element the platform reads it from."
|
|
85
|
+
},
|
|
86
|
+
"popovertargetaction": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"default": "",
|
|
89
|
+
"attribute": "popovertargetaction",
|
|
90
|
+
"description": "toggle, show or hide; forwarded with popovertarget."
|
|
91
|
+
},
|
|
92
|
+
"command": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"default": "",
|
|
95
|
+
"attribute": "command",
|
|
96
|
+
"description": "The invoker command this button sends; forwarded to the inner control."
|
|
97
|
+
},
|
|
98
|
+
"commandfor": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"default": "",
|
|
101
|
+
"attribute": "commandfor",
|
|
102
|
+
"description": "The element the command is sent to; forwarded to the inner control."
|
|
103
|
+
},
|
|
104
|
+
"notLoading": {
|
|
105
|
+
"$expression": {
|
|
106
|
+
"operator": "!",
|
|
107
|
+
"target": {
|
|
108
|
+
"$ref": "#/state/loading"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"onClick": {
|
|
113
|
+
"$prototype": "Function",
|
|
114
|
+
"body": [
|
|
115
|
+
{
|
|
116
|
+
"if": {
|
|
117
|
+
"$ref": "#/state/loading"
|
|
118
|
+
},
|
|
119
|
+
"then": [
|
|
120
|
+
{
|
|
121
|
+
"stopPropagation": true
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"preventDefault": true
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"description": "A loading button swallows the activation: the click stops here and its default (a form submission, a popover, a command) is cancelled. A disabled button never gets this far, because its inner control is disabled."
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"onclick": {
|
|
133
|
+
"$ref": "#/state/onClick"
|
|
134
|
+
},
|
|
135
|
+
"attributes": {
|
|
136
|
+
"data-variant": "${state.variant}",
|
|
137
|
+
"data-size": "${state.size}",
|
|
138
|
+
"data-quiet": "${state.quiet ? '' : null}",
|
|
139
|
+
"data-loading": "${state.loading ? '' : null}"
|
|
140
|
+
},
|
|
141
|
+
"style": {
|
|
142
|
+
"display": "inline-flex",
|
|
143
|
+
"verticalAlign": "middle",
|
|
144
|
+
"&[hidden]": {
|
|
145
|
+
"display": "none"
|
|
146
|
+
},
|
|
147
|
+
"& > [part=\"control\"]": {
|
|
148
|
+
"appearance": "none",
|
|
149
|
+
"font": "inherit",
|
|
150
|
+
"fontFamily": "var(--jx-font-sans)",
|
|
151
|
+
"fontSize": "var(--jx-text-md)",
|
|
152
|
+
"lineHeight": "var(--jx-leading-md)",
|
|
153
|
+
"display": "inline-flex",
|
|
154
|
+
"alignItems": "center",
|
|
155
|
+
"justifyContent": "center",
|
|
156
|
+
"gap": "var(--jx-space-2)",
|
|
157
|
+
"minHeight": "var(--jx-control-h)",
|
|
158
|
+
"margin": "0",
|
|
159
|
+
"padding": "0 var(--jx-space-4)",
|
|
160
|
+
"border": "1px solid var(--jx-border-strong)",
|
|
161
|
+
"borderRadius": "var(--jx-radius-sm)",
|
|
162
|
+
"background": "var(--jx-bg-input)",
|
|
163
|
+
"color": "var(--jx-fg)",
|
|
164
|
+
"cursor": "pointer",
|
|
165
|
+
"whiteSpace": "nowrap",
|
|
166
|
+
"outline": "none",
|
|
167
|
+
"transition": "background var(--jx-dur-1) var(--jx-ease-out), border-color var(--jx-dur-1) var(--jx-ease-out)",
|
|
168
|
+
":hover": {
|
|
169
|
+
"background": "var(--jx-hover-bg)"
|
|
170
|
+
},
|
|
171
|
+
":focus-visible": {
|
|
172
|
+
"outline": "var(--jx-focus-ring)",
|
|
173
|
+
"outlineOffset": "2px"
|
|
174
|
+
},
|
|
175
|
+
":disabled": {
|
|
176
|
+
"opacity": "0.5",
|
|
177
|
+
"cursor": "default"
|
|
178
|
+
},
|
|
179
|
+
"&[aria-busy=\"true\"]": {
|
|
180
|
+
"cursor": "progress"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"&[data-variant=\"accent\"] > [part=\"control\"]": {
|
|
184
|
+
"background": "var(--jx-accent-solid)",
|
|
185
|
+
"borderColor": "transparent",
|
|
186
|
+
"color": "var(--jx-accent-fg)",
|
|
187
|
+
":hover": {
|
|
188
|
+
"background": "var(--jx-accent-hover)"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"&[data-variant=\"primary\"] > [part=\"control\"]": {
|
|
192
|
+
"background": "var(--jx-fg)",
|
|
193
|
+
"borderColor": "transparent",
|
|
194
|
+
"color": "var(--jx-bg)",
|
|
195
|
+
":hover": {
|
|
196
|
+
"background": "var(--jx-fg-dim)"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"&[data-variant=\"negative\"] > [part=\"control\"]": {
|
|
200
|
+
"background": "var(--jx-danger)",
|
|
201
|
+
"borderColor": "transparent",
|
|
202
|
+
"color": "var(--jx-accent-fg)",
|
|
203
|
+
":hover": {
|
|
204
|
+
"filter": "brightness(1.1)"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"&[data-quiet] > [part=\"control\"]": {
|
|
208
|
+
"background": "transparent",
|
|
209
|
+
"borderColor": "transparent",
|
|
210
|
+
":hover": {
|
|
211
|
+
"background": "var(--jx-hover-bg)"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"&[data-size=\"sm\"] > [part=\"control\"]": {
|
|
215
|
+
"minHeight": "calc(var(--jx-control-h) - 4px)",
|
|
216
|
+
"padding": "0 var(--jx-space-3)",
|
|
217
|
+
"fontSize": "var(--jx-text-sm)"
|
|
218
|
+
},
|
|
219
|
+
"&[data-size=\"lg\"] > [part=\"control\"]": {
|
|
220
|
+
"minHeight": "calc(var(--jx-control-h) + 8px)",
|
|
221
|
+
"padding": "0 var(--jx-space-5)",
|
|
222
|
+
"fontSize": "var(--jx-text-lg)"
|
|
223
|
+
},
|
|
224
|
+
"& [part=\"icon\"]": {
|
|
225
|
+
"display": "inline-flex",
|
|
226
|
+
"color": "inherit"
|
|
227
|
+
},
|
|
228
|
+
"& [part=\"spinner\"]": {
|
|
229
|
+
"display": "inline-flex",
|
|
230
|
+
"color": "inherit"
|
|
231
|
+
},
|
|
232
|
+
"& [part=\"spinner\"][hidden]": {
|
|
233
|
+
"display": "none"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"children": [
|
|
237
|
+
{
|
|
238
|
+
"tagName": "button",
|
|
239
|
+
"attributes": {
|
|
240
|
+
"part": "control",
|
|
241
|
+
"type": "${state.type}",
|
|
242
|
+
"disabled": {
|
|
243
|
+
"$ref": "#/state/disabled"
|
|
244
|
+
},
|
|
245
|
+
"aria-disabled": "${state.loading ? 'true' : null}",
|
|
246
|
+
"aria-busy": "${state.loading ? 'true' : null}",
|
|
247
|
+
"aria-label": "${state.label || null}",
|
|
248
|
+
"aria-labelledby": "${state.labelledby || null}",
|
|
249
|
+
"aria-describedby": "${state.describedby || null}",
|
|
250
|
+
"popovertarget": "${state.popovertarget || null}",
|
|
251
|
+
"popovertargetaction": "${state.popovertargetaction || null}",
|
|
252
|
+
"command": "${state.command || null}",
|
|
253
|
+
"commandfor": "${state.commandfor || null}"
|
|
254
|
+
},
|
|
255
|
+
"children": [
|
|
256
|
+
{
|
|
257
|
+
"tagName": "span",
|
|
258
|
+
"attributes": {
|
|
259
|
+
"part": "icon"
|
|
260
|
+
},
|
|
261
|
+
"children": [
|
|
262
|
+
{
|
|
263
|
+
"tagName": "slot",
|
|
264
|
+
"attributes": {
|
|
265
|
+
"name": "icon",
|
|
266
|
+
"part": "icon-slot"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"tagName": "span",
|
|
273
|
+
"attributes": {
|
|
274
|
+
"part": "label"
|
|
275
|
+
},
|
|
276
|
+
"children": [
|
|
277
|
+
{
|
|
278
|
+
"tagName": "slot",
|
|
279
|
+
"attributes": {
|
|
280
|
+
"part": "label-slot"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"tagName": "span",
|
|
287
|
+
"attributes": {
|
|
288
|
+
"part": "spinner",
|
|
289
|
+
"aria-hidden": "true"
|
|
290
|
+
},
|
|
291
|
+
"hidden": {
|
|
292
|
+
"$ref": "#/state/notLoading"
|
|
293
|
+
},
|
|
294
|
+
"children": [
|
|
295
|
+
{
|
|
296
|
+
"tagName": "jx-icon",
|
|
297
|
+
"$props": {
|
|
298
|
+
"name": "spinner",
|
|
299
|
+
"weight": "bold"
|
|
300
|
+
},
|
|
301
|
+
"attributes": {
|
|
302
|
+
"part": "spinner-icon"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
]
|
|
310
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jxsuite.com/schema/v1",
|
|
3
|
+
"$id": "JxIcon",
|
|
4
|
+
"tagName": "jx-icon",
|
|
5
|
+
"observedAttributes": ["name", "weight", "label", "mirror"],
|
|
6
|
+
"state": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"default": "",
|
|
10
|
+
"attribute": "name",
|
|
11
|
+
"description": "The glyph to draw, by its Phosphor name. Every name the kit ships is in icons/list.json."
|
|
12
|
+
},
|
|
13
|
+
"weight": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"default": "regular",
|
|
16
|
+
"attribute": "weight",
|
|
17
|
+
"description": "regular, bold, or fill. fill is the active drawing of the same glyph; a weight the manifest lacks falls back to regular."
|
|
18
|
+
},
|
|
19
|
+
"label": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"default": "",
|
|
22
|
+
"attribute": "label",
|
|
23
|
+
"description": "The accessible name. Empty hides the icon from assistive technology, which is right whenever visible text already names the control."
|
|
24
|
+
},
|
|
25
|
+
"mirror": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"default": false,
|
|
28
|
+
"attribute": "mirror",
|
|
29
|
+
"description": "Flip horizontally: a directional glyph in a right-to-left layout, or its opposite."
|
|
30
|
+
},
|
|
31
|
+
"lookup": {
|
|
32
|
+
"$prototype": "Function",
|
|
33
|
+
"$src": "jx-ui:/icons.ts",
|
|
34
|
+
"$export": "iconPath",
|
|
35
|
+
"parameters": ["name", "weight"],
|
|
36
|
+
"description": "Path data for a name and weight, from the committed manifest."
|
|
37
|
+
},
|
|
38
|
+
"path": "${state.lookup(state.name, state.weight)}"
|
|
39
|
+
},
|
|
40
|
+
"style": {
|
|
41
|
+
"display": "inline-flex",
|
|
42
|
+
"&[hidden]": {
|
|
43
|
+
"display": "none"
|
|
44
|
+
},
|
|
45
|
+
"flex": "none",
|
|
46
|
+
"width": "var(--jx-icon-size, 16px)",
|
|
47
|
+
"height": "var(--jx-icon-size, 16px)",
|
|
48
|
+
"verticalAlign": "middle",
|
|
49
|
+
"& > svg": {
|
|
50
|
+
"display": "block",
|
|
51
|
+
"width": "100%",
|
|
52
|
+
"height": "100%"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"children": [
|
|
56
|
+
{
|
|
57
|
+
"tagName": "svg",
|
|
58
|
+
"attributes": {
|
|
59
|
+
"part": "svg",
|
|
60
|
+
"viewBox": "0 0 256 256",
|
|
61
|
+
"fill": "currentColor",
|
|
62
|
+
"focusable": "false",
|
|
63
|
+
"role": "img",
|
|
64
|
+
"aria-label": "${state.label}",
|
|
65
|
+
"aria-hidden": "${state.label ? 'false' : 'true'}"
|
|
66
|
+
},
|
|
67
|
+
"style": {
|
|
68
|
+
"transform": "${state.mirror ? 'scale(-1, 1)' : 'none'}"
|
|
69
|
+
},
|
|
70
|
+
"children": [
|
|
71
|
+
{
|
|
72
|
+
"tagName": "path",
|
|
73
|
+
"attributes": {
|
|
74
|
+
"part": "path",
|
|
75
|
+
"d": "${state.path}"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jxsuite.com/schema/v1",
|
|
3
|
+
"$id": "JxMenuItem",
|
|
4
|
+
"tagName": "jx-menu-item",
|
|
5
|
+
"observedAttributes": ["value", "disabled", "destructive", "requires", "checked", "haspopup"],
|
|
6
|
+
"$elements": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "./jx-icon.json"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"state": {
|
|
12
|
+
"value": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"default": "",
|
|
15
|
+
"attribute": "value",
|
|
16
|
+
"description": "What the row stands for; the detail of the select event it dispatches."
|
|
17
|
+
},
|
|
18
|
+
"disabled": {
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"default": false,
|
|
21
|
+
"attribute": "disabled",
|
|
22
|
+
"description": "A row that cannot act is disabled, never absent; it stays reachable and explains itself through requires."
|
|
23
|
+
},
|
|
24
|
+
"destructive": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"default": false,
|
|
27
|
+
"attribute": "destructive",
|
|
28
|
+
"description": "Draws the row in the danger colour. Derived from the command record, never decided per menu."
|
|
29
|
+
},
|
|
30
|
+
"requires": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"default": "",
|
|
33
|
+
"attribute": "requires",
|
|
34
|
+
"description": "The one-sentence reason a disabled row cannot act, printed as its tooltip."
|
|
35
|
+
},
|
|
36
|
+
"checked": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"default": "",
|
|
39
|
+
"attribute": "checked",
|
|
40
|
+
"description": "Empty for a plain item; true or false for a checkbox item, which then carries aria-checked."
|
|
41
|
+
},
|
|
42
|
+
"haspopup": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"default": false,
|
|
45
|
+
"attribute": "haspopup",
|
|
46
|
+
"description": "The row owns a submenu, slotted as submenu. It still runs its own command; the submenu opens on hover, ArrowRight or the chevron."
|
|
47
|
+
},
|
|
48
|
+
"expanded": {
|
|
49
|
+
"type": "boolean",
|
|
50
|
+
"default": false,
|
|
51
|
+
"description": "Whether the row's submenu is showing. Written by the menu behaviour."
|
|
52
|
+
},
|
|
53
|
+
"noPopup": {
|
|
54
|
+
"$expression": {
|
|
55
|
+
"operator": "!",
|
|
56
|
+
"target": {
|
|
57
|
+
"$ref": "#/state/haspopup"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"onClick": {
|
|
62
|
+
"$prototype": "Function",
|
|
63
|
+
"body": [
|
|
64
|
+
{
|
|
65
|
+
"stopPropagation": true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"if": {
|
|
69
|
+
"operator": "!",
|
|
70
|
+
"target": {
|
|
71
|
+
"$ref": "#/state/disabled"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"then": [
|
|
75
|
+
{
|
|
76
|
+
"dispatchEvent": "select",
|
|
77
|
+
"detail": {
|
|
78
|
+
"$ref": "#/state/value"
|
|
79
|
+
},
|
|
80
|
+
"bubbles": true
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"emits": [
|
|
86
|
+
{
|
|
87
|
+
"name": "select",
|
|
88
|
+
"description": "The row was activated; detail is its value."
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"description": "Activation dispatches select unless the row is disabled. The click stops here: a row inside a submenu is a descendant of the row that owns it, and a click that kept bubbling would activate both."
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"attributes": {
|
|
95
|
+
"role": "${state.checked ? 'menuitemcheckbox' : 'menuitem'}",
|
|
96
|
+
"tabindex": "-1",
|
|
97
|
+
"aria-disabled": "${state.disabled ? 'true' : 'false'}",
|
|
98
|
+
"aria-checked": "${state.checked || null}",
|
|
99
|
+
"aria-haspopup": "${state.haspopup ? 'menu' : null}",
|
|
100
|
+
"aria-expanded": "${state.haspopup ? (state.expanded ? 'true' : 'false') : null}",
|
|
101
|
+
"title": "${state.disabled && state.requires ? state.requires : null}"
|
|
102
|
+
},
|
|
103
|
+
"onclick": {
|
|
104
|
+
"$ref": "#/state/onClick"
|
|
105
|
+
},
|
|
106
|
+
"style": {
|
|
107
|
+
"display": "flex",
|
|
108
|
+
"&[hidden]": {
|
|
109
|
+
"display": "none"
|
|
110
|
+
},
|
|
111
|
+
"alignItems": "center",
|
|
112
|
+
"gap": "var(--jx-space-3)",
|
|
113
|
+
"minHeight": "var(--jx-control-h)",
|
|
114
|
+
"padding": "var(--jx-space-1) var(--jx-space-3)",
|
|
115
|
+
"borderRadius": "var(--jx-radius-sm)",
|
|
116
|
+
"cursor": "default",
|
|
117
|
+
"userSelect": "none",
|
|
118
|
+
"outline": "none",
|
|
119
|
+
"color": "${state.destructive && !state.disabled ? 'var(--jx-danger)' : 'inherit'}",
|
|
120
|
+
":hover": {
|
|
121
|
+
"background": "var(--jx-hover-bg)"
|
|
122
|
+
},
|
|
123
|
+
":focus-visible": {
|
|
124
|
+
"outline": "var(--jx-focus-ring)",
|
|
125
|
+
"outlineOffset": "-2px"
|
|
126
|
+
},
|
|
127
|
+
"&[aria-disabled=\"true\"]": {
|
|
128
|
+
"opacity": "0.5"
|
|
129
|
+
},
|
|
130
|
+
"& > [part=\"icon\"]": {
|
|
131
|
+
"display": "inline-flex",
|
|
132
|
+
"color": "var(--jx-fg-dim)"
|
|
133
|
+
},
|
|
134
|
+
"& > [part=\"text\"]": {
|
|
135
|
+
"display": "flex",
|
|
136
|
+
"flexDirection": "column",
|
|
137
|
+
"flex": "1",
|
|
138
|
+
"minWidth": "0"
|
|
139
|
+
},
|
|
140
|
+
"& > [part=\"text\"] > [part=\"label\"]": {
|
|
141
|
+
"whiteSpace": "nowrap",
|
|
142
|
+
"overflow": "hidden",
|
|
143
|
+
"textOverflow": "ellipsis"
|
|
144
|
+
},
|
|
145
|
+
"& > [part=\"text\"] > [part=\"description\"]": {
|
|
146
|
+
"fontSize": "var(--jx-text-xs)",
|
|
147
|
+
"lineHeight": "var(--jx-leading-xs)",
|
|
148
|
+
"color": "var(--jx-fg-muted)"
|
|
149
|
+
},
|
|
150
|
+
"& > [part=\"value\"]": {
|
|
151
|
+
"color": "var(--jx-fg-dim)",
|
|
152
|
+
"fontSize": "var(--jx-text-sm)",
|
|
153
|
+
"whiteSpace": "nowrap"
|
|
154
|
+
},
|
|
155
|
+
"& > [part=\"value\"] kbd": {
|
|
156
|
+
"fontFamily": "var(--jx-font-mono)",
|
|
157
|
+
"fontSize": "var(--jx-text-xs)",
|
|
158
|
+
"color": "var(--jx-fg-dim)"
|
|
159
|
+
},
|
|
160
|
+
"& > [part=\"chevron\"]": {
|
|
161
|
+
"display": "inline-flex",
|
|
162
|
+
"color": "var(--jx-fg-dim)"
|
|
163
|
+
},
|
|
164
|
+
"& > [part=\"chevron\"][hidden]": {
|
|
165
|
+
"display": "none"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"children": [
|
|
169
|
+
{
|
|
170
|
+
"tagName": "span",
|
|
171
|
+
"attributes": {
|
|
172
|
+
"part": "icon"
|
|
173
|
+
},
|
|
174
|
+
"children": [
|
|
175
|
+
{
|
|
176
|
+
"tagName": "slot",
|
|
177
|
+
"attributes": {
|
|
178
|
+
"name": "icon",
|
|
179
|
+
"part": "icon-slot"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"tagName": "span",
|
|
186
|
+
"attributes": {
|
|
187
|
+
"part": "text"
|
|
188
|
+
},
|
|
189
|
+
"children": [
|
|
190
|
+
{
|
|
191
|
+
"tagName": "span",
|
|
192
|
+
"attributes": {
|
|
193
|
+
"part": "label"
|
|
194
|
+
},
|
|
195
|
+
"children": [
|
|
196
|
+
{
|
|
197
|
+
"tagName": "slot",
|
|
198
|
+
"attributes": {
|
|
199
|
+
"part": "label-slot"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"tagName": "span",
|
|
206
|
+
"attributes": {
|
|
207
|
+
"part": "description"
|
|
208
|
+
},
|
|
209
|
+
"children": [
|
|
210
|
+
{
|
|
211
|
+
"tagName": "slot",
|
|
212
|
+
"attributes": {
|
|
213
|
+
"name": "description",
|
|
214
|
+
"part": "description-slot"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"tagName": "span",
|
|
223
|
+
"attributes": {
|
|
224
|
+
"part": "value"
|
|
225
|
+
},
|
|
226
|
+
"children": [
|
|
227
|
+
{
|
|
228
|
+
"tagName": "slot",
|
|
229
|
+
"attributes": {
|
|
230
|
+
"name": "value",
|
|
231
|
+
"part": "value-slot"
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"tagName": "span",
|
|
238
|
+
"attributes": {
|
|
239
|
+
"part": "chevron"
|
|
240
|
+
},
|
|
241
|
+
"hidden": {
|
|
242
|
+
"$ref": "#/state/noPopup"
|
|
243
|
+
},
|
|
244
|
+
"children": [
|
|
245
|
+
{
|
|
246
|
+
"tagName": "jx-icon",
|
|
247
|
+
"$props": {
|
|
248
|
+
"name": "caret-right",
|
|
249
|
+
"weight": "bold"
|
|
250
|
+
},
|
|
251
|
+
"attributes": {
|
|
252
|
+
"part": "chevron-icon"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"tagName": "slot",
|
|
259
|
+
"attributes": {
|
|
260
|
+
"name": "submenu",
|
|
261
|
+
"part": "submenu-slot"
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
}
|