@helsenorge/designsystem-react 7.0.0 → 7.1.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.
- package/CHANGELOG.md +2 -0
- package/_virtual/_cloneBuffer.js +5 -0
- package/_virtual/_cloneBuffer.js.map +1 -0
- package/_virtual/_commonjs-dynamic-modules.js +7 -0
- package/_virtual/_commonjs-dynamic-modules.js.map +1 -0
- package/_virtual/_commonjsHelpers.js +9 -0
- package/_virtual/_commonjsHelpers.js.map +1 -0
- package/_virtual/_nodeUtil.js +5 -0
- package/_virtual/_nodeUtil.js.map +1 -0
- package/_virtual/assert.js +5 -0
- package/_virtual/assert.js.map +1 -0
- package/_virtual/ast.js +5 -0
- package/_virtual/ast.js.map +1 -0
- package/_virtual/code.js +5 -0
- package/_virtual/code.js.map +1 -0
- package/_virtual/doctrine.js +5 -0
- package/_virtual/doctrine.js.map +1 -0
- package/_virtual/errors.js +5 -0
- package/_virtual/errors.js.map +1 -0
- package/_virtual/index.js +5 -0
- package/_virtual/index.js.map +1 -0
- package/_virtual/index2.js +5 -0
- package/_virtual/index2.js.map +1 -0
- package/_virtual/index3.js +5 -0
- package/_virtual/index3.js.map +1 -0
- package/_virtual/inherits_browser.js +5 -0
- package/_virtual/inherits_browser.js.map +1 -0
- package/_virtual/isBuffer.js +5 -0
- package/_virtual/isBuffer.js.map +1 -0
- package/_virtual/keyword.js +5 -0
- package/_virtual/keyword.js.map +1 -0
- package/_virtual/memoizerific.js +5 -0
- package/_virtual/memoizerific.js.map +1 -0
- package/_virtual/typed.js +5 -0
- package/_virtual/typed.js.map +1 -0
- package/_virtual/types.js +5 -0
- package/_virtual/types.js.map +1 -0
- package/_virtual/util.js +5 -0
- package/_virtual/util.js.map +1 -0
- package/_virtual/utility.js +5 -0
- package/_virtual/utility.js.map +1 -0
- package/_virtual/utils.js +5 -0
- package/_virtual/utils.js.map +1 -0
- package/components/AnchorLink/AnchorLink.js +1 -1
- package/components/Avatar/Avatar.js +1 -1
- package/components/Badge/Badge.d.ts +1 -1
- package/components/Badge/Badge.js +14 -18
- package/components/Badge/Badge.js.map +1 -1
- package/components/Badge/Badge.stories.d.ts +2 -1
- package/components/Badge/styles.module.scss +6 -18
- package/components/Badge/styles.module.scss.d.ts +0 -4
- package/components/Button/Button.js +1 -1
- package/components/Button/Button.stories.d.ts +1 -0
- package/components/Checkbox/Checkbox.js +1 -1
- package/components/Close/Close.js +1 -1
- package/components/DictionaryTrigger/DictionaryTrigger.js +1 -1
- package/components/Dropdown/Dropdown.d.ts +7 -7
- package/components/Dropdown/Dropdown.js +46 -47
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/Dropdown.stories.d.ts +4 -0
- package/components/Duolist/Duolist.js +1 -1
- package/components/EmptyState/EmptyState.js +1 -1
- package/components/EmptyState/NobodyHome.js +1 -1
- package/components/ErrorWrapper/ErrorWrapper.js +1 -1
- package/components/Expander/Expander.js +1 -1
- package/components/ExpanderHierarchy/Expander.js +1 -1
- package/components/ExpanderHierarchy/ExpanderButton.js +1 -1
- package/components/ExpanderHierarchy/ExpanderHierarchy.js +1 -1
- package/components/ExpanderList/ExpanderList.js +1 -1
- package/components/FormGroup/FormGroup.js +1 -1
- package/components/FormLayout/FormLayout.js +1 -1
- package/components/GridExample/GridExample.d.ts +5 -1
- package/components/GridExample/GridExample.js +7 -3
- package/components/GridExample/GridExample.js.map +1 -1
- package/components/HelpBubble/HelpBubble.js +1 -1
- package/components/HelpBubble/HelpBubble.stories.d.ts +4 -0
- package/components/HelpPanel/HelpPanel.js +1 -1
- package/components/HelpQuestion/HelpQuestion.js +1 -1
- package/components/HighlightBox/HighlightBox.js +1 -1
- package/components/HorizontalScroll/HorizontalScroll.js +1 -1
- package/components/Input/Input.js +1 -1
- package/components/Label/Label.js +1 -1
- package/components/Label/SubLabel.js +1 -1
- package/components/LinkList/LinkList.js +1 -1
- package/components/List/List.js +1 -1
- package/components/ListHeader/ListHeader.js +1 -1
- package/components/ListHeader/ListHeaderText/ListHeaderText.js +1 -1
- package/components/Loader/Loader.js +1 -1
- package/components/MaxCharacters/MaxCharacters.js +1 -1
- package/components/Modal/Modal.js +1 -1
- package/components/Modal/Modal.stories.d.ts +4 -0
- package/components/NotificationPanel/DetailButton/DetailButton.js +1 -1
- package/components/NotificationPanel/NotificationPanel.js +1 -1
- package/components/Panel/Panel.js +1 -1
- package/components/PanelList/PanelList.js +1 -1
- package/components/PopMenu/PopMenu.js +1 -1
- package/components/PopMenu/PopMenu.stories.d.ts +4 -0
- package/components/PopOver/PopOver.js +1 -1
- package/components/PopOver/PopOver.stories.d.ts +5 -0
- package/components/PromoPanel/PromoPanel.js +1 -1
- package/components/RadioButton/RadioButton.js +1 -1
- package/components/Select/Select.js +1 -1
- package/components/ServiceMessage/ServiceMessage.js +1 -1
- package/components/SharingStatus/SharingStatus.js +1 -1
- package/components/Slider/Slider.js +1 -1
- package/components/Spacer/Spacer.js +1 -1
- package/components/StatusDot/StatusDot.js +1 -1
- package/components/Step/Step.js +1 -1
- package/components/StepButtons/StepButtons.js +1 -1
- package/components/Stepper/Dot.js +1 -1
- package/components/Stepper/Stepper.js +1 -1
- package/components/Table/Table.js +1 -1
- package/components/Table/TableBody/TableBody.js +1 -1
- package/components/Table/TableCell/TableCell.js +1 -1
- package/components/Table/TableExpandedRow/TableExpandedRow.js +1 -1
- package/components/Table/TableExpanderCell/TableExpanderCell.js +1 -1
- package/components/Table/TableExpanderCell/TableExpanderCellMobile.js +1 -1
- package/components/Table/TableHead/TableHead.js +1 -1
- package/components/Table/TableHeadCell/TableHeadCell.js +1 -1
- package/components/Table/TableRow/TableRow.js +1 -1
- package/components/Table/utils.js +1 -1
- package/components/Tag/Tag.js +1 -1
- package/components/TagList/TagList.js +1 -1
- package/components/Textarea/Textarea.js +1 -1
- package/components/Tile/Tile.js +1 -1
- package/components/Title/Title.js +1 -1
- package/components/Tooltip/Tooltip.stories.d.ts +4 -0
- package/components/Tooltip/TooltipWord/TooltipWord.js +1 -1
- package/components/Trigger/Trigger.js +1 -1
- package/components/Validation/Validation.js +1 -1
- package/components/Validation/ValidationSummary.js +1 -1
- package/docs/index.d.ts +7 -0
- package/docs/index.js +9 -0
- package/docs/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
import r, { useRef as
|
|
1
|
+
import r, { useRef as f, useState as X } from "react";
|
|
2
2
|
import k from "classnames";
|
|
3
3
|
import { theme as C } from "../../theme/index.js";
|
|
4
4
|
import "../../hooks/useBreakpoint.js";
|
|
5
5
|
import { useHover as Z } from "../../hooks/useHover.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const ne = (d) => {
|
|
6
|
+
import { useToggle as j } from "../../hooks/useToggle.js";
|
|
7
|
+
import { useKeyboardEvent as q } from "../../hooks/useKeyboardEvent.js";
|
|
8
|
+
import { useOutsideEvent as F } from "../../hooks/useOutsideEvent.js";
|
|
9
|
+
import { useUuid as g } from "../../hooks/useUuid.js";
|
|
10
|
+
import { ZIndex as G, KeyboardEventKey as n, AnalyticsId as J, IconSize as Q } from "../../constants.js";
|
|
11
|
+
import { mergeRefs as W } from "../../utils/refs.js";
|
|
12
|
+
import Y from "../Button/Button.js";
|
|
13
|
+
import { Icon as M } from "../Icon/Icon.js";
|
|
14
|
+
import ee from "../Icons/PlusSmall.js";
|
|
15
|
+
import o from "../Dropdown/styles.module.scss";
|
|
16
|
+
var oe = /* @__PURE__ */ ((d) => (d.onwhite = "onwhite", d.ongrey = "ongrey", d.onblueberry = "onblueberry", d.oncherry = "oncherry", d))(oe || {});
|
|
17
|
+
const re = (d) => {
|
|
19
18
|
const {
|
|
20
19
|
label: R,
|
|
21
|
-
placeholder:
|
|
22
|
-
closeText:
|
|
23
|
-
noCloseButton:
|
|
24
|
-
onToggle:
|
|
25
|
-
open:
|
|
26
|
-
children:
|
|
20
|
+
placeholder: A,
|
|
21
|
+
closeText: H = "Lukk",
|
|
22
|
+
noCloseButton: K = !1,
|
|
23
|
+
onToggle: O,
|
|
24
|
+
open: $ = !1,
|
|
25
|
+
children: _,
|
|
27
26
|
mode: c = "onwhite",
|
|
28
27
|
transparent: S = !1,
|
|
29
|
-
fluid:
|
|
28
|
+
fluid: y = !1,
|
|
30
29
|
testId: z,
|
|
31
30
|
disabled: i,
|
|
32
|
-
zIndex: D =
|
|
33
|
-
} = d, p =
|
|
31
|
+
zIndex: D = G.PopOver
|
|
32
|
+
} = d, p = f(null), b = f(null), { hoverRef: w, isHovered: L } = Z(), { value: l, toggleValue: h } = j(!i && $, O), a = f(r.Children.map(_, () => r.createRef())), [u, P] = X(), E = g(), I = g(), x = g(), v = () => {
|
|
34
33
|
var e;
|
|
35
|
-
h(), (e =
|
|
36
|
-
},
|
|
34
|
+
h(), (e = b.current) == null || e.focus();
|
|
35
|
+
}, m = () => {
|
|
37
36
|
var e;
|
|
38
|
-
h(), (e =
|
|
37
|
+
h(), (e = w.current) == null || e.focus();
|
|
39
38
|
};
|
|
40
|
-
|
|
39
|
+
q(p, (e) => {
|
|
41
40
|
var N;
|
|
42
41
|
if (e.preventDefault(), !a.current)
|
|
43
42
|
return;
|
|
44
43
|
if (l) {
|
|
45
44
|
if (e.key === n.Escape && l) {
|
|
46
|
-
|
|
45
|
+
m();
|
|
47
46
|
return;
|
|
48
47
|
}
|
|
49
48
|
} else {
|
|
50
49
|
v();
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
53
|
-
const t = a.current.findIndex((
|
|
52
|
+
const t = a.current.findIndex((V) => V.current === e.target);
|
|
54
53
|
let s = t;
|
|
55
54
|
e.key === n.Home ? s = 0 : e.key === n.End ? s = a.current.length - 1 : e.key === n.ArrowDown && t < a.current.length - 1 ? s = t + 1 : e.key === n.ArrowUp && t > 0 ? s = t - 1 : e.key === n.Enter && t !== -1 && (s = t), s !== -1 && ((N = a.current[s].current) == null || N.focus(), P(s));
|
|
56
55
|
}, [
|
|
@@ -60,8 +59,8 @@ const ne = (d) => {
|
|
|
60
59
|
n.Enter,
|
|
61
60
|
n.Escape,
|
|
62
61
|
n.Home
|
|
63
|
-
]),
|
|
64
|
-
const
|
|
62
|
+
]), F(p, () => l && m());
|
|
63
|
+
const T = k(
|
|
65
64
|
o.dropdown__toggle,
|
|
66
65
|
!i && {
|
|
67
66
|
[o["dropdown__toggle--on-white"]]: c === "onwhite",
|
|
@@ -69,36 +68,36 @@ const ne = (d) => {
|
|
|
69
68
|
[o["dropdown__toggle--on-blueberry"]]: c === "onblueberry",
|
|
70
69
|
[o["dropdown__toggle--on-cherry"]]: c === "oncherry",
|
|
71
70
|
[o["dropdown__toggle--transparent"]]: S,
|
|
72
|
-
[o["dropdown__toggle--fluid"]]:
|
|
71
|
+
[o["dropdown__toggle--fluid"]]: y,
|
|
73
72
|
[o["dropdown__toggle--open"]]: l
|
|
74
73
|
}
|
|
75
|
-
),
|
|
74
|
+
), U = k(o.dropdown__content, l && o["dropdown__content--open"]), B = r.Children.map(_, (e, t) => /* @__PURE__ */ r.createElement("li", { className: o.dropdown__input, role: "option", id: `${x}-${t}`, "aria-selected": t === u }, r.isValidElement(e) && a.current && a.current[t] ? r.cloneElement(e, { ref: W([e.props.ref, a.current[t]]) }) : e));
|
|
76
75
|
return /* @__PURE__ */ r.createElement("div", { className: o.dropdown, ref: p }, /* @__PURE__ */ r.createElement("span", { id: E, className: o.dropdown__label }, R), /* @__PURE__ */ r.createElement(
|
|
77
76
|
"button",
|
|
78
77
|
{
|
|
79
78
|
type: "button",
|
|
80
79
|
onClick: () => !l && v(),
|
|
81
|
-
className:
|
|
82
|
-
ref:
|
|
80
|
+
className: T,
|
|
81
|
+
ref: w,
|
|
83
82
|
"data-testid": z,
|
|
84
|
-
"data-analyticsid":
|
|
83
|
+
"data-analyticsid": J.Dropdown,
|
|
85
84
|
disabled: i,
|
|
86
85
|
"aria-labelledby": I,
|
|
87
86
|
"aria-haspopup": "listbox",
|
|
88
87
|
"aria-expanded": l
|
|
89
88
|
},
|
|
90
|
-
/* @__PURE__ */ r.createElement("span", { id: I, className: o.dropdown__toggle__label },
|
|
89
|
+
/* @__PURE__ */ r.createElement("span", { id: I, className: o.dropdown__toggle__label }, A),
|
|
91
90
|
/* @__PURE__ */ r.createElement(
|
|
92
|
-
|
|
91
|
+
M,
|
|
93
92
|
{
|
|
94
93
|
color: i ? C.palette.neutral700 : C.palette.blueberry600,
|
|
95
|
-
svgIcon:
|
|
94
|
+
svgIcon: ee,
|
|
96
95
|
className: o.dropdown__icon,
|
|
97
96
|
isHovered: !i && L,
|
|
98
|
-
size:
|
|
97
|
+
size: Q.XSmall
|
|
99
98
|
}
|
|
100
99
|
)
|
|
101
|
-
), /* @__PURE__ */ r.createElement("div", { className:
|
|
100
|
+
), /* @__PURE__ */ r.createElement("div", { className: U, style: { width: y ? "100%" : "auto", zIndex: D } }, /* @__PURE__ */ r.createElement(
|
|
102
101
|
"ul",
|
|
103
102
|
{
|
|
104
103
|
className: o.dropdown__options,
|
|
@@ -106,13 +105,13 @@ const ne = (d) => {
|
|
|
106
105
|
"aria-labelledby": E,
|
|
107
106
|
tabIndex: -1,
|
|
108
107
|
"aria-activedescendant": typeof u < "u" ? `${x}-${u}` : void 0,
|
|
109
|
-
ref:
|
|
108
|
+
ref: b
|
|
110
109
|
},
|
|
111
|
-
|
|
112
|
-
), !
|
|
113
|
-
},
|
|
110
|
+
B
|
|
111
|
+
), !K && /* @__PURE__ */ r.createElement("div", { className: o.dropdown__close }, /* @__PURE__ */ r.createElement(Y, { onClick: m, fluid: !0, "aria-expanded": l }, H))));
|
|
112
|
+
}, we = re;
|
|
114
113
|
export {
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
oe as DropdownMode,
|
|
115
|
+
we as default
|
|
117
116
|
};
|
|
118
117
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport {\n AnalyticsId,\n IconSize,\n KeyboardEventKey,\n ZIndex,\n theme,\n useHover,\n useKeyboardEvent,\n useOutsideEvent,\n useSize,\n useToggle,\n useUuid,\n} from '../..';\nimport { mergeRefs } from '../../utils/refs';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport PlusSmall from '../Icons/PlusSmall';\n\nimport styles from './styles.module.scss';\n\nexport enum DropdownMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n oncherry = 'oncherry',\n}\n\nexport interface DropdownProps {\n /** Label for dropdown. Synlig for skjermlesere. */\n label: string;\n /** Tekst på knappen som åpner dropdownen */\n placeholder: string;\n /** Sets the dropdown content */\n children: React.ReactNode;\n /** Close button text */\n closeText?: string;\n /** No close button */\n noCloseButton?: boolean;\n /** Called when dropdown is open/closed. */\n onToggle?: (isOpen: boolean) => void;\n /** Om dropdown er åpen */\n open?: boolean;\n /** Changes the visuals of the dropdown */\n mode?: keyof typeof DropdownMode;\n /** Makes the background transparent */\n transparent?: boolean;\n /** Makes the background transparent */\n fluid?: boolean;\n /** Makes the dropdown disabled */\n disabled?: boolean;\n /** Sets the data-testid attribute on the dropdown button. */\n testId?: string;\n /** Overrides the default z-index of the DropDownContent */\n zIndex?: number;\n}\n\nconst Dropdown: React.FC<DropdownProps> = props => {\n const {\n label,\n placeholder,\n closeText = 'Lukk',\n noCloseButton = false,\n onToggle,\n open = false,\n children,\n mode = DropdownMode.onwhite,\n transparent = false,\n fluid = false,\n testId,\n disabled,\n zIndex = ZIndex.PopOver,\n } = props;\n const dropdownRef = useRef<HTMLDivElement>(null);\n const optionsRef = useRef<HTMLUListElement>(null);\n const { hoverRef: buttonRef, isHovered } = useHover<HTMLButtonElement>();\n const { value: isOpen, toggleValue: toggleIsOpen } = useToggle(!disabled && open, onToggle);\n const inputRefList = useRef(React.Children.map(children, () => React.createRef<HTMLElement>()));\n const [currentIndex, setCurrentIndex] = useState<number>();\n const { width: buttonWidth } = useSize(buttonRef) || {};\n const labelId = useUuid();\n const toggleLabelId = useUuid();\n const optionIdPrefix = useUuid();\n\n const handleOpen = (): void => {\n toggleIsOpen();\n optionsRef.current?.focus();\n };\n\n const handleClose = (): void => {\n toggleIsOpen();\n buttonRef.current?.focus();\n };\n\n const handleKeyboardNavigation = (event: KeyboardEvent): void => {\n event.preventDefault();\n\n if (!inputRefList.current) {\n return;\n }\n\n if (!isOpen) {\n handleOpen();\n return;\n } else if (event.key === KeyboardEventKey.Escape && isOpen) {\n handleClose();\n return;\n }\n\n const index = inputRefList.current.findIndex(x => x.current === event.target);\n let nextIndex = index;\n\n if (event.key === KeyboardEventKey.Home) {\n nextIndex = 0;\n } else if (event.key === KeyboardEventKey.End) {\n nextIndex = inputRefList.current.length - 1;\n } else if (event.key === KeyboardEventKey.ArrowDown && index < inputRefList.current.length - 1) {\n nextIndex = index + 1;\n } else if (event.key === KeyboardEventKey.ArrowUp && index > 0) {\n nextIndex = index - 1;\n } else if (event.key === KeyboardEventKey.Enter && index !== -1) {\n nextIndex = index;\n }\n if (nextIndex !== -1) {\n inputRefList.current[nextIndex].current?.focus();\n setCurrentIndex(nextIndex);\n }\n };\n\n useKeyboardEvent(dropdownRef, handleKeyboardNavigation, [\n KeyboardEventKey.ArrowDown,\n KeyboardEventKey.ArrowUp,\n KeyboardEventKey.End,\n KeyboardEventKey.Enter,\n KeyboardEventKey.Escape,\n KeyboardEventKey.Home,\n ]);\n\n useOutsideEvent(dropdownRef, () => isOpen && handleClose());\n\n const toggleClasses = classNames(\n styles.dropdown__toggle,\n !disabled && {\n [styles['dropdown__toggle--on-white']]: mode === DropdownMode.onwhite,\n [styles['dropdown__toggle--on-grey']]: mode === DropdownMode.ongrey,\n [styles['dropdown__toggle--on-blueberry']]: mode === DropdownMode.onblueberry,\n [styles['dropdown__toggle--on-cherry']]: mode === DropdownMode.oncherry,\n [styles['dropdown__toggle--transparent']]: transparent,\n [styles['dropdown__toggle--fluid']]: fluid,\n [styles['dropdown__toggle--open']]: isOpen,\n }\n );\n\n const contentClasses = classNames(styles.dropdown__content, isOpen && styles['dropdown__content--open']);\n\n const renderChildren = React.Children.map(children, (child, index) => (\n <li className={styles.dropdown__input} role=\"option\" id={`${optionIdPrefix}-${index}`} aria-selected={index === currentIndex}>\n {React.isValidElement(child) && inputRefList.current && inputRefList.current[index]\n ? React.cloneElement(child as React.ReactElement, { ref: mergeRefs([child.props.ref, inputRefList.current[index]]) })\n : child}\n </li>\n ));\n\n return (\n <div className={styles.dropdown} ref={dropdownRef}>\n <span id={labelId} className={styles.dropdown__label}>\n {label}\n </span>\n <button\n type=\"button\"\n onClick={(): false | void => !isOpen && handleOpen()}\n className={toggleClasses}\n ref={buttonRef}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Dropdown}\n disabled={disabled}\n aria-labelledby={toggleLabelId}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen}\n >\n <span id={toggleLabelId} className={styles.dropdown__toggle__label}>\n {placeholder}\n </span>\n <Icon\n color={disabled ? theme.palette.neutral700 : theme.palette.blueberry600}\n svgIcon={PlusSmall}\n className={styles.dropdown__icon}\n isHovered={!disabled && isHovered}\n size={IconSize.XSmall}\n />\n </button>\n <div className={contentClasses} style={{ width: fluid ? '100%' : `${buttonWidth}px`, zIndex: zIndex }}>\n <ul\n className={styles.dropdown__options}\n role=\"listbox\"\n aria-labelledby={labelId}\n tabIndex={-1}\n aria-activedescendant={typeof currentIndex !== 'undefined' ? `${optionIdPrefix}-${currentIndex}` : undefined}\n ref={optionsRef}\n >\n {renderChildren}\n </ul>\n {!noCloseButton && (\n <div className={styles.dropdown__close}>\n <Button onClick={handleClose} fluid aria-expanded={isOpen}>\n {closeText}\n </Button>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default Dropdown;\n"],"names":["DropdownMode","Dropdown","props","label","placeholder","closeText","noCloseButton","onToggle","open","children","mode","transparent","fluid","testId","disabled","zIndex","ZIndex","dropdownRef","useRef","optionsRef","buttonRef","isHovered","useHover","isOpen","toggleIsOpen","useToggle","inputRefList","React","currentIndex","setCurrentIndex","useState","buttonWidth","useSize","labelId","useUuid","toggleLabelId","optionIdPrefix","handleOpen","_a","handleClose","useKeyboardEvent","event","KeyboardEventKey","index","x","nextIndex","useOutsideEvent","toggleClasses","classNames","styles","contentClasses","renderChildren","child","mergeRefs","AnalyticsId","Icon","theme","PlusSmall","IconSize","Button","Dropdown$1"],"mappings":";;;;;;;;;;;;;;;;AAwBY,IAAAA,uBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,WAAW,YAJDA,IAAAA,MAAA,CAAA,CAAA;AAoCZ,MAAMC,KAAoC,CAASC,MAAA;AAC3C,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,eAAAC,IAAgB;AAAA,IAChB,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,aAAAC,IAAc;AAAA,IACd,OAAAC,IAAQ;AAAA,IACR,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC,IAASC,EAAO;AAAA,EACd,IAAAd,GACEe,IAAcC,EAAuB,IAAI,GACzCC,IAAaD,EAAyB,IAAI,GAC1C,EAAE,UAAUE,GAAW,WAAAC,MAAcC,EAA4B,GACjE,EAAE,OAAOC,GAAQ,aAAaC,EAAA,IAAiBC,EAAU,CAACX,KAAYN,GAAMD,CAAQ,GACpFmB,IAAeR,EAAOS,EAAM,SAAS,IAAIlB,GAAU,MAAMkB,EAAM,UAAwB,CAAA,CAAC,GACxF,CAACC,GAAcC,CAAe,IAAIC,EAAiB,GACnD,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;AAAA,MACL,eAAaP;AAAA,MACb,oBAAkByC,EAAY;AAAA,MAC9B,UAAAxC;AAAA,MACA,mBAAiBqB;AAAA,MACjB,iBAAc;AAAA,MACd,iBAAeZ;AAAA,IAAA;AAAA,oCAEd,QAAK,EAAA,IAAIY,GAAe,WAAWc,EAAO,2BACxC7C,CACH;AAAA,IACAuB,gBAAAA,EAAA;AAAA,MAAC4B;AAAA,MAAA;AAAA,QACC,OAAOzC,IAAW0C,EAAM,QAAQ,aAAaA,EAAM,QAAQ;AAAA,QAC3D,SAASC;AAAA,QACT,WAAWR,EAAO;AAAA,QAClB,WAAW,CAACnC,KAAYO;AAAA,QACxB,MAAMqC,EAAS;AAAA,MAAA;AAAA,IACjB;AAAA,EAAA,GAEF/B,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWuB,GAAgB,OAAO,EAAE,OAAOtC,IAAQ,SAAS,GAAGmB,CAAW,MAAM,QAAAhB,EACnF,EAAA,GAAAY,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWsB,EAAO;AAAA,MAClB,MAAK;AAAA,MACL,mBAAiBhB;AAAA,MACjB,UAAU;AAAA,MACV,yBAAuB,OAAOL,IAAiB,MAAc,GAAGQ,CAAc,IAAIR,CAAY,KAAK;AAAA,MACnG,KAAKT;AAAA,IAAA;AAAA,IAEJgC;AAAA,EAAA,GAEF,CAAC7C,qCACC,OAAI,EAAA,WAAW2C,EAAO,gBACrB,GAAAtB,gBAAAA,EAAA,cAACgC,MAAO,SAASpB,GAAa,OAAK,IAAC,iBAAehB,KAChDlB,CACH,CACF,CAEJ,CACF;AAEJ,GAEAuD,KAAe3D;"}
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport {\n AnalyticsId,\n IconSize,\n KeyboardEventKey,\n ZIndex,\n theme,\n useHover,\n useKeyboardEvent,\n useOutsideEvent,\n useToggle,\n useUuid,\n} from '../..';\nimport { mergeRefs } from '../../utils/refs';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport PlusSmall from '../Icons/PlusSmall';\n\nimport styles from './styles.module.scss';\n\nexport enum DropdownMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n oncherry = 'oncherry',\n}\n\nexport interface DropdownProps {\n /** Label for dropdown. Visible for screen readers */\n label: string;\n /** Text on the trigger button that opens the dropdown */\n placeholder: string;\n /** Sets the dropdown content */\n children: React.ReactNode;\n /** Close button text */\n closeText?: string;\n /** No close button */\n noCloseButton?: boolean;\n /** Called when dropdown is open/closed */\n onToggle?: (isOpen: boolean) => void;\n /** Whether the dropdown is open or not */\n open?: boolean;\n /** Changes the visuals of the dropdown */\n mode?: keyof typeof DropdownMode;\n /** Makes the background of the trigger transparent */\n transparent?: boolean;\n /** Makes the width of the full component adjust to its parent */\n fluid?: boolean;\n /** Makes the dropdown disabled */\n disabled?: boolean;\n /** Sets the data-testid attribute on the dropdown button */\n testId?: string;\n /** Overrides the default z-index of the DropDownContent */\n zIndex?: number;\n}\n\nconst Dropdown: React.FC<DropdownProps> = props => {\n const {\n label,\n placeholder,\n closeText = 'Lukk',\n noCloseButton = false,\n onToggle,\n open = false,\n children,\n mode = DropdownMode.onwhite,\n transparent = false,\n fluid = false,\n testId,\n disabled,\n zIndex = ZIndex.PopOver,\n } = props;\n const dropdownRef = useRef<HTMLDivElement>(null);\n const optionsRef = useRef<HTMLUListElement>(null);\n const { hoverRef: buttonRef, isHovered } = useHover<HTMLButtonElement>();\n const { value: isOpen, toggleValue: toggleIsOpen } = useToggle(!disabled && open, onToggle);\n const inputRefList = useRef(React.Children.map(children, () => React.createRef<HTMLElement>()));\n const [currentIndex, setCurrentIndex] = useState<number>();\n const labelId = useUuid();\n const toggleLabelId = useUuid();\n const optionIdPrefix = useUuid();\n\n const handleOpen = (): void => {\n toggleIsOpen();\n optionsRef.current?.focus();\n };\n\n const handleClose = (): void => {\n toggleIsOpen();\n buttonRef.current?.focus();\n };\n\n const handleKeyboardNavigation = (event: KeyboardEvent): void => {\n event.preventDefault();\n\n if (!inputRefList.current) {\n return;\n }\n\n if (!isOpen) {\n handleOpen();\n return;\n } else if (event.key === KeyboardEventKey.Escape && isOpen) {\n handleClose();\n return;\n }\n\n const index = inputRefList.current.findIndex(x => x.current === event.target);\n let nextIndex = index;\n\n if (event.key === KeyboardEventKey.Home) {\n nextIndex = 0;\n } else if (event.key === KeyboardEventKey.End) {\n nextIndex = inputRefList.current.length - 1;\n } else if (event.key === KeyboardEventKey.ArrowDown && index < inputRefList.current.length - 1) {\n nextIndex = index + 1;\n } else if (event.key === KeyboardEventKey.ArrowUp && index > 0) {\n nextIndex = index - 1;\n } else if (event.key === KeyboardEventKey.Enter && index !== -1) {\n nextIndex = index;\n }\n if (nextIndex !== -1) {\n inputRefList.current[nextIndex].current?.focus();\n setCurrentIndex(nextIndex);\n }\n };\n\n useKeyboardEvent(dropdownRef, handleKeyboardNavigation, [\n KeyboardEventKey.ArrowDown,\n KeyboardEventKey.ArrowUp,\n KeyboardEventKey.End,\n KeyboardEventKey.Enter,\n KeyboardEventKey.Escape,\n KeyboardEventKey.Home,\n ]);\n\n useOutsideEvent(dropdownRef, () => isOpen && handleClose());\n\n const toggleClasses = classNames(\n styles.dropdown__toggle,\n !disabled && {\n [styles['dropdown__toggle--on-white']]: mode === DropdownMode.onwhite,\n [styles['dropdown__toggle--on-grey']]: mode === DropdownMode.ongrey,\n [styles['dropdown__toggle--on-blueberry']]: mode === DropdownMode.onblueberry,\n [styles['dropdown__toggle--on-cherry']]: mode === DropdownMode.oncherry,\n [styles['dropdown__toggle--transparent']]: transparent,\n [styles['dropdown__toggle--fluid']]: fluid,\n [styles['dropdown__toggle--open']]: isOpen,\n }\n );\n\n const contentClasses = classNames(styles.dropdown__content, isOpen && styles['dropdown__content--open']);\n\n const renderChildren = React.Children.map(children, (child, index) => (\n <li className={styles.dropdown__input} role=\"option\" id={`${optionIdPrefix}-${index}`} aria-selected={index === currentIndex}>\n {React.isValidElement(child) && inputRefList.current && inputRefList.current[index]\n ? React.cloneElement(child as React.ReactElement, { ref: mergeRefs([child.props.ref, inputRefList.current[index]]) })\n : child}\n </li>\n ));\n\n return (\n <div className={styles.dropdown} ref={dropdownRef}>\n <span id={labelId} className={styles.dropdown__label}>\n {label}\n </span>\n <button\n type=\"button\"\n onClick={(): false | void => !isOpen && handleOpen()}\n className={toggleClasses}\n ref={buttonRef}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Dropdown}\n disabled={disabled}\n aria-labelledby={toggleLabelId}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen}\n >\n <span id={toggleLabelId} className={styles.dropdown__toggle__label}>\n {placeholder}\n </span>\n <Icon\n color={disabled ? theme.palette.neutral700 : theme.palette.blueberry600}\n svgIcon={PlusSmall}\n className={styles.dropdown__icon}\n isHovered={!disabled && isHovered}\n size={IconSize.XSmall}\n />\n </button>\n <div className={contentClasses} style={{ width: fluid ? '100%' : `auto`, zIndex: zIndex }}>\n <ul\n className={styles.dropdown__options}\n role=\"listbox\"\n aria-labelledby={labelId}\n tabIndex={-1}\n aria-activedescendant={typeof currentIndex !== 'undefined' ? `${optionIdPrefix}-${currentIndex}` : undefined}\n ref={optionsRef}\n >\n {renderChildren}\n </ul>\n {!noCloseButton && (\n <div className={styles.dropdown__close}>\n <Button onClick={handleClose} fluid aria-expanded={isOpen}>\n {closeText}\n </Button>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default Dropdown;\n"],"names":["DropdownMode","Dropdown","props","label","placeholder","closeText","noCloseButton","onToggle","open","children","mode","transparent","fluid","testId","disabled","zIndex","ZIndex","dropdownRef","useRef","optionsRef","buttonRef","isHovered","useHover","isOpen","toggleIsOpen","useToggle","inputRefList","React","currentIndex","setCurrentIndex","useState","labelId","useUuid","toggleLabelId","optionIdPrefix","handleOpen","_a","handleClose","useKeyboardEvent","event","KeyboardEventKey","index","x","nextIndex","useOutsideEvent","toggleClasses","classNames","styles","contentClasses","renderChildren","child","mergeRefs","AnalyticsId","Icon","theme","PlusSmall","IconSize","Button","Dropdown$1"],"mappings":";;;;;;;;;;;;;;;AAuBY,IAAAA,uBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,WAAW,YAJDA,IAAAA,MAAA,CAAA,CAAA;AAoCZ,MAAMC,KAAoC,CAASC,MAAA;AAC3C,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,eAAAC,IAAgB;AAAA,IAChB,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,aAAAC,IAAc;AAAA,IACd,OAAAC,IAAQ;AAAA,IACR,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC,IAASC,EAAO;AAAA,EACd,IAAAd,GACEe,IAAcC,EAAuB,IAAI,GACzCC,IAAaD,EAAyB,IAAI,GAC1C,EAAE,UAAUE,GAAW,WAAAC,MAAcC,EAA4B,GACjE,EAAE,OAAOC,GAAQ,aAAaC,EAAA,IAAiBC,EAAU,CAACX,KAAYN,GAAMD,CAAQ,GACpFmB,IAAeR,EAAOS,EAAM,SAAS,IAAIlB,GAAU,MAAMkB,EAAM,UAAwB,CAAA,CAAC,GACxF,CAACC,GAAcC,CAAe,IAAIC,EAAiB,GACnDC,IAAUC,KACVC,IAAgBD,KAChBE,IAAiBF,KAEjBG,IAAa,MAAY;;AAChB,IAAAX,MACbY,IAAAjB,EAAW,YAAX,QAAAiB,EAAoB;AAAA,EAAM,GAGtBC,IAAc,MAAY;;AACjB,IAAAb,MACbY,IAAAhB,EAAU,YAAV,QAAAgB,EAAmB;AAAA,EAAM;AAsC3B,EAAAE,EAAiBrB,GAnCgB,CAACsB,MAA+B;;AAG3D,QAFJA,EAAM,eAAe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AAO;AAAA,QAClB,WAAW,CAACjC,KAAYO;AAAA,QACxB,MAAMmC,EAAS;AAAA,MAAA;AAAA,IACjB;AAAA,EAAA,GAEF7B,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWqB,GAAgB,OAAO,EAAE,OAAOpC,IAAQ,SAAS,QAAQ,QAAAG,EACvE,EAAA,GAAAY,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWoB,EAAO;AAAA,MAClB,MAAK;AAAA,MACL,mBAAiBhB;AAAA,MACjB,UAAU;AAAA,MACV,yBAAuB,OAAOH,IAAiB,MAAc,GAAGM,CAAc,IAAIN,CAAY,KAAK;AAAA,MACnG,KAAKT;AAAA,IAAA;AAAA,IAEJ8B;AAAA,EAAA,GAEF,CAAC3C,qCACC,OAAI,EAAA,WAAWyC,EAAO,gBACrB,GAAApB,gBAAAA,EAAA,cAAC8B,KAAO,SAASpB,GAAa,OAAK,IAAC,iBAAed,KAChDlB,CACH,CACF,CAEJ,CACF;AAEJ,GAEAqD,KAAezD;"}
|
|
@@ -2,7 +2,7 @@ import t from "react";
|
|
|
2
2
|
import u from "classnames";
|
|
3
3
|
import { AnalyticsId as F } from "../../constants.js";
|
|
4
4
|
import x from "../Spacer/Spacer.js";
|
|
5
|
-
import o from "
|
|
5
|
+
import o from "../Duolist/styles.module.scss";
|
|
6
6
|
const D = (c) => {
|
|
7
7
|
const { format: s = "formatted", boldColumn: a = s === "non-formatted" ? "none" : "first", description: d, separator: r = ": ", term: l } = c, p = a === "first", f = a === "second", e = s === "non-formatted", _ = u(o.duolist__dt, {
|
|
8
8
|
[o["duolist__dt--bold"]]: p,
|
|
@@ -2,7 +2,7 @@ import e from "react";
|
|
|
2
2
|
import a from "./NobodyHome.js";
|
|
3
3
|
import { AnalyticsId as m } from "../../constants.js";
|
|
4
4
|
import l from "../Title/Title.js";
|
|
5
|
-
import r from "
|
|
5
|
+
import r from "../EmptyState/styles.module.scss";
|
|
6
6
|
const i = (t) => /* @__PURE__ */ e.createElement("div", { className: r.emptystate, "data-testid": t.testId, "data-analyticsid": m.EmptyState }, /* @__PURE__ */ e.createElement(a, null), /* @__PURE__ */ e.createElement(l, { appearance: "title3", htmlMarkup: t.titleHtmlMarkup || "h2" }, t.children)), s = i;
|
|
7
7
|
export {
|
|
8
8
|
s as default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import t from "react";
|
|
2
2
|
import o from "classnames";
|
|
3
|
-
import e from "
|
|
3
|
+
import e from "../ErrorWrapper/styles.module.scss";
|
|
4
4
|
const s = (r) => {
|
|
5
5
|
const a = o(e["error-wrapper"], r.errorText && e["error-wrapper--with-error"], r.className);
|
|
6
6
|
return /* @__PURE__ */ t.createElement("div", { className: a, "data-testid": r.testId }, r.errorText && /* @__PURE__ */ t.createElement("p", { className: e["error-wrapper__errors"], id: r.errorTextId }, r.errorText), r.children);
|
|
@@ -9,7 +9,7 @@ import { Icon as _ } from "../Icon/Icon.js";
|
|
|
9
9
|
import b from "../Icons/ChevronDown.js";
|
|
10
10
|
import h from "../Icons/ChevronUp.js";
|
|
11
11
|
import F from "../LazyIcon/LazyIcon.js";
|
|
12
|
-
import e from "
|
|
12
|
+
import e from "../Expander/styles.module.scss";
|
|
13
13
|
var G = /* @__PURE__ */ ((s) => (s.small = "small", s.large = "large", s))(G || {});
|
|
14
14
|
const J = (s) => {
|
|
15
15
|
const {
|
|
@@ -4,7 +4,7 @@ import x from "./ExpanderButton.js";
|
|
|
4
4
|
import E from "./ExpanderHierarchy.js";
|
|
5
5
|
import { getHeadingTag as _ } from "./utils.js";
|
|
6
6
|
import { isComponent as l } from "../../utils/component.js";
|
|
7
|
-
import r from "
|
|
7
|
+
import r from "../ExpanderHierarchy/expander.module.scss";
|
|
8
8
|
const u = ({
|
|
9
9
|
title: m,
|
|
10
10
|
htmlMarkup: a = "h2",
|
|
@@ -6,7 +6,7 @@ import { useHover as y } from "../../hooks/useHover.js";
|
|
|
6
6
|
import { Icon as I } from "../Icon/Icon.js";
|
|
7
7
|
import N from "../Icons/ChevronDown.js";
|
|
8
8
|
import H from "../Icons/ChevronUp.js";
|
|
9
|
-
import e from "
|
|
9
|
+
import e from "../ExpanderHierarchy/expander.module.scss";
|
|
10
10
|
const g = ({ htmlMarkup: s = "h2", level: t = 1, print: r, expanded: d, onExpand: p, children: i, testId: c }) => {
|
|
11
11
|
const { hoverRef: m, isHovered: _ } = y(), [n, x] = w(d, p), l = () => {
|
|
12
12
|
x(!n);
|
|
@@ -3,7 +3,7 @@ import c from "classnames";
|
|
|
3
3
|
import n from "./Expander.js";
|
|
4
4
|
import { AnalyticsId as h } from "../../constants.js";
|
|
5
5
|
import { isComponent as x } from "../../utils/component.js";
|
|
6
|
-
import t from "
|
|
6
|
+
import t from "../ExpanderHierarchy/styles.module.scss";
|
|
7
7
|
const o = ({
|
|
8
8
|
htmlMarkup: s = "h2",
|
|
9
9
|
level: r = 1,
|
|
@@ -10,7 +10,7 @@ import { isElementInViewport as J } from "../../utils/viewport.js";
|
|
|
10
10
|
import K from "../Icons/ChevronDown.js";
|
|
11
11
|
import Q from "../Icons/ChevronUp.js";
|
|
12
12
|
import { renderListHeader as X } from "../ListHeader/ListHeader.js";
|
|
13
|
-
import r from "
|
|
13
|
+
import r from "../ExpanderList/styles.module.scss";
|
|
14
14
|
const W = s.forwardRef((l, g) => {
|
|
15
15
|
const {
|
|
16
16
|
id: x,
|
|
@@ -11,7 +11,7 @@ import q, { getRadioLabelClasses as J } from "../RadioButton/RadioButton.js";
|
|
|
11
11
|
import K from "../Select/Select.js";
|
|
12
12
|
import O from "../Textarea/Textarea.js";
|
|
13
13
|
import P from "../Title/Title.js";
|
|
14
|
-
import p from "
|
|
14
|
+
import p from "../FormGroup/styles.module.scss";
|
|
15
15
|
const f = r.forwardRef((t, F) => {
|
|
16
16
|
const {
|
|
17
17
|
className: G,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import r from "react";
|
|
2
2
|
import i from "classnames";
|
|
3
3
|
import { FormSize as p, AnalyticsId as v } from "../../constants.js";
|
|
4
|
-
import t from "
|
|
4
|
+
import t from "../FormLayout/styles.module.scss";
|
|
5
5
|
var w = /* @__PURE__ */ ((e) => (e.one = "one", e.two = "two", e.three = "three", e.four = "four", e.five = "five", e))(w || {});
|
|
6
6
|
const m = r.forwardRef((e, s) => {
|
|
7
7
|
const { maxColumns: o = "one", colMinWidth: c = 300, size: f, className: n, mapHelper: a } = e, d = { "--min-col-width": `${c}px` }, u = i(
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type GridLayout = 'helsenorge' | 'padding' | 'none';
|
|
3
|
+
interface GridExampleProps {
|
|
4
|
+
gridLayout: GridLayout;
|
|
5
|
+
}
|
|
6
|
+
export declare const GridExample: React.FC<GridExampleProps>;
|
|
3
7
|
export default GridExample;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
|
|
2
|
+
import { isSupernova as r } from "../../docs/index.js";
|
|
3
|
+
const m = ({ gridLayout: t, children: a }) => {
|
|
4
|
+
const n = r() || t === "padding";
|
|
5
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, n && /* @__PURE__ */ e.createElement("div", { style: { padding: "0.5rem" } }, a), t === "helsenorge" && /* @__PURE__ */ e.createElement("div", { className: "container py-5" }, /* @__PURE__ */ e.createElement("div", { className: "row" }, /* @__PURE__ */ e.createElement("div", { className: "col" }, a))), t === "none" && a);
|
|
6
|
+
}, c = m;
|
|
3
7
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
m as GridExample,
|
|
9
|
+
c as default
|
|
6
10
|
};
|
|
7
11
|
//# sourceMappingURL=GridExample.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridExample.js","sources":["../../../src/components/GridExample/GridExample.tsx"],"sourcesContent":["import React from 'react';\n\nexport const GridExample: React.FC = ({ children }) => (\n <div className=\"container py-5\">\n
|
|
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;"}
|
|
@@ -4,7 +4,7 @@ import { AnalyticsId as L } from "../../constants.js";
|
|
|
4
4
|
import w from "../AnchorLink/AnchorLink.js";
|
|
5
5
|
import A from "../Close/Close.js";
|
|
6
6
|
import I, { PopOverVariant as R } from "../PopOver/PopOver.js";
|
|
7
|
-
import t from "
|
|
7
|
+
import t from "../HelpBubble/styles.module.scss";
|
|
8
8
|
const M = R, b = e.forwardRef((m, u) => {
|
|
9
9
|
const {
|
|
10
10
|
children: p,
|
|
@@ -2,7 +2,7 @@ import m from "react";
|
|
|
2
2
|
import n from "classnames";
|
|
3
3
|
import p from "../HighlightBox/HighlightBox.js";
|
|
4
4
|
import c from "../Icons/HandWaving.js";
|
|
5
|
-
import e from "
|
|
5
|
+
import e from "../HelpPanel/styles.module.scss";
|
|
6
6
|
const i = ({ className: a, testId: l, size: t, children: o, title: r }) => {
|
|
7
7
|
const s = n(e["help-panel"], a);
|
|
8
8
|
return /* @__PURE__ */ m.createElement(
|
|
@@ -4,7 +4,7 @@ import { AnalyticsId as c } from "../../constants.js";
|
|
|
4
4
|
import { usePseudoClasses as d } from "../../hooks/usePseudoClasses.js";
|
|
5
5
|
import { mergeRefs as y } from "../../utils/refs.js";
|
|
6
6
|
import H from "../Trigger/Trigger.js";
|
|
7
|
-
import s from "
|
|
7
|
+
import s from "../HelpQuestion/styles.module.scss";
|
|
8
8
|
const a = t.forwardRef(
|
|
9
9
|
({ children: o, selected: e = !1, className: r, onClick: i, testId: m }, l) => {
|
|
10
10
|
const { isHovered: n, refObject: p } = d(), f = u(s.helpquestion, e && s["helpquestion--selected"], r);
|
|
@@ -6,7 +6,7 @@ import { AnalyticsId as p, IconSize as N } from "../../constants.js";
|
|
|
6
6
|
import { Icon as C } from "../Icon/Icon.js";
|
|
7
7
|
import B from "../LazyIcon/LazyIcon.js";
|
|
8
8
|
import W from "../Title/Title.js";
|
|
9
|
-
import t from "
|
|
9
|
+
import t from "../HighlightBox/styles.module.scss";
|
|
10
10
|
var z = /* @__PURE__ */ ((i) => (i.medium = "medium", i.large = "large", i.fluid = "fluid", i))(z || {});
|
|
11
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
12
|
const { children: r, className: s } = i, a = l(t["highlightbox__content-wrapper"], s);
|
|
@@ -2,7 +2,7 @@ import r, { useRef as e } from "react";
|
|
|
2
2
|
import i from "classnames";
|
|
3
3
|
import { useIsVisible as c } from "../../hooks/useIsVisible.js";
|
|
4
4
|
import { useSize as g } from "../../hooks/useSize.js";
|
|
5
|
-
import o from "
|
|
5
|
+
import o from "../HorizontalScroll/styles.module.scss";
|
|
6
6
|
const d = "3px", p = ({ children: m, childWidth: _, testId: f, ...l }) => {
|
|
7
7
|
const t = e(null), a = e(null), s = e(null), h = c(a, 1, { root: t == null ? void 0 : t.current, rootMargin: d }, !0), u = c(s, 1, { root: t == null ? void 0 : t.current, rootMargin: d }, !0), { width: v = 0 } = g(t) || {}, z = _ > v, b = i(o.horizontalscroll__viewport, z && o["horizontalscroll__viewport--overflow"]), n = l["aria-label"] || l["aria-labelledby"];
|
|
8
8
|
return /* @__PURE__ */ r.createElement("div", { className: o.horizontalscroll, "data-testid": f }, /* @__PURE__ */ r.createElement(
|
|
@@ -9,7 +9,7 @@ import { Icon as Ie } from "../Icon/Icon.js";
|
|
|
9
9
|
import { renderLabel as Ne } from "../Label/Label.js";
|
|
10
10
|
import Re from "../LazyIcon/LazyIcon.js";
|
|
11
11
|
import We from "../MaxCharacters/MaxCharacters.js";
|
|
12
|
-
import t from "
|
|
12
|
+
import t from "../Input/styles.module.scss";
|
|
13
13
|
var Se = /* @__PURE__ */ ((e) => (e.text = "text", e.number = "number", e.email = "email", e.password = "password", e.search = "search", e.tel = "tel", e.url = "url", e.date = "date", e.time = "time", e))(Se || {});
|
|
14
14
|
const ze = (e, s, p) => {
|
|
15
15
|
const i = s ? "1.5rem" : "2rem", f = s ? `${p}px` : "0px";
|
|
@@ -5,7 +5,7 @@ import { AnalyticsId as k, FormMode as b } from "../../constants.js";
|
|
|
5
5
|
import { isComponent as l } from "../../utils/component.js";
|
|
6
6
|
import S from "../Spacer/Spacer.js";
|
|
7
7
|
import _ from "../StatusDot/StatusDot.js";
|
|
8
|
-
import n from "
|
|
8
|
+
import n from "../Label/styles.module.scss";
|
|
9
9
|
const $ = (e) => {
|
|
10
10
|
let r = "";
|
|
11
11
|
return l(e, o) && e.props.labelTexts.forEach((a) => {
|
|
@@ -2,7 +2,7 @@ import e from "react";
|
|
|
2
2
|
import u from "classnames";
|
|
3
3
|
import { AnalyticsId as f, FormMode as S } from "../../constants.js";
|
|
4
4
|
import y from "../Spacer/Spacer.js";
|
|
5
|
-
import a from "
|
|
5
|
+
import a from "../Label/styles.module.scss";
|
|
6
6
|
const _ = ({ className: r, id: d, mode: i, sublabelTexts: l, testId: m }) => {
|
|
7
7
|
const o = (c) => l && l.map((t, b) => {
|
|
8
8
|
const p = u(a.label, a["label--sublabel"], {
|
|
@@ -4,7 +4,7 @@ import { AnalyticsId as b } from "../../constants.js";
|
|
|
4
4
|
import { useHover as w } from "../../hooks/useHover.js";
|
|
5
5
|
import y from "../Icons/ChevronRight.js";
|
|
6
6
|
import { renderListHeader as R } from "../ListHeader/ListHeader.js";
|
|
7
|
-
import t from "
|
|
7
|
+
import t from "../LinkList/styles.module.scss";
|
|
8
8
|
const p = e.forwardRef((L, l) => {
|
|
9
9
|
const {
|
|
10
10
|
children: s,
|
package/components/List/List.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import l from "react";
|
|
2
2
|
import n from "classnames";
|
|
3
3
|
import { AnalyticsId as d } from "../../constants.js";
|
|
4
|
-
import t from "
|
|
4
|
+
import t from "../List/styles.module.scss";
|
|
5
5
|
const u = ({ children: s }) => /* @__PURE__ */ l.createElement("li", { className: t.list__item }, s), a = ({ children: s, className: i, testId: m, variant: e = "bullet", margin: o }) => {
|
|
6
6
|
const c = ["numbered", "alphabetical"].includes(e) ? "ol" : "ul", r = n(t.list, t[`list--${e}`], o && t["list--margin"], i);
|
|
7
7
|
return /* @__PURE__ */ l.createElement(c, { className: r, "data-testid": m, "data-analyticsid": d.List }, s);
|
|
@@ -7,7 +7,7 @@ import $, { AvatarSize as B } from "../Avatar/Avatar.js";
|
|
|
7
7
|
import R from "../Badge/Badge.js";
|
|
8
8
|
import { Icon as p } from "../Icon/Icon.js";
|
|
9
9
|
import { IconSize as C } from "../../constants.js";
|
|
10
|
-
import t from "
|
|
10
|
+
import t from "../ListHeader/styles.module.scss";
|
|
11
11
|
const K = (m, f, _, i, c, o) => {
|
|
12
12
|
if (u(m, E))
|
|
13
13
|
return r.cloneElement(m, {
|
|
@@ -2,7 +2,7 @@ import r, { useState as C, useRef as R, useEffect as S } from "react";
|
|
|
2
2
|
import c from "classnames";
|
|
3
3
|
import { AnalyticsId as D } from "../../constants.js";
|
|
4
4
|
import { uuid as z } from "../../utils/uuid.js";
|
|
5
|
-
import e from "
|
|
5
|
+
import e from "../Loader/styles.module.scss";
|
|
6
6
|
var A = /* @__PURE__ */ ((t) => (t.screen = "screen", t.parent = "parent", t))(A || {});
|
|
7
7
|
const B = (t) => {
|
|
8
8
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import l from "react";
|
|
2
2
|
import n from "classnames";
|
|
3
3
|
import { FormMode as f } from "../../constants.js";
|
|
4
|
-
import a from "
|
|
4
|
+
import a from "../MaxCharacters/styles.module.scss";
|
|
5
5
|
const d = ({ maxCharacters: r, maxText: t, length: e, mode: s, maxWidth: c }) => {
|
|
6
6
|
const o = e / r, m = n(a["max-characters"], {
|
|
7
7
|
[a["max-characters--on-dark"]]: s === f.ondark,
|
|
@@ -13,7 +13,7 @@ import K from "../Icons/AlertSignStroke.js";
|
|
|
13
13
|
import O from "../Icons/CheckOutline.js";
|
|
14
14
|
import D from "../Portal/index.js";
|
|
15
15
|
import M from "../Title/Title.js";
|
|
16
|
-
import a from "
|
|
16
|
+
import a from "../Modal/styles.module.scss";
|
|
17
17
|
var V = /* @__PURE__ */ ((e) => (e.normal = "normal", e.warning = "warning", e.error = "error", e.success = "success", e.image = "image", e))(V || {}), Z = /* @__PURE__ */ ((e) => (e.large = "large", e.medium = "medium", e))(Z || {});
|
|
18
18
|
const j = {
|
|
19
19
|
variant: "normal",
|
|
@@ -7,7 +7,7 @@ import v from "../../Button/Button.js";
|
|
|
7
7
|
import { Icon as x } from "../../Icon/Icon.js";
|
|
8
8
|
import E from "../../Icons/ChevronDown.js";
|
|
9
9
|
import I from "../../Icons/ChevronUp.js";
|
|
10
|
-
import a from "
|
|
10
|
+
import a from "../../NotificationPanel/DetailButton/styles.module.scss";
|
|
11
11
|
const T = ({ content: i, buttonText: r, buttonClosedText: s, expanderOpenFromStart: c }) => {
|
|
12
12
|
const [t, l] = f(c), o = t ? r : s, m = u(), p = b({
|
|
13
13
|
label: o,
|
|
@@ -12,7 +12,7 @@ import D from "../Icons/CheckFill.js";
|
|
|
12
12
|
import M from "../Icons/ErrorSignFill.js";
|
|
13
13
|
import O from "../Icons/InfoSignFill.js";
|
|
14
14
|
import U from "../Icons/TriangleX.js";
|
|
15
|
-
import e from "
|
|
15
|
+
import e from "../NotificationPanel/styles.module.scss";
|
|
16
16
|
const V = ({ fluid: s, children: m }) => {
|
|
17
17
|
if (s) {
|
|
18
18
|
const l = c(e["fluid-wrapper"]);
|
|
@@ -16,7 +16,7 @@ import _e from "../Icons/ChevronUp.js";
|
|
|
16
16
|
import Ee from "../Icons/Pencil.js";
|
|
17
17
|
import fe from "../Icons/Watch.js";
|
|
18
18
|
import ye from "../Title/Title.js";
|
|
19
|
-
import e from "
|
|
19
|
+
import e from "../Panel/styles.module.scss";
|
|
20
20
|
var ve = /* @__PURE__ */ ((a) => (a.normal = "normal", a.new = "new", a.error = "error", a.draft = "draft", a))(ve || {}), be = /* @__PURE__ */ ((a) => (a.fill = "fill", a.white = "white", a.stroke = "stroke", a.line = "line", a))(be || {}), Ce = /* @__PURE__ */ ((a) => (a.layout1 = "layout1", a.layout2 = "layout2", a.layout3a = "layout3a", a.layout3b = "layout3b", a.layout3c = "layout3c", a))(Ce || {});
|
|
21
21
|
const S = ({ status: a, statusMessage: n }) => {
|
|
22
22
|
const m = () => a === "error" ? { color: W.cherry500, svgIcon: me } : { color: W.black, svgIcon: Ee }, s = r(e["status-message"], {
|
|
@@ -2,7 +2,7 @@ import t from "react";
|
|
|
2
2
|
import c from "classnames";
|
|
3
3
|
import { AnalyticsId as p } from "../../constants.js";
|
|
4
4
|
import f, { PanelVariant as o } from "../Panel/Panel.js";
|
|
5
|
-
import P from "
|
|
5
|
+
import P from "../PanelList/styles.module.scss";
|
|
6
6
|
const u = (a) => t.isValidElement(a) && a.type === f, y = t.forwardRef(function(s, l) {
|
|
7
7
|
const { testId: i, children: m, variant: n = o.fill } = s, d = (e, r) => t.cloneElement(e, {
|
|
8
8
|
variant: n,
|