@redvars/peacock 3.6.0 → 3.6.1
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/code-highlighter.js +1 -1
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +928 -96
- package/dist/custom-elements.json +1294 -379
- package/dist/{flow-designer-dZnLJOQT.js → flow-designer-DvTUrDp5.js} +3 -3
- package/dist/{flow-designer-dZnLJOQT.js.map → flow-designer-DvTUrDp5.js.map} +1 -1
- package/dist/{flow-designer-node-XMe-jlKg.js → flow-designer-node-BWrPuxAR.js} +2 -2
- package/dist/flow-designer-node-BWrPuxAR.js.map +1 -0
- package/dist/flow-designer-node.js +1 -1
- package/dist/flow-designer.js +2 -2
- package/dist/html-editor.js +27245 -87
- package/dist/html-editor.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/modal.js +1 -7
- package/dist/modal.js.map +1 -1
- package/dist/{navigation-rail-DyO0oAZU.js → navigation-rail-DTTkqohi.js} +763 -214
- package/dist/navigation-rail-DTTkqohi.js.map +1 -0
- package/dist/peacock-loader.js +12 -3
- package/dist/peacock-loader.js.map +1 -1
- package/dist/src/html-editor/html-editor.d.ts +44 -11
- package/dist/src/index.d.ts +2 -0
- package/dist/src/list/index.d.ts +2 -0
- package/dist/src/list/list-item.d.ts +35 -0
- package/dist/src/list/list.d.ts +28 -0
- package/dist/src/modal/modal.d.ts +1 -7
- package/dist/src/navigation-rail/navigation-rail.d.ts +3 -7
- package/dist/src/number-field/number-field.d.ts +2 -2
- package/dist/src/svg/index.d.ts +1 -0
- package/dist/src/svg/svg.d.ts +38 -0
- package/dist/src/toolbar/toolbar.d.ts +3 -3
- package/dist/toolbar.js +3 -3
- package/dist/toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -1
- package/readme.md +3 -3
- package/src/code-highlighter/code-highlighter.ts +1 -1
- package/src/flow-designer/flow-designer-node.ts +1 -1
- package/src/html-editor/html-editor.scss +44 -2
- package/src/html-editor/html-editor.ts +309 -94
- package/src/index.ts +2 -1
- package/src/list/index.ts +2 -0
- package/src/list/list-item.scss +111 -0
- package/src/list/list-item.ts +175 -0
- package/src/list/list.scss +24 -0
- package/src/list/list.ts +51 -0
- package/src/modal/modal.ts +1 -7
- package/src/navigation-rail/navigation-rail-item.scss +7 -38
- package/src/navigation-rail/navigation-rail-item.ts +1 -2
- package/src/navigation-rail/navigation-rail.scss +17 -21
- package/src/navigation-rail/navigation-rail.ts +6 -9
- package/src/number-field/number-field.ts +2 -2
- package/src/peacock-loader.ts +12 -0
- package/src/svg/index.ts +1 -0
- package/src/svg/svg.scss +91 -0
- package/src/svg/svg.ts +160 -0
- package/src/toolbar/toolbar.ts +3 -3
- package/dist/flow-designer-node-XMe-jlKg.js.map +0 -1
- package/dist/navigation-rail-DyO0oAZU.js.map +0 -1
package/src/index.ts
CHANGED
|
@@ -37,11 +37,13 @@ export { Tooltip } from './popover/index.js';
|
|
|
37
37
|
export { Popover, PopoverContent } from './popover/index.js';
|
|
38
38
|
export { Breadcrumb, BreadcrumbItem } from './breadcrumb/index.js';
|
|
39
39
|
export { Menu, MenuItem, SubMenu } from './menu/index.js';
|
|
40
|
+
export { List, ListItem } from './list/index.js';
|
|
40
41
|
|
|
41
42
|
export { CodeHighlighter } from './code-highlighter/index.js';
|
|
42
43
|
export { CodeEditor } from './code-editor/index.js';
|
|
43
44
|
export { HtmlEditor } from './html-editor/index.js';
|
|
44
45
|
export { Image } from './image/index.js';
|
|
46
|
+
export { Svg } from './svg/index.js';
|
|
45
47
|
export { Tab, TabGroup, TabPanel, Tabs } from './tabs/index.js';
|
|
46
48
|
export { Slider } from './slider/index.js';
|
|
47
49
|
export { ChartDoughnut } from './chart-doughnut/index.js';
|
|
@@ -84,4 +86,3 @@ export type {
|
|
|
84
86
|
NodeTemplate,
|
|
85
87
|
} from './flow-designer/index.js';
|
|
86
88
|
export { ConditionBuilder, CbPredicate, CbCompoundExpression, CbExpression, CbDivider } from './condition-builder/index.js';
|
|
87
|
-
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
@use "../../scss/mixin";
|
|
2
|
+
|
|
3
|
+
@include mixin.base-styles;
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
padding-inline: var(--spacing-050);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.item-element {
|
|
11
|
+
position: relative;
|
|
12
|
+
min-height: 3.5rem;
|
|
13
|
+
width: 100%;
|
|
14
|
+
border: 0;
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
outline: 0;
|
|
18
|
+
background: transparent;
|
|
19
|
+
text-align: initial;
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
|
|
23
|
+
@include mixin.get-typography(body-large);
|
|
24
|
+
|
|
25
|
+
.list-item-content {
|
|
26
|
+
position: relative;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: var(--spacing-200);
|
|
31
|
+
min-height: 3.5rem;
|
|
32
|
+
padding-inline: var(--spacing-200);
|
|
33
|
+
color: var(--_label-text-color);
|
|
34
|
+
opacity: var(--_label-text-opacity, 1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.leading,
|
|
38
|
+
.trailing {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
min-width: 1.5rem;
|
|
43
|
+
color: var(--_leading-trailing-color);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.trailing {
|
|
47
|
+
margin-inline-start: auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.content {
|
|
51
|
+
display: block;
|
|
52
|
+
flex: 1;
|
|
53
|
+
min-inline-size: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.background {
|
|
57
|
+
position: absolute;
|
|
58
|
+
inset: 0;
|
|
59
|
+
background-color: var(--_container-color);
|
|
60
|
+
opacity: var(--_container-opacity, 1);
|
|
61
|
+
border-radius: var(--shape-corner-medium);
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.focus-ring {
|
|
66
|
+
--focus-ring-container-shape-start-start: var(--shape-corner-medium);
|
|
67
|
+
--focus-ring-container-shape-start-end: var(--shape-corner-medium);
|
|
68
|
+
--focus-ring-container-shape-end-start: var(--shape-corner-medium);
|
|
69
|
+
--focus-ring-container-shape-end-end: var(--shape-corner-medium);
|
|
70
|
+
z-index: 2;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ripple {
|
|
74
|
+
--ripple-state-opacity: var(--_container-state-opacity, 0);
|
|
75
|
+
--ripple-pressed-color: var(--_container-state-color);
|
|
76
|
+
border-radius: var(--shape-corner-medium);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.item-element {
|
|
80
|
+
--_container-color: transparent;
|
|
81
|
+
--_label-text-color: var(--color-on-surface);
|
|
82
|
+
--_leading-trailing-color: var(--color-on-surface-variant);
|
|
83
|
+
--_container-state-color: var(--color-on-surface);
|
|
84
|
+
|
|
85
|
+
&:hover:not(:where(.disabled, .selected)) {
|
|
86
|
+
--_container-state-opacity: 0.08;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.pressed:not(:where(.disabled)) {
|
|
90
|
+
--_container-state-opacity: 0.12;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.selected {
|
|
94
|
+
--_container-color: var(--color-secondary-container);
|
|
95
|
+
--_label-text-color: var(--color-on-secondary-container);
|
|
96
|
+
--_leading-trailing-color: var(--color-on-secondary-container);
|
|
97
|
+
--_container-state-color: var(--color-on-secondary-container);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.disabled {
|
|
101
|
+
cursor: not-allowed;
|
|
102
|
+
--_label-text-color: var(--color-on-surface);
|
|
103
|
+
--_label-text-opacity: 0.38;
|
|
104
|
+
--_leading-trailing-color: var(--color-on-surface);
|
|
105
|
+
--_container-opacity: 0.12;
|
|
106
|
+
|
|
107
|
+
.ripple {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import styles from './list-item.scss';
|
|
6
|
+
import BaseButtonMixin from '@/__mixins/BaseButtonMixin.js';
|
|
7
|
+
import BaseHyperlinkMixin from '@/__mixins/BaseHyperlinkMixin.js';
|
|
8
|
+
import {
|
|
9
|
+
dispatchActivationClick,
|
|
10
|
+
isActivationClick,
|
|
11
|
+
} from '@/__utils/dispatch-event-utils.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @label List Item
|
|
15
|
+
* @tag wc-list-item
|
|
16
|
+
* @rawTag list-item
|
|
17
|
+
* @parentRawTag list
|
|
18
|
+
*
|
|
19
|
+
* @summary A Material 3 list item with leading, trailing and content slots.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```html
|
|
23
|
+
* <wc-list-item selected>
|
|
24
|
+
* <wc-icon slot="leading" name="person"></wc-icon>
|
|
25
|
+
* Profile
|
|
26
|
+
* <wc-icon slot="trailing" name="chevron_right"></wc-icon>
|
|
27
|
+
* </wc-list-item>
|
|
28
|
+
* ```
|
|
29
|
+
* @tags display
|
|
30
|
+
*/
|
|
31
|
+
export class ListItem extends BaseButtonMixin(BaseHyperlinkMixin(LitElement)) {
|
|
32
|
+
static styles = [styles];
|
|
33
|
+
|
|
34
|
+
@property({ type: Boolean, reflect: true }) selected = false;
|
|
35
|
+
|
|
36
|
+
@query('#item') readonly itemElement!: HTMLElement | null;
|
|
37
|
+
|
|
38
|
+
@state() isPressed = false;
|
|
39
|
+
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
// eslint-disable-next-line wc/guard-super-call
|
|
42
|
+
super.connectedCallback();
|
|
43
|
+
|
|
44
|
+
if (!this.hasAttribute('role')) {
|
|
45
|
+
this.setAttribute('role', 'listitem');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
override focus() {
|
|
50
|
+
this.itemElement?.focus();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override blur() {
|
|
54
|
+
this.itemElement?.blur();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
__dispatchClick = (event: MouseEvent | KeyboardEvent) => {
|
|
58
|
+
if (this.softDisabled || (this.disabled && this.href)) {
|
|
59
|
+
event.stopImmediatePropagation();
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!isActivationClick(event) || !this.itemElement) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
this.focus();
|
|
69
|
+
dispatchActivationClick(this.itemElement);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
__handleKeyDown = (event: KeyboardEvent) => {
|
|
73
|
+
this.__handlePress(event);
|
|
74
|
+
|
|
75
|
+
if (this.disabled || this.softDisabled || !this.itemElement) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (event.key === ' ') {
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
this.itemElement.click();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (event.key === 'Enter' && !this.__isLink()) {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
this.itemElement.click();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
__handlePress = (event: KeyboardEvent | MouseEvent) => {
|
|
92
|
+
if (this.disabled || this.softDisabled) return;
|
|
93
|
+
|
|
94
|
+
if (
|
|
95
|
+
event instanceof KeyboardEvent &&
|
|
96
|
+
event.type === 'keydown' &&
|
|
97
|
+
(event.key === 'Enter' || event.key === ' ')
|
|
98
|
+
) {
|
|
99
|
+
this.isPressed = true;
|
|
100
|
+
} else if (event.type === 'mousedown') {
|
|
101
|
+
this.isPressed = true;
|
|
102
|
+
} else {
|
|
103
|
+
this.isPressed = false;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
render() {
|
|
108
|
+
const isLink = this.__isLink();
|
|
109
|
+
|
|
110
|
+
const cssClasses = {
|
|
111
|
+
'list-item': true,
|
|
112
|
+
'item-element': true,
|
|
113
|
+
selected: this.selected,
|
|
114
|
+
disabled: this.disabled || this.softDisabled,
|
|
115
|
+
pressed: this.isPressed,
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
if (!isLink) {
|
|
119
|
+
return html`
|
|
120
|
+
<button
|
|
121
|
+
id="item"
|
|
122
|
+
class=${classMap(cssClasses)}
|
|
123
|
+
type=${this.htmlType}
|
|
124
|
+
?disabled=${this.disabled}
|
|
125
|
+
?aria-disabled=${this.softDisabled}
|
|
126
|
+
@click=${this.__dispatchClick}
|
|
127
|
+
@mousedown=${this.__handlePress}
|
|
128
|
+
@keydown=${this.__handleKeyDown}
|
|
129
|
+
@keyup=${this.__handlePress}
|
|
130
|
+
>
|
|
131
|
+
${this.renderContent()}
|
|
132
|
+
</button>
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return html`
|
|
137
|
+
<a
|
|
138
|
+
id="item"
|
|
139
|
+
class=${classMap(cssClasses)}
|
|
140
|
+
href=${this.href}
|
|
141
|
+
target=${this.target}
|
|
142
|
+
rel=${ifDefined(this.rel)}
|
|
143
|
+
download=${ifDefined(this.download)}
|
|
144
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
|
145
|
+
aria-disabled=${String(this.disabled || this.softDisabled)}
|
|
146
|
+
@click=${this.__dispatchClick}
|
|
147
|
+
@mousedown=${this.__handlePress}
|
|
148
|
+
@keydown=${this.__handleKeyDown}
|
|
149
|
+
@keyup=${this.__handlePress}
|
|
150
|
+
>
|
|
151
|
+
${this.renderContent()}
|
|
152
|
+
</a>
|
|
153
|
+
`;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
renderContent() {
|
|
157
|
+
return html`
|
|
158
|
+
<wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
|
|
159
|
+
<div class="background"></div>
|
|
160
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
161
|
+
|
|
162
|
+
<div class="list-item-content">
|
|
163
|
+
<div class="leading">
|
|
164
|
+
<slot name="leading"></slot>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="content">
|
|
167
|
+
<slot></slot>
|
|
168
|
+
</div>
|
|
169
|
+
<div class="trailing">
|
|
170
|
+
<slot name="trailing"></slot>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
`;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@use "../../scss/mixin";
|
|
2
|
+
|
|
3
|
+
@include mixin.base-styles;
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.list {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: var(--spacing-050);
|
|
13
|
+
padding-block: var(--spacing-050);
|
|
14
|
+
border-radius: var(--shape-corner-large);
|
|
15
|
+
background-color: var(--_container-color);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.list.variant-standard {
|
|
19
|
+
--_container-color: var(--color-surface-container);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.list.variant-vibrant {
|
|
23
|
+
--_container-color: var(--color-tertiary-container);
|
|
24
|
+
}
|
package/src/list/list.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { LitElement, html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import styles from './list.scss';
|
|
5
|
+
import { ListItem } from './list-item.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @label List
|
|
9
|
+
* @tag wc-list
|
|
10
|
+
* @rawTag list
|
|
11
|
+
*
|
|
12
|
+
* @summary A Material 3 list container for one or more list items.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <wc-list>
|
|
17
|
+
* <wc-list-item>
|
|
18
|
+
* <wc-icon slot="leading" name="inbox"></wc-icon>
|
|
19
|
+
* Inbox
|
|
20
|
+
* <span slot="trailing">24</span>
|
|
21
|
+
* </wc-list-item>
|
|
22
|
+
* </wc-list>
|
|
23
|
+
* ```
|
|
24
|
+
* @tags display
|
|
25
|
+
*/
|
|
26
|
+
export class List extends LitElement {
|
|
27
|
+
static styles = [styles];
|
|
28
|
+
|
|
29
|
+
static Item = ListItem;
|
|
30
|
+
|
|
31
|
+
@property({ type: String, reflect: true }) variant: 'standard' | 'vibrant' =
|
|
32
|
+
'standard';
|
|
33
|
+
|
|
34
|
+
connectedCallback() {
|
|
35
|
+
super.connectedCallback();
|
|
36
|
+
this.setAttribute('role', 'list');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
render() {
|
|
40
|
+
const cssClasses = {
|
|
41
|
+
list: true,
|
|
42
|
+
[`variant-${this.variant}`]: true,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return html`
|
|
46
|
+
<div class=${classMap(cssClasses)}>
|
|
47
|
+
<slot></slot>
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/modal/modal.ts
CHANGED
|
@@ -21,13 +21,7 @@ type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'fullscreen';
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```html
|
|
24
|
-
*
|
|
25
|
-
* <p>Are you sure you want to continue?</p>
|
|
26
|
-
* <div slot="footer">
|
|
27
|
-
* <wc-button variant="text">Cancel</wc-button>
|
|
28
|
-
* <wc-button>Confirm</wc-button>
|
|
29
|
-
* </div>
|
|
30
|
-
* </wc-modal>
|
|
24
|
+
* MODAL
|
|
31
25
|
* ```
|
|
32
26
|
* @tags overlay, dialog, feedback
|
|
33
27
|
*/
|
|
@@ -64,6 +64,13 @@
|
|
|
64
64
|
flex-shrink: 0;
|
|
65
65
|
transition: background-color var(--duration-short4, 200ms) var(--easing-standard, ease);
|
|
66
66
|
|
|
67
|
+
.ripple {
|
|
68
|
+
inset: 0;
|
|
69
|
+
z-index: 0;
|
|
70
|
+
--ripple-pressed-color: var(--_state-color);
|
|
71
|
+
border-radius: inherit;
|
|
72
|
+
}
|
|
73
|
+
|
|
67
74
|
.icon-container {
|
|
68
75
|
display: flex;
|
|
69
76
|
align-items: center;
|
|
@@ -81,29 +88,6 @@
|
|
|
81
88
|
}
|
|
82
89
|
}
|
|
83
90
|
|
|
84
|
-
/* State layer for hover/press */
|
|
85
|
-
.state-layer {
|
|
86
|
-
position: absolute;
|
|
87
|
-
top: 0.25rem;
|
|
88
|
-
left: 50%;
|
|
89
|
-
transform: translateX(-50%);
|
|
90
|
-
width: var(--_indicator-width);
|
|
91
|
-
height: var(--_indicator-height);
|
|
92
|
-
pointer-events: none;
|
|
93
|
-
background-color: var(--_state-color);
|
|
94
|
-
opacity: 0;
|
|
95
|
-
z-index: 0;
|
|
96
|
-
border-radius: var(--_indicator-shape);
|
|
97
|
-
transition: opacity var(--duration-short4, 200ms) var(--easing-standard, ease);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.ripple {
|
|
101
|
-
z-index: 1;
|
|
102
|
-
--ripple-pressed-color: var(--_state-color);
|
|
103
|
-
--ripple-state-opacity: 0;
|
|
104
|
-
border-radius: var(--shape-corner-small, 4px);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
91
|
/* Label */
|
|
108
92
|
.label {
|
|
109
93
|
@include mixin.get-typography('label-medium');
|
|
@@ -166,20 +150,6 @@
|
|
|
166
150
|
}
|
|
167
151
|
}
|
|
168
152
|
|
|
169
|
-
/* Hover state */
|
|
170
|
-
&:hover:not(.disabled) {
|
|
171
|
-
.state-layer {
|
|
172
|
-
opacity: 0.08;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/* Pressed state */
|
|
177
|
-
&.pressed:not(.disabled) {
|
|
178
|
-
.state-layer {
|
|
179
|
-
opacity: 0.12;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
153
|
/* Disabled state */
|
|
184
154
|
&.disabled {
|
|
185
155
|
cursor: not-allowed;
|
|
@@ -208,7 +178,6 @@
|
|
|
208
178
|
@media (prefers-reduced-motion: reduce) {
|
|
209
179
|
.item {
|
|
210
180
|
.indicator,
|
|
211
|
-
.state-layer,
|
|
212
181
|
.label {
|
|
213
182
|
transition: none;
|
|
214
183
|
}
|
|
@@ -155,11 +155,10 @@ export class NavigationRailItem extends LitElement {
|
|
|
155
155
|
__renderItemContent() {
|
|
156
156
|
return html`
|
|
157
157
|
<wc-focus-ring class="focus-ring" for='item'></wc-focus-ring>
|
|
158
|
-
<div class="state-layer"></div>
|
|
159
|
-
<wc-ripple class="ripple"></wc-ripple>
|
|
160
158
|
|
|
161
159
|
<div class="item-content">
|
|
162
160
|
<div class="indicator">
|
|
161
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
163
162
|
<div class="icon-container">
|
|
164
163
|
<slot name="active-icon" class="active-icon-slot"></slot>
|
|
165
164
|
<slot name="icon" class="icon-slot"></slot>
|
|
@@ -26,6 +26,21 @@
|
|
|
26
26
|
align-items: center;
|
|
27
27
|
width: 100%;
|
|
28
28
|
flex-shrink: 0;
|
|
29
|
+
padding-block-end: 2.5rem;
|
|
30
|
+
|
|
31
|
+
&:empty {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.footer {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: flex-end;
|
|
41
|
+
width: 100%;
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
margin-top: auto;
|
|
29
44
|
|
|
30
45
|
&:empty {
|
|
31
46
|
display: none;
|
|
@@ -34,7 +49,6 @@
|
|
|
34
49
|
|
|
35
50
|
wc-divider {
|
|
36
51
|
width: calc(100% - 1rem);
|
|
37
|
-
margin-block: 0.5rem;
|
|
38
52
|
flex-shrink: 0;
|
|
39
53
|
}
|
|
40
54
|
|
|
@@ -44,29 +58,11 @@
|
|
|
44
58
|
align-items: center;
|
|
45
59
|
width: 100%;
|
|
46
60
|
gap: 0.75rem; /* 12dp between items */
|
|
47
|
-
flex: 1;
|
|
61
|
+
flex: 1 1 auto;
|
|
62
|
+
min-height: 0;
|
|
48
63
|
|
|
49
64
|
::slotted(wc-navigation-rail-item) {
|
|
50
65
|
width: 100%;
|
|
51
66
|
}
|
|
52
67
|
}
|
|
53
|
-
|
|
54
|
-
/* Alignment variants */
|
|
55
|
-
&.align-top {
|
|
56
|
-
.items {
|
|
57
|
-
justify-content: flex-start;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&.align-center {
|
|
62
|
-
.items {
|
|
63
|
-
justify-content: center;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&.align-bottom {
|
|
68
|
-
.items {
|
|
69
|
-
justify-content: flex-end;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
68
|
}
|
|
@@ -14,6 +14,9 @@ import { NavigationRailItem } from './navigation-rail-item.js';
|
|
|
14
14
|
* <p>Navigation rail provides access to primary destinations in an app using icons—with or without labels—on a vertical rail.</p>
|
|
15
15
|
* <p>Use navigation rail on medium-sized screens (tablets) with 3–7 destinations.</p>
|
|
16
16
|
*
|
|
17
|
+
* @slot header - Content displayed above the rail items.
|
|
18
|
+
* @slot footer - Content pinned to the bottom of the rail.
|
|
19
|
+
*
|
|
17
20
|
* @cssprop --nav-rail-width - Width of the rail container. Defaults to 5rem (80dp).
|
|
18
21
|
* @cssprop --nav-rail-container-color - Background color of the rail. Defaults to surface color.
|
|
19
22
|
* @cssprop --nav-rail-indicator-color - Color of the active indicator. Defaults to secondary-container.
|
|
@@ -49,14 +52,6 @@ export class NavigationRail extends LitElement {
|
|
|
49
52
|
|
|
50
53
|
static Item = NavigationRailItem;
|
|
51
54
|
|
|
52
|
-
/**
|
|
53
|
-
* Vertical alignment of items within the rail.
|
|
54
|
-
* - `"top"`: Items align to the top.
|
|
55
|
-
* - `"center"`: Items are centered (default).
|
|
56
|
-
* - `"bottom"`: Items align to the bottom.
|
|
57
|
-
*/
|
|
58
|
-
@property({ reflect: true }) alignment: 'top' | 'center' | 'bottom' = 'center';
|
|
59
|
-
|
|
60
55
|
/**
|
|
61
56
|
* Display mode of the navigation rail.
|
|
62
57
|
* - `"expanded"`: shows labels.
|
|
@@ -130,7 +125,6 @@ export class NavigationRail extends LitElement {
|
|
|
130
125
|
render() {
|
|
131
126
|
const cssClasses = {
|
|
132
127
|
rail: true,
|
|
133
|
-
[`align-${this.alignment}`]: true,
|
|
134
128
|
[`mode-${this.mode}`]: true,
|
|
135
129
|
};
|
|
136
130
|
|
|
@@ -143,6 +137,9 @@ export class NavigationRail extends LitElement {
|
|
|
143
137
|
<nav class="items" role="presentation">
|
|
144
138
|
<slot @slotchange=${this._syncItemMode}></slot>
|
|
145
139
|
</nav>
|
|
140
|
+
<div class="footer">
|
|
141
|
+
<slot name="footer"></slot>
|
|
142
|
+
</div>
|
|
146
143
|
</div>
|
|
147
144
|
`;
|
|
148
145
|
}
|
|
@@ -10,8 +10,8 @@ import styles from './number-field.scss';
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @label Number Field
|
|
13
|
-
* @tag number-field
|
|
14
|
-
* @rawTag number
|
|
13
|
+
* @tag wc-number-field
|
|
14
|
+
* @rawTag number-field
|
|
15
15
|
*
|
|
16
16
|
* @summary The Number Field component is used to capture numeric user input.
|
|
17
17
|
*
|
package/src/peacock-loader.ts
CHANGED
|
@@ -30,6 +30,8 @@ import { Radio } from './radio/radio.js';
|
|
|
30
30
|
import { Menu } from './menu/menu/menu.js';
|
|
31
31
|
import { MenuItem } from './menu/menu-item/menu-item.js';
|
|
32
32
|
import { SubMenu } from './menu/sub-menu/sub-menu.js';
|
|
33
|
+
import { List } from './list/list.js';
|
|
34
|
+
import { ListItem } from './list/list-item.js';
|
|
33
35
|
|
|
34
36
|
import { Accordion } from './accordion/accordion.js';
|
|
35
37
|
import { Link } from './link/link.js';
|
|
@@ -49,6 +51,7 @@ import { Spinner } from './spinner/spinner.js';
|
|
|
49
51
|
import { EmptyState } from './empty-state/empty-state.js';
|
|
50
52
|
import { Container } from './container/container.js';
|
|
51
53
|
import { Image } from './image/image.js';
|
|
54
|
+
import { Svg } from './svg/svg.js';
|
|
52
55
|
|
|
53
56
|
import { LoaderConfig, LoaderUtils } from './LoaderUtils.js';
|
|
54
57
|
import { loadCSS } from './CssLoader.js';
|
|
@@ -287,12 +290,21 @@ const loaderConfig: LoaderConfig = {
|
|
|
287
290
|
'wc-sub-menu': {
|
|
288
291
|
CustomElementClass: SubMenu,
|
|
289
292
|
},
|
|
293
|
+
'wc-list': {
|
|
294
|
+
CustomElementClass: List,
|
|
295
|
+
},
|
|
296
|
+
'wc-list-item': {
|
|
297
|
+
CustomElementClass: ListItem,
|
|
298
|
+
},
|
|
290
299
|
'wc-container': {
|
|
291
300
|
CustomElementClass: Container,
|
|
292
301
|
},
|
|
293
302
|
'wc-image': {
|
|
294
303
|
CustomElementClass: Image,
|
|
295
304
|
},
|
|
305
|
+
'wc-svg': {
|
|
306
|
+
CustomElementClass: Svg,
|
|
307
|
+
},
|
|
296
308
|
'wc-slider': {
|
|
297
309
|
CustomElementClass: Slider,
|
|
298
310
|
},
|
package/src/svg/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Svg } from './svg.js';
|