@helsenorge/designsystem-react 11.3.0 → 12.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/DictionaryTrigger.js +28 -0
  3. package/DictionaryTrigger.js.map +1 -0
  4. package/HelpDetails.js +65 -0
  5. package/HelpDetails.js.map +1 -0
  6. package/HelpTriggerIcon.js +113 -0
  7. package/HelpTriggerIcon.js.map +1 -0
  8. package/HelpTriggerStandalone.js +37 -0
  9. package/HelpTriggerStandalone.js.map +1 -0
  10. package/HighlightPanel.js +5 -59
  11. package/HighlightPanel.js.map +1 -1
  12. package/PopOver.js +48 -175
  13. package/PopOver.js.map +1 -1
  14. package/components/DictionaryTrigger/index.js +1 -24
  15. package/components/DictionaryTrigger/index.js.map +1 -1
  16. package/components/HelpBubble/HelpBubble.d.ts +3 -6
  17. package/components/HelpBubble/index.js +55 -3
  18. package/components/HelpBubble/index.js.map +1 -1
  19. package/components/HelpBubble/styles.module.scss +5 -7
  20. package/components/HelpBubble/styles.module.scss.d.ts +0 -1
  21. package/components/HelpDetails/HelpDetails.d.ts +11 -0
  22. package/components/HelpDetails/styles.module.scss +49 -0
  23. package/components/HelpDetails/styles.module.scss.d.ts +13 -0
  24. package/components/HelpExpanderInline/HelpExpanderInline.d.ts +17 -0
  25. package/components/HelpExpanderInline/index.d.ts +3 -0
  26. package/components/HelpExpanderInline/index.js +16 -0
  27. package/components/HelpExpanderInline/index.js.map +1 -0
  28. package/components/HelpExpanderStandalone/HelpExpanderStandalone.d.ts +28 -0
  29. package/components/HelpExpanderStandalone/HelpExpanderStandalone.test.d.ts +1 -0
  30. package/components/HelpExpanderStandalone/index.d.ts +3 -0
  31. package/components/HelpExpanderStandalone/index.js +50 -0
  32. package/components/HelpExpanderStandalone/index.js.map +1 -0
  33. package/components/HelpExpanderStandalone/styles.module.scss +5 -0
  34. package/components/{HelpTooltip/HelpTooltipWord → HelpExpanderStandalone}/styles.module.scss.d.ts +1 -1
  35. package/components/HelpPanel/HelpPanel.d.ts +0 -3
  36. package/components/HelpPanel/index.js +2 -13
  37. package/components/HelpPanel/index.js.map +1 -1
  38. package/components/HelpPanel/styles.module.scss +3 -2
  39. package/components/HelpTooltip/HelpTooltip.d.ts +2 -8
  40. package/components/HelpTooltip/index.js +21 -78
  41. package/components/HelpTooltip/index.js.map +1 -1
  42. package/components/HelpTriggerIcon/HelpSign.d.ts +8 -0
  43. package/components/HelpTriggerIcon/HelpTriggerIcon.d.ts +34 -0
  44. package/components/HelpTriggerIcon/HelpTriggerIcon.test.d.ts +1 -0
  45. package/components/HelpTriggerIcon/index.d.ts +3 -0
  46. package/components/HelpTriggerIcon/index.js +7 -0
  47. package/components/{HelpTrigger → HelpTriggerIcon}/index.js.map +1 -1
  48. package/components/HelpTriggerIcon/styles.module.scss +157 -0
  49. package/components/HelpTriggerIcon/styles.module.scss.d.ts +15 -0
  50. package/components/HelpTriggerInline/HelpTriggerInline.d.ts +28 -0
  51. package/components/HelpTriggerInline/HelpTriggerInline.test.d.ts +1 -0
  52. package/components/HelpTriggerInline/index.d.ts +3 -0
  53. package/components/HelpTriggerInline/index.js +35 -0
  54. package/components/HelpTriggerInline/index.js.map +1 -0
  55. package/components/HelpTriggerInline/styles.module.scss +41 -0
  56. package/components/{HelpQuestion → HelpTriggerInline}/styles.module.scss.d.ts +2 -2
  57. package/components/HelpTriggerStandalone/HelpTriggerStandalone.d.ts +28 -0
  58. package/components/HelpTriggerStandalone/HelpTriggerStandalone.test.d.ts +1 -0
  59. package/components/HelpTriggerStandalone/index.d.ts +3 -0
  60. package/components/HelpTriggerStandalone/index.js +5 -0
  61. package/components/HelpTriggerStandalone/styles.module.scss +70 -0
  62. package/components/HelpTriggerStandalone/styles.module.scss.d.ts +11 -0
  63. package/components/HighlightPanel/HighlightPanel.d.ts +0 -9
  64. package/components/HighlightPanel/index.js +0 -2
  65. package/components/HighlightPanel/index.js.map +1 -1
  66. package/components/HighlightPanel/styles.module.scss +23 -165
  67. package/components/HighlightPanel/styles.module.scss.d.ts +1 -8
  68. package/components/PopMenu/index.js +3 -4
  69. package/components/PopMenu/index.js.map +1 -1
  70. package/components/PopMenu/styles.module.scss +10 -10
  71. package/components/PopMenu/styles.module.scss.d.ts +0 -1
  72. package/components/PopOver/PopOver.d.ts +7 -6
  73. package/components/PopOver/index.js +3 -3
  74. package/components/PopOver/styles.module.scss +13 -50
  75. package/components/PopOver/styles.module.scss.d.ts +0 -5
  76. package/constants.d.ts +5 -2
  77. package/constants.js +5 -2
  78. package/constants.js.map +1 -1
  79. package/floating-ui.react.js +4232 -0
  80. package/floating-ui.react.js.map +1 -0
  81. package/hooks/useHover.d.ts +1 -1
  82. package/hooks/useHover.js +2 -2
  83. package/hooks/useHover.js.map +1 -1
  84. package/package.json +2 -1
  85. package/scss/_font-mixins.scss +22 -0
  86. package/scss/typography.module.scss +8 -0
  87. package/scss/typography.module.scss.d.ts +2 -0
  88. package/scss/typography.stories.tsx +8 -0
  89. package/HelpBubble.js +0 -78
  90. package/HelpBubble.js.map +0 -1
  91. package/HelpTooltipWord.js +0 -28
  92. package/HelpTooltipWord.js.map +0 -1
  93. package/HelpTrigger.js +0 -80
  94. package/HelpTrigger.js.map +0 -1
  95. package/components/HelpQuestion/HelpQuestion.d.ts +0 -21
  96. package/components/HelpQuestion/index.d.ts +0 -3
  97. package/components/HelpQuestion/index.js +0 -35
  98. package/components/HelpQuestion/index.js.map +0 -1
  99. package/components/HelpQuestion/styles.module.scss +0 -49
  100. package/components/HelpTooltip/HelpTooltipWord/HelpTooltipWord.d.ts +0 -19
  101. package/components/HelpTooltip/HelpTooltipWord/index.d.ts +0 -3
  102. package/components/HelpTooltip/HelpTooltipWord/index.js +0 -5
  103. package/components/HelpTooltip/HelpTooltipWord/styles.module.scss +0 -18
  104. package/components/HelpTrigger/HelpSign.d.ts +0 -4
  105. package/components/HelpTrigger/HelpTrigger.d.ts +0 -44
  106. package/components/HelpTrigger/index.d.ts +0 -3
  107. package/components/HelpTrigger/index.js +0 -5
  108. package/components/HelpTrigger/styles.module.scss +0 -101
  109. package/components/HelpTrigger/styles.module.scss.d.ts +0 -15
  110. package/hooks/useDelayedState.d.ts +0 -8
  111. package/hooks/useDelayedState.js +0 -23
  112. package/hooks/useDelayedState.js.map +0 -1
  113. /package/components/{HelpQuestion/HelpQuestion.test.d.ts → HelpDetails/HelpDetails.test.d.ts} +0 -0
  114. /package/components/{HelpTrigger/HelpTrigger.test.d.ts → HelpExpanderInline/HelpExpanderInline.test.d.ts} +0 -0
  115. /package/components/{HelpTooltip/HelpTooltipWord → HelpTriggerStandalone}/index.js.map +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/HelpTriggerInline/HelpTriggerInline.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { HelpTriggerIconInternal, HelpTriggerWeights } from '../HelpTriggerIcon';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpTriggerInlineProps\n extends Pick<React.InputHTMLAttributes<HTMLButtonElement>, 'onClick' | 'aria-haspopup' | 'aria-controls' | 'aria-expanded'> {\n /**\n * Sets aria-label of the trigger. ariaLabel or ariaLabelledById MUST be set!\n */\n ariaLabel?: string;\n /**\n * Sets aria-labelledby of the trigger. ariaLabel or ariaLabelledById MUST be set!\n */\n ariaLabelledById?: string;\n /** Sets the text content of the HelpTriggerInline. */\n children: string;\n /**\n * Sets the colors of the help trigger. Default: normal.\n */\n weight?: HelpTriggerWeights;\n /**\n * Classname will be applied to the button element.\n */\n className?: string;\n /**\n * Optional test id.\n */\n testId?: string;\n}\n\nconst HelpTriggerInline = React.forwardRef<HTMLButtonElement, HelpTriggerInlineProps>(\n ({ ariaLabel, ariaLabelledById, children, className, testId, weight = 'normal', ...rest }, ref) => {\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledById });\n const helpTriggerInlineStyles = classNames(styles['help-trigger-inline'], className);\n\n return (\n <button\n aria-label={ariaLabel}\n type=\"button\"\n data-testid={testId}\n data-analyticsid={AnalyticsId.HelpTriggerInline}\n className={helpTriggerInlineStyles}\n ref={ref}\n {...ariaLabelAttributes}\n {...rest}\n >\n <span className={styles['help-trigger-inline__text']}>{children}</span>\n <HelpTriggerIconInternal weight={weight} size={'inherit'} htmlMarkup={'span'} />\n </button>\n );\n }\n);\n\nHelpTriggerInline.displayName = 'HelpTriggerInline';\n\nexport default HelpTriggerInline;\n"],"names":["React"],"mappings":";;;;;;;AAoCA,MAAM,oBAAoBA,eAAM;AAAA,EAC9B,CAAC,EAAE,WAAW,kBAAkB,UAAU,WAAW,QAAQ,SAAS,UAAU,GAAG,KAAK,GAAG,QAAQ;AACjG,UAAM,sBAAsB,uBAAuB,EAAE,OAAO,WAAW,IAAI,kBAAkB;AAC7F,UAAM,0BAA0B,WAAW,OAAO,qBAAqB,GAAG,SAAS;AAGjF,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,cAAY;AAAA,QACZ,MAAK;AAAA,QACL,eAAa;AAAA,QACb,oBAAkB,YAAY;AAAA,QAC9B,WAAW;AAAA,QACX;AAAA,QACC,GAAG;AAAA,QACH,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,oBAAC,QAAK,EAAA,WAAW,OAAO,2BAA2B,GAAI,UAAS;AAAA,8BAC/D,yBAAwB,EAAA,QAAgB,MAAM,WAAW,YAAY,OAAQ,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAChF;AAAA,EAAA;AAGN;AAEA,kBAAkB,cAAc;"}
@@ -0,0 +1,41 @@
1
+ @use 'sass:map';
2
+ @use '../../scss/breakpoints' as breakpoints;
3
+ @import '../../scss/supernova/styles/colors.css';
4
+ @import '../../scss/supernova/styles/spacers.css';
5
+
6
+ $trigger-medium-size: 1.25rem;
7
+ $trigger-large-size: 1.5rem;
8
+ $trigger-xl-size: 2rem;
9
+ $outline-medium-width: 2px;
10
+ $outline-large-width: 2.2px;
11
+ $outline-xl-width: 2.5px;
12
+
13
+ .help-trigger-inline {
14
+ display: inline;
15
+ color: var(--core-color-plum-800);
16
+ cursor: pointer;
17
+ text-decoration: none;
18
+ background-color: transparent;
19
+ outline: none;
20
+ border: 0;
21
+ padding: 0 var(--core-space-3xs);
22
+ font-size: clamp(0px, 1em, 48px);
23
+ font-weight: inherit;
24
+
25
+ &:hover {
26
+ background-color: var(--core-color-plum-50);
27
+ }
28
+
29
+ &:focus-visible {
30
+ outline: 3px solid var(--color-action-border-onlight-focus);
31
+ }
32
+
33
+ &:active {
34
+ text-decoration: solid underline;
35
+ text-underline-offset: 4.23px;
36
+ }
37
+
38
+ &__text {
39
+ margin-right: clamp(var(--core-space-3xs), 0.2em, var(--core-space-2xs));
40
+ }
41
+ }
@@ -1,6 +1,6 @@
1
1
  export type Styles = {
2
- helpquestion: string;
3
- 'helpquestion--selected': string;
2
+ 'help-trigger-inline': string;
3
+ 'help-trigger-inline__text': string;
4
4
  };
5
5
 
6
6
  export type ClassNames = keyof Styles;
@@ -0,0 +1,28 @@
1
+ import { default as React } from 'react';
2
+ import { HelpTriggerWeights } from '../HelpTriggerIcon';
3
+ export interface HelpTriggerStandaloneProps extends Pick<React.InputHTMLAttributes<HTMLButtonElement>, 'onClick' | 'aria-haspopup' | 'aria-controls' | 'aria-expanded'> {
4
+ /**
5
+ * Sets aria-label of the trigger. ariaLabel or ariaLabelledById MUST be set!
6
+ */
7
+ ariaLabel?: string;
8
+ /**
9
+ * Sets aria-labelledby of the trigger. ariaLabel or ariaLabelledById MUST be set!
10
+ */
11
+ ariaLabelledById?: string;
12
+ /** Sets the text content of the HelpTriggerStandalone. */
13
+ children: React.ReactNode;
14
+ /**
15
+ * Sets the colors of the help trigger. Default: normal.
16
+ */
17
+ weight?: HelpTriggerWeights;
18
+ /**
19
+ * Classname will be applied to the button element.
20
+ */
21
+ className?: string;
22
+ /**
23
+ * Optional test id.
24
+ */
25
+ testId?: string;
26
+ }
27
+ declare const HelpTriggerStandalone: React.ForwardRefExoticComponent<HelpTriggerStandaloneProps & React.RefAttributes<HTMLButtonElement>>;
28
+ export default HelpTriggerStandalone;
@@ -0,0 +1,3 @@
1
+ import { default as HelpTriggerStandalone } from './HelpTriggerStandalone';
2
+ export * from './HelpTriggerStandalone';
3
+ export default HelpTriggerStandalone;
@@ -0,0 +1,5 @@
1
+ import { H as HelpTriggerStandalone } from "../../HelpTriggerStandalone.js";
2
+ export {
3
+ HelpTriggerStandalone as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,70 @@
1
+ @use 'sass:map';
2
+ @use '../../scss/breakpoints' as breakpoints;
3
+ @use '../../scss/font-mixins' as fonts;
4
+ @import '../../scss/supernova/styles/colors.css';
5
+ @import '../../scss/supernova/styles/spacers.css';
6
+
7
+ $trigger-medium-size: 1.25rem;
8
+ $trigger-large-size: 1.5rem;
9
+ $trigger-xl-size: 2rem;
10
+ $outline-medium-width: 2px;
11
+ $outline-large-width: 2.2px;
12
+ $outline-xl-width: 2.5px;
13
+
14
+ .help-trigger-standalone {
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ padding: 0;
19
+ cursor: pointer;
20
+ text-decoration: none;
21
+ background-color: transparent;
22
+ outline: none;
23
+ border: 0;
24
+ min-width: 4.6rem;
25
+ height: 2.75rem;
26
+
27
+ &:focus-visible {
28
+ outline: none;
29
+ }
30
+
31
+ &__inner-container {
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ min-height: var(--core-space-l);
36
+ color: var(--core-color-plum-800);
37
+ padding: 0 var(--core-space-3xs);
38
+ font-size: 1rem;
39
+ font-weight: 600;
40
+ line-height: 1.2rem;
41
+
42
+ :hover > & {
43
+ background-color: var(--core-color-plum-50);
44
+ }
45
+
46
+ :focus-visible > & {
47
+ outline: 3px solid var(--color-action-border-onlight-focus);
48
+ }
49
+
50
+ :active > & {
51
+ text-decoration: solid underline;
52
+ text-underline-offset: 4.23px;
53
+ }
54
+
55
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
56
+ min-height: 2.25rem;
57
+ font-size: 1.125rem;
58
+ line-height: 1.463rem;
59
+ }
60
+ }
61
+
62
+ &__children {
63
+ display: inline-flex;
64
+ justify-content: center;
65
+ align-items: center;
66
+ margin-left: var(--core-space-2xs);
67
+
68
+ @include fonts.help-trigger-text;
69
+ }
70
+ }
@@ -0,0 +1,11 @@
1
+ export type Styles = {
2
+ 'help-trigger-standalone': string;
3
+ 'help-trigger-standalone__children': string;
4
+ 'help-trigger-standalone__inner-container': string;
5
+ };
6
+
7
+ export type ClassNames = keyof Styles;
8
+
9
+ declare const styles: Styles;
10
+
11
+ export default styles;
@@ -4,27 +4,18 @@ import { SvgIcon } from '../Icon';
4
4
  import { IconName } from '../Icons/IconNames';
5
5
  import { TitleTags } from '../Title';
6
6
  export type HighlightPanelColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;
7
- export declare enum HighlightPanelSize {
8
- medium = "medium",
9
- large = "large",
10
- fluid = "fluid"
11
- }
12
7
  export type HighlightPanelTags = Exclude<keyof HTMLElementTagNameMap, 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'>;
13
8
  export interface HighlightPanelProps {
14
9
  /** What's in the box? */
15
10
  children: React.ReactNode;
16
11
  /** Changes the background color. Default: white */
17
12
  color?: HighlightPanelColors;
18
- /** Changes the size. Default: medium */
19
- size?: keyof typeof HighlightPanelSize;
20
13
  /** Adds an icon to the highlightpanel. */
21
14
  svgIcon?: SvgIcon | IconName;
22
15
  /** Changes the underlying element. Default: div */
23
16
  htmlMarkup?: HighlightPanelTags;
24
17
  /** Adds custom classes to the element. */
25
18
  className?: string;
26
- /** Adds custom classes to the content-wrapper. Not used for fluid size. */
27
- contentWrapperClassName?: string;
28
19
  /** Sets the data-testid attribute. */
29
20
  testId?: string;
30
21
  /** Element that is set after the icon-element in the DOM, often a title-element */
@@ -1,7 +1,5 @@
1
1
  import { H as HighlightPanel } from "../../HighlightPanel.js";
2
- import { a } from "../../HighlightPanel.js";
3
2
  export {
4
- a as HighlightPanelSize,
5
3
  HighlightPanel as default
6
4
  };
7
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -5,145 +5,30 @@
5
5
  @import '../../scss/grid';
6
6
  @import '../../scss/supernova/styles/colors.css';
7
7
 
8
- @mixin content-wrapper-with-icon-flex {
9
- display: flex;
10
- flex-direction: column;
11
- }
12
-
13
- @mixin content-wrapper-with-icon-flex-responsive {
14
- @media (min-width: map.get($grid-breakpoints, md)) {
15
- flex-direction: row;
16
- }
17
- }
18
-
19
- @mixin content-wrapper-with-icon-padding {
20
- padding-top: spacers.getSpacer(m);
21
- }
22
-
23
8
  .highlightpanel {
24
- $panel: &;
25
9
  $colors: 'neutral', 'blueberry', 'cherry';
26
10
 
27
- // Medium og large har bakgrunnsfarge på den indre wrapperen
28
- // slik at bakgrunnsfargen ikke går helt ut i kantene
29
- &--medium,
30
- &--large {
31
- @each $color in $colors {
32
- &#{$panel}--#{$color} {
33
- #{$panel}__content-wrapper {
34
- background-color: var(--color-base-background-#{$color});
35
- border: 1px solid var(--color-base-border-#{$color});
36
- }
37
- }
38
- }
39
-
40
- // Hvit har sin egen regel siden den ikke har valører
41
- &#{$panel}--white {
42
- #{$panel}__content-wrapper {
43
- background-color: var(--color-base-background-white);
44
- border: 1px solid var(--color-base-border-onlight-subtle);
45
- }
46
- }
47
- }
48
-
49
- &--large {
50
- #{$panel}__content-wrapper {
51
- padding: spacers.getSpacer(m) spacers.getSpacer(s) spacers.getSpacer(l);
52
-
53
- @media (min-width: map.get($grid-breakpoints, lg)) {
54
- padding-top: spacers.getSpacer(l);
55
- padding-bottom: spacers.getSpacer(xl);
56
- }
57
- }
58
- }
59
-
60
- &--medium {
61
- #{$panel}__content-wrapper {
62
- padding: spacers.getSpacer(m) spacers.getSpacer(s) spacers.getSpacer(l);
63
-
64
- @media (min-width: map.get($grid-breakpoints, md)) {
65
- padding: spacers.getSpacer(m) spacers.getSpacer(m) spacers.getSpacer(l);
66
- }
67
-
68
- @media (min-width: map.get($grid-breakpoints, lg)) {
69
- padding: spacers.getSpacer(l);
70
- }
71
- }
72
- }
73
-
74
11
  // fluid skal ha bakgrunnsfarge på den ytre containeren
75
- &--fluid {
76
- padding: spacers.getSpacer(m) spacers.getSpacer(s) spacers.getSpacer(l);
77
-
78
- @media (min-width: map.get($grid-breakpoints, lg)) {
79
- padding: spacers.getSpacer(m) spacers.getSpacer(m) spacers.getSpacer(l);
80
- }
12
+ padding: spacers.getSpacer(m) spacers.getSpacer(s) spacers.getSpacer(l);
81
13
 
82
- @each $color in $colors {
83
- &#{$panel}--#{$color} {
84
- background-color: var(--color-base-background-#{$color});
85
- border: 1px solid var(--color-base-border-#{$color});
86
- }
87
- }
88
- &#{$panel}--white {
89
- background-color: var(--color-base-background-white);
90
- border: 1px solid var(--color-base-border-onlight-subtle);
91
- }
14
+ @media (min-width: map.get($grid-breakpoints, sm)) {
15
+ padding: spacers.getSpacer(m) spacers.getSpacer(m) spacers.getSpacer(l);
92
16
  }
93
17
 
94
- &--has-icon#{&}--medium {
95
- #{$panel}__content-wrapper {
96
- @include content-wrapper-with-icon-flex;
97
- @include content-wrapper-with-icon-padding;
98
- @include content-wrapper-with-icon-flex-responsive;
99
-
100
- @media (min-width: map.get($grid-breakpoints, lg)) {
101
- padding-left: spacers.getSpacer(m);
102
- }
103
- }
18
+ @media (min-width: map.get($grid-breakpoints, xl)) {
19
+ padding: spacers.getSpacer(l) spacers.getSpacer(l) spacers.getSpacer(l) spacers.getSpacer(m);
104
20
  }
105
21
 
106
- &--has-icon#{&}--large {
107
- #{$panel}__col {
108
- @include content-wrapper-with-icon-flex;
109
- @include content-wrapper-with-icon-flex-responsive;
110
- }
111
- #{$panel}__content-wrapper {
112
- @include content-wrapper-with-icon-padding;
113
-
114
- @media (min-width: map.get($grid-breakpoints, sm)) {
115
- padding-left: spacers.getSpacer(s);
116
- }
117
-
118
- @media (min-width: map.get($grid-breakpoints, md)) {
119
- padding-left: spacers.getSpacer(m);
120
- }
121
-
122
- @media (min-width: map.get($grid-breakpoints, lg)) {
123
- padding-left: 0;
124
- padding-top: spacers.getSpacer(l);
125
- padding-bottom: spacers.getSpacer(xl);
126
- }
127
- }
128
-
129
- #{$panel}__icon {
130
- @media (min-width: map.get($grid-breakpoints, lg)) {
131
- @include make-col-ready;
132
- @include make-col(2);
133
-
134
- display: flex;
135
- justify-content: flex-end;
136
- margin-right: 0;
137
- padding-right: spacers.getSpacer(s);
138
- }
22
+ @each $color in $colors {
23
+ &--#{$color} {
24
+ background-color: var(--color-base-background-#{$color});
25
+ border: 1px solid var(--color-base-border-#{$color});
139
26
  }
27
+ }
140
28
 
141
- #{$panel}__content {
142
- @media (min-width: map.get($grid-breakpoints, lg)) {
143
- @include make-col-ready;
144
- @include make-col(8);
145
- }
146
- }
29
+ &--white {
30
+ background-color: var(--color-base-background-white);
31
+ border: 1px solid var(--color-base-border-onlight-subtle);
147
32
  }
148
33
 
149
34
  &__content {
@@ -152,54 +37,27 @@
152
37
  }
153
38
  }
154
39
 
155
- &--has-icon#{&}--fluid {
156
- @include content-wrapper-with-icon-flex;
157
- @include content-wrapper-with-icon-padding;
158
- @include content-wrapper-with-icon-flex-responsive;
40
+ &--has-icon {
41
+ display: flex;
42
+ flex-direction: column;
43
+ padding-top: spacers.getSpacer(m);
44
+
45
+ @media (min-width: map.get($grid-breakpoints, md)) {
46
+ flex-direction: row;
47
+ }
159
48
  }
160
49
 
161
50
  &__icon {
162
51
  display: inline-flex;
163
- margin-right: spacers.getSpacer(s);
52
+ gap: spacers.getSpacer(xs);
164
53
  margin-bottom: spacers.getSpacer(2xs);
165
54
 
166
55
  @media (min-width: map.get($grid-breakpoints, md)) {
56
+ margin-right: spacers.getSpacer(s);
167
57
  margin-bottom: 0;
168
58
  }
169
59
  }
170
60
 
171
- &__row {
172
- @include make-row;
173
- }
174
-
175
- &__col {
176
- @include make-col-ready;
177
- @include make-col(12);
178
-
179
- &--offset {
180
- @media (min-width: map.get($grid-breakpoints, sm)) {
181
- @include make-col(10);
182
- @include make-col-offset(1);
183
- }
184
-
185
- @media (min-width: map.get($grid-breakpoints, lg)) {
186
- @include make-col(8);
187
- @include make-col-offset(2);
188
- }
189
- }
190
-
191
- &--large-with-icon {
192
- @media (min-width: map.get($grid-breakpoints, sm)) {
193
- @include make-col(11);
194
- @include make-col-offset(0);
195
- }
196
-
197
- @media (min-width: map.get($grid-breakpoints, lg)) {
198
- @include make-col(12);
199
- }
200
- }
201
- }
202
-
203
61
  &__title-wrapper {
204
62
  display: flex;
205
63
  align-items: center;
@@ -1,18 +1,11 @@
1
1
  export type Styles = {
2
- highlightpanel__col: string;
3
- 'highlightpanel__col--large-with-icon': string;
4
- 'highlightpanel__col--offset': string;
2
+ highlightpanel: string;
5
3
  highlightpanel__content: string;
6
- 'highlightpanel__content-wrapper': string;
7
4
  highlightpanel__icon: string;
8
- highlightpanel__row: string;
9
5
  'highlightpanel__title-wrapper': string;
10
6
  'highlightpanel--blueberry': string;
11
7
  'highlightpanel--cherry': string;
12
- 'highlightpanel--fluid': string;
13
8
  'highlightpanel--has-icon': string;
14
- 'highlightpanel--large': string;
15
- 'highlightpanel--medium': string;
16
9
  'highlightpanel--neutral': string;
17
10
  'highlightpanel--white': string;
18
11
  };
@@ -12,7 +12,7 @@ import VerticalDots from "../Icons/VerticalDots.js";
12
12
  import X from "../Icons/X.js";
13
13
  import { L as LazyIcon } from "../../LazyIcon.js";
14
14
  import { L as LinkList } from "../../LinkList.js";
15
- import { a as PopOver } from "../../PopOver.js";
15
+ import { P as PopOver } from "../../PopOver.js";
16
16
  import styles from "./styles.module.scss";
17
17
  var PopMenuVariant = /* @__PURE__ */ ((PopMenuVariant2) => {
18
18
  PopMenuVariant2["onWhite"] = "on-white";
@@ -28,7 +28,6 @@ var PopMenuLabelPosition = /* @__PURE__ */ ((PopMenuLabelPosition2) => {
28
28
  const PopMenu = (props) => {
29
29
  const triggerButtonRef = useRef(null);
30
30
  const iconRef = useRef(null);
31
- const popOverRef = useRef(null);
32
31
  const outerRef = useRef(null);
33
32
  const [isOpen, setIsOpen] = useState(false);
34
33
  const {
@@ -66,9 +65,9 @@ const PopMenu = (props) => {
66
65
  {
67
66
  testId: popOverTestId,
68
67
  className: classNames(styles["pop-menu__pop-over"], popOverClassName),
69
- arrowClassName: styles["pop-menu__pop-over-arrow"],
70
68
  controllerRef: iconRef,
71
- popOverRef,
69
+ role: "dialog",
70
+ show: isOpen,
72
71
  children: React__default.Children.map(
73
72
  children,
74
73
  (child) => React__default.cloneElement(child, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/PopMenu/PopMenu.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { getColor } from '../../theme/currys';\nimport { isComponent } from '../../utils/component';\nimport Icon, { SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport VerticalDots from '../Icons/VerticalDots';\nimport X from '../Icons/X';\nimport LazyIcon from '../LazyIcon';\nimport LinkList, { LinkListProps, LinkProps } from '../LinkList';\nimport PopOver from '../PopOver';\n\nimport styles from './styles.module.scss';\n\nexport enum PopMenuVariant {\n onWhite = 'on-white',\n onGray = 'on-gray',\n onBlueberry = 'on-blueberry',\n}\n\nexport enum PopMenuLabelPosition {\n right = 'right',\n left = 'left',\n}\n\nexport interface PopMenuProps {\n /** Content shown inside PopOver. Can only be a LinkList */\n children: React.ReactElement<LinkListProps>;\n /** Adds custom classes to the popover element. */\n popOverClassName?: string;\n /** Adds custom classes to the element. */\n popMenuClassName?: string;\n /** Changes responsive design for the trigger buttons. */\n popMenuVariant?: PopMenuVariant;\n /** Sets the data-testid attribute for the button that opens. */\n openButtonTestId?: string;\n /** Sets the data-testid attribute for the button that closes. */\n closeButtonTestId?: string;\n /** Sets the data-testid attribute for the popover. */\n popOverTestId?: string;\n /** Sets the arial-label attribute for the openButton. */\n openButtonAriaLabel?: string;\n /** Sets the arial-label attribute for the closeButton. */\n closeButtonAriaLabel?: string;\n /** Sets the icon on the trigger button. */\n svgIcon?: SvgIcon | IconName;\n /** Optional text next to the trigger button. */\n labelText?: string;\n /** Placement of the label text relative to the trigger button. */\n labelTextPosition?: PopMenuLabelPosition;\n}\n\nexport const PopMenu: React.FC<PopMenuProps> = (props: PopMenuProps) => {\n const triggerButtonRef = useRef<HTMLButtonElement>(null);\n const iconRef = useRef<HTMLDivElement>(null);\n const popOverRef = useRef<HTMLDivElement>(null);\n const outerRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const {\n children,\n popOverClassName,\n popMenuClassName,\n openButtonTestId,\n closeButtonTestId,\n popOverTestId,\n popMenuVariant = PopMenuVariant.onWhite,\n openButtonAriaLabel,\n closeButtonAriaLabel,\n svgIcon,\n labelText,\n labelTextPosition = PopMenuLabelPosition.right,\n } = props;\n const buttonClasses = classNames(styles['pop-menu-button'], {\n [styles[`pop-menu-button--${popMenuVariant}`]]: popMenuVariant,\n });\n const isMobile = useIsMobileBreakpoint();\n\n useOutsideEvent(outerRef, () => {\n setIsOpen(false);\n });\n\n const { isHovered: triggerButtonIsHovered } = useHover(triggerButtonRef);\n const mobileIconSize = isMobile ? IconSize.XSmall : IconSize.Small;\n\n const handleClick = (cb?: () => void): void => {\n setIsOpen(false);\n cb && cb();\n };\n\n const renderChildren = (): React.ReactElement | undefined => {\n if (isComponent<LinkListProps>(children, LinkList)) {\n return (\n <PopOver\n testId={popOverTestId}\n className={classNames(styles['pop-menu__pop-over'], popOverClassName)}\n arrowClassName={styles['pop-menu__pop-over-arrow']}\n controllerRef={iconRef}\n popOverRef={popOverRef}\n >\n {React.Children.map(children, child =>\n React.cloneElement(child, {\n children: React.Children.map(child.props.children, child =>\n isComponent<LinkProps>(child, LinkList.Link)\n ? React.cloneElement(child, {\n onClick: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) =>\n handleClick(() => child.props.onClick && child.props.onClick(event)),\n })\n : child\n ),\n })\n )}\n </PopOver>\n );\n }\n };\n\n const toggleOpenOnClick = (e?: React.MouseEvent<HTMLElement, MouseEvent>): void => {\n e && e.stopPropagation();\n setIsOpen(!isOpen);\n };\n\n const iconComponent =\n svgIcon && typeof svgIcon === 'string' ? (\n <LazyIcon iconName={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n ) : (\n svgIcon && <Icon svgIcon={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n );\n\n const openIcon = svgIcon ? (\n iconComponent\n ) : (\n <Icon svgIcon={svgIcon ?? VerticalDots} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />\n );\n\n const closeIcon = <Icon svgIcon={X} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />;\n\n const triggerButton = (\n <button\n ref={triggerButtonRef}\n data-testid={isOpen ? closeButtonTestId : openButtonTestId}\n className={buttonClasses}\n aria-label={isOpen ? closeButtonAriaLabel : openButtonAriaLabel}\n aria-expanded={isOpen}\n onClick={toggleOpenOnClick}\n type=\"button\"\n >\n {labelText && labelTextPosition == PopMenuLabelPosition.left && <span>{labelText}</span>}\n {<div ref={iconRef}>{isOpen ? closeIcon : openIcon}</div>}\n {labelText && labelTextPosition == PopMenuLabelPosition.right && <span>{labelText}</span>}\n </button>\n );\n\n return (\n <div ref={outerRef} className={classNames(styles['pop-menu-button'], popMenuClassName)} data-analyticsid={AnalyticsId.PopMenu}>\n {triggerButton}\n {isOpen && renderChildren()}\n </div>\n );\n};\n\nexport default PopMenu;\n"],"names":["PopMenuVariant","PopMenuLabelPosition","React","child"],"mappings":";;;;;;;;;;;;;;;;AAoBY,IAAA,mCAAAA,oBAAL;AACLA,kBAAA,SAAU,IAAA;AACVA,kBAAA,QAAS,IAAA;AACTA,kBAAA,aAAc,IAAA;AAHJA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAMA,IAAA,yCAAAC,0BAAL;AACLA,wBAAA,OAAQ,IAAA;AACRA,wBAAA,MAAO,IAAA;AAFGA,SAAAA;AAAA,GAAA,wBAAA,CAAA,CAAA;AAgCC,MAAA,UAAkC,CAAC,UAAwB;AAChE,QAAA,mBAAmB,OAA0B,IAAI;AACjD,QAAA,UAAU,OAAuB,IAAI;AACrC,QAAA,aAAa,OAAuB,IAAI;AACxC,QAAA,WAAW,OAAuB,IAAI;AAC5C,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AACpC,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA;AAAA,EAAA,IAClB;AACJ,QAAM,gBAAgB,WAAW,OAAO,iBAAiB,GAAG;AAAA,IAC1D,CAAC,OAAO,oBAAoB,cAAc,EAAE,CAAC,GAAG;AAAA,EAAA,CACjD;AACD,QAAM,WAAW,sBAAsB;AAEvC,kBAAgB,UAAU,MAAM;AAC9B,cAAU,KAAK;AAAA,EAAA,CAChB;AAED,QAAM,EAAE,WAAW,2BAA2B,SAAS,gBAAgB;AACvE,QAAM,iBAAiB,WAAW,SAAS,SAAS,SAAS;AAEvD,QAAA,cAAc,CAAC,OAA0B;AAC7C,cAAU,KAAK;AACf,UAAM,GAAG;AAAA,EACX;AAEA,QAAM,iBAAiB,MAAs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oBAAoB;AAAA,MAC1C,WAAW;AAAA,MACX,cAAY,SAAS,uBAAuB;AAAA,MAC5C,iBAAe;AAAA,MACf,SAAS;AAAA,MACT,MAAK;AAAA,MAEJ,UAAA;AAAA,QAAA,aAAa,qBAAqB,UAA8B,oBAAA,QAAA,EAAM,UAAU,WAAA;AAAA,4BAC/E,OAAI,EAAA,KAAK,SAAU,UAAA,SAAS,YAAY,UAAS;AAAA,QAClD,aAAa,qBAAqB,WAA8B,oBAAC,UAAM,UAAU,UAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACpF;AAGF,SACG,qBAAA,OAAA,EAAI,KAAK,UAAU,WAAW,WAAW,OAAO,iBAAiB,GAAG,gBAAgB,GAAG,oBAAkB,YAAY,SACnH,UAAA;AAAA,IAAA;AAAA,IACA,UAAU,eAAe;AAAA,EAAA,GAC5B;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/PopMenu/PopMenu.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { getColor } from '../../theme/currys';\nimport { isComponent } from '../../utils/component';\nimport Icon, { SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport VerticalDots from '../Icons/VerticalDots';\nimport X from '../Icons/X';\nimport LazyIcon from '../LazyIcon';\nimport LinkList, { LinkListProps, LinkProps } from '../LinkList';\nimport PopOver from '../PopOver';\n\nimport styles from './styles.module.scss';\n\nexport enum PopMenuVariant {\n onWhite = 'on-white',\n onGray = 'on-gray',\n onBlueberry = 'on-blueberry',\n}\n\nexport enum PopMenuLabelPosition {\n right = 'right',\n left = 'left',\n}\n\nexport interface PopMenuProps {\n /** Content shown inside PopOver. Can only be a LinkList */\n children: React.ReactElement<LinkListProps>;\n /** Adds custom classes to the popover element. */\n popOverClassName?: string;\n /** Adds custom classes to the element. */\n popMenuClassName?: string;\n /** Changes responsive design for the trigger buttons. */\n popMenuVariant?: PopMenuVariant;\n /** Sets the data-testid attribute for the button that opens. */\n openButtonTestId?: string;\n /** Sets the data-testid attribute for the button that closes. */\n closeButtonTestId?: string;\n /** Sets the data-testid attribute for the popover. */\n popOverTestId?: string;\n /** Sets the arial-label attribute for the openButton. */\n openButtonAriaLabel?: string;\n /** Sets the arial-label attribute for the closeButton. */\n closeButtonAriaLabel?: string;\n /** Sets the icon on the trigger button. */\n svgIcon?: SvgIcon | IconName;\n /** Optional text next to the trigger button. */\n labelText?: string;\n /** Placement of the label text relative to the trigger button. */\n labelTextPosition?: PopMenuLabelPosition;\n}\n\nexport const PopMenu: React.FC<PopMenuProps> = (props: PopMenuProps) => {\n const triggerButtonRef = useRef<HTMLButtonElement>(null);\n const iconRef = useRef<HTMLDivElement>(null);\n const outerRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const {\n children,\n popOverClassName,\n popMenuClassName,\n openButtonTestId,\n closeButtonTestId,\n popOverTestId,\n popMenuVariant = PopMenuVariant.onWhite,\n openButtonAriaLabel,\n closeButtonAriaLabel,\n svgIcon,\n labelText,\n labelTextPosition = PopMenuLabelPosition.right,\n } = props;\n const buttonClasses = classNames(styles['pop-menu-button'], {\n [styles[`pop-menu-button--${popMenuVariant}`]]: popMenuVariant,\n });\n const isMobile = useIsMobileBreakpoint();\n\n useOutsideEvent(outerRef, () => {\n setIsOpen(false);\n });\n\n const { isHovered: triggerButtonIsHovered } = useHover(triggerButtonRef);\n const mobileIconSize = isMobile ? IconSize.XSmall : IconSize.Small;\n\n const handleClick = (cb?: () => void): void => {\n setIsOpen(false);\n cb && cb();\n };\n\n const renderChildren = (): React.ReactElement | undefined => {\n if (isComponent<LinkListProps>(children, LinkList)) {\n return (\n <PopOver\n testId={popOverTestId}\n className={classNames(styles['pop-menu__pop-over'], popOverClassName)}\n controllerRef={iconRef}\n role=\"dialog\"\n show={isOpen}\n >\n {React.Children.map(children, child =>\n React.cloneElement(child, {\n children: React.Children.map(child.props.children, child =>\n isComponent<LinkProps>(child, LinkList.Link)\n ? React.cloneElement(child, {\n onClick: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) =>\n handleClick(() => child.props.onClick && child.props.onClick(event)),\n })\n : child\n ),\n })\n )}\n </PopOver>\n );\n }\n };\n\n const toggleOpenOnClick = (e?: React.MouseEvent<HTMLElement, MouseEvent>): void => {\n e && e.stopPropagation();\n setIsOpen(!isOpen);\n };\n\n const iconComponent =\n svgIcon && typeof svgIcon === 'string' ? (\n <LazyIcon iconName={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n ) : (\n svgIcon && <Icon svgIcon={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n );\n\n const openIcon = svgIcon ? (\n iconComponent\n ) : (\n <Icon svgIcon={svgIcon ?? VerticalDots} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />\n );\n\n const closeIcon = <Icon svgIcon={X} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />;\n\n const triggerButton = (\n <button\n ref={triggerButtonRef}\n data-testid={isOpen ? closeButtonTestId : openButtonTestId}\n className={buttonClasses}\n aria-label={isOpen ? closeButtonAriaLabel : openButtonAriaLabel}\n aria-expanded={isOpen}\n onClick={toggleOpenOnClick}\n type=\"button\"\n >\n {labelText && labelTextPosition == PopMenuLabelPosition.left && <span>{labelText}</span>}\n {<div ref={iconRef}>{isOpen ? closeIcon : openIcon}</div>}\n {labelText && labelTextPosition == PopMenuLabelPosition.right && <span>{labelText}</span>}\n </button>\n );\n\n return (\n <div ref={outerRef} className={classNames(styles['pop-menu-button'], popMenuClassName)} data-analyticsid={AnalyticsId.PopMenu}>\n {triggerButton}\n {isOpen && renderChildren()}\n </div>\n );\n};\n\nexport default PopMenu;\n"],"names":["PopMenuV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AAa,qBAAqB,UAA8B,oBAAA,QAAA,EAAM,UAAU,WAAA;AAAA,4BAC/E,OAAI,EAAA,KAAK,SAAU,UAAA,SAAS,YAAY,UAAS;AAAA,QAClD,aAAa,qBAAqB,WAA8B,oBAAC,UAAM,UAAU,UAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACpF;AAGF,SACG,qBAAA,OAAA,EAAI,KAAK,UAAU,WAAW,WAAW,OAAO,iBAAiB,GAAG,gBAAgB,GAAG,oBAAkB,YAAY,SACnH,UAAA;AAAA,IAAA;AAAA,IACA,UAAU,eAAe;AAAA,EAAA,GAC5B;AAEJ;"}
@@ -108,11 +108,15 @@ html :focus > .pop-menu-button {
108
108
 
109
109
  .pop-menu__pop-over {
110
110
  width: 20.875rem;
111
- border: 0.125rem solid rgb(24 128 151);
112
- box-shadow: 0 0 0.3125rem 0 rgb(0 0 0 / 50%);
111
+ padding: 0;
113
112
 
114
113
  @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
115
114
  width: 26.125rem;
115
+ max-width: 27rem;
116
+ }
117
+
118
+ ul {
119
+ width: calc(100% - 0.5px);
116
120
  }
117
121
 
118
122
  li:first-of-type {
@@ -120,8 +124,8 @@ html :focus > .pop-menu-button {
120
124
 
121
125
  a,
122
126
  button {
123
- border-top-left-radius: 0.5625rem;
124
- border-top-right-radius: 0.5625rem;
127
+ border-top-left-radius: 9px;
128
+ border-top-right-radius: 9px;
125
129
  }
126
130
  }
127
131
 
@@ -130,12 +134,8 @@ html :focus > .pop-menu-button {
130
134
 
131
135
  a,
132
136
  button {
133
- border-bottom-left-radius: 0.5625rem;
134
- border-bottom-right-radius: 0.5625rem;
137
+ border-bottom-left-radius: 9px;
138
+ border-bottom-right-radius: 9px;
135
139
  }
136
140
  }
137
141
  }
138
-
139
- .pop-menu__pop-over-arrow {
140
- --drop-shadow-color: rgb(24 128 151);
141
- }
@@ -1,6 +1,5 @@
1
1
  export type Styles = {
2
2
  'pop-menu__pop-over': string;
3
- 'pop-menu__pop-over-arrow': string;
4
3
  'pop-menu-button': string;
5
4
  'pop-menu-button--on-blueberry': string;
6
5
  'pop-menu-button--on-gray': string;
@@ -4,7 +4,8 @@ export declare enum PopOverVariant {
4
4
  positionbelow = "positionbelow",
5
5
  positionabove = "positionabove"
6
6
  }
7
- export type PopOverRole = 'tooltip';
7
+ export type PopOverRole = 'tooltip' | 'dialog';
8
+ export type PopOverPlacement = 'top' | 'bottom';
8
9
  export interface PopOverProps {
9
10
  /** Id of the PopOver */
10
11
  id?: string;
@@ -12,16 +13,16 @@ export interface PopOverProps {
12
13
  children: React.ReactNode;
13
14
  /** Ref for the element the PopOver is placed upon */
14
15
  controllerRef: React.RefObject<HTMLElement | SVGSVGElement>;
15
- /** Ref for the element the PopOver is placed upon */
16
- popOverRef?: React.RefObject<HTMLDivElement>;
17
16
  /** Show the popover. Only applies when role=tooltip. Default: false. */
18
17
  show?: boolean;
19
18
  /** Adds custom classes to the element. */
20
19
  className?: string;
21
- /** Adds custom classes to the arrow element. */
20
+ /** @deprecated Adds custom classes to the arrow element. */
22
21
  arrowClassName?: string;
23
- /** Determines the placement of the popover. Default: automatic positioning. */
22
+ /** @deprecated use placement instead. Determines the placement of the popover. Default: automatic positioning. */
24
23
  variant?: keyof typeof PopOverVariant;
24
+ /** Sets the placement of the popover relative to the trigger if there is space, otherwise automatic. */
25
+ placement?: PopOverPlacement;
25
26
  /** Sets role of the PopOver element */
26
27
  role?: PopOverRole;
27
28
  /** Sets the data-testid attribute. */
@@ -29,5 +30,5 @@ export interface PopOverProps {
29
30
  /** Overrides the default z-index of PopOver */
30
31
  zIndex?: number;
31
32
  }
32
- declare const PopOver: React.ForwardRefExoticComponent<PopOverProps & React.RefAttributes<HTMLDivElement | SVGSVGElement>>;
33
+ declare const PopOver: React.ForwardRefExoticComponent<PopOverProps & React.RefAttributes<HTMLElement | HTMLDivElement | SVGSVGElement>>;
33
34
  export default PopOver;
@@ -1,7 +1,7 @@
1
- import { a as PopOver } from "../../PopOver.js";
2
- import { P } from "../../PopOver.js";
1
+ import { P as PopOver } from "../../PopOver.js";
2
+ import { a } from "../../PopOver.js";
3
3
  export {
4
- P as PopOverVariant,
4
+ a as PopOverVariant,
5
5
  PopOver as default
6
6
  };
7
7
  //# sourceMappingURL=index.js.map