@cagatayfdn/flora-components 0.0.107 → 0.0.109
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/Checkbox.css +1 -1
- package/dist/Switch.css +1 -1
- package/dist/components/Checkbox/Checkbox.js +83 -83
- package/dist/components/Switch/Switch.js +54 -49
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/Checkbox.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@font-face{font-family:icons;src:url(./icons.ttf?d7c5f4afeb19a281435835a1c99d5e42) format("truetype"),url(./icons.woff?d7c5f4afeb19a281435835a1c99d5e42) format("woff"),url(./icons.woff2?d7c5f4afeb19a281435835a1c99d5e42) format("woff2")}i[class^=icon-]:before,i[class*=" icon-"]:before{font-family:icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}._icon-
|
|
1
|
+
@font-face{font-family:icons;src:url(./icons.ttf?d7c5f4afeb19a281435835a1c99d5e42) format("truetype"),url(./icons.woff?d7c5f4afeb19a281435835a1c99d5e42) format("woff"),url(./icons.woff2?d7c5f4afeb19a281435835a1c99d5e42) format("woff2")}i[class^=icon-]:before,i[class*=" icon-"]:before{font-family:icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}._icon-applications_1hdsg_16:before{content:""}._icon-attach_1hdsg_20:before{content:""}._icon-attachment_1hdsg_24:before{content:""}._icon-billing_1hdsg_28:before{content:""}._icon-box_1hdsg_32:before{content:""}._icon-calendar_1hdsg_36:before{content:""}._icon-cart_1hdsg_40:before{content:""}._icon-certificate_1hdsg_44:before{content:""}._icon-check_1hdsg_48:before{content:""}._icon-chevron-left_1hdsg_52:before{content:""}._icon-chevron-right_1hdsg_56:before{content:""}._icon-circle-minus_1hdsg_60:before{content:""}._icon-circle-plus_1hdsg_64:before{content:""}._icon-clock_1hdsg_68:before{content:""}._icon-close_1hdsg_72:before{content:""}._icon-copy_1hdsg_76:before{content:""}._icon-credit-card_1hdsg_80:before{content:""}._icon-document_1hdsg_84:before{content:""}._icon-domain-registration_1hdsg_88:before{content:""}._icon-domains_1hdsg_92:before{content:""}._icon-down-arrow_1hdsg_96:before{content:""}._icon-down-square_1hdsg_100:before{content:""}._icon-down_1hdsg_96:before{content:""}._icon-download_1hdsg_108:before{content:""}._icon-edit-outline_1hdsg_112:before{content:""}._icon-edit_1hdsg_112:before{content:""}._icon-email_1hdsg_120:before{content:""}._icon-environment_1hdsg_124:before{content:""}._icon-error-fill_1hdsg_128:before{content:""}._icon-error_1hdsg_128:before{content:""}._icon-fileTextOutlined_1hdsg_136:before{content:""}._icon-info_1hdsg_140:before{content:""}._icon-install_1hdsg_144:before{content:""}._icon-link_1hdsg_148:before{content:""}._icon-log_1hdsg_152:before{content:""}._icon-menu-close_1hdsg_156:before{content:""}._icon-menu-open_1hdsg_160:before{content:""}._icon-monitoring_1hdsg_164:before{content:""}._icon-network_1hdsg_168:before{content:""}._icon-no-results_1hdsg_172:before{content:""}._icon-not-edit_1hdsg_176:before{content:""}._icon-out_1hdsg_180:before{content:""}._icon-path_1hdsg_184:before{content:""}._icon-plus_1hdsg_188:before{content:""}._icon-preview_1hdsg_192:before{content:""}._icon-profile_1hdsg_196:before{content:""}._icon-project-list_1hdsg_200:before{content:""}._icon-projects_1hdsg_204:before{content:""}._icon-reload_1hdsg_208:before{content:""}._icon-retry_1hdsg_212:before{content:""}._icon-search_1hdsg_216:before{content:""}._icon-settings_1hdsg_220:before{content:""}._icon-support_1hdsg_224:before{content:""}._icon-trash_1hdsg_228:before{content:""}._icon-users_1hdsg_232:before{content:""}._icon-warning_1hdsg_236:before{content:""}._checkbox_1hdsg_240{line-height:18px;position:relative;height:20px;display:inline-block}._checkbox_1hdsg_240 input[type=checkbox]{vertical-align:middle;left:0;position:absolute;z-index:2;width:100%;height:100%;cursor:pointer;opacity:0}._checkbox_1hdsg_240 label{padding-left:18px;line-height:22px;font-weight:400;cursor:pointer;color:#fff;margin-bottom:0}._checkbox_1hdsg_240 label span{margin-left:10px}._checkbox_1hdsg_240 input[type=checkbox]+label:before,._checkbox_1hdsg_240 input[type=checkbox]+label:after{content:"";font-family:icons;display:inline-block;vertical-align:middle;position:absolute;top:2px;left:0;cursor:pointer}._checkbox_1hdsg_240 input[type=checkbox]+label:after{color:#fff;font-size:18px;width:18px;height:18px;border-radius:4px}._checkbox_1hdsg_240 input[type=checkbox]+label:before{height:18px;width:18px;background-color:#e9f0f7;border:solid 1px #c8daec;border-radius:4px}._checkbox_1hdsg_240 input[type=checkbox]:disabled{cursor:not-allowed}._checkbox_1hdsg_240 input[type=checkbox]:disabled+label{opacity:.3}._checkbox_1hdsg_240 input[type=checkbox]:checked+label:before{content:"";text-align:center;top:2px;left:0;z-index:1;background-color:#6c7ebe;border-color:#6c7ebe;color:#fdfdfd;font-size:11px;line-height:17px}._checkbox_1hdsg_240 a{text-decoration:underline!important;cursor:pointer!important}._checkbox__filter_1hdsg_314{background-color:#2b344c;border:2px solid #262e47;border-radius:5px;height:40px;padding:10px 10px 10px 0;display:flex;align-items:center}._checkbox__filter_1hdsg_314 label{margin-left:16px}._checkbox__filter_1hdsg_314 label span{color:#fff;font-weight:600}._checkbox__filter_1hdsg_314 input{width:18px!important;height:18px!important}._checkbox__filter_1hdsg_314 input+label:before{margin-top:6px;margin-left:16px;height:18px;width:18px;background-color:#e9f0f7;border:solid 1px #c8daec;border-radius:4px}._switch_1hdsg_344{position:relative;display:inline-block;min-width:43px;height:26px;margin-bottom:0}._switch_1hdsg_344._text-hide_1hdsg_351:before,._switch_1hdsg_344._text-hide_1hdsg_351:after{display:none!important}._switch_1hdsg_344 input{opacity:0;width:0;height:0}._slider_1hdsg_361{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#78788029;-webkit-transition:.4s;transition:.4s}._slider_1hdsg_361:after{content:"";color:#fff;line-height:28px;padding-left:30px}._slider_1hdsg_361:before{position:absolute;content:"";height:22px;width:22px;left:2px;bottom:2px;background-color:#fff;-webkit-transition:.4s;transition:.4s}input:checked+._slider_1hdsg_361{background-color:#71d200}input:checked+._slider_1hdsg_361:after{content:"";padding-left:10px}input:checked+._slider_1hdsg_361:before{-webkit-transform:translateX(17px);-moz-transform:translateX(17px);-ms-transform:translateX(17px);-o-transform:translateX(17px);transform-origin:center center}._slider_1hdsg_361._round_1hdsg_408{border-radius:34px}._slider_1hdsg_361._round_1hdsg_408:before{border-radius:50%;box-shadow:0 3px 1px #0000000f,0 3px 8px #00000026}
|
package/dist/Switch.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._switch_5793j_1{position:relative;display:inline-block;width:58px;height:26px;border-radius:24px}._switch_5793j_1 input{opacity:0;width:0;height:0;margin:0}._switch_5793j_1._checked_5793j_14{border-color:transparent}._switch_5793j_1._disabled_5793j_17{opacity:.5}._switch__small_5793j_20{width:58px}._switch__small_5793j_20 input:checked+._slider_5793j_23:before{transform:translate(33px)}._switch__small_5793j_20 ._active_5793j_26{padding-left:7px}._switch__small_5793j_20 ._passive_5793j_29{padding-right:7px}._switch__large_5793j_32{width:82px}._switch__large_5793j_32 input:checked+._slider_5793j_23:before{transform:translate(58px)}._switch__large_5793j_32 ._passive_5793j_29{padding-right:11px}._switch__large_5793j_32 ._active_5793j_26{padding-left:11px}._slider_5793j_23{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#d4d6f0;border-color:2px solid;-webkit-transition:.4s;transition:.4s;border-radius:30px;text-align:inherit!important}._slider_5793j_23 span{font-size:9px;text-transform:uppercase;font-weight:700;padding:0 5px;display:flex!important;justify-content:flex-end;align-items:center;height:100%}._slider_5793j_23:before{position:absolute;content:"";height:22px;width:22px;bottom:2px;background-color:#fff;-webkit-transition:.4s;transition:.4s;border-radius:30px;transform:translate(2px)}input:checked+._slider_5793j_23{background-color:#71d200}input:checked+._slider_5793j_23 span{justify-content:flex-start}input:focus+._slider_5793j_23{box-shadow:0 0 1px #71d200}._slider_5793j_23._round_5793j_95{border-radius:34px}._slider_5793j_23._round_5793j_95:before{border-radius:50%}
|
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
import { j as o } from "../../jsx-runtime-BcAkpsdy.js";
|
|
2
|
-
import
|
|
2
|
+
import f, { useState as x, useEffect as k } from "react";
|
|
3
3
|
import { c as w } from "../../index-BHf7G3IG.js";
|
|
4
4
|
import b from "../Label/Label.js";
|
|
5
|
-
import
|
|
6
|
-
import '../../Checkbox.css';const v = "
|
|
7
|
-
"icon-applications": "_icon-
|
|
8
|
-
"icon-attach": "_icon-
|
|
9
|
-
"icon-attachment": "_icon-
|
|
10
|
-
"icon-billing": "_icon-
|
|
11
|
-
"icon-box": "_icon-
|
|
12
|
-
"icon-calendar": "_icon-
|
|
13
|
-
"icon-cart": "_icon-
|
|
14
|
-
"icon-certificate": "_icon-
|
|
15
|
-
"icon-check": "_icon-
|
|
16
|
-
"icon-chevron-left": "_icon-chevron-
|
|
17
|
-
"icon-chevron-right": "_icon-chevron-
|
|
18
|
-
"icon-circle-minus": "_icon-circle-
|
|
19
|
-
"icon-circle-plus": "_icon-circle-
|
|
20
|
-
"icon-clock": "_icon-
|
|
21
|
-
"icon-close": "_icon-
|
|
22
|
-
"icon-copy": "_icon-
|
|
23
|
-
"icon-credit-card": "_icon-credit-
|
|
24
|
-
"icon-document": "_icon-
|
|
25
|
-
"icon-domain-registration": "_icon-domain-
|
|
26
|
-
"icon-domains": "_icon-
|
|
27
|
-
"icon-down-arrow": "_icon-down-
|
|
28
|
-
"icon-down-square": "_icon-down-
|
|
29
|
-
"icon-down": "_icon-
|
|
30
|
-
"icon-download": "_icon-
|
|
31
|
-
"icon-edit-outline": "_icon-edit-
|
|
32
|
-
"icon-edit": "_icon-
|
|
33
|
-
"icon-email": "_icon-
|
|
34
|
-
"icon-environment": "_icon-
|
|
35
|
-
"icon-error-fill": "_icon-error-
|
|
36
|
-
"icon-error": "_icon-
|
|
37
|
-
"icon-fileTextOutlined": "_icon-
|
|
38
|
-
"icon-info": "_icon-
|
|
39
|
-
"icon-install": "_icon-
|
|
40
|
-
"icon-link": "_icon-
|
|
41
|
-
"icon-log": "_icon-
|
|
42
|
-
"icon-menu-close": "_icon-menu-
|
|
43
|
-
"icon-menu-open": "_icon-menu-
|
|
44
|
-
"icon-monitoring": "_icon-
|
|
45
|
-
"icon-network": "_icon-
|
|
46
|
-
"icon-no-results": "_icon-no-
|
|
47
|
-
"icon-not-edit": "_icon-not-
|
|
48
|
-
"icon-out": "_icon-
|
|
49
|
-
"icon-path": "_icon-
|
|
50
|
-
"icon-plus": "_icon-
|
|
51
|
-
"icon-preview": "_icon-
|
|
52
|
-
"icon-profile": "_icon-
|
|
53
|
-
"icon-project-list": "_icon-project-
|
|
54
|
-
"icon-projects": "_icon-
|
|
55
|
-
"icon-reload": "_icon-
|
|
56
|
-
"icon-retry": "_icon-
|
|
57
|
-
"icon-search": "_icon-
|
|
58
|
-
"icon-settings": "_icon-
|
|
59
|
-
"icon-support": "_icon-
|
|
60
|
-
"icon-trash": "_icon-
|
|
61
|
-
"icon-users": "_icon-
|
|
62
|
-
"icon-warning": "_icon-
|
|
5
|
+
import j from "../ValidationError/ValidationError.js";
|
|
6
|
+
import '../../Checkbox.css';const v = "_checkbox_1hdsg_240", y = "_checkbox__filter_1hdsg_314", C = "_slider_1hdsg_361", E = "_round_1hdsg_408", i = {
|
|
7
|
+
"icon-applications": "_icon-applications_1hdsg_16",
|
|
8
|
+
"icon-attach": "_icon-attach_1hdsg_20",
|
|
9
|
+
"icon-attachment": "_icon-attachment_1hdsg_24",
|
|
10
|
+
"icon-billing": "_icon-billing_1hdsg_28",
|
|
11
|
+
"icon-box": "_icon-box_1hdsg_32",
|
|
12
|
+
"icon-calendar": "_icon-calendar_1hdsg_36",
|
|
13
|
+
"icon-cart": "_icon-cart_1hdsg_40",
|
|
14
|
+
"icon-certificate": "_icon-certificate_1hdsg_44",
|
|
15
|
+
"icon-check": "_icon-check_1hdsg_48",
|
|
16
|
+
"icon-chevron-left": "_icon-chevron-left_1hdsg_52",
|
|
17
|
+
"icon-chevron-right": "_icon-chevron-right_1hdsg_56",
|
|
18
|
+
"icon-circle-minus": "_icon-circle-minus_1hdsg_60",
|
|
19
|
+
"icon-circle-plus": "_icon-circle-plus_1hdsg_64",
|
|
20
|
+
"icon-clock": "_icon-clock_1hdsg_68",
|
|
21
|
+
"icon-close": "_icon-close_1hdsg_72",
|
|
22
|
+
"icon-copy": "_icon-copy_1hdsg_76",
|
|
23
|
+
"icon-credit-card": "_icon-credit-card_1hdsg_80",
|
|
24
|
+
"icon-document": "_icon-document_1hdsg_84",
|
|
25
|
+
"icon-domain-registration": "_icon-domain-registration_1hdsg_88",
|
|
26
|
+
"icon-domains": "_icon-domains_1hdsg_92",
|
|
27
|
+
"icon-down-arrow": "_icon-down-arrow_1hdsg_96",
|
|
28
|
+
"icon-down-square": "_icon-down-square_1hdsg_100",
|
|
29
|
+
"icon-down": "_icon-down_1hdsg_96",
|
|
30
|
+
"icon-download": "_icon-download_1hdsg_108",
|
|
31
|
+
"icon-edit-outline": "_icon-edit-outline_1hdsg_112",
|
|
32
|
+
"icon-edit": "_icon-edit_1hdsg_112",
|
|
33
|
+
"icon-email": "_icon-email_1hdsg_120",
|
|
34
|
+
"icon-environment": "_icon-environment_1hdsg_124",
|
|
35
|
+
"icon-error-fill": "_icon-error-fill_1hdsg_128",
|
|
36
|
+
"icon-error": "_icon-error_1hdsg_128",
|
|
37
|
+
"icon-fileTextOutlined": "_icon-fileTextOutlined_1hdsg_136",
|
|
38
|
+
"icon-info": "_icon-info_1hdsg_140",
|
|
39
|
+
"icon-install": "_icon-install_1hdsg_144",
|
|
40
|
+
"icon-link": "_icon-link_1hdsg_148",
|
|
41
|
+
"icon-log": "_icon-log_1hdsg_152",
|
|
42
|
+
"icon-menu-close": "_icon-menu-close_1hdsg_156",
|
|
43
|
+
"icon-menu-open": "_icon-menu-open_1hdsg_160",
|
|
44
|
+
"icon-monitoring": "_icon-monitoring_1hdsg_164",
|
|
45
|
+
"icon-network": "_icon-network_1hdsg_168",
|
|
46
|
+
"icon-no-results": "_icon-no-results_1hdsg_172",
|
|
47
|
+
"icon-not-edit": "_icon-not-edit_1hdsg_176",
|
|
48
|
+
"icon-out": "_icon-out_1hdsg_180",
|
|
49
|
+
"icon-path": "_icon-path_1hdsg_184",
|
|
50
|
+
"icon-plus": "_icon-plus_1hdsg_188",
|
|
51
|
+
"icon-preview": "_icon-preview_1hdsg_192",
|
|
52
|
+
"icon-profile": "_icon-profile_1hdsg_196",
|
|
53
|
+
"icon-project-list": "_icon-project-list_1hdsg_200",
|
|
54
|
+
"icon-projects": "_icon-projects_1hdsg_204",
|
|
55
|
+
"icon-reload": "_icon-reload_1hdsg_208",
|
|
56
|
+
"icon-retry": "_icon-retry_1hdsg_212",
|
|
57
|
+
"icon-search": "_icon-search_1hdsg_216",
|
|
58
|
+
"icon-settings": "_icon-settings_1hdsg_220",
|
|
59
|
+
"icon-support": "_icon-support_1hdsg_224",
|
|
60
|
+
"icon-trash": "_icon-trash_1hdsg_228",
|
|
61
|
+
"icon-users": "_icon-users_1hdsg_232",
|
|
62
|
+
"icon-warning": "_icon-warning_1hdsg_236",
|
|
63
63
|
checkbox: v,
|
|
64
64
|
checkbox__filter: y,
|
|
65
|
-
switch: "
|
|
66
|
-
"text-hide": "_text-
|
|
65
|
+
switch: "_switch_1hdsg_344",
|
|
66
|
+
"text-hide": "_text-hide_1hdsg_351",
|
|
67
67
|
slider: C,
|
|
68
68
|
round: E
|
|
69
|
-
}, F =
|
|
69
|
+
}, F = f.forwardRef(
|
|
70
70
|
({
|
|
71
71
|
name: c,
|
|
72
|
-
label:
|
|
73
|
-
labelAppearance:
|
|
74
|
-
error:
|
|
75
|
-
isDisabled:
|
|
76
|
-
isInline:
|
|
72
|
+
label: s,
|
|
73
|
+
labelAppearance: l,
|
|
74
|
+
error: e,
|
|
75
|
+
isDisabled: d = !1,
|
|
76
|
+
isInline: a,
|
|
77
77
|
checked: n = !1,
|
|
78
|
-
onChange:
|
|
79
|
-
filterInput:
|
|
80
|
-
wrapperClassName:
|
|
78
|
+
onChange: t,
|
|
79
|
+
filterInput: p,
|
|
80
|
+
wrapperClassName: u,
|
|
81
81
|
..._
|
|
82
82
|
}) => {
|
|
83
|
-
const [
|
|
83
|
+
const [r, h] = x(
|
|
84
84
|
n || !!_.value
|
|
85
85
|
);
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
k(() => {
|
|
87
|
+
h(n);
|
|
88
88
|
}, [n]);
|
|
89
|
-
const
|
|
90
|
-
!_.readOnly && !
|
|
89
|
+
const m = (g) => {
|
|
90
|
+
!_.readOnly && !d && (g.persist(), h(!r), t && t(g));
|
|
91
91
|
};
|
|
92
92
|
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
93
93
|
/* @__PURE__ */ o.jsxs(
|
|
94
94
|
"div",
|
|
95
95
|
{
|
|
96
|
-
className: w(i.checkbox,
|
|
97
|
-
[i.inline]:
|
|
98
|
-
[i.checkbox__filter]:
|
|
96
|
+
className: w(i.checkbox, u, {
|
|
97
|
+
[i.inline]: a,
|
|
98
|
+
[i.checkbox__filter]: p
|
|
99
99
|
}),
|
|
100
100
|
"data-testid": "checkbox",
|
|
101
101
|
children: [
|
|
@@ -105,17 +105,17 @@ import '../../Checkbox.css';const v = "_checkbox_1jok7_240", y = "_checkbox__fil
|
|
|
105
105
|
type: "checkbox",
|
|
106
106
|
name: c,
|
|
107
107
|
id: c,
|
|
108
|
-
disabled:
|
|
109
|
-
checked:
|
|
110
|
-
onChange:
|
|
108
|
+
disabled: d,
|
|
109
|
+
checked: r,
|
|
110
|
+
onChange: m,
|
|
111
111
|
..._
|
|
112
112
|
}
|
|
113
113
|
),
|
|
114
|
-
/* @__PURE__ */ o.jsx(b, { className: i.label, name: c, appearance:
|
|
114
|
+
/* @__PURE__ */ o.jsx(b, { className: i.label, name: c, appearance: l, children: s && /* @__PURE__ */ o.jsx("span", { children: s }) })
|
|
115
115
|
]
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
|
-
|
|
118
|
+
e && /* @__PURE__ */ o.jsx(j, { ...e })
|
|
119
119
|
] });
|
|
120
120
|
}
|
|
121
121
|
);
|
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import u, { useState as v, useEffect as
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
|
|
2
|
+
import u, { useState as v, useEffect as j } from "react";
|
|
3
|
+
import { c as d } from "../../index-BHf7G3IG.js";
|
|
4
|
+
import N from "../Label/Label.js";
|
|
5
|
+
import { Size as y } from "../../enums/size.js";
|
|
6
|
+
import { u as b } from "../../useTranslation-CnCPcxVj.js";
|
|
7
|
+
import '../../Switch.css';const S = "_checked_5793j_14", O = "_disabled_5793j_17", R = "_switch__small_5793j_20", g = "_slider_5793j_23", C = "_active_5793j_26", E = "_passive_5793j_29", F = "_switch__large_5793j_32", L = "_round_5793j_95", t = {
|
|
8
|
+
switch: "_switch_5793j_1",
|
|
9
|
+
checked: S,
|
|
10
|
+
disabled: O,
|
|
11
|
+
switch__small: R,
|
|
12
|
+
slider: g,
|
|
13
|
+
active: C,
|
|
14
|
+
passive: E,
|
|
15
|
+
switch__large: F,
|
|
16
|
+
round: L
|
|
17
|
+
}, B = u.forwardRef(
|
|
15
18
|
({
|
|
16
|
-
name:
|
|
19
|
+
name: a,
|
|
17
20
|
label: r,
|
|
18
|
-
className:
|
|
21
|
+
className: p,
|
|
19
22
|
isDisabled: i,
|
|
20
|
-
value:
|
|
23
|
+
value: c,
|
|
21
24
|
onChange: o,
|
|
22
|
-
onLabelClick:
|
|
25
|
+
onLabelClick: n,
|
|
23
26
|
checkedChildren: f,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
h(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
size: l = y.SM,
|
|
28
|
+
unCheckedChildren: w,
|
|
29
|
+
..._
|
|
30
|
+
}, x) => {
|
|
31
|
+
const [s, h] = v(c), { t: m } = b();
|
|
32
|
+
j(() => {
|
|
33
|
+
!_.readOnly && !i && c !== void 0 && o && o(s);
|
|
34
|
+
}, [s, c]), j(() => {
|
|
35
|
+
c && h(c);
|
|
36
|
+
}, [c]);
|
|
37
|
+
const k = () => {
|
|
38
|
+
!i && !_.readOnly && h(!s), !i && n && n(!s);
|
|
35
39
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
r && /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ e.jsxs("div", { className: d(t.container, p), "data-testid": "switch-container", children: [
|
|
41
|
+
r && /* @__PURE__ */ e.jsx(N, { name: a, children: r }),
|
|
42
|
+
/* @__PURE__ */ e.jsx("div", { className: t.block, children: /* @__PURE__ */ e.jsxs(
|
|
39
43
|
"label",
|
|
40
44
|
{
|
|
41
|
-
className:
|
|
42
|
-
[
|
|
43
|
-
[
|
|
45
|
+
className: d(t.switch, {
|
|
46
|
+
[t.checked]: s,
|
|
47
|
+
[t.disabled]: i,
|
|
48
|
+
[t[`switch__${l}`]]: l
|
|
44
49
|
}),
|
|
45
|
-
htmlFor:
|
|
46
|
-
onClick: () =>
|
|
50
|
+
htmlFor: a,
|
|
51
|
+
onClick: () => k(),
|
|
47
52
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ e.jsx(
|
|
49
54
|
"input",
|
|
50
55
|
{
|
|
51
56
|
type: "checkbox",
|
|
52
|
-
name:
|
|
53
|
-
value:
|
|
57
|
+
name: a,
|
|
58
|
+
value: c,
|
|
54
59
|
"data-testid": "switch-input",
|
|
55
|
-
ref:
|
|
56
|
-
checked:
|
|
60
|
+
ref: x,
|
|
61
|
+
checked: s,
|
|
57
62
|
readOnly: !0,
|
|
58
|
-
...
|
|
63
|
+
..._
|
|
59
64
|
}
|
|
60
65
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ e.jsx("span", { className: t.slider, children: /* @__PURE__ */ e.jsx(
|
|
62
67
|
"span",
|
|
63
68
|
{
|
|
64
|
-
className:
|
|
65
|
-
[
|
|
66
|
-
[
|
|
69
|
+
className: d({
|
|
70
|
+
[t.active]: s,
|
|
71
|
+
[t.passive]: !s
|
|
67
72
|
}),
|
|
68
|
-
children:
|
|
73
|
+
children: s ? f || m("text.active") : w || m("text.passive")
|
|
69
74
|
}
|
|
70
75
|
) })
|
|
71
76
|
]
|
|
@@ -75,5 +80,5 @@ import '../../Switch.css';const N = "_checked_ptgnt_14", y = "_disabled_ptgnt_17
|
|
|
75
80
|
}
|
|
76
81
|
);
|
|
77
82
|
export {
|
|
78
|
-
|
|
83
|
+
B as default
|
|
79
84
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1231,6 +1231,7 @@ export declare const Switch: React_2.ForwardRefExoticComponent<{
|
|
|
1231
1231
|
label?: string | undefined;
|
|
1232
1232
|
checked?: boolean | undefined;
|
|
1233
1233
|
className?: string | undefined;
|
|
1234
|
+
size?: Size | undefined;
|
|
1234
1235
|
value?: any;
|
|
1235
1236
|
onChange?: ((value: boolean) => void) | undefined;
|
|
1236
1237
|
onLabelClick?: ((value: boolean) => void) | undefined;
|
|
@@ -1243,6 +1244,7 @@ export declare type SwitchProps = {
|
|
|
1243
1244
|
label?: string;
|
|
1244
1245
|
checked?: boolean;
|
|
1245
1246
|
className?: string;
|
|
1247
|
+
size?: Size;
|
|
1246
1248
|
value?: any;
|
|
1247
1249
|
onChange?: (value: boolean) => void;
|
|
1248
1250
|
onLabelClick?: (value: boolean) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1231,6 +1231,7 @@ export declare const Switch: React_2.ForwardRefExoticComponent<{
|
|
|
1231
1231
|
label?: string | undefined;
|
|
1232
1232
|
checked?: boolean | undefined;
|
|
1233
1233
|
className?: string | undefined;
|
|
1234
|
+
size?: Size | undefined;
|
|
1234
1235
|
value?: any;
|
|
1235
1236
|
onChange?: ((value: boolean) => void) | undefined;
|
|
1236
1237
|
onLabelClick?: ((value: boolean) => void) | undefined;
|
|
@@ -1243,6 +1244,7 @@ export declare type SwitchProps = {
|
|
|
1243
1244
|
label?: string;
|
|
1244
1245
|
checked?: boolean;
|
|
1245
1246
|
className?: string;
|
|
1247
|
+
size?: Size;
|
|
1246
1248
|
value?: any;
|
|
1247
1249
|
onChange?: (value: boolean) => void;
|
|
1248
1250
|
onLabelClick?: (value: boolean) => void;
|