@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.
- package/LICENSE +44 -44
- package/NOTICE +9 -0
- package/README.md +194 -194
- package/dist/containers/Dialog.js +11 -11
- package/dist/containers/Dialog.styles.js +48 -48
- package/dist/containers/Dock.js +11 -11
- package/dist/containers/Dock.styles.js +351 -351
- package/dist/containers/DockLayout.js +4 -4
- package/dist/containers/Floating.js +23 -23
- package/dist/containers/Floating.styles.js +116 -116
- package/dist/containers/Folder.js +28 -28
- package/dist/containers/Folder.styles.js +221 -221
- package/dist/containers/Pane.js +50 -50
- package/dist/containers/Pane.styles.js +186 -186
- package/dist/containers/Rail.js +18 -18
- package/dist/containers/Tab.js +10 -10
- package/dist/containers/Tabs.js +26 -26
- package/dist/containers/Tabs.styles.js +93 -93
- package/dist/containers/Toolbar.js +25 -25
- package/dist/containers/resize.js +5 -5
- package/dist/controls/Button.js +9 -9
- package/dist/controls/Button.styles.js +79 -79
- package/dist/controls/ButtonGroup.js +28 -28
- package/dist/controls/ButtonGroup.styles.js +98 -98
- package/dist/controls/Checkbox.js +14 -14
- package/dist/controls/Checkbox.styles.js +111 -111
- package/dist/controls/Color.js +51 -51
- package/dist/controls/Color.styles.js +83 -83
- package/dist/controls/ColorPicker.js +104 -104
- package/dist/controls/ColorPicker.styles.js +296 -296
- package/dist/controls/Control.js +33 -33
- package/dist/controls/Control.styles.js +102 -102
- package/dist/controls/Controls.js +11 -11
- package/dist/controls/Controls.styles.js +98 -98
- package/dist/controls/Flags.js +18 -18
- package/dist/controls/Flags.styles.js +59 -59
- package/dist/controls/Number.js +21 -21
- package/dist/controls/Number.styles.js +44 -44
- package/dist/controls/PropertyRow.js +13 -13
- package/dist/controls/PropertyRow.styles.js +105 -105
- package/dist/controls/Range.js +24 -24
- package/dist/controls/Range.styles.js +25 -25
- package/dist/controls/Select.js +23 -23
- package/dist/controls/Select.styles.js +47 -47
- package/dist/controls/Separator.js +11 -11
- package/dist/controls/Separator.styles.js +45 -45
- package/dist/controls/Slider.js +36 -36
- package/dist/controls/Slider.styles.js +161 -161
- package/dist/controls/Text.js +17 -17
- package/dist/data/Tree.d.ts +0 -14
- package/dist/data/Tree.d.ts.map +1 -1
- package/dist/data/Tree.js +90 -120
- package/dist/data/Tree.js.map +1 -1
- package/dist/data/Tree.styles.d.ts.map +1 -1
- package/dist/data/Tree.styles.js +220 -237
- package/dist/data/Tree.styles.js.map +1 -1
- package/dist/data/dropZone.d.ts +0 -10
- package/dist/data/dropZone.d.ts.map +1 -1
- package/dist/data/dropZone.js +0 -10
- package/dist/data/dropZone.js.map +1 -1
- package/dist/data/resolveRename.d.ts +0 -3
- package/dist/data/resolveRename.d.ts.map +1 -1
- package/dist/data/resolveRename.js +0 -3
- package/dist/data/resolveRename.js.map +1 -1
- package/dist/data/resolveReparent.d.ts +0 -7
- package/dist/data/resolveReparent.d.ts.map +1 -1
- package/dist/data/resolveReparent.js +0 -6
- package/dist/data/resolveReparent.js.map +1 -1
- package/dist/data/rowDragSession.d.ts +0 -8
- package/dist/data/rowDragSession.d.ts.map +1 -1
- package/dist/data/rowDragSession.js +0 -6
- package/dist/data/rowDragSession.js.map +1 -1
- package/dist/data/treeNodes.d.ts +0 -6
- package/dist/data/treeNodes.d.ts.map +1 -1
- package/dist/data/treeNodes.js +2 -7
- package/dist/data/treeNodes.js.map +1 -1
- package/dist/feedback/JollyPixelLogo.js +84 -84
- package/dist/feedback/Loading.js +29 -29
- package/dist/feedback/Loading.styles.js +230 -230
- package/dist/feedback/Log.js +8 -8
- package/dist/feedback/Log.styles.js +61 -61
- package/dist/feedback/Progress.js +17 -17
- package/dist/feedback/Progress.styles.js +146 -146
- package/dist/field/JollyField.js +51 -51
- package/dist/field/JollyField.styles.js +429 -429
- package/dist/icon/Icon.js +24 -24
- package/dist/icon/builtins.js +126 -126
- package/dist/interaction/drag/DragSession.js +6 -6
- package/dist/interaction/scrub/ScrubController.js +6 -6
- package/dist/math/AxisController.js +22 -22
- package/dist/math/Point2d.js +12 -12
- package/dist/math/Point2d.styles.js +49 -49
- package/dist/math/Quaternion.js +4 -4
- package/dist/math/Transform.js +40 -40
- package/dist/math/Transform.styles.js +17 -17
- package/dist/math/VectorField.js +4 -4
- package/dist/math/VectorField.styles.js +102 -102
- package/dist/monitors/Graph.js +8 -8
- package/dist/monitors/Graph.styles.js +42 -42
- package/dist/monitors/Monitor.js +5 -5
- package/dist/monitors/Monitor.styles.js +31 -31
- package/dist/peer/Presence.js +33 -33
- package/dist/peer/Presence.styles.js +82 -82
- package/dist/stats/Stats.js +6 -6
- package/dist/stats/Stats.styles.js +54 -54
- package/dist/theme/components/DensityControl.js +16 -16
- package/dist/theme/components/ThemeControl.js +16 -16
- package/dist/theme/components/ThemePreferences.js +18 -18
- package/dist/theme/font.js +9 -9
- package/dist/theme/styles/hiddenStyles.js +4 -4
- package/dist/theme/styles/mixins.js +16 -16
- package/dist/theme/styles/themeStyles.js +4 -4
- package/dist/theme/tokens/density.js +19 -19
- package/dist/theme/tokens/ramps.js +40 -40
- package/dist/theme/tokens/scales.js +56 -56
- package/dist/theme/tokens/semantic.js +184 -184
- package/package.json +6 -5
|
@@ -2,103 +2,103 @@
|
|
|
2
2
|
import { css } from "lit";
|
|
3
3
|
// Import Internal Dependencies
|
|
4
4
|
import { fillTransition, truncate, visuallyHidden } from "../theme/styles/mixins.js";
|
|
5
|
-
export const buttonGroupStyles = css `
|
|
6
|
-
/*
|
|
7
|
-
* Segments used to be joined by shared borders. Without them a hairline gap
|
|
8
|
-
* does the same job: the fills read as one strip, still visibly divided.
|
|
9
|
-
*/
|
|
10
|
-
.group {
|
|
11
|
-
display: flex;
|
|
12
|
-
flex: 1 1 auto;
|
|
13
|
-
gap: 1px;
|
|
14
|
-
min-width: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host([layout="grid"]) .group {
|
|
18
|
-
display: grid;
|
|
19
|
-
gap: var(--jolly-space-1, 4px);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.segment {
|
|
23
|
-
display: inline-flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
justify-content: center;
|
|
26
|
-
flex: 1 1 0;
|
|
27
|
-
gap: 4px;
|
|
28
|
-
min-width: 0;
|
|
29
|
-
height: var(--jolly-control-height, 20px);
|
|
30
|
-
padding: 0 var(--jolly-space-1, 4px);
|
|
31
|
-
border: 0;
|
|
32
|
-
background: var(--jolly-control-bg);
|
|
33
|
-
color: inherit;
|
|
34
|
-
font: inherit;
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
${fillTransition}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/*
|
|
40
|
-
* Round only the outer edges of joined segments.
|
|
41
|
-
*/
|
|
42
|
-
:host(:not([layout="grid"])) .segment:first-child {
|
|
43
|
-
border-radius: var(--jolly-radius-sm, 2px) 0 0 var(--jolly-radius-sm, 2px);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
:host(:not([layout="grid"])) .segment:last-child {
|
|
47
|
-
border-radius: 0 var(--jolly-radius-sm, 2px) var(--jolly-radius-sm, 2px) 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
:host(:not([layout="grid"])) .segment:only-child {
|
|
51
|
-
border-radius: var(--jolly-radius-sm, 2px);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
:host([layout="grid"]) .segment {
|
|
55
|
-
border-radius: var(--jolly-radius-sm, 2px);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.segment:hover:not(:disabled) {
|
|
59
|
-
background: var(--jolly-control-bg-hover);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.segment:active:not(:disabled) {
|
|
63
|
-
background: var(--jolly-control-bg-active);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.segment:focus-visible {
|
|
67
|
-
background: var(--jolly-control-bg-focus);
|
|
68
|
-
outline: none;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.segment[aria-checked="true"] {
|
|
72
|
-
background: var(--jolly-accent-fill);
|
|
73
|
-
color: var(--jolly-text-on-fill);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.segment[aria-checked="true"]:hover:not(:disabled) {
|
|
77
|
-
background: var(--jolly-accent-fill-hover);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/*
|
|
81
|
-
* A checked segment is already filled, so its focus step lightens the accent
|
|
82
|
-
* rather than tinting over it.
|
|
83
|
-
*/
|
|
84
|
-
.segment[aria-checked="true"]:focus-visible {
|
|
85
|
-
background: var(--jolly-accent-fill-focus);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.segment:disabled {
|
|
89
|
-
cursor: default;
|
|
90
|
-
opacity: 0.5;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.segment-label {
|
|
94
|
-
${truncate}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/*
|
|
98
|
-
* Hide visible labels while keeping their accessible names.
|
|
99
|
-
*/
|
|
100
|
-
:host([icons-only]) .segment-label {
|
|
101
|
-
${visuallyHidden}
|
|
102
|
-
}
|
|
5
|
+
export const buttonGroupStyles = css `
|
|
6
|
+
/*
|
|
7
|
+
* Segments used to be joined by shared borders. Without them a hairline gap
|
|
8
|
+
* does the same job: the fills read as one strip, still visibly divided.
|
|
9
|
+
*/
|
|
10
|
+
.group {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex: 1 1 auto;
|
|
13
|
+
gap: 1px;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host([layout="grid"]) .group {
|
|
18
|
+
display: grid;
|
|
19
|
+
gap: var(--jolly-space-1, 4px);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.segment {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
flex: 1 1 0;
|
|
27
|
+
gap: 4px;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
height: var(--jolly-control-height, 20px);
|
|
30
|
+
padding: 0 var(--jolly-space-1, 4px);
|
|
31
|
+
border: 0;
|
|
32
|
+
background: var(--jolly-control-bg);
|
|
33
|
+
color: inherit;
|
|
34
|
+
font: inherit;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
${fillTransition}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/*
|
|
40
|
+
* Round only the outer edges of joined segments.
|
|
41
|
+
*/
|
|
42
|
+
:host(:not([layout="grid"])) .segment:first-child {
|
|
43
|
+
border-radius: var(--jolly-radius-sm, 2px) 0 0 var(--jolly-radius-sm, 2px);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host(:not([layout="grid"])) .segment:last-child {
|
|
47
|
+
border-radius: 0 var(--jolly-radius-sm, 2px) var(--jolly-radius-sm, 2px) 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host(:not([layout="grid"])) .segment:only-child {
|
|
51
|
+
border-radius: var(--jolly-radius-sm, 2px);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([layout="grid"]) .segment {
|
|
55
|
+
border-radius: var(--jolly-radius-sm, 2px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.segment:hover:not(:disabled) {
|
|
59
|
+
background: var(--jolly-control-bg-hover);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.segment:active:not(:disabled) {
|
|
63
|
+
background: var(--jolly-control-bg-active);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.segment:focus-visible {
|
|
67
|
+
background: var(--jolly-control-bg-focus);
|
|
68
|
+
outline: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.segment[aria-checked="true"] {
|
|
72
|
+
background: var(--jolly-accent-fill);
|
|
73
|
+
color: var(--jolly-text-on-fill);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.segment[aria-checked="true"]:hover:not(:disabled) {
|
|
77
|
+
background: var(--jolly-accent-fill-hover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
* A checked segment is already filled, so its focus step lightens the accent
|
|
82
|
+
* rather than tinting over it.
|
|
83
|
+
*/
|
|
84
|
+
.segment[aria-checked="true"]:focus-visible {
|
|
85
|
+
background: var(--jolly-accent-fill-focus);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.segment:disabled {
|
|
89
|
+
cursor: default;
|
|
90
|
+
opacity: 0.5;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.segment-label {
|
|
94
|
+
${truncate}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
* Hide visible labels while keeping their accessible names.
|
|
99
|
+
*/
|
|
100
|
+
:host([icons-only]) .segment-label {
|
|
101
|
+
${visuallyHidden}
|
|
102
|
+
}
|
|
103
103
|
`;
|
|
104
104
|
//# sourceMappingURL=ButtonGroup.styles.js.map
|
|
@@ -29,20 +29,20 @@ let Checkbox = class Checkbox extends JollyField {
|
|
|
29
29
|
}
|
|
30
30
|
/** Keeps the native checkbox on the standard control-sized hit target. */
|
|
31
31
|
renderValue() {
|
|
32
|
-
return html `
|
|
33
|
-
<label class="checkbox">
|
|
34
|
-
<input
|
|
35
|
-
type="checkbox"
|
|
36
|
-
.checked=${this.concreteValue ?? false}
|
|
37
|
-
.indeterminate=${this.mixed}
|
|
38
|
-
?disabled=${this.disabled}
|
|
39
|
-
aria-readonly=${this.readonlyAria}
|
|
40
|
-
aria-disabled=${this.lockedAria}
|
|
41
|
-
aria-description=${this.lockDescription}
|
|
42
|
-
aria-invalid=${this.displayError === null ? nothing : "true"}
|
|
43
|
-
@click=${this.#onClick}
|
|
44
|
-
>
|
|
45
|
-
</label>
|
|
32
|
+
return html `
|
|
33
|
+
<label class="checkbox">
|
|
34
|
+
<input
|
|
35
|
+
type="checkbox"
|
|
36
|
+
.checked=${this.concreteValue ?? false}
|
|
37
|
+
.indeterminate=${this.mixed}
|
|
38
|
+
?disabled=${this.disabled}
|
|
39
|
+
aria-readonly=${this.readonlyAria}
|
|
40
|
+
aria-disabled=${this.lockedAria}
|
|
41
|
+
aria-description=${this.lockDescription}
|
|
42
|
+
aria-invalid=${this.displayError === null ? nothing : "true"}
|
|
43
|
+
@click=${this.#onClick}
|
|
44
|
+
>
|
|
45
|
+
</label>
|
|
46
46
|
`;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
@@ -1,116 +1,116 @@
|
|
|
1
1
|
// Import Third-party Dependencies
|
|
2
2
|
import { css } from "lit";
|
|
3
3
|
/** Keeps checkboxes fixed-size and aligned to the requested logical edge. */
|
|
4
|
-
export const checkboxStyles = css `
|
|
5
|
-
.value {
|
|
6
|
-
justify-content: flex-start;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
:host([align="end"]) .value,
|
|
10
|
-
:host([align="end"]) .checkbox {
|
|
11
|
-
justify-content: flex-end;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/* Keep the native control on the same hit target as the other fields. */
|
|
15
|
-
.checkbox {
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: flex-start;
|
|
19
|
-
flex: 0 0 auto;
|
|
20
|
-
width: var(--jolly-control-height, 20px);
|
|
21
|
-
height: var(--jolly-control-height, 20px);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:host([clickable-background]) .checkbox {
|
|
25
|
-
position: relative;
|
|
26
|
-
isolation: isolate;
|
|
27
|
-
flex: 1 1 auto;
|
|
28
|
-
width: auto;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
:host([clickable-background]) .checkbox::before {
|
|
33
|
-
--jolly-checkbox-gradient-direction: to right;
|
|
34
|
-
|
|
35
|
-
content: "";
|
|
36
|
-
position: absolute;
|
|
37
|
-
inset-block: calc(var(--jolly-space-1, 4px) / 2);
|
|
38
|
-
inset-inline: 0;
|
|
39
|
-
z-index: -1;
|
|
40
|
-
border-start-start-radius: var(--jolly-radius-sm, 2px);
|
|
41
|
-
border-end-start-radius: var(--jolly-radius-sm, 2px);
|
|
42
|
-
background-image: linear-gradient(
|
|
43
|
-
var(--jolly-checkbox-gradient-direction),
|
|
44
|
-
var(--jolly-control-bg),
|
|
45
|
-
transparent 72%
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:host([clickable-background][align="end"]) .checkbox::before,
|
|
50
|
-
:host([clickable-background]:dir(rtl)) .checkbox::before {
|
|
51
|
-
--jolly-checkbox-gradient-direction: to left;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
:host([clickable-background][align="end"]:dir(rtl)) .checkbox::before {
|
|
55
|
-
--jolly-checkbox-gradient-direction: to right;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
:host([clickable-background][align="end"]) .checkbox::before {
|
|
59
|
-
border-start-start-radius: 0;
|
|
60
|
-
border-start-end-radius: var(--jolly-radius-sm, 2px);
|
|
61
|
-
border-end-start-radius: 0;
|
|
62
|
-
border-end-end-radius: var(--jolly-radius-sm, 2px);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:host(
|
|
66
|
-
[clickable-background]:not([disabled]):not([readonly]):not([locked])
|
|
67
|
-
) .checkbox:hover::before {
|
|
68
|
-
background-image: linear-gradient(
|
|
69
|
-
var(--jolly-checkbox-gradient-direction),
|
|
70
|
-
var(--jolly-control-bg-hover),
|
|
71
|
-
transparent 72%
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
:host(
|
|
76
|
-
[clickable-background]:not([disabled]):not([readonly]):not([locked])
|
|
77
|
-
) .checkbox:has(input:focus-visible)::before {
|
|
78
|
-
background-image: linear-gradient(
|
|
79
|
-
var(--jolly-checkbox-gradient-direction),
|
|
80
|
-
var(--jolly-control-bg-focus),
|
|
81
|
-
transparent 72%
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.value input[type="checkbox"] {
|
|
86
|
-
flex: 0 0 auto;
|
|
87
|
-
width: 14px;
|
|
88
|
-
height: 14px;
|
|
89
|
-
margin: 0;
|
|
90
|
-
accent-color: var(--jolly-field-active-color);
|
|
91
|
-
cursor: pointer;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
:host([clickable-background]) .value input[type="checkbox"] {
|
|
95
|
-
margin-inline: var(--jolly-space-1, 4px) 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
:host([clickable-background][align="end"]) .value input[type="checkbox"] {
|
|
99
|
-
margin-inline: 0 var(--jolly-space-1, 4px);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.value input[type="checkbox"]:focus-visible {
|
|
103
|
-
outline: none;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
:host([disabled]) .value input[type="checkbox"] {
|
|
107
|
-
cursor: default;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
:host([clickable-background][disabled]) .checkbox,
|
|
111
|
-
:host([clickable-background][readonly]) .checkbox,
|
|
112
|
-
:host([clickable-background][locked]) .checkbox {
|
|
113
|
-
cursor: default;
|
|
114
|
-
}
|
|
4
|
+
export const checkboxStyles = css `
|
|
5
|
+
.value {
|
|
6
|
+
justify-content: flex-start;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([align="end"]) .value,
|
|
10
|
+
:host([align="end"]) .checkbox {
|
|
11
|
+
justify-content: flex-end;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Keep the native control on the same hit target as the other fields. */
|
|
15
|
+
.checkbox {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: flex-start;
|
|
19
|
+
flex: 0 0 auto;
|
|
20
|
+
width: var(--jolly-control-height, 20px);
|
|
21
|
+
height: var(--jolly-control-height, 20px);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([clickable-background]) .checkbox {
|
|
25
|
+
position: relative;
|
|
26
|
+
isolation: isolate;
|
|
27
|
+
flex: 1 1 auto;
|
|
28
|
+
width: auto;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([clickable-background]) .checkbox::before {
|
|
33
|
+
--jolly-checkbox-gradient-direction: to right;
|
|
34
|
+
|
|
35
|
+
content: "";
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset-block: calc(var(--jolly-space-1, 4px) / 2);
|
|
38
|
+
inset-inline: 0;
|
|
39
|
+
z-index: -1;
|
|
40
|
+
border-start-start-radius: var(--jolly-radius-sm, 2px);
|
|
41
|
+
border-end-start-radius: var(--jolly-radius-sm, 2px);
|
|
42
|
+
background-image: linear-gradient(
|
|
43
|
+
var(--jolly-checkbox-gradient-direction),
|
|
44
|
+
var(--jolly-control-bg),
|
|
45
|
+
transparent 72%
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host([clickable-background][align="end"]) .checkbox::before,
|
|
50
|
+
:host([clickable-background]:dir(rtl)) .checkbox::before {
|
|
51
|
+
--jolly-checkbox-gradient-direction: to left;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([clickable-background][align="end"]:dir(rtl)) .checkbox::before {
|
|
55
|
+
--jolly-checkbox-gradient-direction: to right;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([clickable-background][align="end"]) .checkbox::before {
|
|
59
|
+
border-start-start-radius: 0;
|
|
60
|
+
border-start-end-radius: var(--jolly-radius-sm, 2px);
|
|
61
|
+
border-end-start-radius: 0;
|
|
62
|
+
border-end-end-radius: var(--jolly-radius-sm, 2px);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host(
|
|
66
|
+
[clickable-background]:not([disabled]):not([readonly]):not([locked])
|
|
67
|
+
) .checkbox:hover::before {
|
|
68
|
+
background-image: linear-gradient(
|
|
69
|
+
var(--jolly-checkbox-gradient-direction),
|
|
70
|
+
var(--jolly-control-bg-hover),
|
|
71
|
+
transparent 72%
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host(
|
|
76
|
+
[clickable-background]:not([disabled]):not([readonly]):not([locked])
|
|
77
|
+
) .checkbox:has(input:focus-visible)::before {
|
|
78
|
+
background-image: linear-gradient(
|
|
79
|
+
var(--jolly-checkbox-gradient-direction),
|
|
80
|
+
var(--jolly-control-bg-focus),
|
|
81
|
+
transparent 72%
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.value input[type="checkbox"] {
|
|
86
|
+
flex: 0 0 auto;
|
|
87
|
+
width: 14px;
|
|
88
|
+
height: 14px;
|
|
89
|
+
margin: 0;
|
|
90
|
+
accent-color: var(--jolly-field-active-color);
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([clickable-background]) .value input[type="checkbox"] {
|
|
95
|
+
margin-inline: var(--jolly-space-1, 4px) 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([clickable-background][align="end"]) .value input[type="checkbox"] {
|
|
99
|
+
margin-inline: 0 var(--jolly-space-1, 4px);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.value input[type="checkbox"]:focus-visible {
|
|
103
|
+
outline: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host([disabled]) .value input[type="checkbox"] {
|
|
107
|
+
cursor: default;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host([clickable-background][disabled]) .checkbox,
|
|
111
|
+
:host([clickable-background][readonly]) .checkbox,
|
|
112
|
+
:host([clickable-background][locked]) .checkbox {
|
|
113
|
+
cursor: default;
|
|
114
|
+
}
|
|
115
115
|
`;
|
|
116
116
|
//# sourceMappingURL=Checkbox.styles.js.map
|
package/dist/controls/Color.js
CHANGED
|
@@ -73,41 +73,41 @@ let Color = class Color extends JollyField {
|
|
|
73
73
|
}
|
|
74
74
|
renderValue() {
|
|
75
75
|
const swatch = this.concreteValue;
|
|
76
|
-
return html `
|
|
77
|
-
<button
|
|
78
|
-
class="swatch"
|
|
79
|
-
type="button"
|
|
80
|
-
popovertarget="picker"
|
|
81
|
-
title="Pick a colour"
|
|
82
|
-
aria-label="Pick a colour"
|
|
83
|
-
aria-haspopup="dialog"
|
|
84
|
-
aria-expanded=${this.#popup.open}
|
|
85
|
-
?disabled=${this.disabled}
|
|
86
|
-
>
|
|
76
|
+
return html `
|
|
77
|
+
<button
|
|
78
|
+
class="swatch"
|
|
79
|
+
type="button"
|
|
80
|
+
popovertarget="picker"
|
|
81
|
+
title="Pick a colour"
|
|
82
|
+
aria-label="Pick a colour"
|
|
83
|
+
aria-haspopup="dialog"
|
|
84
|
+
aria-expanded=${this.#popup.open}
|
|
85
|
+
?disabled=${this.disabled}
|
|
86
|
+
>
|
|
87
87
|
${swatch === undefined
|
|
88
88
|
? nothing
|
|
89
|
-
: html `<span class="swatch-face" style="--jolly-swatch-color:${swatch}"></span>`}
|
|
90
|
-
</button>
|
|
91
|
-
<input
|
|
92
|
-
type="text"
|
|
93
|
-
class="hex"
|
|
94
|
-
spellcheck="false"
|
|
95
|
-
aria-label="Hex value"
|
|
96
|
-
.value=${this.draft ?? swatch ?? ""}
|
|
97
|
-
placeholder=${this.mixed ? MIXED_PLACEHOLDER : this.#placeholder}
|
|
98
|
-
?disabled=${this.disabled}
|
|
99
|
-
?readonly=${this.inputReadonly}
|
|
100
|
-
?data-pointer-focus=${this.#pointerFocus.active}
|
|
101
|
-
aria-readonly=${this.readonlyAria}
|
|
102
|
-
aria-disabled=${this.lockedAria}
|
|
103
|
-
aria-description=${this.lockDescription}
|
|
104
|
-
aria-invalid=${this.displayError === null ? nothing : "true"}
|
|
105
|
-
@input=${this.onDraftInput}
|
|
106
|
-
@focus=${this.#pointerFocus.onFocus}
|
|
107
|
-
@keydown=${this.#onKeyDown}
|
|
108
|
-
@blur=${this.#onBlur}
|
|
109
|
-
>
|
|
110
|
-
${this.#renderPopover()}
|
|
89
|
+
: html `<span class="swatch-face" style="--jolly-swatch-color:${swatch}"></span>`}
|
|
90
|
+
</button>
|
|
91
|
+
<input
|
|
92
|
+
type="text"
|
|
93
|
+
class="hex"
|
|
94
|
+
spellcheck="false"
|
|
95
|
+
aria-label="Hex value"
|
|
96
|
+
.value=${this.draft ?? swatch ?? ""}
|
|
97
|
+
placeholder=${this.mixed ? MIXED_PLACEHOLDER : this.#placeholder}
|
|
98
|
+
?disabled=${this.disabled}
|
|
99
|
+
?readonly=${this.inputReadonly}
|
|
100
|
+
?data-pointer-focus=${this.#pointerFocus.active}
|
|
101
|
+
aria-readonly=${this.readonlyAria}
|
|
102
|
+
aria-disabled=${this.lockedAria}
|
|
103
|
+
aria-description=${this.lockDescription}
|
|
104
|
+
aria-invalid=${this.displayError === null ? nothing : "true"}
|
|
105
|
+
@input=${this.onDraftInput}
|
|
106
|
+
@focus=${this.#pointerFocus.onFocus}
|
|
107
|
+
@keydown=${this.#onKeyDown}
|
|
108
|
+
@blur=${this.#onBlur}
|
|
109
|
+
>
|
|
110
|
+
${this.#renderPopover()}
|
|
111
111
|
`;
|
|
112
112
|
}
|
|
113
113
|
get #placeholder() {
|
|
@@ -116,24 +116,24 @@ let Color = class Color extends JollyField {
|
|
|
116
116
|
: Color_1.Defaults.value;
|
|
117
117
|
}
|
|
118
118
|
#renderPopover() {
|
|
119
|
-
return html `
|
|
120
|
-
<div
|
|
121
|
-
class="popover"
|
|
122
|
-
id="picker"
|
|
123
|
-
popover
|
|
124
|
-
@beforetoggle=${this.#popup.onBeforeToggle}
|
|
125
|
-
@toggle=${this.#popup.onToggle}
|
|
126
|
-
>
|
|
127
|
-
<jolly-color-picker
|
|
128
|
-
class="picker"
|
|
129
|
-
.value=${this.concreteValue ?? Color_1.Defaults.value}
|
|
130
|
-
?alpha=${this.alpha}
|
|
131
|
-
.hexInput=${false}
|
|
132
|
-
?readonly=${!this.editable}
|
|
133
|
-
@jolly-input=${this.#onPickerInput}
|
|
134
|
-
@jolly-change=${this.#onPickerChange}
|
|
135
|
-
></jolly-color-picker>
|
|
136
|
-
</div>
|
|
119
|
+
return html `
|
|
120
|
+
<div
|
|
121
|
+
class="popover"
|
|
122
|
+
id="picker"
|
|
123
|
+
popover
|
|
124
|
+
@beforetoggle=${this.#popup.onBeforeToggle}
|
|
125
|
+
@toggle=${this.#popup.onToggle}
|
|
126
|
+
>
|
|
127
|
+
<jolly-color-picker
|
|
128
|
+
class="picker"
|
|
129
|
+
.value=${this.concreteValue ?? Color_1.Defaults.value}
|
|
130
|
+
?alpha=${this.alpha}
|
|
131
|
+
.hexInput=${false}
|
|
132
|
+
?readonly=${!this.editable}
|
|
133
|
+
@jolly-input=${this.#onPickerInput}
|
|
134
|
+
@jolly-change=${this.#onPickerChange}
|
|
135
|
+
></jolly-color-picker>
|
|
136
|
+
</div>
|
|
137
137
|
`;
|
|
138
138
|
}
|
|
139
139
|
/**
|