@umbraco-ui/uui 2.0.0-alpha.1 → 2.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/custom-elements.json +45 -8
  2. package/dist/components/avatar/avatar.element.js +1 -0
  3. package/dist/components/avatar/avatar.element.js.map +1 -1
  4. package/dist/components/boolean-input/boolean-input.element.js +7 -1
  5. package/dist/components/boolean-input/boolean-input.element.js.map +1 -1
  6. package/dist/components/button/button.element.d.ts +0 -1
  7. package/dist/components/button/button.element.js +64 -18
  8. package/dist/components/button/button.element.js.map +1 -1
  9. package/dist/components/card-block-type/card-block-type.element.js +13 -4
  10. package/dist/components/card-block-type/card-block-type.element.js.map +1 -1
  11. package/dist/components/card-content-node/card-content-node.element.js +2 -2
  12. package/dist/components/card-content-node/card-content-node.element.js.map +1 -1
  13. package/dist/components/card-media/card-media.element.js +10 -3
  14. package/dist/components/card-media/card-media.element.js.map +1 -1
  15. package/dist/components/card-user/card-user.element.js +2 -2
  16. package/dist/components/card-user/card-user.element.js.map +1 -1
  17. package/dist/components/checkbox/checkbox.element.js +3 -6
  18. package/dist/components/checkbox/checkbox.element.js.map +1 -1
  19. package/dist/components/color-slider/color-slider.element.js +13 -3
  20. package/dist/components/color-slider/color-slider.element.js.map +1 -1
  21. package/dist/components/color-swatch/color-swatch.element.js +33 -1
  22. package/dist/components/color-swatch/color-swatch.element.js.map +1 -1
  23. package/dist/components/combobox/combobox.element.d.ts +9 -0
  24. package/dist/components/combobox/combobox.element.js +127 -15
  25. package/dist/components/combobox/combobox.element.js.map +1 -1
  26. package/dist/components/combobox-list/combobox-list-option.element.d.ts +1 -0
  27. package/dist/components/combobox-list/combobox-list-option.element.js +49 -10
  28. package/dist/components/combobox-list/combobox-list-option.element.js.map +1 -1
  29. package/dist/components/combobox-list/combobox-list.element.d.ts +14 -0
  30. package/dist/components/combobox-list/combobox-list.element.js +74 -25
  31. package/dist/components/combobox-list/combobox-list.element.js.map +1 -1
  32. package/dist/components/file-dropzone/file-dropzone.element.d.ts +2 -8
  33. package/dist/components/file-dropzone/file-dropzone.element.js +14 -25
  34. package/dist/components/file-dropzone/file-dropzone.element.js.map +1 -1
  35. package/dist/components/icon-registry-essential/UUIIconRegistryEssential.js +1 -1
  36. package/dist/components/icon-registry-essential/icon-registry-essential.js +33 -0
  37. package/dist/components/icon-registry-essential/icon-registry-essential.js.map +1 -1
  38. package/dist/components/index.d.ts +81 -0
  39. package/dist/components/input/input.element.js +33 -3
  40. package/dist/components/input/input.element.js.map +1 -1
  41. package/dist/components/input-file/input-file.element.js +33 -1
  42. package/dist/components/input-file/input-file.element.js.map +1 -1
  43. package/dist/components/input-lock/input-lock.element.js +33 -4
  44. package/dist/components/input-lock/input-lock.element.js.map +1 -1
  45. package/dist/components/input-password/input-password.element.js +33 -3
  46. package/dist/components/input-password/input-password.element.js.map +1 -1
  47. package/dist/components/keyboard-shortcut/key.element.js +7 -1
  48. package/dist/components/keyboard-shortcut/key.element.js.map +1 -1
  49. package/dist/components/loader/loader.element.js +19 -2
  50. package/dist/components/loader/loader.element.js.map +1 -1
  51. package/dist/components/modal/modal-container.js +6 -2
  52. package/dist/components/modal/modal-container.js.map +1 -1
  53. package/dist/components/modal/modal-dialog.element.js +5 -5
  54. package/dist/components/modal/modal-dialog.element.js.map +1 -1
  55. package/dist/components/modal/modal-sidebar.element.js +14 -10
  56. package/dist/components/modal/modal-sidebar.element.js.map +1 -1
  57. package/dist/components/modal/modal-with-toasts-example.element.d.ts +22 -0
  58. package/dist/components/modal/modal.element.d.ts +3 -1
  59. package/dist/components/modal/modal.element.js +31 -12
  60. package/dist/components/modal/modal.element.js.map +1 -1
  61. package/dist/components/modal/modal.js +7 -1
  62. package/dist/components/modal/modal.js.map +1 -1
  63. package/dist/components/pagination/pagination.element.d.ts +2 -0
  64. package/dist/components/pagination/pagination.element.js +26 -20
  65. package/dist/components/pagination/pagination.element.js.map +1 -1
  66. package/dist/components/progress-bar/progress-bar.element.js +6 -5
  67. package/dist/components/progress-bar/progress-bar.element.js.map +1 -1
  68. package/dist/components/responsive-container/responsive-container.element.js +36 -14
  69. package/dist/components/responsive-container/responsive-container.element.js.map +1 -1
  70. package/dist/components/scroll-container/scroll-container.element.js +4 -4
  71. package/dist/components/scroll-container/scroll-container.element.js.map +1 -1
  72. package/dist/components/symbol-expand/symbol-expand.element.js +1 -1
  73. package/dist/components/symbol-expand/symbol-expand.element.js.map +1 -1
  74. package/dist/components/symbol-file-thumbnail/symbol-file-thumbnail.element.js +34 -1
  75. package/dist/components/symbol-file-thumbnail/symbol-file-thumbnail.element.js.map +1 -1
  76. package/dist/components/table/table-head.element.js +4 -0
  77. package/dist/components/table/table-head.element.js.map +1 -1
  78. package/dist/components/table/table.element.js +5 -1
  79. package/dist/components/table/table.element.js.map +1 -1
  80. package/dist/components/tag/tag.element.js +4 -3
  81. package/dist/components/tag/tag.element.js.map +1 -1
  82. package/dist/components/toast-notification/toast-notification.element.js +34 -2
  83. package/dist/components/toast-notification/toast-notification.element.js.map +1 -1
  84. package/dist/components/toggle/toggle.element.js +38 -3
  85. package/dist/components/toggle/toggle.element.js.map +1 -1
  86. package/dist/index.d.ts +1 -81
  87. package/dist/internal/mixins/LabelMixin.js +14 -1
  88. package/dist/internal/mixins/LabelMixin.js.map +1 -1
  89. package/dist/internal/mixins/SelectOnlyMixin.d.ts +1 -1
  90. package/dist/internal/mixins/SelectOnlyMixin.js.map +1 -1
  91. package/dist/package.json.js +1 -1
  92. package/dist/themes/dark.css +1 -1
  93. package/dist/themes/high-contrast.css +1 -1
  94. package/dist/themes/light.css +1 -1
  95. package/package.json +26 -26
  96. package/vscode.html-custom-data.json +33 -18
@@ -754,10 +754,6 @@
754
754
  "name": "--uui-button-content-align",
755
755
  "description": "Overwrite justify-content alignment. Possible values: 'left', 'right', 'center'."
756
756
  },
757
- {
758
- "name": "--uui-button-transition",
759
- "description": "Add transition to the button. Default is none."
760
- },
761
757
  {
762
758
  "name": "--uui-focus-outline-color",
763
759
  "description": "overwrite the focus outline color"
@@ -1224,10 +1220,6 @@
1224
1220
  "name": "--uui-button-content-align",
1225
1221
  "description": "Overwrite justify-content alignment. Possible values: 'left', 'right', 'center'."
1226
1222
  },
1227
- {
1228
- "name": "--uui-button-transition",
1229
- "description": "Add transition to the button. Default is none."
1230
- },
1231
1223
  {
1232
1224
  "name": "--uui-focus-outline-color",
1233
1225
  "description": "overwrite the focus outline color"
@@ -2984,6 +2976,11 @@
2984
2976
  "name": "uui-combobox-list-option",
2985
2977
  "path": "./src/components/combobox-list/combobox-list-option.element.ts",
2986
2978
  "attributes": [
2979
+ {
2980
+ "name": "multiple",
2981
+ "type": "boolean",
2982
+ "default": "false"
2983
+ },
2987
2984
  {
2988
2985
  "name": "value",
2989
2986
  "description": "Value of the option.",
@@ -3022,6 +3019,12 @@
3022
3019
  }
3023
3020
  ],
3024
3021
  "properties": [
3022
+ {
3023
+ "name": "multiple",
3024
+ "attribute": "multiple",
3025
+ "type": "boolean",
3026
+ "default": "false"
3027
+ },
3025
3028
  {
3026
3029
  "name": "value",
3027
3030
  "attribute": "value",
@@ -3103,6 +3106,11 @@
3103
3106
  "type": "string",
3104
3107
  "default": "\"\\\"\\\"\""
3105
3108
  },
3109
+ {
3110
+ "name": "multiple",
3111
+ "type": "boolean",
3112
+ "default": "false"
3113
+ },
3106
3114
  {
3107
3115
  "name": "for",
3108
3116
  "description": "provide another element of which keyboard navigation",
@@ -3125,6 +3133,12 @@
3125
3133
  "type": "string",
3126
3134
  "default": "\"\\\"\\\"\""
3127
3135
  },
3136
+ {
3137
+ "name": "multiple",
3138
+ "attribute": "multiple",
3139
+ "type": "boolean",
3140
+ "default": "false"
3141
+ },
3128
3142
  {
3129
3143
  "name": "for",
3130
3144
  "attribute": "for",
@@ -3132,6 +3146,16 @@
3132
3146
  "type": "HTMLElement",
3133
3147
  "default": "\"this\""
3134
3148
  },
3149
+ {
3150
+ "name": "selectedValues",
3151
+ "description": "Array of selected option values. Only relevant when multiple is true.",
3152
+ "type": "string[]"
3153
+ },
3154
+ {
3155
+ "name": "selectedDisplayValues",
3156
+ "description": "Array of display values for selected options. Only relevant when multiple is true.",
3157
+ "type": "string[]"
3158
+ },
3135
3159
  {
3136
3160
  "name": "styles",
3137
3161
  "type": "CSSResult[]",
@@ -3179,6 +3203,12 @@
3179
3203
  "type": "boolean",
3180
3204
  "default": "\"false\""
3181
3205
  },
3206
+ {
3207
+ "name": "multiple",
3208
+ "description": "Enables multiple selection mode.",
3209
+ "type": "boolean",
3210
+ "default": "\"false\""
3211
+ },
3182
3212
  {
3183
3213
  "name": "hide-expand-symbol",
3184
3214
  "description": "Removes the expand symbol.",
@@ -3269,6 +3299,13 @@
3269
3299
  "type": "boolean",
3270
3300
  "default": "\"false\""
3271
3301
  },
3302
+ {
3303
+ "name": "multiple",
3304
+ "attribute": "multiple",
3305
+ "description": "Enables multiple selection mode.",
3306
+ "type": "boolean",
3307
+ "default": "\"false\""
3308
+ },
3272
3309
  {
3273
3310
  "name": "hideExpandSymbol",
3274
3311
  "attribute": "hide-expand-symbol",
@@ -53,6 +53,7 @@ const _UUIAvatarElement = class _UUIAvatarElement extends LitElement {
53
53
  }
54
54
  renderImage() {
55
55
  return html` <img
56
+ decoding="async"
56
57
  src="${this.imgSrc}"
57
58
  srcset="${this.imgSrcset}"
58
59
  alt="${this._initials}"
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.element.js","sources":["../../../src/components/avatar/avatar.element.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { when } from 'lit/directives/when.js';\n\n/**\n * Avatar for displaying users\n * @element uui-avatar\n * @slot - For anything other than initials (no more than 2-3 characters)\n */\nexport class UUIAvatarElement extends LitElement {\n /**\n * Set to true to prevent content from getting hidden if going outside the parent. Useful in combination with something like a Badge.\n * @type {boolean}\n * @attr overflow\n * @default true\n */\n @property({ type: Boolean, attribute: true, reflect: true })\n public overflow = true;\n\n /**\n * Use this to apply a image src\n * @type {string}\n * @attr img-src\n * @default ''\n */\n @property({ type: String, attribute: 'img-src' })\n public imgSrc = '';\n\n /**\n * Use this to apply a image srcset\n * @type {string}\n * @attr img-srcset\n * @default ''\n */\n @property({ type: String, attribute: 'img-srcset' })\n public imgSrcset = '';\n\n /**\n * Provide the name used for labels and to generate the initials.\n * @type {string}\n * @attr\n * @default ''\n */\n @property({ type: String, reflect: true })\n name = '';\n\n /**\n * Use this to override the initials generated from the name.\n * @type {string}\n * @attr\n * @default undefined\n */\n @property({ type: String })\n initials?: string;\n\n private get _initials() {\n return this.initials?.substring(0, 3) || this.createInitials(this.name);\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.name) {\n console.warn(this.tagName + ' needs a `name`', this);\n }\n }\n\n private createInitials(name: string) {\n let initials = '';\n\n if (!name) {\n return initials;\n }\n\n // Split by whitespace and filter out parts that start with special characters or emojis\n // This filters out parts beginning with punctuation (like parentheses, brackets, @ symbols)\n // and emojis, while keeping parts that start with letters or numbers\n const nameParts = name\n .split(/\\s+/)\n .filter(part => part.length > 0 && !/^[^\\p{L}\\p{N}]/u.test(part));\n\n // If no valid letter/number parts, check if we have emojis or other pictographic content\n if (nameParts.length === 0) {\n const trimmedName = name.trim();\n // Only render content if it contains emojis/pictographs, not just punctuation\n // Limit to the first emoji to avoid overflow in small avatars\n if (\n trimmedName.length > 0 &&\n /\\p{Extended_Pictographic}/u.test(trimmedName)\n ) {\n // Split by spaces and get the first part that contains an emoji\n const parts = trimmedName.split(/\\s+/);\n for (const part of parts) {\n if (/\\p{Extended_Pictographic}/u.test(part)) {\n return part;\n }\n }\n }\n return initials;\n }\n\n // Take first character of the first valid name part\n initials = nameParts[0].charAt(0);\n\n // If there's more than one valid name part, add the first character of the last valid name part\n if (nameParts.length > 1) {\n initials += nameParts.at(-1)!.charAt(0);\n }\n\n return initials.toUpperCase();\n }\n\n private renderImage() {\n return html` <img\n src=\"${this.imgSrc}\"\n srcset=\"${this.imgSrcset}\"\n alt=\"${this._initials}\"\n title=\"${this.name}\" />`;\n }\n\n render() {\n return html`\n ${when(\n this.imgSrc,\n () => this.renderImage(),\n () => this._initials,\n )}\n <slot></slot>\n `;\n }\n\n static override readonly styles = [\n css`\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n position: relative;\n overflow: hidden;\n border-radius: 50%;\n font-weight: 700;\n -webkit-font-smoothing: subpixel-antialiased;\n width: calc(2em + 4px);\n height: calc(2em + 4px);\n user-select: none;\n /* box-sizing: border-box; */\n aspect-ratio: 1;\n box-shadow: 0 0 0 1.5px var(--uui-color-border);\n }\n\n :host([overflow]) {\n overflow: unset;\n }\n\n img {\n object-fit: cover;\n height: 100%;\n width: 100%;\n overflow: hidden;\n border-radius: 50%;\n }\n `,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AASO,MAAM,oBAAN,MAAM,0BAAyB,WAAW;AAAA,EAA1C,cAAA;AAAA,UAAA,GAAA,SAAA;AAQL,SAAO,WAAW;AASlB,SAAO,SAAS;AAShB,SAAO,YAAY;AASnB,SAAA,OAAO;AAAA,EAAA;AAAA,EAWP,IAAY,YAAY;AACtB,WAAO,KAAK,UAAU,UAAU,GAAG,CAAC,KAAK,KAAK,eAAe,KAAK,IAAI;AAAA,EACxE;AAAA,EAEA,oBAAoB;AAClB,UAAM,kBAAA;AACN,QAAI,CAAC,KAAK,MAAM;AACd,cAAQ,KAAK,KAAK,UAAU,mBAAmB,IAAI;AAAA,IACrD;AAAA,EACF;AAAA,EAEQ,eAAe,MAAc;AACnC,QAAI,WAAW;AAEf,QAAI,CAAC,MAAM;AACT,aAAO;AAAA,IACT;AAKA,UAAM,YAAY,KACf,MAAM,KAAK,EACX,OAAO,CAAA,SAAQ,KAAK,SAAS,KAAK,CAAC,kBAAkB,KAAK,IAAI,CAAC;AAGlE,QAAI,UAAU,WAAW,GAAG;AAC1B,YAAM,cAAc,KAAK,KAAA;AAGzB,UACE,YAAY,SAAS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J,WAAA,WAAA;AASP,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM;AAAA,GAlC9B,iBAmCX,WAAA,MAAA;AASA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3Cf,iBA4CX,WAAA,UAAA;"}
1
+ {"version":3,"file":"avatar.element.js","sources":["../../../src/components/avatar/avatar.element.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { when } from 'lit/directives/when.js';\n\n/**\n * Avatar for displaying users\n * @element uui-avatar\n * @slot - For anything other than initials (no more than 2-3 characters)\n */\nexport class UUIAvatarElement extends LitElement {\n /**\n * Set to true to prevent content from getting hidden if going outside the parent. Useful in combination with something like a Badge.\n * @type {boolean}\n * @attr overflow\n * @default true\n */\n @property({ type: Boolean, attribute: true, reflect: true })\n public overflow = true;\n\n /**\n * Use this to apply a image src\n * @type {string}\n * @attr img-src\n * @default ''\n */\n @property({ type: String, attribute: 'img-src' })\n public imgSrc = '';\n\n /**\n * Use this to apply a image srcset\n * @type {string}\n * @attr img-srcset\n * @default ''\n */\n @property({ type: String, attribute: 'img-srcset' })\n public imgSrcset = '';\n\n /**\n * Provide the name used for labels and to generate the initials.\n * @type {string}\n * @attr\n * @default ''\n */\n @property({ type: String, reflect: true })\n name = '';\n\n /**\n * Use this to override the initials generated from the name.\n * @type {string}\n * @attr\n * @default undefined\n */\n @property({ type: String })\n initials?: string;\n\n private get _initials() {\n return this.initials?.substring(0, 3) || this.createInitials(this.name);\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.name) {\n console.warn(this.tagName + ' needs a `name`', this);\n }\n }\n\n private createInitials(name: string) {\n let initials = '';\n\n if (!name) {\n return initials;\n }\n\n // Split by whitespace and filter out parts that start with special characters or emojis\n // This filters out parts beginning with punctuation (like parentheses, brackets, @ symbols)\n // and emojis, while keeping parts that start with letters or numbers\n const nameParts = name\n .split(/\\s+/)\n .filter(part => part.length > 0 && !/^[^\\p{L}\\p{N}]/u.test(part));\n\n // If no valid letter/number parts, check if we have emojis or other pictographic content\n if (nameParts.length === 0) {\n const trimmedName = name.trim();\n // Only render content if it contains emojis/pictographs, not just punctuation\n // Limit to the first emoji to avoid overflow in small avatars\n if (\n trimmedName.length > 0 &&\n /\\p{Extended_Pictographic}/u.test(trimmedName)\n ) {\n // Split by spaces and get the first part that contains an emoji\n const parts = trimmedName.split(/\\s+/);\n for (const part of parts) {\n if (/\\p{Extended_Pictographic}/u.test(part)) {\n return part;\n }\n }\n }\n return initials;\n }\n\n // Take first character of the first valid name part\n initials = nameParts[0].charAt(0);\n\n // If there's more than one valid name part, add the first character of the last valid name part\n if (nameParts.length > 1) {\n initials += nameParts.at(-1)!.charAt(0);\n }\n\n return initials.toUpperCase();\n }\n\n private renderImage() {\n return html` <img\n decoding=\"async\"\n src=\"${this.imgSrc}\"\n srcset=\"${this.imgSrcset}\"\n alt=\"${this._initials}\"\n title=\"${this.name}\" />`;\n }\n\n render() {\n return html`\n ${when(\n this.imgSrc,\n () => this.renderImage(),\n () => this._initials,\n )}\n <slot></slot>\n `;\n }\n\n static override readonly styles = [\n css`\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n position: relative;\n overflow: hidden;\n border-radius: 50%;\n font-weight: 700;\n -webkit-font-smoothing: subpixel-antialiased;\n width: calc(2em + 4px);\n height: calc(2em + 4px);\n user-select: none;\n /* box-sizing: border-box; */\n aspect-ratio: 1;\n box-shadow: 0 0 0 1.5px var(--uui-color-border);\n }\n\n :host([overflow]) {\n overflow: unset;\n }\n\n img {\n object-fit: cover;\n height: 100%;\n width: 100%;\n overflow: hidden;\n border-radius: 50%;\n }\n `,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AASO,MAAM,oBAAN,MAAM,0BAAyB,WAAW;AAAA,EAA1C,cAAA;AAAA,UAAA,GAAA,SAAA;AAQL,SAAO,WAAW;AASlB,SAAO,SAAS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MAAM,KAAK;AAAA,IAAA,CACZ;AAAA;AAAA;AAAA,EAGL;AAmCF;AAjCE,kBAAyB,SAAS;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA3HG,IAAM,mBAAN;AAQE,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,WAAW,MAAM,SAAS,MAAM;AAAA,GAPhD,iBAQJ,WAAA,UAAA;AASA,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,WAAW;AAAA,GAhBrC,iBAiBJ,WAAA,QAAA;AASA,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,GAzBxC,iBA0BJ,WAAA,WAAA;AASP,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM;AAAA,GAlC9B,iBAmCX,WAAA,MAAA;AASA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3Cf,iBA4CX,WAAA,UAAA;"}
@@ -7,6 +7,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
7
7
  var _UUIBooleanInputElement_instances, onKeyDown_fn;
8
8
  import { LitElement, html, css } from "lit";
9
9
  import { property, query } from "lit/decorators.js";
10
+ import { ifDefined } from "lit/directives/if-defined.js";
10
11
  import { UUIBooleanInputEvent } from "./UUIBooleanInputEvent.js";
11
12
  import { UUIFormControlWithBasicsMixin } from "../../internal/mixins/FormControlWithBasicsMixin.js";
12
13
  import { LabelMixin } from "../../internal/mixins/LabelMixin.js";
@@ -102,7 +103,12 @@ const _UUIBooleanInputElement = class _UUIBooleanInputElement extends UUIFormCon
102
103
  .checked=${this.checked}
103
104
  .indeterminate=${this.indeterminate}
104
105
  aria-checked="${this.checked ? "true" : "false"}"
105
- aria-label=${this.label}
106
+ aria-label=${ifDefined(
107
+ this.getAttribute("aria-label") || this.label || void 0
108
+ )}
109
+ aria-labelledby=${ifDefined(
110
+ this.getAttribute("aria-labelledby") || void 0
111
+ )}
106
112
  role="${this.inputRole}" />
107
113
  ${this.renderCheckbox()} ${this.renderLabel()}
108
114
  </label>
@@ -1 +1 @@
1
- {"version":3,"file":"boolean-input.element.js","sources":["../../../src/components/boolean-input/boolean-input.element.ts"],"sourcesContent":["import {\n UUIFormControlWithBasicsMixin,\n LabelMixin,\n} from '../../internal/mixins/index.js';\nimport type { TemplateResult } from 'lit';\nimport { css, html, LitElement } from 'lit';\nimport { property, query } from 'lit/decorators.js';\n\nimport { UUIBooleanInputEvent } from './UUIBooleanInputEvent.js';\n\ntype LabelPosition = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * Base class wrapping native input type=\"checkbox\". Extend for custom boolean input.\n * @extends LabelMixin\n * @fires UUIBooleanInputEvent#change on change\n * @abstract\n */\nexport abstract class UUIBooleanInputElement extends UUIFormControlWithBasicsMixin(\n LabelMixin('', LitElement),\n '',\n) {\n private _value = '';\n\n /** intentional overwrite of FormControlMixins value getter and setter method. */\n get value() {\n return this._value;\n }\n set value(newVal: string) {\n const oldValue = super.value;\n this._value = newVal;\n this._internals.setFormValue(\n this._checked && this.name !== '' ? this._value : null,\n );\n\n this.requestUpdate('value', oldValue);\n }\n\n /**\n * Specifies the label position of the checkbox or the toggle\n * @type {'left' | 'right' | 'top' | 'bottom'}\n * @attr label-position\n * @default right\n */\n @property({ type: String, attribute: 'label-position', reflect: true })\n labelPosition: LabelPosition = 'right';\n\n private _checked = false;\n\n /**\n * Reflects the state of the element.\n * True if checkbox or toggle is checked. Change this to switch the state programmatically.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean }) // Do not 'reflect' as the attribute is used as fallback.\n get checked() {\n return this._checked;\n }\n set checked(newVal) {\n const oldValue = this._checked;\n this._checked = newVal;\n this._internals.setFormValue(\n this._checked && this.name !== '' ? this._value || 'on' : null,\n );\n this.requestUpdate('checked', oldValue);\n }\n\n /**\n * Indeterminate state for the input.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n indeterminate = false;\n\n /**\n * Disables the input.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n @query('#input')\n protected readonly _input!: HTMLInputElement;\n\n private readonly inputRole: 'checkbox' | 'switch';\n\n constructor(inputRole: 'checkbox' | 'switch' = 'checkbox') {\n super();\n if (this._value === '') {\n this._value = 'on';\n }\n this.inputRole = inputRole;\n this.addEventListener('keydown', this.#onKeyDown);\n }\n\n protected getFormElement(): HTMLInputElement {\n return this._input;\n }\n\n #onKeyDown(e: KeyboardEvent): void {\n if (e.key == 'Enter') {\n this.submit();\n }\n }\n\n public hasValue(): boolean {\n return this.checked;\n }\n\n public formResetCallback() {\n super.formResetCallback();\n this.checked = this.hasAttribute('checked');\n }\n\n /**\n * This method enables <label for=\"...\"> to focus the input\n */\n async focus() {\n await this.updateComplete;\n this._input.focus();\n }\n async click() {\n await this.updateComplete;\n this._input.click();\n }\n\n private _onInputChange(e: Event) {\n e.stopPropagation();\n this.pristine = false;\n this.checked = this._input.checked;\n this.indeterminate = this._input.indeterminate;\n this.dispatchEvent(new UUIBooleanInputEvent(UUIBooleanInputEvent.CHANGE));\n }\n\n /**\n * When extending UUIBooleanInputBase class you need to implement this abstract method. It should return a template of your input.\n * @returns {TemplateResult}\n * @abstract\n * @method\n */\n protected abstract renderCheckbox(): TemplateResult;\n\n render() {\n return html`\n <label>\n <input\n id=\"input\"\n type=\"checkbox\"\n @change=\"${this._onInputChange}\"\n .disabled=${this.disabled || this.readonly}\n .checked=${this.checked}\n .indeterminate=${this.indeterminate}\n aria-checked=\"${this.checked ? 'true' : 'false'}\"\n aria-label=${this.label}\n role=\"${this.inputRole}\" />\n ${this.renderCheckbox()} ${this.renderLabel()}\n </label>\n `;\n }\n\n static override readonly styles = [\n css`\n :host {\n display: inline-block;\n }\n\n label {\n position: relative;\n cursor: pointer;\n user-select: none;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-items: center;\n gap: var(--uui-size-3);\n }\n\n :host([readonly]) label {\n cursor: default;\n }\n\n input {\n position: absolute;\n height: 0px;\n width: 0px;\n opacity: 0;\n }\n\n :host([label-position='left']) label {\n flex-direction: row-reverse;\n }\n\n :host([label-position='top']) label {\n gap: var(--uui-size-half-base-unit);\n flex-direction: column-reverse;\n }\n\n :host([label-position='bottom']) label {\n gap: var(--uui-size-half-base-unit);\n flex-direction: column;\n }\n\n :host([disabled]) label {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .label {\n display: block;\n }\n\n span.label:empty {\n display: none;\n }\n `,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAe,0BAAf,MAAe,gCAA+B;AAAA,EACnD,WAAW,IAAI,UAAU;AAAA,EACzB;AACF,EAAE;AAAA,EAgFA,YAAY,YAAmC,YAAY;AACzD,UAAA;AApFG;AAIL,SAAQ,SAAS;AAuBjB,SAAA,gBAA+B;AAE/B,SAAQ,WAAW;AA6BnB,SAAA,gBAAgB;AAShB,SAAA,WAAW;AASX,SAAA,WAAW;AAST,QAAI,KAAK,WAAW,IAAI;AACtB,WAAK,SAAS;AAAA,IAChB;AACA,SAAK,YAAY;AACjB,SAAK,iBAAiB,WAAW,sBAAK,gDAAU;AAAA,EAClD;AAAA;AAAA,EAnFA,IAAI,QAAQ;AACV,WAAO,KAAK;AAAA,EACd;AAAA,EACA,IAAI,MAAM,QAAgB;AACxB,UAAM,WAAW,MAAM;AACvB,SAAK,SAAS;AACd,SAAK,WAAW;AAAA,MACd,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AAAA,EAGnD;AA0DF;AArNO;AAgGL,wBAAW,GAAwB;AACjC,MAAI,EAAE,OAAO,SAAS;AACpB,SAAK,OAAA;AAAA,EACP;AACF;AAyDA,wBAAyB,SAAS;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA9JG,IAAe,yBAAf;AA2BL,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,SAAS,MAAM;AAAA,GA1BlD,uBA2BpB,WAAA,iBAAA,CAAA;AAYI,gBAAA;AAAA,EADH,SAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAtCP,uBAuChB,WAAA,WAAA,CAAA;AAmBJ,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GAzDtB,uBA0DpB,WAAA,iBAAA,CAAA;AASA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GAlEtB,uBAmEpB,WAAA,YAAA,CAAA;AASA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GA3EtB,uBA4EpB,WAAA,YAAA,CAAA;AAGmB,gBAAA;AAAA,EADlB,MAAM,QAAQ;AAAA,GA9EK,uBA+ED,WAAA,UAAA,CAAA;"}
1
+ {"version":3,"file":"boolean-input.element.js","sources":["../../../src/components/boolean-input/boolean-input.element.ts"],"sourcesContent":["import {\n UUIFormControlWithBasicsMixin,\n LabelMixin,\n} from '../../internal/mixins/index.js';\nimport type { TemplateResult } from 'lit';\nimport { css, html, LitElement } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { UUIBooleanInputEvent } from './UUIBooleanInputEvent.js';\n\ntype LabelPosition = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * Base class wrapping native input type=\"checkbox\". Extend for custom boolean input.\n * @extends LabelMixin\n * @fires UUIBooleanInputEvent#change on change\n * @abstract\n */\nexport abstract class UUIBooleanInputElement extends UUIFormControlWithBasicsMixin(\n LabelMixin('', LitElement),\n '',\n) {\n private _value = '';\n\n /** intentional overwrite of FormControlMixins value getter and setter method. */\n get value() {\n return this._value;\n }\n set value(newVal: string) {\n const oldValue = super.value;\n this._value = newVal;\n this._internals.setFormValue(\n this._checked && this.name !== '' ? this._value : null,\n );\n\n this.requestUpdate('value', oldValue);\n }\n\n /**\n * Specifies the label position of the checkbox or the toggle\n * @type {'left' | 'right' | 'top' | 'bottom'}\n * @attr label-position\n * @default right\n */\n @property({ type: String, attribute: 'label-position', reflect: true })\n labelPosition: LabelPosition = 'right';\n\n private _checked = false;\n\n /**\n * Reflects the state of the element.\n * True if checkbox or toggle is checked. Change this to switch the state programmatically.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean }) // Do not 'reflect' as the attribute is used as fallback.\n get checked() {\n return this._checked;\n }\n set checked(newVal) {\n const oldValue = this._checked;\n this._checked = newVal;\n this._internals.setFormValue(\n this._checked && this.name !== '' ? this._value || 'on' : null,\n );\n this.requestUpdate('checked', oldValue);\n }\n\n /**\n * Indeterminate state for the input.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n indeterminate = false;\n\n /**\n * Disables the input.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n @query('#input')\n protected readonly _input!: HTMLInputElement;\n\n private readonly inputRole: 'checkbox' | 'switch';\n\n constructor(inputRole: 'checkbox' | 'switch' = 'checkbox') {\n super();\n if (this._value === '') {\n this._value = 'on';\n }\n this.inputRole = inputRole;\n this.addEventListener('keydown', this.#onKeyDown);\n }\n\n protected getFormElement(): HTMLInputElement {\n return this._input;\n }\n\n #onKeyDown(e: KeyboardEvent): void {\n if (e.key == 'Enter') {\n this.submit();\n }\n }\n\n public hasValue(): boolean {\n return this.checked;\n }\n\n public formResetCallback() {\n super.formResetCallback();\n this.checked = this.hasAttribute('checked');\n }\n\n /**\n * This method enables <label for=\"...\"> to focus the input\n */\n async focus() {\n await this.updateComplete;\n this._input.focus();\n }\n async click() {\n await this.updateComplete;\n this._input.click();\n }\n\n private _onInputChange(e: Event) {\n e.stopPropagation();\n this.pristine = false;\n this.checked = this._input.checked;\n this.indeterminate = this._input.indeterminate;\n this.dispatchEvent(new UUIBooleanInputEvent(UUIBooleanInputEvent.CHANGE));\n }\n\n /**\n * When extending UUIBooleanInputBase class you need to implement this abstract method. It should return a template of your input.\n * @returns {TemplateResult}\n * @abstract\n * @method\n */\n protected abstract renderCheckbox(): TemplateResult;\n\n render() {\n return html`\n <label>\n <input\n id=\"input\"\n type=\"checkbox\"\n @change=\"${this._onInputChange}\"\n .disabled=${this.disabled || this.readonly}\n .checked=${this.checked}\n .indeterminate=${this.indeterminate}\n aria-checked=\"${this.checked ? 'true' : 'false'}\"\n aria-label=${ifDefined(\n this.getAttribute('aria-label') || this.label || undefined,\n )}\n aria-labelledby=${ifDefined(\n this.getAttribute('aria-labelledby') || undefined,\n )}\n role=\"${this.inputRole}\" />\n ${this.renderCheckbox()} ${this.renderLabel()}\n </label>\n `;\n }\n\n static override readonly styles = [\n css`\n :host {\n display: inline-block;\n }\n\n label {\n position: relative;\n cursor: pointer;\n user-select: none;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-items: center;\n gap: var(--uui-size-3);\n }\n\n :host([readonly]) label {\n cursor: default;\n }\n\n input {\n position: absolute;\n height: 0px;\n width: 0px;\n opacity: 0;\n }\n\n :host([label-position='left']) label {\n flex-direction: row-reverse;\n }\n\n :host([label-position='top']) label {\n gap: var(--uui-size-half-base-unit);\n flex-direction: column-reverse;\n }\n\n :host([label-position='bottom']) label {\n gap: var(--uui-size-half-base-unit);\n flex-direction: column;\n }\n\n :host([disabled]) label {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .label {\n display: block;\n }\n\n span.label:empty {\n display: none;\n }\n `,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAe,0BAAf,MAAe,gCAA+B;AAAA,EACnD,WAAW,IAAI,UAAU;AAAA,EACzB;AACF,EAAE;AAAA,EAgFA,YAAY,YAAmC,YAAY;AACzD,UAAA;AApFG;AAIL,SAAQ,SAAS;AAuBjB,SAAA,gBAA+B;AAE/B,SAAQ,WAAW;AA6BnB,SAAA,gBAAgB;AAShB,SAAA,WAAW;AASX,SAAA,WAAW;AAST,QAAI,KAAK,WAAW,IAAI;AACtB,WAAK,SAAS;AAAA,IAChB;AACA,SAAK,YAAY;AACjB,SAAK,iBAAiB,WAAW,sBAAK,gDAAU;AAAA,EAClD;AAAA;AAAA,EAnFA,IAAI,QAAQ;AACV,WAAO,KAAK;AAAA,EACd;AAAA,EACA,IAAI,MAAM,QAAgB;AACxB,UAAM,WAAW,MAAM;AACvB,SAAK,SAAS;AACd,SAAK,WAAW;AAAA,MACd,KAAK,YAAY,KAAK,SAAS,KAAK,KAAK,SAAS;AAAA,IAAA;AAGpD,SAAK,cAAc,SAAS,QAAQ;AAAA,EACtC;AAAA;AAAA,EAqBA,IAAI,UAAU;AACZ,WAAO,KAAK;AAAA,EACd;AAAA,EACA,IAAI,QAAQ,QAAQ;AAClB,UAAM,WAAW,KAAK;AACtB,SAAK,WAAW;AAChB,SAAK,WAAW;AAAA,MACd,KAAK,YAAY,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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAnKG,IAAe,yBAAf;AA2BL,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,SAAS,MAAM;AAAA,GA1BlD,uBA2BpB,WAAA,iBAAA,CAAA;AAYI,gBAAA;AAAA,EADH,SAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAtCP,uBAuChB,WAAA,WAAA,CAAA;AAmBJ,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GAzDtB,uBA0DpB,WAAA,iBAAA,CAAA;AASA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GAlEtB,uBAmEpB,WAAA,YAAA,CAAA;AASA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GA3EtB,uBA4EpB,WAAA,YAAA,CAAA;AAGmB,gBAAA;AAAA,EADlB,MAAM,QAAQ;AAAA,GA9EK,uBA+ED,WAAA,UAAA,CAAA;"}
@@ -30,7 +30,6 @@ declare const UUIButtonElement_base: (new (...args: any[]) => import("../../inde
30
30
  * @cssprop --uui-button-contrast-hover - overwrite the text color for hover state
31
31
  * @cssprop --uui-button-contrast-disabled - overwrite the text color for disabled state
32
32
  * @cssprop --uui-button-content-align - Overwrite justify-content alignment. Possible values: 'left', 'right', 'center'.
33
- * @cssprop --uui-button-transition - Add transition to the button. Default is none.
34
33
  * @cssprop --uui-focus-outline-color - overwrite the focus outline color
35
34
  */
36
35
  export declare class UUIButtonElement extends UUIButtonElement_base {
@@ -6,6 +6,39 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
6
6
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
7
7
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
8
8
  var _resetStateTimeout;
9
+ import "../icon-registry-essential/svgs/iconAdd.js";
10
+ import "../icon-registry-essential/svgs/iconAlert.js";
11
+ import "../icon-registry-essential/svgs/iconAttachment.js";
12
+ import "../icon-registry-essential/svgs/iconCalendar.js";
13
+ import { iconCheck } from "../icon-registry-essential/svgs/iconCheck.js";
14
+ import "../icon-registry-essential/svgs/iconClipboard.js";
15
+ import "../icon-registry-essential/svgs/iconCode.js";
16
+ import "../icon-registry-essential/svgs/iconColorPicker.js";
17
+ import "../icon-registry-essential/svgs/iconCopy.js";
18
+ import "../icon-registry-essential/svgs/iconDelete.js";
19
+ import "../icon-registry-essential/svgs/iconDocument.js";
20
+ import "../icon-registry-essential/svgs/iconDownload.js";
21
+ import "../icon-registry-essential/svgs/iconDrag.js";
22
+ import "../icon-registry-essential/svgs/iconEdit.js";
23
+ import "../icon-registry-essential/svgs/iconFavorite.js";
24
+ import "../icon-registry-essential/svgs/iconFolder.js";
25
+ import "../icon-registry-essential/svgs/iconForbidden.js";
26
+ import "../icon-registry-essential/svgs/iconInfo.js";
27
+ import "../icon-registry-essential/svgs/iconLink.js";
28
+ import "../icon-registry-essential/svgs/iconLock.js";
29
+ import "../icon-registry-essential/svgs/iconPause.js";
30
+ import "../icon-registry-essential/svgs/iconPicture.js";
31
+ import "../icon-registry-essential/svgs/iconPlay.js";
32
+ import "../icon-registry-essential/svgs/iconRemove.js";
33
+ import "../icon-registry-essential/svgs/iconSearch.js";
34
+ import "../icon-registry-essential/svgs/iconSee.js";
35
+ import "../icon-registry-essential/svgs/iconSettings.js";
36
+ import "../icon-registry-essential/svgs/iconSubtract.js";
37
+ import "../icon-registry-essential/svgs/iconSync.js";
38
+ import "../icon-registry-essential/svgs/iconUnlock.js";
39
+ import "../icon-registry-essential/svgs/iconUnsee.js";
40
+ import "../icon-registry-essential/svgs/iconWand.js";
41
+ import { iconWrong } from "../icon-registry-essential/svgs/iconWrong.js";
9
42
  import { nothing, html, css, LitElement } from "lit";
10
43
  import { property, query } from "lit/decorators.js";
11
44
  import { ifDefined } from "lit/directives/if-defined.js";
@@ -14,8 +47,6 @@ import "../loader-circle/loader-circle.js";
14
47
  import { UUIFormControlWithBasicsMixin } from "../../internal/mixins/FormControlWithBasicsMixin.js";
15
48
  import { LabelMixin } from "../../internal/mixins/LabelMixin.js";
16
49
  import { PopoverTargetMixin } from "../../internal/mixins/PopoverTargetMixin.js";
17
- import { iconWrong } from "../icon-registry-essential/svgs/iconWrong.js";
18
- import { iconCheck } from "../icon-registry-essential/svgs/iconCheck.js";
19
50
  import { UUIHorizontalShakeKeyframes, UUIHorizontalShakeAnimationValue } from "../../internal/animations/uui-shake.js";
20
51
  var __defProp = Object.defineProperty;
21
52
  var __decorateClass = (decorators, target, key, kind) => {
@@ -116,7 +147,12 @@ const _UUIButtonElement = class _UUIButtonElement extends UUIFormControlWithBasi
116
147
  return html`
117
148
  <a
118
149
  id="button"
119
- aria-label=${ifDefined(this.label)}
150
+ aria-label=${ifDefined(
151
+ this.getAttribute("aria-label") || this.label || void 0
152
+ )}
153
+ aria-labelledby=${ifDefined(
154
+ this.getAttribute("aria-labelledby") || void 0
155
+ )}
120
156
  title=${ifDefined(this.title === "" ? void 0 : this.title)}
121
157
  href=${ifDefined(this.disabled ? void 0 : this.href)}
122
158
  target=${ifDefined(this.target || void 0)}
@@ -131,7 +167,12 @@ const _UUIButtonElement = class _UUIButtonElement extends UUIFormControlWithBasi
131
167
  id="button"
132
168
  type=${this.type}
133
169
  ?disabled=${this.disabled}
134
- aria-label=${ifDefined(this.label)}
170
+ aria-label=${ifDefined(
171
+ this.getAttribute("aria-label") || this.label || void 0
172
+ )}
173
+ aria-labelledby=${ifDefined(
174
+ this.getAttribute("aria-labelledby") || void 0
175
+ )}
135
176
  title=${ifDefined(this.title === "" ? void 0 : this.title)}>
136
177
  ${this.renderState()} ${this.renderLabel()}
137
178
  <slot name="extra"></slot>
@@ -234,7 +275,10 @@ _UUIButtonElement.styles = [
234
275
 
235
276
  box-shadow: none;
236
277
 
237
- transition: var(--uui-button-transition, none);
278
+ transition:
279
+ background-color 60ms,
280
+ color 60ms,
281
+ border-color 60ms;
238
282
  }
239
283
 
240
284
  #button:focus-visible {
@@ -297,6 +341,15 @@ _UUIButtonElement.styles = [
297
341
 
298
342
  /** Button color attribute: */
299
343
  #button {
344
+ --color: var(--uui-color-interactive);
345
+ --color-standalone: var(--uui-color-interactive);
346
+ --color-emphasis: var(--uui-color-interactive-emphasis);
347
+ --color-contrast: var(--uui-color-interactive-contrast);
348
+ }
349
+ /* PRIMARY — DEFAULT */
350
+ :host([look='primary']:not([color])) #button,
351
+ :host([look='primary'][color='']) #button,
352
+ :host([look='primary'][color='default']) #button {
300
353
  --color: var(--uui-color-default);
301
354
  --color-standalone: var(--uui-color-default-standalone);
302
355
  --color-emphasis: var(--uui-color-default-emphasis);
@@ -343,10 +396,7 @@ _UUIButtonElement.styles = [
343
396
  border-color: var(--uui-button-border-color, transparent);
344
397
  }
345
398
  :host(:not([disabled]):hover) #button {
346
- background-color: var(
347
- --uui-button-background-color-hover,
348
- var(--uui-color-surface-emphasis)
349
- );
399
+ background-color: var(--uui-button-background-color-hover, transparent);
350
400
  color: var(--uui-button-contrast-hover, var(--color-standalone));
351
401
  border-color: var(--uui-button-border-color-hover, transparent);
352
402
  }
@@ -364,9 +414,8 @@ _UUIButtonElement.styles = [
364
414
  background-color: var(--uui-button-background-color, var(--color));
365
415
  color: var(--uui-button-contrast, var(--color-contrast));
366
416
  border-color: var(--uui-button-border-color, transparent);
367
-
368
- /* special for primary: */
369
- font-weight: var(--uui-button-font-weight, 400);
417
+ /** makes font slightly bolder */
418
+ text-shadow: 0 0 currentColor;
370
419
  }
371
420
 
372
421
  :host([look='primary']:hover) #button {
@@ -391,6 +440,7 @@ _UUIButtonElement.styles = [
391
440
  color: var(--uui-button-contrast-disabled, var(--color-contrast));
392
441
  border-color: var(--uui-button-border-color-disabled, var(--color));
393
442
  }
443
+
394
444
  /* SECONDARY */
395
445
  :host([look='secondary']) #button {
396
446
  background-color: var(
@@ -399,9 +449,8 @@ _UUIButtonElement.styles = [
399
449
  );
400
450
  color: var(--uui-button-contrast, var(--color-standalone));
401
451
  border-color: var(--uui-button-border-color, transparent);
402
-
403
- /* special for secondary: */
404
- font-weight: var(--uui-button-font-weight, 400);
452
+ /** makes font slightly bolder */
453
+ text-shadow: 0 0 currentColor;
405
454
  }
406
455
  :host([look='secondary']:hover) #button {
407
456
  background-color: var(
@@ -428,9 +477,6 @@ _UUIButtonElement.styles = [
428
477
  --uui-button-border-color,
429
478
  var(--uui-color-border-standalone)
430
479
  );
431
-
432
- /* special for outline: */
433
- font-weight: var(--uui-button-font-weight, 400);
434
480
  }
435
481
  :host([look='outline']:not([disabled]):hover) #button {
436
482
  background-color: var(--uui-button-background-color-hover, transparent);
@@ -1 +1 @@
1
- {"version":3,"file":"button.element.js","sources":["../../../src/components/button/button.element.ts"],"sourcesContent":["import {\n UUIHorizontalShakeAnimationValue,\n UUIHorizontalShakeKeyframes,\n} from '../../internal/animations/index.js';\nimport {\n LabelMixin,\n PopoverTargetMixin,\n UUIFormControlWithBasicsMixin,\n} from '../../internal/mixins/index.js';\nimport { iconCheck, iconWrong } from '../icon-registry-essential/svgs/index.js';\nimport type {\n UUIInterfaceColor,\n UUIInterfaceLook,\n} from '../../internal/types/index.js';\nimport type { TemplateResult } from 'lit';\nimport { css, html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport '../icon/icon.js';\nimport '../loader-circle/loader-circle.js';\n\nexport type UUIButtonState = undefined | 'waiting' | 'success' | 'failed';\n\nexport type UUIButtonType = 'submit' | 'button' | 'reset';\n\n/**\n * @element uui-button\n * @fires {UUIButtonEvent} click - fires when the element is clicked\n * @slot - for default content\n * @slot label - for label content\n * @slot extra - for extra\n * @property {string} label - label to be used for aria-label and potentially as visual label for some components\n * @attribute label - label to be used for aria-label and potentially as visual label for some components\n * @description - All-around button\n * @cssprop --uui-button-height - overwrite the button height\n * @cssprop --uui-button-border-width - overwrite the border width\n * @cssprop --uui-button-border-radius - overwrite the border radius\n * @cssprop --uui-button-font-weight - overwrite the font weight\n * @cssprop --uui-button-font-size - overwrite the font size\n * @cssprop --uui-button-background-color - overwrite the background color\n * @cssprop --uui-button-background-color-hover - overwrite the background color for hover state\n * @cssprop --uui-button-background-color-disabled - overwrite the background color for disabled state\n * @cssprop --uui-button-border-color - overwrite the border color\n * @cssprop --uui-button-border-color-hover - overwrite the border color for hover state\n * @cssprop --uui-button-border-color-disabled - overwrite the border color for disabled state\n * @cssprop --uui-button-contrast - overwrite the text color\n * @cssprop --uui-button-contrast-hover - overwrite the text color for hover state\n * @cssprop --uui-button-contrast-disabled - overwrite the text color for disabled state\n * @cssprop --uui-button-content-align - Overwrite justify-content alignment. Possible values: 'left', 'right', 'center'.\n * @cssprop --uui-button-transition - Add transition to the button. Default is none.\n * @cssprop --uui-focus-outline-color - overwrite the focus outline color\n */\nexport class UUIButtonElement extends UUIFormControlWithBasicsMixin(\n LabelMixin('', PopoverTargetMixin(LitElement)),\n) {\n /**\n * Specifies the type of button\n * @type {\"submit\" | \"button\" | \"reset\"}\n * @attr\n * @default \"button\"\n */\n @property({ type: String, reflect: true })\n type: UUIButtonType = 'button';\n\n /**\n * Disables the button, changes the looks of it and prevents if from emitting the click event\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Changes the look of the button to one of the predefined, symbolic looks. For example - set this to positive if you want nice, green \"confirm\" button.\n * @type {\"default\" | \"primary\" | \"secondary\" | \"outline\" | \"placeholder\"}\n * @attr\n * @default \"default\"\n */\n @property({ reflect: true })\n look: UUIInterfaceLook = 'default';\n\n /**\n * Changes the look of the button to one of the predefined, symbolic looks. For example - set this to positive if you want nice, green \"confirm\" button.\n * @type {\"default\" | \"positive\" | \"warning\" | \"danger\"}\n * @attr\n * @default \"default\"\n */\n @property({ reflect: true })\n color: UUIInterfaceColor = 'default';\n\n /**\n * Makes the left and right padding of the button narrower.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n compact = false;\n\n /**\n * Sets the state of the button. With waiting state a loader will show, the success and fail states display icons. State is automatically reset to the default after 3 seconds.\n * @type {undefined |'waiting' | 'success' | 'failed'}\n * @attr\n * @default undefined\n */\n @property({ type: String, reflect: true })\n state: UUIButtonState = undefined;\n\n /**\n * Set an href, this will turns the button into a anchor tag.\n * @type {string}\n * @attr\n * @default undefined\n */\n @property({ type: String })\n public href?: string;\n\n /**\n * Set an anchor tag target, only used when using href.\n * @type {string}\n * @attr\n * @default undefined\n */\n @property({ type: String })\n public target?: '_blank' | '_parent' | '_self' | '_top';\n\n /**\n * Set the rel attribute for an anchor tag, only used when using href.\n * @type {string}\n * @attr\n * @default undefined\n */\n @property({ type: String })\n public rel?: string;\n\n /**\n * Sets the title attribute, which provides a tooltip for both button and anchor elements.\n * @type {string}\n * @attr\n * @default ''\n */\n @property({ type: String })\n public title: string = '';\n\n @query('#button')\n protected readonly _button!: HTMLInputElement;\n\n constructor() {\n super();\n this.addEventListener('click', this._onHostClick);\n }\n\n protected getFormElement(): HTMLElement {\n return this._button;\n }\n\n async focus() {\n await this.updateComplete;\n this._button.focus();\n }\n async blur() {\n await this.updateComplete;\n this._button.blur();\n }\n async click() {\n await this.updateComplete;\n this._button.click();\n }\n\n private _onHostClick(e: MouseEvent) {\n if (this.disabled) {\n e.preventDefault();\n e.stopImmediatePropagation();\n return;\n }\n\n if (this._internals?.form) {\n switch (this.type) {\n case 'reset':\n this._internals.form.reset();\n break;\n case 'button':\n break;\n default:\n this.submit();\n break;\n }\n }\n\n this._togglePopover();\n }\n\n #resetStateTimeout?: number;\n\n // Reset the state after 2sec if it is 'success' or 'failed'.\n updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('state')) {\n clearTimeout(this.#resetStateTimeout);\n if (this.state === 'success' || this.state === 'failed') {\n this.#resetStateTimeout = setTimeout(\n () => (this.state = undefined),\n 2000,\n ) as any;\n }\n }\n }\n\n protected renderState(): TemplateResult | typeof nothing {\n let element: TemplateResult;\n switch (this.state) {\n case 'waiting':\n element = html`<uui-loader-circle id=\"loader\"></uui-loader-circle>`;\n break;\n case 'success':\n element = html`<uui-icon\n name=\"check\"\n .fallback=${iconCheck.strings[0]}></uui-icon>`;\n break;\n case 'failed':\n element = html`<uui-icon\n name=\"wrong\"\n .fallback=${iconWrong.strings[0]}></uui-icon>`;\n break;\n default:\n return nothing;\n }\n\n return html`<div id=\"state\">${element}</div>`;\n }\n\n render() {\n if (this.href) {\n const rel =\n this.rel ||\n (this.target === '_blank' ? 'noopener noreferrer' : undefined);\n return html`\n <a\n id=\"button\"\n aria-label=${ifDefined(this.label)}\n title=${ifDefined(this.title === '' ? undefined : this.title)}\n href=${ifDefined(this.disabled ? undefined : this.href)}\n target=${ifDefined(this.target || undefined)}\n rel=${ifDefined(rel)}>\n ${this.renderState()} ${this.renderLabel()}\n <slot name=\"extra\"></slot>\n </a>\n `;\n }\n return html`\n <button\n id=\"button\"\n type=${this.type}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(this.label)}\n title=${ifDefined(this.title === '' ? undefined : this.title)}>\n ${this.renderState()} ${this.renderLabel()}\n <slot name=\"extra\"></slot>\n </button>\n `;\n }\n\n static override readonly styles = [\n UUIHorizontalShakeKeyframes,\n css`\n :host {\n position: relative;\n display: inline-flex;\n margin-left: calc(var(--uui-button-merge-border-left, 0) * -1px);\n --uui-button-padding-left-factor: 3;\n --uui-button-padding-right-factor: 3;\n --uui-button-padding-top-factor: 1;\n --uui-button-padding-bottom-factor: 1;\n\n min-height: var(--uui-button-height, var(--uui-size-11));\n max-height: 100%;\n cursor: pointer;\n\n text-align: center;\n font-size: var(--uui-button-font-size, inherit);\n font-weight: var(--uui-button-font-weight, 400);\n transition:\n background-color 80ms,\n border-color 80ms,\n color 80ms;\n }\n\n :host([compact]) {\n --uui-button-padding-left-factor: 1;\n --uui-button-padding-right-factor: 1;\n --uui-button-padding-top-factor: 0;\n --uui-button-padding-bottom-factor: 0;\n }\n\n .label {\n line-height: 1; /** needed to reset 'a > span' */\n transition: opacity 120ms;\n display: flex;\n gap: var(--uui-size-1);\n align-items: center;\n }\n\n :host([state]:not([state=''])) .label {\n opacity: 0;\n }\n\n #state {\n position: absolute;\n opacity: 0;\n animation-name: fadeIn;\n animation-delay: 40ms;\n animation-duration: 360ms;\n animation-fill-mode: forwards;\n display: flex;\n justify-content: center;\n width: 100%;\n height: 100%;\n align-items: center;\n }\n\n #button {\n width: 100%;\n background-color: transparent;\n color: inherit;\n font-size: inherit;\n border-radius: inherit;\n font-family: inherit;\n font-weight: inherit;\n text-align: inherit;\n border: none;\n cursor: inherit;\n\n display: inline-flex;\n align-items: center;\n justify-content: var(--uui-button-content-align, center);\n\n /* for anchor tag: */\n text-decoration: none;\n color: currentColor;\n line-height: inherit;\n\n border-width: var(--uui-button-border-width, 1px);\n border-style: solid;\n border-radius: var(\n --uui-button-border-radius,\n var(--uui-border-radius-3)\n );\n cursor: pointer;\n\n padding: calc(var(--uui-size-2) * var(--uui-button-padding-top-factor))\n calc(var(--uui-size-2) * var(--uui-button-padding-right-factor))\n calc(var(--uui-size-2) * var(--uui-button-padding-bottom-factor))\n calc(var(--uui-size-2) * var(--uui-button-padding-left-factor));\n\n box-shadow: none;\n\n transition: var(--uui-button-transition, none);\n }\n\n #button:focus-visible {\n outline: 2px solid\n var(\n --uui-focus-outline-color,\n var(--color-emphasis, var(--uui-color-focus))\n );\n }\n\n button[disabled]:active,\n a:not([href]):active {\n animation: ${UUIHorizontalShakeAnimationValue};\n }\n\n /* ANIMATIONS */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n #icon-check,\n #icon-wrong {\n display: grid;\n place-items: center;\n width: 1.5em;\n }\n\n #loader {\n font-size: 1.5em;\n }\n :host([look]:not([look=''])) #loader {\n color: inherit;\n }\n\n /* edge case for default color */\n :host(:not([color]):not([look='primary'])),\n :host([color='']:not([look='primary'])),\n :host([color='default']:not([look='primary'])) {\n --uui-button-contrast-hover: var(--uui-color-default-emphasis);\n }\n\n :host([color='warning'][look='outline']) #button,\n :host([color='warning'][look='placeholder']) #button {\n --uui-button-contrast-hover: var(--color-standalone);\n }\n\n /** Button color attribute: */\n #button {\n --color: var(--uui-color-default);\n --color-standalone: var(--uui-color-default-standalone);\n --color-emphasis: var(--uui-color-default-emphasis);\n --color-contrast: var(--uui-color-default-contrast);\n }\n :host([color='positive']) #button {\n --color: var(--uui-color-positive);\n --color-standalone: var(--uui-color-positive-standalone);\n --color-emphasis: var(--uui-color-positive-emphasis);\n --color-contrast: var(--uui-color-positive-contrast);\n }\n :host([color='warning']) #button {\n --color: var(--uui-color-warning);\n --color-standalone: var(--uui-color-warning-standalone);\n --color-emphasis: var(--uui-color-warning-emphasis);\n --color-contrast: var(--uui-color-warning-contrast);\n }\n :host([color='danger']) #button {\n --color: var(--uui-color-danger);\n --color-standalone: var(--uui-color-danger-standalone);\n --color-emphasis: var(--uui-color-danger-emphasis);\n --color-contrast: var(--uui-color-danger-contrast);\n }\n :host([color='invalid']) #button {\n --color: var(--uui-color-invalid);\n --color-standalone: var(--uui-color-invalid-standalone);\n --color-emphasis: var(--uui-color-invalid-emphasis);\n --color-contrast: var(--uui-color-invalid-contrast);\n }\n :host([disabled]) #button {\n --color: var(--uui-color-disabled);\n --color-standalone: var(--uui-color-disabled-contrast);\n --color-emphasis: var(--uui-color-disabled);\n --color-contrast: var(--uui-color-disabled-contrast);\n\n cursor: default;\n }\n\n /** Button look attribute: */\n /* DEFAULT */\n #button {\n background-color: var(--uui-button-background-color, transparent);\n color: var(--uui-button-contrast, var(--color-standalone));\n border-color: var(--uui-button-border-color, transparent);\n }\n :host(:not([disabled]):hover) #button {\n background-color: var(\n --uui-button-background-color-hover,\n var(--uui-color-surface-emphasis)\n );\n color: var(--uui-button-contrast-hover, var(--color-standalone));\n border-color: var(--uui-button-border-color-hover, transparent);\n }\n :host([disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n transparent\n );\n color: var(--uui-button-contrast-disabled, var(--color-contrast));\n border-color: var(--uui-button-border-color-disabled, transparent);\n }\n\n /* PRIMARY */\n :host([look='primary']) #button {\n background-color: var(--uui-button-background-color, var(--color));\n color: var(--uui-button-contrast, var(--color-contrast));\n border-color: var(--uui-button-border-color, transparent);\n\n /* special for primary: */\n font-weight: var(--uui-button-font-weight, 400);\n }\n\n :host([look='primary']:hover) #button {\n background-color: var(\n --uui-button-background-color-hover,\n var(--color-emphasis)\n );\n color: var(--uui-button-contrast-hover, var(--color-contrast));\n border-color: var(--uui-button-border-color-hover, transparent);\n }\n\n /* special outline offset tof primary style so you can see the outline */\n :host([look='primary']) #button:focus-visible {\n outline-offset: 2px;\n }\n\n :host([look='primary'][disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n var(--color)\n );\n color: var(--uui-button-contrast-disabled, var(--color-contrast));\n border-color: var(--uui-button-border-color-disabled, var(--color));\n }\n /* SECONDARY */\n :host([look='secondary']) #button {\n background-color: var(\n --uui-button-background-color,\n var(--uui-color-surface-alt)\n );\n color: var(--uui-button-contrast, var(--color-standalone));\n border-color: var(--uui-button-border-color, transparent);\n\n /* special for secondary: */\n font-weight: var(--uui-button-font-weight, 400);\n }\n :host([look='secondary']:hover) #button {\n background-color: var(\n --uui-button-background-color-hover,\n var(--uui-color-surface-emphasis)\n );\n color: var(--uui-button-contrast-hover, var(--color-standalone));\n border-color: var(--uui-button-border-color-hover, transparent);\n }\n :host([look='secondary'][disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n var(--color)\n );\n color: var(--uui-button-contrast-disabled, var(--color-contrast));\n border-color: var(--uui-button-border-color-disabled, var(--color));\n }\n\n /* OUTLINE */\n :host([look='outline']) #button {\n background-color: var(--uui-button-background-color, transparent);\n color: var(--uui-button-contrast, var(--color-standalone));\n border-color: var(\n --uui-button-border-color,\n var(--uui-color-border-standalone)\n );\n\n /* special for outline: */\n font-weight: var(--uui-button-font-weight, 400);\n }\n :host([look='outline']:not([disabled]):hover) #button {\n background-color: var(--uui-button-background-color-hover, transparent);\n color: var(--uui-button-contrast-hover, var(--color-standalone));\n border-color: var(--uui-button-border-color-hover);\n }\n :host([look='outline'][disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n transparent\n );\n color: var(--uui-button-contrast-disabled, var(--color-standalone));\n border-color: var(\n --uui-button-border-color-disabled,\n var(--color-standalone)\n );\n }\n\n /* PLACEHOLDER */\n :host([look='placeholder']) #button {\n border-style: dashed;\n background-color: var(--uui-button-background-color, transparent);\n color: var(--uui-button-contrast, var(--color-standalone));\n border-color: var(\n --uui-button-border-color,\n var(--uui-color-border-standalone)\n );\n }\n :host([look='placeholder']:not([disabled]):hover) #button {\n background-color: var(--uui-button-background-color-hover, transparent);\n color: var(--uui-button-contrast-hover, var(--color-standalone));\n border-color: var(--uui-button-border-color-hover);\n }\n :host([look='placeholder'][disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n var(--color)\n );\n color: var(--uui-button-contrast-disabled, var(--color-standalone));\n border-color: var(\n --uui-button-border-color-disabled,\n var(--color-standalone)\n );\n }\n `,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDO,MAAM,oBAA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A,MAAA;AASA,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAxEf,iBAyEJ,WAAA,QAAA;AASA,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAjFf,iBAkFJ,WAAA,KAAA;AASA,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA1Ff,iBA2FJ,WAAA,OAAA;AAGY,gBAAA;AAAA,EADlB,MAAM,SAAS;AAAA,GA7FL,iBA8FQ,WAAA,SAAA;"}
1
+ {"version":3,"file":"button.element.js","sources":["../../../src/components/button/button.element.ts"],"sourcesContent":["import {\n UUIHorizontalShakeAnimationValue,\n UUIHorizontalShakeKeyframes,\n} from '../../internal/animations/index.js';\nimport {\n LabelMixin,\n PopoverTargetMixin,\n UUIFormControlWithBasicsMixin,\n} from '../../internal/mixins/index.js';\nimport { iconCheck, iconWrong } from '../icon-registry-essential/svgs/index.js';\nimport type {\n UUIInterfaceColor,\n UUIInterfaceLook,\n} from '../../internal/types/index.js';\nimport type { TemplateResult } from 'lit';\nimport { css, html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport '../icon/icon.js';\nimport '../loader-circle/loader-circle.js';\n\nexport type UUIButtonState = undefined | 'waiting' | 'success' | 'failed';\n\nexport type UUIButtonType = 'submit' | 'button' | 'reset';\n\n/**\n * @element uui-button\n * @fires {UUIButtonEvent} click - fires when the element is clicked\n * @slot - for default content\n * @slot label - for label content\n * @slot extra - for extra\n * @property {string} label - label to be used for aria-label and potentially as visual label for some components\n * @attribute label - label to be used for aria-label and potentially as visual label for some components\n * @description - All-around button\n * @cssprop --uui-button-height - overwrite the button height\n * @cssprop --uui-button-border-width - overwrite the border width\n * @cssprop --uui-button-border-radius - overwrite the border radius\n * @cssprop --uui-button-font-weight - overwrite the font weight\n * @cssprop --uui-button-font-size - overwrite the font size\n * @cssprop --uui-button-background-color - overwrite the background color\n * @cssprop --uui-button-background-color-hover - overwrite the background color for hover state\n * @cssprop --uui-button-background-color-disabled - overwrite the background color for disabled state\n * @cssprop --uui-button-border-color - overwrite the border color\n * @cssprop --uui-button-border-color-hover - overwrite the border color for hover state\n * @cssprop --uui-button-border-color-disabled - overwrite the border color for disabled state\n * @cssprop --uui-button-contrast - overwrite the text color\n * @cssprop --uui-button-contrast-hover - overwrite the text color for hover state\n * @cssprop --uui-button-contrast-disabled - overwrite the text color for disabled state\n * @cssprop --uui-button-content-align - Overwrite justify-content alignment. Possible values: 'left', 'right', 'center'.\n * @cssprop --uui-focus-outline-color - overwrite the focus outline color\n */\nexport class UUIButtonElement extends UUIFormControlWithBasicsMixin(\n LabelMixin('', PopoverTargetMixin(LitElement)),\n) {\n /**\n * Specifies the type of button\n * @type {\"submit\" | \"button\" | \"reset\"}\n * @attr\n * @default \"button\"\n */\n @property({ type: String, reflect: true })\n type: UUIButtonType = 'button';\n\n /**\n * Disables the button, changes the looks of it and prevents if from emitting the click event\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Changes the look of the button to one of the predefined, symbolic looks. For example - set this to positive if you want nice, green \"confirm\" button.\n * @type {\"default\" | \"primary\" | \"secondary\" | \"outline\" | \"placeholder\"}\n * @attr\n * @default \"default\"\n */\n @property({ reflect: true })\n look: UUIInterfaceLook = 'default';\n\n /**\n * Changes the look of the button to one of the predefined, symbolic looks. For example - set this to positive if you want nice, green \"confirm\" button.\n * @type {\"default\" | \"positive\" | \"warning\" | \"danger\"}\n * @attr\n * @default \"default\"\n */\n @property({ reflect: true })\n color: UUIInterfaceColor = 'default';\n\n /**\n * Makes the left and right padding of the button narrower.\n * @type {boolean}\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n compact = false;\n\n /**\n * Sets the state of the button. With waiting state a loader will show, the success and fail states display icons. State is automatically reset to the default after 3 seconds.\n * @type {undefined |'waiting' | 'success' | 'failed'}\n * @attr\n * @default undefined\n */\n @property({ type: String, reflect: true })\n state: UUIButtonState = undefined;\n\n /**\n * Set an href, this will turns the button into a anchor tag.\n * @type {string}\n * @attr\n * @default undefined\n */\n @property({ type: String })\n public href?: string;\n\n /**\n * Set an anchor tag target, only used when using href.\n * @type {string}\n * @attr\n * @default undefined\n */\n @property({ type: String })\n public target?: '_blank' | '_parent' | '_self' | '_top';\n\n /**\n * Set the rel attribute for an anchor tag, only used when using href.\n * @type {string}\n * @attr\n * @default undefined\n */\n @property({ type: String })\n public rel?: string;\n\n /**\n * Sets the title attribute, which provides a tooltip for both button and anchor elements.\n * @type {string}\n * @attr\n * @default ''\n */\n @property({ type: String })\n public title: string = '';\n\n @query('#button')\n protected readonly _button!: HTMLInputElement;\n\n constructor() {\n super();\n this.addEventListener('click', this._onHostClick);\n }\n\n protected getFormElement(): HTMLElement {\n return this._button;\n }\n\n async focus() {\n await this.updateComplete;\n this._button.focus();\n }\n async blur() {\n await this.updateComplete;\n this._button.blur();\n }\n async click() {\n await this.updateComplete;\n this._button.click();\n }\n\n private _onHostClick(e: MouseEvent) {\n if (this.disabled) {\n e.preventDefault();\n e.stopImmediatePropagation();\n return;\n }\n\n if (this._internals?.form) {\n switch (this.type) {\n case 'reset':\n this._internals.form.reset();\n break;\n case 'button':\n break;\n default:\n this.submit();\n break;\n }\n }\n\n this._togglePopover();\n }\n\n #resetStateTimeout?: number;\n\n // Reset the state after 2sec if it is 'success' or 'failed'.\n updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('state')) {\n clearTimeout(this.#resetStateTimeout);\n if (this.state === 'success' || this.state === 'failed') {\n this.#resetStateTimeout = setTimeout(\n () => (this.state = undefined),\n 2000,\n ) as any;\n }\n }\n }\n\n protected renderState(): TemplateResult | typeof nothing {\n let element: TemplateResult;\n switch (this.state) {\n case 'waiting':\n element = html`<uui-loader-circle id=\"loader\"></uui-loader-circle>`;\n break;\n case 'success':\n element = html`<uui-icon\n name=\"check\"\n .fallback=${iconCheck.strings[0]}></uui-icon>`;\n break;\n case 'failed':\n element = html`<uui-icon\n name=\"wrong\"\n .fallback=${iconWrong.strings[0]}></uui-icon>`;\n break;\n default:\n return nothing;\n }\n\n return html`<div id=\"state\">${element}</div>`;\n }\n\n render() {\n if (this.href) {\n const rel =\n this.rel ||\n (this.target === '_blank' ? 'noopener noreferrer' : undefined);\n return html`\n <a\n id=\"button\"\n aria-label=${ifDefined(\n this.getAttribute('aria-label') || this.label || undefined,\n )}\n aria-labelledby=${ifDefined(\n this.getAttribute('aria-labelledby') || undefined,\n )}\n title=${ifDefined(this.title === '' ? undefined : this.title)}\n href=${ifDefined(this.disabled ? undefined : this.href)}\n target=${ifDefined(this.target || undefined)}\n rel=${ifDefined(rel)}>\n ${this.renderState()} ${this.renderLabel()}\n <slot name=\"extra\"></slot>\n </a>\n `;\n }\n return html`\n <button\n id=\"button\"\n type=${this.type}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(\n this.getAttribute('aria-label') || this.label || undefined,\n )}\n aria-labelledby=${ifDefined(\n this.getAttribute('aria-labelledby') || undefined,\n )}\n title=${ifDefined(this.title === '' ? undefined : this.title)}>\n ${this.renderState()} ${this.renderLabel()}\n <slot name=\"extra\"></slot>\n </button>\n `;\n }\n\n static override readonly styles = [\n UUIHorizontalShakeKeyframes,\n css`\n :host {\n position: relative;\n display: inline-flex;\n margin-left: calc(var(--uui-button-merge-border-left, 0) * -1px);\n --uui-button-padding-left-factor: 3;\n --uui-button-padding-right-factor: 3;\n --uui-button-padding-top-factor: 1;\n --uui-button-padding-bottom-factor: 1;\n\n min-height: var(--uui-button-height, var(--uui-size-11));\n max-height: 100%;\n cursor: pointer;\n\n text-align: center;\n font-size: var(--uui-button-font-size, inherit);\n font-weight: var(--uui-button-font-weight, 400);\n transition:\n background-color 80ms,\n border-color 80ms,\n color 80ms;\n }\n\n :host([compact]) {\n --uui-button-padding-left-factor: 1;\n --uui-button-padding-right-factor: 1;\n --uui-button-padding-top-factor: 0;\n --uui-button-padding-bottom-factor: 0;\n }\n\n .label {\n line-height: 1; /** needed to reset 'a > span' */\n transition: opacity 120ms;\n display: flex;\n gap: var(--uui-size-1);\n align-items: center;\n }\n\n :host([state]:not([state=''])) .label {\n opacity: 0;\n }\n\n #state {\n position: absolute;\n opacity: 0;\n animation-name: fadeIn;\n animation-delay: 40ms;\n animation-duration: 360ms;\n animation-fill-mode: forwards;\n display: flex;\n justify-content: center;\n width: 100%;\n height: 100%;\n align-items: center;\n }\n\n #button {\n width: 100%;\n background-color: transparent;\n color: inherit;\n font-size: inherit;\n border-radius: inherit;\n font-family: inherit;\n font-weight: inherit;\n text-align: inherit;\n border: none;\n cursor: inherit;\n\n display: inline-flex;\n align-items: center;\n justify-content: var(--uui-button-content-align, center);\n\n /* for anchor tag: */\n text-decoration: none;\n color: currentColor;\n line-height: inherit;\n\n border-width: var(--uui-button-border-width, 1px);\n border-style: solid;\n border-radius: var(\n --uui-button-border-radius,\n var(--uui-border-radius-3)\n );\n cursor: pointer;\n\n padding: calc(var(--uui-size-2) * var(--uui-button-padding-top-factor))\n calc(var(--uui-size-2) * var(--uui-button-padding-right-factor))\n calc(var(--uui-size-2) * var(--uui-button-padding-bottom-factor))\n calc(var(--uui-size-2) * var(--uui-button-padding-left-factor));\n\n box-shadow: none;\n\n transition:\n background-color 60ms,\n color 60ms,\n border-color 60ms;\n }\n\n #button:focus-visible {\n outline: 2px solid\n var(\n --uui-focus-outline-color,\n var(--color-emphasis, var(--uui-color-focus))\n );\n }\n\n button[disabled]:active,\n a:not([href]):active {\n animation: ${UUIHorizontalShakeAnimationValue};\n }\n\n /* ANIMATIONS */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n #icon-check,\n #icon-wrong {\n display: grid;\n place-items: center;\n width: 1.5em;\n }\n\n #loader {\n font-size: 1.5em;\n }\n :host([look]:not([look=''])) #loader {\n color: inherit;\n }\n\n /* edge case for default color */\n :host(:not([color]):not([look='primary'])),\n :host([color='']:not([look='primary'])),\n :host([color='default']:not([look='primary'])) {\n --uui-button-contrast-hover: var(--uui-color-default-emphasis);\n }\n\n :host([color='warning'][look='outline']) #button,\n :host([color='warning'][look='placeholder']) #button {\n --uui-button-contrast-hover: var(--color-standalone);\n }\n\n /** Button color attribute: */\n #button {\n --color: var(--uui-color-interactive);\n --color-standalone: var(--uui-color-interactive);\n --color-emphasis: var(--uui-color-interactive-emphasis);\n --color-contrast: var(--uui-color-interactive-contrast);\n }\n /* PRIMARY — DEFAULT */\n :host([look='primary']:not([color])) #button,\n :host([look='primary'][color='']) #button,\n :host([look='primary'][color='default']) #button {\n --color: var(--uui-color-default);\n --color-standalone: var(--uui-color-default-standalone);\n --color-emphasis: var(--uui-color-default-emphasis);\n --color-contrast: var(--uui-color-default-contrast);\n }\n :host([color='positive']) #button {\n --color: var(--uui-color-positive);\n --color-standalone: var(--uui-color-positive-standalone);\n --color-emphasis: var(--uui-color-positive-emphasis);\n --color-contrast: var(--uui-color-positive-contrast);\n }\n :host([color='warning']) #button {\n --color: var(--uui-color-warning);\n --color-standalone: var(--uui-color-warning-standalone);\n --color-emphasis: var(--uui-color-warning-emphasis);\n --color-contrast: var(--uui-color-warning-contrast);\n }\n :host([color='danger']) #button {\n --color: var(--uui-color-danger);\n --color-standalone: var(--uui-color-danger-standalone);\n --color-emphasis: var(--uui-color-danger-emphasis);\n --color-contrast: var(--uui-color-danger-contrast);\n }\n :host([color='invalid']) #button {\n --color: var(--uui-color-invalid);\n --color-standalone: var(--uui-color-invalid-standalone);\n --color-emphasis: var(--uui-color-invalid-emphasis);\n --color-contrast: var(--uui-color-invalid-contrast);\n }\n :host([disabled]) #button {\n --color: var(--uui-color-disabled);\n --color-standalone: var(--uui-color-disabled-contrast);\n --color-emphasis: var(--uui-color-disabled);\n --color-contrast: var(--uui-color-disabled-contrast);\n\n cursor: default;\n }\n\n /** Button look attribute: */\n /* DEFAULT */\n #button {\n background-color: var(--uui-button-background-color, transparent);\n color: var(--uui-button-contrast, var(--color-standalone));\n border-color: var(--uui-button-border-color, transparent);\n }\n :host(:not([disabled]):hover) #button {\n background-color: var(--uui-button-background-color-hover, transparent);\n color: var(--uui-button-contrast-hover, var(--color-standalone));\n border-color: var(--uui-button-border-color-hover, transparent);\n }\n :host([disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n transparent\n );\n color: var(--uui-button-contrast-disabled, var(--color-contrast));\n border-color: var(--uui-button-border-color-disabled, transparent);\n }\n\n /* PRIMARY */\n :host([look='primary']) #button {\n background-color: var(--uui-button-background-color, var(--color));\n color: var(--uui-button-contrast, var(--color-contrast));\n border-color: var(--uui-button-border-color, transparent);\n /** makes font slightly bolder */\n text-shadow: 0 0 currentColor;\n }\n\n :host([look='primary']:hover) #button {\n background-color: var(\n --uui-button-background-color-hover,\n var(--color-emphasis)\n );\n color: var(--uui-button-contrast-hover, var(--color-contrast));\n border-color: var(--uui-button-border-color-hover, transparent);\n }\n\n /* special outline offset tof primary style so you can see the outline */\n :host([look='primary']) #button:focus-visible {\n outline-offset: 2px;\n }\n\n :host([look='primary'][disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n var(--color)\n );\n color: var(--uui-button-contrast-disabled, var(--color-contrast));\n border-color: var(--uui-button-border-color-disabled, var(--color));\n }\n\n /* SECONDARY */\n :host([look='secondary']) #button {\n background-color: var(\n --uui-button-background-color,\n var(--uui-color-surface-alt)\n );\n color: var(--uui-button-contrast, var(--color-standalone));\n border-color: var(--uui-button-border-color, transparent);\n /** makes font slightly bolder */\n text-shadow: 0 0 currentColor;\n }\n :host([look='secondary']:hover) #button {\n background-color: var(\n --uui-button-background-color-hover,\n var(--uui-color-surface-emphasis)\n );\n color: var(--uui-button-contrast-hover, var(--color-standalone));\n border-color: var(--uui-button-border-color-hover, transparent);\n }\n :host([look='secondary'][disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n var(--color)\n );\n color: var(--uui-button-contrast-disabled, var(--color-contrast));\n border-color: var(--uui-button-border-color-disabled, var(--color));\n }\n\n /* OUTLINE */\n :host([look='outline']) #button {\n background-color: var(--uui-button-background-color, transparent);\n color: var(--uui-button-contrast, var(--color-standalone));\n border-color: var(\n --uui-button-border-color,\n var(--uui-color-border-standalone)\n );\n }\n :host([look='outline']:not([disabled]):hover) #button {\n background-color: var(--uui-button-background-color-hover, transparent);\n color: var(--uui-button-contrast-hover, var(--color-standalone));\n border-color: var(--uui-button-border-color-hover);\n }\n :host([look='outline'][disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n transparent\n );\n color: var(--uui-button-contrast-disabled, var(--color-standalone));\n border-color: var(\n --uui-button-border-color-disabled,\n var(--color-standalone)\n );\n }\n\n /* PLACEHOLDER */\n :host([look='placeholder']) #button {\n border-style: dashed;\n background-color: var(--uui-button-background-color, transparent);\n color: var(--uui-button-contrast, var(--color-standalone));\n border-color: var(\n --uui-button-border-color,\n var(--uui-color-border-standalone)\n );\n }\n :host([look='placeholder']:not([disabled]):hover) #button {\n background-color: var(--uui-button-background-color-hover, transparent);\n color: var(--uui-button-contrast-hover, var(--color-standalone));\n border-color: var(--uui-button-border-color-hover);\n }\n :host([look='placeholder'][disabled]) #button {\n background-color: var(\n --uui-button-background-color-disabled,\n var(--color)\n );\n color: var(--uui-button-contrast-disabled, var(--color-standalone));\n border-color: var(\n --uui-button-border-color-disabled,\n var(--color-standalone)\n );\n }\n `,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDO,MAAM,oBAAN,MAAM,0BAAyB;AAAA,EACpC,WAAW,IAAI,mBAAmB,UAAU,CAAC;AAC/C,EAAE;AAAA,EA8FA,cAAc;AACZ,UAAA;AA4CF;AAnIA,SAAA,OAAsB;AAStB,SAAA,W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BAuDX,WAAA,OAAA;AASO,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Df,iBAgEJ,WAAA,MAAA;AASA,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAxEf,iBAyEJ,WAAA,QAAA;AASA,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAjFf,iBAkFJ,WAAA,KAAA;AASA,gBAAA;AAAA,EADN,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA1Ff,iBA2FJ,WAAA,OAAA;AAGY,gBAAA;AAAA,EADlB,MAAM,SAAS;AAAA,GA7FL,iBA8FQ,WAAA,SAAA;"}
@@ -93,6 +93,15 @@ _UUICardBlockTypeElement.styles = [
93
93
  background-color: var(--uui-color-surface-alt);
94
94
  }
95
95
 
96
+ slot:not([name]) {
97
+ display: flex;
98
+ justify-content: center;
99
+ align-items: center;
100
+ width: 100%;
101
+ overflow: clip;
102
+ border-radius: calc(var(--uui-border-radius-2) - 1px);
103
+ }
104
+
96
105
  slot[name='tag'] {
97
106
  position: absolute;
98
107
  bottom: var(--uui-size-4);
@@ -104,8 +113,8 @@ _UUICardBlockTypeElement.styles = [
104
113
 
105
114
  slot[name='actions'] {
106
115
  position: absolute;
107
- top: var(--uui-size-4);
108
- right: var(--uui-size-4);
116
+ top: var(--uui-size-space-3);
117
+ right: var(--uui-size-space-3);
109
118
  display: flex;
110
119
  justify-content: right;
111
120
  z-index: 2;
@@ -129,7 +138,6 @@ _UUICardBlockTypeElement.styles = [
129
138
 
130
139
  slot:not([name])::slotted(*) {
131
140
  align-self: center;
132
- border-radius: var(--uui-border-radius-2);
133
141
  object-fit: cover;
134
142
  max-width: 100%;
135
143
  max-height: 100%;
@@ -195,7 +203,8 @@ _UUICardBlockTypeElement.styles = [
195
203
  inset: 0;
196
204
  z-index: -1;
197
205
  border-top: 1px solid var(--uui-color-divider);
198
- border-radius: 0 0 var(--uui-border-radius-2) var(--uui-border-radius-2);
206
+ border-radius: 0 0 calc(var(--uui-border-radius-2) - 1px)
207
+ calc(var(--uui-border-radius-2) - 1px);
199
208
  background-color: var(--uui-color-surface);
200
209
  pointer-events: none;
201
210
  opacity: 0.96;
@@ -1 +1 @@
1
- {"version":3,"file":"card-block-type.element.js","sources":["../../../src/components/card-block-type/card-block-type.element.ts"],"sourcesContent":["import { UUICardElement } from '../card/card.js';\nimport { css, html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nexport type BlockTypeIcon = {\n name?: string;\n color?: string;\n};\n\n/**\n * @element uui-card-block-type\n * @slot - slot for the default content area\n * @slot tag - slot for the tag with support for `<uui-tag>` elements\n * @slot actions - slot for the actions with support for the `<uui-action-bar>` element\n */\nexport class UUICardBlockTypeElement extends UUICardElement {\n /**\n * Block type name\n * @type {string}\n * @attr name\n * @default ''\n */\n @property({ type: String })\n name = '';\n\n /**\n * Block type description\n * @type {string}\n * @attr description\n * @default undefined\n */\n @property({ type: String })\n description?: string;\n\n @property({ type: String, attribute: 'background' })\n public get background(): string | undefined {\n return undefined;\n }\n public set background(value: string | undefined) {\n this.style.backgroundColor = value ?? '';\n }\n\n render() {\n return html`\n ${this.#renderMedia()}\n ${this.href ? this.#renderLink() : this.#renderButton()}\n <!-- Select border must be right after #open-part -->\n <div id=\"select-border\"></div>\n ${this.selectable ? this.renderCheckbox() : nothing}\n <slot name=\"tag\"></slot>\n <slot name=\"actions\"></slot>\n `;\n }\n\n #renderButton() {\n const tabIndex = !this.disabled ? (this.selectOnly ? -1 : 0) : undefined;\n return html`\n <button\n id=\"open-part\"\n class=\"uui-text\"\n tabindex=${ifDefined(tabIndex)}\n @click=${this.handleOpenClick}\n @keydown=${this.handleOpenKeydown}>\n ${this.#renderContent()}\n </button>\n `;\n }\n\n #renderLink() {\n const tabIndex = !this.disabled ? (this.selectOnly ? -1 : 0) : undefined;\n const rel = this.target === '_blank' ? 'noopener noreferrer' : undefined;\n return html`\n <a\n id=\"open-part\"\n class=\"uui-text\"\n tabindex=${ifDefined(tabIndex)}\n href=${ifDefined(!this.disabled ? this.href : undefined)}\n target=${ifDefined(this.target || undefined)}\n rel=${ifDefined(this.rel || rel)}>\n ${this.#renderContent()}\n </a>\n `;\n }\n\n #renderMedia() {\n return html`<div id=\"portrait\">\n <slot></slot>\n </div> `;\n }\n\n #renderContent() {\n return html`\n <div id=\"content\">\n <span title=\"${this.name}\" id=\"name\">${this.name}</span>\n <small title=\"${ifDefined(this.description)}\">${this.description}<slot name=\"description\"></slot></small>\n </div></div>\n `;\n }\n\n static override readonly styles = [\n ...UUICardElement.styles,\n css`\n :host {\n background-color: var(--uui-color-surface-alt);\n }\n\n slot[name='tag'] {\n position: absolute;\n bottom: var(--uui-size-4);\n right: var(--uui-size-4);\n display: flex;\n justify-content: right;\n z-index: 2;\n }\n\n slot[name='actions'] {\n position: absolute;\n top: var(--uui-size-4);\n right: var(--uui-size-4);\n display: flex;\n justify-content: right;\n z-index: 2;\n opacity: 0;\n transition: opacity 120ms;\n }\n :host(:focus) slot[name='actions'],\n :host(:focus-within) slot[name='actions'],\n :host(:hover) slot[name='actions'] {\n opacity: 1;\n }\n\n #portrait {\n display: flex;\n justify-content: center;\n min-height: 150px;\n max-height: 150px;\n width: 100%;\n margin-bottom: var(--uui-size-layout-2);\n }\n\n slot:not([name])::slotted(*) {\n align-self: center;\n border-radius: var(--uui-border-radius-2);\n object-fit: cover;\n max-width: 100%;\n max-height: 100%;\n font-size: var(--uui-size-8);\n }\n\n #open-part {\n position: absolute;\n z-index: 1;\n inset: 0;\n margin-bottom: 0;\n color: var(--uui-color-interactive);\n border: none;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n\n :host([disabled]) #open-part {\n pointer-events: none;\n background: var(--uui-color-disabled);\n color: var(--uui-color-contrast-disabled);\n }\n\n #open-part:hover {\n color: var(--uui-color-interactive-emphasis);\n }\n #open-part:hover #name {\n text-decoration: underline;\n }\n #open-part #name,\n #open-part small {\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n overflow-wrap: anywhere;\n }\n\n :host([image]:not([image=''])) #open-part {\n transition: opacity 0.5s 0.5s;\n opacity: 0;\n }\n\n #content {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n font-family: inherit;\n font-size: var(--uui-type-small-size);\n box-sizing: border-box;\n text-align: left;\n word-break: break-word;\n padding-top: var(--uui-size-space-3);\n }\n\n #content::before {\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n border-top: 1px solid var(--uui-color-divider);\n border-radius: 0 0 var(--uui-border-radius-2) var(--uui-border-radius-2);\n background-color: var(--uui-color-surface);\n pointer-events: none;\n opacity: 0.96;\n }\n\n :host(:focus) slot[name='actions'],\n :host(:focus-within) slot[name='actions'],\n :host(:hover) slot[name='actions'] {\n opacity: 1;\n }\n\n :host(\n [image]:not([image='']):hover,\n [image]:not([image='']):focus,\n [image]:not([image='']):focus-within,\n [selected][image]:not([image='']),\n [error][image]:not([image=''])\n )\n #open-part {\n opacity: 1;\n transition-duration: 120ms;\n transition-delay: 0s;\n }\n\n :host([selectable]) #open-part {\n inset: var(--uui-size-space-3) var(--uui-size-space-4);\n }\n :host(:not([selectable])) #content {\n padding: var(--uui-size-space-3) var(--uui-size-space-4);\n }\n :host([selectable]) #content::before {\n inset: calc(var(--uui-size-space-3) * -1)\n calc(var(--uui-size-space-4) * -1);\n top: 0;\n }\n `,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,2BAAN,MAAM,iCAAgC,eAAe;AAAA,EAArD,cAAA;AAAA,UAAA,GAAA,SAAA;AAAA;AAQL,SAAA,OAAO;AAAA,EAAA;AAAA,EAYP,IAAW,aAAiC;AAC1C,WAAO;AAAA,EACT;AAAA,EACA,IAAW,WAAW,OAA2B;AAC/C,SA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAtFG,IAAM,0BAAN;AAQL,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAPf,wBAQX,WAAA,QAAA,CAAA;AASA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAhBf,wBAiBX,WAAA,eAAA,CAAA;AAGW,gBAAA;AAAA,EADV,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,GAnBxC,wBAoBA,WAAA,cAAA,CAAA;"}
1
+ {"version":3,"file":"card-block-type.element.js","sources":["../../../src/components/card-block-type/card-block-type.element.ts"],"sourcesContent":["import { UUICardElement } from '../card/card.js';\nimport { css, html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nexport type BlockTypeIcon = {\n name?: string;\n color?: string;\n};\n\n/**\n * @element uui-card-block-type\n * @slot - slot for the default content area\n * @slot tag - slot for the tag with support for `<uui-tag>` elements\n * @slot actions - slot for the actions with support for the `<uui-action-bar>` element\n */\nexport class UUICardBlockTypeElement extends UUICardElement {\n /**\n * Block type name\n * @type {string}\n * @attr name\n * @default ''\n */\n @property({ type: String })\n name = '';\n\n /**\n * Block type description\n * @type {string}\n * @attr description\n * @default undefined\n */\n @property({ type: String })\n description?: string;\n\n @property({ type: String, attribute: 'background' })\n public get background(): string | undefined {\n return undefined;\n }\n public set background(value: string | undefined) {\n this.style.backgroundColor = value ?? '';\n }\n\n render() {\n return html`\n ${this.#renderMedia()}\n ${this.href ? this.#renderLink() : this.#renderButton()}\n <!-- Select border must be right after #open-part -->\n <div id=\"select-border\"></div>\n ${this.selectable ? this.renderCheckbox() : nothing}\n <slot name=\"tag\"></slot>\n <slot name=\"actions\"></slot>\n `;\n }\n\n #renderButton() {\n const tabIndex = !this.disabled ? (this.selectOnly ? -1 : 0) : undefined;\n return html`\n <button\n id=\"open-part\"\n class=\"uui-text\"\n tabindex=${ifDefined(tabIndex)}\n @click=${this.handleOpenClick}\n @keydown=${this.handleOpenKeydown}>\n ${this.#renderContent()}\n </button>\n `;\n }\n\n #renderLink() {\n const tabIndex = !this.disabled ? (this.selectOnly ? -1 : 0) : undefined;\n const rel = this.target === '_blank' ? 'noopener noreferrer' : undefined;\n return html`\n <a\n id=\"open-part\"\n class=\"uui-text\"\n tabindex=${ifDefined(tabIndex)}\n href=${ifDefined(!this.disabled ? this.href : undefined)}\n target=${ifDefined(this.target || undefined)}\n rel=${ifDefined(this.rel || rel)}>\n ${this.#renderContent()}\n </a>\n `;\n }\n\n #renderMedia() {\n return html`<div id=\"portrait\">\n <slot></slot>\n </div> `;\n }\n\n #renderContent() {\n return html`\n <div id=\"content\">\n <span title=\"${this.name}\" id=\"name\">${this.name}</span>\n <small title=\"${ifDefined(this.description)}\">${this.description}<slot name=\"description\"></slot></small>\n </div></div>\n `;\n }\n\n static override readonly styles = [\n ...UUICardElement.styles,\n css`\n :host {\n background-color: var(--uui-color-surface-alt);\n }\n\n slot:not([name]) {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n overflow: clip;\n border-radius: calc(var(--uui-border-radius-2) - 1px);\n }\n\n slot[name='tag'] {\n position: absolute;\n bottom: var(--uui-size-4);\n right: var(--uui-size-4);\n display: flex;\n justify-content: right;\n z-index: 2;\n }\n\n slot[name='actions'] {\n position: absolute;\n top: var(--uui-size-space-3);\n right: var(--uui-size-space-3);\n display: flex;\n justify-content: right;\n z-index: 2;\n opacity: 0;\n transition: opacity 120ms;\n }\n :host(:focus) slot[name='actions'],\n :host(:focus-within) slot[name='actions'],\n :host(:hover) slot[name='actions'] {\n opacity: 1;\n }\n\n #portrait {\n display: flex;\n justify-content: center;\n min-height: 150px;\n max-height: 150px;\n width: 100%;\n margin-bottom: var(--uui-size-layout-2);\n }\n\n slot:not([name])::slotted(*) {\n align-self: center;\n object-fit: cover;\n max-width: 100%;\n max-height: 100%;\n font-size: var(--uui-size-8);\n }\n\n #open-part {\n position: absolute;\n z-index: 1;\n inset: 0;\n margin-bottom: 0;\n color: var(--uui-color-interactive);\n border: none;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n\n :host([disabled]) #open-part {\n pointer-events: none;\n background: var(--uui-color-disabled);\n color: var(--uui-color-contrast-disabled);\n }\n\n #open-part:hover {\n color: var(--uui-color-interactive-emphasis);\n }\n #open-part:hover #name {\n text-decoration: underline;\n }\n #open-part #name,\n #open-part small {\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n overflow-wrap: anywhere;\n }\n\n :host([image]:not([image=''])) #open-part {\n transition: opacity 0.5s 0.5s;\n opacity: 0;\n }\n\n #content {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n font-family: inherit;\n font-size: var(--uui-type-small-size);\n box-sizing: border-box;\n text-align: left;\n word-break: break-word;\n padding-top: var(--uui-size-space-3);\n }\n\n #content::before {\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n border-top: 1px solid var(--uui-color-divider);\n border-radius: 0 0 calc(var(--uui-border-radius-2) - 1px)\n calc(var(--uui-border-radius-2) - 1px);\n background-color: var(--uui-color-surface);\n pointer-events: none;\n opacity: 0.96;\n }\n\n :host(:focus) slot[name='actions'],\n :host(:focus-within) slot[name='actions'],\n :host(:hover) slot[name='actions'] {\n opacity: 1;\n }\n\n :host(\n [image]:not([image='']):hover,\n [image]:not([image='']):focus,\n [image]:not([image='']):focus-within,\n [selected][image]:not([image='']),\n [error][image]:not([image=''])\n )\n #open-part {\n opacity: 1;\n transition-duration: 120ms;\n transition-delay: 0s;\n }\n\n :host([selectable]) #open-part {\n inset: var(--uui-size-space-3) var(--uui-size-space-4);\n }\n :host(:not([selectable])) #content {\n padding: var(--uui-size-space-3) var(--uui-size-space-4);\n }\n :host([selectable]) #content::before {\n inset: calc(var(--uui-size-space-3) * -1)\n calc(var(--uui-size-space-4) * -1);\n top: 0;\n }\n `,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,2BAAN,MAAM,iCAAgC,eAAe;AAAA,EAArD,cAAA;AAAA,UAAA,GAAA,SAAA;AAAA;AAQL,SAAA,OAAO;AAAA,EAAA;AAAA,EAYP,IAAW,aAAiC;AAC1C,WAAO;AAAA,EACT;AAAA,EACA,IAAW,WAAW,OAA2B;AAC/C,SAAK,MAAM,kBAAkB,SAAS;AAAA,EACxC;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,QACH,sBAAK,oDAAL,UAAmB;AAAA,QACnB,KAAK,OAAO,sBAAK,mDAAL,aAAqB,sBAAK,qDAAL,UAAoB;AAAA;AAAA;AA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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAtFG,IAAM,0BAAN;AAQL,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAPf,wBAQX,WAAA,QAAA,CAAA;AASA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAhBf,wBAiBX,WAAA,eAAA,CAAA;AAGW,gBAAA;AAAA,EADV,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,GAnBxC,wBAoBA,WAAA,cAAA,CAAA;"}
@@ -124,8 +124,8 @@ _UUICardContentNodeElement.styles = [
124
124
 
125
125
  slot[name='actions'] {
126
126
  position: absolute;
127
- top: var(--uui-size-4);
128
- right: var(--uui-size-4);
127
+ top: var(--uui-size-space-3);
128
+ right: var(--uui-size-space-3);
129
129
  display: flex;
130
130
  justify-content: right;
131
131