@redvars/peacock 3.5.0 → 3.5.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/BaseButton-DuASuVth.js +219 -0
- package/dist/BaseButton-DuASuVth.js.map +1 -0
- package/dist/BaseHyperlinkMixin-BNuwbiEf.js +65 -0
- package/dist/BaseHyperlinkMixin-BNuwbiEf.js.map +1 -0
- package/dist/assets/components.css +1 -1
- package/dist/assets/components.css.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/banner.js +12 -27
- package/dist/banner.js.map +1 -1
- package/dist/{button-DMN1dPAg.js → button-DouvOfEU.js} +77 -251
- package/dist/button-DouvOfEU.js.map +1 -0
- package/dist/{button-group-CX9CUUXk.js → button-group-CEdMwvJJ.js} +71 -42
- package/dist/button-group-CEdMwvJJ.js.map +1 -0
- package/dist/button-group.js +5 -5
- package/dist/button.js +3 -3
- package/dist/card.js +18 -73
- package/dist/card.js.map +1 -1
- package/dist/chart-bar.js.map +1 -1
- package/dist/chart-doughnut.js +2 -2
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js +2 -2
- package/dist/chart-pie.js.map +1 -1
- package/dist/chart-stacked-bar.js.map +1 -1
- package/dist/code-highlighter.js +2 -1
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +3105 -1494
- package/dist/custom-elements.json +9244 -7829
- package/dist/fab.js +421 -9
- package/dist/fab.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/{select-4pl4XBj7.js → navigation-rail-Lxetd5-Z.js} +2214 -1090
- package/dist/navigation-rail-Lxetd5-Z.js.map +1 -0
- package/dist/notification.js +3 -2
- package/dist/notification.js.map +1 -1
- package/dist/peacock-loader.js +22 -10
- package/dist/peacock-loader.js.map +1 -1
- package/dist/search.js +4 -0
- package/dist/search.js.map +1 -1
- package/dist/src/__mixins/BaseButtonMixin.d.ts +20 -0
- package/dist/src/__mixins/BaseHyperlinkMixin.d.ts +18 -0
- package/dist/src/__mixins/MixinConstructor.d.ts +1 -0
- package/dist/src/banner/banner.d.ts +0 -4
- package/dist/src/button/BaseButton.d.ts +4 -47
- package/dist/src/button/button/button.d.ts +32 -3
- package/dist/src/button/button-group/button-group.d.ts +2 -2
- package/dist/src/button/icon-button/icon-button.d.ts +33 -8
- package/dist/src/card/card.d.ts +4 -15
- package/dist/src/fab/fab.d.ts +4 -35
- package/dist/src/focus-ring/focus-ring.d.ts +11 -5
- package/dist/src/index.d.ts +3 -1
- package/dist/src/link/link.d.ts +1 -1
- package/dist/src/navigation-rail/index.d.ts +2 -0
- package/dist/src/navigation-rail/navigation-rail-item.d.ts +55 -0
- package/dist/src/navigation-rail/navigation-rail.d.ts +71 -0
- package/dist/src/sidebar-menu/index.d.ts +3 -0
- package/dist/src/sidebar-menu/sidebar-menu-item.d.ts +58 -0
- package/dist/src/sidebar-menu/sidebar-menu.d.ts +38 -0
- package/dist/src/sidebar-menu/sidebar-sub-menu.d.ts +35 -0
- package/dist/src/toolbar/toolbar.d.ts +10 -10
- package/dist/src/tooltip/tooltip.d.ts +3 -0
- package/dist/src/url-field/index.d.ts +1 -0
- package/dist/src/url-field/url-field.d.ts +48 -0
- package/dist/test/sidebar-menu.test.d.ts +1 -0
- package/dist/toolbar.js +10 -10
- package/dist/toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/readme.md +73 -65
- package/scss/mixin.scss +16 -0
- package/src/__mixins/BaseButtonMixin.ts +83 -0
- package/src/__mixins/BaseHyperlinkMixin.ts +68 -0
- package/src/__mixins/MixinConstructor.ts +1 -0
- package/src/{__base_element → __mixins}/README.md +2 -2
- package/src/banner/banner.scss +18 -22
- package/src/banner/banner.ts +1 -7
- package/src/button/BaseButton.ts +11 -100
- package/src/button/button/button-sizes.scss +4 -2
- package/src/button/button/button.ts +76 -23
- package/src/button/button-group/button-group.ts +2 -2
- package/src/button/icon-button/icon-button.ts +75 -33
- package/src/card/card.ts +11 -71
- package/src/chart-bar/chart-bar.ts +9 -14
- package/src/chart-bar/chart-stacked-bar.ts +12 -18
- package/src/chart-doughnut/chart-doughnut.ts +23 -27
- package/src/chart-pie/chart-pie.ts +19 -23
- package/src/checkbox/checkbox.scss +17 -34
- package/src/checkbox/checkbox.ts +3 -1
- package/src/code-highlighter/code-highlighter.scss +1 -0
- package/src/code-highlighter/code-highlighter.ts +1 -1
- package/src/date-picker/date-picker.ts +1 -1
- package/src/elevation/elevation.scss +5 -5
- package/src/fab/fab.ts +29 -100
- package/src/focus-ring/focus-ring.ts +47 -40
- package/src/index.ts +3 -1
- package/src/input/input.ts +3 -1
- package/src/link/link.ts +2 -2
- package/src/menu/menu-item/menu-item.ts +3 -1
- package/src/navigation-rail/index.ts +2 -0
- package/src/navigation-rail/navigation-rail-item.scss +216 -0
- package/src/navigation-rail/navigation-rail-item.ts +223 -0
- package/src/navigation-rail/navigation-rail.scss +72 -0
- package/src/navigation-rail/navigation-rail.ts +149 -0
- package/src/notification/notification.ts +3 -2
- package/src/number-field/number-field.ts +6 -4
- package/src/pagination/pagination.ts +6 -4
- package/src/peacock-loader.ts +22 -5
- package/src/search/search.ts +4 -0
- package/src/sidebar-menu/demo/index.html +68 -0
- package/src/sidebar-menu/index.ts +3 -0
- package/src/sidebar-menu/sidebar-menu-item.scss +102 -0
- package/src/sidebar-menu/sidebar-menu-item.ts +151 -0
- package/src/{tree-view/tree-view.scss → sidebar-menu/sidebar-menu.scss} +1 -1
- package/src/sidebar-menu/sidebar-menu.ts +182 -0
- package/src/sidebar-menu/sidebar-sub-menu.scss +130 -0
- package/src/sidebar-menu/sidebar-sub-menu.ts +160 -0
- package/src/skeleton/skeleton.scss +18 -24
- package/src/snackbar/snackbar.ts +1 -1
- package/src/tabs/tab.ts +4 -3
- package/src/text/text.css-component.scss +7 -1
- package/src/time-picker/time-picker.ts +1 -1
- package/src/toolbar/toolbar.ts +10 -10
- package/src/tooltip/tooltip.ts +24 -0
- package/src/url-field/index.ts +1 -0
- package/src/url-field/url-field.scss +50 -0
- package/src/url-field/url-field.ts +239 -0
- package/dist/button-DMN1dPAg.js.map +0 -1
- package/dist/button-group-CX9CUUXk.js.map +0 -1
- package/dist/fab-C5Nzxk0E.js +0 -497
- package/dist/fab-C5Nzxk0E.js.map +0 -1
- package/dist/select-4pl4XBj7.js.map +0 -1
- package/dist/spread-B5cgadZl.js +0 -32
- package/dist/spread-B5cgadZl.js.map +0 -1
- package/dist/src/__base_element/BaseHyperlink.d.ts +0 -20
- package/dist/src/tree-view/index.d.ts +0 -2
- package/dist/src/tree-view/tree-node.d.ts +0 -69
- package/dist/src/tree-view/tree-view.d.ts +0 -40
- package/dist/src/tree-view/wc-tree-view.d.ts +0 -6
- package/dist/test/tree-view.test.d.ts +0 -1
- package/dist/throttle-C7ZAPqtu.js +0 -24
- package/dist/throttle-C7ZAPqtu.js.map +0 -1
- package/src/__base_element/BaseHyperlink.ts +0 -42
- package/src/tree-view/demo/index.html +0 -57
- package/src/tree-view/index.ts +0 -2
- package/src/tree-view/tree-node.scss +0 -101
- package/src/tree-view/tree-node.ts +0 -268
- package/src/tree-view/tree-view.ts +0 -182
- package/src/tree-view/wc-tree-view.ts +0 -9
package/dist/src/card/card.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LitElement, nothing
|
|
1
|
+
import { LitElement, nothing } from 'lit';
|
|
2
2
|
type CardVariant = 'elevated' | 'filled' | 'outlined';
|
|
3
|
+
declare const Card_base: typeof LitElement & import("../__mixins/MixinConstructor.js").MixinConstructor<import("@/__mixins/BaseHyperlinkMixin.js").BaseHyperlinkInterface>;
|
|
3
4
|
/**
|
|
4
5
|
* @label Card
|
|
5
6
|
* @tag wc-card
|
|
@@ -17,7 +18,7 @@ type CardVariant = 'elevated' | 'filled' | 'outlined';
|
|
|
17
18
|
* </wc-card>
|
|
18
19
|
* ```
|
|
19
20
|
*/
|
|
20
|
-
export declare class Card extends
|
|
21
|
+
export declare class Card extends Card_base {
|
|
21
22
|
#private;
|
|
22
23
|
static styles: import("lit").CSSResultGroup[];
|
|
23
24
|
variant: CardVariant;
|
|
@@ -27,14 +28,6 @@ export declare class Card extends LitElement {
|
|
|
27
28
|
* If button is disabled, the reason why it is disabled.
|
|
28
29
|
*/
|
|
29
30
|
disabledReason: string;
|
|
30
|
-
/**
|
|
31
|
-
* Hyperlink to navigate to on click.
|
|
32
|
-
*/
|
|
33
|
-
href?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Sets or retrieves the window or frame at which to target content.
|
|
36
|
-
*/
|
|
37
|
-
target: string;
|
|
38
31
|
/**
|
|
39
32
|
* Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
|
|
40
33
|
*/
|
|
@@ -45,17 +38,13 @@ export declare class Card extends LitElement {
|
|
|
45
38
|
isPressed: boolean;
|
|
46
39
|
private slotHasContent;
|
|
47
40
|
readonly cardElement: HTMLElement | null;
|
|
48
|
-
readonly contentSlot: HTMLSlotElement | null;
|
|
49
41
|
firstUpdated(): void;
|
|
50
|
-
updated(changedProperties: PropertyValues<this>): void;
|
|
51
|
-
__syncSlottedChildrenTabIndex(): void;
|
|
52
42
|
__dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void;
|
|
53
43
|
__dispatchClick: (event: MouseEvent | KeyboardEvent) => void;
|
|
54
|
-
__isLink(): boolean;
|
|
55
44
|
__getDisabledReasonID(): string | typeof nothing;
|
|
56
45
|
__renderDisabledReason(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
57
46
|
__handlePress: (event: KeyboardEvent | MouseEvent) => void;
|
|
58
47
|
render(): import("lit-html").TemplateResult<1>;
|
|
59
|
-
renderCardContent(): import("lit-html").TemplateResult<1>;
|
|
48
|
+
renderCardContent(disableSlotTabbing: boolean): import("lit-html").TemplateResult<1>;
|
|
60
49
|
}
|
|
61
50
|
export {};
|
package/dist/src/fab/fab.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { nothing } from 'lit';
|
|
2
|
+
import { BaseButton } from '@/button/BaseButton.js';
|
|
3
3
|
/**
|
|
4
4
|
* @label FAB
|
|
5
5
|
* @tag wc-fab
|
|
@@ -18,25 +18,13 @@ import { IconProvider } from '../icon/icon.js';
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```html
|
|
21
|
-
* <wc-fab name="add"></wc-fab>
|
|
21
|
+
* <wc-fab><wc-icon name="add"></wc-icon></wc-fab>
|
|
22
22
|
* ```
|
|
23
23
|
* @tags controls
|
|
24
24
|
*/
|
|
25
|
-
export declare class Fab extends
|
|
25
|
+
export declare class Fab extends BaseButton {
|
|
26
26
|
#private;
|
|
27
27
|
static styles: import("lit").CSSResultGroup[];
|
|
28
|
-
/**
|
|
29
|
-
* Name of the icon to display inside the FAB.
|
|
30
|
-
*/
|
|
31
|
-
name?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Source URL for a custom icon.
|
|
34
|
-
*/
|
|
35
|
-
src?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Icon provider. Defaults to `"material-symbols"`.
|
|
38
|
-
*/
|
|
39
|
-
provider: IconProvider;
|
|
40
28
|
/**
|
|
41
29
|
* Optional label text for the extended FAB variant.
|
|
42
30
|
* When set, the FAB displays both the icon and a text label.
|
|
@@ -67,18 +55,6 @@ export declare class Fab extends LitElement {
|
|
|
67
55
|
* If `true`, the FAB is in a lowered (resting) state with reduced elevation.
|
|
68
56
|
*/
|
|
69
57
|
lowered: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* If `true`, the user cannot interact with the FAB.
|
|
72
|
-
*/
|
|
73
|
-
disabled: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Hyperlink to navigate to on click.
|
|
76
|
-
*/
|
|
77
|
-
href?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Sets or retrieves the window or frame at which to target content.
|
|
80
|
-
*/
|
|
81
|
-
target: string;
|
|
82
58
|
/**
|
|
83
59
|
* Additional ARIA attributes to pass to the inner button/anchor element.
|
|
84
60
|
*/
|
|
@@ -94,18 +70,11 @@ export declare class Fab extends LitElement {
|
|
|
94
70
|
*/
|
|
95
71
|
tooltip?: string;
|
|
96
72
|
isPressed: boolean;
|
|
97
|
-
readonly fabElement: HTMLElement | null;
|
|
98
73
|
focus(): void;
|
|
99
74
|
blur(): void;
|
|
100
|
-
connectedCallback(): void;
|
|
101
|
-
disconnectedCallback(): void;
|
|
102
75
|
firstUpdated(): void;
|
|
103
|
-
__handlePress: (event: KeyboardEvent | MouseEvent) => void;
|
|
104
|
-
__isLink(): boolean;
|
|
105
|
-
__dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void;
|
|
106
76
|
__dispatchClick: (event: MouseEvent | KeyboardEvent) => void;
|
|
107
77
|
__getDisabledReasonID(): string | typeof nothing;
|
|
108
78
|
render(): import("lit-html").TemplateResult<1>;
|
|
109
79
|
__renderFabContent(isExtended: boolean): import("lit-html").TemplateResult<1>;
|
|
110
|
-
__renderTooltip(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
111
80
|
}
|
|
@@ -14,17 +14,23 @@ export declare class FocusRing extends LitElement {
|
|
|
14
14
|
static styles: import("lit").CSSResultGroup[];
|
|
15
15
|
visible: boolean;
|
|
16
16
|
for: string;
|
|
17
|
+
private __boundFocusin;
|
|
18
|
+
private __boundFocusout;
|
|
19
|
+
private __boundPointerdown;
|
|
17
20
|
render(): symbol;
|
|
18
|
-
_control?: HTMLElement;
|
|
19
|
-
_focusTarget?: HTMLElement;
|
|
20
|
-
get control(): HTMLElement | null;
|
|
21
|
-
set control(control: HTMLElement | null);
|
|
22
|
-
set forElement(value: HTMLElement | null);
|
|
23
21
|
connectedCallback(): void;
|
|
24
22
|
disconnectedCallback(): void;
|
|
23
|
+
updated(changed: Map<string, unknown>): void;
|
|
25
24
|
__focusin(): void;
|
|
26
25
|
__focusout(): void;
|
|
27
26
|
__pointerdown(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Resolves the element that should receive focus-ring event listeners by id.
|
|
29
|
+
* Prefers lookup from the current control's root node, then falls back to a
|
|
30
|
+
* document-level lookup.
|
|
31
|
+
*
|
|
32
|
+
* @returns The resolved focus target, if one can be found.
|
|
33
|
+
*/
|
|
28
34
|
__getFocusTarget(): HTMLElement | undefined;
|
|
29
35
|
attach(): void;
|
|
30
36
|
detach(): void;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { LinearProgress } from './progress/linear-progress/index.js';
|
|
|
17
17
|
export { CircularProgress } from './progress/circular-progress/index.js';
|
|
18
18
|
export { Skeleton } from './skeleton/index.js';
|
|
19
19
|
export { Input } from './input/index.js';
|
|
20
|
+
export { UrlField } from './url-field/index.js';
|
|
20
21
|
export { Field } from './field/index.js';
|
|
21
22
|
export { NumberField } from './number-field/index.js';
|
|
22
23
|
export { DatePicker } from './date-picker/index.js';
|
|
@@ -41,7 +42,7 @@ export { ChartPie } from './chart-pie/index.js';
|
|
|
41
42
|
export { ChartBar, ChartStackedBar } from './chart-bar/index.js';
|
|
42
43
|
export { Table } from './table/index.js';
|
|
43
44
|
export { Pagination } from './pagination/index.js';
|
|
44
|
-
export {
|
|
45
|
+
export { SidebarMenu, SidebarMenuItem, SidebarSubMenu } from './sidebar-menu/index.js';
|
|
45
46
|
export { Card } from './card/index.js';
|
|
46
47
|
export { Banner } from './banner/index.js';
|
|
47
48
|
export { Notification } from './notification/index.js';
|
|
@@ -54,3 +55,4 @@ export type { SelectOption } from './select/index.js';
|
|
|
54
55
|
export { SelectOptionElement } from './select/index.js';
|
|
55
56
|
export { Search } from './search/index.js';
|
|
56
57
|
export { Toolbar } from './toolbar/index.js';
|
|
58
|
+
export { NavigationRail, NavigationRailItem } from './navigation-rail/index.js';
|
package/dist/src/link/link.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
declare const Link_base: typeof LitElement & (
|
|
2
|
+
declare const Link_base: typeof LitElement & import("../__mixins/MixinConstructor.js").MixinConstructor<import("../__mixins/BaseHyperlinkMixin.js").BaseHyperlinkInterface>;
|
|
3
3
|
/**
|
|
4
4
|
* @label Link
|
|
5
5
|
* @tag wc-link
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { LitElement, nothing } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Navigation Rail Item
|
|
4
|
+
* @tag wc-navigation-rail-item
|
|
5
|
+
* @rawTag navigation-rail-item
|
|
6
|
+
* @parentRawTag navigation-rail
|
|
7
|
+
*
|
|
8
|
+
* @summary An individual item within a navigation rail.
|
|
9
|
+
* @overview
|
|
10
|
+
* <p>Navigation rail items display a destination with an icon and optional label.</p>
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```html
|
|
14
|
+
* <wc-navigation-rail-item>
|
|
15
|
+
* <wc-icon slot="icon">home</wc-icon>
|
|
16
|
+
* Home
|
|
17
|
+
* </wc-navigation-rail-item>
|
|
18
|
+
* ```
|
|
19
|
+
* @tags navigation
|
|
20
|
+
*/
|
|
21
|
+
export declare class NavigationRailItem extends LitElement {
|
|
22
|
+
#private;
|
|
23
|
+
static styles: import("lit").CSSResultGroup[];
|
|
24
|
+
/** Whether this item is currently active/selected. */
|
|
25
|
+
active: boolean;
|
|
26
|
+
/** Whether this item is disabled. */
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
/** Whether the parent rail is in collapsed mode (labels hidden). */
|
|
29
|
+
collapsed: boolean;
|
|
30
|
+
/** If provided, the item renders as a link. */
|
|
31
|
+
href?: string;
|
|
32
|
+
/** Link target. */
|
|
33
|
+
target: string;
|
|
34
|
+
/** Value used for identification when managing active state externally. */
|
|
35
|
+
value?: string;
|
|
36
|
+
/** Reason the item is disabled (shown to screen readers). */
|
|
37
|
+
disabledReason: string;
|
|
38
|
+
/** Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds. */
|
|
39
|
+
throttleDelay: number;
|
|
40
|
+
private _isPressed;
|
|
41
|
+
private _hasLabel;
|
|
42
|
+
private _hasActiveIcon;
|
|
43
|
+
readonly itemElement: HTMLElement | null;
|
|
44
|
+
focus(): void;
|
|
45
|
+
blur(): void;
|
|
46
|
+
firstUpdated(): void;
|
|
47
|
+
__dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void;
|
|
48
|
+
__dispatchClick: (event: MouseEvent | KeyboardEvent) => void;
|
|
49
|
+
__handlePress: (event: KeyboardEvent | MouseEvent) => void;
|
|
50
|
+
__isLink(): boolean;
|
|
51
|
+
__getDisabledReasonID(): string | typeof nothing;
|
|
52
|
+
__renderDisabledReason(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
53
|
+
__renderItemContent(): import("lit-html").TemplateResult<1>;
|
|
54
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { NavigationRailItem } from './navigation-rail-item.js';
|
|
3
|
+
/**
|
|
4
|
+
* @label Navigation Rail
|
|
5
|
+
* @tag wc-navigation-rail
|
|
6
|
+
* @rawTag navigation-rail
|
|
7
|
+
*
|
|
8
|
+
* @summary A vertical side navigation for medium-sized screens, following Material Design 3 specs.
|
|
9
|
+
* @overview
|
|
10
|
+
* <p>Navigation rail provides access to primary destinations in an app using icons—with or without labels—on a vertical rail.</p>
|
|
11
|
+
* <p>Use navigation rail on medium-sized screens (tablets) with 3–7 destinations.</p>
|
|
12
|
+
*
|
|
13
|
+
* @cssprop --nav-rail-width - Width of the rail container. Defaults to 5rem (80dp).
|
|
14
|
+
* @cssprop --nav-rail-container-color - Background color of the rail. Defaults to surface color.
|
|
15
|
+
* @cssprop --nav-rail-indicator-color - Color of the active indicator. Defaults to secondary-container.
|
|
16
|
+
* @cssprop --nav-rail-indicator-shape - Shape (border-radius) of the active indicator. Defaults to full (pill).
|
|
17
|
+
* @cssprop --nav-rail-indicator-width - Width of the active indicator. Defaults to 3.5rem (56dp).
|
|
18
|
+
* @cssprop --nav-rail-indicator-height - Height of the active indicator. Defaults to 2rem (32dp).
|
|
19
|
+
* @cssprop --nav-rail-inactive-icon-color - Color of inactive icons. Defaults to on-surface-variant.
|
|
20
|
+
* @cssprop --nav-rail-active-icon-color - Color of active icons. Defaults to on-secondary-container.
|
|
21
|
+
* @cssprop --nav-rail-inactive-label-color - Color of inactive labels. Defaults to on-surface-variant.
|
|
22
|
+
* @cssprop --nav-rail-active-label-color - Color of active labels. Defaults to on-surface.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```html
|
|
26
|
+
* <wc-navigation-rail>
|
|
27
|
+
* <wc-navigation-rail-item active>
|
|
28
|
+
* <wc-icon slot="icon">home</wc-icon>
|
|
29
|
+
* Home
|
|
30
|
+
* </wc-navigation-rail-item>
|
|
31
|
+
* <wc-navigation-rail-item>
|
|
32
|
+
* <wc-icon slot="icon">search</wc-icon>
|
|
33
|
+
* Search
|
|
34
|
+
* </wc-navigation-rail-item>
|
|
35
|
+
* <wc-navigation-rail-item>
|
|
36
|
+
* <wc-icon slot="icon">settings</wc-icon>
|
|
37
|
+
* Settings
|
|
38
|
+
* </wc-navigation-rail-item>
|
|
39
|
+
* </wc-navigation-rail>
|
|
40
|
+
* ```
|
|
41
|
+
* @tags navigation
|
|
42
|
+
*/
|
|
43
|
+
export declare class NavigationRail extends LitElement {
|
|
44
|
+
static styles: import("lit").CSSResultGroup[];
|
|
45
|
+
static Item: typeof NavigationRailItem;
|
|
46
|
+
/**
|
|
47
|
+
* Vertical alignment of items within the rail.
|
|
48
|
+
* - `"top"`: Items align to the top.
|
|
49
|
+
* - `"center"`: Items are centered (default).
|
|
50
|
+
* - `"bottom"`: Items align to the bottom.
|
|
51
|
+
*/
|
|
52
|
+
alignment: 'top' | 'center' | 'bottom';
|
|
53
|
+
/**
|
|
54
|
+
* Display mode of the navigation rail.
|
|
55
|
+
* - `"expanded"`: shows labels.
|
|
56
|
+
* - `"collapsed"`: hides labels.
|
|
57
|
+
*/
|
|
58
|
+
mode: 'expanded' | 'collapsed';
|
|
59
|
+
/**
|
|
60
|
+
* Whether to show a divider between the header and items sections.
|
|
61
|
+
*/
|
|
62
|
+
showDivider: boolean;
|
|
63
|
+
connectedCallback(): void;
|
|
64
|
+
disconnectedCallback(): void;
|
|
65
|
+
protected firstUpdated(): void;
|
|
66
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
67
|
+
private _handleItemClick;
|
|
68
|
+
private _getItems;
|
|
69
|
+
private _syncItemMode;
|
|
70
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Sidebar Menu Item
|
|
4
|
+
* @tag wc-sidebar-menu-item
|
|
5
|
+
* @rawTag sidebar-menu-item
|
|
6
|
+
* @parentRawTag sidebar-menu
|
|
7
|
+
* @summary A sidebar menu item represents a selectable leaf item in the sidebar navigation tree.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```html
|
|
11
|
+
* <wc-sidebar-menu>
|
|
12
|
+
* <wc-sidebar-sub-menu label="Parent" expanded>
|
|
13
|
+
* <wc-sidebar-menu-item label="Child"></wc-sidebar-menu-item>
|
|
14
|
+
* </wc-sidebar-sub-menu>
|
|
15
|
+
* </wc-sidebar-menu>
|
|
16
|
+
* ```
|
|
17
|
+
* @tags navigation
|
|
18
|
+
*/
|
|
19
|
+
export declare class SidebarMenuItem extends LitElement {
|
|
20
|
+
static styles: import("lit").CSSResultGroup[];
|
|
21
|
+
/**
|
|
22
|
+
* The value used to identify this item when selected.
|
|
23
|
+
*/
|
|
24
|
+
value: string;
|
|
25
|
+
/**
|
|
26
|
+
* The display label for this item.
|
|
27
|
+
*/
|
|
28
|
+
label: string;
|
|
29
|
+
/**
|
|
30
|
+
* Optional icon name to display before the label.
|
|
31
|
+
*/
|
|
32
|
+
icon: string;
|
|
33
|
+
/**
|
|
34
|
+
* Optional hyperlink to navigate to on click.
|
|
35
|
+
*/
|
|
36
|
+
href: string;
|
|
37
|
+
/**
|
|
38
|
+
* Sets or retrieves the window or frame at which to target content.
|
|
39
|
+
*/
|
|
40
|
+
target: string;
|
|
41
|
+
/**
|
|
42
|
+
* If true, the user cannot interact with the item.
|
|
43
|
+
*/
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the item is currently selected.
|
|
47
|
+
*/
|
|
48
|
+
selected: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The nesting depth level (set automatically by the parent sidebar-menu).
|
|
51
|
+
*/
|
|
52
|
+
level: number;
|
|
53
|
+
private readonly _nativeElement;
|
|
54
|
+
focus(): void;
|
|
55
|
+
blur(): void;
|
|
56
|
+
private _onClick;
|
|
57
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Sidebar Menu
|
|
4
|
+
* @tag wc-sidebar-menu
|
|
5
|
+
* @rawTag sidebar-menu
|
|
6
|
+
* @summary A sidebar menu is a hierarchical structure that provides nested levels of navigation. It supports keyboard navigation, single/multi select, and expandable items.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```html
|
|
10
|
+
* <wc-sidebar-menu>
|
|
11
|
+
* <wc-sidebar-sub-menu label="Parent" expanded>
|
|
12
|
+
* <wc-sidebar-menu-item label="Child 1"></wc-sidebar-menu-item>
|
|
13
|
+
* <wc-sidebar-menu-item label="Child 2"></wc-sidebar-menu-item>
|
|
14
|
+
* </wc-sidebar-sub-menu>
|
|
15
|
+
* </wc-sidebar-menu>
|
|
16
|
+
* ```
|
|
17
|
+
* @tags navigation
|
|
18
|
+
*/
|
|
19
|
+
export declare class SidebarMenu extends LitElement {
|
|
20
|
+
static styles: import("lit").CSSResultGroup[];
|
|
21
|
+
/**
|
|
22
|
+
* The value of the currently selected item.
|
|
23
|
+
*/
|
|
24
|
+
selectedItem: string;
|
|
25
|
+
connectedCallback(): void;
|
|
26
|
+
updated(changedProps: Map<string, unknown>): void;
|
|
27
|
+
disconnectedCallback(): void;
|
|
28
|
+
private _isSidebarNode;
|
|
29
|
+
private _getTopLevelItems;
|
|
30
|
+
private _getChildNodes;
|
|
31
|
+
private _getAllVisibleItems;
|
|
32
|
+
private _onItemClick;
|
|
33
|
+
private _updateSelectedState;
|
|
34
|
+
private _collectAllItems;
|
|
35
|
+
private _syncSelectedStateFromProperty;
|
|
36
|
+
private _onKeyDown;
|
|
37
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Sidebar Sub Menu
|
|
4
|
+
* @tag wc-sidebar-sub-menu
|
|
5
|
+
* @rawTag sidebar-sub-menu
|
|
6
|
+
* @parentRawTag sidebar-menu
|
|
7
|
+
* @summary A sidebar sub menu groups sidebar menu items and handles expand/collapse behavior.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```html
|
|
11
|
+
* <wc-sidebar-sub-menu label="Parent" expanded>
|
|
12
|
+
* <wc-sidebar-menu-item label="Child"></wc-sidebar-menu-item>
|
|
13
|
+
* </wc-sidebar-sub-menu>
|
|
14
|
+
* ```
|
|
15
|
+
* @tags navigation
|
|
16
|
+
*/
|
|
17
|
+
export declare class SidebarSubMenu extends LitElement {
|
|
18
|
+
static styles: import("lit").CSSResultGroup[];
|
|
19
|
+
value: string;
|
|
20
|
+
label: string;
|
|
21
|
+
icon: string;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
selected: boolean;
|
|
24
|
+
expanded: boolean;
|
|
25
|
+
level: number;
|
|
26
|
+
private readonly _nativeElement;
|
|
27
|
+
focus(): void;
|
|
28
|
+
blur(): void;
|
|
29
|
+
connectedCallback(): void;
|
|
30
|
+
updated(changedProps: Map<string, unknown>): void;
|
|
31
|
+
private _getChildNodes;
|
|
32
|
+
private _updateChildLevels;
|
|
33
|
+
private _onClick;
|
|
34
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
35
|
+
}
|
|
@@ -27,10 +27,10 @@ import { LitElement } from 'lit';
|
|
|
27
27
|
* ```html
|
|
28
28
|
* <!-- Docked toolbar -->
|
|
29
29
|
* <wc-toolbar>
|
|
30
|
-
* <wc-icon-button variant="text" name="home"></wc-icon-button>
|
|
31
|
-
* <wc-icon-button variant="tonal" name="search"></wc-icon-button>
|
|
32
|
-
* <wc-icon-button variant="text" name="favorite"></wc-icon-button>
|
|
33
|
-
* <wc-icon-button variant="text" name="account_circle"></wc-icon-button>
|
|
30
|
+
* <wc-icon-button variant="text"><wc-icon name="home"></wc-icon></wc-icon-button>
|
|
31
|
+
* <wc-icon-button variant="tonal"><wc-icon name="search"></wc-icon></wc-icon-button>
|
|
32
|
+
* <wc-icon-button variant="text"><wc-icon name="favorite"></wc-icon></wc-icon-button>
|
|
33
|
+
* <wc-icon-button variant="text"><wc-icon name="account_circle"></wc-icon></wc-icon-button>
|
|
34
34
|
* </wc-toolbar>
|
|
35
35
|
* ```
|
|
36
36
|
*
|
|
@@ -38,9 +38,9 @@ import { LitElement } from 'lit';
|
|
|
38
38
|
* ```html
|
|
39
39
|
* <!-- Floating horizontal toolbar -->
|
|
40
40
|
* <wc-toolbar variant="floating" orientation="horizontal">
|
|
41
|
-
* <wc-icon-button variant="tonal" name="home"></wc-icon-button>
|
|
42
|
-
* <wc-icon-button variant="text" name="search"></wc-icon-button>
|
|
43
|
-
* <wc-icon-button variant="text" name="favorite"></wc-icon-button>
|
|
41
|
+
* <wc-icon-button variant="tonal"><wc-icon name="home"></wc-icon></wc-icon-button>
|
|
42
|
+
* <wc-icon-button variant="text"><wc-icon name="search"></wc-icon></wc-icon-button>
|
|
43
|
+
* <wc-icon-button variant="text"><wc-icon name="favorite"></wc-icon></wc-icon-button>
|
|
44
44
|
* </wc-toolbar>
|
|
45
45
|
* ```
|
|
46
46
|
*
|
|
@@ -48,9 +48,9 @@ import { LitElement } from 'lit';
|
|
|
48
48
|
* ```html
|
|
49
49
|
* <!-- Floating vertical toolbar -->
|
|
50
50
|
* <wc-toolbar variant="floating" orientation="vertical">
|
|
51
|
-
* <wc-icon-button variant="tonal" name="home"></wc-icon-button>
|
|
52
|
-
* <wc-icon-button variant="text" name="search"></wc-icon-button>
|
|
53
|
-
* <wc-icon-button variant="text" name="favorite"></wc-icon-button>
|
|
51
|
+
* <wc-icon-button variant="tonal"><wc-icon name="home"></wc-icon></wc-icon-button>
|
|
52
|
+
* <wc-icon-button variant="text"><wc-icon name="search"></wc-icon></wc-icon-button>
|
|
53
|
+
* <wc-icon-button variant="text"><wc-icon name="favorite"></wc-icon></wc-icon-button>
|
|
54
54
|
* </wc-toolbar>
|
|
55
55
|
* ```
|
|
56
56
|
* @tags display navigation
|
|
@@ -40,6 +40,9 @@ export declare class Tooltip extends LitElement {
|
|
|
40
40
|
private _handleGlobalOpen;
|
|
41
41
|
private _handleDocumentClick;
|
|
42
42
|
private detachListeners;
|
|
43
|
+
_focusTarget?: HTMLElement;
|
|
44
|
+
set forElement(value: HTMLElement | null);
|
|
45
|
+
__getFocusTarget(): HTMLElement | null;
|
|
43
46
|
private attachListeners;
|
|
44
47
|
connectedCallback(): void;
|
|
45
48
|
disconnectedCallback(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UrlField } from './url-field.js';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import BaseInput from '../input/BaseInput.js';
|
|
2
|
+
/**
|
|
3
|
+
* @label URL Field
|
|
4
|
+
* @tag wc-url-field
|
|
5
|
+
* @rawTag url-field
|
|
6
|
+
*
|
|
7
|
+
* @summary A field for entering and displaying URLs with validation.
|
|
8
|
+
* @overview
|
|
9
|
+
* <p>URL Field wraps an input with URL validation, showing a clickable link preview when not in edit mode.</p>
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```html
|
|
13
|
+
* <wc-url-field label="Website" value="https://example.com"></wc-url-field>
|
|
14
|
+
* ```
|
|
15
|
+
* @tags form
|
|
16
|
+
*/
|
|
17
|
+
export declare class UrlField extends BaseInput {
|
|
18
|
+
static styles: import("lit").CSSResultGroup[];
|
|
19
|
+
value: string;
|
|
20
|
+
name: string;
|
|
21
|
+
placeholder: string;
|
|
22
|
+
label: string;
|
|
23
|
+
editing: boolean;
|
|
24
|
+
debounce: number;
|
|
25
|
+
size: 'sm' | 'md' | 'lg';
|
|
26
|
+
variant: 'filled' | 'outlined' | 'default';
|
|
27
|
+
helperText: string;
|
|
28
|
+
error: boolean;
|
|
29
|
+
errorText: string;
|
|
30
|
+
warning: boolean;
|
|
31
|
+
warningText: string;
|
|
32
|
+
private focused;
|
|
33
|
+
private isValid;
|
|
34
|
+
private inputElement?;
|
|
35
|
+
private debounceTimer?;
|
|
36
|
+
disconnectedCallback(): void;
|
|
37
|
+
focus(): void;
|
|
38
|
+
blur(): void;
|
|
39
|
+
private startEditing;
|
|
40
|
+
private closeEditing;
|
|
41
|
+
private validateUrl;
|
|
42
|
+
private handleInput;
|
|
43
|
+
private handleFocusChange;
|
|
44
|
+
private handleBlur;
|
|
45
|
+
private handleChange;
|
|
46
|
+
private renderDisplayValue;
|
|
47
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/toolbar.js
CHANGED
|
@@ -195,10 +195,10 @@ var Toolbar_1;
|
|
|
195
195
|
* ```html
|
|
196
196
|
* <!-- Docked toolbar -->
|
|
197
197
|
* <wc-toolbar>
|
|
198
|
-
* <wc-icon-button variant="text" name="home"></wc-icon-button>
|
|
199
|
-
* <wc-icon-button variant="tonal" name="search"></wc-icon-button>
|
|
200
|
-
* <wc-icon-button variant="text" name="favorite"></wc-icon-button>
|
|
201
|
-
* <wc-icon-button variant="text" name="account_circle"></wc-icon-button>
|
|
198
|
+
* <wc-icon-button variant="text"><wc-icon name="home"></wc-icon></wc-icon-button>
|
|
199
|
+
* <wc-icon-button variant="tonal"><wc-icon name="search"></wc-icon></wc-icon-button>
|
|
200
|
+
* <wc-icon-button variant="text"><wc-icon name="favorite"></wc-icon></wc-icon-button>
|
|
201
|
+
* <wc-icon-button variant="text"><wc-icon name="account_circle"></wc-icon></wc-icon-button>
|
|
202
202
|
* </wc-toolbar>
|
|
203
203
|
* ```
|
|
204
204
|
*
|
|
@@ -206,9 +206,9 @@ var Toolbar_1;
|
|
|
206
206
|
* ```html
|
|
207
207
|
* <!-- Floating horizontal toolbar -->
|
|
208
208
|
* <wc-toolbar variant="floating" orientation="horizontal">
|
|
209
|
-
* <wc-icon-button variant="tonal" name="home"></wc-icon-button>
|
|
210
|
-
* <wc-icon-button variant="text" name="search"></wc-icon-button>
|
|
211
|
-
* <wc-icon-button variant="text" name="favorite"></wc-icon-button>
|
|
209
|
+
* <wc-icon-button variant="tonal"><wc-icon name="home"></wc-icon></wc-icon-button>
|
|
210
|
+
* <wc-icon-button variant="text"><wc-icon name="search"></wc-icon></wc-icon-button>
|
|
211
|
+
* <wc-icon-button variant="text"><wc-icon name="favorite"></wc-icon></wc-icon-button>
|
|
212
212
|
* </wc-toolbar>
|
|
213
213
|
* ```
|
|
214
214
|
*
|
|
@@ -216,9 +216,9 @@ var Toolbar_1;
|
|
|
216
216
|
* ```html
|
|
217
217
|
* <!-- Floating vertical toolbar -->
|
|
218
218
|
* <wc-toolbar variant="floating" orientation="vertical">
|
|
219
|
-
* <wc-icon-button variant="tonal" name="home"></wc-icon-button>
|
|
220
|
-
* <wc-icon-button variant="text" name="search"></wc-icon-button>
|
|
221
|
-
* <wc-icon-button variant="text" name="favorite"></wc-icon-button>
|
|
219
|
+
* <wc-icon-button variant="tonal"><wc-icon name="home"></wc-icon></wc-icon-button>
|
|
220
|
+
* <wc-icon-button variant="text"><wc-icon name="search"></wc-icon></wc-icon-button>
|
|
221
|
+
* <wc-icon-button variant="text"><wc-icon name="favorite"></wc-icon></wc-icon-button>
|
|
222
222
|
* </wc-toolbar>
|
|
223
223
|
* ```
|
|
224
224
|
* @tags display navigation
|
package/dist/toolbar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.js","sources":["../../src/toolbar/toolbar.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './toolbar.scss';\nimport colorStyles from './toolbar-colors.scss';\n\n/**\n * @label Toolbar\n * @tag wc-toolbar\n * @rawTag toolbar\n *\n * @summary A Material 3 toolbar / app bar for navigation and actions.\n * @overview\n * <p>The toolbar component implements the Material 3 app bar pattern. It supports a\n * docked (attached) variant for bottom-panel navigation and a floating (detached pill-shaped)\n * variant. The floating variant supports both horizontal and vertical orientations.</p>\n *\n * <p>Render toolbar actions directly as children of the component. The docked variant is\n * optimized for a horizontal action row, while the floating variant supports both horizontal\n * and vertical layouts.</p>\n *\n * @cssprop --toolbar-container-color - Background color of the toolbar.\n * @cssprop --toolbar-container-shape - Border radius of the toolbar. Relevant for the floating variant.\n * @cssprop --toolbar-height - Height of the toolbar (docked horizontal / floating horizontal).\n * @cssprop --toolbar-padding-inline - Inline padding of the toolbar.\n * @cssprop --toolbar-gap - Gap between toolbar sections.\n * @cssprop --toolbar-icon-color - Color of icon slots.\n * @cssprop --toolbar-title-color - Color of the title (default slot) text.\n * @cssprop --toolbar-shadow - Box-shadow of the toolbar.\n *\n * @example\n * ```html\n * <!-- Docked toolbar -->\n * <wc-toolbar>\n * <wc-icon-button variant=\"text\" name=\"home\"></wc-icon-button>\n * <wc-icon-button variant=\"tonal\" name=\"search\"></wc-icon-button>\n * <wc-icon-button variant=\"text\" name=\"favorite\"></wc-icon-button>\n * <wc-icon-button variant=\"text\" name=\"account_circle\"></wc-icon-button>\n * </wc-toolbar>\n * ```\n *\n * @example\n * ```html\n * <!-- Floating horizontal toolbar -->\n * <wc-toolbar variant=\"floating\" orientation=\"horizontal\">\n * <wc-icon-button variant=\"tonal\" name=\"home\"></wc-icon-button>\n * <wc-icon-button variant=\"text\" name=\"search\"></wc-icon-button>\n * <wc-icon-button variant=\"text\" name=\"favorite\"></wc-icon-button>\n * </wc-toolbar>\n * ```\n *\n * @example\n * ```html\n * <!-- Floating vertical toolbar -->\n * <wc-toolbar variant=\"floating\" orientation=\"vertical\">\n * <wc-icon-button variant=\"tonal\" name=\"home\"></wc-icon-button>\n * <wc-icon-button variant=\"text\" name=\"search\"></wc-icon-button>\n * <wc-icon-button variant=\"text\" name=\"favorite\"></wc-icon-button>\n * </wc-toolbar>\n * ```\n * @tags display navigation\n */\n@IndividualComponent\nexport class Toolbar extends LitElement {\n static styles = [styles, colorStyles];\n\n /**\n * Visual and layout variant of the toolbar.\n * - `\"docked\"`: A full-width bar attached to the edge of the screen (default).\n * - `\"floating\"`: A detached pill-shaped toolbar that floats over content.\n */\n @property({ type: String, reflect: true })\n variant: 'docked' | 'floating' = 'docked';\n\n /**\n * Orientation of the toolbar content.\n * - `\"horizontal\"`: Items are laid out left to right (default).\n * - `\"vertical\"`: Items are stacked top to bottom. Primarily useful for the floating variant.\n */\n @property({ type: String, reflect: true })\n orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Size of the docked toolbar.\n * - `\"small\"`: 80dp height (default).\n * - `\"medium\"`: 96dp height.\n * - `\"large\"`: 112dp height.\n */\n @property({ type: String, reflect: true })\n size: 'small' | 'medium' | 'large' = 'small';\n\n /**\n * Whether the toolbar is visually elevated (adds a shadow).\n */\n @property({ type: Boolean, reflect: true })\n elevated: boolean = false;\n\n override render() {\n const cssClasses = {\n toolbar: true,\n [`variant-${this.variant}`]: true,\n [`orientation-${this.orientation}`]: true,\n [`size-${this.size}`]: true,\n elevated: this.elevated,\n };\n\n if (this.variant === 'floating') {\n return Toolbar.__renderFloating(cssClasses);\n }\n\n return Toolbar.__renderDocked(cssClasses);\n }\n\n private static __renderDocked(cssClasses: Record<string, boolean>) {\n return html`\n <div class=${classMap(cssClasses)} role=\"toolbar\">\n <div class=\"background\"></div>\n <div class=\"toolbar-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n private static __renderFloating(cssClasses: Record<string, boolean>) {\n return html`\n <div class=${classMap(cssClasses)} role=\"toolbar\">\n <wc-elevation class=\"elevation\"></wc-elevation>\n <div class=\"background\"></div>\n <div class=\"toolbar-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","colorStyles","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;AAEI,IAAM,OAAO,GAAA,SAAA,GAAb,MAAM,OAAQ,SAAQA,GAAU,CAAA;AAAhC,IAAA,WAAA,GAAA;;AAGL;;;;AAIG;QAEH,IAAA,CAAA,OAAO,GAA0B,QAAQ;AAEzC;;;;AAIG;QAEH,IAAA,CAAA,WAAW,GAA8B,YAAY;AAErD;;;;;AAKG;QAEH,IAAA,CAAA,IAAI,GAAiC,OAAO;AAE5C;;AAEG;QAEH,IAAA,CAAA,QAAQ,GAAY,KAAK;IAwC3B;IAtCW,MAAM,GAAA;AACb,QAAA,MAAM,UAAU,GAAG;AACjB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,CAAC,WAAW,IAAI,CAAC,OAAO,CAAA,CAAE,GAAG,IAAI;AACjC,YAAA,CAAC,eAAe,IAAI,CAAC,WAAW,CAAA,CAAE,GAAG,IAAI;AACzC,YAAA,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAA,CAAE,GAAG,IAAI;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;AAED,QAAA,IAAI,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE;AAC/B,YAAA,OAAO,SAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC;QAC7C;AAEA,QAAA,OAAO,SAAO,CAAC,cAAc,CAAC,UAAU,CAAC;IAC3C;IAEQ,OAAO,cAAc,CAAC,UAAmC,EAAA;AAC/D,QAAA,OAAOC,CAAI,CAAA;mBACIC,CAAQ,CAAC,UAAU,CAAC,CAAA;;;;;;KAMlC;IACH;IAEQ,OAAO,gBAAgB,CAAC,UAAmC,EAAA;AACjE,QAAA,OAAOD,CAAI,CAAA;mBACIC,CAAQ,CAAC,UAAU,CAAC,CAAA;;;;;;;KAOlC;IACH;;AAtEO,OAAA,CAAA,MAAM,GAAG,CAACC,UAAM,EAAEC,QAAW,CAAC;AAQrC,UAAA,CAAA;IADCC,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACC,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAQ1C,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACa,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAStD,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACI,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAM7C,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAChB,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAhCf,OAAO,GAAA,SAAA,GAAA,UAAA,CAAA;IADnB;AACY,CAAA,EAAA,OAAO,CAwEnB;;;;"}
|
|
1
|
+
{"version":3,"file":"toolbar.js","sources":["../../src/toolbar/toolbar.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './toolbar.scss';\nimport colorStyles from './toolbar-colors.scss';\n\n/**\n * @label Toolbar\n * @tag wc-toolbar\n * @rawTag toolbar\n *\n * @summary A Material 3 toolbar / app bar for navigation and actions.\n * @overview\n * <p>The toolbar component implements the Material 3 app bar pattern. It supports a\n * docked (attached) variant for bottom-panel navigation and a floating (detached pill-shaped)\n * variant. The floating variant supports both horizontal and vertical orientations.</p>\n *\n * <p>Render toolbar actions directly as children of the component. The docked variant is\n * optimized for a horizontal action row, while the floating variant supports both horizontal\n * and vertical layouts.</p>\n *\n * @cssprop --toolbar-container-color - Background color of the toolbar.\n * @cssprop --toolbar-container-shape - Border radius of the toolbar. Relevant for the floating variant.\n * @cssprop --toolbar-height - Height of the toolbar (docked horizontal / floating horizontal).\n * @cssprop --toolbar-padding-inline - Inline padding of the toolbar.\n * @cssprop --toolbar-gap - Gap between toolbar sections.\n * @cssprop --toolbar-icon-color - Color of icon slots.\n * @cssprop --toolbar-title-color - Color of the title (default slot) text.\n * @cssprop --toolbar-shadow - Box-shadow of the toolbar.\n *\n * @example\n * ```html\n * <!-- Docked toolbar -->\n * <wc-toolbar>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"tonal\"><wc-icon name=\"search\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"favorite\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"account_circle\"></wc-icon></wc-icon-button>\n * </wc-toolbar>\n * ```\n *\n * @example\n * ```html\n * <!-- Floating horizontal toolbar -->\n * <wc-toolbar variant=\"floating\" orientation=\"horizontal\">\n * <wc-icon-button variant=\"tonal\"><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"search\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"favorite\"></wc-icon></wc-icon-button>\n * </wc-toolbar>\n * ```\n *\n * @example\n * ```html\n * <!-- Floating vertical toolbar -->\n * <wc-toolbar variant=\"floating\" orientation=\"vertical\">\n * <wc-icon-button variant=\"tonal\"><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"search\"></wc-icon></wc-icon-button>\n * <wc-icon-button variant=\"text\"><wc-icon name=\"favorite\"></wc-icon></wc-icon-button>\n * </wc-toolbar>\n * ```\n * @tags display navigation\n */\n@IndividualComponent\nexport class Toolbar extends LitElement {\n static styles = [styles, colorStyles];\n\n /**\n * Visual and layout variant of the toolbar.\n * - `\"docked\"`: A full-width bar attached to the edge of the screen (default).\n * - `\"floating\"`: A detached pill-shaped toolbar that floats over content.\n */\n @property({ type: String, reflect: true })\n variant: 'docked' | 'floating' = 'docked';\n\n /**\n * Orientation of the toolbar content.\n * - `\"horizontal\"`: Items are laid out left to right (default).\n * - `\"vertical\"`: Items are stacked top to bottom. Primarily useful for the floating variant.\n */\n @property({ type: String, reflect: true })\n orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Size of the docked toolbar.\n * - `\"small\"`: 80dp height (default).\n * - `\"medium\"`: 96dp height.\n * - `\"large\"`: 112dp height.\n */\n @property({ type: String, reflect: true })\n size: 'small' | 'medium' | 'large' = 'small';\n\n /**\n * Whether the toolbar is visually elevated (adds a shadow).\n */\n @property({ type: Boolean, reflect: true })\n elevated: boolean = false;\n\n override render() {\n const cssClasses = {\n toolbar: true,\n [`variant-${this.variant}`]: true,\n [`orientation-${this.orientation}`]: true,\n [`size-${this.size}`]: true,\n elevated: this.elevated,\n };\n\n if (this.variant === 'floating') {\n return Toolbar.__renderFloating(cssClasses);\n }\n\n return Toolbar.__renderDocked(cssClasses);\n }\n\n private static __renderDocked(cssClasses: Record<string, boolean>) {\n return html`\n <div class=${classMap(cssClasses)} role=\"toolbar\">\n <div class=\"background\"></div>\n <div class=\"toolbar-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n private static __renderFloating(cssClasses: Record<string, boolean>) {\n return html`\n <div class=${classMap(cssClasses)} role=\"toolbar\">\n <wc-elevation class=\"elevation\"></wc-elevation>\n <div class=\"background\"></div>\n <div class=\"toolbar-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","colorStyles","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;AAEI,IAAM,OAAO,GAAA,SAAA,GAAb,MAAM,OAAQ,SAAQA,GAAU,CAAA;AAAhC,IAAA,WAAA,GAAA;;AAGL;;;;AAIG;QAEH,IAAA,CAAA,OAAO,GAA0B,QAAQ;AAEzC;;;;AAIG;QAEH,IAAA,CAAA,WAAW,GAA8B,YAAY;AAErD;;;;;AAKG;QAEH,IAAA,CAAA,IAAI,GAAiC,OAAO;AAE5C;;AAEG;QAEH,IAAA,CAAA,QAAQ,GAAY,KAAK;IAwC3B;IAtCW,MAAM,GAAA;AACb,QAAA,MAAM,UAAU,GAAG;AACjB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,CAAC,WAAW,IAAI,CAAC,OAAO,CAAA,CAAE,GAAG,IAAI;AACjC,YAAA,CAAC,eAAe,IAAI,CAAC,WAAW,CAAA,CAAE,GAAG,IAAI;AACzC,YAAA,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAA,CAAE,GAAG,IAAI;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;AAED,QAAA,IAAI,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE;AAC/B,YAAA,OAAO,SAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC;QAC7C;AAEA,QAAA,OAAO,SAAO,CAAC,cAAc,CAAC,UAAU,CAAC;IAC3C;IAEQ,OAAO,cAAc,CAAC,UAAmC,EAAA;AAC/D,QAAA,OAAOC,CAAI,CAAA;mBACIC,CAAQ,CAAC,UAAU,CAAC,CAAA;;;;;;KAMlC;IACH;IAEQ,OAAO,gBAAgB,CAAC,UAAmC,EAAA;AACjE,QAAA,OAAOD,CAAI,CAAA;mBACIC,CAAQ,CAAC,UAAU,CAAC,CAAA;;;;;;;KAOlC;IACH;;AAtEO,OAAA,CAAA,MAAM,GAAG,CAACC,UAAM,EAAEC,QAAW,CAAC;AAQrC,UAAA,CAAA;IADCC,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACC,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAQ1C,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACa,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAStD,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACI,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAM7C,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAChB,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAhCf,OAAO,GAAA,SAAA,GAAA,UAAA,CAAA;IADnB;AACY,CAAA,EAAA,OAAO,CAwEnB;;;;"}
|