@helsenorge/designsystem-react 9.5.0 → 9.7.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 +48 -3
- package/Label.js +5 -3
- package/Label.js.map +1 -1
- package/ListHeader.js +2 -4
- package/ListHeader.js.map +1 -1
- package/TabList.js +74 -21
- package/TabList.js.map +1 -1
- package/components/Dropdown/index.js +1 -1
- package/components/Dropdown/index.js.map +1 -1
- package/components/ExpanderList/index.js +3 -3
- package/components/ExpanderList/index.js.map +1 -1
- package/components/ExpanderList/styles.module.scss +1 -6
- package/components/Label/Label.d.ts +1 -1
- package/components/ListHeader/styles.module.scss +1 -1
- package/components/Modal/styles.module.scss +26 -0
- package/components/StickyNote/StickyNote.d.ts +25 -0
- package/components/StickyNote/StickyNote.test.d.ts +1 -0
- package/components/StickyNote/Triangle.d.ts +9 -0
- package/components/StickyNote/index.d.ts +3 -0
- package/components/StickyNote/index.js +142 -0
- package/components/StickyNote/index.js.map +1 -0
- package/components/StickyNote/styles.module.scss +101 -0
- package/components/StickyNote/styles.module.scss.d.ts +19 -0
- package/components/Tabs/TabList/TabChevron.d.ts +9 -0
- package/components/Tabs/TabList/TabList.d.ts +2 -0
- package/components/Tabs/TabList/styles.module.scss +29 -5
- package/components/Tabs/TabList/styles.module.scss.d.ts +3 -0
- package/components/Tabs/TabPanel/styles.module.scss +2 -2
- package/components/Tabs/Tabs.d.ts +4 -0
- package/components/Tabs/index.js +15 -2
- package/components/Tabs/index.js.map +1 -1
- package/components/Validation/index.js +2 -1
- package/components/Validation/index.js.map +1 -1
- package/constants.d.ts +0 -1
- package/constants.js +0 -1
- package/constants.js.map +1 -1
- package/package.json +1 -1
|
@@ -267,12 +267,7 @@
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
&--padding {
|
|
270
|
-
padding: getSpacer(
|
|
271
|
-
|
|
272
|
-
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
273
|
-
padding-left: getSpacer(2xs);
|
|
274
|
-
padding-right: getSpacer(2xs);
|
|
275
|
-
}
|
|
270
|
+
padding: getSpacer(xs) getSpacer(s) getSpacer(l);
|
|
276
271
|
}
|
|
277
272
|
}
|
|
278
273
|
}
|
|
@@ -24,7 +24,7 @@ export interface LabelProps {
|
|
|
24
24
|
/** Id som plasseres på <label/> */
|
|
25
25
|
labelId?: string;
|
|
26
26
|
/** Array of main label strings. Can be of type semibold or normal */
|
|
27
|
-
labelTexts
|
|
27
|
+
labelTexts?: LabelText[];
|
|
28
28
|
/** Array of sublabel strings. Can be of type semibold or normal */
|
|
29
29
|
onColor?: keyof typeof FormOnColor;
|
|
30
30
|
/** StatusDot placed underneath the last sublabel */
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
justify-content: center;
|
|
12
12
|
position: fixed;
|
|
13
13
|
inset: 0;
|
|
14
|
+
container-type: inline-size;
|
|
14
15
|
|
|
15
16
|
@media print {
|
|
16
17
|
position: absolute;
|
|
@@ -90,6 +91,10 @@
|
|
|
90
91
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
91
92
|
width: 696px;
|
|
92
93
|
}
|
|
94
|
+
|
|
95
|
+
@container (max-width: 319px) {
|
|
96
|
+
padding-bottom: getSpacer(2xs);
|
|
97
|
+
}
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
&--medium {
|
|
@@ -126,6 +131,7 @@
|
|
|
126
131
|
transition: opacity 0.5s;
|
|
127
132
|
opacity: 0;
|
|
128
133
|
z-index: 2;
|
|
134
|
+
pointer-events: none;
|
|
129
135
|
}
|
|
130
136
|
|
|
131
137
|
&__shadow--top {
|
|
@@ -169,6 +175,10 @@
|
|
|
169
175
|
max-height: none;
|
|
170
176
|
}
|
|
171
177
|
|
|
178
|
+
@container (max-width: 319px) {
|
|
179
|
+
max-height: calc(100dvh - 4rem);
|
|
180
|
+
}
|
|
181
|
+
|
|
172
182
|
&--image {
|
|
173
183
|
max-height: 100vh;
|
|
174
184
|
}
|
|
@@ -180,6 +190,10 @@
|
|
|
180
190
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
181
191
|
padding: getSpacer(xl) getSpacer(xl) getSpacer(2xs);
|
|
182
192
|
}
|
|
193
|
+
|
|
194
|
+
@container (max-width: 319px) {
|
|
195
|
+
padding: getSpacer(2xs) getSpacer(2xs) getSpacer(4xs);
|
|
196
|
+
}
|
|
183
197
|
}
|
|
184
198
|
|
|
185
199
|
&--medium {
|
|
@@ -188,6 +202,10 @@
|
|
|
188
202
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
189
203
|
padding: getSpacer(xl) getSpacer(m) getSpacer(2xs);
|
|
190
204
|
}
|
|
205
|
+
|
|
206
|
+
@container (max-width: 319px) {
|
|
207
|
+
padding: getSpacer(2xs) getSpacer(3xs) getSpacer(4xs);
|
|
208
|
+
}
|
|
191
209
|
}
|
|
192
210
|
&--large#{&}--image {
|
|
193
211
|
padding: getSpacer(xl) getSpacer(2xs) getSpacer(l);
|
|
@@ -239,10 +257,18 @@
|
|
|
239
257
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
240
258
|
padding: getSpacer(l) getSpacer(xl) 0;
|
|
241
259
|
}
|
|
260
|
+
|
|
261
|
+
@container (max-width: 319px) {
|
|
262
|
+
padding: getSpacer(2xs) getSpacer(2xs) 0;
|
|
263
|
+
}
|
|
242
264
|
}
|
|
243
265
|
|
|
244
266
|
&--medium {
|
|
245
267
|
padding: getSpacer(m) getSpacer(m) 0;
|
|
268
|
+
|
|
269
|
+
@container (max-width: 319px) {
|
|
270
|
+
padding: getSpacer(2xs) getSpacer(2xs) 0;
|
|
271
|
+
}
|
|
246
272
|
}
|
|
247
273
|
}
|
|
248
274
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface StickyNoteProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
/** Aria label for the delete/close button */
|
|
4
|
+
arialabelXButton: string;
|
|
5
|
+
/** Activates the error styling */
|
|
6
|
+
error?: boolean;
|
|
7
|
+
/** Error text to show below the note */
|
|
8
|
+
errorText?: string;
|
|
9
|
+
/** Error text id */
|
|
10
|
+
errorTextId?: string;
|
|
11
|
+
/** Text shown under the textarea */
|
|
12
|
+
footerText?: string;
|
|
13
|
+
/** Function run when clicking the delete/close button */
|
|
14
|
+
onXButtonClick?: () => void;
|
|
15
|
+
/** Function run if user clicks the component while it is disabled */
|
|
16
|
+
onClickWhileDisabled?: () => void;
|
|
17
|
+
/** Sets the data-testid attribute. */
|
|
18
|
+
testId?: string;
|
|
19
|
+
/** Timestamp shown over the textarea */
|
|
20
|
+
timestamp: string;
|
|
21
|
+
/** Classname for the outer wrapper */
|
|
22
|
+
wrapperClassName?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const StickyNote: React.FC<StickyNoteProps>;
|
|
25
|
+
export default StickyNote;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { useHover } from "../../hooks/useHover.js";
|
|
5
|
+
import { usePseudoClasses } from "../../hooks/usePseudoClasses.js";
|
|
6
|
+
import { I as Icon } from "../../Icon.js";
|
|
7
|
+
import { IconSize } from "../../constants.js";
|
|
8
|
+
import { useUuid } from "../../hooks/useUuid.js";
|
|
9
|
+
import { getAriaDescribedBy } from "../../utils/accessibility.js";
|
|
10
|
+
import X from "../Icons/X.js";
|
|
11
|
+
import styles from "./styles.module.scss";
|
|
12
|
+
const Triangle = ({ type }) => {
|
|
13
|
+
const palette = (() => {
|
|
14
|
+
switch (type) {
|
|
15
|
+
case "active":
|
|
16
|
+
return {
|
|
17
|
+
border: "#C59302",
|
|
18
|
+
background: "#F5E080"
|
|
19
|
+
};
|
|
20
|
+
case "error":
|
|
21
|
+
return {
|
|
22
|
+
border: "#C83521",
|
|
23
|
+
background: "#EEC0A5"
|
|
24
|
+
};
|
|
25
|
+
default:
|
|
26
|
+
return {
|
|
27
|
+
border: "#F5E080",
|
|
28
|
+
background: "#F5E080"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
})();
|
|
32
|
+
return /* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("mask", { id: "path-1-inside-1_1_44", fill: "white", children: /* @__PURE__ */ jsx("path", { d: "M22 0L1.80043e-06 22L2.83099e-06 -8.97354e-07L22 0Z" }) }),
|
|
34
|
+
/* @__PURE__ */ jsx("path", { d: "M22 0L1.80043e-06 22L2.83099e-06 -8.97354e-07L22 0Z", fill: palette.background }),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
"path",
|
|
37
|
+
{
|
|
38
|
+
d: "M22 0L22.7071 0.707107L24.4142 -1L22 -1L22 0ZM1.80043e-06 22L-0.999998 22L-0.999998 24.4142L0.707109 22.7071L1.80043e-06 22ZM2.83099e-06 -8.97354e-07L2.87783e-06 -1L-0.999997 -1L-0.999997 -9.38143e-07L2.83099e-06 -8.97354e-07ZM21.2929 -0.707107L-0.707105 21.2929L0.707109 22.7071L22.7071 0.707107L21.2929 -0.707107ZM1 22L1 -8.56565e-07L-0.999997 -9.38143e-07L-0.999998 22L1 22ZM2.78414e-06 0.999999L22 1L22 -1L2.87783e-06 -1L2.78414e-06 0.999999Z",
|
|
39
|
+
fill: palette.border,
|
|
40
|
+
mask: "url(#path-1-inside-1_1_44)"
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] });
|
|
44
|
+
};
|
|
45
|
+
const StickyNote = (props) => {
|
|
46
|
+
const {
|
|
47
|
+
wrapperClassName,
|
|
48
|
+
timestamp,
|
|
49
|
+
onXButtonClick,
|
|
50
|
+
arialabelXButton,
|
|
51
|
+
footerText,
|
|
52
|
+
error,
|
|
53
|
+
errorText,
|
|
54
|
+
errorTextId,
|
|
55
|
+
onClickWhileDisabled,
|
|
56
|
+
testId,
|
|
57
|
+
...textareaProps
|
|
58
|
+
} = props;
|
|
59
|
+
const errorTextUuid = useUuid(errorTextId);
|
|
60
|
+
const stickynoteRef = useRef(null);
|
|
61
|
+
const textareaRef = useRef(null);
|
|
62
|
+
const { isFocused: isTextareaFocused } = usePseudoClasses(textareaRef);
|
|
63
|
+
const { isHovered } = useHover(stickynoteRef);
|
|
64
|
+
const triangleType = error ? "error" : isTextareaFocused ? "active" : "default";
|
|
65
|
+
const handleWrapperClick = (event) => {
|
|
66
|
+
var _a;
|
|
67
|
+
if (event.target.closest("button")) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (textareaProps.disabled) {
|
|
71
|
+
onClickWhileDisabled && onClickWhileDisabled();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
(_a = textareaRef.current) == null ? void 0 : _a.focus();
|
|
75
|
+
};
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
textareaRef && textareaRef.current && resizeTextarea(textareaRef.current);
|
|
78
|
+
}, []);
|
|
79
|
+
const resizeTextarea = (target) => {
|
|
80
|
+
target.style.height = "inherit";
|
|
81
|
+
target.style.height = `${target.scrollHeight}px`;
|
|
82
|
+
};
|
|
83
|
+
const handleChange = (e) => {
|
|
84
|
+
const textarea = e.target;
|
|
85
|
+
resizeTextarea(textarea);
|
|
86
|
+
textareaProps.onChange && textareaProps.onChange(e);
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
89
|
+
/* @__PURE__ */ jsxs(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
"data-testid": testId,
|
|
93
|
+
ref: stickynoteRef,
|
|
94
|
+
className: classNames(styles["sticky-note"], wrapperClassName, {
|
|
95
|
+
[styles["sticky-note--focused"]]: isTextareaFocused,
|
|
96
|
+
[styles["sticky-note--hovered"]]: isHovered && !isTextareaFocused && !textareaProps.disabled,
|
|
97
|
+
[styles["sticky-note--error"]]: error
|
|
98
|
+
}),
|
|
99
|
+
onClick: handleWrapperClick,
|
|
100
|
+
role: "textbox",
|
|
101
|
+
tabIndex: -1,
|
|
102
|
+
onKeyDown: (e) => {
|
|
103
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
104
|
+
handleWrapperClick(e);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx("div", { className: classNames(styles["sticky-note__header"]), children: timestamp && /* @__PURE__ */ jsx("span", { className: styles["sticky-note__header__timestamp"], children: timestamp }) }),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
"textarea",
|
|
111
|
+
{
|
|
112
|
+
ref: textareaRef,
|
|
113
|
+
"data-testid": `${testId}-textarea`,
|
|
114
|
+
className: classNames(styles["sticky-note__textarea"], textareaProps.className),
|
|
115
|
+
...textareaProps,
|
|
116
|
+
onChange: handleChange,
|
|
117
|
+
"aria-describedby": getAriaDescribedBy(props, errorTextUuid)
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
"button",
|
|
122
|
+
{
|
|
123
|
+
onClick: onXButtonClick,
|
|
124
|
+
"aria-label": arialabelXButton,
|
|
125
|
+
"data-testid": "closeButton",
|
|
126
|
+
className: classNames(styles["sticky-note__x-button"]),
|
|
127
|
+
type: "button",
|
|
128
|
+
children: /* @__PURE__ */ jsx(Icon, { svgIcon: X, color: "black", size: IconSize.XXSmall })
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ jsx("div", { className: classNames(styles["sticky-note__footer"]), children: footerText && /* @__PURE__ */ jsx("span", { children: footerText }) }),
|
|
132
|
+
/* @__PURE__ */ jsx("div", { className: classNames(styles["sticky-note__triangle"]), children: /* @__PURE__ */ jsx(Triangle, { type: triangleType }) })
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
error && /* @__PURE__ */ jsx("p", { className: styles["sticky-note__error-text"], id: errorTextId, children: errorText })
|
|
137
|
+
] });
|
|
138
|
+
};
|
|
139
|
+
export {
|
|
140
|
+
StickyNote as default
|
|
141
|
+
};
|
|
142
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/StickyNote/Triangle.tsx","../../../src/components/StickyNote/StickyNote.tsx"],"sourcesContent":["interface TriangleProps {\n type: 'default' | 'active' | 'error';\n}\n\nexport interface Palette {\n border: string;\n background: string;\n}\n\nconst Triangle: React.FC<TriangleProps> = ({ type }) => {\n const palette = ((): Palette => {\n switch (type) {\n case 'active':\n return {\n border: '#C59302',\n background: '#F5E080',\n };\n case 'error':\n return {\n border: '#C83521',\n background: '#EEC0A5',\n };\n default:\n return {\n border: '#F5E080',\n background: '#F5E080',\n };\n }\n })();\n return (\n <svg width=\"22\" height=\"22\" viewBox=\"0 0 22 22\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <mask id=\"path-1-inside-1_1_44\" fill=\"white\">\n <path d=\"M22 0L1.80043e-06 22L2.83099e-06 -8.97354e-07L22 0Z\" />\n </mask>\n <path d=\"M22 0L1.80043e-06 22L2.83099e-06 -8.97354e-07L22 0Z\" fill={palette.background} />\n <path\n d=\"M22 0L22.7071 0.707107L24.4142 -1L22 -1L22 0ZM1.80043e-06 22L-0.999998 22L-0.999998 24.4142L0.707109 22.7071L1.80043e-06 22ZM2.83099e-06 -8.97354e-07L2.87783e-06 -1L-0.999997 -1L-0.999997 -9.38143e-07L2.83099e-06 -8.97354e-07ZM21.2929 -0.707107L-0.707105 21.2929L0.707109 22.7071L22.7071 0.707107L21.2929 -0.707107ZM1 22L1 -8.56565e-07L-0.999997 -9.38143e-07L-0.999998 22L1 22ZM2.78414e-06 0.999999L22 1L22 -1L2.87783e-06 -1L2.78414e-06 0.999999Z\"\n fill={palette.border}\n mask=\"url(#path-1-inside-1_1_44)\"\n />\n </svg>\n );\n};\n\nexport default Triangle;\n","import React, { useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useHover } from '../../hooks/useHover';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport Icon, { IconSize } from '../Icon';\nimport Triangle from './Triangle';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport X from '../Icons/X';\n\nimport styles from './styles.module.scss';\n\nexport interface StickyNoteProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Aria label for the delete/close button */\n arialabelXButton: string;\n /** Activates the error styling */\n error?: boolean;\n /** Error text to show below the note */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Text shown under the textarea */\n footerText?: string;\n /** Function run when clicking the delete/close button */\n onXButtonClick?: () => void;\n /** Function run if user clicks the component while it is disabled */\n onClickWhileDisabled?: () => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Timestamp shown over the textarea */\n timestamp: string;\n /** Classname for the outer wrapper */\n wrapperClassName?: string;\n}\n\nconst StickyNote: React.FC<StickyNoteProps> = (props: StickyNoteProps) => {\n const {\n wrapperClassName,\n timestamp,\n onXButtonClick,\n arialabelXButton,\n footerText,\n error,\n errorText,\n errorTextId,\n onClickWhileDisabled,\n testId,\n ...textareaProps\n } = props;\n const errorTextUuid = useUuid(errorTextId);\n const stickynoteRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const { isFocused: isTextareaFocused } = usePseudoClasses<HTMLTextAreaElement>(textareaRef);\n const { isHovered } = useHover<HTMLDivElement>(stickynoteRef);\n const triangleType = error ? 'error' : isTextareaFocused ? 'active' : 'default';\n\n const handleWrapperClick = (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>): void => {\n if ((event.target as HTMLElement).closest('button')) {\n return;\n }\n if (textareaProps.disabled) {\n onClickWhileDisabled && onClickWhileDisabled();\n return;\n }\n textareaRef.current?.focus();\n };\n\n useEffect(() => {\n // Resize textarea to fit default value\n textareaRef && textareaRef.current && resizeTextarea(textareaRef.current);\n }, []);\n\n const resizeTextarea = (target: HTMLTextAreaElement): void => {\n // Reset field height\n target.style.height = 'inherit';\n // Set new height\n target.style.height = `${target.scrollHeight}px`;\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\n const textarea = e.target as HTMLTextAreaElement;\n resizeTextarea(textarea);\n textareaProps.onChange && textareaProps.onChange(e);\n };\n\n return (\n <div>\n <div\n data-testid={testId}\n ref={stickynoteRef}\n className={classNames(styles['sticky-note'], wrapperClassName, {\n [styles['sticky-note--focused']]: isTextareaFocused,\n [styles['sticky-note--hovered']]: isHovered && !isTextareaFocused && !textareaProps.disabled,\n [styles['sticky-note--error']]: error,\n })}\n onClick={handleWrapperClick}\n role=\"textbox\"\n tabIndex={-1}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n handleWrapperClick(e as React.KeyboardEvent<HTMLDivElement>);\n }\n }}\n >\n <div className={classNames(styles['sticky-note__header'])}>\n {timestamp && <span className={styles['sticky-note__header__timestamp']}>{timestamp}</span>}\n </div>\n <textarea\n ref={textareaRef}\n data-testid={`${testId}-textarea`}\n className={classNames(styles['sticky-note__textarea'], textareaProps.className)}\n {...textareaProps}\n onChange={handleChange}\n aria-describedby={getAriaDescribedBy(props, errorTextUuid)}\n />\n <button\n onClick={onXButtonClick}\n aria-label={arialabelXButton}\n data-testid=\"closeButton\"\n className={classNames(styles['sticky-note__x-button'])}\n type=\"button\"\n >\n <Icon svgIcon={X} color=\"black\" size={IconSize.XXSmall} />\n </button>\n <div className={classNames(styles['sticky-note__footer'])}>{footerText && <span>{footerText}</span>}</div>\n <div className={classNames(styles['sticky-note__triangle'])}>\n <Triangle type={triangleType} />\n </div>\n </div>\n {error && (\n <p className={styles['sticky-note__error-text']} id={errorTextId}>\n {errorText}\n </p>\n )}\n </div>\n );\n};\n\nexport default StickyNote;\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
@use '../../scss/supernova/styles/colors' as *;
|
|
2
|
+
@use '../../scss/font-settings' as fonts;
|
|
3
|
+
|
|
4
|
+
.sticky-note {
|
|
5
|
+
position: relative;
|
|
6
|
+
background-color: var(--core-color-banana-50);
|
|
7
|
+
width: 100%;
|
|
8
|
+
border: var(--core-color-banana-300) 1px solid;
|
|
9
|
+
padding: 12px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
|
|
12
|
+
|
|
13
|
+
&--focused {
|
|
14
|
+
background-color: var(--core-color-banana-50);
|
|
15
|
+
border-color: var(--core-color-banana-600);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--hovered {
|
|
19
|
+
background-color: var(--core-color-banana-100);
|
|
20
|
+
border: var(--core-color-banana-100) 1px solid;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--error {
|
|
24
|
+
background-color: var(--core-color-cherry-50);
|
|
25
|
+
border: var(--core-color-cherry-300) 1px solid;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__x-button {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
background-color: transparent;
|
|
31
|
+
color: var(--color-base-text-onlight);
|
|
32
|
+
border: 0;
|
|
33
|
+
width: 2.75rem;
|
|
34
|
+
height: 2.75rem;
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
align-items: center;
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 2px;
|
|
40
|
+
right: 2px;
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
background-color: var(--core-color-banana-200); // todo: bestem farge her
|
|
44
|
+
outline: 1px solid var(--core-color-banana-500); // todo: bestem farge her
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:focus-visible {
|
|
48
|
+
background-color: var(--color-action-background-transparent-onlight-hoverselected);
|
|
49
|
+
outline: 2px solid var(--color-action-border-onlight-focus);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&__header {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-flow: row nowrap;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
align-items: center;
|
|
58
|
+
|
|
59
|
+
&__timestamp {
|
|
60
|
+
color: var(--color-placeholder-text-onlight);
|
|
61
|
+
font-size: 1rem;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__textarea {
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
border: none;
|
|
69
|
+
resize: none;
|
|
70
|
+
background: transparent;
|
|
71
|
+
outline: none;
|
|
72
|
+
line-height: 28px;
|
|
73
|
+
|
|
74
|
+
&:disabled {
|
|
75
|
+
// Dette er for å unngå at disabled tekst ikke validerer på iOS
|
|
76
|
+
-webkit-text-fill-color: var(--color-base-text-onlight);
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&__footer {
|
|
82
|
+
color: var(--color-placeholder-text-onlight);
|
|
83
|
+
font-size: 0.75rem;
|
|
84
|
+
font-style: italic;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&__triangle {
|
|
88
|
+
position: absolute;
|
|
89
|
+
bottom: -2px;
|
|
90
|
+
right: -2px;
|
|
91
|
+
width: 22px;
|
|
92
|
+
height: 22px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__error-text {
|
|
96
|
+
color: var(--color-notification-status-error);
|
|
97
|
+
line-height: 1.875rem;
|
|
98
|
+
font-size: fonts.$font-size-sm;
|
|
99
|
+
margin-top: 0.75rem;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
'sticky-note': string;
|
|
3
|
+
'sticky-note__error-text': string;
|
|
4
|
+
'sticky-note__footer': string;
|
|
5
|
+
'sticky-note__header': string;
|
|
6
|
+
'sticky-note__header__timestamp': string;
|
|
7
|
+
'sticky-note__textarea': string;
|
|
8
|
+
'sticky-note__triangle': string;
|
|
9
|
+
'sticky-note__x-button': string;
|
|
10
|
+
'sticky-note--error': string;
|
|
11
|
+
'sticky-note--focused': string;
|
|
12
|
+
'sticky-note--hovered': string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type ClassNames = keyof Styles;
|
|
16
|
+
|
|
17
|
+
declare const styles: Styles;
|
|
18
|
+
|
|
19
|
+
export default styles;
|
|
@@ -108,22 +108,46 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
&
|
|
112
|
-
&
|
|
111
|
+
&__end-wrapper,
|
|
112
|
+
&__start-wrapper {
|
|
113
|
+
display: flex;
|
|
113
114
|
position: absolute;
|
|
114
115
|
top: 0;
|
|
116
|
+
z-index: 10;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&__start-wrapper {
|
|
120
|
+
left: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&__end-wrapper {
|
|
124
|
+
right: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&__button {
|
|
128
|
+
border: none;
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-wrap: wrap;
|
|
131
|
+
align-items: center;
|
|
132
|
+
|
|
133
|
+
&:focus-visible {
|
|
134
|
+
outline: 4px solid var(--color-action-border-onlight-focus);
|
|
135
|
+
outline-offset: -4px;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&__fade-start,
|
|
140
|
+
&__fade-end {
|
|
115
141
|
width: 15px;
|
|
116
142
|
height: 47px;
|
|
117
|
-
|
|
143
|
+
pointer-events: none;
|
|
118
144
|
}
|
|
119
145
|
|
|
120
146
|
&__fade-start {
|
|
121
|
-
left: 0;
|
|
122
147
|
mask-image: linear-gradient(to right, #000f, #0000);
|
|
123
148
|
}
|
|
124
149
|
|
|
125
150
|
&__fade-end {
|
|
126
|
-
right: 0;
|
|
127
151
|
mask-image: linear-gradient(to left, #000f, #0000);
|
|
128
152
|
}
|
|
129
153
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export type Styles = {
|
|
2
2
|
'tab-list': string;
|
|
3
3
|
'tab-list__border': string;
|
|
4
|
+
'tab-list__button': string;
|
|
5
|
+
'tab-list__end-wrapper': string;
|
|
4
6
|
'tab-list__fade-end': string;
|
|
5
7
|
'tab-list__fade-start': string;
|
|
8
|
+
'tab-list__start-wrapper': string;
|
|
6
9
|
'tab-list__tab': string;
|
|
7
10
|
'tab-list__tab__title-and-icon': string;
|
|
8
11
|
'tab-list__tab--blueberry': string;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
$tab-panel: &;
|
|
10
10
|
$colors: 'blueberry', 'neutral', 'white';
|
|
11
11
|
|
|
12
|
-
padding: getSpacer(
|
|
12
|
+
padding: getSpacer(l) getSpacer(s) getSpacer(xl);
|
|
13
13
|
width: 100%;
|
|
14
14
|
border-bottom: 1px solid var(--color-action-border-onlight-focus);
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
border-radius: 0 0 0.5rem 0.5rem;
|
|
24
24
|
border: 1px solid var(--color-action-border-onlight-focus);
|
|
25
25
|
border-top: 0;
|
|
26
|
-
padding: getSpacer(
|
|
26
|
+
padding: getSpacer(xl) getSpacer(m) getSpacer(2xl);
|
|
27
27
|
|
|
28
28
|
&#{$tab-panel}--first {
|
|
29
29
|
border-radius: 0;
|
|
@@ -23,6 +23,10 @@ export interface TabsProps {
|
|
|
23
23
|
touchBehaviour?: TabsTouchBehaviour;
|
|
24
24
|
/** Sets the data-testid attribute. */
|
|
25
25
|
testId?: string;
|
|
26
|
+
/** Sets aria label on the "scroll to the right" button in TabList */
|
|
27
|
+
ariaLabelRightButton?: string;
|
|
28
|
+
/** Sets aria label on the "scroll to the left" button in TabList */
|
|
29
|
+
ariaLabelLeftButton?: string;
|
|
26
30
|
}
|
|
27
31
|
declare const TabsRoot: React.FC<TabsProps>;
|
|
28
32
|
type TabsComponent = typeof TabsRoot & {
|
package/components/Tabs/index.js
CHANGED
|
@@ -13,7 +13,9 @@ const TabsRoot = ({
|
|
|
13
13
|
containerBreakout = true,
|
|
14
14
|
onColor = "onwhite",
|
|
15
15
|
sticky = true,
|
|
16
|
-
testId
|
|
16
|
+
testId,
|
|
17
|
+
ariaLabelRightButton,
|
|
18
|
+
ariaLabelLeftButton
|
|
17
19
|
}) => {
|
|
18
20
|
const isControlled = activeTab !== void 0;
|
|
19
21
|
const [uncontrolledValue, setUncontrolledValue] = useState(0);
|
|
@@ -39,7 +41,18 @@ const TabsRoot = ({
|
|
|
39
41
|
[styles["tab-list-wrapper--sticky"]]: sticky
|
|
40
42
|
}),
|
|
41
43
|
children: [
|
|
42
|
-
/* @__PURE__ */ jsx(
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
TabList,
|
|
46
|
+
{
|
|
47
|
+
onTabListClick: (index) => onValueChange(index),
|
|
48
|
+
selectedTab: activeTabIndex,
|
|
49
|
+
color,
|
|
50
|
+
onColor: onColorUsed,
|
|
51
|
+
ariaLabelLeftButton,
|
|
52
|
+
ariaLabelRightButton,
|
|
53
|
+
children
|
|
54
|
+
}
|
|
55
|
+
),
|
|
43
56
|
/* @__PURE__ */ jsx("div", { className: classNames(styles["panel-wrapper"], styles[`panel-wrapper--${color}`]) })
|
|
44
57
|
]
|
|
45
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Tab from './Tab';\nimport TabList from './TabList';\nimport TabPanel from './TabPanel';\nimport designsystemlayout from '../../scss/layout.module.scss';\nimport { PaletteNames } from '../../theme/palette';\n\nimport styles from './styles.module.scss';\n\nexport type { TabProps } from './Tab';\nexport type TabsColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'white'>;\nexport type TabsOnColor = 'onblueberry' | 'onneutral' | 'onwhite';\nexport type TabsTouchBehaviour = 'swipe' | 'none';\n\nexport interface TabsProps {\n children?: React.ReactNode;\n /** Controlled state for Tabs component */\n activeTab?: number;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the color of the tabs. Default: white */\n color?: TabsColors;\n /** Sets wether the component should use the container-breakout class. Default: true */\n containerBreakout?: boolean;\n /** Sets the background color of the tabs. Can only be used when the color is set to white. Default: onwhite */\n onColor?: TabsOnColor;\n /** Whether the tab list should be sticky */\n sticky?: boolean;\n /** Determines how Tabs respons to touch events. */\n touchBehaviour?: TabsTouchBehaviour;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst TabsRoot: React.FC<TabsProps> = ({\n activeTab,\n children,\n className,\n color = 'white',\n containerBreakout = true,\n onColor = 'onwhite',\n sticky = true,\n testId,\n}) => {\n const isControlled = activeTab !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(0);\n const tabsRef = useRef<HTMLDivElement>(null);\n const tabPanelRef = useRef<HTMLDivElement>(null);\n const tabListRef = useRef<HTMLDivElement>(null);\n\n let onColorUsed: TabsOnColor = 'onwhite';\n if (color === 'white') {\n onColorUsed = onColor;\n }\n\n const onValueChange = (newValue: number): void => {\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n };\n\n const activeTabIndex = isControlled ? activeTab : uncontrolledValue;\n\n return (\n <div className={classNames(className, containerBreakout && designsystemlayout['container-breakout'])} data-testid={testId}>\n <div\n ref={tabListRef}\n className={classNames(styles['tab-list-wrapper'], {\n [styles['tab-list-wrapper--sticky']]: sticky,\n })}\n >\n <TabList
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Tab from './Tab';\nimport TabList from './TabList';\nimport TabPanel from './TabPanel';\nimport designsystemlayout from '../../scss/layout.module.scss';\nimport { PaletteNames } from '../../theme/palette';\n\nimport styles from './styles.module.scss';\n\nexport type { TabProps } from './Tab';\nexport type TabsColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'white'>;\nexport type TabsOnColor = 'onblueberry' | 'onneutral' | 'onwhite';\nexport type TabsTouchBehaviour = 'swipe' | 'none';\n\nexport interface TabsProps {\n children?: React.ReactNode;\n /** Controlled state for Tabs component */\n activeTab?: number;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the color of the tabs. Default: white */\n color?: TabsColors;\n /** Sets wether the component should use the container-breakout class. Default: true */\n containerBreakout?: boolean;\n /** Sets the background color of the tabs. Can only be used when the color is set to white. Default: onwhite */\n onColor?: TabsOnColor;\n /** Whether the tab list should be sticky */\n sticky?: boolean;\n /** Determines how Tabs respons to touch events. */\n touchBehaviour?: TabsTouchBehaviour;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets aria label on the \"scroll to the right\" button in TabList */\n ariaLabelRightButton?: string;\n /** Sets aria label on the \"scroll to the left\" button in TabList */\n ariaLabelLeftButton?: string;\n}\n\nconst TabsRoot: React.FC<TabsProps> = ({\n activeTab,\n children,\n className,\n color = 'white',\n containerBreakout = true,\n onColor = 'onwhite',\n sticky = true,\n testId,\n ariaLabelRightButton,\n ariaLabelLeftButton,\n}) => {\n const isControlled = activeTab !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(0);\n const tabsRef = useRef<HTMLDivElement>(null);\n const tabPanelRef = useRef<HTMLDivElement>(null);\n const tabListRef = useRef<HTMLDivElement>(null);\n\n let onColorUsed: TabsOnColor = 'onwhite';\n if (color === 'white') {\n onColorUsed = onColor;\n }\n\n const onValueChange = (newValue: number): void => {\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n };\n\n const activeTabIndex = isControlled ? activeTab : uncontrolledValue;\n\n return (\n <div className={classNames(className, containerBreakout && designsystemlayout['container-breakout'])} data-testid={testId}>\n <div\n ref={tabListRef}\n className={classNames(styles['tab-list-wrapper'], {\n [styles['tab-list-wrapper--sticky']]: sticky,\n })}\n >\n <TabList\n onTabListClick={(index: number) => onValueChange(index)}\n selectedTab={activeTabIndex}\n color={color}\n onColor={onColorUsed}\n ariaLabelLeftButton={ariaLabelLeftButton}\n ariaLabelRightButton={ariaLabelRightButton}\n >\n {children}\n </TabList>\n <div className={classNames(styles['panel-wrapper'], styles[`panel-wrapper--${color}`])}></div>\n </div>\n <div ref={tabsRef} style={{ marginTop: '-50px' }}>\n <TabPanel ref={tabPanelRef} color={color} isFirst={activeTabIndex == 0}>\n {React.Children.toArray(children)[activeTabIndex]}\n </TabPanel>\n </div>\n </div>\n );\n};\n\ntype TabsComponent = typeof TabsRoot & {\n Tab: typeof Tab;\n};\nconst Tabs = TabsRoot as TabsComponent;\nTabs.displayName = 'Tabs';\nTabs.Tab = Tab;\nTabs.Tab.displayName = 'Tabs.Tab';\n\nexport default Tabs;\n"],"names":[],"mappings":";;;;;;;AAyCA,MAAM,WAAgC,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,cAAc;AACnC,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAS,CAAC;AACtD,QAAA,UAAU,OAAuB,IAAI;AACrC,QAAA,cAAc,OAAuB,IAAI;AACzC,QAAA,aAAa,OAAuB,IAAI;AAE9C,MAAI,cAA2B;AAC/B,MAAI,UAAU,SAAS;AACP,kBAAA;AAAA,EAAA;AAGV,QAAA,gBAAgB,CAAC,aAA2B;AAChD,QAAI,CAAC,cAAc;AACjB,2BAAqB,QAAQ;AAAA,IAAA;AAAA,EAEjC;AAEM,QAAA,iBAAiB,eAAe,YAAY;AAGhD,SAAA,qBAAC,OAAI,EAAA,WAAW,WAAW,WAAW,qBAAqB,mBAAmB,oBAAoB,CAAC,GAAG,eAAa,QACjH,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL,WAAW,WAAW,OAAO,kBAAkB,GAAG;AAAA,UAChD,CAAC,OAAO,0BAA0B,CAAC,GAAG;AAAA,QAAA,CACvC;AAAA,QAED,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,gBAAgB,CAAC,UAAkB,cAAc,KAAK;AAAA,cACtD,aAAa;AAAA,cACb;AAAA,cACA,SAAS;AAAA,cACT;AAAA,cACA;AAAA,cAEC;AAAA,YAAA;AAAA,UACH;AAAA,UACC,oBAAA,OAAA,EAAI,WAAW,WAAW,OAAO,eAAe,GAAG,OAAO,kBAAkB,KAAK,EAAE,CAAC,EAAG,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1F;AAAA,IACA,oBAAC,OAAI,EAAA,KAAK,SAAS,OAAO,EAAE,WAAW,QAAA,GACrC,UAAA,oBAAC,UAAS,EAAA,KAAK,aAAa,OAAc,SAAS,kBAAkB,GAClE,UAAM,MAAA,SAAS,QAAQ,QAAQ,EAAE,cAAc,EAClD,CAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;AAKA,MAAM,OAAO;AACb,KAAK,cAAc;AACnB,KAAK,MAAM;AACX,KAAK,IAAI,cAAc;"}
|
|
@@ -34,7 +34,8 @@ const ValidationSummary = (props) => {
|
|
|
34
34
|
return /* @__PURE__ */ jsxs(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
|
-
role: "
|
|
37
|
+
role: "status",
|
|
38
|
+
"aria-atomic": "true",
|
|
38
39
|
"aria-live": "polite",
|
|
39
40
|
"aria-relevant": "all",
|
|
40
41
|
"aria-labelledby": hasErrors && props.errorTitle ? titleId : void 0,
|