@dafaz-ui/react 4.0.10 → 4.0.12
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +49 -25
- package/dist/index.mjs +43 -19
- package/package.json +1 -1
- package/src/components/CheckBox/index.tsx +42 -19
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @dafaz-ui/react@4.0.
|
2
|
+
> @dafaz-ui/react@4.0.12 build
|
3
3
|
> tsup src/index.tsx --format esm,cjs --dts --external react
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
@@ -8,11 +8,11 @@
|
|
8
8
|
[34mCLI[39m Target: es6
|
9
9
|
[34mESM[39m Build start
|
10
10
|
[34mCJS[39m Build start
|
11
|
-
[
|
12
|
-
[
|
13
|
-
[
|
14
|
-
[
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m20.05 KB[39m
|
12
|
+
[32mESM[39m ⚡️ Build success in 38ms
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m22.58 KB[39m
|
14
|
+
[32mCJS[39m ⚡️ Build success in 38ms
|
15
15
|
[34mDTS[39m Build start
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m103.
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m103.
|
16
|
+
[32mDTS[39m ⚡️ Build success in 4498ms
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m103.76 KB[39m
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m103.76 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
@@ -663,14 +663,13 @@ interface CheckboxIUProps extends ComponentProps<typeof CheckBoxUI> {
|
|
663
663
|
disabled?: boolean;
|
664
664
|
}
|
665
665
|
|
666
|
-
interface CheckboxProps {
|
666
|
+
interface CheckboxProps extends CheckboxIUProps {
|
667
667
|
id: string;
|
668
668
|
label: string;
|
669
|
+
checked: boolean;
|
670
|
+
onCheckedChange: (checked: boolean) => void;
|
669
671
|
}
|
670
|
-
declare
|
671
|
-
declare namespace CheckBox {
|
672
|
-
var displayName: string;
|
673
|
-
}
|
672
|
+
declare const CheckBox: react.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
674
673
|
|
675
674
|
declare const HeadingUI: _stitches_react_types_styled_component.StyledComponent<"h2", {
|
676
675
|
mode?: "white" | "default" | undefined;
|
package/dist/index.d.ts
CHANGED
@@ -663,14 +663,13 @@ interface CheckboxIUProps extends ComponentProps<typeof CheckBoxUI> {
|
|
663
663
|
disabled?: boolean;
|
664
664
|
}
|
665
665
|
|
666
|
-
interface CheckboxProps {
|
666
|
+
interface CheckboxProps extends CheckboxIUProps {
|
667
667
|
id: string;
|
668
668
|
label: string;
|
669
|
+
checked: boolean;
|
670
|
+
onCheckedChange: (checked: boolean) => void;
|
669
671
|
}
|
670
|
-
declare
|
671
|
-
declare namespace CheckBox {
|
672
|
-
var displayName: string;
|
673
|
-
}
|
672
|
+
declare const CheckBox: react.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
674
673
|
|
675
674
|
declare const HeadingUI: _stitches_react_types_styled_component.StyledComponent<"h2", {
|
676
675
|
mode?: "white" | "default" | undefined;
|
package/dist/index.js
CHANGED
@@ -323,6 +323,9 @@ function Button(_a) {
|
|
323
323
|
}
|
324
324
|
Button.displayName = "Button";
|
325
325
|
|
326
|
+
// src/components/CheckBox/index.tsx
|
327
|
+
var import_react2 = require("react");
|
328
|
+
|
326
329
|
// src/components/CheckBox/styles.ts
|
327
330
|
var Checkbox = __toESM(require("@radix-ui/react-checkbox"));
|
328
331
|
var CheckBoxUI = styled(Checkbox.Root, {
|
@@ -443,25 +446,46 @@ var Label = styled("label", {
|
|
443
446
|
});
|
444
447
|
|
445
448
|
// src/components/CheckBox/index.tsx
|
446
|
-
var
|
449
|
+
var import_react3 = require("@phosphor-icons/react");
|
447
450
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
451
|
+
var CheckBox = (0, import_react2.forwardRef)(
|
452
|
+
(_a, ref) => {
|
453
|
+
var _b = _a, {
|
454
|
+
id,
|
455
|
+
label,
|
456
|
+
size,
|
457
|
+
disabled = false,
|
458
|
+
checked,
|
459
|
+
onCheckedChange,
|
460
|
+
value
|
461
|
+
} = _b, props = __objRest(_b, [
|
462
|
+
"id",
|
463
|
+
"label",
|
464
|
+
"size",
|
465
|
+
"disabled",
|
466
|
+
"checked",
|
467
|
+
"onCheckedChange",
|
468
|
+
"value"
|
469
|
+
]);
|
470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Label, { disabled, htmlFor: id, size, children: [
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
472
|
+
CheckBoxUI,
|
473
|
+
__spreadProps(__spreadValues({
|
474
|
+
ref,
|
475
|
+
checked,
|
476
|
+
onCheckedChange,
|
477
|
+
disabled,
|
478
|
+
id,
|
479
|
+
size,
|
480
|
+
value
|
481
|
+
}, props), {
|
482
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CheckBoxIndicator, { asChild: true, size, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react3.Check, { weight: "bold" }) })
|
483
|
+
})
|
484
|
+
),
|
485
|
+
label
|
486
|
+
] });
|
487
|
+
}
|
488
|
+
);
|
465
489
|
CheckBox.displayName = "CheckBox";
|
466
490
|
|
467
491
|
// src/components/Heading/styles.ts
|
@@ -524,7 +548,7 @@ var RadioUI = styled(RadioGroup.Root, {
|
|
524
548
|
});
|
525
549
|
|
526
550
|
// src/components/Radio/RadioItem/index.tsx
|
527
|
-
var
|
551
|
+
var import_react4 = require("@phosphor-icons/react");
|
528
552
|
|
529
553
|
// src/components/Radio/RadioItem/styles.ts
|
530
554
|
var RadioGroup2 = __toESM(require("@radix-ui/react-radio-group"));
|
@@ -663,7 +687,7 @@ function RadioItem(_a) {
|
|
663
687
|
"disabled"
|
664
688
|
]);
|
665
689
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(RadioItemContainer, { children: [
|
666
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadioItemUI, __spreadProps(__spreadValues({ disabled, id }, props), { size, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadioIndicator, { asChild: true, size, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
690
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadioItemUI, __spreadProps(__spreadValues({ disabled, id }, props), { size, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadioIndicator, { asChild: true, size, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react4.Check, { weight: "bold" }) }) })),
|
667
691
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label2, { disabled, htmlFor: id, size, children: label })
|
668
692
|
] }, id);
|
669
693
|
}
|
@@ -763,7 +787,7 @@ var OptionUI = styled("option", {
|
|
763
787
|
});
|
764
788
|
|
765
789
|
// src/components/Select/index.tsx
|
766
|
-
var
|
790
|
+
var import_react5 = require("react");
|
767
791
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
768
792
|
function Select(_a) {
|
769
793
|
var _b = _a, {
|
@@ -775,7 +799,7 @@ function Select(_a) {
|
|
775
799
|
"placeholder",
|
776
800
|
"items"
|
777
801
|
]);
|
778
|
-
const [value, setValue] = (0,
|
802
|
+
const [value, setValue] = (0, import_react5.useState)("");
|
779
803
|
function handleSelect(event) {
|
780
804
|
setValue(() => {
|
781
805
|
return event.target.value;
|
@@ -881,7 +905,7 @@ function TextArea(_a) {
|
|
881
905
|
TextArea.displayName = "TextArea";
|
882
906
|
|
883
907
|
// src/components/TextInput/index.tsx
|
884
|
-
var
|
908
|
+
var import_react6 = require("react");
|
885
909
|
|
886
910
|
// src/components/TextInput/styles.ts
|
887
911
|
var InputContainer = styled("div", {
|
@@ -946,7 +970,7 @@ var Sufix = styled("span", {
|
|
946
970
|
|
947
971
|
// src/components/TextInput/index.tsx
|
948
972
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
949
|
-
var TextInput = (0,
|
973
|
+
var TextInput = (0, import_react6.forwardRef)(
|
950
974
|
(_a, ref) => {
|
951
975
|
var _b = _a, {
|
952
976
|
withShadow = false,
|
@@ -959,7 +983,7 @@ var TextInput = (0, import_react5.forwardRef)(
|
|
959
983
|
"requiredText",
|
960
984
|
"id"
|
961
985
|
]);
|
962
|
-
const [hiddenOptional, setHiddenOptional] = (0,
|
986
|
+
const [hiddenOptional, setHiddenOptional] = (0, import_react6.useState)(required);
|
963
987
|
function handleOnChange(event) {
|
964
988
|
if (!required) {
|
965
989
|
if (event.target.value === "") {
|
package/dist/index.mjs
CHANGED
@@ -274,6 +274,9 @@ function Button(_a) {
|
|
274
274
|
}
|
275
275
|
Button.displayName = "Button";
|
276
276
|
|
277
|
+
// src/components/CheckBox/index.tsx
|
278
|
+
import { forwardRef } from "react";
|
279
|
+
|
277
280
|
// src/components/CheckBox/styles.ts
|
278
281
|
import * as Checkbox from "@radix-ui/react-checkbox";
|
279
282
|
var CheckBoxUI = styled(Checkbox.Root, {
|
@@ -396,23 +399,44 @@ var Label = styled("label", {
|
|
396
399
|
// src/components/CheckBox/index.tsx
|
397
400
|
import { Check } from "@phosphor-icons/react";
|
398
401
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
402
|
+
var CheckBox = forwardRef(
|
403
|
+
(_a, ref) => {
|
404
|
+
var _b = _a, {
|
405
|
+
id,
|
406
|
+
label,
|
407
|
+
size,
|
408
|
+
disabled = false,
|
409
|
+
checked,
|
410
|
+
onCheckedChange,
|
411
|
+
value
|
412
|
+
} = _b, props = __objRest(_b, [
|
413
|
+
"id",
|
414
|
+
"label",
|
415
|
+
"size",
|
416
|
+
"disabled",
|
417
|
+
"checked",
|
418
|
+
"onCheckedChange",
|
419
|
+
"value"
|
420
|
+
]);
|
421
|
+
return /* @__PURE__ */ jsxs(Label, { disabled, htmlFor: id, size, children: [
|
422
|
+
/* @__PURE__ */ jsx3(
|
423
|
+
CheckBoxUI,
|
424
|
+
__spreadProps(__spreadValues({
|
425
|
+
ref,
|
426
|
+
checked,
|
427
|
+
onCheckedChange,
|
428
|
+
disabled,
|
429
|
+
id,
|
430
|
+
size,
|
431
|
+
value
|
432
|
+
}, props), {
|
433
|
+
children: /* @__PURE__ */ jsx3(CheckBoxIndicator, { asChild: true, size, children: /* @__PURE__ */ jsx3(Check, { weight: "bold" }) })
|
434
|
+
})
|
435
|
+
),
|
436
|
+
label
|
437
|
+
] });
|
438
|
+
}
|
439
|
+
);
|
416
440
|
CheckBox.displayName = "CheckBox";
|
417
441
|
|
418
442
|
// src/components/Heading/styles.ts
|
@@ -833,7 +857,7 @@ TextArea.displayName = "TextArea";
|
|
833
857
|
|
834
858
|
// src/components/TextInput/index.tsx
|
835
859
|
import {
|
836
|
-
forwardRef,
|
860
|
+
forwardRef as forwardRef2,
|
837
861
|
useState as useState2
|
838
862
|
} from "react";
|
839
863
|
|
@@ -900,7 +924,7 @@ var Sufix = styled("span", {
|
|
900
924
|
|
901
925
|
// src/components/TextInput/index.tsx
|
902
926
|
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
903
|
-
var TextInput =
|
927
|
+
var TextInput = forwardRef2(
|
904
928
|
(_a, ref) => {
|
905
929
|
var _b = _a, {
|
906
930
|
withShadow = false,
|
package/package.json
CHANGED
@@ -1,28 +1,51 @@
|
|
1
|
+
import { forwardRef, type ElementRef } from 'react'
|
1
2
|
import { CheckBoxIndicator, CheckBoxUI, Label, CheckboxIUProps } from './styles'
|
2
3
|
import { Check } from '@phosphor-icons/react'
|
3
4
|
|
4
|
-
interface CheckboxProps {
|
5
|
+
interface CheckboxProps extends CheckboxIUProps {
|
5
6
|
id: string
|
6
7
|
label: string
|
8
|
+
checked: boolean
|
9
|
+
onCheckedChange: (checked: boolean) => void
|
7
10
|
}
|
8
11
|
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
)
|
26
|
-
|
12
|
+
export const CheckBox = forwardRef<
|
13
|
+
ElementRef<typeof CheckBoxUI>,
|
14
|
+
CheckboxProps
|
15
|
+
>(
|
16
|
+
(
|
17
|
+
{
|
18
|
+
id,
|
19
|
+
label,
|
20
|
+
size,
|
21
|
+
disabled = false,
|
22
|
+
checked,
|
23
|
+
onCheckedChange,
|
24
|
+
value,
|
25
|
+
...props
|
26
|
+
}: CheckboxProps,
|
27
|
+
ref,
|
28
|
+
) => {
|
29
|
+
return (
|
30
|
+
<Label disabled={disabled} htmlFor={id} size={size}>
|
31
|
+
<CheckBoxUI
|
32
|
+
ref={ref}
|
33
|
+
checked={checked}
|
34
|
+
onCheckedChange={onCheckedChange}
|
35
|
+
disabled={disabled}
|
36
|
+
id={id}
|
37
|
+
size={size}
|
38
|
+
value={value}
|
39
|
+
{...props}
|
40
|
+
>
|
41
|
+
<CheckBoxIndicator asChild size={size}>
|
42
|
+
<Check weight="bold" />
|
43
|
+
</CheckBoxIndicator>
|
44
|
+
</CheckBoxUI>
|
45
|
+
{label}
|
46
|
+
</Label>
|
47
|
+
)
|
48
|
+
},
|
49
|
+
)
|
27
50
|
|
28
51
|
CheckBox.displayName = 'CheckBox'
|