@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,216 @@
1
+ {
2
+ "$schema": "https://jxsuite.com/schema/v1",
3
+ "$id": "JxColorSlider",
4
+ "tagName": "jx-color-slider",
5
+ "observedAttributes": [
6
+ "label",
7
+ "labelledby",
8
+ "channel",
9
+ "value",
10
+ "min",
11
+ "max",
12
+ "step",
13
+ "color",
14
+ "disabled"
15
+ ],
16
+ "state": {
17
+ "label": {
18
+ "type": "string",
19
+ "default": "",
20
+ "attribute": "label",
21
+ "description": "The accessible name, forwarded to the inner range as aria-label. Required unless labelledby names a visible one: a slider is in the accessibility lint's LABELLED_ROLES, so it may not take its name from anything it contains, and an unnamed hue track is announced as \"slider\" and a number."
22
+ },
23
+ "labelledby": {
24
+ "type": "string",
25
+ "default": "",
26
+ "attribute": "labelledby",
27
+ "description": "Forwarded to the inner range as aria-labelledby, for a visible label the element does not own."
28
+ },
29
+ "channel": {
30
+ "type": "string",
31
+ "default": "hue",
32
+ "attribute": "channel",
33
+ "description": "What the track is made of: hue draws the full spectrum and runs 0-360, alpha draws the colour fading out over a checkerboard and runs 0-100. It chooses the drawing, the default top of the range and the units the value is announced in, so it is the one prop that has to be right; everything else has a sensible answer without it."
34
+ },
35
+ "value": {
36
+ "type": "number",
37
+ "default": 0,
38
+ "attribute": "value",
39
+ "description": "Where the thumb is, in the track's own units — degrees on a hue track, percent on an alpha one. It is bound to the inner range BOTH ways: as the value property, which is the live value once the reader's first drag has set the control's dirty flag, and as the value attribute, which is the control's default and therefore what a form reset returns to."
40
+ },
41
+ "min": {
42
+ "type": "number",
43
+ "default": 0,
44
+ "attribute": "min",
45
+ "description": "The bottom of the range. Zero for both shipped channels, and there so a consumer can cut a track down to a band."
46
+ },
47
+ "max": {
48
+ "type": "number",
49
+ "default": 0,
50
+ "attribute": "max",
51
+ "description": "The top of the range, or 0 to let the channel decide — 360 for hue, 100 for alpha. Zero means unset rather than a top of zero, because a numeric prop coerces a removed attribute through the current value's type and a non-zero default could then never be cleared; a track that genuinely ends at zero has nowhere to move and is not a control."
52
+ },
53
+ "step": {
54
+ "type": "number",
55
+ "default": 1,
56
+ "attribute": "step",
57
+ "description": "The grid the value moves on, for the platform's own arrow keys and for the kit's ten-step Shift+Arrow."
58
+ },
59
+ "color": {
60
+ "type": "string",
61
+ "default": "",
62
+ "attribute": "color",
63
+ "description": "The colour an alpha track fades from, as any CSS colour. Ignored by a hue track. Empty falls back to currentColor, so a track with nothing told to it still draws something honest rather than nothing at all."
64
+ },
65
+ "disabled": {
66
+ "type": "boolean",
67
+ "default": false,
68
+ "attribute": "disabled",
69
+ "description": "Cannot be moved or focused. Forwarded to the inner range, so the refusal is the platform's rather than a style that only looks like one."
70
+ },
71
+ "maxValue": "${state.max > 0 ? state.max : (state.channel === 'alpha' ? 100 : 360)}",
72
+ "trackImage": "${state.channel === 'alpha' ? 'linear-gradient(to right, transparent, ' + (state.color || 'currentColor') + ')' : 'linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%))'}",
73
+ "valueText": "${state.channel === 'alpha' ? Math.round(state.value) + '%' : Math.round(state.value) + ' degrees'}",
74
+ "onInput": {
75
+ "$prototype": "Function",
76
+ "$src": "jx-ui:/behaviors/color-slider.ts",
77
+ "$export": "onSliderInput",
78
+ "emits": [
79
+ {
80
+ "name": "input",
81
+ "description": "The value is moving under the reader's hand. It comes from the ELEMENT, so e.target.value is the number in the track's own units."
82
+ }
83
+ ],
84
+ "description": "Mirrors the inner range into value and re-says the platform's own input from the host, so one e.target answers for every colour element in the kit."
85
+ },
86
+ "onChange": {
87
+ "$prototype": "Function",
88
+ "$src": "jx-ui:/behaviors/color-slider.ts",
89
+ "$export": "onSliderChange",
90
+ "emits": [
91
+ {
92
+ "name": "change",
93
+ "description": "The reader committed the value; e.target is the element."
94
+ }
95
+ ],
96
+ "description": "The same mirror and the same re-say, for the commit."
97
+ },
98
+ "onKeydown": {
99
+ "$prototype": "Function",
100
+ "$src": "jx-ui:/behaviors/color-slider.ts",
101
+ "$export": "onSliderKeydown",
102
+ "description": "Shift+Arrow moves ten steps, which no range has of its own. A plain arrow, Home, End and the Page keys are the platform's and are not touched."
103
+ }
104
+ },
105
+ "oninput": {
106
+ "$ref": "#/state/onInput"
107
+ },
108
+ "onchange": {
109
+ "$ref": "#/state/onChange"
110
+ },
111
+ "onkeydown": {
112
+ "$ref": "#/state/onKeydown"
113
+ },
114
+ "attributes": {
115
+ "data-channel": "${state.channel}",
116
+ "data-disabled": "${state.disabled ? '' : null}"
117
+ },
118
+ "style": {
119
+ "display": "block",
120
+ "&[hidden]": {
121
+ "display": "none"
122
+ },
123
+ "boxSizing": "border-box",
124
+ "inlineSize": "100%",
125
+ "minInlineSize": "120px",
126
+ "--jx-color-track-h": "16px",
127
+ "--jx-color-track-image": "${state.trackImage}",
128
+ "--jx-color-checkerboard": "repeating-conic-gradient(var(--jx-gray-300) 0% 25%, var(--jx-bg-input) 0% 50%) 50% / 8px 8px",
129
+ "&[data-disabled]": {
130
+ "opacity": "0.5"
131
+ },
132
+ "& > [part=\"track\"]": {
133
+ "position": "relative",
134
+ "display": "block",
135
+ "boxSizing": "border-box",
136
+ "inlineSize": "100%",
137
+ "blockSize": "var(--jx-color-track-h)",
138
+ "borderRadius": "var(--jx-radius-sm)",
139
+ "background": "var(--jx-color-track-image), var(--jx-color-checkerboard)",
140
+ "boxShadow": "inset 0 0 0 1px var(--jx-border-strong)"
141
+ },
142
+ "& [part=\"input\"]": {
143
+ "appearance": "none",
144
+ "position": "absolute",
145
+ "insetInline": "0",
146
+ "insetBlock": "0",
147
+ "inlineSize": "100%",
148
+ "blockSize": "100%",
149
+ "margin": "0",
150
+ "padding": "0",
151
+ "border": "0",
152
+ "background": "none",
153
+ "font": "inherit",
154
+ "cursor": "pointer",
155
+ "outline": "none",
156
+ ":focus-visible": {
157
+ "outline": "var(--jx-focus-ring)",
158
+ "outlineOffset": "2px",
159
+ "borderRadius": "var(--jx-radius-sm)"
160
+ },
161
+ ":disabled": {
162
+ "cursor": "default"
163
+ }
164
+ },
165
+ "& [part=\"input\"]::-webkit-slider-thumb": {
166
+ "appearance": "none",
167
+ "inlineSize": "12px",
168
+ "blockSize": "var(--jx-color-track-h)",
169
+ "borderRadius": "var(--jx-radius-xs)",
170
+ "border": "2px solid var(--jx-bg)",
171
+ "boxShadow": "0 0 0 1px var(--jx-fg)",
172
+ "background": "transparent",
173
+ "cursor": "inherit"
174
+ },
175
+ "& [part=\"input\"]::-moz-range-thumb": {
176
+ "appearance": "none",
177
+ "inlineSize": "12px",
178
+ "blockSize": "var(--jx-color-track-h)",
179
+ "borderRadius": "var(--jx-radius-xs)",
180
+ "border": "2px solid var(--jx-bg)",
181
+ "boxShadow": "0 0 0 1px var(--jx-fg)",
182
+ "background": "transparent",
183
+ "cursor": "inherit"
184
+ }
185
+ },
186
+ "children": [
187
+ {
188
+ "tagName": "div",
189
+ "attributes": {
190
+ "part": "track"
191
+ },
192
+ "children": [
193
+ {
194
+ "tagName": "input",
195
+ "attributes": {
196
+ "part": "input",
197
+ "type": "range",
198
+ "aria-label": "${state.label || null}",
199
+ "aria-labelledby": "${state.labelledby || null}",
200
+ "aria-valuetext": "${state.valueText}",
201
+ "min": "${state.min}",
202
+ "max": "${state.maxValue}",
203
+ "step": "${state.step}",
204
+ "value": "${state.value}",
205
+ "disabled": {
206
+ "$ref": "#/state/disabled"
207
+ }
208
+ },
209
+ "value": {
210
+ "$ref": "#/state/value"
211
+ }
212
+ }
213
+ ]
214
+ }
215
+ ]
216
+ }