@rikstv/shared-components 0.6.4 → 0.6.9

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.
@@ -1,4 +1,75 @@
1
- import r from"react";import{C as e}from"./Core.js";var t={exports:{}},o={};Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(r){return e[r]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(r){o[r]=r})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(n){return!1}}()||Object.assign;
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 n=r,a=60103;if(o.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var s=Symbol.for;a=s("react.element"),o.Fragment=s("react.fragment")}var c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p=Object.prototype.hasOwnProperty,f={key:!0,ref:!0,__self:!0,__source:!0};function i(r,e,t){var o,n={},s=null,i=null;for(o in void 0!==t&&(s=""+t),void 0!==e.key&&(s=""+e.key),void 0!==e.ref&&(i=e.ref),e)p.call(e,o)&&!f.hasOwnProperty(o)&&(n[o]=e[o]);if(r&&r.defaultProps)for(o in e=r.defaultProps)void 0===n[o]&&(n[o]=e[o]);return{$$typeof:a,type:r,key:s,ref:i,props:n,_owner:c.current}}o.jsx=i,o.jsxs=i,t.exports=o;const y=t.exports.jsx,O=t.exports.jsxs;const j=({children:r})=>y(e,{brand:"rtv",children:r});export{j as R,O as a,y as j};
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 };
@@ -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-button-primary-fg: #004b50;--rds-button-secondary-pressed-fg: #ffffff;--rds-button-secondary-pressed-bg: #001d1d;--rds-button-tertirary-bg: #193f3f;--rds-button-tertiary-hover-bg: #004b50;--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-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: 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}
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}
@@ -1 +1,10 @@
1
- import{C as r}from"./Core.js";import{j as s}from"./RiksTV.js";const o=({children:o})=>s(r,{brand:"strm",children:o});export{o as S};
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 };
@@ -1,4 +1,4 @@
1
- @use './core';
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);
@@ -1,13 +1,9 @@
1
- @use './core';
1
+ @use "./core";
2
2
 
3
3
  .strm {
4
4
  --stand-up-green: #49f5a4;
5
5
  --surface-background: #edfef6;
6
- --rds-button-primary-fg: #004b50;
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 @@
1
+ export declare const generateId: (id?: string | undefined) => string;
@@ -0,0 +1,2 @@
1
+ import { FC } from "react";
2
+ export declare const Chevron: FC;
@@ -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.css ADDED
@@ -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-form-group .rds-textfield--label span{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-link--light:visited,.rds-light .rds-link:visited{color:var(--rds-background-primary)}.rds-link--light--active,.rds-link--light[aria-current=page],.rds-light [aria-current=page].rds-link{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-form-group .rds-textfield--label span,.rds-form-group .rds-textfield--label .rds-light span{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)}.rds-form-group{--input-color: var(--rds-foreground-primary);--input-label-color: var(--rds-foreground-secondary);--input-border-color: var(--rds-foreground-primary);--input-error-color: var(--rds-feedback-error);--input-bg: var(--rds-background-primary)}.rds-form-group .rds-textfield--input{border:1px solid var(--input-border-color);background-color:var(--input-border-bg);color:var(--input-color);border-radius:2px;height:3rem;width:100%;max-width:500px;padding:0 var(--rds-spacing--8)}.rds-form-group .rds-textfield--input--full-width{max-width:unset}.rds-form-group .rds-textfield--input::placeholder{opacity:0}.rds-form-group .rds-textfield--input::-webkit-search-cancel-button{-webkit-appearance:none;display:none}.rds-form-group .rds-textfield--input:-webkit-autofill{box-shadow:0 0 0 30px var(--rds-background-primary) inset;-webkit-box-shadow:0 0 0 30px var(--rds-background-primary) inset;-webkit-text-fill-color:var(--rds-foreground-primary)}.rds-form-group .rds-textfield--label{cursor:text;background-color:var(--input-bg);position:absolute;padding:0 8px;top:50%;left:var(--rds-spacing--4);transform:translateY(-50%);transition:.2s ease-in-out;transition-property:top,font-size}.rds-form-group .rds-textfield--label span{font-size:1.125rem;color:var(--input-label-color)}.rds-form-group .rds-textfield--error-text{color:var(--input-error-color);margin-top:.5rem;margin-bottom:.5rem;position:absolute}.rds-form-group .rds-textfield:focus::-moz-focus-inner{border-style:none;outline:0}.rds-form-group .rds-textfield:focus button::-moz-focus-inner,.rds-form-group .rds-textfield:focus [type=button]::-moz-focus-inner,.rds-form-group .rds-textfield:focus [type=reset]::-moz-focus-inner,.rds-form-group .rds-textfield:focus [type=submit]::-moz-focus-inner{border-style:none}.rds-form-group .rds-textfield:focus input[type=button]::-moz-focus-inner{outline:0}html:not([data-mousenavigation]):not([data-touchnavigation]) .rds-form-group .rds-textfield:focus{outline-offset:2px;outline:2px solid var(--rds-feedback-info);transition:outline-offset .25s ease}.rds-form-group{position:relative}.rds-form-group:focus-within .rds-textfield--label{top:0;font-size:1rem}.rds-form-group input:not(:placeholder-shown)+label{top:0;font-size:1rem}.rds-light .rds-textfield,.rds-light.rds-textfield{--input-color: var(--rds-button-primary-fg);--input-border-color: var(--rds-button-primary-fg);--input-bg: var(--surface-background)}.rds-light .rds-textfield--label span,.rds-light.rds-textfield--label span{--input-label-color: var(--rds-background-primary)}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
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";
7
8
  export { RadioToggleInput } from "./toggle/RadioToggle";
8
9
  export { FieldSet } from "./toggle/FieldSet";
10
+ export { TextField } from "./textfield/TextField";
9
11
  export { DisplayTitle, H1, H2, H3, H4, Body, Bold, SubBody, Tag, Meta } from "./typography/Typography";
@@ -1 +1,100 @@
1
- export{R as RiksTVProvider}from"./core/RiksTV.js";export{S as StrimProvider}from"./core/Strim.js";export{L as LightMode}from"./core/LightMode.js";export{P as PrimaryButton,S as SecondaryButton,T as TertiaryButton}from"./button/Button.js";export{P as PrimaryIconButton,S as SecondaryIconButton,T as TertiaryIconButton}from"./button/IconButton.js";export{T as ToggleButton}from"./toggleButton/ToggleButton.js";export{a as RadioToggleInput}from"./toggle/RadioToggle.js";export{F as FieldSet}from"./toggle/FieldSet.js";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";import"react";import"./core/Core.js";import"./button/BaseButton.js";
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 = (a3, b2) => {
7
+ for (var prop in b2 || (b2 = {}))
8
+ if (__hasOwnProp.call(b2, prop))
9
+ __defNormalProp(a3, prop, b2[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b2)) {
12
+ if (__propIsEnum.call(b2, prop))
13
+ __defNormalProp(a3, prop, b2[prop]);
14
+ }
15
+ return a3;
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 { a as jsxs, j as jsx } from "./core/RiksTV.js";
30
+ export { R as RiksTVProvider } from "./core/RiksTV.js";
31
+ export { S as StrimProvider } from "./core/Strim.js";
32
+ export { L as LightMode } from "./core/LightMode.js";
33
+ export { A as Accordion } from "./accordion/Accordion.js";
34
+ export { P as PrimaryButton, S as SecondaryButton, T as TertiaryButton } from "./button/Button.js";
35
+ export { P as PrimaryIconButton, S as SecondaryIconButton, T as TertiaryIconButton } from "./button/IconButton.js";
36
+ export { T as ToggleButton } from "./toggleButton/ToggleButton.js";
37
+ export { a as RadioToggleInput } from "./toggle/RadioToggle.js";
38
+ export { F as FieldSet } from "./toggle/FieldSet.js";
39
+ import { forwardRef } from "react";
40
+ import "./core/Core.js";
41
+ import { S as SubBody } from "./typography/Typography.js";
42
+ 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";
43
+ import "./icons/Chevron.js";
44
+ import "./button/BaseButton.js";
45
+ const generateId = (id) => {
46
+ if (id) {
47
+ return id;
48
+ }
49
+ return `${new Date().valueOf()}`;
50
+ };
51
+ var textfield = "";
52
+ const TextField = forwardRef((_a, ref) => {
53
+ var _b = _a, {
54
+ className = "",
55
+ id,
56
+ labelClass = "",
57
+ type = "text",
58
+ fullWidth = false,
59
+ lightBackground = false,
60
+ label,
61
+ error
62
+ } = _b, props = __objRest(_b, [
63
+ "className",
64
+ "id",
65
+ "labelClass",
66
+ "type",
67
+ "fullWidth",
68
+ "lightBackground",
69
+ "label",
70
+ "error"
71
+ ]);
72
+ const errorTextId = generateId();
73
+ const generatedId = generateId(id);
74
+ return /* @__PURE__ */ jsxs("div", {
75
+ className: `rds-form-group ${className}`,
76
+ children: [/* @__PURE__ */ jsx("input", __spreadValues({
77
+ ref,
78
+ id: generatedId,
79
+ className: `
80
+ rds-textfield
81
+ rds-textfield--input ${error ? "rds-textfield--input--error" : ""} ${fullWidth ? "rds-textfield--input--full-width" : ""} ${lightBackground ? "rds-light" : ""}
82
+ `,
83
+ type,
84
+ placeholder: label,
85
+ "aria-describedby": error ? errorTextId : void 0
86
+ }, props)), error && /* @__PURE__ */ jsx(SubBody, {
87
+ id: errorTextId,
88
+ className: "rds-textfield--error-text",
89
+ children: error
90
+ }), /* @__PURE__ */ jsx("label", {
91
+ htmlFor: generatedId,
92
+ className: `rds-textfield rds-textfield--label ${labelClass} ${lightBackground ? "rds-light" : ""}`,
93
+ children: /* @__PURE__ */ jsx("span", {
94
+ children: label
95
+ })
96
+ })]
97
+ });
98
+ });
99
+ TextField.displayName = "TextField";
100
+ export { TextField };
@@ -0,0 +1,13 @@
1
+ import { DetailedHTMLProps, InputHTMLAttributes } from "react";
2
+ import "./textfield.scss";
3
+ declare type Props = Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">;
4
+ export declare const TextField: import("react").ForwardRefExoticComponent<Props & {
5
+ className?: string;
6
+ name: string;
7
+ label: string;
8
+ fullWidth?: boolean;
9
+ lightBackground?: boolean;
10
+ labelClass?: string;
11
+ error?: string | null | false;
12
+ } & import("react").RefAttributes<HTMLInputElement>>;
13
+ export {};
@@ -0,0 +1,101 @@
1
+ @use "../typography/typography.scss";
2
+ @use "../core/mixin/focus" as mix;
3
+ @use "../core/mixin/rem";
4
+
5
+ .rds-form-group {
6
+ --input-color: var(--rds-foreground-primary);
7
+ --input-label-color: var(--rds-foreground-secondary);
8
+ --input-border-color: var(--rds-foreground-primary);
9
+ --input-error-color: var(--rds-feedback-error);
10
+ --input-bg: var(--rds-background-primary);
11
+
12
+ .rds-textfield {
13
+ &--input {
14
+ border: 1px solid var(--input-border-color);
15
+ background-color: var(--input-border-bg);
16
+ color: var(--input-color);
17
+ border-radius: 2px;
18
+
19
+ height: 3rem;
20
+ width: 100%;
21
+ max-width: 500px;
22
+ padding: 0 var(--rds-spacing--8);
23
+
24
+ &--full-width {
25
+ max-width: unset;
26
+ }
27
+
28
+ &::placeholder {
29
+ opacity: 0;
30
+ }
31
+
32
+ &::-webkit-search-cancel-button {
33
+ -webkit-appearance: none;
34
+ display: none;
35
+ }
36
+
37
+ &:-webkit-autofill {
38
+ box-shadow: 0 0 0 30px var(--rds-background-primary) inset;
39
+ -webkit-box-shadow: 0 0 0 30px var(--rds-background-primary) inset;
40
+ -webkit-text-fill-color: var(--rds-foreground-primary);
41
+ }
42
+ }
43
+
44
+ &--label {
45
+ cursor: text;
46
+ background-color: var(--input-bg);
47
+ position: absolute;
48
+ padding: 0 8px;
49
+ top: 50%;
50
+ left: var(--rds-spacing--4);
51
+ transform: translateY(-50%);
52
+ transition: 0.2s ease-in-out;
53
+ transition-property: top, font-size;
54
+
55
+ span {
56
+ @extend .rds-bold;
57
+ font-size: rem.convert(18px);
58
+ color: var(--input-label-color);
59
+ }
60
+ }
61
+
62
+ &--error-text {
63
+ color: var(--input-error-color);
64
+ margin-top: 0.5rem;
65
+ margin-bottom: 0.5rem;
66
+ position: absolute;
67
+ }
68
+
69
+ @include mix.with-keyboard-focus;
70
+ }
71
+ }
72
+
73
+ .rds-form-group {
74
+ position: relative;
75
+
76
+ &:focus-within {
77
+ .rds-textfield--label {
78
+ top: 0;
79
+ font-size: 1rem;
80
+ }
81
+ }
82
+
83
+ input:not(:placeholder-shown) + label {
84
+ top: 0;
85
+ font-size: 1rem;
86
+ }
87
+ }
88
+
89
+ .rds-light {
90
+ .rds-textfield,
91
+ &.rds-textfield {
92
+ --input-color: var(--rds-button-primary-fg);
93
+ --input-border-color: var(--rds-button-primary-fg);
94
+ --input-bg: var(--surface-background);
95
+ &--label {
96
+ span {
97
+ --input-label-color: var(--rds-background-primary);
98
+ }
99
+ }
100
+ }
101
+ }
@@ -1 +1,66 @@
1
- var e=Object.defineProperty,r=Object.defineProperties,a=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(r,a,l)=>a in r?e(r,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[a]=l,i=(e,r)=>{for(var a in r||(r={}))t.call(r,a)&&s(e,a,r[a]);if(l)for(var a of l(r))o.call(r,a)&&s(e,a,r[a]);return e};import{forwardRef as n}from"react";import{R as d}from"./RadioToggle.js";import{j as c,a as f}from"../core/RiksTV.js";const m=n(((e,s)=>{var n,m,p=e,{legend:b,children:g,name:O,className:v="",showLegend:y=!1}=p,j=((e,r)=>{var a={};for(var s in e)t.call(e,s)&&r.indexOf(s)<0&&(a[s]=e[s]);if(null!=e&&l)for(var s of l(e))r.indexOf(s)<0&&o.call(e,s)&&(a[s]=e[s]);return a})(p,["legend","children","name","className","showLegend"]);return c(d.Provider,{value:{radioName:O},children:f("fieldset",(n=i({"data-testid":"fieldset"},j),m={className:`rds-field-set ${v}`,ref:s,children:[c("legend",{className:"rds-field-set__legend "+(y?"":"sr-only"),children:b}),g]},r(n,a(m))))})}));m.displayName="FieldSet";export{m as F};
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 @@
1
- .rds-field-set{border:none;margin:0;padding:0;display:flex}.rds-field-set__legend{margin-bottom:var(--rds-spacing--8)}.rds-radio-toggle{padding:0;background-color:var(--rds-foreground-overlay-soft);color:#fff;margin:0 var(--rds-spacing--8);display:block;max-width:25ch;min-width:7ch;overflow:hidden;border-radius:var(--rds-roundness--button)}.rds-radio-toggle:hover{background-color:var(--rds-background-tertiary)}.rds-radio-toggle:active{background-color:var(--rds-background-overlay-soft);color:#fff}.rds-radio-toggle__label{width:100%;display:grid;place-items:center;transition:125ms ease background-color;padding:.78125rem var(--rds-spacing--24);box-sizing:border-box;user-select:none}.rds-radio-toggle__input{position:absolute;opacity:0}.rds-radio-toggle__input:checked+.rds-radio-toggle__label{background-color:var(--rds-foreground-tertiary)}.rds-radio-toggle__input:active+.rds-radio-toggle__label{background-color:var(--rds-foreground-overlay-soft)}.rds-radio-toggle:focus::-moz-focus-inner{border-style:none;outline:0}.rds-radio-toggle:focus button::-moz-focus-inner,.rds-radio-toggle:focus [type=button]::-moz-focus-inner,.rds-radio-toggle:focus [type=reset]::-moz-focus-inner,.rds-radio-toggle:focus [type=submit]::-moz-focus-inner{border-style:none}.rds-radio-toggle:focus input[type=button]::-moz-focus-inner{outline:0}html:not([data-mousenavigation]):not([data-touchnavigation]) .rds-radio-toggle:focus{outline-offset:2px;outline:2px solid var(--rds-feedback-info);transition:outline-offset .25s ease}.rds-radio-toggle:focus-within::-moz-focus-inner{border-style:none;outline:0}.rds-radio-toggle:focus-within button::-moz-focus-inner,.rds-radio-toggle:focus-within [type=button]::-moz-focus-inner,.rds-radio-toggle:focus-within [type=reset]::-moz-focus-inner,.rds-radio-toggle:focus-within [type=submit]::-moz-focus-inner{border-style:none}.rds-radio-toggle:focus-within input[type=button]::-moz-focus-inner{outline:0}html:not([data-mousenavigation]):not([data-touchnavigation]) .rds-radio-toggle:focus-within{outline-offset:2px;outline:2px solid var(--rds-feedback-info);transition:outline-offset .25s ease}
1
+ .rds-button__shared,.rds-radio-toggle{--common-button--primary-color: var(--rds-button-primary-fg);--common-button--primary-bg: var(--rds-accent-color);--common-button--primary-hover-bg: var(--rds-accent-hover);--common-button--primary-pressed-bg: var(--rds-accent-color);--common-button--secondary-border-color: var(--rds-foreground-primary);--common-button--secondary-color: var(--rds-foreground-primary);--common-button--secondary-bg: var(--rds-background-primary);--common-button--secondary-hover-color: var(--rds-background-primary);--common-button--secondary-hover-bg: var(--rds-foreground-primary);--common-button--secondary-pressed-color: var(--rds-button-secondary-pressed-fg);--common-button--secondary-pressed-bg: var(--rds-button-secondary-pressed-bg);--common-button--tertiary-bg: var(--rds-button-tertirary-bg);--common-button--tertiary-color: var(--rds-foreground-primary);--common-button--tertiary-hover-bg: var(--rds-button-tertiary-hover-bg);--common-button--tertiary-hover-color: var(--rds-foreground-primary);--common-button--tertiary-pressed-bg: var(--rds-background-tertiary);--common-button--tertiary-pressed-color: var(--rds-foreground-primary);--common-button--disabled-bg: var(--rds-foreground-secondary);--common-button--disabled-color: var(--rds-foreground-tertiary);border:none;width:auto;background:transparent;line-height:normal;-webkit-appearance:none;display:flex;transition:125ms ease-in-out;transition-property:color,box-shadow,background-color;font-family:var(--rds-font-family-m-headlines)}.rds-button__shared::-moz-focus-inner,.rds-radio-toggle::-moz-focus-inner{border:0;padding:0}.rds-button__shared--primary{color:var(--common-button--primary-color);background-color:var(--common-button--primary-bg)}.rds-button__shared--primary:hover{background-color:var(--common-button--primary-hover-bg)}.rds-button__shared--primary:active{box-shadow:none;background-color:var(--common-button--primary-pressed-bg)}.rds-button__shared--secondary{background-color:var(--common-button--secondary-bg);border:2px solid var(--common-button--secondary-border-color);color:var(--common-button--secondary-color)}.rds-button__shared--secondary:hover{background-color:var(--common-button--secondary-hover-bg);color:var(--common-button--secondary-hover-color)}.rds-button__shared--secondary:active{background-color:var(--common-button--secondary-pressed-bg);color:var(--common-button--secondary-pressed-color);border-color:var(--common-button--secondary-pressed-bg)}.rds-button__shared--tertiary,.rds-radio-toggle{background-color:var(--common-button--tertiary-bg);color:var(--common-button--tertiary-color)}.rds-button__shared--tertiary:hover,.rds-radio-toggle:hover{background-color:var(--common-button--tertiary-hover-bg);color:var(--common-button--tertiary-hover-color)}.rds-button__shared--tertiary:active,.rds-radio-toggle:active{background-color:var(--common-button--tertiary-pressed-bg);color:var(--common-button--tertiary-pressed-color)}.rds-button__shared:disabled,.rds-radio-toggle:disabled{background-color:var(--common-button--disabled-bg);color:var(--common-button--disabled-color);box-shadow:none;cursor:not-allowed;border:none}.rds-button__shared:hover,.rds-radio-toggle:hover{box-shadow:var(--rds-box-shadow--default)}.rds-button__shared:active,.rds-radio-toggle:active{box-shadow:none}.rds-button__shared:focus::-moz-focus-inner,.rds-radio-toggle:focus::-moz-focus-inner{border-style:none;outline:0}.rds-button__shared:focus button::-moz-focus-inner,.rds-radio-toggle:focus button::-moz-focus-inner,.rds-button__shared:focus [type=button]::-moz-focus-inner,.rds-radio-toggle:focus [type=button]::-moz-focus-inner,.rds-button__shared:focus [type=reset]::-moz-focus-inner,.rds-radio-toggle:focus [type=reset]::-moz-focus-inner,.rds-button__shared:focus [type=submit]::-moz-focus-inner,.rds-radio-toggle:focus [type=submit]::-moz-focus-inner{border-style:none}.rds-button__shared:focus input[type=button]::-moz-focus-inner,.rds-radio-toggle:focus input[type=button]::-moz-focus-inner{outline:0}html:not([data-mousenavigation]):not([data-touchnavigation]) .rds-button__shared:focus,html:not([data-mousenavigation]):not([data-touchnavigation]) .rds-radio-toggle:focus{outline-offset:2px;outline:2px solid var(--rds-feedback-info);transition:outline-offset .25s ease}.rds-light .rds-button__shared--primary,.rds-light.rds-button__shared--primary{--common-button--primary-color: var(--rds-foreground-primary);--common-button--primary-bg: var(--rds-button-primary-fg)}.rds-light .rds-button__shared--primary:hover,.rds-light.rds-button__shared--primary:hover{--common-button--primary-hover-bg: var(--rds-foreground-tertiary)}.rds-light .rds-button__shared--primary:active,.rds-light.rds-button__shared--primary:active{box-shadow:none;--common-button--primary-pressed-bg: var(--rds-background-primary)}.rds-light .rds-button__shared--primary:disabled,.rds-light.rds-button__shared--primary:disabled{--common-button--disabled-color: var(--rds-button-tertiary-hover-bg)}.rds-light .rds-button__shared--secondary,.rds-light.rds-button__shared--secondary{--common-button--secondary-color: var(--rds-button-tertiary-hover-bg);--common-button--secondary-border-color: var(--rds-button-tertiary-hover-bg);--common-button--secondary-bg: var(--surface-background)}.rds-light .rds-button__shared--secondary:hover,.rds-light.rds-button__shared--secondary:hover{--common-button--secondary-hover-bg: var(--rds-button-primary-fg);--common-button--secondary-hover-color: var(--rds-foreground-primary)}.rds-light .rds-button__shared--secondary:active,.rds-light.rds-button__shared--secondary:active{--common-button--secondary-pressed-color: var(--rds-foreground-primary);--common-button--secondary-pressed-bg: var(--rds-button-primary-fg)}.rds-light .rds-button__shared--secondary:disabled,.rds-light.rds-button__shared--secondary:disabled{--common-button--disabled-color: var(--rds-button-primary-fg)}.rds-button,.rds-radio-toggle{padding:.78125rem var(--rds-spacing--32);border-radius:var(--rds-roundness--button);overflow-y:hidden;cursor:pointer;font-size:1.125rem}.rds-button__icon{display:flex;align-items:center;align-self:center;margin-right:var(--rds-spacing--16);width:1.125rem}.rds-button__icon>svg{width:100%}.rds-button__postfix{position:relative;display:flex;align-items:center;margin-left:var(--rds-spacing--16);padding-left:var(--rds-spacing--16)}.rds-button__postfix:before{content:" ";position:absolute;width:1px;background-color:currentColor;height:200%;left:0}.rds-button--loading:disabled{cursor:wait!important}.rds-button--loading:disabled:hover{box-shadow:none}.rds-field-set{border:none;margin:0;padding:0;display:flex}.rds-field-set__legend{margin-bottom:var(--rds-spacing--8)}.rds-radio-toggle{padding:0;background-color:var(--rds-foreground-overlay-soft);color:#fff;margin:0 var(--rds-spacing--8);display:block;max-width:25ch;min-width:7ch;overflow:hidden;border-radius:var(--rds-roundness--button)}.rds-radio-toggle:hover{background-color:var(--rds-background-tertiary)}.rds-radio-toggle:active{background-color:var(--rds-background-overlay-soft);color:#fff}.rds-radio-toggle__label{width:100%;display:grid;place-items:center;transition:125ms ease background-color;padding:.78125rem var(--rds-spacing--24);box-sizing:border-box;user-select:none}.rds-radio-toggle__input{position:absolute;opacity:0}.rds-radio-toggle__input:checked+.rds-radio-toggle__label{background-color:var(--rds-foreground-tertiary)}.rds-radio-toggle__input:active+.rds-radio-toggle__label{background-color:var(--rds-foreground-overlay-soft)}.rds-radio-toggle:focus::-moz-focus-inner{border-style:none;outline:0}.rds-radio-toggle:focus button::-moz-focus-inner,.rds-radio-toggle:focus [type=button]::-moz-focus-inner,.rds-radio-toggle:focus [type=reset]::-moz-focus-inner,.rds-radio-toggle:focus [type=submit]::-moz-focus-inner{border-style:none}.rds-radio-toggle:focus input[type=button]::-moz-focus-inner{outline:0}html:not([data-mousenavigation]):not([data-touchnavigation]) .rds-radio-toggle:focus{outline-offset:2px;outline:2px solid var(--rds-feedback-info);transition:outline-offset .25s ease}.rds-radio-toggle:focus-within::-moz-focus-inner{border-style:none;outline:0}.rds-radio-toggle:focus-within button::-moz-focus-inner,.rds-radio-toggle:focus-within [type=button]::-moz-focus-inner,.rds-radio-toggle:focus-within [type=reset]::-moz-focus-inner,.rds-radio-toggle:focus-within [type=submit]::-moz-focus-inner{border-style:none}.rds-radio-toggle:focus-within input[type=button]::-moz-focus-inner{outline:0}html:not([data-mousenavigation]):not([data-touchnavigation]) .rds-radio-toggle:focus-within{outline-offset:2px;outline:2px solid var(--rds-feedback-info);transition:outline-offset .25s ease}
@@ -1 +1,65 @@
1
- var r=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,s=(e,a,t)=>a in e?r(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,n=(r,e)=>{for(var a in e||(e={}))o.call(e,a)&&s(r,a,e[a]);if(t)for(var a of t(e))l.call(e,a)&&s(r,a,e[a]);return r};import{createContext as i,forwardRef as c,useContext as p}from"react";import"../button/Button.js";import{a as d,j as m}from"../core/RiksTV.js";const b=i({radioName:""});const f=c(((r,s)=>{var i=r,{label:c,name:f,className:u=""}=i,g=((r,e)=>{var a={};for(var s in r)o.call(r,s)&&e.indexOf(s)<0&&(a[s]=r[s]);if(null!=r&&t)for(var s of t(r))e.indexOf(s)<0&&l.call(r,s)&&(a[s]=r[s]);return a})(i,["label","name","className"]);const{radioName:y}=p(b);return d("label",{className:`rds-radio-toggle rds-button rds-button__shared rds-button__shared--primary ${u}`,children:[m("input",(O=n({className:"rds-radio-toggle__input"},g),j={ref:s,type:"radio",name:y||f},e(O,a(j)))),m("span",{className:"rds-radio-toggle__label",children:c})]});var O,j}));f.displayName="RadioToggleInput";export{b as R,f as a};
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,5 +1,7 @@
1
- @use '../core/mixin/focus' as mix;
2
- @use '../core/mixin/rem';
1
+ @use "../core/mixin/focus" as mix;
2
+ @use "../core/mixin/rem";
3
+ @use "../button/button-shared";
4
+ @use "../button/button";
3
5
 
4
6
  .rds-field-set {
5
7
  border: none;
@@ -12,6 +14,9 @@
12
14
  }
13
15
 
14
16
  .rds-radio-toggle {
17
+ @extend .rds-button__shared;
18
+ @extend .rds-button;
19
+ @extend .rds-button__shared--tertiary;
15
20
  // button reset
16
21
  padding: 0;
17
22
  background-color: var(--rds-foreground-overlay-soft);