@designsystem-se/af 41.0.1-beta.1 → 41.0.1-beta.3

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 (30) hide show
  1. package/components/digi-calendar-datepicker.js +4 -4
  2. package/components/digi-calendar.js +1 -1
  3. package/components/digi-form-file-upload.js +1 -1
  4. package/components/digi-form-input-search.js +2 -2
  5. package/components/digi-form-input.js +1 -1
  6. package/components/digi-form-label.js +1 -1
  7. package/components/digi-form-select-filter.js +2 -2
  8. package/components/digi-form-select.js +1 -1
  9. package/components/digi-form-textarea.js +1 -1
  10. package/components/{p-2QoafdpB.js → p-B7_lQTCU.js} +19 -5
  11. package/components/{p-DL56hj-Q.js → p-DI0_hUPN.js} +2 -2
  12. package/components/{p-CsnkG9DM.js → p-DRVEvFMd.js} +6 -5
  13. package/components/{p-CZNczF84.js → p-stxQJv63.js} +1 -1
  14. package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
  15. package/dist/cjs/digi-button_83.cjs.entry.js +16 -8
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/collection/components/_form/form-label/form-label.js +12 -4
  18. package/dist/collection/components/_form/form-select/form-select.js +5 -4
  19. package/dist/collection/design-tokens/components/_logo.variables.scss +17 -15
  20. package/dist/digi-arbetsformedlingen/design-tokens/components/_logo.variables.scss +15 -17
  21. package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
  22. package/dist/digi-arbetsformedlingen/p-3f6d6a9e.entry.js +1 -0
  23. package/dist/esm/digi-arbetsformedlingen.js +1 -1
  24. package/dist/esm/digi-button_83.entry.js +16 -8
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/types/components/_form/form-label/form-label.d.ts +2 -1
  27. package/hydrate/index.js +17 -8
  28. package/hydrate/index.mjs +17 -8
  29. package/package.json +4 -2
  30. package/dist/digi-arbetsformedlingen/p-5c8111ef.entry.js +0 -1
@@ -30,7 +30,7 @@ export class FormLabel {
30
30
  this.afAnnounceIfOptionalText = _t.optional.toLowerCase();
31
31
  }
32
32
  componentWillLoad() {
33
- this.warnIfMissingLabel();
33
+ this.setLabelText();
34
34
  this.validateFor();
35
35
  this.handleSlotVisibility();
36
36
  }
@@ -39,7 +39,8 @@ export class FormLabel {
39
39
  logger.warn(`digi-form-label must have a for attribute. Please add a for attribute using af-for`, this.hostElement);
40
40
  }
41
41
  }
42
- warnIfMissingLabel() {
42
+ setLabelText() {
43
+ this.labelText = `${this.afLabel} ${this.requiredText}`;
43
44
  if (!this.afLabel) {
44
45
  logger.warn(`digi-form-label must have a label. Please add a label using af-label`, this.hostElement);
45
46
  }
@@ -61,7 +62,7 @@ export class FormLabel {
61
62
  }
62
63
  }
63
64
  render() {
64
- return (h("div", { key: 'd505cd974e5fad197c27502bbd5a69e03b6da4c9', class: "digi-form-label" }, h("div", { key: '438d01b31f6b2814ae6a1ca04c824ea08ea2be23', class: "digi-form-label__label-group" }, this.afFor && this.afLabel && (h("label", { key: 'f339da21e44bd1d80bc2bcd71f2a7b85ded421a3', class: "digi-form-label__label", htmlFor: this.afFor, id: this.afId }, h("span", { key: '49c6e41049caafd257d39c8e4bbd61054e618ac9', tabindex: "-1", class: "digi-form-label__label--label" }, `${this.afLabel} ${this.requiredText}`), this.afDescription && (h("span", { key: '857cf559d405dc425fb16289d216cc5ed500775f', tabindex: "-1", class: "digi-form-label__label--description" }, this.afDescription)))), this.hasActionSlot && (h("div", { key: '11a7132c78dc5467b25c8a09724a1d13f3a324c3', class: "digi-form-label__actions" }, h("slot", { key: 'f499d1b9d31ccc825723a880bea8f110658b462d', name: "actions" }))))));
65
+ return (h("div", { key: '78c3c9cc7609ede22abcd68c16514c85b52c945e', class: "digi-form-label" }, h("div", { key: '5bd7a74e6508c261f489716673f011391bf7c0d8', class: "digi-form-label__label-group" }, this.afFor && this.afLabel && (h("label", { key: '6952422ebe4e447857befae6116fd7336046dc1f', class: "digi-form-label__label", htmlFor: this.afFor, id: this.afId }, h("span", { key: '2da61e9396c9c20b40ee4d80c21ae96e2a491e8f', tabindex: "-1", class: "digi-form-label__label--label" }, this.labelText), this.afDescription && (h("span", { key: '858d2ae39681662c278352e42b7bccb511279bd0', tabindex: "-1", class: "digi-form-label__label--description" }, this.afDescription)))), this.hasActionSlot && (h("div", { key: '7719bef7cfe38637a5ef4b71d5e9a6237ed48ff2', class: "digi-form-label__actions" }, h("slot", { key: '37bd2332a7d4e7fa15c4ff61a0cc26c92bed08d8', name: "actions" }))))));
65
66
  }
66
67
  static get is() { return "digi-form-label"; }
67
68
  static get encapsulation() { return "scoped"; }
@@ -261,6 +262,7 @@ export class FormLabel {
261
262
  }
262
263
  static get states() {
263
264
  return {
265
+ "labelText": {},
264
266
  "hasActionSlot": {}
265
267
  };
266
268
  }
@@ -271,7 +273,13 @@ export class FormLabel {
271
273
  "methodName": "validateFor"
272
274
  }, {
273
275
  "propName": "afLabel",
274
- "methodName": "warnIfMissingLabel"
276
+ "methodName": "setLabelText"
277
+ }, {
278
+ "propName": "afRequired",
279
+ "methodName": "setLabelText"
280
+ }, {
281
+ "propName": "afAnnounceIfOptional",
282
+ "methodName": "setLabelText"
275
283
  }];
276
284
  }
277
285
  }
@@ -81,7 +81,8 @@ export class FormSelect {
81
81
  this.optionsObserver = new MutationObserver(() => this.getOptions());
82
82
  this.optionsObserver.observe(this.hostElement, {
83
83
  childList: true,
84
- subtree: true
84
+ subtree: true,
85
+ characterData: true
85
86
  });
86
87
  this.getOptions();
87
88
  this.afOnReady.emit();
@@ -151,14 +152,14 @@ export class FormSelect {
151
152
  : false;
152
153
  }
153
154
  render() {
154
- return (h(Host, { key: 'fa05393217c58cb56e451dc8fe9463504d6a300d', tabindex: -1 }, h("div", { key: 'feaedb4dc5c663a3fde4b9c56cc52f39c316ebe8', class: Object.assign({ 'digi-form-select': true }, this.cssModifiers) }, h("div", { key: 'c13e62f88ee2d3d2205d53ee97defd61cd55d4c8', class: "digi-form-select__label-group" }, h("digi-form-label", { key: '56932b0aa1bda5491666b103a75a39857939cf5f', afFor: this.afId, afLabel: this.afLabel, afId: `${this.afId}-label`, afDescription: this.afDescription, afRequired: this.afRequired, afAnnounceIfOptional: this.afAnnounceIfOptional, afRequiredText: this.afRequiredText, afAnnounceIfOptionalText: this.afAnnounceIfOptionalText })), h("div", { key: 'c64d5ed5f7d148db11c1091ffc3fadf0ff0c5cda', class: "digi-form-select__select-wrapper" }, h("select", { key: '509e0affa812c5950abc8c199608e1bbacc70873', class: "digi-form-select__select", name: this.afName, id: this.afId, "aria-label": this.afAriaLabel, "aria-invalid": this.afValidation === FormSelectValidation.ERROR
155
+ return (h(Host, { key: '25781b1ef869d40adddd56e0bc76df15fb38824d', tabindex: -1 }, h("div", { key: '134a4405b623a02f203539a0dc7e7a2b273a8997', class: Object.assign({ 'digi-form-select': true }, this.cssModifiers) }, h("div", { key: '131cd12bd401525cd24568864087860947f78411', class: "digi-form-select__label-group" }, h("digi-form-label", { key: '0144ed5018666da00966461aee1e0cb716fd3dc4', afFor: this.afId, afLabel: this.afLabel, afId: `${this.afId}-label`, afDescription: this.afDescription, afRequired: this.afRequired, afAnnounceIfOptional: this.afAnnounceIfOptional, afRequiredText: this.afRequiredText, afAnnounceIfOptionalText: this.afAnnounceIfOptionalText })), h("div", { key: '0b7f01ce1e8cb0ceb1e0dcc2c34ebf4766789804', class: "digi-form-select__select-wrapper" }, h("select", { key: '76cdaf0d9afbaea218f1ef7aa9c938cb7cbc81c1', class: "digi-form-select__select", name: this.afName, id: this.afId, "aria-label": this.afAriaLabel, "aria-invalid": this.afValidation === FormSelectValidation.ERROR
155
156
  ? 'true'
156
- : 'false', "aria-describedby": `${this.afId}--validation-message`, ref: (el) => (this._select = el), required: this.afRequired ? this.afRequired : null, onFocus: (e) => this.focusHandler(e), onFocusout: (e) => this.focusoutHandler(e), onBlur: (e) => this.blurHandler(e), onChange: (e) => this.changeHandler(e), onInput: (e) => this.selectHandler(e), autoFocus: this.afAutofocus ? this.afAutofocus : null }, this.hasPlaceholder && (h("option", { key: '7787a78ae8a05f8a59d020ee0f87494fe88105e0', class: {
157
+ : 'false', "aria-describedby": `${this.afId}--validation-message`, ref: (el) => (this._select = el), required: this.afRequired ? this.afRequired : null, onFocus: (e) => this.focusHandler(e), onFocusout: (e) => this.focusoutHandler(e), onBlur: (e) => this.blurHandler(e), onChange: (e) => this.changeHandler(e), onInput: (e) => this.selectHandler(e), autoFocus: this.afAutofocus ? this.afAutofocus : null }, this.hasPlaceholder && (h("option", { key: '50a6a16127c45e1d7bf18c9bf23d269f35360cf4', class: {
157
158
  'digi-form-select__select-option': true,
158
159
  'digi-form-select__select-option--initial-value': true
159
160
  }, disabled: true, selected: !this.afValue, value: "" }, this.afPlaceholder)), this.optionItems.map((option, index) => {
160
161
  return (h("option", { key: index, class: "digi-form-select__select-option", value: option.value, selected: this.getSelectedItem(option) }, option.text));
161
- })), h("digi-icon-input-select-marker", { key: 'f344f09f7f591867d6205b4a67390b579b44e624', class: "digi-form-select__icon", slot: "icon" })), h("div", { key: 'e2ca1ec1fdce28eb0f4aa40acb0a760a8fdc67a0', hidden: true }, h("slot", { key: 'f38120495c88c0ee63b2a85baa671be3d307e23d' })), h("div", { key: '7081d2f99cbdc49ac25d2a6bc5a86ad76385ff19', class: "digi-form-select__footer" }, h("div", { key: '20e66dae37629e92c8ba54b78f95d454650e0869', "aria-atomic": "true", role: this.errorMessageIsAlert ? 'alert' : null, id: `${this.afId}--validation-message` }, this.showValidation() && (h("digi-form-validation-message", { key: '0125fcc8076542953cc99a6113d9de4ebdf14ad8', "af-variation": this.afValidation }, this.afValidationText)))))));
162
+ })), h("digi-icon-input-select-marker", { key: '4f18ad875e8c9ce10c658c667f1fcf5530db9eb2', class: "digi-form-select__icon", slot: "icon" })), h("div", { key: '723e27711db96646df989f4a7ed87e68b85434df', hidden: true }, h("slot", { key: '0d0048a91cb95c882c43ac6f319f53f7e994a8bb' })), h("div", { key: '42eff52b99714e2b1f53e58c50a0a9e8059efeeb', class: "digi-form-select__footer" }, h("div", { key: '30f66c55f4595c1c2621d733e6e997b45d09600e', "aria-atomic": "true", role: this.errorMessageIsAlert ? 'alert' : null, id: `${this.afId}--validation-message` }, this.showValidation() && (h("digi-form-validation-message", { key: '7affedbbffd3a8bd13c562e21a24fd02562042a0', "af-variation": this.afValidation }, this.afValidationText)))))));
162
163
  }
163
164
  static get is() { return "digi-form-select"; }
164
165
  static get encapsulation() { return "scoped"; }
@@ -1,16 +1,18 @@
1
- @mixin digi-title-logo--variables() {
2
- --digi--title-logo-text-color: var(--digi--color--text--primary);
3
- --digi--title-logo-font-weight: var(--digi--global--typography--font-weight--bold);
4
- --digi--title-logo-font-size: var(--digi--typography--title-logo--font-size--mobile);
5
- --digi--title-logo-font-size-small: var(--digi--global--typography--font-size--large);
6
- --digi--title-logo-line-height-small: 1.25rem;
7
- --digi--title-logo-symbol-color: var(--digi--color--logotype--primary--symbol);
8
- --digi--title-logo-symbol-width: 36px;
9
- --digi--title-logo-symbol-height: 36px;
10
- --digi--title-logo-symbol-width-mobile: 44px;
11
- --digi--title-logo-symbol-height-mobile: 44px;
12
- --digi--title-logo-text-height: 40px;
13
- --digi--title-logo-border-width: var(--digi--global--border-width--base);
14
- --digi--title-logo-vertical-padding: 1.375rem;
15
- --digi--title-logo-gap: 9px;
1
+ @use '../../../../../../styles/src/digi-styles.utils' as *;
2
+
3
+ @mixin digi-logo--variables() {
4
+ --digi--logo--img--min-width: #{rem(256)};
5
+ --digi--logo--img--max-width:#{rem(292)};
6
+ --digi--logo--img--max-width--large: #{rem(368)};
7
+ --digi--logo--img--max-width--system: #{rem(44)};
8
+
9
+ --digi--logo--padding: 1.375rem;
10
+ --digi--logo--padding--wide: var(--digi--gutter--larger);
11
+ --digi--logo--padding--large: var(--digi--gutter--medium);
12
+ --digi--logo--padding--large--wide: var(--digi--gutter--larger);
13
+
14
+ --digi--logo--primary--symbol: var(--digi--color--logotype--primary--symbol);
15
+ --digi--logo--secondary--symbol: var(--digi--color--logotype--secondary--symbol);
16
+ --digi--logo--primary--text: var(--digi--color--logotype--primary--text);
17
+ --digi--logo--secondary--text: var(--digi--color--logotype--secondary--text);
16
18
  }
@@ -1,18 +1,16 @@
1
- @use '../../../../../../styles/src/digi-styles.utils' as *;
2
-
3
- @mixin digi-logo--variables() {
4
- --digi--logo--img--min-width: #{rem(256)};
5
- --digi--logo--img--max-width:#{rem(292)};
6
- --digi--logo--img--max-width--large: #{rem(368)};
7
- --digi--logo--img--max-width--system: #{rem(44)};
8
-
9
- --digi--logo--padding: 1.375rem;
10
- --digi--logo--padding--wide: var(--digi--gutter--larger);
11
- --digi--logo--padding--large: var(--digi--gutter--medium);
12
- --digi--logo--padding--large--wide: var(--digi--gutter--larger);
13
-
14
- --digi--logo--primary--symbol: var(--digi--color--logotype--primary--symbol);
15
- --digi--logo--secondary--symbol: var(--digi--color--logotype--secondary--symbol);
16
- --digi--logo--primary--text: var(--digi--color--logotype--primary--text);
17
- --digi--logo--secondary--text: var(--digi--color--logotype--secondary--text);
1
+ @mixin digi-title-logo--variables() {
2
+ --digi--title-logo-text-color: var(--digi--color--text--primary);
3
+ --digi--title-logo-font-weight: var(--digi--global--typography--font-weight--bold);
4
+ --digi--title-logo-font-size: var(--digi--typography--title-logo--font-size--mobile);
5
+ --digi--title-logo-font-size-small: var(--digi--global--typography--font-size--large);
6
+ --digi--title-logo-line-height-small: 1.25rem;
7
+ --digi--title-logo-symbol-color: var(--digi--color--logotype--primary--symbol);
8
+ --digi--title-logo-symbol-width: 36px;
9
+ --digi--title-logo-symbol-height: 36px;
10
+ --digi--title-logo-symbol-width-mobile: 44px;
11
+ --digi--title-logo-symbol-height-mobile: 44px;
12
+ --digi--title-logo-text-height: 40px;
13
+ --digi--title-logo-border-width: var(--digi--global--border-width--base);
14
+ --digi--title-logo-vertical-padding: 1.375rem;
15
+ --digi--title-logo-gap: 9px;
18
16
  }