@dafaz-ui/react 4.0.9 → 4.0.11
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 +2 -5
- package/dist/index.d.ts +2 -5
- package/dist/index.js +51 -26
- package/dist/index.mjs +45 -20
- package/package.json +1 -1
- package/src/components/CheckBox/index.tsx +40 -19
- package/src/components/Radio/index.tsx +1 -0
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @dafaz-ui/react@4.0.
|
2
|
+
> @dafaz-ui/react@4.0.11 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
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[32m22.
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m20.05 KB[39m
|
12
|
+
[32mESM[39m ⚡️ Build success in 41ms
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m22.58 KB[39m
|
14
|
+
[32mCJS[39m ⚡️ Build success in 42ms
|
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 4546ms
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m103.69 KB[39m
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m103.69 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
@@ -663,14 +663,11 @@ 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
669
|
}
|
670
|
-
declare
|
671
|
-
declare namespace CheckBox {
|
672
|
-
var displayName: string;
|
673
|
-
}
|
670
|
+
declare const CheckBox: react.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
674
671
|
|
675
672
|
declare const HeadingUI: _stitches_react_types_styled_component.StyledComponent<"h2", {
|
676
673
|
mode?: "white" | "default" | undefined;
|
package/dist/index.d.ts
CHANGED
@@ -663,14 +663,11 @@ 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
669
|
}
|
670
|
-
declare
|
671
|
-
declare namespace CheckBox {
|
672
|
-
var displayName: string;
|
673
|
-
}
|
670
|
+
declare const CheckBox: react.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
674
671
|
|
675
672
|
declare const HeadingUI: _stitches_react_types_styled_component.StyledComponent<"h2", {
|
676
673
|
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
|
}
|
@@ -690,7 +714,8 @@ function Radio(_a) {
|
|
690
714
|
value: item.value,
|
691
715
|
size,
|
692
716
|
disabled
|
693
|
-
}
|
717
|
+
},
|
718
|
+
item.id
|
694
719
|
);
|
695
720
|
}) }));
|
696
721
|
}
|
@@ -762,7 +787,7 @@ var OptionUI = styled("option", {
|
|
762
787
|
});
|
763
788
|
|
764
789
|
// src/components/Select/index.tsx
|
765
|
-
var
|
790
|
+
var import_react5 = require("react");
|
766
791
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
767
792
|
function Select(_a) {
|
768
793
|
var _b = _a, {
|
@@ -774,7 +799,7 @@ function Select(_a) {
|
|
774
799
|
"placeholder",
|
775
800
|
"items"
|
776
801
|
]);
|
777
|
-
const [value, setValue] = (0,
|
802
|
+
const [value, setValue] = (0, import_react5.useState)("");
|
778
803
|
function handleSelect(event) {
|
779
804
|
setValue(() => {
|
780
805
|
return event.target.value;
|
@@ -880,7 +905,7 @@ function TextArea(_a) {
|
|
880
905
|
TextArea.displayName = "TextArea";
|
881
906
|
|
882
907
|
// src/components/TextInput/index.tsx
|
883
|
-
var
|
908
|
+
var import_react6 = require("react");
|
884
909
|
|
885
910
|
// src/components/TextInput/styles.ts
|
886
911
|
var InputContainer = styled("div", {
|
@@ -945,7 +970,7 @@ var Sufix = styled("span", {
|
|
945
970
|
|
946
971
|
// src/components/TextInput/index.tsx
|
947
972
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
948
|
-
var TextInput = (0,
|
973
|
+
var TextInput = (0, import_react6.forwardRef)(
|
949
974
|
(_a, ref) => {
|
950
975
|
var _b = _a, {
|
951
976
|
withShadow = false,
|
@@ -958,7 +983,7 @@ var TextInput = (0, import_react5.forwardRef)(
|
|
958
983
|
"requiredText",
|
959
984
|
"id"
|
960
985
|
]);
|
961
|
-
const [hiddenOptional, setHiddenOptional] = (0,
|
986
|
+
const [hiddenOptional, setHiddenOptional] = (0, import_react6.useState)(required);
|
962
987
|
function handleOnChange(event) {
|
963
988
|
if (!required) {
|
964
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
|
@@ -641,7 +665,8 @@ function Radio(_a) {
|
|
641
665
|
value: item.value,
|
642
666
|
size,
|
643
667
|
disabled
|
644
|
-
}
|
668
|
+
},
|
669
|
+
item.id
|
645
670
|
);
|
646
671
|
}) }));
|
647
672
|
}
|
@@ -832,7 +857,7 @@ TextArea.displayName = "TextArea";
|
|
832
857
|
|
833
858
|
// src/components/TextInput/index.tsx
|
834
859
|
import {
|
835
|
-
forwardRef,
|
860
|
+
forwardRef as forwardRef2,
|
836
861
|
useState as useState2
|
837
862
|
} from "react";
|
838
863
|
|
@@ -899,7 +924,7 @@ var Sufix = styled("span", {
|
|
899
924
|
|
900
925
|
// src/components/TextInput/index.tsx
|
901
926
|
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
902
|
-
var TextInput =
|
927
|
+
var TextInput = forwardRef2(
|
903
928
|
(_a, ref) => {
|
904
929
|
var _b = _a, {
|
905
930
|
withShadow = false,
|
package/package.json
CHANGED
@@ -1,28 +1,49 @@
|
|
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
|
7
8
|
}
|
8
9
|
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
)
|
26
|
-
|
10
|
+
export const CheckBox = forwardRef<
|
11
|
+
ElementRef<typeof CheckBoxUI>,
|
12
|
+
CheckboxProps
|
13
|
+
>(
|
14
|
+
(
|
15
|
+
{
|
16
|
+
id,
|
17
|
+
label,
|
18
|
+
size,
|
19
|
+
disabled = false,
|
20
|
+
checked,
|
21
|
+
onCheckedChange,
|
22
|
+
value,
|
23
|
+
...props
|
24
|
+
}: CheckboxProps,
|
25
|
+
ref,
|
26
|
+
) => {
|
27
|
+
return (
|
28
|
+
<Label disabled={disabled} htmlFor={id} size={size}>
|
29
|
+
<CheckBoxUI
|
30
|
+
ref={ref}
|
31
|
+
checked={checked}
|
32
|
+
onCheckedChange={onCheckedChange}
|
33
|
+
disabled={disabled}
|
34
|
+
id={id}
|
35
|
+
size={size}
|
36
|
+
value={value}
|
37
|
+
{...props}
|
38
|
+
>
|
39
|
+
<CheckBoxIndicator asChild size={size}>
|
40
|
+
<Check weight="bold" />
|
41
|
+
</CheckBoxIndicator>
|
42
|
+
</CheckBoxUI>
|
43
|
+
{label}
|
44
|
+
</Label>
|
45
|
+
)
|
46
|
+
},
|
47
|
+
)
|
27
48
|
|
28
49
|
CheckBox.displayName = 'CheckBox'
|