@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
package/dist/icon/Icon.js CHANGED
@@ -21,22 +21,22 @@ const kWarned = new Set();
21
21
  * unlabeled icons are decorative.
22
22
  */
23
23
  let Icon = class Icon extends LitElement {
24
- static styles = css `
25
- :host {
26
- display: inline-flex;
27
- flex: 0 0 auto;
28
- align-items: center;
29
- justify-content: center;
30
- width: var(--jolly-icon-size, 16px);
31
- height: var(--jolly-icon-size, 16px);
32
- color: inherit;
33
- }
34
-
35
- svg {
36
- display: block;
37
- width: 100%;
38
- height: 100%;
39
- }
24
+ static styles = css `
25
+ :host {
26
+ display: inline-flex;
27
+ flex: 0 0 auto;
28
+ align-items: center;
29
+ justify-content: center;
30
+ width: var(--jolly-icon-size, 16px);
31
+ height: var(--jolly-icon-size, 16px);
32
+ color: inherit;
33
+ }
34
+
35
+ svg {
36
+ display: block;
37
+ width: 100%;
38
+ height: 100%;
39
+ }
40
40
  `;
41
41
  constructor() {
42
42
  super();
@@ -50,14 +50,14 @@ let Icon = class Icon extends LitElement {
50
50
  return nothing;
51
51
  }
52
52
  const decorative = this.label === "";
53
- return html `
54
- <svg
55
- viewBox="0 0 24 24"
56
- fill="none"
57
- role=${decorative ? "presentation" : "img"}
58
- aria-hidden=${decorative ? "true" : nothing}
59
- aria-label=${decorative ? nothing : this.label}
60
- >${svg `${glyph}`}</svg>
53
+ return html `
54
+ <svg
55
+ viewBox="0 0 24 24"
56
+ fill="none"
57
+ role=${decorative ? "presentation" : "img"}
58
+ aria-hidden=${decorative ? "true" : nothing}
59
+ aria-label=${decorative ? nothing : this.label}
60
+ >${svg `${glyph}`}</svg>
61
61
  `;
62
62
  }
63
63
  /**
@@ -5,145 +5,145 @@ import { registerIcon } from "./registry.js";
5
5
  /**
6
6
  * Registers built-in chrome glyphs on the shared 24px grid.
7
7
  */
8
- registerIcon("chevron", svg `
9
- <path
10
- d="M8.5 5.5 16 12l-7.5 6.5"
11
- fill="none"
12
- stroke="currentColor"
13
- stroke-width="2.25"
14
- stroke-linecap="round"
15
- stroke-linejoin="round"
16
- />
8
+ registerIcon("chevron", svg `
9
+ <path
10
+ d="M8.5 5.5 16 12l-7.5 6.5"
11
+ fill="none"
12
+ stroke="currentColor"
13
+ stroke-width="2.25"
14
+ stroke-linecap="round"
15
+ stroke-linejoin="round"
16
+ />
17
17
  `);
18
- registerIcon("close", svg `
19
- <path
20
- d="M6 6l12 12M18 6 6 18"
21
- fill="none"
22
- stroke="currentColor"
23
- stroke-width="2.25"
24
- stroke-linecap="round"
25
- />
18
+ registerIcon("close", svg `
19
+ <path
20
+ d="M6 6l12 12M18 6 6 18"
21
+ fill="none"
22
+ stroke="currentColor"
23
+ stroke-width="2.25"
24
+ stroke-linecap="round"
25
+ />
26
26
  `);
27
- registerIcon("plus", svg `
28
- <path
29
- d="M12 5v14M5 12h14"
30
- fill="none"
31
- stroke="currentColor"
32
- stroke-width="2.25"
33
- stroke-linecap="round"
34
- />
27
+ registerIcon("plus", svg `
28
+ <path
29
+ d="M12 5v14M5 12h14"
30
+ fill="none"
31
+ stroke="currentColor"
32
+ stroke-width="2.25"
33
+ stroke-linecap="round"
34
+ />
35
35
  `);
36
36
  // Circular reset arrow.
37
- registerIcon("revert", svg `
38
- <path
39
- d="M3 12a9 9 0 1 0 3-6.7L3 8"
40
- fill="none"
41
- stroke="currentColor"
42
- stroke-width="2.25"
43
- stroke-linecap="round"
44
- stroke-linejoin="round"
45
- />
46
- <path
47
- d="M3 3v5h5"
48
- fill="none"
49
- stroke="currentColor"
50
- stroke-width="2.25"
51
- stroke-linecap="round"
52
- stroke-linejoin="round"
53
- />
37
+ registerIcon("revert", svg `
38
+ <path
39
+ d="M3 12a9 9 0 1 0 3-6.7L3 8"
40
+ fill="none"
41
+ stroke="currentColor"
42
+ stroke-width="2.25"
43
+ stroke-linecap="round"
44
+ stroke-linejoin="round"
45
+ />
46
+ <path
47
+ d="M3 3v5h5"
48
+ fill="none"
49
+ stroke="currentColor"
50
+ stroke-width="2.25"
51
+ stroke-linecap="round"
52
+ stroke-linejoin="round"
53
+ />
54
54
  `);
55
55
  // Horizontal drag affordance.
56
- registerIcon("drag", svg `
57
- <path
58
- d="M3 12h18"
59
- stroke="currentColor"
60
- stroke-width="2.25"
61
- stroke-linecap="round"
62
- />
63
- <path
64
- d="M6.5 8.5 3 12l3.5 3.5M17.5 8.5 21 12l-3.5 3.5"
65
- fill="none"
66
- stroke="currentColor"
67
- stroke-width="2.25"
68
- stroke-linecap="round"
69
- stroke-linejoin="round"
70
- />
56
+ registerIcon("drag", svg `
57
+ <path
58
+ d="M3 12h18"
59
+ stroke="currentColor"
60
+ stroke-width="2.25"
61
+ stroke-linecap="round"
62
+ />
63
+ <path
64
+ d="M6.5 8.5 3 12l3.5 3.5M17.5 8.5 21 12l-3.5 3.5"
65
+ fill="none"
66
+ stroke="currentColor"
67
+ stroke-width="2.25"
68
+ stroke-linecap="round"
69
+ stroke-linejoin="round"
70
+ />
71
71
  `);
72
- registerIcon("lock", svg `
73
- <rect
74
- x="4.5"
75
- y="10.5"
76
- width="15"
77
- height="10"
78
- rx="2"
79
- fill="none"
80
- stroke="currentColor"
81
- stroke-width="2.25"
82
- stroke-linejoin="round"
83
- />
84
- <path
85
- d="M8 10.5V7.5a4 4 0 0 1 8 0v3"
86
- fill="none"
87
- stroke="currentColor"
88
- stroke-width="2.25"
89
- stroke-linecap="round"
90
- />
72
+ registerIcon("lock", svg `
73
+ <rect
74
+ x="4.5"
75
+ y="10.5"
76
+ width="15"
77
+ height="10"
78
+ rx="2"
79
+ fill="none"
80
+ stroke="currentColor"
81
+ stroke-width="2.25"
82
+ stroke-linejoin="round"
83
+ />
84
+ <path
85
+ d="M8 10.5V7.5a4 4 0 0 1 8 0v3"
86
+ fill="none"
87
+ stroke="currentColor"
88
+ stroke-width="2.25"
89
+ stroke-linecap="round"
90
+ />
91
91
  `);
92
- registerIcon("eye", svg `
93
- <path
94
- d="M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"
95
- fill="none"
96
- stroke="currentColor"
97
- stroke-width="2.25"
98
- stroke-linejoin="round"
99
- stroke-linecap="round"
100
- />
101
- <circle cx="12" cy="12" r="2.6" fill="none" stroke="currentColor" stroke-width="2.25" />
92
+ registerIcon("eye", svg `
93
+ <path
94
+ d="M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"
95
+ fill="none"
96
+ stroke="currentColor"
97
+ stroke-width="2.25"
98
+ stroke-linejoin="round"
99
+ stroke-linecap="round"
100
+ />
101
+ <circle cx="12" cy="12" r="2.6" fill="none" stroke="currentColor" stroke-width="2.25" />
102
102
  `);
103
- registerIcon("search", svg `
104
- <circle cx="10.5" cy="10.5" r="6" fill="none" stroke="currentColor" stroke-width="2.25" />
105
- <path
106
- d="m15 15 4.5 4.5"
107
- stroke="currentColor"
108
- stroke-width="2.25"
109
- stroke-linecap="round"
110
- />
103
+ registerIcon("search", svg `
104
+ <circle cx="10.5" cy="10.5" r="6" fill="none" stroke="currentColor" stroke-width="2.25" />
105
+ <path
106
+ d="m15 15 4.5 4.5"
107
+ stroke="currentColor"
108
+ stroke-width="2.25"
109
+ stroke-linecap="round"
110
+ />
111
111
  `);
112
- registerIcon("check", svg `
113
- <path
114
- d="m5 12.5 4.5 4.5L19 7"
115
- fill="none"
116
- stroke="currentColor"
117
- stroke-width="2.25"
118
- stroke-linecap="round"
119
- stroke-linejoin="round"
120
- />
112
+ registerIcon("check", svg `
113
+ <path
114
+ d="m5 12.5 4.5 4.5L19 7"
115
+ fill="none"
116
+ stroke="currentColor"
117
+ stroke-width="2.25"
118
+ stroke-linecap="round"
119
+ stroke-linejoin="round"
120
+ />
121
121
  `);
122
122
  // Description indicator.
123
- registerIcon("info", svg `
124
- <circle cx="12" cy="12" r="9" fill="currentColor" />
125
- <path
126
- d="M12 10.5v6"
127
- fill="none"
128
- stroke="var(--jolly-surface, Canvas)"
129
- stroke-width="2.5"
130
- stroke-linecap="round"
131
- />
132
- <circle cx="12" cy="7.5" r="1.35" fill="var(--jolly-surface, Canvas)" />
123
+ registerIcon("info", svg `
124
+ <circle cx="12" cy="12" r="9" fill="currentColor" />
125
+ <path
126
+ d="M12 10.5v6"
127
+ fill="none"
128
+ stroke="var(--jolly-surface, Canvas)"
129
+ stroke-width="2.5"
130
+ stroke-linecap="round"
131
+ />
132
+ <circle cx="12" cy="7.5" r="1.35" fill="var(--jolly-surface, Canvas)" />
133
133
  `);
134
134
  // Error indicator.
135
- registerIcon("warning", svg `
136
- <path
137
- d="M12 4.25 21.5 20.5h-19Z"
138
- fill="currentColor"
139
- />
140
- <path
141
- d="M12 9.75v4.75"
142
- fill="none"
143
- stroke="var(--jolly-surface, Canvas)"
144
- stroke-width="2.5"
145
- stroke-linecap="round"
146
- />
147
- <circle cx="12" cy="17.4" r="1.35" fill="var(--jolly-surface, Canvas)" />
135
+ registerIcon("warning", svg `
136
+ <path
137
+ d="M12 4.25 21.5 20.5h-19Z"
138
+ fill="currentColor"
139
+ />
140
+ <path
141
+ d="M12 9.75v4.75"
142
+ fill="none"
143
+ stroke="var(--jolly-surface, Canvas)"
144
+ stroke-width="2.5"
145
+ stroke-linecap="round"
146
+ />
147
+ <circle cx="12" cy="17.4" r="1.35" fill="var(--jolly-surface, Canvas)" />
148
148
  `);
149
149
  //# sourceMappingURL=builtins.js.map
@@ -262,12 +262,12 @@ function movesNothing(zone, index) {
262
262
  * Lazily installs the document-level cursor lock used during a drag.
263
263
  */
264
264
  function ensureSessionStyles() {
265
- ensureDocumentStyles("jolly-drag-session-styles", `
266
- html.${kDraggingClass},
267
- html.${kDraggingClass} * {
268
- cursor: grabbing !important;
269
- user-select: none !important;
270
- }
265
+ ensureDocumentStyles("jolly-drag-session-styles", `
266
+ html.${kDraggingClass},
267
+ html.${kDraggingClass} * {
268
+ cursor: grabbing !important;
269
+ user-select: none !important;
270
+ }
271
271
  `);
272
272
  }
273
273
  //# sourceMappingURL=DragSession.js.map
@@ -55,12 +55,12 @@ export class ScrubController {
55
55
  target.addEventListener("pointermove", this.#onPointerMove);
56
56
  target.addEventListener("pointerup", this.#onPointerUp);
57
57
  target.addEventListener("pointercancel", this.#onPointerUp);
58
- ensureDocumentStyles("jolly-drag-styles", `
59
- html.jolly-scrub-dragging,
60
- html.jolly-scrub-dragging * {
61
- cursor: ew-resize !important;
62
- user-select: none !important;
63
- }
58
+ ensureDocumentStyles("jolly-drag-styles", `
59
+ html.jolly-scrub-dragging,
60
+ html.jolly-scrub-dragging * {
61
+ cursor: ew-resize !important;
62
+ user-select: none !important;
63
+ }
64
64
  `);
65
65
  document.documentElement.classList.add(kDraggingClass);
66
66
  const { top, height } = target.getBoundingClientRect();
@@ -44,28 +44,28 @@ export class AxisController {
44
44
  const value = this.#options.value();
45
45
  const displayed = this.#draft ?? (value === undefined ? "" : formatNumber(value, this.#options.step()));
46
46
  const showMixed = this.#draft === null && value === undefined;
47
- return html `
48
- <span
49
- class="axis-box"
50
- data-axis=${key}
51
- style=${colorVar ? `--jolly-axis-color: var(${colorVar})` : nothing}
52
- >
53
- <span class="axis-tag" aria-hidden="true">${label}</span>
54
- <span class="scrub-handle" aria-hidden="true"></span>
55
- <input
56
- type="text"
57
- inputmode="decimal"
58
- aria-label=${this.#options.ariaLabel()}
59
- .value=${displayed}
60
- placeholder=${showMixed ? MIXED_PLACEHOLDER : ""}
61
- ?disabled=${this.#options.disabled()}
62
- ?readonly=${!this.#options.editable()}
63
- aria-invalid=${this.#error === null ? nothing : "true"}
64
- @input=${this.#onInput}
65
- @keydown=${this.#onKeyDown}
66
- @blur=${this.#onBlur}
67
- >
68
- </span>
47
+ return html `
48
+ <span
49
+ class="axis-box"
50
+ data-axis=${key}
51
+ style=${colorVar ? `--jolly-axis-color: var(${colorVar})` : nothing}
52
+ >
53
+ <span class="axis-tag" aria-hidden="true">${label}</span>
54
+ <span class="scrub-handle" aria-hidden="true"></span>
55
+ <input
56
+ type="text"
57
+ inputmode="decimal"
58
+ aria-label=${this.#options.ariaLabel()}
59
+ .value=${displayed}
60
+ placeholder=${showMixed ? MIXED_PLACEHOLDER : ""}
61
+ ?disabled=${this.#options.disabled()}
62
+ ?readonly=${!this.#options.editable()}
63
+ aria-invalid=${this.#error === null ? nothing : "true"}
64
+ @input=${this.#onInput}
65
+ @keydown=${this.#onKeyDown}
66
+ @blur=${this.#onBlur}
67
+ >
68
+ </span>
69
69
  `;
70
70
  }
71
71
  #onInput = (event) => {
@@ -50,20 +50,20 @@ let Point2d = class Point2d extends JollyField {
50
50
  renderValue() {
51
51
  const point = this.#point;
52
52
  const label = this.label === "" ? "Point" : this.label;
53
- return html `
54
- <div
55
- class="pad"
56
- role="slider"
57
- aria-label=${label}
53
+ return html `
54
+ <div
55
+ class="pad"
56
+ role="slider"
57
+ aria-label=${label}
58
58
  aria-valuetext=${point === undefined
59
59
  ? "Mixed"
60
- : `${formatNumber(point.x, this.step)}, ${formatNumber(point.y, this.step)}`}
61
- tabindex=${this.editable ? "0" : "-1"}
62
- style="--jolly-pad-x:${point ? this.#ratio(point.x) : 0.5}; --jolly-pad-y:${point ? this.#ratio(point.y) : 0.5}"
63
- ?data-mixed=${point === undefined}
64
- @pointerdown=${this.#onPointerDown}
65
- @keydown=${this.#onKeyDown}
66
- ><span class="handle" ?hidden=${point === undefined}></span></div>
60
+ : `${formatNumber(point.x, this.step)}, ${formatNumber(point.y, this.step)}`}
61
+ tabindex=${this.editable ? "0" : "-1"}
62
+ style="--jolly-pad-x:${point ? this.#ratio(point.x) : 0.5}; --jolly-pad-y:${point ? this.#ratio(point.y) : 0.5}"
63
+ ?data-mixed=${point === undefined}
64
+ @pointerdown=${this.#onPointerDown}
65
+ @keydown=${this.#onKeyDown}
66
+ ><span class="handle" ?hidden=${point === undefined}></span></div>
67
67
  `;
68
68
  }
69
69
  get #point() {
@@ -2,54 +2,54 @@
2
2
  import { css } from "lit";
3
3
  // Import Internal Dependencies
4
4
  import { fillTransition } from "../theme/styles/mixins.js";
5
- export const point2dStyles = css `
6
- .pad {
7
- position: relative;
8
- width: 64px;
9
- height: 64px;
10
- border-radius: var(--jolly-radius-sm, 2px);
11
- background: var(--jolly-control-bg, transparent);
12
- cursor: crosshair;
13
- touch-action: none;
14
- ${fillTransition}
15
- }
16
-
17
- .pad:hover {
18
- background: var(--jolly-control-bg-hover);
19
- }
20
-
21
- .pad:focus-visible {
22
- background: var(--jolly-control-bg-focus);
23
- outline: none;
24
- }
25
-
26
- :host([invalid]) .pad {
27
- background: var(--jolly-invalid-bg);
28
- }
29
-
30
- :host([readonly]) .pad {
31
- background: var(--jolly-control-bg-muted);
32
- }
33
-
34
- .pad[data-mixed] {
35
- opacity: 0.35;
36
- }
37
-
38
- .handle {
39
- position: absolute;
40
- top: calc(var(--jolly-pad-y, 0.5) * 100%);
41
- left: calc(var(--jolly-pad-x, 0.5) * 100%);
42
- width: 8px;
43
- height: 8px;
44
- border-radius: 50%;
45
- background: var(--jolly-field-active-color);
46
- box-shadow: 0 0 0 1px var(--jolly-surface);
47
- pointer-events: none;
48
- transform: translate(-50%, -50%);
49
- }
50
-
51
- .handle[hidden] {
52
- display: none;
53
- }
5
+ export const point2dStyles = css `
6
+ .pad {
7
+ position: relative;
8
+ width: 64px;
9
+ height: 64px;
10
+ border-radius: var(--jolly-radius-sm, 2px);
11
+ background: var(--jolly-control-bg, transparent);
12
+ cursor: crosshair;
13
+ touch-action: none;
14
+ ${fillTransition}
15
+ }
16
+
17
+ .pad:hover {
18
+ background: var(--jolly-control-bg-hover);
19
+ }
20
+
21
+ .pad:focus-visible {
22
+ background: var(--jolly-control-bg-focus);
23
+ outline: none;
24
+ }
25
+
26
+ :host([invalid]) .pad {
27
+ background: var(--jolly-invalid-bg);
28
+ }
29
+
30
+ :host([readonly]) .pad {
31
+ background: var(--jolly-control-bg-muted);
32
+ }
33
+
34
+ .pad[data-mixed] {
35
+ opacity: 0.35;
36
+ }
37
+
38
+ .handle {
39
+ position: absolute;
40
+ top: calc(var(--jolly-pad-y, 0.5) * 100%);
41
+ left: calc(var(--jolly-pad-x, 0.5) * 100%);
42
+ width: 8px;
43
+ height: 8px;
44
+ border-radius: 50%;
45
+ background: var(--jolly-field-active-color);
46
+ box-shadow: 0 0 0 1px var(--jolly-surface);
47
+ pointer-events: none;
48
+ transform: translate(-50%, -50%);
49
+ }
50
+
51
+ .handle[hidden] {
52
+ display: none;
53
+ }
54
54
  `;
55
55
  //# sourceMappingURL=Point2d.styles.js.map
@@ -58,10 +58,10 @@ let Quaternion = class Quaternion extends JollyField {
58
58
  return quatEquals(a, b);
59
59
  }
60
60
  renderValue() {
61
- return html `
62
- <div class="axes">
63
- ${kAxisKeys.map((axis) => this.#controllerFor(axis).render())}
64
- </div>
61
+ return html `
62
+ <div class="axes">
63
+ ${kAxisKeys.map((axis) => this.#controllerFor(axis).render())}
64
+ </div>
65
65
  `;
66
66
  }
67
67
  #controllerFor(axis) {
@@ -75,46 +75,46 @@ let Transform = class Transform extends LitElement {
75
75
  const position = this.state.position ?? kEmptySubState;
76
76
  const rotation = this.state.rotation ?? kEmptySubState;
77
77
  const scale = this.state.scale ?? kEmptySubState;
78
- return html `
79
- <jolly-vector3
80
- label=${this.positionLabel}
81
- label-position=${this.labelPosition}
82
- .value=${this.value.position}
83
- .default=${this.default?.position}
84
- .lockedBy=${position.lockedBy ?? null}
85
- .peers=${position.peers ?? []}
86
- .error=${position.error ?? null}
87
- ?disabled=${position.disabled ?? false}
88
- ?readonly=${position.readonly ?? false}
89
- @jolly-input=${(event) => this.#relay("position", event, true)}
90
- @jolly-change=${(event) => this.#relay("position", event, false)}
91
- ></jolly-vector3>
92
- <jolly-quaternion
93
- label=${this.rotationLabel}
94
- label-position=${this.labelPosition}
95
- .value=${this.value.rotation}
96
- .default=${this.default?.rotation}
97
- .lockedBy=${rotation.lockedBy ?? null}
98
- .peers=${rotation.peers ?? []}
99
- .error=${rotation.error ?? null}
100
- ?disabled=${rotation.disabled ?? false}
101
- ?readonly=${rotation.readonly ?? false}
102
- @jolly-input=${(event) => this.#relay("rotation", event, true)}
103
- @jolly-change=${(event) => this.#relay("rotation", event, false)}
104
- ></jolly-quaternion>
105
- <jolly-vector3
106
- label=${this.scaleLabel}
107
- label-position=${this.labelPosition}
108
- .value=${this.value.scale}
109
- .default=${this.default?.scale}
110
- .lockedBy=${scale.lockedBy ?? null}
111
- .peers=${scale.peers ?? []}
112
- .error=${scale.error ?? null}
113
- ?disabled=${scale.disabled ?? false}
114
- ?readonly=${scale.readonly ?? false}
115
- @jolly-input=${(event) => this.#relay("scale", event, true)}
116
- @jolly-change=${(event) => this.#relay("scale", event, false)}
117
- ></jolly-vector3>
78
+ return html `
79
+ <jolly-vector3
80
+ label=${this.positionLabel}
81
+ label-position=${this.labelPosition}
82
+ .value=${this.value.position}
83
+ .default=${this.default?.position}
84
+ .lockedBy=${position.lockedBy ?? null}
85
+ .peers=${position.peers ?? []}
86
+ .error=${position.error ?? null}
87
+ ?disabled=${position.disabled ?? false}
88
+ ?readonly=${position.readonly ?? false}
89
+ @jolly-input=${(event) => this.#relay("position", event, true)}
90
+ @jolly-change=${(event) => this.#relay("position", event, false)}
91
+ ></jolly-vector3>
92
+ <jolly-quaternion
93
+ label=${this.rotationLabel}
94
+ label-position=${this.labelPosition}
95
+ .value=${this.value.rotation}
96
+ .default=${this.default?.rotation}
97
+ .lockedBy=${rotation.lockedBy ?? null}
98
+ .peers=${rotation.peers ?? []}
99
+ .error=${rotation.error ?? null}
100
+ ?disabled=${rotation.disabled ?? false}
101
+ ?readonly=${rotation.readonly ?? false}
102
+ @jolly-input=${(event) => this.#relay("rotation", event, true)}
103
+ @jolly-change=${(event) => this.#relay("rotation", event, false)}
104
+ ></jolly-quaternion>
105
+ <jolly-vector3
106
+ label=${this.scaleLabel}
107
+ label-position=${this.labelPosition}
108
+ .value=${this.value.scale}
109
+ .default=${this.default?.scale}
110
+ .lockedBy=${scale.lockedBy ?? null}
111
+ .peers=${scale.peers ?? []}
112
+ .error=${scale.error ?? null}
113
+ ?disabled=${scale.disabled ?? false}
114
+ ?readonly=${scale.readonly ?? false}
115
+ @jolly-input=${(event) => this.#relay("scale", event, true)}
116
+ @jolly-change=${(event) => this.#relay("scale", event, false)}
117
+ ></jolly-vector3>
118
118
  `;
119
119
  }
120
120
  /** Merges a sub-field commit into the complete TransformValue. */