@rikstv/shared-components 0.6.5 → 0.6.6
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/dist/accordion/Accordion.css +1 -0
- package/dist/accordion/Accordion.d.ts +10 -0
- package/dist/accordion/Accordion.js +73 -0
- package/dist/accordion/accordion.scss +126 -0
- package/dist/button/BaseButton.js +78 -1
- package/dist/button/Button.js +40 -1
- package/dist/button/IconButton.js +40 -1
- package/dist/core/Core.js +76 -1
- package/dist/core/LightMode.js +50 -1
- package/dist/core/RiksTV.css +1 -1
- package/dist/core/RiksTV.js +107 -2
- package/dist/core/Strim.css +1 -1
- package/dist/core/Strim.js +10 -1
- package/dist/core/rtv.scss +5 -1
- package/dist/core/strm.scss +12 -6
- package/dist/icons/Chevron.d.ts +2 -0
- package/dist/icons/Chevron.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/shared-components.es.js +14 -1
- package/dist/toggle/FieldSet.js +66 -1
- package/dist/toggle/RadioToggle.js +65 -1
- package/dist/toggleButton/ToggleButton.js +106 -1
- package/dist/typography/Typography.js +95 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.rds-link{font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;color:var(--rds-foreground-primary);transition:75ms ease color}.rds-link:visited{color:var(--rds-foreground-primary)}.rds-link:hover{text-decoration-thickness:2px;color:var(--rds-heading-accent)}.rds-link:active{text-decoration:none;text-shadow:0px 0px 1px var(--rds-foreground-primary)}.rds-link--active,.rds-link[aria-current=page]{text-shadow:0px 0px 1px var(--rds-foreground-primary)}.rds-link:focus::-moz-focus-inner{border-style:none;outline:0}.rds-link:focus button::-moz-focus-inner,.rds-link:focus [type=button]::-moz-focus-inner,.rds-link:focus [type=reset]::-moz-focus-inner,.rds-link:focus [type=submit]::-moz-focus-inner{border-style:none}.rds-link:focus input[type=button]::-moz-focus-inner{outline:0}html:not([data-mousenavigation]):not([data-touchnavigation]) .rds-link:focus{outline-offset:2px;outline:2px solid var(--rds-feedback-info);transition:outline-offset .25s ease}.rds-display-title{font-family:var(--rds-font-family-lg-headlines);font-size:clamp(2.5rem,calc(1.4285714286rem + 2.9761904762vw),5rem);font-weight:normal;line-height:1.2;color:var(--rds-foreground-primary)}.rds-title-1{font-family:var(--rds-font-family-lg-headlines);font-size:clamp(1.875rem,calc(1.1785714286rem + 1.9345238095vw),3.5rem);font-weight:normal;line-height:1.2;color:var(--rds-foreground-primary)}.rds-title-2{font-family:var(--rds-font-family-lg-headlines);font-size:clamp(1.5rem,calc(1.0714285714rem + 1.1904761905vw),2.5rem);font-weight:normal;line-height:1.2;color:var(--rds-foreground-primary)}.rds-title-3{font-family:var(--rds-font-family-m-headlines);font-size:clamp(1.25rem,calc(1.1964285714rem + .1488095238vw),1.375rem);font-weight:normal;line-height:1.2;color:var(--rds-heading-accent)}.rds-title-4{font-family:var(--rds-font-family-m-headlines);font-size:clamp(1rem,calc(.9464285714rem + .1488095238vw),1.125rem);font-weight:normal;line-height:1.2;color:var(--rds-foreground-primary)}.rds-body{font-family:var(--rds-font-family-body);font-size:clamp(1rem,calc(.9464285714rem + .1488095238vw),1.125rem);font-weight:normal;line-height:1.5;color:var(--rds-foreground-primary)}.rds-sub-body{font-family:var(--rds-font-family-body);font-size:clamp(.875rem,calc(.8214285714rem + .1488095238vw),1rem);font-weight:normal;line-height:1.5;color:var(--rds-foreground-primary)}.rds-tag{font-family:var(--rds-font-family-headlines);text-transform:uppercase;font-size:clamp(.75rem,calc(.6964285714rem + .1488095238vw),.875rem);line-height:1.2;font-weight:normal;letter-spacing:.09375rem;color:var(--rds-foreground-primary)}.rds-bold,.rds-accordion-details__summary{font-family:var(--rds-font-family-headlines);font-size:clamp(1.125rem,calc(1.125rem + 0vw),1.125rem);font-weight:normal;line-height:1.5;color:var(--rds-foreground-primary)}.rds-meta{font-family:var(--rds-font-family-body);font-size:clamp(.75rem,calc(.6964285714rem + .1488095238vw),.875rem);font-weight:normal;line-height:1.5;color:var(--rds-foreground-overlay-heavy)}.rds-link--light,.rds-light .rds-link{color:var(--rds-background-primary)}.rds-link--light:hover,.rds-light .rds-link:hover{color:var(--rds-foreground-tertiary)}.rds-link--light:active,.rds-light .rds-link:active{text-shadow:0px 0px 1px var(--rds-background-primary)}.rds-light .rds-display-title{color:var(--rds-foreground-tertiary)}.rds-display-title--light{color:var(--rds-foreground-tertiary)}.rds-light .rds-title-1{color:var(--rds-button-primary-fg)}.rds-title-1--light{color:var(--rds-button-primary-fg)}.rds-light .rds-title-2{color:var(--rds-button-primary-fg)}.rds-title-2--light{color:var(--rds-button-primary-fg)}.rds-light .rds-title-3{color:var(--rds-button-primary-fg)}.rds-title-3--light{color:var(--rds-button-primary-fg)}.rds-light .rds-title-4{color:var(--rds-button-primary-fg)}.rds-title-4--light{color:var(--rds-button-primary-fg)}.rds-light .rds-body{color:var(--rds-background-primary)}.rds-body--light{color:var(--rds-background-primary)}.rds-light .rds-sub-body{color:var(--rds-button-primary-fg)}.rds-sub-body--light{color:var(--rds-button-primary-fg)}.rds-light .rds-tag{color:var(--rds-background-primary)}.rds-tag--light{color:var(--rds-background-primary)}.rds-light .rds-bold,.rds-light .rds-accordion-details__summary{color:var(--rds-background-primary)}.rds-bold--light{color:var(--rds-background-primary)}.rds-light .rds-meta{color:var(--rds-button-primary-fg)}.rds-meta--light{color:var(--rds-button-primary-fg)}@keyframes details-sweep{0%{opacity:0}to{opacity:1}}.rds-accordion-details{border-radius:var(--rds-roundness--default);transition:125ms ease-in-out box-shadow}.rds-accordion-details:hover{box-shadow:0 8px 18px #0000004d}.rds-accordion-details[open]{--chevron-direction: 180deg;background-color:var(--rds-foreground-solid-soft);overflow:hidden}.rds-accordion-details[open] summary~*{animation:details-sweep .5s ease-in-out forwards}.rds-accordion-details[open] summary~*>*{--toggle-sweep-delay: 0;opacity:0;animation:details-sweep .5s ease-in-out forwards;animation-delay:var(--toggle-sweep-delay)}.rds-accordion-details[open]:hover{box-shadow:0 8px 18px #0000004d}.rds-accordion-details:not([open]){--chevron-direction: 0}.rds-accordion-details:not([open]):hover{box-shadow:none}.rds-accordion-details:not([open]):hover .rds-accordion-details__summary{box-shadow:0 8px 18px #0000004d}.rds-accordion-details__summary{transition:125ms ease-in-out box-shadow;border-radius:var(--rds-roundness--default);background-color:var(--rds-foreground-solid-soft);color:var(--rds-foreground-primary)!important;cursor:pointer;list-style:none;user-select:none;height:3rem;display:flex;align-items:center;align-self:center;position:relative;padding:8px 32px 8px 16px}.rds-accordion-details__summary:focus::-moz-focus-inner{border-style:none;outline:0}.rds-accordion-details__summary:focus button::-moz-focus-inner,.rds-accordion-details__summary:focus [type=button]::-moz-focus-inner,.rds-accordion-details__summary:focus [type=reset]::-moz-focus-inner,.rds-accordion-details__summary:focus [type=submit]::-moz-focus-inner{border-style:none}.rds-accordion-details__summary:focus input[type=button]::-moz-focus-inner{outline:0}html:not([data-mousenavigation]):not([data-touchnavigation]) .rds-accordion-details__summary:focus{outline-offset:2px;outline:2px solid var(--rds-feedback-info);transition:outline-offset .25s ease}.rds-accordion-details__summary>svg{height:100%;transform:rotate(var(--chevron-direction));transition:transform 125ms ease-in-out;transform-origin:center;position:absolute;right:18px;top:0}.rds-accordion-details__summary>svg>path{fill:var(--rds-foreground-primary)}.rds-accordion-details__summary__content{box-sizing:border-box;display:flex;align-items:center;height:100%}.rds-accordion-details__summary::marker,.rds-accordion-details__summary::-webkit-details-marker{display:none}.rds-accordion-details__summary~*{padding:0 32px 16px 16px}.rds-accordion-details--left>summary{padding:8px 32px 8px 64px}.rds-accordion-details--left>summary>svg{right:initial;left:18px}.rds-accordion-details--hide-default-text>summary{max-width:100%;height:100%;background-color:transparent;margin-bottom:0}.rds-accordion-details--light[open],.rds-light [open].rds-accordion-details{background-color:var(--rds-surface-foreground)}.rds-accordion-details--light .rds-accordion-details__summary,.rds-light .rds-accordion-details .rds-accordion-details__summary{background-color:var(--rds-surface-foreground)}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DetailedHTMLProps, FC, HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import "./accordion.scss";
|
|
3
|
+
interface Props extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
4
|
+
heading: ReactNode;
|
|
5
|
+
initialOpen?: boolean;
|
|
6
|
+
alignChevronLeft?: boolean;
|
|
7
|
+
lightBackground?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const Accordion: FC<Props>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { useRef, useEffect } from "react";
|
|
33
|
+
import { C as Chevron } from "../icons/Chevron.js";
|
|
34
|
+
import { a as jsxs, j as jsx } from "../core/RiksTV.js";
|
|
35
|
+
var accordion = "";
|
|
36
|
+
const Accordion = (_a) => {
|
|
37
|
+
var _b = _a, {
|
|
38
|
+
initialOpen = true,
|
|
39
|
+
children,
|
|
40
|
+
heading,
|
|
41
|
+
className = "",
|
|
42
|
+
alignChevronLeft = false,
|
|
43
|
+
lightBackground = false
|
|
44
|
+
} = _b, rest = __objRest(_b, [
|
|
45
|
+
"initialOpen",
|
|
46
|
+
"children",
|
|
47
|
+
"heading",
|
|
48
|
+
"className",
|
|
49
|
+
"alignChevronLeft",
|
|
50
|
+
"lightBackground"
|
|
51
|
+
]);
|
|
52
|
+
const ref = useRef(null);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (ref.current) {
|
|
55
|
+
ref.current.open = initialOpen;
|
|
56
|
+
}
|
|
57
|
+
}, [initialOpen]);
|
|
58
|
+
return /* @__PURE__ */ jsxs("details", __spreadProps(__spreadValues({
|
|
59
|
+
ref,
|
|
60
|
+
"data-testid": "rds-accordion",
|
|
61
|
+
className: `rds-accordion-details ${lightBackground ? "rds-accordion-details--light" : ""} ${alignChevronLeft ? "rds-accordion-details--left" : ""} ${className}`
|
|
62
|
+
}, rest), {
|
|
63
|
+
children: [/* @__PURE__ */ jsxs("summary", {
|
|
64
|
+
"data-testid": "rds-accordion-summary",
|
|
65
|
+
className: "rds-accordion-details__summary",
|
|
66
|
+
children: [/* @__PURE__ */ jsx(Chevron, {}), /* @__PURE__ */ jsx("div", {
|
|
67
|
+
className: "rds-accordion-details__summary__content",
|
|
68
|
+
children: heading
|
|
69
|
+
})]
|
|
70
|
+
}), children]
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
export { Accordion as A };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
@use "../typography/typography.scss";
|
|
2
|
+
@use "../core/mixin/focus.scss";
|
|
3
|
+
|
|
4
|
+
@keyframes details-sweep {
|
|
5
|
+
0% {
|
|
6
|
+
opacity: 0;
|
|
7
|
+
}
|
|
8
|
+
100% {
|
|
9
|
+
opacity: 1;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.rds-accordion-details {
|
|
14
|
+
border-radius: var(--rds-roundness--default);
|
|
15
|
+
transition: 125ms ease-in-out box-shadow;
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
box-shadow: 0px 8px 18px rgba(0, 0, 0, 0.3);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&[open] {
|
|
22
|
+
--chevron-direction: 180deg;
|
|
23
|
+
background-color: var(--rds-foreground-solid-soft);
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
|
|
26
|
+
& summary ~ * {
|
|
27
|
+
animation: details-sweep 0.5s ease-in-out forwards;
|
|
28
|
+
& > * {
|
|
29
|
+
--toggle-sweep-delay: 0;
|
|
30
|
+
opacity: 0;
|
|
31
|
+
animation: details-sweep 0.5s ease-in-out forwards;
|
|
32
|
+
animation-delay: var(--toggle-sweep-delay);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&:hover {
|
|
36
|
+
box-shadow: 0px 8px 18px rgba(0, 0, 0, 0.3);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:not([open]) {
|
|
41
|
+
--chevron-direction: 0;
|
|
42
|
+
&:hover {
|
|
43
|
+
box-shadow: none;
|
|
44
|
+
.rds-accordion-details__summary {
|
|
45
|
+
box-shadow: 0px 8px 18px rgba(0, 0, 0, 0.3);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__summary {
|
|
51
|
+
@include focus.with-keyboard-focus();
|
|
52
|
+
@extend .rds-bold;
|
|
53
|
+
transition: 125ms ease-in-out box-shadow;
|
|
54
|
+
border-radius: var(--rds-roundness--default);
|
|
55
|
+
background-color: var(--rds-foreground-solid-soft);
|
|
56
|
+
color: var(--rds-foreground-primary) !important;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
list-style: none;
|
|
59
|
+
user-select: none;
|
|
60
|
+
height: 3rem;
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
align-self: center;
|
|
64
|
+
position: relative;
|
|
65
|
+
padding: 8px 32px 8px 16px;
|
|
66
|
+
|
|
67
|
+
& > svg {
|
|
68
|
+
height: 100%;
|
|
69
|
+
& > path {
|
|
70
|
+
fill: var(--rds-foreground-primary);
|
|
71
|
+
}
|
|
72
|
+
transform: rotate(var(--chevron-direction));
|
|
73
|
+
transition: transform 125ms ease-in-out;
|
|
74
|
+
transform-origin: center;
|
|
75
|
+
position: absolute;
|
|
76
|
+
right: 18px;
|
|
77
|
+
top: 0;
|
|
78
|
+
}
|
|
79
|
+
&__content {
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
height: 100%;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&::marker,
|
|
87
|
+
&::-webkit-details-marker {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
& ~ * {
|
|
92
|
+
padding: 0px 32px 16px 16px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--left > summary {
|
|
97
|
+
padding: 8px 32px 8px 64px;
|
|
98
|
+
|
|
99
|
+
& > svg {
|
|
100
|
+
right: initial;
|
|
101
|
+
left: 18px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&--hide-default-text > summary {
|
|
106
|
+
max-width: 100%;
|
|
107
|
+
height: 100%;
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
margin-bottom: 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.rds-accordion-details--light {
|
|
114
|
+
&[open] {
|
|
115
|
+
background-color: var(--rds-surface-foreground);
|
|
116
|
+
}
|
|
117
|
+
.rds-accordion-details__summary {
|
|
118
|
+
background-color: var(--rds-surface-foreground);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.rds-light {
|
|
123
|
+
.rds-accordion-details {
|
|
124
|
+
@extend .rds-accordion-details--light;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -1 +1,78 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { forwardRef } from "react";
|
|
33
|
+
import { a as jsxs, j as jsx } from "../core/RiksTV.js";
|
|
34
|
+
const BaseButton = forwardRef((_a, ref) => {
|
|
35
|
+
var _b = _a, {
|
|
36
|
+
children,
|
|
37
|
+
buttonType,
|
|
38
|
+
buttonStyle,
|
|
39
|
+
type = "button",
|
|
40
|
+
isLoading = false,
|
|
41
|
+
postfix,
|
|
42
|
+
icon: Icon,
|
|
43
|
+
iconClass = "",
|
|
44
|
+
disabled,
|
|
45
|
+
className = "",
|
|
46
|
+
"aria-busy": ariaBusy
|
|
47
|
+
} = _b, rest = __objRest(_b, [
|
|
48
|
+
"children",
|
|
49
|
+
"buttonType",
|
|
50
|
+
"buttonStyle",
|
|
51
|
+
"type",
|
|
52
|
+
"isLoading",
|
|
53
|
+
"postfix",
|
|
54
|
+
"icon",
|
|
55
|
+
"iconClass",
|
|
56
|
+
"disabled",
|
|
57
|
+
"className",
|
|
58
|
+
"aria-busy"
|
|
59
|
+
]);
|
|
60
|
+
return /* @__PURE__ */ jsxs("button", __spreadProps(__spreadValues({
|
|
61
|
+
type
|
|
62
|
+
}, rest), {
|
|
63
|
+
ref,
|
|
64
|
+
disabled: isLoading || disabled,
|
|
65
|
+
"aria-busy": isLoading || ariaBusy,
|
|
66
|
+
className: `${buttonStyle} rds-button__shared rds-button__shared--${buttonType} rds-button--${buttonType} ${isLoading ? "rds-button--loading" : ""} ${className}`,
|
|
67
|
+
children: [Icon && /* @__PURE__ */ jsx("span", {
|
|
68
|
+
"data-testid": "rds-button__icon",
|
|
69
|
+
className: `rds-button__icon ${iconClass}`,
|
|
70
|
+
children: /* @__PURE__ */ jsx(Icon, {})
|
|
71
|
+
}), children, !!postfix && buttonStyle !== "rds-icon-button" && /* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "rds-button__postfix",
|
|
73
|
+
children: postfix
|
|
74
|
+
})]
|
|
75
|
+
}));
|
|
76
|
+
});
|
|
77
|
+
BaseButton.displayName = "BaseButton";
|
|
78
|
+
export { BaseButton as B };
|
package/dist/button/Button.js
CHANGED
|
@@ -1 +1,40 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { forwardRef } from "react";
|
|
18
|
+
import { B as BaseButton } from "./BaseButton.js";
|
|
19
|
+
import { j as jsx } from "../core/RiksTV.js";
|
|
20
|
+
var button = "";
|
|
21
|
+
var buttonShared = "";
|
|
22
|
+
const PrimaryButton = forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseButton, __spreadValues({
|
|
23
|
+
buttonStyle: "rds-button",
|
|
24
|
+
buttonType: "primary",
|
|
25
|
+
ref
|
|
26
|
+
}, props)));
|
|
27
|
+
PrimaryButton.displayName = "PrimaryButton";
|
|
28
|
+
const SecondaryButton = forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseButton, __spreadValues({
|
|
29
|
+
buttonStyle: "rds-button",
|
|
30
|
+
buttonType: "secondary",
|
|
31
|
+
ref
|
|
32
|
+
}, props)));
|
|
33
|
+
SecondaryButton.displayName = "SecondaryButton";
|
|
34
|
+
const TertiaryButton = forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseButton, __spreadValues({
|
|
35
|
+
buttonStyle: "rds-button",
|
|
36
|
+
buttonType: "tertiary",
|
|
37
|
+
ref
|
|
38
|
+
}, props)));
|
|
39
|
+
TertiaryButton.displayName = "TertiaryButton";
|
|
40
|
+
export { PrimaryButton as P, SecondaryButton as S, TertiaryButton as T };
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { forwardRef } from "react";
|
|
18
|
+
import { B as BaseButton } from "./BaseButton.js";
|
|
19
|
+
import "./Button.js";
|
|
20
|
+
import { j as jsx } from "../core/RiksTV.js";
|
|
21
|
+
var iconButton = "";
|
|
22
|
+
const PrimaryIconButton = forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseButton, __spreadValues({
|
|
23
|
+
buttonStyle: "rds-icon-button",
|
|
24
|
+
buttonType: "primary",
|
|
25
|
+
ref
|
|
26
|
+
}, props)));
|
|
27
|
+
PrimaryIconButton.displayName = "PrimaryIconButton";
|
|
28
|
+
const SecondaryIconButton = forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseButton, __spreadValues({
|
|
29
|
+
buttonStyle: "rds-icon-button",
|
|
30
|
+
buttonType: "secondary",
|
|
31
|
+
ref
|
|
32
|
+
}, props)));
|
|
33
|
+
SecondaryIconButton.displayName = "SecondaryIconButton";
|
|
34
|
+
const TertiaryIconButton = forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseButton, __spreadValues({
|
|
35
|
+
buttonStyle: "rds-icon-button",
|
|
36
|
+
buttonType: "tertiary",
|
|
37
|
+
ref
|
|
38
|
+
}, props)));
|
|
39
|
+
TertiaryIconButton.displayName = "TertiaryIconButton";
|
|
40
|
+
export { PrimaryIconButton as P, SecondaryIconButton as S, TertiaryIconButton as T };
|
package/dist/core/Core.js
CHANGED
|
@@ -1 +1,76 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import { j as jsx } from "./RiksTV.js";
|
|
2
|
+
let mousenavigation = false;
|
|
3
|
+
let touchnavigation = false;
|
|
4
|
+
let touchEventFired = false;
|
|
5
|
+
const listeners = {
|
|
6
|
+
mousedown: handleMouseDown,
|
|
7
|
+
keydown: handleKeydown,
|
|
8
|
+
touchstart: handleTouchStart
|
|
9
|
+
};
|
|
10
|
+
function removeAllListeners() {
|
|
11
|
+
Object.keys(listeners).forEach((listenerType) => {
|
|
12
|
+
document.removeEventListener(listenerType, listeners[listenerType]);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function addListener(listenerType) {
|
|
16
|
+
document.addEventListener(listenerType, listeners[listenerType]);
|
|
17
|
+
}
|
|
18
|
+
function handleMouseDown() {
|
|
19
|
+
if (!mousenavigation && !touchEventFired) {
|
|
20
|
+
mousenavigation = true;
|
|
21
|
+
touchnavigation = false;
|
|
22
|
+
const htmlElement = document.querySelector("html");
|
|
23
|
+
htmlElement == null ? void 0 : htmlElement.setAttribute("data-mousenavigation", "true");
|
|
24
|
+
htmlElement == null ? void 0 : htmlElement.removeAttribute("data-touchnavigation");
|
|
25
|
+
removeAllListeners();
|
|
26
|
+
addListener("touchstart");
|
|
27
|
+
addListener("keydown");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function handleKeydown(event) {
|
|
31
|
+
if (event.key === "Tab") {
|
|
32
|
+
const htmlElement = document.querySelector("html");
|
|
33
|
+
removeAllListeners();
|
|
34
|
+
htmlElement == null ? void 0 : htmlElement.removeAttribute("data-mousenavigation");
|
|
35
|
+
htmlElement == null ? void 0 : htmlElement.removeAttribute("data-touchnavigation");
|
|
36
|
+
mousenavigation = false;
|
|
37
|
+
touchnavigation = false;
|
|
38
|
+
addListener("touchstart");
|
|
39
|
+
addListener("mousedown");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function handleTouchStart() {
|
|
43
|
+
if (!touchnavigation) {
|
|
44
|
+
mousenavigation = false;
|
|
45
|
+
touchnavigation = true;
|
|
46
|
+
const htmlElement = document.querySelector("html");
|
|
47
|
+
htmlElement == null ? void 0 : htmlElement.setAttribute("data-touchnavigation", "true");
|
|
48
|
+
htmlElement == null ? void 0 : htmlElement.removeAttribute("data-mousenavigation");
|
|
49
|
+
removeAllListeners();
|
|
50
|
+
addListener("touchstart");
|
|
51
|
+
addListener("keydown");
|
|
52
|
+
addListener("mousedown");
|
|
53
|
+
}
|
|
54
|
+
touchEventFired = true;
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
touchEventFired = false;
|
|
57
|
+
}, 150);
|
|
58
|
+
}
|
|
59
|
+
function detectUserInputMethod() {
|
|
60
|
+
if (typeof document !== "undefined") {
|
|
61
|
+
addListener("touchstart");
|
|
62
|
+
addListener("mousedown");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
detectUserInputMethod();
|
|
66
|
+
const Core = ({
|
|
67
|
+
brand,
|
|
68
|
+
children
|
|
69
|
+
}) => {
|
|
70
|
+
return /* @__PURE__ */ jsx("div", {
|
|
71
|
+
"data-testid": "core-entry",
|
|
72
|
+
className: brand,
|
|
73
|
+
children
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
export { Core as C };
|
package/dist/core/LightMode.js
CHANGED
|
@@ -1 +1,50 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { forwardRef } from "react";
|
|
33
|
+
import { j as jsx } from "./RiksTV.js";
|
|
34
|
+
const LightMode = forwardRef((_a, ref) => {
|
|
35
|
+
var _b = _a, {
|
|
36
|
+
children,
|
|
37
|
+
className = ""
|
|
38
|
+
} = _b, props = __objRest(_b, [
|
|
39
|
+
"children",
|
|
40
|
+
"className"
|
|
41
|
+
]);
|
|
42
|
+
return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({
|
|
43
|
+
ref,
|
|
44
|
+
className: `rds-light ${className}`
|
|
45
|
+
}, props), {
|
|
46
|
+
children
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
LightMode.displayName = "LightMode";
|
|
50
|
+
export { LightMode as L };
|
package/dist/core/RiksTV.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--rds-spacing--2: .125rem;--rds-spacing--4: .25rem;--rds-spacing--8: .5rem;--rds-spacing--16: 1rem;--rds-spacing--24: 1.5rem;--rds-spacing--32: 2rem;--rds-spacing--48: 3rem;--rds-spacing--64: 4rem;--rds-spacing--80: 5rem;--rds-spacing--96: 6rem;--rds-box-shadow--default: 0px 8px 16px rgba(0, 0, 0, .5)}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.rtv{--rds-button-primary-fg: #fff;--rds-button-secondary-pressed-fg: #666666;--rds-button-secondary-pressed-bg: #fff;--rds-button-tertirary-bg: #3b3b3b;--rds-button-tertiary-hover-bg: #434343;--rds-accent-color: #ee4642;--rds-accent-color-mid: #ed302b;--rds-accent-color-dark: #d41612;--rds-accent-hover: #d41612;--rds-foreground-primary: #fff;--rds-foreground-secondary: #a8a8a8;--rds-foreground-tertiary: #666;--rds-heading-accent: var(--rds-foreground-primary);--rds-background-primary-rgb: 37, 37, 37;--rds-background-primary: rgb(var(--rds-background-primary-rgb));--rds-background-secondary: #434343;--rds-background-tertiary: #0b0b0b;--rds-foreground-overlay-soft: rgba(255, 255, 255, .1);--rds-foreground-overlay-medium: rgba(255, 255, 255, .3);--rds-foreground-overlay-heavy: rgba(255, 255, 255, .7);--rds-background-overlay-soft: rgba(0, 0, 0, .1);--rds-background-overlay-medium: rgba(0, 0, 0, .5);--rds-background-overlay-heavy: rgba(0, 0, 0, .85);--rds-feedback-info: #00aec7;--rds-feedback-warning: #f2a900;--rds-feedback-confirm: #4cbb81;--rds-feedback-error: #e01c17;--rds-roundness--default: 4px;--rds-roundness--button: 34px;--rds-roundness--round: 50%;--rds-font-family-lg-headlines: "AvertaBold", Arial, Helvetica, "system-ui", sans-serif;--rds-font-family-headlines: "AvertaBold", Arial, Helvetica, "system-ui", sans-serif;--rds-font-family-m-headlines: "AvertaSemibold", Arial, Helvetica, "system-ui", sans-serif;--rds-font-family-body: "AvertaRegular", Arial, Helvetica, "system-ui", sans-serif;--rds-font-size--default: 1.125rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
|
1
|
+
:root{--rds-spacing--2: .125rem;--rds-spacing--4: .25rem;--rds-spacing--8: .5rem;--rds-spacing--16: 1rem;--rds-spacing--24: 1.5rem;--rds-spacing--32: 2rem;--rds-spacing--48: 3rem;--rds-spacing--64: 4rem;--rds-spacing--80: 5rem;--rds-spacing--96: 6rem;--rds-box-shadow--default: 0px 8px 16px rgba(0, 0, 0, .5)}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.rtv{--rds-button-primary-fg: #fff;--rds-button-secondary-pressed-fg: #666666;--rds-button-secondary-pressed-bg: #fff;--rds-button-tertirary-bg: #3b3b3b;--rds-button-tertiary-hover-bg: #434343;--rds-accent-color: #ee4642;--rds-accent-color-mid: #ed302b;--rds-accent-color-dark: #d41612;--rds-accent-hover: #d41612;--rds-foreground-primary: #fff;--rds-foreground-secondary: #a8a8a8;--rds-foreground-tertiary: #666;--rds-heading-accent: var(--rds-foreground-primary);--rds-background-primary-rgb: 37, 37, 37;--rds-background-primary: rgb(var(--rds-background-primary-rgb));--rds-background-secondary: #434343;--rds-background-tertiary: #0b0b0b;--rds-foreground-overlay-soft: rgba(255, 255, 255, .1);--rds-foreground-overlay-medium: rgba(255, 255, 255, .3);--rds-foreground-overlay-heavy: rgba(255, 255, 255, .7);--rds-foreground-solid-soft: #3c3c3c;--rds-surface-foreground: #434343;--rds-background-overlay-soft: rgba(0, 0, 0, .1);--rds-background-overlay-medium: rgba(0, 0, 0, .5);--rds-background-overlay-heavy: rgba(0, 0, 0, .85);--rds-feedback-info: #00aec7;--rds-feedback-warning: #f2a900;--rds-feedback-confirm: #4cbb81;--rds-feedback-error: #e01c17;--rds-roundness--default: 4px;--rds-roundness--button: 34px;--rds-roundness--round: 50%;--rds-font-family-lg-headlines: "AvertaBold", Arial, Helvetica, "system-ui", sans-serif;--rds-font-family-headlines: "AvertaBold", Arial, Helvetica, "system-ui", sans-serif;--rds-font-family-m-headlines: "AvertaSemibold", Arial, Helvetica, "system-ui", sans-serif;--rds-font-family-body: "AvertaRegular", Arial, Helvetica, "system-ui", sans-serif;--rds-font-size--default: 1.125rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
package/dist/core/RiksTV.js
CHANGED
|
@@ -1,4 +1,75 @@
|
|
|
1
|
-
import
|
|
1
|
+
import require$$0 from "react";
|
|
2
|
+
import { C as Core } from "./Core.js";
|
|
3
|
+
var jsxRuntime = { exports: {} };
|
|
4
|
+
var reactJsxRuntime_production_min = {};
|
|
5
|
+
/*
|
|
6
|
+
object-assign
|
|
7
|
+
(c) Sindre Sorhus
|
|
8
|
+
@license MIT
|
|
9
|
+
*/
|
|
10
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
11
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
12
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
13
|
+
function toObject(val) {
|
|
14
|
+
if (val === null || val === void 0) {
|
|
15
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
16
|
+
}
|
|
17
|
+
return Object(val);
|
|
18
|
+
}
|
|
19
|
+
function shouldUseNative() {
|
|
20
|
+
try {
|
|
21
|
+
if (!Object.assign) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
var test1 = new String("abc");
|
|
25
|
+
test1[5] = "de";
|
|
26
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
var test2 = {};
|
|
30
|
+
for (var i = 0; i < 10; i++) {
|
|
31
|
+
test2["_" + String.fromCharCode(i)] = i;
|
|
32
|
+
}
|
|
33
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n2) {
|
|
34
|
+
return test2[n2];
|
|
35
|
+
});
|
|
36
|
+
if (order2.join("") !== "0123456789") {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
var test3 = {};
|
|
40
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
41
|
+
test3[letter] = letter;
|
|
42
|
+
});
|
|
43
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
} catch (err) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
shouldUseNative() ? Object.assign : function(target, source) {
|
|
52
|
+
var from;
|
|
53
|
+
var to = toObject(target);
|
|
54
|
+
var symbols;
|
|
55
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
56
|
+
from = Object(arguments[s]);
|
|
57
|
+
for (var key in from) {
|
|
58
|
+
if (hasOwnProperty.call(from, key)) {
|
|
59
|
+
to[key] = from[key];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (getOwnPropertySymbols) {
|
|
63
|
+
symbols = getOwnPropertySymbols(from);
|
|
64
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
65
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
66
|
+
to[symbols[i]] = from[symbols[i]];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return to;
|
|
72
|
+
};
|
|
2
73
|
/** @license React v17.0.2
|
|
3
74
|
* react-jsx-runtime.production.min.js
|
|
4
75
|
*
|
|
@@ -7,4 +78,38 @@ import r from"react";import{C as e}from"./Core.js";var t={exports:{}},o={};Objec
|
|
|
7
78
|
* This source code is licensed under the MIT license found in the
|
|
8
79
|
* LICENSE file in the root directory of this source tree.
|
|
9
80
|
*/
|
|
10
|
-
var
|
|
81
|
+
var f = require$$0, g = 60103;
|
|
82
|
+
reactJsxRuntime_production_min.Fragment = 60107;
|
|
83
|
+
if (typeof Symbol === "function" && Symbol.for) {
|
|
84
|
+
var h = Symbol.for;
|
|
85
|
+
g = h("react.element");
|
|
86
|
+
reactJsxRuntime_production_min.Fragment = h("react.fragment");
|
|
87
|
+
}
|
|
88
|
+
var m = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, n = Object.prototype.hasOwnProperty, p = { key: true, ref: true, __self: true, __source: true };
|
|
89
|
+
function q(c, a, k) {
|
|
90
|
+
var b, d = {}, e = null, l = null;
|
|
91
|
+
k !== void 0 && (e = "" + k);
|
|
92
|
+
a.key !== void 0 && (e = "" + a.key);
|
|
93
|
+
a.ref !== void 0 && (l = a.ref);
|
|
94
|
+
for (b in a)
|
|
95
|
+
n.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
96
|
+
if (c && c.defaultProps)
|
|
97
|
+
for (b in a = c.defaultProps, a)
|
|
98
|
+
d[b] === void 0 && (d[b] = a[b]);
|
|
99
|
+
return { $$typeof: g, type: c, key: e, ref: l, props: d, _owner: m.current };
|
|
100
|
+
}
|
|
101
|
+
reactJsxRuntime_production_min.jsx = q;
|
|
102
|
+
reactJsxRuntime_production_min.jsxs = q;
|
|
103
|
+
{
|
|
104
|
+
jsxRuntime.exports = reactJsxRuntime_production_min;
|
|
105
|
+
}
|
|
106
|
+
const jsx = jsxRuntime.exports.jsx;
|
|
107
|
+
const jsxs = jsxRuntime.exports.jsxs;
|
|
108
|
+
var rtv = "";
|
|
109
|
+
const RiksTVProvider = ({
|
|
110
|
+
children
|
|
111
|
+
}) => /* @__PURE__ */ jsx(Core, {
|
|
112
|
+
brand: "rtv",
|
|
113
|
+
children
|
|
114
|
+
});
|
|
115
|
+
export { RiksTVProvider as R, jsxs as a, jsx as j };
|
package/dist/core/Strim.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--rds-spacing--2: .125rem;--rds-spacing--4: .25rem;--rds-spacing--8: .5rem;--rds-spacing--16: 1rem;--rds-spacing--24: 1.5rem;--rds-spacing--32: 2rem;--rds-spacing--48: 3rem;--rds-spacing--64: 4rem;--rds-spacing--80: 5rem;--rds-spacing--96: 6rem;--rds-box-shadow--default: 0px 8px 16px rgba(0, 0, 0, .5)}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.strm{--stand-up-green: #49f5a4;--surface-background: #edfef6;--rds-
|
|
1
|
+
:root{--rds-spacing--2: .125rem;--rds-spacing--4: .25rem;--rds-spacing--8: .5rem;--rds-spacing--16: 1rem;--rds-spacing--24: 1.5rem;--rds-spacing--32: 2rem;--rds-spacing--48: 3rem;--rds-spacing--64: 4rem;--rds-spacing--80: 5rem;--rds-spacing--96: 6rem;--rds-box-shadow--default: 0px 8px 16px rgba(0, 0, 0, .5)}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.strm{--stand-up-green: #49f5a4;--surface-background: #edfef6;--rds-accent-color: #faed6f;--rds-accent-color-mid: #f7e426;--rds-accent-color-dark: #f7e426;--rds-accent-hover: #fcf4a9;--rds-foreground-primary: #ffffff;--rds-foreground-secondary: #b2bfbf;--rds-foreground-tertiary: #356e63;--rds-heading-accent: var(--stand-up-green);--rds-background-primary-rgb: 0, 42, 42;--rds-background-primary: rgb(var(--rds-background-primary-rgb));--rds-background-secondary: #001d1d;--rds-background-tertiary: #001515;--rds-foreground-overlay-soft: rgba(255, 255, 255, .1);--rds-foreground-overlay-medium: rgba(255, 255, 255, .3);--rds-foreground-overlay-heavy: rgba(255, 255, 255, .7);--rds-foreground-solid-soft: #1a4040;--rds-surface-foreground: #004b50;--rds-background-overlay-soft: rgba(0, 0, 0, .1);--rds-background-overlay-medium: rgba(0, 0, 0, .5);--rds-background-overlay-heavy: rgba(0, 0, 0, .85);--rds-feedback-info: #00aec7;--rds-feedback-warning: #f2a900;--rds-feedback-confirm: #4cbb81;--rds-feedback-error: #e01c17;--rds-button-primary-fg: var(--rds-surface-foreground);--rds-button-secondary-pressed-fg: #ffffff;--rds-button-secondary-pressed-bg: #001d1d;--rds-button-tertirary-bg: #193f3f;--rds-button-tertiary-hover-bg: var(--rds-surface-foreground);--rds-roundness--default: 12px;--rds-roundness--button: 12px;--rds-roundness--round: 50%;--rds-font-family-lg-headlines: "HALMatex", "system-ui", sans-serif;--rds-font-family-headlines: "AvertaBold", Arial, Helvetica, "system-ui", sans-serif;--rds-font-family-m-headlines: "AvertaSemibold", Arial, Helvetica, "system-ui", sans-serif;--rds-font-family-body: "AvertaRegular", Arial, Helvetica, "system-ui", sans-serif;--rds-font-size--default: 1.125rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
package/dist/core/Strim.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
import{C as
|
|
1
|
+
import { C as Core } from "./Core.js";
|
|
2
|
+
import { j as jsx } from "./RiksTV.js";
|
|
3
|
+
var strm = "";
|
|
4
|
+
const StrimProvider = ({
|
|
5
|
+
children
|
|
6
|
+
}) => /* @__PURE__ */ jsx(Core, {
|
|
7
|
+
brand: "strm",
|
|
8
|
+
children
|
|
9
|
+
});
|
|
10
|
+
export { StrimProvider as S };
|
package/dist/core/rtv.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use "./core";
|
|
2
2
|
|
|
3
3
|
.rtv {
|
|
4
4
|
--rds-button-primary-fg: #fff;
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
--rds-foreground-overlay-medium: rgba(255, 255, 255, 0.3);
|
|
26
26
|
--rds-foreground-overlay-heavy: rgba(255, 255, 255, 0.7);
|
|
27
27
|
|
|
28
|
+
--rds-foreground-solid-soft: #3c3c3c;
|
|
29
|
+
|
|
30
|
+
--rds-surface-foreground: #434343;
|
|
31
|
+
|
|
28
32
|
--rds-background-overlay-soft: rgba(0, 0, 0, 0.1);
|
|
29
33
|
--rds-background-overlay-medium: rgba(0, 0, 0, 0.5);
|
|
30
34
|
--rds-background-overlay-heavy: rgba(0, 0, 0, 0.85);
|
package/dist/core/strm.scss
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use "./core";
|
|
2
2
|
|
|
3
3
|
.strm {
|
|
4
4
|
--stand-up-green: #49f5a4;
|
|
5
5
|
--surface-background: #edfef6;
|
|
6
|
-
|
|
7
|
-
--rds-button-secondary-pressed-fg: #ffffff;
|
|
8
|
-
--rds-button-secondary-pressed-bg: #001d1d;
|
|
9
|
-
--rds-button-tertirary-bg: #193f3f;
|
|
10
|
-
--rds-button-tertiary-hover-bg: #004b50;
|
|
6
|
+
|
|
11
7
|
--rds-accent-color: #faed6f;
|
|
12
8
|
--rds-accent-color-mid: #f7e426;
|
|
13
9
|
--rds-accent-color-dark: #f7e426;
|
|
@@ -27,6 +23,10 @@
|
|
|
27
23
|
--rds-foreground-overlay-medium: rgba(255, 255, 255, 0.3);
|
|
28
24
|
--rds-foreground-overlay-heavy: rgba(255, 255, 255, 0.7);
|
|
29
25
|
|
|
26
|
+
--rds-foreground-solid-soft: #1a4040;
|
|
27
|
+
|
|
28
|
+
--rds-surface-foreground: #004b50;
|
|
29
|
+
|
|
30
30
|
--rds-background-overlay-soft: rgba(0, 0, 0, 0.1);
|
|
31
31
|
--rds-background-overlay-medium: rgba(0, 0, 0, 0.5);
|
|
32
32
|
--rds-background-overlay-heavy: rgba(0, 0, 0, 0.85);
|
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
--rds-feedback-confirm: #4cbb81;
|
|
37
37
|
--rds-feedback-error: #e01c17;
|
|
38
38
|
|
|
39
|
+
--rds-button-primary-fg: var(--rds-surface-foreground);
|
|
40
|
+
--rds-button-secondary-pressed-fg: #ffffff;
|
|
41
|
+
--rds-button-secondary-pressed-bg: #001d1d;
|
|
42
|
+
--rds-button-tertirary-bg: #193f3f;
|
|
43
|
+
--rds-button-tertiary-hover-bg: var(--rds-surface-foreground);
|
|
44
|
+
|
|
39
45
|
--rds-roundness--default: 12px;
|
|
40
46
|
--rds-roundness--button: 12px;
|
|
41
47
|
--rds-roundness--round: 50%;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { j as jsx } from "../core/RiksTV.js";
|
|
2
|
+
const Chevron = () => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
"aria-label": "Pil",
|
|
4
|
+
width: "24",
|
|
5
|
+
height: "25",
|
|
6
|
+
viewBox: "0 0 24 25",
|
|
7
|
+
fill: "none",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
clipRule: "evenodd",
|
|
12
|
+
d: "M5.00962 7.91897C4.64323 7.53475 4.0374 7.52589 3.66026 7.89988C3.2872 8.26982 3.27911 8.87487 3.64154 9.25495L10.9543 16.9237C11.0883 17.0644 11.2493 17.1779 11.429 17.256C11.6089 17.3342 11.8031 17.375 12 17.375C12.1969 17.375 12.3911 17.3342 12.571 17.256C12.7508 17.1778 12.9121 17.0639 13.046 16.9234L20.3585 9.25495C20.7209 8.87486 20.7128 8.26982 20.3397 7.89988C19.9626 7.52589 19.3568 7.53475 18.9904 7.91897L12 15.2496L5.00962 7.91897Z",
|
|
13
|
+
fill: "white"
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
export { Chevron as C };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { RiksTVProvider } from "./core/RiksTV";
|
|
2
2
|
export { StrimProvider } from "./core/Strim";
|
|
3
3
|
export { LightMode } from "./core/LightMode";
|
|
4
|
+
export { Accordion } from "./accordion/Accordion";
|
|
4
5
|
export { PrimaryButton, SecondaryButton, TertiaryButton } from "./button/Button";
|
|
5
6
|
export { PrimaryIconButton, SecondaryIconButton, TertiaryIconButton } from "./button/IconButton";
|
|
6
7
|
export { ToggleButton } from "./toggleButton/ToggleButton";
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
export{R as RiksTVProvider
|
|
1
|
+
export { R as RiksTVProvider } from "./core/RiksTV.js";
|
|
2
|
+
export { S as StrimProvider } from "./core/Strim.js";
|
|
3
|
+
export { L as LightMode } from "./core/LightMode.js";
|
|
4
|
+
export { A as Accordion } from "./accordion/Accordion.js";
|
|
5
|
+
export { P as PrimaryButton, S as SecondaryButton, T as TertiaryButton } from "./button/Button.js";
|
|
6
|
+
export { P as PrimaryIconButton, S as SecondaryIconButton, T as TertiaryIconButton } from "./button/IconButton.js";
|
|
7
|
+
export { T as ToggleButton } from "./toggleButton/ToggleButton.js";
|
|
8
|
+
export { a as RadioToggleInput } from "./toggle/RadioToggle.js";
|
|
9
|
+
export { F as FieldSet } from "./toggle/FieldSet.js";
|
|
10
|
+
export { B as Body, d as Bold, D as DisplayTitle, H as H1, a as H2, b as H3, c as H4, M as Meta, S as SubBody, T as Tag } from "./typography/Typography.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import "./core/Core.js";
|
|
13
|
+
import "./icons/Chevron.js";
|
|
14
|
+
import "./button/BaseButton.js";
|
package/dist/toggle/FieldSet.js
CHANGED
|
@@ -1 +1,66 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { forwardRef } from "react";
|
|
33
|
+
import { R as RadioContext } from "./RadioToggle.js";
|
|
34
|
+
import { j as jsx, a as jsxs } from "../core/RiksTV.js";
|
|
35
|
+
const FieldSet = forwardRef((_a, ref) => {
|
|
36
|
+
var _b = _a, {
|
|
37
|
+
legend,
|
|
38
|
+
children,
|
|
39
|
+
name,
|
|
40
|
+
className = "",
|
|
41
|
+
showLegend = false
|
|
42
|
+
} = _b, rest = __objRest(_b, [
|
|
43
|
+
"legend",
|
|
44
|
+
"children",
|
|
45
|
+
"name",
|
|
46
|
+
"className",
|
|
47
|
+
"showLegend"
|
|
48
|
+
]);
|
|
49
|
+
return /* @__PURE__ */ jsx(RadioContext.Provider, {
|
|
50
|
+
value: {
|
|
51
|
+
radioName: name
|
|
52
|
+
},
|
|
53
|
+
children: /* @__PURE__ */ jsxs("fieldset", __spreadProps(__spreadValues({
|
|
54
|
+
"data-testid": "fieldset"
|
|
55
|
+
}, rest), {
|
|
56
|
+
className: `rds-field-set ${className}`,
|
|
57
|
+
ref,
|
|
58
|
+
children: [/* @__PURE__ */ jsx("legend", {
|
|
59
|
+
className: `rds-field-set__legend ${showLegend ? "" : "sr-only"}`,
|
|
60
|
+
children: legend
|
|
61
|
+
}), children]
|
|
62
|
+
}))
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
FieldSet.displayName = "FieldSet";
|
|
66
|
+
export { FieldSet as F };
|
|
@@ -1 +1,65 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
33
|
+
import "../button/Button.js";
|
|
34
|
+
import { a as jsxs, j as jsx } from "../core/RiksTV.js";
|
|
35
|
+
const RadioContext = createContext({ radioName: "" });
|
|
36
|
+
var radioToggle = "";
|
|
37
|
+
const RadioToggleInput = forwardRef((_a, ref) => {
|
|
38
|
+
var _b = _a, {
|
|
39
|
+
label,
|
|
40
|
+
name,
|
|
41
|
+
className = ""
|
|
42
|
+
} = _b, rest = __objRest(_b, [
|
|
43
|
+
"label",
|
|
44
|
+
"name",
|
|
45
|
+
"className"
|
|
46
|
+
]);
|
|
47
|
+
const {
|
|
48
|
+
radioName
|
|
49
|
+
} = useContext(RadioContext);
|
|
50
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
51
|
+
className: `rds-radio-toggle ${className}`,
|
|
52
|
+
children: [/* @__PURE__ */ jsx("input", __spreadProps(__spreadValues({
|
|
53
|
+
className: "rds-radio-toggle__input"
|
|
54
|
+
}, rest), {
|
|
55
|
+
ref,
|
|
56
|
+
type: "radio",
|
|
57
|
+
name: radioName || name
|
|
58
|
+
})), /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: "rds-radio-toggle__label",
|
|
60
|
+
children: label
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
RadioToggleInput.displayName = "RadioToggleInput";
|
|
65
|
+
export { RadioContext as R, RadioToggleInput as a };
|
|
@@ -1 +1,106 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
import { forwardRef, useRef, useState } from "react";
|
|
30
|
+
import { a as jsxs, j as jsx } from "../core/RiksTV.js";
|
|
31
|
+
const generateId = (id) => {
|
|
32
|
+
if (id) {
|
|
33
|
+
return id;
|
|
34
|
+
}
|
|
35
|
+
return `${new Date().valueOf()}`;
|
|
36
|
+
};
|
|
37
|
+
var toggleButton = "";
|
|
38
|
+
const ToggleButton = forwardRef((_a, ref) => {
|
|
39
|
+
var _b = _a, {
|
|
40
|
+
defaultChecked,
|
|
41
|
+
showLabel = true,
|
|
42
|
+
icons,
|
|
43
|
+
iconClass = "",
|
|
44
|
+
children,
|
|
45
|
+
onChange,
|
|
46
|
+
id,
|
|
47
|
+
className = ""
|
|
48
|
+
} = _b, rest = __objRest(_b, [
|
|
49
|
+
"defaultChecked",
|
|
50
|
+
"showLabel",
|
|
51
|
+
"icons",
|
|
52
|
+
"iconClass",
|
|
53
|
+
"children",
|
|
54
|
+
"onChange",
|
|
55
|
+
"id",
|
|
56
|
+
"className"
|
|
57
|
+
]);
|
|
58
|
+
const internalRef = useRef(null);
|
|
59
|
+
const [internalId] = useState(generateId(id));
|
|
60
|
+
const [isChecked, setIsChecked] = useState(!!defaultChecked);
|
|
61
|
+
const CheckedIcon = icons && "checkedIcon" in icons ? icons.checkedIcon : null;
|
|
62
|
+
const UncheckedIcon = icons && "uncheckedIcon" in icons ? icons.uncheckedIcon : null;
|
|
63
|
+
const ToggleIcon = icons && "toggleIcon" in icons ? icons.toggleIcon : null;
|
|
64
|
+
const inputRef = ref || internalRef;
|
|
65
|
+
const handleChange = (e) => {
|
|
66
|
+
var _a2;
|
|
67
|
+
if (typeof onChange === "function") {
|
|
68
|
+
onChange(e);
|
|
69
|
+
}
|
|
70
|
+
if (typeof inputRef !== "function") {
|
|
71
|
+
setIsChecked(!!((_a2 = inputRef.current) == null ? void 0 : _a2.checked));
|
|
72
|
+
} else {
|
|
73
|
+
setIsChecked(!isChecked);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
77
|
+
className,
|
|
78
|
+
children: [/* @__PURE__ */ jsx("input", __spreadValues({
|
|
79
|
+
id: internalId,
|
|
80
|
+
ref: inputRef,
|
|
81
|
+
type: "checkbox",
|
|
82
|
+
className: "rds-toggle-button__input",
|
|
83
|
+
onChange: handleChange,
|
|
84
|
+
defaultChecked
|
|
85
|
+
}, rest)), /* @__PURE__ */ jsx("label", {
|
|
86
|
+
"data-testid": "toggle-button__label",
|
|
87
|
+
className: `rds-toggle-button ${showLabel ? "" : "rds-toggle-button--round"}`,
|
|
88
|
+
htmlFor: internalId,
|
|
89
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
90
|
+
className: "rds-toggle-button__content",
|
|
91
|
+
children: [icons && /* @__PURE__ */ jsxs("span", {
|
|
92
|
+
className: `rds-toggle-button__rounded ${iconClass}`,
|
|
93
|
+
children: [ToggleIcon && /* @__PURE__ */ jsx(ToggleIcon, {
|
|
94
|
+
checked: isChecked
|
|
95
|
+
}), CheckedIcon && isChecked && /* @__PURE__ */ jsx(CheckedIcon, {}), UncheckedIcon && !isChecked && /* @__PURE__ */ jsx(UncheckedIcon, {})]
|
|
96
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
97
|
+
"data-testid": "toggle-button__label__text",
|
|
98
|
+
className: showLabel ? "" : "sr-only",
|
|
99
|
+
children
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
ToggleButton.displayName = "ToggleButton";
|
|
106
|
+
export { ToggleButton as T };
|
|
@@ -1 +1,95 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { forwardRef } from "react";
|
|
33
|
+
import { j as jsx } from "../core/RiksTV.js";
|
|
34
|
+
var typography = "";
|
|
35
|
+
const typographyFactory = (factoryProps) => forwardRef((_a, ref) => {
|
|
36
|
+
var _b = _a, {
|
|
37
|
+
children,
|
|
38
|
+
lookLike = factoryProps.lookLike,
|
|
39
|
+
className = "",
|
|
40
|
+
lightBackground = false
|
|
41
|
+
} = _b, props = __objRest(_b, [
|
|
42
|
+
"children",
|
|
43
|
+
"lookLike",
|
|
44
|
+
"className",
|
|
45
|
+
"lightBackground"
|
|
46
|
+
]);
|
|
47
|
+
const C = factoryProps.semanticElement;
|
|
48
|
+
return /* @__PURE__ */ jsx(C, __spreadProps(__spreadValues({
|
|
49
|
+
className: `rds-${lookLike} ${lightBackground ? `rds-${lookLike}--light` : ""} ${className}`
|
|
50
|
+
}, props), {
|
|
51
|
+
ref,
|
|
52
|
+
children
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
55
|
+
const DisplayTitle = typographyFactory({
|
|
56
|
+
semanticElement: "h1",
|
|
57
|
+
lookLike: "display-title"
|
|
58
|
+
});
|
|
59
|
+
const H1 = typographyFactory({
|
|
60
|
+
semanticElement: "h1",
|
|
61
|
+
lookLike: "title-1"
|
|
62
|
+
});
|
|
63
|
+
const H2 = typographyFactory({
|
|
64
|
+
semanticElement: "h2",
|
|
65
|
+
lookLike: "title-2"
|
|
66
|
+
});
|
|
67
|
+
const H3 = typographyFactory({
|
|
68
|
+
semanticElement: "h3",
|
|
69
|
+
lookLike: "title-3"
|
|
70
|
+
});
|
|
71
|
+
const H4 = typographyFactory({
|
|
72
|
+
semanticElement: "h4",
|
|
73
|
+
lookLike: "title-4"
|
|
74
|
+
});
|
|
75
|
+
const Body = typographyFactory({
|
|
76
|
+
semanticElement: "p",
|
|
77
|
+
lookLike: "body"
|
|
78
|
+
});
|
|
79
|
+
const SubBody = typographyFactory({
|
|
80
|
+
semanticElement: "p",
|
|
81
|
+
lookLike: "sub-body"
|
|
82
|
+
});
|
|
83
|
+
const Tag = typographyFactory({
|
|
84
|
+
semanticElement: "span",
|
|
85
|
+
lookLike: "tag"
|
|
86
|
+
});
|
|
87
|
+
const Bold = typographyFactory({
|
|
88
|
+
semanticElement: "strong",
|
|
89
|
+
lookLike: "bold"
|
|
90
|
+
});
|
|
91
|
+
const Meta = typographyFactory({
|
|
92
|
+
semanticElement: "span",
|
|
93
|
+
lookLike: "meta"
|
|
94
|
+
});
|
|
95
|
+
export { Body as B, DisplayTitle as D, H1 as H, Meta as M, SubBody as S, Tag as T, H2 as a, H3 as b, H4 as c, Bold as d };
|