@material/web 2.4.2-nightly.f6c1871.0 → 2.4.2-nightly.fd6fe2a.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 +47238 -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/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.d.ts +1 -1
- package/labs/gb/components/button/button.js +5 -5
- package/labs/gb/components/button/button.js.map +1 -1
- 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 -1
- package/labs/gb/components/card/card.js +3 -3
- 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 -1
- package/labs/gb/components/checkbox/checkbox.js +4 -4
- 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 -1
- package/labs/gb/components/divider/divider.js +1 -1
- package/labs/gb/components/divider/divider.js.map +1 -1
- package/labs/gb/components/fab/fab.d.ts +1 -1
- package/labs/gb/components/fab/fab.js +4 -4
- 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.d.ts +1 -1
- package/labs/gb/components/iconbutton/icon-button.js +5 -5
- package/labs/gb/components/iconbutton/icon-button.js.map +1 -1
- package/labs/gb/components/iconbutton/md-icon-button.d.ts +1 -1
- package/labs/gb/components/iconbutton/md-icon-button.js +7 -7
- package/labs/gb/components/iconbutton/md-icon-button.js.map +1 -1
- 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 -1
- package/labs/gb/components/radio/radio.js +4 -4
- 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.js +5 -2
- package/labs/gb/components/ripple/ripple.js.map +1 -1
- package/labs/gb/components/shared/directives.js +2 -3
- package/labs/gb/components/shared/directives.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/md-switch.d.ts +4 -4
- package/labs/gb/components/switch/md-switch.js +12 -12
- package/labs/gb/components/switch/md-switch.js.map +1 -1
- package/labs/gb/components/switch/switch.d.ts +1 -1
- package/labs/gb/components/switch/switch.js +5 -5
- package/labs/gb/components/switch/switch.js.map +1 -1
- package/labs/gb/styles/adopt-styles.js +1 -6
- package/labs/gb/styles/adopt-styles.js.map +1 -1
- 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 +27 -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 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAE3D,oBAAoB;AACpB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,gBAAgB;CACvB,CAAC;AAQX;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,GAAG,KAAK,MACG,EAAE;IACtB,OAAO;QACL,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI;QACzB,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,SAAS;KACxC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,uBAAuB,CAAC;IAC1C,UAAU,EAAE,WAAW;CACxB,CAAC,CAAC;AAEH,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,WAAW;IACrB,cAAc,EAAE,kBAAkB;IAClC,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,mBAAmB;IACpC,gBAAgB,EAAE,oBAAoB;IACtC,gBAAgB,EAAE,oBAAoB;IACtC,sBAAsB,EAAE,2BAA2B;IACnD,oBAAoB,EAAE,yBAAyB;IAC/C,cAAc,EAAE,kBAAkB;IAClC,OAAO,EAAE,cAAc,CAAC,OAAO;IAC/B,KAAK,EAAE,cAAc,CAAC,KAAK;IAC3B,KAAK,EAAE,cAAc,CAAC,KAAK;IAC3B,MAAM,EAAE,cAAc,CAAC,MAAM;IAC7B,QAAQ,EAAE,cAAc,CAAC,QAAQ;CACzB,CAAC;AAkBX;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,MAAM,EAAE,UAAU,GAAG,KAAK,EAC1B,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,KAAK,EACb,KAAK,GAAG,KAAK,EACb,MAAM,GAAG,KAAK,EACd,QAAQ,GAAG,KAAK,MACQ,EAAE;IAC1B,OAAO;QACL,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU;QACpC,CAAC,kBAAkB,CAAC,cAAc,CAAC,EAAE,CAAC,UAAU;QAChD,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,IAAI;QAClC,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,UAAU;QAC9C,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO;QACpC,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,KAAK;QAChC,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,KAAK;QAChC,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM;QAClC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,QAAQ;KACvC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAqB,EACrB,IAA6B;IAE7B,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,uBAAuB,CAAC;IAC9C,UAAU,EAAE,eAAe;IAC3B,YAAY,EAAE,aAAa;CAC5B,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 {FOCUS_RING_CLASSES} from '../focus/focus-ring.js';\nimport {RIPPLE_CLASSES, setupRipple} from '../ripple/ripple.js';\nimport {createClassMapDirective} from '../shared/directives.js';\nimport {PSEUDO_CLASSES} from '../shared/pseudo-classes.js';\n\n/** List classes. */\nexport const LIST_CLASSES = {\n list: 'list',\n listSegmented: 'list-segmented',\n} as const;\n\n/** The state provided to the `listClasses()` function. */\nexport interface ListClassesState {\n /** Whether to render the list with segmented items. */\n segmented?: boolean;\n}\n\n/**\n * Returns the list classes to apply to an element based on the given state.\n *\n * @param state The state of the list.\n * @return An object of class names and truthy values if they apply.\n */\nexport function listClasses({\n segmented = false,\n}: ListClassesState = {}): ClassInfo {\n return {\n [LIST_CLASSES.list]: true,\n [LIST_CLASSES.listSegmented]: segmented,\n };\n}\n\n/**\n * A Lit directive that adds list styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`\n * <ul class=\"${list()}\">\n * <li><button class=\"${listItem()}\">List item 1</button></li>\n * <li><button class=\"${listItem()}\">List item 2</button></li>\n * <li><button class=\"${listItem()}\">List item 3</button></li>\n * </ul>\n * `;\n * ```\n */\nexport const list = createClassMapDirective({\n getClasses: listClasses,\n});\n\n/** List item classes. */\nexport const LIST_ITEM_CLASSES = {\n listItem: 'list-item',\n listItemStatic: 'list-item-static',\n listItemContent: 'list-item-content',\n listItemLeading: 'list-item-leading',\n listItemTrailing: 'list-item-trailing',\n listItemOverline: 'list-item-overline',\n listItemSupportingText: 'list-item-supporting-text',\n listItemTrailingText: 'list-item-trailing-text',\n listItemAvatar: 'list-item-avatar',\n checked: PSEUDO_CLASSES.checked,\n hover: PSEUDO_CLASSES.hover,\n focus: PSEUDO_CLASSES.focus,\n active: PSEUDO_CLASSES.active,\n disabled: PSEUDO_CLASSES.disabled,\n} as const;\n\n/** The state provided to the `listItemClasses()` function. */\nexport interface ListItemClassesState {\n /** Whether the list item is non-interactive. */\n static?: boolean;\n /** Emulates `:checked`. */\n checked?: boolean;\n /** Emulates `:hover`. */\n hover?: boolean;\n /** Emulates `:focus`. */\n focus?: boolean;\n /** Emulates `:active`. */\n active?: boolean;\n /** Emulates `:disabled`. */\n disabled?: boolean;\n}\n\n/**\n * Returns the list item classes to apply to an element based on the given\n * state.\n *\n * @param state The state of the list item.\n * @return An object of class names and truthy values if they apply.\n */\nexport function listItemClasses({\n static: staticItem = false,\n checked = false,\n hover = false,\n focus = false,\n active = false,\n disabled = false,\n}: ListItemClassesState = {}): ClassInfo {\n return {\n [RIPPLE_CLASSES.ripple]: !staticItem,\n [FOCUS_RING_CLASSES.focusRingInner]: !staticItem,\n [LIST_ITEM_CLASSES.listItem]: true,\n [LIST_ITEM_CLASSES.listItemStatic]: staticItem,\n [LIST_ITEM_CLASSES.checked]: checked,\n [LIST_ITEM_CLASSES.hover]: hover,\n [LIST_ITEM_CLASSES.focus]: focus,\n [LIST_ITEM_CLASSES.active]: active,\n [LIST_ITEM_CLASSES.disabled]: disabled,\n };\n}\n\n/**\n * Sets up list item functionality for the given element.\n *\n * @param listItem The element on which to set up list item functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupListItem(\n listItem: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n setupRipple(listItem, opts);\n}\n\n/**\n * A Lit directive that adds list item styling and functionality to its element.\n *\n *\n * @example\n * ```ts\n * html`\n * <ul class=\"${list()}\">\n * <li><button class=\"${listItem()}\">List item 1</button></li>\n * <li><button class=\"${listItem()}\">List item 2</button></li>\n * <li><button class=\"${listItem()}\">List item 3</button></li>\n * </ul>\n * `;\n * ```\n */\nexport const listItem = createClassMapDirective({\n getClasses: listItemClasses,\n setupElement: setupListItem,\n});\n"]}
|
|
@@ -0,0 +1,212 @@
|
|
|
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 '../checkbox/checkbox-tokens';
|
|
8
|
+
@use '../radio/radio-tokens';
|
|
9
|
+
@use 'list-tokens';
|
|
10
|
+
// go/keep-sorted end
|
|
11
|
+
|
|
12
|
+
@layer md.sys, md.comp.ripple, md.comp.focus-ring, md.comp.checkbox, md.comp.radio;
|
|
13
|
+
@layer md.comp.list {
|
|
14
|
+
.list {
|
|
15
|
+
& {
|
|
16
|
+
@include list-tokens.root;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.list-segmented {
|
|
20
|
+
@include list-tokens.segmented;
|
|
21
|
+
--list-segmented: true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
& {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
margin: unset;
|
|
28
|
+
padding: unset;
|
|
29
|
+
list-style: none;
|
|
30
|
+
gap: var(--gap);
|
|
31
|
+
border-radius: var(--container-shape);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
> :first-child:not(slot),
|
|
35
|
+
::slotted(:first-child) {
|
|
36
|
+
border-start-start-radius: inherit;
|
|
37
|
+
border-start-end-radius: inherit;
|
|
38
|
+
--first-child: true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
> :last-child:not(slot),
|
|
42
|
+
::slotted(:last-child) {
|
|
43
|
+
border-end-start-radius: inherit;
|
|
44
|
+
border-end-end-radius: inherit;
|
|
45
|
+
--last-child: true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
slot {
|
|
49
|
+
border-radius: inherit;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.list-select {
|
|
54
|
+
&,
|
|
55
|
+
&::picker(select) {
|
|
56
|
+
// stylelint-disable-next-line scss/declaration-property-value-no-unknown --
|
|
57
|
+
// Uses customizable select
|
|
58
|
+
appearance: base-select;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
border: none;
|
|
62
|
+
background: none;
|
|
63
|
+
height: fit-content;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.list-item {
|
|
67
|
+
& {
|
|
68
|
+
@include list-tokens.item;
|
|
69
|
+
|
|
70
|
+
@container style(--list-segmented: true) {
|
|
71
|
+
@include list-tokens.item-segmented;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:where(:not(.list-item-static)) {
|
|
76
|
+
&:is(:hover, .hover) {
|
|
77
|
+
@include list-tokens.item-hovered;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:is(:focus-within, .focus) {
|
|
81
|
+
@include list-tokens.item-focused;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:is(:active, .active) {
|
|
85
|
+
@include list-tokens.item-pressed;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:is(:checked, .checked) {
|
|
90
|
+
@include list-tokens.item-selected;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:is(:disabled, .disabled) {
|
|
94
|
+
@include list-tokens.item-disabled;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
& {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
gap: var(--between-space);
|
|
101
|
+
box-sizing: border-box;
|
|
102
|
+
min-height: var(--container-height);
|
|
103
|
+
border-radius: var(--container-shape);
|
|
104
|
+
background-color: var(--container-color);
|
|
105
|
+
padding-inline: var(--leading-space) var(--trailing-space);
|
|
106
|
+
padding-block: var(--top-space) var(--bottom-space);
|
|
107
|
+
color: var(--label-text-color);
|
|
108
|
+
font: var(--label-text);
|
|
109
|
+
letter-spacing: var(--label-text-tracking);
|
|
110
|
+
appearance: none;
|
|
111
|
+
border: none;
|
|
112
|
+
text-align: unset;
|
|
113
|
+
text-decoration: unset;
|
|
114
|
+
width: stretch;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@container style(--first-child: true) {
|
|
118
|
+
border-start-start-radius: inherit;
|
|
119
|
+
border-start-end-radius: inherit;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@container style(--last-child: true) {
|
|
123
|
+
border-end-start-radius: inherit;
|
|
124
|
+
border-end-end-radius: inherit;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&:not(:disabled, .disabled, .list-item-static) {
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.list-item-content {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
flex: 1;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.list-item-leading,
|
|
138
|
+
.list-item-trailing {
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
gap: 8px;
|
|
142
|
+
min-height: 28px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.list-item-leading {
|
|
146
|
+
--md-icon-color: var(--leading-icon-color);
|
|
147
|
+
--md-icon-size: var(--leading-icon-size);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.list-item-trailing {
|
|
151
|
+
--md-icon-color: var(--trailing-icon-color);
|
|
152
|
+
--md-icon-size: var(--trailing-icon-size);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.list-item-overline {
|
|
156
|
+
font: var(--overline);
|
|
157
|
+
letter-spacing: var(--overline-tracking);
|
|
158
|
+
color: var(--overline-color);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.list-item-supporting-text {
|
|
162
|
+
font: var(--supporting-text);
|
|
163
|
+
letter-spacing: var(--supporting-text-tracking);
|
|
164
|
+
color: var(--supporting-text-color);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.list-item-trailing-text {
|
|
168
|
+
font: var(--trailing-supporting-text);
|
|
169
|
+
letter-spacing: var(--trailing-supporting-text-tracking);
|
|
170
|
+
color: var(--trailing-supporting-text-color);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.list-item-avatar {
|
|
174
|
+
display: grid;
|
|
175
|
+
place-items: center;
|
|
176
|
+
background-color: var(--avatar-color);
|
|
177
|
+
border-radius: var(--avatar-shape);
|
|
178
|
+
aspect-ratio: 1;
|
|
179
|
+
width: var(--avatar-size);
|
|
180
|
+
font: var(--avatar-label);
|
|
181
|
+
letter-spacing: var(--avatar-label-tracking);
|
|
182
|
+
color: var(--avatar-label-color);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&::checkmark {
|
|
186
|
+
font: var(--leading-icon-size) var(--md-icon-font);
|
|
187
|
+
color: var(--leading-icon-color);
|
|
188
|
+
content: 'check';
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&:has(.list-item-radio, .list-item-checkbox)::checkmark {
|
|
192
|
+
display: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.list-item-radio,
|
|
196
|
+
.list-item-checkbox {
|
|
197
|
+
width: min-content;
|
|
198
|
+
height: min-content;
|
|
199
|
+
--ripple: none;
|
|
200
|
+
--focus-ring-outline: none;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&:is(:checked, .checked) .list-item-radio {
|
|
204
|
+
@include radio-tokens.selected;
|
|
205
|
+
--icon: 'radio_button_checked';
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&:is(:checked, .checked) .list-item-checkbox {
|
|
209
|
+
@include checkbox-tokens.selected;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CSSResultOrNative, LitElement } from 'lit';
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
/** A Material Design list item component. */
|
|
10
|
+
'md-list-item': ListItem;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("../../../behaviors/element-internals.js").WithElementInternals>>;
|
|
14
|
+
/**
|
|
15
|
+
* A Material Design list item component.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ListItem extends baseClass {
|
|
18
|
+
/** @nocollapse */
|
|
19
|
+
static shadowRootOptions: {
|
|
20
|
+
delegatesFocus: boolean;
|
|
21
|
+
clonable?: boolean;
|
|
22
|
+
customElementRegistry?: CustomElementRegistry;
|
|
23
|
+
mode: ShadowRootMode;
|
|
24
|
+
serializable?: boolean;
|
|
25
|
+
slotAssignment?: SlotAssignmentMode;
|
|
26
|
+
};
|
|
27
|
+
static styles: CSSResultOrNative[];
|
|
28
|
+
constructor();
|
|
29
|
+
/**
|
|
30
|
+
* Whether the list item is selected.
|
|
31
|
+
*/
|
|
32
|
+
checked: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the list item is disabled.
|
|
35
|
+
*/
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the list item is non-interactive.
|
|
39
|
+
*/
|
|
40
|
+
nonInteractive: boolean;
|
|
41
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
42
|
+
private renderContent;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
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 { internals, mixinElementInternals, } from '../../../behaviors/element-internals.js';
|
|
11
|
+
import { hasSlotted } from '../shared/has-slotted.js';
|
|
12
|
+
import focusRingStyles from '../focus/focus-ring.css' with { type: 'css' }; // github-only
|
|
13
|
+
// import {styles as focusRingStyles} from '../focus/focus-ring.cssresult.js'; // google3-only
|
|
14
|
+
import rippleStyles from '../ripple/ripple.css' with { type: 'css' }; // github-only
|
|
15
|
+
// import {styles as rippleStyles} from '../ripple/ripple.cssresult.js'; // google3-only
|
|
16
|
+
import listStyles from './list.css' with { type: 'css' }; // github-only
|
|
17
|
+
// import {styles as listStyles} from './list.cssresult.js'; // google3-only
|
|
18
|
+
import { listItem } from './list.js';
|
|
19
|
+
// Separate variable needed for closure.
|
|
20
|
+
const baseClass = mixinDelegatesAria(mixinElementInternals(LitElement));
|
|
21
|
+
/**
|
|
22
|
+
* A Material Design list item component.
|
|
23
|
+
*/
|
|
24
|
+
let ListItem = class ListItem extends baseClass {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
/**
|
|
28
|
+
* Whether the list item is selected.
|
|
29
|
+
*/
|
|
30
|
+
this.checked = false;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the list item is disabled.
|
|
33
|
+
*/
|
|
34
|
+
this.disabled = false;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the list item is non-interactive.
|
|
37
|
+
*/
|
|
38
|
+
this.nonInteractive = false;
|
|
39
|
+
this[internals].role = 'listitem';
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const state = {
|
|
43
|
+
checked: this.checked,
|
|
44
|
+
disabled: this.disabled,
|
|
45
|
+
static: this.nonInteractive,
|
|
46
|
+
};
|
|
47
|
+
if (this.nonInteractive) {
|
|
48
|
+
return html `<div part="list-item" class="${listItem(state)}"
|
|
49
|
+
>${this.renderContent()}</div
|
|
50
|
+
>`;
|
|
51
|
+
}
|
|
52
|
+
// Needed for closure conformance
|
|
53
|
+
const { ariaLabel } = this;
|
|
54
|
+
return html `<button
|
|
55
|
+
part="list-item"
|
|
56
|
+
class="${listItem(state)}"
|
|
57
|
+
?disabled=${this.disabled}
|
|
58
|
+
aria-label=${ariaLabel || nothing}>
|
|
59
|
+
${this.renderContent()}
|
|
60
|
+
</button>`;
|
|
61
|
+
}
|
|
62
|
+
renderContent() {
|
|
63
|
+
return html `
|
|
64
|
+
<span class="list-item-leading">
|
|
65
|
+
<slot name="avatar" class="list-item-avatar" ${hasSlotted()}></slot>
|
|
66
|
+
<slot name="leading" ${hasSlotted()}></slot>
|
|
67
|
+
</span>
|
|
68
|
+
<span class="list-item-content">
|
|
69
|
+
<slot name="overline" class="list-item-overline"></slot>
|
|
70
|
+
<slot></slot>
|
|
71
|
+
<slot name="supporting-text" class="list-item-supporting-text"></slot>
|
|
72
|
+
</span>
|
|
73
|
+
<span class="list-item-trailing">
|
|
74
|
+
<slot
|
|
75
|
+
name="trailing-text"
|
|
76
|
+
class="list-item-trailing-text"
|
|
77
|
+
${hasSlotted()}></slot>
|
|
78
|
+
<slot name="trailing" ${hasSlotted()}></slot>
|
|
79
|
+
</span>
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
/** @nocollapse */
|
|
84
|
+
ListItem.shadowRootOptions = {
|
|
85
|
+
...LitElement.shadowRootOptions,
|
|
86
|
+
delegatesFocus: true,
|
|
87
|
+
};
|
|
88
|
+
ListItem.styles = [
|
|
89
|
+
focusRingStyles,
|
|
90
|
+
rippleStyles,
|
|
91
|
+
listStyles,
|
|
92
|
+
css `
|
|
93
|
+
:host {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
}
|
|
97
|
+
.list-item {
|
|
98
|
+
flex: 1;
|
|
99
|
+
align-items: inherit;
|
|
100
|
+
}
|
|
101
|
+
:is(.list-item-leading, .list-item-trailing):not(:has(.has-slotted)) {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
slot:not(.has-slotted) {
|
|
105
|
+
display: contents;
|
|
106
|
+
}
|
|
107
|
+
`,
|
|
108
|
+
];
|
|
109
|
+
__decorate([
|
|
110
|
+
property({ type: Boolean })
|
|
111
|
+
], ListItem.prototype, "checked", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: Boolean })
|
|
114
|
+
], ListItem.prototype, "disabled", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ type: Boolean, reflect: true, attribute: 'static' })
|
|
117
|
+
], ListItem.prototype, "nonInteractive", void 0);
|
|
118
|
+
ListItem = __decorate([
|
|
119
|
+
customElement('md-list-item')
|
|
120
|
+
], ListItem);
|
|
121
|
+
export { ListItem };
|
|
122
|
+
//# sourceMappingURL=md-list-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"md-list-item.js","sourceRoot":"","sources":["md-list-item.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,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAEpD,OAAO,eAAe,MAAM,yBAAyB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACxF,8FAA8F;AAC9F,OAAO,YAAY,MAAM,sBAAsB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AAClF,wFAAwF;AACxF,OAAO,UAAU,MAAM,YAAY,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACtE,4EAA4E;AAE5E,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAC;AASnC,wCAAwC;AACxC,MAAM,SAAS,GAAG,kBAAkB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC;AAExE;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,SAAS;IA6BrC;QACE,KAAK,EAAE,CAAC;QAIV;;WAEG;QACwB,YAAO,GAAG,KAAK,CAAC;QAE3C;;WAEG;QACwB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;WAEG;QAEH,mBAAc,GAAG,KAAK,CAAC;QAjBrB,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,GAAG,UAAU,CAAC;IACpC,CAAC;IAkBkB,MAAM;QACvB,MAAM,KAAK,GAAG;YACZ,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,cAAc;SAC5B,CAAC;QACF,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,OAAO,IAAI,CAAA,gCAAgC,QAAQ,CAAC,KAAK,CAAC;WACrD,IAAI,CAAC,aAAa,EAAE;QACvB,CAAC;QACL,CAAC;QAED,iCAAiC;QACjC,MAAM,EAAC,SAAS,EAAC,GAAG,IAAuB,CAAC;QAC5C,OAAO,IAAI,CAAA;;eAEA,QAAQ,CAAC,KAAK,CAAC;kBACZ,IAAI,CAAC,QAAQ;mBACZ,SAAS,IAAI,OAAO;QAC/B,IAAI,CAAC,aAAa,EAAE;cACd,CAAC;IACb,CAAC;IAEO,aAAa;QACnB,OAAO,IAAI,CAAA;;uDAEwC,UAAU,EAAE;+BACpC,UAAU,EAAE;;;;;;;;;;;YAW/B,UAAU,EAAE;gCACQ,UAAU,EAAE;;KAEvC,CAAC;IACJ,CAAC;;AA3FD,kBAAkB;AACF,0BAAiB,GAAG;IAClC,GAAG,UAAU,CAAC,iBAAiB;IAC/B,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAEc,eAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,UAAU;IACV,GAAG,CAAA;;;;;;;;;;;;;;;KAeF;CACF,AApBqB,CAoBpB;AAUyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCAAiB;AAKhB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CAAkB;AAM5C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAC,CAAC;gDACvC;AAhDZ,QAAQ;IADpB,aAAa,CAAC,cAAc,CAAC;GACjB,QAAQ,CA6FpB","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 {\n internals,\n mixinElementInternals,\n} from '../../../behaviors/element-internals.js';\nimport {hasSlotted} from '../shared/has-slotted.js';\n\nimport focusRingStyles from '../focus/focus-ring.css' with {type: 'css'}; // github-only\n// import {styles as focusRingStyles} from '../focus/focus-ring.cssresult.js'; // google3-only\nimport rippleStyles from '../ripple/ripple.css' with {type: 'css'}; // github-only\n// import {styles as rippleStyles} from '../ripple/ripple.cssresult.js'; // google3-only\nimport listStyles from './list.css' with {type: 'css'}; // github-only\n// import {styles as listStyles} from './list.cssresult.js'; // google3-only\n\nimport {listItem} from './list.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design list item component. */\n 'md-list-item': ListItem;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinDelegatesAria(mixinElementInternals(LitElement));\n\n/**\n * A Material Design list item component.\n */\n@customElement('md-list-item')\nexport class ListItem extends baseClass {\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n listStyles,\n css`\n :host {\n display: flex;\n align-items: center;\n }\n .list-item {\n flex: 1;\n align-items: inherit;\n }\n :is(.list-item-leading, .list-item-trailing):not(:has(.has-slotted)) {\n display: none;\n }\n slot:not(.has-slotted) {\n display: contents;\n }\n `,\n ];\n\n constructor() {\n super();\n this[internals].role = 'listitem';\n }\n\n /**\n * Whether the list item is selected.\n */\n @property({type: Boolean}) checked = false;\n\n /**\n * Whether the list item is disabled.\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * Whether the list item is non-interactive.\n */\n @property({type: Boolean, reflect: true, attribute: 'static'})\n nonInteractive = false;\n\n protected override render() {\n const state = {\n checked: this.checked,\n disabled: this.disabled,\n static: this.nonInteractive,\n };\n if (this.nonInteractive) {\n return html`<div part=\"list-item\" class=\"${listItem(state)}\"\n >${this.renderContent()}</div\n >`;\n }\n\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`<button\n part=\"list-item\"\n class=\"${listItem(state)}\"\n ?disabled=${this.disabled}\n aria-label=${ariaLabel || nothing}>\n ${this.renderContent()}\n </button>`;\n }\n\n private renderContent() {\n return html`\n <span class=\"list-item-leading\">\n <slot name=\"avatar\" class=\"list-item-avatar\" ${hasSlotted()}></slot>\n <slot name=\"leading\" ${hasSlotted()}></slot>\n </span>\n <span class=\"list-item-content\">\n <slot name=\"overline\" class=\"list-item-overline\"></slot>\n <slot></slot>\n <slot name=\"supporting-text\" class=\"list-item-supporting-text\"></slot>\n </span>\n <span class=\"list-item-trailing\">\n <slot\n name=\"trailing-text\"\n class=\"list-item-trailing-text\"\n ${hasSlotted()}></slot>\n <slot name=\"trailing\" ${hasSlotted()}></slot>\n </span>\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CSSResultOrNative, LitElement } from 'lit';
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
/** A Material Design list component. */
|
|
10
|
+
'md-list': List;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("../../../behaviors/element-internals.js").WithElementInternals>;
|
|
14
|
+
/**
|
|
15
|
+
* A Material Design list component.
|
|
16
|
+
*/
|
|
17
|
+
export declare class List extends baseClass {
|
|
18
|
+
static styles: CSSResultOrNative[];
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Whether to render the list with segmented items.
|
|
22
|
+
*/
|
|
23
|
+
segmented: boolean;
|
|
24
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
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 } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { internals, mixinElementInternals, } from '../../../behaviors/element-internals.js';
|
|
10
|
+
import listStyles from './list.css' with { type: 'css' }; // github-only
|
|
11
|
+
// import {styles as listStyles} from './list.cssresult.js'; // google3-only
|
|
12
|
+
import { list } from './list.js';
|
|
13
|
+
// Separate variable needed for closure.
|
|
14
|
+
const baseClass = mixinElementInternals(LitElement);
|
|
15
|
+
/**
|
|
16
|
+
* A Material Design list component.
|
|
17
|
+
*/
|
|
18
|
+
let List = class List extends baseClass {
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
/**
|
|
22
|
+
* Whether to render the list with segmented items.
|
|
23
|
+
*/
|
|
24
|
+
this.segmented = false;
|
|
25
|
+
this[internals].role = 'list';
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return html `<div part="list" class="${list(this)}">
|
|
29
|
+
<slot></slot>
|
|
30
|
+
</div>`;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
List.styles = [
|
|
34
|
+
listStyles,
|
|
35
|
+
css `
|
|
36
|
+
:host {
|
|
37
|
+
display: flex;
|
|
38
|
+
}
|
|
39
|
+
.list {
|
|
40
|
+
flex: 1;
|
|
41
|
+
}
|
|
42
|
+
`,
|
|
43
|
+
];
|
|
44
|
+
__decorate([
|
|
45
|
+
property({ type: Boolean })
|
|
46
|
+
], List.prototype, "segmented", void 0);
|
|
47
|
+
List = __decorate([
|
|
48
|
+
customElement('md-list')
|
|
49
|
+
], List);
|
|
50
|
+
export { List };
|
|
51
|
+
//# sourceMappingURL=md-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"md-list.js","sourceRoot":"","sources":["md-list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,UAAU,MAAM,YAAY,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACtE,4EAA4E;AAE5E,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAS/B,wCAAwC;AACxC,MAAM,SAAS,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAEpD;;GAEG;AAEI,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,SAAS;IAajC;QACE,KAAK,EAAE,CAAC;QAIV;;WAEG;QACwB,cAAS,GAAG,KAAK,CAAC;QAN3C,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC;IAChC,CAAC;IAOkB,MAAM;QACvB,OAAO,IAAI,CAAA,2BAA2B,IAAI,CAAC,IAAI,CAAC;;WAEzC,CAAC;IACV,CAAC;;AA1Be,WAAM,GAAwB;IAC5C,UAAU;IACV,GAAG,CAAA;;;;;;;KAOF;CACF,AAVqB,CAUpB;AAUyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uCAAmB;AArBlC,IAAI;IADhB,aAAa,CAAC,SAAS,CAAC;GACZ,IAAI,CA4BhB","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 {customElement, property} from 'lit/decorators.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../../behaviors/element-internals.js';\n\nimport listStyles from './list.css' with {type: 'css'}; // github-only\n// import {styles as listStyles} from './list.cssresult.js'; // google3-only\n\nimport {list} from './list.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design list component. */\n 'md-list': List;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinElementInternals(LitElement);\n\n/**\n * A Material Design list component.\n */\n@customElement('md-list')\nexport class List extends baseClass {\n static override styles: CSSResultOrNative[] = [\n listStyles,\n css`\n :host {\n display: flex;\n }\n .list {\n flex: 1;\n }\n `,\n ];\n\n constructor() {\n super();\n this[internals].role = 'list';\n }\n\n /**\n * Whether to render the list with segmented items.\n */\n @property({type: Boolean}) segmented = false;\n\n protected override render() {\n return html`<div part=\"list\" class=\"${list(this)}\">\n <slot></slot>\n </div>`;\n }\n}\n"]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 Google LLC
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
@mixin root {
|
|
7
|
+
--container-color: var(--md-sys-color-surface-container-low);
|
|
8
|
+
--container-elevation: var(--md-sys-elevation-shadow-2);
|
|
9
|
+
--container-shape: var(--md-sys-shape-corner-lg);
|
|
10
|
+
--gap: 2px;
|
|
11
|
+
--group-padding: 2px;
|
|
12
|
+
--group-shape: var(--md-sys-shape-corner-sm);
|
|
13
|
+
--section-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@mixin inactive {
|
|
17
|
+
--container-shape: var(--md-sys-shape-corner-sm);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@mixin active {
|
|
21
|
+
--container-shape: var(--md-sys-shape-corner-md);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@mixin vibrant {
|
|
25
|
+
--container-color: var(--md-sys-color-tertiary-container);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin item {
|
|
29
|
+
--between-space: 12px;
|
|
30
|
+
--bottom-space: 8px;
|
|
31
|
+
--container-color: transparent;
|
|
32
|
+
--height: 44px;
|
|
33
|
+
--inner-corner-corner-size: none;
|
|
34
|
+
--label-text-color: var(--md-sys-color-on-surface);
|
|
35
|
+
--label-text: var(--md-sys-typescale-label-lg);
|
|
36
|
+
--label-text-tracking: var(--md-sys-typescale-label-lg-tracking);
|
|
37
|
+
--leading-icon-color: var(--md-sys-color-on-surface-variant);
|
|
38
|
+
--leading-icon-size: 20px;
|
|
39
|
+
--leading-space: 16px;
|
|
40
|
+
--shape: var(--md-sys-shape-corner-xs);
|
|
41
|
+
--supporting-text-color: var(--md-sys-color-on-surface-variant);
|
|
42
|
+
--supporting-text: var(--md-sys-typescale-body-sm);
|
|
43
|
+
--supporting-text-tracking: var(--md-sys-typescale-body-sm-tracking);
|
|
44
|
+
--top-space: 8px;
|
|
45
|
+
--trailing-icon-color: var(--md-sys-color-on-surface-variant);
|
|
46
|
+
--trailing-icon-size: 20px;
|
|
47
|
+
--trailing-space: 16px;
|
|
48
|
+
--trailing-supporting-text-color: var(--md-sys-color-on-surface-variant);
|
|
49
|
+
--trailing-supporting-text: var(--md-sys-typescale-label-lg);
|
|
50
|
+
--trailing-supporting-text-tracking: var(--md-sys-typescale-label-lg-tracking);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@mixin item-first-child {
|
|
54
|
+
--inner-corner-corner-size: var(--md-sys-shape-corner-xs);
|
|
55
|
+
--shape: var(--md-sys-shape-corner-md);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@mixin item-last-child {
|
|
59
|
+
--inner-corner-corner-size: var(--md-sys-shape-corner-xs);
|
|
60
|
+
--shape: var(--md-sys-shape-corner-md);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@mixin item-vibrant {
|
|
64
|
+
--label-text-color: var(--md-sys-color-on-tertiary-container);
|
|
65
|
+
--leading-icon-color: var(--md-sys-color-on-tertiary-container);
|
|
66
|
+
--supporting-text-color: var(--md-sys-color-on-tertiary-container);
|
|
67
|
+
--trailing-icon-color: var(--md-sys-color-on-tertiary-container);
|
|
68
|
+
--trailing-supporting-text-color: var(--md-sys-color-on-tertiary-container);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@mixin item-vibrant-hovered {
|
|
72
|
+
--leading-icon-color: var(--md-sys-color-tertiary);
|
|
73
|
+
--trailing-icon-color: var(--md-sys-color-tertiary);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@mixin item-vibrant-focused {
|
|
77
|
+
--leading-icon-color: var(--md-sys-color-tertiary);
|
|
78
|
+
--trailing-icon-color: var(--md-sys-color-tertiary);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@mixin item-vibrant-pressed {
|
|
82
|
+
--leading-icon-color: var(--md-sys-color-tertiary);
|
|
83
|
+
--trailing-icon-color: var(--md-sys-color-tertiary);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@mixin item-selected {
|
|
87
|
+
--container-color: var(--md-sys-color-tertiary-container);
|
|
88
|
+
--label-text-color: var(--md-sys-color-on-tertiary-container);
|
|
89
|
+
--leading-icon-color: var(--md-sys-color-on-tertiary-container);
|
|
90
|
+
--shape: var(--md-sys-shape-corner-md);
|
|
91
|
+
--supporting-text-color: var(--md-sys-color-on-tertiary-container);
|
|
92
|
+
--trailing-icon-color: var(--md-sys-color-on-tertiary-container);
|
|
93
|
+
--trailing-supporting-text-color: var(--md-sys-color-on-tertiary-container);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@mixin item-selected-vibrant {
|
|
97
|
+
--container-color: var(--md-sys-color-tertiary);
|
|
98
|
+
--label-text-color: var(--md-sys-color-on-tertiary);
|
|
99
|
+
--leading-icon-color: var(--md-sys-color-on-tertiary);
|
|
100
|
+
--supporting-text-color: var(--md-sys-color-on-tertiary);
|
|
101
|
+
--trailing-icon-color: var(--md-sys-color-on-tertiary);
|
|
102
|
+
--trailing-supporting-text-color: var(--md-sys-color-on-tertiary);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@mixin item-disabled {
|
|
106
|
+
--label-text-color: hsl(from var(--md-sys-color-on-surface) h s l / 38%);
|
|
107
|
+
--leading-icon-color: hsl(from var(--md-sys-color-on-surface) h s l / 38%);
|
|
108
|
+
--supporting-text-color: hsl(from var(--md-sys-color-on-surface) h s l / 38%);
|
|
109
|
+
--trailing-icon-color: hsl(from var(--md-sys-color-on-surface) h s l / 38%);
|
|
110
|
+
--trailing-supporting-text-color: hsl(from var(--md-sys-color-on-surface) h s l / 38%);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@mixin item-disabled-vibrant {
|
|
114
|
+
--label-text-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
115
|
+
--leading-icon-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
116
|
+
--supporting-text-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
117
|
+
--trailing-icon-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
118
|
+
--trailing-supporting-text-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@mixin item-disabled-selected {
|
|
122
|
+
--container-color: hsl(from var(--md-sys-color-tertiary-container) h s l / 38%);
|
|
123
|
+
--label-text-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
124
|
+
--leading-icon-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
125
|
+
--supporting-text-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
126
|
+
--trailing-icon-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
127
|
+
--trailing-supporting-text-color: hsl(from var(--md-sys-color-on-tertiary-container) h s l / 38%);
|
|
128
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 MenuItemCheckable } from './menu.js';
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'md-menu-group': MenuGroup;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("../../../behaviors/element-internals.js").WithElementInternals>;
|
|
14
|
+
/**
|
|
15
|
+
* A Material Design menu group component.
|
|
16
|
+
*/
|
|
17
|
+
export declare class MenuGroup extends baseClass {
|
|
18
|
+
static styles: CSSResultOrNative[];
|
|
19
|
+
checkable: MenuItemCheckable | null;
|
|
20
|
+
get menu(): HTMLElement | null;
|
|
21
|
+
get items(): HTMLElement[];
|
|
22
|
+
private readonly menuContext;
|
|
23
|
+
constructor();
|
|
24
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
export {};
|