@helsenorge/designsystem-react 2.9.3 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/Avatar.js +2 -0
  2. package/Avatar.js.map +1 -0
  3. package/Badge.js +1 -1
  4. package/Badge.js.map +1 -1
  5. package/CHANGELOG.md +19 -0
  6. package/FormGroup.js +1 -1
  7. package/FormGroup.js.map +1 -1
  8. package/ListHeader.js +2 -0
  9. package/ListHeader.js.map +1 -0
  10. package/ListHeaderText.js +2 -0
  11. package/ListHeaderText.js.map +1 -0
  12. package/StatusDot.js +2 -0
  13. package/StatusDot.js.map +1 -0
  14. package/components/Avatar/Avatar.d.ts +3 -2
  15. package/components/Avatar/Avatar.d.ts.map +1 -1
  16. package/components/Avatar/index.js +1 -1
  17. package/components/Avatar/index.js.map +1 -1
  18. package/components/Badge/Badge.d.ts +3 -2
  19. package/components/Badge/Badge.d.ts.map +1 -1
  20. package/components/Badge/styles.module.scss +1 -4
  21. package/components/Badge/styles.module.scss.d.ts +0 -1
  22. package/components/ExpanderList/ExpanderList.d.ts +10 -4
  23. package/components/ExpanderList/ExpanderList.d.ts.map +1 -1
  24. package/components/ExpanderList/componentdata.json +1 -1
  25. package/components/ExpanderList/index.js +1 -1
  26. package/components/ExpanderList/index.js.map +1 -1
  27. package/components/ExpanderList/styles.module.scss +29 -67
  28. package/components/ExpanderList/styles.module.scss.d.ts +3 -6
  29. package/components/FormExample/index.js +2 -2
  30. package/components/FormExample/index.js.map +1 -1
  31. package/components/FormGroup/FormGroup.d.ts.map +1 -1
  32. package/components/FormGroup/index.js +1 -1
  33. package/components/Icons/Coins.js +1 -1
  34. package/components/Icons/Coins.js.map +1 -1
  35. package/components/Icons/PersonCancel.js +1 -1
  36. package/components/Icons/PersonCancel.js.map +1 -1
  37. package/components/Icons/TravelRoute.js +1 -1
  38. package/components/Icons/TravelRoute.js.map +1 -1
  39. package/components/LinkList/LinkList.d.ts +13 -8
  40. package/components/LinkList/LinkList.d.ts.map +1 -1
  41. package/components/LinkList/componentdata.json +1 -1
  42. package/components/LinkList/index.js +1 -1
  43. package/components/LinkList/index.js.map +1 -1
  44. package/components/LinkList/styles.module.scss +35 -61
  45. package/components/LinkList/styles.module.scss.d.ts +3 -5
  46. package/components/ListHeader/ListHeader.d.ts +38 -0
  47. package/components/ListHeader/ListHeader.d.ts.map +1 -0
  48. package/components/ListHeader/ListHeaderText/ListHeaderText.d.ts +24 -0
  49. package/components/ListHeader/ListHeaderText/ListHeaderText.d.ts.map +1 -0
  50. package/components/ListHeader/ListHeaderText/componentdata.json +1 -0
  51. package/components/ListHeader/ListHeaderText/index.d.ts +4 -0
  52. package/components/ListHeader/ListHeaderText/index.d.ts.map +1 -0
  53. package/components/ListHeader/ListHeaderText/index.js +2 -0
  54. package/components/ListHeader/ListHeaderText/index.js.map +1 -0
  55. package/components/ListHeader/componentdata.json +1 -0
  56. package/components/ListHeader/index.d.ts +5 -0
  57. package/components/ListHeader/index.d.ts.map +1 -0
  58. package/components/ListHeader/index.js +2 -0
  59. package/components/ListHeader/index.js.map +1 -0
  60. package/components/ListHeader/styles.module.scss +150 -0
  61. package/components/ListHeader/styles.module.scss.d.ts +41 -0
  62. package/components/NotificationPanel/styles.module.scss +2 -1
  63. package/components/StatusDot/StatusDot.d.ts.map +1 -1
  64. package/components/StatusDot/index.js +1 -1
  65. package/components/StatusDot/index.js.map +1 -1
  66. package/components/StatusDot/styles.module.scss +1 -0
  67. package/components/Validation/index.js +1 -1
  68. package/package.json +1 -1
  69. package/utils/component.d.ts +3 -0
  70. package/utils/component.d.ts.map +1 -0
  71. package/utils/component.js +2 -0
  72. package/utils/component.js.map +1 -0
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { AvatarProps, AvatarType } from '../Avatar';
3
+ import { BadgeProps, BadgeType } from '../Badge';
4
+ import { ListHeaderTextProps, ListHeaderTextType } from './ListHeaderText/ListHeaderText';
5
+ import { SvgIcon } from '../Icons';
6
+ export declare type ListHeaderSize = 'small' | 'medium' | 'large';
7
+ export interface ListHeaderType extends React.ForwardRefExoticComponent<ListHeaderProps & React.RefAttributes<HTMLLIElement>> {
8
+ Avatar?: AvatarType;
9
+ Badge?: BadgeType;
10
+ ListHeaderText?: ListHeaderTextType;
11
+ }
12
+ export declare const renderListHeader: (element: React.ReactNode, chevronIcon: SvgIcon, isHovered: boolean, size: ListHeaderSize, icon?: React.ReactElement) => false | "" | 0 | JSX.Element | null | undefined;
13
+ export interface ListHeaderProps {
14
+ /** Adds custom classes to the ListHeader element. */
15
+ className?: string;
16
+ /** Chevron to render inside of the ListHeader */
17
+ chevronIcon?: SvgIcon;
18
+ /** Children to be rendered inside of ListHeader */
19
+ children: React.ReactNode;
20
+ /** icon to be rendered inside of ListHeader */
21
+ icon?: React.ReactElement;
22
+ /** whether or not the parent is hovered */
23
+ isHovered?: boolean;
24
+ /** Changes size of the ListHeader. */
25
+ size?: ListHeaderSize;
26
+ /** Sets the data-testid attribute. */
27
+ testId?: string;
28
+ }
29
+ export declare const mapChildren: (children: React.ReactNode, isJsxChild?: boolean) => {
30
+ avatarChild?: AvatarProps | undefined;
31
+ listHeaderTextChildren: Array<ListHeaderTextProps>;
32
+ badgeChild?: BadgeProps | undefined;
33
+ stringChildren: Array<string>;
34
+ remainingChildren: Array<any>;
35
+ };
36
+ export declare const ListHeader: ListHeaderType;
37
+ export default ListHeader;
38
+ //# sourceMappingURL=ListHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListHeader.d.ts","sourceRoot":"","sources":["../../../src/components/ListHeader/ListHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,OAAuB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAI1G,OAAa,EAAY,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnD,oBAAY,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1D,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,yBAAyB,CAAC,eAAe,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IAC3H,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC;AAED,eAAO,MAAM,gBAAgB,YAClB,MAAM,SAAS,eACX,OAAO,aACT,OAAO,QACZ,cAAc,SACb,MAAM,YAAY,oDAc1B,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+CAA+C;IAC/C,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,aACZ,MAAM,SAAS;;4BAID,MAAM,mBAAmB,CAAC;;oBAElC,MAAM,MAAM,CAAC;uBACV,MAAM,GAAG,CAAC;CA+B9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAqEvB,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { StatusDotVariant } from '../../StatusDot';
3
+ export declare type ListHeaderTextType = React.ForwardRefExoticComponent<ListHeaderTextProps & React.RefAttributes<HTMLLIElement>>;
4
+ export interface ListHeaderTextProps {
5
+ /** The first text in the ListHeaderText Component */
6
+ firstText: string;
7
+ /** Will style the first text as bold */
8
+ firstTextEmphasised?: boolean;
9
+ /** The second text in the ListHeaderText Component */
10
+ secondText?: string;
11
+ /** Will style the second text as bold */
12
+ secondTextEmphasised?: boolean;
13
+ /** Whether or not this ListHeaderText is a sub text */
14
+ subText?: boolean;
15
+ /** Decides the variant for the StatusDot */
16
+ statusDotVariant?: StatusDotVariant;
17
+ /** Adds custom classes to the ListHeaderText component. */
18
+ className?: string;
19
+ /** Sets the data-testid attribute. */
20
+ testId?: string;
21
+ }
22
+ export declare const ListHeaderText: ListHeaderTextType;
23
+ export default ListHeaderText;
24
+ //# sourceMappingURL=ListHeaderText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListHeaderText.d.ts","sourceRoot":"","sources":["../../../../src/components/ListHeader/ListHeaderText/ListHeaderText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAI9D,oBAAY,kBAAkB,GAAG,KAAK,CAAC,yBAAyB,CAAC,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAE3H,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,cAAc,EAAE,kBAmC3B,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ {"props":{"firstText":{"defaultValue":null,"description":"The first text in the ListHeaderText Component","name":"firstText","parent":{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"}],"required":true,"type":{"name":"string"}},"firstTextEmphasised":{"defaultValue":null,"description":"Will style the first text as bold","name":"firstTextEmphasised","parent":{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"}],"required":false,"type":{"name":"boolean"}},"secondText":{"defaultValue":null,"description":"The second text in the ListHeaderText Component","name":"secondText","parent":{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"}],"required":false,"type":{"name":"string"}},"secondTextEmphasised":{"defaultValue":null,"description":"Will style the second text as bold","name":"secondTextEmphasised","parent":{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"}],"required":false,"type":{"name":"boolean"}},"subText":{"defaultValue":null,"description":"Whether or not this ListHeaderText is a sub text","name":"subText","parent":{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"}],"required":false,"type":{"name":"boolean"}},"statusDotVariant":{"defaultValue":null,"description":"Decides the variant for the StatusDot","name":"statusDotVariant","parent":{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"}],"required":false,"type":{"name":"enum","raw":"StatusDotVariant","value":[{"value":"\"info\"","description":"","fullComment":"","tags":{}},{"value":"\"warning\"","description":"","fullComment":"","tags":{}},{"value":"\"alert\"","description":"","fullComment":"","tags":{}},{"value":"\"cancelled\"","description":"","fullComment":"","tags":{}},{"value":"\"active\"","description":"","fullComment":"","tags":{}},{"value":"\"transparent\"","description":"","fullComment":"","tags":{}},{"value":"\"recurring\"","description":"","fullComment":"","tags":{}},{"value":"\"group\"","description":"","fullComment":"","tags":{}},{"value":"\"noaccess\"","description":"","fullComment":"","tags":{}}]}},"className":{"defaultValue":null,"description":"Adds custom classes to the ListHeaderText component.","name":"className","parent":{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"}],"required":false,"type":{"name":"string"}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeaderText/ListHeaderText.tsx","name":"ListHeaderTextProps"}],"required":false,"type":{"name":"string"}}}}
@@ -0,0 +1,4 @@
1
+ import ListHeaderText from './ListHeaderText';
2
+ export * from './ListHeaderText';
3
+ export default ListHeaderText;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ListHeader/ListHeaderText/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,eAAe,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ import"../../../ListHeaderText.js";import{L as n,L as q}from"../../../ListHeaderText.js";import"react";import"classnames";import"../../../StatusDot.js";import"../../StatusDot/styles.module.scss";import"../../../constants.js";import"../../Icons/Icon.js";import"../../../hooks/useUuid.js";import"../../../uuid.js";import"../../../utils/environment.js";import"../../Icons/Undo.js";import"../../../theme/currys/color.js";import"../../../theme/index.js";import"../../../theme/palette.js";import"../../../theme/spacers.js";import"../../../theme/grid.js";import"../../Icons/Group.js";import"../../Icons/NoAccess.js";import"../../../hooks/useBreakpoint.js";import"../styles.module.scss";export{n as ListHeaderText,q as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"props":{"className":{"defaultValue":null,"description":"Adds custom classes to the ListHeader element.","name":"className","parent":{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"}],"required":false,"type":{"name":"string"}},"chevronIcon":{"defaultValue":null,"description":"Chevron to render inside of the ListHeader","name":"chevronIcon","parent":{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"}],"required":false,"type":{"name":"SvgIcon"}},"children":{"defaultValue":null,"description":"Children to be rendered inside of ListHeader","name":"children","parent":{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"}],"required":true,"type":{"name":"ReactNode"}},"icon":{"defaultValue":null,"description":"icon to be rendered inside of ListHeader","name":"icon","parent":{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"}],"required":false,"type":{"name":"ReactElement<any, string | JSXElementConstructor<any>>"}},"isHovered":{"defaultValue":null,"description":"whether or not the parent is hovered","name":"isHovered","parent":{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"}],"required":false,"type":{"name":"boolean"}},"size":{"defaultValue":null,"description":"Changes size of the ListHeader.","name":"size","parent":{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"}],"required":false,"type":{"name":"enum","raw":"ListHeaderSize","value":[{"value":"\"small\""},{"value":"\"medium\""},{"value":"\"large\""}]}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"},"declarations":[{"fileName":"src/components/ListHeader/ListHeader.tsx","name":"ListHeaderProps"}],"required":false,"type":{"name":"string"}}}}
@@ -0,0 +1,5 @@
1
+ import { ListHeader } from './ListHeader';
2
+ export { ListHeaderText } from './ListHeaderText';
3
+ export * from './ListHeader';
4
+ export default ListHeader;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ListHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAc,cAAc,CAAC;AAC7B,eAAe,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ import"../../ListHeader.js";import{L as z,L as A,m as B,r as D}from"../../ListHeader.js";import{L as F}from"../../ListHeaderText.js";import"react";import"classnames";import"../../Avatar.js";import"../Icons/Icon.js";import"../../constants.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";import"../Icons/Check.js";import"../Avatar/styles.module.scss";import"../../theme/palette.js";import"../../Badge.js";import"../Badge/styles.module.scss";import"./styles.module.scss";import"../../hooks/useBreakpoint.js";import"../../theme/grid.js";import"../../utils/component.js";import"../../StatusDot.js";import"../StatusDot/styles.module.scss";import"../Icons/Undo.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/spacers.js";import"../Icons/Group.js";import"../Icons/NoAccess.js";export{z as ListHeader,F as ListHeaderText,A as default,B as mapChildren,D as renderListHeader};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,150 @@
1
+ @import '../../scss/_spacers.scss';
2
+ @import '../../scss/_breakpoints.scss';
3
+ @import '../../scss/_font-settings.scss';
4
+ @import '../../scss/_palette.scss';
5
+
6
+ .list-header {
7
+ display: flex;
8
+ width: 100%;
9
+ padding-right: getSpacer(2xs);
10
+ padding-left: getSpacer(2xs);
11
+ text-align: left;
12
+ align-items: center;
13
+
14
+ &--for-element-content {
15
+ align-content: flex-start;
16
+ padding-top: getSpacer(s);
17
+ padding-bottom: getSpacer(s);
18
+ }
19
+ &--top-align-content {
20
+ align-items: flex-start;
21
+ }
22
+
23
+ &__content {
24
+ border-bottom: 1px solid transparent;
25
+ display: flex;
26
+ align-items: center;
27
+ width: 100%;
28
+
29
+ &--string {
30
+ margin: getSpacer(xs) 0;
31
+ @media (min-width: map-get($grid-breakpoints, md)) {
32
+ margin: getSpacer(s) 0;
33
+ }
34
+ }
35
+ &--element {
36
+ display: flex;
37
+ align-items: flex-start;
38
+ flex-direction: column;
39
+ }
40
+ &--spacing {
41
+ margin-left: getSpacer(s);
42
+ }
43
+ :focus > &,
44
+ :focus-visible > & {
45
+ border-color: $black;
46
+ }
47
+ }
48
+
49
+ &__icon,
50
+ &__avatar {
51
+ display: flex;
52
+ align-items: center;
53
+
54
+ &--for-element-content {
55
+ &--medium {
56
+ height: $lineheight-size-sm;
57
+ }
58
+ &--large {
59
+ height: $lineheight-size-md;
60
+ }
61
+ @media (min-width: map-get($grid-breakpoints, md)) {
62
+ &--medium {
63
+ height: $lineheight-size-md;
64
+ }
65
+ &--large {
66
+ height: $lineheight-size-lg;
67
+ }
68
+ }
69
+ }
70
+ }
71
+
72
+ &__icon {
73
+ &--for-string-content {
74
+ margin: getSpacer(3xs) getSpacer(2xs) getSpacer(3xs) 0;
75
+ @media (min-width: map-get($grid-breakpoints, md)) {
76
+ margin: getSpacer(2xs) getSpacer(2xs) getSpacer(2xs) 0;
77
+ }
78
+ }
79
+ &--for-element-content {
80
+ margin: 0 getSpacer(2xs) 0 0;
81
+ }
82
+ }
83
+
84
+ &__avatar {
85
+ &--for-string-content {
86
+ margin: getSpacer(3xs) getSpacer(s) getSpacer(3xs) 0;
87
+ @media (min-width: map-get($grid-breakpoints, md)) {
88
+ margin: getSpacer(2xs) getSpacer(s) getSpacer(2xs) 0;
89
+ }
90
+ }
91
+ &--for-element-content {
92
+ margin: 0 getSpacer(s) 0 0;
93
+ }
94
+ }
95
+
96
+ &__chevron,
97
+ &__badge {
98
+ display: flex;
99
+ align-items: center;
100
+ padding-left: getSpacer(2xs);
101
+ &--for-string-content {
102
+ margin: getSpacer(3xs) 0 getSpacer(3xs) auto;
103
+ @media (min-width: map-get($grid-breakpoints, md)) {
104
+ margin: getSpacer(2xs) 0 getSpacer(2xs) auto;
105
+ }
106
+ }
107
+ &--right {
108
+ margin-left: auto;
109
+ margin-right: getSpacer(2xs);
110
+ }
111
+ //Height needs to be same as line-height
112
+ &--small {
113
+ height: $lineheight-size-xs;
114
+ }
115
+ &--medium {
116
+ height: $lineheight-size-sm;
117
+ }
118
+ &--large {
119
+ height: $lineheight-size-md;
120
+ }
121
+ @media (min-width: map-get($grid-breakpoints, md)) {
122
+ &--small {
123
+ height: $lineheight-size-sm;
124
+ }
125
+ &--medium {
126
+ height: $lineheight-size-md;
127
+ }
128
+ &--large {
129
+ height: $lineheight-size-lg;
130
+ }
131
+ }
132
+ }
133
+ }
134
+
135
+ .statusDot {
136
+ padding: 1rem;
137
+ }
138
+ .text-wrapper {
139
+ display: flex;
140
+ align-items: flex-start;
141
+ font-size: 20px;
142
+ font-weight: 400;
143
+
144
+ &--sub-level {
145
+ font-size: 18px;
146
+ }
147
+ &__text--emphasised {
148
+ font-weight: 600;
149
+ }
150
+ }
@@ -0,0 +1,41 @@
1
+ export type Styles = {
2
+ 'list-header': string;
3
+ 'list-header__avatar': string;
4
+ 'list-header__avatar--for-element-content': string;
5
+ 'list-header__avatar--for-element-content--large': string;
6
+ 'list-header__avatar--for-element-content--medium': string;
7
+ 'list-header__avatar--for-string-content': string;
8
+ 'list-header__badge': string;
9
+ 'list-header__badge--for-string-content': string;
10
+ 'list-header__badge--large': string;
11
+ 'list-header__badge--medium': string;
12
+ 'list-header__badge--right': string;
13
+ 'list-header__badge--small': string;
14
+ 'list-header__chevron': string;
15
+ 'list-header__chevron--for-string-content': string;
16
+ 'list-header__chevron--large': string;
17
+ 'list-header__chevron--medium': string;
18
+ 'list-header__chevron--right': string;
19
+ 'list-header__chevron--small': string;
20
+ 'list-header__content': string;
21
+ 'list-header__content--element': string;
22
+ 'list-header__content--spacing': string;
23
+ 'list-header__content--string': string;
24
+ 'list-header__icon': string;
25
+ 'list-header__icon--for-element-content': string;
26
+ 'list-header__icon--for-element-content--large': string;
27
+ 'list-header__icon--for-element-content--medium': string;
28
+ 'list-header__icon--for-string-content': string;
29
+ 'list-header--for-element-content': string;
30
+ 'list-header--top-align-content': string;
31
+ statusDot: string;
32
+ 'text-wrapper': string;
33
+ 'text-wrapper__text--emphasised': string;
34
+ 'text-wrapper--sub-level': string;
35
+ };
36
+
37
+ export type ClassNames = keyof Styles;
38
+
39
+ declare const styles: Styles;
40
+
41
+ export default styles;
@@ -10,13 +10,14 @@
10
10
  width: inherit;
11
11
 
12
12
  &--has-children {
13
- padding: getSpacer(2xs) getSpacer(s) getSpacer(m) getSpacer(2xs);
13
+ padding: getSpacer(2xs) getSpacer(s) getSpacer(2xs) getSpacer(2xs);
14
14
  #{$panel}__icon {
15
15
  margin-top: getSpacer(2xs);
16
16
  margin-right: getSpacer(2xs);
17
17
  }
18
18
  #{$panel}__content {
19
19
  margin-top: getSpacer(s);
20
+ margin-bottom: getSpacer(s);
20
21
  }
21
22
  @media (min-width: map-get($grid-breakpoints, md)) {
22
23
  padding-left: getSpacer(s);
@@ -1 +1 @@
1
- {"version":3,"file":"StatusDot.d.ts","sourceRoot":"","sources":["../../../src/components/StatusDot/StatusDot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,OAAO,gBAAgB,CAAC;IACxC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,MAAM,oFAyBV,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"StatusDot.d.ts","sourceRoot":"","sources":["../../../src/components/StatusDot/StatusDot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,OAAO,gBAAgB,CAAC;IACxC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,MAAM,oFA2BV,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- import r from"react";import c from"classnames";import s from"./styles.module.scss";import{IconSize as l,AnalyticsId as _}from"../../constants.js";import{Icon as n}from"../Icons/Icon.js";import v from"../Icons/Undo.js";import{getColor as I}from"../../theme/currys/color.js";import E from"../Icons/Group.js";import N from"../Icons/NoAccess.js";import"../../theme/grid.js";import"../../hooks/useBreakpoint.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";var X=(e=>(e.info="info",e.warning="warning",e.alert="alert",e.cancelled="cancelled",e.active="active",e.transparent="transparent",e.recurring="recurring",e.group="group",e.noaccess="noaccess",e))(X||{});const J=r.forwardRef(function(m,C){const{variant:o="info",text:i,className:p}=m,a=o==="recurring"||o==="group"||o==="noaccess",d=o==="cancelled",f=c(s.statusdot,{[s["statusdot--cancelled"]]:d},p),u=c(s.statusdot__dot,[a?s["statusdot__dot--icon"]:s[`statusdot__dot--${o}`]]),g=c(s.statusdot__label,{[s["statusdot__label--icon"]]:a});let t=null;return o==="recurring"?t=r.createElement(n,{size:l.XXSmall,svgIcon:v}):o==="group"?t=r.createElement(n,{size:l.XXSmall,svgIcon:E}):o==="noaccess"&&(t=r.createElement(n,{size:l.XXSmall,svgIcon:N,color:I("cherry",600)})),r.createElement("div",{className:f,"data-analyticsid":_.StatusDot},r.createElement("span",{className:u},t),r.createElement("span",{className:g},i))});export{X as StatusDotVariant,J as default};
1
+ import"../../StatusDot.js";import{a as h,S as j}from"../../StatusDot.js";import"react";import"classnames";import"./styles.module.scss";import"../../constants.js";import"../Icons/Icon.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";import"../Icons/Undo.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../theme/grid.js";import"../Icons/Group.js";import"../Icons/NoAccess.js";import"../../hooks/useBreakpoint.js";export{h as StatusDotVariant,j as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/StatusDot/StatusDot.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport statusDotStyles from './styles.module.scss';\nimport { AnalyticsId } from '../../constants';\nimport { Icon } from '../Icons/Icon';\nimport Undo from '../Icons/Undo';\nimport { getColor } from '../../theme/currys';\nimport Group from '../Icons/Group';\nimport NoAccess from '../Icons/NoAccess';\nimport { IconSize } from '../..';\n\nexport enum StatusDotVariant {\n info = 'info',\n warning = 'warning',\n alert = 'alert',\n cancelled = 'cancelled',\n active = 'active',\n transparent = 'transparent',\n recurring = 'recurring',\n group = 'group',\n noaccess = 'noaccess',\n}\n\nexport interface StatusDotProps {\n /** Visual variants for the statusdot */\n variant?: keyof typeof StatusDotVariant;\n /** Text placed to the right of the statusdot */\n text: string;\n /** Adds custom classes to the element. */\n className?: string;\n}\n\nconst Spacer = React.forwardRef(function SpacerForwardedRef(props: StatusDotProps, ref: React.ForwardedRef<HTMLElement>) {\n const { variant = StatusDotVariant.info, text, className } = props;\n const hasIcon = variant === StatusDotVariant.recurring || variant === StatusDotVariant.group || variant === StatusDotVariant.noaccess;\n const isCancelled = variant === StatusDotVariant.cancelled;\n const statusDotClasses = classNames(statusDotStyles['statusdot'], { [statusDotStyles['statusdot--cancelled']]: isCancelled }, className);\n const dotClasses = classNames(statusDotStyles['statusdot__dot'], [\n hasIcon ? statusDotStyles[`statusdot__dot--icon`] : statusDotStyles[`statusdot__dot--${variant}`],\n ]);\n const labelClasses = classNames(statusDotStyles['statusdot__label'], { [statusDotStyles[`statusdot__label--icon`]]: hasIcon });\n let svgIcon: JSX.Element | null = null;\n\n if (variant === StatusDotVariant.recurring) {\n svgIcon = <Icon size={IconSize.XXSmall} svgIcon={Undo} />;\n } else if (variant === StatusDotVariant.group) {\n svgIcon = <Icon size={IconSize.XXSmall} svgIcon={Group} />;\n } else if (variant === StatusDotVariant.noaccess) {\n svgIcon = <Icon size={IconSize.XXSmall} svgIcon={NoAccess} color={getColor('cherry', 600)} />;\n }\n\n return (\n <div className={statusDotClasses} data-analyticsid={AnalyticsId.StatusDot}>\n <span className={dotClasses}>{svgIcon}</span>\n <span className={labelClasses}>{text}</span>\n </div>\n );\n});\n\nexport default Spacer;\n"],"names":["StatusDotVariant","Spacer","React","props","ref","variant","text","className","hasIcon","isCancelled","statusDotClasses","classNames","statusDotStyles","dotClasses","labelClasses","svgIcon","Icon","IconSize","Undo","Group","NoAccess","getColor","AnalyticsId"],"mappings":"0kBAaY,IAAAA,GAAAA,IACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,MAAQ,QACRA,EAAA,UAAY,YACZA,EAAA,OAAS,SACTA,EAAA,YAAc,cACdA,EAAA,UAAY,YACZA,EAAA,MAAQ,QACRA,EAAA,SAAW,WATDA,IAAAA,GAAA,CAAA,CAAA,EAqBZ,MAAMC,EAASC,EAAM,WAAW,SAA4BC,EAAuBC,EAAsC,CACvH,KAAM,CAAE,QAAAC,EAAU,OAAuB,KAAAC,EAAM,UAAAC,GAAcJ,EACvDK,EAAUH,IAAY,aAA8BA,IAAY,SAA0BA,IAAY,WACtGI,EAAcJ,IAAY,YAC1BK,EAAmBC,EAAWC,EAAgB,UAAc,CAAE,CAACA,EAAgB,yBAA0BH,CAAY,EAAGF,CAAS,EACjIM,EAAaF,EAAWC,EAAgB,eAAmB,CAC/DJ,EAAUI,EAAgB,wBAA0BA,EAAgB,mBAAmBP,IAAA,CACxF,EACKS,EAAeH,EAAWC,EAAgB,iBAAqB,CAAE,CAACA,EAAgB,2BAA4BJ,CAAS,CAAA,EAC7H,IAAIO,EAA8B,KAElC,OAAIV,IAAY,YACdU,EAAWb,EAAA,cAAAc,EAAA,CAAK,KAAMC,EAAS,QAAS,QAASC,CAAA,CAAM,EAC9Cb,IAAY,QACrBU,EAAWb,EAAA,cAAAc,EAAA,CAAK,KAAMC,EAAS,QAAS,QAASE,CAAA,CAAO,EAC/Cd,IAAY,aACrBU,EAAWb,EAAA,cAAAc,EAAA,CAAK,KAAMC,EAAS,QAAS,QAASG,EAAU,MAAOC,EAAS,SAAU,GAAG,CAAA,CAAG,GAI1FnB,EAAA,cAAA,MAAA,CAAI,UAAWQ,EAAkB,mBAAkBY,EAAY,SAAA,EAC7DpB,EAAA,cAAA,OAAA,CAAK,UAAWW,CAAa,EAAAE,CAAQ,EACrCb,EAAA,cAAA,OAAA,CAAK,UAAWY,CAAA,EAAeR,CAAK,CACvC,CAEJ,CAAC"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  @import '../../scss/palette';
2
2
  @import '../../scss/spacers.scss';
3
3
  @import '../../scss/font-settings';
4
+ @import '../../scss/screen-reader.scss';
4
5
 
5
6
  .statusdot {
6
7
  position: relative;
@@ -1,2 +1,2 @@
1
- import"../../Validation.js";import{V as J,V as K}from"../../Validation.js";import"react";import"classnames";import"../../FormGroup.js";import"../FormGroup/styles.module.scss";import"../../Checkbox.js";import"../../uuid.js";import"../../utils/environment.js";import"../Icons/Check.js";import"../Icons/Icon.js";import"../../constants.js";import"../../hooks/useUuid.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../theme/grid.js";import"../Checkbox/styles.module.scss";import"../../RadioButton.js";import"../RadioButton/styles.module.scss";import"../../Input.js";import"../../hooks/useBreakpoint.js";import"../../ErrorWrapper.js";import"../ErrorWrapper/styles.module.scss";import"../Input/styles.module.scss";import"../../Title.js";import"../Title/styles.module.scss";import"../../FormLayout.js";import"../FormLayout/styles.module.scss";import"../../Select.js";import"../Select/styles.module.scss";import"../Icons/ChevronDown.js";import"./styles.module.scss";export{J as Validation,K as default};
1
+ import"../../Validation.js";import{V as K,V as L}from"../../Validation.js";import"react";import"classnames";import"../../FormGroup.js";import"../FormGroup/styles.module.scss";import"../../Checkbox.js";import"../../uuid.js";import"../../utils/environment.js";import"../Icons/Check.js";import"../Icons/Icon.js";import"../../constants.js";import"../../hooks/useUuid.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../theme/grid.js";import"../Checkbox/styles.module.scss";import"../../RadioButton.js";import"../RadioButton/styles.module.scss";import"../../Input.js";import"../../hooks/useBreakpoint.js";import"../../ErrorWrapper.js";import"../ErrorWrapper/styles.module.scss";import"../Input/styles.module.scss";import"../../Title.js";import"../Title/styles.module.scss";import"../../FormLayout.js";import"../FormLayout/styles.module.scss";import"../../Select.js";import"../Select/styles.module.scss";import"../Icons/ChevronDown.js";import"../../utils/component.js";import"./styles.module.scss";export{K as Validation,L as default};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "description": "The official design system for Helsenorge built with React.",
5
5
  "homepage": "https://helsenorge.design",
6
- "version": "2.9.3",
6
+ "version": "2.10.1",
7
7
  "author": "Helsenorge",
8
8
  "license": "MIT",
9
9
  "peerDependencies": {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const isComponent: <T>(element: {} | null | undefined, type: React.ForwardRefExoticComponent<T>) => element is React.ReactElement<T, string | React.JSXElementConstructor<any>>;
3
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/utils/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,WAAW,eACb,EAAE,GAAG,IAAI,GAAG,SAAS,0HAEwF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import i from"react";const e=(o,t)=>i.isValidElement(o)&&o.type===t;export{e as isComponent};
2
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../src/utils/component.ts"],"sourcesContent":["import React from 'react';\n\nexport const isComponent = <T>(\n element: {} | null | undefined,\n type: React.ForwardRefExoticComponent<T>\n): element is React.ReactElement<T> => React.isValidElement<T>(element) && (element as React.ReactElement).type === type;\n"],"names":["isComponent","element","type","React"],"mappings":"qBAEa,MAAAA,EAAc,CACzBC,EACAC,IACqCC,EAAM,eAAkBF,CAAO,GAAMA,EAA+B,OAASC"}