@politiet/sheriff-web-components 1.3.1 → 2.0.0-beta.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.
Files changed (188) hide show
  1. package/dist/frameworks/preact.d.ts +3 -5
  2. package/dist/frameworks/preact.d.ts.map +1 -1
  3. package/dist/frameworks/react.d.ts +55 -20
  4. package/dist/frameworks/react.d.ts.map +1 -1
  5. package/dist/frameworks/solidjs.d.ts +3 -5
  6. package/dist/frameworks/solidjs.d.ts.map +1 -1
  7. package/dist/frameworks/svelte.d.ts +3 -5
  8. package/dist/frameworks/svelte.d.ts.map +1 -1
  9. package/dist/frameworks/vue.d.ts +3 -5
  10. package/dist/frameworks/vue.d.ts.map +1 -1
  11. package/dist/index.d.ts +21 -6
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +4 -6
  14. package/dist/index.js.map +1 -1
  15. package/dist/react-wrappers/SDSAlertWrapper.d.ts +5 -0
  16. package/dist/react-wrappers/SDSAlertWrapper.d.ts.map +1 -0
  17. package/dist/react-wrappers/SDSAlertWrapper.js +12 -0
  18. package/dist/react-wrappers/SDSAlertWrapper.js.map +1 -0
  19. package/dist/react-wrappers/SDSCardWrapper.d.ts +3 -0
  20. package/dist/react-wrappers/SDSCardWrapper.d.ts.map +1 -0
  21. package/dist/react-wrappers/SDSCardWrapper.js +10 -0
  22. package/dist/react-wrappers/SDSCardWrapper.js.map +1 -0
  23. package/dist/react-wrappers/SDSTagWrapper.d.ts +3 -0
  24. package/dist/react-wrappers/SDSTagWrapper.d.ts.map +1 -0
  25. package/dist/react-wrappers/SDSTagWrapper.js +10 -0
  26. package/dist/react-wrappers/SDSTagWrapper.js.map +1 -0
  27. package/dist/react-wrappers/SDSTextAreaWrapper.d.ts +2 -2
  28. package/dist/react-wrappers/SDSTextAreaWrapper.d.ts.map +1 -1
  29. package/dist/react-wrappers/SDSTextAreaWrapper.js +2 -2
  30. package/dist/react-wrappers/SDSTextAreaWrapper.js.map +1 -1
  31. package/dist/react-wrappers/index.d.ts +2 -6
  32. package/dist/react-wrappers/index.d.ts.map +1 -1
  33. package/dist/react-wrappers/index.js +2 -6
  34. package/dist/react-wrappers/index.js.map +1 -1
  35. package/dist/sds-alert/sds-alert.d.ts +27 -0
  36. package/dist/sds-alert/sds-alert.d.ts.map +1 -0
  37. package/dist/sds-alert/sds-alert.js +65 -0
  38. package/dist/sds-alert/sds-alert.js.map +1 -0
  39. package/dist/sds-alert/sds-alert.styles.d.ts +2 -0
  40. package/dist/sds-alert/sds-alert.styles.d.ts.map +1 -0
  41. package/dist/sds-alert/sds-alert.styles.js +166 -0
  42. package/dist/sds-alert/sds-alert.styles.js.map +1 -0
  43. package/dist/sds-button/sds-button.d.ts +23 -14
  44. package/dist/sds-button/sds-button.d.ts.map +1 -1
  45. package/dist/sds-button/sds-button.js +42 -27
  46. package/dist/sds-button/sds-button.js.map +1 -1
  47. package/dist/sds-button/sds-button.spec.js +53 -38
  48. package/dist/sds-button/sds-button.spec.js.map +1 -1
  49. package/dist/sds-button/sds-button.styles.d.ts.map +1 -1
  50. package/dist/sds-button/sds-button.styles.js +107 -92
  51. package/dist/sds-button/sds-button.styles.js.map +1 -1
  52. package/dist/sds-card/sds-card.d.ts +18 -0
  53. package/dist/sds-card/sds-card.d.ts.map +1 -0
  54. package/dist/sds-card/sds-card.js +58 -0
  55. package/dist/sds-card/sds-card.js.map +1 -0
  56. package/dist/sds-card/sds-card.styles.d.ts +2 -0
  57. package/dist/sds-card/sds-card.styles.d.ts.map +1 -0
  58. package/dist/sds-card/sds-card.styles.js +124 -0
  59. package/dist/sds-card/sds-card.styles.js.map +1 -0
  60. package/dist/sds-checkbox/sds-checkbox.d.ts +9 -0
  61. package/dist/sds-checkbox/sds-checkbox.d.ts.map +1 -1
  62. package/dist/sds-checkbox/sds-checkbox.js +40 -35
  63. package/dist/sds-checkbox/sds-checkbox.js.map +1 -1
  64. package/dist/sds-checkbox/sds-checkbox.styles.d.ts.map +1 -1
  65. package/dist/sds-checkbox/sds-checkbox.styles.js +162 -62
  66. package/dist/sds-checkbox/sds-checkbox.styles.js.map +1 -1
  67. package/dist/sds-checkbox-group/sds-checkbox-group.d.ts +14 -0
  68. package/dist/sds-checkbox-group/sds-checkbox-group.d.ts.map +1 -1
  69. package/dist/sds-checkbox-group/sds-checkbox-group.js +58 -6
  70. package/dist/sds-checkbox-group/sds-checkbox-group.js.map +1 -1
  71. package/dist/sds-checkbox-group/sds-checkbox-group.styles.d.ts.map +1 -1
  72. package/dist/sds-checkbox-group/sds-checkbox-group.styles.js +61 -22
  73. package/dist/sds-checkbox-group/sds-checkbox-group.styles.js.map +1 -1
  74. package/dist/sds-chip/sds-chip.d.ts +3 -1
  75. package/dist/sds-chip/sds-chip.d.ts.map +1 -1
  76. package/dist/sds-chip/sds-chip.js +21 -15
  77. package/dist/sds-chip/sds-chip.js.map +1 -1
  78. package/dist/sds-chip/sds-chip.styles.d.ts.map +1 -1
  79. package/dist/sds-chip/sds-chip.styles.js +105 -40
  80. package/dist/sds-chip/sds-chip.styles.js.map +1 -1
  81. package/dist/sds-detail/sds-detail.styles.js +2 -2
  82. package/dist/sds-detail/sds-detail.styles.js.map +1 -1
  83. package/dist/sds-heading/sds-heading.d.ts +2 -1
  84. package/dist/sds-heading/sds-heading.d.ts.map +1 -1
  85. package/dist/sds-heading/sds-heading.js +12 -15
  86. package/dist/sds-heading/sds-heading.js.map +1 -1
  87. package/dist/sds-heading/sds-heading.styles.d.ts.map +1 -1
  88. package/dist/sds-heading/sds-heading.styles.js +89 -42
  89. package/dist/sds-heading/sds-heading.styles.js.map +1 -1
  90. package/dist/sds-icon/sds-icon-names.d.ts +1 -1
  91. package/dist/sds-icon/sds-icon-names.d.ts.map +1 -1
  92. package/dist/sds-icon/sds-icon-names.js +3626 -554
  93. package/dist/sds-icon/sds-icon-names.js.map +1 -1
  94. package/dist/sds-icon/sds-icon.allowed-colors.js +12 -12
  95. package/dist/sds-icon/sds-icon.color-types.d.ts +1 -1
  96. package/dist/sds-icon/sds-icon.d.ts +10 -1
  97. package/dist/sds-icon/sds-icon.d.ts.map +1 -1
  98. package/dist/sds-icon/sds-icon.js +3 -10
  99. package/dist/sds-icon/sds-icon.js.map +1 -1
  100. package/dist/sds-icon/sds-icon.styles.d.ts.map +1 -1
  101. package/dist/sds-icon/sds-icon.styles.js +20 -6
  102. package/dist/sds-icon/sds-icon.styles.js.map +1 -1
  103. package/dist/sds-label/sds-label.styles.js +2 -2
  104. package/dist/sds-label/sds-label.styles.js.map +1 -1
  105. package/dist/sds-link/sds-link.styles.js +6 -6
  106. package/dist/sds-link/sds-link.styles.js.map +1 -1
  107. package/dist/sds-loader/sds-loader.d.ts +4 -3
  108. package/dist/sds-loader/sds-loader.d.ts.map +1 -1
  109. package/dist/sds-loader/sds-loader.js +16 -8
  110. package/dist/sds-loader/sds-loader.js.map +1 -1
  111. package/dist/sds-loader/sds-loader.styles.d.ts.map +1 -1
  112. package/dist/sds-loader/sds-loader.styles.js +65 -20
  113. package/dist/sds-loader/sds-loader.styles.js.map +1 -1
  114. package/dist/sds-nav-card/sds-nav-card.styles.d.ts.map +1 -1
  115. package/dist/sds-nav-card/sds-nav-card.styles.js +18 -25
  116. package/dist/sds-nav-card/sds-nav-card.styles.js.map +1 -1
  117. package/dist/sds-notification/sds-notification.d.ts +6 -2
  118. package/dist/sds-notification/sds-notification.d.ts.map +1 -1
  119. package/dist/sds-notification/sds-notification.js +31 -19
  120. package/dist/sds-notification/sds-notification.js.map +1 -1
  121. package/dist/sds-notification/sds-notification.styles.d.ts.map +1 -1
  122. package/dist/sds-notification/sds-notification.styles.js +93 -113
  123. package/dist/sds-notification/sds-notification.styles.js.map +1 -1
  124. package/dist/sds-paragraph/sds-paragraph.styles.js +2 -2
  125. package/dist/sds-paragraph/sds-paragraph.styles.js.map +1 -1
  126. package/dist/sds-radio/sds-radio.d.ts +9 -0
  127. package/dist/sds-radio/sds-radio.d.ts.map +1 -1
  128. package/dist/sds-radio/sds-radio.js +43 -33
  129. package/dist/sds-radio/sds-radio.js.map +1 -1
  130. package/dist/sds-radio/sds-radio.spec.js +0 -7
  131. package/dist/sds-radio/sds-radio.spec.js.map +1 -1
  132. package/dist/sds-radio/sds-radio.styles.d.ts.map +1 -1
  133. package/dist/sds-radio/sds-radio.styles.js +150 -64
  134. package/dist/sds-radio/sds-radio.styles.js.map +1 -1
  135. package/dist/sds-radio-group/sds-radio-group.d.ts +17 -1
  136. package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -1
  137. package/dist/sds-radio-group/sds-radio-group.js +79 -13
  138. package/dist/sds-radio-group/sds-radio-group.js.map +1 -1
  139. package/dist/sds-radio-group/sds-radio-group.styles.d.ts.map +1 -1
  140. package/dist/sds-radio-group/sds-radio-group.styles.js +73 -23
  141. package/dist/sds-radio-group/sds-radio-group.styles.js.map +1 -1
  142. package/dist/sds-switch/sds-switch.d.ts +7 -1
  143. package/dist/sds-switch/sds-switch.d.ts.map +1 -1
  144. package/dist/sds-switch/sds-switch.js +27 -10
  145. package/dist/sds-switch/sds-switch.js.map +1 -1
  146. package/dist/sds-switch/sds-switch.styles.d.ts.map +1 -1
  147. package/dist/sds-switch/sds-switch.styles.js +92 -64
  148. package/dist/sds-switch/sds-switch.styles.js.map +1 -1
  149. package/dist/sds-tag/sds-tag.d.ts +21 -0
  150. package/dist/sds-tag/sds-tag.d.ts.map +1 -0
  151. package/dist/sds-tag/sds-tag.js +38 -0
  152. package/dist/sds-tag/sds-tag.js.map +1 -0
  153. package/dist/sds-tag/sds-tag.styles.d.ts +2 -0
  154. package/dist/sds-tag/sds-tag.styles.d.ts.map +1 -0
  155. package/dist/sds-tag/sds-tag.styles.js +90 -0
  156. package/dist/sds-tag/sds-tag.styles.js.map +1 -0
  157. package/dist/sds-text/sds-text.d.ts +6 -1
  158. package/dist/sds-text/sds-text.d.ts.map +1 -1
  159. package/dist/sds-text/sds-text.js +11 -11
  160. package/dist/sds-text/sds-text.js.map +1 -1
  161. package/dist/sds-text/sds-text.styles.d.ts.map +1 -1
  162. package/dist/sds-text/sds-text.styles.js +257 -14
  163. package/dist/sds-text/sds-text.styles.js.map +1 -1
  164. package/dist/sds-textarea/sds-textarea.d.ts +7 -0
  165. package/dist/sds-textarea/sds-textarea.d.ts.map +1 -1
  166. package/dist/sds-textarea/sds-textarea.js +21 -24
  167. package/dist/sds-textarea/sds-textarea.js.map +1 -1
  168. package/dist/sds-textarea/sds-textarea.styles.d.ts.map +1 -1
  169. package/dist/sds-textarea/sds-textarea.styles.js +121 -58
  170. package/dist/sds-textarea/sds-textarea.styles.js.map +1 -1
  171. package/dist/sds-textfield/sds-textfield.d.ts +5 -0
  172. package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
  173. package/dist/sds-textfield/sds-textfield.js +7 -5
  174. package/dist/sds-textfield/sds-textfield.js.map +1 -1
  175. package/dist/sds-textfield/sds-textfield.styles.d.ts.map +1 -1
  176. package/dist/sds-textfield/sds-textfield.styles.js +104 -62
  177. package/dist/sds-textfield/sds-textfield.styles.js.map +1 -1
  178. package/dist/sheriff-web-components.js +2931 -1966
  179. package/dist/types.d.ts +5 -0
  180. package/dist/types.d.ts.map +1 -0
  181. package/dist/types.js +2 -0
  182. package/dist/types.js.map +1 -0
  183. package/dist/utils/renderErrorMessage.js +1 -1
  184. package/dist/utils/slot-validator.d.ts +2 -0
  185. package/dist/utils/slot-validator.d.ts.map +1 -0
  186. package/dist/utils/slot-validator.js +24 -0
  187. package/dist/utils/slot-validator.js.map +1 -0
  188. package/package.json +24 -29
@@ -10,16 +10,19 @@ import { classMap } from 'lit/directives/class-map.js';
10
10
  import { guardedCustomElement } from '../utils/guarded-custom-element';
11
11
  import { styles } from './sds-notification.styles';
12
12
  import '../sds-icon/sds-icon';
13
+ import '../sds-button/sds-button';
13
14
  const notificationIcons = {
14
- info: 'info-material-filled',
15
+ info: 'InformationSquareFill-aksel-filled',
15
16
  success: 'check_circle-material-filled',
16
- attention: 'error-material-filled',
17
+ attention: 'warning-material-filled',
17
18
  warning: 'warning-material-filled',
18
- critical: 'dangerous-material-filled',
19
+ danger: 'dangerous-material-filled',
20
+ critical: 'dangerous-material-filled', // Deprecated
19
21
  };
22
+ let hasWarnedAboutDeprecation = false;
20
23
  let SDSNotification = class SDSNotification extends LitElement {
21
24
  constructor() {
22
- super(...arguments);
25
+ super();
23
26
  // Reactive Props
24
27
  this.variant = 'info';
25
28
  this._remove = () => {
@@ -28,31 +31,40 @@ let SDSNotification = class SDSNotification extends LitElement {
28
31
  composed: true,
29
32
  }));
30
33
  };
34
+ if (!hasWarnedAboutDeprecation) {
35
+ hasWarnedAboutDeprecation = true;
36
+ console.warn('[Sheriff] The Notification component is deprecated and will be removed in the next major release. Please migrate to the Alert component.');
37
+ }
38
+ }
39
+ updated(changed) {
40
+ // Cast critical variant to danger and warning to attention to prevent breaking changes
41
+ if (changed.has('variant') && this.variant === 'critical') {
42
+ this.variant = 'danger';
43
+ }
44
+ else if (changed.has('variant') && this.variant === 'warning') {
45
+ this.variant = 'attention';
46
+ }
31
47
  }
32
48
  render() {
33
49
  const notificationClasses = {
34
50
  'sds-notification': true,
35
- [`sds-notification--${this.variant}`]: true,
36
51
  };
52
+ const colorPalette = this.variant === 'danger' || this.variant === 'critical' ? 'danger' : 'accent';
37
53
  return html `<div class="${classMap(notificationClasses)}">
38
54
  <div class="sds-notification__type">
39
- <sds-icon class="sds-notification__icon" name="${notificationIcons[this.variant]}" size="m"></sds-icon>
55
+ <sds-icon class="sds-notification__icon" name="${notificationIcons[this.variant]}" size="md"></sds-icon>
40
56
  </div>
41
57
  <div class="sds-notification__content">
42
- <div class="sds-notification__content-text">
43
- <slot name="title"></slot>
44
- <slot name="message"></slot>
45
- </div>
46
- ${this.removableLabel
47
- ? html `<button
48
- class="sds-notification__remove-btn"
49
- @click=${this._remove}
50
- aria-label="${this.removableLabel}"
51
- >
52
- <sds-icon name="close-material-outlined" size="s"></sds-icon>
53
- </button>`
54
- : nothing}
58
+ <slot name="title"></slot>
59
+ <slot name="message"></slot>
55
60
  </div>
61
+ ${this.removableLabel
62
+ ? html `<div class="sds-notification__actions">
63
+ <sds-button icon variant="tertiary" color="${colorPalette}" size="sm" @click=${this._remove} aria-label="${this.removableLabel}">
64
+ <sds-icon name="close-material-outlined" size="sm"></sds-icon>
65
+ </sds-button>
66
+ </div>`
67
+ : nothing}
56
68
  </div>`;
57
69
  }
58
70
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sds-notification.js","sourceRoot":"","sources":["../../src/sds-notification/sds-notification.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,sBAAsB,CAAC;AAI9B,MAAM,iBAAiB,GAAwC;IAC9D,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,8BAA8B;IACvC,SAAS,EAAE,uBAAuB;IAClC,OAAO,EAAE,yBAAyB;IAClC,QAAQ,EAAE,2BAA2B;CACrC,CAAC;AASK,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAIN,iBAAiB;QAC0B,YAAO,GAAwB,MAAM,CAAC;QAGhE,YAAO,GAAG,GAAG,EAAE;YAC/B,IAAI,CAAC,aAAa,CACjB,IAAI,WAAW,CAAC,YAAY,EAAE;gBAC7B,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;aACd,CAAC,CACF,CAAC;QACH,CAAC,CAAC;IA6BH,CAAC;IA3BS,MAAM;QACd,MAAM,mBAAmB,GAAG;YAC3B,kBAAkB,EAAE,IAAI;YACxB,CAAC,qBAAqB,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI;SAC3C,CAAC;QAEF,OAAO,IAAI,CAAA,eAAe,QAAQ,CAAC,mBAAmB,CAAC;;qDAEJ,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC;;;;;;;MAO9E,IAAI,CAAC,cAAc;YACpB,CAAC,CAAC,IAAI,CAAA;;gBAEK,IAAI,CAAC,OAAO;qBACP,IAAI,CAAC,cAAc;;;gBAGxB;YACX,CAAC,CAAC,OAAO;;SAEL,CAAC;IACT,CAAC;;AA1CD,UAAU;AACM,sBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAGS;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAuC;AACR;IAAxE,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDAAyB;AANrF,eAAe;IAD3B,oBAAoB,CAAC,kBAAkB,CAAC;GAC5B,eAAe,CA4C3B","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { styles } from './sds-notification.styles';\n\nimport '../sds-icon/sds-icon';\n\ntype NotificationVariant = 'info' | 'success' | 'attention' | 'warning' | 'critical';\n\nconst notificationIcons: Record<NotificationVariant, string> = {\n\tinfo: 'info-material-filled',\n\tsuccess: 'check_circle-material-filled',\n\tattention: 'error-material-filled',\n\twarning: 'warning-material-filled',\n\tcritical: 'dangerous-material-filled',\n};\n\nexport interface SDSNotificationProps {\n\tvariant?: NotificationVariant;\n\t'removable-label'?: string;\n\tonSdsRemove?: (event: CustomEvent) => void;\n}\n\n@guardedCustomElement('sds-notification')\nexport class SDSNotification extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\t// Reactive Props\n\t@property({ type: String, reflect: true }) variant: NotificationVariant = 'info';\n\t@property({ type: String, attribute: 'removable-label', reflect: true }) removableLabel?: string;\n\n\tprivate readonly _remove = () => {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('sds-remove', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t})\n\t\t);\n\t};\n\n\toverride render() {\n\t\tconst notificationClasses = {\n\t\t\t'sds-notification': true,\n\t\t\t[`sds-notification--${this.variant}`]: true,\n\t\t};\n\n\t\treturn html`<div class=\"${classMap(notificationClasses)}\">\n\t\t\t<div class=\"sds-notification__type\">\n\t\t\t\t<sds-icon class=\"sds-notification__icon\" name=\"${notificationIcons[this.variant]}\" size=\"m\"></sds-icon>\n\t\t\t</div>\n\t\t\t<div class=\"sds-notification__content\">\n\t\t\t\t<div class=\"sds-notification__content-text\">\n\t\t\t\t\t<slot name=\"title\"></slot>\n\t\t\t\t\t<slot name=\"message\"></slot>\n\t\t\t\t</div>\n\t\t\t\t${this.removableLabel\n\t\t\t\t\t? html`<button\n\t\t\t\t\t\t\tclass=\"sds-notification__remove-btn\"\n\t\t\t\t\t\t\t@click=${this._remove}\n\t\t\t\t\t\t\taria-label=\"${this.removableLabel}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<sds-icon name=\"close-material-outlined\" size=\"s\"></sds-icon>\n\t\t\t\t\t\t</button>`\n\t\t\t\t\t: nothing}\n\t\t\t</div>\n\t\t</div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-notification': SDSNotification;\n\t}\n}\n"]}
1
+ {"version":3,"file":"sds-notification.js","sourceRoot":"","sources":["../../src/sds-notification/sds-notification.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM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;IACF,CAAC;IAWQ,MAAM;QACd,MAAM,mBAAmB,GAAG;YAC3B,kBAAkB,EAAE,IAAI;SACxB,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;QAEpG,OAAO,IAAI,CAAA,eAAe,QAAQ,CAAC,mBAAmB,CAAC;;qDAEJ,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC;;;;;;KAM/E,IAAI,CAAC,cAAc;YACpB,CAAC,CAAC,IAAI,CAAA;mDACyC,YAAY,sBAAsB,IAAI,CAAC,OAAO,gBAAgB,IAAI,CAAC,cAAc;;;YAGxH;YACR,CAAC,CAAC,OAAO;SACJ,CAAC;IACT,CAAC;;AAxDD,UAAU;AACM,sBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAGS;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAuC;AACR;IAAxE,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDAAyB;AANrF,eAAe;IAD3B,oBAAoB,CAAC,kBAAkB,CAAC;GAC5B,eAAe,CA0D3B","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { styles } from './sds-notification.styles';\nimport { SDS_COLOR_PALETTES } from '../types';\n\nimport '../sds-icon/sds-icon';\nimport '../sds-button/sds-button';\n\ntype NotificationVariant = Extract<SDS_COLOR_PALETTES, 'info' | 'success' | 'attention' | 'warning' | 'critical' | 'danger'> | 'critical';\n\nconst notificationIcons: Record<NotificationVariant, string> = {\n\tinfo: 'InformationSquareFill-aksel-filled',\n\tsuccess: 'check_circle-material-filled',\n\tattention: 'warning-material-filled',\n\twarning: 'warning-material-filled',\n\tdanger: 'dangerous-material-filled',\n\tcritical: 'dangerous-material-filled', // Deprecated\n};\n\nexport interface SDSNotificationProps {\n\tvariant?: NotificationVariant;\n\t'removable-label'?: string;\n\tonSdsRemove?: (event: CustomEvent) => void;\n}\n\nlet hasWarnedAboutDeprecation: boolean = false;\n\n@guardedCustomElement('sds-notification')\nexport class SDSNotification extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\t// Reactive Props\n\t@property({ type: String, reflect: true }) variant: NotificationVariant = 'info';\n\t@property({ type: String, attribute: 'removable-label', reflect: true }) removableLabel?: string;\n\n\tconstructor() {\n\t\tsuper();\n\t\tif (!hasWarnedAboutDeprecation) {\n\t\t\thasWarnedAboutDeprecation = true;\n\t\t\tconsole.warn('[Sheriff] The Notification component is deprecated and will be removed in the next major release. Please migrate to the Alert component.');\n\t\t}\n\t}\n\n\toverride updated(changed: PropertyValues) {\n\t\t// Cast critical variant to danger and warning to attention to prevent breaking changes\n\t\tif (changed.has('variant') && this.variant === 'critical') {\n\t\t\tthis.variant = 'danger';\n\t\t} else if (changed.has('variant') && this.variant === 'warning') {\n\t\t\tthis.variant = 'attention';\n\t\t}\n\t}\n\n\tprivate readonly _remove = () => {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('sds-remove', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t})\n\t\t);\n\t};\n\n\toverride render() {\n\t\tconst notificationClasses = {\n\t\t\t'sds-notification': true,\n\t\t};\n\n\t\tconst colorPalette = this.variant === 'danger' || this.variant === 'critical' ? 'danger' : 'accent';\n\n\t\treturn html`<div class=\"${classMap(notificationClasses)}\">\n\t\t\t<div class=\"sds-notification__type\">\n\t\t\t\t<sds-icon class=\"sds-notification__icon\" name=\"${notificationIcons[this.variant]}\" size=\"md\"></sds-icon>\n\t\t\t</div>\n\t\t\t<div class=\"sds-notification__content\">\n\t\t\t\t<slot name=\"title\"></slot>\n\t\t\t\t<slot name=\"message\"></slot>\n\t\t\t</div>\n\t\t\t${this.removableLabel\n\t\t\t\t? html`<div class=\"sds-notification__actions\">\n\t\t\t\t\t\t<sds-button icon variant=\"tertiary\" color=\"${colorPalette}\" size=\"sm\" @click=${this._remove} aria-label=\"${this.removableLabel}\">\n\t\t\t\t\t\t\t<sds-icon name=\"close-material-outlined\" size=\"sm\"></sds-icon>\n\t\t\t\t\t\t</sds-button>\n\t\t\t\t\t</div>`\n\t\t\t\t: nothing}\n\t\t</div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-notification': SDSNotification;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sds-notification.styles.d.ts","sourceRoot":"","sources":["../../src/sds-notification/sds-notification.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA6JlB,CAAC"}
1
+ {"version":3,"file":"sds-notification.styles.d.ts","sourceRoot":"","sources":["../../src/sds-notification/sds-notification.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAyIlB,CAAC"}
@@ -1,160 +1,140 @@
1
1
  import { css } from 'lit';
2
2
  export const styles = css `
3
3
  :host {
4
+ --_sds-notification-background-color: var(--sds-notification-background-color, var(--sds-color-alert-info-surface-tinted));
5
+
6
+ --_sds-notification-border-color: var(--sds-notification-border-color, var(--sds-color-alert-info-border-default));
7
+ --_sds-notification-border-radius: var(--sds-notification-border-radius, var(--sds-radius-sm));
8
+ --_sds-notification-border-width: var(--sds-notification-border-width, var(--sds-border-sm));
9
+
10
+ --_sds-notification-column-gap: var(--sds-notification-column-gap, var(--sds-spacing-2xs));
11
+ --_sds-notification-content-gap: var(--sds-notification-content-gap, var(--sds-spacing-3xs));
12
+
13
+ --_sds-notification-font-family: var(--sds-notification-font-family, var(--sds-typography-font-family-roboto));
14
+ --_sds-notification-font-size: var(--sds-notification-font-size, var(--sds-components-font-size-md));
15
+ --_sds-notification-font-weight: var(--sds-notification-font-weight, var(--sds-typography-body-md-desktop-font-weight));
16
+ --_sds-notification-line-height: var(--sds-notification-line-height, var(--sds-components-line-height-squeezed-md));
17
+ --_sds-notification-text-color: var(--sds-notification-text-color, var(--sds-color-alert-info-text-default));
18
+
19
+ --_sds-notification-title-font-size: var(--sds-notification-title-font-size, var(--sds-typography-body-lg-desktop-tall-font-size));
20
+ --_sds-notification-title-font-weight: var(--sds-notification-title-font-weight, var(--sds-typography-body-lg-strong-tall-desktop-font-weight));
21
+ --_sds-notification-title-line-height: var(--sds-notification-title-line-height, var(--sds-typography-body-lg-strong-tall-desktop-line-height));
22
+
23
+ --_sds-notification-icon-color: var(--sds-notification-icon-color, var(--sds-color-alert-info-text-subtle));
24
+ --_sds-notification-max-line-width: var(--sds-notification-max-line-width, var(--sds-typography-max-line-width));
25
+ --_sds-notification-padding: var(--sds-notification-padding, var(--sds-spacing-sm));
26
+ --_sds-notification-remove-btn-radius: var(--sds-notification-remove-btn-radius, var(--sds-radius-xs));
27
+
4
28
  display: block;
5
- box-sizing: border-box;
6
29
  }
7
30
 
8
31
  .sds-notification {
9
- font-family: var(--sds-typography-font-family);
10
- font-size: 1rem;
11
- font-weight: 400;
12
- line-height: 1.25;
13
-
14
32
  display: flex;
15
- gap: 0.5rem;
33
+ gap: var(--_sds-notification-column-gap);
34
+ padding: var(--_sds-notification-padding);
16
35
 
17
- background-color: var(--sds-color-semantic-surface-info-subtle);
18
- border: 1px solid var(--sds-color-semantic-surface-info-xtreme);
19
- color: var(--sds-color-semantic-text-default);
36
+ background-color: var(--_sds-notification-background-color);
37
+ border: var(--_sds-notification-border-width) solid var(--_sds-notification-border-color);
38
+ border-radius: var(--_sds-notification-border-radius);
39
+ color: var(--_sds-notification-text-color);
20
40
 
41
+ font-family: var(--_sds-notification-font-family);
21
42
  text-align: left;
22
43
  }
23
44
 
24
- .sds-notification--success {
25
- background-color: var(--sds-color-semantic-surface-ok-subtle);
26
- border-color: var(--sds-color-semantic-surface-ok-xtreme);
45
+ .sds-notification__type {
46
+ color: var(--_sds-notification-icon-color);
47
+ }
27
48
 
28
- .sds-notification__type {
29
- background-color: var(--sds-color-semantic-surface-ok-xtreme);
30
- }
49
+ .sds-notification__content {
50
+ align-self: center;
51
+ display: flex;
52
+ flex: 1;
53
+ flex-direction: column;
54
+ gap: var(--_sds-notification-content-gap);
31
55
  }
32
56
 
33
- .sds-notification--attention {
34
- background-color: var(--sds-color-semantic-surface-attention-subtle);
35
- border-color: var(--sds-color-semantic-surface-attention-xtreme);
57
+ .sds-notification__actions {
58
+ --sds-button-padding-inline: 0;
59
+ }
36
60
 
37
- .sds-notification__type {
38
- background-color: var(--sds-color-semantic-surface-attention-xtreme);
39
- }
61
+ .sds-notification__icon {
62
+ display: block;
63
+ position: relative;
64
+ z-index: 1;
40
65
  }
41
66
 
42
- .sds-notification--warning {
43
- background-color: var(--sds-color-semantic-surface-warning-subtle);
44
- border-color: var(--sds-color-semantic-surface-warning-xtreme);
67
+ :host([variant='success']) {
68
+ --_sds-notification-background-color: var(--sds-notification-background-color, var(--sds-color-alert-success-surface-tinted));
69
+ --_sds-notification-border-color: var(--sds-notification-border-color, var(--sds-color-alert-success-border-default));
70
+ --_sds-notification-text-color: var(--sds-notification-text-color, var(--sds-color-alert-attention-text-default));
71
+ --_sds-notification-icon-color: var(--sds-notification-icon-color, var(--sds-color-alert-success-text-subtle));
72
+
73
+ sds-button {
74
+ --sds-button-text-color: var(--sds-color-alert-success-action-default);
75
+ }
45
76
 
46
- .sds-notification__type {
47
- background-color: var(--sds-color-semantic-surface-warning-xtreme);
77
+ sds-button:hover {
78
+ --sds-button-background-color: var(--sds-color-alert-success-surface-hover);
79
+ --sds-button-border-color: var(--sds-color-alert-success-surface-hover);
48
80
  }
49
81
 
50
- .sds-notification__icon::before {
51
- width: 4px;
52
- height: 14px;
82
+ sds-button:active {
83
+ --sds-button-background-color: var(--sds-color-alert-success-surface-active);
84
+ --sds-button-border-color: var(--sds-color-alert-success-surface-active);
53
85
  }
54
86
  }
55
87
 
56
- .sds-notification--critical {
57
- background-color: var(--sds-color-semantic-surface-critical-subtle);
58
- border-color: var(--sds-color-semantic-surface-critical-xtreme);
88
+ :host([variant='warning']), /* Deprecated */
89
+ :host([variant='attention']) {
90
+ --_sds-notification-background-color: var(--sds-notification-background-color, var(--sds-color-alert-attention-surface-tinted));
91
+ --_sds-notification-border-color: var(--sds-notification-border-color, var(--sds-color-alert-attention-border-default));
92
+ --_sds-notification-text-color: var(--sds-notification-text-color, var(--sds-color-alert-attention-text-default));
93
+ --_sds-notification-icon-color: var(--sds-notification-icon-color, var(--sds-color-alert-attention-text-subtle));
59
94
 
60
- .sds-notification__type {
61
- background-color: var(--sds-color-semantic-surface-critical-xtreme);
95
+ sds-button {
96
+ --sds-button-text-color: var(--sds-color-alert-attention-border-default);
62
97
  }
63
98
 
64
- .sds-notification__icon::before {
65
- width: 10px;
66
- height: 10px;
99
+ sds-button:hover {
100
+ --sds-button-background-color: var(--sds-color-alert-attention-surface-hover);
101
+ --sds-button-border-color: var(--sds-color-alert-attention-surface-hover);
67
102
  }
68
- }
69
-
70
- .sds-notification__type {
71
- background-color: var(--sds-color-semantic-surface-info-xtreme);
72
- color: white;
73
- padding: 1rem 0.5rem;
74
- }
75
103
 
76
- .sds-notification__content {
77
- display: flex;
78
- flex: 1;
79
- gap: 1rem;
80
- padding: 1rem 0.5rem;
104
+ sds-button:active {
105
+ --sds-button-background-color: var(--sds-color-alert-attention-surface-active);
106
+ --sds-button-border-color: var(--sds-color-alert-attention-surface-active);
107
+ }
81
108
  }
82
109
 
83
- .sds-notification__content-text {
84
- flex: 1;
110
+ :host([variant='critical']), /* Deprecated */
111
+ :host([variant='danger']) {
112
+ --_sds-notification-background-color: var(--sds-notification-background-color, var(--sds-color-alert-danger-surface-tinted));
113
+ --_sds-notification-border-color: var(--sds-notification-border-color, var(--sds-color-alert-danger-border-default));
114
+ --_sds-notification-text-color: var(--sds-notification-text-color, var(--sds-color-alert-danger-text-default));
115
+ --_sds-notification-icon-color: var(--sds-notification-icon-color, var(--sds-color-alert-danger-text-subtle));
85
116
  }
86
117
 
87
118
  ::slotted([slot='title']),
88
119
  ::slotted(:is(h1, h2, h3, h4, h5, h6)) {
89
- color: var(--sds-color-semantic-text-default) !important;
90
- font-size: 1rem !important;
120
+ color: var(--_sds-notification-text-color) !important;
121
+ font-size: var(--_sds-notification-title-font-size) !important;
91
122
  font-style: normal !important;
92
- font-weight: 700 !important;
93
- line-height: 1.5 !important;
123
+ font-weight: var(--_sds-notification-title-font-weight) !important;
124
+ line-height: var(--_sds-notification-title-line-height) !important;
94
125
  margin: 0 !important;
95
- max-width: var(--sds-typography-max-line-width) !important;
126
+ max-width: var(--_sds-notification-max-line-width) !important;
96
127
  }
97
128
 
98
129
  ::slotted([slot='message']),
99
130
  ::slotted(:is(p)) {
100
- color: var(--sds-color-semantic-text-default) !important;
101
- font-size: 1rem !important;
131
+ color: var(--_sds-notification-text-color) !important;
132
+ font-size: var(--_sds-notification-font-size) !important;
102
133
  font-style: normal !important;
103
- font-weight: 400 !important;
104
- line-height: 1.5 !important;
134
+ font-weight: var(--_sds-notification-font-weight) !important;
135
+ line-height: var(--_sds-notification-line-height) !important;
105
136
  margin: 0 !important;
106
- max-width: var(--sds-typography-max-line-width) !important;
107
- }
108
-
109
- .sds-notification__icon {
110
- display: block;
111
- position: relative;
112
- z-index: 1;
113
-
114
- &::before {
115
- content: '';
116
- display: block;
117
- width: 14px;
118
- height: 14px;
119
- background-color: black;
120
- position: absolute;
121
- top: 50%;
122
- left: 50%;
123
- transform: translate(-50%, -50%);
124
- z-index: -1;
125
- }
126
- }
127
-
128
- .sds-notification__remove-btn {
129
- border: 0;
130
- border-radius: var(--sds-radius-4);
131
- background: transparent;
132
- cursor: pointer;
133
- flex: 0 1 auto;
134
- padding: 0;
135
- width: 24px;
136
- height: 24px;
137
-
138
- display: flex;
139
- align-items: center;
140
- justify-content: center;
141
-
142
- &:focus {
143
- outline: 2px solid var(--sds-color-semantic-surface-action-default);
144
- outline-offset: 1px;
145
- }
146
-
147
- &:hover {
148
- background-color: var(--sds-color-semantic-surface-action-subtle);
149
- border: 2px solid var(--sds-color-semantic-surface-action-hover);
150
- }
151
-
152
- &:active {
153
- background-color: var(--sds-color-semantic-surface-action-active);
154
- border: 2px solid var(--sds-color-semantic-surface-action-active);
155
- color: var(--sds-color-semantic-text-on-action);
156
- outline: 0;
157
- }
137
+ max-width: var(--_sds-notification-max-line-width) !important;
158
138
  }
159
139
  `;
160
140
  //# sourceMappingURL=sds-notification.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sds-notification.styles.js","sourceRoot":"","sources":["../../src/sds-notification/sds-notification.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6JxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\tdisplay: block;\n\t\tbox-sizing: border-box;\n\t}\n\n\t.sds-notification {\n\t\tfont-family: var(--sds-typography-font-family);\n\t\tfont-size: 1rem;\n\t\tfont-weight: 400;\n\t\tline-height: 1.25;\n\n\t\tdisplay: flex;\n\t\tgap: 0.5rem;\n\n\t\tbackground-color: var(--sds-color-semantic-surface-info-subtle);\n\t\tborder: 1px solid var(--sds-color-semantic-surface-info-xtreme);\n\t\tcolor: var(--sds-color-semantic-text-default);\n\n\t\ttext-align: left;\n\t}\n\n\t.sds-notification--success {\n\t\tbackground-color: var(--sds-color-semantic-surface-ok-subtle);\n\t\tborder-color: var(--sds-color-semantic-surface-ok-xtreme);\n\n\t\t.sds-notification__type {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-ok-xtreme);\n\t\t}\n\t}\n\n\t.sds-notification--attention {\n\t\tbackground-color: var(--sds-color-semantic-surface-attention-subtle);\n\t\tborder-color: var(--sds-color-semantic-surface-attention-xtreme);\n\n\t\t.sds-notification__type {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-attention-xtreme);\n\t\t}\n\t}\n\n\t.sds-notification--warning {\n\t\tbackground-color: var(--sds-color-semantic-surface-warning-subtle);\n\t\tborder-color: var(--sds-color-semantic-surface-warning-xtreme);\n\n\t\t.sds-notification__type {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-warning-xtreme);\n\t\t}\n\n\t\t.sds-notification__icon::before {\n\t\t\twidth: 4px;\n\t\t\theight: 14px;\n\t\t}\n\t}\n\n\t.sds-notification--critical {\n\t\tbackground-color: var(--sds-color-semantic-surface-critical-subtle);\n\t\tborder-color: var(--sds-color-semantic-surface-critical-xtreme);\n\n\t\t.sds-notification__type {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-critical-xtreme);\n\t\t}\n\n\t\t.sds-notification__icon::before {\n\t\t\twidth: 10px;\n\t\t\theight: 10px;\n\t\t}\n\t}\n\n\t.sds-notification__type {\n\t\tbackground-color: var(--sds-color-semantic-surface-info-xtreme);\n\t\tcolor: white;\n\t\tpadding: 1rem 0.5rem;\n\t}\n\n\t.sds-notification__content {\n\t\tdisplay: flex;\n\t\tflex: 1;\n\t\tgap: 1rem;\n\t\tpadding: 1rem 0.5rem;\n\t}\n\n\t.sds-notification__content-text {\n\t\tflex: 1;\n\t}\n\n\t::slotted([slot='title']),\n\t::slotted(:is(h1, h2, h3, h4, h5, h6)) {\n\t\tcolor: var(--sds-color-semantic-text-default) !important;\n\t\tfont-size: 1rem !important;\n\t\tfont-style: normal !important;\n\t\tfont-weight: 700 !important;\n\t\tline-height: 1.5 !important;\n\t\tmargin: 0 !important;\n\t\tmax-width: var(--sds-typography-max-line-width) !important;\n\t}\n\n\t::slotted([slot='message']),\n\t::slotted(:is(p)) {\n\t\tcolor: var(--sds-color-semantic-text-default) !important;\n\t\tfont-size: 1rem !important;\n\t\tfont-style: normal !important;\n\t\tfont-weight: 400 !important;\n\t\tline-height: 1.5 !important;\n\t\tmargin: 0 !important;\n\t\tmax-width: var(--sds-typography-max-line-width) !important;\n\t}\n\n\t.sds-notification__icon {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tz-index: 1;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tbackground-color: black;\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\tz-index: -1;\n\t\t}\n\t}\n\n\t.sds-notification__remove-btn {\n\t\tborder: 0;\n\t\tborder-radius: var(--sds-radius-4);\n\t\tbackground: transparent;\n\t\tcursor: pointer;\n\t\tflex: 0 1 auto;\n\t\tpadding: 0;\n\t\twidth: 24px;\n\t\theight: 24px;\n\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:focus {\n\t\t\toutline: 2px solid var(--sds-color-semantic-surface-action-default);\n\t\t\toutline-offset: 1px;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-action-subtle);\n\t\t\tborder: 2px solid var(--sds-color-semantic-surface-action-hover);\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-action-active);\n\t\t\tborder: 2px solid var(--sds-color-semantic-surface-action-active);\n\t\t\tcolor: var(--sds-color-semantic-text-on-action);\n\t\t\toutline: 0;\n\t\t}\n\t}\n`;\n"]}
1
+ {"version":3,"file":"sds-notification.styles.js","sourceRoot":"","sources":["../../src/sds-notification/sds-notification.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyIxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-notification-background-color: var(--sds-notification-background-color, var(--sds-color-alert-info-surface-tinted));\n\n\t\t--_sds-notification-border-color: var(--sds-notification-border-color, var(--sds-color-alert-info-border-default));\n\t\t--_sds-notification-border-radius: var(--sds-notification-border-radius, var(--sds-radius-sm));\n\t\t--_sds-notification-border-width: var(--sds-notification-border-width, var(--sds-border-sm));\n\n\t\t--_sds-notification-column-gap: var(--sds-notification-column-gap, var(--sds-spacing-2xs));\n\t\t--_sds-notification-content-gap: var(--sds-notification-content-gap, var(--sds-spacing-3xs));\n\n\t\t--_sds-notification-font-family: var(--sds-notification-font-family, var(--sds-typography-font-family-roboto));\n\t\t--_sds-notification-font-size: var(--sds-notification-font-size, var(--sds-components-font-size-md));\n\t\t--_sds-notification-font-weight: var(--sds-notification-font-weight, var(--sds-typography-body-md-desktop-font-weight));\n\t\t--_sds-notification-line-height: var(--sds-notification-line-height, var(--sds-components-line-height-squeezed-md));\n\t\t--_sds-notification-text-color: var(--sds-notification-text-color, var(--sds-color-alert-info-text-default));\n\n\t\t--_sds-notification-title-font-size: var(--sds-notification-title-font-size, var(--sds-typography-body-lg-desktop-tall-font-size));\n\t\t--_sds-notification-title-font-weight: var(--sds-notification-title-font-weight, var(--sds-typography-body-lg-strong-tall-desktop-font-weight));\n\t\t--_sds-notification-title-line-height: var(--sds-notification-title-line-height, var(--sds-typography-body-lg-strong-tall-desktop-line-height));\n\n\t\t--_sds-notification-icon-color: var(--sds-notification-icon-color, var(--sds-color-alert-info-text-subtle));\n\t\t--_sds-notification-max-line-width: var(--sds-notification-max-line-width, var(--sds-typography-max-line-width));\n\t\t--_sds-notification-padding: var(--sds-notification-padding, var(--sds-spacing-sm));\n\t\t--_sds-notification-remove-btn-radius: var(--sds-notification-remove-btn-radius, var(--sds-radius-xs));\n\n\t\tdisplay: block;\n\t}\n\n\t.sds-notification {\n\t\tdisplay: flex;\n\t\tgap: var(--_sds-notification-column-gap);\n\t\tpadding: var(--_sds-notification-padding);\n\n\t\tbackground-color: var(--_sds-notification-background-color);\n\t\tborder: var(--_sds-notification-border-width) solid var(--_sds-notification-border-color);\n\t\tborder-radius: var(--_sds-notification-border-radius);\n\t\tcolor: var(--_sds-notification-text-color);\n\n\t\tfont-family: var(--_sds-notification-font-family);\n\t\ttext-align: left;\n\t}\n\n\t.sds-notification__type {\n\t\tcolor: var(--_sds-notification-icon-color);\n\t}\n\n\t.sds-notification__content {\n\t\talign-self: center;\n\t\tdisplay: flex;\n\t\tflex: 1;\n\t\tflex-direction: column;\n\t\tgap: var(--_sds-notification-content-gap);\n\t}\n\n\t.sds-notification__actions {\n\t\t--sds-button-padding-inline: 0;\n\t}\n\n\t.sds-notification__icon {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tz-index: 1;\n\t}\n\n\t:host([variant='success']) {\n\t\t--_sds-notification-background-color: var(--sds-notification-background-color, var(--sds-color-alert-success-surface-tinted));\n\t\t--_sds-notification-border-color: var(--sds-notification-border-color, var(--sds-color-alert-success-border-default));\n\t\t--_sds-notification-text-color: var(--sds-notification-text-color, var(--sds-color-alert-attention-text-default));\n\t\t--_sds-notification-icon-color: var(--sds-notification-icon-color, var(--sds-color-alert-success-text-subtle));\n\n\t\tsds-button {\n\t\t\t--sds-button-text-color: var(--sds-color-alert-success-action-default);\n\t\t}\n\n\t\tsds-button:hover {\n\t\t\t--sds-button-background-color: var(--sds-color-alert-success-surface-hover);\n\t\t\t--sds-button-border-color: var(--sds-color-alert-success-surface-hover);\n\t\t}\n\n\t\tsds-button:active {\n\t\t\t--sds-button-background-color: var(--sds-color-alert-success-surface-active);\n\t\t\t--sds-button-border-color: var(--sds-color-alert-success-surface-active);\n\t\t}\n\t}\n\n\t:host([variant='warning']), /* Deprecated */\n\t:host([variant='attention']) {\n\t\t--_sds-notification-background-color: var(--sds-notification-background-color, var(--sds-color-alert-attention-surface-tinted));\n\t\t--_sds-notification-border-color: var(--sds-notification-border-color, var(--sds-color-alert-attention-border-default));\n\t\t--_sds-notification-text-color: var(--sds-notification-text-color, var(--sds-color-alert-attention-text-default));\n\t\t--_sds-notification-icon-color: var(--sds-notification-icon-color, var(--sds-color-alert-attention-text-subtle));\n\n\t\tsds-button {\n\t\t\t--sds-button-text-color: var(--sds-color-alert-attention-border-default);\n\t\t}\n\n\t\tsds-button:hover {\n\t\t\t--sds-button-background-color: var(--sds-color-alert-attention-surface-hover);\n\t\t\t--sds-button-border-color: var(--sds-color-alert-attention-surface-hover);\n\t\t}\n\n\t\tsds-button:active {\n\t\t\t--sds-button-background-color: var(--sds-color-alert-attention-surface-active);\n\t\t\t--sds-button-border-color: var(--sds-color-alert-attention-surface-active);\n\t\t}\n\t}\n\n\t:host([variant='critical']), /* Deprecated */\n\t:host([variant='danger']) {\n\t\t--_sds-notification-background-color: var(--sds-notification-background-color, var(--sds-color-alert-danger-surface-tinted));\n\t\t--_sds-notification-border-color: var(--sds-notification-border-color, var(--sds-color-alert-danger-border-default));\n\t\t--_sds-notification-text-color: var(--sds-notification-text-color, var(--sds-color-alert-danger-text-default));\n\t\t--_sds-notification-icon-color: var(--sds-notification-icon-color, var(--sds-color-alert-danger-text-subtle));\n\t}\n\n\t::slotted([slot='title']),\n\t::slotted(:is(h1, h2, h3, h4, h5, h6)) {\n\t\tcolor: var(--_sds-notification-text-color) !important;\n\t\tfont-size: var(--_sds-notification-title-font-size) !important;\n\t\tfont-style: normal !important;\n\t\tfont-weight: var(--_sds-notification-title-font-weight) !important;\n\t\tline-height: var(--_sds-notification-title-line-height) !important;\n\t\tmargin: 0 !important;\n\t\tmax-width: var(--_sds-notification-max-line-width) !important;\n\t}\n\n\t::slotted([slot='message']),\n\t::slotted(:is(p)) {\n\t\tcolor: var(--_sds-notification-text-color) !important;\n\t\tfont-size: var(--_sds-notification-font-size) !important;\n\t\tfont-style: normal !important;\n\t\tfont-weight: var(--_sds-notification-font-weight) !important;\n\t\tline-height: var(--_sds-notification-line-height) !important;\n\t\tmargin: 0 !important;\n\t\tmax-width: var(--_sds-notification-max-line-width) !important;\n\t}\n`;\n"]}
@@ -5,9 +5,9 @@ export const styles = css `
5
5
  }
6
6
 
7
7
  .sds-paragraph {
8
- font-family: var(--sds-typography-font-family);
8
+ font-family: var(--sds-typography-body-md-font-family);
9
9
  font-weight: 400;
10
- color: var(--sds-color-semantic-text-default);
10
+ color: var(--sds-color-primary-text-default);
11
11
  margin: 0;
12
12
  max-width: var(--sds-typography-max-line-width);
13
13
  padding: 0;
@@ -1 +1 @@
1
- {"version":3,"file":"sds-paragraph.styles.js","sourceRoot":"","sources":["../../src/sds-paragraph/sds-paragraph.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.sds-paragraph {\n\t\tfont-family: var(--sds-typography-font-family);\n\t\tfont-weight: 400;\n\t\tcolor: var(--sds-color-semantic-text-default);\n\t\tmargin: 0;\n\t\tmax-width: var(--sds-typography-max-line-width);\n\t\tpadding: 0;\n\t}\n\n\t.sds-paragraph--xl {\n\t\tfont-size: 1.25rem;\n\t\tline-height: 1.4;\n\t}\n\n\t.sds-paragraph--l {\n\t\tfont-size: 1.125rem;\n\t\tline-height: 1.333;\n\t}\n\n\t.sds-paragraph--m {\n\t\tfont-size: 1rem;\n\t\tline-height: 1.5;\n\t}\n\n\t@media (max-width: 640px) {\n\t\t.sds-paragraph--m {\n\t\t\tline-height: 1.375;\n\t\t}\n\t}\n`;\n"]}
1
+ {"version":3,"file":"sds-paragraph.styles.js","sourceRoot":"","sources":["../../src/sds-paragraph/sds-paragraph.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.sds-paragraph {\n\t\tfont-family: var(--sds-typography-body-md-font-family);\n\t\tfont-weight: 400;\n\t\tcolor: var(--sds-color-primary-text-default);\n\t\tmargin: 0;\n\t\tmax-width: var(--sds-typography-max-line-width);\n\t\tpadding: 0;\n\t}\n\n\t.sds-paragraph--xl {\n\t\tfont-size: 1.25rem;\n\t\tline-height: 1.4;\n\t}\n\n\t.sds-paragraph--l {\n\t\tfont-size: 1.125rem;\n\t\tline-height: 1.333;\n\t}\n\n\t.sds-paragraph--m {\n\t\tfont-size: 1rem;\n\t\tline-height: 1.5;\n\t}\n\n\t@media (max-width: 640px) {\n\t\t.sds-paragraph--m {\n\t\t\tline-height: 1.375;\n\t\t}\n\t}\n`;\n"]}
@@ -1,4 +1,6 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
+ import { SDS_SIZES } from '../types';
3
+ type RadioSize = Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;
2
4
  export interface SDSRadioProps {
3
5
  disabled?: boolean;
4
6
  required?: boolean;
@@ -8,6 +10,9 @@ export interface SDSRadioProps {
8
10
  value?: string;
9
11
  checked?: boolean;
10
12
  error?: boolean;
13
+ readonly?: boolean;
14
+ size?: RadioSize;
15
+ 'help-text'?: string;
11
16
  onChange?: (event: CustomEvent<{
12
17
  checked: boolean;
13
18
  value?: string;
@@ -27,6 +32,9 @@ export declare class SDSRadio extends LitElement {
27
32
  value: string;
28
33
  checked: boolean;
29
34
  error: boolean;
35
+ readOnly: boolean;
36
+ size: RadioSize;
37
+ helpText?: string;
30
38
  control: HTMLInputElement;
31
39
  private _initialChecked;
32
40
  constructor();
@@ -62,4 +70,5 @@ declare global {
62
70
  'sds-radio': SDSRadio;
63
71
  }
64
72
  }
73
+ export {};
65
74
  //# sourceMappingURL=sds-radio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sds-radio.d.ts","sourceRoot":"","sources":["../../src/sds-radio/sds-radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;AAOhE,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;IAC9E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACtC;AAED,qBACa,QAAS,SAAQ,UAAU;IAEvC,OAAgB,MAAM,4BAAY;IAElC,MAAM,CAAC,cAAc,UAAQ;IAC7B,SAAgB,SAAS,EAAE,gBAAgB,CAAC;IAEA,QAAQ,EAAE,OAAO,C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,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD"}
@@ -20,9 +20,11 @@ let SDSRadio = class SDSRadio extends LitElement {
20
20
  this.value = 'on';
21
21
  this.checked = false;
22
22
  this.error = false;
23
+ this.readOnly = false;
24
+ this.size = 'md';
23
25
  this._initialChecked = false;
24
26
  this._handleKeydown = (event) => {
25
- if (!this.name || this.disabled)
27
+ if (!this.name || this.disabled || this.readOnly)
26
28
  return;
27
29
  const root = this.getRootNode();
28
30
  const radios = Array.from(root.querySelectorAll(`sds-radio[name="${this.name}"]`));
@@ -48,15 +50,18 @@ let SDSRadio = class SDSRadio extends LitElement {
48
50
  event.preventDefault();
49
51
  };
50
52
  this._handleChange = (event) => {
51
- if (!this.disabled) {
52
- const elem = event.target;
53
- this.checked = elem.checked;
54
- if (this.checked) {
55
- this._uncheckSiblings();
56
- }
57
- this._updateGroupValidation();
58
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
53
+ if (this.disabled || this.readOnly) {
54
+ event.target.checked = this.checked;
55
+ event.preventDefault();
56
+ return;
59
57
  }
58
+ const elem = event.target;
59
+ this.checked = elem.checked;
60
+ if (this.checked) {
61
+ this._uncheckSiblings();
62
+ }
63
+ this._updateGroupValidation();
64
+ this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
60
65
  };
61
66
  this._handleFocus = (event) => {
62
67
  event.stopImmediatePropagation();
@@ -68,7 +73,7 @@ let SDSRadio = class SDSRadio extends LitElement {
68
73
  };
69
74
  this._handleClick = (event) => {
70
75
  event.stopImmediatePropagation();
71
- if (event.currentTarget === event.target && !this.disabled) {
76
+ if (event.currentTarget === event.target && !this.disabled && !this.readOnly) {
72
77
  this.shadowRoot?.querySelector('input')?.click();
73
78
  }
74
79
  };
@@ -106,10 +111,7 @@ let SDSRadio = class SDSRadio extends LitElement {
106
111
  if (!radio.control)
107
112
  return;
108
113
  if (isAnyRequired) {
109
- isAnyChecked
110
- ? radio.internals.setValidity({})
111
- : radio.internals.setValidity({ valueMissing: true }, radio.control.validationMessage, radio.control);
112
- radio.internals.setValidity(isAnyChecked ? {} : { valueMissing: true }, isAnyChecked ? 'Error' : radio.control.validationMessage, ...(radio.control ? [radio.control] : []));
114
+ radio.internals.setValidity(isAnyChecked ? {} : { valueMissing: true }, isAnyChecked ? '' : radio.control.validationMessage, radio.control);
113
115
  }
114
116
  else {
115
117
  radio.internals.setValidity({});
@@ -148,9 +150,8 @@ let SDSRadio = class SDSRadio extends LitElement {
148
150
  radio.checked = false;
149
151
  radio.internals.setFormValue(null);
150
152
  const input = radio.shadowRoot?.querySelector('#control');
151
- if (input) {
153
+ if (input)
152
154
  input.checked = false;
153
- }
154
155
  }
155
156
  });
156
157
  }
@@ -192,7 +193,7 @@ let SDSRadio = class SDSRadio extends LitElement {
192
193
  this.shadowRoot?.querySelector('input')?.blur();
193
194
  }
194
195
  click() {
195
- if (!this.disabled)
196
+ if (!this.disabled && !this.readOnly)
196
197
  this.shadowRoot?.querySelector('input')?.click();
197
198
  }
198
199
  render() {
@@ -206,22 +207,22 @@ let SDSRadio = class SDSRadio extends LitElement {
206
207
  };
207
208
  return html `
208
209
  <div class="${classMap(radioClasses)}" @click="${this._handleClick}">
209
- <label class="sds-radio__label">
210
- <input
211
- id="control"
212
- type="radio"
213
- name="${ifDefined(this.name)}"
214
- value="${ifDefined(this.value)}"
215
- ?checked="${this.checked}"
216
- ?disabled="${this.disabled}"
217
- ?required="${this.required}"
218
- @change="${this._handleChange}"
219
- @focus="${this._handleFocus}"
220
- @blur="${this._handleBlur}"
221
- class="${classMap(inputClasses)}"
222
- />
223
- ${this.label ? html `<span class="sds-radio__text">${this.label}</span>` : nothing}
224
- </label>
210
+ <input
211
+ id="control"
212
+ type="radio"
213
+ name="${ifDefined(this.name)}"
214
+ value="${ifDefined(this.value)}"
215
+ ?checked="${this.checked}"
216
+ ?disabled="${this.disabled}"
217
+ ?required="${this.required}"
218
+ ?readonly="${this.readOnly}"
219
+ @change="${this._handleChange}"
220
+ @focus="${this._handleFocus}"
221
+ @blur="${this._handleBlur}"
222
+ class="${classMap(inputClasses)}"
223
+ />
224
+ ${this.label ? html `<label class="sds-radio__label" for="control">${this.label}</label>` : nothing}
225
+ ${this.helpText ? html `<span class="sds-radio__help-text">${this.helpText}</span>` : nothing}
225
226
  </div>
226
227
  `;
227
228
  }
@@ -253,6 +254,15 @@ __decorate([
253
254
  __decorate([
254
255
  property({ type: Boolean, reflect: true })
255
256
  ], SDSRadio.prototype, "error", void 0);
257
+ __decorate([
258
+ property({ type: Boolean, attribute: 'readonly', reflect: true })
259
+ ], SDSRadio.prototype, "readOnly", void 0);
260
+ __decorate([
261
+ property({ type: String, reflect: true })
262
+ ], SDSRadio.prototype, "size", void 0);
263
+ __decorate([
264
+ property({ type: String, attribute: 'help-text' })
265
+ ], SDSRadio.prototype, "helpText", void 0);
256
266
  __decorate([
257
267
  query('#control')
258
268
  ], SDSRadio.prototype, "control", void 0);