@designsystem-se/af 38.1.0 → 38.2.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 (33) hide show
  1. package/components/digi-calendar-datepicker.js +10 -6
  2. package/components/digi-form-checkbox.js +1 -1
  3. package/components/digi-form-error-list.js +33 -1
  4. package/components/digi-form-filter.js +1 -1
  5. package/components/{p-13c09880.js → p-f84f590e.js} +2 -2
  6. package/custom-elements.json +9 -1
  7. package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
  8. package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +8 -6
  9. package/dist/cjs/digi-form-checkbox.cjs.entry.js +2 -2
  10. package/dist/cjs/digi-form-error-list.cjs.entry.js +33 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/collection/components/_calendar/calendar-datepicker/calendar-datepicker.js +53 -6
  13. package/dist/collection/components/_form/form-checkbox/form-checkbox.js +8 -5
  14. package/dist/collection/components/_form/form-error-list/form-error-list.js +20 -1
  15. package/dist/collection/design-tokens/components/_logo.variables.scss +17 -15
  16. package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
  17. package/dist/digi-arbetsformedlingen/{p-37c0ea9e.entry.js → p-2295239c.entry.js} +1 -1
  18. package/dist/digi-arbetsformedlingen/p-42ae53aa.entry.js +1 -0
  19. package/dist/digi-arbetsformedlingen/p-7f155bd5.entry.js +1 -0
  20. package/dist/esm/digi-arbetsformedlingen.js +1 -1
  21. package/dist/esm/digi-calendar-datepicker.entry.js +8 -6
  22. package/dist/esm/digi-form-checkbox.entry.js +2 -2
  23. package/dist/esm/digi-form-error-list.entry.js +33 -1
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/types/components/_calendar/calendar-datepicker/calendar-datepicker.d.ts +10 -0
  26. package/dist/types/components/_form/form-checkbox/form-checkbox.d.ts +5 -2
  27. package/dist/types/components/_form/form-error-list/form-error-list.d.ts +3 -0
  28. package/dist/types/components.d.ts +24 -4
  29. package/hydrate/index.js +45 -9
  30. package/hydrate/index.mjs +45 -9
  31. package/package.json +1 -1
  32. package/dist/digi-arbetsformedlingen/p-ef689144.entry.js +0 -1
  33. package/dist/digi-arbetsformedlingen/p-f0a405ca.entry.js +0 -1
@@ -41,6 +41,8 @@ export class CalendarDatepicker {
41
41
  this.afCloseOnSelect = false;
42
42
  this.afOpenCalendarTo = undefined;
43
43
  this.afErrorMessageIsAlert = true;
44
+ this.afAnnounceIfOptional = false;
45
+ this.afAnnounceIfOptionalText = undefined;
44
46
  }
45
47
  afDisableValidationChangeHandler(newVal) {
46
48
  if (!newVal) {
@@ -372,9 +374,9 @@ export class CalendarDatepicker {
372
374
  return this.afSelectedDates;
373
375
  }
374
376
  render() {
375
- return (h(Host, { key: '6b080d933e012fe050aee0181f927c3252b0bb7e', tabindex: -1 }, h("div", { key: 'ec59a7f209f7a5e06c62d4443fbca980b1030d12', class: Object.assign({ 'digi-calendar-datepicker': true }, this.cssModifiers), id: `${this.afId}-datepicker` }, h("div", { key: '2bf3bd4f0a82c14c4fb04610dab19767fbba595d', class: "digi-calendar-datepicker__input-field" }, h("digi-form-input", { key: 'ebde8123611c021b60104f75c2e4085e35fb4697', ref: (el) => (this._input = el), class: 'digi-calendar-datepicker__input-component', afLabel: this.afLabel, afLabelDescription: this.afLabelDescription, afName: this.afName, afValue: this.inputValue, afValidation: this.hasBuiltInValidationError()
377
+ return (h(Host, { key: 'a22b366eece8bdf2a6d66ba7b4561093391ad16d', tabindex: -1 }, h("div", { key: '5ec3557df78bb012f2e10f1852252e78e2470ee3', class: Object.assign({ 'digi-calendar-datepicker': true }, this.cssModifiers), id: `${this.afId}-datepicker` }, h("div", { key: '1215a13021718ac98ad2a4a7a5bae3c456385124', class: "digi-calendar-datepicker__input-field" }, h("digi-form-input", { key: '8794d312452fe11f0f9052bbdd238e5570ec55f0', ref: (el) => (this._input = el), class: 'digi-calendar-datepicker__input-component', afLabel: this.afLabel, afLabelDescription: this.afLabelDescription, afName: this.afName, afValue: this.inputValue, afValidation: this.hasBuiltInValidationError()
376
378
  ? FormInputValidation.ERROR
377
- : this.afValidation, afValidationText: this.getErrorText(), afId: this.afId, afAriaDescribedby: `${this.afId}--validation-message`, afRequired: this.afRequired, afRequiredText: this.afRequiredText, onAfOnChange: (evt) => {
379
+ : this.afValidation, afValidationText: this.getErrorText(), afId: this.afId, afAriaDescribedby: `${this.afId}--validation-message`, afRequired: this.afRequired, afRequiredText: this.afRequiredText, afAnnounceIfOptional: this.afAnnounceIfOptional, afAnnounceIfOptionalText: this.afAnnounceIfOptionalText, onAfOnChange: (evt) => {
378
380
  evt.stopImmediatePropagation();
379
381
  this.parseInput(evt);
380
382
  }, onAfOnBlur: (evt) => {
@@ -389,11 +391,11 @@ export class CalendarDatepicker {
389
391
  e.preventDefault();
390
392
  const focusableDateButton = this.hostElement.querySelector('.digi-calendar__date[tabindex="0"]');
391
393
  focusableDateButton === null || focusableDateButton === void 0 ? void 0 : focusableDateButton.focus();
392
- } }, h("button", { key: '04df5ccb789271d7ba2f693b740f316301f9fae0', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
394
+ } }, h("button", { key: 'c953ddf0c99cfd3b892941da7da4a887b342fd78', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
393
395
  ? this.afCloseCalendarAriaLabel
394
- : this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, h("digi-icon-calendar-alt", { key: '65b9a472f629bbaa46a64c8a304f358da76b0830', class: "digi-calendar-datepicker__button-icon", slot: "icon" })))), h("div", { key: 'd0df89ce680bb2a0ca7f311b2c0ead0f72dc30b6', class: "digi-calendar-datepicker__calendar", id: "calendar-popup" }, h("p", { key: '9796876e15e88b1599d772863c29fc472da24c69', role: "alert", class: "digi-calendar-datepicker__sr-instructions" }, this.showCalendar
396
+ : this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, h("digi-icon-calendar-alt", { key: '46c7387d404b77911b97f31c10e7147bd436c7e3', class: "digi-calendar-datepicker__button-icon", slot: "icon" })))), h("div", { key: '91894a4219afa79d913f558f5d1cc6b410b535ce', class: "digi-calendar-datepicker__calendar", id: "calendar-popup" }, h("p", { key: '989fc17ea7a95aa014a26e09f7db7f59fe53a36b', role: "alert", class: "digi-calendar-datepicker__sr-instructions" }, this.showCalendar
395
397
  ? `${_t.calendar.screenReaderInstructions}${this.screenReaderUpdateTrigger ? '\u200B' : ''}`
396
- : ''), h("digi-calendar", { key: 'bd5f34bcdbcb2276b5080c43479337c514861ba9', afActive: this.showCalendar, afShowWeekNumber: this.afShowWeekNumber, afMultipleDates: this.afMultipleDates, afYearSelect: this.afYearSelect, afSelectedDates: this.getSelectedDates, afMinDate: this.afMinDate, afMaxDate: this.afMaxDate, "aria-hidden": !this.showCalendar, afOpenCalendarTo: this.afOpenCalendarTo, onAfOnDateSelectedChange: (evt) => {
398
+ : ''), h("digi-calendar", { key: '6e62fb845769eca0a9b8cb21e4a09a5620804d42', afActive: this.showCalendar, afShowWeekNumber: this.afShowWeekNumber, afMultipleDates: this.afMultipleDates, afYearSelect: this.afYearSelect, afSelectedDates: this.getSelectedDates, afMinDate: this.afMinDate, afMaxDate: this.afMaxDate, "aria-hidden": !this.showCalendar, afOpenCalendarTo: this.afOpenCalendarTo, onAfOnDateSelectedChange: (evt) => {
397
399
  evt.stopImmediatePropagation();
398
400
  this.parseCalendar(evt);
399
401
  }, onKeyDown: (e) => {
@@ -404,7 +406,7 @@ export class CalendarDatepicker {
404
406
  return;
405
407
  e.preventDefault();
406
408
  this.focusOnCalendarInput();
407
- } })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: 'fc150d20f14731e8f67f38c6042e8af4e24eae38', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
409
+ } })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: 'd9f3eb470b29a0ab96134f1e4666743efacd7448', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
408
410
  ? `${_t.calendar.datepicker.selectedDate}: ${this.datesToInputString(this.afSelectedDates)}`
409
411
  : '')))));
410
412
  }
@@ -974,6 +976,51 @@ export class CalendarDatepicker {
974
976
  "attribute": "af-error-message-is-alert",
975
977
  "reflect": false,
976
978
  "defaultValue": "true"
979
+ },
980
+ "afAnnounceIfOptional": {
981
+ "type": "boolean",
982
+ "mutable": false,
983
+ "complexType": {
984
+ "original": "boolean",
985
+ "resolved": "boolean",
986
+ "references": {}
987
+ },
988
+ "required": false,
989
+ "optional": false,
990
+ "docs": {
991
+ "tags": [{
992
+ "name": "en",
993
+ "text": "Set this to true if the form contains more required fields than optional fields."
994
+ }],
995
+ "text": "S\u00E4tt denna till true om formul\u00E4ret inneh\u00E5ller fler obligatoriska f\u00E4lt \u00E4n valfria."
996
+ },
997
+ "getter": false,
998
+ "setter": false,
999
+ "attribute": "af-announce-if-optional",
1000
+ "reflect": false,
1001
+ "defaultValue": "false"
1002
+ },
1003
+ "afAnnounceIfOptionalText": {
1004
+ "type": "string",
1005
+ "mutable": false,
1006
+ "complexType": {
1007
+ "original": "string",
1008
+ "resolved": "string",
1009
+ "references": {}
1010
+ },
1011
+ "required": false,
1012
+ "optional": false,
1013
+ "docs": {
1014
+ "tags": [{
1015
+ "name": "en",
1016
+ "text": "Set text for afAnnounceIfOptional."
1017
+ }],
1018
+ "text": "S\u00E4tter text f\u00F6r afAnnounceIfOptional."
1019
+ },
1020
+ "getter": false,
1021
+ "setter": false,
1022
+ "attribute": "af-announce-if-optional-text",
1023
+ "reflect": false
977
1024
  }
978
1025
  };
979
1026
  }
@@ -110,7 +110,7 @@ export class FormCheckbox {
110
110
  this.afOnInput.emit(e);
111
111
  }
112
112
  render() {
113
- return (h(Host, { key: '93a52532d5ee8e2b89982b3d06509c16b3656bce', tabindex: -1 }, h("div", { key: '3f2fe30e35c36080d80fdec5c57abf8e310ae14b', class: Object.assign({ 'digi-form-checkbox': true }, this.cssModifiers) }, h("input", { key: 'a45c26da379bff48830f0b03ceebcf24b06c3b17', class: "digi-form-checkbox__input", ref: (el) => {
113
+ return (h(Host, { key: 'e8ca1dfe96537dd438a4b6c206adfc7c9fd64d9c', tabindex: -1 }, h("div", { key: '850911b7ffdcea222b12c2c883cf93b63f703b4f', class: Object.assign({ 'digi-form-checkbox': true }, this.cssModifiers) }, h("input", { key: '923a49d0402e6b3034d3e8e6d43033692695c830', class: "digi-form-checkbox__input", ref: (el) => {
114
114
  var _a;
115
115
  this._input = el;
116
116
  (_a = this === null || this === void 0 ? void 0 : this.afInputRef) === null || _a === void 0 ? void 0 : _a.call(this, el);
@@ -118,7 +118,7 @@ export class FormCheckbox {
118
118
  ? null
119
119
  : `${this.afAriaDescribedby ? `${this.afAriaDescribedby} ` : ''}${this.afDescription ? `${this.afId}-description` : ''}`, "aria-labelledby": this.afAriaLabelledby, "aria-label": this.afAriaLabel, "aria-invalid": this.afValidation === FormCheckboxValidation.ERROR
120
120
  ? 'true'
121
- : 'false', required: this.afRequired, id: this.afId, name: this.afName, type: "checkbox", checked: this.afChecked, value: this.afValue, indeterminate: this.afIndeterminate, autofocus: this.afAutofocus ? this.afAutofocus : null }), h("label", { key: '54cd68f1c10fd023e9dd81bd0fabb2920b911c12', htmlFor: this.afId, class: "digi-form-checkbox__label" }, h("span", { key: 'c7184f48868d38d04485a48f214cc3c37d862ba4', class: "digi-form-checkbox__box" }), this.afLabel), !!this.afDescription && (h("p", { key: 'afc00a7de3cef740bdbf23607cd9247887752759', id: `${this.afId}-description`, class: "digi-form-checkbox__description" }, this.afDescription)))));
121
+ : 'false', required: this.afRequired, id: this.afId, name: this.afName, type: "checkbox", checked: this.afChecked, value: this.afValue, indeterminate: this.afIndeterminate, autofocus: this.afAutofocus ? this.afAutofocus : null }), h("label", { key: 'dccbd4e83dbc757483a18ac22d1539ef83dfb534', htmlFor: this.afId, class: "digi-form-checkbox__label" }, h("span", { key: '1cbc88be9d74dab3e04472bc9462712377447d4a', class: "digi-form-checkbox__box" }), this.afLabel), !!this.afDescription && (h("p", { key: 'bdab264d9d13520858c581d2664c0d53171a1415', id: `${this.afId}-description`, class: "digi-form-checkbox__description" }, this.afDescription)))));
122
122
  }
123
123
  static get is() { return "digi-form-checkbox"; }
124
124
  static get encapsulation() { return "scoped"; }
@@ -573,10 +573,13 @@ export class FormCheckbox {
573
573
  "optional": false,
574
574
  "docs": {
575
575
  "tags": [{
576
- "name": "deprecated",
577
- "text": "Denna prop kommer att tas bort i slutet av augusti"
576
+ "name": "ignore",
577
+ "text": "S\u00E4tter specifikt tabindex f\u00F6r input. Anv\u00E4nds till v\u00E5r komponent Multifiter\nd\u00E4r vi vill manipulera tabbordningen f\u00F6r att underl\u00E4tta navigeringen f\u00F6r tangentbordsanv\u00E4ndare"
578
+ }, {
579
+ "name": "en",
580
+ "text": "Set specific tabindex for input. Used in our component Multifilter \nwhere we want to manipulate the tab order to facilitate navigation for keyboard users."
578
581
  }],
579
- "text": "Tabindex"
582
+ "text": ""
580
583
  },
581
584
  "getter": false,
582
585
  "setter": false,
@@ -3,6 +3,7 @@ import { randomIdGenerator } from "../../../global/utils/randomIdGenerator";
3
3
  import { FormErrorListHeadingLevel } from "./form-error-list-heading-level.enum";
4
4
  import { TypographyVariation } from "../../../enums";
5
5
  import { NotificationAlertVariation } from "../../_notification/notification-alert/notification-alert-variation.enum";
6
+ import { applyStencilScope } from "../../../global/utils/applyStencilScope/applyStencilScope.util";
6
7
  /**
7
8
  * @enums FormErrorListHeadingLevel - form-error-list-heading-level.enum.ts
8
9
  * @swedishName Felmeddelandelista
@@ -23,6 +24,24 @@ export class FormErrorList {
23
24
  async afMSetHeadingFocus() {
24
25
  this.setHeadingFocus();
25
26
  }
27
+ connectedCallback() {
28
+ this.observer = new MutationObserver((mutations) => {
29
+ const hasChildChanges = mutations.some(mutation => mutation.type === 'childList');
30
+ if (hasChildChanges) {
31
+ const hostElement = this.hostElement.querySelector('.digi-form-error-list');
32
+ applyStencilScope(hostElement, hostElement);
33
+ }
34
+ });
35
+ this.observer.observe(this.hostElement, {
36
+ childList: true,
37
+ subtree: true
38
+ });
39
+ }
40
+ disconnectedCallback() {
41
+ if (this.observer) {
42
+ this.observer.disconnect();
43
+ }
44
+ }
26
45
  componentDidLoad() {
27
46
  this.setHeadingFocus();
28
47
  this.afOnReady.emit();
@@ -49,7 +68,7 @@ export class FormErrorList {
49
68
  this.afOnClickLink.emit({ id });
50
69
  }
51
70
  render() {
52
- return (h("div", { key: '59bc43d4b3dd0149647b50203cc1ae585d829006', class: "digi-form-error-list", id: this.afId }, h("digi-notification-alert", { key: 'a2b034276ff7549c9c0711202020e3753da7808d', ref: (el) => (this._notificationAlert = el), "af-heading": this.afHeading, "af-heading-level": this.afHeadingLevel, "af-variation": NotificationAlertVariation.DANGER }, this.afDescription && (h("digi-typography", { key: '3a61c65373b92a73694770f851c6727e27f853e7', "af-variation": TypographyVariation.SMALL }, h("p", { key: 'a088b4d084f5a6db85cedcb4f469f4dff803f8f6', class: "digi-form-error-list__description" }, this.afDescription))), h("slot", { key: '794c42cdece0d06945255b70a96a6992eb4dcd4c' }))));
71
+ return (h("div", { key: '9471a904e95c6304644d884e15aac90d3b0fbad1', class: "digi-form-error-list", id: this.afId }, h("digi-notification-alert", { key: '13a8bf3037570f929f470cc2a531156d552ca53a', ref: (el) => (this._notificationAlert = el), "af-heading": this.afHeading, "af-heading-level": this.afHeadingLevel, "af-variation": NotificationAlertVariation.DANGER }, this.afDescription && (h("digi-typography", { key: '8e8ef106286f426b0cbcfd904407582e79e8ce24', "af-variation": TypographyVariation.SMALL }, h("p", { key: '51175a8da94efe46a262ce365994aa3c23983f2e', class: "digi-form-error-list__description" }, this.afDescription))), h("slot", { key: 'b9f5287d0e2c0326100a094a48fa5e7ab314b92f' }))));
53
72
  }
54
73
  static get is() { return "digi-form-error-list"; }
55
74
  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
  }