@fairmint/ui 0.2.3 → 0.2.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.
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { TextInputProps } from '../../primitives/TextInput/TextInput';
3
+ /**
4
+ * Zod schema for Ethereum wallet address validation.
5
+ * Trims whitespace, then validates `0x` + 40 hex characters, rejecting the zero address.
6
+ */
7
+ export declare const ethereumAddressSchema: z.ZodEffects<z.ZodString, string, string>;
8
+ export interface EthereumAddressFieldProps extends Omit<TextInputProps, "type"> {
9
+ error?: string;
10
+ }
11
+ /** Ethereum wallet address input with monospace font and Zod-based validation via `ethereumAddressSchema`. */
12
+ export declare function EthereumAddressField({ error, ...rest }: EthereumAddressFieldProps): import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=EthereumAddressField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EthereumAddressField.d.ts","sourceRoot":"","sources":["../../../../src/components/form/EthereumAddressField/EthereumAddressField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAG3E;;;GAGG;AACH,eAAO,MAAM,qBAAqB,2CAU/B,CAAC;AAEJ,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,8GAA8G;AAC9G,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,yBAAyB,2CAcjF"}
@@ -0,0 +1,43 @@
1
+ import { ReactNode } from 'react';
2
+ export interface EditableSectionProps {
3
+ /** Section heading shown in the header row. */
4
+ title?: ReactNode;
5
+ /** Content rendered in read (non-editing) mode. */
6
+ readView: ReactNode;
7
+ /**
8
+ * Called when Save is clicked. Resolve to close edit mode; throw to stay open
9
+ * (e.g. validation failure or API error — handle `notify.error` inside here).
10
+ */
11
+ onSave: () => Promise<void>;
12
+ /** Called when Cancel is clicked, before the edit mode closes. Use to reset form state. */
13
+ onCancel?: () => void;
14
+ /**
15
+ * When true the edit button is hidden and any open edit session is closed.
16
+ * Pass `isViewingAs` to prevent edits during admin impersonation.
17
+ */
18
+ disabled?: boolean;
19
+ /**
20
+ * Called when `onSave` throws. Use for logging or error tracking. The
21
+ * component stays in edit mode regardless — this is purely observational.
22
+ */
23
+ onSaveError?: (error: unknown) => void;
24
+ /**
25
+ * Icon rendered inside the edit `ActionIcon`. When omitted a plain text
26
+ * "Edit" button is shown instead.
27
+ */
28
+ editIcon?: ReactNode;
29
+ /** Save button label. @default "Save" */
30
+ saveLabel?: string;
31
+ /** Cancel button label. @default "Cancel" */
32
+ cancelLabel?: string;
33
+ /** Children rendered in edit mode (form fields, etc.). */
34
+ children: ReactNode;
35
+ }
36
+ /**
37
+ * Wraps a section of the page with a pencil-icon toggle between a read view
38
+ * and an edit view. Manages `isEditing` and `isSaving` state internally so
39
+ * consumers only need to supply `readView`, the edit fields as `children`,
40
+ * and the async `onSave` callback.
41
+ */
42
+ export declare function EditableSection({ title, readView, onSave, onCancel, disabled, onSaveError, editIcon, saveLabel, cancelLabel, children, }: EditableSectionProps): import("react/jsx-runtime").JSX.Element;
43
+ //# sourceMappingURL=EditableSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableSection.d.ts","sourceRoot":"","sources":["../../../../src/components/generic/EditableSection/EditableSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAM5D,MAAM,WAAW,oBAAoB;IACnC,+CAA+C;IAC/C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mDAAmD;IACnD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAgB,EAChB,WAAW,EACX,QAAQ,EACR,SAAkB,EAClB,WAAsB,EACtB,QAAQ,GACT,EAAE,oBAAoB,2CAwFtB"}
@@ -1,3 +1,3 @@
1
- export { Anchor, Box, type BoxProps, Center, Collapse, Container, type ContainerProps, Divider, Flex, Grid, Group, type GroupProps, Paper, ScrollArea, SimpleGrid, Space, Stack, type StackProps, Text, type TextProps, Title, type TitleProps, UnstyledButton, } from '@mantine/core';
1
+ export { Anchor, Box, type BoxProps, Center, Collapse, Container, type ContainerProps, Divider, Flex, Grid, Group, type GroupProps, Paper, ScrollArea, SimpleGrid, Space, Stack, type StackProps, Text, type TextProps, ThemeIcon, type ThemeIconProps, Title, type TitleProps, UnstyledButton, } from '@mantine/core';
2
2
  export { useClickOutside, useClipboard, useDebouncedValue, useDisclosure, useHotkeys, useId, useIntersection, useMediaQuery, useScrollIntoView, useViewportSize, } from '@mantine/hooks';
3
3
  //# sourceMappingURL=layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,GAAG,EACH,KAAK,QAAQ,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,cAAc,EACnB,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,UAAU,EACf,KAAK,EACL,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,UAAU,EACf,IAAI,EACJ,KAAK,SAAS,EACd,KAAK,EACL,KAAK,UAAU,EACf,cAAc,GACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,KAAK,EACL,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,GAAG,EACH,KAAK,QAAQ,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,cAAc,EACnB,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,UAAU,EACf,KAAK,EACL,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,UAAU,EACf,IAAI,EACJ,KAAK,SAAS,EACd,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,EACL,KAAK,UAAU,EACf,cAAc,GACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,KAAK,EACL,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC"}