@helsenorge/designsystem-react 7.13.4 → 8.0.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 (108) hide show
  1. package/CHANGELOG.md +80 -3
  2. package/__mocks__/matchMedia.d.ts +1 -1
  3. package/components/Checkbox/Checkbox.js +47 -46
  4. package/components/Checkbox/Checkbox.js.map +1 -1
  5. package/components/Checkbox/styles.module.scss +101 -29
  6. package/components/Checkbox/styles.module.scss.d.ts +0 -1
  7. package/components/Chip/Chip.d.ts +31 -0
  8. package/components/Chip/Chip.js +30 -0
  9. package/components/Chip/Chip.js.map +1 -0
  10. package/components/Chip/index.d.ts +3 -0
  11. package/components/Chip/index.js +9 -0
  12. package/components/Chip/styles.module.scss +98 -0
  13. package/components/Chip/styles.module.scss.d.ts +21 -0
  14. package/components/ErrorWrapper/ErrorWrapper.js +5 -5
  15. package/components/ErrorWrapper/ErrorWrapper.js.map +1 -1
  16. package/components/ErrorWrapper/styles.module.scss +0 -5
  17. package/components/EyebrowHeader/EyebrowHeader.d.ts +17 -0
  18. package/components/EyebrowHeader/EyebrowHeader.js +12 -0
  19. package/components/EyebrowHeader/EyebrowHeader.js.map +1 -0
  20. package/components/EyebrowHeader/index.d.ts +3 -0
  21. package/components/EyebrowHeader/index.js +5 -0
  22. package/components/EyebrowHeader/styles.module.scss +5 -0
  23. package/components/FormGroup/styles.module.scss +3 -0
  24. package/components/GridExample/GridExample.d.ts +1 -0
  25. package/components/GridExample/GridExample.js.map +1 -1
  26. package/components/HelpPanel/HelpPanel.d.ts +2 -2
  27. package/components/HelpPanel/HelpPanel.js +10 -10
  28. package/components/HelpPanel/HelpPanel.js.map +1 -1
  29. package/components/{HighlightBox/HighlightBox.d.ts → HighlightPanel/HighlightPanel.d.ts} +10 -10
  30. package/components/HighlightPanel/HighlightPanel.js +61 -0
  31. package/components/HighlightPanel/HighlightPanel.js.map +1 -0
  32. package/components/HighlightPanel/index.d.ts +3 -0
  33. package/components/HighlightPanel/index.js +7 -0
  34. package/components/HighlightPanel/index.js.map +1 -0
  35. package/components/{HighlightBox → HighlightPanel}/styles.module.scss +17 -17
  36. package/components/HighlightPanel/styles.module.scss.d.ts +25 -0
  37. package/components/HorizontalScroll/HorizontalScroll.d.ts +1 -0
  38. package/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
  39. package/components/NotificationPanel/NotificationPanel.d.ts +1 -1
  40. package/components/NotificationPanel/NotificationPanel.js +23 -23
  41. package/components/NotificationPanel/NotificationPanel.js.map +1 -1
  42. package/components/NotificationPanel/styles.module.scss +0 -14
  43. package/components/NotificationPanel/styles.module.scss.d.ts +0 -1
  44. package/components/RadioButton/RadioButton.js +42 -41
  45. package/components/RadioButton/RadioButton.js.map +1 -1
  46. package/components/RadioButton/styles.module.scss +41 -35
  47. package/components/ServiceMessage/ServiceMessage.js +25 -25
  48. package/components/ServiceMessage/ServiceMessage.js.map +1 -1
  49. package/components/ServiceMessage/styles.module.scss +0 -13
  50. package/components/ServiceMessage/styles.module.scss.d.ts +0 -1
  51. package/components/Tabs/Tabs.d.ts +1 -0
  52. package/components/Tabs/Tabs.js.map +1 -1
  53. package/components/Tag/Tag.d.ts +3 -9
  54. package/components/Tag/Tag.js +16 -42
  55. package/components/Tag/Tag.js.map +1 -1
  56. package/components/Tag/index.js +5 -6
  57. package/components/Tag/styles.module.scss +5 -105
  58. package/components/Tag/styles.module.scss.d.ts +0 -4
  59. package/components/TagList/TagList.d.ts +1 -0
  60. package/components/TagList/TagList.js.map +1 -1
  61. package/components/Tooltip/Tooltip.d.ts +4 -1
  62. package/components/Tooltip/Tooltip.js.map +1 -1
  63. package/components/Validation/Validation.d.ts +0 -5
  64. package/components/Validation/Validation.js +11 -12
  65. package/components/Validation/Validation.js.map +1 -1
  66. package/components/Validation/ValidationSummary.js +2 -2
  67. package/components/Validation/ValidationSummary.js.map +1 -1
  68. package/components/Validation/styles.module.scss +20 -14
  69. package/components/Validation/styles.module.scss.d.ts +5 -5
  70. package/constants.d.ts +5 -2
  71. package/constants.js +2 -2
  72. package/constants.js.map +1 -1
  73. package/package.json +3 -3
  74. package/scss/supernova/index.css +2 -2
  75. package/scss/supernova/styles/colors.css +1 -1
  76. package/utils/tests/setup-test.d.ts +1 -1
  77. package/_virtual/assert.js +0 -5
  78. package/_virtual/assert.js.map +0 -1
  79. package/_virtual/ast.js +0 -5
  80. package/_virtual/ast.js.map +0 -1
  81. package/_virtual/code.js +0 -5
  82. package/_virtual/code.js.map +0 -1
  83. package/_virtual/doctrine.js +0 -5
  84. package/_virtual/doctrine.js.map +0 -1
  85. package/_virtual/errors.js +0 -5
  86. package/_virtual/errors.js.map +0 -1
  87. package/_virtual/index.js +0 -5
  88. package/_virtual/inherits_browser.js +0 -5
  89. package/_virtual/inherits_browser.js.map +0 -1
  90. package/_virtual/keyword.js +0 -5
  91. package/_virtual/keyword.js.map +0 -1
  92. package/_virtual/typed.js +0 -5
  93. package/_virtual/typed.js.map +0 -1
  94. package/_virtual/types.js +0 -5
  95. package/_virtual/types.js.map +0 -1
  96. package/_virtual/util.js +0 -5
  97. package/_virtual/util.js.map +0 -1
  98. package/_virtual/utility.js +0 -5
  99. package/_virtual/utility.js.map +0 -1
  100. package/_virtual/utils.js +0 -5
  101. package/_virtual/utils.js.map +0 -1
  102. package/components/HighlightBox/HighlightBox.js +0 -61
  103. package/components/HighlightBox/HighlightBox.js.map +0 -1
  104. package/components/HighlightBox/index.d.ts +0 -3
  105. package/components/HighlightBox/index.js +0 -7
  106. package/components/HighlightBox/styles.module.scss.d.ts +0 -25
  107. /package/components/{HighlightBox → Chip}/index.js.map +0 -0
  108. /package/{_virtual → components/EyebrowHeader}/index.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationSummary.js","sources":["../../../src/components/Validation/ValidationSummary.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport ErrorList from './ErrorList';\nimport { ValidationErrors } from './types';\nimport { useUuid } from '../../hooks/useUuid';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\ninterface ValidationSummaryProps {\n /** Error summary title */\n errorTitle?: string;\n /** Error list */\n errors?: ValidationErrors;\n /** Markup props for error summary title. Default: h2 */\n errorTitleHtmlMarkup?: TitleTags;\n /** Will be shown last */\n children?: React.ReactNode;\n}\n\nconst ValidationSummary: React.FC<ValidationSummaryProps> = props => {\n const { errorTitleHtmlMarkup = 'h2' } = props;\n const titleId = useUuid();\n\n const summaryClasses = classNames(\n styles['validation-summary'],\n !!props.errors && Object.entries(props.errors).length > 0 && styles['validation-summary--visible']\n );\n\n return (\n <div role={'alert'} aria-live={'polite'} aria-relevant={'all'} aria-labelledby={titleId} className={summaryClasses}>\n {!!props.errors && Object.entries(props.errors).length > 0 && (\n <>\n <Title appearance=\"title4\" id={titleId} htmlMarkup={errorTitleHtmlMarkup} margin={{ marginTop: 0, marginBottom: 1 }}>\n {props.errorTitle}\n </Title>\n <ErrorList errors={props.errors} />\n </>\n )}\n {props.children}\n </div>\n );\n};\n\nexport default ValidationSummary;\n"],"names":["ValidationSummary","props","errorTitleHtmlMarkup","titleId","useUuid","summaryClasses","classNames","styles","React","Title","ErrorList"],"mappings":";;;;;;AAsBA,MAAMA,IAAsD,CAASC,MAAA;AAC7D,QAAA,EAAE,sBAAAC,IAAuB,KAAS,IAAAD,GAClCE,IAAUC,KAEVC,IAAiBC;AAAA,IACrBC,EAAO,oBAAoB;AAAA,IAC3B,CAAC,CAACN,EAAM,UAAU,OAAO,QAAQA,EAAM,MAAM,EAAE,SAAS,KAAKM,EAAO,6BAA6B;AAAA,EAAA;AAIjG,SAAAC,gBAAAA,EAAA,cAAC,SAAI,MAAM,SAAS,aAAW,UAAU,iBAAe,OAAO,mBAAiBL,GAAS,WAAWE,KACjG,CAAC,CAACJ,EAAM,UAAU,OAAO,QAAQA,EAAM,MAAM,EAAE,SAAS,KAErDO,gBAAAA,EAAA,cAAAA,EAAA,UAAA,MAAAA,gBAAAA,EAAA,cAACC,KAAM,YAAW,UAAS,IAAIN,GAAS,YAAYD,GAAsB,QAAQ,EAAE,WAAW,GAAG,cAAc,OAC7GD,EAAM,UACT,GACAO,gBAAAA,EAAA,cAACE,GAAU,EAAA,QAAQT,EAAM,OAAQ,CAAA,CACnC,GAEDA,EAAM,QACT;AAEJ;"}
1
+ {"version":3,"file":"ValidationSummary.js","sources":["../../../src/components/Validation/ValidationSummary.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport ErrorList from './ErrorList';\nimport { ValidationErrors } from './types';\nimport { useUuid } from '../../hooks/useUuid';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\ninterface ValidationSummaryProps {\n /** Error summary title */\n errorTitle?: string;\n /** Error list */\n errors?: ValidationErrors;\n /** Markup props for error summary title. Default: h2 */\n errorTitleHtmlMarkup?: TitleTags;\n /** Will be shown last */\n children?: React.ReactNode;\n}\n\nconst ValidationSummary: React.FC<ValidationSummaryProps> = props => {\n const { errorTitleHtmlMarkup = 'h2' } = props;\n const titleId = useUuid();\n\n const summaryClasses = classNames(\n styles['validation__summary'],\n !!props.errors && Object.entries(props.errors).length > 0 && styles['validation__summary--visible']\n );\n\n return (\n <div role={'alert'} aria-live={'polite'} aria-relevant={'all'} aria-labelledby={titleId} className={summaryClasses}>\n {!!props.errors && Object.entries(props.errors).length > 0 && (\n <>\n <Title appearance=\"title4\" id={titleId} htmlMarkup={errorTitleHtmlMarkup} margin={{ marginTop: 0, marginBottom: 1 }}>\n {props.errorTitle}\n </Title>\n <ErrorList errors={props.errors} />\n </>\n )}\n {props.children}\n </div>\n );\n};\n\nexport default ValidationSummary;\n"],"names":["ValidationSummary","props","errorTitleHtmlMarkup","titleId","useUuid","summaryClasses","classNames","styles","React","Title","ErrorList"],"mappings":";;;;;;AAsBA,MAAMA,IAAsD,CAASC,MAAA;AAC7D,QAAA,EAAE,sBAAAC,IAAuB,KAAS,IAAAD,GAClCE,IAAUC,KAEVC,IAAiBC;AAAA,IACrBC,EAAO;AAAA,IACP,CAAC,CAACN,EAAM,UAAU,OAAO,QAAQA,EAAM,MAAM,EAAE,SAAS,KAAKM,EAAO,8BAA8B;AAAA,EAAA;AAIlG,SAAAC,gBAAAA,EAAA,cAAC,SAAI,MAAM,SAAS,aAAW,UAAU,iBAAe,OAAO,mBAAiBL,GAAS,WAAWE,KACjG,CAAC,CAACJ,EAAM,UAAU,OAAO,QAAQA,EAAM,MAAM,EAAE,SAAS,KAErDO,gBAAAA,EAAA,cAAAA,EAAA,UAAA,MAAAA,gBAAAA,EAAA,cAACC,KAAM,YAAW,UAAS,IAAIN,GAAS,YAAYD,GAAsB,QAAQ,EAAE,WAAW,GAAG,cAAc,OAC7GD,EAAM,UACT,GACAO,gBAAAA,EAAA,cAACE,GAAU,EAAA,QAAQT,EAAM,OAAQ,CAAA,CACnC,GAEDA,EAAM,QACT;AAEJ;"}
@@ -1,26 +1,32 @@
1
+ @use 'sass:map';
2
+ @import '../../scss/breakpoints';
1
3
  @import '../../scss/spacers';
2
4
  @import '../../scss/palette';
3
5
  @import '../../scss/font-settings';
4
6
 
5
- .validation-summary {
6
- color: $cherry600;
7
+ .validation {
8
+ &__error-wrapper {
9
+ padding-bottom: getSpacer(m);
7
10
 
8
- &--visible {
9
- margin: getSpacer(l) 0 getSpacer(s);
11
+ @media (min-width: map.get($grid-breakpoints, md)) {
12
+ padding-bottom: getSpacer(l);
13
+ }
10
14
  }
11
- }
12
15
 
13
- .validation-errors {
14
- font-size: $font-size-sm;
15
- font-weight: 600;
16
+ &__summary {
17
+ color: $cherry600;
16
18
 
17
- &--visible {
18
- margin: getSpacer(l) 0 getSpacer(s);
19
+ &--visible {
20
+ margin: getSpacer(l) 0 getSpacer(s);
21
+ }
19
22
  }
20
- }
21
23
 
22
- .form-group-wrapper {
23
- &--error-sibling {
24
- padding-bottom: 0 !important;
24
+ &__errors {
25
+ font-size: $font-size-sm;
26
+ font-weight: 600;
27
+
28
+ &--visible {
29
+ margin: getSpacer(l) 0 getSpacer(s);
30
+ }
25
31
  }
26
32
  }
@@ -1,9 +1,9 @@
1
1
  export type Styles = {
2
- 'form-group-wrapper--error-sibling': string;
3
- 'validation-errors': string;
4
- 'validation-errors--visible': string;
5
- 'validation-summary': string;
6
- 'validation-summary--visible': string;
2
+ 'validation__error-wrapper': string;
3
+ validation__errors: string;
4
+ 'validation__errors--visible': string;
5
+ validation__summary: string;
6
+ 'validation__summary--visible': string;
7
7
  };
8
8
 
9
9
  export type ClassNames = keyof Styles;
package/constants.d.ts CHANGED
@@ -10,7 +10,8 @@ export declare enum ZIndex {
10
10
  Modal = 1300000,
11
11
  PopOver = 11000,
12
12
  ExpanderTrigger = 10000,
13
- OverlayScreen = 9999
13
+ OverlayScreen = 9999,
14
+ LightBoxButtons = 1000
14
15
  }
15
16
  export declare const AVERAGE_CHARACTER_WIDTH_PX = 12;
16
17
  export interface HTMLButtonProps {
@@ -56,6 +57,7 @@ export declare enum AnalyticsId {
56
57
  Badge = "badge",
57
58
  Button = "button",
58
59
  Checkbox = "checkbox",
60
+ Chip = "chip",
59
61
  Close = "close",
60
62
  DictionaryTrigger = "dictionary-trigger",
61
63
  Dropdown = "dropdown",
@@ -66,11 +68,12 @@ export declare enum AnalyticsId {
66
68
  ExpanderHierarchyExpander = "expander-hierarchy-expander",
67
69
  ExpanderList = "expander-list",
68
70
  ExpanderListExpander = "expander-list-expander",
71
+ EyebrowHeader = "eyebrow-header",
69
72
  FormGroup = "form-group",
70
73
  FormLayout = "form-layout",
71
74
  HelpBubble = "help-bubble",
72
75
  HelpQuestion = "help-question",
73
- HighlightBox = "highlight-box",
76
+ HighlightPanel = "highlight-panel",
74
77
  Icon = "icon",
75
78
  Illustration = "Illustration",
76
79
  Input = "input",
package/constants.js CHANGED
@@ -1,6 +1,6 @@
1
- var e = /* @__PURE__ */ ((r) => (r[r.XXSmall = 24] = "XXSmall", r[r.XSmall = 38] = "XSmall", r[r.Small = 48] = "Small", r[r.Medium = 64] = "Medium", r[r.Large = 80] = "Large", r[r.XLarge = 130] = "XLarge", r))(e || {}), o = /* @__PURE__ */ ((r) => (r[r.Modal = 13e5] = "Modal", r[r.PopOver = 11e3] = "PopOver", r[r.ExpanderTrigger = 1e4] = "ExpanderTrigger", r[r.OverlayScreen = 9999] = "OverlayScreen", r))(o || {});
1
+ var e = /* @__PURE__ */ ((r) => (r[r.XXSmall = 24] = "XXSmall", r[r.XSmall = 38] = "XSmall", r[r.Small = 48] = "Small", r[r.Medium = 64] = "Medium", r[r.Large = 80] = "Large", r[r.XLarge = 130] = "XLarge", r))(e || {}), o = /* @__PURE__ */ ((r) => (r[r.Modal = 13e5] = "Modal", r[r.PopOver = 11e3] = "PopOver", r[r.ExpanderTrigger = 1e4] = "ExpanderTrigger", r[r.OverlayScreen = 9999] = "OverlayScreen", r[r.LightBoxButtons = 1e3] = "LightBoxButtons", r))(o || {});
2
2
  const g = 12;
3
- var p = /* @__PURE__ */ ((r) => (r.onwhite = "onwhite", r.ongrey = "ongrey", r.onblueberry = "onblueberry", r.ondark = "ondark", r.oninvalid = "oninvalid", r))(p || {}), a = /* @__PURE__ */ ((r) => (r.medium = "medium", r.large = "large", r))(a || {}), t = /* @__PURE__ */ ((r) => (r.AnchorLink = "anchor-link", r.Avatar = "avatar", r.Badge = "badge", r.Button = "button", r.Checkbox = "checkbox", r.Close = "close", r.DictionaryTrigger = "dictionary-trigger", r.Dropdown = "dropdown", r.Duolist = "duolist", r.EmptyState = "empty-state", r.Expander = "expander", r.ExpanderHierarchy = "expander-hierarchy", r.ExpanderHierarchyExpander = "expander-hierarchy-expander", r.ExpanderList = "expander-list", r.ExpanderListExpander = "expander-list-expander", r.FormGroup = "form-group", r.FormLayout = "form-layout", r.HelpBubble = "help-bubble", r.HelpQuestion = "help-question", r.HighlightBox = "highlight-box", r.Icon = "icon", r.Illustration = "Illustration", r.Input = "input", r.Label = "label", r.Link = "link", r.LinkList = "link-list", r.List = "list", r.Loader = "loader", r.Logo = "logo", r.Modal = "modal", r.NotificationPanel = "notification-panel", r.Panel = "panel", r.PanelList = "panel-list", r.PopMenu = "pop-menu", r.PopOver = "pop-over", r.Portal = "portal", r.PromoPanel = "promo-panel", r.RadioButton = "radio-button", r.Select = "select", r.SharingStatus = "sharing-status", r.Slider = "slider", r.Spacer = "spacer", r.StatusDot = "status-dot", r.Step = "step", r.StepButtons = "step-buttons", r.Stepper = "stepper", r.Sublabel = "sublabel", r.Table = "table", r.Tag = "tag", r.TagList = "tag-list", r.Textarea = "textarea", r.Tile = "tile", r.Title = "title", r.Tooltip = "tooltip", r.Trigger = "trigger", r.Validation = "validation", r))(t || {}), u = /* @__PURE__ */ ((r) => (r.Enter = "Enter", r.Escape = "Escape", r.ArrowDown = "ArrowDown", r.ArrowUp = "ArrowUp", r.ArrowRight = "ArrowRight", r.ArrowLeft = "ArrowLeft", r.Home = "Home", r.End = "End", r.Space = " ", r.Tab = "Tab", r))(u || {});
3
+ var p = /* @__PURE__ */ ((r) => (r.onwhite = "onwhite", r.ongrey = "ongrey", r.onblueberry = "onblueberry", r.ondark = "ondark", r.oninvalid = "oninvalid", r))(p || {}), a = /* @__PURE__ */ ((r) => (r.medium = "medium", r.large = "large", r))(a || {}), t = /* @__PURE__ */ ((r) => (r.AnchorLink = "anchor-link", r.Avatar = "avatar", r.Badge = "badge", r.Button = "button", r.Checkbox = "checkbox", r.Chip = "chip", r.Close = "close", r.DictionaryTrigger = "dictionary-trigger", r.Dropdown = "dropdown", r.Duolist = "duolist", r.EmptyState = "empty-state", r.Expander = "expander", r.ExpanderHierarchy = "expander-hierarchy", r.ExpanderHierarchyExpander = "expander-hierarchy-expander", r.ExpanderList = "expander-list", r.ExpanderListExpander = "expander-list-expander", r.EyebrowHeader = "eyebrow-header", r.FormGroup = "form-group", r.FormLayout = "form-layout", r.HelpBubble = "help-bubble", r.HelpQuestion = "help-question", r.HighlightPanel = "highlight-panel", r.Icon = "icon", r.Illustration = "Illustration", r.Input = "input", r.Label = "label", r.Link = "link", r.LinkList = "link-list", r.List = "list", r.Loader = "loader", r.Logo = "logo", r.Modal = "modal", r.NotificationPanel = "notification-panel", r.Panel = "panel", r.PanelList = "panel-list", r.PopMenu = "pop-menu", r.PopOver = "pop-over", r.Portal = "portal", r.PromoPanel = "promo-panel", r.RadioButton = "radio-button", r.Select = "select", r.SharingStatus = "sharing-status", r.Slider = "slider", r.Spacer = "spacer", r.StatusDot = "status-dot", r.Step = "step", r.StepButtons = "step-buttons", r.Stepper = "stepper", r.Sublabel = "sublabel", r.Table = "table", r.Tag = "tag", r.TagList = "tag-list", r.Textarea = "textarea", r.Tile = "tile", r.Title = "title", r.Tooltip = "tooltip", r.Trigger = "trigger", r.Validation = "validation", r))(t || {}), u = /* @__PURE__ */ ((r) => (r.Enter = "Enter", r.Escape = "Escape", r.ArrowDown = "ArrowDown", r.ArrowUp = "ArrowUp", r.ArrowRight = "ArrowRight", r.ArrowLeft = "ArrowLeft", r.Home = "Home", r.End = "End", r.Space = " ", r.Tab = "Tab", r))(u || {});
4
4
  export {
5
5
  g as AVERAGE_CHARACTER_WIDTH_PX,
6
6
  t as AnalyticsId,
package/constants.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export enum IconSize {\n XXSmall = 24,\n XSmall = 38,\n Small = 48,\n Medium = 64,\n Large = 80,\n XLarge = 130,\n}\n\nexport enum ZIndex {\n Modal = 1300000,\n PopOver = 11000,\n // TODO: Skille mellom ExpanderTrigger isSticky og isHovered? Skulle tro isHovered trenger vesentlig mindre z-index\n ExpanderTrigger = 10000,\n OverlayScreen = 9999,\n}\n\nexport const AVERAGE_CHARACTER_WIDTH_PX = 12;\n\nexport interface HTMLButtonProps {\n autoFocus?: boolean;\n disabled?: boolean;\n form?: string;\n formAction?: string;\n formEncType?: string;\n formMethod?: string;\n formNoValidate?: boolean;\n formTarget?: string;\n name?: string;\n type?: 'submit' | 'reset' | 'button' | string;\n value?: string | string[] | number;\n id?: string;\n}\n\nexport type AnchorTarget = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface HTMLAnchorProps {\n download?: string;\n href?: string;\n hrefLang?: string;\n media?: string;\n ping?: string;\n rel?: AnchorTarget;\n target?: string;\n referrerPolicy?:\n | ''\n | 'same-origin'\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n}\n\nexport type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;\n\nexport enum FormMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n ondark = 'ondark',\n oninvalid = 'oninvalid',\n}\n\nexport enum FormSize {\n medium = 'medium',\n large = 'large',\n}\n\nexport enum AnalyticsId {\n AnchorLink = 'anchor-link',\n Avatar = 'avatar',\n Badge = 'badge',\n Button = 'button',\n Checkbox = 'checkbox',\n Close = 'close',\n DictionaryTrigger = 'dictionary-trigger',\n Dropdown = 'dropdown',\n Duolist = 'duolist',\n EmptyState = 'empty-state',\n Expander = 'expander',\n ExpanderHierarchy = 'expander-hierarchy',\n ExpanderHierarchyExpander = 'expander-hierarchy-expander',\n ExpanderList = 'expander-list',\n ExpanderListExpander = 'expander-list-expander',\n FormGroup = 'form-group',\n FormLayout = 'form-layout',\n HelpBubble = 'help-bubble',\n HelpQuestion = 'help-question',\n HighlightBox = 'highlight-box',\n Icon = 'icon',\n Illustration = 'Illustration',\n Input = 'input',\n Label = 'label',\n Link = 'link',\n LinkList = 'link-list',\n List = 'list',\n Loader = 'loader',\n Logo = 'logo',\n Modal = 'modal',\n NotificationPanel = 'notification-panel',\n Panel = 'panel',\n PanelList = 'panel-list',\n PopMenu = 'pop-menu',\n PopOver = 'pop-over',\n Portal = 'portal',\n PromoPanel = 'promo-panel',\n RadioButton = 'radio-button',\n Select = 'select',\n SharingStatus = 'sharing-status',\n Slider = 'slider',\n Spacer = 'spacer',\n StatusDot = 'status-dot',\n Step = 'step',\n StepButtons = 'step-buttons',\n Stepper = 'stepper',\n Sublabel = 'sublabel',\n Table = 'table',\n Tag = 'tag',\n TagList = 'tag-list',\n Textarea = 'textarea',\n Tile = 'tile',\n Title = 'title',\n Tooltip = 'tooltip',\n Trigger = 'trigger',\n Validation = 'validation',\n}\n\nexport enum KeyboardEventKey {\n Enter = 'Enter',\n Escape = 'Escape',\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n ArrowRight = 'ArrowRight',\n ArrowLeft = 'ArrowLeft',\n Home = 'Home',\n End = 'End',\n Space = ' ',\n Tab = 'Tab',\n}\n"],"names":["IconSize","ZIndex","AVERAGE_CHARACTER_WIDTH_PX","FormMode","FormSize","AnalyticsId","KeyboardEventKey"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAAA,EAAA,UAAU,EAAV,IAAA,WACAA,EAAAA,EAAA,SAAS,EAAT,IAAA,UACAA,EAAAA,EAAA,QAAQ,EAAR,IAAA,SACAA,EAAAA,EAAA,SAAS,EAAT,IAAA,UACAA,EAAAA,EAAA,QAAQ,EAAR,IAAA,SACAA,EAAAA,EAAA,SAAS,GAAT,IAAA,UANUA,IAAAA,KAAA,CAAA,CAAA,GASAC,sBAAAA,OACVA,EAAAA,EAAA,QAAQ,IAAR,IAAA,SACAA,EAAAA,EAAA,UAAU,IAAV,IAAA,WAEAA,EAAAA,EAAA,kBAAkB,GAAlB,IAAA,mBACAA,EAAAA,EAAA,gBAAgB,IAAhB,IAAA,iBALUA,IAAAA,KAAA,CAAA,CAAA;AAQL,MAAMC,IAA6B;AAyC9B,IAAAC,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,SAAS,UACTA,EAAA,YAAY,aALFA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA,GAKAC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,EAAA,OAAO,QACPA,EAAA,MAAM,OACNA,EAAA,QAAQ,KACRA,EAAA,MAAM,OAVIA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export enum IconSize {\n XXSmall = 24,\n XSmall = 38,\n Small = 48,\n Medium = 64,\n Large = 80,\n XLarge = 130,\n}\n\nexport enum ZIndex {\n Modal = 1300000,\n PopOver = 11000,\n // TODO: Skille mellom ExpanderTrigger isSticky og isHovered? Skulle tro isHovered trenger vesentlig mindre z-index\n ExpanderTrigger = 10000,\n OverlayScreen = 9999,\n LightBoxButtons = 1000,\n}\n\nexport const AVERAGE_CHARACTER_WIDTH_PX = 12;\n\nexport interface HTMLButtonProps {\n autoFocus?: boolean;\n disabled?: boolean;\n form?: string;\n formAction?: string;\n formEncType?: string;\n formMethod?: string;\n formNoValidate?: boolean;\n formTarget?: string;\n name?: string;\n type?: 'submit' | 'reset' | 'button' | string;\n value?: string | string[] | number;\n id?: string;\n}\n\nexport type AnchorTarget = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface HTMLAnchorProps {\n download?: string;\n href?: string;\n hrefLang?: string;\n media?: string;\n ping?: string;\n rel?: AnchorTarget;\n target?: string;\n referrerPolicy?:\n | ''\n | 'same-origin'\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n}\n\nexport type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;\n\nexport enum FormMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n ondark = 'ondark',\n oninvalid = 'oninvalid',\n}\n\nexport enum FormSize {\n medium = 'medium',\n large = 'large',\n}\n\nexport enum AnalyticsId {\n AnchorLink = 'anchor-link',\n Avatar = 'avatar',\n Badge = 'badge',\n Button = 'button',\n Checkbox = 'checkbox',\n Chip = 'chip',\n Close = 'close',\n DictionaryTrigger = 'dictionary-trigger',\n Dropdown = 'dropdown',\n Duolist = 'duolist',\n EmptyState = 'empty-state',\n Expander = 'expander',\n ExpanderHierarchy = 'expander-hierarchy',\n ExpanderHierarchyExpander = 'expander-hierarchy-expander',\n ExpanderList = 'expander-list',\n ExpanderListExpander = 'expander-list-expander',\n EyebrowHeader = 'eyebrow-header',\n FormGroup = 'form-group',\n FormLayout = 'form-layout',\n HelpBubble = 'help-bubble',\n HelpQuestion = 'help-question',\n HighlightPanel = 'highlight-panel',\n Icon = 'icon',\n Illustration = 'Illustration',\n Input = 'input',\n Label = 'label',\n Link = 'link',\n LinkList = 'link-list',\n List = 'list',\n Loader = 'loader',\n Logo = 'logo',\n Modal = 'modal',\n NotificationPanel = 'notification-panel',\n Panel = 'panel',\n PanelList = 'panel-list',\n PopMenu = 'pop-menu',\n PopOver = 'pop-over',\n Portal = 'portal',\n PromoPanel = 'promo-panel',\n RadioButton = 'radio-button',\n Select = 'select',\n SharingStatus = 'sharing-status',\n Slider = 'slider',\n Spacer = 'spacer',\n StatusDot = 'status-dot',\n Step = 'step',\n StepButtons = 'step-buttons',\n Stepper = 'stepper',\n Sublabel = 'sublabel',\n Table = 'table',\n Tag = 'tag',\n TagList = 'tag-list',\n Textarea = 'textarea',\n Tile = 'tile',\n Title = 'title',\n Tooltip = 'tooltip',\n Trigger = 'trigger',\n Validation = 'validation',\n}\n\nexport enum KeyboardEventKey {\n Enter = 'Enter',\n Escape = 'Escape',\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n ArrowRight = 'ArrowRight',\n ArrowLeft = 'ArrowLeft',\n Home = 'Home',\n End = 'End',\n Space = ' ',\n Tab = 'Tab',\n}\n"],"names":["IconSize","ZIndex","AVERAGE_CHARACTER_WIDTH_PX","FormMode","FormSize","AnalyticsId","KeyboardEventKey"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAAA,EAAA,UAAU,EAAV,IAAA,WACAA,EAAAA,EAAA,SAA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OAAO,QACPA,EAAA,WAAW,aACXA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,QAAQ,SACRA,EAAA,oBAAoB,sBACpBA,EAAA,QAAQ,SACRA,EAAA,YAAY,cACZA,EAAA,UAAU,YACVA,EAAA,UAAU,YACVA,EAAA,SAAS,UACTA,EAAA,aAAa,eACbA,EAAA,cAAc,gBACdA,EAAA,SAAS,UACTA,EAAA,gBAAgB,kBAChBA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,YAAY,cACZA,EAAA,OAAO,QACPA,EAAA,cAAc,gBACdA,EAAA,UAAU,WACVA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,MAAM,OACNA,EAAA,UAAU,YACVA,EAAA,WAAW,YACXA,EAAA,OAAO,QACPA,EAAA,QAAQ,SACRA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,aAAa,cA1DHA,IAAAA,KAAA,CAAA,CAAA,GA6DAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,YAAY,aACZA,EAAA,UAAU,WACVA,EAAA,aAAa,cACbA,EAAA,YAAY,aACZA,EAAA,OAAO,QACPA,EAAA,MAAM,OACNA,EAAA,QAAQ,KACRA,EAAA,MAAM,OAVIA,IAAAA,KAAA,CAAA,CAAA;"}
package/package.json CHANGED
@@ -7,15 +7,15 @@
7
7
  "url": "git+https://github.com/helsenorge/designsystem.git"
8
8
  },
9
9
  "homepage": "https://helsenorge.design",
10
- "version": "7.13.4",
10
+ "version": "8.0.1",
11
11
  "author": "Helsenorge",
12
12
  "license": "MIT",
13
13
  "peerDependencies": {
14
14
  "bootstrap": "^4.6.2",
15
15
  "classnames": "^2.3.2",
16
16
  "normalize.css": "^8.0.1",
17
- "react": "^17.0.0",
18
- "react-dom": "^17.0.0"
17
+ "react": "^17.0.0 || ^18.0.0",
18
+ "react-dom": "^17.0.0 || ^18.0.0"
19
19
  },
20
20
  "sideEffects": false
21
21
  }
@@ -1,3 +1,3 @@
1
1
  /* This file was generated by Supernova and should not be changed manually */
2
- @import "./colors.css";
3
- @import "./typography.css";
2
+ @import './colors.css';
3
+ @import './typography.css';
@@ -170,4 +170,4 @@
170
170
  /* Subtle border for Blueberry 50 background */
171
171
  --color-base-border-blueberry: #afdae3;
172
172
  --color-base-border-cherry: #eec0a5;
173
- }
173
+ }
@@ -1,4 +1,4 @@
1
- import '@testing-library/jest-dom/extend-expect';
1
+ import '@testing-library/jest-dom';
2
2
  import '../../__mocks__/matchMedia';
3
3
  import '../../__mocks__/IntersectionObserver';
4
4
  import '../../__mocks__/ResizeObserver';
@@ -1,5 +0,0 @@
1
- var e = { exports: {} };
2
- export {
3
- e as __module
4
- };
5
- //# sourceMappingURL=assert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assert.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/_virtual/ast.js DELETED
@@ -1,5 +0,0 @@
1
- var a = { exports: {} };
2
- export {
3
- a as __module
4
- };
5
- //# sourceMappingURL=ast.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ast.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/_virtual/code.js DELETED
@@ -1,5 +0,0 @@
1
- var e = { exports: {} };
2
- export {
3
- e as __module
4
- };
5
- //# sourceMappingURL=code.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
5
- //# sourceMappingURL=doctrine.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doctrine.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
5
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/_virtual/index.js DELETED
@@ -1,5 +0,0 @@
1
- var a = { exports: {} };
2
- export {
3
- a as __module
4
- };
5
- //# sourceMappingURL=index.js.map
@@ -1,5 +0,0 @@
1
- var r = { exports: {} };
2
- export {
3
- r as __module
4
- };
5
- //# sourceMappingURL=inherits_browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inherits_browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- var e = { exports: {} };
2
- export {
3
- e as __module
4
- };
5
- //# sourceMappingURL=keyword.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keyword.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/_virtual/typed.js DELETED
@@ -1,5 +0,0 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
5
- //# sourceMappingURL=typed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typed.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/_virtual/types.js DELETED
@@ -1,5 +0,0 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
5
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/_virtual/util.js DELETED
@@ -1,5 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
5
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- var t = {};
2
- export {
3
- t as __exports
4
- };
5
- //# sourceMappingURL=utility.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utility.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/_virtual/utils.js DELETED
@@ -1,5 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
5
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,61 +0,0 @@
1
- import e from "react";
2
- import l from "classnames";
3
- import "../../theme/grid.js";
4
- import { useBreakpoint as w, Breakpoint as y } from "../../hooks/useBreakpoint.js";
5
- import { AnalyticsId as p, IconSize as N } from "../../constants.js";
6
- import { Icon as C } from "../Icon/Icon.js";
7
- import { LazyIcon as W } from "../LazyIcon/LazyIcon.js";
8
- import { Title as z } from "../Title/Title.js";
9
- import t from "../HighlightBox/styles.module.scss";
10
- var B = /* @__PURE__ */ ((i) => (i.medium = "medium", i.large = "large", i.fluid = "fluid", i))(B || {});
11
- const u = ({ className: i, size: r, children: s }) => /* @__PURE__ */ e.createElement("div", { className: i, "data-testid": "highlightbox-wrapper" }, /* @__PURE__ */ e.createElement("div", { className: t.highlightbox__row }, /* @__PURE__ */ e.createElement("div", { className: l(t.highlightbox__col, r === "medium" && t["highlightbox__col--offset"]) }, s))), x = (i) => {
12
- const { children: r, className: s } = i, a = l(t["highlightbox__content-wrapper"], s);
13
- return /* @__PURE__ */ e.createElement("div", { className: a }, /* @__PURE__ */ e.createElement("div", { className: l(t.highlightbox__row) }, r));
14
- }, j = (i) => {
15
- const {
16
- children: r,
17
- color: s = "white",
18
- size: a = "medium",
19
- testId: c,
20
- svgIcon: n,
21
- htmlMarkup: b = "div",
22
- className: v,
23
- contentWrapperClassName: I,
24
- title: d,
25
- titleHtmlMarkup: k = "h2"
26
- } = i, _ = w(), o = l(
27
- t[`highlightbox--${s}`],
28
- t[`highlightbox--${a}`],
29
- n && t["highlightbox--has-icon"],
30
- { container: a === "medium" || a === "large" },
31
- v
32
- ), m = () => {
33
- if (n) {
34
- const f = a === "large" && _ && _ >= y.md ? N.Medium : N.Small, E = /* @__PURE__ */ e.createElement(z, { testId: "titleId", htmlMarkup: k, appearance: "title4" }, d);
35
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: t.highlightbox__icon }, typeof n == "string" ? /* @__PURE__ */ e.createElement(W, { iconName: n, size: f }) : /* @__PURE__ */ e.createElement(C, { svgIcon: n, size: f }), d && /* @__PURE__ */ e.createElement("div", { className: t.mobile }, E)), /* @__PURE__ */ e.createElement("div", { className: t.highlightbox__content }, d && /* @__PURE__ */ e.createElement("div", { className: t.desktop, "aria-hidden": "true" }, E), r));
36
- }
37
- return r;
38
- }, h = b, g = l(t["highlightbox__content-wrapper"], I);
39
- return a === "medium" ? /* @__PURE__ */ e.createElement(u, { className: o, size: a }, /* @__PURE__ */ e.createElement(h, { className: g, "data-testid": c, "data-analyticsid": p.HighlightBox }, m())) : a === "large" && n ? /* @__PURE__ */ e.createElement(u, { className: o, size: a }, /* @__PURE__ */ e.createElement(x, { className: g }, /* @__PURE__ */ e.createElement(
40
- h,
41
- {
42
- className: l(t.highlightbox__col, t["highlightbox__col--large-with-icon"]),
43
- "data-testid": c,
44
- "data-analyticsid": p.HighlightBox
45
- },
46
- m()
47
- ))) : a === "large" ? /* @__PURE__ */ e.createElement(u, { className: o, size: a }, /* @__PURE__ */ e.createElement(x, { className: g }, /* @__PURE__ */ e.createElement(
48
- h,
49
- {
50
- className: l(t.highlightbox__col, t["highlightbox__col--offset"]),
51
- "data-testid": c,
52
- "data-analyticsid": p.HighlightBox
53
- },
54
- m()
55
- ))) : a === "fluid" ? /* @__PURE__ */ e.createElement(h, { className: o, "data-testid": c }, m()) : null;
56
- };
57
- export {
58
- B as HighlightBoxSize,
59
- j as default
60
- };
61
- //# sourceMappingURL=HighlightBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HighlightBox.js","sources":["../../../src/components/HighlightBox/HighlightBox.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { useBreakpoint, Breakpoint } from '../..';\nimport { AnalyticsId } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\nimport Icon, { SvgIcon, IconSize } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type HighlightBoxColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;\n\nexport enum HighlightBoxSize {\n medium = 'medium',\n large = 'large',\n fluid = 'fluid',\n}\n\nexport type HighlightBoxTags = Exclude<\n keyof HTMLElementTagNameMap,\n 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'\n>;\n\nexport interface HighlightBoxProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the background color. Default: white */\n color?: HighlightBoxColors;\n /** Changes the size. Default: medium */\n size?: keyof typeof HighlightBoxSize;\n /** Adds an icon to the highlightbox. */\n svgIcon?: SvgIcon | IconName;\n /** Changes the underlying element. Default: div */\n htmlMarkup?: HighlightBoxTags;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the content-wrapper */\n contentWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Element that is set after the icon-element in the DOM, often a title-element */\n title?: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\ninterface WrapperProps {\n className: string;\n size?: keyof typeof HighlightBoxSize;\n}\n\nconst Wrapper: React.FC<WrapperProps> = ({ className, size, children }) => (\n <div className={className} data-testid={'highlightbox-wrapper'}>\n <div className={styles.highlightbox__row}>\n <div className={classNames(styles.highlightbox__col, size === HighlightBoxSize.medium && styles['highlightbox__col--offset'])}>\n {children}\n </div>\n </div>\n </div>\n);\n\ninterface ContentWrapperProps {\n children: React.ReactNode;\n className?: string;\n}\n\nconst ContentWrapper: React.FC<ContentWrapperProps> = props => {\n const { children, className } = props;\n const contentWrapperClasses = classNames(styles['highlightbox__content-wrapper'], className);\n\n return (\n <div className={contentWrapperClasses}>\n <div className={classNames(styles.highlightbox__row)}>{children}</div>\n </div>\n );\n};\n\nconst HighlightBox: React.FC<HighlightBoxProps> = props => {\n const {\n children,\n color = 'white',\n size = HighlightBoxSize.medium,\n testId,\n svgIcon,\n htmlMarkup = 'div',\n className,\n contentWrapperClassName,\n title,\n titleHtmlMarkup = 'h2',\n } = props;\n const breakpoint = useBreakpoint();\n\n const containerClassName = classNames(\n styles[`highlightbox--${color}`],\n styles[`highlightbox--${size}`],\n svgIcon && styles['highlightbox--has-icon'],\n { container: size === 'medium' || size === 'large' },\n className\n );\n\n const renderContent = () => {\n if (svgIcon) {\n const iconSize = size === HighlightBoxSize.large && breakpoint && breakpoint >= Breakpoint.md ? IconSize.Medium : IconSize.Small;\n\n const titleElement = (\n <Title testId=\"titleId\" htmlMarkup={titleHtmlMarkup} appearance=\"title4\">\n {title}\n </Title>\n );\n\n return (\n <>\n <div className={styles.highlightbox__icon}>\n {typeof svgIcon === 'string' ? <LazyIcon iconName={svgIcon} size={iconSize} /> : <Icon svgIcon={svgIcon} size={iconSize} />}\n {title && <div className={styles['mobile']}>{titleElement}</div>}\n </div>\n <div className={styles.highlightbox__content}>\n {title && (\n <div className={styles['desktop']} aria-hidden=\"true\">\n {titleElement}\n </div>\n )}\n {children}\n </div>\n </>\n );\n }\n\n return children;\n };\n\n const CustomTag = htmlMarkup;\n\n const contentWrapperClasses = classNames(styles['highlightbox__content-wrapper'], contentWrapperClassName);\n\n if (size === HighlightBoxSize.medium) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <CustomTag className={contentWrapperClasses} data-testid={testId} data-analyticsid={AnalyticsId.HighlightBox}>\n {renderContent()}\n </CustomTag>\n </Wrapper>\n );\n }\n\n if (size === HighlightBoxSize.large && svgIcon) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightbox__col, styles['highlightbox__col--large-with-icon'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightBox}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightBoxSize.large) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightbox__col, styles['highlightbox__col--offset'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightBox}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightBoxSize.fluid) {\n return (\n <CustomTag className={containerClassName} data-testid={testId}>\n {renderContent()}\n </CustomTag>\n );\n }\n\n return null;\n};\n\nexport default HighlightBox;\n"],"names":["HighlightBoxSize","Wrapper","className","size","children","React","styles","classNames","ContentWrapper","props","contentWrapperClasses","HighlightBox","color","testId","svgIcon","htmlMarkup","contentWrapperClassName","title","titleHtmlMarkup","breakpoint","useBreakpoint","containerClassName","renderContent","iconSize","Breakpoint","IconSize","titleElement","Title","LazyIcon","Icon","CustomTag","AnalyticsId"],"mappings":";;;;;;;;;AAgBY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;AAuCZ,MAAMC,IAAkC,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,UAAAC,EAC1D,MAAAC,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAAH,GAAsB,eAAa,uBAAA,mCACrC,OAAI,EAAA,WAAWI,EAAO,kBAAA,GACpBD,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWE,EAAWD,EAAO,mBAAmBH,MAAS,YAA2BG,EAAO,2BAA2B,CAAC,KACzHF,CACH,CACF,CACF,GAQII,IAAgD,CAASC,MAAA;AACvD,QAAA,EAAE,UAAAL,GAAU,WAAAF,EAAc,IAAAO,GAC1BC,IAAwBH,EAAWD,EAAO,+BAA+B,GAAGJ,CAAS;AAE3F,SACGG,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWK,EAAA,GACbL,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWE,EAAWD,EAAO,iBAAiB,EAAI,GAAAF,CAAS,CAClE;AAEJ,GA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AAA,GAGH0B,IAAYf,GAEZL,IAAwBH,EAAWD,EAAO,+BAA+B,GAAGU,CAAuB;AAEzG,SAAIb,MAAS,2CAERF,GAAQ,EAAA,WAAWoB,GAAoB,MAAAlB,EAAA,mCACrC2B,GAAU,EAAA,WAAWpB,GAAuB,eAAaG,GAAQ,oBAAkBkB,EAAY,aAC7F,GAAAT,EACH,CAAA,CACF,IAIAnB,MAAS,WAA0BW,IAEnCT,gBAAAA,EAAA,cAACJ,KAAQ,WAAWoB,GAAoB,MAAAlB,KACrCE,gBAAAA,EAAA,cAAAG,GAAA,EAAe,WAAWE,EACzB,GAAAL,gBAAAA,EAAA;AAAA,IAACyB;AAAA,IAAA;AAAA,MACC,WAAWvB,EAAWD,EAAO,mBAAmBA,EAAO,oCAAoC,CAAC;AAAA,MAC5F,eAAaO;AAAA,MACb,oBAAkBkB,EAAY;AAAA,IAAA;AAAA,IAE7BT,EAAc;AAAA,EAEnB,CAAA,CACF,IAIAnB,MAAS,UAETE,gBAAAA,EAAA,cAACJ,KAAQ,WAAWoB,GAAoB,MAAAlB,KACrCE,gBAAAA,EAAA,cAAAG,GAAA,EAAe,WAAWE,EACzB,GAAAL,gBAAAA,EAAA;AAAA,IAACyB;AAAA,IAAA;AAAA,MACC,WAAWvB,EAAWD,EAAO,mBAAmBA,EAAO,2BAA2B,CAAC;AAAA,MACnF,eAAaO;AAAA,MACb,oBAAkBkB,EAAY;AAAA,IAAA;AAAA,IAE7BT,EAAc;AAAA,EAEnB,CAAA,CACF,IAIAnB,MAAS,0CAER2B,GAAU,EAAA,WAAWT,GAAoB,eAAaR,EAAA,GACpDS,GACH,IAIG;AACT;"}
@@ -1,3 +0,0 @@
1
- import HighlightBox from './HighlightBox';
2
- export * from './HighlightBox';
3
- export default HighlightBox;
@@ -1,7 +0,0 @@
1
- import i from "./HighlightBox.js";
2
- import { HighlightBoxSize as e } from "./HighlightBox.js";
3
- export {
4
- e as HighlightBoxSize,
5
- i as default
6
- };
7
- //# sourceMappingURL=index.js.map
@@ -1,25 +0,0 @@
1
- export type Styles = {
2
- desktop: string;
3
- highlightbox__col: string;
4
- 'highlightbox__col--large-with-icon': string;
5
- 'highlightbox__col--offset': string;
6
- highlightbox__content: string;
7
- 'highlightbox__content-wrapper': string;
8
- highlightbox__icon: string;
9
- highlightbox__row: string;
10
- 'highlightbox--blueberry': string;
11
- 'highlightbox--cherry': string;
12
- 'highlightbox--fluid': string;
13
- 'highlightbox--has-icon': string;
14
- 'highlightbox--large': string;
15
- 'highlightbox--medium': string;
16
- 'highlightbox--neutral': string;
17
- 'highlightbox--white': string;
18
- mobile: string;
19
- };
20
-
21
- export type ClassNames = keyof Styles;
22
-
23
- declare const styles: Styles;
24
-
25
- export default styles;
File without changes