@redvars/peacock 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/banner.js +202 -0
- package/dist/banner.js.map +1 -0
- package/dist/bottom-sheet.js +2 -2
- package/dist/{button-COYCtuA8.js → button-DMN1dPAg.js} +58 -75
- package/dist/button-DMN1dPAg.js.map +1 -0
- package/dist/{button-group-DsXquZQn.js → button-group-CX9CUUXk.js} +9 -14
- package/dist/button-group-CX9CUUXk.js.map +1 -0
- package/dist/button-group.js +8 -5
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +7 -4
- package/dist/button.js.map +1 -1
- package/dist/card.js +15 -5
- package/dist/card.js.map +1 -1
- package/dist/chart-bar.js +2 -2
- package/dist/chart-bar.js.map +1 -1
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js.map +1 -1
- package/dist/chart-stacked-bar.js +2 -2
- package/dist/chart-stacked-bar.js.map +1 -1
- package/dist/{class-map-3TAnCMAX.js → class-map-YU7g0o3B.js} +2 -2
- package/dist/{class-map-3TAnCMAX.js.map → class-map-YU7g0o3B.js.map} +1 -1
- package/dist/clock.js.map +1 -1
- package/dist/code-editor.js +4 -4
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +3 -3
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +2918 -1379
- package/dist/custom-elements.json +2783 -1054
- package/dist/directive-ZPhl09Yt.js +9 -0
- package/dist/directive-ZPhl09Yt.js.map +1 -0
- package/dist/dispatch-event-utils-CuEqjlPT.js +127 -0
- package/dist/dispatch-event-utils-CuEqjlPT.js.map +1 -0
- package/dist/fab-C5Nzxk0E.js +497 -0
- package/dist/fab-C5Nzxk0E.js.map +1 -0
- package/dist/fab.js +11 -0
- package/dist/fab.js.map +1 -0
- package/dist/index.js +17 -9
- package/dist/index.js.map +1 -1
- package/dist/{observe-theme-change-DKAIv5BB.js → is-dark-mode-DicqGkCJ.js} +6 -2
- package/dist/is-dark-mode-DicqGkCJ.js.map +1 -0
- package/dist/notification.js +417 -0
- package/dist/notification.js.map +1 -0
- package/dist/number-counter.js +2 -2
- package/dist/number-counter.js.map +1 -1
- package/dist/observe-slot-change-BGJfgg2E.js +31 -0
- package/dist/observe-slot-change-BGJfgg2E.js.map +1 -0
- package/dist/peacock-loader.js +32 -9
- package/dist/peacock-loader.js.map +1 -1
- package/dist/search.js +452 -0
- package/dist/search.js.map +1 -0
- package/dist/{select-C3XAzenC.js → select-4pl4XBj7.js} +778 -374
- package/dist/select-4pl4XBj7.js.map +1 -0
- package/dist/side-sheet.js +2 -2
- package/dist/spread-B5cgadZl.js +32 -0
- package/dist/spread-B5cgadZl.js.map +1 -0
- package/dist/src/__base_element/BaseHyperlink.d.ts +20 -0
- package/dist/src/__utils/cache-fetch.d.ts +1 -0
- package/dist/src/__utils/is-dark-mode.d.ts +1 -0
- package/dist/src/__utils/is-in-viewport.d.ts +1 -0
- package/dist/src/__utils/observe-slot-change.d.ts +1 -0
- package/dist/src/__utils/sanitize-svg.d.ts +1 -0
- package/dist/src/__utils/throttle.d.ts +4 -0
- package/dist/src/accordion/accordion-item.d.ts +33 -9
- package/dist/src/accordion/accordion.d.ts +21 -5
- package/dist/src/banner/banner.d.ts +47 -0
- package/dist/src/banner/index.d.ts +1 -0
- package/dist/src/button/BaseButton.d.ts +6 -13
- package/dist/src/button/button-group/button-group.d.ts +2 -2
- package/dist/src/empty-state/empty-state.d.ts +1 -1
- package/dist/src/fab/fab.d.ts +111 -0
- package/dist/src/fab/index.d.ts +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/link/link.d.ts +3 -10
- package/dist/src/menu/menu/menu.d.ts +3 -2
- package/dist/src/menu/sub-menu/sub-menu.d.ts +1 -0
- package/dist/src/notification/index.d.ts +1 -0
- package/dist/src/notification/notification.d.ts +69 -0
- package/dist/src/pagination/pagination.d.ts +8 -1
- package/dist/src/search/index.d.ts +1 -0
- package/dist/src/search/search.d.ts +76 -0
- package/dist/src/select/select.d.ts +3 -5
- package/dist/src/slider/slider.d.ts +4 -0
- package/dist/src/snackbar/snackbar.d.ts +14 -1
- package/dist/src/toolbar/index.d.ts +1 -0
- package/dist/src/toolbar/toolbar.d.ts +86 -0
- package/dist/{style-map-CRFEoCEg.js → style-map-DVmWOuYy.js} +2 -2
- package/dist/{style-map-CRFEoCEg.js.map → style-map-DVmWOuYy.js.map} +1 -1
- package/dist/test/banner.test.d.ts +1 -0
- package/dist/test/search.test.d.ts +1 -0
- package/dist/test/toolbar.test.d.ts +1 -0
- package/dist/throttle-C7ZAPqtu.js +24 -0
- package/dist/throttle-C7ZAPqtu.js.map +1 -0
- package/dist/toolbar.js +306 -0
- package/dist/toolbar.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-D3GHRaGQ.js → unsafe-html-BsGUjx94.js} +2 -2
- package/dist/{unsafe-html-D3GHRaGQ.js.map → unsafe-html-BsGUjx94.js.map} +1 -1
- package/package.json +1 -1
- package/readme.md +2 -2
- package/scss/styles.scss +4 -0
- package/src/__base_element/BaseHyperlink.ts +42 -0
- package/src/__base_element/README.md +19 -0
- package/src/__utils/cache-fetch.ts +65 -0
- package/src/__utils/is-dark-mode.ts +3 -0
- package/src/__utils/is-in-viewport.ts +6 -0
- package/src/__utils/observe-slot-change.ts +38 -0
- package/src/__utils/sanitize-svg.ts +27 -0
- package/src/__utils/throttle.ts +27 -0
- package/src/accordion/accordion-item.scss +136 -65
- package/src/accordion/accordion-item.ts +117 -44
- package/src/accordion/accordion.scss +24 -5
- package/src/accordion/accordion.ts +29 -23
- package/src/accordion/demo/index.html +74 -35
- package/src/banner/banner.scss +87 -0
- package/src/banner/banner.ts +107 -0
- package/src/banner/index.ts +1 -0
- package/src/button/BaseButton.ts +14 -27
- package/src/button/button/button-colors.scss +14 -14
- package/src/button/button/button.ts +6 -5
- package/src/button/button-group/button-group.ts +3 -3
- package/src/button/icon-button/icon-button.ts +4 -11
- package/src/card/card.ts +41 -31
- package/src/chart-bar/chart-bar.ts +1 -1
- package/src/chart-bar/chart-stacked-bar.ts +3 -1
- package/src/chart-doughnut/chart-doughnut.ts +1 -1
- package/src/chart-pie/chart-pie.ts +1 -1
- package/src/checkbox/checkbox.ts +1 -1
- package/src/clock/clock.ts +1 -1
- package/src/code-editor/code-editor.ts +4 -4
- package/src/code-highlighter/code-highlighter.ts +2 -2
- package/src/date-picker/date-picker.ts +5 -2
- package/src/divider/divider.ts +3 -1
- package/src/empty-state/empty-state.scss +7 -9
- package/src/empty-state/empty-state.ts +1 -1
- package/src/fab/fab-colors.scss +49 -0
- package/src/fab/fab-sizes.scss +47 -0
- package/src/fab/fab.scss +137 -0
- package/src/fab/fab.ts +285 -0
- package/src/fab/index.ts +1 -0
- package/src/field/field.ts +3 -1
- package/src/icon/datasource.ts +1 -1
- package/src/icon/icon.ts +3 -1
- package/src/image/image.ts +3 -2
- package/src/index.ts +5 -0
- package/src/input/input.ts +5 -2
- package/src/link/link.ts +2 -15
- package/src/menu/menu/menu.scss +7 -0
- package/src/menu/menu/menu.ts +7 -4
- package/src/menu/sub-menu/sub-menu.ts +1 -0
- package/src/notification/index.ts +1 -0
- package/src/notification/notification.scss +201 -0
- package/src/notification/notification.ts +206 -0
- package/src/number-counter/number-counter.ts +3 -1
- package/src/number-field/number-field.ts +4 -2
- package/src/pagination/pagination.scss +33 -24
- package/src/pagination/pagination.ts +113 -60
- package/src/peacock-loader.ts +20 -0
- package/src/radio/radio.ts +3 -1
- package/src/search/index.ts +1 -0
- package/src/search/search-colors.scss +14 -0
- package/src/search/search.scss +204 -0
- package/src/search/search.ts +240 -0
- package/src/select/option.ts +1 -1
- package/src/select/select.scss +5 -0
- package/src/select/select.ts +71 -37
- package/src/slider/slider.scss +19 -0
- package/src/slider/slider.ts +30 -19
- package/src/snackbar/snackbar.scss +62 -31
- package/src/snackbar/snackbar.ts +92 -12
- package/src/switch/switch.ts +3 -1
- package/src/table/table.ts +3 -1
- package/src/tabs/tab.ts +6 -3
- package/src/textarea/textarea.ts +4 -2
- package/src/time-picker/time-picker.ts +4 -2
- package/src/toolbar/index.ts +1 -0
- package/src/toolbar/toolbar-colors.scss +16 -0
- package/src/toolbar/toolbar.scss +165 -0
- package/src/toolbar/toolbar.ts +137 -0
- package/dist/button-COYCtuA8.js.map +0 -1
- package/dist/button-group-DsXquZQn.js.map +0 -1
- package/dist/directive-Cuw6h7YA.js +0 -9
- package/dist/directive-Cuw6h7YA.js.map +0 -1
- package/dist/dispatch-event-utils-B4odODQf.js +0 -277
- package/dist/dispatch-event-utils-B4odODQf.js.map +0 -1
- package/dist/observe-theme-change-DKAIv5BB.js.map +0 -1
- package/dist/select-C3XAzenC.js.map +0 -1
- package/dist/src/styleMixins.css.d.ts +0 -9
- package/dist/src/utils.d.ts +0 -9
- package/src/styleMixins.css.ts +0 -55
- package/src/utils.ts +0 -193
- /package/dist/src/{spread.d.ts → __directive/spread.d.ts} +0 -0
- /package/dist/src/{utils → __utils}/copy-to-clipboard.d.ts +0 -0
- /package/dist/src/{utils → __utils}/dispatch-event-utils.d.ts +0 -0
- /package/dist/src/{utils → __utils}/observe-theme-change.d.ts +0 -0
- /package/src/{spread.ts → __directive/spread.ts} +0 -0
- /package/src/{utils → __utils}/copy-to-clipboard.ts +0 -0
- /package/src/{utils → __utils}/dispatch-event-utils.ts +0 -0
- /package/src/{utils → __utils}/observe-theme-change.ts +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Search
|
|
4
|
+
* @tag wc-search
|
|
5
|
+
* @rawTag search
|
|
6
|
+
*
|
|
7
|
+
* @summary A Material 3 search bar for filtering and finding content.
|
|
8
|
+
* @overview
|
|
9
|
+
* <p>The search component provides a text input designed for search interactions.
|
|
10
|
+
* It supports outlined and filled variants, an optional clear button, and leading/trailing icon slots.</p>
|
|
11
|
+
*
|
|
12
|
+
* @cssprop --search-container-shape - Border radius of the search bar. Defaults to full (pill shape).
|
|
13
|
+
* @cssprop --search-container-color - Background color of the search container.
|
|
14
|
+
* @cssprop --search-input-text-color - Color of the input text.
|
|
15
|
+
* @cssprop --search-placeholder-color - Color of the placeholder text.
|
|
16
|
+
* @cssprop --search-icon-color - Color of the leading and trailing icons.
|
|
17
|
+
* @cssprop --search-outline-color - Border color for the outlined variant.
|
|
18
|
+
* @cssprop --search-outline-width - Border width for the outlined variant.
|
|
19
|
+
*
|
|
20
|
+
* @fires {CustomEvent} input - Dispatched when the search value changes.
|
|
21
|
+
* @fires {CustomEvent} change - Dispatched when the search input loses focus or Enter is pressed.
|
|
22
|
+
* @fires {CustomEvent} clear - Dispatched when the clear button is activated.
|
|
23
|
+
* @fires {CustomEvent} search - Dispatched when the user submits the search (presses Enter).
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html
|
|
27
|
+
* <wc-search placeholder="Search..."></wc-search>
|
|
28
|
+
* ```
|
|
29
|
+
* @tags form
|
|
30
|
+
*/
|
|
31
|
+
export declare class Search extends LitElement {
|
|
32
|
+
static styles: import("lit").CSSResultGroup[];
|
|
33
|
+
/**
|
|
34
|
+
* Visual style variant.
|
|
35
|
+
* Possible values: `"outlined"`, `"filled"`. Defaults to `"filled"`.
|
|
36
|
+
*/
|
|
37
|
+
variant: 'outlined' | 'filled';
|
|
38
|
+
/**
|
|
39
|
+
* Placeholder text shown when the input is empty.
|
|
40
|
+
*/
|
|
41
|
+
placeholder: string;
|
|
42
|
+
/**
|
|
43
|
+
* Current search value.
|
|
44
|
+
*/
|
|
45
|
+
value: string;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the search bar is disabled.
|
|
48
|
+
*/
|
|
49
|
+
disabled: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether a clear button is shown when the input has a value.
|
|
52
|
+
*/
|
|
53
|
+
clearable: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Size of the search bar.
|
|
56
|
+
* Possible values: `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`.
|
|
57
|
+
*/
|
|
58
|
+
size: 'sm' | 'md' | 'lg';
|
|
59
|
+
private focused;
|
|
60
|
+
private leadingSlotHasContent;
|
|
61
|
+
private inputElement?;
|
|
62
|
+
firstUpdated(): void;
|
|
63
|
+
/** Focuses the internal input element. */
|
|
64
|
+
focus(): void;
|
|
65
|
+
/** Blurs the internal input element. */
|
|
66
|
+
blur(): void;
|
|
67
|
+
private __handleInput;
|
|
68
|
+
private __handleChange;
|
|
69
|
+
private __handleKeydown;
|
|
70
|
+
private __handleFocus;
|
|
71
|
+
private __handleBlur;
|
|
72
|
+
private __clearValue;
|
|
73
|
+
private __renderClearButton;
|
|
74
|
+
private __renderLeadingIcon;
|
|
75
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
76
|
+
}
|
|
@@ -29,6 +29,7 @@ export interface SelectOption {
|
|
|
29
29
|
*/
|
|
30
30
|
export declare class Select extends BaseInput {
|
|
31
31
|
static styles: import("lit").CSSResultGroup[];
|
|
32
|
+
private readonly _menuId;
|
|
32
33
|
/**
|
|
33
34
|
* Array of options to display in the dropdown.
|
|
34
35
|
* Setting this property creates matching `<wc-option>` children automatically.
|
|
@@ -56,10 +57,6 @@ export declare class Select extends BaseInput {
|
|
|
56
57
|
* Label displayed above the field.
|
|
57
58
|
*/
|
|
58
59
|
label: string;
|
|
59
|
-
/**
|
|
60
|
-
* Show a clear button in single-select mode when a value is selected.
|
|
61
|
-
*/
|
|
62
|
-
clearable: boolean;
|
|
63
60
|
/**
|
|
64
61
|
* Visual variant of the field.
|
|
65
62
|
*/
|
|
@@ -103,13 +100,14 @@ export declare class Select extends BaseInput {
|
|
|
103
100
|
private _openMenu;
|
|
104
101
|
private _closeMenu;
|
|
105
102
|
private _handleTriggerClick;
|
|
103
|
+
private _handleFieldClick;
|
|
106
104
|
private _handleTriggerKeyDown;
|
|
107
105
|
private _handleMenuClosed;
|
|
108
106
|
private _handleMenuItemActivate;
|
|
109
107
|
private _dispatchChange;
|
|
110
108
|
private _handleSearchInput;
|
|
111
|
-
private _handleClear;
|
|
112
109
|
private _handleChipDismiss;
|
|
110
|
+
private _renderEmptyState;
|
|
113
111
|
private _renderTriggerContent;
|
|
114
112
|
private _renderFieldEnd;
|
|
115
113
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -40,6 +40,10 @@ export declare class Slider extends LitElement {
|
|
|
40
40
|
* Whether to show labels on the slider.
|
|
41
41
|
*/
|
|
42
42
|
labeled: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to show the current value beside the slider.
|
|
45
|
+
*/
|
|
46
|
+
showValue: boolean;
|
|
43
47
|
private isDragging;
|
|
44
48
|
private container;
|
|
45
49
|
private thumbElement;
|
|
@@ -10,29 +10,42 @@ import { LitElement } from 'lit';
|
|
|
10
10
|
* @cssprop --snackbar-action-text-color - Action text color.
|
|
11
11
|
* @cssprop --snackbar-close-icon-color - Close icon color.
|
|
12
12
|
* @cssprop --snackbar-border-radius - Border radius of the snackbar surface.
|
|
13
|
+
* @cssprop --snackbar-offset-inline - Inline offset from viewport edges.
|
|
14
|
+
* @cssprop --snackbar-offset-bottom - Bottom offset from viewport edge.
|
|
15
|
+
* @cssprop --snackbar-z-index - Stacking order for the snackbar.
|
|
13
16
|
*
|
|
14
17
|
* @example
|
|
15
18
|
* ```html
|
|
16
|
-
* <wc-snackbar
|
|
19
|
+
* <wc-snackbar preview message="Message archived" action-label="Undo"></wc-snackbar>
|
|
17
20
|
* ```
|
|
18
21
|
* @tags display, feedback
|
|
19
22
|
*/
|
|
20
23
|
export declare class Snackbar extends LitElement {
|
|
21
24
|
static styles: import("lit").CSSResultGroup[];
|
|
25
|
+
private static readonly GLOBAL_OPEN_EVENT;
|
|
26
|
+
private static readonly EXIT_ANIMATION_MS;
|
|
22
27
|
open: boolean;
|
|
23
28
|
message: string;
|
|
24
29
|
actionLabel: string;
|
|
25
30
|
showCloseIcon: boolean;
|
|
26
31
|
duration: number;
|
|
27
32
|
multiline: boolean;
|
|
33
|
+
preview: boolean;
|
|
34
|
+
private dismissing;
|
|
28
35
|
private hideTimer;
|
|
36
|
+
private exitTimer;
|
|
37
|
+
private readonly handleGlobalSnackbarOpen;
|
|
38
|
+
connectedCallback(): void;
|
|
29
39
|
show(): void;
|
|
30
40
|
hide(): void;
|
|
31
41
|
private close;
|
|
42
|
+
private completeDismiss;
|
|
32
43
|
private dispatchActionEvent;
|
|
33
44
|
private handleActionClick;
|
|
34
45
|
private handleCloseClick;
|
|
35
46
|
private clearTimer;
|
|
47
|
+
private clearExitTimer;
|
|
48
|
+
private handleAnimationEnd;
|
|
36
49
|
private scheduleAutoHide;
|
|
37
50
|
protected updated(changedProperties: Map<string, unknown>): void;
|
|
38
51
|
disconnectedCallback(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Toolbar } from './toolbar.js';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Toolbar
|
|
4
|
+
* @tag wc-toolbar
|
|
5
|
+
* @rawTag toolbar
|
|
6
|
+
*
|
|
7
|
+
* @summary A Material 3 toolbar / app bar for navigation and actions.
|
|
8
|
+
* @overview
|
|
9
|
+
* <p>The toolbar component implements the Material 3 app bar pattern. It supports a
|
|
10
|
+
* docked (attached) variant for bottom-panel navigation and a floating (detached pill-shaped)
|
|
11
|
+
* variant. The floating variant supports both horizontal and vertical orientations.</p>
|
|
12
|
+
*
|
|
13
|
+
* <p>Render toolbar actions directly as children of the component. The docked variant is
|
|
14
|
+
* optimized for a horizontal action row, while the floating variant supports both horizontal
|
|
15
|
+
* and vertical layouts.</p>
|
|
16
|
+
*
|
|
17
|
+
* @cssprop --toolbar-container-color - Background color of the toolbar.
|
|
18
|
+
* @cssprop --toolbar-container-shape - Border radius of the toolbar. Relevant for the floating variant.
|
|
19
|
+
* @cssprop --toolbar-height - Height of the toolbar (docked horizontal / floating horizontal).
|
|
20
|
+
* @cssprop --toolbar-padding-inline - Inline padding of the toolbar.
|
|
21
|
+
* @cssprop --toolbar-gap - Gap between toolbar sections.
|
|
22
|
+
* @cssprop --toolbar-icon-color - Color of icon slots.
|
|
23
|
+
* @cssprop --toolbar-title-color - Color of the title (default slot) text.
|
|
24
|
+
* @cssprop --toolbar-shadow - Box-shadow of the toolbar.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```html
|
|
28
|
+
* <!-- Docked toolbar -->
|
|
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>
|
|
34
|
+
* </wc-toolbar>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```html
|
|
39
|
+
* <!-- Floating horizontal toolbar -->
|
|
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>
|
|
44
|
+
* </wc-toolbar>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```html
|
|
49
|
+
* <!-- Floating vertical toolbar -->
|
|
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>
|
|
54
|
+
* </wc-toolbar>
|
|
55
|
+
* ```
|
|
56
|
+
* @tags display navigation
|
|
57
|
+
*/
|
|
58
|
+
export declare class Toolbar extends LitElement {
|
|
59
|
+
static styles: import("lit").CSSResultGroup[];
|
|
60
|
+
/**
|
|
61
|
+
* Visual and layout variant of the toolbar.
|
|
62
|
+
* - `"docked"`: A full-width bar attached to the edge of the screen (default).
|
|
63
|
+
* - `"floating"`: A detached pill-shaped toolbar that floats over content.
|
|
64
|
+
*/
|
|
65
|
+
variant: 'docked' | 'floating';
|
|
66
|
+
/**
|
|
67
|
+
* Orientation of the toolbar content.
|
|
68
|
+
* - `"horizontal"`: Items are laid out left to right (default).
|
|
69
|
+
* - `"vertical"`: Items are stacked top to bottom. Primarily useful for the floating variant.
|
|
70
|
+
*/
|
|
71
|
+
orientation: 'horizontal' | 'vertical';
|
|
72
|
+
/**
|
|
73
|
+
* Size of the docked toolbar.
|
|
74
|
+
* - `"small"`: 80dp height (default).
|
|
75
|
+
* - `"medium"`: 96dp height.
|
|
76
|
+
* - `"large"`: 112dp height.
|
|
77
|
+
*/
|
|
78
|
+
size: 'small' | 'medium' | 'large';
|
|
79
|
+
/**
|
|
80
|
+
* Whether the toolbar is visually elevated (adds a shadow).
|
|
81
|
+
*/
|
|
82
|
+
elevated: boolean;
|
|
83
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
84
|
+
private static __renderDocked;
|
|
85
|
+
private static __renderFloating;
|
|
86
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E } from './IndividualComponent-DUINtMGK.js';
|
|
2
|
-
import { e, i as i$1, t } from './directive-
|
|
2
|
+
import { e, i as i$1, t } from './directive-ZPhl09Yt.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
@@ -8,4 +8,4 @@ import { e, i as i$1, t } from './directive-Cuw6h7YA.js';
|
|
|
8
8
|
*/const n="important",i=" !"+n,o=e(class extends i$1{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"style"!==t$1.name||t$1.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r="string"==typeof e&&e.endsWith(i);t.includes("-")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:""):s[t]=e;}}return E}});
|
|
9
9
|
|
|
10
10
|
export { o };
|
|
11
|
-
//# sourceMappingURL=style-map-
|
|
11
|
+
//# sourceMappingURL=style-map-DVmWOuYy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-map-
|
|
1
|
+
{"version":3,"file":"style-map-DVmWOuYy.js","sources":["../node_modules/lit-html/directives/style-map.js"],"sourcesContent":["import{noChange as t}from\"../lit-html.js\";import{directive as e,Directive as r,PartType as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const n=\"important\",i=\" !\"+n,o=e(class extends r{constructor(t){if(super(t),t.type!==s.ATTRIBUTE||\"style\"!==t.name||t.strings?.length>2)throw Error(\"The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.\")}render(t){return Object.keys(t).reduce((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes(\"-\")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,\"-$&\").toLowerCase()}:${s};`},\"\")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes(\"-\")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r=\"string\"==typeof e&&e.endsWith(i);t.includes(\"-\")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:\"\"):s[t]=e}}return t}});export{o as styleMap};\n//# sourceMappingURL=style-map.js.map\n"],"names":["r","t","s"],"mappings":";;;AACA;AACA;AACA;AACA;AACA,GAAQ,MAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAcA,GAAC,CAAC,WAAW,CAACC,GAAC,CAAC,CAAC,GAAG,KAAK,CAACA,GAAC,CAAC,CAACA,GAAC,CAAC,IAAI,GAAGC,CAAC,CAAC,SAAS,EAAE,OAAO,GAAGD,GAAC,CAAC,IAAI,EAAEA,GAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,4GAA4G,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,mCAAmC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,OAAOA,CAAC,CAAC,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function throttle(func, delay, options = { leading: true, trailing: true }) {
|
|
2
|
+
let timerId;
|
|
3
|
+
let lastExec = 0;
|
|
4
|
+
return function (...args) {
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
const context = this;
|
|
7
|
+
const now = Date.now();
|
|
8
|
+
const shouldCallNow = options.leading && now - lastExec >= delay;
|
|
9
|
+
if (shouldCallNow) {
|
|
10
|
+
func.apply(context, args);
|
|
11
|
+
lastExec = now;
|
|
12
|
+
}
|
|
13
|
+
else if (options.trailing && !timerId) {
|
|
14
|
+
timerId = setTimeout(() => {
|
|
15
|
+
func.apply(context, args);
|
|
16
|
+
lastExec = Date.now();
|
|
17
|
+
timerId = null;
|
|
18
|
+
}, delay);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { throttle as t };
|
|
24
|
+
//# sourceMappingURL=throttle-C7ZAPqtu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttle-C7ZAPqtu.js","sources":["../../src/__utils/throttle.ts"],"sourcesContent":["export function throttle(\n func: Function,\n delay: number,\n options = { leading: true, trailing: true },\n) {\n let timerId: any;\n let lastExec = 0;\n\n return function (...args: any[]) {\n // @ts-ignore\n const context = this;\n const now = Date.now();\n\n const shouldCallNow = options.leading && now - lastExec >= delay;\n\n if (shouldCallNow) {\n func.apply(context, args);\n lastExec = now;\n } else if (options.trailing && !timerId) {\n timerId = setTimeout(() => {\n func.apply(context, args);\n lastExec = Date.now();\n timerId = null;\n }, delay);\n }\n };\n}"],"names":[],"mappings":"SAAgB,QAAQ,CACtB,IAAc,EACd,KAAa,EACb,OAAO,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAA;AAE3C,IAAA,IAAI,OAAY;IAChB,IAAI,QAAQ,GAAG,CAAC;IAEhB,OAAO,UAAU,GAAG,IAAW,EAAA;;QAE7B,MAAM,OAAO,GAAG,IAAI;AACpB,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;QAEtB,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,IAAI,GAAG,GAAG,QAAQ,IAAI,KAAK;QAEhE,IAAI,aAAa,EAAE;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;YACzB,QAAQ,GAAG,GAAG;QAChB;AAAO,aAAA,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,EAAE;AACvC,YAAA,OAAO,GAAG,UAAU,CAAC,MAAK;AACxB,gBAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AACzB,gBAAA,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE;gBACrB,OAAO,GAAG,IAAI;YAChB,CAAC,EAAE,KAAK,CAAC;QACX;AACF,IAAA,CAAC;AACH;;;;"}
|
package/dist/toolbar.js
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { a as i, _ as __decorate, I as IndividualComponent, i as i$1, b } from './IndividualComponent-DUINtMGK.js';
|
|
2
|
+
import { n } from './property-1psGvXOq.js';
|
|
3
|
+
import { e } from './class-map-YU7g0o3B.js';
|
|
4
|
+
import './directive-ZPhl09Yt.js';
|
|
5
|
+
|
|
6
|
+
var css_248z$1 = i`* {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.screen-reader-only {
|
|
11
|
+
display: none !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
--toolbar-container-shape: var(--shape-corner-full);
|
|
17
|
+
--toolbar-docked-container-shape: var(--shape-corner-extra-large) var(--shape-corner-extra-large) var(--shape-corner-none) var(--shape-corner-none);
|
|
18
|
+
--toolbar-height: 5rem; /* 80dp - small/default docked */
|
|
19
|
+
--toolbar-padding-inline: 0.75rem;
|
|
20
|
+
--toolbar-gap: 0.5rem;
|
|
21
|
+
--toolbar-shadow: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* ---- Shared toolbar base ---- */
|
|
25
|
+
.toolbar {
|
|
26
|
+
position: relative;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--toolbar-gap);
|
|
30
|
+
padding-inline: var(--toolbar-padding-inline);
|
|
31
|
+
min-height: var(--toolbar-height);
|
|
32
|
+
width: 100%;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
color: var(--_toolbar-title-color);
|
|
35
|
+
--icon-color: var(--_toolbar-icon-color);
|
|
36
|
+
box-shadow: var(--toolbar-shadow);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.toolbar-content {
|
|
40
|
+
position: relative;
|
|
41
|
+
z-index: 1;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.background {
|
|
48
|
+
position: absolute;
|
|
49
|
+
inset: 0;
|
|
50
|
+
background-color: var(--_toolbar-container-color);
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
z-index: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* ---- Docked variant ---- */
|
|
56
|
+
.toolbar.variant-docked {
|
|
57
|
+
width: 100%;
|
|
58
|
+
padding-inline: var(--toolbar-padding-inline);
|
|
59
|
+
padding-block-start: 0.5rem;
|
|
60
|
+
padding-block-end: calc(0.5rem + env(safe-area-inset-bottom, 0px));
|
|
61
|
+
}
|
|
62
|
+
.toolbar.variant-docked .background {
|
|
63
|
+
border-radius: var(--toolbar-docked-container-shape);
|
|
64
|
+
}
|
|
65
|
+
.toolbar.variant-docked .toolbar-content {
|
|
66
|
+
width: 100%;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
gap: var(--toolbar-gap);
|
|
69
|
+
overflow-x: auto;
|
|
70
|
+
overflow-y: hidden;
|
|
71
|
+
scrollbar-width: none;
|
|
72
|
+
}
|
|
73
|
+
.toolbar.variant-docked .toolbar-content::-webkit-scrollbar {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
.toolbar.variant-docked ::slotted(*) {
|
|
77
|
+
position: relative;
|
|
78
|
+
z-index: 1;
|
|
79
|
+
flex-shrink: 0;
|
|
80
|
+
}
|
|
81
|
+
.toolbar.variant-docked ::slotted(wc-icon-button) {
|
|
82
|
+
--button-container-shape: var(--shape-corner-full);
|
|
83
|
+
--button-container-shape-variant: round;
|
|
84
|
+
}
|
|
85
|
+
.toolbar.variant-docked {
|
|
86
|
+
/* Size variants */
|
|
87
|
+
}
|
|
88
|
+
.toolbar.variant-docked.size-small {
|
|
89
|
+
--toolbar-height: 5rem;
|
|
90
|
+
}
|
|
91
|
+
.toolbar.variant-docked.size-medium {
|
|
92
|
+
--toolbar-height: 6rem;
|
|
93
|
+
}
|
|
94
|
+
.toolbar.variant-docked.size-large {
|
|
95
|
+
--toolbar-height: 7rem;
|
|
96
|
+
}
|
|
97
|
+
.toolbar.variant-docked.elevated {
|
|
98
|
+
--toolbar-shadow: var(--elevation-shadow-level-3, 0 4px 8px rgba(0, 0, 0, 0.15));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* ---- Floating variant ---- */
|
|
102
|
+
.toolbar.variant-floating {
|
|
103
|
+
--toolbar-container-shape: var(--shape-corner-full);
|
|
104
|
+
border-radius: var(--toolbar-container-shape);
|
|
105
|
+
width: auto;
|
|
106
|
+
display: inline-flex;
|
|
107
|
+
padding: 0.75rem;
|
|
108
|
+
gap: 0.5rem;
|
|
109
|
+
}
|
|
110
|
+
.toolbar.variant-floating .elevation {
|
|
111
|
+
--elevation-level: 3;
|
|
112
|
+
--elevation-container-shape: var(--toolbar-container-shape);
|
|
113
|
+
--elevation-container-shape-variant: round;
|
|
114
|
+
}
|
|
115
|
+
.toolbar.variant-floating .background {
|
|
116
|
+
border-radius: var(--toolbar-container-shape);
|
|
117
|
+
}
|
|
118
|
+
.toolbar.variant-floating .toolbar-content {
|
|
119
|
+
width: auto;
|
|
120
|
+
gap: 0.5rem;
|
|
121
|
+
}
|
|
122
|
+
.toolbar.variant-floating ::slotted(*) {
|
|
123
|
+
position: relative;
|
|
124
|
+
z-index: 1;
|
|
125
|
+
}
|
|
126
|
+
.toolbar.variant-floating ::slotted(wc-icon-button) {
|
|
127
|
+
--button-container-shape: var(--shape-corner-full);
|
|
128
|
+
--button-container-shape-variant: round;
|
|
129
|
+
}
|
|
130
|
+
.toolbar.variant-floating.orientation-horizontal {
|
|
131
|
+
min-height: auto;
|
|
132
|
+
padding-block: 0.5rem;
|
|
133
|
+
padding-inline: 0.75rem;
|
|
134
|
+
}
|
|
135
|
+
.toolbar.variant-floating.orientation-horizontal .toolbar-content {
|
|
136
|
+
flex-direction: row;
|
|
137
|
+
align-items: center;
|
|
138
|
+
}
|
|
139
|
+
.toolbar.variant-floating.orientation-vertical {
|
|
140
|
+
min-height: auto;
|
|
141
|
+
width: auto;
|
|
142
|
+
padding-block: 0.75rem;
|
|
143
|
+
padding-inline: 0.5rem;
|
|
144
|
+
}
|
|
145
|
+
.toolbar.variant-floating.orientation-vertical .toolbar-content {
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
align-items: center;
|
|
148
|
+
}
|
|
149
|
+
.toolbar.variant-floating.elevated .elevation {
|
|
150
|
+
--elevation-level: 4;
|
|
151
|
+
}`;
|
|
152
|
+
|
|
153
|
+
var css_248z = i`:host {
|
|
154
|
+
/* Docked toolbar */
|
|
155
|
+
--toolbar-container-color: var(--color-surface-container);
|
|
156
|
+
--toolbar-title-color: var(--color-on-surface);
|
|
157
|
+
--toolbar-icon-color: var(--color-on-surface-variant);
|
|
158
|
+
/* Internal aliases used by styles */
|
|
159
|
+
--_toolbar-container-color: var(--toolbar-container-color);
|
|
160
|
+
--_toolbar-title-color: var(--toolbar-title-color);
|
|
161
|
+
--_toolbar-icon-color: var(--toolbar-icon-color);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Floating variant uses surface-container-high for a visible pill */
|
|
165
|
+
:host([variant=floating]) {
|
|
166
|
+
--toolbar-container-color: var(--color-surface-container-high);
|
|
167
|
+
}`;
|
|
168
|
+
|
|
169
|
+
var Toolbar_1;
|
|
170
|
+
/**
|
|
171
|
+
* @label Toolbar
|
|
172
|
+
* @tag wc-toolbar
|
|
173
|
+
* @rawTag toolbar
|
|
174
|
+
*
|
|
175
|
+
* @summary A Material 3 toolbar / app bar for navigation and actions.
|
|
176
|
+
* @overview
|
|
177
|
+
* <p>The toolbar component implements the Material 3 app bar pattern. It supports a
|
|
178
|
+
* docked (attached) variant for bottom-panel navigation and a floating (detached pill-shaped)
|
|
179
|
+
* variant. The floating variant supports both horizontal and vertical orientations.</p>
|
|
180
|
+
*
|
|
181
|
+
* <p>Render toolbar actions directly as children of the component. The docked variant is
|
|
182
|
+
* optimized for a horizontal action row, while the floating variant supports both horizontal
|
|
183
|
+
* and vertical layouts.</p>
|
|
184
|
+
*
|
|
185
|
+
* @cssprop --toolbar-container-color - Background color of the toolbar.
|
|
186
|
+
* @cssprop --toolbar-container-shape - Border radius of the toolbar. Relevant for the floating variant.
|
|
187
|
+
* @cssprop --toolbar-height - Height of the toolbar (docked horizontal / floating horizontal).
|
|
188
|
+
* @cssprop --toolbar-padding-inline - Inline padding of the toolbar.
|
|
189
|
+
* @cssprop --toolbar-gap - Gap between toolbar sections.
|
|
190
|
+
* @cssprop --toolbar-icon-color - Color of icon slots.
|
|
191
|
+
* @cssprop --toolbar-title-color - Color of the title (default slot) text.
|
|
192
|
+
* @cssprop --toolbar-shadow - Box-shadow of the toolbar.
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```html
|
|
196
|
+
* <!-- Docked toolbar -->
|
|
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>
|
|
202
|
+
* </wc-toolbar>
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```html
|
|
207
|
+
* <!-- Floating horizontal toolbar -->
|
|
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>
|
|
212
|
+
* </wc-toolbar>
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```html
|
|
217
|
+
* <!-- Floating vertical toolbar -->
|
|
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>
|
|
222
|
+
* </wc-toolbar>
|
|
223
|
+
* ```
|
|
224
|
+
* @tags display navigation
|
|
225
|
+
*/
|
|
226
|
+
let Toolbar = Toolbar_1 = class Toolbar extends i$1 {
|
|
227
|
+
constructor() {
|
|
228
|
+
super(...arguments);
|
|
229
|
+
/**
|
|
230
|
+
* Visual and layout variant of the toolbar.
|
|
231
|
+
* - `"docked"`: A full-width bar attached to the edge of the screen (default).
|
|
232
|
+
* - `"floating"`: A detached pill-shaped toolbar that floats over content.
|
|
233
|
+
*/
|
|
234
|
+
this.variant = 'docked';
|
|
235
|
+
/**
|
|
236
|
+
* Orientation of the toolbar content.
|
|
237
|
+
* - `"horizontal"`: Items are laid out left to right (default).
|
|
238
|
+
* - `"vertical"`: Items are stacked top to bottom. Primarily useful for the floating variant.
|
|
239
|
+
*/
|
|
240
|
+
this.orientation = 'horizontal';
|
|
241
|
+
/**
|
|
242
|
+
* Size of the docked toolbar.
|
|
243
|
+
* - `"small"`: 80dp height (default).
|
|
244
|
+
* - `"medium"`: 96dp height.
|
|
245
|
+
* - `"large"`: 112dp height.
|
|
246
|
+
*/
|
|
247
|
+
this.size = 'small';
|
|
248
|
+
/**
|
|
249
|
+
* Whether the toolbar is visually elevated (adds a shadow).
|
|
250
|
+
*/
|
|
251
|
+
this.elevated = false;
|
|
252
|
+
}
|
|
253
|
+
render() {
|
|
254
|
+
const cssClasses = {
|
|
255
|
+
toolbar: true,
|
|
256
|
+
[`variant-${this.variant}`]: true,
|
|
257
|
+
[`orientation-${this.orientation}`]: true,
|
|
258
|
+
[`size-${this.size}`]: true,
|
|
259
|
+
elevated: this.elevated,
|
|
260
|
+
};
|
|
261
|
+
if (this.variant === 'floating') {
|
|
262
|
+
return Toolbar_1.__renderFloating(cssClasses);
|
|
263
|
+
}
|
|
264
|
+
return Toolbar_1.__renderDocked(cssClasses);
|
|
265
|
+
}
|
|
266
|
+
static __renderDocked(cssClasses) {
|
|
267
|
+
return b `
|
|
268
|
+
<div class=${e(cssClasses)} role="toolbar">
|
|
269
|
+
<div class="background"></div>
|
|
270
|
+
<div class="toolbar-content">
|
|
271
|
+
<slot></slot>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
`;
|
|
275
|
+
}
|
|
276
|
+
static __renderFloating(cssClasses) {
|
|
277
|
+
return b `
|
|
278
|
+
<div class=${e(cssClasses)} role="toolbar">
|
|
279
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
280
|
+
<div class="background"></div>
|
|
281
|
+
<div class="toolbar-content">
|
|
282
|
+
<slot></slot>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
`;
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
Toolbar.styles = [css_248z$1, css_248z];
|
|
289
|
+
__decorate([
|
|
290
|
+
n({ type: String, reflect: true })
|
|
291
|
+
], Toolbar.prototype, "variant", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
n({ type: String, reflect: true })
|
|
294
|
+
], Toolbar.prototype, "orientation", void 0);
|
|
295
|
+
__decorate([
|
|
296
|
+
n({ type: String, reflect: true })
|
|
297
|
+
], Toolbar.prototype, "size", void 0);
|
|
298
|
+
__decorate([
|
|
299
|
+
n({ type: Boolean, reflect: true })
|
|
300
|
+
], Toolbar.prototype, "elevated", void 0);
|
|
301
|
+
Toolbar = Toolbar_1 = __decorate([
|
|
302
|
+
IndividualComponent
|
|
303
|
+
], Toolbar);
|
|
304
|
+
|
|
305
|
+
export { Toolbar };
|
|
306
|
+
//# sourceMappingURL=toolbar.js.map
|
|
@@ -0,0 +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;;;;"}
|