@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,18 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { ark } from "@ark-ui/react/factory";
|
|
3
|
+
import { styled } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { checkmark } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { dataAttr } from "@pyck/react/utils";
|
|
6
|
+
|
|
7
|
+
//#region src/components/checkmark/checkmark.tsx
|
|
8
|
+
const StyledCheckmark = styled(ark.svg, checkmark);
|
|
9
|
+
const Checkmark = forwardRef(function Checkmark(props, ref) {
|
|
10
|
+
const { checked, indeterminate, disabled, ...rest } = props;
|
|
11
|
+
return <StyledCheckmark ref={ref} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3px" strokeLinecap="round" strokeLinejoin="round" data-state={indeterminate ? "indeterminate" : checked ? "checked" : "unchecked"} data-disabled={dataAttr(disabled)} {...rest}>
|
|
12
|
+
<title>Checkmark</title>
|
|
13
|
+
{indeterminate ? <path d="M5 12h14" /> : checked ? <path d="M20 6 9 17l-5-5" /> : null}
|
|
14
|
+
</StyledCheckmark>;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Checkmark as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) {
|
|
6
|
+
__defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!no_symbols) {
|
|
12
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { __exportAll as t };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createContext, mergeProps } from "@ark-ui/react/utils";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { ark } from "@ark-ui/react/factory";
|
|
4
|
+
import { styled } from "@pyck/styled-system/jsx";
|
|
5
|
+
import { button } from "@pyck/styled-system/recipes";
|
|
6
|
+
import { XIcon } from "lucide-react";
|
|
7
|
+
import { Loader } from "@pyck/react/loader";
|
|
8
|
+
import { Group } from "@pyck/react/group";
|
|
9
|
+
|
|
10
|
+
//#region src/components/button/button-group.tsx
|
|
11
|
+
const ButtonGroup = forwardRef(function ButtonGroup(props, ref) {
|
|
12
|
+
const [variantProps, otherProps] = useMemo(() => button.splitVariantProps(props), [props]);
|
|
13
|
+
return <ButtonPropsProvider value={variantProps}>
|
|
14
|
+
<Group ref={ref} {...otherProps} />
|
|
15
|
+
</ButtonPropsProvider>;
|
|
16
|
+
});
|
|
17
|
+
const [ButtonPropsProvider, useButtonPropsContext] = createContext({
|
|
18
|
+
name: "ButtonPropsContext",
|
|
19
|
+
hookName: "useButtonPropsContext",
|
|
20
|
+
providerName: "<PropsProvider />",
|
|
21
|
+
strict: false
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/button/button.tsx
|
|
26
|
+
const BaseButton = styled(ark.button, button);
|
|
27
|
+
const Button = forwardRef(function Button(props, ref) {
|
|
28
|
+
const propsContext = useButtonPropsContext();
|
|
29
|
+
const { loading, loadingText, children, spinner, spinnerPlacement, ...rest } = useMemo(() => mergeProps(propsContext, props), [propsContext, props]);
|
|
30
|
+
return <BaseButton type="button" ref={ref} {...rest} data-loading={loading ? "" : void 0} disabled={loading || rest.disabled}>
|
|
31
|
+
{!props.asChild && loading ? <Loader spinner={spinner} text={loadingText} spinnerPlacement={spinnerPlacement}>
|
|
32
|
+
{children}
|
|
33
|
+
</Loader> : children}
|
|
34
|
+
</BaseButton>;
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/button/icon-button.tsx
|
|
39
|
+
const IconButton = forwardRef(function IconButton(props, ref) {
|
|
40
|
+
return <Button px="0" py="0" ref={ref} {...props} />;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/components/button/close-button.tsx
|
|
45
|
+
const CloseButton = forwardRef(function CloseButton(props, ref) {
|
|
46
|
+
return <IconButton variant="plain" color="fg.muted" aria-label="Close" ref={ref} {...props}>
|
|
47
|
+
<XIcon />
|
|
48
|
+
</IconButton>;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { ButtonGroup as i, IconButton as n, Button as r, CloseButton as t };
|
|
@@ -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/absolute-center/absolute-center.d.ts
|
|
8
|
+
type AbsoluteCenterProps = ComponentProps<typeof AbsoluteCenter>;
|
|
9
|
+
declare const AbsoluteCenter: _pyck_styled_system_types0.StyledComponent<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.AbsoluteCenterVariantProps>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AbsoluteCenter, type AbsoluteCenterProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ark } from "@ark-ui/react/factory";
|
|
2
|
+
import { styled } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { absoluteCenter } from "@pyck/styled-system/recipes";
|
|
4
|
+
|
|
5
|
+
//#region src/components/absolute-center/absolute-center.tsx
|
|
6
|
+
const AbsoluteCenter = styled(ark.div, absoluteCenter);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AbsoluteCenter };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } 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 { Popover, PopoverContext as Context } from "@ark-ui/react/popover";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/action-bar/action-bar.d.ts
|
|
9
|
+
declare namespace action_bar_d_exports {
|
|
10
|
+
export { CloseTrigger, Content, Context, Positioner, Root, RootProps, RootProvider, SelectionText, Separator };
|
|
11
|
+
}
|
|
12
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
13
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextRootProvider<(props: Popover.RootProps) => react_jsx_runtime0.JSX.Element, _pyck_styled_system_recipes0.ActionBarRecipe>;
|
|
14
|
+
declare const RootProvider: _pyck_styled_system_jsx0.StyleContextRootProvider<(props: Popover.RootProps) => react_jsx_runtime0.JSX.Element, _pyck_styled_system_recipes0.ActionBarRecipe>;
|
|
15
|
+
declare const CloseTrigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Popover.CloseTriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
16
|
+
declare const Content: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Popover.ContentProps & react.RefAttributes<HTMLDivElement>>>;
|
|
17
|
+
declare const Positioner: _pyck_styled_system_jsx0.StyleContextConsumer<"div">;
|
|
18
|
+
declare const Separator: _pyck_styled_system_jsx0.StyleContextConsumer<"div">;
|
|
19
|
+
declare const SelectionText: _pyck_styled_system_jsx0.StyleContextConsumer<"span">;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { action_bar_d_exports as ActionBar };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { actionBar } from "@pyck/styled-system/recipes";
|
|
4
|
+
import { Popover, PopoverContext as Context } from "@ark-ui/react/popover";
|
|
5
|
+
|
|
6
|
+
//#region src/components/action-bar/action-bar.tsx
|
|
7
|
+
var action_bar_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
CloseTrigger: () => CloseTrigger,
|
|
9
|
+
Content: () => Content,
|
|
10
|
+
Context: () => Context,
|
|
11
|
+
Positioner: () => Positioner,
|
|
12
|
+
Root: () => Root,
|
|
13
|
+
RootProvider: () => RootProvider,
|
|
14
|
+
SelectionText: () => SelectionText,
|
|
15
|
+
Separator: () => Separator
|
|
16
|
+
});
|
|
17
|
+
const { withRootProvider, withContext } = createStyleContext(actionBar);
|
|
18
|
+
const Root = withRootProvider(Popover.Root, { defaultProps: {
|
|
19
|
+
lazyMount: true,
|
|
20
|
+
unmountOnExit: true,
|
|
21
|
+
autoFocus: false
|
|
22
|
+
} });
|
|
23
|
+
const RootProvider = withRootProvider(Popover.Root, { defaultProps: {
|
|
24
|
+
lazyMount: true,
|
|
25
|
+
unmountOnExit: true,
|
|
26
|
+
autoFocus: false
|
|
27
|
+
} });
|
|
28
|
+
const CloseTrigger = withContext(Popover.CloseTrigger, "closeTrigger");
|
|
29
|
+
const Content = withContext(Popover.Content, "content");
|
|
30
|
+
const Positioner = withContext("div", "positioner");
|
|
31
|
+
const Separator = withContext("div", "separator");
|
|
32
|
+
const SelectionText = withContext("span", "selectionText");
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { action_bar_exports as ActionBar };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps, ReactElement, 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 { Avatar as Avatar$1 } from "@ark-ui/react/avatar";
|
|
6
|
+
|
|
7
|
+
//#region src/components/avatar/avatar.d.ts
|
|
8
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
9
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<Avatar$1.RootProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.AvatarRecipe>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/avatar/avatar.closed.d.ts
|
|
12
|
+
interface AvatarProps extends RootProps {
|
|
13
|
+
name?: string;
|
|
14
|
+
src?: string | null;
|
|
15
|
+
srcSet?: string;
|
|
16
|
+
loading?: 'eager' | 'lazy' | undefined;
|
|
17
|
+
icon?: ReactElement;
|
|
18
|
+
fallback?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
declare const Avatar: react.ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Avatar, type AvatarProps };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { avatar } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { Avatar as Avatar$1, AvatarContext as Context } from "@ark-ui/react/avatar";
|
|
6
|
+
import { UserIcon } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
//#region src/components/avatar/avatar.tsx
|
|
9
|
+
var avatar_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Context: () => Context,
|
|
11
|
+
Fallback: () => Fallback,
|
|
12
|
+
Image: () => Image,
|
|
13
|
+
Root: () => Root,
|
|
14
|
+
RootProvider: () => RootProvider
|
|
15
|
+
});
|
|
16
|
+
const { withProvider, withContext } = createStyleContext(avatar);
|
|
17
|
+
const Root = withProvider(Avatar$1.Root, "root");
|
|
18
|
+
const RootProvider = withProvider(Avatar$1.RootProvider, "root");
|
|
19
|
+
const Image = withContext(Avatar$1.Image, "image", { defaultProps: {
|
|
20
|
+
draggable: "false",
|
|
21
|
+
referrerPolicy: "no-referrer",
|
|
22
|
+
loading: "eager"
|
|
23
|
+
} });
|
|
24
|
+
const StyledFallback = withContext(Avatar$1.Fallback, "fallback");
|
|
25
|
+
const Fallback = forwardRef(function Fallback(props, ref) {
|
|
26
|
+
const { name, children, asChild, ...rest } = props;
|
|
27
|
+
const fallbackContent = children || asChild ? children : name ? getInitials(name) : <UserIcon />;
|
|
28
|
+
return <StyledFallback ref={ref} {...rest}>
|
|
29
|
+
{fallbackContent}
|
|
30
|
+
</StyledFallback>;
|
|
31
|
+
});
|
|
32
|
+
const getInitials = (name) => {
|
|
33
|
+
const trimmedName = name.trim();
|
|
34
|
+
if (trimmedName.match(/^[^a-zA-Z]/)) return trimmedName;
|
|
35
|
+
const names = trimmedName.split(" ");
|
|
36
|
+
const firstName = names[0] || "";
|
|
37
|
+
const lastName = names.length > 1 ? names[names.length - 1] : "";
|
|
38
|
+
return firstName && lastName ? `${firstName[0]}${lastName[0]}` : firstName[0];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/avatar/avatar.closed.tsx
|
|
43
|
+
const Avatar = forwardRef(function Avatar(props, ref) {
|
|
44
|
+
const { name, src, srcSet, loading, icon, fallback, children, ...rest } = props;
|
|
45
|
+
return <avatar_exports.Root ref={ref} {...rest}>
|
|
46
|
+
<avatar_exports.Fallback name={name}>{fallback || icon}</avatar_exports.Fallback>
|
|
47
|
+
<avatar_exports.Image src={src ?? void 0} srcSet={srcSet} loading={loading} alt={name} />
|
|
48
|
+
{children}
|
|
49
|
+
</avatar_exports.Root>;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
export { Avatar };
|
|
@@ -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/badge/badge.d.ts
|
|
8
|
+
type BadgeProps = ComponentProps<typeof Badge>;
|
|
9
|
+
declare const Badge: _pyck_styled_system_types0.StyledComponent<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.BadgeVariantProps>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Badge, type BadgeProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ark } from "@ark-ui/react/factory";
|
|
2
|
+
import { styled } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { badge } from "@pyck/styled-system/recipes";
|
|
4
|
+
|
|
5
|
+
//#region src/components/badge/badge.tsx
|
|
6
|
+
const Badge = styled(ark.div, badge);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Badge };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } 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/breadcrumb/breadcrumb.d.ts
|
|
8
|
+
declare namespace breadcrumb_d_exports {
|
|
9
|
+
export { Ellipsis, Item, Link, List, Root, RootProps, Separator };
|
|
10
|
+
}
|
|
11
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
12
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLElement> & react.HTMLAttributes<HTMLElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.BreadcrumbRecipe>;
|
|
13
|
+
declare const List: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLOListElement> & react.OlHTMLAttributes<HTMLOListElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
14
|
+
declare const Item: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLLIElement> & react.LiHTMLAttributes<HTMLLIElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
15
|
+
declare const Link: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLAnchorElement> & react.AnchorHTMLAttributes<HTMLAnchorElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
16
|
+
declare const Ellipsis: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLLIElement> & react.LiHTMLAttributes<HTMLLIElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
17
|
+
declare const Separator: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLLIElement> & react.LiHTMLAttributes<HTMLLIElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { breadcrumb_d_exports as Breadcrumb };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { ark } from "@ark-ui/react/factory";
|
|
3
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { breadcrumb } from "@pyck/styled-system/recipes";
|
|
5
|
+
|
|
6
|
+
//#region src/components/breadcrumb/breadcrumb.tsx
|
|
7
|
+
var breadcrumb_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
Ellipsis: () => Ellipsis,
|
|
9
|
+
Item: () => Item,
|
|
10
|
+
Link: () => Link,
|
|
11
|
+
List: () => List,
|
|
12
|
+
Root: () => Root,
|
|
13
|
+
Separator: () => Separator
|
|
14
|
+
});
|
|
15
|
+
const { withProvider, withContext } = createStyleContext(breadcrumb);
|
|
16
|
+
const Root = withProvider(ark.nav, "root", { defaultProps: { "aria-label": "breadcrumb" } });
|
|
17
|
+
const List = withContext(ark.ol, "list");
|
|
18
|
+
const Item = withContext(ark.li, "item");
|
|
19
|
+
const Link = withContext(ark.a, "link");
|
|
20
|
+
const Ellipsis = withContext(ark.li, "ellipsis", { defaultProps: {
|
|
21
|
+
role: "presentation",
|
|
22
|
+
"aria-hidden": true,
|
|
23
|
+
children: "..."
|
|
24
|
+
} });
|
|
25
|
+
const Separator = withContext(ark.li, "separator", { defaultProps: {
|
|
26
|
+
"aria-hidden": true,
|
|
27
|
+
children: "/"
|
|
28
|
+
} });
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { breadcrumb_exports as Breadcrumb };
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { ButtonVariantProps } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { GroupProps } from "@pyck/react/group";
|
|
6
|
+
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
7
|
+
import * as _pyck_styled_system_types0 from "@pyck/styled-system/types";
|
|
8
|
+
|
|
9
|
+
//#region src/components/button/button.d.ts
|
|
10
|
+
interface ButtonLoadingProps {
|
|
11
|
+
/**
|
|
12
|
+
* If `true`, the button will show a loading spinner.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
loading?: boolean | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The text to show while loading.
|
|
18
|
+
*/
|
|
19
|
+
loadingText?: ReactNode | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The spinner to show while loading.
|
|
22
|
+
*/
|
|
23
|
+
spinner?: ReactNode | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The placement of the spinner
|
|
26
|
+
* @default "start"
|
|
27
|
+
*/
|
|
28
|
+
spinnerPlacement?: 'start' | 'end' | undefined;
|
|
29
|
+
}
|
|
30
|
+
type BaseButtonProps = ComponentProps<typeof BaseButton>;
|
|
31
|
+
declare const BaseButton: _pyck_styled_system_types0.StyledComponent<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLButtonElement> & react.ButtonHTMLAttributes<HTMLButtonElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.ButtonVariantProps>;
|
|
32
|
+
interface ButtonProps extends BaseButtonProps, ButtonLoadingProps {}
|
|
33
|
+
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/components/button/button-group.d.ts
|
|
36
|
+
interface ButtonGroupProps extends GroupProps, ButtonVariantProps {}
|
|
37
|
+
declare const ButtonGroup: react.ForwardRefExoticComponent<Omit<ButtonGroupProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/button/icon-button.d.ts
|
|
40
|
+
interface IconButtonProps extends ButtonProps {}
|
|
41
|
+
declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/button/close-button.d.ts
|
|
44
|
+
type CloseButtonProps = Omit<IconButtonProps, 'children'>;
|
|
45
|
+
declare const CloseButton: react.ForwardRefExoticComponent<Omit<CloseButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CloseButton, type CloseButtonProps, IconButton, type IconButtonProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } 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/card/card.d.ts
|
|
8
|
+
declare namespace card_d_exports {
|
|
9
|
+
export { Body, Description, Footer, Header, Root, RootProps, Title };
|
|
10
|
+
}
|
|
11
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
12
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>, _pyck_styled_system_recipes0.CardRecipe>;
|
|
13
|
+
declare const Header: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
14
|
+
declare const Body: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
15
|
+
declare const Footer: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLHeadingElement> & react.HTMLAttributes<HTMLHeadingElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
16
|
+
declare const Title: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLHeadingElement> & react.HTMLAttributes<HTMLHeadingElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
17
|
+
declare const Description: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { card_d_exports as Card };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { ark } from "@ark-ui/react/factory";
|
|
3
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { card } from "@pyck/styled-system/recipes";
|
|
5
|
+
|
|
6
|
+
//#region src/components/card/card.tsx
|
|
7
|
+
var card_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
Body: () => Body,
|
|
9
|
+
Description: () => Description,
|
|
10
|
+
Footer: () => Footer,
|
|
11
|
+
Header: () => Header,
|
|
12
|
+
Root: () => Root,
|
|
13
|
+
Title: () => Title
|
|
14
|
+
});
|
|
15
|
+
const { withProvider, withContext } = createStyleContext(card);
|
|
16
|
+
const Root = withProvider(ark.div, "root");
|
|
17
|
+
const Header = withContext(ark.div, "header");
|
|
18
|
+
const Body = withContext(ark.div, "body");
|
|
19
|
+
const Footer = withContext(ark.h3, "footer");
|
|
20
|
+
const Title = withContext(ark.h3, "title");
|
|
21
|
+
const Description = withContext(ark.div, "description");
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { card_exports as Card };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } 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 { Carousel, CarouselContext as Context } from "@ark-ui/react/carousel";
|
|
6
|
+
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
7
|
+
|
|
8
|
+
//#region src/components/carousel/carousel.d.ts
|
|
9
|
+
declare namespace carousel_d_exports {
|
|
10
|
+
export { AutoplayTrigger, Context, Control, Image, Indicator, IndicatorGroup, Item, ItemGroup, NextTrigger, PrevTrigger, Root, RootProps, RootProvider };
|
|
11
|
+
}
|
|
12
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
13
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<Carousel.RootProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.CarouselRecipe>;
|
|
14
|
+
declare const RootProvider: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<Carousel.RootProviderProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.CarouselRecipe>;
|
|
15
|
+
declare const AutoplayTrigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Carousel.AutoplayTriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
16
|
+
declare const Control: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Carousel.ControlProps & react.RefAttributes<HTMLDivElement>>>;
|
|
17
|
+
declare const Indicator: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Carousel.IndicatorProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
18
|
+
declare const Item: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Carousel.ItemProps & react.RefAttributes<HTMLDivElement>>>;
|
|
19
|
+
declare const ItemGroup: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Carousel.ItemGroupProps & react.RefAttributes<HTMLDivElement>>>;
|
|
20
|
+
declare const NextTrigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Carousel.NextTriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
21
|
+
declare const PrevTrigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Carousel.PrevTriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
22
|
+
declare const Image: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLImageElement> & react.ImgHTMLAttributes<HTMLImageElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
23
|
+
declare const IndicatorGroup: react.ForwardRefExoticComponent<Carousel.IndicatorGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { carousel_d_exports as Carousel };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { n as IconButton } from "../../close-button-BM7ikbYh.js";
|
|
3
|
+
import "../button/index.js";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { ark } from "@ark-ui/react/factory";
|
|
6
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
7
|
+
import { carousel } from "@pyck/styled-system/recipes";
|
|
8
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
9
|
+
import { Carousel, CarouselContext as Context, useCarouselContext } from "@ark-ui/react/carousel";
|
|
10
|
+
|
|
11
|
+
//#region src/components/carousel/carousel.tsx
|
|
12
|
+
var carousel_exports = /* @__PURE__ */ __exportAll({
|
|
13
|
+
AutoplayTrigger: () => AutoplayTrigger,
|
|
14
|
+
Context: () => Context,
|
|
15
|
+
Control: () => Control,
|
|
16
|
+
Image: () => Image,
|
|
17
|
+
Indicator: () => Indicator,
|
|
18
|
+
IndicatorGroup: () => IndicatorGroup,
|
|
19
|
+
Item: () => Item,
|
|
20
|
+
ItemGroup: () => ItemGroup,
|
|
21
|
+
NextTrigger: () => NextTrigger,
|
|
22
|
+
PrevTrigger: () => PrevTrigger,
|
|
23
|
+
Root: () => Root,
|
|
24
|
+
RootProvider: () => RootProvider
|
|
25
|
+
});
|
|
26
|
+
const { withProvider, withContext } = createStyleContext(carousel);
|
|
27
|
+
const Root = withProvider(Carousel.Root, "root", {
|
|
28
|
+
forwardProps: ["page"],
|
|
29
|
+
defaultProps: { spacing: "32px" }
|
|
30
|
+
});
|
|
31
|
+
const RootProvider = withProvider(Carousel.RootProvider, "root");
|
|
32
|
+
const AutoplayTrigger = withContext(Carousel.AutoplayTrigger, "autoplayTrigger");
|
|
33
|
+
const Control = withContext(Carousel.Control, "control");
|
|
34
|
+
const Indicator = withContext(Carousel.Indicator, "indicator");
|
|
35
|
+
const Item = withContext(Carousel.Item, "item");
|
|
36
|
+
const ItemGroup = withContext(Carousel.ItemGroup, "itemGroup");
|
|
37
|
+
const NextTriggerChild = () => {
|
|
38
|
+
return <IconButton size="sm" variant="plain" aria-label="Next slide">
|
|
39
|
+
<ChevronRightIcon />
|
|
40
|
+
</IconButton>;
|
|
41
|
+
};
|
|
42
|
+
const NextTrigger = withContext(Carousel.NextTrigger, "nextTrigger", { defaultProps: {
|
|
43
|
+
asChild: true,
|
|
44
|
+
children: <NextTriggerChild />
|
|
45
|
+
} });
|
|
46
|
+
const PrevTriggerChild = () => {
|
|
47
|
+
return <IconButton size="sm" variant="plain" aria-label="Previous slide">
|
|
48
|
+
<ChevronLeftIcon />
|
|
49
|
+
</IconButton>;
|
|
50
|
+
};
|
|
51
|
+
const PrevTrigger = withContext(Carousel.PrevTrigger, "prevTrigger", { defaultProps: {
|
|
52
|
+
asChild: true,
|
|
53
|
+
children: <PrevTriggerChild />
|
|
54
|
+
} });
|
|
55
|
+
const Image = withContext(ark.img, "image");
|
|
56
|
+
const StyledIndicatorGroup = withContext(Carousel.IndicatorGroup, "indicatorGroup");
|
|
57
|
+
const IndicatorGroup = forwardRef((props, ref) => {
|
|
58
|
+
const carousel = useCarouselContext();
|
|
59
|
+
return <StyledIndicatorGroup {...props} ref={ref}>
|
|
60
|
+
{carousel.pageSnapPoints.map((_, index) => <Indicator key={index} index={index} />)}
|
|
61
|
+
</StyledIndicatorGroup>;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { carousel_exports as Carousel };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } 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 { Checkbox as Checkbox$1, CheckboxCheckedState } from "@ark-ui/react/checkbox";
|
|
6
|
+
import { CheckboxProps as CheckboxProps$1 } from "@pyck/react/checkbox";
|
|
7
|
+
import { FieldPath, FieldValues } from "react-hook-form";
|
|
8
|
+
import { HTMLStyledProps as HTMLStyledProps$1 } from "@pyck/styled-system/types";
|
|
9
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region src/components/checkbox/checkbox.d.ts
|
|
12
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
13
|
+
type HiddenInputProps = ComponentProps<typeof HiddenInput>;
|
|
14
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<Checkbox$1.RootProps & react.RefAttributes<HTMLLabelElement>>, _pyck_styled_system_recipes0.CheckboxRecipe>;
|
|
15
|
+
declare const HiddenInput: react.ForwardRefExoticComponent<Checkbox$1.HiddenInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/checkbox/checkbox.closed.d.ts
|
|
18
|
+
interface CheckboxProps extends Omit<RootProps, 'ref'> {
|
|
19
|
+
inputProps?: HiddenInputProps;
|
|
20
|
+
}
|
|
21
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/checkbox/checkbox.field.d.ts
|
|
24
|
+
interface CheckboxFieldProps<T extends FieldValues = FieldValues> {
|
|
25
|
+
name: FieldPath<T>;
|
|
26
|
+
label: string;
|
|
27
|
+
helperText?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
checkboxProps?: CheckboxProps$1;
|
|
30
|
+
hideLabel?: boolean;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare const CheckboxField: <T extends FieldValues>(props: CheckboxFieldProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Checkbox, type CheckboxCheckedState, CheckboxField, type CheckboxFieldProps, type CheckboxProps };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { VisuallyHidden, createStyleContext, styled } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { checkbox } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { Checkbox as Checkbox$1, CheckboxGroupProvider as GroupProvider, useCheckboxContext } from "@ark-ui/react/checkbox";
|
|
6
|
+
import { Checkbox as Checkbox$2 } from "@pyck/react/checkbox";
|
|
7
|
+
import { Field } from "@pyck/react/field";
|
|
8
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
9
|
+
|
|
10
|
+
//#region src/components/checkbox/checkbox.tsx
|
|
11
|
+
var checkbox_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
Control: () => Control,
|
|
13
|
+
Group: () => Group,
|
|
14
|
+
GroupProvider: () => GroupProvider,
|
|
15
|
+
HiddenInput: () => HiddenInput,
|
|
16
|
+
Indicator: () => Indicator,
|
|
17
|
+
Label: () => Label,
|
|
18
|
+
Root: () => Root,
|
|
19
|
+
RootProvider: () => RootProvider
|
|
20
|
+
});
|
|
21
|
+
const { withProvider, withContext } = createStyleContext(checkbox);
|
|
22
|
+
const Root = withProvider(Checkbox$1.Root, "root");
|
|
23
|
+
const RootProvider = withProvider(Checkbox$1.RootProvider, "root");
|
|
24
|
+
const Control = withContext(Checkbox$1.Control, "control");
|
|
25
|
+
const Group = withProvider(Checkbox$1.Group, "group");
|
|
26
|
+
const Label = withContext(Checkbox$1.Label, "label");
|
|
27
|
+
const HiddenInput = Checkbox$1.HiddenInput;
|
|
28
|
+
const Indicator = forwardRef(function Indicator(props, ref) {
|
|
29
|
+
const { indeterminate, checked } = useCheckboxContext();
|
|
30
|
+
return <Checkbox$1.Indicator indeterminate={indeterminate} asChild>
|
|
31
|
+
<styled.svg ref={ref} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3px" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
32
|
+
<title>Checkmark</title>
|
|
33
|
+
{indeterminate ? <path d="M5 12h14" /> : checked ? <path d="M20 6 9 17l-5-5" /> : null}
|
|
34
|
+
</styled.svg>
|
|
35
|
+
</Checkbox$1.Indicator>;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/checkbox/checkbox.closed.tsx
|
|
40
|
+
const Checkbox = forwardRef(function Checkbox(props, ref) {
|
|
41
|
+
const { children, inputProps, ...rootProps } = props;
|
|
42
|
+
return <checkbox_exports.Root {...rootProps}>
|
|
43
|
+
<checkbox_exports.HiddenInput ref={ref} {...inputProps} />
|
|
44
|
+
<checkbox_exports.Control>
|
|
45
|
+
<checkbox_exports.Indicator />
|
|
46
|
+
</checkbox_exports.Control>
|
|
47
|
+
{children && <checkbox_exports.Label>{children}</checkbox_exports.Label>}
|
|
48
|
+
{props["aria-label"] && <checkbox_exports.Label asChild>
|
|
49
|
+
<VisuallyHidden>{props["aria-label"]}</VisuallyHidden>
|
|
50
|
+
</checkbox_exports.Label>}
|
|
51
|
+
</checkbox_exports.Root>;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/checkbox/checkbox.field.tsx
|
|
56
|
+
const CheckboxField = (props) => {
|
|
57
|
+
const { name, label, helperText, hideLabel, disabled, checkboxProps, required } = props;
|
|
58
|
+
const { control } = useFormContext();
|
|
59
|
+
return <Controller name={name} control={control} render={({ field, fieldState }) => <Field helperText={helperText} disabled={disabled} invalid={!!fieldState.error} errorText={fieldState.error?.message} hideLabel={hideLabel} required={required}>
|
|
60
|
+
<Checkbox$2 size="xs" checked={!!field.value} onCheckedChange={(e) => field.onChange(e.checked)} {...checkboxProps}>
|
|
61
|
+
{label}
|
|
62
|
+
</Checkbox$2>
|
|
63
|
+
</Field>} />;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
export { Checkbox, CheckboxField };
|