@redvars/peacock 3.6.0 → 3.6.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/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/assets/tokens.css +1 -1
- package/dist/assets/tokens.css.map +1 -1
- package/dist/{button-colors-Ccys3hvS.js → button-colors-AvGh22Zn.js} +18 -18
- package/dist/{button-colors-Ccys3hvS.js.map → button-colors-AvGh22Zn.js.map} +1 -1
- package/dist/button-group.js +2 -2
- package/dist/button.js +2 -3
- package/dist/button.js.map +1 -1
- package/dist/card.js +1 -1
- package/dist/card.js.map +1 -1
- package/dist/code-highlighter.js +34 -9
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +4973 -3553
- package/dist/custom-elements.json +7899 -6346
- 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 +1402 -8
- package/dist/flow-designer.js.map +1 -1
- package/dist/html-editor.js +27245 -87
- package/dist/html-editor.js.map +1 -1
- package/dist/icon-CueRR7wx.js +260 -0
- package/dist/icon-CueRR7wx.js.map +1 -0
- package/dist/{icon-button-CK1ZuE-2.js → icon-button-ohxHhy4t.js} +2 -2
- package/dist/{icon-button-CK1ZuE-2.js.map → icon-button-ohxHhy4t.js.map} +1 -1
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/modal.js +12 -18
- package/dist/modal.js.map +1 -1
- package/dist/{navigation-rail-DyO0oAZU.js → navigation-rail-CD7IrqbN.js} +952 -279
- package/dist/navigation-rail-CD7IrqbN.js.map +1 -0
- package/dist/peacock-loader.js +39 -30
- package/dist/peacock-loader.js.map +1 -1
- package/dist/{popover-NC7b1lTq.js → popover-DUPmMVWS.js} +9 -4
- package/dist/{popover-NC7b1lTq.js.map → popover-DUPmMVWS.js.map} +1 -1
- package/dist/popover.js +1 -1
- package/dist/src/__controllers/floating-controller.d.ts +1 -0
- package/dist/src/avatar/avatar.d.ts +1 -1
- package/dist/src/breadcrumb/breadcrumb/breadcrumb.d.ts +0 -1
- package/dist/src/chip/chip/chip.d.ts +14 -11
- package/dist/src/chip/chip-set/chip-set.d.ts +20 -0
- package/dist/src/chip/chip-set/index.d.ts +1 -0
- package/dist/src/code-highlighter/code-highlighter.d.ts +4 -0
- package/dist/src/html-editor/html-editor.d.ts +44 -11
- package/dist/src/index.d.ts +3 -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/menu/menu/menu.d.ts +1 -0
- package/dist/src/modal/modal.d.ts +2 -8
- 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/test/chip.test.d.ts +1 -0
- 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/scss/styles.scss +3 -3
- package/scss/tokens.css +1 -1
- package/src/__controllers/floating-controller.ts +9 -3
- package/src/avatar/avatar.scss +4 -4
- package/src/avatar/avatar.ts +1 -1
- package/src/breadcrumb/breadcrumb/breadcrumb.ts +0 -1
- package/src/button/button/button.scss +17 -17
- package/src/button/button/button.ts +1 -2
- package/src/card/card.ts +1 -1
- package/src/chip/chip/chip.scss +119 -45
- package/src/chip/chip/chip.ts +97 -38
- package/src/chip/chip-set/chip-set.scss +13 -0
- package/src/chip/chip-set/chip-set.ts +25 -0
- package/src/chip/chip-set/index.ts +1 -0
- package/src/code-highlighter/code-highlighter.ts +33 -6
- package/src/field/field.scss +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 +3 -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/menu/menu/menu.ts +11 -0
- package/src/modal/modal.scss +10 -10
- package/src/modal/modal.ts +2 -8
- 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 +36 -22
- 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-dZnLJOQT.js +0 -1656
- package/dist/flow-designer-dZnLJOQT.js.map +0 -1
- package/dist/flow-designer-node-XMe-jlKg.js.map +0 -1
- package/dist/navigation-rail-DyO0oAZU.js.map +0 -1
- package/src/chip/chip/chip-colors.scss +0 -31
|
@@ -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/menu/menu/menu.ts
CHANGED
|
@@ -276,6 +276,16 @@ export class Menu extends LitElement {
|
|
|
276
276
|
this._syncRovingTabIndex();
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
+
private _dispatchItemActivate(item: MenuItem) {
|
|
280
|
+
this.dispatchEvent(
|
|
281
|
+
new CustomEvent('menu-item-activate', {
|
|
282
|
+
bubbles: true,
|
|
283
|
+
composed: true,
|
|
284
|
+
detail: { item },
|
|
285
|
+
}),
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
279
289
|
private _onClick = (event: Event) => {
|
|
280
290
|
if (!this.open) {
|
|
281
291
|
return;
|
|
@@ -287,6 +297,7 @@ export class Menu extends LitElement {
|
|
|
287
297
|
}
|
|
288
298
|
|
|
289
299
|
this._setActiveItem(item);
|
|
300
|
+
this._dispatchItemActivate(item);
|
|
290
301
|
if (item.keepOpen) {
|
|
291
302
|
return;
|
|
292
303
|
}
|
package/src/modal/modal.scss
CHANGED
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
:host {
|
|
6
6
|
display: contents;
|
|
7
7
|
|
|
8
|
-
--modal-container-color: var(--color-surface-container-high
|
|
9
|
-
--modal-scrim-color:
|
|
10
|
-
--modal-shape: var(--shape-corner-extra-large
|
|
8
|
+
--modal-container-color: var(--color-surface-container-high);
|
|
9
|
+
--modal-scrim-color: color-mix(in srgb, var(--color-scrim), transparent 32%);
|
|
10
|
+
--modal-shape: var(--shape-corner-extra-large);
|
|
11
11
|
--modal-min-width: 280px;
|
|
12
12
|
--modal-max-width: 560px;
|
|
13
13
|
--modal-max-height: 90dvh;
|
|
14
|
-
--modal-transition-duration: var(--duration-medium2
|
|
15
|
-
--modal-transition-easing: var(--easing-emphasized
|
|
16
|
-
--modal-heading-color: var(--color-on-surface
|
|
17
|
-
--modal-subheading-color: var(--color-on-surface-variant
|
|
18
|
-
--modal-content-color: var(--color-on-surface-variant
|
|
19
|
-
--modal-divider-color: var(--color-outline-variant
|
|
20
|
-
--modal-elevation: var(--elevation-level3
|
|
14
|
+
--modal-transition-duration: var(--duration-medium2);
|
|
15
|
+
--modal-transition-easing: var(--easing-emphasized);
|
|
16
|
+
--modal-heading-color: var(--color-on-surface);
|
|
17
|
+
--modal-subheading-color: var(--color-on-surface-variant);
|
|
18
|
+
--modal-content-color: var(--color-on-surface-variant);
|
|
19
|
+
--modal-divider-color: var(--color-outline-variant);
|
|
20
|
+
--modal-elevation: var(--elevation-level3);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/* Scrim backdrop */
|
package/src/modal/modal.ts
CHANGED
|
@@ -9,7 +9,7 @@ type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'fullscreen';
|
|
|
9
9
|
/**
|
|
10
10
|
* @label Modal
|
|
11
11
|
* @tag wc-modal
|
|
12
|
-
* @rawTag modal
|
|
12
|
+
* @rawTag modal
|
|
13
13
|
* @summary A Material Design 3 dialog/modal for displaying content in a layer above the page, with optional header, body, and footer slots.
|
|
14
14
|
*
|
|
15
15
|
* @cssprop --modal-container-color - Background color of the dialog container.
|
|
@@ -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,11 +30,14 @@ 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';
|
|
36
38
|
import { Tag } from './chip/tag/tag.js';
|
|
37
39
|
import { Chip } from './chip/chip/chip.js';
|
|
40
|
+
import { ChipSet } from './chip/chip-set/chip-set.js';
|
|
38
41
|
import { LinearProgress } from './progress/linear-progress/linear-progress.js';
|
|
39
42
|
import { CircularProgress } from './progress/circular-progress/circular-progress.js';
|
|
40
43
|
|
|
@@ -49,6 +52,7 @@ import { Spinner } from './spinner/spinner.js';
|
|
|
49
52
|
import { EmptyState } from './empty-state/empty-state.js';
|
|
50
53
|
import { Container } from './container/container.js';
|
|
51
54
|
import { Image } from './image/image.js';
|
|
55
|
+
import { Svg } from './svg/svg.js';
|
|
52
56
|
|
|
53
57
|
import { LoaderConfig, LoaderUtils } from './LoaderUtils.js';
|
|
54
58
|
import { loadCSS } from './CssLoader.js';
|
|
@@ -77,17 +81,6 @@ import { Search } from './search/search.js';
|
|
|
77
81
|
import { Toolbar } from './toolbar/toolbar.js';
|
|
78
82
|
import { NavigationRail } from './navigation-rail/navigation-rail.js';
|
|
79
83
|
import { NavigationRailItem } from './navigation-rail/navigation-rail-item.js';
|
|
80
|
-
import { Calendar } from './calendar/calendar.js';
|
|
81
|
-
import { CalendarColumnView } from './calendar/calendar-column-view.js';
|
|
82
|
-
import { CalendarMonthView } from './calendar/calendar-month-view.js';
|
|
83
|
-
import { Canvas } from './canvas/canvas.js';
|
|
84
|
-
import { FlowDesigner } from './flow-designer/flow-designer.js';
|
|
85
|
-
import { FlowDesignerNode } from './flow-designer/flow-designer-node.js';
|
|
86
|
-
import { ConditionBuilder } from './condition-builder/condition-builder.js';
|
|
87
|
-
import { CbPredicate } from './condition-builder/cb-predicate.js';
|
|
88
|
-
import { CbCompoundExpression } from './condition-builder/cb-compound-expression.js';
|
|
89
|
-
import { CbExpression } from './condition-builder/cb-expression.js';
|
|
90
|
-
import { CbDivider } from './condition-builder/cb-divider.js';
|
|
91
84
|
|
|
92
85
|
const distDirectory = `${import.meta.url}/..`;
|
|
93
86
|
await loadCSS(`${distDirectory}/assets/styles.css`);
|
|
@@ -187,6 +180,9 @@ const loaderConfig: LoaderConfig = {
|
|
|
187
180
|
'wc-chip': {
|
|
188
181
|
CustomElementClass: Chip,
|
|
189
182
|
},
|
|
183
|
+
'wc-chip-set': {
|
|
184
|
+
CustomElementClass: ChipSet,
|
|
185
|
+
},
|
|
190
186
|
'wc-card': {
|
|
191
187
|
CustomElementClass: Card,
|
|
192
188
|
},
|
|
@@ -253,6 +249,7 @@ const loaderConfig: LoaderConfig = {
|
|
|
253
249
|
},
|
|
254
250
|
'wc-html-editor': {
|
|
255
251
|
importPath: `${distDirectory}/html-editor.js`,
|
|
252
|
+
dependencies: ['wc-code-editor'],
|
|
256
253
|
},
|
|
257
254
|
'wc-code-highlighter': {
|
|
258
255
|
importPath: `${distDirectory}/code-highlighter.js`,
|
|
@@ -287,12 +284,21 @@ const loaderConfig: LoaderConfig = {
|
|
|
287
284
|
'wc-sub-menu': {
|
|
288
285
|
CustomElementClass: SubMenu,
|
|
289
286
|
},
|
|
287
|
+
'wc-list': {
|
|
288
|
+
CustomElementClass: List,
|
|
289
|
+
},
|
|
290
|
+
'wc-list-item': {
|
|
291
|
+
CustomElementClass: ListItem,
|
|
292
|
+
},
|
|
290
293
|
'wc-container': {
|
|
291
294
|
CustomElementClass: Container,
|
|
292
295
|
},
|
|
293
296
|
'wc-image': {
|
|
294
297
|
CustomElementClass: Image,
|
|
295
298
|
},
|
|
299
|
+
'wc-svg': {
|
|
300
|
+
CustomElementClass: Svg,
|
|
301
|
+
},
|
|
296
302
|
'wc-slider': {
|
|
297
303
|
CustomElementClass: Slider,
|
|
298
304
|
},
|
|
@@ -342,22 +348,24 @@ const loaderConfig: LoaderConfig = {
|
|
|
342
348
|
CustomElementClass: NavigationRailItem,
|
|
343
349
|
},
|
|
344
350
|
'wc-calendar': {
|
|
345
|
-
|
|
351
|
+
importPath: `${distDirectory}/calendar.js`,
|
|
352
|
+
dependencies: ['wc-calendar-column-view', 'wc-calendar-month-view'],
|
|
346
353
|
},
|
|
347
354
|
'wc-calendar-column-view': {
|
|
348
|
-
|
|
355
|
+
importPath: `${distDirectory}/calendar-column-view.js`,
|
|
349
356
|
},
|
|
350
357
|
'wc-calendar-month-view': {
|
|
351
|
-
|
|
358
|
+
importPath: `${distDirectory}/calendar-month-view.js`,
|
|
352
359
|
},
|
|
353
360
|
'wc-canvas': {
|
|
354
|
-
|
|
361
|
+
importPath: `${distDirectory}/canvas.js`,
|
|
355
362
|
},
|
|
356
363
|
'wc-flow-designer': {
|
|
357
|
-
|
|
364
|
+
importPath: `${distDirectory}/flow-designer.js`,
|
|
365
|
+
dependencies: ['wc-flow-designer-node'],
|
|
358
366
|
},
|
|
359
367
|
'wc-flow-designer-node': {
|
|
360
|
-
|
|
368
|
+
importPath: `${distDirectory}/flow-designer-node.js`,
|
|
361
369
|
},
|
|
362
370
|
'wc-chart-doughnut': {
|
|
363
371
|
importPath: `${distDirectory}/chart-doughnut.js`,
|
|
@@ -372,19 +380,25 @@ const loaderConfig: LoaderConfig = {
|
|
|
372
380
|
importPath: `${distDirectory}/chart-stacked-bar.js`,
|
|
373
381
|
},
|
|
374
382
|
'wc-condition-builder': {
|
|
375
|
-
|
|
383
|
+
importPath: `${distDirectory}/condition-builder.js`,
|
|
384
|
+
dependencies: [
|
|
385
|
+
'wc-cb-predicate',
|
|
386
|
+
'wc-cb-compound-expression',
|
|
387
|
+
'wc-cb-expression',
|
|
388
|
+
'wc-cb-divider',
|
|
389
|
+
],
|
|
376
390
|
},
|
|
377
391
|
'wc-cb-predicate': {
|
|
378
|
-
|
|
392
|
+
importPath: `${distDirectory}/cb-predicate.js`,
|
|
379
393
|
},
|
|
380
394
|
'wc-cb-compound-expression': {
|
|
381
|
-
|
|
395
|
+
importPath: `${distDirectory}/cb-compound-expression.js`,
|
|
382
396
|
},
|
|
383
397
|
'wc-cb-expression': {
|
|
384
|
-
|
|
398
|
+
importPath: `${distDirectory}/cb-expression.js`,
|
|
385
399
|
},
|
|
386
400
|
'wc-cb-divider': {
|
|
387
|
-
|
|
401
|
+
importPath: `${distDirectory}/cb-divider.js`,
|
|
388
402
|
},
|
|
389
403
|
},
|
|
390
404
|
};
|
package/src/svg/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Svg } from './svg.js';
|