@clubmed/trident-ui 1.0.0-alpha.42 → 1.0.0-alpha.44
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -0
- package/assets/style.css +1 -1
- package/atoms/Icons/Icon.js +6 -6
- package/fonts/Actions/tui-actions.css +6 -6
- package/fonts/Actions/tui-actions.eot +0 -0
- package/fonts/Actions/tui-actions.less +6 -6
- package/fonts/Actions/tui-actions.module.less +6 -6
- package/fonts/Actions/tui-actions.scss +6 -6
- package/fonts/Actions/tui-actions.styl +6 -6
- package/fonts/Actions/tui-actions.ttf +0 -0
- package/fonts/Actions/tui-actions.woff +0 -0
- package/fonts/Actions/tui-actions.woff2 +0 -0
- package/fonts/Activities/tui-activities.css +6 -6
- package/fonts/Activities/tui-activities.eot +0 -0
- package/fonts/Activities/tui-activities.less +6 -6
- package/fonts/Activities/tui-activities.module.less +6 -6
- package/fonts/Activities/tui-activities.scss +6 -6
- package/fonts/Activities/tui-activities.styl +6 -6
- package/fonts/Activities/tui-activities.ttf +0 -0
- package/fonts/Activities/tui-activities.woff +0 -0
- package/fonts/Activities/tui-activities.woff2 +0 -0
- package/fonts/Brand/tui-brand.css +6 -6
- package/fonts/Brand/tui-brand.eot +0 -0
- package/fonts/Brand/tui-brand.less +6 -6
- package/fonts/Brand/tui-brand.module.less +6 -6
- package/fonts/Brand/tui-brand.scss +6 -6
- package/fonts/Brand/tui-brand.styl +6 -6
- package/fonts/Brand/tui-brand.ttf +0 -0
- package/fonts/Brand/tui-brand.woff +0 -0
- package/fonts/Brand/tui-brand.woff2 +0 -0
- package/fonts/Covid/tui-covid.css +6 -6
- package/fonts/Covid/tui-covid.eot +0 -0
- package/fonts/Covid/tui-covid.less +6 -6
- package/fonts/Covid/tui-covid.module.less +6 -6
- package/fonts/Covid/tui-covid.scss +6 -6
- package/fonts/Covid/tui-covid.styl +6 -6
- package/fonts/Covid/tui-covid.ttf +0 -0
- package/fonts/Covid/tui-covid.woff +0 -0
- package/fonts/Covid/tui-covid.woff2 +0 -0
- package/fonts/Food/tui-food.css +6 -6
- package/fonts/Food/tui-food.eot +0 -0
- package/fonts/Food/tui-food.less +6 -6
- package/fonts/Food/tui-food.module.less +6 -6
- package/fonts/Food/tui-food.scss +6 -6
- package/fonts/Food/tui-food.styl +6 -6
- package/fonts/Food/tui-food.ttf +0 -0
- package/fonts/Food/tui-food.woff +0 -0
- package/fonts/Food/tui-food.woff2 +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.css +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.module.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.scss +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.styl +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
- package/fonts/Places/tui-places.css +6 -6
- package/fonts/Places/tui-places.eot +0 -0
- package/fonts/Places/tui-places.less +6 -6
- package/fonts/Places/tui-places.module.less +6 -6
- package/fonts/Places/tui-places.scss +6 -6
- package/fonts/Places/tui-places.styl +6 -6
- package/fonts/Places/tui-places.ttf +0 -0
- package/fonts/Places/tui-places.woff +0 -0
- package/fonts/Places/tui-places.woff2 +0 -0
- package/fonts/Room/tui-room.css +6 -6
- package/fonts/Room/tui-room.eot +0 -0
- package/fonts/Room/tui-room.less +6 -6
- package/fonts/Room/tui-room.module.less +6 -6
- package/fonts/Room/tui-room.scss +6 -6
- package/fonts/Room/tui-room.styl +6 -6
- package/fonts/Room/tui-room.ttf +0 -0
- package/fonts/Room/tui-room.woff +0 -0
- package/fonts/Room/tui-room.woff2 +0 -0
- package/fonts/Services/tui-services.css +6 -6
- package/fonts/Services/tui-services.eot +0 -0
- package/fonts/Services/tui-services.less +6 -6
- package/fonts/Services/tui-services.module.less +6 -6
- package/fonts/Services/tui-services.scss +6 -6
- package/fonts/Services/tui-services.styl +6 -6
- package/fonts/Services/tui-services.ttf +0 -0
- package/fonts/Services/tui-services.woff +0 -0
- package/fonts/Services/tui-services.woff2 +0 -0
- package/fonts/Socials/tui-socials.css +6 -6
- package/fonts/Socials/tui-socials.eot +0 -0
- package/fonts/Socials/tui-socials.less +6 -6
- package/fonts/Socials/tui-socials.module.less +6 -6
- package/fonts/Socials/tui-socials.scss +6 -6
- package/fonts/Socials/tui-socials.styl +6 -6
- package/fonts/Socials/tui-socials.ttf +0 -0
- package/fonts/Socials/tui-socials.woff +0 -0
- package/fonts/Socials/tui-socials.woff2 +0 -0
- package/fonts/Transports/tui-transports.css +6 -6
- package/fonts/Transports/tui-transports.eot +0 -0
- package/fonts/Transports/tui-transports.less +6 -6
- package/fonts/Transports/tui-transports.module.less +6 -6
- package/fonts/Transports/tui-transports.scss +6 -6
- package/fonts/Transports/tui-transports.styl +6 -6
- package/fonts/Transports/tui-transports.ttf +0 -0
- package/fonts/Transports/tui-transports.woff +0 -0
- package/fonts/Transports/tui-transports.woff2 +0 -0
- package/fonts/Utilities/tui-utilities.css +6 -6
- package/fonts/Utilities/tui-utilities.eot +0 -0
- package/fonts/Utilities/tui-utilities.less +6 -6
- package/fonts/Utilities/tui-utilities.module.less +6 -6
- package/fonts/Utilities/tui-utilities.scss +6 -6
- package/fonts/Utilities/tui-utilities.styl +6 -6
- package/fonts/Utilities/tui-utilities.ttf +0 -0
- package/fonts/Utilities/tui-utilities.woff +0 -0
- package/fonts/Utilities/tui-utilities.woff2 +0 -0
- package/molecules/Forms/FormControl.d.ts +2 -5
- package/molecules/Forms/Password/Password.d.ts +0 -2
- package/molecules/Forms/Switch/Switch.d.ts +5 -0
- package/molecules/Forms/Switch/Switch.js +60 -0
- package/package.json +1 -1
- package/molecules/Forms/Switch.d.ts +0 -10
- package/molecules/Forms/Switch.js +0 -60
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-transports";
|
2
|
-
src: url('tui-transports.eot?t=
|
3
|
-
src: url('tui-transports.eot?t=
|
4
|
-
url("tui-transports.woff2?t=
|
5
|
-
url("tui-transports.woff?t=
|
6
|
-
url('tui-transports.ttf?t=
|
7
|
-
url('tui-transports.svg?t=
|
2
|
+
src: url('tui-transports.eot?t=1714036372651'); /* IE9*/
|
3
|
+
src: url('tui-transports.eot?t=1714036372651#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-transports.woff2?t=1714036372651") format("woff2"),
|
5
|
+
url("tui-transports.woff?t=1714036372651") format("woff"),
|
6
|
+
url('tui-transports.ttf?t=1714036372651') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-transports.svg?t=1714036372651#tui-transports') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-transports-"], [class*=" tui-transports-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-transports";
|
2
|
-
src: url('tui-transports.eot?t=
|
3
|
-
src: url('tui-transports.eot?t=
|
4
|
-
url("tui-transports.woff2?t=
|
5
|
-
url("tui-transports.woff?t=
|
6
|
-
url('tui-transports.ttf?t=
|
7
|
-
url('tui-transports.svg?t=
|
2
|
+
src: url('tui-transports.eot?t=1714036372651'); /* IE9*/
|
3
|
+
src: url('tui-transports.eot?t=1714036372651#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-transports.woff2?t=1714036372651") format("woff2"),
|
5
|
+
url("tui-transports.woff?t=1714036372651") format("woff"),
|
6
|
+
url('tui-transports.ttf?t=1714036372651') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-transports.svg?t=1714036372651#tui-transports') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-transports-"], [class*=" tui-transports-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-transports";
|
2
|
-
src: url('tui-transports.eot?t=
|
3
|
-
src: url('tui-transports.eot?t=
|
4
|
-
url("tui-transports.woff2?t=
|
5
|
-
url("tui-transports.woff?t=
|
6
|
-
url('tui-transports.ttf?t=
|
7
|
-
url('tui-transports.svg?t=
|
2
|
+
src: url('tui-transports.eot?t=1714036372651'); /* IE9*/
|
3
|
+
src: url('tui-transports.eot?t=1714036372651#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-transports.woff2?t=1714036372651") format("woff2"),
|
5
|
+
url("tui-transports.woff?t=1714036372651") format("woff"),
|
6
|
+
url('tui-transports.ttf?t=1714036372651') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-transports.svg?t=1714036372651#tui-transports') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-transports-"], [class*=" tui-transports-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-transports";
|
2
|
-
src: url('tui-transports.eot?t=
|
3
|
-
src: url('tui-transports.eot?t=
|
4
|
-
url("tui-transports.woff2?t=
|
5
|
-
url("tui-transports.woff?t=
|
6
|
-
url('tui-transports.ttf?t=
|
7
|
-
url('tui-transports.svg?t=
|
2
|
+
src: url('tui-transports.eot?t=1714036372651'); /* IE9*/
|
3
|
+
src: url('tui-transports.eot?t=1714036372651#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-transports.woff2?t=1714036372651") format("woff2"),
|
5
|
+
url("tui-transports.woff?t=1714036372651") format("woff"),
|
6
|
+
url('tui-transports.ttf?t=1714036372651') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-transports.svg?t=1714036372651#tui-transports') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-transports-"], [class*=" tui-transports-"] {
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,11 +1,11 @@
|
|
1
1
|
@font-face {
|
2
2
|
font-family: "tui-utilities";
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
src: url('tui-utilities.eot?t=
|
5
|
-
url("tui-utilities.woff2?t=
|
6
|
-
url("tui-utilities.woff?t=
|
7
|
-
url('tui-utilities.ttf?t=
|
8
|
-
url('tui-utilities.svg?t=
|
3
|
+
src: url('tui-utilities.eot?t=1714036372805'); /* IE9*/
|
4
|
+
src: url('tui-utilities.eot?t=1714036372805#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
5
|
+
url("tui-utilities.woff2?t=1714036372805") format("woff2"),
|
6
|
+
url("tui-utilities.woff?t=1714036372805") format("woff"),
|
7
|
+
url('tui-utilities.ttf?t=1714036372805') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
8
|
+
url('tui-utilities.svg?t=1714036372805#tui-utilities') format('svg'); /* iOS 4.1- */
|
9
9
|
}
|
10
10
|
|
11
11
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
Binary file
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1714036372805'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1714036372805#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1714036372805") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1714036372805") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1714036372805') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1714036372805#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1714036372805'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1714036372805#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1714036372805") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1714036372805") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1714036372805') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1714036372805#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1714036372805'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1714036372805#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1714036372805") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1714036372805") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1714036372805') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1714036372805#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1714036372805'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1714036372805#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1714036372805") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1714036372805") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1714036372805') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1714036372805#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,10 +1,7 @@
|
|
1
1
|
import { HTMLAttributes, InputHTMLAttributes, PropsWithChildren } from 'react';
|
2
|
-
import { ValidationStatus } from '../../hooks/useInternalStatus
|
3
|
-
import { FormLabelProps } from './FormLabel
|
2
|
+
import { ValidationStatus } from '../../hooks/useInternalStatus';
|
3
|
+
import { FormLabelProps } from './FormLabel';
|
4
4
|
export type FormControlProps<Value = unknown, Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>> = {
|
5
|
-
/**
|
6
|
-
* Value text
|
7
|
-
*/
|
8
5
|
value?: Value;
|
9
6
|
validationStatus?: ValidationStatus;
|
10
7
|
onChange?: (name: string, value: Value) => void;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import { FormControlProps } from '../FormControl';
|
2
|
-
import { ValidationStatus } from '../../../hooks/useInternalStatus';
|
3
2
|
import { ValidationMessage } from './ValidationMessage';
|
4
3
|
export interface PasswordProps<Value> extends FormControlProps<Value> {
|
5
|
-
status?: ValidationStatus;
|
6
4
|
validationMessages?: ValidationMessage[];
|
7
5
|
}
|
8
6
|
export declare function Password<Value = string>(props: PasswordProps<Value>): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { FormControlProps } from '../FormControl';
|
2
|
+
export interface SwitchProps extends FormControlProps<boolean> {
|
3
|
+
width?: number;
|
4
|
+
}
|
5
|
+
export declare function Switch({ id, name, className, checked: initialChecked, disabled, width, onChange, tabIndex, children, }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { c as m } from "../../../index-Cu0xwYjD.js";
|
3
|
+
import { useValue as x } from "../../../hooks/useValue.js";
|
4
|
+
import "../../../controls-l0sNRNKZ.js";
|
5
|
+
let f = 0;
|
6
|
+
function d({
|
7
|
+
id: a = `switch-${++f}`,
|
8
|
+
name: r = a,
|
9
|
+
className: s,
|
10
|
+
checked: o,
|
11
|
+
disabled: c,
|
12
|
+
width: t = 56,
|
13
|
+
onChange: n,
|
14
|
+
tabIndex: h = 0,
|
15
|
+
children: p
|
16
|
+
}) {
|
17
|
+
const { value: i, setValue: u } = x({
|
18
|
+
initialValue: o,
|
19
|
+
name: r,
|
20
|
+
onChange: n
|
21
|
+
});
|
22
|
+
return /* @__PURE__ */ l(
|
23
|
+
"label",
|
24
|
+
{
|
25
|
+
className: m(s, "relative flex items-center gap-[10px]", {
|
26
|
+
"text-grey": c,
|
27
|
+
"cursor-pointer": !c
|
28
|
+
}),
|
29
|
+
"data-testid": "SwitchContainer",
|
30
|
+
children: [
|
31
|
+
/* @__PURE__ */ l("span", { className: "relative", children: [
|
32
|
+
/* @__PURE__ */ e(
|
33
|
+
"input",
|
34
|
+
{
|
35
|
+
type: "checkbox",
|
36
|
+
name: r,
|
37
|
+
tabIndex: h,
|
38
|
+
checked: i,
|
39
|
+
disabled: c,
|
40
|
+
role: "switch",
|
41
|
+
className: "absolute w-full h-full opacity-0 cursor-pointer",
|
42
|
+
onChange: () => {
|
43
|
+
!c && u(!i);
|
44
|
+
},
|
45
|
+
"data-name": "Switch"
|
46
|
+
}
|
47
|
+
),
|
48
|
+
/* @__PURE__ */ e("span", { style: { height: t * 4 / 7, width: t }, children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: t * 3 / 7, children: /* @__PURE__ */ l("g", { children: [
|
49
|
+
/* @__PURE__ */ e("circle", { cx: 12, cy: 12, r: 12, fill: "hsl(var(--color-white))" }),
|
50
|
+
/* @__PURE__ */ e("circle", { cx: 12, cy: 12, r: 4, fill: "hsl(var(--color-grey))" })
|
51
|
+
] }) }) })
|
52
|
+
] }),
|
53
|
+
/* @__PURE__ */ e("span", { className: "text-b2 font-semibold", children: p })
|
54
|
+
]
|
55
|
+
}
|
56
|
+
);
|
57
|
+
}
|
58
|
+
export {
|
59
|
+
d as Switch
|
60
|
+
};
|
package/package.json
CHANGED
@@ -1,10 +0,0 @@
|
|
1
|
-
import { InputHTMLAttributes } from 'react';
|
2
|
-
import './controls.css';
|
3
|
-
export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
4
|
-
/**
|
5
|
-
* The width of the switch.
|
6
|
-
* */
|
7
|
-
width?: number;
|
8
|
-
onChange?: (name: string, value: boolean) => void;
|
9
|
-
}
|
10
|
-
export declare function Switch({ id, name, className, checked: initialChecked, disabled, width, onChange, tabIndex, children, ...rest }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
@@ -1,60 +0,0 @@
|
|
1
|
-
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { c as f } from "../../index-Cu0xwYjD.js";
|
3
|
-
import { useValue as x } from "../../hooks/useValue.js";
|
4
|
-
import "../../controls-l0sNRNKZ.js";
|
5
|
-
let g = 0;
|
6
|
-
function k({
|
7
|
-
id: a = `switch-${++g}`,
|
8
|
-
name: t = a,
|
9
|
-
className: s,
|
10
|
-
checked: o,
|
11
|
-
disabled: c,
|
12
|
-
width: l = 56,
|
13
|
-
onChange: h,
|
14
|
-
tabIndex: n = 0,
|
15
|
-
children: u,
|
16
|
-
...m
|
17
|
-
}) {
|
18
|
-
const { value: i, setValue: p } = x({
|
19
|
-
initialValue: o,
|
20
|
-
name: t,
|
21
|
-
onChange: h
|
22
|
-
});
|
23
|
-
return /* @__PURE__ */ r(
|
24
|
-
"label",
|
25
|
-
{
|
26
|
-
className: f(s, "relative flex items-center gap-8", {
|
27
|
-
"text-grey": c
|
28
|
-
}),
|
29
|
-
children: [
|
30
|
-
/* @__PURE__ */ r("span", { className: "relative", children: [
|
31
|
-
/* @__PURE__ */ e(
|
32
|
-
"input",
|
33
|
-
{
|
34
|
-
...m,
|
35
|
-
className: "absolute w-full h-full opacity-0 cursor-pointer",
|
36
|
-
type: "checkbox",
|
37
|
-
name: t,
|
38
|
-
tabIndex: n,
|
39
|
-
onChange: () => {
|
40
|
-
!c && p(!i);
|
41
|
-
},
|
42
|
-
role: "switch",
|
43
|
-
"data-name": "Switch",
|
44
|
-
checked: i,
|
45
|
-
disabled: c
|
46
|
-
}
|
47
|
-
),
|
48
|
-
/* @__PURE__ */ e("span", { style: { height: l * 4 / 7, width: l }, children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: l * 3 / 7, children: /* @__PURE__ */ r("g", { children: [
|
49
|
-
/* @__PURE__ */ e("circle", { cx: 12, cy: 12, r: 12, fill: "hsl(var(--color-white))" }),
|
50
|
-
/* @__PURE__ */ e("circle", { cx: 12, cy: 12, r: 4, fill: "hsl(var(--color-grey))" })
|
51
|
-
] }) }) })
|
52
|
-
] }),
|
53
|
-
u
|
54
|
-
]
|
55
|
-
}
|
56
|
-
);
|
57
|
-
}
|
58
|
-
export {
|
59
|
-
k as Switch
|
60
|
-
};
|