@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,186 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "StylebookDialog",
4
+ "tagName": "main",
5
+ "$elements": [
6
+ {
7
+ "$ref": "../components/jx-icon.json"
8
+ },
9
+ {
10
+ "$ref": "../components/jx-button.json"
11
+ },
12
+ {
13
+ "$ref": "../components/jx-dialog.json"
14
+ }
15
+ ],
16
+ "state": {},
17
+ "style": {
18
+ "fontFamily": "var(--jx-font-sans)",
19
+ "fontSize": "var(--jx-text-md)",
20
+ "color": "var(--jx-fg)",
21
+ "background": "var(--jx-bg)",
22
+ "padding": "var(--jx-space-6)",
23
+ "minHeight": "100vh",
24
+ "& > h1": {
25
+ "fontSize": "var(--jx-text-lg)",
26
+ "fontWeight": "600",
27
+ "margin": "0 0 var(--jx-space-5)"
28
+ },
29
+ "& > p": {
30
+ "color": "var(--jx-fg-dim)",
31
+ "margin": "0 0 var(--jx-space-5)"
32
+ },
33
+ "& [role=\"group\"]": {
34
+ "display": "flex",
35
+ "alignItems": "center",
36
+ "gap": "var(--jx-space-3)",
37
+ "margin": "0 0 var(--jx-space-4)"
38
+ },
39
+ "& [role=\"group\"] > span": {
40
+ "width": "80px",
41
+ "color": "var(--jx-fg-muted)",
42
+ "fontSize": "var(--jx-text-sm)"
43
+ }
44
+ },
45
+ "children": [
46
+ {
47
+ "tagName": "h1",
48
+ "textContent": "jx-dialog"
49
+ },
50
+ {
51
+ "tagName": "p",
52
+ "textContent": "A native dialog opened modally. Each button below aims a --show command at its dialog, which is how a page opens one with no script; Escape cancels, and only the dismissible one closes on a click outside."
53
+ },
54
+ {
55
+ "tagName": "div",
56
+ "attributes": {
57
+ "role": "group",
58
+ "aria-label": "Openers"
59
+ },
60
+ "children": [
61
+ {
62
+ "tagName": "jx-button",
63
+ "$props": {
64
+ "variant": "accent",
65
+ "command": "--show",
66
+ "commandfor": "confirm-demo"
67
+ },
68
+ "children": [
69
+ {
70
+ "tagName": "span",
71
+ "textContent": "Confirm\u2026"
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "tagName": "jx-button",
77
+ "$props": {
78
+ "command": "--show",
79
+ "commandfor": "destructive-demo"
80
+ },
81
+ "children": [
82
+ {
83
+ "tagName": "span",
84
+ "textContent": "Delete\u2026"
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ "tagName": "jx-button",
90
+ "$props": {
91
+ "command": "--show",
92
+ "commandfor": "three-demo"
93
+ },
94
+ "children": [
95
+ {
96
+ "tagName": "span",
97
+ "textContent": "Save or discard\u2026"
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "tagName": "jx-button",
103
+ "$props": {
104
+ "command": "--show",
105
+ "commandfor": "dismissible-demo"
106
+ },
107
+ "children": [
108
+ {
109
+ "tagName": "span",
110
+ "textContent": "Dismissible\u2026"
111
+ }
112
+ ]
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ "tagName": "jx-dialog",
118
+ "attributes": {
119
+ "id": "confirm-demo"
120
+ },
121
+ "$props": {
122
+ "headline": "Publish the site?",
123
+ "confirmLabel": "Publish"
124
+ },
125
+ "children": [
126
+ {
127
+ "tagName": "p",
128
+ "textContent": "Every page is built and uploaded. Nothing else changes."
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "tagName": "jx-dialog",
134
+ "attributes": {
135
+ "id": "destructive-demo"
136
+ },
137
+ "$props": {
138
+ "headline": "Delete about.md?",
139
+ "confirmLabel": "Delete",
140
+ "destructive": true
141
+ },
142
+ "children": [
143
+ {
144
+ "tagName": "p",
145
+ "textContent": "The file is removed from the project. This cannot be undone."
146
+ }
147
+ ]
148
+ },
149
+ {
150
+ "tagName": "jx-dialog",
151
+ "attributes": {
152
+ "id": "three-demo"
153
+ },
154
+ "$props": {
155
+ "headline": "Save changes to index.json?",
156
+ "confirmLabel": "Save",
157
+ "secondaryLabel": "Discard",
158
+ "size": "md"
159
+ },
160
+ "children": [
161
+ {
162
+ "tagName": "p",
163
+ "textContent": "Your changes are lost if you close without saving."
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "tagName": "jx-dialog",
169
+ "attributes": {
170
+ "id": "dismissible-demo"
171
+ },
172
+ "$props": {
173
+ "headline": "About this kit",
174
+ "confirmLabel": "",
175
+ "cancelLabel": "Close",
176
+ "dismissible": true
177
+ },
178
+ "children": [
179
+ {
180
+ "tagName": "p",
181
+ "textContent": "A dialog with nothing to answer: click outside it, press Escape, or close it."
182
+ }
183
+ ]
184
+ }
185
+ ]
186
+ }
@@ -0,0 +1,125 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "StylebookDivider",
4
+ "tagName": "main",
5
+ "$elements": [
6
+ { "$ref": "../components/jx-icon.json" },
7
+ { "$ref": "../components/jx-divider.json" },
8
+ { "$ref": "../components/jx-action-button.json" },
9
+ { "$ref": "../components/jx-toolbar.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
+ "& > p": { "color": "var(--jx-fg-dim)", "margin": "0 0 var(--jx-space-5)" },
24
+ "& [data-toolbar]": {
25
+ "display": "flex",
26
+ "alignItems": "center",
27
+ "gap": "var(--jx-space-1)",
28
+ "height": "var(--jx-control-h)",
29
+ "padding": "0 var(--jx-space-2)",
30
+ "width": "320px",
31
+ "border": "1px solid var(--jx-border)",
32
+ "borderRadius": "var(--jx-radius-sm)",
33
+ "background": "var(--jx-bg-panel)",
34
+ "margin": "0 0 var(--jx-space-5)"
35
+ },
36
+ "& [data-stack]": {
37
+ "display": "flex",
38
+ "flexDirection": "column",
39
+ "width": "220px",
40
+ "padding": "var(--jx-space-2)",
41
+ "border": "1px solid var(--jx-border)",
42
+ "borderRadius": "var(--jx-radius-sm)",
43
+ "background": "var(--jx-bg-panel)",
44
+ "margin": "0 0 var(--jx-space-5)"
45
+ },
46
+ "& [data-stack] > div": {
47
+ "padding": "var(--jx-space-1) var(--jx-space-2)",
48
+ "lineHeight": "var(--jx-leading-md)"
49
+ }
50
+ },
51
+ "children": [
52
+ { "tagName": "h1", "textContent": "jx-divider" },
53
+ {
54
+ "tagName": "p",
55
+ "textContent": "A hairline, drawn by an inner hr the platform already announces as a separator. orientation turns it: the vertical branch makes the host a flex box exactly as wide as the rule it holds, so it stretches to a toolbar's height and takes no width beyond the hairline. The host still HAS a box: one client rect, coincident with the rule, which is what the canvas selects and drops onto. display: contents would measure the same and leave nothing to select."
56
+ },
57
+ {
58
+ "tagName": "div",
59
+ "attributes": {
60
+ "data-stack": "",
61
+ "role": "group",
62
+ "aria-label": "Horizontal, between menu rows"
63
+ },
64
+ "children": [
65
+ { "tagName": "div", "textContent": "Cut" },
66
+ { "tagName": "div", "textContent": "Copy" },
67
+ { "tagName": "jx-divider" },
68
+ { "tagName": "div", "textContent": "Paste" },
69
+ { "tagName": "jx-divider", "$props": { "orientation": "horizontal" } },
70
+ { "tagName": "div", "textContent": "Delete" }
71
+ ]
72
+ },
73
+ {
74
+ "tagName": "jx-toolbar",
75
+ "$props": {
76
+ "label": "Vertical, between tool groups"
77
+ },
78
+ "attributes": {
79
+ "data-toolbar": ""
80
+ },
81
+ "children": [
82
+ { "tagName": "jx-action-button", "$props": { "icon": "arrow-u-up-left", "label": "Undo" } },
83
+ {
84
+ "tagName": "jx-action-button",
85
+ "$props": { "icon": "arrow-u-up-right", "label": "Redo" }
86
+ },
87
+ { "tagName": "jx-divider", "$props": { "orientation": "vertical" } },
88
+ { "tagName": "jx-action-button", "$props": { "icon": "trash", "label": "Delete" } },
89
+ { "tagName": "jx-divider", "$props": { "orientation": "vertical" } },
90
+ { "tagName": "jx-action-button", "$props": { "icon": "gear", "label": "Settings" } }
91
+ ]
92
+ },
93
+ {
94
+ "tagName": "p",
95
+ "textContent": "hidden removes the hairline AND its advance, in either orientation. The host declares a display of its own, so it re-states the hiding the UA rule would otherwise have done. The vertical branch declares one too, which is why there is a second, more specific rule for it."
96
+ },
97
+ {
98
+ "tagName": "jx-toolbar",
99
+ "$props": {
100
+ "label": "Hidden, between the same two buttons"
101
+ },
102
+ "attributes": {
103
+ "data-toolbar": ""
104
+ },
105
+ "children": [
106
+ { "tagName": "jx-action-button", "$props": { "icon": "arrow-u-up-left", "label": "Undo" } },
107
+ { "tagName": "jx-divider", "$props": { "orientation": "vertical" }, "hidden": true },
108
+ { "tagName": "jx-action-button", "$props": { "icon": "trash", "label": "Delete" } }
109
+ ]
110
+ },
111
+ {
112
+ "tagName": "div",
113
+ "attributes": {
114
+ "data-stack": "",
115
+ "role": "group",
116
+ "aria-label": "Hidden, between the same two rows"
117
+ },
118
+ "children": [
119
+ { "tagName": "div", "textContent": "Cut" },
120
+ { "tagName": "jx-divider", "hidden": true },
121
+ { "tagName": "div", "textContent": "Paste" }
122
+ ]
123
+ }
124
+ ]
125
+ }
@@ -0,0 +1,92 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "StylebookDot",
4
+ "tagName": "main",
5
+ "$elements": [
6
+ { "$ref": "../components/jx-dot.json" },
7
+ { "$ref": "../components/jx-divider.json" }
8
+ ],
9
+ "style": {
10
+ "fontFamily": "var(--jx-font-sans)",
11
+ "fontSize": "var(--jx-text-md)",
12
+ "color": "var(--jx-fg)",
13
+ "background": "var(--jx-bg)",
14
+ "padding": "var(--jx-space-6)",
15
+ "minHeight": "100vh",
16
+ "& > h1": {
17
+ "fontSize": "var(--jx-text-lg)",
18
+ "fontWeight": "600",
19
+ "margin": "0 0 var(--jx-space-5)"
20
+ },
21
+ "& > p": { "color": "var(--jx-fg-dim)", "margin": "0 0 var(--jx-space-5)" },
22
+ "& [role=\"group\"]": {
23
+ "display": "flex",
24
+ "alignItems": "center",
25
+ "gap": "var(--jx-space-3)",
26
+ "margin": "0 0 var(--jx-space-4)"
27
+ },
28
+ "& [role=\"group\"] > span": {
29
+ "width": "120px",
30
+ "color": "var(--jx-fg-muted)",
31
+ "fontSize": "var(--jx-text-sm)"
32
+ },
33
+ "& [data-crowded]": {
34
+ "display": "flex",
35
+ "alignItems": "center",
36
+ "gap": "var(--jx-space-2)",
37
+ "width": "140px",
38
+ "padding": "var(--jx-space-1) var(--jx-space-2)",
39
+ "border": "1px solid var(--jx-border)",
40
+ "borderRadius": "var(--jx-radius-sm)",
41
+ "margin": "0 0 var(--jx-space-5)"
42
+ },
43
+ "& [data-crowded] > span": {
44
+ "whiteSpace": "nowrap",
45
+ "overflow": "hidden",
46
+ "textOverflow": "ellipsis"
47
+ }
48
+ },
49
+ "children": [
50
+ { "tagName": "h1", "textContent": "jx-dot" },
51
+ {
52
+ "tagName": "p",
53
+ "textContent": "A six-pixel status disc. tone recolours it and nothing else; it carries no name of its own, so a row that means something by it says so in its own text or names the dot at the usage site."
54
+ },
55
+ {
56
+ "tagName": "div",
57
+ "attributes": { "role": "group", "aria-label": "Every tone" },
58
+ "children": [
59
+ { "tagName": "span", "textContent": "tones" },
60
+ { "tagName": "jx-dot" },
61
+ { "tagName": "jx-dot", "$props": { "tone": "danger" } },
62
+ { "tagName": "jx-dot", "$props": { "tone": "success" } },
63
+ { "tagName": "jx-dot", "$props": { "tone": "warning" } },
64
+ { "tagName": "jx-dot", "$props": { "tone": "unknown" } }
65
+ ]
66
+ },
67
+ {
68
+ "tagName": "div",
69
+ "attributes": { "role": "group", "aria-label": "Beside a label" },
70
+ "children": [
71
+ { "tagName": "span", "textContent": "in a row" },
72
+ { "tagName": "jx-dot", "$props": { "tone": "success" } },
73
+ { "tagName": "span", "textContent": "Connected" },
74
+ { "tagName": "jx-divider", "$props": { "orientation": "vertical" } },
75
+ { "tagName": "jx-dot", "$props": { "tone": "danger" } },
76
+ { "tagName": "span", "textContent": "Three errors" }
77
+ ]
78
+ },
79
+ {
80
+ "tagName": "div",
81
+ "attributes": {
82
+ "data-crowded": "",
83
+ "role": "group",
84
+ "aria-label": "Crowded out of its own row"
85
+ },
86
+ "children": [
87
+ { "tagName": "span", "textContent": "A section title far too long for this box" },
88
+ { "tagName": "jx-dot", "$props": { "tone": "warning" } }
89
+ ]
90
+ }
91
+ ]
92
+ }