@journ/nude 0.1.1 → 0.1.3
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/accordion-parts.d.ts +6 -5
- package/dist/accordion.d.ts +4 -4
- package/dist/alert-dialog-parts.d.ts +9 -8
- package/dist/alert-dialog.d.ts +10 -9
- package/dist/alert.d.ts +13 -6
- package/dist/animated-size.d.ts +3 -3
- package/dist/animated-size.js +1 -1
- package/dist/avatar-parts.d.ts +5 -4
- package/dist/avatar.d.ts +3 -3
- package/dist/badge.d.ts +2 -1
- package/dist/breadcrumbs.d.ts +13 -6
- package/dist/bulk-bar.d.ts +8 -3
- package/dist/button.d.ts +4 -4
- package/dist/calendar-parts.d.ts +23 -26
- package/dist/calendar-parts.js +5 -3
- package/dist/card.d.ts +15 -7
- package/dist/carousel-parts.d.ts +20 -11
- package/dist/carousel-parts.js +3 -2
- package/dist/checkbox-parts.d.ts +3 -2
- package/dist/checkbox.d.ts +3 -2
- package/dist/chip.d.ts +9 -7
- package/dist/collapsible-parts.d.ts +4 -3
- package/dist/collapsible.d.ts +4 -3
- package/dist/combobox-parts.d.ts +19 -63
- package/dist/combobox-parts.js +8 -2
- package/dist/combobox.d.ts +13 -76
- package/dist/command-palette-parts.d.ts +3 -3
- package/dist/command-palette-parts.js +1 -1
- package/dist/command-palette.d.ts +8 -54
- package/dist/composer.d.ts +5 -2
- package/dist/context-menu-parts.d.ts +8 -4
- package/dist/context-menu-parts.js +5 -1
- package/dist/context-menu.d.ts +8 -7
- package/dist/currency-input-parts.d.ts +4 -3
- package/dist/currency-input-parts.js +5 -2
- package/dist/data-table-parts.d.ts +18 -25
- package/dist/data-table-parts.js +1 -2
- package/dist/date-input-parts.d.ts +4 -3
- package/dist/date-input-parts.js +3 -2
- package/dist/date-picker-parts.d.ts +11 -10
- package/dist/date-picker-parts.js +6 -1
- package/dist/date-picker.d.ts +7 -21
- package/dist/date-range-picker-parts.d.ts +11 -10
- package/dist/date-range-picker-parts.js +6 -1
- package/dist/date-range-picker.d.ts +7 -21
- package/dist/description-list.d.ts +7 -3
- package/dist/dialog-parts.d.ts +8 -7
- package/dist/dialog.d.ts +10 -9
- package/dist/divider.d.ts +2 -1
- package/dist/drawer-parts.d.ts +9 -20
- package/dist/drawer.d.ts +10 -22
- package/dist/dropdown-menu-parts.d.ts +8 -4
- package/dist/dropdown-menu-parts.js +5 -1
- package/dist/dropdown-menu.d.ts +8 -7
- package/dist/empty-state.d.ts +11 -5
- package/dist/field-parts.d.ts +8 -7
- package/dist/field-parts.js +1 -1
- package/dist/file-dropzone-parts.d.ts +8 -7
- package/dist/file-dropzone.d.ts +4 -4
- package/dist/heading.d.ts +3 -3
- package/dist/hover-card-parts.d.ts +4 -4
- package/dist/hover-card.d.ts +3 -3
- package/dist/icon-button.d.ts +3 -2
- package/dist/icon.d.ts +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/input.d.ts +2 -1
- package/dist/lib/commit-on.d.ts +6 -5
- package/dist/lib/menu-parts.d.ts +9 -7
- package/dist/lib/modal-content.d.ts +5 -4
- package/dist/lib/modal-parts.d.ts +3 -2
- package/dist/lib/part.d.ts +3 -2
- package/dist/lib/picker.d.ts +18 -15
- package/dist/lib/picker.js +2 -1
- package/dist/link.d.ts +3 -3
- package/dist/list-row.d.ts +22 -0
- package/dist/list-row.js +14 -0
- package/dist/markdown.d.ts +2 -2
- package/dist/message.d.ts +9 -6
- package/dist/month-picker-parts.d.ts +2 -2
- package/dist/month-picker-parts.js +2 -2
- package/dist/month-stepper-parts.d.ts +7 -6
- package/dist/month-stepper-parts.js +3 -2
- package/dist/multiple-selector-parts.d.ts +23 -11
- package/dist/multiple-selector-parts.js +8 -3
- package/dist/multiple-selector.d.ts +11 -64
- package/dist/nav-bar.d.ts +5 -2
- package/dist/navigation-menu-parts.d.ts +8 -7
- package/dist/navigation-menu.d.ts +6 -6
- package/dist/otp-input-parts.d.ts +4 -3
- package/dist/otp-input.d.ts +4 -3
- package/dist/page-header.d.ts +7 -3
- package/dist/page.d.ts +7 -3
- package/dist/pagination.d.ts +12 -7
- package/dist/pill-select.d.ts +2 -1
- package/dist/popover-parts.d.ts +5 -5
- package/dist/popover.d.ts +4 -4
- package/dist/portal.d.ts +1 -1
- package/dist/progress-parts.d.ts +5 -4
- package/dist/progress-parts.js +1 -1
- package/dist/quantity-input-parts.d.ts +7 -6
- package/dist/quantity-input-parts.js +5 -2
- package/dist/radio-parts.d.ts +4 -3
- package/dist/radio.d.ts +2 -2
- package/dist/scroll-area-parts.d.ts +7 -6
- package/dist/scroll-area.d.ts +4 -4
- package/dist/select-parts.d.ts +10 -9
- package/dist/select.d.ts +6 -6
- package/dist/sheet-parts.d.ts +5 -5
- package/dist/sheet.d.ts +9 -7
- package/dist/sidebar.d.ts +19 -9
- package/dist/skeleton.d.ts +2 -1
- package/dist/slider-parts.d.ts +5 -4
- package/dist/slider.d.ts +5 -4
- package/dist/spinner.d.ts +2 -2
- package/dist/stack-parts.d.ts +8 -7
- package/dist/stack-parts.js +2 -1
- package/dist/stat.d.ts +9 -4
- package/dist/step-button.d.ts +4 -3
- package/dist/stepper-parts.d.ts +15 -10
- package/dist/stepper-parts.js +3 -2
- package/dist/stepper.d.ts +3 -3
- package/dist/styled.d.ts +5 -0
- package/dist/styled.js +0 -0
- package/dist/switch-parts.d.ts +3 -2
- package/dist/switch.d.ts +3 -2
- package/dist/table.d.ts +15 -7
- package/dist/tabs-parts.d.ts +5 -4
- package/dist/tabs.d.ts +5 -4
- package/dist/tag-input-parts.d.ts +18 -8
- package/dist/tag-input-parts.js +4 -2
- package/dist/text-morph.d.ts +3 -3
- package/dist/text-morph.js +1 -1
- package/dist/text-shimmer.d.ts +3 -3
- package/dist/text.d.ts +2 -1
- package/dist/textarea.d.ts +2 -1
- package/dist/time-range-parts.d.ts +6 -6
- package/dist/time-range-parts.js +3 -2
- package/dist/toast-parts.d.ts +7 -6
- package/dist/toggle-group-parts.d.ts +3 -2
- package/dist/toggle-group.d.ts +3 -2
- package/dist/tooltip-parts.d.ts +5 -5
- package/dist/tooltip.d.ts +3 -3
- package/dist/touch-target.d.ts +2 -2
- package/package.json +3 -3
package/dist/combobox-parts.d.ts
CHANGED
|
@@ -1,74 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Styled } from "./styled.js";
|
|
2
|
+
import { Picker, PickerActions, PickerContextValue, PickerState } from "./lib/picker.js";
|
|
3
|
+
import { ComponentPropsWithRef, JSX, ReactNode } from "react";
|
|
3
4
|
import { Command } from "cmdk";
|
|
4
5
|
//#region src/combobox-parts.d.ts
|
|
5
6
|
type ComboboxState = PickerState<string>;
|
|
6
7
|
type ComboboxActions = PickerActions<string>;
|
|
7
|
-
type ComboboxContextValue = Omit<PickerContextValue<string, object>,
|
|
8
|
-
declare const ContextProvider:
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
type ComboboxContextValue = Omit<PickerContextValue<string, object>, "meta">;
|
|
9
|
+
declare const ContextProvider: Picker<string>["ContextProvider"];
|
|
10
|
+
declare const Provider: Picker<string>["Provider"];
|
|
11
|
+
declare const Trigger: Picker<string>["Trigger"];
|
|
12
|
+
declare const Value: Picker<string>["Value"];
|
|
13
|
+
declare const useCombobox: Picker<string>["usePicker"];
|
|
11
14
|
type RootProps = {
|
|
12
15
|
value?: string | null;
|
|
13
16
|
defaultValue?: string | null;
|
|
14
17
|
onValueChange?: (value: string) => void;
|
|
15
18
|
children?: ReactNode;
|
|
16
19
|
};
|
|
17
|
-
declare const Root: ({ value, defaultValue, onValueChange, children }: RootProps) =>
|
|
20
|
+
declare const Root: ({ value, defaultValue, onValueChange, children }: RootProps) => JSX.Element;
|
|
18
21
|
/** Matches without accents or case, against the item's keywords when it has any. */
|
|
19
|
-
declare const Frame:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
26
|
-
label?: string;
|
|
27
|
-
shouldFilter?: boolean;
|
|
28
|
-
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
29
|
-
defaultValue?: string;
|
|
30
|
-
value?: string;
|
|
31
|
-
onValueChange?: (value: string) => void;
|
|
32
|
-
loop?: boolean;
|
|
33
|
-
disablePointerSelection?: boolean;
|
|
34
|
-
vimBindings?: boolean;
|
|
35
|
-
} & import("react").RefAttributes<HTMLDivElement>) => ReactNode;
|
|
36
|
-
declare const Input: (props: Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & {
|
|
37
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
38
|
-
} & {
|
|
39
|
-
asChild?: boolean;
|
|
40
|
-
}, "asChild" | "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
41
|
-
value?: string;
|
|
42
|
-
onValueChange?: (search: string) => void;
|
|
43
|
-
} & import("react").RefAttributes<HTMLInputElement>) => ReactNode;
|
|
44
|
-
declare const List: (props: {
|
|
45
|
-
children?: React.ReactNode;
|
|
46
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
47
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
48
|
-
} & {
|
|
49
|
-
asChild?: boolean;
|
|
50
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
51
|
-
label?: string;
|
|
52
|
-
} & import("react").RefAttributes<HTMLDivElement>) => ReactNode;
|
|
53
|
-
declare const Empty: (props: {
|
|
54
|
-
children?: React.ReactNode;
|
|
55
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
56
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
57
|
-
} & {
|
|
58
|
-
asChild?: boolean;
|
|
59
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>) => ReactNode;
|
|
60
|
-
declare const Group: (props: {
|
|
61
|
-
children?: React.ReactNode;
|
|
62
|
-
} & Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
63
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
64
|
-
} & {
|
|
65
|
-
asChild?: boolean;
|
|
66
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
|
|
67
|
-
heading?: React.ReactNode;
|
|
68
|
-
value?: string;
|
|
69
|
-
forceMount?: boolean;
|
|
70
|
-
} & import("react").RefAttributes<HTMLDivElement>) => ReactNode;
|
|
71
|
-
type ItemProps = Omit<ComponentPropsWithRef<typeof Command.Item>, 'value'> & {
|
|
22
|
+
declare const Frame: Styled<typeof Command>;
|
|
23
|
+
declare const Input: Styled<typeof Command.Input>;
|
|
24
|
+
declare const List: Styled<typeof Command.List>;
|
|
25
|
+
declare const Empty: Styled<typeof Command.Empty>;
|
|
26
|
+
declare const Group: Styled<typeof Command.Group>;
|
|
27
|
+
type ItemProps = Omit<ComponentPropsWithRef<typeof Command.Item>, "value"> & {
|
|
72
28
|
value: string;
|
|
73
29
|
};
|
|
74
30
|
type OptionProps = ItemProps & {
|
|
@@ -77,9 +33,9 @@ type OptionProps = ItemProps & {
|
|
|
77
33
|
onPick: (value: string) => void;
|
|
78
34
|
};
|
|
79
35
|
/** An option that knows nothing about the picker around it. Combobox, MultipleSelector and others build their items from it. */
|
|
80
|
-
declare const Option: ({ value, checked, onPick, onSelect, ...props }: OptionProps) =>
|
|
81
|
-
declare const Item: (props: ItemProps) =>
|
|
36
|
+
declare const Option: ({ value, checked, onPick, onSelect, ...props }: OptionProps) => JSX.Element;
|
|
37
|
+
declare const Item: (props: ItemProps) => JSX.Element;
|
|
82
38
|
/** Rendered only inside the checked item. */
|
|
83
|
-
declare const ItemIndicator: (props: ComponentPropsWithRef<
|
|
39
|
+
declare const ItemIndicator: (props: ComponentPropsWithRef<"span">) => ReactNode;
|
|
84
40
|
//#endregion
|
|
85
41
|
export { type ComboboxActions, type ComboboxContextValue, type ComboboxState, ContextProvider, Empty, Frame, Group, Input, Item, ItemIndicator, type ItemProps, List, Option, type OptionProps, Provider, Root, type RootProps, Trigger, Value, useCombobox };
|
package/dist/combobox-parts.js
CHANGED
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import { part } from "./lib/part.js";
|
|
3
3
|
import { createPicker } from "./lib/picker.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { createRequiredContext } from "@journ/lift";
|
|
5
|
+
import { createRequiredContext } from "@journ/lift/required-context";
|
|
6
6
|
import { Command } from "cmdk";
|
|
7
7
|
//#region src/combobox-parts.tsx
|
|
8
|
-
const
|
|
8
|
+
const picker = createPicker("Combobox", "combobox");
|
|
9
|
+
const ContextProvider = picker.ContextProvider;
|
|
10
|
+
const Provider = picker.Provider;
|
|
11
|
+
const Trigger = picker.Trigger;
|
|
12
|
+
const Value = picker.Value;
|
|
13
|
+
const useCombobox = picker.usePicker;
|
|
14
|
+
const usePickerState = picker.usePickerState;
|
|
9
15
|
const [ItemContext, useComboboxItem] = createRequiredContext("Combobox.Item");
|
|
10
16
|
const normalize = (text) => text.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase();
|
|
11
17
|
const matchKeywords = (value, search, keywords) => normalize(keywords?.length ? keywords.join(" ") : value).includes(normalize(search)) ? 1 : 0;
|
package/dist/combobox.d.ts
CHANGED
|
@@ -1,82 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ComboboxActions, ComboboxContextValue, ComboboxState, Item, ItemIndicator, Root, RootProps, useCombobox } from "./combobox-parts.js";
|
|
1
|
+
import { ComboboxActions, ComboboxContextValue, ComboboxState, Empty, Frame, Group, Input, Item, ItemIndicator, List, Provider, Root, RootProps, Trigger, Value, useCombobox } from "./combobox-parts.js";
|
|
2
|
+
import { Content, Description, Title } from "./drawer-parts.js";
|
|
4
3
|
//#region src/combobox.d.ts
|
|
5
4
|
declare const Combobox: {
|
|
6
|
-
Provider:
|
|
5
|
+
Provider: typeof Provider;
|
|
7
6
|
Root: typeof Root;
|
|
8
|
-
Trigger:
|
|
9
|
-
Value:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Portal: typeof import("vaul").Portal;
|
|
19
|
-
Handle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
20
|
-
preventCycle?: boolean | undefined;
|
|
21
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
-
Close: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
23
|
-
Title: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
24
|
-
Description: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
25
|
-
}>) => import("react").JSX.Element;
|
|
26
|
-
Title: (props: import("@radix-ui/react-dialog").DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>) => import("react").ReactNode;
|
|
27
|
-
Description: (props: import("@radix-ui/react-dialog").DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>) => import("react").ReactNode;
|
|
28
|
-
Frame: (props: {
|
|
29
|
-
children?: React.ReactNode;
|
|
30
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
31
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
32
|
-
} & {
|
|
33
|
-
asChild?: boolean;
|
|
34
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
35
|
-
label?: string;
|
|
36
|
-
shouldFilter?: boolean;
|
|
37
|
-
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
38
|
-
defaultValue?: string;
|
|
39
|
-
value?: string;
|
|
40
|
-
onValueChange?: (value: string) => void;
|
|
41
|
-
loop?: boolean;
|
|
42
|
-
disablePointerSelection?: boolean;
|
|
43
|
-
vimBindings?: boolean;
|
|
44
|
-
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
45
|
-
Input: (props: Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & {
|
|
46
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
47
|
-
} & {
|
|
48
|
-
asChild?: boolean;
|
|
49
|
-
}, "asChild" | "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
50
|
-
value?: string;
|
|
51
|
-
onValueChange?: (search: string) => void;
|
|
52
|
-
} & import("react").RefAttributes<HTMLInputElement>) => import("react").ReactNode;
|
|
53
|
-
List: (props: {
|
|
54
|
-
children?: React.ReactNode;
|
|
55
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
56
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
57
|
-
} & {
|
|
58
|
-
asChild?: boolean;
|
|
59
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
60
|
-
label?: string;
|
|
61
|
-
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
62
|
-
Empty: (props: {
|
|
63
|
-
children?: React.ReactNode;
|
|
64
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
65
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
66
|
-
} & {
|
|
67
|
-
asChild?: boolean;
|
|
68
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
69
|
-
Group: (props: {
|
|
70
|
-
children?: React.ReactNode;
|
|
71
|
-
} & Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
72
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
73
|
-
} & {
|
|
74
|
-
asChild?: boolean;
|
|
75
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
|
|
76
|
-
heading?: React.ReactNode;
|
|
77
|
-
value?: string;
|
|
78
|
-
forceMount?: boolean;
|
|
79
|
-
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
7
|
+
Trigger: typeof Trigger;
|
|
8
|
+
Value: typeof Value;
|
|
9
|
+
Content: typeof Content;
|
|
10
|
+
Title: typeof Title;
|
|
11
|
+
Description: typeof Description;
|
|
12
|
+
Frame: typeof Frame;
|
|
13
|
+
Input: typeof Input;
|
|
14
|
+
List: typeof List;
|
|
15
|
+
Empty: typeof Empty;
|
|
16
|
+
Group: typeof Group;
|
|
80
17
|
Item: typeof Item;
|
|
81
18
|
ItemIndicator: typeof ItemIndicator;
|
|
82
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Content as Content$1, Trigger } from "./dialog-parts.js";
|
|
2
|
-
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import { ComponentPropsWithRef, JSX, ReactNode } from "react";
|
|
3
3
|
//#region src/command-palette-parts.d.ts
|
|
4
4
|
type RootProps = {
|
|
5
5
|
open?: boolean;
|
|
@@ -12,11 +12,11 @@ type RootProps = {
|
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
};
|
|
14
14
|
/** A dialog that hosts the combobox list parts, opened globally with a keyboard shortcut. */
|
|
15
|
-
declare const Root: ({ open, defaultOpen, onOpenChange, onSelect, shortcut, children }: RootProps) =>
|
|
15
|
+
declare const Root: ({ open, defaultOpen, onOpenChange, onSelect, shortcut, children }: RootProps) => JSX.Element;
|
|
16
16
|
type ContentProps = ComponentPropsWithRef<typeof Content$1> & {
|
|
17
17
|
/** Read by screen readers only. */
|
|
18
18
|
title?: string;
|
|
19
19
|
};
|
|
20
|
-
declare const Content: ({ title, children, ...props }: ContentProps) =>
|
|
20
|
+
declare const Content: ({ title, children, ...props }: ContentProps) => JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { Content, type ContentProps, Root, type RootProps, Trigger };
|
|
@@ -4,7 +4,7 @@ import { Content as Content$1, Root as Root$1, Title, Trigger } from "./dialog-p
|
|
|
4
4
|
import { visuallyHidden } from "./lib/visually-hidden.js";
|
|
5
5
|
import { useEffect } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { useControllableState } from "@journ/lift";
|
|
7
|
+
import { useControllableState } from "@journ/lift/use-controllable-state";
|
|
8
8
|
//#region src/command-palette-parts.tsx
|
|
9
9
|
/** A dialog that hosts the combobox list parts, opened globally with a keyboard shortcut. */
|
|
10
10
|
const Root = ({ open, defaultOpen = false, onOpenChange, onSelect, shortcut = "k", children }) => {
|
|
@@ -1,62 +1,16 @@
|
|
|
1
|
-
import { Item, ItemIndicator } from "./combobox-parts.js";
|
|
1
|
+
import { Empty, Frame, Group, Input, Item, ItemIndicator, List } from "./combobox-parts.js";
|
|
2
|
+
import { Trigger } from "./dialog-parts.js";
|
|
2
3
|
import { Content, Root, RootProps } from "./command-palette-parts.js";
|
|
3
4
|
//#region src/command-palette.d.ts
|
|
4
5
|
declare const CommandPalette: {
|
|
5
6
|
Root: typeof Root;
|
|
6
|
-
Trigger:
|
|
7
|
+
Trigger: typeof Trigger;
|
|
7
8
|
Content: typeof Content;
|
|
8
|
-
Frame:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
asChild?: boolean;
|
|
14
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
15
|
-
label?: string;
|
|
16
|
-
shouldFilter?: boolean;
|
|
17
|
-
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
18
|
-
defaultValue?: string;
|
|
19
|
-
value?: string;
|
|
20
|
-
onValueChange?: (value: string) => void;
|
|
21
|
-
loop?: boolean;
|
|
22
|
-
disablePointerSelection?: boolean;
|
|
23
|
-
vimBindings?: boolean;
|
|
24
|
-
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
25
|
-
Input: (props: Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & {
|
|
26
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
27
|
-
} & {
|
|
28
|
-
asChild?: boolean;
|
|
29
|
-
}, "asChild" | "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
30
|
-
value?: string;
|
|
31
|
-
onValueChange?: (search: string) => void;
|
|
32
|
-
} & import("react").RefAttributes<HTMLInputElement>) => import("react").ReactNode;
|
|
33
|
-
List: (props: {
|
|
34
|
-
children?: React.ReactNode;
|
|
35
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
36
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
37
|
-
} & {
|
|
38
|
-
asChild?: boolean;
|
|
39
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
40
|
-
label?: string;
|
|
41
|
-
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
42
|
-
Empty: (props: {
|
|
43
|
-
children?: React.ReactNode;
|
|
44
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
45
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
46
|
-
} & {
|
|
47
|
-
asChild?: boolean;
|
|
48
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
49
|
-
Group: (props: {
|
|
50
|
-
children?: React.ReactNode;
|
|
51
|
-
} & Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
52
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
53
|
-
} & {
|
|
54
|
-
asChild?: boolean;
|
|
55
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
|
|
56
|
-
heading?: React.ReactNode;
|
|
57
|
-
value?: string;
|
|
58
|
-
forceMount?: boolean;
|
|
59
|
-
} & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
|
|
9
|
+
Frame: typeof Frame;
|
|
10
|
+
Input: typeof Input;
|
|
11
|
+
List: typeof List;
|
|
12
|
+
Empty: typeof Empty;
|
|
13
|
+
Group: typeof Group;
|
|
60
14
|
Item: typeof Item;
|
|
61
15
|
ItemIndicator: typeof ItemIndicator;
|
|
62
16
|
};
|
package/dist/composer.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { Styled } from "./styled.js";
|
|
1
2
|
//#region src/composer.d.ts
|
|
3
|
+
declare const Root: Styled<"div">;
|
|
4
|
+
declare const Input: Styled<"input">;
|
|
2
5
|
declare const Composer: {
|
|
3
|
-
Root:
|
|
4
|
-
Input:
|
|
6
|
+
Root: typeof Root;
|
|
7
|
+
Input: typeof Input;
|
|
5
8
|
};
|
|
6
9
|
//#endregion
|
|
7
10
|
export { Composer };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { Styled } from "./styled.js";
|
|
1
2
|
import * as RadixMenu from "@radix-ui/react-context-menu";
|
|
2
3
|
//#region src/context-menu-parts.d.ts
|
|
3
|
-
declare const Root:
|
|
4
|
-
declare const Trigger:
|
|
5
|
-
declare const Group:
|
|
6
|
-
declare const Content:
|
|
4
|
+
declare const Root: typeof RadixMenu.Root;
|
|
5
|
+
declare const Trigger: typeof RadixMenu.Trigger;
|
|
6
|
+
declare const Group: typeof RadixMenu.Group;
|
|
7
|
+
declare const Content: Styled<typeof RadixMenu.Content>;
|
|
8
|
+
declare const Item: Styled<typeof RadixMenu.Item>;
|
|
9
|
+
declare const Label: Styled<typeof RadixMenu.Label>;
|
|
10
|
+
declare const Separator: Styled<typeof RadixMenu.Separator>;
|
|
7
11
|
//#endregion
|
|
8
12
|
export { Content, Group, Item, Label, Root, Separator, Trigger };
|
|
@@ -5,6 +5,10 @@ import * as RadixMenu from "@radix-ui/react-context-menu";
|
|
|
5
5
|
const Root = RadixMenu.Root;
|
|
6
6
|
const Trigger = RadixMenu.Trigger;
|
|
7
7
|
const Group = RadixMenu.Group;
|
|
8
|
-
const
|
|
8
|
+
const menu = createMenuParts(RadixMenu, "context-menu");
|
|
9
|
+
const Content = menu.Content;
|
|
10
|
+
const Item = menu.Item;
|
|
11
|
+
const Label = menu.Label;
|
|
12
|
+
const Separator = menu.Separator;
|
|
9
13
|
//#endregion
|
|
10
14
|
export { Content, Group, Item, Label, Root, Separator, Trigger };
|
package/dist/context-menu.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { Content, Group, Item, Label, Root, Separator, Trigger } from "./context-menu-parts.js";
|
|
1
2
|
//#region src/context-menu.d.ts
|
|
2
3
|
declare const ContextMenu: {
|
|
3
|
-
Root:
|
|
4
|
-
Trigger:
|
|
5
|
-
Content:
|
|
6
|
-
Group:
|
|
7
|
-
Label:
|
|
8
|
-
Item:
|
|
9
|
-
Separator:
|
|
4
|
+
Root: typeof Root;
|
|
5
|
+
Trigger: typeof Trigger;
|
|
6
|
+
Content: typeof Content;
|
|
7
|
+
Group: typeof Group;
|
|
8
|
+
Label: typeof Label;
|
|
9
|
+
Item: typeof Item;
|
|
10
|
+
Separator: typeof Separator;
|
|
10
11
|
};
|
|
11
12
|
//#endregion
|
|
12
13
|
export { ContextMenu };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Styled } from "./styled.js";
|
|
1
2
|
import { Input } from "./input.js";
|
|
2
|
-
import {
|
|
3
|
+
import { JSX, ReactNode } from "react";
|
|
3
4
|
//#region src/currency-input-parts.d.ts
|
|
4
5
|
type RootProps = {
|
|
5
6
|
/** The amount, or null while empty. */
|
|
@@ -16,7 +17,7 @@ type RootProps = {
|
|
|
16
17
|
* An amount shown formatted ($1,234.50) and edited as plain digits. Typing is
|
|
17
18
|
* free until blur or Enter, then it is read in the locale and snapped to the bounds.
|
|
18
19
|
*/
|
|
19
|
-
declare const Root: ({ value, defaultValue, onValueChange, currency, locale, min, max, children }: RootProps) =>
|
|
20
|
-
declare const Field:
|
|
20
|
+
declare const Root: ({ value, defaultValue, onValueChange, currency, locale, min, max, children }: RootProps) => JSX.Element;
|
|
21
|
+
declare const Field: Styled<typeof Input>;
|
|
21
22
|
//#endregion
|
|
22
23
|
export { Field, Root, type RootProps };
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
import { Input } from "./input.js";
|
|
3
3
|
import { commitOn } from "./lib/commit-on.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { createRequiredContext
|
|
6
|
-
import {
|
|
5
|
+
import { createRequiredContext } from "@journ/lift/required-context";
|
|
6
|
+
import { useControllableState } from "@journ/lift/use-controllable-state";
|
|
7
|
+
import { clamp } from "@journ/fitter-happier/clamp";
|
|
8
|
+
import { formatPlain, parseLocalizedNumber } from "@journ/fitter-happier/number";
|
|
9
|
+
import { useDraft } from "@journ/lift/use-draft";
|
|
7
10
|
//#region src/currency-input-parts.tsx
|
|
8
11
|
const [CurrencyContext, useCurrency] = createRequiredContext("CurrencyInput.Root");
|
|
9
12
|
/**
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
+
import { Styled } from "./styled.js";
|
|
1
2
|
import { Table } from "./table.js";
|
|
2
|
-
import { ComponentPropsWithRef, ElementType, ReactNode } from "react";
|
|
3
|
-
import { ColumnDef, ReactTable, RowData, RowData as RowData$1, SortingState } from "@tanstack/react-table";
|
|
3
|
+
import { ComponentPropsWithRef, ElementType, JSX, ReactNode } from "react";
|
|
4
|
+
import { ColumnDef, ColumnHelper, ReactTable, RowData, RowData as RowData$1, SortingState, columnVisibilityFeature, createPaginatedRowModel, createSortedRowModel, rowPaginationFeature, rowSelectionFeature, rowSortingFeature } from "@tanstack/react-table";
|
|
4
5
|
//#region src/data-table-parts.d.ts
|
|
5
6
|
/** The table features journ turns on. Declared once so every part sees the same types. */
|
|
6
|
-
|
|
7
|
-
rowSortingFeature:
|
|
8
|
-
sortedRowModel:
|
|
9
|
-
rowSelectionFeature:
|
|
10
|
-
columnVisibilityFeature:
|
|
11
|
-
rowPaginationFeature:
|
|
12
|
-
paginatedRowModel:
|
|
7
|
+
type Features = {
|
|
8
|
+
rowSortingFeature: typeof rowSortingFeature;
|
|
9
|
+
sortedRowModel: ReturnType<typeof createSortedRowModel>;
|
|
10
|
+
rowSelectionFeature: typeof rowSelectionFeature;
|
|
11
|
+
columnVisibilityFeature: typeof columnVisibilityFeature;
|
|
12
|
+
rowPaginationFeature: typeof rowPaginationFeature;
|
|
13
|
+
paginatedRowModel: ReturnType<typeof createPaginatedRowModel>;
|
|
13
14
|
};
|
|
14
|
-
type Features = typeof features;
|
|
15
15
|
type DataTableColumn<TData extends RowData$1> = ColumnDef<Features, TData>;
|
|
16
16
|
/** Typed helper for building columns: `const column = dataTableColumns<Row>()`. */
|
|
17
|
-
declare const dataTableColumns: <TData extends RowData$1>() =>
|
|
18
|
-
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
19
|
-
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
20
|
-
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
21
|
-
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
22
|
-
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
23
|
-
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
24
|
-
}, TData>;
|
|
17
|
+
declare const dataTableColumns: <TData extends RowData$1>() => ColumnHelper<Features, TData>;
|
|
25
18
|
/** The components the parts render. A style layer swaps in its own; each receives the same props as the default. */
|
|
26
19
|
type DataTableComponents = {
|
|
27
20
|
Table: Record<keyof typeof Table, ElementType>;
|
|
@@ -79,23 +72,23 @@ type RootProps<TData extends RowData$1> = {
|
|
|
79
72
|
children?: ReactNode;
|
|
80
73
|
};
|
|
81
74
|
/** Owns sorting, selection, column visibility and paging, and shares the table with its parts. */
|
|
82
|
-
declare const Root: <TData extends RowData$1>({ data, columns, pageSize, getRowId, initialSorting, onSelectionChange, components, classNames, icons, children }: RootProps<TData>) =>
|
|
83
|
-
declare const Toolbar:
|
|
84
|
-
type TableViewProps = ComponentPropsWithRef<
|
|
75
|
+
declare const Root: <TData extends RowData$1>({ data, columns, pageSize, getRowId, initialSorting, onSelectionChange, components, classNames, icons, children }: RootProps<TData>) => JSX.Element;
|
|
76
|
+
declare const Toolbar: Styled<"div">;
|
|
77
|
+
type TableViewProps = ComponentPropsWithRef<"table"> & {
|
|
85
78
|
/** Shown in place of the rows when there are none. */
|
|
86
79
|
empty?: ReactNode;
|
|
87
80
|
};
|
|
88
81
|
/** Renders the header, rows and cells from the table state with the Table parts. */
|
|
89
|
-
declare const View: ({ empty, ...props }: TableViewProps) =>
|
|
82
|
+
declare const View: ({ empty, ...props }: TableViewProps) => JSX.Element;
|
|
90
83
|
/** A checkbox column with select all for the current page. Put it first in `columns`. */
|
|
91
84
|
declare const selectColumn: <TData extends RowData$1>() => DataTableColumn<TData>;
|
|
92
85
|
/** A popover with one checkbox per hideable column. Children replace the default trigger label. */
|
|
93
86
|
declare const ColumnPicker: ({ children }: {
|
|
94
87
|
children?: ReactNode;
|
|
95
|
-
}) =>
|
|
88
|
+
}) => JSX.Element;
|
|
96
89
|
/** Previous and next with the current page. Uses buttons, since paging stays on the page. */
|
|
97
|
-
declare const Pager:
|
|
90
|
+
declare const Pager: Styled<"nav">;
|
|
98
91
|
/** Appears while rows are selected. Children are the bulk actions. */
|
|
99
|
-
declare const SelectionBar: ({ children, ...props }: ComponentPropsWithRef<
|
|
92
|
+
declare const SelectionBar: ({ children, ...props }: ComponentPropsWithRef<"div">) => ReactNode;
|
|
100
93
|
//#endregion
|
|
101
94
|
export { ColumnPicker, type DataTableClassNames, type DataTableColumn, type DataTableComponents, type DataTableIcons, Pager, Root, type RootProps, type RowData, SelectionBar, type TableViewProps, Toolbar, View, dataTableColumns, selectColumn, useDataTable };
|
package/dist/data-table-parts.js
CHANGED
|
@@ -7,10 +7,9 @@ import { Content, Root as Root$2, Trigger } from "./popover-parts.js";
|
|
|
7
7
|
import { Table } from "./table.js";
|
|
8
8
|
import { useEffect, useRef } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { createRequiredContext } from "@journ/lift";
|
|
10
|
+
import { createRequiredContext } from "@journ/lift/required-context";
|
|
11
11
|
import { columnVisibilityFeature, createColumnHelper, createPaginatedRowModel, createSortedRowModel, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, tableFeatures, useTable } from "@tanstack/react-table";
|
|
12
12
|
//#region src/data-table-parts.tsx
|
|
13
|
-
/** The table features journ turns on. Declared once so every part sees the same types. */
|
|
14
13
|
const features = tableFeatures({
|
|
15
14
|
rowSortingFeature,
|
|
16
15
|
sortedRowModel: createSortedRowModel(),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Styled } from "./styled.js";
|
|
1
2
|
import { Input } from "./input.js";
|
|
2
|
-
import {
|
|
3
|
+
import { JSX, ReactNode } from "react";
|
|
3
4
|
//#region src/date-input-parts.d.ts
|
|
4
5
|
type RootProps = {
|
|
5
6
|
value?: Date | null;
|
|
@@ -9,7 +10,7 @@ type RootProps = {
|
|
|
9
10
|
children?: ReactNode;
|
|
10
11
|
};
|
|
11
12
|
/** Holds the typed text and commits a real date on blur or Enter. */
|
|
12
|
-
declare const Root: ({ value, defaultValue, onValueChange, locale, children }: RootProps) =>
|
|
13
|
-
declare const Field:
|
|
13
|
+
declare const Root: ({ value, defaultValue, onValueChange, locale, children }: RootProps) => JSX.Element;
|
|
14
|
+
declare const Field: Styled<typeof Input>;
|
|
14
15
|
//#endregion
|
|
15
16
|
export { Field, Root, type RootProps };
|
package/dist/date-input-parts.js
CHANGED
|
@@ -3,8 +3,9 @@ import { Input } from "./input.js";
|
|
|
3
3
|
import { commitOn } from "./lib/commit-on.js";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { createRequiredContext
|
|
7
|
-
import {
|
|
6
|
+
import { createRequiredContext } from "@journ/lift/required-context";
|
|
7
|
+
import { useControllableState } from "@journ/lift/use-controllable-state";
|
|
8
|
+
import { datePlaceholder, formatDate, parseDate } from "@journ/fitter-happier/parse-date";
|
|
8
9
|
//#region src/date-input-parts.tsx
|
|
9
10
|
const [DateInputContext, useDateInput] = createRequiredContext("DateInput.Root");
|
|
10
11
|
/** Holds the typed text and commits a real date on blur or Enter. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootProps as RootProps$1 } from "./calendar-parts.js";
|
|
2
|
-
import { PickerActions, PickerContextValue,
|
|
3
|
-
import { ReactNode } from "react";
|
|
2
|
+
import { Picker, PickerActions, PickerContextValue, PickerState } from "./lib/picker.js";
|
|
3
|
+
import { JSX, ReactNode } from "react";
|
|
4
4
|
//#region src/date-picker-parts.d.ts
|
|
5
5
|
type DatePickerMeta = {
|
|
6
6
|
locale?: string;
|
|
@@ -8,9 +8,10 @@ type DatePickerMeta = {
|
|
|
8
8
|
type DatePickerState = PickerState<Date>;
|
|
9
9
|
type DatePickerActions = PickerActions<Date>;
|
|
10
10
|
type DatePickerContextValue = PickerContextValue<Date, DatePickerMeta>;
|
|
11
|
-
declare const Provider:
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
declare const Provider: Picker<Date, DatePickerMeta>["Provider"];
|
|
12
|
+
declare const Trigger: Picker<Date, DatePickerMeta>["Trigger"];
|
|
13
|
+
declare const PickerValue: Picker<Date, DatePickerMeta>["Value"];
|
|
14
|
+
declare const useDatePicker: Picker<Date, DatePickerMeta>["usePicker"];
|
|
14
15
|
type RootProps = {
|
|
15
16
|
value?: Date | null;
|
|
16
17
|
defaultValue?: Date | null;
|
|
@@ -18,12 +19,12 @@ type RootProps = {
|
|
|
18
19
|
locale?: string;
|
|
19
20
|
children?: ReactNode;
|
|
20
21
|
};
|
|
21
|
-
declare const Root: ({ value, defaultValue, onValueChange, locale, children }: RootProps) =>
|
|
22
|
-
type ValueProps = Omit<React.ComponentProps<typeof PickerValue>,
|
|
22
|
+
declare const Root: ({ value, defaultValue, onValueChange, locale, children }: RootProps) => JSX.Element;
|
|
23
|
+
type ValueProps = Omit<React.ComponentProps<typeof PickerValue>, "children"> & {
|
|
23
24
|
format?: Intl.DateTimeFormatOptions;
|
|
24
25
|
};
|
|
25
|
-
declare const Value: ({ format, ...props }: ValueProps) =>
|
|
26
|
-
type CalendarProps = Omit<RootProps$1,
|
|
27
|
-
declare const Calendar: (props: CalendarProps) =>
|
|
26
|
+
declare const Value: ({ format, ...props }: ValueProps) => JSX.Element;
|
|
27
|
+
type CalendarProps = Omit<RootProps$1, "value" | "defaultValue" | "onValueChange" | "locale">;
|
|
28
|
+
declare const Calendar: (props: CalendarProps) => JSX.Element;
|
|
28
29
|
//#endregion
|
|
29
30
|
export { Calendar, type DatePickerActions, type DatePickerContextValue, type DatePickerMeta, type DatePickerState, Provider, Root, type RootProps, Trigger, Value, useDatePicker };
|
|
@@ -3,7 +3,12 @@ import { Root as Root$1 } from "./calendar-parts.js";
|
|
|
3
3
|
import { createPicker } from "./lib/picker.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/date-picker-parts.tsx
|
|
6
|
-
const
|
|
6
|
+
const picker = createPicker("DatePicker", "date-picker");
|
|
7
|
+
const Provider = picker.Provider;
|
|
8
|
+
const Trigger = picker.Trigger;
|
|
9
|
+
const PickerValue = picker.Value;
|
|
10
|
+
const useDatePicker = picker.usePicker;
|
|
11
|
+
const usePickerState = picker.usePickerState;
|
|
7
12
|
const Root = ({ value, defaultValue = null, onValueChange, locale = "en", children }) => {
|
|
8
13
|
const { state, actions } = usePickerState(value, defaultValue, onValueChange);
|
|
9
14
|
return /* @__PURE__ */ jsx(Provider, {
|