@pyck/react 0.0.1
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/checkmark-CW-yHMvN.js +18 -0
- package/dist/chunk-BYypO7fO.js +18 -0
- package/dist/close-button-BM7ikbYh.js +52 -0
- package/dist/components/absolute-center/index.d.ts +11 -0
- package/dist/components/absolute-center/index.js +9 -0
- package/dist/components/action-bar/index.d.ts +21 -0
- package/dist/components/action-bar/index.js +35 -0
- package/dist/components/avatar/index.d.ts +22 -0
- package/dist/components/avatar/index.js +53 -0
- package/dist/components/badge/index.d.ts +11 -0
- package/dist/components/badge/index.js +9 -0
- package/dist/components/breadcrumb/index.d.ts +19 -0
- package/dist/components/breadcrumb/index.js +31 -0
- package/dist/components/button/index.d.ts +47 -0
- package/dist/components/button/index.js +3 -0
- package/dist/components/card/index.d.ts +19 -0
- package/dist/components/card/index.js +24 -0
- package/dist/components/carousel/index.d.ts +25 -0
- package/dist/components/carousel/index.js +65 -0
- package/dist/components/checkbox/index.d.ts +35 -0
- package/dist/components/checkbox/index.js +67 -0
- package/dist/components/checkmark/index.d.ts +26 -0
- package/dist/components/checkmark/index.js +3 -0
- package/dist/components/clipboard/index.d.ts +21 -0
- package/dist/components/clipboard/index.js +36 -0
- package/dist/components/collapsible/index.d.ts +18 -0
- package/dist/components/collapsible/index.js +23 -0
- package/dist/components/combobox/index.d.ts +32 -0
- package/dist/components/combobox/index.js +62 -0
- package/dist/components/data-list/index.d.ts +26 -0
- package/dist/components/data-list/index.js +39 -0
- package/dist/components/date-picker/index.d.ts +38 -0
- package/dist/components/date-picker/index.js +81 -0
- package/dist/components/dialog/index.d.ts +107 -0
- package/dist/components/dialog/index.js +295 -0
- package/dist/components/display-date-value/index.d.ts +3 -0
- package/dist/components/display-date-value/index.js +4 -0
- package/dist/components/display-value/index.d.ts +2 -0
- package/dist/components/display-value/index.js +3 -0
- package/dist/components/drawer/index.d.ts +28 -0
- package/dist/components/drawer/index.js +50 -0
- package/dist/components/drilldown-menu/index.d.ts +16 -0
- package/dist/components/drilldown-menu/index.js +123 -0
- package/dist/components/field/index.d.ts +21 -0
- package/dist/components/field/index.js +49 -0
- package/dist/components/fieldset/index.d.ts +23 -0
- package/dist/components/fieldset/index.js +32 -0
- package/dist/components/floating-panel/index.d.ts +23 -0
- package/dist/components/floating-panel/index.js +86 -0
- package/dist/components/for/index.d.ts +20 -0
- package/dist/components/for/index.js +9 -0
- package/dist/components/form/index.d.ts +41 -0
- package/dist/components/form/index.js +46 -0
- package/dist/components/format/index.d.ts +2 -0
- package/dist/components/format/index.js +3 -0
- package/dist/components/group/index.d.ts +11 -0
- package/dist/components/group/index.js +9 -0
- package/dist/components/heading/index.d.ts +12 -0
- package/dist/components/heading/index.js +8 -0
- package/dist/components/highlight/index.d.ts +17 -0
- package/dist/components/highlight/index.js +27 -0
- package/dist/components/icon/index.d.ts +19 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/image/index.d.ts +22 -0
- package/dist/components/image/index.js +12 -0
- package/dist/components/input/index.d.ts +23 -0
- package/dist/components/input/index.js +21 -0
- package/dist/components/input-addon/index.d.ts +11 -0
- package/dist/components/input-addon/index.js +9 -0
- package/dist/components/input-group/index.d.ts +16 -0
- package/dist/components/input-group/index.js +29 -0
- package/dist/components/json-form-builder/index.d.ts +135 -0
- package/dist/components/json-form-builder/index.js +347 -0
- package/dist/components/kbd/index.d.ts +11 -0
- package/dist/components/kbd/index.js +9 -0
- package/dist/components/link/index.d.ts +11 -0
- package/dist/components/link/index.js +9 -0
- package/dist/components/listbox/index.d.ts +2 -0
- package/dist/components/listbox/index.js +3 -0
- package/dist/components/loader/index.d.ts +28 -0
- package/dist/components/loader/index.js +28 -0
- package/dist/components/locale/index.d.ts +2 -0
- package/dist/components/locale/index.js +3 -0
- package/dist/components/logo/index.d.ts +8 -0
- package/dist/components/logo/index.js +25 -0
- package/dist/components/mark/index.d.ts +11 -0
- package/dist/components/mark/index.js +9 -0
- package/dist/components/menu/index.d.ts +34 -0
- package/dist/components/menu/index.js +69 -0
- package/dist/components/number-input/index.d.ts +34 -0
- package/dist/components/number-input/index.js +51 -0
- package/dist/components/page-header/index.d.ts +18 -0
- package/dist/components/page-header/index.js +22 -0
- package/dist/components/pagination/index.d.ts +29 -0
- package/dist/components/pagination/index.js +45 -0
- package/dist/components/picker/index.d.ts +19 -0
- package/dist/components/picker/index.js +57 -0
- package/dist/components/popover/index.d.ts +30 -0
- package/dist/components/popover/index.js +50 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +3 -0
- package/dist/components/progress/index.d.ts +19 -0
- package/dist/components/progress/index.js +47 -0
- package/dist/components/progress-circle/index.d.ts +19 -0
- package/dist/components/progress-circle/index.js +54 -0
- package/dist/components/radio-card-group/index.d.ts +21 -0
- package/dist/components/radio-card-group/index.js +29 -0
- package/dist/components/radio-group/index.d.ts +22 -0
- package/dist/components/radio-group/index.js +41 -0
- package/dist/components/scroll-area/index.d.ts +23 -0
- package/dist/components/scroll-area/index.js +41 -0
- package/dist/components/segment-group/index.d.ts +32 -0
- package/dist/components/segment-group/index.js +46 -0
- package/dist/components/select/index.d.ts +54 -0
- package/dist/components/select/index.js +93 -0
- package/dist/components/show/index.d.ts +11 -0
- package/dist/components/show/index.js +3 -0
- package/dist/components/skeleton/index.d.ts +23 -0
- package/dist/components/skeleton/index.js +17 -0
- package/dist/components/slider/index.d.ts +31 -0
- package/dist/components/slider/index.js +93 -0
- package/dist/components/span/index.d.ts +8 -0
- package/dist/components/span/index.js +3 -0
- package/dist/components/spinner/index.d.ts +11 -0
- package/dist/components/spinner/index.js +9 -0
- package/dist/components/spotlight/index.d.ts +28 -0
- package/dist/components/spotlight/index.js +165 -0
- package/dist/components/stat/index.d.ts +16 -0
- package/dist/components/stat/index.js +18 -0
- package/dist/components/steps/index.d.ts +36 -0
- package/dist/components/steps/index.js +61 -0
- package/dist/components/switch/index.d.ts +41 -0
- package/dist/components/switch/index.js +80 -0
- package/dist/components/table/index.d.ts +85 -0
- package/dist/components/table/index.js +144 -0
- package/dist/components/tabs/index.d.ts +18 -0
- package/dist/components/tabs/index.js +22 -0
- package/dist/components/tags-input/index.d.ts +29 -0
- package/dist/components/tags-input/index.js +48 -0
- package/dist/components/text/index.d.ts +12 -0
- package/dist/components/text/index.js +8 -0
- package/dist/components/textarea/index.d.ts +24 -0
- package/dist/components/textarea/index.js +22 -0
- package/dist/components/toast/index.d.ts +25 -0
- package/dist/components/toast/index.js +76 -0
- package/dist/components/toggle-group/index.d.ts +16 -0
- package/dist/components/toggle-group/index.js +19 -0
- package/dist/components/tooltip/index.d.ts +26 -0
- package/dist/components/tooltip/index.js +50 -0
- package/dist/components/tree-view/index.d.ts +37 -0
- package/dist/components/tree-view/index.js +63 -0
- package/dist/components/wrap/index.d.ts +15 -0
- package/dist/components/wrap/index.js +5 -0
- package/dist/display-date-value-CdfgVuB7.d.ts +15 -0
- package/dist/display-date-value-gTlidtNz.js +21 -0
- package/dist/display-value-BNKxQ99u.js +37 -0
- package/dist/display-value-IyQT1429.d.ts +11 -0
- package/dist/featured-icon-DPysOpSf.js +35 -0
- package/dist/function-DOGwA2sm.js +7 -0
- package/dist/show-IaI-36v9.js +12 -0
- package/dist/span-DWZSA3mH.js +7 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.js +0 -0
- package/dist/utils/index.d.ts +206 -0
- package/dist/utils/index.js +377 -0
- package/package.json +89 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps, PropsWithChildren } from "react";
|
|
3
|
+
import * as _pyck_styled_system_jsx0 from "@pyck/styled-system/jsx";
|
|
4
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
5
|
+
import { FloatingPanel } from "@ark-ui/react/floating-panel";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/floating-panel/floating-panel.d.ts
|
|
9
|
+
declare namespace floating_panel_d_exports {
|
|
10
|
+
export { Body, Content, Controls, Header, Positioner, ResizeTriggers, Root, RootProps, RootProvider, Trigger };
|
|
11
|
+
}
|
|
12
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
13
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextRootProvider<(props: FloatingPanel.RootProps) => react_jsx_runtime0.JSX.Element, _pyck_styled_system_recipes0.FloatingPanelRecipe>;
|
|
14
|
+
declare const RootProvider: _pyck_styled_system_jsx0.StyleContextRootProvider<(props: FloatingPanel.RootProviderProps) => react_jsx_runtime0.JSX.Element, _pyck_styled_system_recipes0.FloatingPanelRecipe>;
|
|
15
|
+
declare const Trigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<FloatingPanel.TriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
16
|
+
declare const Positioner: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<FloatingPanel.PositionerProps & react.RefAttributes<HTMLDivElement>>>;
|
|
17
|
+
declare const Content: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<FloatingPanel.ContentProps & react.RefAttributes<HTMLDivElement>>>;
|
|
18
|
+
declare const Body: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<FloatingPanel.BodyProps & react.RefAttributes<HTMLDivElement>>>;
|
|
19
|
+
declare const Header: (props: PropsWithChildren) => react_jsx_runtime0.JSX.Element;
|
|
20
|
+
declare const Controls: () => react_jsx_runtime0.JSX.Element;
|
|
21
|
+
declare const ResizeTriggers: () => react_jsx_runtime0.JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { floating_panel_d_exports as FloatingPanel };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { floatingPanel } from "@pyck/styled-system/recipes";
|
|
4
|
+
import { ArrowDownLeft, GripVertical, Maximize, Minus, XIcon } from "lucide-react";
|
|
5
|
+
import { ButtonGroup, IconButton } from "@pyck/react/button";
|
|
6
|
+
import { FloatingPanel } from "@ark-ui/react/floating-panel";
|
|
7
|
+
|
|
8
|
+
//#region src/components/floating-panel/floating-panel.tsx
|
|
9
|
+
var floating_panel_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Body: () => Body,
|
|
11
|
+
Content: () => Content,
|
|
12
|
+
Controls: () => Controls,
|
|
13
|
+
Header: () => Header,
|
|
14
|
+
Positioner: () => Positioner,
|
|
15
|
+
ResizeTriggers: () => ResizeTriggers,
|
|
16
|
+
Root: () => Root,
|
|
17
|
+
RootProvider: () => RootProvider,
|
|
18
|
+
Trigger: () => Trigger
|
|
19
|
+
});
|
|
20
|
+
const { withRootProvider, withContext } = createStyleContext(floatingPanel);
|
|
21
|
+
const Root = withRootProvider(FloatingPanel.Root);
|
|
22
|
+
const RootProvider = withRootProvider(FloatingPanel.RootProvider);
|
|
23
|
+
const Trigger = withContext(FloatingPanel.Trigger, "trigger");
|
|
24
|
+
const Positioner = withContext(FloatingPanel.Positioner, "positioner");
|
|
25
|
+
const Content = withContext(FloatingPanel.Content, "content");
|
|
26
|
+
const Body = withContext(FloatingPanel.Body, "body");
|
|
27
|
+
const CloseTrigger = withContext(FloatingPanel.CloseTrigger, "closeTrigger");
|
|
28
|
+
const Control = withContext(FloatingPanel.Control, "control");
|
|
29
|
+
const DragTrigger = withContext(FloatingPanel.DragTrigger, "dragTrigger");
|
|
30
|
+
const ResizeTrigger = withContext(FloatingPanel.ResizeTrigger, "resizeTrigger");
|
|
31
|
+
const StageTrigger = withContext(FloatingPanel.StageTrigger, "stageTrigger");
|
|
32
|
+
const StyledHeader = withContext(FloatingPanel.Header, "header");
|
|
33
|
+
const Title = withContext(FloatingPanel.Title, "title");
|
|
34
|
+
const Header = (props) => {
|
|
35
|
+
const { children } = props;
|
|
36
|
+
return <DragTrigger>
|
|
37
|
+
<StyledHeader>
|
|
38
|
+
<Title>
|
|
39
|
+
<GripVertical />
|
|
40
|
+
{children}
|
|
41
|
+
</Title>
|
|
42
|
+
<Controls />
|
|
43
|
+
</StyledHeader>
|
|
44
|
+
</DragTrigger>;
|
|
45
|
+
};
|
|
46
|
+
const Controls = () => {
|
|
47
|
+
return <Control asChild>
|
|
48
|
+
<ButtonGroup variant="plain" size="2xs">
|
|
49
|
+
<StageTrigger stage="minimized" asChild>
|
|
50
|
+
<IconButton>
|
|
51
|
+
<Minus />
|
|
52
|
+
</IconButton>
|
|
53
|
+
</StageTrigger>
|
|
54
|
+
<StageTrigger stage="maximized" asChild>
|
|
55
|
+
<IconButton>
|
|
56
|
+
<Maximize />
|
|
57
|
+
</IconButton>
|
|
58
|
+
</StageTrigger>
|
|
59
|
+
<StageTrigger stage="default" asChild>
|
|
60
|
+
<IconButton>
|
|
61
|
+
<ArrowDownLeft />
|
|
62
|
+
</IconButton>
|
|
63
|
+
</StageTrigger>
|
|
64
|
+
<CloseTrigger asChild>
|
|
65
|
+
<IconButton>
|
|
66
|
+
<XIcon />
|
|
67
|
+
</IconButton>
|
|
68
|
+
</CloseTrigger>
|
|
69
|
+
</ButtonGroup>
|
|
70
|
+
</Control>;
|
|
71
|
+
};
|
|
72
|
+
const ResizeTriggers = () => {
|
|
73
|
+
return <>
|
|
74
|
+
<ResizeTrigger axis="n" />
|
|
75
|
+
<ResizeTrigger axis="e" />
|
|
76
|
+
<ResizeTrigger axis="w" />
|
|
77
|
+
<ResizeTrigger axis="s" />
|
|
78
|
+
<ResizeTrigger axis="ne" />
|
|
79
|
+
<ResizeTrigger axis="se" />
|
|
80
|
+
<ResizeTrigger axis="sw" />
|
|
81
|
+
<ResizeTrigger axis="nw" />
|
|
82
|
+
</>;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { floating_panel_exports as FloatingPanel };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/for/for.d.ts
|
|
4
|
+
interface ForProps<T> {
|
|
5
|
+
/**
|
|
6
|
+
* The array to iterate over
|
|
7
|
+
*/
|
|
8
|
+
each: T[] | readonly T[] | undefined | null;
|
|
9
|
+
/**
|
|
10
|
+
* The fallback content to render when the array is empty or undefined
|
|
11
|
+
*/
|
|
12
|
+
fallback?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The render function to render each item in the array
|
|
15
|
+
*/
|
|
16
|
+
children: (item: T, index: number) => ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare function For<T>(props: ForProps<T>): ReactNode;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { For, type ForProps };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
4
|
+
import { FieldValues, UseFormReturn } from "react-hook-form";
|
|
5
|
+
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
6
|
+
import * as _pyck_styled_system_types0 from "@pyck/styled-system/types";
|
|
7
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/components/form/form.d.ts
|
|
10
|
+
type StyledFormProps = ComponentProps<typeof StyledForm>;
|
|
11
|
+
declare const StyledForm: _pyck_styled_system_types0.StyledComponent<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLFormElement> & react.FormHTMLAttributes<HTMLFormElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.FormVariantProps>;
|
|
12
|
+
interface FormProps<T extends FieldValues> extends StyledFormProps {
|
|
13
|
+
value: UseFormReturn<T>;
|
|
14
|
+
}
|
|
15
|
+
declare const Form: <T extends FieldValues>(props: FormProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/form/form-section.d.ts
|
|
18
|
+
type FormSectionProps<T extends FieldValues> = {
|
|
19
|
+
id: string;
|
|
20
|
+
value: UseFormReturn<T>;
|
|
21
|
+
onSubmit: () => void;
|
|
22
|
+
error: string | null;
|
|
23
|
+
legend: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
loading: boolean;
|
|
27
|
+
busy: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare const FormSection: <T extends FieldValues>({
|
|
30
|
+
id,
|
|
31
|
+
value,
|
|
32
|
+
onSubmit,
|
|
33
|
+
error,
|
|
34
|
+
legend,
|
|
35
|
+
description,
|
|
36
|
+
children,
|
|
37
|
+
loading,
|
|
38
|
+
busy
|
|
39
|
+
}: FormSectionProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Form, type FormProps, FormSection };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ark } from "@ark-ui/react/factory";
|
|
2
|
+
import { Box, styled } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { form } from "@pyck/styled-system/recipes";
|
|
4
|
+
import { FormProvider } from "react-hook-form";
|
|
5
|
+
import { Show } from "@pyck/react/show";
|
|
6
|
+
import { Button } from "@pyck/react/button";
|
|
7
|
+
import { Form as Form$1 } from "@pyck/react/form";
|
|
8
|
+
import { Fieldset } from "@pyck/react/fieldset";
|
|
9
|
+
|
|
10
|
+
//#region src/components/form/form.tsx
|
|
11
|
+
const StyledForm = styled(ark.form, form);
|
|
12
|
+
const Form = (props) => {
|
|
13
|
+
const { value, ...formProps } = props;
|
|
14
|
+
return <FormProvider {...value}>
|
|
15
|
+
<StyledForm {...formProps} />
|
|
16
|
+
</FormProvider>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/components/form/form-section.tsx
|
|
21
|
+
const FormSection = ({ id, value, onSubmit, error, legend, description, children, loading, busy }) => {
|
|
22
|
+
return <Box id={id}>
|
|
23
|
+
<Form$1 value={value} onSubmit={value.handleSubmit(onSubmit)}>
|
|
24
|
+
<Fieldset.Root invalid={!!error}>
|
|
25
|
+
<Fieldset.Header>
|
|
26
|
+
<Fieldset.Legend>{legend}</Fieldset.Legend>
|
|
27
|
+
<Show when={description}>
|
|
28
|
+
<Fieldset.Description>{description}</Fieldset.Description>
|
|
29
|
+
</Show>
|
|
30
|
+
</Fieldset.Header>
|
|
31
|
+
|
|
32
|
+
<Fieldset.Body>{children}</Fieldset.Body>
|
|
33
|
+
|
|
34
|
+
<Fieldset.Footer>
|
|
35
|
+
{error && <Fieldset.ErrorText>{error}</Fieldset.ErrorText>}
|
|
36
|
+
<Button type="submit" loading={loading} disabled={busy} size="sm">
|
|
37
|
+
Save
|
|
38
|
+
</Button>
|
|
39
|
+
</Fieldset.Footer>
|
|
40
|
+
</Fieldset.Root>
|
|
41
|
+
</Form$1>
|
|
42
|
+
</Box>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Form, FormSection };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
4
|
+
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
5
|
+
import * as _pyck_styled_system_types0 from "@pyck/styled-system/types";
|
|
6
|
+
|
|
7
|
+
//#region src/components/group/group.d.ts
|
|
8
|
+
type GroupProps = ComponentProps<typeof Group>;
|
|
9
|
+
declare const Group: _pyck_styled_system_types0.StyledComponent<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.GroupVariantProps>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Group, type GroupProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ark } from "@ark-ui/react/factory";
|
|
2
|
+
import { styled } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { group } from "@pyck/styled-system/recipes";
|
|
4
|
+
|
|
5
|
+
//#region src/components/group/group.tsx
|
|
6
|
+
const Group = styled(ark.div, group);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Group };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentProps, ElementType } from "react";
|
|
2
|
+
import { HeadingVariantProps } from "@pyck/styled-system/recipes";
|
|
3
|
+
import { StyledComponent } from "@pyck/styled-system/types";
|
|
4
|
+
|
|
5
|
+
//#region src/components/heading/heading.d.ts
|
|
6
|
+
type Props = HeadingVariantProps & {
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
};
|
|
9
|
+
type HeadingProps = ComponentProps<typeof Heading>;
|
|
10
|
+
declare const Heading: StyledComponent<"h2", Props>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Heading, type HeadingProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MarkProps } from "@pyck/react/mark";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/highlight/highlight.d.ts
|
|
5
|
+
interface HighlightProps extends MarkProps {
|
|
6
|
+
query: string | string[];
|
|
7
|
+
children: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to ignore case when matching the query.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
ignoreCase?: boolean | undefined;
|
|
13
|
+
matchAll?: boolean | undefined;
|
|
14
|
+
}
|
|
15
|
+
declare const Highlight: (props: HighlightProps) => react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Highlight, type HighlightProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Fragment } from "react";
|
|
2
|
+
import { Show } from "@pyck/react/show";
|
|
3
|
+
import { useHighlight } from "@ark-ui/react/highlight";
|
|
4
|
+
import { For } from "@pyck/react/for";
|
|
5
|
+
import { Mark } from "@pyck/react/mark";
|
|
6
|
+
|
|
7
|
+
//#region src/components/highlight/highlight.tsx
|
|
8
|
+
const Highlight = (props) => {
|
|
9
|
+
const { children, query, ignoreCase = true, matchAll, ...markProps } = props;
|
|
10
|
+
if (typeof children !== "string") throw new Error("The children prop of Highlight must be a string");
|
|
11
|
+
const chunks = useHighlight({
|
|
12
|
+
query,
|
|
13
|
+
text: children,
|
|
14
|
+
matchAll,
|
|
15
|
+
ignoreCase
|
|
16
|
+
});
|
|
17
|
+
return <For each={chunks}>
|
|
18
|
+
{(chunk, index) => <Show key={index} when={chunk.match} fallback={<Fragment key={index}>{chunk.text}</Fragment>}>
|
|
19
|
+
<Mark key={index} {...markProps}>
|
|
20
|
+
{chunk.text}
|
|
21
|
+
</Mark>
|
|
22
|
+
</Show>}
|
|
23
|
+
</For>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Highlight };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
4
|
+
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
5
|
+
import * as _pyck_styled_system_types0 from "@pyck/styled-system/types";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/icon/featured-icon.d.ts
|
|
9
|
+
type FeaturedIconProps = ComponentProps<typeof IconWrapper>;
|
|
10
|
+
declare const IconWrapper: _pyck_styled_system_types0.StyledComponent<"div", {
|
|
11
|
+
variant?: "embedded" | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
declare const FeaturedIcon: (props: FeaturedIconProps) => react_jsx_runtime0.JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/icon/icon.d.ts
|
|
16
|
+
type IconProps = ComponentProps<typeof Icon>;
|
|
17
|
+
declare const Icon: _pyck_styled_system_types0.StyledComponent<react.ForwardRefExoticComponent<react.SVGProps<SVGSVGElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.IconVariantProps>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { FeaturedIcon, Icon, type IconProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { HTMLStyledProps, SystemStyleObject } from "@pyck/styled-system/types";
|
|
3
|
+
|
|
4
|
+
//#region src/components/image/image.d.ts
|
|
5
|
+
interface ImageOptions {
|
|
6
|
+
/**
|
|
7
|
+
* How the image to fit within its bounds.
|
|
8
|
+
* It maps to css `object-fit` property.
|
|
9
|
+
* @type SystemStyleObject["objectFit"]
|
|
10
|
+
*/
|
|
11
|
+
fit?: SystemStyleObject['objectFit'] | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* How to align the image within its bounds.
|
|
14
|
+
* It maps to css `object-position` property.
|
|
15
|
+
* @type SystemStyleObject["objectPosition"]
|
|
16
|
+
*/
|
|
17
|
+
align?: SystemStyleObject['objectPosition'] | undefined;
|
|
18
|
+
}
|
|
19
|
+
interface ImageProps extends HTMLStyledProps<'img'>, ImageOptions {}
|
|
20
|
+
declare const Image: react.ForwardRefExoticComponent<Omit<ImageProps, "ref"> & react.RefAttributes<HTMLImageElement>>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Image, type ImageProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { styled } from "@pyck/styled-system/jsx";
|
|
3
|
+
|
|
4
|
+
//#region src/components/image/image.tsx
|
|
5
|
+
const StyledImage = styled("img");
|
|
6
|
+
const Image = forwardRef(function Image(props, ref) {
|
|
7
|
+
const { align, fit = "cover", ...rest } = props;
|
|
8
|
+
return <StyledImage ref={ref} objectFit={fit} objectPosition={align} {...rest} />;
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Image };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
4
|
+
import { FieldProps } from "@pyck/react/field";
|
|
5
|
+
import { FieldPath, FieldValues } from "react-hook-form";
|
|
6
|
+
import { Field as Field$1 } from "@ark-ui/react/field";
|
|
7
|
+
import * as _pyck_styled_system_types0 from "@pyck/styled-system/types";
|
|
8
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
//#region src/components/input/input.d.ts
|
|
11
|
+
type InputProps = ComponentProps<typeof Input>;
|
|
12
|
+
declare const Input: _pyck_styled_system_types0.StyledComponent<react.ForwardRefExoticComponent<Field$1.InputProps & react.RefAttributes<HTMLInputElement>>, _pyck_styled_system_recipes0.InputVariantProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/input/input.field.d.ts
|
|
15
|
+
interface InputFieldProps<T extends FieldValues = FieldValues> extends InputProps {
|
|
16
|
+
name: FieldPath<T>;
|
|
17
|
+
label: FieldProps['label'];
|
|
18
|
+
helperText?: FieldProps['helperText'];
|
|
19
|
+
hideLabel?: FieldProps['hideLabel'];
|
|
20
|
+
}
|
|
21
|
+
declare const InputField: <T extends FieldValues>(props: InputFieldProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Input, InputField, type InputFieldProps, type InputProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { styled } from "@pyck/styled-system/jsx";
|
|
2
|
+
import { input } from "@pyck/styled-system/recipes";
|
|
3
|
+
import { Field } from "@pyck/react/field";
|
|
4
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
5
|
+
import { Field as Field$1 } from "@ark-ui/react/field";
|
|
6
|
+
|
|
7
|
+
//#region src/components/input/input.tsx
|
|
8
|
+
const Input = styled(Field$1.Input, input);
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/input/input.field.tsx
|
|
12
|
+
const InputField = (props) => {
|
|
13
|
+
const { name, label, hideLabel, helperText, disabled, ...inputProps } = props;
|
|
14
|
+
const { control } = useFormContext();
|
|
15
|
+
return <Controller name={name} control={control} render={({ field, fieldState }) => <Field label={label} helperText={helperText} hideLabel={hideLabel} disabled={field.disabled || disabled} required={inputProps.required} invalid={!!fieldState.error} errorText={fieldState.error?.message}>
|
|
16
|
+
<Input {...inputProps} name={field.name} value={field.value} onChange={field.onChange} onBlur={field.onBlur} />
|
|
17
|
+
</Field>} />;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Input, InputField };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
4
|
+
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
5
|
+
import * as _pyck_styled_system_types0 from "@pyck/styled-system/types";
|
|
6
|
+
|
|
7
|
+
//#region src/components/input-addon/input-addon.d.ts
|
|
8
|
+
type InputAddonProps = ComponentProps<typeof InputAddon>;
|
|
9
|
+
declare const InputAddon: _pyck_styled_system_types0.StyledComponent<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.InputAddonVariantProps>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { InputAddon, type InputAddonProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ark } from "@ark-ui/react/factory";
|
|
2
|
+
import { styled } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { inputAddon } from "@pyck/styled-system/recipes";
|
|
4
|
+
|
|
5
|
+
//#region src/components/input-addon/input-addon.tsx
|
|
6
|
+
const InputAddon = styled(ark.div, inputAddon);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { InputAddon };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import * as _pyck_styled_system_jsx0 from "@pyck/styled-system/jsx";
|
|
4
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
5
|
+
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/input-group/input-group.d.ts
|
|
8
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
9
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.InputGroupRecipe>;
|
|
10
|
+
interface InputGroupProps extends RootProps {
|
|
11
|
+
startElement?: ReactNode | undefined;
|
|
12
|
+
endElement?: ReactNode | undefined;
|
|
13
|
+
}
|
|
14
|
+
declare const InputGroup: react.ForwardRefExoticComponent<Omit<InputGroupProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { InputGroup, type InputGroupProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { ark } from "@ark-ui/react/factory";
|
|
3
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { inputGroup } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { Show } from "@pyck/react/show";
|
|
6
|
+
|
|
7
|
+
//#region src/components/input-group/input-group.tsx
|
|
8
|
+
const { withProvider, withContext } = createStyleContext(inputGroup);
|
|
9
|
+
const Root = withProvider(ark.div, "root");
|
|
10
|
+
const Element = withContext(ark.div, "element");
|
|
11
|
+
const InputGroup = forwardRef(function InputGroup(props, ref) {
|
|
12
|
+
const { startElement, endElement, children, ...rest } = props;
|
|
13
|
+
return <Root ref={ref} {...rest}>
|
|
14
|
+
<Show when={startElement}>
|
|
15
|
+
<Element insetInlineStart="0" top="0">
|
|
16
|
+
{startElement}
|
|
17
|
+
</Element>
|
|
18
|
+
</Show>
|
|
19
|
+
{children}
|
|
20
|
+
<Show when={endElement}>
|
|
21
|
+
<Element insetInlineEnd="0" top="0">
|
|
22
|
+
{endElement}
|
|
23
|
+
</Element>
|
|
24
|
+
</Show>
|
|
25
|
+
</Root>;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { InputGroup };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { ZodTypeAny, z } from "zod";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { FieldValues, UseFormReturn } from "react-hook-form";
|
|
4
|
+
import { CollectionItem } from "@ark-ui/react";
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/json-form-builder/types.d.ts
|
|
8
|
+
interface LayoutNode {
|
|
9
|
+
type: 'layout';
|
|
10
|
+
format: 'vertical' | 'horizontal';
|
|
11
|
+
nodes: Node[];
|
|
12
|
+
}
|
|
13
|
+
interface FieldNode {
|
|
14
|
+
type: 'field';
|
|
15
|
+
scope: string;
|
|
16
|
+
}
|
|
17
|
+
type Node = LayoutNode | FieldNode;
|
|
18
|
+
interface FormBuilderSchema {
|
|
19
|
+
type?: 'object';
|
|
20
|
+
properties: Record<string, FormBuilderFormProperty>;
|
|
21
|
+
required?: string[];
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
type FormBuilderFormProperty = FormBuilderStringProperty | FormBuilderNumberProperty | FormBuilderBooleanProperty | FormBuilderArrayProperty | FormBuilderObjectProperty;
|
|
25
|
+
interface FormBuilderStringProperty {
|
|
26
|
+
type: 'string';
|
|
27
|
+
title?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
minLength?: number;
|
|
30
|
+
maxLength?: number;
|
|
31
|
+
format?: 'email' | 'date';
|
|
32
|
+
enum?: readonly string[];
|
|
33
|
+
oneOf?: Array<{
|
|
34
|
+
const: string;
|
|
35
|
+
}>;
|
|
36
|
+
nullable?: boolean;
|
|
37
|
+
}
|
|
38
|
+
interface FormBuilderNumberProperty {
|
|
39
|
+
type: 'number' | 'integer';
|
|
40
|
+
title?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
minimum?: number;
|
|
43
|
+
maximum?: number;
|
|
44
|
+
nullable?: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface FormBuilderBooleanProperty {
|
|
47
|
+
type: 'boolean';
|
|
48
|
+
title?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
nullable?: boolean;
|
|
51
|
+
}
|
|
52
|
+
interface FormBuilderArrayProperty {
|
|
53
|
+
type: 'array';
|
|
54
|
+
title?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
items: {
|
|
57
|
+
type: 'string' | 'number' | 'boolean';
|
|
58
|
+
enum?: readonly string[];
|
|
59
|
+
};
|
|
60
|
+
uniqueItems?: boolean;
|
|
61
|
+
minItems?: number;
|
|
62
|
+
maxItems?: number;
|
|
63
|
+
nullable?: boolean;
|
|
64
|
+
}
|
|
65
|
+
interface FormBuilderObjectProperty {
|
|
66
|
+
type: 'object';
|
|
67
|
+
title?: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
properties: Record<string, FormBuilderFormProperty>;
|
|
70
|
+
required?: string[];
|
|
71
|
+
nullable?: boolean;
|
|
72
|
+
}
|
|
73
|
+
type SelectItem = CollectionItem & {
|
|
74
|
+
title?: string;
|
|
75
|
+
description?: string;
|
|
76
|
+
value: string;
|
|
77
|
+
label: string;
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/components/json-form-builder/builder.d.ts
|
|
81
|
+
interface Fieldset {
|
|
82
|
+
legend: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
nodes: Node[];
|
|
85
|
+
}
|
|
86
|
+
interface BuilderProps {
|
|
87
|
+
jsonSchema: FormBuilderSchema;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Basic JSON Schema → form generator.
|
|
91
|
+
*
|
|
92
|
+
* <Builder /> renders fields in the order they appear in the schema without layout control.
|
|
93
|
+
* It is intentionally minimal. Use <UiSchemaForm /> if you need structured layouts.
|
|
94
|
+
*/
|
|
95
|
+
declare const Builder: ({
|
|
96
|
+
jsonSchema
|
|
97
|
+
}: BuilderProps) => react_jsx_runtime0.JSX.Element;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/json-form-builder/render-field.d.ts
|
|
100
|
+
declare const renderField: (schema: FormBuilderFormProperty, key: string, options?: {
|
|
101
|
+
required?: boolean;
|
|
102
|
+
}) => react_jsx_runtime0.JSX.Element | null | undefined;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/components/json-form-builder/ui-schema-form.d.ts
|
|
105
|
+
interface UiSchemaFormProps<T extends FieldValues> {
|
|
106
|
+
id: string;
|
|
107
|
+
value: UseFormReturn<T>;
|
|
108
|
+
onSubmit: () => void;
|
|
109
|
+
jsonSchema: FormBuilderSchema;
|
|
110
|
+
uiFieldset: Fieldset;
|
|
111
|
+
form?: UseFormReturn<T>;
|
|
112
|
+
footer: ReactNode;
|
|
113
|
+
error?: string | null;
|
|
114
|
+
}
|
|
115
|
+
declare const UiSchemaForm: <T extends FieldValues>({
|
|
116
|
+
id,
|
|
117
|
+
value,
|
|
118
|
+
onSubmit,
|
|
119
|
+
jsonSchema,
|
|
120
|
+
uiFieldset,
|
|
121
|
+
form: providedForm,
|
|
122
|
+
footer,
|
|
123
|
+
error
|
|
124
|
+
}: UiSchemaFormProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/components/json-form-builder/utils/create-zod-schema.d.ts
|
|
127
|
+
/**
|
|
128
|
+
* Builds a Zod schema from a JSON Schema object.
|
|
129
|
+
* Used for validating Builder and UiSchemaForm forms via react-hook-form.
|
|
130
|
+
*/
|
|
131
|
+
declare const createZodSchemaFromJson: (schema: FormBuilderSchema) => z.ZodObject<{
|
|
132
|
+
[x: string]: ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
//#endregion
|
|
135
|
+
export { Builder, BuilderProps, FieldNode, Fieldset, FormBuilderArrayProperty, FormBuilderBooleanProperty, FormBuilderFormProperty, FormBuilderNumberProperty, FormBuilderObjectProperty, FormBuilderSchema, FormBuilderStringProperty, LayoutNode, Node, SelectItem, UiSchemaForm, createZodSchemaFromJson, renderField };
|