@lssm/lib.presentation-runtime-react-native 0.0.0-canary-20251222120211 → 0.0.0-canary-20251223010757
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useForm } from "./ui-kit/dist/ui/form.js";
|
|
2
1
|
import * as React from "react";
|
|
2
|
+
import { useForm } from "@lssm/lib.ui-kit/ui/form";
|
|
3
3
|
|
|
4
4
|
//#region src/index.ts
|
|
5
5
|
function usePresentationController({ defaults, form: formOpts, toVariables, fetcher, toChips, useUrlState, replace }) {
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/lib.presentation-runtime-react-native",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251223010757",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"types": "./dist/nativewind-env.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"scripts": {
|
|
10
|
+
"clean": "rimraf dist .turbo",
|
|
10
11
|
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
11
12
|
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
12
|
-
"build": "bun build:
|
|
13
|
+
"build": "bun build:types && bun build:bundle",
|
|
13
14
|
"build:bundle": "tsdown",
|
|
14
15
|
"build:types": "tsc --noEmit -p tsconfig.json",
|
|
15
16
|
"dev": "bun run build:bundle --watch",
|
|
@@ -22,11 +23,11 @@
|
|
|
22
23
|
"react-native": "*",
|
|
23
24
|
"react-hook-form": "^7.68.0",
|
|
24
25
|
"zod": "^4.1.13",
|
|
25
|
-
"@lssm/lib.presentation-runtime-core": "0.0.0-canary-
|
|
26
|
+
"@lssm/lib.presentation-runtime-core": "0.0.0-canary-20251223010757"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@lssm/lib.presentation-runtime-core": "0.0.0-canary-
|
|
29
|
-
"@lssm/lib.ui-kit": "0.0.0-canary-
|
|
29
|
+
"@lssm/lib.presentation-runtime-core": "0.0.0-canary-20251223010757",
|
|
30
|
+
"@lssm/lib.ui-kit": "0.0.0-canary-20251223010757"
|
|
30
31
|
},
|
|
31
32
|
"files": [
|
|
32
33
|
"dist",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React$1 from "react";
|
|
4
|
-
import "react-native";
|
|
5
|
-
import "react/jsx-runtime";
|
|
6
|
-
import "@rn-primitives/slot";
|
|
7
|
-
import { useForm } from "react-hook-form";
|
|
8
|
-
import "@hookform/resolvers/zod";
|
|
9
|
-
|
|
10
|
-
//#region ../ui-kit/dist/ui/form.js
|
|
11
|
-
const FormFieldContext = React$1.createContext({});
|
|
12
|
-
const FormItemContext = React$1.createContext({});
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
export { useForm };
|
|
16
|
-
//# sourceMappingURL=form.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","names":[],"sources":["../../../../../ui-kit/dist/ui/form.js"],"sourcesContent":["'use client';\n\nimport { cn } from \"../-core/dist/utils.js\";\nimport { Label } from \"./label.js\";\nimport * as React$1 from \"react\";\nimport { View } from \"react-native\";\nimport * as Slot from \"@rn-primitives/slot\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Controller, FormProvider, useFieldArray, useForm, useFormContext, useFormState } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\n\n//#region ui/form.tsx\nconst Form = FormProvider;\nconst FormFieldContext = React$1.createContext({});\nconst FormField = ({ ...props }) => {\n\treturn /* @__PURE__ */ jsx(FormFieldContext.Provider, {\n\t\tvalue: { name: props.name },\n\t\tchildren: /* @__PURE__ */ jsx(Controller, { ...props })\n\t});\n};\nconst useFormField = () => {\n\tconst fieldContext = React$1.useContext(FormFieldContext);\n\tconst itemContext = React$1.useContext(FormItemContext);\n\tconst { getFieldState } = useFormContext();\n\tconst formState = useFormState({ name: fieldContext.name });\n\tconst fieldState = getFieldState(fieldContext.name, formState);\n\tif (!fieldContext) throw new Error(\"useFormField should be used within <FormField>\");\n\tconst { id } = itemContext;\n\treturn {\n\t\tid,\n\t\tname: fieldContext.name,\n\t\tformItemId: `${id}-form-item`,\n\t\tformDescriptionId: `${id}-form-item-description`,\n\t\tformMessageId: `${id}-form-item-message`,\n\t\t...fieldState\n\t};\n};\nconst FormItemContext = React$1.createContext({});\nfunction FormItem({ className, ...props }) {\n\tconst id = React$1.useId();\n\treturn /* @__PURE__ */ jsx(FormItemContext.Provider, {\n\t\tvalue: { id },\n\t\tchildren: /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\"data-slot\": \"form-item\",\n\t\t\tclassName: cn(\"grid gap-2\", className),\n\t\t\t...props\n\t\t})\n\t});\n}\nfunction FormLabel({ className, ...props }) {\n\tconst { error, formItemId } = useFormField();\n\treturn /* @__PURE__ */ jsx(Label, {\n\t\t\"data-slot\": \"form-label\",\n\t\t\"data-error\": !!error,\n\t\tclassName: cn(\"data-[error=true]:text-destructive\", className),\n\t\thtmlFor: formItemId,\n\t\t...props\n\t});\n}\nfunction FormControl({ asChild = false, ...props }) {\n\tconst Component = asChild ? Slot.Text : View;\n\tconst { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\treturn /* @__PURE__ */ jsx(Component, {\n\t\t\"data-slot\": \"form-control\",\n\t\tid: formItemId,\n\t\t\"aria-describedby\": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,\n\t\t\"aria-invalid\": !!error,\n\t\t...props\n\t});\n}\nfunction FormDescription({ className, ...props }) {\n\tconst { formDescriptionId } = useFormField();\n\treturn /* @__PURE__ */ jsx(\"p\", {\n\t\t\"data-slot\": \"form-description\",\n\t\tid: formDescriptionId,\n\t\tclassName: cn(\"text-muted-foreground text-sm\", className),\n\t\t...props\n\t});\n}\nfunction FormMessage({ className, ...props }) {\n\tconst { error, formMessageId } = useFormField();\n\tconst body = error ? String(error?.message ?? \"\") : props.children;\n\tif (!body) return null;\n\treturn /* @__PURE__ */ jsx(\"p\", {\n\t\t\"data-slot\": \"form-message\",\n\t\tid: formMessageId,\n\t\tclassName: cn(\"text-destructive text-sm\", className),\n\t\t...props,\n\t\tchildren: body\n\t});\n}\n\n//#endregion\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFieldArray, useForm, useFormField, zodResolver };\n//# sourceMappingURL=form.js.map"],"mappings":";;;;;;;;;;AAaA,MAAM,mBAAmB,QAAQ,cAAc,EAAE,CAAC;AAwBlD,MAAM,kBAAkB,QAAQ,cAAc,EAAE,CAAC"}
|