@material/web 2.4.2-nightly.fd6fe2a.0 → 2.5.1-nightly.70e259d.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/custom-elements.json +7148 -7166
- package/labs/aria/query-associated.d.ts +23 -0
- package/labs/aria/query-associated.js +36 -0
- package/labs/aria/query-associated.js.map +1 -0
- package/labs/aria/tabs/md-aria-tab.d.ts +11 -0
- package/labs/aria/tabs/md-aria-tab.js +8 -0
- package/labs/aria/tabs/md-aria-tab.js.map +1 -0
- package/labs/aria/tabs/md-aria-tablist.d.ts +11 -0
- package/labs/aria/tabs/md-aria-tablist.js +8 -0
- package/labs/aria/tabs/md-aria-tablist.js.map +1 -0
- package/labs/aria/tabs/md-aria-tabpanel.d.ts +11 -0
- package/labs/aria/tabs/md-aria-tabpanel.js +8 -0
- package/labs/aria/tabs/md-aria-tabpanel.js.map +1 -0
- package/labs/aria/tabs/tab.d.ts +33 -0
- package/labs/aria/tabs/tab.js +88 -0
- package/labs/aria/tabs/tab.js.map +1 -0
- package/labs/aria/tabs/tablist.d.ts +67 -0
- package/labs/aria/tabs/tablist.js +271 -0
- package/labs/aria/tabs/tablist.js.map +1 -0
- package/labs/aria/tabs/tabpanel.d.ts +26 -0
- package/labs/aria/tabs/tabpanel.js +53 -0
- package/labs/aria/tabs/tabpanel.js.map +1 -0
- package/labs/gb/components/appbar/_app-bar-tokens.scss +136 -0
- package/labs/gb/components/appbar/app-bar-element.d.ts +53 -0
- package/labs/gb/components/appbar/app-bar-element.js +144 -0
- package/labs/gb/components/appbar/app-bar-element.js.map +1 -0
- package/labs/gb/components/appbar/app-bar.css +4 -0
- package/labs/gb/components/appbar/app-bar.css.map +1 -0
- package/labs/gb/components/appbar/app-bar.cssresult.d.ts +3 -0
- package/labs/gb/components/appbar/app-bar.cssresult.js +14 -0
- package/labs/gb/components/appbar/app-bar.cssresult.js.map +1 -0
- package/labs/gb/components/appbar/app-bar.d.ts +71 -0
- package/labs/gb/components/appbar/app-bar.js +96 -0
- package/labs/gb/components/appbar/app-bar.js.map +1 -0
- package/labs/gb/components/appbar/app-bar.scss +167 -0
- package/labs/gb/components/appbar/md-gb-app-bar.d.ts +12 -0
- package/labs/gb/components/appbar/md-gb-app-bar.js +8 -0
- package/labs/gb/components/appbar/md-gb-app-bar.js.map +1 -0
- package/labs/gb/components/badge/_badge-tokens.scss +18 -0
- package/labs/gb/components/badge/badge-element.d.ts +15 -0
- package/labs/gb/components/badge/badge-element.js +49 -0
- package/labs/gb/components/badge/badge-element.js.map +1 -0
- package/labs/gb/components/badge/badge.css +4 -0
- package/labs/gb/components/badge/badge.css.map +1 -0
- package/labs/gb/components/badge/badge.cssresult.d.ts +3 -0
- package/labs/gb/components/badge/badge.cssresult.js +14 -0
- package/labs/gb/components/badge/badge.cssresult.js.map +1 -0
- package/labs/gb/components/badge/badge.d.ts +32 -0
- package/labs/gb/components/badge/badge.js +35 -0
- package/labs/gb/components/badge/badge.js.map +1 -0
- package/labs/gb/components/badge/badge.scss +49 -0
- package/labs/gb/components/badge/md-gb-badge.d.ts +12 -0
- package/labs/gb/components/badge/md-gb-badge.js +8 -0
- package/labs/gb/components/badge/md-gb-badge.js.map +1 -0
- package/labs/gb/components/button/_button-tokens.scss +2 -0
- package/labs/gb/components/button/{md-button.d.ts → button-element.d.ts} +22 -7
- package/labs/gb/components/button/{md-button.js → button-element.js} +38 -20
- package/labs/gb/components/button/button-element.js.map +1 -0
- package/labs/gb/components/button/button.css.map +1 -1
- package/labs/gb/components/button/md-gb-button.d.ts +12 -0
- package/labs/gb/components/button/md-gb-button.js +8 -0
- package/labs/gb/components/button/md-gb-button.js.map +1 -0
- package/labs/gb/components/card/_card-tokens.scss +2 -0
- package/labs/gb/components/card/{md-card.d.ts → card-element.d.ts} +12 -7
- package/labs/gb/components/card/{md-card.js → card-element.js} +21 -14
- package/labs/gb/components/card/card-element.js.map +1 -0
- package/labs/gb/components/card/card.css.map +1 -1
- package/labs/gb/components/card/md-gb-card.d.ts +12 -0
- package/labs/gb/components/card/md-gb-card.js +8 -0
- package/labs/gb/components/card/md-gb-card.js.map +1 -0
- package/labs/gb/components/checkbox/_checkbox-tokens.scss +2 -0
- package/labs/gb/components/checkbox/{md-checkbox.d.ts → checkbox-element.d.ts} +15 -7
- package/labs/gb/components/checkbox/{md-checkbox.js → checkbox-element.js} +26 -16
- package/labs/gb/components/checkbox/checkbox-element.js.map +1 -0
- package/labs/gb/components/checkbox/checkbox.css.map +1 -1
- package/labs/gb/components/checkbox/md-gb-checkbox.d.ts +12 -0
- package/labs/gb/components/checkbox/md-gb-checkbox.js +8 -0
- package/labs/gb/components/checkbox/md-gb-checkbox.js.map +1 -0
- package/labs/gb/components/chip/_chip-tokens.scss +167 -0
- package/labs/gb/components/chip/chip-element.d.ts +73 -0
- package/labs/gb/components/chip/chip-element.js +233 -0
- package/labs/gb/components/chip/chip-element.js.map +1 -0
- package/labs/gb/components/chip/chip.css +4 -0
- package/labs/gb/components/chip/chip.css.map +1 -0
- package/labs/gb/components/chip/chip.cssresult.d.ts +3 -0
- package/labs/gb/components/chip/chip.cssresult.js +14 -0
- package/labs/gb/components/chip/chip.cssresult.js.map +1 -0
- package/labs/gb/components/chip/chip.d.ts +77 -0
- package/labs/gb/components/chip/chip.js +99 -0
- package/labs/gb/components/chip/chip.js.map +1 -0
- package/labs/gb/components/chip/chip.scss +97 -0
- package/labs/gb/components/chip/md-gb-chip.d.ts +13 -0
- package/labs/gb/components/chip/md-gb-chip.js +9 -0
- package/labs/gb/components/chip/md-gb-chip.js.map +1 -0
- package/labs/gb/components/divider/_divider-tokens.scss +2 -0
- package/labs/gb/components/divider/{md-divider.d.ts → divider-element.d.ts} +5 -7
- package/labs/gb/components/divider/{md-divider.js → divider-element.js} +10 -10
- package/labs/gb/components/divider/divider-element.js.map +1 -0
- package/labs/gb/components/divider/divider.css.map +1 -1
- package/labs/gb/components/divider/md-gb-divider.d.ts +12 -0
- package/labs/gb/components/divider/md-gb-divider.js +8 -0
- package/labs/gb/components/divider/md-gb-divider.js.map +1 -0
- package/labs/gb/components/fab/_fab-tokens.scss +2 -0
- package/labs/gb/components/fab/fab-element.d.ts +31 -0
- package/labs/gb/components/fab/{md-fab.js → fab-element.js} +22 -11
- package/labs/gb/components/fab/fab-element.js.map +1 -0
- package/labs/gb/components/fab/fab.css.map +1 -1
- package/labs/gb/components/fab/md-gb-fab.d.ts +12 -0
- package/labs/gb/components/fab/md-gb-fab.js +8 -0
- package/labs/gb/components/fab/md-gb-fab.js.map +1 -0
- package/labs/gb/components/iconbutton/_icon-button-tokens.scss +2 -0
- package/labs/gb/components/iconbutton/{md-icon-button.d.ts → icon-button-element.d.ts} +15 -7
- package/labs/gb/components/iconbutton/{md-icon-button.js → icon-button-element.js} +30 -20
- package/labs/gb/components/iconbutton/icon-button-element.js.map +1 -0
- package/labs/gb/components/iconbutton/icon-button.css.map +1 -1
- package/labs/gb/components/iconbutton/md-gb-icon-button.d.ts +12 -0
- package/labs/gb/components/iconbutton/md-gb-icon-button.js +8 -0
- package/labs/gb/components/iconbutton/md-gb-icon-button.js.map +1 -0
- package/labs/gb/components/list/_list-tokens.scss +4 -0
- package/labs/gb/components/list/{md-list.d.ts → list-element.d.ts} +6 -7
- package/labs/gb/components/list/{md-list.js → list-element.js} +11 -10
- package/labs/gb/components/list/list-element.js.map +1 -0
- package/labs/gb/components/list/list-item-element.d.ts +77 -0
- package/labs/gb/components/list/{md-list-item.js → list-item-element.js} +48 -13
- package/labs/gb/components/list/list-item-element.js.map +1 -0
- package/labs/gb/components/list/list.css.map +1 -1
- package/labs/gb/components/list/md-gb-list-item.d.ts +12 -0
- package/labs/gb/components/list/md-gb-list-item.js +8 -0
- package/labs/gb/components/list/md-gb-list-item.js.map +1 -0
- package/labs/gb/components/list/md-gb-list.d.ts +12 -0
- package/labs/gb/components/list/md-gb-list.js +8 -0
- package/labs/gb/components/list/md-gb-list.js.map +1 -0
- package/labs/gb/components/menu/_menu-tokens.scss +4 -0
- package/labs/gb/components/menu/md-gb-menu-group.d.ts +12 -0
- package/labs/gb/components/menu/md-gb-menu-group.js +8 -0
- package/labs/gb/components/menu/md-gb-menu-group.js.map +1 -0
- package/labs/gb/components/menu/md-gb-menu-item.d.ts +12 -0
- package/labs/gb/components/menu/md-gb-menu-item.js +8 -0
- package/labs/gb/components/menu/md-gb-menu-item.js.map +1 -0
- package/labs/gb/components/menu/md-gb-menu.d.ts +12 -0
- package/labs/gb/components/menu/md-gb-menu.js +8 -0
- package/labs/gb/components/menu/md-gb-menu.js.map +1 -0
- package/labs/gb/components/menu/{md-menu.d.ts → menu-element.d.ts} +11 -7
- package/labs/gb/components/menu/{md-menu.js → menu-element.js} +16 -10
- package/labs/gb/components/menu/menu-element.js.map +1 -0
- package/labs/gb/components/menu/{md-menu-group.d.ts → menu-group-element.d.ts} +3 -6
- package/labs/gb/components/menu/{md-menu-group.js → menu-group-element.js} +11 -11
- package/labs/gb/components/menu/menu-group-element.js.map +1 -0
- package/labs/gb/components/menu/menu-item-element.d.ts +56 -0
- package/labs/gb/components/menu/{md-menu-item.js → menu-item-element.js} +41 -13
- package/labs/gb/components/menu/menu-item-element.js.map +1 -0
- package/labs/gb/components/menu/menu.css.map +1 -1
- package/labs/gb/components/menu/menu.js +1 -1
- package/labs/gb/components/menu/menu.js.map +1 -1
- package/labs/gb/components/radio/_radio-tokens.scss +2 -0
- package/labs/gb/components/radio/md-gb-radio.d.ts +12 -0
- package/labs/gb/components/radio/md-gb-radio.js +8 -0
- package/labs/gb/components/radio/md-gb-radio.js.map +1 -0
- package/labs/gb/components/radio/{md-radio.d.ts → radio-element.d.ts} +10 -7
- package/labs/gb/components/radio/{md-radio.js → radio-element.js} +19 -14
- package/labs/gb/components/radio/radio-element.js.map +1 -0
- package/labs/gb/components/radio/radio.css.map +1 -1
- package/labs/gb/components/splitbutton/_split-button-tokens.scss +4 -0
- package/labs/gb/components/splitbutton/md-gb-split-button.d.ts +12 -0
- package/labs/gb/components/splitbutton/md-gb-split-button.js +8 -0
- package/labs/gb/components/splitbutton/md-gb-split-button.js.map +1 -0
- package/labs/gb/components/splitbutton/split-button-element.d.ts +33 -0
- package/labs/gb/components/splitbutton/{md-split-button.js → split-button-element.js} +21 -12
- package/labs/gb/components/splitbutton/split-button-element.js.map +1 -0
- package/labs/gb/components/splitbutton/split-button.css.map +1 -1
- package/labs/gb/components/splitbutton/split-button.d.ts +4 -4
- package/labs/gb/components/splitbutton/split-button.js +4 -4
- package/labs/gb/components/splitbutton/split-button.js.map +1 -1
- package/labs/gb/components/switch/_switch-tokens.scss +2 -0
- package/labs/gb/components/switch/md-gb-switch.d.ts +12 -0
- package/labs/gb/components/switch/md-gb-switch.js +8 -0
- package/labs/gb/components/switch/md-gb-switch.js.map +1 -0
- package/labs/gb/components/switch/{md-switch.d.ts → switch-element.d.ts} +19 -7
- package/labs/gb/components/switch/{md-switch.js → switch-element.js} +28 -14
- package/labs/gb/components/switch/switch-element.js.map +1 -0
- package/labs/gb/components/switch/switch.css.map +1 -1
- package/labs/gb/styles/adopt-styles.js +6 -1
- package/labs/gb/styles/adopt-styles.js.map +1 -1
- package/labs/gb/styles/icon/{md-icon.d.ts → icon-element.d.ts} +1 -7
- package/labs/gb/styles/icon/{md-icon.js → icon-element.js} +8 -10
- package/labs/gb/styles/icon/icon-element.js.map +1 -0
- package/labs/gb/styles/icon/md-gb-icon.d.ts +12 -0
- package/labs/gb/styles/icon/md-gb-icon.js +8 -0
- package/labs/gb/styles/icon/md-gb-icon.js.map +1 -0
- package/package.json +3 -3
- package/labs/gb/components/button/md-button.js.map +0 -1
- package/labs/gb/components/card/md-card.js.map +0 -1
- package/labs/gb/components/checkbox/md-checkbox.js.map +0 -1
- package/labs/gb/components/divider/md-divider.js.map +0 -1
- package/labs/gb/components/fab/md-fab.d.ts +0 -22
- package/labs/gb/components/fab/md-fab.js.map +0 -1
- package/labs/gb/components/iconbutton/md-icon-button.js.map +0 -1
- package/labs/gb/components/list/md-list-item.d.ts +0 -44
- package/labs/gb/components/list/md-list-item.js.map +0 -1
- package/labs/gb/components/list/md-list.js.map +0 -1
- package/labs/gb/components/menu/md-menu-group.js.map +0 -1
- package/labs/gb/components/menu/md-menu-item.d.ts +0 -30
- package/labs/gb/components/menu/md-menu-item.js.map +0 -1
- package/labs/gb/components/menu/md-menu.js.map +0 -1
- package/labs/gb/components/radio/md-radio.js.map +0 -1
- package/labs/gb/components/splitbutton/md-split-button.d.ts +0 -26
- package/labs/gb/components/splitbutton/md-split-button.js.map +0 -1
- package/labs/gb/components/switch/md-switch.js.map +0 -1
- package/labs/gb/styles/icon/md-icon.js.map +0 -1
|
@@ -0,0 +1,99 @@
|
|
|
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 { isDisabled, PSEUDO_CLASSES } from '../shared/pseudo-classes.js';
|
|
11
|
+
/** Chip color configurations. */
|
|
12
|
+
export const CHIP_COLORS = {
|
|
13
|
+
elevated: 'elevated',
|
|
14
|
+
filled: 'filled',
|
|
15
|
+
outlined: 'outlined',
|
|
16
|
+
tonal: 'tonal',
|
|
17
|
+
};
|
|
18
|
+
/** Chip classes. */
|
|
19
|
+
export const CHIP_CLASSES = {
|
|
20
|
+
chip: 'chip',
|
|
21
|
+
chipElevated: 'chip-elevated',
|
|
22
|
+
chipFilled: 'chip-filled',
|
|
23
|
+
chipOutlined: 'chip-outlined',
|
|
24
|
+
chipTonal: 'chip-tonal',
|
|
25
|
+
chipSelected: 'chip-selected',
|
|
26
|
+
chipFilter: 'chip-filter',
|
|
27
|
+
chipInput: 'chip-input',
|
|
28
|
+
chipRemovable: 'chip-removable',
|
|
29
|
+
chipWithLeadingIcon: 'chip-with-leading-icon',
|
|
30
|
+
chipWithTrailingIcon: 'chip-with-trailing-icon',
|
|
31
|
+
chipWithAvatar: 'chip-with-avatar',
|
|
32
|
+
disabled: PSEUDO_CLASSES.disabled,
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Returns the chip classes to apply to an element based on the given state.
|
|
36
|
+
*
|
|
37
|
+
* @param state The state of the chip.
|
|
38
|
+
* @return An object of class names and truthy values if they apply.
|
|
39
|
+
*/
|
|
40
|
+
export function chipClasses({ color = 'outlined', type = 'action', selected = false, removable = false, withLeadingIcon = false, withTrailingIcon = false, withAvatar = false, disabled = false, } = {}) {
|
|
41
|
+
return {
|
|
42
|
+
...rippleClasses(),
|
|
43
|
+
...focusRingClasses(),
|
|
44
|
+
[CHIP_CLASSES.chip]: true,
|
|
45
|
+
[CHIP_CLASSES.chipElevated]: color === CHIP_COLORS.elevated,
|
|
46
|
+
[CHIP_CLASSES.chipFilled]: color === CHIP_COLORS.filled,
|
|
47
|
+
[CHIP_CLASSES.chipOutlined]: color === CHIP_COLORS.outlined,
|
|
48
|
+
[CHIP_CLASSES.chipTonal]: color === CHIP_COLORS.tonal,
|
|
49
|
+
[CHIP_CLASSES.chipSelected]: selected,
|
|
50
|
+
[CHIP_CLASSES.chipFilter]: type === 'filter' || type === 'toggle',
|
|
51
|
+
[CHIP_CLASSES.chipInput]: removable || type === 'action',
|
|
52
|
+
[CHIP_CLASSES.chipRemovable]: removable,
|
|
53
|
+
[CHIP_CLASSES.chipWithLeadingIcon]: withLeadingIcon,
|
|
54
|
+
[CHIP_CLASSES.chipWithTrailingIcon]: withTrailingIcon,
|
|
55
|
+
[CHIP_CLASSES.chipWithAvatar]: withAvatar,
|
|
56
|
+
[CHIP_CLASSES.disabled]: disabled,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Sets up chip functionality for the given element.
|
|
61
|
+
*
|
|
62
|
+
* @param chip The element on which to set up chip functionality.
|
|
63
|
+
* @param opts Setup options, supports a cleanup `signal`.
|
|
64
|
+
*/
|
|
65
|
+
export function setupChip(chip, opts) {
|
|
66
|
+
setupDispatchHooks(chip, 'click');
|
|
67
|
+
setupRipple(chip, opts);
|
|
68
|
+
chip.addEventListener('click', (event) => {
|
|
69
|
+
if (isDisabled(chip)) {
|
|
70
|
+
event.stopImmediatePropagation();
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
afterDispatch(event, () => {
|
|
75
|
+
const isToggle = chip.hasAttribute('aria-pressed') ||
|
|
76
|
+
chip.matches(`.${CHIP_CLASSES.chipFilter},.${CHIP_CLASSES.chipSelected}`);
|
|
77
|
+
if (event.defaultPrevented || !isToggle) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const isPressed = chip.ariaPressed === 'true';
|
|
81
|
+
chip.ariaPressed = String(!isPressed);
|
|
82
|
+
chip.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
|
|
83
|
+
chip.dispatchEvent(new Event('change', { bubbles: true }));
|
|
84
|
+
});
|
|
85
|
+
}, opts);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A Lit directive that adds chip styling and functionality to its element.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* html`<button class="${chip({color: 'elevated'})}">Elevated Chip</button>`;
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export const chip = createClassMapDirective({
|
|
96
|
+
getClasses: chipClasses,
|
|
97
|
+
setupElement: setupChip,
|
|
98
|
+
});
|
|
99
|
+
//# sourceMappingURL=chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.js","sourceRoot":"","sources":["chip.ts"],"names":[],"mappings":"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","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 {isDisabled, PSEUDO_CLASSES} from '../shared/pseudo-classes.js';\n\n/** Chip color/emphasis configuration types. */\nexport type ChipColor = 'elevated' | 'filled' | 'outlined' | 'tonal';\n\n/** Chip color configurations. */\nexport const CHIP_COLORS = {\n elevated: 'elevated',\n filled: 'filled',\n outlined: 'outlined',\n tonal: 'tonal',\n} as const;\n\n/** Chip functional type. */\nexport type ChipType = 'action' | 'filter' | 'toggle' | 'link';\n\n/** Chip classes. */\nexport const CHIP_CLASSES = {\n chip: 'chip',\n chipElevated: 'chip-elevated',\n chipFilled: 'chip-filled',\n chipOutlined: 'chip-outlined',\n chipTonal: 'chip-tonal',\n chipSelected: 'chip-selected',\n chipFilter: 'chip-filter',\n chipInput: 'chip-input',\n chipRemovable: 'chip-removable',\n chipWithLeadingIcon: 'chip-with-leading-icon',\n chipWithTrailingIcon: 'chip-with-trailing-icon',\n chipWithAvatar: 'chip-with-avatar',\n disabled: PSEUDO_CLASSES.disabled,\n} as const;\n\n/** The state provided to the `chipClasses()` function. */\nexport interface ChipClassesState {\n /** The emphasis color of the chip. */\n color?: ChipColor;\n /** The functional behavior type of the chip (`action`, `filter`, `toggle`, `link`). */\n type?: ChipType;\n /** Whether the filter or toggle chip is selected. */\n selected?: boolean;\n /** Whether the chip is removable (`removable=\"true\"`). */\n removable?: boolean;\n /** Whether the chip has a leading icon. */\n withLeadingIcon?: boolean;\n /** Whether the chip has a trailing icon. */\n withTrailingIcon?: boolean;\n /** Whether the chip has an avatar. */\n withAvatar?: boolean;\n /** Emulates `:disabled`. */\n disabled?: boolean;\n}\n\n/**\n * Returns the chip classes to apply to an element based on the given state.\n *\n * @param state The state of the chip.\n * @return An object of class names and truthy values if they apply.\n */\nexport function chipClasses({\n color = 'outlined',\n type = 'action',\n selected = false,\n removable = false,\n withLeadingIcon = false,\n withTrailingIcon = false,\n withAvatar = false,\n disabled = false,\n}: ChipClassesState = {}): ClassInfo {\n return {\n ...rippleClasses(),\n ...focusRingClasses(),\n [CHIP_CLASSES.chip]: true,\n [CHIP_CLASSES.chipElevated]: color === CHIP_COLORS.elevated,\n [CHIP_CLASSES.chipFilled]: color === CHIP_COLORS.filled,\n [CHIP_CLASSES.chipOutlined]: color === CHIP_COLORS.outlined,\n [CHIP_CLASSES.chipTonal]: color === CHIP_COLORS.tonal,\n [CHIP_CLASSES.chipSelected]: selected,\n [CHIP_CLASSES.chipFilter]: type === 'filter' || type === 'toggle',\n [CHIP_CLASSES.chipInput]: removable || type === 'action',\n [CHIP_CLASSES.chipRemovable]: removable,\n [CHIP_CLASSES.chipWithLeadingIcon]: withLeadingIcon,\n [CHIP_CLASSES.chipWithTrailingIcon]: withTrailingIcon,\n [CHIP_CLASSES.chipWithAvatar]: withAvatar,\n [CHIP_CLASSES.disabled]: disabled,\n };\n}\n\n/**\n * Sets up chip functionality for the given element.\n *\n * @param chip The element on which to set up chip functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupChip(\n chip: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n setupDispatchHooks(chip, 'click');\n setupRipple(chip, opts);\n chip.addEventListener(\n 'click',\n (event) => {\n if (isDisabled(chip)) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n afterDispatch(event, () => {\n const isToggle =\n chip.hasAttribute('aria-pressed') ||\n chip.matches(\n `.${CHIP_CLASSES.chipFilter},.${CHIP_CLASSES.chipSelected}`,\n );\n if (event.defaultPrevented || !isToggle) {\n return;\n }\n\n const isPressed = chip.ariaPressed === 'true';\n chip.ariaPressed = String(!isPressed);\n chip.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n chip.dispatchEvent(new Event('change', {bubbles: true}));\n });\n },\n opts,\n );\n}\n\n/**\n * A Lit directive that adds chip styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`<button class=\"${chip({color: 'elevated'})}\">Elevated Chip</button>`;\n * ```\n */\nexport const chip = createClassMapDirective({\n getClasses: chipClasses,\n setupElement: setupChip,\n});\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
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 'chip-tokens';
|
|
8
|
+
// go/keep-sorted end
|
|
9
|
+
|
|
10
|
+
@layer md.sys, md.comp.ripple, md.comp.focus-ring;
|
|
11
|
+
@layer md.comp.chip {
|
|
12
|
+
.chip {
|
|
13
|
+
@include chip-tokens.root;
|
|
14
|
+
&.chip-elevated {
|
|
15
|
+
@include chip-tokens.elevated;
|
|
16
|
+
}
|
|
17
|
+
&.chip-filled {
|
|
18
|
+
@include chip-tokens.filled;
|
|
19
|
+
}
|
|
20
|
+
&.chip-tonal {
|
|
21
|
+
@include chip-tokens.tonal;
|
|
22
|
+
}
|
|
23
|
+
&.chip-outlined {
|
|
24
|
+
@include chip-tokens.outlined;
|
|
25
|
+
}
|
|
26
|
+
&:is(.chip-selected, [aria-pressed='true']) {
|
|
27
|
+
@include chip-tokens.selected;
|
|
28
|
+
}
|
|
29
|
+
&.chip-filter {
|
|
30
|
+
@include chip-tokens.filter;
|
|
31
|
+
}
|
|
32
|
+
&.chip-input {
|
|
33
|
+
@include chip-tokens.input;
|
|
34
|
+
}
|
|
35
|
+
&.chip-with-leading-icon {
|
|
36
|
+
@include chip-tokens.with-leading-icon;
|
|
37
|
+
}
|
|
38
|
+
&.chip-with-trailing-icon {
|
|
39
|
+
@include chip-tokens.with-trailing-icon;
|
|
40
|
+
}
|
|
41
|
+
&.chip-with-avatar {
|
|
42
|
+
@include chip-tokens.with-avatar;
|
|
43
|
+
}
|
|
44
|
+
&:is(:disabled, .disabled, [aria-disabled='true']) {
|
|
45
|
+
@include chip-tokens.disabled;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
& {
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
height: var(--height);
|
|
53
|
+
gap: var(--gap-horizontal);
|
|
54
|
+
padding-inline: var(--padding-leading) var(--padding-trailing);
|
|
55
|
+
padding-block: var(--padding-top) var(--padding-bottom);
|
|
56
|
+
border: var(--outline-width) solid var(--outline-color);
|
|
57
|
+
border-radius: var(--shape);
|
|
58
|
+
box-shadow: var(--container-elevation);
|
|
59
|
+
background-color: var(--container-color);
|
|
60
|
+
color: var(--label-text-color);
|
|
61
|
+
font: var(--label-text);
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
user-select: none;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
--md-icon-color: var(--leading-icon-color);
|
|
66
|
+
--md-icon-size: var(--leading-icon-size);
|
|
67
|
+
}
|
|
68
|
+
&:not(:disabled, .disabled, [aria-disabled='true']) {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.chip-action,
|
|
73
|
+
.chip-remove {
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
gap: var(--gap-horizontal);
|
|
78
|
+
background: transparent;
|
|
79
|
+
border: none;
|
|
80
|
+
outline: none;
|
|
81
|
+
color: inherit;
|
|
82
|
+
font: inherit;
|
|
83
|
+
padding: 0;
|
|
84
|
+
margin: 0;
|
|
85
|
+
height: 100%;
|
|
86
|
+
cursor: inherit;
|
|
87
|
+
}
|
|
88
|
+
.chip-remove {
|
|
89
|
+
border-radius: 50%;
|
|
90
|
+
aspect-ratio: 1;
|
|
91
|
+
margin-inline-start: 4px;
|
|
92
|
+
outline: var(--focus-ring-outline);
|
|
93
|
+
--md-icon-color: var(--trailing-icon-color);
|
|
94
|
+
--md-icon-size: var(--trailing-icon-size);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ChipElement } from './chip-element.js';
|
|
7
|
+
export * from './chip-element.js';
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
/** A Material Design Expressive Chip component. */
|
|
11
|
+
'md-gb-chip': ChipElement;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ChipElement } from './chip-element.js';
|
|
7
|
+
export * from './chip-element.js';
|
|
8
|
+
customElements.define('md-gb-chip', ChipElement);
|
|
9
|
+
//# sourceMappingURL=md-gb-chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"md-gb-chip.js","sourceRoot":"","sources":["md-gb-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE9C,cAAc,mBAAmB,CAAC;AASlC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ChipElement} from './chip-element.js';\n\nexport * from './chip-element.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design Expressive Chip component. */\n 'md-gb-chip': ChipElement;\n }\n}\n\ncustomElements.define('md-gb-chip', ChipElement);\n"]}
|
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { CSSResultOrNative, LitElement } from 'lit';
|
|
7
|
-
declare global {
|
|
8
|
-
interface HTMLElementTagNameMap {
|
|
9
|
-
/** A Material Design divider component. */
|
|
10
|
-
'md-divider': Divider;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
7
|
/**
|
|
14
8
|
* A Material Design divider component.
|
|
9
|
+
*
|
|
10
|
+
* @csspart divider - The divider element.
|
|
11
|
+
* @cssprop --color
|
|
12
|
+
* @cssprop --thickness
|
|
15
13
|
*/
|
|
16
|
-
export declare class
|
|
14
|
+
export declare class DividerElement extends LitElement {
|
|
17
15
|
static styles: CSSResultOrNative[];
|
|
18
16
|
/**
|
|
19
17
|
* Whether or not the divider is vertical.
|
|
@@ -5,14 +5,18 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { __decorate } from "tslib";
|
|
7
7
|
import { css, html, LitElement } from 'lit';
|
|
8
|
-
import {
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
9
|
import dividerStyles from './divider.css' with { type: 'css' }; // github-only
|
|
10
10
|
// import {styles as dividerStyles} from './divider.cssresult.js'; // google3-only
|
|
11
11
|
import { divider } from './divider.js';
|
|
12
12
|
/**
|
|
13
13
|
* A Material Design divider component.
|
|
14
|
+
*
|
|
15
|
+
* @csspart divider - The divider element.
|
|
16
|
+
* @cssprop --color
|
|
17
|
+
* @cssprop --thickness
|
|
14
18
|
*/
|
|
15
|
-
|
|
19
|
+
export class DividerElement extends LitElement {
|
|
16
20
|
constructor() {
|
|
17
21
|
super(...arguments);
|
|
18
22
|
/**
|
|
@@ -23,8 +27,8 @@ let Divider = class Divider extends LitElement {
|
|
|
23
27
|
render() {
|
|
24
28
|
return html `<div part="divider" class="${divider(this)}"></div>`;
|
|
25
29
|
}
|
|
26
|
-
}
|
|
27
|
-
|
|
30
|
+
}
|
|
31
|
+
DividerElement.styles = [
|
|
28
32
|
dividerStyles,
|
|
29
33
|
css `
|
|
30
34
|
:host {
|
|
@@ -43,9 +47,5 @@ Divider.styles = [
|
|
|
43
47
|
];
|
|
44
48
|
__decorate([
|
|
45
49
|
property({ type: Boolean, reflect: true })
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
customElement('md-divider')
|
|
49
|
-
], Divider);
|
|
50
|
-
export { Divider };
|
|
51
|
-
//# sourceMappingURL=md-divider.js.map
|
|
50
|
+
], DividerElement.prototype, "vertical", void 0);
|
|
51
|
+
//# sourceMappingURL=divider-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider-element.js","sourceRoot":"","sources":["divider-element.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,aAAa,MAAM,eAAe,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AAC5E,kFAAkF;AAElF,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IAA9C;;QAmBE;;WAEG;QACuC,aAAQ,GAAG,KAAK,CAAC;IAK7D,CAAC;IAHoB,MAAM;QACvB,OAAO,IAAI,CAAA,8BAA8B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;IACnE,CAAC;;AAzBe,qBAAM,GAAwB;IAC5C,aAAa;IACb,GAAG,CAAA;;;;;;;;;;;;;KAaF;CACF,AAhBqB,CAgBpB;AAKwC;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;gDAAkB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {property} from 'lit/decorators.js';\n\nimport dividerStyles from './divider.css' with {type: 'css'}; // github-only\n// import {styles as dividerStyles} from './divider.cssresult.js'; // google3-only\n\nimport {divider} from './divider.js';\n\n/**\n * A Material Design divider component.\n *\n * @csspart divider - The divider element.\n * @cssprop --color\n * @cssprop --thickness\n */\nexport class DividerElement extends LitElement {\n static override styles: CSSResultOrNative[] = [\n dividerStyles,\n css`\n :host {\n display: flex;\n }\n .divider {\n flex: 1;\n }\n :host(:not([vertical])) {\n width: 100%;\n }\n :host([vertical]) {\n min-height: 100%;\n }\n `,\n ];\n\n /**\n * Whether or not the divider is vertical.\n */\n @property({type: Boolean, reflect: true}) vertical = false;\n\n protected override render() {\n return html`<div part=\"divider\" class=\"${divider(this)}\"></div>`;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["divider.scss","_divider-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,cACA,uBAEI,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["divider.scss","_divider-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,cACA,uBAEI,SCLF,6CACA,iBDOI,sBACA,YACA,aAGF,gCACE,kDACA,WAGF,0BACE,sDACA","file":"divider.css"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { DividerElement } from './divider-element.js';
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
/** A Material Design component. */
|
|
10
|
+
'md-gb-divider': DividerElement;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"md-gb-divider.js","sourceRoot":"","sources":["md-gb-divider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AASpD,cAAc,CAAC,MAAM,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {DividerElement} from './divider-element.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design component. */\n 'md-gb-divider': DividerElement;\n }\n}\n\ncustomElements.define('md-gb-divider', DividerElement);\n"]}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
//
|
|
5
5
|
|
|
6
6
|
@mixin root {
|
|
7
|
+
// LINT.IfChange
|
|
7
8
|
--container-color: transparent;
|
|
8
9
|
--container-elevation: var(--md-sys-elevation-shadow-3);
|
|
9
10
|
--container-height: 56px;
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
--label-text-tracking: var(--md-sys-typescale-label-lg-tracking);
|
|
17
18
|
--leading-space: 16px;
|
|
18
19
|
--trailing-space: 16px;
|
|
20
|
+
// LINT.ThenChange(md-fab.ts) keep in sync with `@cssprop` jsdoc tags
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
@mixin hovered {
|
|
@@ -0,0 +1,31 @@
|
|
|
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 FabColor, type FabSize } from './fab.js';
|
|
8
|
+
/**
|
|
9
|
+
* A Material Design fab component.
|
|
10
|
+
*
|
|
11
|
+
* @slot - Used to display an icon and optional label.
|
|
12
|
+
* @csspart fab - The FAB's root element.
|
|
13
|
+
* @cssprop --container-color
|
|
14
|
+
* @cssprop --container-elevation
|
|
15
|
+
* @cssprop --container-height
|
|
16
|
+
* @cssprop --container-shape
|
|
17
|
+
* @cssprop --icon-color
|
|
18
|
+
* @cssprop --icon-label-space
|
|
19
|
+
* @cssprop --icon-size
|
|
20
|
+
* @cssprop --label-text
|
|
21
|
+
* @cssprop --label-text-color
|
|
22
|
+
* @cssprop --label-text-tracking
|
|
23
|
+
* @cssprop --leading-space
|
|
24
|
+
* @cssprop --trailing-space
|
|
25
|
+
*/
|
|
26
|
+
export declare class FabElement extends LitElement {
|
|
27
|
+
static styles: CSSResultOrNative[];
|
|
28
|
+
color: FabColor;
|
|
29
|
+
size: FabSize;
|
|
30
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
31
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { __decorate } from "tslib";
|
|
7
7
|
import { css, html, LitElement } from 'lit';
|
|
8
|
-
import {
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
9
|
import focusRingStyles from '../focus/focus-ring.css' with { type: 'css' }; // github-only
|
|
10
10
|
// import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only
|
|
11
11
|
import rippleStyles from '../ripple/ripple.css' with { type: 'css' }; // github-only
|
|
@@ -15,8 +15,23 @@ import fabStyles from './fab.css' with { type: 'css' }; // github-only
|
|
|
15
15
|
import { fab } from './fab.js';
|
|
16
16
|
/**
|
|
17
17
|
* A Material Design fab component.
|
|
18
|
+
*
|
|
19
|
+
* @slot - Used to display an icon and optional label.
|
|
20
|
+
* @csspart fab - The FAB's root element.
|
|
21
|
+
* @cssprop --container-color
|
|
22
|
+
* @cssprop --container-elevation
|
|
23
|
+
* @cssprop --container-height
|
|
24
|
+
* @cssprop --container-shape
|
|
25
|
+
* @cssprop --icon-color
|
|
26
|
+
* @cssprop --icon-label-space
|
|
27
|
+
* @cssprop --icon-size
|
|
28
|
+
* @cssprop --label-text
|
|
29
|
+
* @cssprop --label-text-color
|
|
30
|
+
* @cssprop --label-text-tracking
|
|
31
|
+
* @cssprop --leading-space
|
|
32
|
+
* @cssprop --trailing-space
|
|
18
33
|
*/
|
|
19
|
-
|
|
34
|
+
export class FabElement extends LitElement {
|
|
20
35
|
constructor() {
|
|
21
36
|
super(...arguments);
|
|
22
37
|
this.color = 'primary-container';
|
|
@@ -29,8 +44,8 @@ let Fab = class Fab extends LitElement {
|
|
|
29
44
|
<slot></slot>
|
|
30
45
|
</button>`;
|
|
31
46
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
47
|
+
}
|
|
48
|
+
FabElement.styles = [
|
|
34
49
|
focusRingStyles,
|
|
35
50
|
rippleStyles,
|
|
36
51
|
fabStyles,
|
|
@@ -45,12 +60,8 @@ Fab.styles = [
|
|
|
45
60
|
];
|
|
46
61
|
__decorate([
|
|
47
62
|
property()
|
|
48
|
-
],
|
|
63
|
+
], FabElement.prototype, "color", void 0);
|
|
49
64
|
__decorate([
|
|
50
65
|
property()
|
|
51
|
-
],
|
|
52
|
-
|
|
53
|
-
customElement('md-fab')
|
|
54
|
-
], Fab);
|
|
55
|
-
export { Fab };
|
|
56
|
-
//# sourceMappingURL=md-fab.js.map
|
|
66
|
+
], FabElement.prototype, "size", void 0);
|
|
67
|
+
//# sourceMappingURL=fab-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fab-element.js","sourceRoot":"","sources":["fab-element.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,eAAe,MAAM,yBAAyB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACxF,kFAAkF;AAClF,OAAO,YAAY,MAAM,sBAAsB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AAClF,4EAA4E;AAC5E,OAAO,SAAS,MAAM,WAAW,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACpE,0EAA0E;AAE1E,OAAO,EAAC,GAAG,EAA8B,MAAM,UAAU,CAAC;AAE1D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QAec,UAAK,GAAa,mBAAmB,CAAC;QACtC,SAAI,GAAY,SAAS,CAAC;IASxC,CAAC;IAPoB,MAAM;QACvB,OAAO,IAAI,CAAA;;eAEA,GAAG,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC;;cAE1C,CAAC;IACb,CAAC;;AAvBe,iBAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,SAAS;IACT,GAAG,CAAA;;;;;;;KAOF;CACF,AAZqB,CAYpB;AAEU;IAAX,QAAQ,EAAE;yCAAuC;AACtC;IAAX,QAAQ,EAAE;wCAA2B","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {property} from 'lit/decorators.js';\n\nimport focusRingStyles from '../focus/focus-ring.css' with {type: 'css'}; // github-only\n// import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only\nimport rippleStyles from '../ripple/ripple.css' with {type: 'css'}; // github-only\n// import rippleStyles from '../ripple/ripple.cssresult.js'; // google3-only\nimport fabStyles from './fab.css' with {type: 'css'}; // github-only\n// import {styles as fabStyles} from './fab.cssresult.js'; // google3-only\n\nimport {fab, type FabColor, type FabSize} from './fab.js';\n\n/**\n * A Material Design fab component.\n *\n * @slot - Used to display an icon and optional label.\n * @csspart fab - The FAB's root element.\n * @cssprop --container-color\n * @cssprop --container-elevation\n * @cssprop --container-height\n * @cssprop --container-shape\n * @cssprop --icon-color\n * @cssprop --icon-label-space\n * @cssprop --icon-size\n * @cssprop --label-text\n * @cssprop --label-text-color\n * @cssprop --label-text-tracking\n * @cssprop --leading-space\n * @cssprop --trailing-space\n */\nexport class FabElement extends LitElement {\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n fabStyles,\n css`\n :host {\n display: inline-flex;\n }\n .fab {\n flex: 1;\n }\n `,\n ];\n\n @property() color: FabColor = 'primary-container';\n @property() size: FabSize = 'default';\n\n protected override render() {\n return html`<button\n part=\"fab\"\n class=\"${fab({color: this.color, size: this.size})}\">\n <slot></slot>\n </button>`;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["fab.scss","_fab-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GAUA,oCACA,mBAEI,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["fab.scss","_fab-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GAUA,oCACA,mBAEI,KCNF,+BACA,wDACA,yBACA,iDACA,2BACA,yBACA,kBACA,+CACA,iCACA,iEACA,sBACA,uBDDE,uBCMF,wDDFE,yBCMF,wDDFE,2BCMF,yDACA,uDACA,6DDJE,iBCQF,+CACA,6CACA,mDDNE,6BCUF,2DACA,yDACA,+DDRE,mBCYF,iDACA,+CACA,qDDVE,4BCcF,0DACA,wDACA,8DDZE,kBCgBF,gDACA,8CACA,oDDdE,YCkBF,yBACA,2DACA,kBACA,+CACA,iEACA,sBACA,uBDpBE,YCwBF,yBACA,iDACA,yBACA,kBACA,kDACA,oEACA,sBACA,uBD3BE,KACE,gBACA,YACA,oBACA,mBACA,4BACA,+BACA,wCACA,qCACA,sCACA,8BACA,uBACA,0CACA,0DACA,8DACA,mCACA","file":"fab.css"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { FabElement } from './fab-element.js';
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
/** A Material Design component. */
|
|
10
|
+
'md-gb-fab': FabElement;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"md-gb-fab.js","sourceRoot":"","sources":["md-gb-fab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAS5C,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {FabElement} from './fab-element.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design component. */\n 'md-gb-fab': FabElement;\n }\n}\n\ncustomElements.define('md-gb-fab', FabElement);\n"]}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
//
|
|
5
5
|
|
|
6
6
|
@mixin root {
|
|
7
|
+
// LINT.IfChange
|
|
7
8
|
--container-color: transparent;
|
|
8
9
|
--container-height: auto;
|
|
9
10
|
--container-shape: calc(var(--container-height) / 2);
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
--outline-width: 1px;
|
|
14
15
|
--leading-space: 0;
|
|
15
16
|
--trailing-space: 0;
|
|
17
|
+
// LINT.ThenChange(md-icon-button.ts) keep in sync with `@cssprop` jsdoc tags
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
@mixin selected {
|
|
@@ -5,17 +5,25 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { CSSResultOrNative, LitElement } from 'lit';
|
|
7
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
8
|
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
9
|
/**
|
|
16
10
|
* A Material Design icon button component.
|
|
11
|
+
*
|
|
12
|
+
* @slot - Used to display an icon.
|
|
13
|
+
* @fires {InputEvent} input - Fired when a toggle icon button is selected or unselected. --bubbles --composed
|
|
14
|
+
* @fires {Event} change - Fired when a toggle button is selected or unselected. --bubbles
|
|
15
|
+
* @csspart icon-btn - The icon button's root element.
|
|
16
|
+
* @cssprop --container-color
|
|
17
|
+
* @cssprop --container-height
|
|
18
|
+
* @cssprop --container-shape
|
|
19
|
+
* @cssprop --icon-color
|
|
20
|
+
* @cssprop --icon-size
|
|
21
|
+
* @cssprop --outline-color
|
|
22
|
+
* @cssprop --outline-width
|
|
23
|
+
* @cssprop --leading-space
|
|
24
|
+
* @cssprop --trailing-space
|
|
17
25
|
*/
|
|
18
|
-
export declare class
|
|
26
|
+
export declare class IconButtonElement extends baseClass {
|
|
19
27
|
/** @nocollapse */
|
|
20
28
|
static shadowRootOptions: ShadowRootInit;
|
|
21
29
|
static styles: CSSResultOrNative[];
|