@tatamicks/checkbox 0.0.1

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/index.mjs ADDED
@@ -0,0 +1,1147 @@
1
+ import { HorizontalAlign as Oe, VerticalAlign as De, toPx as O, DimensionInput as ie, ColorPicker as q, sizeDefinition as yr, universalProperties as Cr } from "@tatamicks/core";
2
+ import Fe, { forwardRef as Rr, useRef as Er, useImperativeHandle as _r, useMemo as oe, useCallback as D } from "react";
3
+ var K = { exports: {} }, Y = {};
4
+ /**
5
+ * @license React
6
+ * react-jsx-runtime.production.min.js
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var We;
14
+ function kr() {
15
+ if (We) return Y;
16
+ We = 1;
17
+ var s = Fe, R = Symbol.for("react.element"), f = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, C = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function _(k, h, m) {
19
+ var b, S = {}, T = null, v = null;
20
+ m !== void 0 && (T = "" + m), h.key !== void 0 && (T = "" + h.key), h.ref !== void 0 && (v = h.ref);
21
+ for (b in h) p.call(h, b) && !d.hasOwnProperty(b) && (S[b] = h[b]);
22
+ if (k && k.defaultProps) for (b in h = k.defaultProps, h) S[b] === void 0 && (S[b] = h[b]);
23
+ return { $$typeof: R, type: k, key: T, ref: v, props: S, _owner: C.current };
24
+ }
25
+ return Y.Fragment = f, Y.jsx = _, Y.jsxs = _, Y;
26
+ }
27
+ var V = {};
28
+ /**
29
+ * @license React
30
+ * react-jsx-runtime.development.js
31
+ *
32
+ * Copyright (c) Facebook, Inc. and its affiliates.
33
+ *
34
+ * This source code is licensed under the MIT license found in the
35
+ * LICENSE file in the root directory of this source tree.
36
+ */
37
+ var Ie;
38
+ function jr() {
39
+ return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && (function() {
40
+ var s = Fe, R = Symbol.for("react.element"), f = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), k = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), v = Symbol.for("react.offscreen"), A = Symbol.iterator, G = "@@iterator";
41
+ function U(e) {
42
+ if (e === null || typeof e != "object")
43
+ return null;
44
+ var r = A && e[A] || e[G];
45
+ return typeof r == "function" ? r : null;
46
+ }
47
+ var u = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function y(e) {
49
+ {
50
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
51
+ t[n - 1] = arguments[n];
52
+ ze("error", e, t);
53
+ }
54
+ }
55
+ function ze(e, r, t) {
56
+ {
57
+ var n = u.ReactDebugCurrentFrame, l = n.getStackAddendum();
58
+ l !== "" && (r += "%s", t = t.concat([l]));
59
+ var c = t.map(function(a) {
60
+ return String(a);
61
+ });
62
+ c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
63
+ }
64
+ }
65
+ var Ye = !1, Ve = !1, Ue = !1, Le = !1, Me = !1, ae;
66
+ ae = Symbol.for("react.module.reference");
67
+ function Ne(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === p || e === d || Me || e === C || e === m || e === b || Le || e === v || Ye || Ve || Ue || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === S || e.$$typeof === _ || e.$$typeof === k || e.$$typeof === h || // This needs to include all possible module reference object
69
+ // types supported by any Flight configuration anywhere since
70
+ // we don't know which Flight build this will end up being used
71
+ // with.
72
+ e.$$typeof === ae || e.getModuleId !== void 0));
73
+ }
74
+ function Je(e, r, t) {
75
+ var n = e.displayName;
76
+ if (n)
77
+ return n;
78
+ var l = r.displayName || r.name || "";
79
+ return l !== "" ? t + "(" + l + ")" : t;
80
+ }
81
+ function se(e) {
82
+ return e.displayName || "Context";
83
+ }
84
+ function P(e) {
85
+ if (e == null)
86
+ return null;
87
+ if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
+ return e.displayName || e.name || null;
89
+ if (typeof e == "string")
90
+ return e;
91
+ switch (e) {
92
+ case p:
93
+ return "Fragment";
94
+ case f:
95
+ return "Portal";
96
+ case d:
97
+ return "Profiler";
98
+ case C:
99
+ return "StrictMode";
100
+ case m:
101
+ return "Suspense";
102
+ case b:
103
+ return "SuspenseList";
104
+ }
105
+ if (typeof e == "object")
106
+ switch (e.$$typeof) {
107
+ case k:
108
+ var r = e;
109
+ return se(r) + ".Consumer";
110
+ case _:
111
+ var t = e;
112
+ return se(t._context) + ".Provider";
113
+ case h:
114
+ return Je(e, e.render, "ForwardRef");
115
+ case S:
116
+ var n = e.displayName || null;
117
+ return n !== null ? n : P(e.type) || "Memo";
118
+ case T: {
119
+ var l = e, c = l._payload, a = l._init;
120
+ try {
121
+ return P(a(c));
122
+ } catch {
123
+ return null;
124
+ }
125
+ }
126
+ }
127
+ return null;
128
+ }
129
+ var W = Object.assign, $ = 0, le, ue, ce, fe, de, ve, pe;
130
+ function he() {
131
+ }
132
+ he.__reactDisabledLog = !0;
133
+ function qe() {
134
+ {
135
+ if ($ === 0) {
136
+ le = console.log, ue = console.info, ce = console.warn, fe = console.error, de = console.group, ve = console.groupCollapsed, pe = console.groupEnd;
137
+ var e = {
138
+ configurable: !0,
139
+ enumerable: !0,
140
+ value: he,
141
+ writable: !0
142
+ };
143
+ Object.defineProperties(console, {
144
+ info: e,
145
+ log: e,
146
+ warn: e,
147
+ error: e,
148
+ group: e,
149
+ groupCollapsed: e,
150
+ groupEnd: e
151
+ });
152
+ }
153
+ $++;
154
+ }
155
+ }
156
+ function Ke() {
157
+ {
158
+ if ($--, $ === 0) {
159
+ var e = {
160
+ configurable: !0,
161
+ enumerable: !0,
162
+ writable: !0
163
+ };
164
+ Object.defineProperties(console, {
165
+ log: W({}, e, {
166
+ value: le
167
+ }),
168
+ info: W({}, e, {
169
+ value: ue
170
+ }),
171
+ warn: W({}, e, {
172
+ value: ce
173
+ }),
174
+ error: W({}, e, {
175
+ value: fe
176
+ }),
177
+ group: W({}, e, {
178
+ value: de
179
+ }),
180
+ groupCollapsed: W({}, e, {
181
+ value: ve
182
+ }),
183
+ groupEnd: W({}, e, {
184
+ value: pe
185
+ })
186
+ });
187
+ }
188
+ $ < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
+ }
190
+ }
191
+ var H = u.ReactCurrentDispatcher, X;
192
+ function L(e, r, t) {
193
+ {
194
+ if (X === void 0)
195
+ try {
196
+ throw Error();
197
+ } catch (l) {
198
+ var n = l.stack.trim().match(/\n( *(at )?)/);
199
+ X = n && n[1] || "";
200
+ }
201
+ return `
202
+ ` + X + e;
203
+ }
204
+ }
205
+ var Z = !1, M;
206
+ {
207
+ var Ge = typeof WeakMap == "function" ? WeakMap : Map;
208
+ M = new Ge();
209
+ }
210
+ function ge(e, r) {
211
+ if (!e || Z)
212
+ return "";
213
+ {
214
+ var t = M.get(e);
215
+ if (t !== void 0)
216
+ return t;
217
+ }
218
+ var n;
219
+ Z = !0;
220
+ var l = Error.prepareStackTrace;
221
+ Error.prepareStackTrace = void 0;
222
+ var c;
223
+ c = H.current, H.current = null, qe();
224
+ try {
225
+ if (r) {
226
+ var a = function() {
227
+ throw Error();
228
+ };
229
+ if (Object.defineProperty(a.prototype, "props", {
230
+ set: function() {
231
+ throw Error();
232
+ }
233
+ }), typeof Reflect == "object" && Reflect.construct) {
234
+ try {
235
+ Reflect.construct(a, []);
236
+ } catch (j) {
237
+ n = j;
238
+ }
239
+ Reflect.construct(e, [], a);
240
+ } else {
241
+ try {
242
+ a.call();
243
+ } catch (j) {
244
+ n = j;
245
+ }
246
+ e.call(a.prototype);
247
+ }
248
+ } else {
249
+ try {
250
+ throw Error();
251
+ } catch (j) {
252
+ n = j;
253
+ }
254
+ e();
255
+ }
256
+ } catch (j) {
257
+ if (j && n && typeof j.stack == "string") {
258
+ for (var o = j.stack.split(`
259
+ `), E = n.stack.split(`
260
+ `), g = o.length - 1, x = E.length - 1; g >= 1 && x >= 0 && o[g] !== E[x]; )
261
+ x--;
262
+ for (; g >= 1 && x >= 0; g--, x--)
263
+ if (o[g] !== E[x]) {
264
+ if (g !== 1 || x !== 1)
265
+ do
266
+ if (g--, x--, x < 0 || o[g] !== E[x]) {
267
+ var w = `
268
+ ` + o[g].replace(" at new ", " at ");
269
+ return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, w), w;
270
+ }
271
+ while (g >= 1 && x >= 0);
272
+ break;
273
+ }
274
+ }
275
+ } finally {
276
+ Z = !1, H.current = c, Ke(), Error.prepareStackTrace = l;
277
+ }
278
+ var B = e ? e.displayName || e.name : "", I = B ? L(B) : "";
279
+ return typeof e == "function" && M.set(e, I), I;
280
+ }
281
+ function He(e, r, t) {
282
+ return ge(e, !1);
283
+ }
284
+ function Xe(e) {
285
+ var r = e.prototype;
286
+ return !!(r && r.isReactComponent);
287
+ }
288
+ function N(e, r, t) {
289
+ if (e == null)
290
+ return "";
291
+ if (typeof e == "function")
292
+ return ge(e, Xe(e));
293
+ if (typeof e == "string")
294
+ return L(e);
295
+ switch (e) {
296
+ case m:
297
+ return L("Suspense");
298
+ case b:
299
+ return L("SuspenseList");
300
+ }
301
+ if (typeof e == "object")
302
+ switch (e.$$typeof) {
303
+ case h:
304
+ return He(e.render);
305
+ case S:
306
+ return N(e.type, r, t);
307
+ case T: {
308
+ var n = e, l = n._payload, c = n._init;
309
+ try {
310
+ return N(c(l), r, t);
311
+ } catch {
312
+ }
313
+ }
314
+ }
315
+ return "";
316
+ }
317
+ var z = Object.prototype.hasOwnProperty, xe = {}, me = u.ReactDebugCurrentFrame;
318
+ function J(e) {
319
+ if (e) {
320
+ var r = e._owner, t = N(e.type, e._source, r ? r.type : null);
321
+ me.setExtraStackFrame(t);
322
+ } else
323
+ me.setExtraStackFrame(null);
324
+ }
325
+ function Ze(e, r, t, n, l) {
326
+ {
327
+ var c = Function.call.bind(z);
328
+ for (var a in e)
329
+ if (c(e, a)) {
330
+ var o = void 0;
331
+ try {
332
+ if (typeof e[a] != "function") {
333
+ var E = Error((n || "React class") + ": " + t + " type `" + a + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[a] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ throw E.name = "Invariant Violation", E;
335
+ }
336
+ o = e[a](r, a, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch (g) {
338
+ o = g;
339
+ }
340
+ o && !(o instanceof Error) && (J(l), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, a, typeof o), J(null)), o instanceof Error && !(o.message in xe) && (xe[o.message] = !0, J(l), y("Failed %s type: %s", t, o.message), J(null));
341
+ }
342
+ }
343
+ }
344
+ var Qe = Array.isArray;
345
+ function Q(e) {
346
+ return Qe(e);
347
+ }
348
+ function er(e) {
349
+ {
350
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
+ return t;
352
+ }
353
+ }
354
+ function rr(e) {
355
+ try {
356
+ return be(e), !1;
357
+ } catch {
358
+ return !0;
359
+ }
360
+ }
361
+ function be(e) {
362
+ return "" + e;
363
+ }
364
+ function ye(e) {
365
+ if (rr(e))
366
+ return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), be(e);
367
+ }
368
+ var Ce = u.ReactCurrentOwner, tr = {
369
+ key: !0,
370
+ ref: !0,
371
+ __self: !0,
372
+ __source: !0
373
+ }, Re, Ee;
374
+ function nr(e) {
375
+ if (z.call(e, "ref")) {
376
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
377
+ if (r && r.isReactWarning)
378
+ return !1;
379
+ }
380
+ return e.ref !== void 0;
381
+ }
382
+ function ir(e) {
383
+ if (z.call(e, "key")) {
384
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
385
+ if (r && r.isReactWarning)
386
+ return !1;
387
+ }
388
+ return e.key !== void 0;
389
+ }
390
+ function or(e, r) {
391
+ typeof e.ref == "string" && Ce.current;
392
+ }
393
+ function ar(e, r) {
394
+ {
395
+ var t = function() {
396
+ Re || (Re = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
397
+ };
398
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
399
+ get: t,
400
+ configurable: !0
401
+ });
402
+ }
403
+ }
404
+ function sr(e, r) {
405
+ {
406
+ var t = function() {
407
+ Ee || (Ee = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
408
+ };
409
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
+ get: t,
411
+ configurable: !0
412
+ });
413
+ }
414
+ }
415
+ var lr = function(e, r, t, n, l, c, a) {
416
+ var o = {
417
+ // This tag allows us to uniquely identify this as a React Element
418
+ $$typeof: R,
419
+ // Built-in properties that belong on the element
420
+ type: e,
421
+ key: r,
422
+ ref: t,
423
+ props: a,
424
+ // Record the component responsible for creating this element.
425
+ _owner: c
426
+ };
427
+ return o._store = {}, Object.defineProperty(o._store, "validated", {
428
+ configurable: !1,
429
+ enumerable: !1,
430
+ writable: !0,
431
+ value: !1
432
+ }), Object.defineProperty(o, "_self", {
433
+ configurable: !1,
434
+ enumerable: !1,
435
+ writable: !1,
436
+ value: n
437
+ }), Object.defineProperty(o, "_source", {
438
+ configurable: !1,
439
+ enumerable: !1,
440
+ writable: !1,
441
+ value: l
442
+ }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
443
+ };
444
+ function ur(e, r, t, n, l) {
445
+ {
446
+ var c, a = {}, o = null, E = null;
447
+ t !== void 0 && (ye(t), o = "" + t), ir(r) && (ye(r.key), o = "" + r.key), nr(r) && (E = r.ref, or(r, l));
448
+ for (c in r)
449
+ z.call(r, c) && !tr.hasOwnProperty(c) && (a[c] = r[c]);
450
+ if (e && e.defaultProps) {
451
+ var g = e.defaultProps;
452
+ for (c in g)
453
+ a[c] === void 0 && (a[c] = g[c]);
454
+ }
455
+ if (o || E) {
456
+ var x = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
+ o && ar(a, x), E && sr(a, x);
458
+ }
459
+ return lr(e, o, E, l, n, Ce.current, a);
460
+ }
461
+ }
462
+ var ee = u.ReactCurrentOwner, _e = u.ReactDebugCurrentFrame;
463
+ function F(e) {
464
+ if (e) {
465
+ var r = e._owner, t = N(e.type, e._source, r ? r.type : null);
466
+ _e.setExtraStackFrame(t);
467
+ } else
468
+ _e.setExtraStackFrame(null);
469
+ }
470
+ var re;
471
+ re = !1;
472
+ function te(e) {
473
+ return typeof e == "object" && e !== null && e.$$typeof === R;
474
+ }
475
+ function ke() {
476
+ {
477
+ if (ee.current) {
478
+ var e = P(ee.current.type);
479
+ if (e)
480
+ return `
481
+
482
+ Check the render method of \`` + e + "`.";
483
+ }
484
+ return "";
485
+ }
486
+ }
487
+ function cr(e) {
488
+ return "";
489
+ }
490
+ var je = {};
491
+ function fr(e) {
492
+ {
493
+ var r = ke();
494
+ if (!r) {
495
+ var t = typeof e == "string" ? e : e.displayName || e.name;
496
+ t && (r = `
497
+
498
+ Check the top-level render call using <` + t + ">.");
499
+ }
500
+ return r;
501
+ }
502
+ }
503
+ function Se(e, r) {
504
+ {
505
+ if (!e._store || e._store.validated || e.key != null)
506
+ return;
507
+ e._store.validated = !0;
508
+ var t = fr(r);
509
+ if (je[t])
510
+ return;
511
+ je[t] = !0;
512
+ var n = "";
513
+ e && e._owner && e._owner !== ee.current && (n = " It was passed a child from " + P(e._owner.type) + "."), F(e), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null);
514
+ }
515
+ }
516
+ function we(e, r) {
517
+ {
518
+ if (typeof e != "object")
519
+ return;
520
+ if (Q(e))
521
+ for (var t = 0; t < e.length; t++) {
522
+ var n = e[t];
523
+ te(n) && Se(n, r);
524
+ }
525
+ else if (te(e))
526
+ e._store && (e._store.validated = !0);
527
+ else if (e) {
528
+ var l = U(e);
529
+ if (typeof l == "function" && l !== e.entries)
530
+ for (var c = l.call(e), a; !(a = c.next()).done; )
531
+ te(a.value) && Se(a.value, r);
532
+ }
533
+ }
534
+ }
535
+ function dr(e) {
536
+ {
537
+ var r = e.type;
538
+ if (r == null || typeof r == "string")
539
+ return;
540
+ var t;
541
+ if (typeof r == "function")
542
+ t = r.propTypes;
543
+ else if (typeof r == "object" && (r.$$typeof === h || // Note: Memo only checks outer props here.
544
+ // Inner props are checked in the reconciler.
545
+ r.$$typeof === S))
546
+ t = r.propTypes;
547
+ else
548
+ return;
549
+ if (t) {
550
+ var n = P(r);
551
+ Ze(t, e.props, "prop", n, e);
552
+ } else if (r.PropTypes !== void 0 && !re) {
553
+ re = !0;
554
+ var l = P(r);
555
+ y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
556
+ }
557
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
+ }
559
+ }
560
+ function vr(e) {
561
+ {
562
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
563
+ var n = r[t];
564
+ if (n !== "children" && n !== "key") {
565
+ F(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
566
+ break;
567
+ }
568
+ }
569
+ e.ref !== null && (F(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
570
+ }
571
+ }
572
+ var Te = {};
573
+ function Pe(e, r, t, n, l, c) {
574
+ {
575
+ var a = Ne(e);
576
+ if (!a) {
577
+ var o = "";
578
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
+ var E = cr();
580
+ E ? o += E : o += ke();
581
+ var g;
582
+ e === null ? g = "null" : Q(e) ? g = "array" : e !== void 0 && e.$$typeof === R ? (g = "<" + (P(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : g = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", g, o);
583
+ }
584
+ var x = ur(e, r, t, l, c);
585
+ if (x == null)
586
+ return x;
587
+ if (a) {
588
+ var w = r.children;
589
+ if (w !== void 0)
590
+ if (n)
591
+ if (Q(w)) {
592
+ for (var B = 0; B < w.length; B++)
593
+ we(w[B], e);
594
+ Object.freeze && Object.freeze(w);
595
+ } else
596
+ y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
+ else
598
+ we(w, e);
599
+ }
600
+ if (z.call(r, "key")) {
601
+ var I = P(e), j = Object.keys(r).filter(function(br) {
602
+ return br !== "key";
603
+ }), ne = j.length > 0 ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}";
604
+ if (!Te[I + ne]) {
605
+ var mr = j.length > 0 ? "{" + j.join(": ..., ") + ": ...}" : "{}";
606
+ y(`A props object containing a "key" prop is being spread into JSX:
607
+ let props = %s;
608
+ <%s {...props} />
609
+ React keys must be passed directly to JSX without using spread:
610
+ let props = %s;
611
+ <%s key={someKey} {...props} />`, ne, I, mr, I), Te[I + ne] = !0;
612
+ }
613
+ }
614
+ return e === p ? vr(x) : dr(x), x;
615
+ }
616
+ }
617
+ function pr(e, r, t) {
618
+ return Pe(e, r, t, !0);
619
+ }
620
+ function hr(e, r, t) {
621
+ return Pe(e, r, t, !1);
622
+ }
623
+ var gr = hr, xr = pr;
624
+ V.Fragment = p, V.jsx = gr, V.jsxs = xr;
625
+ })()), V;
626
+ }
627
+ var Ae;
628
+ function Sr() {
629
+ return Ae || (Ae = 1, process.env.NODE_ENV === "production" ? K.exports = kr() : K.exports = jr()), K.exports;
630
+ }
631
+ var i = Sr();
632
+ function wr({
633
+ size: s = 16,
634
+ checked: R = !1,
635
+ borderWidth: f = 1,
636
+ borderColor: p = "#d1d5db",
637
+ checkWidth: C = 3.5,
638
+ checkColor: d = "#2563eb",
639
+ backgroundColor: _ = "#ffffff",
640
+ checkedBackgroundColor: k
641
+ }) {
642
+ const h = R && k ? k : _;
643
+ return /* @__PURE__ */ i.jsxs(
644
+ "svg",
645
+ {
646
+ width: s,
647
+ height: s,
648
+ viewBox: "0 0 20 20",
649
+ "aria-hidden": "true",
650
+ focusable: "false",
651
+ children: [
652
+ /* @__PURE__ */ i.jsx(
653
+ "rect",
654
+ {
655
+ x: f / 2,
656
+ y: f / 2,
657
+ width: 20 - f,
658
+ height: 20 - f,
659
+ fill: h,
660
+ stroke: p,
661
+ strokeWidth: f
662
+ }
663
+ ),
664
+ R ? /* @__PURE__ */ i.jsx(
665
+ "path",
666
+ {
667
+ d: "M3 11l4 4L17 4",
668
+ fill: "none",
669
+ stroke: d,
670
+ strokeWidth: C
671
+ }
672
+ ) : null
673
+ ]
674
+ }
675
+ );
676
+ }
677
+ const Be = Rr(({ props: s, value: R, onChange: f, readOnly: p }, C) => {
678
+ const d = Er(null);
679
+ _r(
680
+ C,
681
+ () => ({
682
+ focus: () => {
683
+ var u;
684
+ (u = d.current) == null || u.focus(), !p && f && f(!(R ?? !1));
685
+ }
686
+ }),
687
+ [p, f, R]
688
+ );
689
+ const _ = R ?? !1, k = (u) => {
690
+ p || f(u.target.checked);
691
+ }, h = oe(() => {
692
+ const u = {
693
+ width: "100%",
694
+ height: "100%",
695
+ display: "flex",
696
+ boxSizing: "border-box",
697
+ overflow: "hidden"
698
+ };
699
+ switch (s.justifyContent) {
700
+ case Oe.left:
701
+ u.justifyContent = "flex-start";
702
+ break;
703
+ case Oe.right:
704
+ u.justifyContent = "flex-end";
705
+ break;
706
+ default:
707
+ u.justifyContent = "center";
708
+ break;
709
+ }
710
+ switch (s.alignItems) {
711
+ case De.top:
712
+ u.alignItems = "flex-start";
713
+ break;
714
+ case De.bottom:
715
+ u.alignItems = "flex-end";
716
+ break;
717
+ default:
718
+ u.alignItems = "center";
719
+ break;
720
+ }
721
+ if (s.isIndividual)
722
+ s.top && (u.paddingTop = O.fromDim(s.top)), s.right && (u.paddingRight = O.fromDim(s.right)), s.bottom && (u.paddingBottom = O.fromDim(s.bottom)), s.left && (u.paddingLeft = O.fromDim(s.left));
723
+ else if (s.all) {
724
+ const y = O.fromDim(s.all);
725
+ u.padding = `${y}px`;
726
+ }
727
+ return u;
728
+ }, [s]), m = s.styleConfig ?? {}, b = m.checkboxSize ? O.fromDim(m.checkboxSize) : 16, S = m.borderWidth ? O.fromDim(m.borderWidth) : 1, T = m.checkWidth ? O.fromDim(m.checkWidth) : 3.5, v = {
729
+ position: "absolute",
730
+ inset: 0,
731
+ margin: 0,
732
+ width: "100%",
733
+ height: "100%",
734
+ opacity: 0,
735
+ pointerEvents: "none"
736
+ // クリックイベントを受け取らない
737
+ }, A = {
738
+ pointerEvents: "none",
739
+ position: "absolute",
740
+ inset: 0,
741
+ display: "flex",
742
+ alignItems: "center",
743
+ justifyContent: "center"
744
+ }, G = {
745
+ width: b,
746
+ height: b,
747
+ position: "relative"
748
+ }, U = () => {
749
+ !p && f && f(!_);
750
+ };
751
+ return /* @__PURE__ */ i.jsxs(
752
+ "div",
753
+ {
754
+ style: {
755
+ ...h,
756
+ cursor: p ? "not-allowed" : "pointer"
757
+ },
758
+ role: "switch",
759
+ "aria-checked": _,
760
+ "aria-disabled": p,
761
+ "aria-label": "Checkbox",
762
+ tabIndex: p ? -1 : 0,
763
+ onClick: U,
764
+ onKeyDown: (u) => {
765
+ !p && (u.key === " " || u.key === "Enter") && (u.preventDefault(), U());
766
+ },
767
+ children: [
768
+ /* @__PURE__ */ i.jsx(
769
+ "input",
770
+ {
771
+ ref: d,
772
+ type: "checkbox",
773
+ checked: _,
774
+ onChange: k,
775
+ disabled: p,
776
+ style: v,
777
+ tabIndex: -1,
778
+ "aria-hidden": "true"
779
+ }
780
+ ),
781
+ /* @__PURE__ */ i.jsx("div", { style: G, children: /* @__PURE__ */ i.jsx("div", { style: A, "aria-hidden": "true", children: /* @__PURE__ */ i.jsx(
782
+ wr,
783
+ {
784
+ size: b,
785
+ checked: _,
786
+ borderWidth: S,
787
+ borderColor: m.borderColor ?? "#000000",
788
+ checkWidth: T,
789
+ checkColor: m.checkColor ?? "#000000",
790
+ backgroundColor: m.backgroundColor ?? "#ffffff",
791
+ checkedBackgroundColor: m.checkedBackgroundColor
792
+ }
793
+ ) }) })
794
+ ]
795
+ }
796
+ );
797
+ });
798
+ Be.displayName = "CheckboxRenderer";
799
+ const $e = ({
800
+ value: s,
801
+ onChange: R,
802
+ readOnly: f = !1
803
+ }) => {
804
+ const p = oe(
805
+ () => ({
806
+ checkboxSize: { value: 16, unit: "px" },
807
+ borderWidth: { value: 1, unit: "px" },
808
+ borderColor: "#d1d5db",
809
+ checkWidth: { value: 3.5, unit: "px" },
810
+ checkColor: "#2563eb",
811
+ backgroundColor: "#ffffff"
812
+ }),
813
+ []
814
+ ), C = oe(
815
+ () => ({
816
+ ...p,
817
+ ...s
818
+ }),
819
+ [s, p]
820
+ ), d = D(
821
+ (v, A) => {
822
+ R({
823
+ ...s,
824
+ [v]: A
825
+ });
826
+ },
827
+ [s, R]
828
+ ), _ = D(
829
+ (v) => d("checkboxSize", v),
830
+ [d]
831
+ ), k = D(
832
+ (v) => d("borderWidth", v),
833
+ [d]
834
+ ), h = D(
835
+ (v) => d("borderColor", v),
836
+ [d]
837
+ ), m = D(
838
+ (v) => d("checkWidth", v),
839
+ [d]
840
+ ), b = D(
841
+ (v) => d("checkColor", v),
842
+ [d]
843
+ ), S = D(
844
+ (v) => d("backgroundColor", v),
845
+ [d]
846
+ ), T = D(
847
+ (v) => d("checkedBackgroundColor", v),
848
+ [d]
849
+ );
850
+ return /* @__PURE__ */ i.jsxs(
851
+ "div",
852
+ {
853
+ style: {
854
+ display: "flex",
855
+ flexDirection: "column",
856
+ gap: "12px",
857
+ padding: "12px"
858
+ },
859
+ children: [
860
+ /* @__PURE__ */ i.jsxs(
861
+ "div",
862
+ {
863
+ style: {
864
+ padding: "16px",
865
+ backgroundColor: "#f5f5f5",
866
+ borderRadius: "4px",
867
+ display: "flex",
868
+ justifyContent: "center",
869
+ alignItems: "center",
870
+ gap: "16px"
871
+ },
872
+ children: [
873
+ /* @__PURE__ */ i.jsxs("div", { style: { textAlign: "center" }, children: [
874
+ /* @__PURE__ */ i.jsx("div", { style: { fontSize: "12px", color: "#666", marginBottom: "8px" }, children: "未チェック" }),
875
+ /* @__PURE__ */ i.jsx(
876
+ "div",
877
+ {
878
+ style: {
879
+ width: "40px",
880
+ height: "40px",
881
+ backgroundColor: "#ddd",
882
+ borderRadius: "4px"
883
+ }
884
+ }
885
+ )
886
+ ] }),
887
+ /* @__PURE__ */ i.jsxs("div", { style: { textAlign: "center" }, children: [
888
+ /* @__PURE__ */ i.jsx("div", { style: { fontSize: "12px", color: "#666", marginBottom: "8px" }, children: "チェック" }),
889
+ /* @__PURE__ */ i.jsx(
890
+ "div",
891
+ {
892
+ style: {
893
+ width: "40px",
894
+ height: "40px",
895
+ backgroundColor: "#ddd",
896
+ borderRadius: "4px"
897
+ }
898
+ }
899
+ )
900
+ ] })
901
+ ]
902
+ }
903
+ ),
904
+ /* @__PURE__ */ i.jsxs("div", { children: [
905
+ /* @__PURE__ */ i.jsx(
906
+ "div",
907
+ {
908
+ style: {
909
+ fontSize: "12px",
910
+ fontWeight: "500",
911
+ marginBottom: "4px"
912
+ },
913
+ children: "チェックボックスのサイズ"
914
+ }
915
+ ),
916
+ /* @__PURE__ */ i.jsx(
917
+ ie,
918
+ {
919
+ value: C.checkboxSize,
920
+ onChange: _,
921
+ readOnly: f,
922
+ allowedUnits: ["px"],
923
+ config: {
924
+ min: 8,
925
+ max: 64,
926
+ step: 1,
927
+ placeholder: "16px"
928
+ }
929
+ }
930
+ )
931
+ ] }),
932
+ /* @__PURE__ */ i.jsxs(
933
+ "div",
934
+ {
935
+ style: {
936
+ display: "grid",
937
+ gridTemplateColumns: "1fr 1fr",
938
+ gap: "8px"
939
+ },
940
+ children: [
941
+ /* @__PURE__ */ i.jsxs("div", { children: [
942
+ /* @__PURE__ */ i.jsx(
943
+ "div",
944
+ {
945
+ style: {
946
+ fontSize: "12px",
947
+ fontWeight: "500",
948
+ marginBottom: "4px"
949
+ },
950
+ children: "枠線の太さ"
951
+ }
952
+ ),
953
+ /* @__PURE__ */ i.jsx(
954
+ ie,
955
+ {
956
+ value: C.borderWidth,
957
+ onChange: k,
958
+ readOnly: f,
959
+ allowedUnits: ["px", "%"],
960
+ config: {
961
+ min: 0,
962
+ step: 0.5,
963
+ placeholder: "1px"
964
+ }
965
+ }
966
+ )
967
+ ] }),
968
+ /* @__PURE__ */ i.jsxs("div", { children: [
969
+ /* @__PURE__ */ i.jsx(
970
+ "div",
971
+ {
972
+ style: {
973
+ fontSize: "12px",
974
+ fontWeight: "500",
975
+ marginBottom: "4px"
976
+ },
977
+ children: "枠線の色"
978
+ }
979
+ ),
980
+ /* @__PURE__ */ i.jsx(
981
+ q,
982
+ {
983
+ value: C.borderColor,
984
+ onChange: h,
985
+ readOnly: f,
986
+ showTextInput: !0,
987
+ placeholder: "#d1d5db"
988
+ }
989
+ )
990
+ ] })
991
+ ]
992
+ }
993
+ ),
994
+ /* @__PURE__ */ i.jsxs(
995
+ "div",
996
+ {
997
+ style: {
998
+ display: "grid",
999
+ gridTemplateColumns: "1fr 1fr",
1000
+ gap: "8px"
1001
+ },
1002
+ children: [
1003
+ /* @__PURE__ */ i.jsxs("div", { children: [
1004
+ /* @__PURE__ */ i.jsx(
1005
+ "div",
1006
+ {
1007
+ style: {
1008
+ fontSize: "12px",
1009
+ fontWeight: "500",
1010
+ marginBottom: "4px"
1011
+ },
1012
+ children: "チェックマークの太さ"
1013
+ }
1014
+ ),
1015
+ /* @__PURE__ */ i.jsx(
1016
+ ie,
1017
+ {
1018
+ value: C.checkWidth,
1019
+ onChange: m,
1020
+ readOnly: f,
1021
+ allowedUnits: ["px", "%"],
1022
+ config: {
1023
+ min: 0,
1024
+ step: 0.5,
1025
+ placeholder: "3.5px"
1026
+ }
1027
+ }
1028
+ )
1029
+ ] }),
1030
+ /* @__PURE__ */ i.jsxs("div", { children: [
1031
+ /* @__PURE__ */ i.jsx(
1032
+ "div",
1033
+ {
1034
+ style: {
1035
+ fontSize: "12px",
1036
+ fontWeight: "500",
1037
+ marginBottom: "4px"
1038
+ },
1039
+ children: "チェックマークの色"
1040
+ }
1041
+ ),
1042
+ /* @__PURE__ */ i.jsx(
1043
+ q,
1044
+ {
1045
+ value: C.checkColor,
1046
+ onChange: b,
1047
+ readOnly: f,
1048
+ showTextInput: !0,
1049
+ placeholder: "#2563eb"
1050
+ }
1051
+ )
1052
+ ] })
1053
+ ]
1054
+ }
1055
+ ),
1056
+ /* @__PURE__ */ i.jsxs(
1057
+ "div",
1058
+ {
1059
+ style: {
1060
+ display: "grid",
1061
+ gridTemplateColumns: "1fr 1fr",
1062
+ gap: "8px"
1063
+ },
1064
+ children: [
1065
+ /* @__PURE__ */ i.jsxs("div", { children: [
1066
+ /* @__PURE__ */ i.jsx(
1067
+ "div",
1068
+ {
1069
+ style: {
1070
+ fontSize: "12px",
1071
+ fontWeight: "500",
1072
+ marginBottom: "4px"
1073
+ },
1074
+ children: "背景色(未チェック)"
1075
+ }
1076
+ ),
1077
+ /* @__PURE__ */ i.jsx(
1078
+ q,
1079
+ {
1080
+ value: C.backgroundColor,
1081
+ onChange: S,
1082
+ readOnly: f,
1083
+ showTextInput: !0,
1084
+ placeholder: "#ffffff"
1085
+ }
1086
+ )
1087
+ ] }),
1088
+ /* @__PURE__ */ i.jsxs("div", { children: [
1089
+ /* @__PURE__ */ i.jsx(
1090
+ "div",
1091
+ {
1092
+ style: {
1093
+ fontSize: "12px",
1094
+ fontWeight: "500",
1095
+ marginBottom: "4px"
1096
+ },
1097
+ children: "背景色(チェック時)"
1098
+ }
1099
+ ),
1100
+ /* @__PURE__ */ i.jsx(
1101
+ q,
1102
+ {
1103
+ value: C.checkedBackgroundColor,
1104
+ onChange: T,
1105
+ readOnly: f,
1106
+ showTextInput: !0,
1107
+ allowUndefined: !0,
1108
+ placeholder: "#ffffff"
1109
+ }
1110
+ )
1111
+ ] })
1112
+ ]
1113
+ }
1114
+ )
1115
+ ]
1116
+ }
1117
+ );
1118
+ };
1119
+ $e.displayName = "CheckboxStyleEditor";
1120
+ const Or = {
1121
+ kind: "checkbox",
1122
+ meta: {
1123
+ displayName: "チェックボックス",
1124
+ description: "チェック/非チェックを選択する入力ブロック",
1125
+ defaultSize: { w: 2, h: 2 }
1126
+ },
1127
+ Renderer: Be,
1128
+ properties: {
1129
+ ...Cr,
1130
+ // alignment + padding
1131
+ ...yr,
1132
+ styleConfig: {
1133
+ Component: $e,
1134
+ label: "チェックボックススタイル",
1135
+ group: "スタイル",
1136
+ defaultValue: void 0
1137
+ }
1138
+ },
1139
+ validateProps: (s) => s,
1140
+ validateValue: (s) => typeof s == "boolean" ? s : !1
1141
+ };
1142
+ export {
1143
+ Or as CheckboxPlugin,
1144
+ Be as CheckboxRenderer,
1145
+ $e as CheckboxStyleEditor
1146
+ };
1147
+ //# sourceMappingURL=index.mjs.map