@rikstv/shared-components 0.8.1 → 1.1.79

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 (151) hide show
  1. package/README.md +21 -2
  2. package/dist/{accordion → components/accordion}/Accordion.d.ts +1 -2
  3. package/dist/components/accordion/Accordion.js +34 -0
  4. package/dist/{accordion → components/accordion}/accordion.scss +58 -39
  5. package/dist/components/breadcrumb/Breadcrumb.d.ts +13 -0
  6. package/dist/components/breadcrumb/Breadcrumb.js +39 -0
  7. package/dist/components/breadcrumb/breadcrumb.scss +75 -0
  8. package/dist/components/button/ArrowButton.d.ts +12 -0
  9. package/dist/components/button/ArrowButton.js +44 -0
  10. package/dist/components/button/BaseButton.d.ts +18 -0
  11. package/dist/components/button/BaseButton.js +42 -0
  12. package/dist/components/button/BaseDecoratedButton.d.ts +11 -0
  13. package/dist/components/button/BaseDecoratedButton.js +32 -0
  14. package/dist/components/button/BaseLinkButton.d.ts +20 -0
  15. package/dist/components/button/BaseLinkButton.js +44 -0
  16. package/dist/{button → components/button}/Button.d.ts +2 -0
  17. package/dist/components/button/Button.js +29 -0
  18. package/dist/components/button/DecoratedButton.d.ts +7 -0
  19. package/dist/components/button/DecoratedButton.js +23 -0
  20. package/dist/{button → components/button}/IconButton.d.ts +2 -3
  21. package/dist/components/button/IconButton.js +24 -0
  22. package/dist/components/button/LinkButton.d.ts +5 -0
  23. package/dist/components/button/LinkButton.js +10 -0
  24. package/dist/components/button/arrow-button.scss +37 -0
  25. package/dist/{button → components/button}/button-shared.scss +14 -3
  26. package/dist/components/button/button.scss +93 -0
  27. package/dist/{button → components/button}/icon-button.scss +0 -0
  28. package/dist/components/button/link-button.scss +6 -0
  29. package/dist/components/checkbox/Checkbox.d.ts +9 -0
  30. package/dist/components/checkbox/Checkbox.js +40 -0
  31. package/dist/components/checkbox/checkbox.scss +116 -0
  32. package/dist/{core → components/core}/Core.d.ts +0 -0
  33. package/dist/{core → components/core}/Core.js +0 -0
  34. package/dist/{core → components/core}/LightMode.d.ts +0 -0
  35. package/dist/components/core/LightMode.js +14 -0
  36. package/dist/{core → components/core}/RiksTV.d.ts +0 -0
  37. package/dist/components/core/RiksTV.js +116 -0
  38. package/dist/{core → components/core}/Strim.d.ts +0 -0
  39. package/dist/components/core/Strim.js +10 -0
  40. package/dist/components/core/core.scss +102 -0
  41. package/dist/components/core/docs/Spacing.scss +12 -0
  42. package/dist/components/core/docs/componets/ColorSwatch/ColorSwatch.scss +66 -0
  43. package/dist/components/core/docs/componets/ColorSwatch/ColorSwatchBtn.scss +19 -0
  44. package/dist/components/core/docs/componets/ExampleGrid/ExampleGrid.scss +12 -0
  45. package/dist/components/core/docs/componets/SpacingBlock/SpacingBlock.scss +6 -0
  46. package/dist/components/core/docs/hooks/animated.scss +12 -0
  47. package/dist/components/core/docs/hooks/clickOutside.scss +11 -0
  48. package/dist/components/core/docs/hooks/intersection.scss +14 -0
  49. package/dist/components/core/hooks/useAnimatedHeight.d.ts +19 -0
  50. package/dist/components/core/hooks/useBrowserPreferences.d.ts +5 -0
  51. package/dist/components/core/hooks/useClickOutsideListener.d.ts +8 -0
  52. package/dist/components/core/hooks/useIntersectionObserver.d.ts +2 -0
  53. package/dist/components/core/hooks/useMutationObserver.d.ts +2 -0
  54. package/dist/components/core/mixin/breakpoints.scss +44 -0
  55. package/dist/{core → components/core}/mixin/fluid.scss +0 -0
  56. package/dist/{core → components/core}/mixin/focus.scss +0 -0
  57. package/dist/{core → components/core}/mixin/navigation.scss +0 -0
  58. package/dist/{core → components/core}/mixin/rem.scss +0 -0
  59. package/dist/components/core/rikstvColors.scss +71 -0
  60. package/dist/components/core/rtv.scss +75 -0
  61. package/dist/components/core/spacing/Gutter.d.ts +2 -0
  62. package/dist/components/core/spacing/GutterPadding.d.ts +2 -0
  63. package/dist/components/core/strimColors.scss +48 -0
  64. package/dist/components/core/strm.scss +79 -0
  65. package/dist/{core → components/core}/utils/detectUserInputMethod.d.ts +0 -0
  66. package/dist/components/icons/Arrow.d.ts +2 -0
  67. package/dist/components/icons/Arrow.js +12 -0
  68. package/dist/{icons → components/icons}/Chevron.d.ts +0 -0
  69. package/dist/{icons → components/icons}/Chevron.js +0 -0
  70. package/dist/{icons → components/icons}/heartToggle.scss +12 -6
  71. package/dist/components/index.d.ts +31 -0
  72. package/dist/components/list/CheckmarkListItem.d.ts +8 -0
  73. package/dist/components/list/CheckmarkListItem.js +32 -0
  74. package/dist/components/list/CheckmarkListItem.scss +41 -0
  75. package/dist/components/list/CrossmarkListItem.d.ts +8 -0
  76. package/dist/components/list/CrossmarkListItem.js +23 -0
  77. package/dist/components/list/CrossmarkListItem.scss +42 -0
  78. package/dist/components/list/List.d.ts +8 -0
  79. package/dist/components/list/List.js +28 -0
  80. package/dist/components/list/List.scss +15 -0
  81. package/dist/components/list/ListItem.d.ts +8 -0
  82. package/dist/components/list/ListItem.js +19 -0
  83. package/dist/components/list/ListItem.scss +25 -0
  84. package/dist/components/list/OrderedListItem.d.ts +7 -0
  85. package/dist/components/list/OrderedListItem.js +15 -0
  86. package/dist/components/list/OrderedListItem.scss +21 -0
  87. package/dist/components/list/internal/getMarkColor.d.ts +3 -0
  88. package/dist/components/loader/Loader.d.ts +7 -0
  89. package/dist/components/loader/Loader.js +31 -0
  90. package/dist/components/loader/Loader.scss +148 -0
  91. package/dist/components/loader/RawLoader.d.ts +10 -0
  92. package/dist/components/loader/RawLoader.js +30 -0
  93. package/dist/components/panel/Info.d.ts +2 -0
  94. package/dist/components/panel/Info.js +25 -0
  95. package/dist/components/panel/Panel.d.ts +15 -0
  96. package/dist/components/panel/Panel.js +55 -0
  97. package/dist/components/panel/Success.d.ts +2 -0
  98. package/dist/components/panel/Success.js +80 -0
  99. package/dist/components/panel/Warning.d.ts +2 -0
  100. package/dist/components/panel/Warning.js +14 -0
  101. package/dist/components/panel/panel.scss +95 -0
  102. package/dist/components/progress/CircularProgress.d.ts +11 -0
  103. package/dist/components/progress/CircularProgress.js +87 -0
  104. package/dist/components/progress/Progress.d.ts +11 -0
  105. package/dist/components/progress/Progress.js +42 -0
  106. package/dist/components/progress/Progress.scss +76 -0
  107. package/dist/components/progress/circularProgress.scss +70 -0
  108. package/dist/components/spacing/Gutter.js +13 -0
  109. package/dist/components/spacing/GutterPadding.js +13 -0
  110. package/dist/{textfield → components/textfield}/TextField.d.ts +6 -5
  111. package/dist/components/textfield/TextField.js +57 -0
  112. package/dist/components/textfield/textfield.scss +178 -0
  113. package/dist/{toggle → components/toggle}/FieldSet.d.ts +0 -0
  114. package/dist/components/toggle/FieldSet.js +29 -0
  115. package/dist/{toggle → components/toggle}/RadioContext.d.ts +0 -0
  116. package/dist/{toggle → components/toggle}/RadioToggle.d.ts +0 -0
  117. package/dist/components/toggle/RadioToggle.js +30 -0
  118. package/dist/{toggle → components/toggle}/radioToggle.scss +2 -1
  119. package/dist/{toggleButton → components/toggleButton}/ToggleButton.d.ts +1 -0
  120. package/dist/components/toggleButton/ToggleButton.js +70 -0
  121. package/dist/{toggleButton → components/toggleButton}/toggleButton.scss +16 -8
  122. package/dist/components/toggleLinkButton/ToggleLinkButton.d.ts +10 -0
  123. package/dist/components/toggleLinkButton/ToggleLinkButton.js +60 -0
  124. package/dist/components/toggleLinkButton/toggleLinkButton.scss +54 -0
  125. package/dist/{typography → components/typography}/Typography.d.ts +3 -1
  126. package/dist/components/typography/Typography.js +67 -0
  127. package/dist/{typography → components/typography}/typography.scss +30 -1
  128. package/dist/shared-components.es.js +210 -15
  129. package/dist/style.css +1 -1
  130. package/dist/{core/utils → utils}/generateId.d.ts +0 -0
  131. package/package.json +12 -17
  132. package/dist/accordion/Accordion.js +0 -73
  133. package/dist/button/BaseButton.d.ts +0 -15
  134. package/dist/button/BaseButton.js +0 -80
  135. package/dist/button/Button.js +0 -40
  136. package/dist/button/IconButton.js +0 -40
  137. package/dist/button/button.scss +0 -46
  138. package/dist/core/LightMode.js +0 -50
  139. package/dist/core/RiksTV.js +0 -115
  140. package/dist/core/Strim.js +0 -10
  141. package/dist/core/core.scss +0 -29
  142. package/dist/core/rtv.scss +0 -58
  143. package/dist/core/strm.scss +0 -62
  144. package/dist/index.d.ts +0 -11
  145. package/dist/textfield/TextField.js +0 -87
  146. package/dist/textfield/textfield.scss +0 -101
  147. package/dist/toggle/FieldSet.js +0 -66
  148. package/dist/toggle/RadioToggle.js +0 -65
  149. package/dist/toggleButton/ToggleButton.js +0 -106
  150. package/dist/toggleButton/internal/generateId.d.ts +0 -1
  151. package/dist/typography/Typography.js +0 -95
@@ -0,0 +1,15 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ import "./panel.scss";
3
+ export interface Props extends HTMLAttributes<HTMLDivElement> {
4
+ className?: string;
5
+ variant?: "info" | "warning" | "error";
6
+ id?: string;
7
+ lightBackground?: boolean;
8
+ heading?: {
9
+ text: string;
10
+ level: "h1" | "h2" | "h3" | "h4";
11
+ };
12
+ action?: ReactNode;
13
+ icon?: "info" | "success";
14
+ }
15
+ export declare const Panel: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,55 @@
1
+ import { forwardRef } from "react";
2
+ import { S as Span } from "../typography/Typography.js";
3
+ import { S as Success } from "./Success.js";
4
+ import { W as Warning } from "./Warning.js";
5
+ import { I as Info } from "./Info.js";
6
+ import { a as jsxs, j as jsx } from "../core/RiksTV.js";
7
+ var panel = /* @__PURE__ */ (() => ".rds-panel{--panel-info-background-color: var(--rds-heading-accent);--panel-info-color: var(--rds-background-secondary);--panel-warning-background-color: var(--rds-background-secondary);--panel-warning-color: var(--rds-foreground-primary);--panel-fluid-padding: clamp(var(--rds-spacing--16), 2vw, var(--rds-spacing--32));--panel-border: none;--panel-color: #fff;padding:var(--panel-fluid-padding);border-radius:var(--rds-roundness--medium);border:var(--panel-border);display:flex;align-items:flex-end;justify-content:space-between;max-width:var(--rds-content-width--default)}.rds-panel__heading{margin:0;margin-bottom:var(--rds-spacing--8)}.rds-panel__heading>span{color:var(--panel-color)}.rds-panel__content{max-width:var(--rds-readability-width)}.rds-panel__content>span{color:var(--panel-color)}.rds-panel__content__heading{display:flex;align-items:baseline}.rds-panel__content__heading__icon{display:inline-block;width:1.125em;margin-right:.5em;color:var(--panel-color)}.rds-panel__action{display:flex;flex-direction:column;gap:var(--rds-spacing--16);margin-left:var(--rds-spacing--32)}.rds-panel__action>button{width:fit-content}@media (max-width: 768px){.rds-panel{flex-direction:column;align-items:flex-start}.rds-panel__action{margin-top:var(--rds-spacing--24);margin-left:0}}.rds-panel--info{background-color:var(--panel-info-background-color);--panel-color: var(--panel-info-color)}.rds-panel--warning{background-color:var(--panel-warning-background-color);--panel-color: var(--panel-warning-color)}.rds-panel--error{background-color:var(--strim-error-light);--panel-color: var(--strim-fantasy-green)}.rds-light .rds-panel,.rds-light.rds-panel{--panel-info-background-color: var(--rds-heading-accent);--panel-info-color: var(--rds-background-secondary);--panel-warning-background-color: var(--rds-foreground-primary);--panel-warning-color: var(--rds-background-secondary);--panel-border: 2px solid var(--rds-foreground-tertiary)}\n")();
8
+ const Panel = forwardRef(({
9
+ className = "",
10
+ variant = "info",
11
+ heading,
12
+ action,
13
+ lightBackground = false,
14
+ id,
15
+ children,
16
+ icon = "success",
17
+ ...rest
18
+ }, ref) => {
19
+ const H = (heading == null ? void 0 : heading.level) || "span";
20
+ return /* @__PURE__ */ jsxs("div", {
21
+ "data-testid": "rds-panel__container",
22
+ id,
23
+ className: `rds-panel rds-panel--${variant} ${lightBackground ? "rds-light" : ""} ${className}`,
24
+ ref,
25
+ ...rest,
26
+ children: [/* @__PURE__ */ jsxs("div", {
27
+ className: "rds-panel__content",
28
+ children: [heading && /* @__PURE__ */ jsxs("div", {
29
+ className: "rds-panel__content__heading",
30
+ children: [variant === "warning" && /* @__PURE__ */ jsx("span", {
31
+ className: "rds-panel__content__heading__icon",
32
+ children: /* @__PURE__ */ jsx(Warning, {})
33
+ }), variant === "info" && /* @__PURE__ */ jsxs("span", {
34
+ className: "rds-panel__content__heading__icon",
35
+ children: [icon === "success" && /* @__PURE__ */ jsx(Success, {}), icon === "info" && /* @__PURE__ */ jsx(Info, {})]
36
+ }), variant === "error" && /* @__PURE__ */ jsx("span", {
37
+ className: "rds-panel__content__heading__icon",
38
+ children: /* @__PURE__ */ jsx(Info, {})
39
+ }), /* @__PURE__ */ jsx(H, {
40
+ className: "rds-panel__heading rds-title-3",
41
+ children: /* @__PURE__ */ jsx("span", {
42
+ children: heading.text
43
+ })
44
+ })]
45
+ }), /* @__PURE__ */ jsx(Span, {
46
+ children
47
+ })]
48
+ }), action && /* @__PURE__ */ jsx("div", {
49
+ className: "rds-panel__action",
50
+ children: action
51
+ })]
52
+ });
53
+ });
54
+ Panel.displayName = "Panel";
55
+ export { Panel as P };
@@ -0,0 +1,2 @@
1
+ import { FC } from "react";
2
+ export declare const Success: FC;
@@ -0,0 +1,80 @@
1
+ import { a as jsxs, j as jsx } from "../core/RiksTV.js";
2
+ const Success = () => {
3
+ return /* @__PURE__ */ jsxs("svg", {
4
+ fill: "none",
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ viewBox: "0 0 18 18",
7
+ children: [/* @__PURE__ */ jsx("path", {
8
+ fillRule: "evenodd",
9
+ clipRule: "evenodd",
10
+ d: "M6.23 8.19c.22.66.7 1.44 1.42 2.16.72.72 1.5 1.2 2.16 1.42.7.23 1.07.12 1.22-.03.16-.15.27-.53.04-1.23a5.83 5.83 0 0 0-1.43-2.15A5.83 5.83 0 0 0 7.5 6.93c-.7-.23-1.08-.12-1.23.04-.15.15-.26.53-.03 1.22Zm-1.07.36c-.27-.82-.31-1.76.3-2.38.62-.62 1.56-.58 2.38-.3.86.28 1.78.87 2.6 1.7a6.94 6.94 0 0 1 1.7 2.59c.27.82.3 1.76-.31 2.37-.62.62-1.56.58-2.38.3a6.94 6.94 0 0 1-2.6-1.69 6.94 6.94 0 0 1-1.69-2.6Z",
11
+ fill: "currentColor"
12
+ }), /* @__PURE__ */ jsx("path", {
13
+ fillRule: "evenodd",
14
+ clipRule: "evenodd",
15
+ d: "M5.83 6.79c.27.15.36.5.2.76L1.18 16.1a.56.56 0 0 0 .74.74l8.54-4.86a.56.56 0 1 1 .55.97l-8.56 4.88a1.69 1.69 0 0 1-2.26-2.26L5.06 7c.16-.27.5-.37.77-.21ZM11.43 5.38a.56.56 0 0 1 .8 0 .84.84 0 0 1 0 1.2.56.56 0 0 1-.93-.6.56.56 0 0 1 .13-.6Z",
16
+ fill: "currentColor"
17
+ }), /* @__PURE__ */ jsx("path", {
18
+ fillRule: "evenodd",
19
+ clipRule: "evenodd",
20
+ d: "M11.63 6.3a.56.56 0 0 0 .6-.92.84.84 0 0 0-1.2 0 .56.56 0 0 0 .6.92Z",
21
+ fill: "currentColor"
22
+ }), /* @__PURE__ */ jsx("path", {
23
+ fillRule: "evenodd",
24
+ clipRule: "evenodd",
25
+ d: "M11.96 5.97a.56.56 0 0 0-.93-.6.85.85 0 0 0 0 1.2.56.56 0 0 0 .93-.6Z",
26
+ fill: "currentColor"
27
+ }), /* @__PURE__ */ jsx("path", {
28
+ fillRule: "evenodd",
29
+ clipRule: "evenodd",
30
+ d: "M11.63 5.64a.56.56 0 0 0-.6.93.84.84 0 0 0 1.2 0 .56.56 0 0 0-.6-.93ZM14.61 2.2a.56.56 0 0 1 .8 0 .84.84 0 0 1 0 1.19.56.56 0 0 1-.92-.6.56.56 0 0 1 .12-.6Z",
31
+ fill: "currentColor"
32
+ }), /* @__PURE__ */ jsx("path", {
33
+ fillRule: "evenodd",
34
+ clipRule: "evenodd",
35
+ d: "M14.81 3.12a.56.56 0 0 0 .6-.93.84.84 0 0 0-1.2 0 .56.56 0 0 0 .6.93Z",
36
+ fill: "currentColor"
37
+ }), /* @__PURE__ */ jsx("path", {
38
+ fillRule: "evenodd",
39
+ clipRule: "evenodd",
40
+ d: "M15.14 2.79a.56.56 0 0 0-.92-.6.84.84 0 0 0 0 1.2.56.56 0 0 0 .92-.6Z",
41
+ fill: "currentColor"
42
+ }), /* @__PURE__ */ jsx("path", {
43
+ fillRule: "evenodd",
44
+ clipRule: "evenodd",
45
+ d: "M14.81 2.46a.56.56 0 0 0-.6.93.84.84 0 0 0 1.2 0 .56.56 0 0 0-.6-.93ZM14.61 10.15a.56.56 0 0 1 .8 0 .84.84 0 0 1 0 1.2.56.56 0 0 1-.92-.6.56.56 0 0 1 .12-.6Z",
46
+ fill: "currentColor"
47
+ }), /* @__PURE__ */ jsx("path", {
48
+ fillRule: "evenodd",
49
+ clipRule: "evenodd",
50
+ d: "M14.81 11.07a.56.56 0 0 0 .6-.92.84.84 0 0 0-1.2 0 .56.56 0 0 0 .6.92Z",
51
+ fill: "currentColor"
52
+ }), /* @__PURE__ */ jsx("path", {
53
+ fillRule: "evenodd",
54
+ clipRule: "evenodd",
55
+ d: "M15.14 10.74a.56.56 0 0 0-.92-.6.84.84 0 0 0 0 1.2.56.56 0 0 0 .92-.6Z",
56
+ fill: "currentColor"
57
+ }), /* @__PURE__ */ jsx("path", {
58
+ fillRule: "evenodd",
59
+ clipRule: "evenodd",
60
+ d: "M14.81 10.42a.56.56 0 0 0-.6.92.84.84 0 0 0 1.2 0 .56.56 0 0 0-.6-.92ZM5.87 2.99a.56.56 0 0 1 .8 0 .85.85 0 0 1 0 1.19.56.56 0 0 1-.93-.6.56.56 0 0 1 .13-.6Z",
61
+ fill: "currentColor"
62
+ }), /* @__PURE__ */ jsx("path", {
63
+ fillRule: "evenodd",
64
+ clipRule: "evenodd",
65
+ d: "M6.06 3.91a.56.56 0 0 0 .6-.92.84.84 0 0 0-1.2 0 .56.56 0 0 0 .6.92Z",
66
+ fill: "currentColor"
67
+ }), /* @__PURE__ */ jsx("path", {
68
+ fillRule: "evenodd",
69
+ clipRule: "evenodd",
70
+ d: "M6.4 3.58a.56.56 0 0 0-.93-.6.84.84 0 0 0 0 1.2.56.56 0 0 0 .92-.6Z",
71
+ fill: "currentColor"
72
+ }), /* @__PURE__ */ jsx("path", {
73
+ fillRule: "evenodd",
74
+ clipRule: "evenodd",
75
+ d: "M6.06 3.26a.56.56 0 0 0-.6.92.84.84 0 0 0 1.2 0 .56.56 0 0 0-.6-.92ZM9.58 0c.3-.03.59.2.62.5.17 1.5.03 3-.42 4.44a.56.56 0 1 1-1.07-.33c.4-1.29.52-2.64.37-3.99a.56.56 0 0 1 .5-.62ZM12.54 1.04c.3.07.5.36.44.67l-.4 1.98a.56.56 0 1 1-1.1-.22l.4-1.98c.06-.3.35-.5.66-.45ZM13.06 8.22c1.43-.45 2.95-.59 4.44-.42a.56.56 0 1 1-.12 1.12 9.81 9.81 0 0 0-4 .37.56.56 0 0 1-.32-1.07ZM16.96 5.46c.06.3-.14.6-.45.66l-1.98.4a.56.56 0 1 1-.22-1.1l1.98-.4c.3-.06.6.14.67.44Z",
76
+ fill: "currentColor"
77
+ })]
78
+ });
79
+ };
80
+ export { Success as S };
@@ -0,0 +1,2 @@
1
+ import { FC } from "react";
2
+ export declare const Warning: FC;
@@ -0,0 +1,14 @@
1
+ import { j as jsx } from "../core/RiksTV.js";
2
+ const Warning = () => {
3
+ return /* @__PURE__ */ jsx("svg", {
4
+ width: "100%",
5
+ fill: "none",
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 18 18",
8
+ children: /* @__PURE__ */ jsx("path", {
9
+ d: "M17.6 14.94 10.59 1.55a1.5 1.5 0 0 0-2.66 0l-7 13.4a1.5 1.5 0 0 0 1.32 2.19h14.02a1.5 1.5 0 0 0 1.33-2.2ZM8.51 6.26a.75.75 0 1 1 1.5 0v4.5a.75.75 0 1 1-1.5 0v-4.5Zm.79 8.63h-.02a1.15 1.15 0 0 1-1.07-1.53 1.1 1.1 0 0 1 1.01-.72h.02a1.15 1.15 0 0 1 1.08 1.53 1.1 1.1 0 0 1-1.02.72Z",
10
+ fill: "currentColor"
11
+ })
12
+ });
13
+ };
14
+ export { Warning as W };
@@ -0,0 +1,95 @@
1
+ @use "../core/mixin/fluid";
2
+ @use "../core/mixin/focus";
3
+ @use "../core/mixin/breakpoints" as break;
4
+
5
+ .rds-panel {
6
+ --panel-info-background-color: var(--rds-heading-accent);
7
+ --panel-info-color: var(--rds-background-secondary);
8
+ --panel-warning-background-color: var(--rds-background-secondary);
9
+ --panel-warning-color: var(--rds-foreground-primary);
10
+ --panel-fluid-padding: clamp(var(--rds-spacing--16), 2vw, var(--rds-spacing--32));
11
+ --panel-border: none;
12
+ --panel-color: #fff;
13
+
14
+ padding: var(--panel-fluid-padding);
15
+ border-radius: var(--rds-roundness--medium);
16
+ border: var(--panel-border);
17
+ display: flex;
18
+ align-items: flex-end;
19
+ justify-content: space-between;
20
+ max-width: var(--rds-content-width--default);
21
+
22
+ &__heading {
23
+ margin: 0;
24
+ margin-bottom: var(--rds-spacing--8);
25
+ & > span {
26
+ color: var(--panel-color);
27
+ }
28
+ }
29
+
30
+ &__content {
31
+ max-width: var(--rds-readability-width);
32
+ & > span {
33
+ color: var(--panel-color);
34
+ }
35
+ &__heading {
36
+ display: flex;
37
+ align-items: baseline;
38
+
39
+ &__icon {
40
+ display: inline-block;
41
+ width: 1.125em;
42
+ margin-right: 0.5em;
43
+ color: var(--panel-color);
44
+ }
45
+ }
46
+ }
47
+
48
+ &__action {
49
+ display: flex;
50
+ flex-direction: column;
51
+ gap: var(--rds-spacing--16);
52
+ margin-left: var(--rds-spacing--32);
53
+
54
+ & > button {
55
+ width: fit-content;
56
+ }
57
+ }
58
+
59
+ @include break.breakpoint("sm") {
60
+ flex-direction: column;
61
+ align-items: flex-start;
62
+
63
+ &__action {
64
+ margin-top: var(--rds-spacing--24);
65
+ margin-left: 0;
66
+ }
67
+ }
68
+
69
+ &--info {
70
+ background-color: var(--panel-info-background-color);
71
+ --panel-color: var(--panel-info-color);
72
+ }
73
+
74
+ &--warning {
75
+ background-color: var(--panel-warning-background-color);
76
+ --panel-color: var(--panel-warning-color);
77
+ }
78
+
79
+ // Only handled for Strim
80
+ &--error {
81
+ background-color: var(--strim-error-light);
82
+ --panel-color: var(--strim-fantasy-green);
83
+ }
84
+ }
85
+
86
+ .rds-light {
87
+ .rds-panel,
88
+ &.rds-panel {
89
+ --panel-info-background-color: var(--rds-heading-accent);
90
+ --panel-info-color: var(--rds-background-secondary);
91
+ --panel-warning-background-color: var(--rds-foreground-primary);
92
+ --panel-warning-color: var(--rds-background-secondary);
93
+ --panel-border: 2px solid var(--rds-foreground-tertiary);
94
+ }
95
+ }
@@ -0,0 +1,11 @@
1
+ import { HTMLAttributes } from "react";
2
+ import "./circularProgress.scss";
3
+ interface Props extends HTMLAttributes<HTMLDivElement> {
4
+ progressRatio: number;
5
+ label: string;
6
+ size?: "small" | "large";
7
+ className?: string;
8
+ }
9
+ export declare const calculateProgress: ({ progressRatio }: Pick<Props, "progressRatio">) => number;
10
+ export declare const CircularProgress: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
11
+ export {};
@@ -0,0 +1,87 @@
1
+ import { forwardRef, useState, useEffect } from "react";
2
+ import { S as Span } from "../typography/Typography.js";
3
+ import { a as jsxs, F as Fragment, j as jsx } from "../core/RiksTV.js";
4
+ var circularProgress = /* @__PURE__ */ (() => ".rds-progress--circular{width:var(--progress-circle-size);height:var(--progress-circle-size);position:relative}.rds-progress--circular__outer{width:var(--progress-circle-size);height:var(--progress-circle-size);padding:var(--rds-spacing--24);border-radius:50%;display:grid;place-items:center;box-sizing:border-box;text-align:center}.rds-progress--circular #path,.rds-progress--circular #prog{fill:none;stroke-width:12px;stroke-dasharray:314.159;stroke-dashoffset:314}.rds-progress--circular #prog{stroke:url(#GradientColor);animation:rds-in var(--progress) ease-in-out forwards;animation-delay:.2s}@media (prefers-reduced-motion){.rds-progress--circular #prog{opacity:0;animation-delay:0;stroke-dashoffset:var(--calculated-progress);animation:rds-progress-reduced 125ms linear forwards}}.rds-progress--circular #path{stroke:var(--rds-background-overlay-medium);animation:rds-in-path 1s ease-in-out forwards}@media (prefers-reduced-motion){.rds-progress--circular #path{opacity:0;stroke-dashoffset:0;animation:rds-progress-reduced 125ms linear forwards}}@keyframes rds-progress-reduced{to{opacity:1}}@keyframes rds-in-path{to{stroke-dashoffset:0}}@keyframes rds-in{to{stroke-dashoffset:var(--calculated-progress)}}.rds-progress--circular svg{position:absolute;inset:0;transform:rotate(90deg)}\n")();
5
+ const calculateProgress = ({
6
+ progressRatio
7
+ }) => (1 - progressRatio) * 100 * Math.PI;
8
+ const CircularProgress = forwardRef(({
9
+ progressRatio,
10
+ label,
11
+ size = "small",
12
+ className = "",
13
+ children,
14
+ ...rest
15
+ }, ref) => {
16
+ const [calculatedProgress, setCalculatedProgress] = useState(0);
17
+ const [sizeInPx] = useState(size === "small" ? "160px" : "260px");
18
+ useEffect(() => {
19
+ setCalculatedProgress(calculateProgress({
20
+ progressRatio
21
+ }));
22
+ }, [progressRatio]);
23
+ return /* @__PURE__ */ jsxs(Fragment, {
24
+ children: [/* @__PURE__ */ jsxs("label", {
25
+ className: "sr-only",
26
+ "data-testid": "rds-progress__label",
27
+ children: [label, /* @__PURE__ */ jsx("progress", {
28
+ "data-testid": "rds-progress__progress",
29
+ value: progressRatio,
30
+ max: 1
31
+ })]
32
+ }), /* @__PURE__ */ jsxs("div", {
33
+ ref,
34
+ "data-testid": "rds-progress",
35
+ className: `rds-progress--circular ${className}`,
36
+ style: {
37
+ "--progress-circle-size": sizeInPx
38
+ },
39
+ ...rest,
40
+ children: [/* @__PURE__ */ jsx("div", {
41
+ className: "rds-progress--circular__outer",
42
+ "data-testid": "rds-progress__content",
43
+ children: children || /* @__PURE__ */ jsx(Span, {
44
+ "data-testid": "rds-progress__default-text",
45
+ lookLike: "title-3",
46
+ children: progressRatio === 1 ? "Du er i m\xE5l!" : `${progressRatio * 100} %`
47
+ })
48
+ }), /* @__PURE__ */ jsxs("svg", {
49
+ style: {
50
+ "--calculated-progress": calculatedProgress,
51
+ "--progress": `${progressRatio + 1}s`
52
+ },
53
+ xmlns: "http://www.w3.org/2000/svg",
54
+ version: "1.1",
55
+ width: "var(--progress-circle-size)",
56
+ height: "var(--progress-circle-size)",
57
+ viewBox: "-10 0 120 100",
58
+ children: [/* @__PURE__ */ jsx("defs", {
59
+ children: /* @__PURE__ */ jsxs("linearGradient", {
60
+ id: "GradientColor",
61
+ children: [/* @__PURE__ */ jsx("stop", {
62
+ offset: "0%",
63
+ stopColor: "var(--rds-heading-accent)"
64
+ }), /* @__PURE__ */ jsx("stop", {
65
+ offset: "100%",
66
+ stopColor: "var(--rds-background-card)"
67
+ })]
68
+ })
69
+ }), /* @__PURE__ */ jsx("circle", {
70
+ id: "path",
71
+ cx: "50",
72
+ cy: "50",
73
+ r: "50",
74
+ strokeLinecap: "round"
75
+ }), /* @__PURE__ */ jsx("circle", {
76
+ id: "prog",
77
+ cx: "50",
78
+ cy: "50",
79
+ r: "50",
80
+ strokeLinecap: "round"
81
+ })]
82
+ })]
83
+ })]
84
+ });
85
+ });
86
+ CircularProgress.displayName = "CircularProgress";
87
+ export { CircularProgress as C };
@@ -0,0 +1,11 @@
1
+ import { HTMLAttributes } from "react";
2
+ import "./Progress.scss";
3
+ interface Props extends HTMLAttributes<HTMLProgressElement> {
4
+ label: string;
5
+ ratio: number;
6
+ checkmarkOnDone?: boolean;
7
+ animateIn?: boolean;
8
+ className?: string;
9
+ }
10
+ export declare const Progress: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLProgressElement>>;
11
+ export {};
@@ -0,0 +1,42 @@
1
+ import { forwardRef } from "react";
2
+ import { a as jsxs, j as jsx } from "../core/RiksTV.js";
3
+ var Progress$1 = /* @__PURE__ */ (() => '.rds-progress{--rds-progress-height: .1875rem;--rds-progress-color: var(--rds-accent-color);--rds-progress-track-color: var(--rds-foreground-overlay-medium);max-width:300px}.rds-progress--animate .rds-progress__progress{animation:move-in-progress .25s ease-in-out forwards}@media (prefers-reduced-motion){.rds-progress--animate .rds-progress__progress{animation-duration:0ms}}@keyframes move-in-progress{0%{transform:scaleX(var(--progress)) translate(-100%)}to{transform:scaleX(var(--progress)) translate(0)}}.rds-progress__track{width:100%;height:var(--rds-progress-height);background-color:var(--rds-progress-track-color);border-radius:var(--rds-roundness--default);overflow:hidden}.rds-progress__progress{width:100%;height:var(--rds-progress-height);background-color:var(--rds-progress-color);transform:scaleX(var(--progress));transform-origin:left;position:relative}.rds-progress__progress:after{content:"";position:absolute;right:calc(var(--rds-progress-height) * -2);top:0;background-color:var(--rds-progress-color);border-top-right-radius:50%;border-bottom-right-radius:50%;height:100%;width:calc(var(--rds-progress-height) * 2)}.rds-progress--done{width:1em;height:1em;background-color:var(--rds-feedback-confirm);clip-path:polygon(33.59% 75.55%,2.27% 44.24%,2.27% 33.29%,13.21% 33.29%,35.62% 55.65%,89% 2.27%,100% 2.27%,100% 13.21%,37.6% 75.55%,33.59% 75.55%)}\n')();
4
+ const Progress = forwardRef(({
5
+ className = "",
6
+ label,
7
+ ratio,
8
+ checkmarkOnDone = false,
9
+ animateIn = false,
10
+ ...rest
11
+ }, ref) => {
12
+ const progressStyle = {
13
+ "--progress": ratio
14
+ };
15
+ return /* @__PURE__ */ jsxs("div", {
16
+ "data-testid": "rds-progress__wrapper",
17
+ className: `rds-progress ${animateIn ? "rds-progress--animate" : ""} ${className}`,
18
+ children: [/* @__PURE__ */ jsxs("label", {
19
+ "data-testid": "rds-progress__label",
20
+ className: "sr-only",
21
+ children: [/* @__PURE__ */ jsx("progress", {
22
+ "data-testid": "rds-progress__sr",
23
+ max: 1,
24
+ value: ratio,
25
+ ref,
26
+ ...rest
27
+ }), label]
28
+ }), ratio === 1 && checkmarkOnDone && /* @__PURE__ */ jsx("div", {
29
+ "data-testid": "rds-progress__mark",
30
+ className: "rds-progress--done"
31
+ }), (ratio !== 1 || !checkmarkOnDone) && /* @__PURE__ */ jsx("div", {
32
+ className: "rds-progress__track",
33
+ children: /* @__PURE__ */ jsx("div", {
34
+ "data-testid": "rds-progress__bar",
35
+ style: progressStyle,
36
+ className: "rds-progress__progress"
37
+ })
38
+ })]
39
+ });
40
+ });
41
+ Progress.displayName = "Progress";
42
+ export { Progress as P };
@@ -0,0 +1,76 @@
1
+ @use "../core/mixin/rem";
2
+
3
+ .rds-progress {
4
+ --rds-progress-height: #{rem.convert(3px)};
5
+ --rds-progress-color: var(--rds-accent-color);
6
+ --rds-progress-track-color: var(--rds-foreground-overlay-medium);
7
+
8
+ max-width: 300px;
9
+
10
+ &--animate {
11
+ .rds-progress__progress {
12
+ animation: move-in-progress 250ms ease-in-out forwards;
13
+
14
+ @media (prefers-reduced-motion) {
15
+ animation-duration: 0ms;
16
+ }
17
+ }
18
+ }
19
+
20
+ @keyframes move-in-progress {
21
+ 0% {
22
+ transform: scaleX(var(--progress)) translateX(-100%);
23
+ }
24
+ 100% {
25
+ transform: scaleX(var(--progress)) translateX(0px);
26
+ }
27
+ }
28
+
29
+ &__track {
30
+ width: 100%;
31
+ height: var(--rds-progress-height);
32
+ background-color: var(--rds-progress-track-color);
33
+ border-radius: var(--rds-roundness--default);
34
+ overflow: hidden;
35
+ }
36
+
37
+ &__progress {
38
+ width: 100%;
39
+ height: var(--rds-progress-height);
40
+ background-color: var(--rds-progress-color);
41
+ transform: scaleX(var(--progress));
42
+ transform-origin: left;
43
+ position: relative;
44
+
45
+ &::after {
46
+ content: "";
47
+ position: absolute;
48
+ right: calc(var(--rds-progress-height) * -2);
49
+ top: 0;
50
+ background-color: var(--rds-progress-color);
51
+ border-top-right-radius: 50%;
52
+ border-bottom-right-radius: 50%;
53
+ height: 100%;
54
+ width: calc(var(--rds-progress-height) * 2);
55
+ }
56
+ }
57
+
58
+ &--done {
59
+ width: 1em;
60
+ height: 1em;
61
+ background-color: var(--rds-feedback-confirm);
62
+
63
+ clip-path: polygon(
64
+ 33.59% 75.55%,
65
+ 2.27% 44.24%,
66
+ 2.27% 33.29%,
67
+ 13.21% 33.29%,
68
+ 35.62% 55.65%,
69
+ 89% 2.27%,
70
+ 100% 2.27%,
71
+ 100% 13.21%,
72
+ 37.6% 75.55%,
73
+ 33.59% 75.55%
74
+ );
75
+ }
76
+ }
@@ -0,0 +1,70 @@
1
+ .rds-progress--circular {
2
+ width: var(--progress-circle-size);
3
+ height: var(--progress-circle-size);
4
+ position: relative;
5
+
6
+ &__outer {
7
+ width: var(--progress-circle-size);
8
+ height: var(--progress-circle-size);
9
+ padding: var(--rds-spacing--24);
10
+ border-radius: 50%;
11
+ display: grid;
12
+ place-items: center;
13
+ box-sizing: border-box;
14
+ text-align: center;
15
+ }
16
+
17
+ #path,
18
+ #prog {
19
+ fill: none;
20
+ stroke-width: 12px;
21
+ stroke-dasharray: 314.159;
22
+ stroke-dashoffset: 314;
23
+ }
24
+
25
+ #prog {
26
+ stroke: url(#GradientColor);
27
+ animation: rds-in var(--progress) ease-in-out forwards;
28
+ animation-delay: 200ms;
29
+ @media (prefers-reduced-motion) {
30
+ opacity: 0;
31
+ animation-delay: 0;
32
+ stroke-dashoffset: var(--calculated-progress);
33
+ animation: rds-progress-reduced 125ms linear forwards;
34
+ }
35
+ }
36
+
37
+ #path {
38
+ stroke: var(--rds-background-overlay-medium);
39
+ animation: rds-in-path 1s ease-in-out forwards;
40
+ @media (prefers-reduced-motion) {
41
+ opacity: 0;
42
+ stroke-dashoffset: 0;
43
+ animation: rds-progress-reduced 125ms linear forwards;
44
+ }
45
+ }
46
+
47
+ @keyframes rds-progress-reduced {
48
+ 100% {
49
+ opacity: 1;
50
+ }
51
+ }
52
+
53
+ @keyframes rds-in-path {
54
+ 100% {
55
+ stroke-dashoffset: 0;
56
+ }
57
+ }
58
+
59
+ @keyframes rds-in {
60
+ 100% {
61
+ stroke-dashoffset: var(--calculated-progress);
62
+ }
63
+ }
64
+
65
+ svg {
66
+ position: absolute;
67
+ inset: 0;
68
+ transform: rotate(90deg);
69
+ }
70
+ }
@@ -0,0 +1,13 @@
1
+ import { j as jsx } from "../core/RiksTV.js";
2
+ const Gutter = ({
3
+ className = "",
4
+ children,
5
+ ...rest
6
+ }) => {
7
+ return /* @__PURE__ */ jsx("div", {
8
+ className: `rds-gutter ${className}`,
9
+ ...rest,
10
+ children
11
+ });
12
+ };
13
+ export { Gutter as G };
@@ -0,0 +1,13 @@
1
+ import { j as jsx } from "../core/RiksTV.js";
2
+ const GutterPadding = ({
3
+ className = "",
4
+ children,
5
+ ...rest
6
+ }) => {
7
+ return /* @__PURE__ */ jsx("div", {
8
+ className: `rds-gutter-padding ${className}`,
9
+ ...rest,
10
+ children
11
+ });
12
+ };
13
+ export { GutterPadding as G };
@@ -1,13 +1,14 @@
1
1
  import { DetailedHTMLProps, InputHTMLAttributes } from "react";
2
2
  import "./textfield.scss";
3
- declare type Props = Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">;
4
- export declare const TextField: import("react").ForwardRefExoticComponent<Props & {
3
+ interface Props extends Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> {
5
4
  className?: string;
6
5
  name: string;
7
6
  label: string;
8
7
  fullWidth?: boolean;
9
- lightBackground?: boolean;
8
+ valid?: boolean;
9
+ lightBackground?: boolean | "white";
10
10
  labelClass?: string;
11
- error?: string | null | false;
12
- } & import("react").RefAttributes<HTMLInputElement>>;
11
+ errorMessage?: string;
12
+ }
13
+ export declare const TextField: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLInputElement>>;
13
14
  export {};