@cfx-dev/ui-components 4.5.13 → 4.5.14
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/assets/all_css.css +1 -0
- package/dist/assets/css/Checkbox.css +1 -1
- package/dist/assets/css/CheckboxShowcase.css +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +5 -0
- package/dist/components/Checkbox/Checkbox.js +163 -153
- package/dist/components/Checkbox/CheckboxShowcase.d.ts +4 -0
- package/dist/components/Checkbox/CheckboxShowcase.js +33 -0
- package/package.json +1 -1
package/dist/assets/all_css.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cfxui__Checkbox__rootUnset__cbb57{all:unset}.cfxui__Checkbox__root__865aa{cursor:pointer;display:flex;align-items:center;justify-content:center;box-sizing:border-box;position:relative}.cfxui__Checkbox__root__865aa:focus-visible,.cfxui__Checkbox__root__865aa:focus-visible:hover{outline-offset:var(--checkbox-focus-border-size, initial);outline:var(--checkbox-focus-border-size, initial) solid var(--color-checkbox-focus-border-color)}.cfxui__Checkbox__root__865aa[data-disabled]{opacity:.5;cursor:not-allowed}.cfxui__Checkbox__root__865aa .cfxui__Checkbox__square__029aa{position:relative;top:0;left:0;width:100%;height:100%}.cfxui__Checkbox__root__865aa .cfxui__Checkbox__indicator__2afc0{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center
|
|
1
|
+
.cfxui__Checkbox__rootUnset__cbb57{all:unset}.cfxui__Checkbox__root__865aa{cursor:pointer;display:flex;align-items:center;justify-content:center;box-sizing:border-box;position:relative}.cfxui__Checkbox__root__865aa:focus-visible,.cfxui__Checkbox__root__865aa:focus-visible:hover{outline-offset:var(--checkbox-focus-border-size, initial);outline:var(--checkbox-focus-border-size, initial) solid var(--color-checkbox-focus-border-color)}.cfxui__Checkbox__root__865aa[data-disabled]{opacity:.5;cursor:not-allowed}.cfxui__Checkbox__root__865aa .cfxui__Checkbox__square__029aa{position:relative;top:0;left:0;width:100%;height:100%}.cfxui__Checkbox__root__865aa .cfxui__Checkbox__indicator__2afc0{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;width:50%;height:50%}.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-small__02440,.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-small__02440 .cfxui__Checkbox__indicator__2afc0{width:calc(var(--quant) * 2);height:calc(var(--quant) * 2)}.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-small__02440 .cfxui__Checkbox__indicator__2afc0 .cfxui__Checkbox__radioIcon__719e7{width:calc(var(--quant) * 2 / 3);height:calc(var(--quant) * 2 / 3)}.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-small__02440 .cfxui__Checkbox__indicator__2afc0 .cfxui__Checkbox__tickIcon__a7f19{width:calc(var(--quant) * 2 / 2);height:calc(var(--quant) * 2 / 2)}.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-normal__700f4,.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-normal__700f4 .cfxui__Checkbox__indicator__2afc0{width:var(--control-height-xsmall);height:var(--control-height-xsmall)}.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-normal__700f4 .cfxui__Checkbox__indicator__2afc0 .cfxui__Checkbox__radioIcon__719e7{width:calc(var(--control-height-xsmall) / 3);height:calc(var(--control-height-xsmall) / 3)}.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-normal__700f4 .cfxui__Checkbox__indicator__2afc0 .cfxui__Checkbox__tickIcon__a7f19{width:calc(var(--control-height-xsmall) / 2);height:calc(var(--control-height-xsmall) / 2)}.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-large__28529,.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-large__28529 .cfxui__Checkbox__indicator__2afc0{width:var(--control-height-small);height:var(--control-height-small)}.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-large__28529 .cfxui__Checkbox__indicator__2afc0 .cfxui__Checkbox__radioIcon__719e7{width:calc(var(--control-height-small) / 3);height:calc(var(--control-height-small) / 3)}.cfxui__Checkbox__root__865aa.cfxui__Checkbox__size-large__28529 .cfxui__Checkbox__indicator__2afc0 .cfxui__Checkbox__tickIcon__a7f19{width:calc(var(--control-height-small) / 2);height:calc(var(--control-height-small) / 2)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cfxui__CheckboxShowcase__root__5c0e0{overflow:hidden}.cfxui__CheckboxShowcase__root__5c0e0:not(.cfxui__CheckboxShowcase__checked__e49f9){color:rgba(var(--color-secondary),.2)}.cfxui__CheckboxShowcase__root__5c0e0:not(.cfxui__CheckboxShowcase__checked__e49f9):hover{color:rgba(var(--color-secondary),.6)}.cfxui__CheckboxShowcase__root__5c0e0.cfxui__CheckboxShowcase__checked__e49f9{color:rgba(var(--color-tertiary),1)}.cfxui__CheckboxShowcase__root__5c0e0.cfxui__CheckboxShowcase__checked__e49f9 .cfxui__CheckboxShowcase__icon__686ec{color:rgba(var(--color-bg),1);background-color:rgba(var(--color-tertiary),1);box-shadow:0 0 0 calc(var(--quant) * .175) rgba(var(--color-tertiary),1)}
|
|
@@ -2,11 +2,16 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { GetColorProps } from '../../utils/color';
|
|
3
3
|
import * as CheckboxUi from '@radix-ui/react-checkbox';
|
|
4
4
|
export type CheckboxSize = 'small' | 'normal' | 'large';
|
|
5
|
+
export type CheckboxCheckedType = CheckboxUi.CheckedState;
|
|
5
6
|
export interface CheckboxProps extends Omit<CheckboxUi.CheckboxProps, 'color'>, GetColorProps {
|
|
6
7
|
id?: string;
|
|
7
8
|
size?: CheckboxSize;
|
|
8
9
|
rootClassName?: string;
|
|
9
10
|
indicatorClassName?: string;
|
|
11
|
+
iconClassName?: string;
|
|
12
|
+
squareClassName?: string;
|
|
13
|
+
checkedClassName?: string;
|
|
14
|
+
iconSquare?: React.ComponentType;
|
|
10
15
|
iconIndicator?: React.ComponentType;
|
|
11
16
|
name?: string;
|
|
12
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as s, jsxs as w, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
3
|
import G from "react";
|
|
4
|
-
import { c as K, P as
|
|
4
|
+
import { c as K, P as g, d as X, u as B, e as q, f as J } from "../../index-DCuJlMqr.js";
|
|
5
5
|
import { u as Q } from "../../index-BZPx6jYI.js";
|
|
6
6
|
import { P as V } from "../../index-DWzyrn_L.js";
|
|
7
7
|
import "../Icons/cfx-icons/Close.js";
|
|
@@ -55,139 +55,139 @@ import "../Icons/cfx-icons-big/Subscriptions.js";
|
|
|
55
55
|
import "../Icons/cfx-icons-big/Upload.js";
|
|
56
56
|
import "../Icons/cfx-icons-big/Warning.js";
|
|
57
57
|
import "../Icons/cfx-icons-big/Confirm.js";
|
|
58
|
-
import { clsx as
|
|
58
|
+
import { clsx as N } from "../../utils/clsx.js";
|
|
59
59
|
import { getColor as Z } from "../../utils/color.js";
|
|
60
|
-
var
|
|
60
|
+
var R = "Checkbox", [ee, ho] = K(R), [oe, E] = ee(R);
|
|
61
61
|
function te(o) {
|
|
62
62
|
const {
|
|
63
|
-
__scopeCheckbox:
|
|
64
|
-
checked:
|
|
65
|
-
children:
|
|
66
|
-
defaultChecked:
|
|
63
|
+
__scopeCheckbox: a,
|
|
64
|
+
checked: n,
|
|
65
|
+
children: m,
|
|
66
|
+
defaultChecked: r,
|
|
67
67
|
disabled: e,
|
|
68
68
|
form: f,
|
|
69
69
|
name: _,
|
|
70
|
-
onCheckedChange:
|
|
70
|
+
onCheckedChange: d,
|
|
71
71
|
required: h,
|
|
72
|
-
value:
|
|
72
|
+
value: C = "on",
|
|
73
73
|
// @ts-expect-error
|
|
74
|
-
internal_do_not_use_render:
|
|
75
|
-
} = o, [
|
|
76
|
-
prop:
|
|
77
|
-
defaultProp:
|
|
78
|
-
onChange:
|
|
79
|
-
caller:
|
|
80
|
-
}), [
|
|
74
|
+
internal_do_not_use_render: p
|
|
75
|
+
} = o, [i, b] = X({
|
|
76
|
+
prop: n,
|
|
77
|
+
defaultProp: r ?? !1,
|
|
78
|
+
onChange: d,
|
|
79
|
+
caller: R
|
|
80
|
+
}), [u, k] = l.useState(null), [I, t] = l.useState(null), c = l.useRef(!1), y = u ? !!f || !!u.closest("form") : (
|
|
81
81
|
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
82
82
|
!0
|
|
83
83
|
), P = {
|
|
84
|
-
checked:
|
|
84
|
+
checked: i,
|
|
85
85
|
disabled: e,
|
|
86
|
-
setChecked:
|
|
87
|
-
control:
|
|
88
|
-
setControl:
|
|
86
|
+
setChecked: b,
|
|
87
|
+
control: u,
|
|
88
|
+
setControl: k,
|
|
89
89
|
name: _,
|
|
90
90
|
form: f,
|
|
91
|
-
value:
|
|
92
|
-
hasConsumerStoppedPropagationRef:
|
|
91
|
+
value: C,
|
|
92
|
+
hasConsumerStoppedPropagationRef: c,
|
|
93
93
|
required: h,
|
|
94
|
-
defaultChecked:
|
|
95
|
-
isFormControl:
|
|
94
|
+
defaultChecked: v(r) ? !1 : r,
|
|
95
|
+
isFormControl: y,
|
|
96
96
|
bubbleInput: I,
|
|
97
|
-
setBubbleInput:
|
|
97
|
+
setBubbleInput: t
|
|
98
98
|
};
|
|
99
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ s(
|
|
100
100
|
oe,
|
|
101
101
|
{
|
|
102
|
-
scope:
|
|
102
|
+
scope: a,
|
|
103
103
|
...P,
|
|
104
|
-
children: re(
|
|
104
|
+
children: re(p) ? p(P) : m
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
|
-
var T = "CheckboxTrigger", M =
|
|
109
|
-
({ __scopeCheckbox: o, onKeyDown:
|
|
108
|
+
var T = "CheckboxTrigger", M = l.forwardRef(
|
|
109
|
+
({ __scopeCheckbox: o, onKeyDown: a, onClick: n, ...m }, r) => {
|
|
110
110
|
const {
|
|
111
111
|
control: e,
|
|
112
112
|
value: f,
|
|
113
113
|
disabled: _,
|
|
114
|
-
checked:
|
|
114
|
+
checked: d,
|
|
115
115
|
required: h,
|
|
116
|
-
setControl:
|
|
117
|
-
setChecked:
|
|
118
|
-
hasConsumerStoppedPropagationRef:
|
|
119
|
-
isFormControl:
|
|
120
|
-
bubbleInput:
|
|
121
|
-
} =
|
|
122
|
-
return
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
return
|
|
116
|
+
setControl: C,
|
|
117
|
+
setChecked: p,
|
|
118
|
+
hasConsumerStoppedPropagationRef: i,
|
|
119
|
+
isFormControl: b,
|
|
120
|
+
bubbleInput: u
|
|
121
|
+
} = E(T, o), k = B(r, C), I = l.useRef(d);
|
|
122
|
+
return l.useEffect(() => {
|
|
123
|
+
const t = e == null ? void 0 : e.form;
|
|
124
|
+
if (t) {
|
|
125
|
+
const c = () => p(I.current);
|
|
126
|
+
return t.addEventListener("reset", c), () => t.removeEventListener("reset", c);
|
|
127
127
|
}
|
|
128
|
-
}, [e,
|
|
129
|
-
|
|
128
|
+
}, [e, p]), /* @__PURE__ */ s(
|
|
129
|
+
g.button,
|
|
130
130
|
{
|
|
131
131
|
type: "button",
|
|
132
132
|
role: "checkbox",
|
|
133
|
-
"aria-checked":
|
|
133
|
+
"aria-checked": v(d) ? "mixed" : d,
|
|
134
134
|
"aria-required": h,
|
|
135
|
-
"data-state": O(
|
|
135
|
+
"data-state": O(d),
|
|
136
136
|
"data-disabled": _ ? "" : void 0,
|
|
137
137
|
disabled: _,
|
|
138
138
|
value: f,
|
|
139
|
-
...
|
|
140
|
-
ref:
|
|
141
|
-
onKeyDown: q(
|
|
142
|
-
|
|
139
|
+
...m,
|
|
140
|
+
ref: k,
|
|
141
|
+
onKeyDown: q(a, (t) => {
|
|
142
|
+
t.key === "Enter" && t.preventDefault();
|
|
143
143
|
}),
|
|
144
|
-
onClick: q(
|
|
145
|
-
|
|
144
|
+
onClick: q(n, (t) => {
|
|
145
|
+
p((c) => v(c) ? !0 : !c), u && b && (i.current = t.isPropagationStopped(), i.current || t.stopPropagation());
|
|
146
146
|
})
|
|
147
147
|
}
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
150
|
);
|
|
151
151
|
M.displayName = T;
|
|
152
|
-
var U =
|
|
153
|
-
(o,
|
|
152
|
+
var U = l.forwardRef(
|
|
153
|
+
(o, a) => {
|
|
154
154
|
const {
|
|
155
|
-
__scopeCheckbox:
|
|
156
|
-
name:
|
|
157
|
-
checked:
|
|
155
|
+
__scopeCheckbox: n,
|
|
156
|
+
name: m,
|
|
157
|
+
checked: r,
|
|
158
158
|
defaultChecked: e,
|
|
159
159
|
required: f,
|
|
160
160
|
disabled: _,
|
|
161
|
-
value:
|
|
161
|
+
value: d,
|
|
162
162
|
onCheckedChange: h,
|
|
163
|
-
form:
|
|
164
|
-
...
|
|
163
|
+
form: C,
|
|
164
|
+
...p
|
|
165
165
|
} = o;
|
|
166
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ s(
|
|
167
167
|
te,
|
|
168
168
|
{
|
|
169
|
-
__scopeCheckbox:
|
|
170
|
-
checked:
|
|
169
|
+
__scopeCheckbox: n,
|
|
170
|
+
checked: r,
|
|
171
171
|
defaultChecked: e,
|
|
172
172
|
disabled: _,
|
|
173
173
|
required: f,
|
|
174
174
|
onCheckedChange: h,
|
|
175
|
-
name:
|
|
176
|
-
form:
|
|
177
|
-
value:
|
|
178
|
-
internal_do_not_use_render: ({ isFormControl:
|
|
179
|
-
/* @__PURE__ */
|
|
175
|
+
name: m,
|
|
176
|
+
form: C,
|
|
177
|
+
value: d,
|
|
178
|
+
internal_do_not_use_render: ({ isFormControl: i }) => /* @__PURE__ */ w($, { children: [
|
|
179
|
+
/* @__PURE__ */ s(
|
|
180
180
|
M,
|
|
181
181
|
{
|
|
182
|
-
...
|
|
183
|
-
ref:
|
|
184
|
-
__scopeCheckbox:
|
|
182
|
+
...p,
|
|
183
|
+
ref: a,
|
|
184
|
+
__scopeCheckbox: n
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
|
|
187
|
+
i && /* @__PURE__ */ s(
|
|
188
188
|
L,
|
|
189
189
|
{
|
|
190
|
-
__scopeCheckbox:
|
|
190
|
+
__scopeCheckbox: n
|
|
191
191
|
}
|
|
192
192
|
)
|
|
193
193
|
] })
|
|
@@ -195,21 +195,21 @@ var U = u.forwardRef(
|
|
|
195
195
|
);
|
|
196
196
|
}
|
|
197
197
|
);
|
|
198
|
-
U.displayName =
|
|
199
|
-
var A = "CheckboxIndicator", D =
|
|
200
|
-
(o,
|
|
201
|
-
const { __scopeCheckbox:
|
|
202
|
-
return /* @__PURE__ */
|
|
198
|
+
U.displayName = R;
|
|
199
|
+
var A = "CheckboxIndicator", D = l.forwardRef(
|
|
200
|
+
(o, a) => {
|
|
201
|
+
const { __scopeCheckbox: n, forceMount: m, ...r } = o, e = E(A, n);
|
|
202
|
+
return /* @__PURE__ */ s(
|
|
203
203
|
V,
|
|
204
204
|
{
|
|
205
|
-
present:
|
|
206
|
-
children: /* @__PURE__ */
|
|
207
|
-
|
|
205
|
+
present: m || v(e.checked) || e.checked === !0,
|
|
206
|
+
children: /* @__PURE__ */ s(
|
|
207
|
+
g.span,
|
|
208
208
|
{
|
|
209
209
|
"data-state": O(e.checked),
|
|
210
210
|
"data-disabled": e.disabled ? "" : void 0,
|
|
211
|
-
...
|
|
212
|
-
ref:
|
|
211
|
+
...r,
|
|
212
|
+
ref: a,
|
|
213
213
|
style: { pointerEvents: "none", ...o.style }
|
|
214
214
|
}
|
|
215
215
|
)
|
|
@@ -218,50 +218,50 @@ var A = "CheckboxIndicator", D = u.forwardRef(
|
|
|
218
218
|
}
|
|
219
219
|
);
|
|
220
220
|
D.displayName = A;
|
|
221
|
-
var F = "CheckboxBubbleInput", L =
|
|
222
|
-
({ __scopeCheckbox: o, ...
|
|
221
|
+
var F = "CheckboxBubbleInput", L = l.forwardRef(
|
|
222
|
+
({ __scopeCheckbox: o, ...a }, n) => {
|
|
223
223
|
const {
|
|
224
|
-
control:
|
|
225
|
-
hasConsumerStoppedPropagationRef:
|
|
224
|
+
control: m,
|
|
225
|
+
hasConsumerStoppedPropagationRef: r,
|
|
226
226
|
checked: e,
|
|
227
227
|
defaultChecked: f,
|
|
228
228
|
required: _,
|
|
229
|
-
disabled:
|
|
229
|
+
disabled: d,
|
|
230
230
|
name: h,
|
|
231
|
-
value:
|
|
232
|
-
form:
|
|
233
|
-
bubbleInput:
|
|
234
|
-
setBubbleInput:
|
|
235
|
-
} =
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
239
|
-
const
|
|
240
|
-
|
|
231
|
+
value: C,
|
|
232
|
+
form: p,
|
|
233
|
+
bubbleInput: i,
|
|
234
|
+
setBubbleInput: b
|
|
235
|
+
} = E(F, o), u = B(n, b), k = Q(e), I = J(m);
|
|
236
|
+
l.useEffect(() => {
|
|
237
|
+
const c = i;
|
|
238
|
+
if (!c) return;
|
|
239
|
+
const y = window.HTMLInputElement.prototype, S = Object.getOwnPropertyDescriptor(
|
|
240
|
+
y,
|
|
241
241
|
"checked"
|
|
242
|
-
).set, j = !
|
|
243
|
-
if (
|
|
242
|
+
).set, j = !r.current;
|
|
243
|
+
if (k !== e && S) {
|
|
244
244
|
const H = new Event("click", { bubbles: j });
|
|
245
|
-
|
|
245
|
+
c.indeterminate = v(e), S.call(c, v(e) ? !1 : e), c.dispatchEvent(H);
|
|
246
246
|
}
|
|
247
|
-
}, [
|
|
248
|
-
const
|
|
249
|
-
return /* @__PURE__ */
|
|
250
|
-
|
|
247
|
+
}, [i, k, e, r]);
|
|
248
|
+
const t = l.useRef(v(e) ? !1 : e);
|
|
249
|
+
return /* @__PURE__ */ s(
|
|
250
|
+
g.input,
|
|
251
251
|
{
|
|
252
252
|
type: "checkbox",
|
|
253
253
|
"aria-hidden": !0,
|
|
254
|
-
defaultChecked: f ??
|
|
254
|
+
defaultChecked: f ?? t.current,
|
|
255
255
|
required: _,
|
|
256
|
-
disabled:
|
|
256
|
+
disabled: d,
|
|
257
257
|
name: h,
|
|
258
|
-
value:
|
|
259
|
-
form:
|
|
260
|
-
...
|
|
258
|
+
value: C,
|
|
259
|
+
form: p,
|
|
260
|
+
...a,
|
|
261
261
|
tabIndex: -1,
|
|
262
|
-
ref:
|
|
262
|
+
ref: u,
|
|
263
263
|
style: {
|
|
264
|
-
...
|
|
264
|
+
...a.style,
|
|
265
265
|
...I,
|
|
266
266
|
position: "absolute",
|
|
267
267
|
pointerEvents: "none",
|
|
@@ -280,71 +280,81 @@ L.displayName = F;
|
|
|
280
280
|
function re(o) {
|
|
281
281
|
return typeof o == "function";
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function v(o) {
|
|
284
284
|
return o === "indeterminate";
|
|
285
285
|
}
|
|
286
286
|
function O(o) {
|
|
287
|
-
return
|
|
287
|
+
return v(o) ? "indeterminate" : o ? "checked" : "unchecked";
|
|
288
288
|
}
|
|
289
|
-
const ce = "cfxui__Checkbox__rootUnset__cbb57", ne = "cfxui__Checkbox__root__865aa", ie = "cfxui__Checkbox__square__029aa",
|
|
289
|
+
const ce = "cfxui__Checkbox__rootUnset__cbb57", ne = "cfxui__Checkbox__root__865aa", ie = "cfxui__Checkbox__square__029aa", ae = "cfxui__Checkbox__indicator__2afc0", se = "cfxui__Checkbox__radioIcon__719e7", me = "cfxui__Checkbox__tickIcon__a7f19", x = {
|
|
290
290
|
rootUnset: ce,
|
|
291
291
|
root: ne,
|
|
292
292
|
square: ie,
|
|
293
|
-
indicator:
|
|
294
|
-
checked: ae,
|
|
293
|
+
indicator: ae,
|
|
295
294
|
"size-small": "cfxui__Checkbox__size-small__02440",
|
|
296
|
-
radioIcon:
|
|
295
|
+
radioIcon: se,
|
|
297
296
|
tickIcon: me,
|
|
298
297
|
"size-normal": "cfxui__Checkbox__size-normal__700f4",
|
|
299
298
|
"size-large": "cfxui__Checkbox__size-large__28529"
|
|
300
299
|
};
|
|
301
|
-
function
|
|
300
|
+
function de(o) {
|
|
302
301
|
const {
|
|
303
|
-
id:
|
|
304
|
-
size:
|
|
305
|
-
rootClassName:
|
|
306
|
-
indicatorClassName:
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
302
|
+
id: a,
|
|
303
|
+
size: n = "normal",
|
|
304
|
+
rootClassName: m,
|
|
305
|
+
indicatorClassName: r,
|
|
306
|
+
iconClassName: e,
|
|
307
|
+
checkedClassName: f,
|
|
308
|
+
squareClassName: _,
|
|
309
|
+
colorToken: d,
|
|
310
|
+
color: h,
|
|
311
|
+
opacity: C,
|
|
312
|
+
luminance: p,
|
|
313
|
+
checked: i,
|
|
314
|
+
name: b,
|
|
315
|
+
iconIndicator: u = z,
|
|
316
|
+
iconSquare: k = W,
|
|
317
|
+
...I
|
|
318
|
+
} = o, t = Z(o), c = N(
|
|
319
|
+
x.root,
|
|
320
|
+
x.rootUnset,
|
|
321
|
+
x[`size-${n}`],
|
|
322
|
+
m,
|
|
323
|
+
{
|
|
324
|
+
[f || ""]: i
|
|
325
|
+
}
|
|
326
|
+
), y = N(
|
|
327
|
+
x.checked,
|
|
328
|
+
e,
|
|
329
|
+
{
|
|
330
|
+
[x.tickIcon]: u === Y,
|
|
331
|
+
[x.radioIcon]: u === z
|
|
332
|
+
}
|
|
324
333
|
);
|
|
325
334
|
return /* @__PURE__ */ w(
|
|
326
335
|
U,
|
|
327
336
|
{
|
|
328
|
-
...
|
|
329
|
-
id:
|
|
330
|
-
checked:
|
|
331
|
-
style: { color:
|
|
332
|
-
className:
|
|
337
|
+
...I,
|
|
338
|
+
id: a,
|
|
339
|
+
checked: i,
|
|
340
|
+
style: { color: t },
|
|
341
|
+
className: c,
|
|
333
342
|
children: [
|
|
334
|
-
|
|
343
|
+
b && /* @__PURE__ */ s(
|
|
335
344
|
"input",
|
|
336
345
|
{
|
|
337
346
|
type: "hidden",
|
|
338
|
-
name:
|
|
347
|
+
name: b,
|
|
348
|
+
value: i ? "on" : ""
|
|
339
349
|
}
|
|
340
350
|
),
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ s(k, { className: N(x.square, _) }),
|
|
352
|
+
/* @__PURE__ */ s(D, { className: N(x.indicator, r), children: /* @__PURE__ */ s(u, { className: y }) })
|
|
343
353
|
]
|
|
344
354
|
}
|
|
345
355
|
);
|
|
346
356
|
}
|
|
347
|
-
const
|
|
357
|
+
const Co = G.memo(de);
|
|
348
358
|
export {
|
|
349
|
-
|
|
359
|
+
Co as default
|
|
350
360
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
3
|
+
import i from "../Box/Box.js";
|
|
4
|
+
import "../../utils/ui/ui.js";
|
|
5
|
+
import h from "./Checkbox.js";
|
|
6
|
+
const n = "cfxui__CheckboxShowcase__root__5c0e0", _ = "cfxui__CheckboxShowcase__checked__e49f9", k = "cfxui__CheckboxShowcase__icon__686ec", e = {
|
|
7
|
+
root: n,
|
|
8
|
+
checked: _,
|
|
9
|
+
icon: k
|
|
10
|
+
};
|
|
11
|
+
function l(s) {
|
|
12
|
+
const [a, c] = r.useState(!1);
|
|
13
|
+
return /* @__PURE__ */ o(i, { p: 2, children: /* @__PURE__ */ o(
|
|
14
|
+
h,
|
|
15
|
+
{
|
|
16
|
+
...s,
|
|
17
|
+
id: "checkbox1",
|
|
18
|
+
name: "checkbox1",
|
|
19
|
+
checked: a,
|
|
20
|
+
onCheckedChange: c,
|
|
21
|
+
onClick: () => c((t) => !t),
|
|
22
|
+
size: "normal",
|
|
23
|
+
rootClassName: e.root,
|
|
24
|
+
indicatorClassName: e.indicator,
|
|
25
|
+
iconClassName: e.icon,
|
|
26
|
+
checkedClassName: e.checked,
|
|
27
|
+
squareClassName: e.square
|
|
28
|
+
}
|
|
29
|
+
) });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
l as default
|
|
33
|
+
};
|