@edux-design/forms 0.0.7 → 0.0.8
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.js +18 -5
- package/dist/index.mjs +19 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -383,6 +383,7 @@ var Checkbox = (0, import_react7.forwardRef)(
|
|
|
383
383
|
({
|
|
384
384
|
className,
|
|
385
385
|
indeterminate = false,
|
|
386
|
+
plus = false,
|
|
386
387
|
variant = "primary",
|
|
387
388
|
disabled,
|
|
388
389
|
id: providedId,
|
|
@@ -407,7 +408,7 @@ var Checkbox = (0, import_react7.forwardRef)(
|
|
|
407
408
|
...ariaDescribedByProp ? ariaDescribedByProp.split(" ") : []
|
|
408
409
|
].filter(Boolean);
|
|
409
410
|
const describedBy = describedByTokens.length ? describedByTokens.join(" ") : void 0;
|
|
410
|
-
const ariaChecked = indeterminate ? "mixed" : ariaCheckedProp;
|
|
411
|
+
const ariaChecked = indeterminate || plus ? "mixed" : ariaCheckedProp;
|
|
411
412
|
const inputRef = (0, import_react7.useRef)(null);
|
|
412
413
|
const setRefs = (0, import_react7.useCallback)(
|
|
413
414
|
(node) => {
|
|
@@ -468,8 +469,8 @@ var Checkbox = (0, import_react7.forwardRef)(
|
|
|
468
469
|
!isDisabled && intent.activeBg,
|
|
469
470
|
intent.peerSelectedBorder,
|
|
470
471
|
intent.peerSelectedBg,
|
|
471
|
-
indeterminate && intent.selectedBorder,
|
|
472
|
-
indeterminate && intent.selectedBg
|
|
472
|
+
(indeterminate || plus) && intent.selectedBorder,
|
|
473
|
+
(indeterminate || plus) && intent.selectedBg
|
|
473
474
|
)
|
|
474
475
|
}
|
|
475
476
|
),
|
|
@@ -481,7 +482,7 @@ var Checkbox = (0, import_react7.forwardRef)(
|
|
|
481
482
|
"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 transition-opacity duration-150",
|
|
482
483
|
intent.iconColor,
|
|
483
484
|
"peer-disabled:text-fg-inactive",
|
|
484
|
-
indeterminate ? "opacity-0" : "opacity-0 peer-checked:opacity-100"
|
|
485
|
+
indeterminate || plus ? "opacity-0" : "opacity-0 peer-checked:opacity-100"
|
|
485
486
|
)
|
|
486
487
|
}
|
|
487
488
|
),
|
|
@@ -493,7 +494,19 @@ var Checkbox = (0, import_react7.forwardRef)(
|
|
|
493
494
|
"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 transition-opacity duration-150",
|
|
494
495
|
intent.iconColor,
|
|
495
496
|
"peer-disabled:text-fg-inactive",
|
|
496
|
-
indeterminate ? "opacity-100" : "opacity-0"
|
|
497
|
+
indeterminate && !plus ? "opacity-100" : "opacity-0"
|
|
498
|
+
)
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
502
|
+
import_icons3.Plus,
|
|
503
|
+
{
|
|
504
|
+
"aria-hidden": "true",
|
|
505
|
+
className: (0, import_utils4.cx)(
|
|
506
|
+
"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 transition-opacity duration-150",
|
|
507
|
+
intent.iconColor,
|
|
508
|
+
"peer-disabled:text-fg-inactive",
|
|
509
|
+
plus ? "opacity-100" : "opacity-0"
|
|
497
510
|
)
|
|
498
511
|
}
|
|
499
512
|
)
|
package/dist/index.mjs
CHANGED
|
@@ -277,7 +277,7 @@ function Radio() {
|
|
|
277
277
|
// src/elements/Checkbox.jsx
|
|
278
278
|
import React6, { forwardRef as forwardRef2, useCallback as useCallback3, useEffect as useEffect2, useRef } from "react";
|
|
279
279
|
import { cx as cx4 } from "@edux-design/utils";
|
|
280
|
-
import { Check, Indeterminate } from "@edux-design/icons";
|
|
280
|
+
import { Check, Indeterminate, Plus } from "@edux-design/icons";
|
|
281
281
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
282
282
|
var VARIANT_INTENTS = {
|
|
283
283
|
primary: {
|
|
@@ -345,6 +345,7 @@ var Checkbox = forwardRef2(
|
|
|
345
345
|
({
|
|
346
346
|
className,
|
|
347
347
|
indeterminate = false,
|
|
348
|
+
plus = false,
|
|
348
349
|
variant = "primary",
|
|
349
350
|
disabled,
|
|
350
351
|
id: providedId,
|
|
@@ -369,7 +370,7 @@ var Checkbox = forwardRef2(
|
|
|
369
370
|
...ariaDescribedByProp ? ariaDescribedByProp.split(" ") : []
|
|
370
371
|
].filter(Boolean);
|
|
371
372
|
const describedBy = describedByTokens.length ? describedByTokens.join(" ") : void 0;
|
|
372
|
-
const ariaChecked = indeterminate ? "mixed" : ariaCheckedProp;
|
|
373
|
+
const ariaChecked = indeterminate || plus ? "mixed" : ariaCheckedProp;
|
|
373
374
|
const inputRef = useRef(null);
|
|
374
375
|
const setRefs = useCallback3(
|
|
375
376
|
(node) => {
|
|
@@ -430,8 +431,8 @@ var Checkbox = forwardRef2(
|
|
|
430
431
|
!isDisabled && intent.activeBg,
|
|
431
432
|
intent.peerSelectedBorder,
|
|
432
433
|
intent.peerSelectedBg,
|
|
433
|
-
indeterminate && intent.selectedBorder,
|
|
434
|
-
indeterminate && intent.selectedBg
|
|
434
|
+
(indeterminate || plus) && intent.selectedBorder,
|
|
435
|
+
(indeterminate || plus) && intent.selectedBg
|
|
435
436
|
)
|
|
436
437
|
}
|
|
437
438
|
),
|
|
@@ -443,7 +444,7 @@ var Checkbox = forwardRef2(
|
|
|
443
444
|
"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 transition-opacity duration-150",
|
|
444
445
|
intent.iconColor,
|
|
445
446
|
"peer-disabled:text-fg-inactive",
|
|
446
|
-
indeterminate ? "opacity-0" : "opacity-0 peer-checked:opacity-100"
|
|
447
|
+
indeterminate || plus ? "opacity-0" : "opacity-0 peer-checked:opacity-100"
|
|
447
448
|
)
|
|
448
449
|
}
|
|
449
450
|
),
|
|
@@ -455,7 +456,19 @@ var Checkbox = forwardRef2(
|
|
|
455
456
|
"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 transition-opacity duration-150",
|
|
456
457
|
intent.iconColor,
|
|
457
458
|
"peer-disabled:text-fg-inactive",
|
|
458
|
-
indeterminate ? "opacity-100" : "opacity-0"
|
|
459
|
+
indeterminate && !plus ? "opacity-100" : "opacity-0"
|
|
460
|
+
)
|
|
461
|
+
}
|
|
462
|
+
),
|
|
463
|
+
/* @__PURE__ */ jsx6(
|
|
464
|
+
Plus,
|
|
465
|
+
{
|
|
466
|
+
"aria-hidden": "true",
|
|
467
|
+
className: cx4(
|
|
468
|
+
"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 transition-opacity duration-150",
|
|
469
|
+
intent.iconColor,
|
|
470
|
+
"peer-disabled:text-fg-inactive",
|
|
471
|
+
plus ? "opacity-100" : "opacity-0"
|
|
459
472
|
)
|
|
460
473
|
}
|
|
461
474
|
)
|