@helsenorge/designsystem-react 7.1.0 → 7.2.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 (69) hide show
  1. package/CHANGELOG.md +31 -3
  2. package/components/AnchorLink/AnchorLink.stories.d.ts +1 -0
  3. package/components/Avatar/Avatar.stories.d.ts +2 -0
  4. package/components/Badge/Badge.stories.d.ts +2 -0
  5. package/components/Button/Button.js +21 -21
  6. package/components/Button/Button.js.map +1 -1
  7. package/components/Checkbox/Checkbox.stories.d.ts +1 -0
  8. package/components/Close/Close.stories.d.ts +1 -0
  9. package/components/DictionaryTrigger/DictionaryTrigger.stories.d.ts +1 -0
  10. package/components/Dropdown/Dropdown.js +17 -17
  11. package/components/Dropdown/Dropdown.js.map +1 -1
  12. package/components/Dropdown/Dropdown.stories.d.ts +1 -0
  13. package/components/Duolist/Duolist.stories.d.ts +1 -0
  14. package/components/Duolist/styles.module.scss +19 -19
  15. package/components/EmptyState/EmptyState.stories.d.ts +1 -0
  16. package/components/Expander/Expander.stories.d.ts +1 -0
  17. package/components/Expander/styles.module.scss +13 -13
  18. package/components/ExpanderHierarchy/ExpanderHierarchy.stories.d.ts +1 -0
  19. package/components/ExpanderList/ExpanderList.stories.d.ts +2 -0
  20. package/components/FormGroup/FormGroup.stories.d.ts +1 -0
  21. package/components/FormLayout/FormLayout.stories.d.ts +1 -0
  22. package/components/GridExample/GridExample.js +2 -5
  23. package/components/GridExample/GridExample.js.map +1 -1
  24. package/components/HelpBubble/HelpBubble.stories.d.ts +1 -0
  25. package/components/HelpPanel/HelpPanel.stories.d.ts +1 -0
  26. package/components/HelpQuestion/HelpQuestion.stories.d.ts +1 -0
  27. package/components/HighlightBox/HighlightBox.stories.d.ts +1 -0
  28. package/components/HorizontalScroll/styles.module.scss +2 -0
  29. package/components/Icon/Icon.stories.d.ts +1 -0
  30. package/components/Illustration/Illustration.stories.d.ts +1 -0
  31. package/components/Illustration/Illustrations.stories.d.ts +1 -0
  32. package/components/Input/Input.stories.d.ts +1 -0
  33. package/components/Label/Label.stories.d.ts +1 -0
  34. package/components/LazyIcon/LazyIcon.stories.d.ts +1 -0
  35. package/components/LazyIllustration/LazyIllustration.stories.d.ts +1 -0
  36. package/components/LinkList/LinkList.stories.d.ts +2 -0
  37. package/components/List/styles.module.scss +6 -0
  38. package/components/Loader/Loader.stories.d.ts +1 -0
  39. package/components/Logo/Logo.stories.d.ts +1 -0
  40. package/components/NotificationPanel/NotificationPanel.stories.d.ts +1 -0
  41. package/components/Panel/Panel.stories.d.ts +1 -0
  42. package/components/PanelList/PanelList.stories.d.ts +1 -0
  43. package/components/PopMenu/PopMenu.stories.d.ts +1 -0
  44. package/components/PopMenu/styles.module.scss +7 -8
  45. package/components/PopOver/styles.module.scss +4 -4
  46. package/components/PromoPanel/PromoPanel.stories.d.ts +1 -0
  47. package/components/RadioButton/RadioButton.stories.d.ts +1 -0
  48. package/components/Select/Select.stories.d.ts +1 -0
  49. package/components/ServiceMessage/ServiceMessage.stories.d.ts +1 -0
  50. package/components/SharingStatus/SharingStatus.stories.d.ts +1 -0
  51. package/components/Slider/Slider.stories.d.ts +1 -0
  52. package/components/Spacer/Spacer.stories.d.ts +1 -0
  53. package/components/StatusDot/StatusDot.stories.d.ts +1 -0
  54. package/components/Step/Step.stories.d.ts +1 -0
  55. package/components/StepButtons/StepButtons.stories.d.ts +1 -0
  56. package/components/Stepper/Stepper.stories.d.ts +1 -0
  57. package/components/Table/Table.stories.d.ts +1 -0
  58. package/components/Tag/Tag.stories.d.ts +1 -0
  59. package/components/TagList/TagList.stories.d.ts +1 -0
  60. package/components/Textarea/Textarea.stories.d.ts +1 -0
  61. package/components/Tile/Tile.stories.d.ts +2 -0
  62. package/components/Title/Title.stories.d.ts +1 -0
  63. package/components/Tooltip/Tooltip.stories.d.ts +1 -0
  64. package/components/Trigger/Trigger.stories.d.ts +1 -0
  65. package/components/Validation/Validation.stories.d.ts +2 -1
  66. package/docs/index.d.ts +1 -0
  67. package/docs/index.js +9 -4
  68. package/docs/index.js.map +1 -1
  69. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"GridExample.js","sources":["../../../src/components/GridExample/GridExample.tsx"],"sourcesContent":["import React from 'react';\n\nimport { isSupernova } from '../../docs';\n\ntype GridLayout = 'helsenorge' | 'padding' | 'none';\ninterface GridExampleProps {\n gridLayout: GridLayout;\n}\n\nexport const GridExample: React.FC<GridExampleProps> = ({ gridLayout, children }) => {\n const returnWithPadding = isSupernova() || gridLayout === 'padding';\n\n return (\n <>\n {returnWithPadding && <div style={{ padding: '0.5rem' }}>{children}</div>}\n {gridLayout === 'helsenorge' && (\n <div className=\"container py-5\">\n <div className=\"row\">\n <div className=\"col\">{children}</div>\n </div>\n </div>\n )}\n {gridLayout === 'none' && children}\n </>\n );\n};\n\nexport default GridExample;\n"],"names":["GridExample","gridLayout","children","returnWithPadding","isSupernova","React","GridExample$1"],"mappings":";;AASO,MAAMA,IAA0C,CAAC,EAAE,YAAAC,GAAY,UAAAC,QAAe;AAC7E,QAAAC,IAAoBC,OAAiBH,MAAe;AAE1D,SAEKI,gBAAAA,EAAA,cAAAA,EAAA,UAAA,MAAAF,KAAsBE,gBAAAA,EAAA,cAAA,OAAA,EAAI,OAAO,EAAE,SAAS,SAAA,KAAaH,CAAS,GAClED,MAAe,gBACbI,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAU,oBACZA,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAU,MAAA,mCACZ,OAAI,EAAA,WAAU,MAAO,GAAAH,CAAS,CACjC,CACF,GAEDD,MAAe,UAAUC,CAC5B;AAEJ,GAEAI,IAAeN;"}
1
+ {"version":3,"file":"GridExample.js","sources":["../../../src/components/GridExample/GridExample.tsx"],"sourcesContent":["import React from 'react';\n\nimport { isSupernova } from '../../docs';\n\ntype GridLayout = 'helsenorge' | 'padding' | 'none';\n\ninterface GridExampleProps {\n gridLayout: GridLayout;\n}\n\nexport const GridExample: React.FC<GridExampleProps> = ({ gridLayout = isSupernova(), children }) => {\n if (isSupernova() || gridLayout === 'padding') {\n return <div style={{ padding: '0.5rem' }}>{children}</div>;\n }\n\n if (gridLayout === 'helsenorge') {\n return (\n <div className=\"container py-5\">\n <div className=\"row\">\n <div className=\"col\">{children}</div>\n </div>\n </div>\n );\n }\n\n return <>{children}</>;\n};\n\nexport default GridExample;\n"],"names":["GridExample","gridLayout","isSupernova","children","React","GridExample$1"],"mappings":";;AAUO,MAAMA,IAA0C,CAAC,EAAE,YAAAC,IAAaC,EAAY,GAAG,UAAAC,QAChFD,EAAA,KAAiBD,MAAe,4CAC1B,OAAI,EAAA,OAAO,EAAE,SAAS,SAAA,KAAaE,CAAS,IAGlDF,MAAe,eAEdG,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAU,oDACZ,OAAI,EAAA,WAAU,MACb,GAAAA,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAU,MAAO,GAAAD,CAAS,CACjC,CACF,sDAIMA,CAAS,GAGrBE,IAAeL;"}
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.ForwardRefExoticComponent<import("./HelpBubble").HelpBubbleProps & React.RefAttributes<HTMLDivElement | SVGSVGElement>>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./HelpPanel").HelpPanelProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.ForwardRefExoticComponent<import("./HelpQuestion").HelpQuestionProps & React.RefAttributes<HTMLButtonElement>>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -6,6 +6,7 @@ declare const meta: {
6
6
  component: React.FC<import("./HighlightBox").HighlightBoxProps>;
7
7
  parameters: {
8
8
  docs: {
9
+ page: () => React.JSX.Element;
9
10
  description: {
10
11
  component: string;
11
12
  };
@@ -1,6 +1,8 @@
1
1
  @import '../../scss/breakpoints';
2
2
  @import '../../scss/palette';
3
3
 
4
+ // Disables fordi stylelint og prettier er uenige
5
+ /* stylelint-disable-next-line scss/dollar-variable-colon-space-after */
4
6
  $gradient:
5
7
  rgb(0 0 0 / 27%),
6
8
  rgb(0 0 0 / 27%) 18%,
@@ -7,6 +7,7 @@ declare const meta: {
7
7
  component: React.ForwardRefExoticComponent<import("./Icon").IconProps & React.RefAttributes<SVGSVGElement>>;
8
8
  parameters: {
9
9
  docs: {
10
+ page: () => React.JSX.Element;
10
11
  description: {
11
12
  component: string;
12
13
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.ForwardRefExoticComponent<import("./Illustration").IllustrationProps & React.RefAttributes<SVGSVGElement>>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -9,6 +9,7 @@ declare const meta: {
9
9
  component: React.FC<import("../LazyIllustration").LazyIllustrationProps>;
10
10
  parameters: {
11
11
  docs: {
12
+ page: () => React.JSX.Element;
12
13
  description: {
13
14
  component: string;
14
15
  };
@@ -10,6 +10,7 @@ declare const meta: {
10
10
  component: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
11
11
  parameters: {
12
12
  docs: {
13
+ page: () => React.JSX.Element;
13
14
  description: {
14
15
  component: string;
15
16
  };
@@ -9,6 +9,7 @@ declare const meta: {
9
9
  component: React.FunctionComponent<import("./Label").LabelProps>;
10
10
  parameters: {
11
11
  docs: {
12
+ page: () => React.JSX.Element;
12
13
  description: {
13
14
  component: string;
14
15
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./LazyIcon").LazyIconProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./LazyIllustration").LazyIllustrationProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -1,9 +1,11 @@
1
+ import React from 'react';
1
2
  import { StoryObj } from '@storybook/react';
2
3
  declare const meta: {
3
4
  title: string;
4
5
  component: import("./LinkList").CompoundComponent;
5
6
  parameters: {
6
7
  docs: {
8
+ page: () => React.JSX.Element;
7
9
  description: {
8
10
  component: string;
9
11
  };
@@ -20,6 +20,8 @@
20
20
 
21
21
  > #{$list}__item {
22
22
  > #{$list}--bullet {
23
+ // for å beholde utseende disables warning på whitespace her
24
+ /* stylelint-disable-next-line no-irregular-whitespace */
23
25
  list-style-type: '⬥ ';
24
26
 
25
27
  > #{$list}__item {
@@ -28,6 +30,8 @@
28
30
  }
29
31
 
30
32
  > #{$list}--bullet {
33
+ // for å beholde utseende disables warning på whitespace her
34
+ /* stylelint-disable-next-line no-irregular-whitespace */
31
35
  list-style-type: '– ';
32
36
  }
33
37
  }
@@ -38,6 +42,8 @@
38
42
  }
39
43
 
40
44
  &--dashed {
45
+ // for å beholde utseende disables warning på whitespace her
46
+ /* stylelint-disable-next-line no-irregular-whitespace */
41
47
  list-style-type: '– ';
42
48
  }
43
49
 
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./Loader").LoaderProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./Logo").LogoProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.ForwardRefExoticComponent<import("./NotificationPanel").NotificationPanelProps & React.RefAttributes<HTMLDivElement>>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -9,6 +9,7 @@ declare const meta: {
9
9
  component: React.ForwardRefExoticComponent<import("./Panel").PanelProps & React.RefAttributes<HTMLHeadingElement>>;
10
10
  parameters: {
11
11
  docs: {
12
+ page: () => React.JSX.Element;
12
13
  description: {
13
14
  component: string;
14
15
  };
@@ -6,6 +6,7 @@ declare const meta: {
6
6
  component: React.ForwardRefExoticComponent<import("./PanelList").PanelListProps & React.RefAttributes<HTMLDivElement>>;
7
7
  parameters: {
8
8
  docs: {
9
+ page: () => React.JSX.Element;
9
10
  description: {
10
11
  component: string;
11
12
  };
@@ -6,6 +6,7 @@ declare const meta: {
6
6
  component: React.FC<import("./PopMenu").PopMenuProps>;
7
7
  parameters: {
8
8
  docs: {
9
+ page: () => React.JSX.Element;
9
10
  description: {
10
11
  component: string;
11
12
  };
@@ -18,20 +18,20 @@
18
18
  box-shadow: none;
19
19
  outline: none;
20
20
  }
21
+ }
21
22
 
22
- :focus > .pop-menu-button {
23
- box-shadow: none;
24
- }
23
+ html :focus > .pop-menu-button {
24
+ box-shadow: none;
25
+ border: solid;
25
26
  }
26
27
 
27
- // overrides
28
- :focus > .pop-menu-button:hover {
28
+ .pop-menu-button :focus > .pop-menu-button {
29
29
  box-shadow: none;
30
30
  }
31
31
 
32
- html :focus > .pop-menu-button {
32
+ // overrides
33
+ :focus > .pop-menu-button:hover {
33
34
  box-shadow: none;
34
- border: solid;
35
35
  }
36
36
 
37
37
  .pop-menu-button--on-white {
@@ -108,7 +108,6 @@ html :focus > .pop-menu-button {
108
108
 
109
109
  .pop-menu__pop-over {
110
110
  width: 20.875rem;
111
- width: 26.125rem;
112
111
  border: 0.125rem solid rgb(24 128 151);
113
112
  box-shadow: 0 0 0.3125rem 0 rgb(0 0 0 / 50%);
114
113
 
@@ -20,10 +20,6 @@
20
20
  z-index: 3;
21
21
  visibility: hidden;
22
22
 
23
- & + &__arrow {
24
- visibility: hidden;
25
- }
26
-
27
23
  &--visible {
28
24
  visibility: visible;
29
25
 
@@ -65,4 +61,8 @@
65
61
  filter: drop-shadow(0 0.2rem 0 var(--drop-shadow-color));
66
62
  }
67
63
  }
64
+
65
+ & + &__arrow {
66
+ visibility: hidden;
67
+ }
68
68
  }
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./PromoPanel").PromoPanelProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -6,6 +6,7 @@ declare const meta: {
6
6
  component: React.ForwardRefExoticComponent<import("./RadioButton").RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
7
7
  parameters: {
8
8
  docs: {
9
+ page: () => React.JSX.Element;
9
10
  description: {
10
11
  component: string;
11
12
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.ForwardRefExoticComponent<import("./Select").SelectProps & React.RefAttributes<HTMLSelectElement>>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./ServiceMessage").ServiceMessageProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./SharingStatus").SharingStatusProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./Slider").SliderProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.ForwardRefExoticComponent<import("./Spacer").SpacerProps & React.RefAttributes<HTMLElement>>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -6,6 +6,7 @@ declare const meta: {
6
6
  component: React.FC<import("./StatusDot").StatusDotProps>;
7
7
  parameters: {
8
8
  docs: {
9
+ page: () => React.JSX.Element;
9
10
  description: {
10
11
  component: string;
11
12
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./Step").StepProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./StepButtons").StepButtonsProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./Stepper").StepperProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -12,6 +12,7 @@ declare const meta: {
12
12
  component: React.FC<import("./Table").Props>;
13
13
  parameters: {
14
14
  docs: {
15
+ page: () => React.JSX.Element;
15
16
  description: {
16
17
  component: string;
17
18
  };
@@ -6,6 +6,7 @@ declare const meta: {
6
6
  component: React.FC<import("./Tag").TagProps>;
7
7
  parameters: {
8
8
  docs: {
9
+ page: () => React.JSX.Element;
9
10
  description: {
10
11
  component: string;
11
12
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./TagList").TagListPropsProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -6,6 +6,7 @@ declare const meta: {
6
6
  component: React.ForwardRefExoticComponent<import("./Textarea").TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
7
7
  parameters: {
8
8
  docs: {
9
+ page: () => React.JSX.Element;
9
10
  description: {
10
11
  component: string;
11
12
  };
@@ -1,9 +1,11 @@
1
+ import React from 'react';
1
2
  import { StoryObj } from '@storybook/react';
2
3
  declare const meta: {
3
4
  title: string;
4
5
  component: import("./Tile").TileCompound;
5
6
  parameters: {
6
7
  docs: {
8
+ page: () => React.JSX.Element;
7
9
  description: {
8
10
  component: string;
9
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.ForwardRefExoticComponent<import("./Title").TitleProps & React.RefAttributes<HTMLHeadingElement>>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.FC<import("./Tooltip").TooltipProps>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: React.ForwardRefExoticComponent<import("./Trigger").TriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
6
  parameters: {
7
7
  docs: {
8
+ page: () => React.JSX.Element;
8
9
  description: {
9
10
  component: string;
10
11
  };
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { StoryObj } from '@storybook/react';
3
3
  import { FormSize } from '../../constants';
4
4
  declare const meta: {
@@ -6,6 +6,7 @@ declare const meta: {
6
6
  component: (props: import("../FormExample/FormExample").FormExampleProps) => JSX.Element;
7
7
  parameters: {
8
8
  docs: {
9
+ page: () => React.JSX.Element;
9
10
  description: {
10
11
  component: string;
11
12
  markdown: string;
package/docs/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface DocsProps<T> {
3
3
  component: T;
4
+ hideStories?: boolean;
4
5
  }
5
6
  export declare const isSupernova: () => boolean;
6
7
  declare const Docs: <T>(props: DocsProps<T>) => React.JSX.Element;
package/docs/index.js CHANGED
@@ -1,9 +1,14 @@
1
1
  import * as e from "react";
2
2
  import "../node_modules/@storybook/addon-docs/dist/chunk-HLWAVYOI.js";
3
- import { ArgTypes as n, Title as r, Subtitle as l, Description as o, Primary as a, Stories as i } from "../node_modules/@storybook/blocks/dist/index.js";
4
- const c = () => window.parent.location.hostname === "frankenstein.helsenorge.design" || window.location.search.includes("isSupernova"), u = (t) => c() ? /* @__PURE__ */ e.createElement(n, { of: t.component }) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(r, null), /* @__PURE__ */ e.createElement(l, null), /* @__PURE__ */ e.createElement(o, null), /* @__PURE__ */ e.createElement(a, null), /* @__PURE__ */ e.createElement(n, { of: t.component }), /* @__PURE__ */ e.createElement(i, null));
3
+ import { ArgTypes as n, Title as o, Subtitle as l, Description as i, Primary as c, Stories as s } from "../node_modules/@storybook/blocks/dist/index.js";
4
+ const m = () => (window.location != window.parent.location ? document.referrer : document.location.href).startsWith("https://frankenstein.helsenorge.design") || window.location.search.includes("isSupernova"), w = (t) => {
5
+ if (m())
6
+ return /* @__PURE__ */ e.createElement(n, { of: t.component });
7
+ const r = new URLSearchParams(window.location.search), a = `${window.location.pathname}?id=${r.get("id")}&viewMode=docs`;
8
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", justifyContent: "space-between" } }, /* @__PURE__ */ e.createElement(o, null), /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("a", { target: "_blank", href: a, rel: "noreferrer" }, "Åpne i ny fane"))), /* @__PURE__ */ e.createElement(l, null), /* @__PURE__ */ e.createElement(i, null), /* @__PURE__ */ e.createElement(c, null), /* @__PURE__ */ e.createElement(n, { of: t.component }), !t.hideStories && /* @__PURE__ */ e.createElement(s, null));
9
+ };
5
10
  export {
6
- u as default,
7
- c as isSupernova
11
+ w as default,
12
+ m as isSupernova
8
13
  };
9
14
  //# sourceMappingURL=index.js.map
package/docs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/docs/index.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Title, Subtitle, Description, Primary, ArgTypes, Stories } from '@storybook/addon-docs';\n\ninterface DocsProps<T> {\n component: T;\n}\n\nexport const isSupernova = (): boolean =>\n window.parent.location.hostname === 'frankenstein.helsenorge.design' || window.location.search.includes('isSupernova');\n\nconst Docs = <T,>(props: DocsProps<T>): React.JSX.Element => {\n if (isSupernova()) {\n return <ArgTypes of={props.component} />;\n }\n\n return (\n <>\n <Title />\n <Subtitle />\n <Description />\n <Primary />\n <ArgTypes of={props.component} />\n <Stories />\n </>\n );\n};\n\nexport default Docs;\n"],"names":["isSupernova","Docs","props","React","ArgTypes","Title","Subtitle","Description","Primary","Stories"],"mappings":";;;AAQa,MAAAA,IAAc,MACzB,OAAO,OAAO,SAAS,aAAa,oCAAoC,OAAO,SAAS,OAAO,SAAS,aAAa,GAEjHC,IAAO,CAAKC,MACZF,MACM,gBAAAG,EAAA,cAAAC,GAAA,EAAS,IAAIF,EAAM,UAAW,CAAA,IAItC,gBAAAC,EAAA,cAAAA,EAAA,UAAA,sCACGE,GAAM,IAAA,mCACNC,GAAS,IAAA,mCACTC,GAAY,IAAA,mCACZC,GAAQ,IAAA,mCACRJ,GAAS,EAAA,IAAIF,EAAM,UAAW,CAAA,GAC9B,gBAAAC,EAAA,cAAAM,GAAA,IAAQ,CACX;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/docs/index.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Title, Subtitle, Description, Primary, ArgTypes, Stories } from '@storybook/addon-docs';\n\ninterface DocsProps<T> {\n component: T;\n hideStories?: boolean;\n}\n\nexport const isSupernova = (): boolean => {\n const url = window.location != window.parent.location ? document.referrer : document.location.href;\n return url.startsWith('https://frankenstein.helsenorge.design') || window.location.search.includes('isSupernova');\n};\n\nconst Docs = <T,>(props: DocsProps<T>): React.JSX.Element => {\n if (isSupernova()) {\n return <ArgTypes of={props.component} />;\n }\n\n const searchParams = new URLSearchParams(window.location.search);\n const newWindowUrl = `${window.location.pathname}?id=${searchParams.get('id')}&viewMode=docs`;\n\n return (\n <>\n <div style={{ display: 'flex', justifyContent: 'space-between' }}>\n <Title />\n <div>\n <a target=\"_blank\" href={newWindowUrl} rel=\"noreferrer\">\n {'Åpne i ny fane'}\n </a>\n </div>\n </div>\n <Subtitle />\n <Description />\n <Primary />\n <ArgTypes of={props.component} />\n {!props.hideStories && <Stories />}\n </>\n );\n};\n\nexport default Docs;\n"],"names":["isSupernova","Docs","props","React","ArgTypes","searchParams","newWindowUrl","Title","Subtitle","Description","Primary","Stories"],"mappings":";;;AASO,MAAMA,IAAc,OACb,OAAO,YAAY,OAAO,OAAO,WAAW,SAAS,WAAW,SAAS,SAAS,MACnF,WAAW,wCAAwC,KAAK,OAAO,SAAS,OAAO,SAAS,aAAa,GAG5GC,IAAO,CAAKC,MAA2C;AAC3D,MAAIF;AACF,WAAQ,gBAAAG,EAAA,cAAAC,GAAA,EAAS,IAAIF,EAAM,UAAW,CAAA;AAGxC,QAAMG,IAAe,IAAI,gBAAgB,OAAO,SAAS,MAAM,GACzDC,IAAe,GAAG,OAAO,SAAS,QAAQ,OAAOD,EAAa,IAAI,IAAI,CAAC;AAG3E,SAAA,gBAAAF,EAAA,cAAAA,EAAA,UAAA,sCACG,OAAI,EAAA,OAAO,EAAE,SAAS,QAAQ,gBAAgB,kBAAgB,mCAC5DI,GAAM,IAAA,mCACN,OACC,MAAA,gBAAAJ,EAAA,cAAC,OAAE,QAAO,UAAS,MAAMG,GAAc,KAAI,aAAA,GACxC,gBACH,CACF,CACF,GACC,gBAAAH,EAAA,cAAAK,GAAA,IAAS,GACT,gBAAAL,EAAA,cAAAM,GAAA,IAAY,GACb,gBAAAN,EAAA,cAACO,GAAQ,IAAA,mCACRN,GAAS,EAAA,IAAIF,EAAM,UAAW,CAAA,GAC9B,CAACA,EAAM,eAAgB,gBAAAC,EAAA,cAAAQ,GAAA,IAAQ,CAClC;AAEJ;"}
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "git+https://github.com/helsenorge/designsystem.git"
8
8
  },
9
9
  "homepage": "https://helsenorge.design",
10
- "version": "7.1.0",
10
+ "version": "7.2.1",
11
11
  "author": "Helsenorge",
12
12
  "license": "MIT",
13
13
  "peerDependencies": {