@redvars/peacock 3.10.1 → 3.11.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/dist/BaseInput-CV0pZgSb.js +58 -0
- package/dist/BaseInput-CV0pZgSb.js.map +1 -0
- package/dist/app-bar.js +16 -16
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/assets/theme.d.ts +66 -0
- package/dist/assets/theme.js +134 -0
- package/dist/assets/tokens.css +1 -1
- package/dist/assets/tokens.css.map +1 -1
- package/dist/base-progress-CLZTRveO.js +33 -0
- package/dist/base-progress-CLZTRveO.js.map +1 -0
- package/dist/bottom-sheet.js +1 -1
- package/dist/button-group.js +9 -7
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +225 -187
- package/dist/button.js.map +1 -1
- package/dist/{chart-bar-CapLbc2e.js → chart-bar-D5dGFJfK.js} +2 -2
- package/dist/{chart-bar-CapLbc2e.js.map → chart-bar-D5dGFJfK.js.map} +1 -1
- package/dist/chart-bar.js +1 -1
- package/dist/chart-stacked-bar.js +1 -1
- package/dist/checkbox.js +78 -53
- package/dist/checkbox.js.map +1 -1
- package/dist/chip-set.js +52 -0
- package/dist/chip-set.js.map +1 -0
- package/dist/chip.js +8 -6
- package/dist/chip.js.map +1 -1
- package/dist/circular-progress.js +177 -0
- package/dist/circular-progress.js.map +1 -0
- package/dist/code-editor.js +129 -72
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +2 -38
- package/dist/code-highlighter.js.map +1 -1
- package/dist/color-field.js +309 -0
- package/dist/color-field.js.map +1 -0
- package/dist/color-picker.js +26 -15
- package/dist/color-picker.js.map +1 -1
- package/dist/copy-to-clipboard-upGx-Ueo.js +39 -0
- package/dist/copy-to-clipboard-upGx-Ueo.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +1044 -382
- package/dist/custom-elements.json +8615 -4726
- package/dist/date-picker.js +241 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/{element-internals-2CMts_0M.js → delegate-py-Ets8N.js} +2 -43
- package/dist/delegate-py-Ets8N.js.map +1 -0
- package/dist/element-internals-QME0yEz4.js +43 -0
- package/dist/element-internals-QME0yEz4.js.map +1 -0
- package/dist/fab.js +51 -49
- package/dist/fab.js.map +1 -1
- package/dist/field.js +25 -0
- package/dist/field.js.map +1 -1
- package/dist/flow.js +5 -5
- package/dist/form-associated-Bhwwr6dT.js +162 -0
- package/dist/form-associated-Bhwwr6dT.js.map +1 -0
- package/dist/{form-associated-BXADnjOB.js → form-submitter-DPI4L6gj.js} +3 -159
- package/dist/form-submitter-DPI4L6gj.js.map +1 -0
- package/dist/html-editor.js +3 -1
- package/dist/html-editor.js.map +1 -1
- package/dist/icon-button.js +195 -156
- package/dist/icon-button.js.map +1 -1
- package/dist/image.js +2 -2
- package/dist/index.js +32 -8
- package/dist/index.js.map +1 -1
- package/dist/input.js +259 -0
- package/dist/input.js.map +1 -0
- package/dist/item.js +2 -1
- package/dist/item.js.map +1 -1
- package/dist/linear-progress.js +192 -0
- package/dist/linear-progress.js.map +1 -0
- package/dist/{list-AdO-PUq_.js → list-item.js} +12 -222
- package/dist/list-item.js.map +1 -0
- package/dist/list.js +225 -6
- package/dist/list.js.map +1 -1
- package/dist/loader-full.js +31 -8
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +52 -12
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +5 -3
- package/dist/markdown-editor.js.map +1 -1
- package/dist/menu-item.js +30 -30
- package/dist/navigation-bar-item.js +41 -0
- package/dist/navigation-bar-item.js.map +1 -0
- package/dist/navigation-bar.js +128 -0
- package/dist/navigation-bar.js.map +1 -0
- package/dist/navigation-drawer-item.js +236 -0
- package/dist/navigation-drawer-item.js.map +1 -0
- package/dist/navigation-drawer.js +293 -0
- package/dist/navigation-drawer.js.map +1 -0
- package/dist/navigation-rail.js +1 -1
- package/dist/number-field.js +280 -0
- package/dist/number-field.js.map +1 -0
- package/dist/pagination.js +1 -1
- package/dist/radio-group.js +209 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/radio.js +47 -37
- package/dist/radio.js.map +1 -1
- package/dist/segmented-button-group.js +12 -0
- package/dist/segmented-button-group.js.map +1 -1
- package/dist/segmented-button.js +10 -6
- package/dist/segmented-button.js.map +1 -1
- package/dist/select.js +653 -0
- package/dist/select.js.map +1 -0
- package/dist/side-sheet.js +1 -1
- package/dist/sidebar-menu-item.js +273 -0
- package/dist/sidebar-menu-item.js.map +1 -0
- package/dist/sidebar-menu.js +193 -0
- package/dist/sidebar-menu.js.map +1 -0
- package/dist/sidebar-sub-menu.js +301 -0
- package/dist/sidebar-sub-menu.js.map +1 -0
- package/dist/slider.js +76 -24
- package/dist/slider.js.map +1 -1
- package/dist/snackbar.js +3 -3
- package/dist/snackbar.js.map +1 -1
- package/dist/split-button.js +2 -2
- package/dist/src/__internal/utils/size.d.ts +9 -0
- package/dist/src/button/ButtonTypes.d.ts +1 -1
- package/dist/src/checkbox/checkbox.d.ts +28 -22
- package/dist/src/chip/chip/chip.d.ts +3 -0
- package/dist/src/chip/tag/tag.d.ts +5 -1
- package/dist/src/code-editor/code-editor.d.ts +37 -10
- package/dist/src/color-field/color-field.d.ts +55 -0
- package/dist/src/color-field/index.d.ts +1 -0
- package/dist/src/color-picker/color-picker.d.ts +1 -1
- package/dist/src/date-picker/date-picker.d.ts +0 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/input/BaseInput.d.ts +21 -3
- package/dist/src/input/input.d.ts +15 -7
- package/dist/src/navigation-bar/index.d.ts +2 -0
- package/dist/src/navigation-bar/navigation-bar-item.d.ts +23 -0
- package/dist/src/navigation-bar/navigation-bar.d.ts +44 -0
- package/dist/src/navigation-drawer/index.d.ts +2 -0
- package/dist/src/navigation-drawer/navigation-drawer-item.d.ts +48 -0
- package/dist/src/navigation-drawer/navigation-drawer.d.ts +70 -0
- package/dist/src/number-field/number-field.d.ts +0 -1
- package/dist/src/radio/index.d.ts +1 -0
- package/dist/src/radio/radio-group.d.ts +50 -0
- package/dist/src/radio/radio.d.ts +18 -18
- package/dist/src/segmented-button/segmented-button-group.d.ts +5 -0
- package/dist/src/segmented-button/segmented-button.d.ts +2 -1
- package/dist/src/select/select.d.ts +6 -0
- package/dist/src/slider/slider.d.ts +14 -5
- package/dist/src/switch/switch.d.ts +22 -26
- package/dist/src/tabs/tabs.d.ts +3 -0
- package/dist/src/textarea/textarea.d.ts +0 -1
- package/dist/src/time-picker/time-picker.d.ts +0 -1
- package/dist/src/toolbar/toolbar.d.ts +7 -4
- package/dist/src/url-field/url-field.d.ts +0 -1
- package/dist/svg.js +5 -5
- package/dist/switch.js +413 -0
- package/dist/switch.js.map +1 -0
- package/dist/tab.js +2 -1
- package/dist/tab.js.map +1 -1
- package/dist/tabs.js +10 -8
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +349 -0
- package/dist/tag.js.map +1 -0
- package/dist/test/code-editor.test.d.ts +1 -0
- package/dist/test/color-field.test.d.ts +1 -0
- package/dist/test/color-picker.test.d.ts +1 -0
- package/dist/test/field.test.d.ts +1 -0
- package/dist/test/form-controls.test.d.ts +1 -0
- package/dist/test/icon.test.d.ts +1 -1
- package/dist/test/input.test.d.ts +1 -0
- package/dist/test/navigation.test.d.ts +1 -0
- package/dist/test/segmented-button.test.d.ts +1 -0
- package/dist/test/slider.test.d.ts +1 -0
- package/dist/textarea.js +237 -0
- package/dist/textarea.js.map +1 -0
- package/dist/time-picker.js +241 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/toolbar.js +26 -9
- package/dist/toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/url-field.js +298 -0
- package/dist/url-field.js.map +1 -0
- package/package.json +29 -8
- package/readme.md +2 -2
- package/scss/tokens.css +175 -18
- package/src/__internal/utils/size.ts +23 -0
- package/src/app-bar/app-bar.scss +4 -16
- package/src/bottom-sheet/bottom-sheet.scss +1 -1
- package/src/button/ButtonTypes.ts +2 -0
- package/src/button/button/button-base.scss +84 -84
- package/src/button/button/button-colors.scss +14 -2
- package/src/button/button/button-layers.scss +71 -71
- package/src/button/button/button-shapes.scss +2 -2
- package/src/button/button/button-sizes.scss +35 -35
- package/src/button/button/button.scss +1 -1
- package/src/button/button/button.ts +1 -2
- package/src/button/button-group/button-group.scss +5 -5
- package/src/button/fab/fab-sizes.scss +15 -15
- package/src/button/fab/fab.scss +32 -32
- package/src/button/icon-button/icon-button-sizes.scss +7 -7
- package/src/chart-bar/chart-bar.scss +1 -1
- package/src/checkbox/checkbox.scss +7 -6
- package/src/checkbox/checkbox.ts +92 -40
- package/src/chip/chip/chip.ts +8 -5
- package/src/chip/chip-set/chip-set.ts +2 -0
- package/src/chip/tag/tag-colors.scss +1 -1
- package/src/chip/tag/tag-sizes.scss +9 -0
- package/src/chip/tag/tag.scss +1 -1
- package/src/chip/tag/tag.ts +20 -9
- package/src/code-editor/code-editor.scss +8 -3
- package/src/code-editor/code-editor.ts +148 -79
- package/src/code-highlighter/code-highlighter.scss +1 -1
- package/src/color-field/color-field.scss +48 -0
- package/src/color-field/color-field.ts +239 -0
- package/src/color-field/index.ts +1 -0
- package/src/color-picker/color-picker.scss +33 -15
- package/src/color-picker/color-picker.ts +2 -1
- package/src/date-picker/date-picker.ts +2 -3
- package/src/field/field.scss +31 -0
- package/src/flow/flow.scss +5 -5
- package/src/image/image.scss +2 -2
- package/src/index.ts +7 -3
- package/src/input/BaseInput.ts +54 -4
- package/src/input/input.ts +104 -79
- package/src/list/list-item.ts +2 -0
- package/src/loader.ts +28 -6
- package/src/markdown-editor/markdown-editor.scss +2 -2
- package/src/menu/menu-item/menu-item.scss +30 -30
- package/src/navigation-bar/index.ts +2 -0
- package/src/navigation-bar/navigation-bar-item.ts +25 -0
- package/src/navigation-bar/navigation-bar.scss +27 -0
- package/src/navigation-bar/navigation-bar.ts +96 -0
- package/src/navigation-drawer/index.ts +2 -0
- package/src/navigation-drawer/navigation-drawer-item.scss +82 -0
- package/src/navigation-drawer/navigation-drawer-item.ts +133 -0
- package/src/navigation-drawer/navigation-drawer.scss +99 -0
- package/src/navigation-drawer/navigation-drawer.ts +196 -0
- package/src/navigation-rail/navigation-rail.scss +1 -1
- package/src/number-field/number-field.ts +2 -3
- package/src/pagination/pagination.scss +1 -1
- package/src/progress/circular-progress/circular-progress.ts +2 -0
- package/src/progress/linear-progress/linear-progress.ts +2 -0
- package/src/radio/index.ts +1 -0
- package/src/radio/radio-group.scss +39 -0
- package/src/radio/radio-group.ts +167 -0
- package/src/radio/radio.ts +74 -31
- package/src/segmented-button/segmented-button-group.ts +12 -0
- package/src/segmented-button/segmented-button.ts +12 -6
- package/src/select/select.ts +21 -1
- package/src/side-sheet/side-sheet.scss +1 -1
- package/src/sidebar-menu/sidebar-menu-item.scss +1 -1
- package/src/sidebar-menu/sidebar-menu-item.ts +2 -0
- package/src/sidebar-menu/sidebar-menu.ts +2 -0
- package/src/sidebar-menu/sidebar-sub-menu.scss +1 -1
- package/src/sidebar-menu/sidebar-sub-menu.ts +2 -0
- package/src/slider/slider.scss +3 -3
- package/src/slider/slider.ts +119 -31
- package/src/snackbar/snackbar.ts +3 -3
- package/src/split-button/split-button-colors.scss +2 -2
- package/src/svg/svg.scss +5 -5
- package/src/switch/switch.scss +0 -1
- package/src/switch/switch.ts +82 -47
- package/src/tabs/tab.scss +2 -1
- package/src/tabs/tabs.ts +14 -8
- package/src/textarea/textarea.ts +2 -3
- package/src/time-picker/time-picker.ts +2 -3
- package/src/toolbar/toolbar.scss +4 -4
- package/src/toolbar/toolbar.ts +12 -5
- package/src/url-field/url-field.ts +2 -3
- package/dist/BaseInput-CU1zZYKc.js +0 -27
- package/dist/BaseInput-CU1zZYKc.js.map +0 -1
- package/dist/brand-loader.js +0 -358
- package/dist/brand-loader.js.map +0 -1
- package/dist/element-internals-2CMts_0M.js.map +0 -1
- package/dist/form-associated-BXADnjOB.js.map +0 -1
- package/dist/list-AdO-PUq_.js.map +0 -1
- package/dist/select-DkyRqUTI.js +0 -3955
- package/dist/select-DkyRqUTI.js.map +0 -1
- package/dist/src/brand-loader/brand-loader.d.ts +0 -33
- package/dist/src/brand-loader/index.d.ts +0 -2
- package/src/brand-loader/brand-loader.scss +0 -270
- package/src/brand-loader/brand-loader.ts +0 -115
- package/src/brand-loader/index.ts +0 -2
- /package/dist/test/{brand-loader.test.d.ts → button.test.d.ts} +0 -0
|
@@ -3,7 +3,19 @@
|
|
|
3
3
|
--_thumb-size: 16px;
|
|
4
4
|
--_track-height: 12px;
|
|
5
5
|
--_preview-size: 40px;
|
|
6
|
-
--_radius:
|
|
6
|
+
--_radius: var(--shape-corner-small);
|
|
7
|
+
// Contrast ring and checkerboard work on any picked color, so they stay
|
|
8
|
+
// black/white rather than following the theme roles.
|
|
9
|
+
--_ring-color: var(--color-white);
|
|
10
|
+
--_ring-shadow:
|
|
11
|
+
0 0 0 1px color-mix(in srgb, var(--color-shadow) 30%, transparent),
|
|
12
|
+
0 2px 4px color-mix(in srgb, var(--color-shadow) 30%, transparent);
|
|
13
|
+
--_checker:
|
|
14
|
+
repeating-conic-gradient(
|
|
15
|
+
var(--color-neutral-80) 0% 25%,
|
|
16
|
+
var(--color-white) 0% 50%
|
|
17
|
+
)
|
|
18
|
+
0 0 / 8px 8px;
|
|
7
19
|
|
|
8
20
|
display: inline-block;
|
|
9
21
|
width: var(--color-picker-width, 240px);
|
|
@@ -30,8 +42,8 @@
|
|
|
30
42
|
border-radius: var(--_radius);
|
|
31
43
|
// White-to-hue horizontal gradient, black overlay going downward
|
|
32
44
|
background:
|
|
33
|
-
linear-gradient(to bottom, transparent 0%,
|
|
34
|
-
linear-gradient(to right,
|
|
45
|
+
linear-gradient(to bottom, transparent 0%, var(--color-black) 100%),
|
|
46
|
+
linear-gradient(to right, var(--color-white) 0%, var(--hue-color) 100%);
|
|
35
47
|
cursor: crosshair;
|
|
36
48
|
user-select: none;
|
|
37
49
|
overflow: hidden;
|
|
@@ -42,14 +54,16 @@
|
|
|
42
54
|
width: var(--_thumb-size);
|
|
43
55
|
height: var(--_thumb-size);
|
|
44
56
|
border-radius: 50%;
|
|
45
|
-
border: 2px solid
|
|
46
|
-
box-shadow:
|
|
57
|
+
border: 2px solid var(--_ring-color);
|
|
58
|
+
box-shadow: var(--_ring-shadow);
|
|
47
59
|
transform: translate(-50%, -50%);
|
|
48
60
|
outline: none;
|
|
49
61
|
cursor: crosshair;
|
|
50
62
|
|
|
51
63
|
&:focus-visible {
|
|
52
|
-
box-shadow:
|
|
64
|
+
box-shadow:
|
|
65
|
+
0 0 0 2px var(--_ring-color),
|
|
66
|
+
0 0 0 4px var(--color-primary);
|
|
53
67
|
}
|
|
54
68
|
}
|
|
55
69
|
|
|
@@ -68,8 +82,8 @@
|
|
|
68
82
|
flex-shrink: 0;
|
|
69
83
|
overflow: hidden;
|
|
70
84
|
// Checkerboard backdrop (visible through transparent colors)
|
|
71
|
-
background:
|
|
72
|
-
box-shadow: inset 0 0 0 1px
|
|
85
|
+
background: var(--_checker);
|
|
86
|
+
box-shadow: inset 0 0 0 1px var(--color-outline-variant);
|
|
73
87
|
}
|
|
74
88
|
|
|
75
89
|
.preview-inner {
|
|
@@ -96,6 +110,8 @@
|
|
|
96
110
|
}
|
|
97
111
|
|
|
98
112
|
.hue-track {
|
|
113
|
+
// The hue spectrum is literal color math, not a theme color.
|
|
114
|
+
// stylelint-disable-next-line peacock/no-raw-color
|
|
99
115
|
background: linear-gradient(
|
|
100
116
|
to right,
|
|
101
117
|
hsl(0, 100%, 50%),
|
|
@@ -112,7 +128,7 @@
|
|
|
112
128
|
// Color gradient over checkerboard
|
|
113
129
|
background:
|
|
114
130
|
linear-gradient(to right, transparent, var(--current-color, currentColor)),
|
|
115
|
-
|
|
131
|
+
var(--_checker);
|
|
116
132
|
}
|
|
117
133
|
|
|
118
134
|
// ── Slider thumb ──────────────────────────────────────────────────────────────
|
|
@@ -123,21 +139,23 @@
|
|
|
123
139
|
width: var(--_thumb-size);
|
|
124
140
|
height: var(--_thumb-size);
|
|
125
141
|
border-radius: 50%;
|
|
126
|
-
background:
|
|
127
|
-
border: 2px solid
|
|
128
|
-
box-shadow:
|
|
142
|
+
background: var(--_ring-color);
|
|
143
|
+
border: 2px solid color-mix(in srgb, var(--color-shadow) 15%, transparent);
|
|
144
|
+
box-shadow: var(--elevation-level1);
|
|
129
145
|
transform: translate(-50%, -50%);
|
|
130
146
|
cursor: grab;
|
|
131
147
|
outline: none;
|
|
132
148
|
transition: box-shadow 0.15s ease;
|
|
133
149
|
|
|
134
150
|
&:focus-visible {
|
|
135
|
-
box-shadow:
|
|
151
|
+
box-shadow:
|
|
152
|
+
0 0 0 2px var(--_ring-color),
|
|
153
|
+
0 0 0 4px var(--color-primary);
|
|
136
154
|
}
|
|
137
155
|
|
|
138
156
|
&:active {
|
|
139
157
|
cursor: grabbing;
|
|
140
|
-
box-shadow:
|
|
158
|
+
box-shadow: var(--elevation-level3);
|
|
141
159
|
}
|
|
142
160
|
}
|
|
143
161
|
|
|
@@ -181,7 +199,7 @@
|
|
|
181
199
|
background: transparent;
|
|
182
200
|
outline: none;
|
|
183
201
|
font-size: 13px;
|
|
184
|
-
font-family: var(--
|
|
202
|
+
font-family: var(--font-family-monospace, monospace);
|
|
185
203
|
color: var(--color-on-surface, #333);
|
|
186
204
|
}
|
|
187
205
|
|
|
@@ -153,7 +153,8 @@ export class ColorPicker extends LitElement {
|
|
|
153
153
|
this._lastEmittedValue = this.value;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
updated
|
|
156
|
+
// willUpdate, not updated: syncing the HSV state here lands in the same render.
|
|
157
|
+
willUpdate(changed: Map<PropertyKey, unknown>) {
|
|
157
158
|
if (changed.has('value') && this.value !== this._lastEmittedValue) {
|
|
158
159
|
this._syncFromValue();
|
|
159
160
|
}
|
|
@@ -4,6 +4,7 @@ import { property, query, state } from 'lit/decorators.js';
|
|
|
4
4
|
import { redispatchEvent } from '@/__internal/utils/dispatch-event-utils.js';
|
|
5
5
|
import { spread } from '@/__internal/directive/spread.js';
|
|
6
6
|
|
|
7
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
7
8
|
import BaseInput from '../input/BaseInput.js';
|
|
8
9
|
import styles from './date-picker.scss';
|
|
9
10
|
|
|
@@ -19,15 +20,13 @@ import styles from './date-picker.scss';
|
|
|
19
20
|
* <wc-date-picker label="Date" placeholder="Select a date"></wc-date-picker>
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
23
|
+
@IndividualComponent
|
|
22
24
|
export class DatePicker extends BaseInput {
|
|
23
25
|
static styles = [styles];
|
|
24
26
|
|
|
25
27
|
@property({ type: String })
|
|
26
28
|
value = '';
|
|
27
29
|
|
|
28
|
-
@property({ type: String })
|
|
29
|
-
name: string = '';
|
|
30
|
-
|
|
31
30
|
@property({ type: String }) placeholder = '';
|
|
32
31
|
|
|
33
32
|
@property({ type: String }) label = '';
|
package/src/field/field.scss
CHANGED
|
@@ -169,6 +169,37 @@
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
// M3 filled text field: tinted container, square bottom corners and an
|
|
173
|
+
// active indicator along the bottom edge instead of a full outline.
|
|
174
|
+
&.variant-filled {
|
|
175
|
+
--_container-color: var(
|
|
176
|
+
--field-container-color,
|
|
177
|
+
var(--color-surface-container-highest)
|
|
178
|
+
);
|
|
179
|
+
--_outline-color: var(
|
|
180
|
+
--field-active-indicator-color,
|
|
181
|
+
var(--color-on-surface-variant)
|
|
182
|
+
);
|
|
183
|
+
--_outline-width: 0.0625rem;
|
|
184
|
+
--_container-shape-end-start: var(
|
|
185
|
+
--field-container-shape-end-start,
|
|
186
|
+
var(--shape-corner-none)
|
|
187
|
+
);
|
|
188
|
+
--_container-shape-end-end: var(
|
|
189
|
+
--field-container-shape-end-end,
|
|
190
|
+
var(--shape-corner-none)
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
.field-body .outline {
|
|
194
|
+
border-width: 0 0 var(--_outline-width);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&:not(.disabled, .readonly, .focused, .has-error, .has-warning)
|
|
198
|
+
.field-body:hover {
|
|
199
|
+
--_outline-color: var(--color-on-surface);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
172
203
|
&.focused {
|
|
173
204
|
--_outline-color: var(--color-primary);
|
|
174
205
|
--_outline-width: 0.125rem;
|
package/src/flow/flow.scss
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
--flow-hover-color: var(--color-primary, #005FAF);
|
|
14
14
|
--flow-node-bg: var(--color-surface-container-low, #f8f9fc);
|
|
15
15
|
--flow-node-border: var(--color-outline-variant, #c5c6cb);
|
|
16
|
-
--flow-node-shadow:
|
|
17
|
-
--flow-node-active-shadow:
|
|
16
|
+
--flow-node-shadow: var(--elevation-level1);
|
|
17
|
+
--flow-node-active-shadow: var(--elevation-level3);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.flow-container {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
height: 100%;
|
|
24
24
|
background: var(--flow-background);
|
|
25
25
|
border: 1px solid var(--color-outline-variant);
|
|
26
|
-
border-radius:
|
|
26
|
+
border-radius: var(--shape-corner-large);
|
|
27
27
|
overflow: auto;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
background: var(--flow-node-bg);
|
|
87
87
|
border: 1px solid var(--flow-node-border);
|
|
88
88
|
box-shadow: var(--flow-node-shadow);
|
|
89
|
-
border-radius:
|
|
89
|
+
border-radius: var(--shape-corner-medium);
|
|
90
90
|
min-width: 150px;
|
|
91
91
|
min-height: 70px;
|
|
92
92
|
cursor: grab;
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
transform: scale(1.4);
|
|
146
146
|
background-color: var(--flow-hover-color);
|
|
147
147
|
border-color: var(--flow-hover-color);
|
|
148
|
-
box-shadow: 0 0 8px
|
|
148
|
+
box-shadow: 0 0 8px color-mix(in srgb, var(--flow-hover-color) 50%, transparent);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
&:active {
|
package/src/image/image.scss
CHANGED
|
@@ -24,7 +24,7 @@ img.clickable {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.placeholder {
|
|
27
|
-
background:
|
|
27
|
+
background: var(--color-surface-container-highest);
|
|
28
28
|
min-width: 100px;
|
|
29
29
|
min-height: 100px;
|
|
30
30
|
display: block;
|
|
@@ -56,6 +56,6 @@ img.clickable {
|
|
|
56
56
|
max-height: 90vh;
|
|
57
57
|
object-fit: contain;
|
|
58
58
|
box-shadow: 0 8px 40px color-mix(in srgb, var(--color-shadow), transparent 40%);
|
|
59
|
-
border-radius:
|
|
59
|
+
border-radius: var(--shape-corner-extra-small);
|
|
60
60
|
cursor: auto;
|
|
61
61
|
}
|
package/src/index.ts
CHANGED
|
@@ -33,8 +33,6 @@ export { Textarea } from './textarea/index.js';
|
|
|
33
33
|
export { Switch } from './switch/index.js';
|
|
34
34
|
export { Checkbox } from './checkbox/index.js';
|
|
35
35
|
export { Spinner } from './spinner/index.js';
|
|
36
|
-
export { BrandLoader } from './brand-loader/index.js';
|
|
37
|
-
export type { BrandLoaderVariant } from './brand-loader/index.js';
|
|
38
36
|
export { Container } from './container/index.js';
|
|
39
37
|
|
|
40
38
|
export { NumberCounter } from './number-counter/index.js';
|
|
@@ -56,6 +54,7 @@ export { Svg } from './svg/index.js';
|
|
|
56
54
|
export { Tab, TabGroup, TabPanel, Tabs } from './tabs/index.js';
|
|
57
55
|
export { Slider } from './slider/index.js';
|
|
58
56
|
export { ColorPicker } from './color-picker/index.js';
|
|
57
|
+
export { ColorField } from './color-field/index.js';
|
|
59
58
|
export { ChartDoughnut } from './chart-doughnut/index.js';
|
|
60
59
|
export { ChartPie } from './chart-pie/index.js';
|
|
61
60
|
export { ChartBar, ChartStackedBar } from './chart-bar/index.js';
|
|
@@ -71,7 +70,7 @@ export { Alert } from './alert/index.js';
|
|
|
71
70
|
export { Notification } from './notification/index.js';
|
|
72
71
|
export { NotificationManager } from './notification-manager/index.js';
|
|
73
72
|
export { Snackbar } from './snackbar/index.js';
|
|
74
|
-
export { Radio } from './radio/index.js';
|
|
73
|
+
export { Radio, RadioGroup } from './radio/index.js';
|
|
75
74
|
export { Modal } from './modal/index.js';
|
|
76
75
|
export { BottomSheet } from './bottom-sheet/index.js';
|
|
77
76
|
export { SideSheet } from './side-sheet/index.js';
|
|
@@ -82,6 +81,11 @@ export { Search } from './search/index.js';
|
|
|
82
81
|
export { Toolbar } from './toolbar/index.js';
|
|
83
82
|
export { AppBar } from './app-bar/index.js';
|
|
84
83
|
export { NavigationRail, NavigationRailItem } from './navigation-rail/index.js';
|
|
84
|
+
export { NavigationBar, NavigationBarItem } from './navigation-bar/index.js';
|
|
85
|
+
export {
|
|
86
|
+
NavigationDrawer,
|
|
87
|
+
NavigationDrawerItem,
|
|
88
|
+
} from './navigation-drawer/index.js';
|
|
85
89
|
export {
|
|
86
90
|
Calendar,
|
|
87
91
|
CalendarColumnView,
|
package/src/input/BaseInput.ts
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { mixinElementInternals } from '@/__internal/mixins/element-internals.js';
|
|
5
|
+
import {
|
|
6
|
+
type FormRestoreState,
|
|
7
|
+
type FormValue,
|
|
8
|
+
getFormValue,
|
|
9
|
+
mixinFormAssociated,
|
|
10
|
+
} from '@/__internal/mixins/form-associated.js';
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Base class for Peacock's text-like form controls.
|
|
14
|
+
*
|
|
15
|
+
* It is form-associated: `value` is submitted with the surrounding `<form>`, `form.reset()`
|
|
16
|
+
* restores the value the control started with, and a disabled `<fieldset>` disables it.
|
|
17
|
+
* `name` and `disabled` come from `mixinFormAssociated`; they are backed by attributes, so
|
|
18
|
+
* subclasses must not redeclare them.
|
|
19
|
+
*/
|
|
20
|
+
export default abstract class BaseInput extends mixinFormAssociated(
|
|
21
|
+
mixinElementInternals(LitElement),
|
|
22
|
+
) {
|
|
23
|
+
// ── Properties ───────────────────────────────────────────────────────────
|
|
24
|
+
|
|
25
|
+
/** Each control declares its own `value` (a property, or an accessor such as Switch's). */
|
|
26
|
+
abstract value?: any;
|
|
9
27
|
|
|
10
28
|
@property({ type: Boolean, reflect: true })
|
|
11
29
|
readonly: boolean = false;
|
|
@@ -15,4 +33,36 @@ export default abstract class BaseInput extends LitElement {
|
|
|
15
33
|
|
|
16
34
|
@property({ type: Boolean, reflect: true })
|
|
17
35
|
skeleton = false;
|
|
36
|
+
|
|
37
|
+
// ── Private fields ───────────────────────────────────────────────────────
|
|
38
|
+
|
|
39
|
+
/** The value the control had when it was first connected; `form.reset()` returns to it. */
|
|
40
|
+
private __defaultValue: unknown = undefined;
|
|
41
|
+
|
|
42
|
+
private __defaultValueCaptured = false;
|
|
43
|
+
|
|
44
|
+
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
45
|
+
|
|
46
|
+
override connectedCallback() {
|
|
47
|
+
super.connectedCallback();
|
|
48
|
+
if (!this.__defaultValueCaptured) {
|
|
49
|
+
this.__defaultValue = this.value;
|
|
50
|
+
this.__defaultValueCaptured = true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ── Form association ─────────────────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
override [getFormValue](): FormValue | null {
|
|
57
|
+
if (this.value === undefined || this.value === null) return null;
|
|
58
|
+
return String(this.value);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
formResetCallback() {
|
|
62
|
+
this.value = this.__defaultValue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
formStateRestoreCallback(state: FormRestoreState | null) {
|
|
66
|
+
this.value = typeof state === 'string' ? state : this.__defaultValue;
|
|
67
|
+
}
|
|
18
68
|
}
|
package/src/input/input.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { html, nothing } from
|
|
2
|
-
import { property, query, state } from
|
|
1
|
+
import { html, nothing } from 'lit';
|
|
2
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
3
3
|
|
|
4
|
-
import { redispatchEvent } from
|
|
5
|
-
import { spread } from
|
|
4
|
+
import { redispatchEvent } from '@/__internal/utils/dispatch-event-utils.js';
|
|
5
|
+
import { spread } from '@/__internal/directive/spread.js';
|
|
6
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
6
7
|
|
|
7
|
-
import BaseInput from
|
|
8
|
-
import styles from
|
|
8
|
+
import BaseInput from './BaseInput.js';
|
|
9
|
+
import styles from './input.scss';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* @label Input
|
|
@@ -13,62 +14,74 @@ import styles from "./input.scss";
|
|
|
13
14
|
* @rawTag input
|
|
14
15
|
*
|
|
15
16
|
* @summary The Input component is used to capture user input.
|
|
17
|
+
* @overview
|
|
18
|
+
* <p>Input is form-associated: inside a <code><form></code> its <code>value</code> is submitted
|
|
19
|
+
* under its <code>name</code>, and <code>form.reset()</code> restores the starting value.</p>
|
|
20
|
+
*
|
|
21
|
+
* @fires {Event} input - Re-fired from the native input as the user types.
|
|
22
|
+
* @fires {Event} change - Re-fired from the native input when the value is committed.
|
|
16
23
|
*
|
|
17
24
|
* @example
|
|
18
25
|
* ```html
|
|
19
26
|
* <wc-input label="Name" required placeholder="Enter your name"></wc-input>
|
|
20
27
|
* ```
|
|
28
|
+
* @tags input, form
|
|
21
29
|
*/
|
|
30
|
+
@IndividualComponent
|
|
22
31
|
export class Input extends BaseInput {
|
|
32
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
33
|
+
|
|
23
34
|
static styles = [styles];
|
|
24
35
|
|
|
25
|
-
|
|
26
|
-
value = "";
|
|
36
|
+
// ── Properties ───────────────────────────────────────────────────────────
|
|
27
37
|
|
|
28
38
|
@property({ type: String })
|
|
29
|
-
|
|
39
|
+
value = '';
|
|
30
40
|
|
|
31
41
|
@property({ type: String })
|
|
32
|
-
placeholder =
|
|
42
|
+
placeholder = '';
|
|
33
43
|
|
|
34
44
|
@property({ type: String })
|
|
35
|
-
label =
|
|
45
|
+
label = '';
|
|
36
46
|
|
|
37
47
|
@property({ type: Boolean, reflect: true })
|
|
38
48
|
inline = false;
|
|
39
49
|
|
|
50
|
+
/** Field size. Possible values are `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`. */
|
|
40
51
|
@property({ type: String, reflect: true })
|
|
41
|
-
size:
|
|
52
|
+
size: 'sm' | 'md' | 'lg' = 'md';
|
|
42
53
|
|
|
43
54
|
@property({ type: String })
|
|
44
|
-
type:
|
|
55
|
+
type: 'text' | 'password' | 'email' | 'tel' = 'text';
|
|
45
56
|
|
|
46
57
|
@property({ type: String })
|
|
47
|
-
autocomplete:
|
|
58
|
+
autocomplete: 'on' | 'off' = 'off';
|
|
48
59
|
|
|
49
60
|
@property({ type: Object })
|
|
50
61
|
configAria: Record<string, string> = {};
|
|
51
62
|
|
|
52
63
|
@property({ type: String })
|
|
53
|
-
variant:
|
|
64
|
+
variant: 'filled' | 'outlined' | 'default' = 'default';
|
|
54
65
|
|
|
55
66
|
/**
|
|
56
67
|
* Helper text to display below the input.
|
|
57
68
|
*/
|
|
58
|
-
@property({ type: String, attribute:
|
|
59
|
-
helperText: string =
|
|
69
|
+
@property({ type: String, attribute: 'helper-text' })
|
|
70
|
+
helperText: string = '';
|
|
60
71
|
|
|
61
72
|
@property({ type: Boolean })
|
|
62
73
|
error: boolean = false;
|
|
63
74
|
|
|
64
|
-
@property({ type: String, attribute:
|
|
65
|
-
errorText: string =
|
|
75
|
+
@property({ type: String, attribute: 'error-text' })
|
|
76
|
+
errorText: string = '';
|
|
66
77
|
|
|
67
78
|
@property({ type: Boolean })
|
|
68
79
|
warning: boolean = false;
|
|
69
80
|
|
|
70
|
-
@property({ type: String, attribute:
|
|
71
|
-
warningText: string =
|
|
81
|
+
@property({ type: String, attribute: 'warning-text' })
|
|
82
|
+
warningText: string = '';
|
|
83
|
+
|
|
84
|
+
// ── State ────────────────────────────────────────────────────────────────
|
|
72
85
|
|
|
73
86
|
@state()
|
|
74
87
|
private focused = false;
|
|
@@ -83,26 +96,34 @@ export class Input extends BaseInput {
|
|
|
83
96
|
@state()
|
|
84
97
|
private dirty = false;
|
|
85
98
|
|
|
86
|
-
|
|
99
|
+
// ── Queries ──────────────────────────────────────────────────────────────
|
|
100
|
+
|
|
101
|
+
@query('.input-element')
|
|
87
102
|
private inputElement?: HTMLInputElement;
|
|
88
103
|
|
|
104
|
+
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
105
|
+
|
|
106
|
+
override connectedCallback() {
|
|
107
|
+
super.connectedCallback();
|
|
108
|
+
this.handleInitialAttributes();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ── Public methods ───────────────────────────────────────────────────────
|
|
112
|
+
|
|
89
113
|
override async focus() {
|
|
90
114
|
await Promise.all([
|
|
91
|
-
customElements.whenDefined(
|
|
92
|
-
customElements.whenDefined(
|
|
115
|
+
customElements.whenDefined('wc-input'),
|
|
116
|
+
customElements.whenDefined('wc-field'),
|
|
93
117
|
]);
|
|
94
118
|
await this.updateComplete;
|
|
95
119
|
this.inputElement?.focus();
|
|
96
120
|
}
|
|
97
121
|
|
|
98
|
-
|
|
99
|
-
super.connectedCallback();
|
|
100
|
-
this.handleInitialAttributes();
|
|
101
|
-
}
|
|
122
|
+
// ── Private methods ──────────────────────────────────────────────────────
|
|
102
123
|
|
|
103
124
|
private handleInitialAttributes() {
|
|
104
|
-
Array.from(this.attributes).forEach(
|
|
105
|
-
if (attr.name.startsWith(
|
|
125
|
+
Array.from(this.attributes).forEach(attr => {
|
|
126
|
+
if (attr.name.startsWith('aria-')) {
|
|
106
127
|
this.configAria[attr.name] = attr.value;
|
|
107
128
|
this.removeAttribute(attr.name);
|
|
108
129
|
}
|
|
@@ -115,76 +136,80 @@ export class Input extends BaseInput {
|
|
|
115
136
|
}
|
|
116
137
|
|
|
117
138
|
private __handleFocusChange = (event: FocusEvent) => {
|
|
118
|
-
this.focused = event.type ===
|
|
139
|
+
this.focused = event.type === 'focus';
|
|
119
140
|
};
|
|
120
141
|
|
|
121
142
|
private __redispatchEvent(event: Event) {
|
|
122
143
|
redispatchEvent(this, event);
|
|
123
144
|
}
|
|
124
145
|
|
|
146
|
+
// ── Render helpers ───────────────────────────────────────────────────────
|
|
147
|
+
|
|
148
|
+
private __renderPasswordToggle() {
|
|
149
|
+
if (this.type !== 'password') return nothing;
|
|
150
|
+
return html`
|
|
151
|
+
<wc-icon-button
|
|
152
|
+
class="password-toggle"
|
|
153
|
+
variant="text"
|
|
154
|
+
slot="field-end"
|
|
155
|
+
tooltip=${this.passwordVisible ? 'Hide password' : 'Show password'}
|
|
156
|
+
@click=${() => {
|
|
157
|
+
this.passwordVisible = !this.passwordVisible;
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
<wc-icon
|
|
161
|
+
name=${this.passwordVisible ? 'visibility_off' : 'visibility'}
|
|
162
|
+
></wc-icon>
|
|
163
|
+
</wc-icon-button>
|
|
164
|
+
`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// ── Render ───────────────────────────────────────────────────────────────
|
|
168
|
+
|
|
125
169
|
render() {
|
|
126
|
-
const displayType =
|
|
127
|
-
?
|
|
128
|
-
: this.type;
|
|
170
|
+
const displayType =
|
|
171
|
+
this.type === 'password' && this.passwordVisible ? 'text' : this.type;
|
|
129
172
|
|
|
130
173
|
return html`
|
|
131
174
|
<wc-field
|
|
132
|
-
?required
|
|
133
|
-
?disabled
|
|
134
|
-
?readonly
|
|
135
|
-
?skeleton
|
|
136
|
-
helper-text
|
|
137
|
-
?error
|
|
138
|
-
error-text
|
|
139
|
-
?warning
|
|
140
|
-
variant
|
|
141
|
-
?populated
|
|
142
|
-
warning-text
|
|
143
|
-
label
|
|
144
|
-
?focused
|
|
145
|
-
.host
|
|
175
|
+
?required=${this.required}
|
|
176
|
+
?disabled=${this.disabled}
|
|
177
|
+
?readonly=${this.readonly}
|
|
178
|
+
?skeleton=${this.skeleton}
|
|
179
|
+
helper-text=${this.helperText}
|
|
180
|
+
?error=${this.error}
|
|
181
|
+
error-text=${this.errorText}
|
|
182
|
+
?warning=${this.warning}
|
|
183
|
+
variant=${this.variant}
|
|
184
|
+
?populated=${!!this.value}
|
|
185
|
+
warning-text=${this.warningText}
|
|
186
|
+
label=${this.label}
|
|
187
|
+
?focused=${this.focused}
|
|
188
|
+
.host=${this}
|
|
146
189
|
class="input-wrapper"
|
|
147
190
|
>
|
|
148
191
|
<slot name="start" slot="field-start"></slot>
|
|
149
192
|
|
|
150
193
|
<input
|
|
151
194
|
class="input input-element"
|
|
152
|
-
name
|
|
153
|
-
type
|
|
154
|
-
placeholder
|
|
155
|
-
autocomplete
|
|
156
|
-
.value
|
|
157
|
-
?readonly
|
|
158
|
-
?required
|
|
159
|
-
?disabled
|
|
160
|
-
@input
|
|
161
|
-
@change
|
|
162
|
-
@focus
|
|
163
|
-
@blur
|
|
195
|
+
name=${this.name}
|
|
196
|
+
type=${displayType}
|
|
197
|
+
placeholder=${this.placeholder}
|
|
198
|
+
autocomplete=${this.autocomplete}
|
|
199
|
+
.value=${this.value}
|
|
200
|
+
?readonly=${this.readonly}
|
|
201
|
+
?required=${this.required}
|
|
202
|
+
?disabled=${this.disabled}
|
|
203
|
+
@input=${this.__handleInput}
|
|
204
|
+
@change=${this.__redispatchEvent}
|
|
205
|
+
@focus=${this.__handleFocusChange}
|
|
206
|
+
@blur=${this.__handleFocusChange}
|
|
164
207
|
${spread(this.configAria)}
|
|
165
208
|
/>
|
|
166
209
|
|
|
167
210
|
<slot name="end" slot="field-end"></slot>
|
|
168
211
|
|
|
169
|
-
${this.
|
|
170
|
-
? html`
|
|
171
|
-
<wc-icon-button
|
|
172
|
-
class="password-toggle"
|
|
173
|
-
variant="text"
|
|
174
|
-
slot="field-end"
|
|
175
|
-
tooltip="${this.passwordVisible
|
|
176
|
-
? "Hide password"
|
|
177
|
-
: "Show password"}"
|
|
178
|
-
@click="${() => {
|
|
179
|
-
this.passwordVisible = !this.passwordVisible;
|
|
180
|
-
}}"
|
|
181
|
-
>
|
|
182
|
-
<wc-icon
|
|
183
|
-
name="${this.passwordVisible ? "visibility_off" : "visibility"}"
|
|
184
|
-
></wc-icon>
|
|
185
|
-
</wc-icon-button>
|
|
186
|
-
`
|
|
187
|
-
: nothing}
|
|
212
|
+
${this.__renderPasswordToggle()}
|
|
188
213
|
</wc-field>
|
|
189
214
|
`;
|
|
190
215
|
}
|
package/src/list/list-item.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { html, LitElement, nothing } from 'lit';
|
|
2
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
2
3
|
import { property, query } from 'lit/decorators.js';
|
|
3
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -31,6 +32,7 @@ import { mixinElementInternals } from '@/__internal/mixins/element-internals.js'
|
|
|
31
32
|
* ```
|
|
32
33
|
* @tags display
|
|
33
34
|
*/
|
|
35
|
+
@IndividualComponent
|
|
34
36
|
export class ListItem extends mixinBaseButton(
|
|
35
37
|
mixinHyperlink(mixinDelegatesAria(mixinElementInternals(LitElement))),
|
|
36
38
|
) {
|