@material/web 2.4.2-nightly.2fe7e22.0 → 2.4.2-nightly.5088d91.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/button/internal/_touch-target.scss +1 -1
- package/button/internal/button.d.ts +0 -4
- package/button/internal/button.js.map +1 -1
- package/button/internal/shared-styles.css +1 -1
- package/button/internal/shared-styles.css.map +1 -1
- package/button/internal/shared-styles.cssresult.js +1 -1
- package/button/internal/shared-styles.cssresult.js.map +1 -1
- package/checkbox/internal/checkbox.d.ts +2 -2
- package/checkbox/internal/checkbox.js.map +1 -1
- package/chips/internal/chip.d.ts +2 -0
- package/custom-elements.json +41872 -0
- package/icon/internal/icon.d.ts +1 -1
- package/icon/internal/icon.js +1 -1
- package/icon/internal/icon.js.map +1 -1
- package/iconbutton/internal/icon-button.d.ts +0 -4
- package/iconbutton/internal/icon-button.js.map +1 -1
- package/internal/aria/aria.d.ts +1 -1
- package/internal/events/dispatch-hooks.js +31 -35
- package/internal/events/dispatch-hooks.js.map +1 -1
- package/labs/behaviors/form-associated.d.ts +0 -22
- package/labs/behaviors/form-associated.js +0 -11
- package/labs/behaviors/form-associated.js.map +1 -1
- package/labs/gb/components/button/_button-tokens.scss +30 -30
- package/labs/gb/components/button/button.css +1 -1
- package/labs/gb/components/button/button.css.map +1 -1
- package/labs/gb/components/button/button.cssresult.js +1 -1
- package/labs/gb/components/button/button.cssresult.js.map +1 -1
- package/labs/gb/components/button/button.d.ts +1 -16
- package/labs/gb/components/button/button.js +10 -33
- package/labs/gb/components/button/button.js.map +1 -1
- package/labs/gb/components/button/button.scss +25 -25
- package/labs/gb/components/button/md-button.d.ts +10 -2
- package/labs/gb/components/button/md-button.js +92 -11
- package/labs/gb/components/button/md-button.js.map +1 -1
- package/labs/gb/components/card/card.d.ts +1 -11
- package/labs/gb/components/card/card.js +6 -13
- package/labs/gb/components/card/card.js.map +1 -1
- package/labs/gb/components/card/md-card.d.ts +9 -1
- package/labs/gb/components/card/md-card.js +85 -8
- package/labs/gb/components/card/md-card.js.map +1 -1
- package/labs/gb/components/checkbox/checkbox.css +1 -1
- package/labs/gb/components/checkbox/checkbox.css.map +1 -1
- package/labs/gb/components/checkbox/checkbox.cssresult.js +1 -1
- package/labs/gb/components/checkbox/checkbox.cssresult.js.map +1 -1
- package/labs/gb/components/checkbox/checkbox.d.ts +1 -16
- package/labs/gb/components/checkbox/checkbox.js +8 -31
- package/labs/gb/components/checkbox/checkbox.js.map +1 -1
- package/labs/gb/components/checkbox/checkbox.scss +13 -13
- package/labs/gb/components/checkbox/md-checkbox.d.ts +4 -4
- package/labs/gb/components/checkbox/md-checkbox.js +10 -10
- package/labs/gb/components/checkbox/md-checkbox.js.map +1 -1
- package/labs/gb/components/divider/divider.d.ts +1 -11
- package/labs/gb/components/divider/divider.js +4 -11
- package/labs/gb/components/divider/divider.js.map +1 -1
- package/labs/gb/components/fab/fab.d.ts +1 -16
- package/labs/gb/components/fab/fab.js +8 -31
- package/labs/gb/components/fab/fab.js.map +1 -1
- package/labs/gb/components/fab/md-fab.js +4 -4
- package/labs/gb/components/fab/md-fab.js.map +1 -1
- package/labs/gb/components/focus/focus-ring.js +1 -1
- package/labs/gb/components/focus/focus-ring.js.map +1 -1
- package/labs/gb/components/iconbutton/_icon-button-tokens.scss +202 -0
- package/labs/gb/components/iconbutton/icon-button.css +4 -0
- package/labs/gb/components/iconbutton/icon-button.css.map +1 -0
- package/labs/gb/components/iconbutton/icon-button.cssresult.d.ts +3 -0
- package/labs/gb/components/iconbutton/icon-button.cssresult.js +14 -0
- package/labs/gb/components/iconbutton/icon-button.cssresult.js.map +1 -0
- package/labs/gb/components/iconbutton/icon-button.d.ts +97 -0
- package/labs/gb/components/iconbutton/icon-button.js +122 -0
- package/labs/gb/components/iconbutton/icon-button.js.map +1 -0
- package/labs/gb/components/iconbutton/icon-button.scss +153 -0
- package/labs/gb/components/iconbutton/md-icon-button.d.ts +73 -0
- package/labs/gb/components/iconbutton/md-icon-button.js +176 -0
- package/labs/gb/components/iconbutton/md-icon-button.js.map +1 -0
- package/labs/gb/components/list/_list-tokens.scss +102 -0
- package/labs/gb/components/list/list.css +4 -0
- package/labs/gb/components/list/list.css.map +1 -0
- package/labs/gb/components/list/list.cssresult.d.ts +3 -0
- package/labs/gb/components/list/list.cssresult.js +14 -0
- package/labs/gb/components/list/list.cssresult.js.map +1 -0
- package/labs/gb/components/list/list.d.ts +103 -0
- package/labs/gb/components/list/list.js +109 -0
- package/labs/gb/components/list/list.js.map +1 -0
- package/labs/gb/components/list/list.scss +212 -0
- package/labs/gb/components/list/md-list-item.d.ts +44 -0
- package/labs/gb/components/list/md-list-item.js +122 -0
- package/labs/gb/components/list/md-list-item.js.map +1 -0
- package/labs/gb/components/list/md-list.d.ts +26 -0
- package/labs/gb/components/list/md-list.js +51 -0
- package/labs/gb/components/list/md-list.js.map +1 -0
- package/labs/gb/components/menu/_menu-tokens.scss +128 -0
- package/labs/gb/components/menu/md-menu-group.d.ts +26 -0
- package/labs/gb/components/menu/md-menu-group.js +65 -0
- package/labs/gb/components/menu/md-menu-group.js.map +1 -0
- package/labs/gb/components/menu/md-menu-item.d.ts +30 -0
- package/labs/gb/components/menu/md-menu-item.js +165 -0
- package/labs/gb/components/menu/md-menu-item.js.map +1 -0
- package/labs/gb/components/menu/md-menu.d.ts +28 -0
- package/labs/gb/components/menu/md-menu.js +141 -0
- package/labs/gb/components/menu/md-menu.js.map +1 -0
- package/labs/gb/components/menu/menu.css +4 -0
- package/labs/gb/components/menu/menu.css.map +1 -0
- package/labs/gb/components/menu/menu.cssresult.d.ts +3 -0
- package/labs/gb/components/menu/menu.cssresult.js +14 -0
- package/labs/gb/components/menu/menu.cssresult.js.map +1 -0
- package/labs/gb/components/menu/menu.d.ts +117 -0
- package/labs/gb/components/menu/menu.js +107 -0
- package/labs/gb/components/menu/menu.js.map +1 -0
- package/labs/gb/components/menu/menu.scss +171 -0
- package/labs/gb/components/radio/md-radio.d.ts +4 -4
- package/labs/gb/components/radio/md-radio.js +11 -11
- package/labs/gb/components/radio/md-radio.js.map +1 -1
- package/labs/gb/components/radio/radio.css +1 -1
- package/labs/gb/components/radio/radio.css.map +1 -1
- package/labs/gb/components/radio/radio.cssresult.js +1 -1
- package/labs/gb/components/radio/radio.cssresult.js.map +1 -1
- package/labs/gb/components/radio/radio.d.ts +1 -14
- package/labs/gb/components/radio/radio.js +8 -23
- package/labs/gb/components/radio/radio.js.map +1 -1
- package/labs/gb/components/radio/radio.scss +4 -5
- package/labs/gb/components/ripple/ripple.d.ts +1 -10
- package/labs/gb/components/ripple/ripple.js +28 -32
- package/labs/gb/components/ripple/ripple.js.map +1 -1
- package/labs/gb/components/shared/directives.d.ts +93 -0
- package/labs/gb/components/shared/directives.js +111 -0
- package/labs/gb/components/shared/directives.js.map +1 -0
- package/labs/gb/components/shared/has-slotted.d.ts +10 -0
- package/labs/gb/components/shared/has-slotted.js +19 -0
- package/labs/gb/components/shared/has-slotted.js.map +1 -0
- package/labs/gb/components/shared/pseudo-classes.d.ts +7 -0
- package/labs/gb/components/shared/pseudo-classes.js +9 -0
- package/labs/gb/components/shared/pseudo-classes.js.map +1 -1
- package/labs/gb/components/splitbutton/_split-button-tokens.scss +135 -0
- package/labs/gb/components/splitbutton/md-split-button.d.ts +26 -0
- package/labs/gb/components/splitbutton/md-split-button.js +119 -0
- package/labs/gb/components/splitbutton/md-split-button.js.map +1 -0
- package/labs/gb/components/splitbutton/split-button.css +4 -0
- package/labs/gb/components/splitbutton/split-button.css.map +1 -0
- package/labs/gb/components/splitbutton/split-button.cssresult.d.ts +3 -0
- package/labs/gb/components/splitbutton/split-button.cssresult.js +14 -0
- package/labs/gb/components/splitbutton/split-button.cssresult.js.map +1 -0
- package/labs/gb/components/splitbutton/split-button.d.ts +47 -0
- package/labs/gb/components/splitbutton/split-button.js +46 -0
- package/labs/gb/components/splitbutton/split-button.js.map +1 -0
- package/labs/gb/components/splitbutton/split-button.scss +164 -0
- package/labs/gb/components/switch/_switch-tokens.scss +56 -0
- package/labs/gb/components/switch/md-switch.d.ts +66 -0
- package/labs/gb/components/switch/md-switch.js +162 -0
- package/labs/gb/components/switch/md-switch.js.map +1 -0
- package/labs/gb/components/switch/switch.css +4 -0
- package/labs/gb/components/switch/switch.css.map +1 -0
- package/labs/gb/components/switch/switch.cssresult.d.ts +3 -0
- package/labs/gb/components/switch/switch.cssresult.js +14 -0
- package/labs/gb/components/switch/switch.cssresult.js.map +1 -0
- package/labs/gb/components/switch/switch.d.ts +54 -0
- package/labs/gb/components/switch/switch.js +85 -0
- package/labs/gb/components/switch/switch.js.map +1 -0
- package/labs/gb/components/switch/switch.scss +109 -0
- package/labs/gb/styles/icon/md-icon.css +1 -1
- package/labs/gb/styles/icon/md-icon.css.map +1 -1
- package/labs/gb/styles/icon/md-icon.cssresult.js +1 -1
- package/labs/gb/styles/icon/md-icon.cssresult.js.map +1 -1
- package/labs/gb/styles/icon/md-icon.d.ts +20 -0
- package/labs/gb/styles/icon/md-icon.js +24 -0
- package/labs/gb/styles/icon/md-icon.js.map +1 -0
- package/labs/gb/styles/icon/md-icon.scss +2 -1
- package/labs/gb/styles/m3.css +5 -2
- package/labs/gb/styles/m3.css.map +1 -1
- package/labs/gb/styles/m3.cssresult.js +5 -2
- package/labs/gb/styles/m3.cssresult.js.map +1 -1
- package/labs/gb/styles/m3.scss +1 -0
- package/labs/gb/styles/space/md-space-tokens.css +4 -0
- package/labs/gb/styles/space/md-space-tokens.css.map +1 -0
- package/labs/gb/styles/space/md-space-tokens.cssresult.d.ts +3 -0
- package/labs/gb/styles/space/md-space-tokens.cssresult.js +14 -0
- package/labs/gb/styles/space/md-space-tokens.cssresult.js.map +1 -0
- package/labs/gb/styles/space/md-space-tokens.scss +28 -0
- package/labs/gb/styles/tailwind.css +4 -0
- package/labs/gb/styles/tailwind.css.map +1 -0
- package/labs/gb/styles/tailwind.cssresult.d.ts +3 -0
- package/labs/gb/styles/tailwind.cssresult.js +14 -0
- package/labs/gb/styles/tailwind.cssresult.js.map +1 -0
- package/labs/gb/styles/tailwind.scss +349 -0
- package/labs/gb/styles/typography/internal/_typography-tokens.scss +85 -16
- package/labs/gb/styles/typography/md-typography-tokens.css +1 -1
- package/labs/gb/styles/typography/md-typography-tokens.css.map +1 -1
- package/labs/gb/styles/typography/md-typography-tokens.cssresult.js +1 -1
- package/labs/gb/styles/typography/md-typography-tokens.cssresult.js.map +1 -1
- package/list/internal/listitem/list-item.d.ts +6 -1
- package/list/internal/listitem/list-item.js +4 -1
- package/list/internal/listitem/list-item.js.map +1 -1
- package/menu/internal/menuitem/menu-item.d.ts +2 -0
- package/menu/internal/submenu/sub-menu.d.ts +5 -1
- package/menu/internal/submenu/sub-menu.js +5 -1
- package/menu/internal/submenu/sub-menu.js.map +1 -1
- package/package.json +26 -4
- package/radio/internal/radio.d.ts +0 -2
- package/radio/internal/radio.js.map +1 -1
- package/select/internal/select.d.ts +2 -2
- package/select/internal/select.js.map +1 -1
- package/select/internal/selectoption/select-option.d.ts +2 -0
- package/slider/internal/slider.d.ts +0 -2
- package/slider/internal/slider.js.map +1 -1
- package/switch/internal/_switch.scss +1 -0
- package/switch/internal/switch-styles.css +1 -1
- package/switch/internal/switch-styles.css.map +1 -1
- package/switch/internal/switch-styles.cssresult.js +1 -1
- package/switch/internal/switch-styles.cssresult.js.map +1 -1
- package/switch/internal/switch.d.ts +0 -2
- package/switch/internal/switch.js.map +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { afterDispatch, setupDispatchHooks, } from '../../../../internal/events/dispatch-hooks.js';
|
|
7
|
+
import { focusRingClasses } from '../focus/focus-ring.js';
|
|
8
|
+
import { rippleClasses, setupRipple } from '../ripple/ripple.js';
|
|
9
|
+
import { createClassMapDirective } from '../shared/directives.js';
|
|
10
|
+
import { PSEUDO_CLASSES, isDisabled } from '../shared/pseudo-classes.js';
|
|
11
|
+
/** Icon Button color configurations. */
|
|
12
|
+
export const ICON_BUTTON_COLORS = {
|
|
13
|
+
filled: 'filled',
|
|
14
|
+
tonal: 'tonal',
|
|
15
|
+
outlined: 'outlined',
|
|
16
|
+
standard: 'standard',
|
|
17
|
+
};
|
|
18
|
+
/** Icon Button size configurations. */
|
|
19
|
+
export const ICON_BUTTON_SIZES = {
|
|
20
|
+
xs: 'xs',
|
|
21
|
+
sm: 'sm',
|
|
22
|
+
md: 'md',
|
|
23
|
+
lg: 'lg',
|
|
24
|
+
xl: 'xl',
|
|
25
|
+
};
|
|
26
|
+
/** Icon Button width configurations. */
|
|
27
|
+
export const ICON_BUTTON_WIDTHS = {
|
|
28
|
+
narrow: 'narrow',
|
|
29
|
+
wide: 'wide',
|
|
30
|
+
};
|
|
31
|
+
/** Icon Button classes. */
|
|
32
|
+
export const ICON_BUTTON_CLASSES = {
|
|
33
|
+
iconBtn: 'icon-btn',
|
|
34
|
+
iconBtnFilled: 'icon-btn-filled',
|
|
35
|
+
iconBtnTonal: 'icon-btn-tonal',
|
|
36
|
+
iconBtnOutlined: 'icon-btn-outlined',
|
|
37
|
+
iconBtnStandard: 'icon-btn-standard',
|
|
38
|
+
iconBtnXs: 'icon-btn-xs',
|
|
39
|
+
iconBtnSm: 'icon-btn-sm',
|
|
40
|
+
iconBtnMd: 'icon-btn-md',
|
|
41
|
+
iconBtnLg: 'icon-btn-lg',
|
|
42
|
+
iconBtnXl: 'icon-btn-xl',
|
|
43
|
+
iconBtnSquare: 'icon-btn-square',
|
|
44
|
+
iconBtnNarrow: 'icon-btn-narrow',
|
|
45
|
+
iconBtnWide: 'icon-btn-wide',
|
|
46
|
+
iconBtnUnselected: 'icon-btn-unselected',
|
|
47
|
+
iconBtnSelected: 'icon-btn-selected',
|
|
48
|
+
active: PSEUDO_CLASSES.active,
|
|
49
|
+
disabled: PSEUDO_CLASSES.disabled,
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Returns the icon button classes to apply to an element based on the given
|
|
53
|
+
* state.
|
|
54
|
+
*
|
|
55
|
+
* @param state The state of the icon button.
|
|
56
|
+
* @return An object of class names and truthy values if they apply.
|
|
57
|
+
*/
|
|
58
|
+
export function iconButtonClasses({ color, size, width, square = false, selected, active = false, disabled = false, } = {}) {
|
|
59
|
+
return {
|
|
60
|
+
...rippleClasses(),
|
|
61
|
+
...focusRingClasses(),
|
|
62
|
+
[ICON_BUTTON_CLASSES.iconBtn]: true,
|
|
63
|
+
[ICON_BUTTON_CLASSES.iconBtnFilled]: color === ICON_BUTTON_COLORS.filled,
|
|
64
|
+
[ICON_BUTTON_CLASSES.iconBtnTonal]: color === ICON_BUTTON_COLORS.tonal,
|
|
65
|
+
[ICON_BUTTON_CLASSES.iconBtnOutlined]: color === ICON_BUTTON_COLORS.outlined,
|
|
66
|
+
[ICON_BUTTON_CLASSES.iconBtnStandard]: color === ICON_BUTTON_COLORS.standard || !color,
|
|
67
|
+
[ICON_BUTTON_CLASSES.iconBtnXs]: size === ICON_BUTTON_SIZES.xs,
|
|
68
|
+
[ICON_BUTTON_CLASSES.iconBtnSm]: size === ICON_BUTTON_SIZES.sm || !size,
|
|
69
|
+
[ICON_BUTTON_CLASSES.iconBtnMd]: size === ICON_BUTTON_SIZES.md,
|
|
70
|
+
[ICON_BUTTON_CLASSES.iconBtnLg]: size === ICON_BUTTON_SIZES.lg,
|
|
71
|
+
[ICON_BUTTON_CLASSES.iconBtnXl]: size === ICON_BUTTON_SIZES.xl,
|
|
72
|
+
[ICON_BUTTON_CLASSES.iconBtnNarrow]: width === ICON_BUTTON_WIDTHS.narrow,
|
|
73
|
+
[ICON_BUTTON_CLASSES.iconBtnWide]: width === ICON_BUTTON_WIDTHS.wide,
|
|
74
|
+
[ICON_BUTTON_CLASSES.iconBtnSquare]: square,
|
|
75
|
+
[ICON_BUTTON_CLASSES.iconBtnUnselected]: selected === false,
|
|
76
|
+
[ICON_BUTTON_CLASSES.iconBtnSelected]: selected === true,
|
|
77
|
+
[ICON_BUTTON_CLASSES.active]: active,
|
|
78
|
+
[ICON_BUTTON_CLASSES.disabled]: disabled,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Sets up icon button functionality for the given element.
|
|
83
|
+
*
|
|
84
|
+
* @param iconButton The element on which to set up icon button functionality.
|
|
85
|
+
* @param opts Setup options, supports a cleanup `signal`.
|
|
86
|
+
*/
|
|
87
|
+
export function setupIconButton(iconButton, opts) {
|
|
88
|
+
setupDispatchHooks(iconButton, 'click');
|
|
89
|
+
setupRipple(iconButton, opts);
|
|
90
|
+
iconButton.addEventListener('click', (event) => {
|
|
91
|
+
if (isDisabled(iconButton)) {
|
|
92
|
+
event.stopImmediatePropagation();
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
afterDispatch(event, () => {
|
|
97
|
+
const isToggle = iconButton.hasAttribute('aria-pressed');
|
|
98
|
+
if (event.defaultPrevented || !isToggle) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const isPressed = iconButton.ariaPressed === 'true';
|
|
102
|
+
iconButton.ariaPressed = String(!isPressed);
|
|
103
|
+
iconButton.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
|
|
104
|
+
iconButton.dispatchEvent(new Event('change', { bubbles: true }));
|
|
105
|
+
});
|
|
106
|
+
}, opts);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A Lit directive that adds icon button styling and functionality to its element.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* html`<button class="${iconButton({color: 'filled'})}">
|
|
114
|
+
* <md-icon>favorite</md-icon>
|
|
115
|
+
* </button>`;
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
export const iconButton = createClassMapDirective({
|
|
119
|
+
getClasses: iconButtonClasses,
|
|
120
|
+
setupElement: setupIconButton,
|
|
121
|
+
});
|
|
122
|
+
//# sourceMappingURL=icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["icon-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,aAAa,EACb,kBAAkB,GACnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAC,cAAc,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAKvE,wCAAwC;AACxC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAKX,uCAAuC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACA,CAAC;AAKX,wCAAwC;AACxC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX,2BAA2B;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EAAE,UAAU;IACnB,aAAa,EAAE,iBAAiB;IAChC,YAAY,EAAE,gBAAgB;IAC9B,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,mBAAmB;IACpC,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,a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AAC,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CACzD,CAAC;YACF,UAAU,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACL,CAAC,EACD,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,uBAAuB,CAAC;IAChD,UAAU,EAAE,iBAAiB;IAC7B,YAAY,EAAE,eAAe;CAC9B,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {type ClassInfo} from 'lit/directives/class-map.js';\nimport {\n afterDispatch,\n setupDispatchHooks,\n} from '../../../../internal/events/dispatch-hooks.js';\nimport {focusRingClasses} from '../focus/focus-ring.js';\nimport {rippleClasses, setupRipple} from '../ripple/ripple.js';\nimport {createClassMapDirective} from '../shared/directives.js';\nimport {PSEUDO_CLASSES, isDisabled} from '../shared/pseudo-classes.js';\n\n/** Icon Button color configuration types. */\nexport type IconButtonColor = 'filled' | 'tonal' | 'outlined' | 'standard';\n\n/** Icon Button color configurations. */\nexport const ICON_BUTTON_COLORS = {\n filled: 'filled',\n tonal: 'tonal',\n outlined: 'outlined',\n standard: 'standard',\n} as const;\n\n/** Icon Button size configuration types. */\nexport type IconButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Icon Button size configurations. */\nexport const ICON_BUTTON_SIZES = {\n xs: 'xs',\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n xl: 'xl',\n} as const;\n\n/** Icon Button width configuration types. */\nexport type IconButtonWidth = 'narrow' | 'wide' | '';\n\n/** Icon Button width configurations. */\nexport const ICON_BUTTON_WIDTHS = {\n narrow: 'narrow',\n wide: 'wide',\n} as const;\n\n/** Icon Button classes. */\nexport const ICON_BUTTON_CLASSES = {\n iconBtn: 'icon-btn',\n iconBtnFilled: 'icon-btn-filled',\n iconBtnTonal: 'icon-btn-tonal',\n iconBtnOutlined: 'icon-btn-outlined',\n iconBtnStandard: 'icon-btn-standard',\n iconBtnXs: 'icon-btn-xs',\n iconBtnSm: 'icon-btn-sm',\n iconBtnMd: 'icon-btn-md',\n iconBtnLg: 'icon-btn-lg',\n iconBtnXl: 'icon-btn-xl',\n iconBtnSquare: 'icon-btn-square',\n iconBtnNarrow: 'icon-btn-narrow',\n iconBtnWide: 'icon-btn-wide',\n iconBtnUnselected: 'icon-btn-unselected',\n iconBtnSelected: 'icon-btn-selected',\n active: PSEUDO_CLASSES.active,\n disabled: PSEUDO_CLASSES.disabled,\n};\n\n/** The state provided to the `iconButtonClasses()` function. */\nexport interface IconButtonClassesState {\n /** The color of the icon button. */\n color?: IconButtonColor;\n /** The size of the icon button. */\n size?: IconButtonSize;\n /** The width of the icon button. */\n width?: IconButtonWidth;\n /** Whether the icon button is a square shape. */\n square?: boolean;\n /** Whether the toggle button is selected, if not undefined. */\n selected?: boolean;\n /** Emulates `:active`. */\n active?: boolean;\n /** Emulates `:disabled`. */\n disabled?: boolean;\n}\n\n/**\n * Returns the icon button classes to apply to an element based on the given\n * state.\n *\n * @param state The state of the icon button.\n * @return An object of class names and truthy values if they apply.\n */\nexport function iconButtonClasses({\n color,\n size,\n width,\n square = false,\n selected,\n active = false,\n disabled = false,\n}: IconButtonClassesState = {}): ClassInfo {\n return {\n ...rippleClasses(),\n ...focusRingClasses(),\n [ICON_BUTTON_CLASSES.iconBtn]: true,\n [ICON_BUTTON_CLASSES.iconBtnFilled]: color === ICON_BUTTON_COLORS.filled,\n [ICON_BUTTON_CLASSES.iconBtnTonal]: color === ICON_BUTTON_COLORS.tonal,\n [ICON_BUTTON_CLASSES.iconBtnOutlined]:\n color === ICON_BUTTON_COLORS.outlined,\n [ICON_BUTTON_CLASSES.iconBtnStandard]:\n color === ICON_BUTTON_COLORS.standard || !color,\n [ICON_BUTTON_CLASSES.iconBtnXs]: size === ICON_BUTTON_SIZES.xs,\n [ICON_BUTTON_CLASSES.iconBtnSm]: size === ICON_BUTTON_SIZES.sm || !size,\n [ICON_BUTTON_CLASSES.iconBtnMd]: size === ICON_BUTTON_SIZES.md,\n [ICON_BUTTON_CLASSES.iconBtnLg]: size === ICON_BUTTON_SIZES.lg,\n [ICON_BUTTON_CLASSES.iconBtnXl]: size === ICON_BUTTON_SIZES.xl,\n [ICON_BUTTON_CLASSES.iconBtnNarrow]: width === ICON_BUTTON_WIDTHS.narrow,\n [ICON_BUTTON_CLASSES.iconBtnWide]: width === ICON_BUTTON_WIDTHS.wide,\n [ICON_BUTTON_CLASSES.iconBtnSquare]: square,\n [ICON_BUTTON_CLASSES.iconBtnUnselected]: selected === false,\n [ICON_BUTTON_CLASSES.iconBtnSelected]: selected === true,\n [ICON_BUTTON_CLASSES.active]: active,\n [ICON_BUTTON_CLASSES.disabled]: disabled,\n };\n}\n\n/**\n * Sets up icon button functionality for the given element.\n *\n * @param iconButton The element on which to set up icon button functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupIconButton(\n iconButton: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n setupDispatchHooks(iconButton, 'click');\n setupRipple(iconButton, opts);\n iconButton.addEventListener(\n 'click',\n (event) => {\n if (isDisabled(iconButton)) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n afterDispatch(event, () => {\n const isToggle = iconButton.hasAttribute('aria-pressed');\n if (event.defaultPrevented || !isToggle) {\n return;\n }\n\n const isPressed = iconButton.ariaPressed === 'true';\n iconButton.ariaPressed = String(!isPressed);\n iconButton.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n iconButton.dispatchEvent(new Event('change', {bubbles: true}));\n });\n },\n opts,\n );\n}\n\n/**\n * A Lit directive that adds icon button styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`<button class=\"${iconButton({color: 'filled'})}\">\n * <md-icon>favorite</md-icon>\n * </button>`;\n * ```\n */\nexport const iconButton = createClassMapDirective({\n getClasses: iconButtonClasses,\n setupElement: setupIconButton,\n});\n"]}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 Google LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// go/keep-sorted start by_regex='(.+) prefix_order=sass:
|
|
7
|
+
@use 'icon-button-tokens';
|
|
8
|
+
// go/keep-sorted end
|
|
9
|
+
|
|
10
|
+
@layer md.sys, md.comp.ripple, md.comp.focus-ring;
|
|
11
|
+
@layer md.comp.icon-btn {
|
|
12
|
+
.icon-btn {
|
|
13
|
+
& {
|
|
14
|
+
@include icon-button-tokens.root;
|
|
15
|
+
}
|
|
16
|
+
&:is(.icon-btn-selected, [aria-pressed='true']) {
|
|
17
|
+
@include icon-button-tokens.selected;
|
|
18
|
+
}
|
|
19
|
+
&.icon-btn-filled {
|
|
20
|
+
@include icon-button-tokens.filled;
|
|
21
|
+
&:where(.icon-btn-unselected, [aria-pressed='false']) {
|
|
22
|
+
@include icon-button-tokens.filled-unselected;
|
|
23
|
+
}
|
|
24
|
+
&:where(.icon-btn-selected, [aria-pressed='true']) {
|
|
25
|
+
@include icon-button-tokens.filled-selected;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
&.icon-btn-tonal {
|
|
29
|
+
@include icon-button-tokens.tonal;
|
|
30
|
+
&:where(.icon-btn-selected, [aria-pressed='true']) {
|
|
31
|
+
@include icon-button-tokens.tonal-selected;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
&.icon-btn-outlined {
|
|
35
|
+
@include icon-button-tokens.outlined;
|
|
36
|
+
&:where(.icon-btn-selected, [aria-pressed='true']) {
|
|
37
|
+
@include icon-button-tokens.outlined-selected;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
&.icon-btn-standard {
|
|
41
|
+
@include icon-button-tokens.standard;
|
|
42
|
+
&:where(.icon-btn-selected, [aria-pressed='true']) {
|
|
43
|
+
@include icon-button-tokens.standard-selected;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
&.icon-btn-xs {
|
|
47
|
+
@include icon-button-tokens.xs;
|
|
48
|
+
&:where(.icon-btn-narrow) {
|
|
49
|
+
@include icon-button-tokens.xs-narrow;
|
|
50
|
+
}
|
|
51
|
+
&:where(.icon-btn-wide) {
|
|
52
|
+
@include icon-button-tokens.xs-wide;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
&.icon-btn-sm {
|
|
56
|
+
@include icon-button-tokens.sm;
|
|
57
|
+
&:where(.icon-btn-narrow) {
|
|
58
|
+
@include icon-button-tokens.sm-narrow;
|
|
59
|
+
}
|
|
60
|
+
&:where(.icon-btn-wide) {
|
|
61
|
+
@include icon-button-tokens.sm-wide;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
&.icon-btn-md {
|
|
65
|
+
@include icon-button-tokens.md;
|
|
66
|
+
&:where(.icon-btn-narrow) {
|
|
67
|
+
@include icon-button-tokens.md-narrow;
|
|
68
|
+
}
|
|
69
|
+
&:where(.icon-btn-wide) {
|
|
70
|
+
@include icon-button-tokens.md-wide;
|
|
71
|
+
}
|
|
72
|
+
&:where(.icon-btn-selected, [aria-pressed='true']) {
|
|
73
|
+
@include icon-button-tokens.md-selected;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
&.icon-btn-lg {
|
|
77
|
+
@include icon-button-tokens.lg;
|
|
78
|
+
&:where(.icon-btn-narrow) {
|
|
79
|
+
@include icon-button-tokens.lg-narrow;
|
|
80
|
+
}
|
|
81
|
+
&:where(.icon-btn-wide) {
|
|
82
|
+
@include icon-button-tokens.lg-wide;
|
|
83
|
+
}
|
|
84
|
+
&:where(.icon-btn-selected, [aria-pressed='true']) {
|
|
85
|
+
@include icon-button-tokens.lg-selected;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
&.icon-btn-xl {
|
|
89
|
+
@include icon-button-tokens.xl;
|
|
90
|
+
&:where(.icon-btn-narrow) {
|
|
91
|
+
@include icon-button-tokens.xl-narrow;
|
|
92
|
+
}
|
|
93
|
+
&:where(.icon-btn-wide) {
|
|
94
|
+
@include icon-button-tokens.xl-wide;
|
|
95
|
+
}
|
|
96
|
+
&:where(.icon-btn-selected, [aria-pressed='true']) {
|
|
97
|
+
@include icon-button-tokens.xl-selected;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
&.icon-btn-square {
|
|
101
|
+
@include icon-button-tokens.square;
|
|
102
|
+
&:where(.icon-btn-md) {
|
|
103
|
+
@include icon-button-tokens.square-md;
|
|
104
|
+
}
|
|
105
|
+
&:where(.icon-btn-lg) {
|
|
106
|
+
@include icon-button-tokens.square-lg;
|
|
107
|
+
}
|
|
108
|
+
&:where(.icon-btn-xl) {
|
|
109
|
+
@include icon-button-tokens.square-xl;
|
|
110
|
+
}
|
|
111
|
+
&:where(.icon-btn-selected, [aria-pressed='true']) {
|
|
112
|
+
@include icon-button-tokens.square-selected;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
&:is(:active, .active):where(:not(:disabled, .disabled)) {
|
|
116
|
+
@include icon-button-tokens.pressed;
|
|
117
|
+
&:where(.icon-btn-md) {
|
|
118
|
+
@include icon-button-tokens.pressed-md;
|
|
119
|
+
}
|
|
120
|
+
&:where(.icon-btn-lg) {
|
|
121
|
+
@include icon-button-tokens.pressed-lg;
|
|
122
|
+
}
|
|
123
|
+
&:where(.icon-btn-xl) {
|
|
124
|
+
@include icon-button-tokens.pressed-xl;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
&:is(:disabled, .disabled) {
|
|
128
|
+
@include icon-button-tokens.disabled;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
& {
|
|
132
|
+
display: inline-grid;
|
|
133
|
+
place-items: center;
|
|
134
|
+
background-color: var(--container-color);
|
|
135
|
+
border: var(--outline-width) solid var(--outline-color);
|
|
136
|
+
border-radius: var(--container-shape);
|
|
137
|
+
height: var(--container-height);
|
|
138
|
+
color: var(--icon-color);
|
|
139
|
+
transition:
|
|
140
|
+
border-radius 350ms cubic-bezier(0.42, 1.67, 0.21, 0.9),
|
|
141
|
+
var(--ripple-transition);
|
|
142
|
+
--md-icon-size: var(--icon-size);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&:not(.icon-btn-narrow, .icon-btn-wide) {
|
|
146
|
+
aspect-ratio: 1;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&:is(.icon-btn-narrow, .icon-btn-wide) {
|
|
150
|
+
padding-inline: var(--leading-space) var(--trailing-space);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CSSResultOrNative, LitElement } from 'lit';
|
|
7
|
+
import type { IconButtonColor, IconButtonSize, IconButtonWidth } from './icon-button.js';
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
/** A Material Design icon button component. */
|
|
11
|
+
'md-icon-button': IconButton;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<(abstract new (...args: any[]) => import("../../../behaviors/element-internals.js").WithElementInternals) & typeof LitElement & import("../../../behaviors/form-associated.js").FormAssociatedConstructor, import("../../../behaviors/form-associated.js").FormAssociated>, import("../../../behaviors/form-submitter.js").FormSubmitter>>;
|
|
15
|
+
/**
|
|
16
|
+
* A Material Design icon button component.
|
|
17
|
+
*/
|
|
18
|
+
export declare class IconButton extends baseClass {
|
|
19
|
+
/** @nocollapse */
|
|
20
|
+
static shadowRootOptions: ShadowRootInit;
|
|
21
|
+
static styles: CSSResultOrNative[];
|
|
22
|
+
/**
|
|
23
|
+
* The color of the button.
|
|
24
|
+
*/
|
|
25
|
+
color: IconButtonColor;
|
|
26
|
+
/**
|
|
27
|
+
* The size of the button.
|
|
28
|
+
*/
|
|
29
|
+
size: IconButtonSize;
|
|
30
|
+
/**
|
|
31
|
+
* Changes the shape of the button to be square.
|
|
32
|
+
*/
|
|
33
|
+
square: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Changes the width of the button.
|
|
36
|
+
*/
|
|
37
|
+
width: IconButtonWidth;
|
|
38
|
+
/**
|
|
39
|
+
* A string indicating the behavior of the button.
|
|
40
|
+
*
|
|
41
|
+
* - "submit" (default): A button that submits its associated form.
|
|
42
|
+
* - "reset": A button that resets its associated form.
|
|
43
|
+
* - "button": A normal button.
|
|
44
|
+
* - "toggle": A toggle button using the `selected` property.
|
|
45
|
+
* - "link": An anchor link (`<a>`). Type is always "link" when `href` is set.
|
|
46
|
+
*/
|
|
47
|
+
get type(): string;
|
|
48
|
+
set type(type: string);
|
|
49
|
+
/**
|
|
50
|
+
* Whether or not the button is "soft-disabled" (disabled but still
|
|
51
|
+
* focusable).
|
|
52
|
+
*/
|
|
53
|
+
softDisabled: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether or not the button is selected, when `type="toggle"`.
|
|
56
|
+
*/
|
|
57
|
+
selected: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The URL that the link button points to.
|
|
60
|
+
*/
|
|
61
|
+
href: string;
|
|
62
|
+
/**
|
|
63
|
+
* The filename to use when downloading the linked resource.
|
|
64
|
+
*/
|
|
65
|
+
download: string;
|
|
66
|
+
/**
|
|
67
|
+
* Where to display the linked `href` URL for a link button.
|
|
68
|
+
*/
|
|
69
|
+
target: '_blank' | '_parent' | '_self' | '_top' | '';
|
|
70
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
71
|
+
private handleChange;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { __decorate } from "tslib";
|
|
7
|
+
import { css, html, LitElement, nothing } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { mixinDelegatesAria } from '../../../../internal/aria/delegate.js';
|
|
10
|
+
import { redispatchEvent } from '../../../../internal/events/redispatch-event.js';
|
|
11
|
+
import { mixinElementInternals } from '../../../behaviors/element-internals.js';
|
|
12
|
+
import { mixinFormAssociated } from '../../../behaviors/form-associated.js';
|
|
13
|
+
import { mixinFormSubmitter } from '../../../behaviors/form-submitter.js';
|
|
14
|
+
import focusRingStyles from '../focus/focus-ring.cssresult.js';
|
|
15
|
+
import rippleStyles from '../ripple/ripple.cssresult.js';
|
|
16
|
+
import iconButtonStyles from './icon-button.cssresult.js';
|
|
17
|
+
import { iconButton } from './icon-button.js';
|
|
18
|
+
const baseClass = mixinDelegatesAria(mixinFormSubmitter(mixinFormAssociated(mixinElementInternals(LitElement))));
|
|
19
|
+
/**
|
|
20
|
+
* A Material Design icon button component.
|
|
21
|
+
*/
|
|
22
|
+
let IconButton = class IconButton extends baseClass {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
/**
|
|
26
|
+
* The color of the button.
|
|
27
|
+
*/
|
|
28
|
+
this.color = 'standard';
|
|
29
|
+
/**
|
|
30
|
+
* The size of the button.
|
|
31
|
+
*/
|
|
32
|
+
this.size = 'sm';
|
|
33
|
+
/**
|
|
34
|
+
* Changes the shape of the button to be square.
|
|
35
|
+
*/
|
|
36
|
+
this.square = false;
|
|
37
|
+
/**
|
|
38
|
+
* Changes the width of the button.
|
|
39
|
+
*/
|
|
40
|
+
this.width = '';
|
|
41
|
+
/**
|
|
42
|
+
* Whether or not the button is "soft-disabled" (disabled but still
|
|
43
|
+
* focusable).
|
|
44
|
+
*/
|
|
45
|
+
this.softDisabled = false;
|
|
46
|
+
/**
|
|
47
|
+
* Whether or not the button is selected, when `type="toggle"`.
|
|
48
|
+
*/
|
|
49
|
+
this.selected = false;
|
|
50
|
+
/**
|
|
51
|
+
* The URL that the link button points to.
|
|
52
|
+
*/
|
|
53
|
+
this.href = '';
|
|
54
|
+
/**
|
|
55
|
+
* The filename to use when downloading the linked resource.
|
|
56
|
+
*/
|
|
57
|
+
this.download = '';
|
|
58
|
+
/**
|
|
59
|
+
* Where to display the linked `href` URL for a link button.
|
|
60
|
+
*/
|
|
61
|
+
this.target = '';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A string indicating the behavior of the button.
|
|
65
|
+
*
|
|
66
|
+
* - "submit" (default): A button that submits its associated form.
|
|
67
|
+
* - "reset": A button that resets its associated form.
|
|
68
|
+
* - "button": A normal button.
|
|
69
|
+
* - "toggle": A toggle button using the `selected` property.
|
|
70
|
+
* - "link": An anchor link (`<a>`). Type is always "link" when `href` is set.
|
|
71
|
+
*/
|
|
72
|
+
get type() {
|
|
73
|
+
return this.href ? 'link' : super.type;
|
|
74
|
+
}
|
|
75
|
+
set type(type) {
|
|
76
|
+
if (this.href && type !== 'link') {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
super.type = type;
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
const classes = iconButton({
|
|
83
|
+
color: this.color,
|
|
84
|
+
size: this.size,
|
|
85
|
+
width: this.width,
|
|
86
|
+
square: this.square,
|
|
87
|
+
disabled: this.softDisabled,
|
|
88
|
+
});
|
|
89
|
+
const { ariaLabel, ariaHasPopup, ariaExpanded } = this;
|
|
90
|
+
if (this.type === 'link') {
|
|
91
|
+
return html `<a
|
|
92
|
+
part="icon-btn"
|
|
93
|
+
class=${classes}
|
|
94
|
+
href=${this.href}
|
|
95
|
+
download=${this.download || nothing}
|
|
96
|
+
target=${this.target || nothing}
|
|
97
|
+
aria-label=${ariaLabel || nothing}
|
|
98
|
+
aria-haspopup=${ariaHasPopup || nothing}
|
|
99
|
+
aria-expanded=${ariaExpanded || nothing}
|
|
100
|
+
aria-disabled=${this.disabled || this.softDisabled || nothing}
|
|
101
|
+
tabindex=${this.disabled && !this.softDisabled ? -1 : nothing}>
|
|
102
|
+
<slot></slot>
|
|
103
|
+
</a>`;
|
|
104
|
+
}
|
|
105
|
+
return html `<button
|
|
106
|
+
part="icon-btn"
|
|
107
|
+
class=${classes}
|
|
108
|
+
type="button"
|
|
109
|
+
?disabled=${this.disabled}
|
|
110
|
+
aria-disabled=${this.softDisabled || nothing}
|
|
111
|
+
aria-label=${ariaLabel || nothing}
|
|
112
|
+
aria-pressed=${this.type === 'toggle' ? this.selected : nothing}
|
|
113
|
+
aria-haspopup=${ariaHasPopup || nothing}
|
|
114
|
+
aria-expanded=${ariaExpanded || nothing}
|
|
115
|
+
@change=${this.handleChange}>
|
|
116
|
+
<slot></slot>
|
|
117
|
+
</button>`;
|
|
118
|
+
}
|
|
119
|
+
handleChange(event) {
|
|
120
|
+
this.selected = event.target.ariaPressed === 'true';
|
|
121
|
+
redispatchEvent(this, event);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
/** @nocollapse */
|
|
125
|
+
IconButton.shadowRootOptions = {
|
|
126
|
+
mode: 'open',
|
|
127
|
+
delegatesFocus: true,
|
|
128
|
+
};
|
|
129
|
+
IconButton.styles = [
|
|
130
|
+
focusRingStyles,
|
|
131
|
+
rippleStyles,
|
|
132
|
+
iconButtonStyles,
|
|
133
|
+
css `
|
|
134
|
+
:host {
|
|
135
|
+
display: inline-flex;
|
|
136
|
+
}
|
|
137
|
+
.icon-btn {
|
|
138
|
+
flex: 1;
|
|
139
|
+
}
|
|
140
|
+
`,
|
|
141
|
+
];
|
|
142
|
+
__decorate([
|
|
143
|
+
property()
|
|
144
|
+
], IconButton.prototype, "color", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
property()
|
|
147
|
+
], IconButton.prototype, "size", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
property({ type: Boolean })
|
|
150
|
+
], IconButton.prototype, "square", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
property()
|
|
153
|
+
], IconButton.prototype, "width", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
property({ noAccessor: true })
|
|
156
|
+
], IconButton.prototype, "type", null);
|
|
157
|
+
__decorate([
|
|
158
|
+
property({ type: Boolean, attribute: 'soft-disabled', reflect: true })
|
|
159
|
+
], IconButton.prototype, "softDisabled", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
property({ type: Boolean })
|
|
162
|
+
], IconButton.prototype, "selected", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
property()
|
|
165
|
+
], IconButton.prototype, "href", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
property()
|
|
168
|
+
], IconButton.prototype, "download", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
property()
|
|
171
|
+
], IconButton.prototype, "target", void 0);
|
|
172
|
+
IconButton = __decorate([
|
|
173
|
+
customElement('md-icon-button')
|
|
174
|
+
], IconButton);
|
|
175
|
+
export { IconButton };
|
|
176
|
+
//# sourceMappingURL=md-icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"md-icon-button.js","sourceRoot":"","sources":["md-icon-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACtE,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAC,eAAe,EAAC,MAAM,iDAAiD,CAAC;AACh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K,MAAM,CAAC;QACrE,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;;AAnID,kBAAkB;AACF,4BAAiB,GAAmB;IAClD,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAEc,iBAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,GAAG,CAAA;;;;;;;KAOF;CACF,AAZqB,CAYpB;AAKU;IAAX,QAAQ,EAAE;yCAAqC;AAKpC;IAAX,QAAQ,EAAE;wCAA6B;AAKb;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CAAgB;AAK9B;IAAX,QAAQ,EAAE;yCAA6B;AAYxC;IADC,QAAQ,CAAC,EAAC,UAAU,EAAE,IAAI,EAAC,CAAC;sCAG5B;AAaD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;gDAChD;AAKM;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CAAkB;AAKhC;IAAX,QAAQ,EAAE;wCAAW;AAKV;IAAX,QAAQ,EAAE;4CAAe;AAKd;IAAX,QAAQ,EAAE;0CAA2D;AAtF3D,UAAU;IADtB,aAAa,CAAC,gBAAgB,CAAC;GACnB,UAAU,CAqItB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, LitElement, nothing} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {ARIAMixinStrict} from '../../../../internal/aria/aria.js';\nimport {mixinDelegatesAria} from '../../../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../../../internal/events/redispatch-event.js';\nimport {mixinElementInternals} from '../../../behaviors/element-internals.js';\nimport {mixinFormAssociated} from '../../../behaviors/form-associated.js';\nimport {mixinFormSubmitter} from '../../../behaviors/form-submitter.js';\n\nimport focusRingStyles from '../focus/focus-ring.cssresult.js';\nimport rippleStyles from '../ripple/ripple.cssresult.js';\nimport iconButtonStyles from './icon-button.cssresult.js';\n\nimport type {\n IconButtonColor,\n IconButtonSize,\n IconButtonWidth,\n} from './icon-button.js';\nimport {iconButton} from './icon-button.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design icon button component. */\n 'md-icon-button': IconButton;\n }\n}\n\nconst baseClass = mixinDelegatesAria(\n mixinFormSubmitter(mixinFormAssociated(mixinElementInternals(LitElement))),\n);\n\n/**\n * A Material Design icon button component.\n */\n@customElement('md-icon-button')\nexport class IconButton extends baseClass {\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n iconButtonStyles,\n css`\n :host {\n display: inline-flex;\n }\n .icon-btn {\n flex: 1;\n }\n `,\n ];\n\n /**\n * The color of the button.\n */\n @property() color: IconButtonColor = 'standard';\n\n /**\n * The size of the button.\n */\n @property() size: IconButtonSize = 'sm';\n\n /**\n * Changes the shape of the button to be square.\n */\n @property({type: Boolean}) square = false;\n\n /**\n * Changes the width of the button.\n */\n @property() width: IconButtonWidth = '';\n\n /**\n * A string indicating the behavior of the button.\n *\n * - \"submit\" (default): A button that submits its associated form.\n * - \"reset\": A button that resets its associated form.\n * - \"button\": A normal button.\n * - \"toggle\": A toggle button using the `selected` property.\n * - \"link\": An anchor link (`<a>`). Type is always \"link\" when `href` is set.\n */\n @property({noAccessor: true})\n override get type(): string {\n return this.href ? 'link' : super.type;\n }\n override set type(type: string) {\n if (this.href && type !== 'link') {\n return;\n }\n super.type = type;\n }\n\n /**\n * Whether or not the button is \"soft-disabled\" (disabled but still\n * focusable).\n */\n @property({type: Boolean, attribute: 'soft-disabled', reflect: true})\n softDisabled = false;\n\n /**\n * Whether or not the button is selected, when `type=\"toggle\"`.\n */\n @property({type: Boolean}) selected = false;\n\n /**\n * The URL that the link button points to.\n */\n @property() href = '';\n\n /**\n * The filename to use when downloading the linked resource.\n */\n @property() download = '';\n\n /**\n * Where to display the linked `href` URL for a link button.\n */\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n\n protected override render() {\n const classes = iconButton({\n color: this.color,\n size: this.size,\n width: this.width,\n square: this.square,\n disabled: this.softDisabled,\n });\n\n const {ariaLabel, ariaHasPopup, ariaExpanded} = this as ARIAMixinStrict;\n if (this.type === 'link') {\n return html`<a\n part=\"icon-btn\"\n class=${classes}\n href=${this.href}\n download=${this.download || nothing}\n target=${this.target || nothing}\n aria-label=${ariaLabel || nothing}\n aria-haspopup=${ariaHasPopup || nothing}\n aria-expanded=${ariaExpanded || nothing}\n aria-disabled=${this.disabled || this.softDisabled || nothing}\n tabindex=${this.disabled && !this.softDisabled ? -1 : nothing}>\n <slot></slot>\n </a>`;\n }\n\n return html`<button\n part=\"icon-btn\"\n class=${classes}\n type=\"button\"\n ?disabled=${this.disabled}\n aria-disabled=${this.softDisabled || nothing}\n aria-label=${ariaLabel || nothing}\n aria-pressed=${this.type === 'toggle' ? this.selected : nothing}\n aria-haspopup=${ariaHasPopup || nothing}\n aria-expanded=${ariaExpanded || nothing}\n @change=${this.handleChange}>\n <slot></slot>\n </button>`;\n }\n\n private handleChange(event: Event) {\n this.selected = (event.target as HTMLElement).ariaPressed === 'true';\n redispatchEvent(this, event);\n }\n}\n"]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 Google LLC
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
@mixin root {
|
|
7
|
+
--container-shape: var(--md-sys-shape-corner-lg);
|
|
8
|
+
--gap: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin segmented {
|
|
12
|
+
--gap: 2px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@mixin item {
|
|
16
|
+
--container-height: 56px;
|
|
17
|
+
--container-color: transparent;
|
|
18
|
+
--container-shape: var(--md-sys-shape-corner-xs);
|
|
19
|
+
--label-text-color: var(--md-sys-color-on-surface);
|
|
20
|
+
--label-text: var(--md-sys-typescale-body-lg);
|
|
21
|
+
--label-text-tracking: var(--md-sys-typescale-body-lg-tracking);
|
|
22
|
+
--leading-space: 16px;
|
|
23
|
+
--trailing-space: 16px;
|
|
24
|
+
--between-space: 12px;
|
|
25
|
+
--top-space: 10px;
|
|
26
|
+
--bottom-space: 10px;
|
|
27
|
+
--avatar-size: 40px;
|
|
28
|
+
--avatar-shape: var(--md-sys-shape-corner-full);
|
|
29
|
+
--avatar-color: var(--md-sys-color-primary-container);
|
|
30
|
+
--avatar-label: var(--md-sys-typescale-title-md);
|
|
31
|
+
--avatar-label-tracking: var(--md-sys-typescale-title-md-tracking);
|
|
32
|
+
--avatar-label-color: var(--md-sys-color-on-primary-container);
|
|
33
|
+
--leading-icon-color: var(--md-sys-color-on-surface-variant);
|
|
34
|
+
--leading-icon-size: 20px;
|
|
35
|
+
--trailing-icon-color: var(--md-sys-color-on-surface-variant);
|
|
36
|
+
--trailing-icon-size: 20px;
|
|
37
|
+
--overline: var(--md-sys-typescale-label-sm);
|
|
38
|
+
--overline-tracking: var(--md-sys-typescale-label-sm-tracking);
|
|
39
|
+
--overline-color: var(--md-sys-color-on-surface-variant);
|
|
40
|
+
--supporting-text: var(--md-sys-typescale-body-md);
|
|
41
|
+
--supporting-text-tracking: var(--md-sys-typescale-body-md-tracking);
|
|
42
|
+
--supporting-text-color: var(--md-sys-color-on-surface-variant);
|
|
43
|
+
--trailing-supporting-text: var(--md-sys-typescale-label-sm);
|
|
44
|
+
--trailing-supporting-text-tracking: var(
|
|
45
|
+
--md-sys-typescale-label-sm-tracking
|
|
46
|
+
);
|
|
47
|
+
--trailing-supporting-text-color: var(--md-sys-color-on-surface-variant);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@mixin item-segmented {
|
|
51
|
+
--container-color: var(--md-sys-color-surface);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@mixin item-hovered {
|
|
55
|
+
--container-shape: var(--md-sys-shape-corner-md);
|
|
56
|
+
--leading-icon-color: var(--md-sys-color-on-surface);
|
|
57
|
+
--trailing-icon-color: var(--md-sys-color-on-surface);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@mixin item-focused {
|
|
61
|
+
--container-shape: var(--md-sys-shape-corner-lg);
|
|
62
|
+
--leading-icon-color: var(--md-sys-color-on-surface);
|
|
63
|
+
--trailing-icon-color: var(--md-sys-color-on-surface);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@mixin item-pressed {
|
|
67
|
+
--container-shape: var(--md-sys-shape-corner-lg);
|
|
68
|
+
--leading-icon-color: var(--md-sys-color-on-surface);
|
|
69
|
+
--trailing-icon-color: var(--md-sys-color-on-surface);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@mixin item-selected {
|
|
73
|
+
--container-shape: var(--md-sys-shape-corner-lg);
|
|
74
|
+
--container-color: var(--md-sys-color-secondary-container);
|
|
75
|
+
--label-text-color: var(--md-sys-color-on-secondary-container);
|
|
76
|
+
--leading-icon-color: var(--md-sys-color-on-secondary-container);
|
|
77
|
+
--trailing-icon-color: var(--md-sys-color-on-secondary-container);
|
|
78
|
+
--overline-color: var(--md-sys-color-on-secondary-container);
|
|
79
|
+
--supporting-text-color: var(--md-sys-color-on-secondary-container);
|
|
80
|
+
--trailing-supporting-text-color: var(
|
|
81
|
+
--md-sys-color-on-secondary-container
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@mixin item-disabled {
|
|
86
|
+
--container-shape: var(--md-sys-shape-corner-xs);
|
|
87
|
+
--container-color: hsl(from var(--md-sys-color-on-surface) h s l / 10%);
|
|
88
|
+
--label-text-color: hsl(from var(--md-sys-color-on-surface) h s l / 38%);
|
|
89
|
+
--leading-icon-color: hsl(
|
|
90
|
+
from var(--md-sys-color-on-surface) h s l / 38%
|
|
91
|
+
);
|
|
92
|
+
--trailing-icon-color: hsl(
|
|
93
|
+
from var(--md-sys-color-on-surface) h s l / 38%
|
|
94
|
+
);
|
|
95
|
+
--overline-color: hsl(from var(--md-sys-color-on-surface) h s l / 38%);
|
|
96
|
+
--supporting-text-color: hsl(
|
|
97
|
+
from var(--md-sys-color-on-surface) h s l / 38%
|
|
98
|
+
);
|
|
99
|
+
--trailing-supporting-text-color: hsl(
|
|
100
|
+
from var(--md-sys-color-on-surface) h s l / 38%
|
|
101
|
+
);
|
|
102
|
+
}
|