@cupra/ui-kit 2.0.0-canary.62 → 2.0.0-canary.64

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 (104) hide show
  1. package/dist/cjs/components/ds-accordion/ds-accordion.cjs +6 -6
  2. package/dist/cjs/components/ds-button/ds-button.cjs +43 -38
  3. package/dist/cjs/components/ds-button/styles/common.styles.cjs +41 -3
  4. package/dist/cjs/components/ds-chips/styles/common.styles.cjs +9 -2
  5. package/dist/cjs/components/ds-select/ds-select.cjs +4 -3
  6. package/dist/cjs/components/ds-slider/ds-slider.cjs +18 -18
  7. package/dist/cjs/components/ds-text-input/ds-text-input.cjs +3 -2
  8. package/dist/cjs/components/ds-textarea/ds-textarea.cjs +4 -3
  9. package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  10. package/dist/cjs/mixins/inputStatesMixin.cjs +1 -1
  11. package/dist/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.cjs +2 -2
  12. package/dist/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.cjs +1 -1
  13. package/dist/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.cjs +5 -0
  14. package/dist/cjs/utils/IconsManager.cjs +1 -1
  15. package/dist/cjs/utils/PubSub.cjs +1 -1
  16. package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  17. package/dist/cjs/utils/concurrencyLimit.cjs +1 -0
  18. package/dist/cjs/utils/cssWithTokens.cjs +1 -1
  19. package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
  20. package/dist/esm/components/ds-accordion/ds-accordion.js +4 -4
  21. package/dist/esm/components/ds-button/ds-button.js +90 -79
  22. package/dist/esm/components/ds-button/styles/common.styles.js +42 -4
  23. package/dist/esm/components/ds-chips/styles/common.styles.js +7 -0
  24. package/dist/esm/components/ds-select/ds-select.js +38 -32
  25. package/dist/esm/components/ds-slider/ds-slider.js +84 -67
  26. package/dist/esm/components/ds-text-input/ds-text-input.js +38 -30
  27. package/dist/esm/components/ds-textarea/ds-textarea.js +45 -37
  28. package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  29. package/dist/esm/mixins/inputStatesMixin.js +4 -3
  30. package/dist/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +17 -16
  31. package/dist/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +4 -4
  32. package/dist/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js +30 -0
  33. package/dist/esm/utils/IconsManager.js +1 -1
  34. package/dist/esm/utils/PubSub.js +1 -1
  35. package/dist/esm/utils/StylesRegistry/StylesRegistry.js +8 -6
  36. package/dist/esm/utils/concurrencyLimit.js +32 -0
  37. package/dist/esm/utils/cssWithTokens.js +1 -1
  38. package/dist/esm/utils/htmlWithTokens.js +1 -1
  39. package/dist/types/components/ds-accordion/ds-accordion.d.ts +1 -1
  40. package/dist/types/components/ds-button/ds-button.d.ts +2 -0
  41. package/dist/types/components/ds-button/ds-button.types.d.ts +1 -0
  42. package/dist/types/components/ds-select/ds-select.d.ts +2 -0
  43. package/dist/types/components/ds-select/ds-select.types.d.ts +1 -0
  44. package/dist/types/components/ds-slider/ds-slider.d.ts +7 -2
  45. package/dist/types/components/ds-slider/ds-slider.types.d.ts +18 -3
  46. package/dist/types/components/ds-text-input/ds-text-input.d.ts +2 -0
  47. package/dist/types/components/ds-text-input/ds-text-input.types.d.ts +1 -0
  48. package/dist/types/components/ds-textarea/ds-textarea.d.ts +2 -0
  49. package/dist/types/components/ds-textarea/ds-textarea.types.d.ts +1 -0
  50. package/dist/types/mixins/inputStatesMixin.d.ts +1 -0
  51. package/dist/types/utils/concurrencyLimit.d.ts +4 -0
  52. package/dist/types/utils/concurrencyLimit.test.d.ts +1 -0
  53. package/dist-react/cjs/components/ds-accordion/ds-accordion.cjs +6 -6
  54. package/dist-react/cjs/components/ds-button/ds-button.cjs +43 -38
  55. package/dist-react/cjs/components/ds-button/styles/common.styles.cjs +41 -3
  56. package/dist-react/cjs/components/ds-chips/styles/common.styles.cjs +9 -2
  57. package/dist-react/cjs/components/ds-select/ds-select.cjs +4 -3
  58. package/dist-react/cjs/components/ds-slider/ds-slider.cjs +18 -18
  59. package/dist-react/cjs/components/ds-text-input/ds-text-input.cjs +3 -2
  60. package/dist-react/cjs/components/ds-textarea/ds-textarea.cjs +4 -3
  61. package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  62. package/dist-react/cjs/mixins/inputStatesMixin.cjs +1 -1
  63. package/dist-react/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.cjs +2 -2
  64. package/dist-react/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.cjs +1 -1
  65. package/dist-react/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.cjs +5 -0
  66. package/dist-react/cjs/utils/IconsManager.cjs +1 -1
  67. package/dist-react/cjs/utils/PubSub.cjs +1 -1
  68. package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  69. package/dist-react/cjs/utils/concurrencyLimit.cjs +1 -0
  70. package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
  71. package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
  72. package/dist-react/esm/components/ds-accordion/ds-accordion.js +4 -4
  73. package/dist-react/esm/components/ds-button/ds-button.js +90 -79
  74. package/dist-react/esm/components/ds-button/styles/common.styles.js +42 -4
  75. package/dist-react/esm/components/ds-chips/styles/common.styles.js +7 -0
  76. package/dist-react/esm/components/ds-select/ds-select.js +38 -32
  77. package/dist-react/esm/components/ds-slider/ds-slider.js +84 -67
  78. package/dist-react/esm/components/ds-text-input/ds-text-input.js +38 -30
  79. package/dist-react/esm/components/ds-textarea/ds-textarea.js +45 -37
  80. package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  81. package/dist-react/esm/mixins/inputStatesMixin.js +4 -3
  82. package/dist-react/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +17 -16
  83. package/dist-react/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +4 -4
  84. package/dist-react/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js +30 -0
  85. package/dist-react/esm/utils/IconsManager.js +1 -1
  86. package/dist-react/esm/utils/PubSub.js +1 -1
  87. package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +8 -6
  88. package/dist-react/esm/utils/concurrencyLimit.js +32 -0
  89. package/dist-react/esm/utils/cssWithTokens.js +1 -1
  90. package/dist-react/esm/utils/htmlWithTokens.js +1 -1
  91. package/dist-react/types/components/ds-accordion/ds-accordion.d.ts +1 -1
  92. package/dist-react/types/components/ds-button/ds-button.d.ts +2 -0
  93. package/dist-react/types/components/ds-button/ds-button.types.d.ts +1 -0
  94. package/dist-react/types/components/ds-select/ds-select.d.ts +2 -0
  95. package/dist-react/types/components/ds-select/ds-select.types.d.ts +1 -0
  96. package/dist-react/types/components/ds-slider/ds-slider.d.ts +7 -2
  97. package/dist-react/types/components/ds-slider/ds-slider.types.d.ts +18 -3
  98. package/dist-react/types/components/ds-text-input/ds-text-input.d.ts +2 -0
  99. package/dist-react/types/components/ds-text-input/ds-text-input.types.d.ts +1 -0
  100. package/dist-react/types/components/ds-textarea/ds-textarea.d.ts +2 -0
  101. package/dist-react/types/components/ds-textarea/ds-textarea.types.d.ts +1 -0
  102. package/dist-react/types/mixins/inputStatesMixin.d.ts +1 -0
  103. package/dist-react/types/utils/concurrencyLimit.d.ts +4 -0
  104. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../lit-html.cjs"),t=require("../directive.cjs"),s=require("../directive-helpers.cjs");/**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const l=t.directive(class extends t.Directive{constructor(e){if(super(e),e.type!==t.PartType.PROPERTY&&e.type!==t.PartType.ATTRIBUTE&&e.type!==t.PartType.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!s.isSingleExpression(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[r]){if(r===n.noChange||r===n.nothing)return r;const i=e.element,o=e.name;if(e.type===t.PartType.PROPERTY){if(r===i[o])return n.noChange}else if(e.type===t.PartType.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(o))return n.noChange}else if(e.type===t.PartType.ATTRIBUTE&&i.getAttribute(o)===r+"")return n.noChange;return s.setCommittedValue(e),r}});exports.live=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.62"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.64"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.62"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.64"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.62/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.64/styles/${t}/components/${e}.css`,r=this.getCachedStyleSheetPromise({url:c});if(r)return r;const i=a(()=>this.fetchStyle({url:c})).then(n=>(n||this.stylePromises.delete(c),n));return this.stylePromises.set(c,i),this.stylePromises.get(c)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const h=s.getInstance();exports.stylesRegistry=h;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(r){let n=0;const e=[];function u(){if(n<r){n++;return}return new Promise(t=>{e.push(()=>{n++,t()})})}function o(){n--;const t=e.shift();t&&t()}return async t=>{const i=u();i&&await i;try{return await t()}finally{o()}}}exports.concurrencyLimit=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-62"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-64"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-62"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-64"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
@@ -19,8 +19,8 @@ let o = class extends u {
19
19
  constructor() {
20
20
  super(...arguments), this.maxHeight = 300, this.open = !1, this.mode = "light", this.size = "medium", this.disabled = !1, this._open = !1;
21
21
  }
22
- async firstUpdated(e) {
23
- super.firstUpdated(e), await this.updateComplete, this._open = this.open;
22
+ willUpdate(e) {
23
+ super.willUpdate(e), e.has("open") && (this._open = this.open);
24
24
  }
25
25
  get containerClasses() {
26
26
  return {
@@ -64,13 +64,13 @@ let o = class extends u {
64
64
  <style>
65
65
  :host{
66
66
  color-scheme: ${this.mode};
67
- pointer-events: ${this.disabled ? "none" : "visible"};
67
+ pointer-events: ${this.disabled ? "none" : "auto"};
68
68
  }
69
69
  </style>
70
70
  `;
71
71
  }
72
72
  handleKeyDown(e) {
73
- this.disabled && e.preventDefault();
73
+ this.disabled && (e.preventDefault(), e.stopPropagation());
74
74
  }
75
75
  handleToggle(e) {
76
76
  this._open = e.newState === "open";
@@ -1,24 +1,24 @@
1
- import { UiKitElement as f } from "../base/UiKitElement.js";
2
- import { customUiKitElement as y } from "../../decorators/customUiKitElement.js";
3
- import { ViewportMixin as g } from "../../mixins/ViewportMixin.js";
4
- import { booleanConverter as a } from "../../utils/booleanConverter.js";
5
- import { htmlWithTokens as b } from "../../utils/htmlWithTokens.js";
6
- import { objectConverter as v } from "../../utils/objectConverter.js";
1
+ import { UiKitElement as g } from "../base/UiKitElement.js";
2
+ import { customUiKitElement as f } from "../../decorators/customUiKitElement.js";
3
+ import { ViewportMixin as y } from "../../mixins/ViewportMixin.js";
4
+ import { booleanConverter as l } from "../../utils/booleanConverter.js";
5
+ import { htmlWithTokens as $ } from "../../utils/htmlWithTokens.js";
6
+ import { objectConverter as b } from "../../utils/objectConverter.js";
7
7
  import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
8
- import { nothing as u, html as o } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
8
+ import { nothing as u, html as s } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
9
9
  import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
10
- import { property as s } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
11
- import { state as $ } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
10
+ import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
11
+ import { state as v } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
12
12
  import { choose as T } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.js";
13
13
  import { classMap as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
14
- import { when as p } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js";
15
- import { buttonStyles as S, textStyles as P, loadingDotsStyles as w } from "./styles/common.styles.js";
16
- var C = Object.defineProperty, x = Object.getOwnPropertyDescriptor, e = (i, n, h, l) => {
17
- for (var r = l > 1 ? void 0 : l ? x(n, h) : n, c = i.length - 1, m; c >= 0; c--)
18
- (m = i[c]) && (r = (l ? m(n, h, r) : m(r)) || r);
19
- return l && r && C(n, h, r), r;
14
+ import { when as a } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js";
15
+ import { buttonStyles as S, textStyles as x, loadingDotsStyles as P } from "./styles/common.styles.js";
16
+ var w = Object.defineProperty, C = Object.getOwnPropertyDescriptor, e = (o, r, h, p) => {
17
+ for (var n = p > 1 ? void 0 : p ? C(r, h) : r, c = o.length - 1, m; c >= 0; c--)
18
+ (m = o[c]) && (n = (p ? m(r, h, n) : m(n)) || n);
19
+ return p && n && w(r, h, n), n;
20
20
  };
21
- let t = class extends g(f) {
21
+ let t = class extends y(g) {
22
22
  constructor() {
23
23
  super(...arguments), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.destructive = !1, this.htmlTagName = "button", this.type = "button", this.iconPosition = "left", this.rounded = !1, this.fullWidth = !1, this.loading = !1;
24
24
  }
@@ -26,11 +26,11 @@ let t = class extends g(f) {
26
26
  this.closestForm = this.closest("form");
27
27
  }
28
28
  get classes() {
29
- const i = typeof this.size == "string" ? this.size : this.size[this.viewport];
29
+ const o = typeof this.size == "string" ? this.size : this.size[this.viewport];
30
30
  return {
31
31
  button: !0,
32
32
  custom: this.htmlTagName === "custom",
33
- [i]: !!i,
33
+ [o]: !!o,
34
34
  [this.mode]: !!this.mode,
35
35
  [this.variant]: !!this.variant,
36
36
  rounded: this.rounded,
@@ -39,14 +39,14 @@ let t = class extends g(f) {
39
39
  "full-width": this.fullWidth
40
40
  };
41
41
  }
42
- handleClick(i) {
43
- if (this.href || i.preventDefault(), this.closestForm && this.type === "submit") {
44
- const n = new Event("submit", {
42
+ handleClick(o) {
43
+ if (this.href || o.preventDefault(), this.closestForm && this.type === "submit") {
44
+ const r = new Event("submit", {
45
45
  bubbles: !0,
46
46
  composed: !0,
47
47
  cancelable: !0
48
48
  });
49
- this.closestForm.dispatchEvent(n);
49
+ this.closestForm.dispatchEvent(r);
50
50
  }
51
51
  }
52
52
  get iconTemplate() {
@@ -56,7 +56,7 @@ let t = class extends g(f) {
56
56
  }) : u;
57
57
  }
58
58
  get loadingTemplate() {
59
- return this.loading ? o`
59
+ return this.loading ? s`
60
60
  <span class="loading-dots">
61
61
  <span>.</span>
62
62
  <span>.</span>
@@ -64,8 +64,11 @@ let t = class extends g(f) {
64
64
  </span>
65
65
  ` : u;
66
66
  }
67
+ get contentTemplate() {
68
+ return this.loading && this.textLoading ? s`${this.textLoading}` : s`<slot></slot>`;
69
+ }
67
70
  get cssTokens() {
68
- return b`
71
+ return $`
69
72
  <style>
70
73
  :host{
71
74
  color-scheme: ${this.mode};
@@ -78,60 +81,65 @@ let t = class extends g(f) {
78
81
  </style>`;
79
82
  }
80
83
  render() {
81
- return o`
84
+ return s`
82
85
  ${this.cssTokens}
83
86
  ${T(this.htmlTagName || "button", [
84
87
  [
85
88
  "button",
86
89
  () => {
87
- var i;
88
- return o`
89
- <button
90
- aria-label=${(i = this.textContent) == null ? void 0 : i.replace(/^\s+|\s+$/g, "")}
91
- class=${d(this.classes)}
92
- type=${this.type}
93
- @click=${this.handleClick}
94
- ?disabled=${this.disabled}
95
- >
96
- ${p(this.iconPosition === "left", () => o` ${this.iconTemplate} `)}
97
- <span class="container">
98
- <slot></slot>
99
- ${this.loadingTemplate}
100
- </span>
101
- ${p(this.iconPosition === "right", () => o` ${this.iconTemplate} `)}
102
- </button>
90
+ var o;
91
+ return s`
92
+ <div class=${d(this.classes)}>
93
+ <button
94
+ class="inner"
95
+ aria-label=${(o = this.textContent) == null ? void 0 : o.replace(/^\s+|\s+$/g, "")}
96
+ type=${this.type}
97
+ @click=${this.handleClick}
98
+ ?disabled=${this.disabled}
99
+ >
100
+ ${a(this.iconPosition === "left", () => s` ${this.iconTemplate} `)}
101
+ <span class="container">
102
+ ${this.contentTemplate}
103
+ ${this.loadingTemplate}
104
+ </span>
105
+ ${a(this.iconPosition === "right", () => s` ${this.iconTemplate} `)}
106
+ </button>
107
+ </div>
103
108
  `;
104
109
  }
105
110
  ],
106
111
  [
107
112
  "a",
108
113
  () => {
109
- var i;
110
- return o`
111
- <a
112
- aria-label=${(i = this.textContent) == null ? void 0 : i.replace(/^\s+|\s+$/g, "")}
113
- class=${d(this.classes)}
114
- href=${this.href}
115
- rel=${this.rel}
116
- target=${this.target}
117
- @click=${this.handleClick}
118
- ?disabled=${this.disabled}
119
- >
120
- ${p(this.iconPosition === "left", () => o`${this.iconTemplate}`)}
121
- <span class="container">
122
- <slot></slot>
123
- ${this.loadingTemplate}
124
- </span>
125
- ${p(this.iconPosition === "right", () => o`${this.iconTemplate}`)}
126
- </a>
114
+ var o;
115
+ return s`
116
+ <div class=${d(this.classes)}>
117
+ <a
118
+ class="inner"
119
+ aria-label=${(o = this.textContent) == null ? void 0 : o.replace(/^\s+|\s+$/g, "")}
120
+ href=${this.href}
121
+ rel=${this.rel}
122
+ target=${this.target}
123
+ @click=${this.handleClick}
124
+ >
125
+ ${a(this.iconPosition === "left", () => s`${this.iconTemplate}`)}
126
+ <span class="container">
127
+ ${this.contentTemplate}
128
+ ${this.loadingTemplate}
129
+ </span>
130
+ ${a(this.iconPosition === "right", () => s`${this.iconTemplate}`)}
131
+ </a>
132
+ </div>
127
133
  `;
128
134
  }
129
135
  ],
130
136
  [
131
137
  "custom",
132
- () => o`
138
+ () => s`
133
139
  <div class=${d(this.classes)}>
134
- <slot></slot>
140
+ ${a(this.iconPosition === "left", () => s`${this.iconTemplate}`)}
141
+ ${this.loading && this.textLoading ? s`<span class="container">${this.textLoading}${this.loadingTemplate}</span>` : s`<slot></slot>${this.loadingTemplate}`}
142
+ ${a(this.iconPosition === "right", () => s`${this.iconTemplate}`)}
135
143
  </div>
136
144
  `
137
145
  ]
@@ -139,57 +147,60 @@ let t = class extends g(f) {
139
147
  `;
140
148
  }
141
149
  };
142
- t.styles = [S, P, w];
150
+ t.styles = [S, x, P];
143
151
  e([
144
- s({ type: String })
152
+ i({ type: String })
145
153
  ], t.prototype, "variant", 2);
146
154
  e([
147
- s({ type: String, reflect: !0 })
155
+ i({ type: String, reflect: !0 })
148
156
  ], t.prototype, "mode", 2);
149
157
  e([
150
- s({ type: String, converter: v })
158
+ i({ type: String, converter: b })
151
159
  ], t.prototype, "size", 2);
152
160
  e([
153
- s({ type: Boolean, converter: a })
161
+ i({ type: Boolean, converter: l })
154
162
  ], t.prototype, "disabled", 2);
155
163
  e([
156
- s({ type: Boolean, converter: a })
164
+ i({ type: Boolean, converter: l })
157
165
  ], t.prototype, "destructive", 2);
158
166
  e([
159
- s({ type: String, attribute: "icon-name" })
167
+ i({ type: String, attribute: "icon-name" })
160
168
  ], t.prototype, "iconName", 2);
161
169
  e([
162
- s({ type: String, attribute: "html-tag-name" })
170
+ i({ type: String, attribute: "html-tag-name" })
163
171
  ], t.prototype, "htmlTagName", 2);
164
172
  e([
165
- s({ type: String, reflect: !0 })
173
+ i({ type: String, reflect: !0 })
166
174
  ], t.prototype, "href", 2);
167
175
  e([
168
- s({ type: String, reflect: !0 })
176
+ i({ type: String, reflect: !0 })
169
177
  ], t.prototype, "rel", 2);
170
178
  e([
171
- s({ type: String, reflect: !0 })
179
+ i({ type: String, reflect: !0 })
172
180
  ], t.prototype, "target", 2);
173
181
  e([
174
- s({ type: String })
182
+ i({ type: String })
175
183
  ], t.prototype, "type", 2);
176
184
  e([
177
- s({ type: String, attribute: "icon-position" })
185
+ i({ type: String, attribute: "icon-position" })
178
186
  ], t.prototype, "iconPosition", 2);
179
187
  e([
180
- s({ type: Boolean, converter: a })
188
+ i({ type: Boolean, converter: l })
181
189
  ], t.prototype, "rounded", 2);
182
190
  e([
183
- s({ type: Boolean, converter: a, attribute: "full-width" })
191
+ i({ type: Boolean, converter: l, attribute: "full-width" })
184
192
  ], t.prototype, "fullWidth", 2);
185
193
  e([
186
- s({ type: Boolean, converter: a })
194
+ i({ type: Boolean, converter: l })
187
195
  ], t.prototype, "loading", 2);
188
196
  e([
189
- $()
197
+ i({ type: String, attribute: "text-loading" })
198
+ ], t.prototype, "textLoading", 2);
199
+ e([
200
+ v()
190
201
  ], t.prototype, "closestForm", 2);
191
202
  t = e([
192
- y("ds-button")
203
+ f("ds-button")
193
204
  ], t);
194
205
  export {
195
206
  t as DsButton
@@ -2,7 +2,7 @@ import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@li
2
2
  import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
3
3
  import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
4
4
  import { css as t } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
5
- const e = t`
5
+ const a = t`
6
6
  :host {
7
7
  display: contents;
8
8
  }
@@ -22,6 +22,44 @@ const e = t`
22
22
  .button.full-width {
23
23
  width: 100%;
24
24
  }
25
+
26
+ .inner,
27
+ .custom ::slotted(*) {
28
+ display: inline-flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ width: 100%;
32
+ height: 100%;
33
+ gap: var(--ui-kit-button-gap, 0);
34
+ padding: 0;
35
+ margin: 0;
36
+ background: transparent;
37
+ border: none;
38
+ color: inherit;
39
+ font: inherit;
40
+ text-transform: inherit;
41
+ letter-spacing: inherit;
42
+ text-decoration: none;
43
+ cursor: inherit;
44
+ outline: none;
45
+ box-sizing: border-box;
46
+ }
47
+
48
+ .custom ::slotted(*) {
49
+ width: auto;
50
+ flex: 1;
51
+ min-width: 0;
52
+ }
53
+
54
+ .custom ::slotted(*:disabled),
55
+ .custom.disabled ::slotted(*) {
56
+ pointer-events: none;
57
+ cursor: default;
58
+ }
59
+
60
+ .custom ::slotted(*:focus-visible) {
61
+ outline: none;
62
+ }
25
63
  `, s = t`
26
64
  .naked.container {
27
65
  display: inline-flex;
@@ -32,7 +70,7 @@ const e = t`
32
70
  text-overflow: ellipsis;
33
71
  white-space: nowrap;
34
72
  }
35
- `, l = t`
73
+ `, d = t`
36
74
  .loading-dots {
37
75
  display: inline-flex;
38
76
  align-items: baseline;
@@ -110,7 +148,7 @@ const e = t`
110
148
  }
111
149
  `;
112
150
  export {
113
- e as buttonStyles,
114
- l as loadingDotsStyles,
151
+ a as buttonStyles,
152
+ d as loadingDotsStyles,
115
153
  s as textStyles
116
154
  };
@@ -41,11 +41,18 @@ const e = o`
41
41
  }
42
42
 
43
43
  .scroll-button {
44
+ display: none;
44
45
  position: absolute;
45
46
  top: 0;
46
47
  z-index: 2;
47
48
  }
48
49
 
50
+ @media (min-width: 768px) {
51
+ .scroll-button {
52
+ display: block;
53
+ }
54
+ }
55
+
49
56
  .scroll-button.left {
50
57
  left: 0;
51
58
  }
@@ -1,30 +1,31 @@
1
- import { UiKitElement as f } from "../base/UiKitElement.js";
2
- import { customUiKitElement as S } from "../../decorators/customUiKitElement.js";
1
+ import { UiKitElement as y } from "../base/UiKitElement.js";
2
+ import { customUiKitElement as f } from "../../decorators/customUiKitElement.js";
3
+ import { booleanConverter as S } from "../../utils/booleanConverter.js";
3
4
  import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
4
- import { html as d, nothing as y } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
5
+ import { html as c, nothing as O } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
5
6
  import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
6
- import { property as p } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
7
- import { state as c } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
8
- import { query as O } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
7
+ import { property as h } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
8
+ import { state as d } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
9
+ import { query as b } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
9
10
  import { queryAssignedElements as v } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js";
10
11
  import { classMap as u } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
11
12
  import { SelectKeyboardController as m } from "./controllers/SelectKeyboardController.js";
12
- import { commonStyles as b } from "./styles/common.styles.js";
13
- var x = Object.defineProperty, I = Object.getOwnPropertyDescriptor, n = (e, t, i, o) => {
14
- for (var a = o > 1 ? void 0 : o ? I(t, i) : t, l = e.length - 1, r; l >= 0; l--)
13
+ import { commonStyles as x } from "./styles/common.styles.js";
14
+ var I = Object.defineProperty, C = Object.getOwnPropertyDescriptor, n = (e, t, i, o) => {
15
+ for (var a = o > 1 ? void 0 : o ? C(t, i) : t, l = e.length - 1, r; l >= 0; l--)
15
16
  (r = e[l]) && (a = (o ? r(t, i, a) : r(a)) || a);
16
- return o && a && x(t, i, a), a;
17
+ return o && a && I(t, i, a), a;
17
18
  };
18
- let s = class extends f {
19
+ let s = class extends y {
19
20
  constructor() {
20
- super(...arguments), this.mode = "light", this.size = "medium", this.variant = "primary", this._open = !1, this.nativeSelect = null, this.nativeLabel = null, this.nativeOptions = [], this.activeIndex = -1, this.hasForcedError = !1, this.handleMutations = (e) => {
21
+ super(...arguments), this.mode = "light", this.size = "medium", this.variant = "primary", this.readonly = !1, this._open = !1, this.nativeSelect = null, this.nativeLabel = null, this.nativeOptions = [], this.activeIndex = -1, this.hasForcedError = !1, this.handleMutations = (e) => {
21
22
  e.forEach((t) => {
22
23
  t.type === "childList" && this.syncNativeOptions();
23
24
  }), this.requestUpdate();
24
25
  }, this.syncNativeOptions = () => {
25
26
  this.nativeOptions = Array.from(this.nativeSelect.options);
26
27
  }, this.handleOpen = () => {
27
- this._open = !0, this.activeIndex = this.findSelectedOptionIndex(), this.focusDisplaySelect();
28
+ this.readonly || (this._open = !0, this.activeIndex = this.findSelectedOptionIndex(), this.focusDisplaySelect());
28
29
  }, this.handleClose = () => {
29
30
  this._open = !1;
30
31
  }, this.handleClickDisplaySelect = () => {
@@ -125,6 +126,7 @@ let s = class extends f {
125
126
  container: !0,
126
127
  open: this._open,
127
128
  disabled: !!((e = this.nativeSelect) != null && e.disabled),
129
+ readonly: !!this.readonly,
128
130
  filled: !!((i = (t = this.nativeOptions) == null ? void 0 : t.find((a) => a.selected && !a.hidden)) != null && i.selected),
129
131
  invalid: !((o = this.nativeSelect) != null && o.validity.valid),
130
132
  error: this.hasForcedError,
@@ -140,12 +142,13 @@ let s = class extends f {
140
142
  return this._open;
141
143
  }
142
144
  render() {
143
- return d`
145
+ return c`
144
146
  <slot @slotchange=${this.initializeNativeSelect}></slot>
145
147
  <div class=${u(this.containerClasses)}>
146
148
  ${this.displaySelectTemplate}
147
149
  ${this.optionsContainerTemplate}
148
150
  <slot name="helper-text"></slot>
151
+ <slot name="readonly-text"></slot>
149
152
  <slot name="forced-error" @slotchange=${this.handleChangeForcedError}></slot>
150
153
  <slot name="invalid-error"></slot>
151
154
  </div>
@@ -164,10 +167,10 @@ let s = class extends f {
164
167
  if (l.nodeType !== 3)
165
168
  return r;
166
169
  if (l.textContent.trim() === "") return "";
167
- const h = document.createElement("span");
168
- return h.classList.add("text"), h.appendChild(r), h;
170
+ const p = document.createElement("span");
171
+ return p.classList.add("text"), p.appendChild(r), p;
169
172
  });
170
- return d`
173
+ return c`
171
174
  <div class="select-outline">
172
175
  <div class="select-container">
173
176
  <label id="display-label" class="label">${(o = this.nativeLabel) == null ? void 0 : o.innerText}</label>
@@ -195,17 +198,17 @@ let s = class extends f {
195
198
  return this._open && this.activeIndex >= 0 ? `${s.ARIA_OPTION_PREFIX}${this.nativeOptions[this.activeIndex].value}` : "";
196
199
  }
197
200
  get optionsContainerTemplate() {
198
- return d`
201
+ return c`
199
202
  <div id="options-container" class="options-container" role="listbox">
200
203
  ${this.nativeOptions.map(
201
- (e, t) => e.hidden ? y : this.renderOptionClone(e, t)
204
+ (e, t) => e.hidden ? O : this.renderOptionClone(e, t)
202
205
  )}
203
206
  </div>
204
207
  `;
205
208
  }
206
209
  renderOptionClone(e, t) {
207
210
  const i = Array.from(e.childNodes).map((o) => o.cloneNode(!0));
208
- return d`
211
+ return c`
209
212
  <div
210
213
  id="${s.ARIA_OPTION_PREFIX}${e.value}"
211
214
  class=${u({
@@ -225,34 +228,37 @@ let s = class extends f {
225
228
  `;
226
229
  }
227
230
  };
228
- s.styles = [b];
231
+ s.styles = [x];
229
232
  s.ARIA_OPTION_PREFIX = "option-";
230
233
  n([
231
- p({ type: String })
234
+ h({ type: String })
232
235
  ], s.prototype, "mode", 2);
233
236
  n([
234
- p({ type: String })
237
+ h({ type: String })
235
238
  ], s.prototype, "size", 2);
236
239
  n([
237
- p({ type: String })
240
+ h({ type: String })
238
241
  ], s.prototype, "variant", 2);
239
242
  n([
240
- c()
243
+ h({ type: Boolean, converter: S, reflect: !0 })
244
+ ], s.prototype, "readonly", 2);
245
+ n([
246
+ d()
241
247
  ], s.prototype, "_open", 2);
242
248
  n([
243
- c()
249
+ d()
244
250
  ], s.prototype, "nativeSelect", 2);
245
251
  n([
246
- c()
252
+ d()
247
253
  ], s.prototype, "nativeLabel", 2);
248
254
  n([
249
- c()
255
+ d()
250
256
  ], s.prototype, "nativeOptions", 2);
251
257
  n([
252
- c()
258
+ d()
253
259
  ], s.prototype, "activeIndex", 2);
254
260
  n([
255
- c()
261
+ d()
256
262
  ], s.prototype, "hasForcedError", 2);
257
263
  n([
258
264
  v({ slot: "", selector: "select", flatten: !0 })
@@ -264,10 +270,10 @@ n([
264
270
  v({ slot: "forced-error", flatten: !0 })
265
271
  ], s.prototype, "forcedError", 2);
266
272
  n([
267
- O(".select")
273
+ b(".select")
268
274
  ], s.prototype, "displaySelect", 2);
269
275
  s = n([
270
- S("ds-select")
276
+ f("ds-select")
271
277
  ], s);
272
278
  export {
273
279
  s as DsSelect