@skf-design-system/ui-components 1.0.2-beta.22 → 1.0.2-beta.23

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.
@@ -3,8 +3,13 @@ const r = o`
3
3
  /* stylelint-disable selector-class-pattern */
4
4
  @layer components {
5
5
  :host {
6
- contain: initial;
7
- display: inline-flex;
6
+ contain: paint style;
7
+ display: inline-block;
8
+ }
9
+
10
+ :host(:not([icon-only])) {
11
+ max-inline-size: min(100%, 23ch);
12
+ min-inline-size: 64px;
8
13
  }
9
14
 
10
15
  .btn {
@@ -14,13 +19,13 @@ const r = o`
14
19
  var(--_skf-button-state-border-color, var(--_skf-button-border-color));
15
20
  border-radius: var(--skf-border-radius-sm);
16
21
  color: var(--_skf-button-state-color, var(--_skf-button-color));
22
+ display: inline-flex;
17
23
  font-size: var(--_skf-button-font-size, var(--skf-font-size-100));
18
24
  font-weight: var(--skf-font-weight-bold);
19
- max-inline-size: min(100%, 23ch);
20
25
  position: relative;
21
26
 
22
27
  &:not(.btn--icon-only) {
23
- min-inline-size: 64px;
28
+ inline-size: 100%;
24
29
  padding-inline: var(--skf-spacing-100);
25
30
  }
26
31
 
@@ -49,7 +54,6 @@ const r = o`
49
54
 
50
55
  .btn--icon-only {
51
56
  aspect-ratio: 1;
52
- display: inherit;
53
57
  place-content: center;
54
58
  }
55
59
 
@@ -118,6 +122,7 @@ const r = o`
118
122
  align-items: center;
119
123
  display: flex;
120
124
  gap: var(--skf-spacing-50);
125
+ min-inline-size: 0;
121
126
  }
122
127
 
123
128
  .btn__label {
@@ -107,6 +107,7 @@ export declare class SkfSelect extends FormBase {
107
107
  constructor();
108
108
  willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
109
109
  firstUpdated(): void;
110
+ /** @internal Handles updates to the size of the select-option component */
110
111
  _handleSizeUpdate(): void;
111
112
  /** @internal */
112
113
  _handleExpandedChange(): void;
@@ -122,8 +123,7 @@ export declare class SkfSelect extends FormBase {
122
123
  _handleReset: () => void;
123
124
  /** @internal */
124
125
  onUpdateComplete(): Promise<string>;
125
- /** @internal */
126
- /** Filter out elements other than skf-select-option and store in this._optionsList */
126
+ /** @internal Filter out elements other than skf-select-option and store in this._optionsList */
127
127
  _collectSlotOptionTags(): void;
128
128
  /** @internal */
129
129
  _updateWidth: () => void;
@@ -8,8 +8,8 @@ import "../tag/tag.js";
8
8
  import { computePosition as S, flip as C, shift as V, offset as $ } from "@floating-ui/dom";
9
9
  import { FormBase as L } from "../../internal/components/formBase.js";
10
10
  import "../../internal/components/hint/hint.js";
11
- import { PopoverController as k } from "../../internal/controllers/popover.controller.js";
12
- import { findMatchingTags as E } from "../../internal/helpers/findMatchingTags.js";
11
+ import { PopoverController as E } from "../../internal/controllers/popover.controller.js";
12
+ import { findMatchingTags as k } from "../../internal/helpers/findMatchingTags.js";
13
13
  import { hintSeverity as A } from "../../internal/helpers/hintSeverity.js";
14
14
  import { raiseError as I } from "../../internal/helpers/raiseError.js";
15
15
  import { watch as w } from "../../internal/helpers/watch.js";
@@ -17,22 +17,22 @@ import { Asterisk as D } from "../../internal/templates/asterisk.js";
17
17
  import { componentStyles as P } from "../../styles/component.styles.js";
18
18
  import { LocalizeController as F } from "../../utilities/localize.js";
19
19
  import { nothing as b, html as p } from "lit";
20
- import { property as a, state as c, query as m, queryAssignedElements as T } from "lit/decorators.js";
21
- import { classMap as z } from "lit/directives/class-map.js";
20
+ import { property as n, state as c, query as m, queryAssignedElements as T } from "lit/decorators.js";
21
+ import { classMap as U } from "lit/directives/class-map.js";
22
22
  import { ifDefined as O } from "lit/directives/if-defined.js";
23
- import { SkfSelectOption as U } from "./select-option.component.js";
24
- import { GlobalClickController as M, KeyboardNavigationController as N, DeveloperFeedbackController as H } from "./select.controllers.js";
25
- import { styles as q } from "./select.styles.js";
23
+ import { SkfSelectOption as z } from "./select-option.component.js";
24
+ import { GlobalClickController as M, KeyboardNavigationController as N, DeveloperFeedbackController as q } from "./select.controllers.js";
25
+ import { styles as H } from "./select.styles.js";
26
26
  var R = Object.defineProperty, j = Object.getOwnPropertyDescriptor, s = (l, r, t, e) => {
27
- for (var o = e > 1 ? void 0 : e ? j(r, t) : r, n = l.length - 1, h; n >= 0; n--)
28
- (h = l[n]) && (o = (e ? h(r, t, o) : h(o)) || o);
27
+ for (var o = e > 1 ? void 0 : e ? j(r, t) : r, a = l.length - 1, h; a >= 0; a--)
28
+ (h = l[a]) && (o = (e ? h(r, t, o) : h(o)) || o);
29
29
  return e && o && R(r, t, o), o;
30
30
  }, d;
31
31
  const f = class f extends L {
32
32
  constructor() {
33
33
  super();
34
34
  g(this, d);
35
- y(this, d, new F(this)), this._componentIsConnected = !1, this.selectDelay = 200, this._optionsList = [], this.hideLabel = !1, this.hideTags = !1, this.label = "", this.lang = "en", this.multiple = !1, this.showValid = !1, this.size = "md", this._expanded = !1, this._invalid = !1, this.globalClickController = new M(this), this.keyboardNavController = new N(this), this.developerFeedbackController = new H(this), this.popoverController = new k(this), this._handleOptionSelected = ((t) => {
35
+ y(this, d, new F(this)), this._componentIsConnected = !1, this.selectDelay = 200, this._optionsList = [], this.hideLabel = !1, this.hideTags = !1, this.label = "", this.lang = "en", this.multiple = !1, this.showValid = !1, this.size = "md", this._expanded = !1, this._invalid = !1, this.globalClickController = new M(this), this.keyboardNavController = new N(this), this.developerFeedbackController = new q(this), this.popoverController = new E(this), this._handleOptionSelected = ((t) => {
36
36
  this._pristine = !1;
37
37
  const e = this._selectedOptions.length > 0;
38
38
  this.setFormValue(e ? this.selectedValues.join(",") : null), this._updateState(t);
@@ -78,14 +78,14 @@ const f = class f extends L {
78
78
  (e || o !== t) && o.removeAttribute("selected");
79
79
  }), this._optionsList = [];
80
80
  }, this._handleSlotChange = () => {
81
- this._handleSizeUpdate(), this._collectSlotOptionTags(), this._ifValueIsSetSelectOption(), this._validateInput(), this._componentIsConnected = !0, this.emit("skf-select-connected");
81
+ this._handleSizeUpdate(), this._collectSlotOptionTags(), this._ifValueIsSetSelectOption(), this._validateInput(), this._componentIsConnected = !0, this.emit("skf-select-connected"), this.requestUpdate();
82
82
  }, this._ifValueIsSetSelectOption = () => {
83
83
  if (this.value)
84
84
  if (this.multiple) {
85
85
  const t = this.value.split(",").map((e) => e.toLowerCase().trim());
86
86
  this._optionsList.forEach((e) => {
87
- t.includes(e.value.toLowerCase().trim()) ? (e.setSelectedDiscrete = !0, this.selectedOptions = [...this.selectedOptions, e]) : (e.setSelectedDiscrete = !1, this._selectedOptions = this._selectedOptions.filter(
88
- (o) => o.value.toLowerCase().trim() !== e.value.toLowerCase().trim()
87
+ t.includes(e.value.toLowerCase().trim()) ? (e.setSelectedDiscrete = !0, this._selectedOptions = [.../* @__PURE__ */ new Set([...this._selectedOptions, e])]) : (e.setSelectedDiscrete = !1, this._selectedOptions = this._selectedOptions.filter(
88
+ (a) => a.value.toLowerCase().trim() !== e.value.toLowerCase().trim()
89
89
  ));
90
90
  }), this._setValue().catch((e) => {
91
91
  console.error(e);
@@ -114,11 +114,11 @@ const f = class f extends L {
114
114
  }
115
115
  set value(t) {
116
116
  let e = [];
117
- this._componentIsConnected && (this.multiple ? e = t.split(",").map((n) => n.toLowerCase().trim()) : e = [t.toLowerCase().trim()], this._selectedOptions = this._optionsList.filter(
118
- (n) => e.includes(n.value.toLowerCase().trim())
119
- ), this._optionsList.forEach((n) => {
120
- n.selected && (n.setSelectedDiscrete = !1);
121
- }), this._selectedOptions.forEach((n) => n.setSelectedDiscrete = !0)), this._setValue();
117
+ this._componentIsConnected && (this.multiple ? e = t.split(",").map((a) => a.toLowerCase().trim()) : e = [t.toLowerCase().trim()], this._selectedOptions = this._optionsList.filter(
118
+ (a) => e.includes(a.value.toLowerCase().trim())
119
+ ), this._optionsList.forEach((a) => {
120
+ a.selected && (a.setSelectedDiscrete = !1);
121
+ }), this._selectedOptions.forEach((a) => a.setSelectedDiscrete = !0)), this._setValue();
122
122
  }
123
123
  get value() {
124
124
  return this._selectedOptions.length ? this._selectedOptions.length === 1 ? this._selectedOptions[0].value.trim() : this._selectedOptions.map((t) => t.value.trim()).join(",") : "";
@@ -152,7 +152,7 @@ const f = class f extends L {
152
152
  }
153
153
  _handleSizeUpdate() {
154
154
  this._slottedItems.forEach((t) => {
155
- (t instanceof U || t instanceof x) && (t.small = this.size === "sm");
155
+ (t instanceof z || t instanceof x) && (t.small = this.size === "sm");
156
156
  });
157
157
  }
158
158
  _handleExpandedChange() {
@@ -195,10 +195,9 @@ const f = class f extends L {
195
195
  async onUpdateComplete() {
196
196
  return await this.updateComplete, this._updateWidth(), "done";
197
197
  }
198
- /** @internal */
199
- /** Filter out elements other than skf-select-option and store in this._optionsList */
198
+ /** @internal Filter out elements other than skf-select-option and store in this._optionsList */
200
199
  _collectSlotOptionTags() {
201
- this._optionsList = E(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), I({
200
+ this._optionsList = k(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), I({
202
201
  assert: this._optionsList.length > 0,
203
202
  reason: "no-children",
204
203
  replaceStrings: [this.localName, "skf-select-option"]
@@ -244,7 +243,7 @@ const f = class f extends L {
244
243
  >
245
244
  <span
246
245
  id="selected-value"
247
- class=${z({ "selected-value": !0, "contains-meta-info": !this.value })}>
246
+ class=${U({ "selected-value": !0, "contains-meta-info": !this.value })}>
248
247
  ${this._computeVisibleValue()}
249
248
  </span>
250
249
  <skf-icon class="arrow" data-color="custom" name="chevronDown"></skf-icon>
@@ -285,58 +284,58 @@ const f = class f extends L {
285
284
  `;
286
285
  }
287
286
  };
288
- d = new WeakMap(), f.styles = [P, q];
287
+ d = new WeakMap(), f.styles = [P, H];
289
288
  let i = f;
290
289
  s([
291
- a({ type: String, attribute: "custom-invalid" })
290
+ n({ type: String, attribute: "custom-invalid" })
292
291
  ], i.prototype, "customInvalid", 2);
293
292
  s([
294
- a({ type: Boolean, attribute: "hide-label" })
293
+ n({ type: Boolean, attribute: "hide-label" })
295
294
  ], i.prototype, "hideLabel", 2);
296
295
  s([
297
- a({ type: Boolean, reflect: !0, attribute: "hide-tags" })
296
+ n({ type: Boolean, reflect: !0, attribute: "hide-tags" })
298
297
  ], i.prototype, "hideTags", 2);
299
298
  s([
300
- a({ type: String })
299
+ n({ type: String })
301
300
  ], i.prototype, "hint", 2);
302
301
  s([
303
- a({ type: Array, attribute: !1 })
302
+ n({ type: Array, attribute: !1 })
304
303
  ], i.prototype, "selectedValues", 1);
305
304
  s([
306
- a({ type: Array, attribute: !1 })
305
+ n({ type: Array, attribute: !1 })
307
306
  ], i.prototype, "selectedOptionsText", 1);
308
307
  s([
309
- a({ type: String, reflect: !0 })
308
+ n({ type: String, reflect: !0 })
310
309
  ], i.prototype, "label", 2);
311
310
  s([
312
- a({ type: String })
311
+ n({ type: String })
313
312
  ], i.prototype, "lang", 2);
314
313
  s([
315
- a({ type: Number })
314
+ n({ type: Number })
316
315
  ], i.prototype, "max", 2);
317
316
  s([
318
- a({ type: Number, attribute: "max-visible-items" })
317
+ n({ type: Number, attribute: "max-visible-items" })
319
318
  ], i.prototype, "maxVisibleItems", 2);
320
319
  s([
321
- a({ type: Number })
320
+ n({ type: Number })
322
321
  ], i.prototype, "min", 2);
323
322
  s([
324
- a({ type: Boolean, reflect: !0 })
323
+ n({ type: Boolean, reflect: !0 })
325
324
  ], i.prototype, "multiple", 2);
326
325
  s([
327
- a({ type: String })
326
+ n({ type: String })
328
327
  ], i.prototype, "name", 2);
329
328
  s([
330
- a()
329
+ n()
331
330
  ], i.prototype, "severity", 2);
332
331
  s([
333
- a({ type: Boolean, attribute: "show-valid" })
332
+ n({ type: Boolean, attribute: "show-valid" })
334
333
  ], i.prototype, "showValid", 2);
335
334
  s([
336
- a({ reflect: !0 })
335
+ n({ reflect: !0 })
337
336
  ], i.prototype, "size", 2);
338
337
  s([
339
- a({ type: String, attribute: !1 })
338
+ n({ type: String, attribute: !1 })
340
339
  ], i.prototype, "value", 1);
341
340
  s([
342
341
  c()
@@ -1210,124 +1210,6 @@
1210
1210
  ],
1211
1211
  "typeDefinitionPath": "components/button/button.d.ts"
1212
1212
  },
1213
- {
1214
- "kind": "javascript-module",
1215
- "path": "components/card/card.js",
1216
- "declarations": [
1217
- {
1218
- "kind": "class",
1219
- "description": "The `<skf-card>` can be used to group related subjects in a container\n\nSee [zeroheight](https://zeroheight.com/853e936c9/p/021eed-card) for design principles",
1220
- "name": "SkfCard",
1221
- "cssProperties": [
1222
- {
1223
- "description": "Ability to set a custom background color",
1224
- "name": "--mod-card-bg-color"
1225
- }
1226
- ],
1227
- "slots": [
1228
- {
1229
- "description": "The card's main content",
1230
- "name": ""
1231
- }
1232
- ],
1233
- "members": [
1234
- {
1235
- "kind": "field",
1236
- "name": "#internals",
1237
- "privacy": "private",
1238
- "type": {
1239
- "text": "ElementInternals"
1240
- }
1241
- },
1242
- {
1243
- "kind": "field",
1244
- "name": "#states",
1245
- "privacy": "private",
1246
- "type": {
1247
- "text": "CustomStateSet"
1248
- }
1249
- },
1250
- {
1251
- "kind": "field",
1252
- "name": "noBorder",
1253
- "type": {
1254
- "text": "boolean"
1255
- },
1256
- "default": "false",
1257
- "description": "If true, removes border",
1258
- "attribute": "no-border"
1259
- },
1260
- {
1261
- "kind": "field",
1262
- "name": "noPadding",
1263
- "type": {
1264
- "text": "boolean"
1265
- },
1266
- "default": "false",
1267
- "description": "If true, removes padding",
1268
- "attribute": "no-padding"
1269
- },
1270
- {
1271
- "kind": "field",
1272
- "name": "stretch",
1273
- "type": {
1274
- "text": "boolean"
1275
- },
1276
- "default": "false",
1277
- "description": "If true, the Card fills the parent element height",
1278
- "attribute": "stretch"
1279
- }
1280
- ],
1281
- "attributes": [
1282
- {
1283
- "name": "no-border",
1284
- "type": {
1285
- "text": "boolean"
1286
- },
1287
- "default": "false",
1288
- "description": "If true, removes border",
1289
- "fieldName": "noBorder"
1290
- },
1291
- {
1292
- "name": "no-padding",
1293
- "type": {
1294
- "text": "boolean"
1295
- },
1296
- "default": "false",
1297
- "description": "If true, removes padding",
1298
- "fieldName": "noPadding"
1299
- },
1300
- {
1301
- "name": "stretch",
1302
- "type": {
1303
- "text": "boolean"
1304
- },
1305
- "default": "false",
1306
- "description": "If true, the Card fills the parent element height",
1307
- "fieldName": "stretch"
1308
- }
1309
- ],
1310
- "superclass": {
1311
- "name": "SkfElement",
1312
- "package": "@internal/components/skf-element.js"
1313
- },
1314
- "tagName": "skf-card",
1315
- "customElement": true,
1316
- "modulePath": "src/components/card/card.component.ts"
1317
- }
1318
- ],
1319
- "exports": [
1320
- {
1321
- "kind": "js",
1322
- "name": "SkfCard",
1323
- "declaration": {
1324
- "name": "SkfCard",
1325
- "module": "src/components/card/card.component.ts"
1326
- }
1327
- }
1328
- ],
1329
- "typeDefinitionPath": "components/card/card.d.ts"
1330
- },
1331
1213
  {
1332
1214
  "kind": "javascript-module",
1333
1215
  "path": "components/checkbox/checkbox.js",
@@ -1613,6 +1495,124 @@
1613
1495
  ],
1614
1496
  "typeDefinitionPath": "components/checkbox/checkbox.d.ts"
1615
1497
  },
1498
+ {
1499
+ "kind": "javascript-module",
1500
+ "path": "components/card/card.js",
1501
+ "declarations": [
1502
+ {
1503
+ "kind": "class",
1504
+ "description": "The `<skf-card>` can be used to group related subjects in a container\n\nSee [zeroheight](https://zeroheight.com/853e936c9/p/021eed-card) for design principles",
1505
+ "name": "SkfCard",
1506
+ "cssProperties": [
1507
+ {
1508
+ "description": "Ability to set a custom background color",
1509
+ "name": "--mod-card-bg-color"
1510
+ }
1511
+ ],
1512
+ "slots": [
1513
+ {
1514
+ "description": "The card's main content",
1515
+ "name": ""
1516
+ }
1517
+ ],
1518
+ "members": [
1519
+ {
1520
+ "kind": "field",
1521
+ "name": "#internals",
1522
+ "privacy": "private",
1523
+ "type": {
1524
+ "text": "ElementInternals"
1525
+ }
1526
+ },
1527
+ {
1528
+ "kind": "field",
1529
+ "name": "#states",
1530
+ "privacy": "private",
1531
+ "type": {
1532
+ "text": "CustomStateSet"
1533
+ }
1534
+ },
1535
+ {
1536
+ "kind": "field",
1537
+ "name": "noBorder",
1538
+ "type": {
1539
+ "text": "boolean"
1540
+ },
1541
+ "default": "false",
1542
+ "description": "If true, removes border",
1543
+ "attribute": "no-border"
1544
+ },
1545
+ {
1546
+ "kind": "field",
1547
+ "name": "noPadding",
1548
+ "type": {
1549
+ "text": "boolean"
1550
+ },
1551
+ "default": "false",
1552
+ "description": "If true, removes padding",
1553
+ "attribute": "no-padding"
1554
+ },
1555
+ {
1556
+ "kind": "field",
1557
+ "name": "stretch",
1558
+ "type": {
1559
+ "text": "boolean"
1560
+ },
1561
+ "default": "false",
1562
+ "description": "If true, the Card fills the parent element height",
1563
+ "attribute": "stretch"
1564
+ }
1565
+ ],
1566
+ "attributes": [
1567
+ {
1568
+ "name": "no-border",
1569
+ "type": {
1570
+ "text": "boolean"
1571
+ },
1572
+ "default": "false",
1573
+ "description": "If true, removes border",
1574
+ "fieldName": "noBorder"
1575
+ },
1576
+ {
1577
+ "name": "no-padding",
1578
+ "type": {
1579
+ "text": "boolean"
1580
+ },
1581
+ "default": "false",
1582
+ "description": "If true, removes padding",
1583
+ "fieldName": "noPadding"
1584
+ },
1585
+ {
1586
+ "name": "stretch",
1587
+ "type": {
1588
+ "text": "boolean"
1589
+ },
1590
+ "default": "false",
1591
+ "description": "If true, the Card fills the parent element height",
1592
+ "fieldName": "stretch"
1593
+ }
1594
+ ],
1595
+ "superclass": {
1596
+ "name": "SkfElement",
1597
+ "package": "@internal/components/skf-element.js"
1598
+ },
1599
+ "tagName": "skf-card",
1600
+ "customElement": true,
1601
+ "modulePath": "src/components/card/card.component.ts"
1602
+ }
1603
+ ],
1604
+ "exports": [
1605
+ {
1606
+ "kind": "js",
1607
+ "name": "SkfCard",
1608
+ "declaration": {
1609
+ "name": "SkfCard",
1610
+ "module": "src/components/card/card.component.ts"
1611
+ }
1612
+ }
1613
+ ],
1614
+ "typeDefinitionPath": "components/card/card.d.ts"
1615
+ },
1616
1616
  {
1617
1617
  "kind": "javascript-module",
1618
1618
  "path": "components/datepicker/datepicker-calendar.js",
@@ -6253,13 +6253,6 @@
6253
6253
  },
6254
6254
  "privacy": "private"
6255
6255
  },
6256
- {
6257
- "kind": "method",
6258
- "name": "_handleSizeUpdate",
6259
- "type": {
6260
- "text": "_handleSizeUpdate() => void"
6261
- }
6262
- },
6263
6256
  {
6264
6257
  "kind": "field",
6265
6258
  "name": "_selectedOptions",