@helsenorge/designsystem-react 14.0.0-beta.4 → 14.0.0-beta.9

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 (178) hide show
  1. package/lib/CHANGELOG.md +63 -2
  2. package/lib/Checkbox.js +11 -1
  3. package/lib/Checkbox.js.map +1 -1
  4. package/lib/Drawer.js +24 -24
  5. package/lib/Drawer.js.map +1 -1
  6. package/lib/Expander.js +6 -2
  7. package/lib/Expander.js.map +1 -1
  8. package/lib/FormGroup.js +4 -3
  9. package/lib/FormGroup.js.map +1 -1
  10. package/lib/HelpTriggerIcon.js +117 -42
  11. package/lib/HelpTriggerIcon.js.map +1 -1
  12. package/lib/InfoTeaser.js +2 -1
  13. package/lib/InfoTeaser.js.map +1 -1
  14. package/lib/Input.js +5 -1
  15. package/lib/Input.js.map +1 -1
  16. package/lib/LazyIcon.js +14 -8
  17. package/lib/LazyIcon.js.map +1 -1
  18. package/lib/LinkList.js.map +1 -1
  19. package/lib/Select.js +5 -1
  20. package/lib/Select.js.map +1 -1
  21. package/lib/StatusDot.js +20 -15
  22. package/lib/StatusDot.js.map +1 -1
  23. package/lib/Textarea.js +5 -1
  24. package/lib/Textarea.js.map +1 -1
  25. package/lib/components/Checkbox/styles.module.scss +4 -0
  26. package/lib/components/Checkbox/styles.module.scss.d.ts +1 -0
  27. package/lib/components/Drawer/styles.module.scss +6 -0
  28. package/lib/components/Expander/styles.module.scss +16 -7
  29. package/lib/components/Expander/styles.module.scss.d.ts +2 -1
  30. package/lib/components/ExpanderHierarchy/Expander.d.ts +2 -0
  31. package/lib/components/ExpanderHierarchy/index.js +2 -1
  32. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  33. package/lib/components/FormGroup/FormGroup.d.ts +5 -0
  34. package/lib/components/HelpTeaser/HelpTeaser.d.ts +2 -0
  35. package/lib/components/HelpTeaser/index.js +2 -1
  36. package/lib/components/HelpTeaser/index.js.map +1 -1
  37. package/lib/components/HelpTriggerIcon/HelpSign.d.ts +3 -1
  38. package/lib/components/Icons/AdditionalIconInformation.d.ts +41 -5
  39. package/lib/components/Icons/AdditionalIconInformation.js +41 -5
  40. package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
  41. package/lib/components/Icons/Attachment.js +1 -11
  42. package/lib/components/Icons/Attachment.js.map +1 -1
  43. package/lib/components/Icons/Change.js +2 -6
  44. package/lib/components/Icons/Change.js.map +1 -1
  45. package/lib/components/Icons/DotAttachment.d.ts +3 -0
  46. package/lib/components/Icons/DotAttachment.js +22 -0
  47. package/lib/components/Icons/DotAttachment.js.map +1 -0
  48. package/lib/components/Icons/DotCheckmark.d.ts +3 -0
  49. package/lib/components/Icons/{DotSuccess.js → DotCheckmark.js} +4 -4
  50. package/lib/components/Icons/DotCheckmark.js.map +1 -0
  51. package/lib/components/Icons/DotCircleArrows.d.ts +3 -0
  52. package/lib/components/Icons/DotCircleArrows.js +18 -0
  53. package/lib/components/Icons/DotCircleArrows.js.map +1 -0
  54. package/lib/components/Icons/DotDot.d.ts +3 -0
  55. package/lib/components/Icons/{DotPending.js → DotDot.js} +4 -4
  56. package/lib/components/Icons/DotDot.js.map +1 -0
  57. package/lib/components/Icons/DotExclamationMark.d.ts +3 -0
  58. package/lib/components/Icons/{DotAlert.js → DotExclamationMark.js} +4 -4
  59. package/lib/components/Icons/DotExclamationMark.js.map +1 -0
  60. package/lib/components/Icons/DotFill.d.ts +3 -0
  61. package/lib/components/Icons/{DotActive.js → DotFill.js} +4 -4
  62. package/lib/components/Icons/DotFill.js.map +1 -0
  63. package/lib/components/Icons/DotGroup.d.ts +3 -0
  64. package/lib/components/Icons/DotGroup.js +22 -0
  65. package/lib/components/Icons/DotGroup.js.map +1 -0
  66. package/lib/components/Icons/DotLogin.d.ts +3 -0
  67. package/lib/components/Icons/DotLogin.js +14 -0
  68. package/lib/components/Icons/DotLogin.js.map +1 -0
  69. package/lib/components/Icons/DotNoAccess.d.ts +3 -0
  70. package/lib/components/Icons/DotNoAccess.js +30 -0
  71. package/lib/components/Icons/DotNoAccess.js.map +1 -0
  72. package/lib/components/Icons/DotNoEye.d.ts +3 -0
  73. package/lib/components/Icons/DotNoEye.js +14 -0
  74. package/lib/components/Icons/DotNoEye.js.map +1 -0
  75. package/lib/components/Icons/DotOutline.d.ts +3 -0
  76. package/lib/components/Icons/{DotInactive.js → DotOutline.js} +4 -4
  77. package/lib/components/Icons/DotOutline.js.map +1 -0
  78. package/lib/components/Icons/DotPencil.d.ts +3 -0
  79. package/lib/components/Icons/DotPencil.js +22 -0
  80. package/lib/components/Icons/DotPencil.js.map +1 -0
  81. package/lib/components/Icons/DotTriangle.d.ts +3 -0
  82. package/lib/components/Icons/{DotWarningTriangle.js → DotTriangle.js} +4 -4
  83. package/lib/components/Icons/DotTriangle.js.map +1 -0
  84. package/lib/components/Icons/DotX.d.ts +3 -0
  85. package/lib/components/Icons/{DotCancelled.js → DotX.js} +4 -4
  86. package/lib/components/Icons/DotX.js.map +1 -0
  87. package/lib/components/Icons/Group.js +2 -2
  88. package/lib/components/Icons/Group.js.map +1 -1
  89. package/lib/components/Icons/IconNames.d.ts +1 -1
  90. package/lib/components/Icons/IconNames.js +14 -8
  91. package/lib/components/Icons/IconNames.js.map +1 -1
  92. package/lib/components/Icons/Login.js +1 -3
  93. package/lib/components/Icons/Login.js.map +1 -1
  94. package/lib/components/Icons/NoAccess.js +7 -15
  95. package/lib/components/Icons/NoAccess.js.map +1 -1
  96. package/lib/components/Icons/NoEye.js +10 -2
  97. package/lib/components/Icons/NoEye.js.map +1 -1
  98. package/lib/components/Icons/Pencil.js +1 -11
  99. package/lib/components/Icons/Pencil.js.map +1 -1
  100. package/lib/components/InfoTeaser/InfoTeaser.d.ts +2 -0
  101. package/lib/components/InfoTeaser/styles.module.scss +0 -2
  102. package/lib/components/Label/Label.d.ts +2 -0
  103. package/lib/components/Label/styles.module.scss +1 -1
  104. package/lib/components/Label/utils.d.ts +21 -2
  105. package/lib/components/RadioButton/styles.module.scss +4 -0
  106. package/lib/components/RadioButton/styles.module.scss.d.ts +1 -0
  107. package/lib/components/Select/styles.module.scss +2 -0
  108. package/lib/components/StatusDot/constants.d.ts +2 -1
  109. package/lib/components/StatusDot/styles.module.scss +4 -2
  110. package/lib/components/StatusDot/styles.module.scss.d.ts +1 -0
  111. package/lib/components/Table/styles.module.scss +1 -1
  112. package/lib/components/Title/styles.module.scss +0 -1
  113. package/lib/components/Toggle/index.js +9 -9
  114. package/lib/components/Toggle/index.js.map +1 -1
  115. package/lib/floating-ui.react.js +7 -3
  116. package/lib/floating-ui.react.js.map +1 -1
  117. package/lib/resources/HN.Designsystem.ArticleTeaser.en-GB.json.d.ts +7 -0
  118. package/lib/resources/HN.Designsystem.ArticleTeaser.nb-NO.json.d.ts +7 -0
  119. package/lib/resources/HN.Designsystem.Drawer.en-GB.json.d.ts +6 -0
  120. package/lib/resources/HN.Designsystem.Drawer.nb-NO.json.d.ts +6 -0
  121. package/lib/resources/HN.Designsystem.Dropdown.en-GB.json.d.ts +6 -0
  122. package/lib/resources/HN.Designsystem.Dropdown.nb-NO.json.d.ts +6 -0
  123. package/lib/resources/HN.Designsystem.FavoriteButton.nb-NO.json.d.ts +6 -0
  124. package/lib/resources/HN.Designsystem.FormFieldTag.en-GB.json.d.ts +12 -0
  125. package/lib/resources/HN.Designsystem.FormFieldTag.nb-NO.json.d.ts +12 -0
  126. package/lib/resources/HN.Designsystem.FormFieldTag.nn-NO.json.d.ts +12 -0
  127. package/lib/resources/HN.Designsystem.FormFieldTag.se-NO.json.d.ts +12 -0
  128. package/lib/resources/HN.Designsystem.HelpBubble.nb-NO.json.d.ts +6 -0
  129. package/lib/resources/HN.Designsystem.HelpDrawer.nb-NO.json.d.ts +6 -0
  130. package/lib/resources/HN.Designsystem.InfoTeaser.en-GB.json.d.ts +7 -0
  131. package/lib/resources/HN.Designsystem.InfoTeaser.nb-NO.json.d.ts +7 -0
  132. package/lib/resources/HN.Designsystem.Input.en-GB.json.d.ts +6 -0
  133. package/lib/resources/HN.Designsystem.Input.nb-NO.json.d.ts +6 -0
  134. package/lib/resources/HN.Designsystem.Input.nn-NO.json.d.ts +6 -0
  135. package/lib/resources/HN.Designsystem.LinkList.en-GB.json.d.ts +6 -0
  136. package/lib/resources/HN.Designsystem.LinkList.nb-NO.json.d.ts +6 -0
  137. package/lib/resources/HN.Designsystem.Panel.en-GB.json.d.ts +7 -0
  138. package/lib/resources/HN.Designsystem.Panel.nb-NO.json.d.ts +7 -0
  139. package/lib/resources/HN.Designsystem.Tabs.en-GB.json.d.ts +7 -0
  140. package/lib/resources/HN.Designsystem.Tabs.nb-NO.json.d.ts +7 -0
  141. package/lib/resources/HN.Designsystem.TextArea.en-GB.json.d.ts +6 -0
  142. package/lib/resources/HN.Designsystem.TextArea.nb-NO.json.d.ts +6 -0
  143. package/lib/resources/HN.Designsystem.TextArea.nn-NO.json.d.ts +6 -0
  144. package/lib/resources/index.d.ts +1 -0
  145. package/lib/scss/_font-mixins.scss +2 -0
  146. package/lib/scss/_print.scss +3 -3
  147. package/lib/scss/_radio-reset.scss +1 -1
  148. package/lib/scss/_screen-reader.scss +7 -10
  149. package/lib/useElementList.js +15 -2
  150. package/lib/useElementList.js.map +1 -1
  151. package/lib/utils2.js +54 -50
  152. package/lib/utils2.js.map +1 -1
  153. package/lib/utils3.js +10 -1
  154. package/lib/utils3.js.map +1 -1
  155. package/package.json +3 -3
  156. package/scss/_font-mixins.scss +2 -0
  157. package/scss/_print.scss +3 -3
  158. package/scss/_radio-reset.scss +1 -1
  159. package/scss/_screen-reader.scss +7 -10
  160. package/lib/components/Icons/DotActive.d.ts +0 -3
  161. package/lib/components/Icons/DotActive.js.map +0 -1
  162. package/lib/components/Icons/DotAlert.d.ts +0 -3
  163. package/lib/components/Icons/DotAlert.js.map +0 -1
  164. package/lib/components/Icons/DotCancelled.d.ts +0 -3
  165. package/lib/components/Icons/DotCancelled.js.map +0 -1
  166. package/lib/components/Icons/DotInactive.d.ts +0 -3
  167. package/lib/components/Icons/DotInactive.js.map +0 -1
  168. package/lib/components/Icons/DotPending.d.ts +0 -3
  169. package/lib/components/Icons/DotPending.js.map +0 -1
  170. package/lib/components/Icons/DotSuccess.d.ts +0 -3
  171. package/lib/components/Icons/DotSuccess.js.map +0 -1
  172. package/lib/components/Icons/DotTransparent.d.ts +0 -3
  173. package/lib/components/Icons/DotTransparent.js +0 -22
  174. package/lib/components/Icons/DotTransparent.js.map +0 -1
  175. package/lib/components/Icons/DotWarningTriangle.d.ts +0 -3
  176. package/lib/components/Icons/DotWarningTriangle.js.map +0 -1
  177. package/lib/scss/_figma-tokens.scss +0 -68
  178. package/scss/_figma-tokens.scss +0 -68
package/lib/StatusDot.js CHANGED
@@ -29,6 +29,7 @@ let StatusDotVariant = /* @__PURE__ */ function(StatusDotVariant$1) {
29
29
  StatusDotVariant$1["active"] = "active";
30
30
  StatusDotVariant$1["pending"] = "pending";
31
31
  StatusDotVariant$1["inactive"] = "inactive";
32
+ StatusDotVariant$1["ready"] = "ready";
32
33
  return StatusDotVariant$1;
33
34
  }({});
34
35
  var StatusDotIcon = ({ onColor, variant = "info" }) => {
@@ -44,7 +45,7 @@ var StatusDotIcon = ({ onColor, variant = "info" }) => {
44
45
  switch (variant) {
45
46
  case StatusDotVariant.success: return /* @__PURE__ */ jsx(LazyIcon, {
46
47
  ...iconProps,
47
- iconName: "DotSuccess"
48
+ iconName: "DotCheckmark"
48
49
  });
49
50
  case StatusDotVariant.inprocess: return /* @__PURE__ */ jsx(LazyIcon, {
50
51
  ...iconProps,
@@ -52,7 +53,7 @@ var StatusDotIcon = ({ onColor, variant = "info" }) => {
52
53
  });
53
54
  case StatusDotVariant.exception: return /* @__PURE__ */ jsx(LazyIcon, {
54
55
  ...iconProps,
55
- iconName: "DotWarningTriangle"
56
+ iconName: "DotTriangle"
56
57
  });
57
58
  case StatusDotVariant.unknown: return /* @__PURE__ */ jsx(LazyIcon, {
58
59
  ...iconProps,
@@ -64,15 +65,15 @@ var StatusDotIcon = ({ onColor, variant = "info" }) => {
64
65
  });
65
66
  case StatusDotVariant.cancelled: return /* @__PURE__ */ jsx(LazyIcon, {
66
67
  ...iconProps,
67
- iconName: "DotCancelled"
68
+ iconName: "DotX"
68
69
  });
69
70
  case StatusDotVariant.alert: return /* @__PURE__ */ jsx(LazyIcon, {
70
71
  ...iconProps,
71
- iconName: "DotAlert"
72
+ iconName: "DotExclamationMark"
72
73
  });
73
74
  case StatusDotVariant.transparent: return /* @__PURE__ */ jsx(LazyIcon, {
74
75
  ...iconProps,
75
- iconName: "DotTransparent"
76
+ iconName: "DotOutline"
76
77
  });
77
78
  case StatusDotVariant.info: return /* @__PURE__ */ jsx(LazyIcon, {
78
79
  ...iconProps,
@@ -80,43 +81,47 @@ var StatusDotIcon = ({ onColor, variant = "info" }) => {
80
81
  });
81
82
  case StatusDotVariant.group: return /* @__PURE__ */ jsx(LazyIcon, {
82
83
  ...iconProps,
83
- iconName: "Group"
84
+ iconName: "DotGroup"
84
85
  });
85
86
  case StatusDotVariant.recurring: return /* @__PURE__ */ jsx(LazyIcon, {
86
87
  ...iconProps,
87
- iconName: "Change"
88
+ iconName: "DotCircleArrows"
88
89
  });
89
90
  case StatusDotVariant.noaccess: return /* @__PURE__ */ jsx(LazyIcon, {
90
91
  ...iconProps,
91
- iconName: "NoAccess"
92
+ iconName: "DotNoAccess"
92
93
  });
93
94
  case StatusDotVariant.draft: return /* @__PURE__ */ jsx(LazyIcon, {
94
95
  ...iconProps,
95
- iconName: "Pencil"
96
+ iconName: "DotPencil"
96
97
  });
97
98
  case StatusDotVariant.hidden: return /* @__PURE__ */ jsx(LazyIcon, {
98
99
  ...iconProps,
99
- iconName: "NoEye"
100
+ iconName: "DotNoEye"
100
101
  });
101
102
  case StatusDotVariant.login: return /* @__PURE__ */ jsx(LazyIcon, {
102
103
  ...iconProps,
103
- iconName: "Login"
104
+ iconName: "DotLogin"
104
105
  });
105
106
  case StatusDotVariant.attachment: return /* @__PURE__ */ jsx(LazyIcon, {
106
107
  ...iconProps,
107
- iconName: "Attachment"
108
+ iconName: "DotAttachment"
108
109
  });
109
110
  case StatusDotVariant.active: return /* @__PURE__ */ jsx(LazyIcon, {
110
111
  ...iconProps,
111
- iconName: "DotActive"
112
+ iconName: "DotFill"
112
113
  });
113
114
  case StatusDotVariant.pending: return /* @__PURE__ */ jsx(LazyIcon, {
114
115
  ...iconProps,
115
- iconName: "DotPending"
116
+ iconName: "DotDot"
116
117
  });
117
118
  case StatusDotVariant.inactive: return /* @__PURE__ */ jsx(LazyIcon, {
118
119
  ...iconProps,
119
- iconName: "DotInactive"
120
+ iconName: "DotOutline"
121
+ });
122
+ case StatusDotVariant.ready: return /* @__PURE__ */ jsx(LazyIcon, {
123
+ ...iconProps,
124
+ iconName: "DotOutline"
120
125
  });
121
126
  }
122
127
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"StatusDot.js","names":["StatusDotIcon: React.FC<StatusDotIconProps>","StatusDot: React.FC<StatusDotProps>"],"sources":["../src/components/StatusDot/constants.ts","../src/components/StatusDot/StatusDot.tsx","../src/components/StatusDot/index.ts"],"sourcesContent":["import { FormOnColor } from '../../constants';\n\nexport enum StatusDotOnColor {\n onwhite = FormOnColor.onwhite,\n ondark = FormOnColor.ondark,\n}\n\nexport enum StatusDotVariant {\n success = 'success',\n inprocess = 'inprocess',\n exception = 'exception',\n unknown = 'unknown',\n inspected = 'inspected',\n cancelled = 'cancelled',\n alert = 'alert',\n transparent = 'transparent',\n info = 'info',\n group = 'group',\n recurring = 'recurring',\n noaccess = 'noaccess',\n draft = 'draft',\n hidden = 'hidden',\n login = 'login',\n attachment = 'attachment',\n active = 'active',\n pending = 'pending',\n inactive = 'inactive',\n}\n","import classNames from 'classnames';\n\nimport { StatusDotOnColor, StatusDotVariant } from './constants';\nimport { IconSize } from '../..';\nimport { AnalyticsId } from '../../constants';\nimport { getColor } from '../../theme/currys';\nimport { LazyIcon } from '../LazyIcon';\n\nimport styles from './styles.module.scss';\n\nexport interface StatusDotIconProps {\n /** Defines the color of the icon */\n onColor?: keyof typeof StatusDotOnColor;\n /** The variant defines style formatting and what icon to use */\n variant?: keyof typeof StatusDotVariant;\n}\n\nconst StatusDotIcon: React.FC<StatusDotIconProps> = ({ onColor, variant = 'info' }) => {\n const color = onColor === StatusDotOnColor.ondark ? getColor('white') : getColor('black');\n const iconProps = {\n color,\n size: IconSize.XXSmall,\n onColor,\n className: classNames({\n [styles[`statusdot__dot--${variant}`]]: typeof variant !== 'undefined',\n [styles['statusdot__dot--on-dark']]: onColor === StatusDotOnColor.ondark,\n }),\n };\n\n switch (variant) {\n case StatusDotVariant.success:\n return <LazyIcon {...iconProps} iconName={'DotSuccess'} />;\n case StatusDotVariant.inprocess:\n return <LazyIcon {...iconProps} iconName={'DotHalfDisc'} />;\n case StatusDotVariant.exception:\n return <LazyIcon {...iconProps} iconName={'DotWarningTriangle'} />;\n case StatusDotVariant.unknown:\n return <LazyIcon {...iconProps} iconName={'DotQuestionMark'} />;\n case StatusDotVariant.inspected:\n return <LazyIcon {...iconProps} iconName={'DotLookingGlass'} />;\n case StatusDotVariant.cancelled:\n return <LazyIcon {...iconProps} iconName={'DotCancelled'} />;\n case StatusDotVariant.alert:\n return <LazyIcon {...iconProps} iconName={'DotAlert'} />;\n case StatusDotVariant.transparent:\n return <LazyIcon {...iconProps} iconName={'DotTransparent'} />;\n case StatusDotVariant.info:\n return <LazyIcon {...iconProps} iconName={'DotInfo'} />;\n case StatusDotVariant.group:\n return <LazyIcon {...iconProps} iconName={'Group'} />;\n case StatusDotVariant.recurring:\n return <LazyIcon {...iconProps} iconName={'Change'} />;\n case StatusDotVariant.noaccess:\n return <LazyIcon {...iconProps} iconName={'NoAccess'} />;\n case StatusDotVariant.draft:\n return <LazyIcon {...iconProps} iconName={'Pencil'} />;\n case StatusDotVariant.hidden:\n return <LazyIcon {...iconProps} iconName={'NoEye'} />;\n case StatusDotVariant.login:\n return <LazyIcon {...iconProps} iconName={'Login'} />;\n case StatusDotVariant.attachment:\n return <LazyIcon {...iconProps} iconName={'Attachment'} />;\n case StatusDotVariant.active:\n return <LazyIcon {...iconProps} iconName={'DotActive'} />;\n case StatusDotVariant.pending:\n return <LazyIcon {...iconProps} iconName={'DotPending'} />;\n case StatusDotVariant.inactive:\n return <LazyIcon {...iconProps} iconName={'DotInactive'} />;\n }\n\n return null;\n};\n\nexport interface StatusDotProps {\n /** id that is placed on the wrapper */\n id?: string;\n /** Defines the color mode, onwhite, ondark etc. */\n onColor?: keyof typeof StatusDotOnColor;\n /** Visual variants for the statusdot */\n variant?: keyof typeof StatusDotVariant;\n /** Text placed to the right of the statusdot */\n text: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the root element */\n ref?: React.Ref<HTMLElement | null>;\n}\n\nexport type StatusDotType = typeof StatusDot;\nconst StatusDot: React.FC<StatusDotProps> = (props: StatusDotProps) => {\n const { id, onColor = StatusDotOnColor.onwhite, variant = StatusDotVariant.info, text, className, testId, ref } = props;\n const statusDotClasses = classNames(styles['statusdot'], className);\n const labelClasses = classNames(styles['statusdot__label'], {\n [styles['statusdot__label--on-dark']]: onColor === StatusDotOnColor.ondark,\n });\n\n return (\n <span id={id} ref={ref} className={statusDotClasses} data-testid={testId} data-analyticsid={AnalyticsId.StatusDot}>\n <span className={styles['statusdot__dot']} data-testid={testId + '-dot'}>\n <StatusDotIcon onColor={onColor} variant={variant} />\n </span>\n <span className={labelClasses}>{text}</span>\n </span>\n );\n};\n\nexport default StatusDot;\n","import StatusDot from './StatusDot';\nexport { StatusDotOnColor, StatusDotVariant } from './constants';\nexport * from './StatusDot';\nexport default StatusDot;\n"],"mappings":";;;;;;AAEA,IAAY,mBAAA,yBAAA,oBAAL;AACL,oBAAA,mBAAA,aAAU,YAAY,WAAA;AACtB,oBAAA,mBAAA,YAAS,YAAY,UAAA;;;AAGvB,IAAY,mBAAA,yBAAA,oBAAL;AACL,oBAAA,aAAA;AACA,oBAAA,eAAA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,oBAAC,eAAA;IAAuB;IAAkB;KAAW;IAChD,EACP,oBAAC,QAAA;GAAK,WAAW;aAAe;IAAY,CAAA;GACvC;;ACrGX,IAAA,sBDyGe"}
1
+ {"version":3,"file":"StatusDot.js","names":["StatusDotIcon: React.FC<StatusDotIconProps>","StatusDot: React.FC<StatusDotProps>"],"sources":["../src/components/StatusDot/constants.ts","../src/components/StatusDot/StatusDot.tsx","../src/components/StatusDot/index.ts"],"sourcesContent":["import { FormOnColor } from '../../constants';\n\nexport enum StatusDotOnColor {\n onwhite = FormOnColor.onwhite,\n ondark = FormOnColor.ondark,\n}\n\nexport enum StatusDotVariant {\n success = 'success',\n inprocess = 'inprocess',\n exception = 'exception',\n unknown = 'unknown',\n inspected = 'inspected',\n cancelled = 'cancelled',\n alert = 'alert',\n transparent = 'transparent',\n info = 'info',\n group = 'group',\n recurring = 'recurring',\n noaccess = 'noaccess',\n draft = 'draft',\n hidden = 'hidden',\n login = 'login',\n attachment = 'attachment',\n active = 'active',\n pending = 'pending',\n inactive = 'inactive',\n ready = 'ready',\n}\n","import classNames from 'classnames';\n\nimport { StatusDotOnColor, StatusDotVariant } from './constants';\nimport { IconSize } from '../..';\nimport { AnalyticsId } from '../../constants';\nimport { getColor } from '../../theme/currys';\nimport { LazyIcon } from '../LazyIcon';\n\nimport styles from './styles.module.scss';\n\nexport interface StatusDotIconProps {\n /** Defines the color of the icon */\n onColor?: keyof typeof StatusDotOnColor;\n /** The variant defines style formatting and what icon to use */\n variant?: keyof typeof StatusDotVariant;\n}\n\nconst StatusDotIcon: React.FC<StatusDotIconProps> = ({ onColor, variant = 'info' }) => {\n const color = onColor === StatusDotOnColor.ondark ? getColor('white') : getColor('black');\n const iconProps = {\n color,\n size: IconSize.XXSmall,\n onColor,\n className: classNames({\n [styles[`statusdot__dot--${variant}`]]: typeof variant !== 'undefined',\n [styles['statusdot__dot--on-dark']]: onColor === StatusDotOnColor.ondark,\n }),\n };\n\n switch (variant) {\n case StatusDotVariant.success:\n return <LazyIcon {...iconProps} iconName={'DotCheckmark'} />;\n case StatusDotVariant.inprocess:\n return <LazyIcon {...iconProps} iconName={'DotHalfDisc'} />;\n case StatusDotVariant.exception:\n return <LazyIcon {...iconProps} iconName={'DotTriangle'} />;\n case StatusDotVariant.unknown:\n return <LazyIcon {...iconProps} iconName={'DotQuestionMark'} />;\n case StatusDotVariant.inspected:\n return <LazyIcon {...iconProps} iconName={'DotLookingGlass'} />;\n case StatusDotVariant.cancelled:\n return <LazyIcon {...iconProps} iconName={'DotX'} />;\n case StatusDotVariant.alert:\n return <LazyIcon {...iconProps} iconName={'DotExclamationMark'} />;\n case StatusDotVariant.transparent:\n return <LazyIcon {...iconProps} iconName={'DotOutline'} />;\n case StatusDotVariant.info:\n return <LazyIcon {...iconProps} iconName={'DotInfo'} />;\n case StatusDotVariant.group:\n return <LazyIcon {...iconProps} iconName={'DotGroup'} />;\n case StatusDotVariant.recurring:\n return <LazyIcon {...iconProps} iconName={'DotCircleArrows'} />;\n case StatusDotVariant.noaccess:\n return <LazyIcon {...iconProps} iconName={'DotNoAccess'} />;\n case StatusDotVariant.draft:\n return <LazyIcon {...iconProps} iconName={'DotPencil'} />;\n case StatusDotVariant.hidden:\n return <LazyIcon {...iconProps} iconName={'DotNoEye'} />;\n case StatusDotVariant.login:\n return <LazyIcon {...iconProps} iconName={'DotLogin'} />;\n case StatusDotVariant.attachment:\n return <LazyIcon {...iconProps} iconName={'DotAttachment'} />;\n case StatusDotVariant.active:\n return <LazyIcon {...iconProps} iconName={'DotFill'} />;\n case StatusDotVariant.pending:\n return <LazyIcon {...iconProps} iconName={'DotDot'} />;\n case StatusDotVariant.inactive:\n return <LazyIcon {...iconProps} iconName={'DotOutline'} />;\n case StatusDotVariant.ready:\n return <LazyIcon {...iconProps} iconName={'DotOutline'} />;\n }\n\n return null;\n};\n\nexport interface StatusDotProps {\n /** id that is placed on the wrapper */\n id?: string;\n /** Defines the color mode, onwhite, ondark etc. */\n onColor?: keyof typeof StatusDotOnColor;\n /** Visual variants for the statusdot */\n variant?: keyof typeof StatusDotVariant;\n /** Text placed to the right of the statusdot */\n text: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the root element */\n ref?: React.Ref<HTMLElement | null>;\n}\n\nexport type StatusDotType = typeof StatusDot;\nconst StatusDot: React.FC<StatusDotProps> = (props: StatusDotProps) => {\n const { id, onColor = StatusDotOnColor.onwhite, variant = StatusDotVariant.info, text, className, testId, ref } = props;\n const statusDotClasses = classNames(styles['statusdot'], className);\n const labelClasses = classNames(styles['statusdot__label'], {\n [styles['statusdot__label--on-dark']]: onColor === StatusDotOnColor.ondark,\n });\n\n return (\n <span id={id} ref={ref} className={statusDotClasses} data-testid={testId} data-analyticsid={AnalyticsId.StatusDot}>\n <span className={styles['statusdot__dot']} data-testid={testId + '-dot'}>\n <StatusDotIcon onColor={onColor} variant={variant} />\n </span>\n <span className={labelClasses}>{text}</span>\n </span>\n );\n};\n\nexport default StatusDot;\n","import StatusDot from './StatusDot';\nexport { StatusDotOnColor, StatusDotVariant } from './constants';\nexport * from './StatusDot';\nexport default StatusDot;\n"],"mappings":";;;;;;AAEA,IAAY,mBAAA,yBAAA,oBAAL;AACL,oBAAA,mBAAA,aAAU,YAAY,WAAA;AACtB,oBAAA,mBAAA,YAAS,YAAY,UAAA;;;AAGvB,IAAY,mBAAA,yBAAA,oBAAL;AACL,oBAAA,aAAA;AACA,oBAAA,eAAA;AACA,oBAAA,eAAA;AACA,oBAAA,aAAA;AACA,oBAAA,eAAA;AACA,oBAAA,eAAA;AACA,oBAAA,WAAA;AACA,oBAAA,iBAAA;AACA,oBAAA,UAAA;AACA,oBAAA,WAAA;AACA,oBAAA,eAAA;AACA,oBAAA,cAAA;AACA,oBAAA,WAAA;AACA,oBAAA,YAAA;AACA,oBAAA,WAAA;AACA,oBAAA,gBAAA;AACA,oBAAA,YAAA;AACA,oBAAA,aAAA;AACA,oBAAA,cAAA;AACA,o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: textareaWrapperClass,
88
88
  children: [
89
- renderLabel(label, textareaId, onColor),
89
+ renderLabel({
90
+ label,
91
+ inputId: textareaId,
92
+ onColor
93
+ }),
90
94
  /* @__PURE__ */ jsx("div", {
91
95
  className: contentWrapperClass,
92
96
  ref: referanse,
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","names":["Textarea: React.FC<TextareaProps>","mergedResources: HNDesignsystemTextArea"],"sources":["../src/resources/HN.Designsystem.TextArea.en-GB.json","../src/resources/HN.Designsystem.TextArea.nb-NO.json","../src/resources/HN.Designsystem.TextArea.nn-NO.json","../src/components/Textarea/resourceHelper.ts","../src/components/Textarea/Textarea.tsx","../src/components/Textarea/index.ts"],"sourcesContent":["{\n \"characters\": \"characters\"\n}\n","{\n \"characters\": \"tegn\"\n}\n","{\n \"characters\": \"teikn\"\n}\n","import type { HNDesignsystemTextArea } from '../../resources/Resources';\n\nimport { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.TextArea.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.TextArea.nb-NO.json';\nimport nnNO from '../../resources/HN.Designsystem.TextArea.nn-NO.json';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemTextArea => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN_NYNORSK:\n return nnNO;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import { useState, useRef, useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport type { HNDesignsystemTextArea } from '../../resources/Resources';\nimport type { ErrorWrapperClassNameProps } from '../ErrorWrapper';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, AVERAGE_CHARACTER_WIDTH_PX, FormOnColor, LanguageLocales } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { useLanguage } from '../../hooks/useLanguage';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper from '../ErrorWrapper';\nimport { renderLabel } from '../Label/utils';\nimport MaxCharacters from '../MaxCharacters/MaxCharacters';\n\nimport styles from './styles.module.scss';\n\nexport interface TextareaProps\n extends\n ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLTextAreaElement>,\n | 'aria-describedby'\n | 'autoFocus'\n | 'disabled'\n | 'name'\n | 'autoComplete'\n | 'placeholder'\n | 'readOnly'\n | 'required'\n | 'defaultValue'\n | 'onChange'\n | 'value'\n > {\n /** max character limit in textarea */\n maxCharacters?: number;\n /** Width of textarea in characters (approximate) */\n width?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** If true, the component will have a bottom margin. */\n marginBottom?: boolean;\n /** If true, the component will be transparent. */\n transparent?: boolean;\n /** Changes the visuals of the textarea */\n onColor?: keyof typeof FormOnColor;\n /** Label of the input */\n label?: React.ReactNode;\n /** id of the textarea */\n textareaId?: string;\n /** max rows */\n maxRows?: number;\n /** min rows */\n minRows?: number;\n /** auto-grows until maxRows */\n grow?: boolean;\n /** Activates Error style for the input */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Resources for component */\n resources?: Partial<HNDesignsystemTextArea>;\n /** Ref passed to the component */\n ref?: React.Ref<HTMLTextAreaElement | null>;\n}\n\nconst getTextareaMaxWidth = (characters: number): string => {\n const paddingWidth = '2rem';\n const scrollbarWidth = '16px';\n const borderWidth = '4px';\n\n return `calc(${characters * AVERAGE_CHARACTER_WIDTH_PX}px + ${paddingWidth} + ${scrollbarWidth} + ${borderWidth})`;\n};\n\nconst Textarea: React.FC<TextareaProps> = props => {\n const {\n maxCharacters,\n width,\n testId,\n defaultValue,\n marginBottom: gutterBottom,\n transparent,\n onColor = FormOnColor.onwhite,\n label,\n textareaId = uuid(),\n minRows = 3,\n maxRows = 10,\n grow,\n error,\n errorText,\n errorTextId: errorTextIdProp,\n errorWrapperClassName,\n autoFocus,\n disabled,\n name,\n autoComplete = 'off',\n placeholder,\n readOnly,\n required,\n onChange,\n value,\n resources,\n ref,\n ...rest\n } = props;\n\n const [rows, setRows] = useState(minRows);\n const [textareaInput, setTextareaInput] = useState(value || defaultValue || '');\n const referanse = useRef<HTMLDivElement>(null);\n const errorTextUuid = useIdWithFallback(errorTextIdProp);\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemTextArea = {\n ...defaultResources,\n ...resources,\n };\n\n useEffect(() => {\n setTextareaInput(defaultValue || '');\n }, [defaultValue]);\n\n const resizeHeight = (target: HTMLTextAreaElement): void => {\n const textareaLineHeight = 28;\n\n const previousRows = target.rows;\n target.rows = minRows; // reset number of rows in textarea\n\n const currentRows = Math.floor((target.scrollHeight - 16) / textareaLineHeight); // scrollHeight - 16px of padding to calculate the rows\n\n if (currentRows === previousRows) {\n target.rows = currentRows;\n }\n\n if (currentRows >= maxRows) {\n target.rows = maxRows;\n target.scrollTop = target.scrollHeight;\n }\n\n if (currentRows < maxRows) {\n setRows(currentRows);\n } else {\n setRows(maxRows);\n }\n };\n\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const maxCharactersExceeded = !!maxCharacters && textareaInput.toString().length > maxCharacters;\n const onError = onColor === FormOnColor.oninvalid || !!errorText || !!error || maxCharactersExceeded;\n\n const textareaWrapperClass = cn(styles.textarea, {\n [styles['textarea--gutterBottom']]: gutterBottom,\n });\n\n const contentWrapperClass = cn(styles['input-container'], {\n [styles['input-container--transparent']]: transparent,\n [styles['input-container--on-blueberry']]: onBlueberry,\n [styles['input-container--on-dark']]: onDark,\n [styles['input-container--invalid']]: onError,\n [styles['input-container--disabled']]: props.disabled,\n });\n\n const textareaClass = cn(styles['input-container__input'], {\n [styles[`input-container__input--disabled`]]: props.disabled,\n });\n\n useEffect(() => {\n if (value) setTextareaInput(value);\n\n if (grow && referanse.current?.children && referanse.current?.children[0]) {\n const textarea = referanse.current?.children[0] as HTMLTextAreaElement;\n resizeHeight(textarea);\n }\n }, [value]);\n\n const onChangeHandler = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\n setTextareaInput(e.target.value);\n\n if (onChange) {\n onChange(e);\n }\n\n if (grow) {\n resizeHeight(e.target);\n }\n };\n\n const maxWidth = width ? getTextareaMaxWidth(width) : undefined;\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextUuid}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Textarea} className={textareaWrapperClass}>\n {renderLabel(label, textareaId, onColor as FormOnColor)}\n <div className={contentWrapperClass} ref={referanse} style={{ maxWidth }}>\n <textarea\n {...rest}\n rows={rows}\n defaultValue={defaultValue}\n id={textareaId}\n className={textareaClass}\n ref={ref}\n aria-describedby={getAriaDescribedBy(props, errorTextUuid)}\n aria-invalid={!!onError}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n disabled={disabled}\n name={name}\n autoComplete={autoComplete ? autoComplete : undefined}\n placeholder={placeholder}\n readOnly={readOnly}\n required={required}\n onChange={onChangeHandler}\n value={value}\n />\n </div>\n {maxCharacters && (\n <MaxCharacters\n maxCharacters={maxCharacters}\n length={textareaInput.toString().length}\n maxText={mergedResources.characters}\n onColor={onColor}\n maxWidth={maxWidth}\n />\n )}\n </div>\n </ErrorWrapper>\n );\n};\n\nTextarea.displayName = 'Textarea';\n\nexport default Textarea;\n","import Textarea from './Textarea';\nexport * from './Textarea';\nexport default Textarea;\n"],"mappings":";;;;;;;;;;;;;;;AGOA,MAAa,gBAAgB,aAAsD;AACjF,SAAQ,UAAR;EACE,KAAK,gBAAgB,QACnB,QAAO;EACT,KAAK,gBAAgB,kBACnB,QAAO;EACT,KAAK,gBAAgB;EACrB,QACE,QAAO;;;ACuDb,IAAM,uBAAuB,iBAA+B;AAK1D,QAAO,QAAQ,eAAA,GAAwC;;AAGzD,IAAMA,YAAoC,UAAS;CACjD,MAAM,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C;GAC1C,OAAO,8BAA8B;GACrC,OAAO,8BAA8B;GACrC,OAAO,+BAA+B,MAAM;EAC9C,CAAC;CAEF,MAAM,gBAAgB,WAAG,OAAO,2BAA2B,GACxD,OAAO,sCAAsC,MAAM,UACrD,CAAC;AAEF,iBAAgB;AACd,MAAI,MAAO,kBAAiB,MAAM;AAElC,MAAI,QAAQ,UAAU,SAAS,YAAY,UAAU,SAAS,SAAS,IAAI;GACzE,MAAM,WAAW,UAAU,SAAS,SAAS;AAC7C,gBAAa,SAAS;;IAEvB,CAAC,MAAM,CAAC;CAEX,MAAM,mBAAmB,MAAoD;AAC3E,mBAAiB,EAAE,OAAO,MAAM;AAEhC,MAAI,SACF,UAAS,EAAE;AAGb,MAAI,KACF,cAAa,EAAE,OAAO;;CAI1B,MAAM,WAAW,QAAQ,oBAAoB,MAAM,GAAG,KAAA;AAEtD,QACE,oBAAC,sBAAA;EAAa,WAAW;EAAkC;EAAW,aAAa;YACjF,qBAAC,OAAA;GAAI,eAAa;GAAQ,oBAAkB,YAAY;GAAU,WAAW;;IAC1E,YAAY,OAAO,YAAY,QAAuB;IACvD,oBAAC,OAAA;KAAI,WAAW;KAAqB,KAAK;KAAW,OAAO,EAAE,UAAU;eACtE,oBAAC,YAAA;MACC,GAAI;MACE;MACQ;MACd,IAAI;MACJ,WAAW;MACN;MACL,oBAAkB,mBAAmB,OAAO,cAAc;MAC1D,gBAAc,CAAC,CAAC;MAEL;MACD;MACJ;MACN,cAAc,eAAe,eAAe,KAAA;MAC/B;MACH;MACA;MACV,UAAU;MACH;OACP;MACE;IACL,iBACC,oBAAC,uBAAA;KACgB;KACf,QAAQ,cAAc,UAAU,CAAC;KACjC,SAAS,gBAAgB;KAChB;KACC;MACV;;IAEA;GACO;;AAInB,SAAS,cAAc;ACzOvB,IAAA,qBD2Oe"}
1
+ {"version":3,"file":"Textarea.js","names":["Textarea: React.FC<TextareaProps>","mergedResources: HNDesignsystemTextArea"],"sources":["../src/resources/HN.Designsystem.TextArea.en-GB.json","../src/resources/HN.Designsystem.TextArea.nb-NO.json","../src/resources/HN.Designsystem.TextArea.nn-NO.json","../src/components/Textarea/resourceHelper.ts","../src/components/Textarea/Textarea.tsx","../src/components/Textarea/index.ts"],"sourcesContent":["{\n \"characters\": \"characters\"\n}\n","{\n \"characters\": \"tegn\"\n}\n","{\n \"characters\": \"teikn\"\n}\n","import type { HNDesignsystemTextArea } from '../../resources/Resources';\n\nimport { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.TextArea.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.TextArea.nb-NO.json';\nimport nnNO from '../../resources/HN.Designsystem.TextArea.nn-NO.json';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemTextArea => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN_NYNORSK:\n return nnNO;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import { useState, useRef, useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport type { HNDesignsystemTextArea } from '../../resources/Resources';\nimport type { ErrorWrapperClassNameProps } from '../ErrorWrapper';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, AVERAGE_CHARACTER_WIDTH_PX, FormOnColor, LanguageLocales } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { useLanguage } from '../../hooks/useLanguage';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper from '../ErrorWrapper';\nimport { renderLabel } from '../Label/utils';\nimport MaxCharacters from '../MaxCharacters/MaxCharacters';\n\nimport styles from './styles.module.scss';\n\nexport interface TextareaProps\n extends\n ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLTextAreaElement>,\n | 'aria-describedby'\n | 'autoFocus'\n | 'disabled'\n | 'name'\n | 'autoComplete'\n | 'placeholder'\n | 'readOnly'\n | 'required'\n | 'defaultValue'\n | 'onChange'\n | 'value'\n > {\n /** max character limit in textarea */\n maxCharacters?: number;\n /** Width of textarea in characters (approximate) */\n width?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** If true, the component will have a bottom margin. */\n marginBottom?: boolean;\n /** If true, the component will be transparent. */\n transparent?: boolean;\n /** Changes the visuals of the textarea */\n onColor?: keyof typeof FormOnColor;\n /** Label of the input */\n label?: React.ReactNode;\n /** id of the textarea */\n textareaId?: string;\n /** max rows */\n maxRows?: number;\n /** min rows */\n minRows?: number;\n /** auto-grows until maxRows */\n grow?: boolean;\n /** Activates Error style for the input */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Resources for component */\n resources?: Partial<HNDesignsystemTextArea>;\n /** Ref passed to the component */\n ref?: React.Ref<HTMLTextAreaElement | null>;\n}\n\nconst getTextareaMaxWidth = (characters: number): string => {\n const paddingWidth = '2rem';\n const scrollbarWidth = '16px';\n const borderWidth = '4px';\n\n return `calc(${characters * AVERAGE_CHARACTER_WIDTH_PX}px + ${paddingWidth} + ${scrollbarWidth} + ${borderWidth})`;\n};\n\nconst Textarea: React.FC<TextareaProps> = props => {\n const {\n maxCharacters,\n width,\n testId,\n defaultValue,\n marginBottom: gutterBottom,\n transparent,\n onColor = FormOnColor.onwhite,\n label,\n textareaId = uuid(),\n minRows = 3,\n maxRows = 10,\n grow,\n error,\n errorText,\n errorTextId: errorTextIdProp,\n errorWrapperClassName,\n autoFocus,\n disabled,\n name,\n autoComplete = 'off',\n placeholder,\n readOnly,\n required,\n onChange,\n value,\n resources,\n ref,\n ...rest\n } = props;\n\n const [rows, setRows] = useState(minRows);\n const [textareaInput, setTextareaInput] = useState(value || defaultValue || '');\n const referanse = useRef<HTMLDivElement>(null);\n const errorTextUuid = useIdWithFallback(errorTextIdProp);\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemTextArea = {\n ...defaultResources,\n ...resources,\n };\n\n useEffect(() => {\n setTextareaInput(defaultValue || '');\n }, [defaultValue]);\n\n const resizeHeight = (target: HTMLTextAreaElement): void => {\n const textareaLineHeight = 28;\n\n const previousRows = target.rows;\n target.rows = minRows; // reset number of rows in textarea\n\n const currentRows = Math.floor((target.scrollHeight - 16) / textareaLineHeight); // scrollHeight - 16px of padding to calculate the rows\n\n if (currentRows === previousRows) {\n target.rows = currentRows;\n }\n\n if (currentRows >= maxRows) {\n target.rows = maxRows;\n target.scrollTop = target.scrollHeight;\n }\n\n if (currentRows < maxRows) {\n setRows(currentRows);\n } else {\n setRows(maxRows);\n }\n };\n\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const maxCharactersExceeded = !!maxCharacters && textareaInput.toString().length > maxCharacters;\n const onError = onColor === FormOnColor.oninvalid || !!errorText || !!error || maxCharactersExceeded;\n\n const textareaWrapperClass = cn(styles.textarea, {\n [styles['textarea--gutterBottom']]: gutterBottom,\n });\n\n const contentWrapperClass = cn(styles['input-container'], {\n [styles['input-container--transparent']]: transparent,\n [styles['input-container--on-blueberry']]: onBlueberry,\n [styles['input-container--on-dark']]: onDark,\n [styles['input-container--invalid']]: onError,\n [styles['input-container--disabled']]: props.disabled,\n });\n\n const textareaClass = cn(styles['input-container__input'], {\n [styles[`input-container__input--disabled`]]: props.disabled,\n });\n\n useEffect(() => {\n if (value) setTextareaInput(value);\n\n if (grow && referanse.current?.children && referanse.current?.children[0]) {\n const textarea = referanse.current?.children[0] as HTMLTextAreaElement;\n resizeHeight(textarea);\n }\n }, [value]);\n\n const onChangeHandler = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\n setTextareaInput(e.target.value);\n\n if (onChange) {\n onChange(e);\n }\n\n if (grow) {\n resizeHeight(e.target);\n }\n };\n\n const maxWidth = width ? getTextareaMaxWidth(width) : undefined;\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextUuid}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Textarea} className={textareaWrapperClass}>\n {renderLabel({ label: label, inputId: textareaId, onColor: onColor as FormOnColor })}\n <div className={contentWrapperClass} ref={referanse} style={{ maxWidth }}>\n <textarea\n {...rest}\n rows={rows}\n defaultValue={defaultValue}\n id={textareaId}\n className={textareaClass}\n ref={ref}\n aria-describedby={getAriaDescribedBy(props, errorTextUuid)}\n aria-invalid={!!onError}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n disabled={disabled}\n name={name}\n autoComplete={autoComplete ? autoComplete : undefined}\n placeholder={placeholder}\n readOnly={readOnly}\n required={required}\n onChange={onChangeHandler}\n value={value}\n />\n </div>\n {maxCharacters && (\n <MaxCharacters\n maxCharacters={maxCharacters}\n length={textareaInput.toString().length}\n maxText={mergedResources.characters}\n onColor={onColor}\n maxWidth={maxWidth}\n />\n )}\n </div>\n </ErrorWrapper>\n );\n};\n\nTextarea.displayName = 'Textarea';\n\nexport default Textarea;\n","import Textarea from './Textarea';\nexport * from './Textarea';\nexport default Textarea;\n"],"mappings":";;;;;;;;;;;;;;;AGOA,MAAa,gBAAgB,aAAsD;AACjF,SAAQ,UAAR;EACE,KAAK,gBAAgB,QACnB,QAAO;EACT,KAAK,gBAAgB,kBACnB,QAAO;EACT,KAAK,gBAAgB;EACrB,QACE,QAAO;;;ACuDb,IAAM,uBAAuB,iBAA+B;AAK1D,QAAO,QAAQ,eAAA,GAAwC;;AAGzD,IAAMA,YAAoC,UAAS;CACjD,MAAM,EACJ,eACA,OACA,QACA,cACA,cAAc,cACd,aACA,UAAU,YAAY,SACtB,OACA,aAAa,MAAM,EACnB,UAAU,GACV,UAAU,IACV,MACA,OACA,WACA,aAAa,iBACb,uBACA,WACA,UACA,MACA,eAAe,OACf,aACA,UACA,UACA,UACA,OACA,WACA,KACA,GAAG,SACD;CAEJ,MAAM,CAAC,MAAM,WAAW,SAAS,QAAQ;CACzC,MAAM,CAAC,eAAe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zE,MAAM,WAAW,UAAU,SAAS,SAAS;AAC7C,gBAAa,SAAS;;IAEvB,CAAC,MAAM,CAAC;CAEX,MAAM,mBAAmB,MAAoD;AAC3E,mBAAiB,EAAE,OAAO,MAAM;AAEhC,MAAI,SACF,UAAS,EAAE;AAGb,MAAI,KACF,cAAa,EAAE,OAAO;;CAI1B,MAAM,WAAW,QAAQ,oBAAoB,MAAM,GAAG,KAAA;AAEtD,QACE,oBAAC,sBAAA;EAAa,WAAW;EAAkC;EAAW,aAAa;YACjF,qBAAC,OAAA;GAAI,eAAa;GAAQ,oBAAkB,YAAY;GAAU,WAAW;;IAC1E,YAAY;KAAS;KAAO,SAAS;KAAqB;KAAwB,CAAC;IACpF,oBAAC,OAAA;KAAI,WAAW;KAAqB,KAAK;KAAW,OAAO,EAAE,UAAU;eACtE,oBAAC,YAAA;MACC,GAAI;MACE;MACQ;MACd,IAAI;MACJ,WAAW;MACN;MACL,oBAAkB,mBAAmB,OAAO,cAAc;MAC1D,gBAAc,CAAC,CAAC;MAEL;MACD;MACJ;MACN,cAAc,eAAe,eAAe,KAAA;MAC/B;MACH;MACA;MACV,UAAU;MACH;OACP;MACE;IACL,iBACC,oBAAC,uBAAA;KACgB;KACf,QAAQ,cAAc,UAAU,CAAC;KACjC,SAAS,gBAAgB;KAChB;KACC;MACV;;IAEA;GACO;;AAInB,SAAS,cAAc;ACzOvB,IAAA,qBD2Oe"}
@@ -458,3 +458,7 @@ $padding-clickable-area-left: 8px;
458
458
  margin-top: -$padding-clickable-area-top-bottom;
459
459
  padding-left: calc(2.8rem + $padding-clickable-area-left);
460
460
  }
461
+
462
+ .checkbox-afterlabelchildren-wrapper {
463
+ padding-top: $padding-clickable-area-top-bottom;
464
+ }
@@ -17,6 +17,7 @@ export type Styles = {
17
17
  'checkbox__icon-wrapper--on-grey': string;
18
18
  'checkbox__icon-wrapper--on-invalid': string;
19
19
  'checkbox__icon-wrapper--on-white': string;
20
+ 'checkbox-afterlabelchildren-wrapper': string;
20
21
  'checkbox-errors': string;
21
22
  'checkbox-label': string;
22
23
  'checkbox-label__large--checked': string;
@@ -182,5 +182,11 @@
182
182
  column-gap: var(--core-space-2xs) 0;
183
183
  padding: var(--core-space-2xs) 0;
184
184
  }
185
+
186
+ // Hack in order to not cut the buttons on iOS in app browser from iOS 26
187
+ // Selector targets iOS
188
+ @supports (font: -apple-system-body) and (-webkit-appearance: none) {
189
+ padding-bottom: 2.5rem;
190
+ }
185
191
  }
186
192
  }
@@ -170,14 +170,23 @@
170
170
  }
171
171
 
172
172
  &--nested-line {
173
- padding-left: spacers.getSpacer(s);
174
- border-left: solid 3px palette.$neutral200;
173
+ &--outer {
174
+ padding-left: 0;
175
175
 
176
- @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
177
- margin-left: calc(38px / 2 - 1px); // Halvparten av chevron-ikonets bredde minus halve bredden på border
178
- padding-left: calc(
179
- 38px / 2 + 12px - 2px
180
- ); // Halvparten av chevron-ikonets bredde, pluss ikonets margin-right på tablet, minus bredden på border
176
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
177
+ padding-left: calc(38px / 2 - 1px); // Halvparten av chevron-ikonets bredde minus halve bredden på border
178
+ }
179
+ }
180
+
181
+ &--inner {
182
+ padding-left: spacers.getSpacer(s);
183
+ border-left: solid 3px palette.$neutral200;
184
+
185
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
186
+ padding-left: calc(
187
+ 38px / 2 + 12px - 2px
188
+ ); // Halvparten av chevron-ikonets bredde, pluss ikonets margin-right på tablet, minus bredden på border
189
+ }
181
190
  }
182
191
  }
183
192
 
@@ -40,7 +40,8 @@ export type Styles = {
40
40
  'expander__content--icon': string;
41
41
  'expander__content--kiwi': string;
42
42
  'expander__content--large': string;
43
- 'expander__content--nested-line': string;
43
+ 'expander__content--nested-line--inner': string;
44
+ 'expander__content--nested-line--outer': string;
44
45
  'expander__content--neutral': string;
45
46
  'expander__content--plum': string;
46
47
  'expander__content--small': string;
@@ -13,6 +13,8 @@ export interface ExpanderProps extends ExpanderHierarchyCommonProps {
13
13
  testId?: string;
14
14
  /** Adds custom classes to the element. */
15
15
  className?: string;
16
+ /** ref that is placed on the li element */
17
+ ref?: React.RefObject<HTMLLIElement>;
16
18
  }
17
19
  export type ExpanderType = typeof Expander;
18
20
  declare const Expander: React.FC<ExpanderProps>;
@@ -50,10 +50,11 @@ const getHeadingTag = (htmlMarkup) => {
50
50
  default: return "h2";
51
51
  }
52
52
  };
53
- var Expander = ({ title, htmlMarkup = "h2", level = 1, print, expanded = false, onExpand, children, testId, className }) => {
53
+ var Expander = ({ title, htmlMarkup = "h2", level = 1, print, expanded = false, onExpand, children, testId, className, ref }) => {
54
54
  const contentClasses = classNames(styles.expander__content, (level === 1 || level === 2) && styles[`expander__content--${level}`], level > 2 && styles[`expander__content--3-and-lower`]);
55
55
  return /* @__PURE__ */ jsxs("li", {
56
56
  className: classNames(styles.expander, className),
57
+ ref,
57
58
  children: [/* @__PURE__ */ jsx(ExpanderButton_default, {
58
59
  htmlMarkup,
59
60
  level,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ExpanderButton: React.FC<ExpanderButtonProps>","Expander: React.FC<ExpanderProps>","ExpanderHierarchy: ExpanderHierarchyCompound"],"sources":["../../../src/components/ExpanderHierarchy/ExpanderButton.tsx","../../../src/components/ExpanderHierarchy/utils.ts","../../../src/components/ExpanderHierarchy/Expander.tsx","../../../src/components/ExpanderHierarchy/ExpanderHierarchy.tsx","../../../src/components/ExpanderHierarchy/index.ts"],"sourcesContent":["import classNames from 'classnames';\n\nimport type { ExpanderHierarchyCommonProps } from '../ExpanderHierarchy';\n\nimport { AnalyticsId } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport Icon, { IconSize } from '../Icon';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\n\nimport styles from './expander.module.scss';\n\ninterface ExpanderButtonProps extends ExpanderHierarchyCommonProps {\n expanded: boolean;\n onExpand?: (isExpanded: boolean) => void;\n children: string;\n testId?: string;\n}\n\nconst ExpanderButton: React.FC<ExpanderButtonProps> = ({ htmlMarkup = 'h2', level = 1, print, expanded, onExpand, children, testId }) => {\n const { refObject, isHovered } = usePseudoClasses<HTMLButtonElement>();\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n\n const handleClick = (): void => {\n setIsExpanded(!isExpanded);\n };\n\n const CustomTag = htmlMarkup;\n\n const buttonClasses = classNames(\n styles.expander__button,\n level > 1 && styles[`expander__button--2-and-lower`],\n print && styles['expander__button--print']\n );\n\n const titleClasses = classNames(\n styles.expander__title,\n (level === 1 || level === 2 || level === 3) && styles[`expander__title--${level}`],\n level > 3 && styles[`expander__title--4-and-lower`],\n isExpanded && styles['expander__title--expanded'],\n print && styles['expander__title--print']\n );\n\n const iconClasses = classNames(\n styles.expander__icon,\n level > 1 && styles[`expander__icon--2-and-lower`],\n level > 2 && styles[`expander__icon--3-and-lower`]\n );\n\n return (\n <CustomTag className={titleClasses}>\n <button\n type=\"button\"\n onClick={handleClick}\n className={buttonClasses}\n aria-expanded={isExpanded}\n ref={refObject}\n data-testid={testId}\n data-analyticsid={AnalyticsId.ExpanderHierarchyExpander}\n >\n {children}\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} isHovered={isHovered} className={iconClasses} size={IconSize.XSmall} />\n </button>\n </CustomTag>\n );\n};\n\nexport default ExpanderButton;\n","export type HeadingTags = 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport const getHeadingTag = (htmlMarkup?: HeadingTags): HeadingTags => {\n switch (htmlMarkup) {\n case 'h2':\n return 'h3';\n case 'h3':\n return 'h4';\n case 'h4':\n return 'h5';\n case 'h5':\n return 'h6';\n case 'h6':\n return 'h6';\n default:\n return 'h2';\n }\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport type { ExpanderHierarchyCommonProps, ExpanderHierarchyProps } from './ExpanderHierarchy';\n\nimport ExpanderButton from './ExpanderButton';\nimport ExpanderHierarchy from './ExpanderHierarchy';\nimport { getHeadingTag } from './utils';\nimport { isComponent } from '../../utils/component';\n\nimport styles from './expander.module.scss';\n\nexport interface ExpanderProps extends ExpanderHierarchyCommonProps {\n /** Sets the trigger title */\n title: string;\n /** Opens or closes the expander */\n expanded?: boolean;\n /** Called when expander is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /** Sets the expanded content */\n children?: React.ReactNode;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n /** Adds custom classes to the element. */\n className?: string;\n}\n\nexport type ExpanderType = typeof Expander;\n\nconst Expander: React.FC<ExpanderProps> = ({\n title,\n htmlMarkup = 'h2',\n level = 1,\n print,\n expanded = false,\n onExpand,\n children,\n testId,\n className,\n}: ExpanderProps) => {\n const contentClasses = classNames(\n styles.expander__content,\n (level === 1 || level === 2) && styles[`expander__content--${level}`],\n level > 2 && styles[`expander__content--3-and-lower`]\n );\n\n return (\n <li className={classNames(styles.expander, className)}>\n <ExpanderButton htmlMarkup={htmlMarkup} level={level} print={print} expanded={expanded} onExpand={onExpand} testId={testId}>\n {title}\n </ExpanderButton>\n <div className={contentClasses}>\n {React.Children.map(children, child =>\n isComponent<ExpanderHierarchyProps>(child, ExpanderHierarchy)\n ? React.cloneElement(child, { htmlMarkup: getHeadingTag(htmlMarkup), level: level + 1, print })\n : child\n )}\n </div>\n </li>\n );\n};\n\nexport default Expander;\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport type { ExpanderProps, ExpanderType } from './Expander';\nimport type { HeadingTags } from './utils';\n\nimport Expander from './Expander';\nimport { AnalyticsId } from '../../constants';\nimport { isComponent } from '../../utils/component';\n\nimport styles from './styles.module.scss';\n\nexport interface ExpanderHierarchyCommonProps {\n /** Changes the underlying element of the expander title. Default: h2. */\n htmlMarkup?: HeadingTags;\n /** Expand all children when printing. */\n print?: boolean;\n /** Expander nesting level. Should not be set manually. */\n level?: number;\n}\n\nexport interface ExpanderHierarchyProps extends ExpanderHierarchyCommonProps {\n children: React.ReactNode;\n /** Sets the data-testid attribute on the expander list. */\n testId?: string;\n}\n\nexport interface ExpanderHierarchyCompound extends React.FC<ExpanderHierarchyProps> {\n Expander: ExpanderType;\n}\n\nconst ExpanderHierarchy: ExpanderHierarchyCompound = ({\n htmlMarkup = 'h2',\n level = 1,\n print,\n children,\n testId,\n}: ExpanderHierarchyProps) => {\n const listClasses = classNames(\n styles.expanderhierarchy,\n level === 2 && styles[`expanderhierarchy--${level}`],\n level > 2 && styles[`expanderhierarchy--3-and-lower`]\n );\n\n return (\n <ul className={listClasses} data-testid={testId} data-analyticsid={AnalyticsId.ExpanderHierarchy}>\n {React.Children.map(children, child =>\n isComponent<ExpanderProps>(child, Expander) ? React.cloneElement(child, { htmlMarkup, level, print }) : child\n )}\n </ul>\n );\n};\n\nExpanderHierarchy.Expander = Expander;\n\nexport default ExpanderHierarchy;\n","import ExpanderHierarchy from './ExpanderHierarchy';\nexport * from './ExpanderHierarchy';\nexport * from './utils';\nexport default ExpanderHierarchy;\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAMA,kBAAiD,EAAE,aAAa,MAAM,QAAQ,GAAG,OAAO,UAAU,UAAU,UAAU,aAAa;CACvI,MAAM,EAAE,WAAW,cAAc,kBAAqC;CACtE,MAAM,CAAC,YAAY,iBAAiB,UAAU,UAAU,SAAS;CAEjE,MAAM,oBAA0B;AAC9B,gBAAc,CAAC,WAAW;;CAG5B,MAAM,YAAY;CAElB,MAAM,gBAAgB,WACpB,OAAO,kBACP,QAAQ,KAAK,OAAO,kCACpB,SAAS,OAAO,2BACjB;CAED,MAAM,eAAe,WACnB,OAAO,kBACN,UAAU,KAAK,UAAU,KAAK,UAAU,MAAM,OAAO,oBAAoB,UAC1E,QAAQ,KAAK,OAAO,iCACpB,cAAc,OAAO,8BACrB,SAAS,OAAO,0BACjB;CAED,MAAM,cAAc,WAClB,OAAO,gBACP,QAAQ,KAAK,OAA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AAa;EAAQ,oBAAkB,YAAY;YAC5E,MAAM,SAAS,IAAI,WAAU,UAC5B,YAA2B,OAAO,iBAAS,GAAG,MAAM,aAAa,OAAO;GAAE;GAAY;GAAO;GAAO,CAAC,GAAG,MACzG;GACE;;AAIT,kBAAkB,WAAW;AAE7B,IAAA,8BAAe;ACrDf,IAAA,4BAAe"}
1
+ {"version":3,"file":"index.js","names":["ExpanderButton: React.FC<ExpanderButtonProps>","Expander: React.FC<ExpanderProps>","ExpanderHierarchy: ExpanderHierarchyCompound"],"sources":["../../../src/components/ExpanderHierarchy/ExpanderButton.tsx","../../../src/components/ExpanderHierarchy/utils.ts","../../../src/components/ExpanderHierarchy/Expander.tsx","../../../src/components/ExpanderHierarchy/ExpanderHierarchy.tsx","../../../src/components/ExpanderHierarchy/index.ts"],"sourcesContent":["import classNames from 'classnames';\n\nimport type { ExpanderHierarchyCommonProps } from '../ExpanderHierarchy';\n\nimport { AnalyticsId } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport Icon, { IconSize } from '../Icon';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\n\nimport styles from './expander.module.scss';\n\ninterface ExpanderButtonProps extends ExpanderHierarchyCommonProps {\n expanded: boolean;\n onExpand?: (isExpanded: boolean) => void;\n children: string;\n testId?: string;\n}\n\nconst ExpanderButton: React.FC<ExpanderButtonProps> = ({ htmlMarkup = 'h2', level = 1, print, expanded, onExpand, children, testId }) => {\n const { refObject, isHovered } = usePseudoClasses<HTMLButtonElement>();\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n\n const handleClick = (): void => {\n setIsExpanded(!isExpanded);\n };\n\n const CustomTag = htmlMarkup;\n\n const buttonClasses = classNames(\n styles.expander__button,\n level > 1 && styles[`expander__button--2-and-lower`],\n print && styles['expander__button--print']\n );\n\n const titleClasses = classNames(\n styles.expander__title,\n (level === 1 || level === 2 || level === 3) && styles[`expander__title--${level}`],\n level > 3 && styles[`expander__title--4-and-lower`],\n isExpanded && styles['expander__title--expanded'],\n print && styles['expander__title--print']\n );\n\n const iconClasses = classNames(\n styles.expander__icon,\n level > 1 && styles[`expander__icon--2-and-lower`],\n level > 2 && styles[`expander__icon--3-and-lower`]\n );\n\n return (\n <CustomTag className={titleClasses}>\n <button\n type=\"button\"\n onClick={handleClick}\n className={buttonClasses}\n aria-expanded={isExpanded}\n ref={refObject}\n data-testid={testId}\n data-analyticsid={AnalyticsId.ExpanderHierarchyExpander}\n >\n {children}\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} isHovered={isHovered} className={iconClasses} size={IconSize.XSmall} />\n </button>\n </CustomTag>\n );\n};\n\nexport default ExpanderButton;\n","export type HeadingTags = 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport const getHeadingTag = (htmlMarkup?: HeadingTags): HeadingTags => {\n switch (htmlMarkup) {\n case 'h2':\n return 'h3';\n case 'h3':\n return 'h4';\n case 'h4':\n return 'h5';\n case 'h5':\n return 'h6';\n case 'h6':\n return 'h6';\n default:\n return 'h2';\n }\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport type { ExpanderHierarchyCommonProps, ExpanderHierarchyProps } from './ExpanderHierarchy';\n\nimport ExpanderButton from './ExpanderButton';\nimport ExpanderHierarchy from './ExpanderHierarchy';\nimport { getHeadingTag } from './utils';\nimport { isComponent } from '../../utils/component';\n\nimport styles from './expander.module.scss';\n\nexport interface ExpanderProps extends ExpanderHierarchyCommonProps {\n /** Sets the trigger title */\n title: string;\n /** Opens or closes the expander */\n expanded?: boolean;\n /** Called when expander is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /** Sets the expanded content */\n children?: React.ReactNode;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** ref that is placed on the li element */\n ref?: React.RefObject<HTMLLIElement>;\n}\n\nexport type ExpanderType = typeof Expander;\n\nconst Expander: React.FC<ExpanderProps> = ({\n title,\n htmlMarkup = 'h2',\n level = 1,\n print,\n expanded = false,\n onExpand,\n children,\n testId,\n className,\n ref,\n}: ExpanderProps) => {\n const contentClasses = classNames(\n styles.expander__content,\n (level === 1 || level === 2) && styles[`expander__content--${level}`],\n level > 2 && styles[`expander__content--3-and-lower`]\n );\n\n return (\n <li className={classNames(styles.expander, className)} ref={ref}>\n <ExpanderButton htmlMarkup={htmlMarkup} level={level} print={print} expanded={expanded} onExpand={onExpand} testId={testId}>\n {title}\n </ExpanderButton>\n <div className={contentClasses}>\n {React.Children.map(children, child =>\n isComponent<ExpanderHierarchyProps>(child, ExpanderHierarchy)\n ? React.cloneElement(child, { htmlMarkup: getHeadingTag(htmlMarkup), level: level + 1, print })\n : child\n )}\n </div>\n </li>\n );\n};\n\nexport default Expander;\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport type { ExpanderProps, ExpanderType } from './Expander';\nimport type { HeadingTags } from './utils';\n\nimport Expander from './Expander';\nimport { AnalyticsId } from '../../constants';\nimport { isComponent } from '../../utils/component';\n\nimport styles from './styles.module.scss';\n\nexport interface ExpanderHierarchyCommonProps {\n /** Changes the underlying element of the expander title. Default: h2. */\n htmlMarkup?: HeadingTags;\n /** Expand all children when printing. */\n print?: boolean;\n /** Expander nesting level. Should not be set manually. */\n level?: number;\n}\n\nexport interface ExpanderHierarchyProps extends ExpanderHierarchyCommonProps {\n children: React.ReactNode;\n /** Sets the data-testid attribute on the expander list. */\n testId?: string;\n}\n\nexport interface ExpanderHierarchyCompound extends React.FC<ExpanderHierarchyProps> {\n Expander: ExpanderType;\n}\n\nconst ExpanderHierarchy: ExpanderHierarchyCompound = ({\n htmlMarkup = 'h2',\n level = 1,\n print,\n children,\n testId,\n}: ExpanderHierarchyProps) => {\n const listClasses = classNames(\n styles.expanderhierarchy,\n level === 2 && styles[`expanderhierarchy--${level}`],\n level > 2 && styles[`expanderhierarchy--3-and-lower`]\n );\n\n return (\n <ul className={listClasses} data-testid={testId} data-analyticsid={AnalyticsId.ExpanderHierarchy}>\n {React.Children.map(children, child =>\n isComponent<ExpanderProps>(child, Expander) ? React.cloneElement(child, { htmlMarkup, level, print }) : child\n )}\n </ul>\n );\n};\n\nExpanderHierarchy.Expander = Expander;\n\nexport default ExpanderHierarchy;\n","import ExpanderHierarchy from './ExpanderHierarchy';\nexport * from './ExpanderHierarchy';\nexport * from './utils';\nexport default ExpanderHierarchy;\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAMA,kBAAiD,EAAE,aAAa,MAAM,QAAQ,GAAG,OAAO,UAAU,UAAU,UAAU,aAAa;CACvI,MAAM,EAAE,WAAW,cAAc,kBAAqC;CACtE,MAAM,CAAC,YAAY,iBAAiB,UAAU,UAAU,SAAS;CAEjE,MAAM,oBAA0B;AAC9B,gBAAc,CAAC,WAAW;;CAG5B,MAAM,YAAY;CAElB,MAAM,gBAAgB,WACpB,OAAO,kBACP,QAAQ,KAAK,OAAO,kCACpB,SAAS,OAAO,2BACjB;CAED,MAAM,eAAe,WACnB,OAAO,kBACN,UAAU,KAAK,UAAU,KAAK,UAAU,MAAM,OAAO,oBAAoB,UAC1E,QAAQ,KAAK,OAAO,iCACpB,cAAc,OAAO,8BACrB,SAAS,OAAO,0BACjB;CAED,MAAM,cAAc,WAClB,OAAO,gBACP,QAAQ,KAAK,OAAO,gCACpB,QAAQ,KAAK,OAAO,+BACrB;AAED,QACE,oBAAC,WAAA;EAAU,WAAW;YACpB,qBAAC,UAAA;GACC,MAAK;GACL,SAAS;GACT,WAAW;GACX,iBAAe;GACf,KAAK;GACL,eAAa;GACb,oBAAkB,YAAY;cAE7B,UACD,oBAAC,cAAA;IAAK,SAAS,aAAa,oBAAY;IAAwB;IAAW,WAAW;IAAa,MAAM,SAAS;KAAU,CAAA;IACrH;GACC;;AAIhB,IAAA,yBAAe;AClEf,MAAa,iBAAiB,eAA0C;AACtE,SAAQ,YAAR;EACE,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,QACE,QAAO;;;ACiBb,IAAMC,YAAqC,EACzC,OACA,aAAa,MACb,QAAQ,GACR,OACA,WAAW,OACX,UACA,UACA,QACA,WACA,UACmB;CACnB,MAAM,iBAAiB,WACrB,OAAO,oBACN,UAAU,KAAK,UAAU,MAAM,OAAO,sBAAsB,UAC7D,QAAQ,KAAK,OAAO,kCACrB;AAED,QACE,qBAAC,MAAA;EAAG,WAAW,WAAW,OAAO,UAAU,UAAU;EAAO;aAC1D,oBAAC,wBAAA;GAA2B;GAAmB;GAAc;GAAiB;GAAoB;GAAkB;aACjH;IACc,EACjB,oBAAC,OAAA;GAAI,WAAW;aACb,MAAM,SAAS,IAAI,WAAU,UAC5B,YAAoC,OAAO,4BAAkB,GACzD,MAAM,aAAa,OAAO;IAAE,YAAY,cAAc,WAAW;IAAE,OAAO,QAAQ;IAAG;IAAO,CAAC,GAC7F,MACL;IACG,CAAA;GACH;;AAIT,IAAA,mBAAe;AClCf,IAAMC,qBAAgD,EACpD,aAAa,MACb,QAAQ,GACR,OACA,UACA,aAC4B;AAO5B,QACE,oBAAC,MAAA;EAAG,WAPc,WAClB,SAAO,mBACP,UAAU,KAAK,SAAO,sBAAsB,UAC5C,QAAQ,KAAK,SAAO,kCACrB;EAG6B,eAAa;EAAQ,oBAAkB,YAAY;YAC5E,MAAM,SAAS,IAAI,WAAU,UAC5B,YAA2B,OAAO,iBAAS,GAAG,MAAM,aAAa,OAAO;GAAE;GAAY;GAAO;GAAO,CAAC,GAAG,MACzG;GACE;;AAIT,kBAAkB,WAAW;AAE7B,IAAA,8BAAe;ACrDf,IAAA,4BAAe"}
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { FormOnColor, FormSize } from '../../constants';
3
+ import { TitleTags } from '../Title';
3
4
  export type FormGroupTags = 'fieldset' | 'div';
4
5
  export interface FormGroupProps {
5
6
  /** Can be used as a replacement text for legend in cases where the group title already exists externally */
@@ -38,6 +39,10 @@ export interface FormGroupProps {
38
39
  fieldsetName?: string;
39
40
  /** Sets div instead of fieldset tag */
40
41
  htmlMarkup?: FormGroupTags;
42
+ /** Markup for legend if formgroup htmlMarkup is div*/
43
+ legendHtmlMarkup?: TitleTags;
44
+ /** Markup for title */
45
+ titleHtmlMarkup?: TitleTags;
41
46
  /** Renders the error component (Default: true) */
42
47
  renderError?: boolean;
43
48
  /** Ref passed to the error message element */
@@ -4,6 +4,8 @@ import { TitleTags } from '../Title';
4
4
  export interface HelpTeaserProps {
5
5
  /** What's in the box? */
6
6
  children: React.ReactNode;
7
+ /** Override the default max height for collapsed teaser. Default is 12.25rem */
8
+ collapsedMaxHeight?: string;
7
9
  /** Changes the underlying element of the wrapper */
8
10
  htmlMarkup?: InfoTeaserTags;
9
11
  /** Resources for component */
@@ -3,7 +3,7 @@ import { t as InfoTeaser_default } from "../../InfoTeaser.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import styles from "./styles.module.scss";
5
5
  var HelpTeaser = (props) => {
6
- const { children, htmlMarkup, resources, testId, title, titleHtmlMarkup } = props;
6
+ const { children, htmlMarkup, resources, testId, title, titleHtmlMarkup, collapsedMaxHeight } = props;
7
7
  return /* @__PURE__ */ jsx(InfoTeaser_default, {
8
8
  testId,
9
9
  htmlMarkup,
@@ -13,6 +13,7 @@ var HelpTeaser = (props) => {
13
13
  resources,
14
14
  svgIcon: HandWaving_default,
15
15
  buttonClassName: styles["helpteaser__button"],
16
+ collapsedMaxHeight,
16
17
  children
17
18
  });
18
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["HelpTeaser: React.FC<HelpTeaserProps>"],"sources":["../../../src/components/HelpTeaser/HelpTeaser.tsx","../../../src/components/HelpTeaser/index.ts"],"sourcesContent":["import type { HNDesignsystemInfoTeaser } from '../../resources/Resources';\nimport type { InfoTeaserTags } from '../InfoTeaser';\nimport type { TitleTags } from '../Title';\n\nimport HandWaving from '../Icons/HandWaving';\nimport InfoTeaser from '../InfoTeaser';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpTeaserProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the underlying element of the wrapper */\n htmlMarkup?: InfoTeaserTags;\n /** Resources for component */\n resources?: Partial<HNDesignsystemInfoTeaser>;\n /** Sets the data-testid attribute */\n testId?: string;\n /** Title on top of the component */\n title: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\nconst HelpTeaser: React.FC<HelpTeaserProps> = props => {\n const { children, htmlMarkup, resources, testId, title, titleHtmlMarkup } = props;\n return (\n <InfoTeaser\n testId={testId}\n htmlMarkup={htmlMarkup}\n className={styles.helpteaser}\n title={title}\n titleHtmlMarkup={titleHtmlMarkup}\n resources={resources}\n svgIcon={HandWaving}\n buttonClassName={styles['helpteaser__button']}\n >\n {children}\n </InfoTeaser>\n );\n};\n\nexport default HelpTeaser;\n","import HelpTeaser from './HelpTeaser';\nexport * from './HelpTeaser';\nexport default HelpTeaser;\n"],"mappings":";;;;AAwBA,IAAMA,cAAwC,UAAS;CACrD,MAAM,EAAE,UAAU,YAAY,WAAW,QAAQ,OAAO,oBAAoB;AAC5E,QACE,oBAAC,oBAAA;EACS;EACI;EACZ,WAAW,OAAO;EACX;EACU;EACN;EACX,SAAS;EACT,iBAAiB,OAAO;EAEvB;GACU;;ACpCjB,IAAA,qBDwCe"}
1
+ {"version":3,"file":"index.js","names":["HelpTeaser: React.FC<HelpTeaserProps>"],"sources":["../../../src/components/HelpTeaser/HelpTeaser.tsx","../../../src/components/HelpTeaser/index.ts"],"sourcesContent":["import type { HNDesignsystemInfoTeaser } from '../../resources/Resources';\nimport type { InfoTeaserTags } from '../InfoTeaser';\nimport type { TitleTags } from '../Title';\n\nimport HandWaving from '../Icons/HandWaving';\nimport InfoTeaser from '../InfoTeaser';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpTeaserProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Override the default max height for collapsed teaser. Default is 12.25rem */\n collapsedMaxHeight?: string;\n /** Changes the underlying element of the wrapper */\n htmlMarkup?: InfoTeaserTags;\n /** Resources for component */\n resources?: Partial<HNDesignsystemInfoTeaser>;\n /** Sets the data-testid attribute */\n testId?: string;\n /** Title on top of the component */\n title: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\nconst HelpTeaser: React.FC<HelpTeaserProps> = props => {\n const { children, htmlMarkup, resources, testId, title, titleHtmlMarkup, collapsedMaxHeight } = props;\n return (\n <InfoTeaser\n testId={testId}\n htmlMarkup={htmlMarkup}\n className={styles.helpteaser}\n title={title}\n titleHtmlMarkup={titleHtmlMarkup}\n resources={resources}\n svgIcon={HandWaving}\n buttonClassName={styles['helpteaser__button']}\n collapsedMaxHeight={collapsedMaxHeight}\n >\n {children}\n </InfoTeaser>\n );\n};\n\nexport default HelpTeaser;\n","import HelpTeaser from './HelpTeaser';\nexport * from './HelpTeaser';\nexport default HelpTeaser;\n"],"mappings":";;;;AA0BA,IAAMA,cAAwC,UAAS;CACrD,MAAM,EAAE,UAAU,YAAY,WAAW,QAAQ,OAAO,iBAAiB,uBAAuB;AAChG,QACE,oBAAC,oBAAA;EACS;EACI;EACZ,WAAW,OAAO;EACX;EACU;EACN;EACX,SAAS;EACT,iBAAiB,OAAO;EACJ;EAEnB;GACU;;ACvCjB,IAAA,qBD2Ce"}
@@ -1,7 +1,9 @@
1
- import { HelpTriggerWeights } from '../HelpTriggerIcon';
1
+ import { default as React } from 'react';
2
+ import { HelpTriggerWeights, HelpTriggerIconSizes } from '../HelpTriggerIcon';
2
3
  export interface HelpSignProps {
3
4
  color?: string;
4
5
  weight?: HelpTriggerWeights;
6
+ size?: HelpTriggerIconSizes;
5
7
  }
6
8
  declare const HelpSign: React.FC<HelpSignProps>;
7
9
  export default HelpSign;
@@ -1263,11 +1263,11 @@ declare const _default: {
1263
1263
  alternativeName: string;
1264
1264
  categories: string;
1265
1265
  };
1266
- dotalert: {
1266
+ dotexclamationmark: {
1267
1267
  alternativeName: string;
1268
1268
  categories: string;
1269
1269
  };
1270
- dotcancelled: {
1270
+ dotx: {
1271
1271
  alternativeName: string;
1272
1272
  categories: string;
1273
1273
  };
@@ -1275,11 +1275,11 @@ declare const _default: {
1275
1275
  alternativeName: string;
1276
1276
  categories: string;
1277
1277
  };
1278
- dotsuccess: {
1278
+ dotcheckmark: {
1279
1279
  alternativeName: string;
1280
1280
  categories: string;
1281
1281
  };
1282
- dottransparent: {
1282
+ dotoutline: {
1283
1283
  alternativeName: string;
1284
1284
  categories: string;
1285
1285
  };
@@ -1295,7 +1295,43 @@ declare const _default: {
1295
1295
  alternativeName: string;
1296
1296
  categories: string;
1297
1297
  };
1298
- dotwarningtriangle: {
1298
+ dottriangle: {
1299
+ alternativeName: string;
1300
+ categories: string;
1301
+ };
1302
+ dotfill: {
1303
+ alternativeName: string;
1304
+ categories: string;
1305
+ };
1306
+ dotdot: {
1307
+ alternativeName: string;
1308
+ categories: string;
1309
+ };
1310
+ dotgroup: {
1311
+ alternativeName: string;
1312
+ categories: string;
1313
+ };
1314
+ dotcirclearrows: {
1315
+ alternativeName: string;
1316
+ categories: string;
1317
+ };
1318
+ dotnoaccess: {
1319
+ alternativeName: string;
1320
+ categories: string;
1321
+ };
1322
+ dotpencil: {
1323
+ alternativeName: string;
1324
+ categories: string;
1325
+ };
1326
+ dotnoeye: {
1327
+ alternativeName: string;
1328
+ categories: string;
1329
+ };
1330
+ dotlogin: {
1331
+ alternativeName: string;
1332
+ categories: string;
1333
+ };
1334
+ dotattachment: {
1299
1335
  alternativeName: string;
1300
1336
  categories: string;
1301
1337
  };
@@ -1263,11 +1263,11 @@ var AdditionalIconInformation_default = {
1263
1263
  alternativeName: "HelseMålinger",
1264
1264
  categories: "Generisk, Tjeneste"
1265
1265
  },
1266
- dotalert: {
1266
+ dotexclamationmark: {
1267
1267
  alternativeName: "",
1268
1268
  categories: "System, StatusDot"
1269
1269
  },
1270
- dotcancelled: {
1270
+ dotx: {
1271
1271
  alternativeName: "",
1272
1272
  categories: "System, StatusDot"
1273
1273
  },
@@ -1275,11 +1275,11 @@ var AdditionalIconInformation_default = {
1275
1275
  alternativeName: "",
1276
1276
  categories: "System, StatusDot"
1277
1277
  },
1278
- dotsuccess: {
1278
+ dotcheckmark: {
1279
1279
  alternativeName: "",
1280
1280
  categories: "System, StatusDot"
1281
1281
  },
1282
- dottransparent: {
1282
+ dotoutline: {
1283
1283
  alternativeName: "",
1284
1284
  categories: "System, StatusDot"
1285
1285
  },
@@ -1295,7 +1295,43 @@ var AdditionalIconInformation_default = {
1295
1295
  alternativeName: "",
1296
1296
  categories: "System, StatusDot"
1297
1297
  },
1298
- dotwarningtriangle: {
1298
+ dottriangle: {
1299
+ alternativeName: "",
1300
+ categories: "System, StatusDot"
1301
+ },
1302
+ dotfill: {
1303
+ alternativeName: "",
1304
+ categories: "System, StatusDot"
1305
+ },
1306
+ dotdot: {
1307
+ alternativeName: "",
1308
+ categories: "System, StatusDot"
1309
+ },
1310
+ dotgroup: {
1311
+ alternativeName: "",
1312
+ categories: "System, StatusDot"
1313
+ },
1314
+ dotcirclearrows: {
1315
+ alternativeName: "",
1316
+ categories: "System, StatusDot"
1317
+ },
1318
+ dotnoaccess: {
1319
+ alternativeName: "",
1320
+ categories: "System, StatusDot"
1321
+ },
1322
+ dotpencil: {
1323
+ alternativeName: "",
1324
+ categories: "System, StatusDot"
1325
+ },
1326
+ dotnoeye: {
1327
+ alternativeName: "",
1328
+ categories: "System, StatusDot"
1329
+ },
1330
+ dotlogin: {
1331
+ alternativeName: "",
1332
+ categories: "System, StatusDot"
1333
+ },
1334
+ dotattachment: {
1299
1335
  alternativeName: "",
1300
1336
  categories: "System, StatusDot"
1301
1337
  },