@redvars/peacock 3.3.1 → 3.3.2
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/dist/{IndividualComponent-tDnXrOLV.js → IndividualComponent-Dt5xirYG.js} +2 -2
- package/dist/{IndividualComponent-tDnXrOLV.js.map → IndividualComponent-Dt5xirYG.js.map} +1 -1
- package/dist/array-D5vjT2Xm.js +14 -0
- package/dist/array-D5vjT2Xm.js.map +1 -0
- package/dist/{button-trIfcqC7.js → button-ClzS8JLq.js} +3 -3
- package/dist/{button-trIfcqC7.js.map → button-ClzS8JLq.js.map} +1 -1
- package/dist/{button-group-DA7xoziD.js → button-group-BMS5WvaF.js} +4 -4
- package/dist/{button-group-DA7xoziD.js.map → button-group-BMS5WvaF.js.map} +1 -1
- package/dist/button-group.js +4 -4
- package/dist/button.js +3 -3
- package/dist/card.js +104 -0
- package/dist/card.js.map +1 -0
- package/dist/chart-bar-DbnXQgvS.js +1121 -0
- package/dist/chart-bar-DbnXQgvS.js.map +1 -0
- package/dist/chart-bar.js +259 -0
- package/dist/chart-bar.js.map +1 -0
- package/dist/chart-donut.js +4 -2
- package/dist/chart-donut.js.map +1 -1
- package/dist/chart-doughnut.js +4 -2
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js +4 -2
- package/dist/chart-pie.js.map +1 -1
- package/dist/chart-stacked-bar.js +401 -0
- package/dist/chart-stacked-bar.js.map +1 -0
- package/dist/{class-map-hJdvjl-W.js → class-map-59YGWLnx.js} +2 -2
- package/dist/{class-map-hJdvjl-W.js.map → class-map-59YGWLnx.js.map} +1 -1
- package/dist/clock.js +1 -1
- package/dist/code-editor.js +3 -3
- package/dist/code-highlighter.js +3 -3
- package/dist/custom-elements-jsdocs.json +2308 -766
- package/dist/custom-elements.json +909 -25
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/number-counter.js +2 -2
- package/dist/{observe-theme-change-BISF-Gl5.js → observe-theme-change-pALI5fmV.js} +2 -2
- package/dist/{observe-theme-change-BISF-Gl5.js.map → observe-theme-change-pALI5fmV.js.map} +1 -1
- package/dist/peacock-loader.js +22 -526
- package/dist/peacock-loader.js.map +1 -1
- package/dist/pie-Dz0IDiPt.js +537 -0
- package/dist/pie-Dz0IDiPt.js.map +1 -0
- package/dist/{tree-view-CLolVlU0.js → snackbar-74YCdMPL.js} +1005 -143
- package/dist/snackbar-74YCdMPL.js.map +1 -0
- package/dist/src/card/card.d.ts +27 -0
- package/dist/src/card/index.d.ts +1 -0
- package/dist/src/chart-bar/chart-bar.d.ts +53 -0
- package/dist/src/chart-bar/chart-stacked-bar.d.ts +78 -0
- package/dist/src/chart-bar/index.d.ts +2 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/menu/menu-item/menu-item.d.ts +1 -1
- package/dist/src/snackbar/index.d.ts +1 -0
- package/dist/src/snackbar/snackbar.d.ts +40 -0
- package/dist/src/tabs/tab-group.d.ts +1 -1
- package/dist/src/tabs/tab-panel.d.ts +1 -0
- package/dist/src/tabs/tab.d.ts +2 -1
- package/dist/{style-map-CfNHEkQp.js → style-map-DcB52w-l.js} +2 -2
- package/dist/{style-map-CfNHEkQp.js.map → style-map-DcB52w-l.js.map} +1 -1
- package/dist/test/card.test.d.ts +1 -0
- package/dist/test/chart-bar.test.d.ts +1 -0
- package/dist/test/snackbar.test.d.ts +1 -0
- package/dist/{transform-DRuHEvar.js → transform-DSwFSqzD.js} +13 -558
- package/dist/transform-DSwFSqzD.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-CV6Je6HL.js → unsafe-html-C2r3PyzF.js} +2 -2
- package/dist/{unsafe-html-CV6Je6HL.js.map → unsafe-html-C2r3PyzF.js.map} +1 -1
- package/package.json +1 -1
- package/readme.md +2 -2
- package/src/card/card.scss +61 -0
- package/src/card/card.ts +38 -0
- package/src/card/index.ts +1 -0
- package/src/chart-bar/chart-bar.scss +58 -0
- package/src/chart-bar/chart-bar.ts +306 -0
- package/src/chart-bar/chart-stacked-bar.ts +402 -0
- package/src/chart-bar/index.ts +2 -0
- package/src/index.ts +5 -0
- package/src/menu/menu-item/menu-item.ts +1 -1
- package/src/peacock-loader.ts +14 -0
- package/src/snackbar/demo/index.html +29 -0
- package/src/snackbar/index.ts +1 -0
- package/src/snackbar/snackbar.scss +73 -0
- package/src/snackbar/snackbar.ts +151 -0
- package/src/tabs/tab-group.ts +57 -28
- package/src/tabs/tab-panel.scss +3 -3
- package/src/tabs/tab-panel.ts +2 -0
- package/src/tabs/tab.scss +76 -2
- package/src/tabs/tab.ts +28 -6
- package/src/tabs/tabs.ts +15 -3
- package/dist/transform-DRuHEvar.js.map +0 -1
- package/dist/tree-view-CLolVlU0.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
export { A as Accordion, a as Avatar, B as Badge, b as Breadcrumb, c as BreadcrumbItem, C as
|
|
1
|
+
export { A as Accordion, a as Avatar, B as Badge, b as Breadcrumb, c as BreadcrumbItem, C as Checkbox, d as Chip, e as CircularProgress, f as Container, D as DatePicker, g as Divider, E as Elevation, h as EmptyState, F as Field, i as FocusRing, I as Icon, j as Image, k as Input, L as LinearProgress, l as Link, M as Menu, m as MenuItem, N as NumberField, P as Pagination, R as Ripple, S as Skeleton, n as Slider, o as Snackbar, p as Spinner, q as SubMenu, r as Switch, T as Tab, s as TabGroup, t as TabPanel, u as Table, v as Tabs, w as Tag, x as Textarea, y as TimePicker, z as Tooltip, G as TreeNode, H as TreeView } from './snackbar-74YCdMPL.js';
|
|
2
2
|
export { Clock } from './clock.js';
|
|
3
|
-
export { B as Button } from './button-
|
|
4
|
-
export { B as ButtonGroup, I as IconButton } from './button-group-
|
|
3
|
+
export { B as Button } from './button-ClzS8JLq.js';
|
|
4
|
+
export { B as ButtonGroup, I as IconButton } from './button-group-BMS5WvaF.js';
|
|
5
5
|
export { NumberCounter } from './number-counter.js';
|
|
6
6
|
export { CodeHighlighter } from './code-highlighter.js';
|
|
7
7
|
export { default as CodeEditor } from './code-editor.js';
|
|
8
|
+
export { ChartDonut } from './chart-donut.js';
|
|
8
9
|
export { ChartDoughnut } from './chart-doughnut.js';
|
|
9
10
|
export { ChartPie } from './chart-pie.js';
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
export { ChartBar } from './chart-bar.js';
|
|
12
|
+
export { ChartStackedBar } from './chart-stacked-bar.js';
|
|
13
|
+
export { Card } from './card.js';
|
|
14
|
+
import './IndividualComponent-Dt5xirYG.js';
|
|
15
|
+
import './class-map-59YGWLnx.js';
|
|
12
16
|
import './directive-Cuw6h7YA.js';
|
|
13
|
-
import './unsafe-html-
|
|
17
|
+
import './unsafe-html-C2r3PyzF.js';
|
|
14
18
|
import './dispatch-event-utils-B4odODQf.js';
|
|
15
19
|
import './query-QBcUV-L_.js';
|
|
16
|
-
import './style-map-
|
|
17
|
-
import './observe-theme-change-
|
|
18
|
-
import './transform-
|
|
20
|
+
import './style-map-DcB52w-l.js';
|
|
21
|
+
import './observe-theme-change-pALI5fmV.js';
|
|
22
|
+
import './transform-DSwFSqzD.js';
|
|
23
|
+
import './pie-Dz0IDiPt.js';
|
|
24
|
+
import './array-D5vjT2Xm.js';
|
|
25
|
+
import './chart-bar-DbnXQgvS.js';
|
|
19
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/number-counter.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i, _ as __decorate, n, I as IndividualComponent,
|
|
2
|
-
import { o } from './style-map-
|
|
1
|
+
import { a as i, _ as __decorate, n, I as IndividualComponent, i as i$1, b, A } from './IndividualComponent-Dt5xirYG.js';
|
|
2
|
+
import { o } from './style-map-DcB52w-l.js';
|
|
3
3
|
import './directive-Cuw6h7YA.js';
|
|
4
4
|
|
|
5
5
|
var css_248z = i`* {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __decorate, n,
|
|
1
|
+
import { _ as __decorate, n, i } from './IndividualComponent-Dt5xirYG.js';
|
|
2
2
|
|
|
3
3
|
class BaseInput extends i {
|
|
4
4
|
constructor() {
|
|
@@ -48,4 +48,4 @@ const observeThemeChange = (() => {
|
|
|
48
48
|
})();
|
|
49
49
|
|
|
50
50
|
export { BaseInput as B, observeThemeChange as o };
|
|
51
|
-
//# sourceMappingURL=observe-theme-change-
|
|
51
|
+
//# sourceMappingURL=observe-theme-change-pALI5fmV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe-theme-change-
|
|
1
|
+
{"version":3,"file":"observe-theme-change-pALI5fmV.js","sources":["../../src/input/BaseInput.ts","../../src/utils/observe-theme-change.ts"],"sourcesContent":["import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nexport default abstract class BaseInput extends LitElement {\n value?: any;\n\n @property({ type: Boolean, reflect: true })\n disabled: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n readonly: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n required: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n skeleton = false;\n}\n","type ThemeChangeCallback = () => void;\n\nexport const observeThemeChange = (() => {\n const callbacks = new Set<ThemeChangeCallback>();\n\n const observer = new MutationObserver((records) => {\n const changed = records.some(\n (r) => r.type === \"attributes\" && r.attributeName === \"data-theme\"\n );\n if (!changed) return;\n\n for (const callback of callbacks) {\n try {\n callback();\n } catch (err) {\n console.error(\"[observeThemeChange] callback threw:\", err);\n }\n }\n });\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-theme\"],\n });\n\n return (callback: ThemeChangeCallback): (() => void) => {\n callbacks.add(callback);\n return () => callbacks.delete(callback);\n };\n})();"],"names":["LitElement","property"],"mappings":";;AAGc,MAAgB,SAAU,SAAQA,CAAU,CAAA;AAA1D,IAAA,WAAA,GAAA;;QAIE,IAAA,CAAA,QAAQ,GAAY,KAAK;QAGzB,IAAA,CAAA,QAAQ,GAAY,KAAK;QAGzB,IAAA,CAAA,QAAQ,GAAY,KAAK;QAGzB,IAAA,CAAA,QAAQ,GAAG,KAAK;IAClB;AAAC;AAVC,UAAA,CAAA;IADCC,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAChB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAG1B,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAChB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAG1B,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAChB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAG1B,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AACzB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;;ACdZ,MAAM,kBAAkB,GAAG,CAAC,MAAK;AACtC,IAAA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuB;IAEhD,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,OAAO,KAAI;QAChD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAC1B,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,aAAa,KAAK,YAAY,CACnE;AACD,QAAA,IAAI,CAAC,OAAO;YAAE;AAEd,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,IAAI;AACF,gBAAA,QAAQ,EAAE;YACZ;YAAE,OAAO,GAAG,EAAE;AACZ,gBAAA,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC;YAC5D;QACF;AACF,IAAA,CAAC,CAAC;AAEF,IAAA,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE;AACzC,QAAA,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,CAAC,YAAY,CAAC;AAChC,KAAA,CAAC;IAEF,OAAO,CAAC,QAA6B,KAAkB;AACrD,QAAA,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC;QACvB,OAAO,MAAM,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC;AACzC,IAAA,CAAC;AACH,CAAC;;;;"}
|
package/dist/peacock-loader.js
CHANGED
|
@@ -1,531 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { B as ButtonGroup, I as IconButton } from './button-group-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { H as TreeView, A as Accordion, o as Snackbar, P as Pagination, u as Table, n as Slider, j as Image, f as Container, q as SubMenu, m as MenuItem, M as Menu, h as EmptyState, p as Spinner, C as Checkbox, r as Switch, c as BreadcrumbItem, b as Breadcrumb, z as Tooltip, y as TimePicker, D as DatePicker, x as Textarea, N as NumberField, k as Input, F as Field, S as Skeleton, e as CircularProgress, L as LinearProgress, w as Tag, d as Chip, l as Link, t as TabPanel, T as Tab, s as TabGroup, v as Tabs, R as Ripple, E as Elevation, g as Divider, B as Badge, a as Avatar, i as FocusRing, I as Icon } from './snackbar-74YCdMPL.js';
|
|
2
|
+
import { B as Button } from './button-ClzS8JLq.js';
|
|
3
|
+
import { B as ButtonGroup, I as IconButton } from './button-group-BMS5WvaF.js';
|
|
4
|
+
import { Card } from './card.js';
|
|
5
|
+
import './IndividualComponent-Dt5xirYG.js';
|
|
6
|
+
import './class-map-59YGWLnx.js';
|
|
7
7
|
import './directive-Cuw6h7YA.js';
|
|
8
|
-
import './unsafe-html-
|
|
8
|
+
import './unsafe-html-C2r3PyzF.js';
|
|
9
9
|
import './dispatch-event-utils-B4odODQf.js';
|
|
10
|
-
import './
|
|
11
|
-
import './
|
|
12
|
-
|
|
13
|
-
var css_248z = i`* {
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.screen-reader-only {
|
|
18
|
-
display: none !important;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:host {
|
|
22
|
-
display: inline-block;
|
|
23
|
-
--checkbox-size: 18px;
|
|
24
|
-
--checkbox-icon-size: 12px;
|
|
25
|
-
--checkbox-selected-color: var(--color-primary);
|
|
26
|
-
--checkbox-unselected-color: var(--color-on-surface-variant);
|
|
27
|
-
--checkbox-checkmark-color: var(--color-on-primary);
|
|
28
|
-
--checkbox-state-layer-size: 40px;
|
|
29
|
-
--checkbox-disabled-opacity: 0.38;
|
|
30
|
-
--checkbox-border-radius: 2px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.checkbox {
|
|
34
|
-
position: relative;
|
|
35
|
-
display: inline-flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
user-select: none;
|
|
39
|
-
vertical-align: middle;
|
|
40
|
-
font-family: var(--typography-body-medium-font-family) !important;
|
|
41
|
-
font-size: var(--typography-body-medium-font-size) !important;
|
|
42
|
-
font-weight: var(--typography-body-medium-font-weight) !important;
|
|
43
|
-
line-height: var(--typography-body-medium-line-height) !important;
|
|
44
|
-
letter-spacing: var(--typography-body-medium-letter-spacing) !important;
|
|
45
|
-
}
|
|
46
|
-
.checkbox.has-content {
|
|
47
|
-
gap: 8px;
|
|
48
|
-
}
|
|
49
|
-
.checkbox .input-native {
|
|
50
|
-
position: absolute;
|
|
51
|
-
width: 1px;
|
|
52
|
-
height: 1px;
|
|
53
|
-
padding: 0;
|
|
54
|
-
margin: -1px;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
clip: rect(0, 0, 0, 0);
|
|
57
|
-
border: 0;
|
|
58
|
-
}
|
|
59
|
-
.checkbox .container {
|
|
60
|
-
position: relative;
|
|
61
|
-
display: inline-flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
width: var(--checkbox-state-layer-size);
|
|
65
|
-
height: var(--checkbox-state-layer-size);
|
|
66
|
-
cursor: inherit;
|
|
67
|
-
outline: none;
|
|
68
|
-
flex-shrink: 0;
|
|
69
|
-
}
|
|
70
|
-
.checkbox .state-layer {
|
|
71
|
-
position: absolute;
|
|
72
|
-
inset: 0;
|
|
73
|
-
border-radius: 50%;
|
|
74
|
-
opacity: 0;
|
|
75
|
-
transition: opacity var(--duration-short2) var(--easing-standard);
|
|
76
|
-
}
|
|
77
|
-
.checkbox .outline {
|
|
78
|
-
position: absolute;
|
|
79
|
-
width: var(--checkbox-size);
|
|
80
|
-
height: var(--checkbox-size);
|
|
81
|
-
border: 2px solid var(--checkbox-unselected-color);
|
|
82
|
-
border-radius: var(--checkbox-border-radius);
|
|
83
|
-
box-sizing: border-box;
|
|
84
|
-
transition: border-color var(--duration-short2) var(--easing-standard);
|
|
85
|
-
}
|
|
86
|
-
.checkbox .background {
|
|
87
|
-
position: absolute;
|
|
88
|
-
width: var(--checkbox-size);
|
|
89
|
-
height: var(--checkbox-size);
|
|
90
|
-
background: var(--checkbox-selected-color);
|
|
91
|
-
border-radius: var(--checkbox-border-radius);
|
|
92
|
-
opacity: 0;
|
|
93
|
-
transform: scale(0);
|
|
94
|
-
transition: transform var(--duration-short2) var(--easing-standard), opacity var(--duration-short2) var(--easing-standard);
|
|
95
|
-
}
|
|
96
|
-
.checkbox .icon {
|
|
97
|
-
position: absolute;
|
|
98
|
-
width: var(--checkbox-icon-size);
|
|
99
|
-
height: var(--checkbox-icon-size);
|
|
100
|
-
fill: none;
|
|
101
|
-
stroke: var(--checkbox-checkmark-color);
|
|
102
|
-
stroke-width: 2;
|
|
103
|
-
stroke-linecap: round;
|
|
104
|
-
stroke-linejoin: round;
|
|
105
|
-
opacity: 0;
|
|
106
|
-
transition: opacity var(--duration-short1) var(--easing-standard);
|
|
107
|
-
}
|
|
108
|
-
.checkbox .icon .checkmark {
|
|
109
|
-
stroke-dasharray: 14;
|
|
110
|
-
stroke-dashoffset: 14;
|
|
111
|
-
transition: stroke-dashoffset var(--duration-short4) var(--easing-emphasized);
|
|
112
|
-
}
|
|
113
|
-
.checkbox .icon .indeterminate {
|
|
114
|
-
transform-origin: center;
|
|
115
|
-
opacity: 0;
|
|
116
|
-
transition: opacity var(--duration-short1) var(--easing-standard);
|
|
117
|
-
}
|
|
118
|
-
.checkbox .label {
|
|
119
|
-
color: var(--color-on-surface);
|
|
120
|
-
cursor: inherit;
|
|
121
|
-
}
|
|
122
|
-
.checkbox:hover:not(.disabled):not(.readonly) .state-layer {
|
|
123
|
-
opacity: 0.08;
|
|
124
|
-
background: var(--color-on-surface);
|
|
125
|
-
}
|
|
126
|
-
.checkbox:hover:not(.disabled):not(.readonly).state-checked .state-layer, .checkbox:hover:not(.disabled):not(.readonly).state-indeterminate .state-layer {
|
|
127
|
-
background: var(--checkbox-selected-color);
|
|
128
|
-
}
|
|
129
|
-
.checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .state-layer {
|
|
130
|
-
opacity: 0.12;
|
|
131
|
-
background: var(--color-on-surface);
|
|
132
|
-
}
|
|
133
|
-
.checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .container {
|
|
134
|
-
outline: 3px solid var(--color-primary);
|
|
135
|
-
outline-offset: 2px;
|
|
136
|
-
border-radius: 50%;
|
|
137
|
-
}
|
|
138
|
-
.checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-checked .state-layer, .checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-indeterminate .state-layer {
|
|
139
|
-
background: var(--checkbox-selected-color);
|
|
140
|
-
}
|
|
141
|
-
.checkbox.active:not(.disabled):not(.readonly) .state-layer {
|
|
142
|
-
opacity: 0.12;
|
|
143
|
-
background: var(--color-on-surface);
|
|
144
|
-
}
|
|
145
|
-
.checkbox.active:not(.disabled):not(.readonly).state-checked .state-layer, .checkbox.active:not(.disabled):not(.readonly).state-indeterminate .state-layer {
|
|
146
|
-
background: var(--checkbox-selected-color);
|
|
147
|
-
}
|
|
148
|
-
.checkbox.rounded {
|
|
149
|
-
--checkbox-border-radius: 18px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.checkbox.state-checked .outline {
|
|
153
|
-
border-color: transparent;
|
|
154
|
-
}
|
|
155
|
-
.checkbox.state-checked .background {
|
|
156
|
-
opacity: 1;
|
|
157
|
-
transform: scale(1);
|
|
158
|
-
}
|
|
159
|
-
.checkbox.state-checked .icon {
|
|
160
|
-
opacity: 1;
|
|
161
|
-
}
|
|
162
|
-
.checkbox.state-checked .icon .checkmark {
|
|
163
|
-
stroke-dashoffset: 0;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.checkbox.state-indeterminate .outline {
|
|
167
|
-
border-color: transparent;
|
|
168
|
-
}
|
|
169
|
-
.checkbox.state-indeterminate .background {
|
|
170
|
-
opacity: 1;
|
|
171
|
-
transform: scale(1);
|
|
172
|
-
}
|
|
173
|
-
.checkbox.state-indeterminate .icon {
|
|
174
|
-
opacity: 1;
|
|
175
|
-
fill: var(--checkbox-checkmark-color);
|
|
176
|
-
}
|
|
177
|
-
.checkbox.state-indeterminate .icon .indeterminate {
|
|
178
|
-
opacity: 1;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.checkbox.size-sm {
|
|
182
|
-
--checkbox-size: 16px;
|
|
183
|
-
--checkbox-icon-size: 10px;
|
|
184
|
-
--checkbox-state-layer-size: 36px;
|
|
185
|
-
font-size: var(--font-size-body-small);
|
|
186
|
-
line-height: var(--line-height-body-small);
|
|
187
|
-
}
|
|
188
|
-
.checkbox.size-sm .icon {
|
|
189
|
-
stroke-width: 1.5;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.checkbox.size-md {
|
|
193
|
-
--checkbox-size: 18px;
|
|
194
|
-
--checkbox-icon-size: 12px;
|
|
195
|
-
--checkbox-state-layer-size: 40px;
|
|
196
|
-
}
|
|
197
|
-
.checkbox.size-md .icon {
|
|
198
|
-
stroke-width: 2;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.checkbox.size-lg {
|
|
202
|
-
--checkbox-size: 24px;
|
|
203
|
-
--checkbox-icon-size: 16px;
|
|
204
|
-
--checkbox-state-layer-size: 48px;
|
|
205
|
-
font-size: var(--font-size-body-large);
|
|
206
|
-
line-height: var(--line-height-body-large);
|
|
207
|
-
}
|
|
208
|
-
.checkbox.size-lg .icon {
|
|
209
|
-
stroke-width: 2.5;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.checkbox.readonly {
|
|
213
|
-
cursor: default;
|
|
214
|
-
}
|
|
215
|
-
.checkbox.readonly .label {
|
|
216
|
-
color: var(--color-on-surface);
|
|
217
|
-
}
|
|
218
|
-
.checkbox.readonly .outline {
|
|
219
|
-
border-color: var(--color-on-surface-variant);
|
|
220
|
-
}
|
|
221
|
-
.checkbox.readonly.state-checked .background, .checkbox.readonly.state-indeterminate .background {
|
|
222
|
-
background: var(--color-on-surface-variant);
|
|
223
|
-
}
|
|
224
|
-
.checkbox.readonly .state-layer {
|
|
225
|
-
display: none;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.checkbox.disabled {
|
|
229
|
-
cursor: not-allowed;
|
|
230
|
-
opacity: var(--checkbox-disabled-opacity);
|
|
231
|
-
}
|
|
232
|
-
.checkbox.disabled .label {
|
|
233
|
-
color: var(--color-on-surface);
|
|
234
|
-
}
|
|
235
|
-
.checkbox.disabled .outline {
|
|
236
|
-
border-color: var(--color-on-surface);
|
|
237
|
-
}
|
|
238
|
-
.checkbox.disabled.state-checked .background, .checkbox.disabled.state-indeterminate .background {
|
|
239
|
-
background: var(--color-on-surface);
|
|
240
|
-
}
|
|
241
|
-
.checkbox.disabled .state-layer {
|
|
242
|
-
display: none;
|
|
243
|
-
}`;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* @label Checkbox
|
|
247
|
-
* @tag wc-checkbox
|
|
248
|
-
* @rawTag checkbox
|
|
249
|
-
* @summary Captures boolean input with an optional indeterminate mode.
|
|
250
|
-
* @overview
|
|
251
|
-
* <p>Checkboxes allow users to select one or more items from a set. Checkboxes can turn an option on or off.</p>
|
|
252
|
-
* <p>Material Design 3 checkboxes feature a smooth animation and clear visual states for checked, unchecked, and indeterminate.</p>
|
|
253
|
-
* @cssprop --checkbox-size: Size of the checkbox container.
|
|
254
|
-
* @cssprop --checkbox-selected-color: Color of the checkbox when selected.
|
|
255
|
-
* @cssprop --checkbox-unselected-color: Color of the checkbox border when unselected.
|
|
256
|
-
* @cssprop --checkbox-checkmark-color: Color of the checkmark icon.
|
|
257
|
-
* @cssprop --checkbox-state-layer-size: Size of the state layer for touch target.
|
|
258
|
-
* @fires {CustomEvent} change - Dispatched when the checkbox value changes.
|
|
259
|
-
* @fires {CustomEvent} blur - Dispatched when the checkbox loses focus.
|
|
260
|
-
* @fires {CustomEvent} focus - Dispatched when the checkbox receives focus.
|
|
261
|
-
* @tags input, form
|
|
262
|
-
*
|
|
263
|
-
* @example
|
|
264
|
-
* ```html
|
|
265
|
-
* <wc-checkbox label="Accept terms"></wc-checkbox>
|
|
266
|
-
* ```
|
|
267
|
-
*/
|
|
268
|
-
class Checkbox extends i$1 {
|
|
269
|
-
constructor() {
|
|
270
|
-
super(...arguments);
|
|
271
|
-
/**
|
|
272
|
-
* The input field name.
|
|
273
|
-
*/
|
|
274
|
-
this.name = '';
|
|
275
|
-
/**
|
|
276
|
-
* The checkbox label.
|
|
277
|
-
*/
|
|
278
|
-
this.label = '';
|
|
279
|
-
/**
|
|
280
|
-
* The input field value (checked state).
|
|
281
|
-
*/
|
|
282
|
-
this.value = false;
|
|
283
|
-
/**
|
|
284
|
-
* If true, displays the checkbox in an indeterminate state.
|
|
285
|
-
*/
|
|
286
|
-
this.indeterminate = false;
|
|
287
|
-
/**
|
|
288
|
-
* If true, the checkbox has rounded corners. Defaults to `false`.
|
|
289
|
-
*/
|
|
290
|
-
this.rounded = false;
|
|
291
|
-
/**
|
|
292
|
-
* The checkbox size.
|
|
293
|
-
* Possible values are: `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`.
|
|
294
|
-
*/
|
|
295
|
-
this.size = 'md';
|
|
296
|
-
/**
|
|
297
|
-
* If true, required icon is shown. Defaults to `false`.
|
|
298
|
-
*/
|
|
299
|
-
this.required = false;
|
|
300
|
-
/**
|
|
301
|
-
* If true, the checkbox is readonly. Defaults to `false`.
|
|
302
|
-
*/
|
|
303
|
-
this.readonly = false;
|
|
304
|
-
/**
|
|
305
|
-
* If true, the user cannot interact with the checkbox. Defaults to `false`.
|
|
306
|
-
*/
|
|
307
|
-
this.disabled = false;
|
|
308
|
-
/**
|
|
309
|
-
* Configuration object for aria attributes.
|
|
310
|
-
*/
|
|
311
|
-
this.configAria = {};
|
|
312
|
-
this.hasFocus = false;
|
|
313
|
-
this.isActive = false;
|
|
314
|
-
this.slotHasContent = false;
|
|
315
|
-
this.windowMouseUp = () => {
|
|
316
|
-
if (this.isActive) {
|
|
317
|
-
this.isActive = false;
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
this.windowKeyUp = (evt) => {
|
|
321
|
-
if (this.isActive && evt.key === ' ') {
|
|
322
|
-
this.isActive = false;
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
this.mouseDownHandler = () => {
|
|
326
|
-
this.isActive = true;
|
|
327
|
-
};
|
|
328
|
-
this.keyDownHandler = (evt) => {
|
|
329
|
-
if (evt.key === ' ') {
|
|
330
|
-
evt.preventDefault();
|
|
331
|
-
this.isActive = true;
|
|
332
|
-
this.clickHandler(evt);
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
this.clickHandler = (ev) => {
|
|
336
|
-
if (!this.disabled && !this.readonly) {
|
|
337
|
-
this.value = !this.value;
|
|
338
|
-
this.indeterminate = false;
|
|
339
|
-
this.dispatchEvent(new CustomEvent('change', {
|
|
340
|
-
detail: { value: this.value, originalEvent: ev },
|
|
341
|
-
bubbles: true,
|
|
342
|
-
composed: true,
|
|
343
|
-
}));
|
|
344
|
-
this.containerElement?.focus();
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
this.blurHandler = (ev) => {
|
|
348
|
-
this.hasFocus = false;
|
|
349
|
-
this.dispatchEvent(new CustomEvent('blur', {
|
|
350
|
-
detail: ev,
|
|
351
|
-
bubbles: true,
|
|
352
|
-
composed: true,
|
|
353
|
-
}));
|
|
354
|
-
};
|
|
355
|
-
this.focusHandler = (ev) => {
|
|
356
|
-
this.hasFocus = true;
|
|
357
|
-
this.dispatchEvent(new CustomEvent('focus', {
|
|
358
|
-
detail: ev,
|
|
359
|
-
bubbles: true,
|
|
360
|
-
composed: true,
|
|
361
|
-
}));
|
|
362
|
-
};
|
|
363
|
-
this.handleKeyUp = (evt) => {
|
|
364
|
-
if (evt.key === 'Enter') {
|
|
365
|
-
this.clickHandler(evt);
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
connectedCallback() {
|
|
370
|
-
super.connectedCallback();
|
|
371
|
-
this.handleInitialAttributes();
|
|
372
|
-
window.addEventListener('mouseup', this.windowMouseUp);
|
|
373
|
-
window.addEventListener('keyup', this.windowKeyUp);
|
|
374
|
-
}
|
|
375
|
-
disconnectedCallback() {
|
|
376
|
-
super.disconnectedCallback();
|
|
377
|
-
window.removeEventListener('mouseup', this.windowMouseUp);
|
|
378
|
-
window.removeEventListener('keyup', this.windowKeyUp);
|
|
379
|
-
}
|
|
380
|
-
firstUpdated() {
|
|
381
|
-
this.slotHasContent = this.hasChildNodes();
|
|
382
|
-
}
|
|
383
|
-
handleInitialAttributes() {
|
|
384
|
-
if (this.hasAttribute('tabindex')) {
|
|
385
|
-
this.tabindex = this.getAttribute('tabindex') || undefined;
|
|
386
|
-
this.removeAttribute('tabindex');
|
|
387
|
-
}
|
|
388
|
-
Array.from(this.attributes).forEach(attr => {
|
|
389
|
-
if (attr.name.startsWith('aria-')) {
|
|
390
|
-
this.configAria[attr.name] = attr.value;
|
|
391
|
-
this.removeAttribute(attr.name);
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Sets focus on the checkbox.
|
|
397
|
-
*/
|
|
398
|
-
focus() {
|
|
399
|
-
this.containerElement?.focus();
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Removes focus from the checkbox.
|
|
403
|
-
*/
|
|
404
|
-
blur() {
|
|
405
|
-
this.containerElement?.blur();
|
|
406
|
-
}
|
|
407
|
-
render() {
|
|
408
|
-
const cssClasses = {
|
|
409
|
-
checkbox: true,
|
|
410
|
-
'state-checked': this.value,
|
|
411
|
-
'state-indeterminate': !this.value && this.indeterminate,
|
|
412
|
-
[`size-${this.size}`]: true,
|
|
413
|
-
'has-focus': this.hasFocus,
|
|
414
|
-
active: this.isActive,
|
|
415
|
-
disabled: this.disabled,
|
|
416
|
-
readonly: this.readonly,
|
|
417
|
-
required: this.required,
|
|
418
|
-
rounded: this.rounded,
|
|
419
|
-
'has-content': this.slotHasContent,
|
|
420
|
-
};
|
|
421
|
-
return b `
|
|
422
|
-
<label class=${e$1(cssClasses)}>
|
|
423
|
-
<div
|
|
424
|
-
class="container"
|
|
425
|
-
tabindex=${this.tabindex || 0}
|
|
426
|
-
@keyup=${this.handleKeyUp}
|
|
427
|
-
@mousedown=${this.mouseDownHandler}
|
|
428
|
-
@keydown=${this.keyDownHandler}
|
|
429
|
-
@blur=${this.blurHandler}
|
|
430
|
-
@focus=${this.focusHandler}
|
|
431
|
-
role="checkbox"
|
|
432
|
-
aria-disabled=${this.disabled}
|
|
433
|
-
aria-required=${this.required}
|
|
434
|
-
aria-checked=${this.value
|
|
435
|
-
? 'true'
|
|
436
|
-
: this.indeterminate
|
|
437
|
-
? 'mixed'
|
|
438
|
-
: 'false'}
|
|
439
|
-
${spread(this.configAria)}
|
|
440
|
-
>
|
|
441
|
-
<div class="state-layer"></div>
|
|
442
|
-
<div class="outline"></div>
|
|
443
|
-
<div class="background"></div>
|
|
444
|
-
<svg class="icon" viewBox="0 0 12 12">
|
|
445
|
-
${this.value
|
|
446
|
-
? w `
|
|
447
|
-
<path
|
|
448
|
-
class="checkmark"
|
|
449
|
-
d="M2 6L5 9L10 2"
|
|
450
|
-
/>
|
|
451
|
-
`
|
|
452
|
-
: this.indeterminate
|
|
453
|
-
? w `<rect
|
|
454
|
-
class="indeterminate"
|
|
455
|
-
x="2"
|
|
456
|
-
y="5"
|
|
457
|
-
width="8"
|
|
458
|
-
height="2"
|
|
459
|
-
/>`
|
|
460
|
-
: ''}
|
|
461
|
-
</svg>
|
|
462
|
-
</div>
|
|
463
|
-
|
|
464
|
-
<input
|
|
465
|
-
type="checkbox"
|
|
466
|
-
class="input-native"
|
|
467
|
-
name=${this.name}
|
|
468
|
-
.checked=${this.value}
|
|
469
|
-
.indeterminate=${this.indeterminate}
|
|
470
|
-
aria-hidden="true"
|
|
471
|
-
?required=${this.required}
|
|
472
|
-
tabindex="-1"
|
|
473
|
-
@click=${this.clickHandler}
|
|
474
|
-
/>
|
|
475
|
-
|
|
476
|
-
${this.label
|
|
477
|
-
? b `<div class="label">${this.label}</div>`
|
|
478
|
-
: b `<div class="label slot-container"><slot></slot></div>`}
|
|
479
|
-
</label>
|
|
480
|
-
`;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
Checkbox.styles = [css_248z];
|
|
484
|
-
__decorate([
|
|
485
|
-
n({ type: String })
|
|
486
|
-
], Checkbox.prototype, "name", void 0);
|
|
487
|
-
__decorate([
|
|
488
|
-
n({ type: String })
|
|
489
|
-
], Checkbox.prototype, "label", void 0);
|
|
490
|
-
__decorate([
|
|
491
|
-
n({ type: Boolean, reflect: true })
|
|
492
|
-
], Checkbox.prototype, "value", void 0);
|
|
493
|
-
__decorate([
|
|
494
|
-
n({ type: Boolean, reflect: true })
|
|
495
|
-
], Checkbox.prototype, "indeterminate", void 0);
|
|
496
|
-
__decorate([
|
|
497
|
-
n({ type: Boolean })
|
|
498
|
-
], Checkbox.prototype, "rounded", void 0);
|
|
499
|
-
__decorate([
|
|
500
|
-
n({ type: String })
|
|
501
|
-
], Checkbox.prototype, "size", void 0);
|
|
502
|
-
__decorate([
|
|
503
|
-
n({ type: Boolean, reflect: true })
|
|
504
|
-
], Checkbox.prototype, "required", void 0);
|
|
505
|
-
__decorate([
|
|
506
|
-
n({ type: Boolean, reflect: true })
|
|
507
|
-
], Checkbox.prototype, "readonly", void 0);
|
|
508
|
-
__decorate([
|
|
509
|
-
n({ type: Boolean, reflect: true })
|
|
510
|
-
], Checkbox.prototype, "disabled", void 0);
|
|
511
|
-
__decorate([
|
|
512
|
-
n({ type: Object })
|
|
513
|
-
], Checkbox.prototype, "configAria", void 0);
|
|
514
|
-
__decorate([
|
|
515
|
-
r()
|
|
516
|
-
], Checkbox.prototype, "hasFocus", void 0);
|
|
517
|
-
__decorate([
|
|
518
|
-
r()
|
|
519
|
-
], Checkbox.prototype, "isActive", void 0);
|
|
520
|
-
__decorate([
|
|
521
|
-
r()
|
|
522
|
-
], Checkbox.prototype, "slotHasContent", void 0);
|
|
523
|
-
__decorate([
|
|
524
|
-
e('.container')
|
|
525
|
-
], Checkbox.prototype, "containerElement", void 0);
|
|
526
|
-
__decorate([
|
|
527
|
-
e('.input-native')
|
|
528
|
-
], Checkbox.prototype, "nativeElement", void 0);
|
|
10
|
+
import './query-QBcUV-L_.js';
|
|
11
|
+
import './style-map-DcB52w-l.js';
|
|
12
|
+
import './observe-theme-change-pALI5fmV.js';
|
|
529
13
|
|
|
530
14
|
class LoaderUtils {
|
|
531
15
|
constructor(loaderConfig) {
|
|
@@ -711,6 +195,9 @@ const loaderConfig = {
|
|
|
711
195
|
'wc-chip': {
|
|
712
196
|
CustomElementClass: Chip,
|
|
713
197
|
},
|
|
198
|
+
'wc-card': {
|
|
199
|
+
CustomElementClass: Card,
|
|
200
|
+
},
|
|
714
201
|
'wc-tag': {
|
|
715
202
|
CustomElementClass: Tag,
|
|
716
203
|
},
|
|
@@ -801,12 +288,21 @@ const loaderConfig = {
|
|
|
801
288
|
'wc-tree-node': {
|
|
802
289
|
CustomElementClass: TreeView.Node,
|
|
803
290
|
},
|
|
291
|
+
'wc-snackbar': {
|
|
292
|
+
CustomElementClass: Snackbar,
|
|
293
|
+
},
|
|
804
294
|
'wc-chart-doughnut': {
|
|
805
295
|
importPath: `${distDirectory}/chart-doughnut.js`,
|
|
806
296
|
},
|
|
807
297
|
'wc-chart-pie': {
|
|
808
298
|
importPath: `${distDirectory}/chart-pie.js`,
|
|
809
299
|
},
|
|
300
|
+
'wc-chart-bar': {
|
|
301
|
+
importPath: `${distDirectory}/chart-bar.js`,
|
|
302
|
+
},
|
|
303
|
+
'wc-chart-stacked-bar': {
|
|
304
|
+
importPath: `${distDirectory}/chart-stacked-bar.js`,
|
|
305
|
+
},
|
|
810
306
|
},
|
|
811
307
|
};
|
|
812
308
|
new LoaderUtils(loaderConfig).start();
|