@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.
- package/components/jx-accordion-item.json +281 -0
- package/components/jx-accordion.json +33 -0
- package/components/jx-action-button.json +268 -34
- package/components/jx-action-group.json +131 -0
- package/components/jx-button.json +141 -26
- package/components/jx-checkbox.json +222 -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 +551 -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 +6 -13
- 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 +331 -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 +645 -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 +719 -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,147 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jxsuite.com/schema/v1",
|
|
3
|
+
"$id": "StylebookTabPanel",
|
|
4
|
+
"tagName": "main",
|
|
5
|
+
"$elements": [
|
|
6
|
+
{
|
|
7
|
+
"$ref": "../components/jx-icon.json"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"$ref": "../components/jx-tab.json"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"$ref": "../components/jx-tab-panel.json"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"$ref": "../components/jx-tabs.json"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"state": {
|
|
20
|
+
"current": "design",
|
|
21
|
+
"onChange": {
|
|
22
|
+
"$prototype": "Function",
|
|
23
|
+
"body": [
|
|
24
|
+
{
|
|
25
|
+
"operator": "=",
|
|
26
|
+
"target": {
|
|
27
|
+
"$ref": "#/state/current"
|
|
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
|
+
"maxWidth": "60ch"
|
|
57
|
+
},
|
|
58
|
+
"& jx-tab-panel": {
|
|
59
|
+
"border": "1px solid var(--jx-border)",
|
|
60
|
+
"borderRadius": "var(--jx-radius-sm)"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"children": [
|
|
64
|
+
{
|
|
65
|
+
"tagName": "h1",
|
|
66
|
+
"textContent": "jx-tab-panel"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"tagName": "p",
|
|
70
|
+
"textContent": "A panel is hidden rather than removed, so the ids its tab names stay resolvable and a find-in-page never lands in a panel nobody can see. It takes one tab stop when it is showing, which is the price of a panel whose whole content may be static text."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"tagName": "h2",
|
|
74
|
+
"textContent": "Paired with its tab"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"tagName": "p",
|
|
78
|
+
"textContent": "Each panel's aria-labelledby names the tab that controls it, and that tab's aria-controls names the panel's id. Nothing in the kit or the lints checks that pairing, so both ids are minted here from one key, the section's own, which is the only thing that keeps them true. Showing: ${state.current}"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"tagName": "jx-tabs",
|
|
82
|
+
"attributes": {
|
|
83
|
+
"label": "Panel demonstration",
|
|
84
|
+
"selected": "${state.current}"
|
|
85
|
+
},
|
|
86
|
+
"onchange": {
|
|
87
|
+
"$ref": "#/state/onChange"
|
|
88
|
+
},
|
|
89
|
+
"children": [
|
|
90
|
+
{
|
|
91
|
+
"tagName": "jx-tab",
|
|
92
|
+
"attributes": {
|
|
93
|
+
"id": "stylebook-tab-design",
|
|
94
|
+
"value": "design",
|
|
95
|
+
"label": "Design",
|
|
96
|
+
"panel": "stylebook-panel-design"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"tagName": "jx-tab",
|
|
101
|
+
"attributes": {
|
|
102
|
+
"id": "stylebook-tab-content",
|
|
103
|
+
"value": "content",
|
|
104
|
+
"label": "Content",
|
|
105
|
+
"panel": "stylebook-panel-content"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"tagName": "jx-tab-panel",
|
|
112
|
+
"attributes": {
|
|
113
|
+
"id": "stylebook-panel-design",
|
|
114
|
+
"labelledby": "stylebook-tab-design",
|
|
115
|
+
"active": "${state.current === 'design'}"
|
|
116
|
+
},
|
|
117
|
+
"children": [
|
|
118
|
+
{
|
|
119
|
+
"tagName": "p",
|
|
120
|
+
"textContent": "Size, spacing and colour for the selected node."
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"tagName": "jx-tab-panel",
|
|
126
|
+
"attributes": {
|
|
127
|
+
"id": "stylebook-panel-content",
|
|
128
|
+
"labelledby": "stylebook-tab-content",
|
|
129
|
+
"active": "${state.current === 'content'}"
|
|
130
|
+
},
|
|
131
|
+
"children": [
|
|
132
|
+
{
|
|
133
|
+
"tagName": "p",
|
|
134
|
+
"textContent": "The text and media this node renders."
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"tagName": "h2",
|
|
140
|
+
"textContent": "Hidden, not gone"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"tagName": "p",
|
|
144
|
+
"textContent": "Whichever panel above is not showing is still in the document, carrying hidden. That is what keeps the tab pointing at it honest, and it is why the panel declares what hidden means to it: an element that sets its own display must also unset it."
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jxsuite.com/schema/v1",
|
|
3
|
+
"$id": "StylebookTab",
|
|
4
|
+
"tagName": "main",
|
|
5
|
+
"$elements": [
|
|
6
|
+
{ "$ref": "../components/jx-action-button.json" },
|
|
7
|
+
{ "$ref": "../components/jx-icon.json" },
|
|
8
|
+
{ "$ref": "../components/jx-tab.json" },
|
|
9
|
+
{ "$ref": "../components/jx-tabs.json" }
|
|
10
|
+
],
|
|
11
|
+
"style": {
|
|
12
|
+
"fontFamily": "var(--jx-font-sans)",
|
|
13
|
+
"fontSize": "var(--jx-text-md)",
|
|
14
|
+
"color": "var(--jx-fg)",
|
|
15
|
+
"background": "var(--jx-bg)",
|
|
16
|
+
"padding": "var(--jx-space-6)",
|
|
17
|
+
"minHeight": "100vh",
|
|
18
|
+
"& > h1": {
|
|
19
|
+
"fontSize": "var(--jx-text-lg)",
|
|
20
|
+
"fontWeight": "600",
|
|
21
|
+
"margin": "0 0 var(--jx-space-5)"
|
|
22
|
+
},
|
|
23
|
+
"& > h2": {
|
|
24
|
+
"fontSize": "var(--jx-text-md)",
|
|
25
|
+
"fontWeight": "600",
|
|
26
|
+
"margin": "var(--jx-space-6) 0 var(--jx-space-3)"
|
|
27
|
+
},
|
|
28
|
+
"& > p": {
|
|
29
|
+
"color": "var(--jx-fg-dim)",
|
|
30
|
+
"margin": "0 0 var(--jx-space-5)",
|
|
31
|
+
"maxWidth": "60ch"
|
|
32
|
+
},
|
|
33
|
+
"& [slot=\"status\"]": {
|
|
34
|
+
"borderRadius": "999px",
|
|
35
|
+
"padding": "0 var(--jx-space-2)",
|
|
36
|
+
"border": "1px solid var(--jx-border)",
|
|
37
|
+
"fontSize": "var(--jx-text-xs)",
|
|
38
|
+
"lineHeight": "var(--jx-leading-xs)",
|
|
39
|
+
"color": "var(--jx-fg-dim)"
|
|
40
|
+
},
|
|
41
|
+
"& [slot=\"icon\"]": {
|
|
42
|
+
"color": "var(--jx-fg-muted)",
|
|
43
|
+
"lineHeight": "1"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"children": [
|
|
47
|
+
{ "tagName": "h1", "textContent": "jx-tab" },
|
|
48
|
+
{
|
|
49
|
+
"tagName": "p",
|
|
50
|
+
"textContent": "A tab is a string with a role, and three places a consumer may decorate it. Write label as an ATTRIBUTE — a property write does not reflect, and selectors read the attribute — and write it whenever anything is slotted: the label is the tab's accessible name, so slotted content never joins it, and a tab with no label falls back to naming itself from whatever was put inside."
|
|
51
|
+
},
|
|
52
|
+
{ "tagName": "h2", "textContent": "States" },
|
|
53
|
+
{
|
|
54
|
+
"tagName": "p",
|
|
55
|
+
"textContent": "Selected, plain, dirty, closable, and a label longer than the tab is wide."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"tagName": "jx-tabs",
|
|
59
|
+
"attributes": { "label": "Tab states", "selected": "one" },
|
|
60
|
+
"children": [
|
|
61
|
+
{ "tagName": "jx-tab", "attributes": { "value": "one", "label": "Selected" } },
|
|
62
|
+
{ "tagName": "jx-tab", "attributes": { "value": "two", "label": "Plain" } },
|
|
63
|
+
{
|
|
64
|
+
"tagName": "jx-tab",
|
|
65
|
+
"attributes": { "value": "three", "label": "Unsaved", "dirty": "" }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"tagName": "jx-tab",
|
|
69
|
+
"attributes": { "value": "four", "label": "Closable", "closable": "" }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"tagName": "jx-tab",
|
|
73
|
+
"attributes": {
|
|
74
|
+
"value": "five",
|
|
75
|
+
"label": "A label far longer than the tab it sits in",
|
|
76
|
+
"closable": "",
|
|
77
|
+
"dirty": ""
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{ "tagName": "h2", "textContent": "The three slots" },
|
|
83
|
+
{
|
|
84
|
+
"tagName": "p",
|
|
85
|
+
"textContent": "icon draws before the label, status and actions after it, and both land before the tab's own dirty dot and close button — so a consumer decorates a tab without re-implementing the tablist. There is deliberately no default slot: the tab's words are the label attribute, and unnamed content has nowhere to go."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"tagName": "p",
|
|
89
|
+
"textContent": "status is for a mark ABOUT the document (a draft pill, a count, a sync state) and actions is for a control (a pin, a lock). The difference is the click: a click on a mark is a click on the tab and selects it, and a click inside actions stops there, exactly as the close button's does."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"tagName": "jx-tabs",
|
|
93
|
+
"attributes": { "label": "Slots", "selected": "post" },
|
|
94
|
+
"children": [
|
|
95
|
+
{
|
|
96
|
+
"tagName": "jx-tab",
|
|
97
|
+
"attributes": { "value": "post", "label": "hello.md", "closable": "", "dirty": "" },
|
|
98
|
+
"children": [
|
|
99
|
+
{
|
|
100
|
+
"tagName": "span",
|
|
101
|
+
"attributes": { "slot": "icon", "aria-hidden": "true" },
|
|
102
|
+
"textContent": "↳"
|
|
103
|
+
},
|
|
104
|
+
{ "tagName": "span", "attributes": { "slot": "status" }, "textContent": "Draft" },
|
|
105
|
+
{
|
|
106
|
+
"tagName": "jx-action-button",
|
|
107
|
+
"attributes": { "slot": "actions" },
|
|
108
|
+
"$props": {
|
|
109
|
+
"icon": "eye",
|
|
110
|
+
"size": "sm",
|
|
111
|
+
"label": "Preview hello.md",
|
|
112
|
+
"hint": "Preview",
|
|
113
|
+
"tabindex": "0"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"tagName": "jx-tab",
|
|
120
|
+
"attributes": { "value": "about", "label": "about.md", "closable": "" },
|
|
121
|
+
"children": [
|
|
122
|
+
{
|
|
123
|
+
"tagName": "jx-icon",
|
|
124
|
+
"attributes": { "slot": "icon", "aria-hidden": "true" },
|
|
125
|
+
"$props": { "name": "file-text" }
|
|
126
|
+
},
|
|
127
|
+
{ "tagName": "span", "attributes": { "slot": "status" }, "textContent": "Published" }
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"tagName": "jx-tab",
|
|
132
|
+
"attributes": { "value": "styles", "label": "main.css", "closable": "" }
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{ "tagName": "h2", "textContent": "A control inside a tab" },
|
|
137
|
+
{
|
|
138
|
+
"tagName": "p",
|
|
139
|
+
"textContent": "A control in actions is in the tab order only while its tab is the current one — bind its tabindex the way the close button's is bound, or a strip of ten tabs becomes ten stops. jx-action-button takes tabindex as a property for exactly this. Enter and Space on it belong to the control; the arrows still move the strip's caret from wherever focus is."
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"tagName": "jx-tabs",
|
|
143
|
+
"attributes": { "label": "Roving caret", "selected": "current" },
|
|
144
|
+
"children": [
|
|
145
|
+
{
|
|
146
|
+
"tagName": "jx-tab",
|
|
147
|
+
"attributes": { "value": "current", "label": "Current", "closable": "" },
|
|
148
|
+
"children": [
|
|
149
|
+
{
|
|
150
|
+
"tagName": "jx-action-button",
|
|
151
|
+
"attributes": { "slot": "actions" },
|
|
152
|
+
"$props": {
|
|
153
|
+
"icon": "eye",
|
|
154
|
+
"size": "sm",
|
|
155
|
+
"label": "Preview Current",
|
|
156
|
+
"hint": "Preview",
|
|
157
|
+
"tabindex": "0"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"tagName": "jx-tab",
|
|
164
|
+
"attributes": { "value": "other", "label": "Other", "closable": "" },
|
|
165
|
+
"children": [
|
|
166
|
+
{
|
|
167
|
+
"tagName": "jx-action-button",
|
|
168
|
+
"attributes": { "slot": "actions" },
|
|
169
|
+
"$props": {
|
|
170
|
+
"icon": "eye",
|
|
171
|
+
"size": "sm",
|
|
172
|
+
"label": "Preview Other",
|
|
173
|
+
"hint": "Preview",
|
|
174
|
+
"tabindex": "-1"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{ "tagName": "h2", "textContent": "The close affordance" },
|
|
182
|
+
{
|
|
183
|
+
"tagName": "p",
|
|
184
|
+
"textContent": "It is a plain button with a jx-icon inside, never a nested kit button: a defined element that ships its own default slot would capture the host's slot distribution. The click stops at the button, so closing never also selects."
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"tagName": "jx-tabs",
|
|
188
|
+
"attributes": { "label": "Open documents", "selected": "index" },
|
|
189
|
+
"children": [
|
|
190
|
+
{
|
|
191
|
+
"tagName": "jx-tab",
|
|
192
|
+
"attributes": { "value": "index", "label": "index.page.json", "closable": "" }
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"tagName": "jx-tab",
|
|
196
|
+
"attributes": { "value": "about", "label": "about.page.json", "closable": "" }
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jxsuite.com/schema/v1",
|
|
3
|
+
"$id": "StylebookTabs",
|
|
4
|
+
"tagName": "main",
|
|
5
|
+
"$elements": [
|
|
6
|
+
{
|
|
7
|
+
"$ref": "../components/jx-icon.json"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"$ref": "../components/jx-tab.json"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"$ref": "../components/jx-tab-panel.json"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"$ref": "../components/jx-tabs.json"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"state": {
|
|
20
|
+
"sections": [
|
|
21
|
+
{
|
|
22
|
+
"id": "design",
|
|
23
|
+
"title": "Design",
|
|
24
|
+
"body": "Size, spacing and colour for the selected node."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "content",
|
|
28
|
+
"title": "Content",
|
|
29
|
+
"body": "The text and media this node renders."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "logic",
|
|
33
|
+
"title": "Logic",
|
|
34
|
+
"body": "Bindings, conditions and the handlers they run."
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"current": "design",
|
|
38
|
+
"manual": "content",
|
|
39
|
+
"onChange": {
|
|
40
|
+
"$prototype": "Function",
|
|
41
|
+
"body": [
|
|
42
|
+
{
|
|
43
|
+
"operator": "=",
|
|
44
|
+
"target": {
|
|
45
|
+
"$ref": "#/state/current"
|
|
46
|
+
},
|
|
47
|
+
"value": {
|
|
48
|
+
"$ref": "event#/detail"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"onManual": {
|
|
54
|
+
"$prototype": "Function",
|
|
55
|
+
"body": [
|
|
56
|
+
{
|
|
57
|
+
"operator": "=",
|
|
58
|
+
"target": {
|
|
59
|
+
"$ref": "#/state/manual"
|
|
60
|
+
},
|
|
61
|
+
"value": {
|
|
62
|
+
"$ref": "event#/detail"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"style": {
|
|
69
|
+
"fontFamily": "var(--jx-font-sans)",
|
|
70
|
+
"fontSize": "var(--jx-text-md)",
|
|
71
|
+
"color": "var(--jx-fg)",
|
|
72
|
+
"background": "var(--jx-bg)",
|
|
73
|
+
"padding": "var(--jx-space-6)",
|
|
74
|
+
"minHeight": "100vh",
|
|
75
|
+
"& > h1": {
|
|
76
|
+
"fontSize": "var(--jx-text-lg)",
|
|
77
|
+
"fontWeight": "600",
|
|
78
|
+
"margin": "0 0 var(--jx-space-5)"
|
|
79
|
+
},
|
|
80
|
+
"& > h2": {
|
|
81
|
+
"fontSize": "var(--jx-text-md)",
|
|
82
|
+
"fontWeight": "600",
|
|
83
|
+
"margin": "var(--jx-space-6) 0 var(--jx-space-3)"
|
|
84
|
+
},
|
|
85
|
+
"& > p": {
|
|
86
|
+
"color": "var(--jx-fg-dim)",
|
|
87
|
+
"margin": "0 0 var(--jx-space-5)",
|
|
88
|
+
"maxWidth": "60ch"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"children": [
|
|
92
|
+
{
|
|
93
|
+
"tagName": "h1",
|
|
94
|
+
"textContent": "jx-tabs"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"tagName": "p",
|
|
98
|
+
"textContent": "The strip IS the tablist: the host carries role=\"tablist\" and its tabs are its own children, with nothing generic between them. A tab and the panel it controls are paired by two ids the consumer mints from one key, which is what this page does."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"tagName": "h2",
|
|
102
|
+
"textContent": "Automatic activation"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"tagName": "p",
|
|
106
|
+
"textContent": "Arrow keys move the caret and select as they land. Selected: ${state.current}"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"tagName": "jx-tabs",
|
|
110
|
+
"attributes": {
|
|
111
|
+
"label": "Inspector sections",
|
|
112
|
+
"activation": "auto",
|
|
113
|
+
"selected": "${state.current}"
|
|
114
|
+
},
|
|
115
|
+
"onchange": {
|
|
116
|
+
"$ref": "#/state/onChange"
|
|
117
|
+
},
|
|
118
|
+
"children": [
|
|
119
|
+
{
|
|
120
|
+
"$prototype": "Array",
|
|
121
|
+
"items": {
|
|
122
|
+
"$ref": "#/state/sections"
|
|
123
|
+
},
|
|
124
|
+
"key": {
|
|
125
|
+
"$ref": "$map/item/id"
|
|
126
|
+
},
|
|
127
|
+
"map": {
|
|
128
|
+
"tagName": "jx-tab",
|
|
129
|
+
"attributes": {
|
|
130
|
+
"id": "tab-${$map.item.id}",
|
|
131
|
+
"value": "${$map.item.id}",
|
|
132
|
+
"label": "${$map.item.title}",
|
|
133
|
+
"panel": "panel-${$map.item.id}"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"$prototype": "Array",
|
|
141
|
+
"items": {
|
|
142
|
+
"$ref": "#/state/sections"
|
|
143
|
+
},
|
|
144
|
+
"key": {
|
|
145
|
+
"$ref": "$map/item/id"
|
|
146
|
+
},
|
|
147
|
+
"map": {
|
|
148
|
+
"tagName": "jx-tab-panel",
|
|
149
|
+
"attributes": {
|
|
150
|
+
"id": "panel-${$map.item.id}",
|
|
151
|
+
"labelledby": "tab-${$map.item.id}",
|
|
152
|
+
"active": "${$map.item.id === state.current}"
|
|
153
|
+
},
|
|
154
|
+
"children": [
|
|
155
|
+
{
|
|
156
|
+
"tagName": "p",
|
|
157
|
+
"textContent": "${$map.item.body}"
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"tagName": "h2",
|
|
164
|
+
"textContent": "Manual activation"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"tagName": "p",
|
|
168
|
+
"textContent": "The caret moves alone; Enter or Space commits. Selected: ${state.manual}"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"tagName": "jx-tabs",
|
|
172
|
+
"attributes": {
|
|
173
|
+
"label": "Dock panes",
|
|
174
|
+
"activation": "manual",
|
|
175
|
+
"selected": "${state.manual}"
|
|
176
|
+
},
|
|
177
|
+
"onchange": {
|
|
178
|
+
"$ref": "#/state/onManual"
|
|
179
|
+
},
|
|
180
|
+
"children": [
|
|
181
|
+
{
|
|
182
|
+
"$prototype": "Array",
|
|
183
|
+
"items": {
|
|
184
|
+
"$ref": "#/state/sections"
|
|
185
|
+
},
|
|
186
|
+
"key": {
|
|
187
|
+
"$ref": "$map/item/id"
|
|
188
|
+
},
|
|
189
|
+
"map": {
|
|
190
|
+
"tagName": "jx-tab",
|
|
191
|
+
"attributes": {
|
|
192
|
+
"value": "${$map.item.id}",
|
|
193
|
+
"label": "${$map.item.title}"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"tagName": "h2",
|
|
201
|
+
"textContent": "Vertical"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"tagName": "p",
|
|
205
|
+
"textContent": "Up and Down move the caret, and the rule moves to the inline edge."
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"tagName": "div",
|
|
209
|
+
"style": {
|
|
210
|
+
"display": "flex",
|
|
211
|
+
"alignItems": "flex-start",
|
|
212
|
+
"gap": "var(--jx-space-5)"
|
|
213
|
+
},
|
|
214
|
+
"children": [
|
|
215
|
+
{
|
|
216
|
+
"tagName": "jx-tabs",
|
|
217
|
+
"attributes": {
|
|
218
|
+
"label": "Settings groups",
|
|
219
|
+
"orientation": "vertical",
|
|
220
|
+
"selected": "design"
|
|
221
|
+
},
|
|
222
|
+
"children": [
|
|
223
|
+
{
|
|
224
|
+
"$prototype": "Array",
|
|
225
|
+
"items": {
|
|
226
|
+
"$ref": "#/state/sections"
|
|
227
|
+
},
|
|
228
|
+
"key": {
|
|
229
|
+
"$ref": "$map/item/id"
|
|
230
|
+
},
|
|
231
|
+
"map": {
|
|
232
|
+
"tagName": "jx-tab",
|
|
233
|
+
"attributes": {
|
|
234
|
+
"value": "${$map.item.id}",
|
|
235
|
+
"label": "${$map.item.title}"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"tagName": "h2",
|
|
245
|
+
"textContent": "Closable and dirty"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"tagName": "p",
|
|
249
|
+
"textContent": "A closable tab draws a close button that dispatches close with the tab's value; Delete on the focused tab is the same path. The dot marks unsaved work and is hidden from assistive technology."
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"tagName": "jx-tabs",
|
|
253
|
+
"attributes": {
|
|
254
|
+
"label": "Open documents",
|
|
255
|
+
"selected": "index"
|
|
256
|
+
},
|
|
257
|
+
"children": [
|
|
258
|
+
{
|
|
259
|
+
"tagName": "jx-tab",
|
|
260
|
+
"attributes": {
|
|
261
|
+
"value": "index",
|
|
262
|
+
"label": "index.page.json",
|
|
263
|
+
"closable": "",
|
|
264
|
+
"dirty": ""
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"tagName": "jx-tab",
|
|
269
|
+
"attributes": {
|
|
270
|
+
"value": "about",
|
|
271
|
+
"label": "about.page.json",
|
|
272
|
+
"closable": ""
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
}
|