@universal-material/web 3.0.134 → 3.0.136

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.
Files changed (45) hide show
  1. package/checkbox/checkbox.d.ts +1 -1
  2. package/checkbox/checkbox.d.ts.map +1 -1
  3. package/checkbox/checkbox.js +4 -6
  4. package/checkbox/checkbox.js.map +1 -1
  5. package/checkbox/checkbox.styles.d.ts.map +1 -1
  6. package/checkbox/checkbox.styles.js +0 -65
  7. package/checkbox/checkbox.styles.js.map +1 -1
  8. package/chip/chip.js +2 -2
  9. package/chip/chip.js.map +1 -1
  10. package/chip/chip.styles.d.ts.map +1 -1
  11. package/chip/chip.styles.js +4 -0
  12. package/chip/chip.styles.js.map +1 -1
  13. package/custom-elements.json +1546 -1143
  14. package/package.json +1 -1
  15. package/radio/radio.d.ts +1 -1
  16. package/radio/radio.d.ts.map +1 -1
  17. package/radio/radio.js +1 -2
  18. package/radio/radio.js.map +1 -1
  19. package/radio/radio.styles.d.ts.map +1 -1
  20. package/radio/radio.styles.js +0 -65
  21. package/radio/radio.styles.js.map +1 -1
  22. package/shared/menu-field/menu-field-navigation-controller.d.ts.map +1 -1
  23. package/shared/menu-field/menu-field-navigation-controller.js +0 -1
  24. package/shared/menu-field/menu-field-navigation-controller.js.map +1 -1
  25. package/shared/selection-control/checkbox-base.d.ts +1 -0
  26. package/shared/selection-control/checkbox-base.d.ts.map +1 -0
  27. package/shared/selection-control/checkbox-base.js +7 -0
  28. package/shared/selection-control/checkbox-base.js.map +1 -0
  29. package/shared/selection-control/selection-control-list-item.d.ts.map +1 -1
  30. package/shared/selection-control/selection-control-list-item.js +9 -5
  31. package/shared/selection-control/selection-control-list-item.js.map +1 -1
  32. package/shared/selection-control/selection-control.d.ts +6 -0
  33. package/shared/selection-control/selection-control.d.ts.map +1 -1
  34. package/shared/selection-control/selection-control.js +67 -10
  35. package/shared/selection-control/selection-control.js.map +1 -1
  36. package/shared/selection-control/selection-control.styles.d.ts.map +1 -1
  37. package/shared/selection-control/selection-control.styles.js +0 -1
  38. package/shared/selection-control/selection-control.styles.js.map +1 -1
  39. package/switch/switch.d.ts +1 -1
  40. package/switch/switch.d.ts.map +1 -1
  41. package/switch/switch.js +7 -9
  42. package/switch/switch.js.map +1 -1
  43. package/switch/switch.styles.d.ts.map +1 -1
  44. package/switch/switch.styles.js +0 -65
  45. package/switch/switch.styles.js.map +1 -1
@@ -3,7 +3,7 @@ import { HTMLTemplateResult } from 'lit';
3
3
  import { UmSelectionControl } from '../shared/selection-control/selection-control.js';
4
4
  export declare class UmCheckbox extends UmSelectionControl {
5
5
  #private;
6
- static styles: import("lit").CSSResult[];
6
+ static styles: import("lit").CSSResultGroup[];
7
7
  hideStateLayer: boolean;
8
8
  get indeterminate(): boolean;
9
9
  set indeterminate(indeterminate: boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/checkbox/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAM/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AAEtF,qBACa,UAAW,SAAQ,kBAAkB;;IAChD,OAAgB,MAAM,4BAGpB;IAIuE,cAAc,UAAS;IAEhG,IACI,aAAa,IAAI,OAAO,CAE3B;IACD,IAAI,aAAa,CAAC,aAAa,EAAE,OAAO,EAUvC;IAED,IAAa,OAAO,IAAI,OAAO,CAE9B;IACD,IAAa,OAAO,CAAC,OAAO,EAAE,OAAO,EAGpC;;IAMQ,YAAY,CAAC,iBAAiB,EAAE,cAAc;cAMpC,eAAe,IAAI,kBAAkB;CAGzD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,UAAU,CAAC;KAC1B;CACF"}
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/checkbox/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAK/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AAEtF,qBACa,UAAW,SAAQ,kBAAkB;;IAChD,OAAgB,MAAM,iCAAuC;IAIc,cAAc,UAAS;IAElG,IACI,aAAa,IAAI,OAAO,CAE3B;IACD,IAAI,aAAa,CAAC,aAAa,EAAE,OAAO,EAUvC;IAED,IAAa,OAAO,IAAI,OAAO,CAE9B;IACD,IAAa,OAAO,CAAC,OAAO,EAAE,OAAO,EAGpC;;IAMQ,YAAY,CAAC,iBAAiB,EAAE,cAAc;cAMpC,eAAe,IAAI,kBAAkB;CAKzD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,UAAU,CAAC;KAC1B;CACF"}
@@ -6,14 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html } from 'lit';
8
8
  import { customElement, property } from 'lit/decorators.js';
9
- import { styles as baseStyles } from '../shared/base.styles.js';
10
9
  import { styles } from './checkbox.styles.js';
11
10
  import { UmSelectionControl } from '../shared/selection-control/selection-control.js';
12
11
  let UmCheckbox = class UmCheckbox extends UmSelectionControl {
13
- static { this.styles = [
14
- baseStyles,
15
- styles
16
- ]; }
12
+ static { this.styles = [UmSelectionControl.styles, styles]; }
17
13
  #indeterminate;
18
14
  get indeterminate() {
19
15
  return this.#indeterminate;
@@ -45,7 +41,9 @@ let UmCheckbox = class UmCheckbox extends UmSelectionControl {
45
41
  this.indeterminate = this.indeterminate;
46
42
  }
47
43
  renderIndicator() {
48
- return html `<div class="border"><div class="indicator"></div></div>`;
44
+ return html `
45
+ <div class="border"><div class="indicator"></div></div>
46
+ `;
49
47
  }
50
48
  };
51
49
  __decorate([
@@ -1 +1 @@
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C,iBAAiC;QACrD,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;QACtC,0CAA0C;QAC1C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;IAC1C,CAAC;IAEkB,eAAe;QAChC,OAAO,IAAI,CAAA,yDAAyD,CAAC;IACvE,CAAC;;AAtCwE;IAAxE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;kDAAwB;AAGhG;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+CAGzB;AAbU,UAAU;IADtB,aAAa,CAAC,YAAY,CAAC;GACf,UAAU,CA+CtB","sourcesContent":["import { PropertyValues } from '@lit/reactive-element';\nimport { html, HTMLTemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles as baseStyles } from '../shared/base.styles.js';\nimport { styles } from './checkbox.styles.js';\n\nimport { UmSelectionControl } from '../shared/selection-control/selection-control.js';\n\n@customElement('u-checkbox')\nexport class UmCheckbox extends UmSelectionControl {\n static override styles = [\n baseStyles,\n styles\n ];\n\n #indeterminate = false;\n\n @property({type: Boolean, attribute: 'hide-state-layer', reflect: true}) hideStateLayer = false;\n\n @property({type: Boolean})\n get indeterminate(): boolean {\n return this.#indeterminate;\n }\n set indeterminate(indeterminate: boolean) {\n this.#indeterminate = indeterminate;\n\n if (!indeterminate) {\n this.input?.classList.remove('indeterminate');\n return;\n }\n \n this.input?.classList.add('indeterminate');\n this.elementInternals.setFormValue(null);\n }\n\n override get checked(): boolean {\n return super.checked;\n }\n override set checked(checked: boolean) {\n super.checked = checked;\n this.indeterminate = false;\n }\n\n constructor() {\n super();\n }\n\n override firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n // eslint-disable-next-line no-self-assign\n this.indeterminate = this.indeterminate;\n }\n\n protected override renderIndicator(): HTMLTemplateResult {\n return html`<div class=\"border\"><div class=\"indicator\"></div></div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-checkbox': UmCheckbox;\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/checkbox/checkbox.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AAG/E,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,kBAAkB;aAChC,WAAM,GAAG,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,AAAtC,CAAuC;IAE7D,cAAc,CAAS;IAKvB,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IACD,IAAI,aAAa,CAAC,aAAsB;QACtC,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QAEpC,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;YAC9C,OAAO;QACT,CAAC;QAED,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,IAAa,OAAO;QAClB,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,IAAa,OAAO,CAAC,OAAgB;QACnC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QA7BV,mBAAc,GAAG,KAAK,CAAC;QAEoD,mBAAc,GAAG,KAAK,CAAC;IA4BlG,CAAC;IAEQ,YAAY,CAAC,iBAAiC;QACrD,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;QACtC,0CAA0C;QAC1C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;IAC1C,CAAC;IAEkB,eAAe;QAChC,OAAO,IAAI,CAAA;;KAEV,CAAC;IACJ,CAAC;;AAxC0E;IAA1E,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAwB;AAGlG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAG3B;AAVU,UAAU;IADtB,aAAa,CAAC,YAAY,CAAC;GACf,UAAU,CA8CtB","sourcesContent":["import { PropertyValues } from '@lit/reactive-element';\nimport { html, HTMLTemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles } from './checkbox.styles.js';\n\nimport { UmSelectionControl } from '../shared/selection-control/selection-control.js';\n\n@customElement('u-checkbox')\nexport class UmCheckbox extends UmSelectionControl {\n static override styles = [UmSelectionControl.styles, styles];\n\n #indeterminate = false;\n\n @property({ type: Boolean, attribute: 'hide-state-layer', reflect: true }) hideStateLayer = false;\n\n @property({ type: Boolean })\n get indeterminate(): boolean {\n return this.#indeterminate;\n }\n set indeterminate(indeterminate: boolean) {\n this.#indeterminate = indeterminate;\n\n if (!indeterminate) {\n this.input?.classList.remove('indeterminate');\n return;\n }\n\n this.input?.classList.add('indeterminate');\n this.elementInternals.setFormValue(null);\n }\n\n override get checked(): boolean {\n return super.checked;\n }\n override set checked(checked: boolean) {\n super.checked = checked;\n this.indeterminate = false;\n }\n\n constructor() {\n super();\n }\n\n override firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n // eslint-disable-next-line no-self-assign\n this.indeterminate = this.indeterminate;\n }\n\n protected override renderIndicator(): HTMLTemplateResult {\n return html`\n <div class=\"border\"><div class=\"indicator\"></div></div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-checkbox': UmCheckbox;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.styles.d.ts","sourceRoot":"","sources":["../../src/checkbox/checkbox.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA4HlB,CAAC"}
1
+ {"version":3,"file":"checkbox.styles.d.ts","sourceRoot":"","sources":["../../src/checkbox/checkbox.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA2DlB,CAAC"}
@@ -1,70 +1,5 @@
1
1
  import { css } from 'lit';
2
2
  export const styles = css `
3
- :host {
4
- --_state-layer-padding: var(--u-checkbox-state-layer-padding, 4px);
5
- --_input-size: calc(var(--_width) - var(--_state-layer-padding) * 2);
6
- --_indicator-color: var(--u-checkbox-indicator-unselected-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));
7
- display: inline-block;
8
- vertical-align: middle;
9
- }
10
-
11
- .container {
12
- cursor: pointer;
13
- position: relative;
14
- width: var(--_width);
15
- height: var(--_height);
16
- padding: var(--_state-layer-padding);
17
- border-radius: var(--u-shape-corner-full, 9999px);
18
- }
19
-
20
- :host([hide-state-layer]) .container {
21
- width: var(--_indicator-size);
22
- height: var(--_indicator-size);
23
- padding: 0;
24
- }
25
- :host([hide-state-layer]) u-ripple {
26
- display: none;
27
- }
28
-
29
- input {
30
- cursor: pointer;
31
- width: 100%;
32
- height: 100%;
33
- padding: 0;
34
- margin: 0;
35
- border-radius: inherit;
36
- appearance: none;
37
- pointer-events: none;
38
- }
39
-
40
- u-ripple {
41
- padding: var(--_state-layer-padding);
42
- }
43
-
44
- .indicator-container {
45
- position: absolute;
46
- display: flex;
47
- align-items: center;
48
- justify-content: center;
49
- inset: 0;
50
- pointer-events: none;
51
- }
52
-
53
- input:checked ~ .indicator-container {
54
- --_indicator-color: var(--u-checkbox-indicator-selected-color, var(--u-color-primary, rgb(103, 80, 164)));
55
- }
56
-
57
- :host([disabled]) {
58
- opacity: var(--u-checkbox-disabled-state-opacity, 0.38);
59
- }
60
- :host([disabled]) input,
61
- :host([disabled]) .container {
62
- cursor: default;
63
- }
64
- :host([disabled]) .indicator-container {
65
- --_indicator-color: var(--u-checkbox-indicator-disabled-color, var(--u-color-on-surface, rgb(29, 27, 32)));
66
- }
67
-
68
3
  :host {
69
4
  --_indicator-size: var(--u-checkbox-indicator-size, 1.125rem);
70
5
  --_width: var(--u-checkbox-size, 3rem);
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.styles.js","sourceRoot":"","sources":["../../src/checkbox/checkbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4HzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_state-layer-padding: var(--u-checkbox-state-layer-padding, 4px);\n --_input-size: calc(var(--_width) - var(--_state-layer-padding) * 2);\n --_indicator-color: var(--u-checkbox-indicator-unselected-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n display: inline-block;\n vertical-align: middle;\n }\n\n .container {\n cursor: pointer;\n position: relative;\n width: var(--_width);\n height: var(--_height);\n padding: var(--_state-layer-padding);\n border-radius: var(--u-shape-corner-full, 9999px);\n }\n\n :host([hide-state-layer]) .container {\n width: var(--_indicator-size);\n height: var(--_indicator-size);\n padding: 0;\n }\n :host([hide-state-layer]) u-ripple {\n display: none;\n }\n\n input {\n cursor: pointer;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n border-radius: inherit;\n appearance: none;\n pointer-events: none;\n }\n\n u-ripple {\n padding: var(--_state-layer-padding);\n }\n\n .indicator-container {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n inset: 0;\n pointer-events: none;\n }\n\n input:checked ~ .indicator-container {\n --_indicator-color: var(--u-checkbox-indicator-selected-color, var(--u-color-primary, rgb(103, 80, 164)));\n }\n\n :host([disabled]) {\n opacity: var(--u-checkbox-disabled-state-opacity, 0.38);\n }\n :host([disabled]) input,\n :host([disabled]) .container {\n cursor: default;\n }\n :host([disabled]) .indicator-container {\n --_indicator-color: var(--u-checkbox-indicator-disabled-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n }\n\n :host {\n --_indicator-size: var(--u-checkbox-indicator-size, 1.125rem);\n --_width: var(--u-checkbox-size, 3rem);\n --_height: var(--_width);\n }\n\n .border {\n width: var(--_indicator-size);\n height: var(--_indicator-size);\n box-shadow: 0 0 0 var(--u-checkbox-indicator-border-width, 0.125rem) var(--_indicator-color) inset;\n border-radius: var(--u-checkbox-indicator-shaper-coner, 2px);\n transition: box-shadow 175ms 175ms;\n }\n\n .indicator {\n position: absolute;\n display: flex;\n justify-content: center;\n width: var(--_indicator-size);\n height: var(--_indicator-size);\n overflow: hidden;\n clip: rect(0, 0, var(--_indicator-size), 0);\n transition: clip 275ms;\n }\n .indicator::before {\n position: relative;\n top: 25%;\n box-sizing: border-box;\n display: block;\n width: 0.75rem;\n height: 0.35rem;\n content: \"\";\n border: var(--u-checkbox-indicator-border-width, 0.125rem) solid var(--u-color-on-primary, rgb(255, 255, 255));\n border-top-style: none;\n border-right-style: none;\n transform: rotate(-45deg);\n transition: border 175ms, transform 175ms;\n }\n\n input.indeterminate ~ .indicator-container .border,\n input:checked ~ .indicator-container .border {\n box-shadow: 0 0 0 calc(var(--_indicator-size) / 2) var(--_indicator-color) inset;\n transition: box-shadow 175ms;\n }\n input.indeterminate ~ .indicator-container .indicator,\n input:checked ~ .indicator-container .indicator {\n clip: rect(0, var(--_indicator-size), var(--_indicator-size), 0);\n transition: clip 175ms 175ms;\n }\n\n input.indeterminate ~ .indicator-container {\n --_indicator-color: var(--u-checkbox-indicator-indeterminate-color, var(--u-color-primary, rgb(103, 80, 164)));\n }\n input.indeterminate ~ .indicator-container .indicator::before {\n border-left-style: none;\n transform: rotate(0);\n width: 0.6rem;\n }\n`;\n"]}
1
+ {"version":3,"file":"checkbox.styles.js","sourceRoot":"","sources":["../../src/checkbox/checkbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_indicator-size: var(--u-checkbox-indicator-size, 1.125rem);\n --_width: var(--u-checkbox-size, 3rem);\n --_height: var(--_width);\n }\n\n .border {\n width: var(--_indicator-size);\n height: var(--_indicator-size);\n box-shadow: 0 0 0 var(--u-checkbox-indicator-border-width, 0.125rem) var(--_indicator-color) inset;\n border-radius: var(--u-checkbox-indicator-shaper-coner, 2px);\n transition: box-shadow 175ms 175ms;\n }\n\n .indicator {\n position: absolute;\n display: flex;\n justify-content: center;\n width: var(--_indicator-size);\n height: var(--_indicator-size);\n overflow: hidden;\n clip: rect(0, 0, var(--_indicator-size), 0);\n transition: clip 275ms;\n }\n .indicator::before {\n position: relative;\n top: 25%;\n box-sizing: border-box;\n display: block;\n width: 0.75rem;\n height: 0.35rem;\n content: \"\";\n border: var(--u-checkbox-indicator-border-width, 0.125rem) solid var(--u-color-on-primary, rgb(255, 255, 255));\n border-top-style: none;\n border-right-style: none;\n transform: rotate(-45deg);\n transition: border 175ms, transform 175ms;\n }\n\n input.indeterminate ~ .indicator-container .border,\n input:checked ~ .indicator-container .border {\n box-shadow: 0 0 0 calc(var(--_indicator-size) / 2) var(--_indicator-color) inset;\n transition: box-shadow 175ms;\n }\n input.indeterminate ~ .indicator-container .indicator,\n input:checked ~ .indicator-container .indicator {\n clip: rect(0, var(--_indicator-size), var(--_indicator-size), 0);\n transition: clip 175ms 175ms;\n }\n\n input.indeterminate ~ .indicator-container {\n --_indicator-color: var(--u-checkbox-indicator-indeterminate-color, var(--u-color-primary, rgb(103, 80, 164)));\n }\n input.indeterminate ~ .indicator-container .indicator::before {\n border-left-style: none;\n transform: rotate(0);\n width: 0.6rem;\n }\n`;\n"]}
package/chip/chip.js CHANGED
@@ -105,8 +105,8 @@ let UmChip = class UmChip extends UmButtonWrapper {
105
105
  }
106
106
  renderContent() {
107
107
  const remove = html `
108
- <button class="icon remove-button focus-ring" @click=${this.#handleRemoveClick}>
109
- <u-ripple id="remove-ripple"></u-ripple>
108
+ <button class="icon remove-button focus-ring" ?disabled=${this.disabled} @click=${this.#handleRemoveClick}>
109
+ <u-ripple id="remove-ripple" ?disabled=${this.disabled}></u-ripple>
110
110
  <slot name="remove-icon">
111
111
  <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 -960 960 960" width="1em" fill="currentColor">
112
112
  <path
package/chip/chip.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"chip.js","sourceRoot":"","sources":["../../src/chip/chip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,OAAO,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1F,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,qBAAqB,CAAC;AAC7B,OAAO,2BAA2B,CAAC;AAG5B,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,eAAe;IAApC;;QAGL,eAAU,GAAG,KAAK,CAAC;QACnB,YAAO,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,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDACT;AAE9B;IAAxB,KAAK,CAAC,gBAAgB,CAAC;4CAAyB;AA9EtC,MAAM;IADlB,aAAa,CAAC,QAAQ,CAAC;GACX,MAAM,CAsKlB","sourcesContent":["import { html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js';\n\nimport { styles } from './chip.styles.js';\n\nimport { UmRipple } from '../ripple/ripple.js';\nimport { UmButtonWrapper } from '../shared/button-wrapper.js';\n\nimport '../ripple/ripple.js';\nimport '../elevation/elevation.js';\n\n@customElement('u-chip')\nexport class UmChip extends UmButtonWrapper {\n static override styles = [UmButtonWrapper.styles, styles];\n\n #clickable = false;\n #toggle = false;\n\n /**\n * Whether the chip is selected or not\n */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n @property({ type: Boolean, reflect: true })\n get clickable(): boolean {\n return this.#clickable;\n }\n set clickable(value: boolean) {\n this.#clickable = value;\n this.renderRipple = this.#clickable || this.#toggle;\n }\n\n /**\n * Adds elevation to the chip\n */\n @property({ type: Boolean, reflect: true }) elevated = false;\n\n /**\n * When true, the chip will toggle between selected and unselected\n * states\n */\n @property({ type: Boolean, reflect: true })\n get toggle(): boolean {\n return this.#toggle;\n }\n set toggle(value: boolean) {\n this.#toggle = value;\n this.renderRipple = this.#clickable || this.#toggle;\n }\n\n /**\n * Add the remove icon\n */\n @property({ type: Boolean, reflect: true }) removable = false;\n\n /**\n * Hide the selected icon\n */\n @property({ type: Boolean, attribute: 'hide-selected-icon', reflect: true }) hideSelectedIcon = false;\n\n /**\n * Whether the chip has a leading icon or not\n *\n * _Note:_ Readonly\n */\n @property({ type: Boolean, attribute: 'has-leading-icon', reflect: true }) hasLeadingIcon = false;\n\n /**\n * Whether the chip has a selected icon or not\n *\n * _Note:_ Readonly\n */\n @property({ type: Boolean, attribute: 'has-selected-icon', reflect: true }) hasSelectedIcon = false;\n\n /**\n * Whether the chip has a trailing icon or not\n *\n * _Note:_ Readonly\n */\n @property({ type: Boolean, attribute: 'has-trailing-icon', reflect: true }) hasTrailingIcon = false;\n\n @queryAssignedElements({ slot: 'leading-icon', flatten: true })\n private readonly assignedLeadingIcons!: HTMLElement[];\n\n @queryAssignedElements({ slot: 'selected-icon', flatten: true })\n private readonly assignedSelectedIcons!: HTMLElement[];\n\n @queryAssignedElements({ slot: 'trailing-icon', flatten: true })\n private readonly assignedTrailingIcons!: HTMLElement[];\n\n @query('#remove-ripple') removeRipple!: UmRipple;\n\n override connectedCallback() {\n super.connectedCallback();\n this.renderRipple = this.#clickable || this.#toggle;\n }\n\n #handleRemoveClick(e: Event) {\n e.stopPropagation();\n\n if (!(<PointerEvent>e).pointerType) {\n this.removeRipple.createRipple();\n }\n\n const removeEvent = new Event('remove', { cancelable: true });\n this.dispatchEvent(removeEvent);\n\n if (!removeEvent.defaultPrevented) {\n this.remove();\n }\n }\n\n #handleTrailingIconSlotChange() {\n this.hasTrailingIcon = this.assignedTrailingIcons.length > 0;\n }\n\n #handleLeadingIconSlotChange() {\n this.hasLeadingIcon = this.assignedLeadingIcons.length > 0;\n }\n\n #handleSelectedIconSlotChange() {\n this.hasSelectedIcon = this.assignedSelectedIcons.length > 0;\n }\n\n protected override handleClick(event: UIEvent): void {\n super.handleClick(event);\n\n if (!this.toggle) {\n return;\n }\n\n this.selected = !this.selected;\n this.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n protected override renderContent(): HTMLTemplateResult {\n const remove = html`\n <button class=\"icon remove-button focus-ring\" @click=${this.#handleRemoveClick}>\n <u-ripple id=\"remove-ripple\"></u-ripple>\n <slot name=\"remove-icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" viewBox=\"0 -960 960 960\" width=\"1em\" fill=\"currentColor\">\n <path\n d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" />\n </svg>\n </slot>\n </button>\n `;\n\n return html`\n <div class=\"container\">\n <div class=\"outline\"></div>\n <span class=\"icon leading\" part=\"icon leading\">\n <slot name=\"leading-icon\" @slotchange=\"${this.#handleLeadingIconSlotChange}\"></slot>\n </span>\n <span class=\"icon selected\" part=\"icon selected\">\n <slot name=\"selected-icon\" @slotchange=\"${this.#handleSelectedIconSlotChange}\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"1em\"\n viewBox=\"0 -960 960 960\"\n width=\"1em\"\n fill=\"currentColor\">\n <path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" />\n </svg>\n </slot>\n </span>\n <div class=\"label\">\n <slot></slot>\n </div>\n <slot\n class=\"icon trailing\"\n part=\"icon trailing\"\n name=\"trailing-icon\"\n @slotchange=\"${this.#handleTrailingIconSlotChange}\"></slot>\n ${this.removable ? remove : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-chip': UmChip;\n }\n}\n"]}
1
+ {"version":3,"file":"chip.js","sourceRoot":"","sources":["../../src/chip/chip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,OAAO,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1F,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,qBAAqB,CAAC;AAC7B,OAAO,2BAA2B,CAAC;AAG5B,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,eAAe;IAApC;;QAGL,eAAU,GAAG,KAAK,CAAC;QACnB,YAAO,GAAG,KAAK,CAAC;QAEhB;;WAEG;QACyC,aAAQ,GAAG,KAAK,CAAC;QAW7D;;WAEG;QACyC,aAAQ,GAAG,KAAK,CAAC;QAe7D;;WAEG;QACyC,cAA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KAAK,CAAC,gBAAgB,CAAC;4CAAyB;AA9EtC,MAAM;IADlB,aAAa,CAAC,QAAQ,CAAC;GACX,MAAM,CAsKlB","sourcesContent":["import { html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js';\n\nimport { styles } from './chip.styles.js';\n\nimport { UmRipple } from '../ripple/ripple.js';\nimport { UmButtonWrapper } from '../shared/button-wrapper.js';\n\nimport '../ripple/ripple.js';\nimport '../elevation/elevation.js';\n\n@customElement('u-chip')\nexport class UmChip extends UmButtonWrapper {\n static override styles = [UmButtonWrapper.styles, styles];\n\n #clickable = false;\n #toggle = false;\n\n /**\n * Whether the chip is selected or not\n */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n @property({ type: Boolean, reflect: true })\n get clickable(): boolean {\n return this.#clickable;\n }\n set clickable(value: boolean) {\n this.#clickable = value;\n this.renderRipple = this.#clickable || this.#toggle;\n }\n\n /**\n * Adds elevation to the chip\n */\n @property({ type: Boolean, reflect: true }) elevated = false;\n\n /**\n * When true, the chip will toggle between selected and unselected\n * states\n */\n @property({ type: Boolean, reflect: true })\n get toggle(): boolean {\n return this.#toggle;\n }\n set toggle(value: boolean) {\n this.#toggle = value;\n this.renderRipple = this.#clickable || this.#toggle;\n }\n\n /**\n * Add the remove icon\n */\n @property({ type: Boolean, reflect: true }) removable = false;\n\n /**\n * Hide the selected icon\n */\n @property({ type: Boolean, attribute: 'hide-selected-icon', reflect: true }) hideSelectedIcon = false;\n\n /**\n * Whether the chip has a leading icon or not\n *\n * _Note:_ Readonly\n */\n @property({ type: Boolean, attribute: 'has-leading-icon', reflect: true }) hasLeadingIcon = false;\n\n /**\n * Whether the chip has a selected icon or not\n *\n * _Note:_ Readonly\n */\n @property({ type: Boolean, attribute: 'has-selected-icon', reflect: true }) hasSelectedIcon = false;\n\n /**\n * Whether the chip has a trailing icon or not\n *\n * _Note:_ Readonly\n */\n @property({ type: Boolean, attribute: 'has-trailing-icon', reflect: true }) hasTrailingIcon = false;\n\n @queryAssignedElements({ slot: 'leading-icon', flatten: true })\n private readonly assignedLeadingIcons!: HTMLElement[];\n\n @queryAssignedElements({ slot: 'selected-icon', flatten: true })\n private readonly assignedSelectedIcons!: HTMLElement[];\n\n @queryAssignedElements({ slot: 'trailing-icon', flatten: true })\n private readonly assignedTrailingIcons!: HTMLElement[];\n\n @query('#remove-ripple') removeRipple!: UmRipple;\n\n override connectedCallback() {\n super.connectedCallback();\n this.renderRipple = this.#clickable || this.#toggle;\n }\n\n #handleRemoveClick(e: Event) {\n e.stopPropagation();\n\n if (!(<PointerEvent>e).pointerType) {\n this.removeRipple.createRipple();\n }\n\n const removeEvent = new Event('remove', { cancelable: true });\n this.dispatchEvent(removeEvent);\n\n if (!removeEvent.defaultPrevented) {\n this.remove();\n }\n }\n\n #handleTrailingIconSlotChange() {\n this.hasTrailingIcon = this.assignedTrailingIcons.length > 0;\n }\n\n #handleLeadingIconSlotChange() {\n this.hasLeadingIcon = this.assignedLeadingIcons.length > 0;\n }\n\n #handleSelectedIconSlotChange() {\n this.hasSelectedIcon = this.assignedSelectedIcons.length > 0;\n }\n\n protected override handleClick(event: UIEvent): void {\n super.handleClick(event);\n\n if (!this.toggle) {\n return;\n }\n\n this.selected = !this.selected;\n this.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n protected override renderContent(): HTMLTemplateResult {\n const remove = html`\n <button class=\"icon remove-button focus-ring\" ?disabled=${this.disabled} @click=${this.#handleRemoveClick}>\n <u-ripple id=\"remove-ripple\" ?disabled=${this.disabled}></u-ripple>\n <slot name=\"remove-icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" viewBox=\"0 -960 960 960\" width=\"1em\" fill=\"currentColor\">\n <path\n d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" />\n </svg>\n </slot>\n </button>\n `;\n\n return html`\n <div class=\"container\">\n <div class=\"outline\"></div>\n <span class=\"icon leading\" part=\"icon leading\">\n <slot name=\"leading-icon\" @slotchange=\"${this.#handleLeadingIconSlotChange}\"></slot>\n </span>\n <span class=\"icon selected\" part=\"icon selected\">\n <slot name=\"selected-icon\" @slotchange=\"${this.#handleSelectedIconSlotChange}\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"1em\"\n viewBox=\"0 -960 960 960\"\n width=\"1em\"\n fill=\"currentColor\">\n <path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" />\n </svg>\n </slot>\n </span>\n <div class=\"label\">\n <slot></slot>\n </div>\n <slot\n class=\"icon trailing\"\n part=\"icon trailing\"\n name=\"trailing-icon\"\n @slotchange=\"${this.#handleTrailingIconSlotChange}\"></slot>\n ${this.removable ? remove : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-chip': UmChip;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chip.styles.d.ts","sourceRoot":"","sources":["../../src/chip/chip.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAiKlB,CAAC"}
1
+ {"version":3,"file":"chip.styles.d.ts","sourceRoot":"","sources":["../../src/chip/chip.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAqKlB,CAAC"}
@@ -160,5 +160,9 @@ export const styles = css `
160
160
  [part=default-selected-icon] {
161
161
  display: contents;
162
162
  }
163
+
164
+ :host([disabled]) .remove-button {
165
+ cursor: default;
166
+ }
163
167
  `;
164
168
  //# sourceMappingURL=chip.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chip.styles.js","sourceRoot":"","sources":["../../src/chip/chip.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiKzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_height: var(--u-chip-height, 32px);\n --_outline-width: var(--u-chip-outline-width, 1px);\n --_outline-color: var(--u-chip-outline-color, var(--u-color-outline, rgb(121, 116, 126)));\n --_shape: var(--u-chip-shape, var(--u-shape-corner-small, 8px));\n --_gap: var(--u-chip-gap, 8px);\n --_icon-size: var(--u-chip-icon-size, 1.125rem);\n --_remove-button-margin: var(--u-chip-remove-button-margin, 2px);\n --_remove-button-size: calc(var(--_height) - var(--_remove-button-margin) * 2);\n --_selected-icon-color: var(--u-chip-selected-icon-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n display: inline-block;\n height: var(--_height);\n border-radius: var(--_shape);\n }\n\n :host(:not([disabled]):not([elevated]):not([selected])) .outline {\n border: var(--_outline-width) solid var(--_outline-color);\n }\n\n :host([elevated]:not([disabled])) {\n --u-elevation-level: var(--u-elevated-chip-elevation-level, 1);\n }\n\n @media (hover: hover) {\n :host([elevated]:not([disabled]):hover) {\n --u-elevation-level: var(--u-elevated-chip-hover-elevation-level, 2);\n }\n }\n .outline {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n }\n\n .container {\n display: flex;\n align-items: center;\n border-radius: inherit;\n height: 100%;\n padding-inline: var(--u-chip-padding, 16px);\n gap: var(--_gap);\n }\n\n .icon {\n width: 1em;\n height: var(--_icon-size);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--_icon-size);\n }\n\n .leading {\n color: var(--u-chip-leading-icon-color, var(--u-color-primary, rgb(103, 80, 164)));\n }\n\n .selected {\n color: var(--_selected-icon-color);\n }\n\n .trailing {\n color: var(--u-chip-trailing-icon-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n .label {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-chip-label-line-height, var(--u-label-l-line-height, 1.25rem));\n font-size: var(--u-chip-label-font-size, var(--u-label-l-font-size, 0.875rem));\n letter-spacing: var(--u-chip-label-letter-spacing, var(--u-label-l-letter-spacing, 0.0071428571rem));\n font-weight: var(--u-chip-label-font-weight, var(--u-label-l-font-weight, var(--u-font-weight-medium, 500)));\n }\n\n .remove-button {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n width: var(--_remove-button-size);\n height: var(--_remove-button-size);\n cursor: pointer;\n padding: 0;\n margin: 0;\n margin-inline: calc((var(--_remove-button-size) - var(--_icon-size)) * -0.5);\n background: gray;\n border: none;\n border-radius: var(--u-chip-remove-button-border-radius, var(--u-shape-corner-full, 9999px));\n background: none;\n appearance: none;\n outline: 0;\n outline-offset: 0;\n z-index: 1;\n }\n\n ::slotted([slot=remove-icon]),\n ::slotted([slot=selected-icon]),\n ::slotted([slot=leading-icon]),\n ::slotted([slot=trailing-icon]) {\n font-size: inherit !important;\n }\n\n slot[name=selected-icon] {\n display: none;\n }\n\n :host(:not([clickable]):not([toggle])) .button {\n cursor: auto;\n }\n\n :host([selected]:not([hide-selected-icon])) .leading {\n display: none;\n }\n :host([selected]:not([hide-selected-icon])) slot[name=selected-icon] {\n display: contents;\n }\n\n .default-select-icon {\n display: contents;\n }\n\n :host([has-selected-icon]) .default-select-icon {\n display: none;\n }\n\n :host([selected]:not([disabled])) {\n background-color: var(--u-chip-selected-bg-color, var(--u-color-secondary-container, rgb(232, 222, 248)));\n }\n :host([selected]:not([disabled])) .leading {\n color: var(--u-chip-selected-leading-icon-color, var(--_selected-icon-color));\n }\n :host([selected]:not([disabled])) .trailing {\n color: var(--u-chip-selected-trailing-icon-color, var(--_selected-icon-color));\n }\n\n :host([has-leading-icon]) .container,\n :host([selected]:not([hide-selected-icon])) .container {\n padding-inline-start: var(--_gap);\n }\n\n :host([has-trailing-icon]) .container,\n :host([removable]) .container {\n padding-inline-end: var(--_gap);\n }\n\n :host(:not([has-leading-icon])) .leading {\n display: none;\n }\n\n :host([hide-selected-icon]) .selected,\n :host(:not([selected])) .selected {\n display: none;\n }\n\n :host(:not([has-trailing-icon])) .trailing {\n display: none;\n }\n\n [part=default-selected-icon] {\n display: contents;\n }\n`;\n"]}
1
+ {"version":3,"file":"chip.styles.js","sourceRoot":"","sources":["../../src/chip/chip.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_height: var(--u-chip-height, 32px);\n --_outline-width: var(--u-chip-outline-width, 1px);\n --_outline-color: var(--u-chip-outline-color, var(--u-color-outline, rgb(121, 116, 126)));\n --_shape: var(--u-chip-shape, var(--u-shape-corner-small, 8px));\n --_gap: var(--u-chip-gap, 8px);\n --_icon-size: var(--u-chip-icon-size, 1.125rem);\n --_remove-button-margin: var(--u-chip-remove-button-margin, 2px);\n --_remove-button-size: calc(var(--_height) - var(--_remove-button-margin) * 2);\n --_selected-icon-color: var(--u-chip-selected-icon-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n display: inline-block;\n height: var(--_height);\n border-radius: var(--_shape);\n }\n\n :host(:not([disabled]):not([elevated]):not([selected])) .outline {\n border: var(--_outline-width) solid var(--_outline-color);\n }\n\n :host([elevated]:not([disabled])) {\n --u-elevation-level: var(--u-elevated-chip-elevation-level, 1);\n }\n\n @media (hover: hover) {\n :host([elevated]:not([disabled]):hover) {\n --u-elevation-level: var(--u-elevated-chip-hover-elevation-level, 2);\n }\n }\n .outline {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n }\n\n .container {\n display: flex;\n align-items: center;\n border-radius: inherit;\n height: 100%;\n padding-inline: var(--u-chip-padding, 16px);\n gap: var(--_gap);\n }\n\n .icon {\n width: 1em;\n height: var(--_icon-size);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--_icon-size);\n }\n\n .leading {\n color: var(--u-chip-leading-icon-color, var(--u-color-primary, rgb(103, 80, 164)));\n }\n\n .selected {\n color: var(--_selected-icon-color);\n }\n\n .trailing {\n color: var(--u-chip-trailing-icon-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n .label {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-chip-label-line-height, var(--u-label-l-line-height, 1.25rem));\n font-size: var(--u-chip-label-font-size, var(--u-label-l-font-size, 0.875rem));\n letter-spacing: var(--u-chip-label-letter-spacing, var(--u-label-l-letter-spacing, 0.0071428571rem));\n font-weight: var(--u-chip-label-font-weight, var(--u-label-l-font-weight, var(--u-font-weight-medium, 500)));\n }\n\n .remove-button {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n width: var(--_remove-button-size);\n height: var(--_remove-button-size);\n cursor: pointer;\n padding: 0;\n margin: 0;\n margin-inline: calc((var(--_remove-button-size) - var(--_icon-size)) * -0.5);\n background: gray;\n border: none;\n border-radius: var(--u-chip-remove-button-border-radius, var(--u-shape-corner-full, 9999px));\n background: none;\n appearance: none;\n outline: 0;\n outline-offset: 0;\n z-index: 1;\n }\n\n ::slotted([slot=remove-icon]),\n ::slotted([slot=selected-icon]),\n ::slotted([slot=leading-icon]),\n ::slotted([slot=trailing-icon]) {\n font-size: inherit !important;\n }\n\n slot[name=selected-icon] {\n display: none;\n }\n\n :host(:not([clickable]):not([toggle])) .button {\n cursor: auto;\n }\n\n :host([selected]:not([hide-selected-icon])) .leading {\n display: none;\n }\n :host([selected]:not([hide-selected-icon])) slot[name=selected-icon] {\n display: contents;\n }\n\n .default-select-icon {\n display: contents;\n }\n\n :host([has-selected-icon]) .default-select-icon {\n display: none;\n }\n\n :host([selected]:not([disabled])) {\n background-color: var(--u-chip-selected-bg-color, var(--u-color-secondary-container, rgb(232, 222, 248)));\n }\n :host([selected]:not([disabled])) .leading {\n color: var(--u-chip-selected-leading-icon-color, var(--_selected-icon-color));\n }\n :host([selected]:not([disabled])) .trailing {\n color: var(--u-chip-selected-trailing-icon-color, var(--_selected-icon-color));\n }\n\n :host([has-leading-icon]) .container,\n :host([selected]:not([hide-selected-icon])) .container {\n padding-inline-start: var(--_gap);\n }\n\n :host([has-trailing-icon]) .container,\n :host([removable]) .container {\n padding-inline-end: var(--_gap);\n }\n\n :host(:not([has-leading-icon])) .leading {\n display: none;\n }\n\n :host([hide-selected-icon]) .selected,\n :host(:not([selected])) .selected {\n display: none;\n }\n\n :host(:not([has-trailing-icon])) .trailing {\n display: none;\n }\n\n [part=default-selected-icon] {\n display: contents;\n }\n\n :host([disabled]) .remove-button {\n cursor: default;\n }\n`;\n"]}