@loadsmart/miranda-wc 1.30.0 → 1.31.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"base-button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/button/base-button.styles.ts"],"names":[],"mappings":"AAMA,iBAAS,MAAM,4BAqFd;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"base-button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/button/base-button.styles.ts"],"names":[],"mappings":"AAMA,iBAAS,MAAM,4BA4Gd;AAED,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.styles.ts"],"names":[],"mappings":"AAOA,iBAAS,MAAM,8BAoQd;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.styles.ts"],"names":[],"mappings":"AAOA,iBAAS,MAAM,8BA4Pd;AAED,eAAe,MAAM,CAAC"}
@@ -3,32 +3,42 @@ import { type ColorToken } from '@loadsmart/miranda-tokens';
3
3
  import type { TypographyVariant } from '../../styles/typography';
4
4
  import type { HTMLTag } from '../../mixins/polymorphic-tag';
5
5
  export interface TextProps {
6
- variant?: TypographyVariant;
7
- color?: ColorToken;
8
6
  as?: HTMLTag;
7
+ color?: ColorToken;
8
+ ellipsized?: boolean;
9
+ variant?: TypographyVariant;
9
10
  }
10
11
  declare const Text_base: import("../../mixins/polymorphic-tag/polymorphic-tag.types").Constructor<import("../../mixins/polymorphic-tag/polymorphic-tag.types").PolymorphicTagInterface> & typeof LitElement;
11
12
  export declare class Text extends Text_base {
12
13
  static styles: import("lit").CSSResult[];
13
14
  static get properties(): {
14
- variant: {
15
+ color: {
15
16
  type: StringConstructor;
17
+ };
18
+ ellipsized: {
19
+ type: BooleanConstructor;
16
20
  reflect: boolean;
17
21
  };
18
- color: {
22
+ variant: {
19
23
  type: StringConstructor;
24
+ reflect: boolean;
20
25
  };
21
26
  };
22
- /**
23
- * Typography variant.
24
- * @type {TypographyVariant}
25
- */
26
- variant: TypographyVariant;
27
27
  /**
28
28
  * Text color.
29
29
  * @type {ColorToken}
30
30
  */
31
31
  color: ColorToken;
32
+ /**
33
+ * Option to enable text ellipsis.
34
+ * @type {Boolean}
35
+ */
36
+ ellipsized: boolean;
37
+ /**
38
+ * Typography variant.
39
+ * @type {TypographyVariant}
40
+ */
41
+ variant: TypographyVariant;
32
42
  constructor();
33
43
  render(): import("lit-html").TemplateResult<2 | 1>;
34
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/text/text.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,2BAA2B,CAAC;AAGxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAI5D,MAAM,WAAW,SAAS;IACzB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,EAAE,CAAC,EAAE,OAAO,CAAC;CACb;;AAED,qBAAa,IAAK,SAAQ,SAIzB;IACA,OAAgB,MAAM,4BAAc;IAEpC,WAAoB,UAAU;;;;;;;;MAK7B;IAED;;;OAGG;IACK,OAAO,EAAE,iBAAiB,CAAC;IAEnC;;;OAGG;IACK,KAAK,EAAE,UAAU,CAAC;;IAUjB,MAAM;CA8Cf;AAID,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,QAAQ,EAAE,IAAI,CAAC;KACf;CACD"}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/text/text.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,2BAA2B,CAAC;AAGxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAI5D,MAAM,WAAW,SAAS;IACzB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC5B;;AAED,qBAAa,IAAK,SAAQ,SAIzB;IACA,OAAgB,MAAM,4BAAc;IAEpC,WAAoB,UAAU;;;;;;;;;;;;MAM7B;IAED;;;OAGG;IACK,KAAK,EAAE,UAAU,CAAC;IAE1B;;;OAGG;IACK,UAAU,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACK,OAAO,EAAE,iBAAiB,CAAC;;IAW1B,MAAM;CA+Cf;AAID,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,QAAQ,EAAE,IAAI,CAAC;KACf;CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"text.styles.d.ts","sourceRoot":"","sources":["../../../src/components/text/text.styles.ts"],"names":[],"mappings":"AAKA,iBAAS,MAAM,4BA4Id;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"text.styles.d.ts","sourceRoot":"","sources":["../../../src/components/text/text.styles.ts"],"names":[],"mappings":"AAKA,iBAAS,MAAM,4BAoJd;AAED,eAAe,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -52,6 +52,28 @@ const ct=t=>null!=t?t:x
52
52
  --m-button-font-size: ${Wt("font-size-3")};
53
53
  }
54
54
 
55
+ :host([size='small']) {
56
+ --m-button-base-size: ${Wt("global-height-small")};
57
+ }
58
+
59
+ :host([size='large']) {
60
+ --m-button-base-size: ${Wt("global-height-large")};
61
+ }
62
+
63
+ :host([variant|='icon']) {
64
+ --m-button-border-radius: ${Wt("border-radius-circle")};
65
+
66
+ min-inline-size: var(--m-button-base-size);
67
+ inline-size: var(--m-button-base-size);
68
+ }
69
+
70
+ :host {
71
+ display: inline-block;
72
+ min-block-size: var(--m-button-base-size);
73
+ block-size: var(--m-button-base-size);
74
+ border-radius: var(--m-button-border-radius);
75
+ }
76
+
55
77
  .button {
56
78
  ${Rt([{property:"color"},{property:"background-color"},{property:"border-color"}])};
57
79
 
@@ -61,12 +83,13 @@ const ct=t=>null!=t?t:x
61
83
  cursor: pointer;
62
84
  position: relative;
63
85
 
64
- display: inline-flex;
86
+ display: flex;
65
87
  align-items: center;
66
88
  justify-content: center;
67
89
  overflow: hidden;
68
90
 
69
- block-size: var(--m-button-base-size);
91
+ block-size: 100%;
92
+ inline-size: 100%;
70
93
  box-sizing: border-box;
71
94
 
72
95
  text-decoration: none;
@@ -291,15 +314,9 @@ const ct=t=>null!=t?t:x
291
314
 
292
315
  .button.-icon,
293
316
  .button.-icon-secondary {
294
- --m-button-border-radius: ${Wt("border-radius-circle")};
295
317
  --m-button-color: ${Mt("color-neutral-90")};
296
318
  --m-button-padding-x: ${Wt("spacing-1")};
297
319
  --m-button-padding-y: ${Wt("spacing-1")};
298
-
299
- min-block-size: var(--m-button-base-size);
300
- max-block-size: var(--m-button-base-size);
301
- min-inline-size: var(--m-button-base-size);
302
- max-inline-size: var(--m-button-base-size);
303
320
  }
304
321
 
305
322
  .button.-icon {
@@ -365,14 +382,12 @@ const ct=t=>null!=t?t:x
365
382
 
366
383
  .button.-small {
367
384
  --m-button-padding-y: ${Wt("spacing-2")};
368
- --m-button-base-size: ${Wt("global-height-small")};
369
385
 
370
386
  ${Pt("button-sm")};
371
387
  }
372
388
 
373
389
  .button.-large {
374
390
  --m-button-padding-y: ${Wt("spacing-4")};
375
- --m-button-base-size: ${Wt("global-height-large")};
376
391
 
377
392
  ${Pt("button-lg")};
378
393
  }
@@ -522,9 +537,9 @@ const ct=t=>null!=t?t:x
522
537
  * Copyright 2018 Google LLC
523
538
  * SPDX-License-Identifier: BSD-3-Clause
524
539
  */
525
- const me=ht(class extends ut{constructor(t){var e;if(super(t),t.type!==dt||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,o)=>{const i=t[o];return null==i?e:e+`${o=o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.vt){this.vt=new Set;for(const t in e)this.vt.add(t);return this.render(e)}this.vt.forEach((t=>{null==e[t]&&(this.vt.delete(t),t.includes("-")?o.removeProperty(t):o[t]="")}));for(const t in e){const i=e[t];null!=i&&(this.vt.add(t),t.includes("-")?o.setProperty(t,i):o[t]=i)}return w}});class fe extends(bt(at,["h1","h2","h3","h4","h5","h6","p","span"],"span")){static get properties(){return{variant:{type:String,reflect:!0},color:{type:String}}}constructor(){super(),this.as="span",this.variant="body-md",this.color="color-text-primary"}render(){return D`
540
+ const me=ht(class extends ut{constructor(t){var e;if(super(t),t.type!==dt||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,o)=>{const i=t[o];return null==i?e:e+`${o=o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.vt){this.vt=new Set;for(const t in e)this.vt.add(t);return this.render(e)}this.vt.forEach((t=>{null==e[t]&&(this.vt.delete(t),t.includes("-")?o.removeProperty(t):o[t]="")}));for(const t in e){const i=e[t];null!=i&&(this.vt.add(t),t.includes("-")?o.setProperty(t,i):o[t]=i)}return w}});class fe extends(bt(at,["h1","h2","h3","h4","h5","h6","p","span"],"span")){static get properties(){return{color:{type:String},ellipsized:{type:Boolean,reflect:!0},variant:{type:String,reflect:!0}}}constructor(){super(),this.as="span",this.color="color-text-primary",this.ellipsized=!1,this.variant="body-md"}render(){return D`
526
541
  <${this.tag}
527
- class=${gt({"m-text":!0,"-body-lg-bold":"body-lg-bold"===this.variant,"-body-lg":"body-lg"===this.variant,"-body-md-bold-underline":"body-md-bold-underline"===this.variant,"-body-md-bold":"body-md-bold"===this.variant,"-body-md-underline":"body-md-underline"===this.variant,"-body-md":"body-md"===this.variant,"-body-sm-bold-underline":"body-sm-bold-underline"===this.variant,"-body-sm-bold":"body-sm-bold"===this.variant,"-body-sm-underline":"body-sm-underline"===this.variant,"-body-sm":"body-sm"===this.variant,"-button-lg":"button-lg"===this.variant,"-button-md":"button-md"===this.variant,"-button-sm":"button-sm"===this.variant,"-chips-md":"chips-md"===this.variant,"-chips-sm":"chips-sm"===this.variant,"-heading-lg-bold":"heading-lg-bold"===this.variant,"-heading-lg":"heading-lg"===this.variant,"-heading-md-bold":"heading-md-bold"===this.variant,"-heading-md":"heading-md"===this.variant,"-heading-sm-bold":"heading-sm-bold"===this.variant,"-heading-sm":"heading-sm"===this.variant,"-hero-lg-bold":"hero-lg-bold"===this.variant,"-hero-lg":"hero-lg"===this.variant,"-hero-md-bold":"hero-md-bold"===this.variant,"-hero-md":"hero-md"===this.variant,"-hero-sm-bold":"hero-sm-bold"===this.variant,"-hero-sm":"hero-sm"===this.variant,"-number-md":"number-md"===this.variant,"-number-sm":"number-sm"===this.variant,"-table-header-md":"table-header-md"===this.variant,"-table-header-sm":"table-header-sm"===this.variant})}
542
+ class=${gt({"m-text":!0,"-body-lg-bold":"body-lg-bold"===this.variant,"-body-lg":"body-lg"===this.variant,"-body-md-bold-underline":"body-md-bold-underline"===this.variant,"-body-md-bold":"body-md-bold"===this.variant,"-body-md-underline":"body-md-underline"===this.variant,"-body-md":"body-md"===this.variant,"-body-sm-bold-underline":"body-sm-bold-underline"===this.variant,"-body-sm-bold":"body-sm-bold"===this.variant,"-body-sm-underline":"body-sm-underline"===this.variant,"-body-sm":"body-sm"===this.variant,"-button-lg":"button-lg"===this.variant,"-button-md":"button-md"===this.variant,"-button-sm":"button-sm"===this.variant,"-chips-md":"chips-md"===this.variant,"-chips-sm":"chips-sm"===this.variant,"-heading-lg-bold":"heading-lg-bold"===this.variant,"-heading-lg":"heading-lg"===this.variant,"-heading-md-bold":"heading-md-bold"===this.variant,"-heading-md":"heading-md"===this.variant,"-heading-sm-bold":"heading-sm-bold"===this.variant,"-heading-sm":"heading-sm"===this.variant,"-hero-lg-bold":"hero-lg-bold"===this.variant,"-hero-lg":"hero-lg"===this.variant,"-hero-md-bold":"hero-md-bold"===this.variant,"-hero-md":"hero-md"===this.variant,"-hero-sm-bold":"hero-sm-bold"===this.variant,"-hero-sm":"hero-sm"===this.variant,"-number-md":"number-md"===this.variant,"-number-sm":"number-sm"===this.variant,"-table-header-md":"table-header-md"===this.variant,"-table-header-sm":"table-header-sm"===this.variant,"-ellipsized":Boolean(this.ellipsized)})}
528
543
  style=${me({"--m-text-color":yt(this.color)})}
529
544
  >
530
545
  <slot></slot>
@@ -532,6 +547,8 @@ const me=ht(class extends ut{constructor(t){var e;if(super(t),t.type!==dt||"styl
532
547
  `}}var $e,ye;fe.styles=[Z`
533
548
  :host {
534
549
  --m-text-color: ${Mt("color-text-primary")};
550
+ --m-text-display: inline-block;
551
+ --m-text-max-width: initial;
535
552
  }
536
553
 
537
554
  .m-text {
@@ -539,9 +556,8 @@ const me=ht(class extends ut{constructor(t){var e;if(super(t),t.type!==dt||"styl
539
556
 
540
557
  ${Pt()};
541
558
 
542
- display: inline-block;
543
-
544
559
  color: var(--m-text-color);
560
+ display: var(--m-text-display);
545
561
  }
546
562
 
547
563
  .-body-lg-bold {
@@ -667,6 +683,13 @@ const me=ht(class extends ut{constructor(t){var e;if(super(t),t.type!==dt||"styl
667
683
  .-table-header-sm {
668
684
  ${Pt("table-header-sm")};
669
685
  }
686
+
687
+ .-ellipsized {
688
+ overflow: hidden;
689
+ text-overflow: ellipsis;
690
+ white-space: nowrap;
691
+ max-width: var(--m-text-max-width);
692
+ }
670
693
  `],window.customElements.define("m-text",fe);class ve extends re{static get properties(){return{variant:{type:String},dismissible:{type:Boolean},dismissed:{type:Boolean,reflect:!0}}}constructor(){super(),$e.set(this,void 0),ye.set(this,(()=>{this.dismissed=!0,this.emit("m-dismiss",{composed:!0})})),this.variant="neutral",this.dismissible=!1,this.dismissed=!1}get primaryAction(){return null==t(this,$e,"f")&&e(this,$e,this.querySelector("m-banner-action-primary"),"f"),t(this,$e,"f")}updated(t){super.updated(t),t.has("variant")&&null!=this.primaryAction&&(this.primaryAction.variant=function(t){switch(t){case"warning":return"warning";case"danger":return"danger";default:return"primary"}}(this.variant))}render(){if(this.dismissed)return x;const e=null!=this.querySelector("*[slot='description']"),o=null!=this.querySelector("*[slot='actions']"),i=v`
671
694
  <m-close-button
672
695
  id="close"
@@ -1599,7 +1622,7 @@ let Be=class{constructor(t,e,o,i=!1){this.host=t,this.context=e,this.callback=o,
1599
1622
  ${H("animation: skeleton-loading 1s linear infinite alternate;")};
1600
1623
  width: var(--m-tag-skeleton-width);
1601
1624
  }
1602
- `]],window.customElements.define("m-tag",yi);class vi extends re{static get properties(){return{clearable:{type:Boolean},disabled:{type:Boolean,reflect:!0},max:{type:String},maxLength:{type:Number,reflect:!0,attribute:"max-length"},min:{type:String},minLength:{type:Number,reflect:!0,attribute:"min-length"},pattern:{type:String},placeholder:{type:String},readOnly:{type:Boolean,reflect:!0,attribute:"read-only"},size:{type:String},status:{type:String},step:{type:String},type:{type:String},value:{type:String}}}constructor(){super(),ui.add(this),this.inputElement=null,this.field=new Be(this,Wo,void 0,!0),this.clearable=!1,this.disabled=!1,this.placeholder=void 0,this.size="default",this.type="text",this.value=void 0,this.max=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","textbox")}render(){return v`
1625
+ `]],window.customElements.define("m-tag",yi);class vi extends re{static get properties(){return{clearable:{type:Boolean},disabled:{type:Boolean,reflect:!0},max:{type:String},maxLength:{type:Number,reflect:!0,attribute:"max-length"},min:{type:String},minLength:{type:Number,reflect:!0,attribute:"min-length"},pattern:{type:String},placeholder:{type:String},readOnly:{type:Boolean,reflect:!0,attribute:"read-only"},size:{type:String},status:{type:String},step:{type:String},type:{type:String},value:{type:String}}}constructor(){super(),ui.add(this),this.inputElement=null,this.field=new Be(this,Wo,void 0,!0),pi.set(this,(t=>{this.value=t.target.value,this.reemit(t)})),mi.set(this,(t=>{t.stopPropagation(),this.clear()})),this.clearable=!1,this.disabled=!1,this.placeholder=void 0,this.size="default",this.type="text",this.value=void 0,this.max=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","textbox")}render(){return v`
1603
1626
  <div
1604
1627
  class=${gt({container:!0,"-size-small":"small"===this.size,"-size-default":"default"===this.size,"-size-large":"large"===this.size,"is-disabled":Boolean(this.disabled),"-status-default":"default"===t(this,ui,"m",bi).call(this),"-status-danger":"danger"===t(this,ui,"m",bi).call(this)})}
1605
1628
  >
@@ -1620,17 +1643,17 @@ let Be=class{constructor(t,e,o,i=!1){this.host=t,this.context=e,this.callback=o,
1620
1643
  step=${this.step||x}
1621
1644
  value="${ct(this.value)}"
1622
1645
  @change=${this.reemit}
1623
- @input=${t(this,ui,"m",pi)}
1646
+ @input=${t(this,pi,"f")}
1624
1647
  />
1625
1648
  ${this.clearable?v`<m-close-button
1626
1649
  class=${gt({clear:!0,"is-visible":t(this,ui,"m",gi).call(this)})}
1627
1650
  controls="${ct(this.id)}"
1628
- @m-close=${t(this,ui,"m",mi)}
1651
+ @m-close=${t(this,mi,"f")}
1629
1652
  label="Clear input"
1630
1653
  ></m-close-button>`:x}
1631
1654
  <slot name="trailing"></slot>
1632
1655
  </div>
1633
- `}get input(){var t,e;return null==this.inputElement&&(this.inputElement=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("input"))&&void 0!==e?e:null),this.inputElement}clear(){this.value="",this.input&&(this.input.value=""),this.emit("m-clear"),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}ui=new WeakSet,gi=function(){const t=this.value||"";return!this.disabled&&t.length>0},bi=function(){var t;return this.status||(null===(t=this.field.value)||void 0===t?void 0:t.status)},pi=function(t){this.value=t.target.value,this.reemit(t)},mi=function(t){t.stopPropagation(),this.clear()},vi.styles=[Z`
1656
+ `}get input(){var t,e;return null==this.inputElement&&(this.inputElement=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("input"))&&void 0!==e?e:null),this.inputElement}clear(){this.value="",this.input&&(this.input.value=""),this.emit("m-clear"),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}pi=new WeakMap,mi=new WeakMap,ui=new WeakSet,gi=function(){const t=this.value||"";return!this.disabled&&t.length>0},bi=function(){var t;return this.status||(null===(t=this.field.value)||void 0===t?void 0:t.status)},vi.styles=[Z`
1634
1657
  :host {
1635
1658
  --m-text-field-background-color: transparent;
1636
1659
  --m-text-field-border-color: ${Mt("color-border")};