@moveindustries/movement-design-system 1.1.6 → 1.2.0
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/CHANGELOG.md +27 -0
- package/dist/assets/fonts/NeueHaasUnicaPro.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Black.otf +0 -0
- package/dist/assets/fonts/TWKEverett-BlackItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Bold.otf +0 -0
- package/dist/assets/fonts/TWKEverett-BoldItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Extrabold.otf +0 -0
- package/dist/assets/fonts/TWKEverett-ExtraboldItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Hairline.otf +0 -0
- package/dist/assets/fonts/TWKEverett-HairlineItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Light.otf +0 -0
- package/dist/assets/fonts/TWKEverett-LightItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Medium.otf +0 -0
- package/dist/assets/fonts/TWKEverett-MediumItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Regular.otf +0 -0
- package/dist/assets/fonts/TWKEverett-RegularItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Super.otf +0 -0
- package/dist/assets/fonts/TWKEverett-SuperItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Thin.otf +0 -0
- package/dist/assets/fonts/TWKEverett-ThinItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverett-Ultralight.otf +0 -0
- package/dist/assets/fonts/TWKEverett-UltralightItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Black.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-BlackItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Bold.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-BoldItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Extrabold.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-ExtraboldItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Hairline.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-HairlineItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Light.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-LightItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Medium.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-MediumItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Regular.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-RegularItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Super.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-SuperItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Thin.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-ThinItalic.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-Ultralight.otf +0 -0
- package/dist/assets/fonts/TWKEverettMono-UltralightItalic.otf +0 -0
- package/dist/assets/fonts/oracle/ABCOracle-Bold.woff2 +0 -0
- package/dist/assets/fonts/oracle/ABCOracle-BoldItalic.woff2 +0 -0
- package/dist/assets/fonts/oracle/ABCOracle-Medium.woff2 +0 -0
- package/dist/assets/fonts/oracle/ABCOracle-MediumItalic.woff2 +0 -0
- package/dist/assets/fonts/oracle/ABCOracle-Regular.woff2 +0 -0
- package/dist/assets/fonts/oracle/ABCOracle-RegularItalic.woff2 +0 -0
- package/dist/assets/fonts/recife/RecifeTextWeb-Bold.woff2 +0 -0
- package/dist/assets/fonts/recife/RecifeTextWeb-BoldItalic.woff2 +0 -0
- package/dist/assets/fonts/recife/RecifeTextWeb-Medium.woff2 +0 -0
- package/dist/assets/fonts/recife/RecifeTextWeb-MediumItalic.woff2 +0 -0
- package/dist/assets/fonts/recife/RecifeTextWeb-Regular.woff2 +0 -0
- package/dist/assets/fonts/recife/RecifeTextWeb-RegularItalic.woff2 +0 -0
- package/dist/{button-Dmwbc4J_.cjs → button-DZAlWvkC.cjs} +1 -1
- package/dist/{button-DBoRj4Bh.js → button-Dh2vlJOI.js} +4 -4
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.js +42 -42
- package/dist/components/WalletModal/WalletModal.d.ts.map +1 -1
- package/dist/components/shadcn/button.d.ts +1 -1
- package/dist/components/shadcn/input.d.ts +1 -1
- package/dist/components/shadcn/typography.d.ts +1 -1
- package/dist/components/theme/index.d.ts +0 -2
- package/dist/components/theme/index.d.ts.map +1 -1
- package/dist/{drawer-C7hRQ7X-.js → drawer-CTsbhpbu.js} +38 -38
- package/dist/{drawer-BkuiusSD.cjs → drawer-DjVIwhWw.cjs} +1 -1
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.js +1 -1
- package/dist/fonts.css +38 -279
- package/dist/index.cjs +1 -12
- package/dist/index.d.ts +5 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1581 -4592
- package/dist/movement-design-system.css +1 -1
- package/dist/recipes.css +6 -6
- package/dist/theme.css +97 -129
- package/dist/{dialog-LjNZCtUV.cjs → use-mobile-C12jSU8y.cjs} +2 -2
- package/dist/{dialog-9n6-1DUQ.js → use-mobile-Da0X_fcF.js} +261 -262
- package/dist/wallet.cjs +1 -1
- package/dist/wallet.js +79 -90
- package/package.json +15 -26
- package/dist/components/Branding/Branding.d.ts +0 -31
- package/dist/components/Branding/Branding.d.ts.map +0 -1
- package/dist/components/Branding/index.d.ts +0 -3
- package/dist/components/Branding/index.d.ts.map +0 -1
- package/dist/components/DottedBackground/DottedBackground.d.ts +0 -11
- package/dist/components/DottedBackground/DottedBackground.d.ts.map +0 -1
- package/dist/components/DottedBackground/index.d.ts +0 -2
- package/dist/components/DottedBackground/index.d.ts.map +0 -1
- package/dist/components/GlobalNavMenu/GlobalNavMenu.d.ts +0 -87
- package/dist/components/GlobalNavMenu/GlobalNavMenu.d.ts.map +0 -1
- package/dist/components/GlobalNavMenu/icons/BridgeIcon.d.ts +0 -2
- package/dist/components/GlobalNavMenu/icons/BridgeIcon.d.ts.map +0 -1
- package/dist/components/GlobalNavMenu/icons/DelegatedStakingIcon.d.ts +0 -2
- package/dist/components/GlobalNavMenu/icons/DelegatedStakingIcon.d.ts.map +0 -1
- package/dist/components/GlobalNavMenu/icons/ExplorerIcon.d.ts +0 -2
- package/dist/components/GlobalNavMenu/icons/ExplorerIcon.d.ts.map +0 -1
- package/dist/components/GlobalNavMenu/icons/GridIcon.d.ts +0 -4
- package/dist/components/GlobalNavMenu/icons/GridIcon.d.ts.map +0 -1
- package/dist/components/GlobalNavMenu/icons/MoveDocsIcon.d.ts +0 -2
- package/dist/components/GlobalNavMenu/icons/MoveDocsIcon.d.ts.map +0 -1
- package/dist/components/GlobalNavMenu/icons/ParthenonIcon.d.ts +0 -2
- package/dist/components/GlobalNavMenu/icons/ParthenonIcon.d.ts.map +0 -1
- package/dist/components/GlobalNavMenu/icons/index.d.ts +0 -7
- package/dist/components/GlobalNavMenu/icons/index.d.ts.map +0 -1
- package/dist/components/GlobalNavMenu/index.d.ts +0 -3
- package/dist/components/GlobalNavMenu/index.d.ts.map +0 -1
- package/dist/components/Logo/Logo.d.ts +0 -3
- package/dist/components/Logo/Logo.d.ts.map +0 -1
- package/dist/components/MultiOutlineText/MultiOutlineText.d.ts +0 -23
- package/dist/components/MultiOutlineText/MultiOutlineText.d.ts.map +0 -1
- package/dist/components/MultiOutlineText/index.d.ts +0 -3
- package/dist/components/MultiOutlineText/index.d.ts.map +0 -1
- package/dist/components/shadcn/alert-dialog.d.ts +0 -15
- package/dist/components/shadcn/alert-dialog.d.ts.map +0 -1
- package/dist/components/shadcn/aspect-ratio.d.ts +0 -4
- package/dist/components/shadcn/aspect-ratio.d.ts.map +0 -1
- package/dist/components/shadcn/button-group.d.ts +0 -12
- package/dist/components/shadcn/button-group.d.ts.map +0 -1
- package/dist/components/shadcn/checkbox.d.ts +0 -5
- package/dist/components/shadcn/checkbox.d.ts.map +0 -1
- package/dist/components/shadcn/crypto-amount-input.d.ts +0 -31
- package/dist/components/shadcn/crypto-amount-input.d.ts.map +0 -1
- package/dist/components/shadcn/empty.d.ts +0 -12
- package/dist/components/shadcn/empty.d.ts.map +0 -1
- package/dist/components/shadcn/field.d.ts +0 -25
- package/dist/components/shadcn/field.d.ts.map +0 -1
- package/dist/components/shadcn/form.d.ts +0 -25
- package/dist/components/shadcn/form.d.ts.map +0 -1
- package/dist/components/shadcn/hover-card.d.ts +0 -7
- package/dist/components/shadcn/hover-card.d.ts.map +0 -1
- package/dist/components/shadcn/input-group.d.ts +0 -17
- package/dist/components/shadcn/input-group.d.ts.map +0 -1
- package/dist/components/shadcn/item.d.ts +0 -24
- package/dist/components/shadcn/item.d.ts.map +0 -1
- package/dist/components/shadcn/list.d.ts +0 -45
- package/dist/components/shadcn/list.d.ts.map +0 -1
- package/dist/components/shadcn/menubar.d.ts +0 -27
- package/dist/components/shadcn/menubar.d.ts.map +0 -1
- package/dist/components/shadcn/navigation-menu.d.ts +0 -15
- package/dist/components/shadcn/navigation-menu.d.ts.map +0 -1
- package/dist/components/shadcn/radio-group.d.ts +0 -6
- package/dist/components/shadcn/radio-group.d.ts.map +0 -1
- package/dist/components/shadcn/scroll-area.d.ts +0 -6
- package/dist/components/shadcn/scroll-area.d.ts.map +0 -1
- package/dist/components/shadcn/separator.d.ts +0 -5
- package/dist/components/shadcn/separator.d.ts.map +0 -1
- package/dist/components/shadcn/sidebar.d.ts +0 -70
- package/dist/components/shadcn/sidebar.d.ts.map +0 -1
- package/dist/components/shadcn/switch.d.ts +0 -5
- package/dist/components/shadcn/switch.d.ts.map +0 -1
- package/dist/components/shadcn/textarea.d.ts +0 -4
- package/dist/components/shadcn/textarea.d.ts.map +0 -1
- package/dist/components/shadcn/toggle.d.ts +0 -10
- package/dist/components/shadcn/toggle.d.ts.map +0 -1
- package/dist/components/theme/theme-switcher.d.ts +0 -33
- package/dist/components/theme/theme-switcher.d.ts.map +0 -1
- package/dist/components/theme/use-theme.d.ts +0 -20
- package/dist/components/theme/use-theme.d.ts.map +0 -1
- package/dist/forms.cjs +0 -1
- package/dist/forms.d.ts +0 -2
- package/dist/forms.d.ts.map +0 -1
- package/dist/forms.js +0 -386
- package/dist/label-CPL77haD.js +0 -23
- package/dist/label-tKsAbVfX.cjs +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
3
|
-
declare function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export { Switch };
|
|
5
|
-
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/shadcn/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAIzD,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAkBnD;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/components/shadcn/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAW1E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
4
|
-
declare const toggleVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "outline" | null | undefined;
|
|
6
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
-
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export { Toggle, toggleVariants };
|
|
10
|
-
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/components/shadcn/toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EAoBnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAClD,YAAY,CAAC,OAAO,cAAc,CAAC,2CAQpC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface ThemeSwitcherProps {
|
|
2
|
-
/** Additional class names */
|
|
3
|
-
className?: string;
|
|
4
|
-
/** Size of the icons. Defaults to 16 */
|
|
5
|
-
iconSize?: number;
|
|
6
|
-
/** Show labels next to icons */
|
|
7
|
-
showLabels?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A theme switcher component that allows users to toggle between light, dark, and system themes.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* import { ThemeSwitcher } from "@/components/theme/theme-switcher";
|
|
15
|
-
*
|
|
16
|
-
* function Header() {
|
|
17
|
-
* return (
|
|
18
|
-
* <header>
|
|
19
|
-
* <ThemeSwitcher />
|
|
20
|
-
* </header>
|
|
21
|
-
* );
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare function ThemeSwitcher({ className, iconSize, showLabels, }: ThemeSwitcherProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
/**
|
|
27
|
-
* A simple toggle button that cycles through themes: light -> dark -> system -> light
|
|
28
|
-
*/
|
|
29
|
-
export declare function ThemeToggle({ className, iconSize, }: {
|
|
30
|
-
className?: string;
|
|
31
|
-
iconSize?: number;
|
|
32
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
//# sourceMappingURL=theme-switcher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme-switcher.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-switcher.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,kBAAkB;IACjC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,QAAa,EACb,UAAkB,GACnB,EAAE,kBAAkB,2CA8DpB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,QAAa,GACd,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,2CA8CA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Re-export useTheme hook from next-themes for convenience.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```tsx
|
|
6
|
-
* import { useTheme } from "@/components/theme/use-theme";
|
|
7
|
-
*
|
|
8
|
-
* function MyComponent() {
|
|
9
|
-
* const { theme, setTheme, resolvedTheme } = useTheme();
|
|
10
|
-
*
|
|
11
|
-
* return (
|
|
12
|
-
* <button onClick={() => setTheme(theme === "dark" ? "light" : "dark")}>
|
|
13
|
-
* Toggle theme
|
|
14
|
-
* </button>
|
|
15
|
-
* );
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export { useTheme } from 'next-themes';
|
|
20
|
-
//# sourceMappingURL=use-theme.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-theme.d.ts","sourceRoot":"","sources":["../../../src/components/theme/use-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/forms.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),n=require("react");require("@radix-ui/react-label");const te=require("@radix-ui/react-slot"),w=require("./utils-CikHldDD.cjs"),re=require("./label-tKsAbVfX.cjs");function oe(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const I=oe(n);var se=e=>e.type==="checkbox",k=e=>e instanceof Date,L=e=>e==null;const G=e=>typeof e=="object";var h=e=>!L(e)&&!Array.isArray(e)&&G(e)&&!k(e),ne=e=>h(e)&&e.target?se(e.target)?e.target.checked:e.target.value:e,ae=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ue=(e,o)=>e.has(ae(o)),ie=e=>{const o=e.constructor&&e.constructor.prototype;return h(o)&&o.hasOwnProperty("isPrototypeOf")},le=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function z(e){if(e instanceof Date)return new Date(e);const o=typeof FileList<"u"&&e instanceof FileList;if(le&&(e instanceof Blob||o))return e;const t=Array.isArray(e);if(!t&&!(h(e)&&ie(e)))return e;const s=t?[]:Object.create(Object.getPrototypeOf(e));for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(s[r]=z(e[r]));return s}var K=e=>/^\w*$/.test(e),D=e=>e===void 0,ce=e=>Array.isArray(e)?e.filter(Boolean):[],J=e=>ce(e.replace(/["|']|\]/g,"").split(/\.|\[/)),g=(e,o,t)=>{if(!o||!h(e))return t;const s=(K(o)?[o]:J(o)).reduce((r,a)=>L(r)?r:r[a],e);return D(s)||s===e?D(e[o])?t:e[o]:s},R=e=>typeof e=="boolean",P=e=>typeof e=="function",U=(e,o,t)=>{let s=-1;const r=K(o)?[o]:J(o),a=r.length,i=a-1;for(;++s<a;){const l=r[s];let c=t;if(s!==i){const f=e[l];c=h(f)||Array.isArray(f)?f:isNaN(+r[s+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const $={BLUR:"blur",CHANGE:"change"},q={all:"all"},T=n.createContext(null);T.displayName="HookFormControlContext";const j=()=>n.useContext(T);var fe=(e,o,t,s=!0)=>{const r={defaultValues:o._defaultValues};for(const a in e)Object.defineProperty(r,a,{get:()=>{const i=a;return o._proxyFormState[i]!==q.all&&(o._proxyFormState[i]=!s||q.all),t&&(t[i]=!0),e[i]}});return r};const Q=typeof window<"u"?n.useLayoutEffect:n.useEffect;function X(e){const o=j(),{control:t=o,disabled:s,name:r,exact:a}=e||{},[i,l]=n.useState(t._formState),c=n.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Q(()=>t._subscribe({name:r,formState:c.current,exact:a,callback:f=>{!s&&l({...t._formState,...f})}}),[r,s,a]),n.useEffect(()=>{c.current.isValid&&t._setValid(!0)},[t]),n.useMemo(()=>fe(i,t,c.current,!1),[i,t])}var de=e=>typeof e=="string",H=(e,o,t,s,r)=>de(e)?g(t,e,r):Array.isArray(e)?e.map(a=>g(t,a)):t,W=e=>L(e)||!G(e);function E(e,o,t=new WeakSet){if(W(e)||W(o))return Object.is(e,o);if(k(e)&&k(o))return Object.is(e.getTime(),o.getTime());const s=Object.keys(e),r=Object.keys(o);if(s.length!==r.length)return!1;if(t.has(e)||t.has(o))return!0;t.add(e),t.add(o);for(const a of s){const i=e[a];if(!r.includes(a))return!1;if(a!=="ref"){const l=o[a];if(k(i)&&k(l)||h(i)&&h(l)||Array.isArray(i)&&Array.isArray(l)?!E(i,l,t):!Object.is(i,l))return!1}}return!0}function me(e){const o=j(),{control:t=o,name:s,defaultValue:r,disabled:a,exact:i,compute:l}=e||{},c=n.useRef(r),f=n.useRef(l),F=n.useRef(void 0),d=n.useRef(t),y=n.useRef(s);f.current=l;const[V,p]=n.useState(()=>{const u=t._getWatch(s,c.current);return f.current?f.current(u):u}),C=n.useCallback(u=>{const m=H(s,t._names,u||t._formValues,!1,c.current);return f.current?f.current(m):m},[t._formValues,t._names,s]),b=n.useCallback(u=>{if(!a){const m=H(s,t._names,u||t._formValues,!1,c.current);if(f.current){const v=f.current(m);E(v,F.current)||(p(v),F.current=v)}else p(m)}},[t._formValues,t._names,a,s]);Q(()=>((d.current!==t||!E(y.current,s))&&(d.current=t,y.current=s,b()),t._subscribe({name:s,formState:{values:!0},exact:i,callback:u=>{b(u.values)}})),[t,i,s,b]),n.useEffect(()=>t._removeUnmounted());const _=d.current!==t,O=y.current,S=n.useMemo(()=>{if(a)return null;const u=!_&&!E(O,s);return _||u?C():null},[a,_,s,O,C]);return S!==null?S:V}function ge(e){const o=j(),{name:t,disabled:s,control:r=o,shouldUnregister:a,defaultValue:i,exact:l=!0}=e,c=ue(r._names.array,t),f=n.useMemo(()=>g(r._formValues,t,g(r._defaultValues,t,i)),[r,t,i]),F=me({control:r,name:t,defaultValue:f,exact:l}),d=X({control:r,name:t,exact:l}),y=n.useRef(e),V=n.useRef(void 0),p=n.useRef(r.register(t,{...e.rules,value:F,...R(e.disabled)?{disabled:e.disabled}:{}}));y.current=e;const C=n.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!g(d.errors,t)},isDirty:{enumerable:!0,get:()=>!!g(d.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!g(d.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!g(d.validatingFields,t)},error:{enumerable:!0,get:()=>g(d.errors,t)}}),[d,t]),b=n.useCallback(u=>p.current.onChange({target:{value:ne(u),name:t},type:$.CHANGE}),[t]),_=n.useCallback(()=>p.current.onBlur({target:{value:g(r._formValues,t),name:t},type:$.BLUR}),[t,r._formValues]),O=n.useCallback(u=>{const m=g(r._fields,t);m&&m._f&&u&&(m._f.ref={focus:()=>P(u.focus)&&u.focus(),select:()=>P(u.select)&&u.select(),setCustomValidity:v=>P(u.setCustomValidity)&&u.setCustomValidity(v),reportValidity:()=>P(u.reportValidity)&&u.reportValidity()})},[r._fields,t]),S=n.useMemo(()=>({name:t,value:F,...R(s)||d.disabled?{disabled:d.disabled||s}:{},onChange:b,onBlur:_,ref:O}),[t,s,d.disabled,b,_,O,F]);return n.useEffect(()=>{const u=r._options.shouldUnregister||a,m=V.current;m&&m!==t&&!c&&r.unregister(m),r.register(t,{...y.current.rules,...R(y.current.disabled)?{disabled:y.current.disabled}:{}});const v=(N,ee)=>{const M=g(r._fields,N);M&&M._f&&(M._f.mount=ee)};if(v(t,!0),u){const N=z(g(r._options.defaultValues,t,y.current.defaultValue));U(r._defaultValues,t,N),D(g(r._formValues,t))&&U(r._formValues,t,N)}return!c&&r.register(t),V.current=t,()=>{(c?u&&!r._state.action:u)?r.unregister(t):v(t,!1)}},[t,r,c,a]),n.useEffect(()=>{r._setDisabledField({disabled:s,name:t})},[s,t,r]),n.useMemo(()=>({field:S,formState:d,fieldState:C}),[S,d,C])}const ye=e=>e.render(ge(e)),B=n.createContext(null);B.displayName="HookFormContext";const Fe=()=>n.useContext(B),pe=e=>{const{children:o,watch:t,getValues:s,getFieldState:r,setError:a,clearErrors:i,setValue:l,trigger:c,formState:f,resetField:F,reset:d,handleSubmit:y,unregister:V,control:p,register:C,setFocus:b,subscribe:_}=e;return n.createElement(B.Provider,{value:n.useMemo(()=>({watch:t,getValues:s,getFieldState:r,setError:a,clearErrors:i,setValue:l,trigger:c,formState:f,resetField:F,reset:d,handleSubmit:y,unregister:V,control:p,register:C,setFocus:b,subscribe:_}),[i,p,f,r,s,y,C,d,F,a,b,l,_,c,V,t])},n.createElement(T.Provider,{value:p},o))},be=pe,Y=I.createContext({}),_e=({...e})=>x.jsx(Y.Provider,{value:{name:e.name},children:x.jsx(ye,{...e})}),A=()=>{const e=I.useContext(Y),o=I.useContext(Z),{getFieldState:t}=Fe(),s=X({name:e.name}),r=t(e.name,s);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=o;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...r}},Z=I.createContext({});function Ce({className:e,...o}){const t=I.useId();return x.jsx(Z.Provider,{value:{id:t},children:x.jsx("div",{"data-slot":"form-item",className:w.cn("grid gap-2",e),...o})})}function ve({className:e,...o}){const{error:t,formItemId:s}=A();return x.jsx(re.Label,{"data-slot":"form-label","data-error":!!t,className:w.cn("data-[error=true]:text-destructive",e),htmlFor:s,...o})}function xe({...e}){const{error:o,formItemId:t,formDescriptionId:s,formMessageId:r}=A();return x.jsx(te.Slot,{"data-slot":"form-control",id:t,"aria-describedby":o?`${s} ${r}`:`${s}`,"aria-invalid":!!o,...e})}function Ve({className:e,...o}){const{formDescriptionId:t}=A();return x.jsx("p",{"data-slot":"form-description",id:t,className:w.cn("text-muted-foreground text-sm",e),...o})}function he({className:e,...o}){const{error:t,formMessageId:s}=A(),r=t?String(t?.message??""):o.children;return r?x.jsx("p",{"data-slot":"form-message",id:s,className:w.cn("text-destructive text-sm",e),...o,children:r}):null}exports.Form=be;exports.FormControl=xe;exports.FormDescription=Ve;exports.FormField=_e;exports.FormItem=Ce;exports.FormLabel=ve;exports.FormMessage=he;exports.useFormField=A;
|
package/dist/forms.d.ts
DELETED
package/dist/forms.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../src/forms.ts"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,GACb,MAAM,0BAA0B,CAAC"}
|
package/dist/forms.js
DELETED
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
-
import * as S from "react";
|
|
3
|
-
import n from "react";
|
|
4
|
-
import "@radix-ui/react-label";
|
|
5
|
-
import { Slot as te } from "@radix-ui/react-slot";
|
|
6
|
-
import { c as P } from "./utils-eGXXUFl7.js";
|
|
7
|
-
import { L as re } from "./label-CPL77haD.js";
|
|
8
|
-
var oe = (e) => e.type === "checkbox", O = (e) => e instanceof Date, L = (e) => e == null;
|
|
9
|
-
const K = (e) => typeof e == "object";
|
|
10
|
-
var x = (e) => !L(e) && !Array.isArray(e) && K(e) && !O(e), se = (e) => x(e) && e.target ? oe(e.target) ? e.target.checked : e.target.value : e, ne = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, ae = (e, o) => e.has(ne(o)), ue = (e) => {
|
|
11
|
-
const o = e.constructor && e.constructor.prototype;
|
|
12
|
-
return x(o) && o.hasOwnProperty("isPrototypeOf");
|
|
13
|
-
}, ie = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
14
|
-
function z(e) {
|
|
15
|
-
if (e instanceof Date)
|
|
16
|
-
return new Date(e);
|
|
17
|
-
const o = typeof FileList < "u" && e instanceof FileList;
|
|
18
|
-
if (ie && (e instanceof Blob || o))
|
|
19
|
-
return e;
|
|
20
|
-
const t = Array.isArray(e);
|
|
21
|
-
if (!t && !(x(e) && ue(e)))
|
|
22
|
-
return e;
|
|
23
|
-
const s = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
24
|
-
for (const r in e)
|
|
25
|
-
Object.prototype.hasOwnProperty.call(e, r) && (s[r] = z(e[r]));
|
|
26
|
-
return s;
|
|
27
|
-
}
|
|
28
|
-
var J = (e) => /^\w*$/.test(e), D = (e) => e === void 0, le = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Q = (e) => le(e.replace(/["|']|\]/g, "").split(/\.|\[/)), y = (e, o, t) => {
|
|
29
|
-
if (!o || !x(e))
|
|
30
|
-
return t;
|
|
31
|
-
const s = (J(o) ? [o] : Q(o)).reduce((r, a) => L(r) ? r : r[a], e);
|
|
32
|
-
return D(s) || s === e ? D(e[o]) ? t : e[o] : s;
|
|
33
|
-
}, M = (e) => typeof e == "boolean", E = (e) => typeof e == "function", $ = (e, o, t) => {
|
|
34
|
-
let s = -1;
|
|
35
|
-
const r = J(o) ? [o] : Q(o), a = r.length, i = a - 1;
|
|
36
|
-
for (; ++s < a; ) {
|
|
37
|
-
const l = r[s];
|
|
38
|
-
let c = t;
|
|
39
|
-
if (s !== i) {
|
|
40
|
-
const f = e[l];
|
|
41
|
-
c = x(f) || Array.isArray(f) ? f : isNaN(+r[s + 1]) ? {} : [];
|
|
42
|
-
}
|
|
43
|
-
if (l === "__proto__" || l === "constructor" || l === "prototype")
|
|
44
|
-
return;
|
|
45
|
-
e[l] = c, e = e[l];
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const H = {
|
|
49
|
-
BLUR: "blur",
|
|
50
|
-
CHANGE: "change"
|
|
51
|
-
}, W = {
|
|
52
|
-
all: "all"
|
|
53
|
-
}, B = n.createContext(null);
|
|
54
|
-
B.displayName = "HookFormControlContext";
|
|
55
|
-
const T = () => n.useContext(B);
|
|
56
|
-
var ce = (e, o, t, s = !0) => {
|
|
57
|
-
const r = {
|
|
58
|
-
defaultValues: o._defaultValues
|
|
59
|
-
};
|
|
60
|
-
for (const a in e)
|
|
61
|
-
Object.defineProperty(r, a, {
|
|
62
|
-
get: () => {
|
|
63
|
-
const i = a;
|
|
64
|
-
return o._proxyFormState[i] !== W.all && (o._proxyFormState[i] = !s || W.all), t && (t[i] = !0), e[i];
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
return r;
|
|
68
|
-
};
|
|
69
|
-
const X = typeof window < "u" ? n.useLayoutEffect : n.useEffect;
|
|
70
|
-
function Y(e) {
|
|
71
|
-
const o = T(), { control: t = o, disabled: s, name: r, exact: a } = e || {}, [i, l] = n.useState(t._formState), c = n.useRef({
|
|
72
|
-
isDirty: !1,
|
|
73
|
-
isLoading: !1,
|
|
74
|
-
dirtyFields: !1,
|
|
75
|
-
touchedFields: !1,
|
|
76
|
-
validatingFields: !1,
|
|
77
|
-
isValidating: !1,
|
|
78
|
-
isValid: !1,
|
|
79
|
-
errors: !1
|
|
80
|
-
});
|
|
81
|
-
return X(() => t._subscribe({
|
|
82
|
-
name: r,
|
|
83
|
-
formState: c.current,
|
|
84
|
-
exact: a,
|
|
85
|
-
callback: (f) => {
|
|
86
|
-
!s && l({
|
|
87
|
-
...t._formState,
|
|
88
|
-
...f
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}), [r, s, a]), n.useEffect(() => {
|
|
92
|
-
c.current.isValid && t._setValid(!0);
|
|
93
|
-
}, [t]), n.useMemo(() => ce(i, t, c.current, !1), [i, t]);
|
|
94
|
-
}
|
|
95
|
-
var fe = (e) => typeof e == "string", G = (e, o, t, s, r) => fe(e) ? y(t, e, r) : Array.isArray(e) ? e.map((a) => y(t, a)) : t, q = (e) => L(e) || !K(e);
|
|
96
|
-
function N(e, o, t = /* @__PURE__ */ new WeakSet()) {
|
|
97
|
-
if (q(e) || q(o))
|
|
98
|
-
return Object.is(e, o);
|
|
99
|
-
if (O(e) && O(o))
|
|
100
|
-
return Object.is(e.getTime(), o.getTime());
|
|
101
|
-
const s = Object.keys(e), r = Object.keys(o);
|
|
102
|
-
if (s.length !== r.length)
|
|
103
|
-
return !1;
|
|
104
|
-
if (t.has(e) || t.has(o))
|
|
105
|
-
return !0;
|
|
106
|
-
t.add(e), t.add(o);
|
|
107
|
-
for (const a of s) {
|
|
108
|
-
const i = e[a];
|
|
109
|
-
if (!r.includes(a))
|
|
110
|
-
return !1;
|
|
111
|
-
if (a !== "ref") {
|
|
112
|
-
const l = o[a];
|
|
113
|
-
if (O(i) && O(l) || x(i) && x(l) || Array.isArray(i) && Array.isArray(l) ? !N(i, l, t) : !Object.is(i, l))
|
|
114
|
-
return !1;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return !0;
|
|
118
|
-
}
|
|
119
|
-
function de(e) {
|
|
120
|
-
const o = T(), { control: t = o, name: s, defaultValue: r, disabled: a, exact: i, compute: l } = e || {}, c = n.useRef(r), f = n.useRef(l), p = n.useRef(void 0), d = n.useRef(t), g = n.useRef(s);
|
|
121
|
-
f.current = l;
|
|
122
|
-
const [h, F] = n.useState(() => {
|
|
123
|
-
const u = t._getWatch(s, c.current);
|
|
124
|
-
return f.current ? f.current(u) : u;
|
|
125
|
-
}), b = n.useCallback((u) => {
|
|
126
|
-
const m = G(s, t._names, u || t._formValues, !1, c.current);
|
|
127
|
-
return f.current ? f.current(m) : m;
|
|
128
|
-
}, [t._formValues, t._names, s]), _ = n.useCallback((u) => {
|
|
129
|
-
if (!a) {
|
|
130
|
-
const m = G(s, t._names, u || t._formValues, !1, c.current);
|
|
131
|
-
if (f.current) {
|
|
132
|
-
const V = f.current(m);
|
|
133
|
-
N(V, p.current) || (F(V), p.current = V);
|
|
134
|
-
} else
|
|
135
|
-
F(m);
|
|
136
|
-
}
|
|
137
|
-
}, [t._formValues, t._names, a, s]);
|
|
138
|
-
X(() => ((d.current !== t || !N(g.current, s)) && (d.current = t, g.current = s, _()), t._subscribe({
|
|
139
|
-
name: s,
|
|
140
|
-
formState: {
|
|
141
|
-
values: !0
|
|
142
|
-
},
|
|
143
|
-
exact: i,
|
|
144
|
-
callback: (u) => {
|
|
145
|
-
_(u.values);
|
|
146
|
-
}
|
|
147
|
-
})), [t, i, s, _]), n.useEffect(() => t._removeUnmounted());
|
|
148
|
-
const C = d.current !== t, k = g.current, I = n.useMemo(() => {
|
|
149
|
-
if (a)
|
|
150
|
-
return null;
|
|
151
|
-
const u = !C && !N(k, s);
|
|
152
|
-
return C || u ? b() : null;
|
|
153
|
-
}, [a, C, s, k, b]);
|
|
154
|
-
return I !== null ? I : h;
|
|
155
|
-
}
|
|
156
|
-
function me(e) {
|
|
157
|
-
const o = T(), { name: t, disabled: s, control: r = o, shouldUnregister: a, defaultValue: i, exact: l = !0 } = e, c = ae(r._names.array, t), f = n.useMemo(() => y(r._formValues, t, y(r._defaultValues, t, i)), [r, t, i]), p = de({
|
|
158
|
-
control: r,
|
|
159
|
-
name: t,
|
|
160
|
-
defaultValue: f,
|
|
161
|
-
exact: l
|
|
162
|
-
}), d = Y({
|
|
163
|
-
control: r,
|
|
164
|
-
name: t,
|
|
165
|
-
exact: l
|
|
166
|
-
}), g = n.useRef(e), h = n.useRef(void 0), F = n.useRef(r.register(t, {
|
|
167
|
-
...e.rules,
|
|
168
|
-
value: p,
|
|
169
|
-
...M(e.disabled) ? { disabled: e.disabled } : {}
|
|
170
|
-
}));
|
|
171
|
-
g.current = e;
|
|
172
|
-
const b = n.useMemo(() => Object.defineProperties({}, {
|
|
173
|
-
invalid: {
|
|
174
|
-
enumerable: !0,
|
|
175
|
-
get: () => !!y(d.errors, t)
|
|
176
|
-
},
|
|
177
|
-
isDirty: {
|
|
178
|
-
enumerable: !0,
|
|
179
|
-
get: () => !!y(d.dirtyFields, t)
|
|
180
|
-
},
|
|
181
|
-
isTouched: {
|
|
182
|
-
enumerable: !0,
|
|
183
|
-
get: () => !!y(d.touchedFields, t)
|
|
184
|
-
},
|
|
185
|
-
isValidating: {
|
|
186
|
-
enumerable: !0,
|
|
187
|
-
get: () => !!y(d.validatingFields, t)
|
|
188
|
-
},
|
|
189
|
-
error: {
|
|
190
|
-
enumerable: !0,
|
|
191
|
-
get: () => y(d.errors, t)
|
|
192
|
-
}
|
|
193
|
-
}), [d, t]), _ = n.useCallback((u) => F.current.onChange({
|
|
194
|
-
target: {
|
|
195
|
-
value: se(u),
|
|
196
|
-
name: t
|
|
197
|
-
},
|
|
198
|
-
type: H.CHANGE
|
|
199
|
-
}), [t]), C = n.useCallback(() => F.current.onBlur({
|
|
200
|
-
target: {
|
|
201
|
-
value: y(r._formValues, t),
|
|
202
|
-
name: t
|
|
203
|
-
},
|
|
204
|
-
type: H.BLUR
|
|
205
|
-
}), [t, r._formValues]), k = n.useCallback((u) => {
|
|
206
|
-
const m = y(r._fields, t);
|
|
207
|
-
m && m._f && u && (m._f.ref = {
|
|
208
|
-
focus: () => E(u.focus) && u.focus(),
|
|
209
|
-
select: () => E(u.select) && u.select(),
|
|
210
|
-
setCustomValidity: (V) => E(u.setCustomValidity) && u.setCustomValidity(V),
|
|
211
|
-
reportValidity: () => E(u.reportValidity) && u.reportValidity()
|
|
212
|
-
});
|
|
213
|
-
}, [r._fields, t]), I = n.useMemo(() => ({
|
|
214
|
-
name: t,
|
|
215
|
-
value: p,
|
|
216
|
-
...M(s) || d.disabled ? { disabled: d.disabled || s } : {},
|
|
217
|
-
onChange: _,
|
|
218
|
-
onBlur: C,
|
|
219
|
-
ref: k
|
|
220
|
-
}), [t, s, d.disabled, _, C, k, p]);
|
|
221
|
-
return n.useEffect(() => {
|
|
222
|
-
const u = r._options.shouldUnregister || a, m = h.current;
|
|
223
|
-
m && m !== t && !c && r.unregister(m), r.register(t, {
|
|
224
|
-
...g.current.rules,
|
|
225
|
-
...M(g.current.disabled) ? { disabled: g.current.disabled } : {}
|
|
226
|
-
});
|
|
227
|
-
const V = (A, ee) => {
|
|
228
|
-
const R = y(r._fields, A);
|
|
229
|
-
R && R._f && (R._f.mount = ee);
|
|
230
|
-
};
|
|
231
|
-
if (V(t, !0), u) {
|
|
232
|
-
const A = z(y(r._options.defaultValues, t, g.current.defaultValue));
|
|
233
|
-
$(r._defaultValues, t, A), D(y(r._formValues, t)) && $(r._formValues, t, A);
|
|
234
|
-
}
|
|
235
|
-
return !c && r.register(t), h.current = t, () => {
|
|
236
|
-
(c ? u && !r._state.action : u) ? r.unregister(t) : V(t, !1);
|
|
237
|
-
};
|
|
238
|
-
}, [t, r, c, a]), n.useEffect(() => {
|
|
239
|
-
r._setDisabledField({
|
|
240
|
-
disabled: s,
|
|
241
|
-
name: t
|
|
242
|
-
});
|
|
243
|
-
}, [s, t, r]), n.useMemo(() => ({
|
|
244
|
-
field: I,
|
|
245
|
-
formState: d,
|
|
246
|
-
fieldState: b
|
|
247
|
-
}), [I, d, b]);
|
|
248
|
-
}
|
|
249
|
-
const ye = (e) => e.render(me(e)), U = n.createContext(null);
|
|
250
|
-
U.displayName = "HookFormContext";
|
|
251
|
-
const ge = () => n.useContext(U), pe = (e) => {
|
|
252
|
-
const { children: o, watch: t, getValues: s, getFieldState: r, setError: a, clearErrors: i, setValue: l, trigger: c, formState: f, resetField: p, reset: d, handleSubmit: g, unregister: h, control: F, register: b, setFocus: _, subscribe: C } = e;
|
|
253
|
-
return n.createElement(
|
|
254
|
-
U.Provider,
|
|
255
|
-
{ value: n.useMemo(() => ({
|
|
256
|
-
watch: t,
|
|
257
|
-
getValues: s,
|
|
258
|
-
getFieldState: r,
|
|
259
|
-
setError: a,
|
|
260
|
-
clearErrors: i,
|
|
261
|
-
setValue: l,
|
|
262
|
-
trigger: c,
|
|
263
|
-
formState: f,
|
|
264
|
-
resetField: p,
|
|
265
|
-
reset: d,
|
|
266
|
-
handleSubmit: g,
|
|
267
|
-
unregister: h,
|
|
268
|
-
control: F,
|
|
269
|
-
register: b,
|
|
270
|
-
setFocus: _,
|
|
271
|
-
subscribe: C
|
|
272
|
-
}), [
|
|
273
|
-
i,
|
|
274
|
-
F,
|
|
275
|
-
f,
|
|
276
|
-
r,
|
|
277
|
-
s,
|
|
278
|
-
g,
|
|
279
|
-
b,
|
|
280
|
-
d,
|
|
281
|
-
p,
|
|
282
|
-
a,
|
|
283
|
-
_,
|
|
284
|
-
l,
|
|
285
|
-
C,
|
|
286
|
-
c,
|
|
287
|
-
h,
|
|
288
|
-
t
|
|
289
|
-
]) },
|
|
290
|
-
n.createElement(B.Provider, { value: F }, o)
|
|
291
|
-
);
|
|
292
|
-
}, he = pe, Z = S.createContext(
|
|
293
|
-
{}
|
|
294
|
-
), xe = ({
|
|
295
|
-
...e
|
|
296
|
-
}) => /* @__PURE__ */ v(Z.Provider, { value: { name: e.name }, children: /* @__PURE__ */ v(ye, { ...e }) }), w = () => {
|
|
297
|
-
const e = S.useContext(Z), o = S.useContext(j), { getFieldState: t } = ge(), s = Y({ name: e.name }), r = t(e.name, s);
|
|
298
|
-
if (!e)
|
|
299
|
-
throw new Error("useFormField should be used within <FormField>");
|
|
300
|
-
const { id: a } = o;
|
|
301
|
-
return {
|
|
302
|
-
id: a,
|
|
303
|
-
name: e.name,
|
|
304
|
-
formItemId: `${a}-form-item`,
|
|
305
|
-
formDescriptionId: `${a}-form-item-description`,
|
|
306
|
-
formMessageId: `${a}-form-item-message`,
|
|
307
|
-
...r
|
|
308
|
-
};
|
|
309
|
-
}, j = S.createContext(
|
|
310
|
-
{}
|
|
311
|
-
);
|
|
312
|
-
function ke({ className: e, ...o }) {
|
|
313
|
-
const t = S.useId();
|
|
314
|
-
return /* @__PURE__ */ v(j.Provider, { value: { id: t }, children: /* @__PURE__ */ v(
|
|
315
|
-
"div",
|
|
316
|
-
{
|
|
317
|
-
"data-slot": "form-item",
|
|
318
|
-
className: P("grid gap-2", e),
|
|
319
|
-
...o
|
|
320
|
-
}
|
|
321
|
-
) });
|
|
322
|
-
}
|
|
323
|
-
function Ie({
|
|
324
|
-
className: e,
|
|
325
|
-
...o
|
|
326
|
-
}) {
|
|
327
|
-
const { error: t, formItemId: s } = w();
|
|
328
|
-
return /* @__PURE__ */ v(
|
|
329
|
-
re,
|
|
330
|
-
{
|
|
331
|
-
"data-slot": "form-label",
|
|
332
|
-
"data-error": !!t,
|
|
333
|
-
className: P("data-[error=true]:text-destructive", e),
|
|
334
|
-
htmlFor: s,
|
|
335
|
-
...o
|
|
336
|
-
}
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
function Oe({ ...e }) {
|
|
340
|
-
const { error: o, formItemId: t, formDescriptionId: s, formMessageId: r } = w();
|
|
341
|
-
return /* @__PURE__ */ v(
|
|
342
|
-
te,
|
|
343
|
-
{
|
|
344
|
-
"data-slot": "form-control",
|
|
345
|
-
id: t,
|
|
346
|
-
"aria-describedby": o ? `${s} ${r}` : `${s}`,
|
|
347
|
-
"aria-invalid": !!o,
|
|
348
|
-
...e
|
|
349
|
-
}
|
|
350
|
-
);
|
|
351
|
-
}
|
|
352
|
-
function Se({ className: e, ...o }) {
|
|
353
|
-
const { formDescriptionId: t } = w();
|
|
354
|
-
return /* @__PURE__ */ v(
|
|
355
|
-
"p",
|
|
356
|
-
{
|
|
357
|
-
"data-slot": "form-description",
|
|
358
|
-
id: t,
|
|
359
|
-
className: P("text-muted-foreground text-sm", e),
|
|
360
|
-
...o
|
|
361
|
-
}
|
|
362
|
-
);
|
|
363
|
-
}
|
|
364
|
-
function Ae({ className: e, ...o }) {
|
|
365
|
-
const { error: t, formMessageId: s } = w(), r = t ? String(t?.message ?? "") : o.children;
|
|
366
|
-
return r ? /* @__PURE__ */ v(
|
|
367
|
-
"p",
|
|
368
|
-
{
|
|
369
|
-
"data-slot": "form-message",
|
|
370
|
-
id: s,
|
|
371
|
-
className: P("text-destructive text-sm", e),
|
|
372
|
-
...o,
|
|
373
|
-
children: r
|
|
374
|
-
}
|
|
375
|
-
) : null;
|
|
376
|
-
}
|
|
377
|
-
export {
|
|
378
|
-
he as Form,
|
|
379
|
-
Oe as FormControl,
|
|
380
|
-
Se as FormDescription,
|
|
381
|
-
xe as FormField,
|
|
382
|
-
ke as FormItem,
|
|
383
|
-
Ie as FormLabel,
|
|
384
|
-
Ae as FormMessage,
|
|
385
|
-
w as useFormField
|
|
386
|
-
};
|
package/dist/label-CPL77haD.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import * as a from "@radix-ui/react-label";
|
|
4
|
-
import { c as r } from "./utils-eGXXUFl7.js";
|
|
5
|
-
function l({
|
|
6
|
-
className: e,
|
|
7
|
-
...t
|
|
8
|
-
}) {
|
|
9
|
-
return /* @__PURE__ */ o(
|
|
10
|
-
a.Root,
|
|
11
|
-
{
|
|
12
|
-
"data-slot": "label",
|
|
13
|
-
className: r(
|
|
14
|
-
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
15
|
-
e
|
|
16
|
-
),
|
|
17
|
-
...t
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
l as L
|
|
23
|
-
};
|
package/dist/label-tKsAbVfX.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("react/jsx-runtime");require("react");const i=require("@radix-ui/react-label"),o=require("./utils-CikHldDD.cjs");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=l(i);function c({className:e,...t}){return a.jsx(s.Root,{"data-slot":"label",className:o.cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}exports.Label=c;
|