@jolly-pixel/ui 1.0.1 → 2.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.
Files changed (117) hide show
  1. package/LICENSE +44 -44
  2. package/NOTICE +9 -0
  3. package/README.md +194 -194
  4. package/dist/containers/Dialog.js +11 -11
  5. package/dist/containers/Dialog.styles.js +48 -48
  6. package/dist/containers/Dock.js +11 -11
  7. package/dist/containers/Dock.styles.js +351 -351
  8. package/dist/containers/DockLayout.js +4 -4
  9. package/dist/containers/Floating.js +23 -23
  10. package/dist/containers/Floating.styles.js +116 -116
  11. package/dist/containers/Folder.js +28 -28
  12. package/dist/containers/Folder.styles.js +221 -221
  13. package/dist/containers/Pane.js +50 -50
  14. package/dist/containers/Pane.styles.js +186 -186
  15. package/dist/containers/Rail.js +18 -18
  16. package/dist/containers/Tab.js +10 -10
  17. package/dist/containers/Tabs.js +26 -26
  18. package/dist/containers/Tabs.styles.js +93 -93
  19. package/dist/containers/Toolbar.js +25 -25
  20. package/dist/containers/resize.js +5 -5
  21. package/dist/controls/Button.js +9 -9
  22. package/dist/controls/Button.styles.js +79 -79
  23. package/dist/controls/ButtonGroup.js +28 -28
  24. package/dist/controls/ButtonGroup.styles.js +98 -98
  25. package/dist/controls/Checkbox.js +14 -14
  26. package/dist/controls/Checkbox.styles.js +111 -111
  27. package/dist/controls/Color.js +51 -51
  28. package/dist/controls/Color.styles.js +83 -83
  29. package/dist/controls/ColorPicker.js +104 -104
  30. package/dist/controls/ColorPicker.styles.js +296 -296
  31. package/dist/controls/Control.js +33 -33
  32. package/dist/controls/Control.styles.js +102 -102
  33. package/dist/controls/Controls.js +11 -11
  34. package/dist/controls/Controls.styles.js +98 -98
  35. package/dist/controls/Flags.js +18 -18
  36. package/dist/controls/Flags.styles.js +59 -59
  37. package/dist/controls/Number.js +21 -21
  38. package/dist/controls/Number.styles.js +44 -44
  39. package/dist/controls/PropertyRow.js +13 -13
  40. package/dist/controls/PropertyRow.styles.js +105 -105
  41. package/dist/controls/Range.js +24 -24
  42. package/dist/controls/Range.styles.js +25 -25
  43. package/dist/controls/Select.js +23 -23
  44. package/dist/controls/Select.styles.js +47 -47
  45. package/dist/controls/Separator.js +11 -11
  46. package/dist/controls/Separator.styles.js +45 -45
  47. package/dist/controls/Slider.js +36 -36
  48. package/dist/controls/Slider.styles.js +161 -161
  49. package/dist/controls/Text.js +17 -17
  50. package/dist/data/Tree.d.ts +0 -14
  51. package/dist/data/Tree.d.ts.map +1 -1
  52. package/dist/data/Tree.js +90 -120
  53. package/dist/data/Tree.js.map +1 -1
  54. package/dist/data/Tree.styles.d.ts.map +1 -1
  55. package/dist/data/Tree.styles.js +220 -237
  56. package/dist/data/Tree.styles.js.map +1 -1
  57. package/dist/data/dropZone.d.ts +0 -10
  58. package/dist/data/dropZone.d.ts.map +1 -1
  59. package/dist/data/dropZone.js +0 -10
  60. package/dist/data/dropZone.js.map +1 -1
  61. package/dist/data/resolveRename.d.ts +0 -3
  62. package/dist/data/resolveRename.d.ts.map +1 -1
  63. package/dist/data/resolveRename.js +0 -3
  64. package/dist/data/resolveRename.js.map +1 -1
  65. package/dist/data/resolveReparent.d.ts +0 -7
  66. package/dist/data/resolveReparent.d.ts.map +1 -1
  67. package/dist/data/resolveReparent.js +0 -6
  68. package/dist/data/resolveReparent.js.map +1 -1
  69. package/dist/data/rowDragSession.d.ts +0 -8
  70. package/dist/data/rowDragSession.d.ts.map +1 -1
  71. package/dist/data/rowDragSession.js +0 -6
  72. package/dist/data/rowDragSession.js.map +1 -1
  73. package/dist/data/treeNodes.d.ts +0 -6
  74. package/dist/data/treeNodes.d.ts.map +1 -1
  75. package/dist/data/treeNodes.js +2 -7
  76. package/dist/data/treeNodes.js.map +1 -1
  77. package/dist/feedback/JollyPixelLogo.js +84 -84
  78. package/dist/feedback/Loading.js +29 -29
  79. package/dist/feedback/Loading.styles.js +230 -230
  80. package/dist/feedback/Log.js +8 -8
  81. package/dist/feedback/Log.styles.js +61 -61
  82. package/dist/feedback/Progress.js +17 -17
  83. package/dist/feedback/Progress.styles.js +146 -146
  84. package/dist/field/JollyField.js +51 -51
  85. package/dist/field/JollyField.styles.js +429 -429
  86. package/dist/icon/Icon.js +24 -24
  87. package/dist/icon/builtins.js +126 -126
  88. package/dist/interaction/drag/DragSession.js +6 -6
  89. package/dist/interaction/scrub/ScrubController.js +6 -6
  90. package/dist/math/AxisController.js +22 -22
  91. package/dist/math/Point2d.js +12 -12
  92. package/dist/math/Point2d.styles.js +49 -49
  93. package/dist/math/Quaternion.js +4 -4
  94. package/dist/math/Transform.js +40 -40
  95. package/dist/math/Transform.styles.js +17 -17
  96. package/dist/math/VectorField.js +4 -4
  97. package/dist/math/VectorField.styles.js +102 -102
  98. package/dist/monitors/Graph.js +8 -8
  99. package/dist/monitors/Graph.styles.js +42 -42
  100. package/dist/monitors/Monitor.js +5 -5
  101. package/dist/monitors/Monitor.styles.js +31 -31
  102. package/dist/peer/Presence.js +33 -33
  103. package/dist/peer/Presence.styles.js +82 -82
  104. package/dist/stats/Stats.js +6 -6
  105. package/dist/stats/Stats.styles.js +54 -54
  106. package/dist/theme/components/DensityControl.js +16 -16
  107. package/dist/theme/components/ThemeControl.js +16 -16
  108. package/dist/theme/components/ThemePreferences.js +18 -18
  109. package/dist/theme/font.js +9 -9
  110. package/dist/theme/styles/hiddenStyles.js +4 -4
  111. package/dist/theme/styles/mixins.js +16 -16
  112. package/dist/theme/styles/themeStyles.js +4 -4
  113. package/dist/theme/tokens/density.js +19 -19
  114. package/dist/theme/tokens/ramps.js +40 -40
  115. package/dist/theme/tokens/scales.js +56 -56
  116. package/dist/theme/tokens/semantic.js +184 -184
  117. package/package.json +6 -5
@@ -2,88 +2,88 @@
2
2
  import { css } from "lit";
3
3
  // Import Internal Dependencies
4
4
  import { focusRing } from "../theme/styles/mixins.js";
5
- export const colorStyles = css `
6
- /* Fill the control so the colour sample has no surrounding frame. */
7
- .value .swatch {
8
- position: relative;
9
- flex: 0 0 auto;
10
- width: var(--jolly-control-height, 20px);
11
- height: var(--jolly-control-height, 20px);
12
- padding: 0;
13
- overflow: hidden;
14
- border: none;
15
- border-radius: var(--jolly-radius-sm, 2px);
16
- background: none;
17
- cursor: pointer;
18
- transition: filter var(--jolly-duration-fast, 100ms) var(--jolly-easing, ease);
19
- }
20
-
21
- /* Avoid changing the sample fill for hover and focus states. */
22
- .value .swatch:hover:not(:disabled) {
23
- filter: brightness(1.12);
24
- }
25
-
26
- .value .swatch:focus-visible {
27
- ${focusRing}
28
- outline-offset: 1px;
29
- }
30
-
31
- /* Layer the colour over a checkerboard to reveal transparency. */
32
- .value .swatch-face {
33
- display: block;
34
- width: 100%;
35
- height: 100%;
36
- border-radius: inherit;
37
- background-color: var(--jolly-surface-raised, Canvas);
38
- background-image:
39
- linear-gradient(
40
- var(--jolly-swatch-color, transparent),
41
- var(--jolly-swatch-color, transparent)
42
- ),
43
- conic-gradient(
44
- var(--jolly-swatch-checker) 25%,
45
- transparent 0 50%,
46
- var(--jolly-swatch-checker) 0 75%,
47
- transparent 0
48
- );
49
- background-size: auto, 6px 6px;
50
- pointer-events: none;
51
- }
52
-
53
- .value .swatch {
54
- --jolly-swatch-checker: color-mix(in oklab, var(--jolly-ink) 18%, transparent);
55
- }
56
-
57
- /* Preserve the swatch slot while hiding mixed values. */
58
- :host([mixed]) .value .swatch {
59
- background: var(--jolly-control-bg);
60
- opacity: 0.35;
61
- pointer-events: none;
62
- }
63
-
64
- .value input.hex {
65
- flex: 1 1 auto;
66
- min-width: 7ch;
67
- font-variant-numeric: inherit;
68
- }
69
-
70
- :host([disabled]) .value .swatch {
71
- cursor: default;
72
- }
73
-
74
- /* Fixed positioning overrides centered UA styles for the top-layer popup. */
75
- .value .popover {
76
- position: fixed;
77
- inset: auto;
78
- width: max-content;
79
- margin: 0;
80
- padding: var(--jolly-space-1, 4px);
81
- overflow: visible;
82
- border: none;
83
- border-radius: var(--jolly-radius-md, 6px);
84
- background: var(--jolly-surface-raised, Canvas);
85
- box-shadow: var(--jolly-shadow-overlay);
86
- color: var(--jolly-text, CanvasText);
87
- }
5
+ export const colorStyles = css `
6
+ /* Fill the control so the colour sample has no surrounding frame. */
7
+ .value .swatch {
8
+ position: relative;
9
+ flex: 0 0 auto;
10
+ width: var(--jolly-control-height, 20px);
11
+ height: var(--jolly-control-height, 20px);
12
+ padding: 0;
13
+ overflow: hidden;
14
+ border: none;
15
+ border-radius: var(--jolly-radius-sm, 2px);
16
+ background: none;
17
+ cursor: pointer;
18
+ transition: filter var(--jolly-duration-fast, 100ms) var(--jolly-easing, ease);
19
+ }
20
+
21
+ /* Avoid changing the sample fill for hover and focus states. */
22
+ .value .swatch:hover:not(:disabled) {
23
+ filter: brightness(1.12);
24
+ }
25
+
26
+ .value .swatch:focus-visible {
27
+ ${focusRing}
28
+ outline-offset: 1px;
29
+ }
30
+
31
+ /* Layer the colour over a checkerboard to reveal transparency. */
32
+ .value .swatch-face {
33
+ display: block;
34
+ width: 100%;
35
+ height: 100%;
36
+ border-radius: inherit;
37
+ background-color: var(--jolly-surface-raised, Canvas);
38
+ background-image:
39
+ linear-gradient(
40
+ var(--jolly-swatch-color, transparent),
41
+ var(--jolly-swatch-color, transparent)
42
+ ),
43
+ conic-gradient(
44
+ var(--jolly-swatch-checker) 25%,
45
+ transparent 0 50%,
46
+ var(--jolly-swatch-checker) 0 75%,
47
+ transparent 0
48
+ );
49
+ background-size: auto, 6px 6px;
50
+ pointer-events: none;
51
+ }
52
+
53
+ .value .swatch {
54
+ --jolly-swatch-checker: color-mix(in oklab, var(--jolly-ink) 18%, transparent);
55
+ }
56
+
57
+ /* Preserve the swatch slot while hiding mixed values. */
58
+ :host([mixed]) .value .swatch {
59
+ background: var(--jolly-control-bg);
60
+ opacity: 0.35;
61
+ pointer-events: none;
62
+ }
63
+
64
+ .value input.hex {
65
+ flex: 1 1 auto;
66
+ min-width: 7ch;
67
+ font-variant-numeric: inherit;
68
+ }
69
+
70
+ :host([disabled]) .value .swatch {
71
+ cursor: default;
72
+ }
73
+
74
+ /* Fixed positioning overrides centered UA styles for the top-layer popup. */
75
+ .value .popover {
76
+ position: fixed;
77
+ inset: auto;
78
+ width: max-content;
79
+ margin: 0;
80
+ padding: var(--jolly-space-1, 4px);
81
+ overflow: visible;
82
+ border: none;
83
+ border-radius: var(--jolly-radius-md, 6px);
84
+ background: var(--jolly-surface-raised, Canvas);
85
+ box-shadow: var(--jolly-shadow-overlay);
86
+ color: var(--jolly-text, CanvasText);
87
+ }
88
88
  `;
89
89
  //# sourceMappingURL=Color.styles.js.map
@@ -110,101 +110,101 @@ let ColorPicker = class ColorPicker extends LitElement {
110
110
  `--jolly-picker-color:${this.#hex}`,
111
111
  `--jolly-picker-opaque:${this.#opaqueHex}`
112
112
  ].join(";");
113
- return html `
114
- <div class="panel" style=${style}>
115
- ${this.#renderArea()}
116
- ${this.#renderHue()}
117
- ${this.alpha ? this.#renderAlpha() : nothing}
118
- ${this.hexInput ? this.#renderFooter() : nothing}
119
- </div>
113
+ return html `
114
+ <div class="panel" style=${style}>
115
+ ${this.#renderArea()}
116
+ ${this.#renderHue()}
117
+ ${this.alpha ? this.#renderAlpha() : nothing}
118
+ ${this.hexInput ? this.#renderFooter() : nothing}
119
+ </div>
120
120
  `;
121
121
  }
122
122
  #renderArea() {
123
123
  const { s, v } = this.#hsva;
124
- return html `
125
- <div
126
- class="area"
127
- role="group"
128
- aria-label="Saturation and value"
129
- @pointerdown=${this.#onAreaPointerDown}
130
- >
131
- <span class="area-cursor"></span>
132
- <input
133
- class="axis axis-saturation"
134
- type="range"
135
- min="0"
136
- max=${kAxisSteps}
137
- .value=${String(Math.round(s * kAxisSteps))}
138
- ?disabled=${this.disabled}
139
- aria-label="Saturation"
140
- aria-readonly=${this.readonly ? "true" : nothing}
141
- @input=${this.#onSaturation}
142
- @change=${this.#onSaturation}
143
- >
144
- <input
145
- class="axis axis-value"
146
- type="range"
147
- min="0"
148
- max=${kAxisSteps}
149
- .value=${String(Math.round(v * kAxisSteps))}
150
- ?disabled=${this.disabled}
151
- aria-label="Value"
152
- aria-readonly=${this.readonly ? "true" : nothing}
153
- @input=${this.#onValue}
154
- @change=${this.#onValue}
155
- >
156
- </div>
124
+ return html `
125
+ <div
126
+ class="area"
127
+ role="group"
128
+ aria-label="Saturation and value"
129
+ @pointerdown=${this.#onAreaPointerDown}
130
+ >
131
+ <span class="area-cursor"></span>
132
+ <input
133
+ class="axis axis-saturation"
134
+ type="range"
135
+ min="0"
136
+ max=${kAxisSteps}
137
+ .value=${String(Math.round(s * kAxisSteps))}
138
+ ?disabled=${this.disabled}
139
+ aria-label="Saturation"
140
+ aria-readonly=${this.readonly ? "true" : nothing}
141
+ @input=${this.#onSaturation}
142
+ @change=${this.#onSaturation}
143
+ >
144
+ <input
145
+ class="axis axis-value"
146
+ type="range"
147
+ min="0"
148
+ max=${kAxisSteps}
149
+ .value=${String(Math.round(v * kAxisSteps))}
150
+ ?disabled=${this.disabled}
151
+ aria-label="Value"
152
+ aria-readonly=${this.readonly ? "true" : nothing}
153
+ @input=${this.#onValue}
154
+ @change=${this.#onValue}
155
+ >
156
+ </div>
157
157
  `;
158
158
  }
159
159
  #renderHue() {
160
- return html `
161
- <div class="track hue">
162
- <input
163
- type="range"
164
- min="0"
165
- max=${kHueSteps}
166
- step="1"
167
- .value=${String(Math.round(this.#hsva.h))}
168
- ?disabled=${this.disabled}
169
- aria-label="Hue"
170
- aria-readonly=${this.readonly ? "true" : nothing}
171
- @input=${this.#onHue}
172
- @change=${this.#onHue}
173
- >
174
- </div>
160
+ return html `
161
+ <div class="track hue">
162
+ <input
163
+ type="range"
164
+ min="0"
165
+ max=${kHueSteps}
166
+ step="1"
167
+ .value=${String(Math.round(this.#hsva.h))}
168
+ ?disabled=${this.disabled}
169
+ aria-label="Hue"
170
+ aria-readonly=${this.readonly ? "true" : nothing}
171
+ @input=${this.#onHue}
172
+ @change=${this.#onHue}
173
+ >
174
+ </div>
175
175
  `;
176
176
  }
177
177
  #renderAlpha() {
178
- return html `
179
- <div class="lane">
180
- <div class="track alpha">
181
- <input
182
- type="range"
183
- min="0"
184
- max=${kAlphaSteps}
185
- step="1"
186
- .value=${String(Math.round(this.#hsva.a * kAlphaSteps))}
187
- ?disabled=${this.disabled}
188
- aria-label="Alpha"
189
- aria-readonly=${this.readonly ? "true" : nothing}
190
- @input=${this.#onAlpha}
191
- @change=${this.#onAlpha}
192
- >
193
- </div>
194
- <input
195
- class="readout"
196
- type="text"
197
- inputmode="decimal"
198
- spellcheck="false"
199
- aria-label="Alpha value"
200
- .value=${this.#alphaDraft.draft ?? formatNumber(this.#hsva.a, kAlphaStep)}
201
- ?disabled=${this.disabled}
202
- ?readonly=${this.readonly}
203
- @input=${this.#onAlphaType}
204
- @keydown=${this.#onAlphaKeyDown}
205
- @blur=${this.#onAlphaBlur}
206
- >
207
- </div>
178
+ return html `
179
+ <div class="lane">
180
+ <div class="track alpha">
181
+ <input
182
+ type="range"
183
+ min="0"
184
+ max=${kAlphaSteps}
185
+ step="1"
186
+ .value=${String(Math.round(this.#hsva.a * kAlphaSteps))}
187
+ ?disabled=${this.disabled}
188
+ aria-label="Alpha"
189
+ aria-readonly=${this.readonly ? "true" : nothing}
190
+ @input=${this.#onAlpha}
191
+ @change=${this.#onAlpha}
192
+ >
193
+ </div>
194
+ <input
195
+ class="readout"
196
+ type="text"
197
+ inputmode="decimal"
198
+ spellcheck="false"
199
+ aria-label="Alpha value"
200
+ .value=${this.#alphaDraft.draft ?? formatNumber(this.#hsva.a, kAlphaStep)}
201
+ ?disabled=${this.disabled}
202
+ ?readonly=${this.readonly}
203
+ @input=${this.#onAlphaType}
204
+ @keydown=${this.#onAlphaKeyDown}
205
+ @blur=${this.#onAlphaBlur}
206
+ >
207
+ </div>
208
208
  `;
209
209
  }
210
210
  #onAlphaType(event) {
@@ -232,25 +232,25 @@ let ColorPicker = class ColorPicker extends LitElement {
232
232
  });
233
233
  }
234
234
  #renderFooter() {
235
- return html `
236
- <div class="footer">
237
- <span class="preview checker">
238
- <span class="preview-face"></span>
239
- </span>
240
- <input
241
- class="hex"
242
- type="text"
243
- spellcheck="false"
244
- aria-label="Hex value"
245
- aria-invalid=${this.#invalid ? "true" : nothing}
246
- .value=${this.#draft ?? this.#hex}
247
- ?disabled=${this.disabled}
248
- ?readonly=${this.readonly}
249
- @input=${this.#onHexType}
250
- @keydown=${this.#onHexKeyDown}
251
- @blur=${this.#onHexBlur}
252
- >
253
- </div>
235
+ return html `
236
+ <div class="footer">
237
+ <span class="preview checker">
238
+ <span class="preview-face"></span>
239
+ </span>
240
+ <input
241
+ class="hex"
242
+ type="text"
243
+ spellcheck="false"
244
+ aria-label="Hex value"
245
+ aria-invalid=${this.#invalid ? "true" : nothing}
246
+ .value=${this.#draft ?? this.#hex}
247
+ ?disabled=${this.disabled}
248
+ ?readonly=${this.readonly}
249
+ @input=${this.#onHexType}
250
+ @keydown=${this.#onHexKeyDown}
251
+ @blur=${this.#onHexBlur}
252
+ >
253
+ </div>
254
254
  `;
255
255
  }
256
256
  #onAreaPointerDown(event) {