@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,98 +2,98 @@
|
|
|
2
2
|
import { css } from "lit";
|
|
3
3
|
// Import Internal Dependencies
|
|
4
4
|
import { kFallback } from "../theme/styles/fallbacks.js";
|
|
5
|
-
export const tabsStyles = css `
|
|
6
|
-
:host {
|
|
7
|
-
display: flex;
|
|
8
|
-
min-width: 0;
|
|
9
|
-
min-height: 0;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
color: var(--jolly-text, ${kFallback.text});
|
|
12
|
-
font: inherit;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
:host([orientation="vertical"]) {
|
|
16
|
-
flex-direction: row;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/*
|
|
20
|
-
* Tabs sit inside a plane, so the strip paints no surface. The selected tab's
|
|
21
|
-
* accent edge is what marks the boundary the divider used to draw.
|
|
22
|
-
*/
|
|
23
|
-
.list {
|
|
24
|
-
display: flex;
|
|
25
|
-
flex: 0 0 auto;
|
|
26
|
-
gap: 1px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:host([orientation="vertical"]) .list {
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
button {
|
|
34
|
-
position: relative;
|
|
35
|
-
min-height: var(--jolly-control-height, 20px);
|
|
36
|
-
padding: 0 var(--jolly-space-2, 8px);
|
|
37
|
-
border: 0;
|
|
38
|
-
border-bottom: 0;
|
|
39
|
-
background: transparent;
|
|
40
|
-
color: inherit;
|
|
41
|
-
font: inherit;
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
transition:
|
|
44
|
-
background-color var(--jolly-duration-fast, 100ms) var(--jolly-easing, ease),
|
|
45
|
-
color var(--jolly-duration-fast, 100ms) var(--jolly-easing, ease);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
button::after {
|
|
49
|
-
position: absolute;
|
|
50
|
-
right: var(--jolly-space-2, 8px);
|
|
51
|
-
bottom: 0;
|
|
52
|
-
left: var(--jolly-space-2, 8px);
|
|
53
|
-
height: 2px;
|
|
54
|
-
background: transparent;
|
|
55
|
-
content: "";
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
button:hover:not(:disabled) {
|
|
59
|
-
background: var(--jolly-control-bg-hover, ${kFallback.controlBg});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
button[aria-selected="true"] {
|
|
63
|
-
background: var(--jolly-control-bg, ${kFallback.controlBg});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
button[aria-selected="true"] {
|
|
67
|
-
color: var(--jolly-accent-text);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
button[aria-selected="true"]::after {
|
|
71
|
-
background: var(--jolly-accent-fill);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
:host([orientation="vertical"]) button::after {
|
|
75
|
-
top: var(--jolly-space-1, 4px);
|
|
76
|
-
right: 0;
|
|
77
|
-
bottom: var(--jolly-space-1, 4px);
|
|
78
|
-
left: auto;
|
|
79
|
-
width: 2px;
|
|
80
|
-
height: auto;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
button:disabled {
|
|
84
|
-
opacity: 0.5;
|
|
85
|
-
cursor: default;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
button:focus-visible {
|
|
89
|
-
background: var(--jolly-control-bg-focus, ${kFallback.controlBg});
|
|
90
|
-
outline: none;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.panels {
|
|
94
|
-
flex: 1 1 auto;
|
|
95
|
-
min-width: 0;
|
|
96
|
-
min-height: 0;
|
|
97
|
-
}
|
|
5
|
+
export const tabsStyles = css `
|
|
6
|
+
:host {
|
|
7
|
+
display: flex;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
min-height: 0;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
color: var(--jolly-text, ${kFallback.text});
|
|
12
|
+
font: inherit;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([orientation="vertical"]) {
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
* Tabs sit inside a plane, so the strip paints no surface. The selected tab's
|
|
21
|
+
* accent edge is what marks the boundary the divider used to draw.
|
|
22
|
+
*/
|
|
23
|
+
.list {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex: 0 0 auto;
|
|
26
|
+
gap: 1px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([orientation="vertical"]) .list {
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
button {
|
|
34
|
+
position: relative;
|
|
35
|
+
min-height: var(--jolly-control-height, 20px);
|
|
36
|
+
padding: 0 var(--jolly-space-2, 8px);
|
|
37
|
+
border: 0;
|
|
38
|
+
border-bottom: 0;
|
|
39
|
+
background: transparent;
|
|
40
|
+
color: inherit;
|
|
41
|
+
font: inherit;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
transition:
|
|
44
|
+
background-color var(--jolly-duration-fast, 100ms) var(--jolly-easing, ease),
|
|
45
|
+
color var(--jolly-duration-fast, 100ms) var(--jolly-easing, ease);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
button::after {
|
|
49
|
+
position: absolute;
|
|
50
|
+
right: var(--jolly-space-2, 8px);
|
|
51
|
+
bottom: 0;
|
|
52
|
+
left: var(--jolly-space-2, 8px);
|
|
53
|
+
height: 2px;
|
|
54
|
+
background: transparent;
|
|
55
|
+
content: "";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
button:hover:not(:disabled) {
|
|
59
|
+
background: var(--jolly-control-bg-hover, ${kFallback.controlBg});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
button[aria-selected="true"] {
|
|
63
|
+
background: var(--jolly-control-bg, ${kFallback.controlBg});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
button[aria-selected="true"] {
|
|
67
|
+
color: var(--jolly-accent-text);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
button[aria-selected="true"]::after {
|
|
71
|
+
background: var(--jolly-accent-fill);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([orientation="vertical"]) button::after {
|
|
75
|
+
top: var(--jolly-space-1, 4px);
|
|
76
|
+
right: 0;
|
|
77
|
+
bottom: var(--jolly-space-1, 4px);
|
|
78
|
+
left: auto;
|
|
79
|
+
width: 2px;
|
|
80
|
+
height: auto;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
button:disabled {
|
|
84
|
+
opacity: 0.5;
|
|
85
|
+
cursor: default;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
button:focus-visible {
|
|
89
|
+
background: var(--jolly-control-bg-focus, ${kFallback.controlBg});
|
|
90
|
+
outline: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.panels {
|
|
94
|
+
flex: 1 1 auto;
|
|
95
|
+
min-width: 0;
|
|
96
|
+
min-height: 0;
|
|
97
|
+
}
|
|
98
98
|
`;
|
|
99
99
|
//# sourceMappingURL=Tabs.styles.js.map
|
|
@@ -11,25 +11,25 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
import { LitElement, css, html } from "lit";
|
|
12
12
|
import { customElement, property } from "lit/decorators.js";
|
|
13
13
|
let Toolbar = class Toolbar extends LitElement {
|
|
14
|
-
static styles = css `
|
|
15
|
-
:host,
|
|
16
|
-
div {
|
|
17
|
-
display: flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
gap: var(--jolly-space-1, 4px);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
:host {
|
|
23
|
-
min-width: 0;
|
|
24
|
-
color: var(--jolly-text);
|
|
25
|
-
font: inherit;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
:host([orientation="vertical"]),
|
|
29
|
-
:host([orientation="vertical"]) div {
|
|
30
|
-
align-items: stretch;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
}
|
|
14
|
+
static styles = css `
|
|
15
|
+
:host,
|
|
16
|
+
div {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: var(--jolly-space-1, 4px);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host {
|
|
23
|
+
min-width: 0;
|
|
24
|
+
color: var(--jolly-text);
|
|
25
|
+
font: inherit;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([orientation="vertical"]),
|
|
29
|
+
:host([orientation="vertical"]) div {
|
|
30
|
+
align-items: stretch;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
}
|
|
33
33
|
`;
|
|
34
34
|
constructor() {
|
|
35
35
|
super();
|
|
@@ -37,12 +37,12 @@ let Toolbar = class Toolbar extends LitElement {
|
|
|
37
37
|
this.label = "";
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return html `
|
|
41
|
-
<div
|
|
42
|
-
role="toolbar"
|
|
43
|
-
aria-label=${this.label}
|
|
44
|
-
aria-orientation=${this.orientation}
|
|
45
|
-
><slot></slot></div>
|
|
40
|
+
return html `
|
|
41
|
+
<div
|
|
42
|
+
role="toolbar"
|
|
43
|
+
aria-label=${this.label}
|
|
44
|
+
aria-orientation=${this.orientation}
|
|
45
|
+
><slot></slot></div>
|
|
46
46
|
`;
|
|
47
47
|
}
|
|
48
48
|
};
|
|
@@ -3,11 +3,11 @@ import { emitContainerEvent } from "./events.js";
|
|
|
3
3
|
import { ensureDocumentStyles } from "../interaction/ensureDocumentStyles.js";
|
|
4
4
|
// CONSTANTS
|
|
5
5
|
export function installResizeCursorStyles(document) {
|
|
6
|
-
ensureDocumentStyles("jolly-resize-cursors", `
|
|
7
|
-
html.handle-dragging.vertical * { cursor: ew-resize !important; }
|
|
8
|
-
html.handle-dragging.horizontal * { cursor: ns-resize !important; }
|
|
9
|
-
html.handle-dragging.nwse * { cursor: nwse-resize !important; }
|
|
10
|
-
html.handle-dragging.nesw * { cursor: nesw-resize !important; }
|
|
6
|
+
ensureDocumentStyles("jolly-resize-cursors", `
|
|
7
|
+
html.handle-dragging.vertical * { cursor: ew-resize !important; }
|
|
8
|
+
html.handle-dragging.horizontal * { cursor: ns-resize !important; }
|
|
9
|
+
html.handle-dragging.nwse * { cursor: nwse-resize !important; }
|
|
10
|
+
html.handle-dragging.nesw * { cursor: nesw-resize !important; }
|
|
11
11
|
`, document);
|
|
12
12
|
}
|
|
13
13
|
export function forwardResizeEvents(owner, resizeHandle, detail, onEnd) {
|
package/dist/controls/Button.js
CHANGED
|
@@ -37,17 +37,17 @@ let Button = class Button extends LitElement {
|
|
|
37
37
|
this.iconOnly = false;
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return html `
|
|
41
|
-
<button
|
|
42
|
-
type="button"
|
|
43
|
-
?disabled=${this.disabled}
|
|
44
|
-
aria-label=${this.label === "" ? nothing : this.label}
|
|
45
|
-
>
|
|
40
|
+
return html `
|
|
41
|
+
<button
|
|
42
|
+
type="button"
|
|
43
|
+
?disabled=${this.disabled}
|
|
44
|
+
aria-label=${this.label === "" ? nothing : this.label}
|
|
45
|
+
>
|
|
46
46
|
${this.icon === undefined
|
|
47
47
|
? nothing
|
|
48
|
-
: html `<jolly-icon name=${this.icon}></jolly-icon>`}
|
|
49
|
-
<slot></slot>
|
|
50
|
-
</button>
|
|
48
|
+
: html `<jolly-icon name=${this.icon}></jolly-icon>`}
|
|
49
|
+
<slot></slot>
|
|
50
|
+
</button>
|
|
51
51
|
`;
|
|
52
52
|
}
|
|
53
53
|
};
|
|
@@ -3,84 +3,84 @@ import { css } from "lit";
|
|
|
3
3
|
// Import Internal Dependencies
|
|
4
4
|
import { kFallback } from "../theme/styles/fallbacks.js";
|
|
5
5
|
import { fillTransition } from "../theme/styles/mixins.js";
|
|
6
|
-
export const buttonStyles = css `
|
|
7
|
-
:host {
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
font-family: var(--jolly-font-family, ui-monospace, monospace);
|
|
10
|
-
font-size: var(--jolly-font-size, 11px);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
button {
|
|
14
|
-
display: inline-flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
gap: var(--jolly-space-1, 4px);
|
|
18
|
-
width: 100%;
|
|
19
|
-
height: var(--jolly-control-height, 20px);
|
|
20
|
-
padding: 0 var(--jolly-space-2, 8px);
|
|
21
|
-
border: 0;
|
|
22
|
-
border-radius: var(--jolly-radius-sm, 2px);
|
|
23
|
-
background: var(--jolly-control-bg, ${kFallback.controlBg});
|
|
24
|
-
color: var(--jolly-text, ${kFallback.text});
|
|
25
|
-
font: inherit;
|
|
26
|
-
white-space: nowrap;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
${fillTransition}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
button:hover:not(:disabled) {
|
|
32
|
-
background: var(--jolly-control-bg-hover);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
button:active:not(:disabled) {
|
|
36
|
-
background: var(--jolly-control-bg-active);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* Focus is a fill step, which has to beat hover because they share a channel. */
|
|
40
|
-
button:focus-visible {
|
|
41
|
-
background: var(--jolly-control-bg-focus);
|
|
42
|
-
outline: none;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host([variant="accent"]) button {
|
|
46
|
-
background: var(--jolly-accent-fill);
|
|
47
|
-
color: var(--jolly-text-on-fill);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
:host([variant="accent"]) button:hover:not(:disabled) {
|
|
51
|
-
background: var(--jolly-accent-fill-hover);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
:host([variant="accent"]) button:focus-visible,
|
|
55
|
-
:host([variant="accent"]) button:active:not(:disabled) {
|
|
56
|
-
background: var(--jolly-accent-fill-focus);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
:host([variant="danger"]) button {
|
|
60
|
-
background: var(--jolly-invalid-bg);
|
|
61
|
-
color: var(--jolly-danger);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
:host([variant="danger"]) button:hover:not(:disabled) {
|
|
65
|
-
background: var(--jolly-invalid-bg-hover);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
:host([variant="danger"]) button:focus-visible,
|
|
69
|
-
:host([variant="danger"]) button:active:not(:disabled) {
|
|
70
|
-
background: var(--jolly-invalid-bg-focus);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:host([disabled]) button {
|
|
74
|
-
opacity: 0.5;
|
|
75
|
-
cursor: default;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/*
|
|
79
|
-
* Icon-only buttons use a square target.
|
|
80
|
-
*/
|
|
81
|
-
:host([icon-only]) button {
|
|
82
|
-
width: var(--jolly-icon-button-size, 32px);
|
|
83
|
-
padding: 0;
|
|
84
|
-
}
|
|
6
|
+
export const buttonStyles = css `
|
|
7
|
+
:host {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
font-family: var(--jolly-font-family, ui-monospace, monospace);
|
|
10
|
+
font-size: var(--jolly-font-size, 11px);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
button {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
gap: var(--jolly-space-1, 4px);
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: var(--jolly-control-height, 20px);
|
|
20
|
+
padding: 0 var(--jolly-space-2, 8px);
|
|
21
|
+
border: 0;
|
|
22
|
+
border-radius: var(--jolly-radius-sm, 2px);
|
|
23
|
+
background: var(--jolly-control-bg, ${kFallback.controlBg});
|
|
24
|
+
color: var(--jolly-text, ${kFallback.text});
|
|
25
|
+
font: inherit;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
${fillTransition}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
button:hover:not(:disabled) {
|
|
32
|
+
background: var(--jolly-control-bg-hover);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
button:active:not(:disabled) {
|
|
36
|
+
background: var(--jolly-control-bg-active);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Focus is a fill step, which has to beat hover because they share a channel. */
|
|
40
|
+
button:focus-visible {
|
|
41
|
+
background: var(--jolly-control-bg-focus);
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([variant="accent"]) button {
|
|
46
|
+
background: var(--jolly-accent-fill);
|
|
47
|
+
color: var(--jolly-text-on-fill);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([variant="accent"]) button:hover:not(:disabled) {
|
|
51
|
+
background: var(--jolly-accent-fill-hover);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([variant="accent"]) button:focus-visible,
|
|
55
|
+
:host([variant="accent"]) button:active:not(:disabled) {
|
|
56
|
+
background: var(--jolly-accent-fill-focus);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([variant="danger"]) button {
|
|
60
|
+
background: var(--jolly-invalid-bg);
|
|
61
|
+
color: var(--jolly-danger);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([variant="danger"]) button:hover:not(:disabled) {
|
|
65
|
+
background: var(--jolly-invalid-bg-hover);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host([variant="danger"]) button:focus-visible,
|
|
69
|
+
:host([variant="danger"]) button:active:not(:disabled) {
|
|
70
|
+
background: var(--jolly-invalid-bg-focus);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([disabled]) button {
|
|
74
|
+
opacity: 0.5;
|
|
75
|
+
cursor: default;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
* Icon-only buttons use a square target.
|
|
80
|
+
*/
|
|
81
|
+
:host([icon-only]) button {
|
|
82
|
+
width: var(--jolly-icon-button-size, 32px);
|
|
83
|
+
padding: 0;
|
|
84
|
+
}
|
|
85
85
|
`;
|
|
86
86
|
//# sourceMappingURL=Button.styles.js.map
|
|
@@ -52,40 +52,40 @@ let ButtonGroup = class ButtonGroup extends JollyField {
|
|
|
52
52
|
const columns = this.layout === "grid" && this.columns > 0
|
|
53
53
|
? `grid-template-columns: repeat(${this.columns}, 1fr)`
|
|
54
54
|
: nothing;
|
|
55
|
-
return html `
|
|
56
|
-
<div
|
|
57
|
-
class="group"
|
|
58
|
-
role="radiogroup"
|
|
59
|
-
aria-label=${this.label || this.getAttribute("aria-label") || nothing}
|
|
60
|
-
aria-readonly=${this.readonlyAria}
|
|
61
|
-
aria-disabled=${this.lockedAria}
|
|
62
|
-
aria-description=${this.lockDescription}
|
|
63
|
-
style=${columns}
|
|
64
|
-
@keydown=${this.#onKeyDown}
|
|
65
|
-
>
|
|
66
|
-
${this.options.map((option, index) => this.#renderOption(option, index))}
|
|
67
|
-
</div>
|
|
55
|
+
return html `
|
|
56
|
+
<div
|
|
57
|
+
class="group"
|
|
58
|
+
role="radiogroup"
|
|
59
|
+
aria-label=${this.label || this.getAttribute("aria-label") || nothing}
|
|
60
|
+
aria-readonly=${this.readonlyAria}
|
|
61
|
+
aria-disabled=${this.lockedAria}
|
|
62
|
+
aria-description=${this.lockDescription}
|
|
63
|
+
style=${columns}
|
|
64
|
+
@keydown=${this.#onKeyDown}
|
|
65
|
+
>
|
|
66
|
+
${this.options.map((option, index) => this.#renderOption(option, index))}
|
|
67
|
+
</div>
|
|
68
68
|
`;
|
|
69
69
|
}
|
|
70
70
|
#renderOption(option, index) {
|
|
71
71
|
const selected = this.#selectedIndex === index;
|
|
72
|
-
return html `
|
|
73
|
-
<button
|
|
74
|
-
type="button"
|
|
75
|
-
role="radio"
|
|
76
|
-
class="segment"
|
|
77
|
-
data-index=${index}
|
|
78
|
-
aria-checked=${selected ? "true" : "false"}
|
|
79
|
-
title=${option.label}
|
|
80
|
-
tabindex=${this.#tabIndexFor(index)}
|
|
81
|
-
?disabled=${this.disabled || option.disabled === true}
|
|
82
|
-
@click=${() => this.#select(index)}
|
|
83
|
-
>
|
|
72
|
+
return html `
|
|
73
|
+
<button
|
|
74
|
+
type="button"
|
|
75
|
+
role="radio"
|
|
76
|
+
class="segment"
|
|
77
|
+
data-index=${index}
|
|
78
|
+
aria-checked=${selected ? "true" : "false"}
|
|
79
|
+
title=${option.label}
|
|
80
|
+
tabindex=${this.#tabIndexFor(index)}
|
|
81
|
+
?disabled=${this.disabled || option.disabled === true}
|
|
82
|
+
@click=${() => this.#select(index)}
|
|
83
|
+
>
|
|
84
84
|
${option.icon === undefined
|
|
85
85
|
? nothing
|
|
86
|
-
: html `<jolly-icon name=${option.icon}></jolly-icon>`}
|
|
87
|
-
<span class="segment-label">${option.label}</span>
|
|
88
|
-
</button>
|
|
86
|
+
: html `<jolly-icon name=${option.icon}></jolly-icon>`}
|
|
87
|
+
<span class="segment-label">${option.label}</span>
|
|
88
|
+
</button>
|
|
89
89
|
`;
|
|
90
90
|
}
|
|
91
91
|
get #selectedIndex() {
|