@wirekyt/react 0.0.1 → 0.0.2
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.cjs +209 -0
- package/dist/accordion.d.cts +69 -0
- package/dist/accordion.d.ts +69 -0
- package/dist/accordion.js +184 -0
- package/dist/angle-slider.cjs +193 -0
- package/dist/angle-slider.d.cts +73 -0
- package/dist/angle-slider.d.ts +73 -0
- package/dist/angle-slider.js +168 -0
- package/dist/avatar.cjs +120 -0
- package/dist/avatar.d.cts +48 -0
- package/dist/avatar.d.ts +48 -0
- package/dist/avatar.js +100 -0
- package/dist/carousel.cjs +246 -0
- package/dist/carousel.d.cts +94 -0
- package/dist/carousel.d.ts +94 -0
- package/dist/carousel.js +223 -0
- package/dist/checkbox.cjs +284 -0
- package/dist/checkbox.d.cts +115 -0
- package/dist/checkbox.d.ts +115 -0
- package/dist/checkbox.js +263 -0
- package/dist/client-only.cjs +12 -0
- package/dist/client-only.d.cts +8 -0
- package/dist/client-only.d.ts +8 -0
- package/dist/client-only.js +11 -0
- package/dist/clipboard.cjs +174 -0
- package/dist/clipboard.d.cts +70 -0
- package/dist/clipboard.d.ts +70 -0
- package/dist/clipboard.js +150 -0
- package/dist/collapsible-B62i_oPJ.cjs +185 -0
- package/dist/collapsible-CiTNjCNf.js +131 -0
- package/dist/collapsible.cjs +23 -0
- package/dist/collapsible.d.cts +56 -0
- package/dist/collapsible.d.ts +56 -0
- package/dist/collapsible.js +2 -0
- package/dist/collection-BFjWNdUS.cjs +223 -0
- package/dist/collection-BJOl6a4H.js +180 -0
- package/dist/collection.cjs +9 -0
- package/dist/collection.d.cts +2 -0
- package/dist/collection.d.ts +2 -0
- package/dist/collection.js +2 -0
- package/dist/color-picker.cjs +575 -0
- package/dist/color-picker.d.cts +179 -0
- package/dist/color-picker.d.ts +179 -0
- package/dist/color-picker.js +530 -0
- package/dist/combobox.cjs +390 -0
- package/dist/combobox.d.cts +128 -0
- package/dist/combobox.d.ts +128 -0
- package/dist/combobox.js +359 -0
- package/dist/core-CBFAnVIP.cjs +375 -0
- package/dist/core-CEYOEcVI.js +357 -0
- package/dist/date-input.cjs +217 -0
- package/dist/date-input.d.cts +69 -0
- package/dist/date-input.d.ts +69 -0
- package/dist/date-input.js +193 -0
- package/dist/date-picker.cjs +588 -0
- package/dist/date-picker.d.cts +190 -0
- package/dist/date-picker.d.ts +190 -0
- package/dist/date-picker.js +543 -0
- package/dist/dialog.cjs +199 -0
- package/dist/dialog.d.cts +78 -0
- package/dist/dialog.d.ts +78 -0
- package/dist/dialog.js +174 -0
- package/dist/download-trigger.cjs +53 -0
- package/dist/download-trigger.d.cts +22 -0
- package/dist/download-trigger.d.ts +22 -0
- package/dist/download-trigger.js +51 -0
- package/dist/drawer.cjs +296 -0
- package/dist/drawer.d.cts +115 -0
- package/dist/drawer.d.ts +115 -0
- package/dist/drawer.js +264 -0
- package/dist/editable.cjs +228 -0
- package/dist/editable.d.cts +79 -0
- package/dist/editable.d.ts +79 -0
- package/dist/editable.js +202 -0
- package/dist/environment-B6IaCAuQ.cjs +59 -0
- package/dist/environment-BTgKwk5E.js +42 -0
- package/dist/factory--dkoVnFK.d.cts +14 -0
- package/dist/factory--dkoVnFK.d.ts +14 -0
- package/dist/factory-CFFufs5e.cjs +59 -0
- package/dist/factory-Nm__-4xn.js +48 -0
- package/dist/field-Cy1E02DH.js +349 -0
- package/dist/field-x8H5uXB9.cjs +438 -0
- package/dist/field.cjs +22 -0
- package/dist/field.d.cts +129 -0
- package/dist/field.d.ts +129 -0
- package/dist/field.js +2 -0
- package/dist/fieldset-DWZXj1t5.cjs +232 -0
- package/dist/fieldset-fx44GCtM.js +178 -0
- package/dist/fieldset.cjs +18 -0
- package/dist/fieldset.d.cts +71 -0
- package/dist/fieldset.d.ts +71 -0
- package/dist/fieldset.js +3 -0
- package/dist/file-upload.cjs +328 -0
- package/dist/file-upload.d.cts +101 -0
- package/dist/file-upload.d.ts +101 -0
- package/dist/file-upload.js +298 -0
- package/dist/floating-panel.cjs +271 -0
- package/dist/floating-panel.d.cts +98 -0
- package/dist/floating-panel.d.ts +98 -0
- package/dist/floating-panel.js +242 -0
- package/dist/format.cjs +64 -0
- package/dist/format.d.cts +44 -0
- package/dist/format.d.ts +44 -0
- package/dist/format.js +54 -0
- package/dist/frame.cjs +85 -0
- package/dist/frame.d.cts +12 -0
- package/dist/frame.d.ts +12 -0
- package/dist/frame.js +84 -0
- package/dist/highlight.cjs +29 -0
- package/dist/highlight.d.cts +13 -0
- package/dist/highlight.d.ts +13 -0
- package/dist/highlight.js +27 -0
- package/dist/hover-card.cjs +154 -0
- package/dist/hover-card.d.cts +68 -0
- package/dist/hover-card.d.ts +68 -0
- package/dist/hover-card.js +131 -0
- package/dist/image-cropper.cjs +0 -0
- package/dist/image-cropper.d.cts +1 -0
- package/dist/image-cropper.d.ts +1 -0
- package/dist/image-cropper.js +0 -0
- package/dist/index-3Al0R5bH.d.cts +73 -0
- package/dist/index-B7wAg5Wf.d.ts +146 -0
- package/dist/index-BAn8qiCM.d.ts +73 -0
- package/dist/index-BSX88T_g.d.cts +146 -0
- package/dist/index-CQAbOgb7.d.cts +23 -0
- package/dist/index-CUyHBXOI.d.cts +33 -0
- package/dist/index-CW-Aj6aT.d.ts +95 -0
- package/dist/index-CxWYgVJk.d.ts +23 -0
- package/dist/index-D7JH9e9E.d.ts +33 -0
- package/dist/index-DTLK6Fuh.d.cts +95 -0
- package/dist/index-srZfUQNt.d.cts +20 -0
- package/dist/index-srZfUQNt.d.ts +20 -0
- package/dist/index.cjs +45 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/json-tree-view.cjs +244 -0
- package/dist/json-tree-view.d.cts +45 -0
- package/dist/json-tree-view.d.ts +45 -0
- package/dist/json-tree-view.js +234 -0
- package/dist/listbox.cjs +290 -0
- package/dist/listbox.d.cts +109 -0
- package/dist/listbox.d.ts +109 -0
- package/dist/listbox.js +264 -0
- package/dist/marquee.cjs +164 -0
- package/dist/marquee.d.cts +60 -0
- package/dist/marquee.d.ts +60 -0
- package/dist/marquee.js +142 -0
- package/dist/menu.cjs +506 -0
- package/dist/menu.d.cts +162 -0
- package/dist/menu.d.ts +162 -0
- package/dist/menu.js +469 -0
- package/dist/navigation-menu.cjs +331 -0
- package/dist/navigation-menu.d.cts +89 -0
- package/dist/navigation-menu.d.ts +89 -0
- package/dist/navigation-menu.js +303 -0
- package/dist/number-input.cjs +222 -0
- package/dist/number-input.d.cts +73 -0
- package/dist/number-input.d.ts +73 -0
- package/dist/number-input.js +197 -0
- package/dist/pagination.cjs +183 -0
- package/dist/pagination.d.cts +68 -0
- package/dist/pagination.d.ts +68 -0
- package/dist/pagination.js +159 -0
- package/dist/password-input.cjs +179 -0
- package/dist/password-input.d.cts +65 -0
- package/dist/password-input.d.ts +65 -0
- package/dist/password-input.js +156 -0
- package/dist/pin-input.cjs +180 -0
- package/dist/pin-input.d.cts +58 -0
- package/dist/pin-input.d.ts +58 -0
- package/dist/pin-input.js +158 -0
- package/dist/popover.cjs +222 -0
- package/dist/popover.d.cts +93 -0
- package/dist/popover.d.ts +93 -0
- package/dist/popover.js +194 -0
- package/dist/portal-6_XzBXiA.cjs +33 -0
- package/dist/portal-QYL_2wB0.js +28 -0
- package/dist/portal.cjs +3 -0
- package/dist/portal.d.cts +9 -0
- package/dist/portal.d.ts +9 -0
- package/dist/portal.js +2 -0
- package/dist/presence-BOs-D6Cv.cjs +96 -0
- package/dist/presence-I8Rceflw.js +65 -0
- package/dist/presence.cjs +7 -0
- package/dist/presence.d.cts +2 -0
- package/dist/presence.d.ts +2 -0
- package/dist/presence.js +2 -0
- package/dist/progress.cjs +206 -0
- package/dist/progress.d.cts +78 -0
- package/dist/progress.d.ts +78 -0
- package/dist/progress.js +180 -0
- package/dist/providers-DrJEJcrE.cjs +128 -0
- package/dist/providers-FEHnDTvb.js +87 -0
- package/dist/qr-code.cjs +154 -0
- package/dist/qr-code.d.cts +58 -0
- package/dist/qr-code.d.ts +58 -0
- package/dist/qr-code.js +132 -0
- package/dist/radio-group.cjs +222 -0
- package/dist/radio-group.d.cts +78 -0
- package/dist/radio-group.d.ts +78 -0
- package/dist/radio-group.js +196 -0
- package/dist/rating-group.cjs +186 -0
- package/dist/rating-group.d.cts +68 -0
- package/dist/rating-group.d.ts +68 -0
- package/dist/rating-group.js +162 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/rolldown-runtime-DakpK96I.cjs +43 -0
- package/dist/scroll-area.cjs +166 -0
- package/dist/scroll-area.d.cts +67 -0
- package/dist/scroll-area.d.ts +67 -0
- package/dist/scroll-area.js +143 -0
- package/dist/segment-group.cjs +215 -0
- package/dist/segment-group.d.cts +81 -0
- package/dist/segment-group.d.ts +81 -0
- package/dist/segment-group.js +194 -0
- package/dist/select.cjs +395 -0
- package/dist/select.d.cts +132 -0
- package/dist/select.d.ts +132 -0
- package/dist/select.js +358 -0
- package/dist/signature-pad.cjs +197 -0
- package/dist/signature-pad.d.cts +68 -0
- package/dist/signature-pad.d.ts +68 -0
- package/dist/signature-pad.js +173 -0
- package/dist/slider.cjs +260 -0
- package/dist/slider.d.cts +88 -0
- package/dist/slider.d.ts +88 -0
- package/dist/slider.js +232 -0
- package/dist/steps.cjs +271 -0
- package/dist/steps.d.cts +104 -0
- package/dist/steps.d.ts +104 -0
- package/dist/steps.js +241 -0
- package/dist/swap.cjs +134 -0
- package/dist/swap.d.cts +49 -0
- package/dist/swap.d.ts +49 -0
- package/dist/swap.js +121 -0
- package/dist/switch.cjs +166 -0
- package/dist/switch.d.cts +58 -0
- package/dist/switch.d.ts +58 -0
- package/dist/switch.js +144 -0
- package/dist/tabs.cjs +177 -0
- package/dist/tabs.d.cts +59 -0
- package/dist/tabs.d.ts +59 -0
- package/dist/tabs.js +155 -0
- package/dist/tags-input.cjs +298 -0
- package/dist/tags-input.d.cts +98 -0
- package/dist/tags-input.d.ts +98 -0
- package/dist/tags-input.js +268 -0
- package/dist/timer.cjs +167 -0
- package/dist/timer.d.cts +63 -0
- package/dist/timer.d.ts +63 -0
- package/dist/timer.js +144 -0
- package/dist/toast.cjs +154 -0
- package/dist/toast.d.cts +59 -0
- package/dist/toast.d.ts +59 -0
- package/dist/toast.js +132 -0
- package/dist/toggle-group.cjs +118 -0
- package/dist/toggle-group.d.cts +43 -0
- package/dist/toggle-group.d.ts +43 -0
- package/dist/toggle-group.js +99 -0
- package/dist/toggle.cjs +85 -0
- package/dist/toggle.d.cts +38 -0
- package/dist/toggle.d.ts +38 -0
- package/dist/toggle.js +71 -0
- package/dist/tooltip.cjs +154 -0
- package/dist/tooltip.d.cts +68 -0
- package/dist/tooltip.d.ts +68 -0
- package/dist/tooltip.js +131 -0
- package/dist/tour.cjs +290 -0
- package/dist/tour.d.cts +112 -0
- package/dist/tour.d.ts +112 -0
- package/dist/tour.js +246 -0
- package/dist/tree-view-CNTEWXlu.js +339 -0
- package/dist/tree-view-CU4Hl5X1.cjs +484 -0
- package/dist/tree-view.cjs +41 -0
- package/dist/tree-view.d.cts +3 -0
- package/dist/tree-view.d.ts +3 -0
- package/dist/tree-view.js +3 -0
- package/dist/types-BQQfrr86.d.cts +6 -0
- package/dist/types-BQQfrr86.d.ts +6 -0
- package/dist/use-context-38DKWHsx.cjs +20 -0
- package/dist/use-context-CITa6pn9.js +10 -0
- package/dist/utils-Cfwm9WW1.cjs +166 -0
- package/dist/utils-CqLmqrgj.js +107 -0
- package/package.json +274 -6
package/dist/timer.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { a as PropTypes } from "./index-CxWYgVJk.js";
|
|
2
|
+
import { r as Optional } from "./types-BQQfrr86.js";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory--dkoVnFK.js";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
import * as timer from "@wirekyt/dom/machines/timer";
|
|
6
|
+
import { ActionTriggerProps, ItemProps, TickDetails, anatomy as timerAnatomy } from "@wirekyt/dom/machines/timer";
|
|
7
|
+
//#region src/components/timer/action-trigger.d.ts
|
|
8
|
+
interface TimerActionTriggerBaseProps extends ActionTriggerProps, PolymorphicProps {}
|
|
9
|
+
interface TimerActionTriggerProps extends HTMLProps<"button">, TimerActionTriggerBaseProps {}
|
|
10
|
+
declare const TimerActionTrigger: import("react").ForwardRefExoticComponent<TimerActionTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/timer/area.d.ts
|
|
13
|
+
interface TimerAreaBaseProps extends PolymorphicProps {}
|
|
14
|
+
interface TimerAreaProps extends HTMLProps<"div">, TimerAreaBaseProps {}
|
|
15
|
+
declare const TimerArea: import("react").ForwardRefExoticComponent<TimerAreaProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/timer/use.d.ts
|
|
18
|
+
interface UseTimerProps extends Optional<Omit<timer.Props, "dir" | "getRootNode">, "id"> {}
|
|
19
|
+
interface UseTimerReturn extends timer.Api<PropTypes> {}
|
|
20
|
+
declare const useTimer: (props?: UseTimerProps) => UseTimerReturn;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/timer/use-context.d.ts
|
|
23
|
+
interface UseTimerContext extends UseTimerReturn {}
|
|
24
|
+
declare const TimerProvider: import("react").Provider<UseTimerContext>, useTimerContext: () => UseTimerContext;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/timer/context.d.ts
|
|
27
|
+
interface TimerContextProps {
|
|
28
|
+
children: (context: UseTimerContext) => ReactNode;
|
|
29
|
+
}
|
|
30
|
+
declare const TimerContext: (props: TimerContextProps) => ReactNode;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/timer/control.d.ts
|
|
33
|
+
interface TimerControlBaseProps extends PolymorphicProps {}
|
|
34
|
+
interface TimerControlProps extends HTMLProps<"div">, TimerControlBaseProps {}
|
|
35
|
+
declare const TimerControl: import("react").ForwardRefExoticComponent<TimerControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/components/timer/item.d.ts
|
|
38
|
+
interface TimerItemBaseProps extends ItemProps, PolymorphicProps {}
|
|
39
|
+
interface TimerItemProps extends HTMLProps<"div">, TimerItemBaseProps {}
|
|
40
|
+
declare const TimerItem: import("react").ForwardRefExoticComponent<TimerItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/timer/root.d.ts
|
|
43
|
+
interface TimerRootBaseProps extends UseTimerProps, PolymorphicProps {}
|
|
44
|
+
interface TimerRootProps extends HTMLProps<"div">, TimerRootBaseProps {}
|
|
45
|
+
declare const TimerRoot: import("react").ForwardRefExoticComponent<TimerRootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/timer/root-provider.d.ts
|
|
48
|
+
interface RootProviderProps {
|
|
49
|
+
value: UseTimerReturn;
|
|
50
|
+
}
|
|
51
|
+
interface TimerRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
|
|
52
|
+
interface TimerRootProviderProps extends HTMLProps<"div">, TimerRootProviderBaseProps {}
|
|
53
|
+
declare const TimerRootProvider: import("react").ForwardRefExoticComponent<TimerRootProviderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/timer/separator.d.ts
|
|
56
|
+
interface TimerSeparatorBaseProps extends PolymorphicProps {}
|
|
57
|
+
interface TimerSeparatorProps extends HTMLProps<"div">, TimerSeparatorBaseProps {}
|
|
58
|
+
declare const TimerSeparator: import("react").ForwardRefExoticComponent<TimerSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
59
|
+
declare namespace timer_d_exports {
|
|
60
|
+
export { TimerActionTrigger as ActionTrigger, TimerActionTriggerBaseProps as ActionTriggerBaseProps, TimerActionTriggerProps as ActionTriggerProps, TimerArea as Area, TimerAreaBaseProps as AreaBaseProps, TimerAreaProps as AreaProps, TimerContext as Context, TimerContextProps as ContextProps, TimerControl as Control, TimerControlBaseProps as ControlBaseProps, TimerControlProps as ControlProps, TimerItem as Item, TimerItemBaseProps as ItemBaseProps, TimerItemProps as ItemProps, TimerRoot as Root, TimerRootBaseProps as RootBaseProps, TimerRootProps as RootProps, TimerRootProvider as RootProvider, TimerRootProviderProps as RootProviderBaseProps, TimerRootProviderBaseProps as RootProviderProps, TimerSeparator as Separator, TimerSeparatorBaseProps as SeparatorBaseProps, TimerSeparatorProps as SeparatorProps, TickDetails };
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { timer_d_exports as Timer, TimerActionTrigger, type TimerActionTriggerBaseProps, type TimerActionTriggerProps, TimerArea, type TimerAreaBaseProps, type TimerAreaProps, TimerContext, type TimerContextProps, TimerControl, type TimerControlBaseProps, type TimerControlProps, TimerItem, type TimerItemBaseProps, type TimerItemProps, TimerRoot, type TimerRootBaseProps, type TimerRootProps, TimerRootProvider, type TimerRootProviderBaseProps, type TimerRootProviderProps, TimerSeparator, type TimerSeparatorBaseProps, type TimerSeparatorProps, type UseTimerContext, type UseTimerProps, type UseTimerReturn, timerAnatomy, useTimer, useTimerContext };
|
package/dist/timer.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { c as createSplitProps, u as createContext$1 } from "./utils-CqLmqrgj.js";
|
|
3
|
+
import { n as useEnvironmentContext } from "./environment-BTgKwk5E.js";
|
|
4
|
+
import { a as useMachine, i as normalizeProps, t as mergeProps } from "./core-CEYOEcVI.js";
|
|
5
|
+
import { n as wire } from "./factory-Nm__-4xn.js";
|
|
6
|
+
import "./providers-FEHnDTvb.js";
|
|
7
|
+
import { forwardRef, useId } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import * as timer from "@wirekyt/dom/machines/timer";
|
|
10
|
+
import { anatomy as timerAnatomy } from "@wirekyt/dom/machines/timer";
|
|
11
|
+
//#region src/components/timer/use-context.ts
|
|
12
|
+
const [TimerProvider, useTimerContext] = createContext$1({
|
|
13
|
+
name: "TimerContext",
|
|
14
|
+
hookName: "useTimerContext",
|
|
15
|
+
providerName: "<TimerProvider />"
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/timer/action-trigger.tsx
|
|
19
|
+
const splitActionTriggerProps = createSplitProps();
|
|
20
|
+
const TimerActionTrigger = forwardRef((props, ref) => {
|
|
21
|
+
const [actionTriggerProps, localProps] = splitActionTriggerProps(props, ["action"]);
|
|
22
|
+
const mergedProps = mergeProps(useTimerContext().getActionTriggerProps(actionTriggerProps), localProps);
|
|
23
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
24
|
+
...mergedProps,
|
|
25
|
+
ref
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
TimerActionTrigger.displayName = "TimerActionTrigger";
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/timer/area.tsx
|
|
31
|
+
const TimerArea = forwardRef((props, ref) => {
|
|
32
|
+
const mergedProps = mergeProps(useTimerContext().getAreaProps(), props);
|
|
33
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
34
|
+
...mergedProps,
|
|
35
|
+
ref
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
TimerArea.displayName = "TimerArea";
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/timer/context.tsx
|
|
41
|
+
const TimerContext = (props) => props.children(useTimerContext());
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/timer/control.tsx
|
|
44
|
+
const TimerControl = forwardRef((props, ref) => {
|
|
45
|
+
const mergedProps = mergeProps(useTimerContext().getControlProps(), props);
|
|
46
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
47
|
+
...mergedProps,
|
|
48
|
+
ref
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
TimerControl.displayName = "TimerControl";
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/timer/item.tsx
|
|
54
|
+
const splitItemProps = createSplitProps();
|
|
55
|
+
const TimerItem = forwardRef((props, ref) => {
|
|
56
|
+
const [itemProps, localProps] = splitItemProps(props, ["type"]);
|
|
57
|
+
const timer = useTimerContext();
|
|
58
|
+
const mergedProps = mergeProps(timer.getItemProps(itemProps), localProps);
|
|
59
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
60
|
+
...mergedProps,
|
|
61
|
+
ref,
|
|
62
|
+
children: timer.formattedTime[itemProps.type]
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
TimerItem.displayName = "TimerItem";
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/timer/use.ts
|
|
68
|
+
const useTimer = (props) => {
|
|
69
|
+
const id = useId();
|
|
70
|
+
const { getRootNode } = useEnvironmentContext();
|
|
71
|
+
const machineProps = {
|
|
72
|
+
id,
|
|
73
|
+
getRootNode,
|
|
74
|
+
...props
|
|
75
|
+
};
|
|
76
|
+
const service = useMachine(timer.machine, machineProps);
|
|
77
|
+
return timer.connect(service, normalizeProps);
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/components/timer/root.tsx
|
|
81
|
+
const splitRootProps = createSplitProps();
|
|
82
|
+
const TimerRoot = forwardRef((props, ref) => {
|
|
83
|
+
const [useTimerProps, localProps] = splitRootProps(props, [
|
|
84
|
+
"id",
|
|
85
|
+
"ids",
|
|
86
|
+
"autoStart",
|
|
87
|
+
"interval",
|
|
88
|
+
"countdown",
|
|
89
|
+
"startMs",
|
|
90
|
+
"targetMs",
|
|
91
|
+
"translations",
|
|
92
|
+
"onComplete",
|
|
93
|
+
"onTick"
|
|
94
|
+
]);
|
|
95
|
+
const timer = useTimer(useTimerProps);
|
|
96
|
+
const mergedProps = mergeProps(timer.getRootProps(), localProps);
|
|
97
|
+
return /* @__PURE__ */ jsx(TimerProvider, {
|
|
98
|
+
value: timer,
|
|
99
|
+
children: /* @__PURE__ */ jsx(wire.div, {
|
|
100
|
+
...mergedProps,
|
|
101
|
+
ref
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
TimerRoot.displayName = "TimerRoot";
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/components/timer/root-provider.tsx
|
|
108
|
+
const splitRootProviderProps = createSplitProps();
|
|
109
|
+
const TimerRootProvider = forwardRef((props, ref) => {
|
|
110
|
+
const [{ value: timer }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
111
|
+
const mergedProps = mergeProps(timer.getRootProps(), localProps);
|
|
112
|
+
return /* @__PURE__ */ jsx(TimerProvider, {
|
|
113
|
+
value: timer,
|
|
114
|
+
children: /* @__PURE__ */ jsx(wire.div, {
|
|
115
|
+
...mergedProps,
|
|
116
|
+
ref
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
TimerRootProvider.displayName = "TimerRootProvider";
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/components/timer/separator.tsx
|
|
123
|
+
const TimerSeparator = forwardRef((props, ref) => {
|
|
124
|
+
const mergedProps = mergeProps(useTimerContext().getSeparatorProps(), props);
|
|
125
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
126
|
+
...mergedProps,
|
|
127
|
+
ref
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
TimerSeparator.displayName = "TimerSeparator";
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/components/timer/timer.ts
|
|
133
|
+
var timer_exports = /* @__PURE__ */ __exportAll({
|
|
134
|
+
ActionTrigger: () => TimerActionTrigger,
|
|
135
|
+
Area: () => TimerArea,
|
|
136
|
+
Context: () => TimerContext,
|
|
137
|
+
Control: () => TimerControl,
|
|
138
|
+
Item: () => TimerItem,
|
|
139
|
+
Root: () => TimerRoot,
|
|
140
|
+
RootProvider: () => TimerRootProvider,
|
|
141
|
+
Separator: () => TimerSeparator
|
|
142
|
+
});
|
|
143
|
+
//#endregion
|
|
144
|
+
export { timer_exports as Timer, TimerActionTrigger, TimerArea, TimerContext, TimerControl, TimerItem, TimerRoot, TimerRootProvider, TimerSeparator, timerAnatomy, useTimer, useTimerContext };
|
package/dist/toast.cjs
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
3
|
+
const require_utils = require("./utils-Cfwm9WW1.cjs");
|
|
4
|
+
const require_environment = require("./environment-B6IaCAuQ.cjs");
|
|
5
|
+
const require_core = require("./core-CBFAnVIP.cjs");
|
|
6
|
+
const require_factory = require("./factory-CFFufs5e.cjs");
|
|
7
|
+
const require_providers = require("./providers-DrJEJcrE.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let _wirekyt_dom_machines_toast = require("@wirekyt/dom/machines/toast");
|
|
11
|
+
_wirekyt_dom_machines_toast = require_rolldown_runtime.__toESM(_wirekyt_dom_machines_toast, 1);
|
|
12
|
+
let _wirekyt_dom = require("@wirekyt/dom");
|
|
13
|
+
//#region src/components/toast/create-toaster.tsx
|
|
14
|
+
const createToaster = (props) => {
|
|
15
|
+
return _wirekyt_dom_machines_toast.createStore(props);
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/toast/use-context.ts
|
|
19
|
+
const [ToastProvider, useToastContext] = require_utils.createContext({
|
|
20
|
+
name: "ToastContext",
|
|
21
|
+
hookName: "useToastContext",
|
|
22
|
+
providerName: "<ToastProvider />"
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/toast/action-trigger.tsx
|
|
26
|
+
const ToastActionTrigger = (0, react.forwardRef)((props, ref) => {
|
|
27
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(useToastContext().getActionTriggerProps(), props);
|
|
28
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.button, {
|
|
29
|
+
...mergedProps,
|
|
30
|
+
ref
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
ToastActionTrigger.displayName = "ToastActionTrigger";
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/components/toast/close-trigger.tsx
|
|
36
|
+
const ToastCloseTrigger = (0, react.forwardRef)((props, ref) => {
|
|
37
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(useToastContext().getCloseTriggerProps(), props);
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.button, {
|
|
39
|
+
...mergedProps,
|
|
40
|
+
ref
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
ToastCloseTrigger.displayName = "ToastCloseTrigger";
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/toast/context.tsx
|
|
46
|
+
const ToastContext = (props) => props.children(useToastContext());
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/toast/description.tsx
|
|
49
|
+
const ToastDescription = (0, react.forwardRef)((props, ref) => {
|
|
50
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(useToastContext().getDescriptionProps(), props);
|
|
51
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.div, {
|
|
52
|
+
...mergedProps,
|
|
53
|
+
ref
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
ToastDescription.displayName = "ToastDescription";
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/toast/root.tsx
|
|
59
|
+
const ToastRoot = (0, react.forwardRef)((props, ref) => {
|
|
60
|
+
const toast = useToastContext();
|
|
61
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
62
|
+
...(0, _wirekyt_dom.mergeProps)(toast.getRootProps(), props),
|
|
63
|
+
ref,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ...toast.getGhostBeforeProps() }),
|
|
66
|
+
props.children,
|
|
67
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ...toast.getGhostAfterProps() })
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
ToastRoot.displayName = "ToastRoot";
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/components/toast/title.tsx
|
|
74
|
+
const ToastTitle = (0, react.forwardRef)((props, ref) => {
|
|
75
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(useToastContext().getTitleProps(), props);
|
|
76
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.div, {
|
|
77
|
+
...mergedProps,
|
|
78
|
+
ref
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
ToastTitle.displayName = "ToastTitle";
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/components/toast/toaster.tsx
|
|
84
|
+
const Toaster = (0, react.forwardRef)((props, ref) => {
|
|
85
|
+
const { toaster, children, ...localProps } = props;
|
|
86
|
+
const locale = require_providers.useLocaleContext();
|
|
87
|
+
const env = require_environment.useEnvironmentContext();
|
|
88
|
+
const service = require_core.useMachine(_wirekyt_dom_machines_toast.group.machine, {
|
|
89
|
+
store: toaster,
|
|
90
|
+
id: (0, react.useId)(),
|
|
91
|
+
dir: locale?.dir,
|
|
92
|
+
getRootNode: env?.getRootNode
|
|
93
|
+
});
|
|
94
|
+
const api = _wirekyt_dom_machines_toast.group.connect(service, require_core.normalizeProps);
|
|
95
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(api.getGroupProps(), localProps);
|
|
96
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.div, {
|
|
97
|
+
...mergedProps,
|
|
98
|
+
ref,
|
|
99
|
+
children: api.getToasts().map((toast, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastActor, {
|
|
100
|
+
value: toast,
|
|
101
|
+
parent: service,
|
|
102
|
+
index,
|
|
103
|
+
children: (ctx) => children(ctx)
|
|
104
|
+
}, toast.id))
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
Toaster.displayName = "Toaster";
|
|
108
|
+
const ToastActor = (props) => {
|
|
109
|
+
const env = require_environment.useEnvironmentContext();
|
|
110
|
+
const localProps = {
|
|
111
|
+
...props.value,
|
|
112
|
+
parent: props.parent,
|
|
113
|
+
index: props.index,
|
|
114
|
+
getRootNode: env.getRootNode
|
|
115
|
+
};
|
|
116
|
+
const service = require_core.useMachine(_wirekyt_dom_machines_toast.machine, { ...localProps });
|
|
117
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastProvider, {
|
|
118
|
+
value: _wirekyt_dom_machines_toast.connect(service, require_core.normalizeProps),
|
|
119
|
+
children: props.children(props.value)
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
ToastActor.displayName = "ToastActor";
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/components/toast/toast.ts
|
|
125
|
+
var toast_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
126
|
+
ActionTrigger: () => ToastActionTrigger,
|
|
127
|
+
CloseTrigger: () => ToastCloseTrigger,
|
|
128
|
+
Context: () => ToastContext,
|
|
129
|
+
Description: () => ToastDescription,
|
|
130
|
+
Root: () => ToastRoot,
|
|
131
|
+
Title: () => ToastTitle
|
|
132
|
+
});
|
|
133
|
+
//#endregion
|
|
134
|
+
Object.defineProperty(exports, "Toast", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function() {
|
|
137
|
+
return toast_exports;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
exports.ToastActionTrigger = ToastActionTrigger;
|
|
141
|
+
exports.ToastCloseTrigger = ToastCloseTrigger;
|
|
142
|
+
exports.ToastContext = ToastContext;
|
|
143
|
+
exports.ToastDescription = ToastDescription;
|
|
144
|
+
exports.ToastRoot = ToastRoot;
|
|
145
|
+
exports.ToastTitle = ToastTitle;
|
|
146
|
+
exports.Toaster = Toaster;
|
|
147
|
+
exports.createToaster = createToaster;
|
|
148
|
+
Object.defineProperty(exports, "toastAnatomy", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function() {
|
|
151
|
+
return _wirekyt_dom_machines_toast.anatomy;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
exports.useToastContext = useToastContext;
|
package/dist/toast.d.cts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { a as PropTypes } from "./index-CQAbOgb7.cjs";
|
|
2
|
+
import { t as Assign } from "./types-BQQfrr86.cjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory--dkoVnFK.cjs";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
import * as toast from "@wirekyt/dom/machines/toast";
|
|
6
|
+
import { ActionOptions, ActionOptions as ToastActionOptions, Placement, Placement as ToastPlacement, PromiseOptions, PromiseOptions as ToastPromiseOptions, Status, Status as ToastStatus, StatusChangeDetails, StatusChangeDetails as ToastStatusChangeDetails, StoreProps, StoreProps as ToastStoreProps, Type, Type as ToastType, anatomy as toastAnatomy } from "@wirekyt/dom/machines/toast";
|
|
7
|
+
//#region src/components/toast/create-toaster.d.ts
|
|
8
|
+
interface CreateToasterProps extends toast.StoreProps {}
|
|
9
|
+
interface CreateToasterReturn extends toast.Store {}
|
|
10
|
+
declare const createToaster: (props: toast.StoreProps) => toast.Store;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/toast/action-trigger.d.ts
|
|
13
|
+
interface ToastActionTriggerBaseProps extends PolymorphicProps {}
|
|
14
|
+
interface ToastActionTriggerProps extends HTMLProps<"button">, ToastActionTriggerBaseProps {}
|
|
15
|
+
declare const ToastActionTrigger: import("react").ForwardRefExoticComponent<ToastActionTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/toast/close-trigger.d.ts
|
|
18
|
+
interface ToastCloseTriggerBaseProps extends PolymorphicProps {}
|
|
19
|
+
interface ToastCloseTriggerProps extends HTMLProps<"button">, ToastCloseTriggerBaseProps {}
|
|
20
|
+
declare const ToastCloseTrigger: import("react").ForwardRefExoticComponent<ToastCloseTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/toast/use-context.d.ts
|
|
23
|
+
interface UseToastContext extends toast.Api<PropTypes, ReactNode> {}
|
|
24
|
+
declare const ToastProvider: import("react").Provider<UseToastContext>, useToastContext: () => UseToastContext;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/toast/context.d.ts
|
|
27
|
+
interface ToastContextProps {
|
|
28
|
+
children: (context: UseToastContext) => ReactNode;
|
|
29
|
+
}
|
|
30
|
+
declare const ToastContext: (props: ToastContextProps) => ReactNode;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/toast/description.d.ts
|
|
33
|
+
interface ToastDescriptionBaseProps extends PolymorphicProps {}
|
|
34
|
+
interface ToastDescriptionProps extends HTMLProps<"div">, ToastDescriptionBaseProps {}
|
|
35
|
+
declare const ToastDescription: import("react").ForwardRefExoticComponent<ToastDescriptionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/components/toast/root.d.ts
|
|
38
|
+
interface ToastRootBaseProps extends PolymorphicProps {}
|
|
39
|
+
interface ToastRootProps extends HTMLProps<"div">, ToastRootBaseProps {}
|
|
40
|
+
declare const ToastRoot: import("react").ForwardRefExoticComponent<ToastRootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/toast/title.d.ts
|
|
43
|
+
interface ToastTitleBaseProps extends PolymorphicProps {}
|
|
44
|
+
interface ToastTitleProps extends HTMLProps<"div">, ToastTitleBaseProps {}
|
|
45
|
+
declare const ToastTitle: import("react").ForwardRefExoticComponent<ToastTitleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/toast/toaster.d.ts
|
|
48
|
+
type ToastOptions = toast.Options<ReactNode>;
|
|
49
|
+
interface ToasterBaseProps extends PolymorphicProps, Omit<toast.GroupProps, "store" | "id"> {
|
|
50
|
+
toaster: CreateToasterReturn;
|
|
51
|
+
children: (toast: ToastOptions) => ReactNode;
|
|
52
|
+
}
|
|
53
|
+
interface ToasterProps extends Assign<HTMLProps<"div">, ToasterBaseProps> {}
|
|
54
|
+
declare const Toaster: import("react").ForwardRefExoticComponent<ToasterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
|
+
declare namespace toast_d_exports {
|
|
56
|
+
export { ActionOptions, ToastActionTrigger as ActionTrigger, ToastActionTriggerBaseProps as ActionTriggerBaseProps, ToastActionTriggerProps as ActionTriggerProps, ToastCloseTrigger as CloseTrigger, ToastCloseTriggerBaseProps as CloseTriggerBaseProps, ToastCloseTriggerProps as CloseTriggerProps, ToastContext as Context, ToastContextProps as ContextProps, ToastDescription as Description, ToastDescriptionBaseProps as DescriptionBaseProps, ToastDescriptionProps as DescriptionProps, ToastOptions as Options, Placement, PromiseOptions, ToastRoot as Root, ToastRootBaseProps as RootBaseProps, ToastRootProps as RootProps, Status, StatusChangeDetails, StoreProps, ToastTitle as Title, ToastTitleBaseProps as TitleBaseProps, ToastTitleProps as TitleProps, Type };
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { type CreateToasterProps, type CreateToasterReturn, toast_d_exports as Toast, type ToastActionOptions, ToastActionTrigger, type ToastActionTriggerBaseProps, type ToastActionTriggerProps, ToastCloseTrigger, type ToastCloseTriggerBaseProps, type ToastCloseTriggerProps, ToastContext, type ToastContextProps, ToastDescription, type ToastDescriptionBaseProps, type ToastDescriptionProps, type ToastOptions, type ToastPlacement, type ToastPromiseOptions, ToastRoot, type ToastRootBaseProps, type ToastRootProps, type ToastStatus, type ToastStatusChangeDetails, type ToastStoreProps, ToastTitle, type ToastTitleBaseProps, type ToastTitleProps, type ToastType, Toaster, type ToasterBaseProps, type ToasterProps, type UseToastContext, createToaster, toastAnatomy, useToastContext };
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { a as PropTypes } from "./index-CxWYgVJk.js";
|
|
2
|
+
import { t as Assign } from "./types-BQQfrr86.js";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory--dkoVnFK.js";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
import * as toast from "@wirekyt/dom/machines/toast";
|
|
6
|
+
import { ActionOptions, ActionOptions as ToastActionOptions, Placement, Placement as ToastPlacement, PromiseOptions, PromiseOptions as ToastPromiseOptions, Status, Status as ToastStatus, StatusChangeDetails, StatusChangeDetails as ToastStatusChangeDetails, StoreProps, StoreProps as ToastStoreProps, Type, Type as ToastType, anatomy as toastAnatomy } from "@wirekyt/dom/machines/toast";
|
|
7
|
+
//#region src/components/toast/create-toaster.d.ts
|
|
8
|
+
interface CreateToasterProps extends toast.StoreProps {}
|
|
9
|
+
interface CreateToasterReturn extends toast.Store {}
|
|
10
|
+
declare const createToaster: (props: toast.StoreProps) => toast.Store;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/toast/action-trigger.d.ts
|
|
13
|
+
interface ToastActionTriggerBaseProps extends PolymorphicProps {}
|
|
14
|
+
interface ToastActionTriggerProps extends HTMLProps<"button">, ToastActionTriggerBaseProps {}
|
|
15
|
+
declare const ToastActionTrigger: import("react").ForwardRefExoticComponent<ToastActionTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/toast/close-trigger.d.ts
|
|
18
|
+
interface ToastCloseTriggerBaseProps extends PolymorphicProps {}
|
|
19
|
+
interface ToastCloseTriggerProps extends HTMLProps<"button">, ToastCloseTriggerBaseProps {}
|
|
20
|
+
declare const ToastCloseTrigger: import("react").ForwardRefExoticComponent<ToastCloseTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/toast/use-context.d.ts
|
|
23
|
+
interface UseToastContext extends toast.Api<PropTypes, ReactNode> {}
|
|
24
|
+
declare const ToastProvider: import("react").Provider<UseToastContext>, useToastContext: () => UseToastContext;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/toast/context.d.ts
|
|
27
|
+
interface ToastContextProps {
|
|
28
|
+
children: (context: UseToastContext) => ReactNode;
|
|
29
|
+
}
|
|
30
|
+
declare const ToastContext: (props: ToastContextProps) => ReactNode;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/toast/description.d.ts
|
|
33
|
+
interface ToastDescriptionBaseProps extends PolymorphicProps {}
|
|
34
|
+
interface ToastDescriptionProps extends HTMLProps<"div">, ToastDescriptionBaseProps {}
|
|
35
|
+
declare const ToastDescription: import("react").ForwardRefExoticComponent<ToastDescriptionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/components/toast/root.d.ts
|
|
38
|
+
interface ToastRootBaseProps extends PolymorphicProps {}
|
|
39
|
+
interface ToastRootProps extends HTMLProps<"div">, ToastRootBaseProps {}
|
|
40
|
+
declare const ToastRoot: import("react").ForwardRefExoticComponent<ToastRootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/toast/title.d.ts
|
|
43
|
+
interface ToastTitleBaseProps extends PolymorphicProps {}
|
|
44
|
+
interface ToastTitleProps extends HTMLProps<"div">, ToastTitleBaseProps {}
|
|
45
|
+
declare const ToastTitle: import("react").ForwardRefExoticComponent<ToastTitleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/toast/toaster.d.ts
|
|
48
|
+
type ToastOptions = toast.Options<ReactNode>;
|
|
49
|
+
interface ToasterBaseProps extends PolymorphicProps, Omit<toast.GroupProps, "store" | "id"> {
|
|
50
|
+
toaster: CreateToasterReturn;
|
|
51
|
+
children: (toast: ToastOptions) => ReactNode;
|
|
52
|
+
}
|
|
53
|
+
interface ToasterProps extends Assign<HTMLProps<"div">, ToasterBaseProps> {}
|
|
54
|
+
declare const Toaster: import("react").ForwardRefExoticComponent<ToasterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
|
+
declare namespace toast_d_exports {
|
|
56
|
+
export { ActionOptions, ToastActionTrigger as ActionTrigger, ToastActionTriggerBaseProps as ActionTriggerBaseProps, ToastActionTriggerProps as ActionTriggerProps, ToastCloseTrigger as CloseTrigger, ToastCloseTriggerBaseProps as CloseTriggerBaseProps, ToastCloseTriggerProps as CloseTriggerProps, ToastContext as Context, ToastContextProps as ContextProps, ToastDescription as Description, ToastDescriptionBaseProps as DescriptionBaseProps, ToastDescriptionProps as DescriptionProps, ToastOptions as Options, Placement, PromiseOptions, ToastRoot as Root, ToastRootBaseProps as RootBaseProps, ToastRootProps as RootProps, Status, StatusChangeDetails, StoreProps, ToastTitle as Title, ToastTitleBaseProps as TitleBaseProps, ToastTitleProps as TitleProps, Type };
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { type CreateToasterProps, type CreateToasterReturn, toast_d_exports as Toast, type ToastActionOptions, ToastActionTrigger, type ToastActionTriggerBaseProps, type ToastActionTriggerProps, ToastCloseTrigger, type ToastCloseTriggerBaseProps, type ToastCloseTriggerProps, ToastContext, type ToastContextProps, ToastDescription, type ToastDescriptionBaseProps, type ToastDescriptionProps, type ToastOptions, type ToastPlacement, type ToastPromiseOptions, ToastRoot, type ToastRootBaseProps, type ToastRootProps, type ToastStatus, type ToastStatusChangeDetails, type ToastStoreProps, ToastTitle, type ToastTitleBaseProps, type ToastTitleProps, type ToastType, Toaster, type ToasterBaseProps, type ToasterProps, type UseToastContext, createToaster, toastAnatomy, useToastContext };
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { u as createContext$1 } from "./utils-CqLmqrgj.js";
|
|
3
|
+
import { n as useEnvironmentContext } from "./environment-BTgKwk5E.js";
|
|
4
|
+
import { a as useMachine, i as normalizeProps, t as mergeProps } from "./core-CEYOEcVI.js";
|
|
5
|
+
import { n as wire } from "./factory-Nm__-4xn.js";
|
|
6
|
+
import { a as useLocaleContext } from "./providers-FEHnDTvb.js";
|
|
7
|
+
import { forwardRef, useId } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import * as toast from "@wirekyt/dom/machines/toast";
|
|
10
|
+
import { anatomy as toastAnatomy } from "@wirekyt/dom/machines/toast";
|
|
11
|
+
//#region src/components/toast/create-toaster.tsx
|
|
12
|
+
const createToaster = (props) => {
|
|
13
|
+
return toast.createStore(props);
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/toast/use-context.ts
|
|
17
|
+
const [ToastProvider, useToastContext] = createContext$1({
|
|
18
|
+
name: "ToastContext",
|
|
19
|
+
hookName: "useToastContext",
|
|
20
|
+
providerName: "<ToastProvider />"
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/toast/action-trigger.tsx
|
|
24
|
+
const ToastActionTrigger = forwardRef((props, ref) => {
|
|
25
|
+
const mergedProps = mergeProps(useToastContext().getActionTriggerProps(), props);
|
|
26
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
27
|
+
...mergedProps,
|
|
28
|
+
ref
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
ToastActionTrigger.displayName = "ToastActionTrigger";
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/toast/close-trigger.tsx
|
|
34
|
+
const ToastCloseTrigger = forwardRef((props, ref) => {
|
|
35
|
+
const mergedProps = mergeProps(useToastContext().getCloseTriggerProps(), props);
|
|
36
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
37
|
+
...mergedProps,
|
|
38
|
+
ref
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
ToastCloseTrigger.displayName = "ToastCloseTrigger";
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/toast/context.tsx
|
|
44
|
+
const ToastContext = (props) => props.children(useToastContext());
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/components/toast/description.tsx
|
|
47
|
+
const ToastDescription = forwardRef((props, ref) => {
|
|
48
|
+
const mergedProps = mergeProps(useToastContext().getDescriptionProps(), props);
|
|
49
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
50
|
+
...mergedProps,
|
|
51
|
+
ref
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
ToastDescription.displayName = "ToastDescription";
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/toast/root.tsx
|
|
57
|
+
const ToastRoot = forwardRef((props, ref) => {
|
|
58
|
+
const toast = useToastContext();
|
|
59
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
...mergeProps(toast.getRootProps(), props),
|
|
61
|
+
ref,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsx("div", { ...toast.getGhostBeforeProps() }),
|
|
64
|
+
props.children,
|
|
65
|
+
/* @__PURE__ */ jsx("div", { ...toast.getGhostAfterProps() })
|
|
66
|
+
]
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
ToastRoot.displayName = "ToastRoot";
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/components/toast/title.tsx
|
|
72
|
+
const ToastTitle = forwardRef((props, ref) => {
|
|
73
|
+
const mergedProps = mergeProps(useToastContext().getTitleProps(), props);
|
|
74
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
75
|
+
...mergedProps,
|
|
76
|
+
ref
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
ToastTitle.displayName = "ToastTitle";
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/components/toast/toaster.tsx
|
|
82
|
+
const Toaster = forwardRef((props, ref) => {
|
|
83
|
+
const { toaster, children, ...localProps } = props;
|
|
84
|
+
const locale = useLocaleContext();
|
|
85
|
+
const env = useEnvironmentContext();
|
|
86
|
+
const service = useMachine(toast.group.machine, {
|
|
87
|
+
store: toaster,
|
|
88
|
+
id: useId(),
|
|
89
|
+
dir: locale?.dir,
|
|
90
|
+
getRootNode: env?.getRootNode
|
|
91
|
+
});
|
|
92
|
+
const api = toast.group.connect(service, normalizeProps);
|
|
93
|
+
const mergedProps = mergeProps(api.getGroupProps(), localProps);
|
|
94
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
95
|
+
...mergedProps,
|
|
96
|
+
ref,
|
|
97
|
+
children: api.getToasts().map((toast, index) => /* @__PURE__ */ jsx(ToastActor, {
|
|
98
|
+
value: toast,
|
|
99
|
+
parent: service,
|
|
100
|
+
index,
|
|
101
|
+
children: (ctx) => children(ctx)
|
|
102
|
+
}, toast.id))
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
Toaster.displayName = "Toaster";
|
|
106
|
+
const ToastActor = (props) => {
|
|
107
|
+
const env = useEnvironmentContext();
|
|
108
|
+
const localProps = {
|
|
109
|
+
...props.value,
|
|
110
|
+
parent: props.parent,
|
|
111
|
+
index: props.index,
|
|
112
|
+
getRootNode: env.getRootNode
|
|
113
|
+
};
|
|
114
|
+
const service = useMachine(toast.machine, { ...localProps });
|
|
115
|
+
return /* @__PURE__ */ jsx(ToastProvider, {
|
|
116
|
+
value: toast.connect(service, normalizeProps),
|
|
117
|
+
children: props.children(props.value)
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
ToastActor.displayName = "ToastActor";
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/components/toast/toast.ts
|
|
123
|
+
var toast_exports = /* @__PURE__ */ __exportAll({
|
|
124
|
+
ActionTrigger: () => ToastActionTrigger,
|
|
125
|
+
CloseTrigger: () => ToastCloseTrigger,
|
|
126
|
+
Context: () => ToastContext,
|
|
127
|
+
Description: () => ToastDescription,
|
|
128
|
+
Root: () => ToastRoot,
|
|
129
|
+
Title: () => ToastTitle
|
|
130
|
+
});
|
|
131
|
+
//#endregion
|
|
132
|
+
export { toast_exports as Toast, ToastActionTrigger, ToastCloseTrigger, ToastContext, ToastDescription, ToastRoot, ToastTitle, Toaster, createToaster, toastAnatomy, useToastContext };
|