@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 * 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 { Tabs } from "@ark-ui/react/tabs";
|
|
6
|
+
|
|
7
|
+
//#region src/components/tabs/tabs.d.ts
|
|
8
|
+
declare namespace tabs_d_exports {
|
|
9
|
+
export { Content, Indicator, List, Root, RootProps, Trigger };
|
|
10
|
+
}
|
|
11
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
12
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<Tabs.RootProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.TabsRecipe>;
|
|
13
|
+
declare const Content: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Tabs.ContentProps & react.RefAttributes<HTMLDivElement>>>;
|
|
14
|
+
declare const List: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Tabs.ListProps & react.RefAttributes<HTMLDivElement>>>;
|
|
15
|
+
declare const Indicator: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Tabs.IndicatorProps & react.RefAttributes<HTMLDivElement>>>;
|
|
16
|
+
declare const Trigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Tabs.TriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { tabs_d_exports as Tabs };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { tabs } from "@pyck/styled-system/recipes";
|
|
4
|
+
import { Tabs } from "@ark-ui/react/tabs";
|
|
5
|
+
|
|
6
|
+
//#region src/components/tabs/tabs.tsx
|
|
7
|
+
var tabs_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
Content: () => Content,
|
|
9
|
+
Indicator: () => Indicator,
|
|
10
|
+
List: () => List,
|
|
11
|
+
Root: () => Root,
|
|
12
|
+
Trigger: () => Trigger
|
|
13
|
+
});
|
|
14
|
+
const { withProvider, withContext } = createStyleContext(tabs);
|
|
15
|
+
const Root = withProvider(Tabs.Root, "root");
|
|
16
|
+
const Content = withContext(Tabs.Content, "content");
|
|
17
|
+
const List = withContext(Tabs.List, "list");
|
|
18
|
+
const Indicator = withContext(Tabs.Indicator, "indicator");
|
|
19
|
+
const Trigger = withContext(Tabs.Trigger, "trigger");
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { tabs_exports as Tabs };
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { TagsInput, TagsInputContext as Context } from "@ark-ui/react/tags-input";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/tags-input/tags-input.d.ts
|
|
9
|
+
declare namespace tags_input_d_exports {
|
|
10
|
+
export { ClearTrigger, Context, Control, HiddenInput, Input, Item, ItemDeleteTrigger, ItemInput, ItemPreview, ItemProps, ItemText, Items, Label, Root, RootProps, RootProvider, TagsInputItemsProps };
|
|
11
|
+
}
|
|
12
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
13
|
+
type ItemProps = ComponentProps<typeof Item>;
|
|
14
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<TagsInput.RootProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.TagsInputRecipe>;
|
|
15
|
+
declare const RootProvider: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<TagsInput.RootProviderProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.TagsInputRecipe>;
|
|
16
|
+
declare const ClearTrigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TagsInput.ClearTriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
17
|
+
declare const Control: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TagsInput.ControlProps & react.RefAttributes<HTMLDivElement>>>;
|
|
18
|
+
declare const HiddenInput: react.ForwardRefExoticComponent<TagsInput.HiddenInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
19
|
+
declare const Input: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TagsInput.InputProps & react.RefAttributes<HTMLInputElement>>>;
|
|
20
|
+
declare const Item: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TagsInput.ItemProps & react.RefAttributes<HTMLDivElement>>>;
|
|
21
|
+
declare const ItemDeleteTrigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TagsInput.ItemDeleteTriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
22
|
+
declare const ItemInput: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TagsInput.ItemInputProps & react.RefAttributes<HTMLInputElement>>>;
|
|
23
|
+
declare const ItemPreview: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TagsInput.ItemPreviewProps & react.RefAttributes<HTMLDivElement>>>;
|
|
24
|
+
declare const ItemText: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TagsInput.ItemTextProps & react.RefAttributes<HTMLSpanElement>>>;
|
|
25
|
+
declare const Label: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TagsInput.LabelProps & react.RefAttributes<HTMLLabelElement>>>;
|
|
26
|
+
interface TagsInputItemsProps extends Omit<ItemProps, 'value' | 'index'> {}
|
|
27
|
+
declare const Items: (props: TagsInputItemsProps) => react_jsx_runtime0.JSX.Element[];
|
|
28
|
+
//#endregion
|
|
29
|
+
export { tags_input_d_exports as TagsInput };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { tagsInput } from "@pyck/styled-system/recipes";
|
|
4
|
+
import { XIcon } from "lucide-react";
|
|
5
|
+
import { TagsInput, TagsInputContext as Context, useTagsInputContext } from "@ark-ui/react/tags-input";
|
|
6
|
+
|
|
7
|
+
//#region src/components/tags-input/tags-input.tsx
|
|
8
|
+
var tags_input_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
ClearTrigger: () => ClearTrigger,
|
|
10
|
+
Context: () => Context,
|
|
11
|
+
Control: () => Control,
|
|
12
|
+
HiddenInput: () => HiddenInput,
|
|
13
|
+
Input: () => Input,
|
|
14
|
+
Item: () => Item,
|
|
15
|
+
ItemDeleteTrigger: () => ItemDeleteTrigger,
|
|
16
|
+
ItemInput: () => ItemInput,
|
|
17
|
+
ItemPreview: () => ItemPreview,
|
|
18
|
+
ItemText: () => ItemText,
|
|
19
|
+
Items: () => Items,
|
|
20
|
+
Label: () => Label,
|
|
21
|
+
Root: () => Root,
|
|
22
|
+
RootProvider: () => RootProvider
|
|
23
|
+
});
|
|
24
|
+
const { withProvider, withContext } = createStyleContext(tagsInput);
|
|
25
|
+
const Root = withProvider(TagsInput.Root, "root");
|
|
26
|
+
const RootProvider = withProvider(TagsInput.RootProvider, "root");
|
|
27
|
+
const ClearTrigger = withContext(TagsInput.ClearTrigger, "clearTrigger", { defaultProps: { children: <XIcon /> } });
|
|
28
|
+
const Control = withContext(TagsInput.Control, "control");
|
|
29
|
+
const HiddenInput = TagsInput.HiddenInput;
|
|
30
|
+
const Input = withContext(TagsInput.Input, "input");
|
|
31
|
+
const Item = withContext(TagsInput.Item, "item");
|
|
32
|
+
const ItemDeleteTrigger = withContext(TagsInput.ItemDeleteTrigger, "itemDeleteTrigger", { defaultProps: { children: <XIcon /> } });
|
|
33
|
+
const ItemInput = withContext(TagsInput.ItemInput, "itemInput");
|
|
34
|
+
const ItemPreview = withContext(TagsInput.ItemPreview, "itemPreview");
|
|
35
|
+
const ItemText = withContext(TagsInput.ItemText, "itemText");
|
|
36
|
+
const Label = withContext(TagsInput.Label, "label");
|
|
37
|
+
const Items = (props) => {
|
|
38
|
+
return useTagsInputContext().value.map((item, index) => <Item key={item} index={index} value={item} {...props}>
|
|
39
|
+
<ItemPreview>
|
|
40
|
+
<ItemText>{item}</ItemText>
|
|
41
|
+
<ItemDeleteTrigger />
|
|
42
|
+
</ItemPreview>
|
|
43
|
+
<ItemInput />
|
|
44
|
+
</Item>);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { tags_input_exports as TagsInput };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentProps, ElementType } from "react";
|
|
2
|
+
import { TextVariantProps } from "@pyck/styled-system/recipes";
|
|
3
|
+
import { StyledComponent } from "@pyck/styled-system/types";
|
|
4
|
+
|
|
5
|
+
//#region src/components/text/text.d.ts
|
|
6
|
+
type Props = TextVariantProps & {
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
};
|
|
9
|
+
type TextProps = ComponentProps<typeof Text>;
|
|
10
|
+
declare const Text: StyledComponent<"p", Props>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Text, type TextProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { TextareaProps as TextareaProps$1 } from "@pyck/react/textarea";
|
|
8
|
+
import * as _pyck_styled_system_types0 from "@pyck/styled-system/types";
|
|
9
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region src/components/textarea/textarea.d.ts
|
|
12
|
+
type TextareaProps = ComponentProps<typeof Textarea>;
|
|
13
|
+
declare const Textarea: _pyck_styled_system_types0.StyledComponent<react.ForwardRefExoticComponent<Field$1.TextareaProps & react.RefAttributes<HTMLTextAreaElement>>, _pyck_styled_system_recipes0.TextareaVariantProps>;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/textarea/textarea-field.d.ts
|
|
16
|
+
interface TextareaFieldProps<T extends FieldValues = FieldValues> extends TextareaProps$1 {
|
|
17
|
+
name: FieldPath<T>;
|
|
18
|
+
label: FieldProps['label'];
|
|
19
|
+
helperText?: FieldProps['helperText'];
|
|
20
|
+
hideLabel?: FieldProps['hideLabel'];
|
|
21
|
+
}
|
|
22
|
+
declare const TextareaField: <T extends FieldValues>(props: TextareaFieldProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Textarea, TextareaField, type TextareaFieldProps, type TextareaProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { styled } from "@pyck/styled-system/jsx";
|
|
2
|
+
import { textarea } 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
|
+
import { Textarea as Textarea$1 } from "@pyck/react/textarea";
|
|
7
|
+
|
|
8
|
+
//#region src/components/textarea/textarea.tsx
|
|
9
|
+
const Textarea = styled(Field$1.Textarea, textarea);
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/textarea/textarea-field.tsx
|
|
13
|
+
const TextareaField = (props) => {
|
|
14
|
+
const { name, label, hideLabel, helperText, disabled, ...textareaProps } = props;
|
|
15
|
+
const { control } = useFormContext();
|
|
16
|
+
return <Controller name={name} control={control} render={({ field, fieldState }) => <Field label={label} helperText={helperText} hideLabel={hideLabel} disabled={field.disabled || disabled} invalid={!!fieldState.error} errorText={fieldState.error?.message}>
|
|
17
|
+
<Textarea$1 {...textareaProps} name={field.name} value={field.value} onChange={field.onChange} onBlur={field.onBlur} />
|
|
18
|
+
</Field>} />;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Textarea, TextareaField };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps, HTMLAttributes } 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 { CreateToasterReturn, Toast, ToastContext as Context } from "@ark-ui/react/toast";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/toast/toast.d.ts
|
|
9
|
+
declare namespace toast_d_exports {
|
|
10
|
+
export { ActionTrigger, CloseTrigger, Context, Description, Indicator, Root, RootProps, Title };
|
|
11
|
+
}
|
|
12
|
+
type IndicatorProps = HTMLAttributes<SVGSVGElement>;
|
|
13
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
14
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<Toast.RootProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.ToastRecipe>;
|
|
15
|
+
declare const Title: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Toast.TitleProps & react.RefAttributes<HTMLDivElement>>>;
|
|
16
|
+
declare const Description: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Toast.DescriptionProps & react.RefAttributes<HTMLDivElement>>>;
|
|
17
|
+
declare const ActionTrigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Toast.ActionTriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
18
|
+
declare const CloseTrigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Toast.CloseTriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
19
|
+
declare const Indicator: react.ForwardRefExoticComponent<IndicatorProps & react.RefAttributes<SVGSVGElement>>;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/toast/toaster.d.ts
|
|
22
|
+
declare const toaster: CreateToasterReturn;
|
|
23
|
+
declare const Toaster: () => react_jsx_runtime0.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { toast_d_exports as Toast, Toaster, toaster };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Stack, createStyleContext, styled } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { toast } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { CheckCircleIcon, CircleAlertIcon, CircleXIcon } from "lucide-react";
|
|
6
|
+
import { Show } from "@pyck/react/show";
|
|
7
|
+
import { Portal } from "@ark-ui/react/portal";
|
|
8
|
+
import { CloseButton } from "@pyck/react/button";
|
|
9
|
+
import { Icon } from "@pyck/react/icon";
|
|
10
|
+
import { Spinner } from "@pyck/react/spinner";
|
|
11
|
+
import { Toast, ToastContext as Context, Toaster as Toaster$1, createToaster, useToastContext } from "@ark-ui/react/toast";
|
|
12
|
+
|
|
13
|
+
//#region src/components/toast/toast.tsx
|
|
14
|
+
var toast_exports = /* @__PURE__ */ __exportAll({
|
|
15
|
+
ActionTrigger: () => ActionTrigger,
|
|
16
|
+
CloseTrigger: () => CloseTrigger,
|
|
17
|
+
Context: () => Context,
|
|
18
|
+
Description: () => Description,
|
|
19
|
+
Indicator: () => Indicator,
|
|
20
|
+
Root: () => Root,
|
|
21
|
+
Title: () => Title
|
|
22
|
+
});
|
|
23
|
+
const { withProvider, withContext } = createStyleContext(toast);
|
|
24
|
+
const Root = withProvider(Toast.Root, "root");
|
|
25
|
+
const Title = withContext(Toast.Title, "title");
|
|
26
|
+
const Description = withContext(Toast.Description, "description");
|
|
27
|
+
const ActionTrigger = withContext(Toast.ActionTrigger, "actionTrigger");
|
|
28
|
+
const CloseTrigger = withContext(Toast.CloseTrigger, "closeTrigger");
|
|
29
|
+
const iconMap = {
|
|
30
|
+
warning: CircleAlertIcon,
|
|
31
|
+
success: CheckCircleIcon,
|
|
32
|
+
error: CircleXIcon
|
|
33
|
+
};
|
|
34
|
+
const Indicator = forwardRef((props, ref) => {
|
|
35
|
+
const toast = useToastContext();
|
|
36
|
+
const StatusIcon = iconMap[toast.type];
|
|
37
|
+
if (!StatusIcon) return null;
|
|
38
|
+
return <Icon ref={ref} data-type={toast.type} {...props}>
|
|
39
|
+
<StatusIcon />
|
|
40
|
+
</Icon>;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/components/toast/toaster.tsx
|
|
45
|
+
const toaster = createToaster({
|
|
46
|
+
placement: "bottom-end",
|
|
47
|
+
pauseOnPageIdle: true,
|
|
48
|
+
duration: 4e3,
|
|
49
|
+
overlap: true,
|
|
50
|
+
max: 5
|
|
51
|
+
});
|
|
52
|
+
const StyledToaster = styled(Toaster$1);
|
|
53
|
+
const Toaster = () => {
|
|
54
|
+
return <Portal>
|
|
55
|
+
<StyledToaster toaster={toaster} insetInline={{ mdDown: "4" }}>
|
|
56
|
+
{(toast) => <toast_exports.Root>
|
|
57
|
+
<Show when={toast.type === "loading"} fallback={<toast_exports.Indicator />}>
|
|
58
|
+
<Spinner />
|
|
59
|
+
</Show>
|
|
60
|
+
<Stack gap="3" alignItems="start">
|
|
61
|
+
<Stack gap="1">
|
|
62
|
+
{toast.title && <toast_exports.Title>{toast.title}</toast_exports.Title>}
|
|
63
|
+
{toast.description && <toast_exports.Description>{toast.description}</toast_exports.Description>}
|
|
64
|
+
</Stack>
|
|
65
|
+
{toast.action && <toast_exports.ActionTrigger>{toast.action.label}</toast_exports.ActionTrigger>}
|
|
66
|
+
</Stack>
|
|
67
|
+
{toast.closable && <toast_exports.CloseTrigger asChild>
|
|
68
|
+
<CloseButton size="sm" />
|
|
69
|
+
</toast_exports.CloseTrigger>}
|
|
70
|
+
</toast_exports.Root>}
|
|
71
|
+
</StyledToaster>
|
|
72
|
+
</Portal>;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { toast_exports as Toast, Toaster, toaster };
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { ToggleGroup, ToggleGroupContext as Context } from "@ark-ui/react/toggle-group";
|
|
6
|
+
|
|
7
|
+
//#region src/components/toggle-group/toggle-group.d.ts
|
|
8
|
+
declare namespace toggle_group_d_exports {
|
|
9
|
+
export { Context, Item, Root, RootProps, RootProvider };
|
|
10
|
+
}
|
|
11
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
12
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<ToggleGroup.RootProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.ToggleGroupRecipe>;
|
|
13
|
+
declare const RootProvider: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<ToggleGroup.RootProviderProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.ToggleGroupRecipe>;
|
|
14
|
+
declare const Item: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<ToggleGroup.ItemProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { toggle_group_d_exports as ToggleGroup };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { toggleGroup } from "@pyck/styled-system/recipes";
|
|
4
|
+
import { ToggleGroup, ToggleGroupContext as Context } from "@ark-ui/react/toggle-group";
|
|
5
|
+
|
|
6
|
+
//#region src/components/toggle-group/toggle-group.tsx
|
|
7
|
+
var toggle_group_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
Context: () => Context,
|
|
9
|
+
Item: () => Item,
|
|
10
|
+
Root: () => Root,
|
|
11
|
+
RootProvider: () => RootProvider
|
|
12
|
+
});
|
|
13
|
+
const { withProvider, withContext } = createStyleContext(toggleGroup);
|
|
14
|
+
const Root = withProvider(ToggleGroup.Root, "root");
|
|
15
|
+
const RootProvider = withProvider(ToggleGroup.RootProvider, "root");
|
|
16
|
+
const Item = withContext(ToggleGroup.Item, "item");
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { toggle_group_exports as ToggleGroup };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps, ReactNode, RefObject } 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 { Tooltip as Tooltip$1 } from "@ark-ui/react/tooltip";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/tooltip/tooltip.d.ts
|
|
9
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
10
|
+
type ContentProps = ComponentProps<typeof Content>;
|
|
11
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextRootProvider<(props: Tooltip$1.RootProps) => react_jsx_runtime0.JSX.Element, _pyck_styled_system_recipes0.TooltipRecipe>;
|
|
12
|
+
declare const Content: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Tooltip$1.ContentProps & react.RefAttributes<HTMLDivElement>>>;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/tooltip/tooltip.closed.d.ts
|
|
15
|
+
interface TooltipProps extends Omit<RootProps, 'content'> {
|
|
16
|
+
showArrow?: boolean;
|
|
17
|
+
portalled?: boolean;
|
|
18
|
+
portalRef?: RefObject<HTMLElement | null>;
|
|
19
|
+
children: ReactNode | undefined;
|
|
20
|
+
content: ReactNode | string;
|
|
21
|
+
contentProps?: ContentProps;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Tooltip, type TooltipProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { tooltip } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { Portal } from "@ark-ui/react/portal";
|
|
6
|
+
import { Tooltip as Tooltip$1, TooltipContext as Context } from "@ark-ui/react/tooltip";
|
|
7
|
+
|
|
8
|
+
//#region src/components/tooltip/tooltip.tsx
|
|
9
|
+
var tooltip_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Arrow: () => Arrow,
|
|
11
|
+
ArrowTip: () => ArrowTip,
|
|
12
|
+
Content: () => Content,
|
|
13
|
+
Context: () => Context,
|
|
14
|
+
Positioner: () => Positioner,
|
|
15
|
+
Root: () => Root,
|
|
16
|
+
Trigger: () => Trigger
|
|
17
|
+
});
|
|
18
|
+
const { withRootProvider, withContext } = createStyleContext(tooltip);
|
|
19
|
+
const Root = withRootProvider(Tooltip$1.Root, { defaultProps: {
|
|
20
|
+
unmountOnExit: true,
|
|
21
|
+
lazyMount: true
|
|
22
|
+
} });
|
|
23
|
+
const Arrow = withContext(Tooltip$1.Arrow, "arrow");
|
|
24
|
+
const ArrowTip = withContext(Tooltip$1.ArrowTip, "arrowTip");
|
|
25
|
+
const Content = withContext(Tooltip$1.Content, "content");
|
|
26
|
+
const Positioner = withContext(Tooltip$1.Positioner, "positioner");
|
|
27
|
+
const Trigger = withContext(Tooltip$1.Trigger, "trigger");
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/tooltip/tooltip.closed.tsx
|
|
31
|
+
const Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
32
|
+
const { showArrow, children, disabled, portalled = true, content, contentProps, portalRef, ...rootProps } = props;
|
|
33
|
+
if (disabled) return children;
|
|
34
|
+
return <tooltip_exports.Root {...rootProps}>
|
|
35
|
+
<tooltip_exports.Trigger asChild>{children}</tooltip_exports.Trigger>
|
|
36
|
+
<Portal disabled={!portalled} container={portalRef}>
|
|
37
|
+
<tooltip_exports.Positioner>
|
|
38
|
+
<tooltip_exports.Content ref={ref} {...contentProps}>
|
|
39
|
+
{showArrow && <tooltip_exports.Arrow>
|
|
40
|
+
<tooltip_exports.ArrowTip />
|
|
41
|
+
</tooltip_exports.Arrow>}
|
|
42
|
+
{content}
|
|
43
|
+
</tooltip_exports.Content>
|
|
44
|
+
</tooltip_exports.Positioner>
|
|
45
|
+
</Portal>
|
|
46
|
+
</tooltip_exports.Root>;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Tooltip };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TreeCollection } from "@ark-ui/react/collection";
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import { ComponentProps, RefAttributes } from "react";
|
|
4
|
+
import * as _pyck_styled_system_jsx0 from "@pyck/styled-system/jsx";
|
|
5
|
+
import { TreeViewVariantProps } from "@pyck/styled-system/recipes";
|
|
6
|
+
import { TreeView, TreeViewContext as Context, TreeViewNodeProvider as NodeProvider, TreeViewNodeProviderProps as NodeProviderProps, TreeViewRootProps, createTreeCollection } from "@ark-ui/react/tree-view";
|
|
7
|
+
import { Assign, HTMLStyledProps as HTMLStyledProps$1 } from "@pyck/styled-system/types";
|
|
8
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
//#region src/components/tree-view/tree-view.d.ts
|
|
11
|
+
declare namespace tree_view_d_exports {
|
|
12
|
+
export { Branch, BranchContent, BranchControl, BranchIndentGuide, BranchIndicator, BranchText, Checkbox, Context, Item, ItemIndicator, ItemText, Label, NodeCheckbox, NodeCheckboxIndicator, NodeCheckboxProps, NodeProvider, NodeProviderProps, NodeRenameInput, Root, RootProps, Tree };
|
|
13
|
+
}
|
|
14
|
+
type StyleProps = TreeViewVariantProps & HTMLStyledProps$1<'div'>;
|
|
15
|
+
type RootProps<T> = Assign<TreeViewRootProps<T>, StyleProps> & RefAttributes<HTMLDivElement>;
|
|
16
|
+
type NodeCheckboxProps = ComponentProps<typeof NodeCheckbox>;
|
|
17
|
+
declare const Root: TreeView.RootComponent<StyleProps>;
|
|
18
|
+
declare const Branch: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.BranchProps & RefAttributes<HTMLDivElement>>>;
|
|
19
|
+
declare const BranchContent: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.BranchContentProps & RefAttributes<HTMLDivElement>>>;
|
|
20
|
+
declare const BranchControl: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.BranchControlProps & RefAttributes<HTMLDivElement>>>;
|
|
21
|
+
declare const BranchIndentGuide: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.BranchIndentGuideProps & RefAttributes<HTMLDivElement>>>;
|
|
22
|
+
declare const BranchText: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.BranchTextProps & RefAttributes<HTMLSpanElement>>>;
|
|
23
|
+
declare const Item: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.ItemProps & RefAttributes<HTMLDivElement>>>;
|
|
24
|
+
declare const ItemIndicator: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.ItemIndicatorProps & RefAttributes<HTMLDivElement>>>;
|
|
25
|
+
declare const ItemText: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.ItemTextProps & RefAttributes<HTMLSpanElement>>>;
|
|
26
|
+
declare const Label: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.LabelProps & RefAttributes<HTMLHeadingElement>>>;
|
|
27
|
+
declare const NodeCheckbox: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.NodeCheckboxProps & RefAttributes<HTMLSpanElement>>>;
|
|
28
|
+
declare const NodeRenameInput: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.NodeRenameInputProps & RefAttributes<HTMLInputElement>>>;
|
|
29
|
+
declare const Tree: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<TreeView.TreeProps & RefAttributes<HTMLDivElement>>>;
|
|
30
|
+
declare const NodeCheckboxIndicator: {
|
|
31
|
+
(props: TreeView.NodeCheckboxIndicatorProps): react_jsx_runtime0.JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
declare const BranchIndicator: react.ForwardRefExoticComponent<Omit<HTMLStyledProps$1<"div">, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const Checkbox: (props: NodeCheckboxProps) => react_jsx_runtime0.JSX.Element;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { type TreeCollection, tree_view_d_exports as TreeView, createTreeCollection };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { treeView } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { ChevronRightIcon } from "lucide-react";
|
|
6
|
+
import { Show } from "@pyck/react/show";
|
|
7
|
+
import { TreeView, TreeViewContext as Context, TreeViewNodeProvider as NodeProvider, createTreeCollection, useTreeViewNodeContext } from "@ark-ui/react/tree-view";
|
|
8
|
+
import { Checkmark } from "@pyck/react/checkmark";
|
|
9
|
+
|
|
10
|
+
//#region src/components/tree-view/tree-view.tsx
|
|
11
|
+
var tree_view_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
Branch: () => Branch,
|
|
13
|
+
BranchContent: () => BranchContent,
|
|
14
|
+
BranchControl: () => BranchControl,
|
|
15
|
+
BranchIndentGuide: () => BranchIndentGuide,
|
|
16
|
+
BranchIndicator: () => BranchIndicator,
|
|
17
|
+
BranchText: () => BranchText,
|
|
18
|
+
Checkbox: () => Checkbox,
|
|
19
|
+
Context: () => Context,
|
|
20
|
+
Item: () => Item,
|
|
21
|
+
ItemIndicator: () => ItemIndicator,
|
|
22
|
+
ItemText: () => ItemText,
|
|
23
|
+
Label: () => Label,
|
|
24
|
+
NodeCheckbox: () => NodeCheckbox,
|
|
25
|
+
NodeCheckboxIndicator: () => NodeCheckboxIndicator,
|
|
26
|
+
NodeProvider: () => NodeProvider,
|
|
27
|
+
NodeRenameInput: () => NodeRenameInput,
|
|
28
|
+
Root: () => Root,
|
|
29
|
+
Tree: () => Tree
|
|
30
|
+
});
|
|
31
|
+
const { withProvider, withContext } = createStyleContext(treeView);
|
|
32
|
+
const Root = withProvider(TreeView.Root, "root");
|
|
33
|
+
const Branch = withContext(TreeView.Branch, "branch");
|
|
34
|
+
const BranchContent = withContext(TreeView.BranchContent, "branchContent");
|
|
35
|
+
const BranchControl = withContext(TreeView.BranchControl, "branchControl");
|
|
36
|
+
const BranchIndentGuide = withContext(TreeView.BranchIndentGuide, "branchIndentGuide");
|
|
37
|
+
const BranchText = withContext(TreeView.BranchText, "branchText");
|
|
38
|
+
const Item = withContext(TreeView.Item, "item");
|
|
39
|
+
const ItemIndicator = withContext(TreeView.ItemIndicator, "itemIndicator");
|
|
40
|
+
const ItemText = withContext(TreeView.ItemText, "itemText");
|
|
41
|
+
const Label = withContext(TreeView.Label, "label");
|
|
42
|
+
const NodeCheckbox = withContext(TreeView.NodeCheckbox, "nodeCheckbox");
|
|
43
|
+
const NodeRenameInput = withContext(TreeView.NodeRenameInput, "nodeRenameInput");
|
|
44
|
+
const Tree = withContext(TreeView.Tree, "tree");
|
|
45
|
+
const NodeCheckboxIndicator = TreeView.NodeCheckboxIndicator;
|
|
46
|
+
const StyledBranchIndicator = withContext(TreeView.BranchIndicator, "branchIndicator");
|
|
47
|
+
const BranchIndicator = forwardRef(function BranchIndicator(props, ref) {
|
|
48
|
+
const node = useTreeViewNodeContext();
|
|
49
|
+
return <Show when={node.isBranch} fallback={<svg aria-hidden="true" focusable="false" />}>
|
|
50
|
+
<StyledBranchIndicator ref={ref} {...props}>
|
|
51
|
+
<ChevronRightIcon />
|
|
52
|
+
</StyledBranchIndicator>
|
|
53
|
+
</Show>;
|
|
54
|
+
});
|
|
55
|
+
const Checkbox = (props) => {
|
|
56
|
+
const node = useTreeViewNodeContext();
|
|
57
|
+
return <NodeCheckbox {...props}>
|
|
58
|
+
<Checkmark size="sm" checked={node.checked === true} indeterminate={node.checked === "indeterminate"} />
|
|
59
|
+
</NodeCheckbox>;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { tree_view_exports as TreeView, createTreeCollection };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/wrap/wrap.d.ts
|
|
4
|
+
interface WrapProps {
|
|
5
|
+
when: boolean | undefined | null;
|
|
6
|
+
with: (children: ReactNode) => ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const Wrap: ({
|
|
10
|
+
when,
|
|
11
|
+
with: wrapper,
|
|
12
|
+
children
|
|
13
|
+
}: WrapProps) => ReactNode;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Wrap, type WrapProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DateInput, Locale, getDateFormats } from "@pyck/react/utils";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/display-date-value/display-date-value.d.ts
|
|
5
|
+
type DateFormatType = keyof ReturnType<typeof getDateFormats> | (string & {});
|
|
6
|
+
interface DisplayDateValueProps {
|
|
7
|
+
value: DateInput;
|
|
8
|
+
format?: DateFormatType;
|
|
9
|
+
type?: 'date' | 'time' | 'datetime' | 'relative';
|
|
10
|
+
locale?: Locale;
|
|
11
|
+
copyable?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const DisplayDateValue: (props: DisplayDateValueProps) => react_jsx_runtime0.JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { DisplayDateValue as n, DisplayDateValueProps as r, DateFormatType as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { t as DisplayValue } from "./display-value-BNKxQ99u.js";
|
|
2
|
+
import { formatDate, formatDateTime, getDateFormats, isString } from "@pyck/react/utils";
|
|
3
|
+
|
|
4
|
+
//#region src/components/display-date-value/display-date-value.tsx
|
|
5
|
+
const DisplayDateValue = (props) => {
|
|
6
|
+
const { value, format, copyable, type = "date", locale: localeProp } = props;
|
|
7
|
+
const locale = localeProp ?? "en-US";
|
|
8
|
+
const formatValue = (date) => {
|
|
9
|
+
if (format && isString(format) && !isDateFormatKey(format, locale)) return formatDate(date, format, locale);
|
|
10
|
+
if (format && isDateFormatKey(format, locale)) return formatDate(date, getDateFormats(locale)[format], locale);
|
|
11
|
+
return formatDateTime(date, type, locale);
|
|
12
|
+
};
|
|
13
|
+
return <DisplayValue value={value} formatValue={formatValue} copyable={copyable} />;
|
|
14
|
+
};
|
|
15
|
+
const isDateFormatKey = (format, locale) => {
|
|
16
|
+
const formats = getDateFormats(locale);
|
|
17
|
+
return Object.keys(formats).includes(format);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DisplayDateValue as t };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HStack, VisuallyHidden } from "@pyck/styled-system/jsx";
|
|
2
|
+
import { isString } from "@pyck/react/utils";
|
|
3
|
+
import { Show } from "@pyck/react/show";
|
|
4
|
+
import { Clipboard } from "@pyck/react/clipboard";
|
|
5
|
+
import { Span } from "@pyck/react/span";
|
|
6
|
+
import { Wrap } from "@pyck/react/wrap";
|
|
7
|
+
|
|
8
|
+
//#region src/components/display-value/display-value.tsx
|
|
9
|
+
const DisplayValue = (props) => {
|
|
10
|
+
const { value, copyable, formatValue } = props;
|
|
11
|
+
const formattedValue = isNotEmpty(value) ? formatValue?.(value) ?? String(value) : null;
|
|
12
|
+
return <Show when={formattedValue != null} fallback={<>
|
|
13
|
+
<Span color="fg.subtle" aria-hidden>
|
|
14
|
+
—
|
|
15
|
+
</Span>
|
|
16
|
+
<VisuallyHidden>No value</VisuallyHidden>
|
|
17
|
+
</>}>
|
|
18
|
+
<Wrap when={copyable} with={(children) => <Clipboard.Root value={formattedValue} timeout={400}>
|
|
19
|
+
<Clipboard.Trigger _hover={{ "& [data-part=\"indicator\"]": { opacity: 1 } }} _active={{ "& [data-part=\"indicator\"]": { opacity: 1 } }}>
|
|
20
|
+
<HStack>
|
|
21
|
+
<Clipboard.Indicator color="fg.subtle" opacity="0" />
|
|
22
|
+
<Span>{children}</Span>
|
|
23
|
+
</HStack>
|
|
24
|
+
</Clipboard.Trigger>
|
|
25
|
+
</Clipboard.Root>}>
|
|
26
|
+
{formattedValue}
|
|
27
|
+
</Wrap>
|
|
28
|
+
</Show>;
|
|
29
|
+
};
|
|
30
|
+
const isNotEmpty = (value) => {
|
|
31
|
+
if (value == null) return false;
|
|
32
|
+
if (isString(value) || Array.isArray(value)) return value.length > 0;
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { DisplayValue as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/display-value/display-value.d.ts
|
|
4
|
+
interface DisplayValueProps<T> {
|
|
5
|
+
value?: T | null | undefined;
|
|
6
|
+
formatValue?: (value: NonNullable<T>) => string | null | undefined;
|
|
7
|
+
copyable?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const DisplayValue: <T>(props: DisplayValueProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { DisplayValueProps as n, DisplayValue as t };
|