@statistikzh/leu 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI component library of the canton of zurich",
4
4
  "license": "MIT",
5
5
  "author": "statistikzh",
6
- "version": "0.5.0",
6
+ "version": "0.5.1",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "homepage": "https://github.com/statistikzh/leu/",
25
25
  "scripts": {
26
26
  "analyze": "cem analyze --config custom-elements-manifest.config.js",
27
- "build": "rimraf dist && npm run build:js && npm run build:types && npm run build:css",
27
+ "build": "rimraf dist && npm run build:js && npm run build:types && npm run build:css && npm run analyze",
28
28
  "build:js": "rollup -c rollup.config.js",
29
29
  "build:types": "tsc -p tsconfig.build.json",
30
30
  "build:css": "postcss src/styles/theme.css -o dist/theme.css && cp dist/theme.css .storybook/static/",
package/rollup.config.js CHANGED
@@ -29,7 +29,7 @@ export default {
29
29
  // - a capital letter
30
30
  // - or "leu-"
31
31
  input: {
32
- "index.js": "index.js",
32
+ index: "index.js",
33
33
  ...Object.fromEntries(
34
34
  globSync("src/components/*/{[A-Z],leu-}*.js", { nocase: false }).map(
35
35
  (file) => [
@@ -198,7 +198,7 @@ export class LeuButton extends LitElement {
198
198
  type=${this.type}
199
199
  >
200
200
  ${this.renderIconBefore()}
201
- <slot></slot>
201
+ <span class="label"><slot></slot></span>
202
202
  ${this.renderIconAfter()} ${this.renderExpandingIcon()}
203
203
  </button>
204
204
  `
@@ -10,11 +10,24 @@ button {
10
10
  cursor: pointer;
11
11
  border: 1px solid transparent;
12
12
  border-radius: 2px;
13
+
14
+ max-width: 100%;
13
15
  display: flex;
14
16
  align-items: center;
15
17
  column-gap: 8px;
16
18
  }
17
19
 
20
+ .label {
21
+ flex: 1 1 0;
22
+ overflow: hidden;
23
+ text-overflow: ellipsis;
24
+ white-space: nowrap;
25
+ }
26
+
27
+ .icon .label {
28
+ display: none;
29
+ }
30
+
18
31
  button.round {
19
32
  border-radius: 50%;
20
33
  }
@@ -84,6 +84,7 @@ export class LeuDropdown extends LitElement {
84
84
  autoSizePadding="8"
85
85
  >
86
86
  <leu-button
87
+ class="button"
87
88
  slot="anchor"
88
89
  icon="download"
89
90
  variant="ghost"
@@ -14,3 +14,7 @@
14
14
 
15
15
  margin-top: 0.5rem;
16
16
  }
17
+
18
+ .button {
19
+ max-width: 100%;
20
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js.d.ts","sourceRoot":"","sources":["index.js.js"],"names":[],"mappings":""}