@pyck/react 0.0.2 → 0.0.5
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.
|
@@ -4,8 +4,8 @@ import { ark } from "@ark-ui/react/factory";
|
|
|
4
4
|
import { Stack, createStyleContext } from "@pyck/styled-system/jsx";
|
|
5
5
|
import { dialog } from "@pyck/styled-system/recipes";
|
|
6
6
|
import { CheckCircleIcon, FilePenLineIcon, Trash2Icon } from "lucide-react";
|
|
7
|
-
import { useForm } from "react-hook-form";
|
|
8
7
|
import { omit } from "@pyck/react/utils";
|
|
8
|
+
import { useForm } from "react-hook-form";
|
|
9
9
|
import { Show } from "@pyck/react/show";
|
|
10
10
|
import { Portal } from "@ark-ui/react/portal";
|
|
11
11
|
import { Button, CloseButton } from "@pyck/react/button";
|
|
@@ -2,25 +2,25 @@ import { P, match } from "ts-pattern";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { Fragment } from "react";
|
|
4
4
|
import { Box, HStack, Stack } from "@pyck/styled-system/jsx";
|
|
5
|
+
import { capitalize } from "@pyck/react/utils";
|
|
5
6
|
import { CheckboxField } from "@pyck/react/checkbox";
|
|
6
7
|
import { Field } from "@pyck/react/field";
|
|
7
8
|
import { Controller, FormProvider, useForm, useFormContext } from "react-hook-form";
|
|
8
|
-
import { capitalize } from "@pyck/react/utils";
|
|
9
9
|
import { Portal } from "@ark-ui/react/portal";
|
|
10
10
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
11
11
|
import { Form } from "@pyck/react/form";
|
|
12
12
|
import { Fieldset } from "@pyck/react/fieldset";
|
|
13
|
+
import { useListCollection } from "@ark-ui/react";
|
|
13
14
|
import { InputField } from "@pyck/react/input";
|
|
14
15
|
import { NumberInputField } from "@pyck/react/number-input";
|
|
15
|
-
import { Combobox, useFilter, useListCollection } from "@pyck/react/combobox";
|
|
16
|
-
import { useListCollection as useListCollection$1 } from "@ark-ui/react";
|
|
16
|
+
import { Combobox, useFilter, useListCollection as useListCollection$1 } from "@pyck/react/combobox";
|
|
17
17
|
import { SelectField } from "@pyck/react/select";
|
|
18
18
|
import { TagsInput } from "@pyck/react/tags-input";
|
|
19
19
|
|
|
20
20
|
//#region src/components/json-form-builder/components/combobox-from-items.tsx
|
|
21
21
|
const ComboboxFromItems = ({ name, label, helperText, items, required }) => {
|
|
22
22
|
const { contains } = useFilter({ sensitivity: "base" });
|
|
23
|
-
const { collection, filter } = useListCollection({
|
|
23
|
+
const { collection, filter } = useListCollection$1({
|
|
24
24
|
initialItems: items,
|
|
25
25
|
filter: contains
|
|
26
26
|
});
|
|
@@ -54,7 +54,7 @@ const ComboboxFromItems = ({ name, label, helperText, items, required }) => {
|
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/components/json-form-builder/components/select-field-from-items.tsx
|
|
56
56
|
const SelectFieldFromItems = ({ name, label, helperText, placeholder, items, required }) => {
|
|
57
|
-
const { collection } = useListCollection
|
|
57
|
+
const { collection } = useListCollection({ initialItems: items });
|
|
58
58
|
if (items.length === 0) return null;
|
|
59
59
|
return <SelectField.Root name={name} label={label} helperText={helperText} placeholder={placeholder ?? `Select ${label}`} collection={collection} multiple={false} required={required}>
|
|
60
60
|
{items.map((item) => <SelectField.Item key={item.value} item={item}>
|
|
@@ -53,7 +53,7 @@ const DateCell = (props) => {
|
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region src/components/table/cells/number-cell.tsx
|
|
55
55
|
const NumberCell = (props) => {
|
|
56
|
-
const { value, minimumFractionDigits, maximumFractionDigits, locale: localeProp, useGrouping, copyable, tooltip, icon, ...rest } = props;
|
|
56
|
+
const { value, minimumFractionDigits, maximumFractionDigits, locale: localeProp, useGrouping, copyable, tooltip, justifyContent = "flex-end", icon, ...rest } = props;
|
|
57
57
|
const locale = localeProp ?? "en";
|
|
58
58
|
const formatValue = (n) => {
|
|
59
59
|
if (!Number.isFinite(n)) return null;
|
|
@@ -63,7 +63,7 @@ const NumberCell = (props) => {
|
|
|
63
63
|
maximumFractionDigits
|
|
64
64
|
}).format(n);
|
|
65
65
|
};
|
|
66
|
-
return <TableCellContent icon={icon} tooltip={tooltip} justifyContent=
|
|
66
|
+
return <TableCellContent icon={icon} tooltip={tooltip} justifyContent={justifyContent} {...rest}>
|
|
67
67
|
<DisplayValue value={value} formatValue={formatValue} copyable={copyable} />
|
|
68
68
|
</TableCellContent>;
|
|
69
69
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyck/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://pyck.ai",
|
|
7
7
|
"repository": {
|
|
@@ -20,31 +20,27 @@
|
|
|
20
20
|
"lint": "biome ci",
|
|
21
21
|
"test": "vitest",
|
|
22
22
|
"test:ci": "vitest run",
|
|
23
|
-
"typecheck": "tsc"
|
|
23
|
+
"typecheck": "tsc",
|
|
24
|
+
"prepack": "bunx clean-package",
|
|
25
|
+
"postpack": "bunx clean-package restore"
|
|
24
26
|
},
|
|
25
27
|
"exports": {
|
|
26
|
-
"./
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
"./types": {
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
30
|
+
"default": "./dist/types/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./utils": {
|
|
33
|
+
"types": "./dist/utils/index.d.ts",
|
|
34
|
+
"default": "./dist/utils/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./*": {
|
|
37
|
+
"types": "./dist/components/*/index.d.ts",
|
|
38
|
+
"default": "./dist/components/*/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./package.json": "./package.json"
|
|
30
41
|
},
|
|
31
42
|
"publishConfig": {
|
|
32
|
-
"access": "public"
|
|
33
|
-
"exports": {
|
|
34
|
-
"./package.json": "./package.json",
|
|
35
|
-
"./types": {
|
|
36
|
-
"types": "./dist/types/index.d.ts",
|
|
37
|
-
"default": "./dist/types/index.js"
|
|
38
|
-
},
|
|
39
|
-
"./utils": {
|
|
40
|
-
"types": "./dist/utils/index.d.ts",
|
|
41
|
-
"default": "./dist/utils/index.js"
|
|
42
|
-
},
|
|
43
|
-
"./*": {
|
|
44
|
-
"types": "./dist/components/*/index.d.ts",
|
|
45
|
-
"default": "./dist/components/*/index.js"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
43
|
+
"access": "public"
|
|
48
44
|
},
|
|
49
45
|
"dependencies": {
|
|
50
46
|
"@ark-ui/react": "5.31.0",
|
|
@@ -57,7 +53,7 @@
|
|
|
57
53
|
},
|
|
58
54
|
"devDependencies": {
|
|
59
55
|
"@hookform/resolvers": "5.2.2",
|
|
60
|
-
"@pyck/styled-system": "0.0.
|
|
56
|
+
"@pyck/styled-system": "0.0.5",
|
|
61
57
|
"@storybook/react": "10.2.10",
|
|
62
58
|
"@testing-library/dom": "10.4.1",
|
|
63
59
|
"@testing-library/jest-dom": "6.9.1",
|
|
@@ -79,11 +75,30 @@
|
|
|
79
75
|
"zod": "4.3.6"
|
|
80
76
|
},
|
|
81
77
|
"peerDependencies": {
|
|
82
|
-
"@pyck/styled-system": ">=0.0.
|
|
78
|
+
"@pyck/styled-system": ">=0.0.5",
|
|
83
79
|
"react": ">=18.0.0",
|
|
84
80
|
"react-dom": ">=18.0.0",
|
|
85
81
|
"react-hook-form": ">=7.0.0",
|
|
86
82
|
"zod": ">=3.0.0",
|
|
87
83
|
"@hookform/resolvers": ">=5.0.0"
|
|
84
|
+
},
|
|
85
|
+
"clean-package": {
|
|
86
|
+
"replace": {
|
|
87
|
+
"exports": {
|
|
88
|
+
"./types": {
|
|
89
|
+
"types": "./dist/types/index.d.ts",
|
|
90
|
+
"default": "./dist/types/index.js"
|
|
91
|
+
},
|
|
92
|
+
"./utils": {
|
|
93
|
+
"types": "./dist/utils/index.d.ts",
|
|
94
|
+
"default": "./dist/utils/index.js"
|
|
95
|
+
},
|
|
96
|
+
"./*": {
|
|
97
|
+
"types": "./dist/components/*/index.d.ts",
|
|
98
|
+
"default": "./dist/components/*/index.js"
|
|
99
|
+
},
|
|
100
|
+
"./package.json": "./package.json"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
88
103
|
}
|
|
89
104
|
}
|