@helsenorge/designsystem-react 7.5.0 → 7.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 +25 -0
- package/components/Badge/Badge.d.ts +7 -1
- package/components/Badge/Badge.js +19 -9
- package/components/Badge/Badge.js.map +1 -1
- package/components/Badge/Badge.stories.d.ts +11 -0
- package/components/Badge/NotificationBadge.d.ts +17 -0
- package/components/Badge/NotificationBadge.js +68 -0
- package/components/Badge/NotificationBadge.js.map +1 -0
- package/components/ErrorWrapper/styles.module.scss +1 -0
- package/components/Expander/styles.module.scss +3 -2
- package/components/ExpanderList/styles.module.scss +6 -1
- package/components/LinkList/LinkList.stories.d.ts +1 -0
- package/components/ListHeader/ListHeader.d.ts +1 -1
- package/components/ListHeader/ListHeader.js +32 -28
- package/components/ListHeader/ListHeader.js.map +1 -1
- package/components/NotificationPanel/NotificationPanel.d.ts +4 -1
- package/components/NotificationPanel/NotificationPanel.js +65 -98
- package/components/NotificationPanel/NotificationPanel.js.map +1 -1
- package/components/NotificationPanel/NotificationPanel.stories.d.ts +6 -1
- package/components/NotificationPanel/styles.module.scss +14 -0
- package/components/NotificationPanel/styles.module.scss.d.ts +1 -0
- package/components/ServiceMessage/ServiceMessage.js +66 -75
- package/components/ServiceMessage/ServiceMessage.js.map +1 -1
- package/components/ServiceMessage/ServiceMessage.stories.d.ts +1 -1
- package/components/ServiceMessage/styles.module.scss +13 -0
- package/components/ServiceMessage/styles.module.scss.d.ts +1 -0
- package/package.json +1 -1
- package/components/NotificationPanel/DetailButton/DetailButton.d.ts +0 -9
- package/components/NotificationPanel/DetailButton/DetailButton.js +0 -28
- package/components/NotificationPanel/DetailButton/DetailButton.js.map +0 -1
- package/components/NotificationPanel/DetailButton/styles.module.scss +0 -38
- package/components/NotificationPanel/DetailButton/styles.module.scss.d.ts +0 -13
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import e, { useState as f } from "react";
|
|
2
|
-
import n from "classnames";
|
|
3
|
-
import { AnalyticsId as _ } from "../../../constants.js";
|
|
4
|
-
import { useUuid as u } from "../../../hooks/useUuid.js";
|
|
5
|
-
import { getAriaLabelAttributes as b } from "../../../utils/accessibility.js";
|
|
6
|
-
import v from "../../Button/Button.js";
|
|
7
|
-
import { Icon as x } from "../../Icon/Icon.js";
|
|
8
|
-
import E from "../../Icons/ChevronDown.js";
|
|
9
|
-
import I from "../../Icons/ChevronUp.js";
|
|
10
|
-
import a from "../../NotificationPanel/DetailButton/styles.module.scss";
|
|
11
|
-
const T = ({ content: i, buttonText: r, buttonClosedText: s, expanderOpenFromStart: c }) => {
|
|
12
|
-
const [t, l] = f(c), o = t ? r : s, m = u(), p = b({
|
|
13
|
-
label: o,
|
|
14
|
-
id: m,
|
|
15
|
-
prefer: "label"
|
|
16
|
-
}), d = {
|
|
17
|
-
onClick: () => l(!t),
|
|
18
|
-
variant: "borderless",
|
|
19
|
-
className: n(a["notification-panel__detail"], a["notification-panel__detail-button"]),
|
|
20
|
-
"aria-expanded": t,
|
|
21
|
-
...p
|
|
22
|
-
};
|
|
23
|
-
return /* @__PURE__ */ e.createElement("div", { className: a["notification-panel__detail-section"] }, /* @__PURE__ */ e.createElement("div", { className: a["notification-panel__detail-section__button--wrapper"] }, /* @__PURE__ */ e.createElement(v, { testId: "expand", "data-analyticsid": _.Expander, ...d }, o, /* @__PURE__ */ e.createElement(x, { svgIcon: t ? I : E }))), t && /* @__PURE__ */ e.createElement("div", { className: n(a["notification-panel__detail-section__content"]) }, i));
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
T as DetailButton
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=DetailButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DetailButton.js","sources":["../../../../src/components/NotificationPanel/DetailButton/DetailButton.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../../constants';\nimport { useUuid } from '../../../hooks/useUuid';\nimport { AriaLabelAttributes, getAriaLabelAttributes } from '../../../utils/accessibility';\nimport Button, { ButtonProps } from '../../Button';\nimport Icon from '../../Icon';\nimport ChevronDown from '../../Icons/ChevronDown';\nimport ChevronUp from '../../Icons/ChevronUp';\n\nimport styles from './styles.module.scss';\n\ntype Props = {\n content: React.ReactNode;\n buttonClosedText: string;\n buttonText: string;\n expanderOpenFromStart: boolean;\n};\nexport const DetailButton: React.FC<Props> = ({ content, buttonText, buttonClosedText, expanderOpenFromStart }: Props): JSX.Element => {\n const [isExpanded, setIsExpanded] = useState<boolean>(expanderOpenFromStart);\n const activeButtonText = isExpanded ? buttonText : buttonClosedText;\n\n const buttonTextId = useUuid();\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: activeButtonText,\n id: buttonTextId,\n prefer: 'label',\n });\n\n const commonProps: Partial<ButtonProps> & AriaLabelAttributes = {\n onClick: () => setIsExpanded(!isExpanded),\n variant: 'borderless',\n className: classNames(styles['notification-panel__detail'], styles['notification-panel__detail-button']),\n 'aria-expanded': isExpanded,\n ...ariaLabelAttributes,\n };\n\n return (\n <div className={styles['notification-panel__detail-section']}>\n <div className={styles['notification-panel__detail-section__button--wrapper']}>\n <Button testId=\"expand\" data-analyticsid={AnalyticsId.Expander} {...commonProps}>\n {activeButtonText}\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} />\n </Button>\n </div>\n {isExpanded && <div className={classNames(styles['notification-panel__detail-section__content'])}>{content}</div>}\n </div>\n );\n};\n"],"names":["DetailButton","content","buttonText","buttonClosedText","expanderOpenFromStart","isExpanded","setIsExpanded","useState","activeButtonText","buttonTextId","useUuid","ariaLabelAttributes","getAriaLabelAttributes","commonProps","classNames","styles","React","Button","AnalyticsId","Icon","ChevronUp","ChevronDown"],"mappings":";;;;;;;;;;AAoBO,MAAMA,IAAgC,CAAC,EAAE,SAAAC,GAAS,YAAAC,GAAY,kBAAAC,GAAkB,uBAAAC,QAAgD;AACrI,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAkBH,CAAqB,GACrEI,IAAmBH,IAAaH,IAAaC,GAE7CM,IAAeC,KAEfC,IAAsBC,EAAuB;AAAA,IACjD,OAAOJ;AAAA,IACP,IAAIC;AAAA,IACJ,QAAQ;AAAA,EAAA,CACT,GAEKI,IAA0D;AAAA,IAC9D,SAAS,MAAMP,EAAc,CAACD,CAAU;AAAA,IACxC,SAAS;AAAA,IACT,WAAWS,EAAWC,EAAO,4BAA4B,GAAGA,EAAO,mCAAmC,CAAC;AAAA,IACvG,iBAAiBV;AAAA,IACjB,GAAGM;AAAA,EAAA;AAGL,yCACG,OAAI,EAAA,WAAWI,EAAO,oCAAoC,EAAA,mCACxD,OAAI,EAAA,WAAWA,EAAO,qDAAqD,KACzEC,gBAAAA,EAAA,cAAAC,GAAA,EAAO,QAAO,UAAS,oBAAkBC,EAAY,UAAW,GAAGL,EACjE,GAAAL,mCACAW,GAAK,EAAA,SAASd,IAAae,IAAYC,EAAA,CAAa,CACvD,CACF,GACChB,KAAeW,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWF,EAAWC,EAAO,6CAA6C,CAAC,KAAId,CAAQ,CAC7G;AAEJ;"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@import '../../../scss/spacers';
|
|
2
|
-
@import '../../../scss/breakpoints';
|
|
3
|
-
@import '../../../scss/font-settings';
|
|
4
|
-
@import '../../../scss/palette';
|
|
5
|
-
|
|
6
|
-
.notification-panel__detail-section {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column-reverse;
|
|
9
|
-
|
|
10
|
-
&__button--wrapper {
|
|
11
|
-
padding: 0.375rem 0 0.625rem;
|
|
12
|
-
font-size: $font-size-xs;
|
|
13
|
-
line-height: $lineheight-size-xs;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&__content {
|
|
17
|
-
padding: getSpacer(3xs) 0;
|
|
18
|
-
font-size: $font-size-xs;
|
|
19
|
-
line-height: $lineheight-size-xs;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
html .notification-panel__detail.notification-panel__detail-button {
|
|
24
|
-
text-decoration: underline;
|
|
25
|
-
text-decoration-color: $blueberry600;
|
|
26
|
-
margin-left: -0.25rem;
|
|
27
|
-
padding: 0 0 0 getSpacer(3xs);
|
|
28
|
-
white-space: nowrap;
|
|
29
|
-
overflow: initial;
|
|
30
|
-
text-overflow: clip;
|
|
31
|
-
font-size: $font-size-sm;
|
|
32
|
-
line-height: 1.625rem;
|
|
33
|
-
height: 1.625rem;
|
|
34
|
-
|
|
35
|
-
@media (width >= 0) {
|
|
36
|
-
min-height: unset;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type Styles = {
|
|
2
|
-
'notification-panel__detail': string;
|
|
3
|
-
'notification-panel__detail-button': string;
|
|
4
|
-
'notification-panel__detail-section': string;
|
|
5
|
-
'notification-panel__detail-section__button--wrapper': string;
|
|
6
|
-
'notification-panel__detail-section__content': string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export type ClassNames = keyof Styles;
|
|
10
|
-
|
|
11
|
-
declare const styles: Styles;
|
|
12
|
-
|
|
13
|
-
export default styles;
|