@zayne-labs/ui-react 0.9.21 → 0.10.0
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/esm/{await-Fe4LFRKd.js → await-fjas2Q-C.js} +6 -8
- package/dist/esm/await-fjas2Q-C.js.map +1 -0
- package/dist/esm/{card-jkLXbuiw.js → card-TD60Xux0.js} +2 -2
- package/dist/esm/card-TD60Xux0.js.map +1 -0
- package/dist/esm/{carousel-Dvp-qURP.js → carousel-YXXtZ85s.js} +120 -102
- package/dist/esm/carousel-YXXtZ85s.js.map +1 -0
- package/dist/esm/cn-_FbtIrlZ.js.map +1 -1
- package/dist/esm/components/common/await/index.d.ts +4 -5
- package/dist/esm/components/common/await/index.js +5 -5
- package/dist/esm/components/common/error-boundary/index.d.ts +1 -1
- package/dist/esm/components/common/error-boundary/index.js +1 -1
- package/dist/esm/components/common/for/index.d.ts +1 -1
- package/dist/esm/components/common/for/index.js +1 -1
- package/dist/esm/components/common/index.d.ts +9 -10
- package/dist/esm/components/common/index.js +10 -10
- package/dist/esm/components/common/show/index.d.ts +1 -1
- package/dist/esm/components/common/show/index.js +2 -2
- package/dist/esm/components/common/slot/index.d.ts +1 -1
- package/dist/esm/components/common/slot/index.js +1 -1
- package/dist/esm/components/common/suspense-with-boundary/index.d.ts +2 -2
- package/dist/esm/components/common/suspense-with-boundary/index.js +2 -2
- package/dist/esm/components/common/switch/index.d.ts +1 -1
- package/dist/esm/components/common/switch/index.js +2 -2
- package/dist/esm/components/common/teleport/index.d.ts +1 -1
- package/dist/esm/components/common/teleport/index.js +1 -1
- package/dist/esm/components/ui/card/index.d.ts +1 -1
- package/dist/esm/components/ui/card/index.js +2 -2
- package/dist/esm/components/ui/carousel/index.d.ts +2 -2
- package/dist/esm/components/ui/carousel/index.js +12 -12
- package/dist/esm/components/ui/drag-scroll/index.d.ts +1 -1
- package/dist/esm/components/ui/drag-scroll/index.js +1 -1
- package/dist/esm/components/ui/drop-zone/index.d.ts +2 -3
- package/dist/esm/components/ui/drop-zone/index.js +12 -12
- package/dist/esm/components/ui/form/index.d.ts +1 -1
- package/dist/esm/components/ui/form/index.js +4 -4
- package/dist/esm/components/ui/index.d.ts +5 -6
- package/dist/esm/components/ui/index.js +15 -15
- package/dist/esm/{drag-scroll-BLjij7aI.js → drag-scroll-De6-soln.js} +16 -9
- package/dist/esm/drag-scroll-De6-soln.js.map +1 -0
- package/dist/esm/drop-zone-BPfSu99L.js +381 -0
- package/dist/esm/drop-zone-BPfSu99L.js.map +1 -0
- package/dist/esm/{error-boundary-B3ycUZ1t.js → error-boundary-xM9An3gz.js} +3 -4
- package/dist/esm/error-boundary-xM9An3gz.js.map +1 -0
- package/dist/esm/{for-aTw1TgJo.js → for-DGs2XZ21.js} +6 -6
- package/dist/esm/for-DGs2XZ21.js.map +1 -0
- package/dist/esm/{form-6RV0u4YT.js → form-Bkj1QWwb.js} +10 -10
- package/dist/esm/form-Bkj1QWwb.js.map +1 -0
- package/dist/esm/{getSlot-D1_uG-Ym.js → getSlot-Cf5ON6lE.js} +2 -2
- package/dist/esm/getSlot-Cf5ON6lE.js.map +1 -0
- package/dist/esm/index-BBGuBbI_.d.ts +183 -0
- package/dist/esm/{index-BwnMUHzm.d.ts → index-BBJzo-WC.d.ts} +2 -3
- package/dist/esm/{getSlotMap-DZlQN8--.d.ts → index-BNrCAe9Y.d.ts} +58 -2
- package/dist/esm/{index-gT9tVHv1.d.ts → index-BYhH4Fm0.d.ts} +1 -1
- package/dist/esm/{index-XYFc-mmy.d.ts → index-BeDmH7lX.d.ts} +1 -2
- package/dist/esm/{index-CIM4YPg5.d.ts → index-CMwCQ8qR.d.ts} +6 -7
- package/dist/esm/{index-B3N6YbN8.d.ts → index-CWKQ5V4B.d.ts} +2 -2
- package/dist/esm/{index-YFi-sIuR.d.ts → index-Ci8USVIW.d.ts} +6 -6
- package/dist/esm/{index-CNE9Cime.d.ts → index-CnvH74ea.d.ts} +4 -4
- package/dist/esm/{index-UX3DaMVe.d.ts → index-DJjxpXUk.d.ts} +1 -2
- package/dist/esm/{index-CFNg1R-m.d.ts → index-DM-Rbcq2.d.ts} +4 -4
- package/dist/esm/{index-CGI7EVlK.d.ts → index-DVr1tbxh.d.ts} +1 -2
- package/dist/esm/{index-DT8F8QKc.d.ts → index-DqutTJQB.d.ts} +25 -32
- package/dist/esm/{index-BsjcsNQh.d.ts → index-lKxE9WPi.d.ts} +2 -2
- package/dist/esm/lib/utils/index.d.ts +1 -2
- package/dist/esm/lib/utils/index.js +2 -2
- package/dist/esm/{show-DNPzdLi-.js → show-BabiXbf7.js} +3 -3
- package/dist/esm/show-BabiXbf7.js.map +1 -0
- package/dist/esm/{slot-RXTKo4L7.js → slot-D1062oA5.js} +29 -28
- package/dist/esm/slot-D1062oA5.js.map +1 -0
- package/dist/esm/{suspense-with-boundary-TrQxYRG6.js → suspense-with-boundary-CEVORL8K.js} +2 -2
- package/dist/esm/suspense-with-boundary-CEVORL8K.js.map +1 -0
- package/dist/esm/{switch-B2gKl94R.js → switch-CCMD01Rs.js} +3 -3
- package/dist/esm/switch-CCMD01Rs.js.map +1 -0
- package/dist/esm/{teleport-dlSjWj_t.js → teleport-DfuYOzsj.js} +2 -2
- package/dist/esm/teleport-DfuYOzsj.js.map +1 -0
- package/dist/esm/{utils-D4YNWj2X.js → utils-ChjmDoRe.js} +2 -2
- package/dist/esm/utils-ChjmDoRe.js.map +1 -0
- package/dist/style.css +39 -5
- package/package.json +20 -21
- package/dist/esm/await-Fe4LFRKd.js.map +0 -1
- package/dist/esm/card-jkLXbuiw.js.map +0 -1
- package/dist/esm/carousel-Dvp-qURP.js.map +0 -1
- package/dist/esm/drag-scroll-BLjij7aI.js.map +0 -1
- package/dist/esm/drop-zone-Beip1k4x.js +0 -313
- package/dist/esm/drop-zone-Beip1k4x.js.map +0 -1
- package/dist/esm/error-boundary-B3ycUZ1t.js.map +0 -1
- package/dist/esm/for-aTw1TgJo.js.map +0 -1
- package/dist/esm/form-6RV0u4YT.js.map +0 -1
- package/dist/esm/getSlot-D1_uG-Ym.js.map +0 -1
- package/dist/esm/index-BilTdK_M.d.ts +0 -193
- package/dist/esm/index-DRiwJkJC.d.ts +0 -60
- package/dist/esm/show-DNPzdLi-.js.map +0 -1
- package/dist/esm/slot-RXTKo4L7.js.map +0 -1
- package/dist/esm/suspense-with-boundary-TrQxYRG6.js.map +0 -1
- package/dist/esm/switch-B2gKl94R.js.map +0 -1
- package/dist/esm/teleport-dlSjWj_t.js.map +0 -1
- package/dist/esm/utils-D4YNWj2X.js.map +0 -1
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as React$2 from "react";
|
|
1
|
+
import { UnionDiscriminator } from "@zayne-labs/toolkit-type-helpers";
|
|
3
2
|
import * as React$1 from "react";
|
|
4
3
|
import { StoreApi } from "@zayne-labs/toolkit-core";
|
|
5
|
-
import {
|
|
6
|
-
import { DiscriminatedRenderProps, PolymorphicProps } from "@zayne-labs/toolkit-react/utils";
|
|
4
|
+
import { PolymorphicProps } from "@zayne-labs/toolkit-react/utils";
|
|
7
5
|
|
|
8
6
|
//#region src/components/ui/carousel/types.d.ts
|
|
9
7
|
type ImagesType = Array<Record<string, string>> | string[];
|
|
10
|
-
type CarouselStore<TImages extends ImagesType =
|
|
8
|
+
type CarouselStore<TImages extends ImagesType = any> = {
|
|
11
9
|
actions: {
|
|
12
10
|
goToNextSlide: () => void;
|
|
13
11
|
goToPreviousSlide: () => void;
|
|
@@ -18,12 +16,7 @@ type CarouselStore<TImages extends ImagesType = ImagesType> = {
|
|
|
18
16
|
maxSlide: number;
|
|
19
17
|
};
|
|
20
18
|
type CarouselStoreApi<TImages extends ImagesType = ImagesType> = StoreApi<CarouselStore<TImages>>;
|
|
21
|
-
type
|
|
22
|
-
children: React.ReactNode;
|
|
23
|
-
images: CarouselStore<TImages>["images"];
|
|
24
|
-
onSlideBtnClick?: () => void;
|
|
25
|
-
};
|
|
26
|
-
type CarouselContentProps = {
|
|
19
|
+
type CarouselRootProps<TImages extends ImagesType = ImagesType> = {
|
|
27
20
|
autoSlideInterval?: number;
|
|
28
21
|
children: React.ReactNode;
|
|
29
22
|
classNames?: {
|
|
@@ -31,6 +24,8 @@ type CarouselContentProps = {
|
|
|
31
24
|
scrollContainer?: string;
|
|
32
25
|
};
|
|
33
26
|
hasAutoSlide?: boolean;
|
|
27
|
+
images: CarouselStore<TImages>["images"];
|
|
28
|
+
onSlideBtnClick?: () => void;
|
|
34
29
|
shouldPauseOnHover?: boolean;
|
|
35
30
|
};
|
|
36
31
|
type CarouselButtonsProps = {
|
|
@@ -64,10 +59,15 @@ type CarouselIndicatorProps = {
|
|
|
64
59
|
};
|
|
65
60
|
currentIndex: number;
|
|
66
61
|
};
|
|
67
|
-
type RenderPropFn<TArrayItem> = (
|
|
68
|
-
|
|
62
|
+
type RenderPropFn<TArrayItem> = (context: {
|
|
63
|
+
array: NoInfer<TArrayItem[]>;
|
|
64
|
+
image: NoInfer<TArrayItem>;
|
|
65
|
+
index: number;
|
|
66
|
+
}) => React.ReactNode;
|
|
67
|
+
type BaseWrapperProps<TArrayItem> = {
|
|
68
|
+
children: React.ReactNode | RenderPropFn<TArrayItem>;
|
|
69
69
|
each?: TArrayItem[];
|
|
70
|
-
}
|
|
70
|
+
};
|
|
71
71
|
type CarouselWrapperProps<TArrayItem> = BaseWrapperProps<TArrayItem> & {
|
|
72
72
|
className?: string;
|
|
73
73
|
};
|
|
@@ -78,24 +78,17 @@ type OtherCarouselProps = {
|
|
|
78
78
|
};
|
|
79
79
|
//#endregion
|
|
80
80
|
//#region src/components/ui/carousel/carousel.d.ts
|
|
81
|
-
declare function
|
|
82
|
-
declare function CarouselButton(props: CarouselButtonsProps): React$
|
|
83
|
-
declare function CarouselControls(props: CarouselControlProps): React$
|
|
84
|
-
declare function CarouselItemGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>): React$
|
|
85
|
-
declare function CarouselItem(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}: OtherCarouselProps): React$2.JSX.Element;
|
|
90
|
-
declare function CarouselCaption<TElement extends React$2.ElementType = "div">(props: PolymorphicProps<TElement, OtherCarouselProps>): React$2.JSX.Element;
|
|
91
|
-
declare function CarouselIndicatorGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>): React$2.JSX.Element;
|
|
92
|
-
declare function CarouselIndicator(props: CarouselIndicatorProps): React$2.JSX.Element;
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/components/ui/carousel/carousel-store-context.d.ts
|
|
95
|
-
declare function CarouselContextProvider<TImages extends ImagesType>(props: CarouselProviderProps<TImages>): React$1.JSX.Element;
|
|
81
|
+
declare function CarouselRoot<TImages extends ImagesType, TElement extends React$1.ElementType = "div">(props: PolymorphicProps<TElement, CarouselRootProps<TImages>>): React$1.JSX.Element;
|
|
82
|
+
declare function CarouselButton(props: CarouselButtonsProps): React$1.JSX.Element;
|
|
83
|
+
declare function CarouselControls(props: CarouselControlProps): React$1.JSX.Element;
|
|
84
|
+
declare function CarouselItemGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>): React$1.JSX.Element;
|
|
85
|
+
declare function CarouselItem(props: OtherCarouselProps): React$1.JSX.Element;
|
|
86
|
+
declare function CarouselCaption<TElement extends React$1.ElementType = "div">(props: PolymorphicProps<TElement, OtherCarouselProps>): React$1.JSX.Element;
|
|
87
|
+
declare function CarouselIndicatorGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>): React$1.JSX.Element;
|
|
88
|
+
declare function CarouselIndicator(props: CarouselIndicatorProps): React$1.JSX.Element;
|
|
96
89
|
declare namespace carousel_parts_d_exports {
|
|
97
|
-
export { CarouselButton as Button, CarouselCaption as Caption,
|
|
90
|
+
export { CarouselButton as Button, CarouselCaption as Caption, CarouselControls as Controls, CarouselIndicator as Indicator, CarouselIndicatorGroup as IndicatorGroup, CarouselItem as Item, CarouselItemGroup as ItemGroup, CarouselRoot as Root };
|
|
98
91
|
}
|
|
99
92
|
//#endregion
|
|
100
|
-
export { CarouselButton, CarouselButtonsProps, CarouselCaption,
|
|
101
|
-
//# sourceMappingURL=index-
|
|
93
|
+
export { CarouselButton, CarouselButtonsProps, CarouselCaption, CarouselControlProps, CarouselControls, CarouselIndicator, CarouselIndicatorGroup, CarouselIndicatorProps, CarouselItem, CarouselItemGroup, CarouselRoot, CarouselRootProps, CarouselStore, CarouselStoreApi, CarouselWrapperProps, ImagesType, OtherCarouselProps, carousel_parts_d_exports };
|
|
94
|
+
//# sourceMappingURL=index-DqutTJQB.d.ts.map
|
|
@@ -63,5 +63,5 @@ declare const useErrorBoundary: <TError extends Error>() => {
|
|
|
63
63
|
showBoundary: (error: TError) => void;
|
|
64
64
|
};
|
|
65
65
|
//#endregion
|
|
66
|
-
export { ErrorBoundary, ErrorBoundaryContextType, ErrorBoundaryProps, FallbackProps, useErrorBoundary, useErrorBoundaryContext };
|
|
67
|
-
//# sourceMappingURL=index-
|
|
66
|
+
export { ErrorBoundary, type ErrorBoundaryContextType, ErrorBoundaryProps, FallbackProps, useErrorBoundary, useErrorBoundaryContext };
|
|
67
|
+
//# sourceMappingURL=index-lKxE9WPi.d.ts.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { GetSlotComponentProps, GetSlotMapResult, createSlotComponent, getSlotMap, slotComponentSymbol, withSlotNameAndSymbol } from "../../
|
|
2
|
-
import { FunctionalComponent, getMultipleSlots, getRegularChildren, getSingleSlot, matchesAnySlotComponent, matchesSlotComponent } from "../../index-DRiwJkJC.js";
|
|
1
|
+
import { FunctionalComponent, GetSlotComponentProps, GetSlotMapResult, createSlotComponent, getMultipleSlots, getRegularChildren, getSingleSlot, getSlotMap, matchesAnySlotComponent, matchesSlotComponent, slotComponentSymbol, withSlotNameAndSymbol } from "../../index-BNrCAe9Y.js";
|
|
3
2
|
export { FunctionalComponent, GetSlotComponentProps, GetSlotMapResult, createSlotComponent, getMultipleSlots, getRegularChildren, getSingleSlot, getSlotMap, matchesAnySlotComponent, matchesSlotComponent, slotComponentSymbol, withSlotNameAndSymbol };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSlotComponent, getSlotMap, slotComponentSymbol, withSlotNameAndSymbol } from "../../utils-
|
|
2
|
-
import { getMultipleSlots, getRegularChildren, getSingleSlot, matchesAnySlotComponent, matchesSlotComponent } from "../../getSlot-
|
|
1
|
+
import { createSlotComponent, getSlotMap, slotComponentSymbol, withSlotNameAndSymbol } from "../../utils-ChjmDoRe.js";
|
|
2
|
+
import { getMultipleSlots, getRegularChildren, getSingleSlot, matchesAnySlotComponent, matchesSlotComponent } from "../../getSlot-Cf5ON6lE.js";
|
|
3
3
|
|
|
4
4
|
export { createSlotComponent, getMultipleSlots, getRegularChildren, getSingleSlot, getSlotMap, matchesAnySlotComponent, matchesSlotComponent, slotComponentSymbol, withSlotNameAndSymbol };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __export } from "./chunk-Cl8Af3a2.js";
|
|
2
|
-
import { getMultipleSlots } from "./getSlot-
|
|
3
|
-
import "react";
|
|
2
|
+
import { getMultipleSlots } from "./getSlot-Cf5ON6lE.js";
|
|
4
3
|
import { assert, isFunction } from "@zayne-labs/toolkit-type-helpers";
|
|
4
|
+
import "react";
|
|
5
5
|
|
|
6
6
|
//#region src/components/common/show/show.tsx
|
|
7
7
|
function ShowRoot(props) {
|
|
@@ -38,4 +38,4 @@ __export(show_parts_exports, {
|
|
|
38
38
|
|
|
39
39
|
//#endregion
|
|
40
40
|
export { ShowContent, ShowFallback, ShowRoot, show_parts_exports };
|
|
41
|
-
//# sourceMappingURL=show-
|
|
41
|
+
//# sourceMappingURL=show-BabiXbf7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show-BabiXbf7.js","names":[],"sources":["../../src/components/common/show/show.tsx","../../src/components/common/show/show-parts.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { getMultipleSlots } from \"@/lib/utils/getSlot\";\nimport { assert, isFunction } from \"@zayne-labs/toolkit-type-helpers\";\n\ntype ShowProps<TWhen> = {\n\tchildren: React.ReactNode | ((value: TWhen) => React.ReactNode);\n\tfallback?: React.ReactNode;\n\twhen: false | TWhen | null | undefined;\n};\n\nexport function ShowRoot<TWhen>(props: ShowProps<TWhen>) {\n\tconst { children, fallback = null, when } = props;\n\n\tconst resolvedChildren = isFunction(children) ? children(when as TWhen) : children;\n\n\tconst {\n\t\tregularChildren,\n\t\tslots: [contentSlot, fallBackSlot],\n\t} = getMultipleSlots(resolvedChildren, [ShowContent, ShowFallback], {\n\t\terrorMessage: [\n\t\t\t\"Only one <Show.Content> component is allowed\",\n\t\t\t\"Only one <Show.Fallback> or <Show.OtherWise> component is allowed\",\n\t\t],\n\t\tthrowOnMultipleSlotMatch: true,\n\t});\n\n\tif (!when) {\n\t\tassert(\n\t\t\t!(fallBackSlot && fallback),\n\t\t\t\"The fallback prop and <Show.Fallback> cannot be used at the same time.\"\n\t\t);\n\n\t\treturn fallBackSlot ?? fallback;\n\t}\n\n\treturn contentSlot ?? regularChildren;\n}\n\nexport function ShowContent({ children }: { children: React.ReactNode }) {\n\treturn children;\n}\nShowContent.slotSymbol = Symbol(\"show-content\");\n\nexport function ShowFallback({ children }: { children: React.ReactNode }) {\n\treturn children;\n}\nShowFallback.slotSymbol = Symbol(\"show-fallback\");\n","export {\n\tShowContent as Content,\n\tShowFallback as Fallback,\n\tShowFallback as Otherwise,\n\tShowRoot as Root,\n} from \"./show\";\n"],"mappings":";;;;;;AAaA,SAAgB,SAAgB,OAAyB;CACxD,MAAM,EAAE,UAAU,WAAW,MAAM,MAAM,GAAG;CAE5C,MAAM,mBAAmB,WAAW,YAAY,SAAS,QAAiB;CAE1E,MAAM,EACL,iBACA,OAAO,CAAC,aAAa,aAAa,EAClC,GAAG,iBAAiB,kBAAkB,CAAC,aAAa,aAAa,EAAE;EACnE,cAAc,CACb,gDACA,oEACA;EACD,0BAA0B;EAC1B;AAED,KAAI,CAAC,MAAM;AACV,SACC,EAAE,gBAAgB,WAClB;AAGD,SAAO,gBAAgB;CACvB;AAED,QAAO,eAAe;AACtB;AAED,SAAgB,YAAY,EAAE,UAAyC,EAAE;AACxE,QAAO;AACP;AACD,YAAY,aAAa,OAAO;AAEhC,SAAgB,aAAa,EAAE,UAAyC,EAAE;AACzE,QAAO;AACP;AACD,aAAa,aAAa,OAAO"}
|
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
import { __export } from "./chunk-Cl8Af3a2.js";
|
|
2
|
-
import { Children, Fragment, cloneElement, isValidElement } from "react";
|
|
3
2
|
import { isArray } from "@zayne-labs/toolkit-type-helpers";
|
|
3
|
+
import { Children, Fragment, cloneElement, isValidElement } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { composeRefs, mergeProps } from "@zayne-labs/toolkit-react/utils";
|
|
6
6
|
|
|
7
7
|
//#region src/components/common/slot/slot.tsx
|
|
8
|
-
function SlotSlottable({ children }) {
|
|
9
|
-
return children;
|
|
10
|
-
}
|
|
11
|
-
const isSlottable = (child) => {
|
|
12
|
-
return isValidElement(child) && child.type === SlotSlottable;
|
|
13
|
-
};
|
|
14
8
|
function SlotRoot(props) {
|
|
15
9
|
const { children,...restOfSlotProps } = props;
|
|
16
10
|
const childrenArray = isArray(children) ? children : [children];
|
|
17
11
|
const slottable = childrenArray.find((element) => isSlottable(element));
|
|
18
|
-
if (slottable) {
|
|
19
|
-
const newElement = slottable.props.children;
|
|
20
|
-
if (Children.count(newElement) > 1) return Children.only(null);
|
|
21
|
-
const newElementChildren = childrenArray.map((child) => {
|
|
22
|
-
if (child === slottable) return isValidElement(newElement) && newElement.props.children;
|
|
23
|
-
return child;
|
|
24
|
-
});
|
|
25
|
-
return /* @__PURE__ */ jsx(SlotClone, {
|
|
26
|
-
...restOfSlotProps,
|
|
27
|
-
children: isValidElement(newElement) && cloneElement(newElement, void 0, newElementChildren)
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return /* @__PURE__ */ jsx(SlotClone, {
|
|
12
|
+
if (!slottable) return /* @__PURE__ */ jsx(SlotClone, {
|
|
31
13
|
...restOfSlotProps,
|
|
32
14
|
children
|
|
33
15
|
});
|
|
16
|
+
if (!isValidElement(slottable)) return null;
|
|
17
|
+
const newElement = slottable.props.children;
|
|
18
|
+
if (!isValidElement(newElement)) return null;
|
|
19
|
+
if (Children.count(newElement) > 1) return Children.only(null);
|
|
20
|
+
const newChildren = childrenArray.map((child) => {
|
|
21
|
+
if (child === slottable) return newElement.props.children;
|
|
22
|
+
return child;
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ jsx(SlotClone, {
|
|
25
|
+
...restOfSlotProps,
|
|
26
|
+
children: cloneElement(newElement, void 0, newChildren)
|
|
27
|
+
});
|
|
34
28
|
}
|
|
29
|
+
function SlotSlottable({ children }) {
|
|
30
|
+
return children;
|
|
31
|
+
}
|
|
32
|
+
const isSlottable = (child) => {
|
|
33
|
+
return isValidElement(child) && child.type === SlotSlottable;
|
|
34
|
+
};
|
|
35
35
|
function SlotClone(props) {
|
|
36
36
|
const { children, ref: forwardedRef,...restOfSlotProps } = props;
|
|
37
|
-
const
|
|
38
|
-
if (!isValidElement(
|
|
39
|
-
|
|
40
|
-
const
|
|
37
|
+
const resolvedChild = isArray(children) && children.length === 1 ? children[0] : children;
|
|
38
|
+
if (!isValidElement(resolvedChild)) return null;
|
|
39
|
+
if (Children.count(resolvedChild) > 1) return Children.only(null);
|
|
40
|
+
const childRef = resolvedChild.props.ref ?? resolvedChild.ref;
|
|
41
|
+
const ref = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;
|
|
41
42
|
const clonedProps = {
|
|
42
|
-
...mergeProps(restOfSlotProps,
|
|
43
|
-
...
|
|
43
|
+
...mergeProps(restOfSlotProps, resolvedChild.props),
|
|
44
|
+
...resolvedChild.type !== Fragment && { ref }
|
|
44
45
|
};
|
|
45
|
-
return cloneElement(
|
|
46
|
+
return cloneElement(resolvedChild, clonedProps);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
//#endregion
|
|
@@ -55,4 +56,4 @@ __export(slot_parts_exports, {
|
|
|
55
56
|
|
|
56
57
|
//#endregion
|
|
57
58
|
export { SlotRoot, SlotSlottable, slot_parts_exports };
|
|
58
|
-
//# sourceMappingURL=slot-
|
|
59
|
+
//# sourceMappingURL=slot-D1062oA5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-D1062oA5.js","names":["ReactFragment"],"sources":["../../src/components/common/slot/slot.tsx","../../src/components/common/slot/slot-parts.ts"],"sourcesContent":["import { composeRefs, type InferProps, mergeProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { isArray, type UnknownObject } from \"@zayne-labs/toolkit-type-helpers\";\nimport * as React from \"react\";\nimport { Children, cloneElement, isValidElement, Fragment as ReactFragment } from \"react\";\n\ntype SlotProps = InferProps<HTMLElement>;\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * ----------------------------------------------------------------------------------------------- */\n\nexport function SlotRoot(props: SlotProps) {\n\tconst { children, ...restOfSlotProps } = props;\n\n\tconst childrenArray = isArray<React.ReactNode>(children) ? children : [children];\n\n\tconst slottable = childrenArray.find((element) => isSlottable(element));\n\n\tif (!slottable) {\n\t\treturn <SlotClone {...restOfSlotProps}>{children}</SlotClone>;\n\t}\n\n\tif (!isValidElement<SlotProps>(slottable)) {\n\t\treturn null;\n\t}\n\n\t// == The new element to render is the one passed as a child of `Slot.Slottable`\n\tconst newElement = slottable.props.children;\n\n\tif (!isValidElement(newElement)) {\n\t\treturn null;\n\t}\n\n\tif (Children.count(newElement) > 1) {\n\t\treturn Children.only(null);\n\t}\n\n\tconst newChildren = childrenArray.map((child) => {\n\t\tif (child === slottable) {\n\t\t\t// == Because the new element will be the one rendered, we are only interested in grabbing its children (`newElement.props.children`)\n\t\t\treturn (newElement.props as SlotProps).children;\n\t\t}\n\n\t\treturn child;\n\t});\n\n\treturn <SlotClone {...restOfSlotProps}>{cloneElement(newElement, undefined, newChildren)}</SlotClone>;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * ----------------------------------------------------------------------------------------------- */\n\nexport function SlotSlottable({ children }: Pick<SlotProps, \"children\">) {\n\treturn children;\n}\n\nconst isSlottable = (child: React.ReactNode): child is React.ReactElement => {\n\treturn isValidElement(child) && child.type === SlotSlottable;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * ----------------------------------------------------------------------------------------------- */\ntype SlotCloneProps = {\n\tchildren: React.ReactNode;\n\tref?: React.RefObject<HTMLElement>;\n};\n\nfunction SlotClone(props: SlotCloneProps) {\n\tconst { children, ref: forwardedRef, ...restOfSlotProps } = props;\n\n\tconst resolvedChild = isArray(children) && children.length === 1 ? children[0] : children;\n\n\tif (!isValidElement<UnknownObject>(resolvedChild)) {\n\t\treturn null;\n\t}\n\n\tif (Children.count(resolvedChild) > 1) {\n\t\treturn Children.only(null);\n\t}\n\n\tconst childRef = (resolvedChild.props.ref\n\t\t?? (resolvedChild as unknown as UnknownObject).ref) as React.Ref<HTMLElement>;\n\n\tconst ref = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;\n\n\tconst clonedProps = {\n\t\t...mergeProps(restOfSlotProps, resolvedChild.props),\n\t\t...(resolvedChild.type !== ReactFragment && { ref }),\n\t};\n\n\treturn cloneElement(resolvedChild, clonedProps);\n}\n","export { SlotRoot as Root, SlotSlottable as Slottable } from \"./slot\";\n"],"mappings":";;;;;;;AAWA,SAAgB,SAAS,OAAkB;CAC1C,MAAM,EAAE,SAAU,GAAG,iBAAiB,GAAG;CAEzC,MAAM,gBAAgB,QAAyB,YAAY,WAAW,CAAC,SAAS;CAEhF,MAAM,YAAY,cAAc,MAAM,YAAY,YAAY;AAE9D,KAAI,CAAC,UACJ,QAAO,oBAAC;EAAU,GAAI;EAAkB;;AAGzC,KAAI,CAAC,eAA0B,WAC9B,QAAO;CAIR,MAAM,aAAa,UAAU,MAAM;AAEnC,KAAI,CAAC,eAAe,YACnB,QAAO;AAGR,KAAI,SAAS,MAAM,cAAc,EAChC,QAAO,SAAS,KAAK;CAGtB,MAAM,cAAc,cAAc,KAAK,UAAU;AAChD,MAAI,UAAU,UAEb,QAAQ,WAAW,MAAoB;AAGxC,SAAO;CACP;AAED,QAAO,oBAAC;EAAU,GAAI;YAAkB,aAAa,YAAY,QAAW;;AAC5E;AAMD,SAAgB,cAAc,EAAE,UAAuC,EAAE;AACxE,QAAO;AACP;AAED,MAAM,eAAe,UAAwD;AAC5E,QAAO,eAAe,UAAU,MAAM,SAAS;AAC/C;AAUD,SAAS,UAAU,OAAuB;CACzC,MAAM,EAAE,UAAU,KAAK,aAAc,GAAG,iBAAiB,GAAG;CAE5D,MAAM,gBAAgB,QAAQ,aAAa,SAAS,WAAW,IAAI,SAAS,KAAK;AAEjF,KAAI,CAAC,eAA8B,eAClC,QAAO;AAGR,KAAI,SAAS,MAAM,iBAAiB,EACnC,QAAO,SAAS,KAAK;CAGtB,MAAM,WAAY,cAAc,MAAM,OACjC,cAA2C;CAEhD,MAAM,MAAM,eAAe,YAAY,cAAc,YAAY;CAEjE,MAAM,cAAc;EACnB,GAAG,WAAW,iBAAiB,cAAc;EAC7C,GAAI,cAAc,SAASA,YAAiB,EAAE,KAAK;EACnD;AAED,QAAO,aAAa,eAAe;AACnC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorBoundary } from "./error-boundary-
|
|
1
|
+
import { ErrorBoundary } from "./error-boundary-xM9An3gz.js";
|
|
2
2
|
import { Suspense } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -18,4 +18,4 @@ function SuspenseWithBoundary(props) {
|
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
export { SuspenseWithBoundary };
|
|
21
|
-
//# sourceMappingURL=suspense-with-boundary-
|
|
21
|
+
//# sourceMappingURL=suspense-with-boundary-CEVORL8K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suspense-with-boundary-CEVORL8K.js","names":[],"sources":["../../src/components/common/suspense-with-boundary/suspense-with-boundary.tsx"],"sourcesContent":["import { Suspense } from \"react\";\nimport { ErrorBoundary, type ErrorBoundaryProps } from \"../error-boundary\";\n\nexport type SuspenseWithBoundaryProps = {\n\tchildren: React.ReactNode;\n\terrorFallback?: ErrorBoundaryProps[\"fallback\"];\n\tfallback?: React.ReactNode;\n};\n\nexport function SuspenseWithBoundary(props: SuspenseWithBoundaryProps) {\n\tconst { children, errorFallback, fallback } = props;\n\n\tconst errorBoundaryProps = Boolean(errorFallback) && { fallback: errorFallback };\n\tconst suspenseProps = Boolean(fallback) && { fallback };\n\n\treturn (\n\t\t<ErrorBoundary {...errorBoundaryProps}>\n\t\t\t<Suspense {...suspenseProps}>{children}</Suspense>\n\t\t</ErrorBoundary>\n\t);\n}\n"],"mappings":";;;;;AASA,SAAgB,qBAAqB,OAAkC;CACtE,MAAM,EAAE,UAAU,eAAe,UAAU,GAAG;CAE9C,MAAM,qBAAqB,QAAQ,kBAAkB,EAAE,UAAU,eAAe;CAChF,MAAM,gBAAgB,QAAQ,aAAa,EAAE,UAAU;AAEvD,QACC,oBAAC;EAAc,GAAI;YAClB,oBAAC;GAAS,GAAI;GAAgB;;;AAGhC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __export } from "./chunk-Cl8Af3a2.js";
|
|
2
|
-
import { getRegularChildren, getSingleSlot } from "./getSlot-
|
|
3
|
-
import "react";
|
|
2
|
+
import { getRegularChildren, getSingleSlot } from "./getSlot-Cf5ON6lE.js";
|
|
4
3
|
import { isFunction } from "@zayne-labs/toolkit-type-helpers";
|
|
4
|
+
import "react";
|
|
5
5
|
|
|
6
6
|
//#region src/components/common/switch/switch.tsx
|
|
7
7
|
const defaultValueSymbol = Symbol("default-value");
|
|
@@ -39,4 +39,4 @@ __export(switch_parts_exports, {
|
|
|
39
39
|
|
|
40
40
|
//#endregion
|
|
41
41
|
export { SwitchDefault, SwitchMatch, SwitchRoot, switch_parts_exports };
|
|
42
|
-
//# sourceMappingURL=switch-
|
|
42
|
+
//# sourceMappingURL=switch-CCMD01Rs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-CCMD01Rs.js","names":[],"sources":["../../src/components/common/switch/switch.tsx","../../src/components/common/switch/switch-parts.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { getRegularChildren, getSingleSlot } from \"@/lib/utils/getSlot\";\nimport { isFunction } from \"@zayne-labs/toolkit-type-helpers\";\n\ntype ValidSwitchComponentType = React.ReactElement<SwitchMatchProps<unknown>>;\n\ntype SwitchProps = {\n\tchildren: ValidSwitchComponentType | ValidSwitchComponentType[];\n\tvalue?: unknown;\n};\n\nconst defaultValueSymbol = Symbol(\"default-value\");\n\nexport function SwitchRoot(props: SwitchProps) {\n\tconst { children, value = defaultValueSymbol } = props;\n\n\tconst defaultCase = getSingleSlot(children, SwitchDefault, {\n\t\terrorMessage: \"Only one <Switch.Default> component is allowed\",\n\t\tthrowOnMultipleSlotMatch: true,\n\t});\n\n\tconst childrenCasesArray = getRegularChildren(children, SwitchDefault) as ValidSwitchComponentType[];\n\n\tconst matchedCase = childrenCasesArray.find((child) => {\n\t\t// == If value is defaultValueSymbol, match the cases in order like switch(true)\n\t\tif (value === defaultValueSymbol) {\n\t\t\treturn Boolean(child.props.when);\n\t\t}\n\n\t\t// == Otherwise, match the cases like switch(value)\n\t\treturn child.props.when === value;\n\t});\n\n\treturn matchedCase ?? defaultCase;\n}\n\ntype SwitchMatchProps<TWhen> = {\n\tchildren: React.ReactNode | ((value: TWhen) => React.ReactNode);\n\twhen: false | TWhen | null | undefined;\n};\n\nexport function SwitchMatch<TWhen>(props: SwitchMatchProps<TWhen>) {\n\tconst { children, when } = props;\n\n\tconst resolvedChildren = isFunction(children) ? children(when as TWhen) : children;\n\n\treturn resolvedChildren;\n}\n\nexport function SwitchDefault({ children }: { children: React.ReactNode }) {\n\treturn children;\n}\nSwitchDefault.slotSymbol = Symbol(\"switch-default\");\n","export { SwitchDefault as Default, SwitchMatch as Match, SwitchRoot as Root } from \"./switch\";\n"],"mappings":";;;;;;AAcA,MAAM,qBAAqB,OAAO;AAElC,SAAgB,WAAW,OAAoB;CAC9C,MAAM,EAAE,UAAU,QAAQ,oBAAoB,GAAG;CAEjD,MAAM,cAAc,cAAc,UAAU,eAAe;EAC1D,cAAc;EACd,0BAA0B;EAC1B;CAED,MAAM,qBAAqB,mBAAmB,UAAU;CAExD,MAAM,cAAc,mBAAmB,MAAM,UAAU;AAEtD,MAAI,UAAU,mBACb,QAAO,QAAQ,MAAM,MAAM;AAI5B,SAAO,MAAM,MAAM,SAAS;CAC5B;AAED,QAAO,eAAe;AACtB;AAOD,SAAgB,YAAmB,OAAgC;CAClE,MAAM,EAAE,UAAU,MAAM,GAAG;CAE3B,MAAM,mBAAmB,WAAW,YAAY,SAAS,QAAiB;AAE1E,QAAO;AACP;AAED,SAAgB,cAAc,EAAE,UAAyC,EAAE;AAC1E,QAAO;AACP;AACD,cAAc,aAAa,OAAO"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
1
|
import { isString } from "@zayne-labs/toolkit-type-helpers";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
|
|
5
5
|
//#region src/components/common/teleport/teleport.tsx
|
|
@@ -29,4 +29,4 @@ function Teleport(props) {
|
|
|
29
29
|
|
|
30
30
|
//#endregion
|
|
31
31
|
export { Teleport };
|
|
32
|
-
//# sourceMappingURL=teleport-
|
|
32
|
+
//# sourceMappingURL=teleport-DfuYOzsj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teleport-DfuYOzsj.js","names":[],"sources":["../../src/components/common/teleport/teleport.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { type AnyString, isString } from \"@zayne-labs/toolkit-type-helpers\";\nimport { useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\ntype ValidHtmlTags = keyof HTMLElementTagNameMap;\n\ntype PortalProps = {\n\tchildren: React.ReactNode;\n\tinsertPosition?: InsertPosition;\n\tto: AnyString | HTMLElement | ValidHtmlTags | null;\n};\n\nfunction Teleport(props: PortalProps) {\n\tconst { children, insertPosition, to } = props;\n\n\tconst [portalContainer, setPortalContainer] = useState<HTMLElement | null>(null);\n\n\t/* eslint-disable react-hooks-extra/no-direct-set-state-in-use-effect -- Allow */\n\n\tuseEffect(() => {\n\t\tif (!to) return;\n\n\t\tif (insertPosition) return;\n\n\t\tconst destination = isString(to) ? document.querySelector<HTMLElement>(to) : to;\n\n\t\tdestination && setPortalContainer(destination);\n\t}, [to, insertPosition]);\n\n\tuseEffect(() => {\n\t\tif (!to) return;\n\n\t\tif (!insertPosition) return;\n\n\t\tconst destination = isString(to) ? document.querySelector<HTMLElement>(to) : to;\n\n\t\tconst tempWrapper = document.createElement(\"div\");\n\t\ttempWrapper.style.display = \"contents\";\n\n\t\tdestination?.insertAdjacentElement(insertPosition, tempWrapper);\n\n\t\tsetPortalContainer(tempWrapper);\n\n\t\treturn () => {\n\t\t\ttempWrapper.remove();\n\t\t};\n\t}, [to, insertPosition]);\n\n\t/* eslint-enable react-hooks-extra/no-direct-set-state-in-use-effect -- Allow */\n\n\treturn portalContainer && createPortal(children, portalContainer);\n}\n\nexport { Teleport };\n"],"mappings":";;;;;AAgBA,SAAS,SAAS,OAAoB;CACrC,MAAM,EAAE,UAAU,gBAAgB,IAAI,GAAG;CAEzC,MAAM,CAAC,iBAAiB,mBAAmB,GAAG,SAA6B;AAI3E,iBAAgB;AACf,MAAI,CAAC,GAAI;AAET,MAAI,eAAgB;EAEpB,MAAM,cAAc,SAAS,MAAM,SAAS,cAA2B,MAAM;AAE7E,iBAAe,mBAAmB;CAClC,GAAE,CAAC,IAAI,eAAe;AAEvB,iBAAgB;AACf,MAAI,CAAC,GAAI;AAET,MAAI,CAAC,eAAgB;EAErB,MAAM,cAAc,SAAS,MAAM,SAAS,cAA2B,MAAM;EAE7E,MAAM,cAAc,SAAS,cAAc;AAC3C,cAAY,MAAM,UAAU;AAE5B,eAAa,sBAAsB,gBAAgB;AAEnD,qBAAmB;AAEnB,eAAa;AACZ,eAAY;EACZ;CACD,GAAE,CAAC,IAAI,eAAe;AAIvB,QAAO,mBAAmB,aAAa,UAAU;AACjD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { isFunction } from "@zayne-labs/toolkit-type-helpers";
|
|
1
2
|
import { Fragment, isValidElement } from "react";
|
|
2
3
|
import { toArray } from "@zayne-labs/toolkit-core";
|
|
3
|
-
import { isFunction } from "@zayne-labs/toolkit-type-helpers";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/utils/getSlotMap/getSlotMap.ts
|
|
6
6
|
/**
|
|
@@ -86,4 +86,4 @@ const withSlotNameAndSymbol = (name, SlotComponent = DefaultSlotComponent) => {
|
|
|
86
86
|
|
|
87
87
|
//#endregion
|
|
88
88
|
export { createSlotComponent, getSlotMap, slotComponentSymbol, withSlotNameAndSymbol };
|
|
89
|
-
//# sourceMappingURL=utils-
|
|
89
|
+
//# sourceMappingURL=utils-ChjmDoRe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-ChjmDoRe.js","names":["slots: Record<string, TSlotComponentProps[\"children\"]> & { default: React.ReactNode[] }","ReactFragment"],"sources":["../../src/lib/utils/getSlotMap/getSlotMap.ts"],"sourcesContent":["import { toArray } from \"@zayne-labs/toolkit-core\";\nimport type { InferProps } from \"@zayne-labs/toolkit-react/utils\";\nimport {\n\ttype CallbackFn,\n\ttype EmptyObject,\n\ttype Prettify,\n\ttype UnionToIntersection,\n\ttype UnknownObject,\n\tisFunction,\n} from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, isValidElement } from \"react\";\n\ntype GetSlotName<TSlotComponentProps extends GetSlotComponentProps> =\n\tstring extends TSlotComponentProps[\"name\"]\n\t\t? never\n\t\t: \"default\" extends TSlotComponentProps[\"name\"]\n\t\t\t? never\n\t\t\t: TSlotComponentProps[\"name\"];\n\ntype GetSpecificSlotsType<TSlotComponentProps extends GetSlotComponentProps> = {\n\t// This conditional before the remapping will prevent an Indexed Record type from showing up if the props are not passed, enhancing type safety\n\t[TName in keyof TSlotComponentProps as GetSlotName<TSlotComponentProps>]: Extract<\n\t\tTSlotComponentProps[\"children\"],\n\t\tReact.ReactNode\n\t>;\n};\n\n/**\n * Maps slot names to their corresponding children types\n */\nexport type GetSlotMapResult<TSlotComponentProps extends GetSlotComponentProps> = UnionToIntersection<\n\tGetSpecificSlotsType<TSlotComponentProps>\n> & { default: React.ReactNode[] };\n\n/**\n * Symbol used to identify SlotComponent instances\n */\nexport const slotComponentSymbol = Symbol(\"slot-component\");\n\n/**\n * @description Creates a map of named slots from React children. Returns an object mapping slot names to their children,\n * with a default slot for unmatched children.\n *\n * @example\n * ```tsx\n * import { type GetSlotComponentProps, SlotComponent } from \"@zayne-labs/toolkit-react/utils\"\n *\n * type SlotProps = GetSlotComponentProps<\"header\" | \"footer\">;\n *\n * function Parent({ children }: { children: React.ReactNode }) {\n * const slots = getSlotMap<SlotProps>(children);\n *\n * return (\n * <div>\n * <header>{slots.header}</header>\n * <main>{slots.default}</main>\n * <footer>{slots.footer}</footer>\n * </div>\n * );\n * }\n * ```\n *\n * Usage:\n * ```tsx\n * <Parent>\n * <SlotComponent name=\"header\">Header Content</SlotComponent>\n * <div>Random stuff</div>\n * <SlotComponent name=\"footer\">Footer Content</SlotComponent>\n * </Parent>\n * ```\n */\nexport const getSlotMap = <TSlotComponentProps extends GetSlotComponentProps>(\n\tchildren: React.ReactNode\n): Prettify<GetSlotMapResult<TSlotComponentProps>> => {\n\tconst slots: Record<string, TSlotComponentProps[\"children\"]> & { default: React.ReactNode[] } = {\n\t\tdefault: [],\n\t};\n\n\tconst isFragment = isValidElement<InferProps<HTMLElement>>(children) && children.type === ReactFragment;\n\n\tconst actualChildren = isFragment ? children.props.children : children;\n\n\tconst childrenArray = toArray<React.ReactNode>(actualChildren);\n\n\tfor (const child of childrenArray) {\n\t\tif (!isValidElement<TSlotComponentProps>(child) || !isFunction(child.type)) {\n\t\t\tslots.default.push(child);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst childType = child.type as SlotWithNameAndSymbol;\n\n\t\tconst isSlotElement =\n\t\t\tchildType.slotSymbol === slotComponentSymbol && Boolean(childType.slotName ?? child.props.name);\n\n\t\tif (!isSlotElement) {\n\t\t\tslots.default.push(child);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst slotName = childType.slotName ?? child.props.name;\n\n\t\tif (slotName === \"default\") {\n\t\t\tslots.default.push(child);\n\t\t\tcontinue;\n\t\t}\n\n\t\tslots[slotName] = child;\n\t}\n\n\treturn slots as GetSlotMapResult<TSlotComponentProps>;\n};\n\n/**\n * @description Produce props for the SlotComponent\n *\n * @example\n * ```ts\n * // Pattern One (slot or slots have same children type, which is just React.ReactNode by default)\n * type SlotProps = GetSlotComponentProps<\"header\" | \"content\" | \"footer\">;\n *\n * // Pattern Two (some slots can have different children type)\n * type SlotProps = GetSlotComponentProps<\"header\", React.ReactNode> | GetSlotComponentProps<\"header\", (renderProp: RenderProp) => React.ReactNode>;\n * ```\n */\nexport type GetSlotComponentProps<\n\tTName extends string = string,\n\tTChildren extends CallbackFn<never, React.ReactNode> | React.ReactNode =\n\t\t| CallbackFn<never, React.ReactNode>\n\t\t| React.ReactNode,\n> = {\n\tchildren: TChildren;\n\t/**\n\t * Name of the slot where content should be rendered\n\t */\n\tname: TName;\n};\n\n/**\n * @description Creates a slot component\n */\nexport const createSlotComponent = <TSlotComponentProps extends GetSlotComponentProps>() => {\n\tconst SlotComponent = (props: TSlotComponentProps) => props.children as React.ReactNode;\n\n\tSlotComponent.slotSymbol = slotComponentSymbol;\n\n\treturn SlotComponent;\n};\n\ntype SlotWithNameAndSymbol<\n\tTSlotComponentProps extends GetSlotComponentProps = GetSlotComponentProps,\n\tTOtherProps extends UnknownObject = EmptyObject,\n> = {\n\t(props: Pick<TSlotComponentProps, \"children\"> & TOtherProps): React.ReactNode;\n\treadonly slotName?: TSlotComponentProps[\"name\"];\n\treadonly slotSymbol?: symbol;\n};\n\nfunction DefaultSlotComponent(props: Pick<GetSlotComponentProps, \"children\">): React.ReactNode {\n\treturn props.children as React.ReactNode;\n}\n\n/**\n * @description Adds a slot symbol and name to a slot component passed in\n */\nexport const withSlotNameAndSymbol = <\n\tTSlotComponentProps extends GetSlotComponentProps,\n\tTOtherProps extends UnknownObject = EmptyObject,\n>(\n\tname: TSlotComponentProps[\"name\"],\n\tSlotComponent: SlotWithNameAndSymbol<TSlotComponentProps, TOtherProps> = DefaultSlotComponent\n) => {\n\t/* eslint-disable no-param-reassign -- This is necessary */\n\t// @ts-expect-error -- This is necessary for the time being, to prevent type errors and accidental overrides on consumer side\n\tSlotComponent.slotSymbol = slotComponentSymbol;\n\t// @ts-expect-error -- This is necessary for the time being, to prevent type errors and accidental overrides on consumer side\n\tSlotComponent.slotName = name;\n\n\t/* eslint-enable no-param-reassign -- This is necessary */\n\n\treturn SlotComponent;\n};\n"],"mappings":";;;;;;;;AAqCA,MAAa,sBAAsB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkC1C,MAAa,cACZ,aACqD;CACrD,MAAMA,QAA0F,EAC/F,SAAS,EAAE,EACX;CAED,MAAM,aAAa,eAAwC,aAAa,SAAS,SAASC;CAE1F,MAAM,iBAAiB,aAAa,SAAS,MAAM,WAAW;CAE9D,MAAM,gBAAgB,QAAyB;AAE/C,MAAK,MAAM,SAAS,eAAe;AAClC,MAAI,CAAC,eAAoC,UAAU,CAAC,WAAW,MAAM,OAAO;AAC3E,SAAM,QAAQ,KAAK;AACnB;EACA;EAED,MAAM,YAAY,MAAM;EAExB,MAAM,gBACL,UAAU,eAAe,uBAAuB,QAAQ,UAAU,YAAY,MAAM,MAAM;AAE3F,MAAI,CAAC,eAAe;AACnB,SAAM,QAAQ,KAAK;AACnB;EACA;EAED,MAAM,WAAW,UAAU,YAAY,MAAM,MAAM;AAEnD,MAAI,aAAa,WAAW;AAC3B,SAAM,QAAQ,KAAK;AACnB;EACA;AAED,QAAM,YAAY;CAClB;AAED,QAAO;AACP;;;;AA8BD,MAAa,4BAA+E;CAC3F,MAAM,iBAAiB,UAA+B,MAAM;AAE5D,eAAc,aAAa;AAE3B,QAAO;AACP;AAWD,SAAS,qBAAqB,OAAiE;AAC9F,QAAO,MAAM;AACb;;;;AAKD,MAAa,yBAIZ,MACA,gBAAyE,yBACrE;AAGJ,eAAc,aAAa;AAE3B,eAAc,WAAW;AAIzB,QAAO;AACP"}
|
package/dist/style.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -153,6 +153,9 @@
|
|
|
153
153
|
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
|
|
154
154
|
padding-block: 0;
|
|
155
155
|
}
|
|
156
|
+
::-webkit-calendar-picker-indicator {
|
|
157
|
+
line-height: 1;
|
|
158
|
+
}
|
|
156
159
|
:-moz-ui-invalid {
|
|
157
160
|
box-shadow: none;
|
|
158
161
|
}
|
|
@@ -279,7 +282,7 @@
|
|
|
279
282
|
.rotate-180 {
|
|
280
283
|
rotate: 180deg;
|
|
281
284
|
}
|
|
282
|
-
|
|
285
|
+
.transform-\[translate3d\(var\(--translate-distance\)\,0\,0\)\] {
|
|
283
286
|
transform: translate3d(var(--translate-distance),0,0);
|
|
284
287
|
}
|
|
285
288
|
.animate-shake {
|
|
@@ -421,6 +424,10 @@
|
|
|
421
424
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
422
425
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
423
426
|
}
|
|
427
|
+
.duration-800 {
|
|
428
|
+
--tw-duration: 800ms;
|
|
429
|
+
transition-duration: 800ms;
|
|
430
|
+
}
|
|
424
431
|
.select-none {
|
|
425
432
|
-webkit-user-select: none;
|
|
426
433
|
user-select: none;
|
|
@@ -428,9 +435,6 @@
|
|
|
428
435
|
.\[scrollbar-width\:none\] {
|
|
429
436
|
scrollbar-width: none;
|
|
430
437
|
}
|
|
431
|
-
.\[transition\:transform_800ms_ease\] {
|
|
432
|
-
transition: transform 800ms ease;
|
|
433
|
-
}
|
|
434
438
|
.file\:border-0 {
|
|
435
439
|
&::file-selector-button {
|
|
436
440
|
border-style: var(--tw-border-style);
|
|
@@ -518,6 +522,26 @@
|
|
|
518
522
|
--color-shadcn-muted-foreground: oklch(0.708 0 0);
|
|
519
523
|
--color-shadcn-destructive: oklch(0.704 0.191 22.216);
|
|
520
524
|
}
|
|
525
|
+
@property --tw-rotate-x {
|
|
526
|
+
syntax: "*";
|
|
527
|
+
inherits: false;
|
|
528
|
+
}
|
|
529
|
+
@property --tw-rotate-y {
|
|
530
|
+
syntax: "*";
|
|
531
|
+
inherits: false;
|
|
532
|
+
}
|
|
533
|
+
@property --tw-rotate-z {
|
|
534
|
+
syntax: "*";
|
|
535
|
+
inherits: false;
|
|
536
|
+
}
|
|
537
|
+
@property --tw-skew-x {
|
|
538
|
+
syntax: "*";
|
|
539
|
+
inherits: false;
|
|
540
|
+
}
|
|
541
|
+
@property --tw-skew-y {
|
|
542
|
+
syntax: "*";
|
|
543
|
+
inherits: false;
|
|
544
|
+
}
|
|
521
545
|
@property --tw-scroll-snap-strictness {
|
|
522
546
|
syntax: "*";
|
|
523
547
|
inherits: false;
|
|
@@ -601,6 +625,10 @@
|
|
|
601
625
|
inherits: false;
|
|
602
626
|
initial-value: 0 0 #0000;
|
|
603
627
|
}
|
|
628
|
+
@property --tw-duration {
|
|
629
|
+
syntax: "*";
|
|
630
|
+
inherits: false;
|
|
631
|
+
}
|
|
604
632
|
@keyframes shake {
|
|
605
633
|
0%, 100% {
|
|
606
634
|
transform: translateX(0px);
|
|
@@ -615,6 +643,11 @@
|
|
|
615
643
|
@layer properties {
|
|
616
644
|
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
617
645
|
*, ::before, ::after, ::backdrop {
|
|
646
|
+
--tw-rotate-x: initial;
|
|
647
|
+
--tw-rotate-y: initial;
|
|
648
|
+
--tw-rotate-z: initial;
|
|
649
|
+
--tw-skew-x: initial;
|
|
650
|
+
--tw-skew-y: initial;
|
|
618
651
|
--tw-scroll-snap-strictness: proximity;
|
|
619
652
|
--tw-border-style: solid;
|
|
620
653
|
--tw-leading: initial;
|
|
@@ -633,6 +666,7 @@
|
|
|
633
666
|
--tw-ring-offset-width: 0px;
|
|
634
667
|
--tw-ring-offset-color: #fff;
|
|
635
668
|
--tw-ring-offset-shadow: 0 0 #0000;
|
|
669
|
+
--tw-duration: initial;
|
|
636
670
|
}
|
|
637
671
|
}
|
|
638
672
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zayne-labs/ui-react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.0",
|
|
5
5
|
"description": "A composable UI/UI-utilities components library. ",
|
|
6
6
|
"author": "Ryan Zayne",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,33 +52,32 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@zayne-labs/toolkit-core": "0.
|
|
56
|
-
"@zayne-labs/toolkit-react": "0.
|
|
57
|
-
"@zayne-labs/toolkit-type-helpers": "0.
|
|
55
|
+
"@zayne-labs/toolkit-core": "0.10.8",
|
|
56
|
+
"@zayne-labs/toolkit-react": "0.10.8",
|
|
57
|
+
"@zayne-labs/toolkit-type-helpers": "0.10.8"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@arethetypeswrong/cli": "0.18.
|
|
60
|
+
"@arethetypeswrong/cli": "0.18.2",
|
|
61
61
|
"@size-limit/esbuild-why": "11.2.0",
|
|
62
62
|
"@size-limit/preset-small-lib": "11.2.0",
|
|
63
|
-
"@tailwindcss/cli": "^4.1.
|
|
63
|
+
"@tailwindcss/cli": "^4.1.12",
|
|
64
64
|
"@total-typescript/ts-reset": "0.6.1",
|
|
65
|
-
"@types/react": "19.1.
|
|
66
|
-
"@types/react-dom": "19.1.
|
|
67
|
-
"@zayne-labs/tsconfig": "0.9.
|
|
68
|
-
"concurrently": "9.
|
|
69
|
-
"cross-env": "
|
|
65
|
+
"@types/react": "19.1.11",
|
|
66
|
+
"@types/react-dom": "19.1.7",
|
|
67
|
+
"@zayne-labs/tsconfig": "0.9.10",
|
|
68
|
+
"concurrently": "9.2.0",
|
|
69
|
+
"cross-env": "10.0.0",
|
|
70
70
|
"publint": "0.3.12",
|
|
71
71
|
"publish": "^0.6.0",
|
|
72
|
-
"react": "19.1.
|
|
73
|
-
"react-dom": "19.1.
|
|
74
|
-
"react-hook-form": "7.
|
|
72
|
+
"react": "19.1.1",
|
|
73
|
+
"react-dom": "19.1.1",
|
|
74
|
+
"react-hook-form": "7.62.0",
|
|
75
75
|
"size-limit": "11.2.0",
|
|
76
|
-
"tailwind-merge": "3.3.
|
|
77
|
-
"tailwindcss": "^4.1.
|
|
78
|
-
"tsdown": "^0.12.
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"zustand": "5.0.5"
|
|
76
|
+
"tailwind-merge": "3.3.1",
|
|
77
|
+
"tailwindcss": "^4.1.12",
|
|
78
|
+
"tsdown": "^0.12.9",
|
|
79
|
+
"typescript": "5.9.2",
|
|
80
|
+
"zustand": "5.0.8"
|
|
82
81
|
},
|
|
83
82
|
"publishConfig": {
|
|
84
83
|
"access": "public",
|
|
@@ -97,7 +96,7 @@
|
|
|
97
96
|
],
|
|
98
97
|
"scripts": {
|
|
99
98
|
"build": "concurrently 'pnpm:build:tailwind' 'tsdown'",
|
|
100
|
-
"build:dev": "cross-env NODE_ENV=development
|
|
99
|
+
"build:dev": "cross-env NODE_ENV=development tsdown",
|
|
101
100
|
"build:tailwind": "tailwindcss -i css/style.css -o ./dist/style.css",
|
|
102
101
|
"build:test": "concurrently --prefix-colors \"yellow.bold,#7da4f8.bold,magenta\" --names PUBLINT,TSUP 'pnpm:lint:publint' 'pnpm:build:dev'",
|
|
103
102
|
"dev": "pnpm build:dev --watch",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"await-Fe4LFRKd.js","names":["props: AwaitRootProps<TValue>","ReactFragment","props: AwaitRootInnerProps<TValue>","Component","props: Pick<AwaitSuccessProps<TValue>, \"children\">"],"sources":["../../src/components/common/await/await-context.ts","../../src/components/common/await/await.tsx","../../src/components/common/await/await-parts.ts"],"sourcesContent":["import { createCustomContext } from \"@zayne-labs/toolkit-react\";\n\nexport type AwaitContextType<TValue = unknown> = {\n\tpromise: Promise<TValue>;\n\tresult: TValue;\n};\n\nexport const [AwaitContextProvider, useAwaitContextImpl] = createCustomContext<AwaitContextType>({\n\thookName: \"useAwaitContext\",\n\tname: \"AwaitContext\",\n\tproviderName: \"AwaitInner\",\n});\n\nexport const useAwaitContext = <TValue>() => useAwaitContextImpl() as AwaitContextType<TValue>;\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { type GetSlotComponentProps, getSlotMap, withSlotNameAndSymbol } from \"@/lib/utils\";\nimport { isFunction } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, Suspense, use, useMemo } from \"react\";\nimport { ErrorBoundary, type ErrorBoundaryProps, useErrorBoundaryContext } from \"../error-boundary\";\nimport { Slot } from \"../slot\";\nimport type { SuspenseWithBoundaryProps } from \"../suspense-with-boundary\";\nimport { AwaitContextProvider, useAwaitContext } from \"./await-context\";\n\ntype RenderPropFn<TValue> = (result: TValue) => React.ReactNode;\n\ntype ChildrenType<TValue> = React.ReactNode | RenderPropFn<TValue>;\n\ntype AwaitRootProps<TValue> = Pick<SuspenseWithBoundaryProps, \"errorFallback\" | \"fallback\"> & {\n\tasChild?: boolean;\n\tchildren: ChildrenType<TValue>;\n\tpromise: Promise<TValue>;\n\twrapperVariant?: \"all\" | \"none\" | \"only-errorBoundary\" | \"only-suspense\";\n};\n\nexport function AwaitRoot<TValue>(props: AwaitRootProps<TValue>) {\n\tconst { children, errorFallback, fallback, wrapperVariant = \"all\", ...restOfProps } = props;\n\n\tconst withErrorBoundary = wrapperVariant === \"all\" || wrapperVariant === \"only-errorBoundary\";\n\tconst withSuspense = wrapperVariant === \"all\" || wrapperVariant === \"only-suspense\";\n\n\tconst WithErrorBoundary = withErrorBoundary ? ErrorBoundary : ReactFragment;\n\tconst WithSuspense = withSuspense ? Suspense : ReactFragment;\n\n\tconst slots = !isFunction(children)\n\t\t? getSlotMap<SlotComponentProps>(children)\n\t\t: ({ default: children } as unknown as ReturnType<typeof getSlotMap<SlotComponentProps>>);\n\n\tconst selectedPendingFallback = slots.pending ?? fallback;\n\tconst selectedErrorFallback = slots.error ?? errorFallback;\n\n\treturn (\n\t\t<WithErrorBoundary {...(Boolean(selectedErrorFallback) && { fallback: selectedErrorFallback })}>\n\t\t\t<WithSuspense {...(Boolean(selectedPendingFallback) && { fallback: selectedPendingFallback })}>\n\t\t\t\t<AwaitRootInner {...restOfProps}>{slots.default}</AwaitRootInner>\n\t\t\t</WithSuspense>\n\t\t</WithErrorBoundary>\n\t);\n}\n\ntype AwaitRootInnerProps<TValue> = Pick<AwaitRootProps<TValue>, \"asChild\" | \"children\" | \"promise\">;\n\nfunction AwaitRootInner<TValue>(props: AwaitRootInnerProps<TValue>) {\n\tconst { asChild, children, promise } = props;\n\n\tconst result = use(promise);\n\n\tconst resolvedChildren = isFunction(children) ? children(result) : children;\n\n\tconst Component = asChild ? Slot.Root : ReactFragment;\n\n\tconst contextValue = useMemo(() => ({ promise, result }), [promise, result]);\n\n\treturn (\n\t\t<AwaitContextProvider value={contextValue}>\n\t\t\t<Component {...(asChild && contextValue)}>{resolvedChildren}</Component>\n\t\t</AwaitContextProvider>\n\t);\n}\n\ntype SlotComponentProps = AwaitErrorProps | AwaitPendingProps | AwaitSuccessProps;\n\ntype AwaitSuccessProps<TValue = unknown> = GetSlotComponentProps<\"default\", ChildrenType<TValue>>;\n\nexport function AwaitSuccess<TPromiseOrValue, TValue = Awaited<TPromiseOrValue>>(\n\tprops: Pick<AwaitSuccessProps<TValue>, \"children\">\n) {\n\tif (isFunction(props.children)) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks -- This hook only uses `use` under the hood so this is safe\n\t\tconst { result } = useAwaitContext<TValue>();\n\n\t\treturn props.children(result);\n\t}\n\n\treturn props.children;\n}\n\nObject.assign(AwaitSuccess, withSlotNameAndSymbol<AwaitSuccessProps>(\"default\"));\n\ntype AwaitPendingProps = GetSlotComponentProps<\"pending\", React.SuspenseProps[\"fallback\"]>;\n\nexport const AwaitPending = withSlotNameAndSymbol<AwaitPendingProps>(\"pending\");\n\ntype AwaitErrorProps = GetSlotComponentProps<\"error\", ErrorBoundaryProps[\"fallback\"]>;\n\nexport const AwaitError = withSlotNameAndSymbol<AwaitErrorProps, { asChild?: boolean }>(\n\t\"error\",\n\t(props) => {\n\t\tconst { asChild, children } = props;\n\n\t\tconst errorBoundaryContext = useErrorBoundaryContext();\n\n\t\tconst Component = asChild ? Slot.Root : ReactFragment;\n\n\t\tconst resolvedChildren = isFunction(children) ? children(errorBoundaryContext) : children;\n\n\t\treturn <Component {...(asChild && errorBoundaryContext)}>{resolvedChildren}</Component>;\n\t}\n);\n","export {\n\tAwaitRoot as Root,\n\tAwaitError as Error,\n\tAwaitPending as Pending,\n\tAwaitSuccess as Success,\n} from \"./await\";\n"],"mappings":";;;;;;;;;;AAOA,MAAa,CAAC,sBAAsB,oBAAoB,GAAG,oBAAsC;CAChG,UAAU;CACV,MAAM;CACN,cAAc;AACd,EAAC;AAEF,MAAa,kBAAkB,MAAc,qBAAqB;;;;ACUlE,SAAgB,UAAkBA,OAA+B;CAChE,MAAM,EAAE,UAAU,eAAe,UAAU,iBAAiB,MAAO,GAAG,aAAa,GAAG;CAEtF,MAAM,oBAAoB,mBAAmB,SAAS,mBAAmB;CACzE,MAAM,eAAe,mBAAmB,SAAS,mBAAmB;CAEpE,MAAM,oBAAoB,oBAAoB,gBAAgBC;CAC9D,MAAM,eAAe,eAAe,WAAWA;CAE/C,MAAM,SAAS,WAAW,SAAS,GAChC,WAA+B,SAAS,GACvC,EAAE,SAAS,SAAU;CAEzB,MAAM,0BAA0B,MAAM,WAAW;CACjD,MAAM,wBAAwB,MAAM,SAAS;AAE7C,wBACC,IAAC;EAAkB,GAAK,QAAQ,sBAAsB,IAAI,EAAE,UAAU,sBAAuB;4BAC5F,IAAC;GAAa,GAAK,QAAQ,wBAAwB,IAAI,EAAE,UAAU,wBAAyB;6BAC3F,IAAC;IAAe,GAAI;cAAc,MAAM;KAAyB;IACnD;GACI;AAErB;AAID,SAAS,eAAuBC,OAAoC;CACnE,MAAM,EAAE,SAAS,UAAU,SAAS,GAAG;CAEvC,MAAM,SAAS,IAAI,QAAQ;CAE3B,MAAM,mBAAmB,WAAW,SAAS,GAAG,SAAS,OAAO,GAAG;CAEnE,MAAMC,cAAY,qBAAsBF;CAExC,MAAM,eAAe,QAAQ,OAAO;EAAE;EAAS;CAAQ,IAAG,CAAC,SAAS,MAAO,EAAC;AAE5E,wBACC,IAAC;EAAqB,OAAO;4BAC5B,IAACE;GAAU,GAAK,WAAW;aAAgB;IAA6B;GAClD;AAExB;AAMD,SAAgB,aACfC,OACC;AACD,KAAI,WAAW,MAAM,SAAS,EAAE;EAE/B,MAAM,EAAE,QAAQ,GAAG,iBAAyB;AAE5C,SAAO,MAAM,SAAS,OAAO;CAC7B;AAED,QAAO,MAAM;AACb;AAED,OAAO,OAAO,cAAc,sBAAyC,UAAU,CAAC;AAIhF,MAAa,eAAe,sBAAyC,UAAU;AAI/E,MAAa,aAAa,sBACzB,SACA,CAAC,UAAU;CACV,MAAM,EAAE,SAAS,UAAU,GAAG;CAE9B,MAAM,uBAAuB,yBAAyB;CAEtD,MAAMD,cAAY,qBAAsBF;CAExC,MAAM,mBAAmB,WAAW,SAAS,GAAG,SAAS,qBAAqB,GAAG;AAEjF,wBAAO,IAACE;EAAU,GAAK,WAAW;YAAwB;GAA6B;AACvF,EACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"card-jkLXbuiw.js","names":["props: PolymorphicProps<TElement>","props: PolymorphicProps<TElement, { asChild?: boolean }>","Component"],"sources":["../../src/components/ui/card/card.tsx","../../src/components/ui/card/card-parts.ts"],"sourcesContent":["import type { PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\nimport * as React from \"react\";\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\n\nexport function CardRoot<TElement extends React.ElementType = \"article\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"article\", ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"card\"\n\t\t\tdata-part=\"root\"\n\t\t\tdata-slot=\"card-root\"\n\t\t\tclassName=\"flex flex-col gap-6 rounded-xl border py-6 shadow-sm\"\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\n\nexport function CardHeader<TElement extends React.ElementType = \"header\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"header\", ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"card\"\n\t\t\tdata-part=\"header\"\n\t\t\tdata-slot=\"card-header\"\n\t\t\tclassName=\"@container/card-header has-data-[slot=card-action]:grid-cols-[1fr_auto] grid\n\t\t\t\tauto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6\"\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\n\nexport function CardTitle<TElement extends React.ElementType = \"h3\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"h3\", className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"card\"\n\t\t\tdata-part=\"title\"\n\t\t\tdata-slot=\"card-title\"\n\t\t\tclassName={cnMerge(\"font-semibold leading-none\", className)}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\n\nexport function CardDescription<TElement extends React.ElementType = \"p\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"p\", className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"card\"\n\t\t\tdata-part=\"description\"\n\t\t\tdata-slot=\"card-description\"\n\t\t\tclassName={cnMerge(\"text-shadcn-muted-foreground text-sm\", className)}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\n\nexport function CardContent<TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"div\", className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"card\"\n\t\t\tdata-part=\"content\"\n\t\t\tdata-slot=\"card-content\"\n\t\t\tclassName={cnMerge(\"px-6\", className)}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\n\nexport function CardAction<TElement extends React.ElementType = \"div\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"div\", className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element\n\t\t\tdata-scope=\"card\"\n\t\t\tdata-part=\"action\"\n\t\t\tdata-slot=\"card-action\"\n\t\t\tclassName={cnMerge(\"col-start-2 row-span-2 row-start-1 self-start justify-self-end\", className)}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\n\nexport function CardFooter<TElement extends React.ElementType = \"footer\">(\n\tprops: PolymorphicProps<TElement, { asChild?: boolean }>\n) {\n\tconst { as: Element = \"footer\", asChild, className, ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Component\n\t\t\tdata-scope=\"card\"\n\t\t\tdata-part=\"footer\"\n\t\t\tdata-slot=\"card-footer\"\n\t\t\tclassName={cnMerge(\"px-6\", className)}\n\t\t\t{...restOfProps}\n\t\t/>\n\t);\n}\n","export {\n\tCardContent as Content,\n\tCardDescription as Description,\n\tCardFooter as Footer,\n\tCardHeader as Header,\n\tCardAction as Action,\n\tCardRoot as Root,\n\tCardTitle as Title,\n} from \"./card\";\n"],"mappings":";;;;;;;AAKA,SAAgB,SACfA,OACC;CACD,MAAM,EAAE,IAAI,UAAU,UAAW,GAAG,aAAa,GAAG;AAEpD,wBACC,IAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAU;EACV,GAAI;GACH;AAEH;AAED,SAAgB,WACfA,OACC;CACD,MAAM,EAAE,IAAI,UAAU,SAAU,GAAG,aAAa,GAAG;AAEnD,wBACC,IAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAU;EAEV,GAAI;GACH;AAEH;AAED,SAAgB,UAAqDA,OAAmC;CACvG,MAAM,EAAE,IAAI,UAAU,MAAM,UAAW,GAAG,aAAa,GAAG;AAE1D,wBACC,IAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,8BAA8B,UAAU;EAC3D,GAAI;GACH;AAEH;AAED,SAAgB,gBACfA,OACC;CACD,MAAM,EAAE,IAAI,UAAU,KAAK,UAAW,GAAG,aAAa,GAAG;AAEzD,wBACC,IAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,wCAAwC,UAAU;EACrE,GAAI;GACH;AAEH;AAED,SAAgB,YACfA,OACC;CACD,MAAM,EAAE,IAAI,UAAU,OAAO,UAAW,GAAG,aAAa,GAAG;AAE3D,wBACC,IAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,QAAQ,UAAU;EACrC,GAAI;GACH;AAEH;AAED,SAAgB,WAAuDA,OAAmC;CACzG,MAAM,EAAE,IAAI,UAAU,OAAO,UAAW,GAAG,aAAa,GAAG;AAE3D,wBACC,IAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,kEAAkE,UAAU;EAC/F,GAAI;GACH;AAEH;AAED,SAAgB,WACfC,OACC;CACD,MAAM,EAAE,IAAI,UAAU,UAAU,SAAS,UAAW,GAAG,aAAa,GAAG;CAEvE,MAAMC,cAAY,qBAAsB;AAExC,wBACC,IAACA;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,QAAQ,UAAU;EACrC,GAAI;GACH;AAEH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"carousel-Dvp-qURP.js","names":["storeValues: PrettyOmit<CarouselProviderProps<TImages>, \"children\">","props: Omit<CarouselProviderProps<TImages>, \"children\">","props: CarouselProviderProps<TImages>","props: React.SVGProps<SVGSVGElement>","options: CarouselOptions","props: PolymorphicProps<TElement, CarouselContentProps>","props: CarouselButtonsProps","props: CarouselControlProps","props: CarouselWrapperProps<TArrayItem>","props: PolymorphicProps<TElement, OtherCarouselProps>","props: CarouselIndicatorProps"],"sources":["../../src/components/ui/carousel/carousel-store-context.tsx","../../src/components/ui/carousel/icons.tsx","../../src/components/ui/carousel/useCarouselOptions.ts","../../src/components/ui/carousel/carousel.tsx","../../src/components/ui/carousel/carousel-parts.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { useConstant } from \"@zayne-labs/toolkit-react\";\nimport { createZustandContext } from \"@zayne-labs/toolkit-react/zustand\";\nimport type { PrettyOmit } from \"@zayne-labs/toolkit-type-helpers\";\nimport { useEffect } from \"react\";\nimport { create } from \"zustand\";\nimport type { CarouselProviderProps, CarouselStore, ImagesType } from \"./types\";\n\nconst [Provider, useCarouselStoreContext] = createZustandContext<CarouselStore>({\n\thookName: \"useCarouselStore\",\n\tname: \"CarouselStoreContext\",\n\tproviderName: \"CarouselContextProvider\",\n});\n\n// CarouselStore Creation\nconst createCarouselStore = <TImages extends ImagesType>(\n\tstoreValues: PrettyOmit<CarouselProviderProps<TImages>, \"children\">\n) => {\n\tconst { images, onSlideBtnClick } = storeValues;\n\n\tconst useInitCarouselStore = create<CarouselStore<TImages>>()((set, get) => ({\n\t\tcurrentSlide: 0,\n\t\timages,\n\t\tmaxSlide: images.length - 1,\n\n\t\t/* eslint-disable perfectionist/sort-objects -- actions should be last */\n\t\tactions: {\n\t\t\t/* eslint-enable perfectionist/sort-objects -- actions should be last */\n\n\t\t\tgoToNextSlide: () => {\n\t\t\t\tconst { currentSlide, maxSlide } = get();\n\t\t\t\tconst { goToSlide } = get().actions;\n\n\t\t\t\tif (currentSlide === maxSlide) {\n\t\t\t\t\tgoToSlide(0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tgoToSlide(currentSlide + 1);\n\t\t\t},\n\n\t\t\tgoToPreviousSlide: () => {\n\t\t\t\tconst { currentSlide, maxSlide } = get();\n\t\t\t\tconst { goToSlide } = get().actions;\n\n\t\t\t\tif (currentSlide === 0) {\n\t\t\t\t\tgoToSlide(maxSlide);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tgoToSlide(currentSlide - 1);\n\t\t\t},\n\n\t\t\tgoToSlide: (newValue) => {\n\t\t\t\tonSlideBtnClick?.();\n\n\t\t\t\tset({ currentSlide: newValue });\n\t\t\t},\n\t\t},\n\t}));\n\n\treturn useInitCarouselStore;\n};\n\nconst useCarousel = <TImages extends ImagesType>(\n\tprops: Omit<CarouselProviderProps<TImages>, \"children\">\n) => {\n\tconst { images, onSlideBtnClick } = props;\n\n\tconst useInitCarouselStore = useConstant(() => createCarouselStore({ images, onSlideBtnClick }));\n\n\t// == To set images again when a page is mounted, preventing stale images from previous page\n\tuseEffect(() => {\n\t\tuseInitCarouselStore.setState({ images });\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps -- useInitCarouselStore is stable\n\t}, [images]);\n\n\treturn useInitCarouselStore;\n};\n\n// == Provider Component\nfunction CarouselContextProvider<TImages extends ImagesType>(props: CarouselProviderProps<TImages>) {\n\tconst { children, images, onSlideBtnClick } = props;\n\n\tconst useInitCarouselStore = useCarousel({ images, onSlideBtnClick });\n\n\treturn <Provider value={useInitCarouselStore}>{children}</Provider>;\n}\n\n// eslint-disable-next-line react-refresh/only-export-components -- It's fine\nexport { useCarouselStoreContext, CarouselContextProvider };\n","import * as React from \"react\";\n\nexport const ChevronLeftIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<circle cx=\"12\" cy=\"12\" r=\"10\" />\n\t\t\t<path d=\"m14 16l-4-4l4-4\" />\n\t\t</g>\n\t</svg>\n);\n","import { useAnimationInterval, useCallbackRef } from \"@zayne-labs/toolkit-react\";\nimport { useState } from \"react\";\nimport { useCarouselStoreContext } from \"./carousel-store-context\";\n\ntype CarouselOptions = {\n\tautoSlideInterval?: number;\n\thasAutoSlide?: boolean;\n\tshouldPauseOnHover?: boolean;\n};\n\nconst useCarouselOptions = (options: CarouselOptions = {}) => {\n\tconst { autoSlideInterval = 5000, hasAutoSlide = false, shouldPauseOnHover = false } = options;\n\n\tconst { goToNextSlide } = useCarouselStoreContext((state) => state.actions);\n\n\tconst [isPaused, setIsPaused] = useState(false);\n\n\tconst shouldAutoSlide = hasAutoSlide && !isPaused;\n\n\tuseAnimationInterval({\n\t\tintervalDuration: shouldAutoSlide ? autoSlideInterval : null,\n\t\tonAnimation: goToNextSlide,\n\t});\n\n\tconst pauseAutoSlide = useCallbackRef(() => shouldPauseOnHover && setIsPaused(true));\n\n\tconst resumeAutoSlide = useCallbackRef(() => shouldPauseOnHover && setIsPaused(false));\n\n\treturn { pauseAutoSlide, resumeAutoSlide };\n};\n\nexport { useCarouselOptions };\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { Show } from \"@/components/common\";\nimport { getElementList } from \"@/components/common/for\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport type { CssWithCustomProperties, PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { useCarouselStoreContext } from \"./carousel-store-context\";\nimport { ChevronLeftIcon } from \"./icons\";\nimport type {\n\tCarouselButtonsProps,\n\tCarouselContentProps,\n\tCarouselControlProps,\n\tCarouselIndicatorProps,\n\tCarouselWrapperProps,\n\tOtherCarouselProps,\n} from \"./types\";\nimport { useCarouselOptions } from \"./useCarouselOptions\";\n\n// TODO - Add dragging and swiping support\nexport function CarouselContent<TElement extends React.ElementType = \"article\">(\n\tprops: PolymorphicProps<TElement, CarouselContentProps>\n) {\n\tconst {\n\t\tas: HtmlElement = \"article\",\n\t\tautoSlideInterval,\n\t\tchildren,\n\t\tclassNames,\n\t\thasAutoSlide,\n\t\tshouldPauseOnHover,\n\t} = props;\n\n\tconst { pauseAutoSlide, resumeAutoSlide } = useCarouselOptions({\n\t\tautoSlideInterval,\n\t\thasAutoSlide,\n\t\tshouldPauseOnHover,\n\t});\n\n\t// FIXME - Prevent touch swipe on mobile using a cover element or allow swipe but it must update the state appropriately\n\treturn (\n\t\t<HtmlElement\n\t\t\tdata-id=\"Carousel\"\n\t\t\tclassName={cnMerge(\"relative select-none\", classNames?.base)}\n\t\t\tonMouseEnter={pauseAutoSlide}\n\t\t\tonMouseLeave={resumeAutoSlide}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-id=\"Scroll Container\"\n\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\"flex size-full overflow-x-scroll [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n\t\t\t\t\tclassNames?.scrollContainer\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</HtmlElement>\n\t);\n}\n\nexport function CarouselButton(props: CarouselButtonsProps) {\n\tconst { classNames, icon, variant } = props;\n\n\tconst { goToNextSlide, goToPreviousSlide } = useCarouselStoreContext((state) => state.actions);\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={cnMerge(\n\t\t\t\t\"z-30 flex h-full w-fit items-center\",\n\t\t\t\tvariant === \"prev\" ? \"justify-start\" : \"justify-end\",\n\t\t\t\tclassNames?.base\n\t\t\t)}\n\t\t\tonClick={variant === \"prev\" ? goToPreviousSlide : goToNextSlide}\n\t\t>\n\t\t\t<span className={cnMerge(\"transition-transform active:scale-[1.06]\", classNames?.iconContainer)}>\n\t\t\t\t{icon ?? (\n\t\t\t\t\t<ChevronLeftIcon\n\t\t\t\t\t\tclassName={cnMerge(variant === \"next\" && \"rotate-180\", classNames?.defaultIcon)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</span>\n\t\t</button>\n\t);\n}\n\nexport function CarouselControls(props: CarouselControlProps) {\n\tconst { classNames, icon } = props;\n\n\treturn (\n\t\t<div className={cnMerge(\"absolute inset-0 flex justify-between\", classNames?.base)}>\n\t\t\t<Show.Root when={icon?.iconType}>\n\t\t\t\t<CarouselButton\n\t\t\t\t\tvariant=\"prev\"\n\t\t\t\t\tclassNames={{\n\t\t\t\t\t\tdefaultIcon: classNames?.defaultIcon,\n\t\t\t\t\t\ticonContainer: cnMerge(\n\t\t\t\t\t\t\ticon?.iconType === \"nextIcon\" && \"rotate-180\",\n\t\t\t\t\t\t\tclassNames?.iconContainer\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t\ticon={icon?.icon}\n\t\t\t\t/>\n\n\t\t\t\t<CarouselButton\n\t\t\t\t\tvariant=\"next\"\n\t\t\t\t\tclassNames={{\n\t\t\t\t\t\tdefaultIcon: classNames?.defaultIcon,\n\t\t\t\t\t\ticonContainer: cnMerge(\n\t\t\t\t\t\t\ticon?.iconType === \"prevIcon\" && \"rotate-180\",\n\t\t\t\t\t\t\tclassNames?.iconContainer\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t\ticon={icon?.icon}\n\t\t\t\t/>\n\n\t\t\t\t<Show.Otherwise>\n\t\t\t\t\t<CarouselButton\n\t\t\t\t\t\tvariant=\"prev\"\n\t\t\t\t\t\tclassNames={{\n\t\t\t\t\t\t\tdefaultIcon: classNames?.defaultIcon,\n\t\t\t\t\t\t\ticonContainer: classNames?.iconContainer,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\ticon={icon?.prev}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<CarouselButton\n\t\t\t\t\t\tvariant=\"next\"\n\t\t\t\t\t\tclassNames={{\n\t\t\t\t\t\t\tdefaultIcon: classNames?.defaultIcon,\n\t\t\t\t\t\t\ticonContainer: classNames?.iconContainer,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\ticon={icon?.next}\n\t\t\t\t\t/>\n\t\t\t\t</Show.Otherwise>\n\t\t\t</Show.Root>\n\t\t</div>\n\t);\n}\n\nexport function CarouselItemGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>) {\n\tconst { children, className, each, render } = props;\n\n\tconst [ItemList] = getElementList(\"base\");\n\tconst currentSlide = useCarouselStoreContext((state) => state.currentSlide);\n\tconst images = useCarouselStoreContext((state) => each ?? (state.images as TArrayItem[]));\n\n\treturn (\n\t\t<ul\n\t\t\tdata-id=\"Carousel Image Wrapper\"\n\t\t\tclassName={cnMerge(\n\t\t\t\t`flex w-full shrink-0 snap-center [transform:translate3d(var(--translate-distance),0,0)]\n\t\t\t\t[transition:transform_800ms_ease]`,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tstyle={\n\t\t\t\t{\n\t\t\t\t\t\"--translate-distance\": `-${currentSlide * 100}%`,\n\t\t\t\t} satisfies CssWithCustomProperties as CssWithCustomProperties\n\t\t\t}\n\t\t>\n\t\t\t{typeof render === \"function\" ? (\n\t\t\t\t<ItemList each={images} render={render} />\n\t\t\t) : (\n\t\t\t\t<ItemList each={images}>{children}</ItemList>\n\t\t\t)}\n\t\t</ul>\n\t);\n}\n\nexport function CarouselItem({ children, className, ...restOfProps }: OtherCarouselProps) {\n\treturn (\n\t\t<li\n\t\t\tclassName={cnMerge(\"flex w-full shrink-0 snap-center justify-center\", className)}\n\t\t\t{...restOfProps}\n\t\t>\n\t\t\t{children}\n\t\t</li>\n\t);\n}\n\nexport function CarouselCaption<TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicProps<TElement, OtherCarouselProps>\n) {\n\tconst { as: HtmlElement = \"div\", children, className } = props;\n\n\treturn (\n\t\t<HtmlElement data-id=\"Carousel Caption\" className={cnMerge(\"absolute z-10\", className)}>\n\t\t\t{children}\n\t\t</HtmlElement>\n\t);\n}\n\nexport function CarouselIndicatorGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>) {\n\tconst { children, className, each, render } = props;\n\n\tconst images = useCarouselStoreContext((state) => each ?? (state.images as TArrayItem[]));\n\tconst [IndicatorList] = getElementList(\"base\");\n\n\treturn (\n\t\t<ul\n\t\t\tdata-id=\"Carousel Indicators\"\n\t\t\tclassName={cnMerge(\n\t\t\t\t\"absolute bottom-[25px] z-[2] flex w-full items-center justify-center gap-[15px]\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t{typeof render === \"function\" ? (\n\t\t\t\t<IndicatorList each={images} render={render} />\n\t\t\t) : (\n\t\t\t\t<IndicatorList each={images}>{children}</IndicatorList>\n\t\t\t)}\n\t\t</ul>\n\t);\n}\n\nexport function CarouselIndicator(props: CarouselIndicatorProps) {\n\tconst { classNames, currentIndex } = props;\n\n\tconst {\n\t\tactions: { goToSlide },\n\t\tcurrentSlide,\n\t} = useCarouselStoreContext((state) => state);\n\n\treturn (\n\t\t<li className={cnMerge(\"inline-flex\", classNames?.base)}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={() => goToSlide(currentIndex)}\n\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\"size-[6px] rounded-[50%]\",\n\t\t\t\t\tclassNames?.base,\n\t\t\t\t\tcurrentIndex === currentSlide && [\"w-[35px] rounded-[5px]\", classNames?.isActive]\n\t\t\t\t)}\n\t\t\t/>\n\t\t</li>\n\t);\n}\n","export { CarouselContextProvider as Root } from \"./carousel-store-context\";\nexport {\n\tCarouselContent as Content,\n\tCarouselControls as Controls,\n\tCarouselButton as Button,\n\tCarouselItem as Item,\n\tCarouselItemGroup as ItemGroup,\n\tCarouselCaption as Caption,\n\tCarouselIndicator as Indicator,\n\tCarouselIndicatorGroup as IndicatorGroup,\n} from \"./carousel\";\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drag-scroll-BLjij7aI.js","names":["element: TElement","action: \"remove\" | \"reset\"","dragContainer: HTMLElement","props?: DragScrollProps<TElement, TItemElement>","event: MouseEvent","refCallBack: RefCallback<TElement>","getRootProps: DragScrollResult<TElement, TItemElement>[\"getRootProps\"]","getItemProps: DragScrollResult<TElement, TItemElement>[\"getItemProps\"]"],"sources":["../../src/components/ui/drag-scroll/utils.ts","../../src/components/ui/drag-scroll/use-drag-scroll.ts"],"sourcesContent":["import { checkIsDeviceMobile } from \"@zayne-labs/toolkit-core\";\n\n/* eslint-disable no-param-reassign -- Mutation is needed here since it's an element */\nexport const updateCursor = <TElement extends HTMLElement>(element: TElement) => {\n\telement.style.cursor = \"grabbing\";\n\telement.style.userSelect = \"none\";\n};\n\nexport const onScrollSnap = <TElement extends HTMLElement>(\n\taction: \"remove\" | \"reset\",\n\telement: TElement\n) => {\n\tif (action === \"remove\") {\n\t\telement.style.scrollSnapType = \"none\";\n\t\treturn;\n\t}\n\n\telement.style.scrollSnapType = \"\";\n};\n\nexport const resetCursor = <TElement extends HTMLElement>(element: TElement) => {\n\telement.style.cursor = \"\";\n\telement.style.userSelect = \"\";\n};\n/* eslint-enable no-param-reassign -- Mutation is needed here since it's an element */\n\nexport const handleScrollSnap = (dragContainer: HTMLElement) => {\n\tconst isMobile = checkIsDeviceMobile();\n\n\tif (!isMobile) {\n\t\tonScrollSnap(\"remove\", dragContainer);\n\t} else {\n\t\tonScrollSnap(\"reset\", dragContainer);\n\t}\n};\n","import { cnMerge } from \"@/lib/utils/cn\";\nimport { off, on } from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef } from \"@zayne-labs/toolkit-react\";\nimport { type InferProps, composeRefs, mergeTwoProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { type RefCallback, useRef } from \"react\";\nimport { handleScrollSnap, resetCursor, updateCursor } from \"./utils\";\n\ntype ItemProps<TItemElement extends HTMLElement> = Omit<InferProps<TItemElement>, \"children\">;\n\ntype RootProps<TElement extends HTMLElement> = Omit<InferProps<TElement>, \"children\">;\n\ntype DragScrollProps<TElement extends HTMLElement, TItemElement extends HTMLElement> = {\n\tclassNames?: { base?: string; item?: string };\n\textraItemProps?: ItemProps<TItemElement>;\n\textraRootProps?: InferProps<TElement>;\n\torientation?: \"both\" | \"horizontal\" | \"vertical\";\n\tusage?: \"allScreens\" | \"desktopOnly\" | \"mobileAndTabletOnly\";\n};\n\ntype DragScrollResult<TElement extends HTMLElement, TItemElement extends HTMLElement> = {\n\tgetItemProps: (itemProps?: ItemProps<TItemElement>) => ItemProps<TItemElement>;\n\tgetRootProps: (rootProps?: RootProps<TElement>) => RootProps<TElement>;\n};\n\nconst useDragScroll = <TElement extends HTMLElement, TItemElement extends HTMLElement = HTMLElement>(\n\tprops?: DragScrollProps<TElement, TItemElement>\n): DragScrollResult<TElement, TItemElement> => {\n\tconst {\n\t\tclassNames,\n\t\textraItemProps,\n\t\textraRootProps,\n\t\torientation = \"horizontal\",\n\t\tusage = \"allScreens\",\n\t} = props ?? {};\n\n\tconst dragContainerRef = useRef<TElement>(null);\n\n\tconst positionRef = useRef({ left: 0, top: 0, x: 0, y: 0 });\n\n\tconst handleMouseMove = useCallbackRef((event: MouseEvent) => {\n\t\tif (!dragContainerRef.current) return;\n\n\t\tif (orientation === \"horizontal\" || orientation === \"both\") {\n\t\t\t// == calculate the current change in the horizontal scroll position based on the difference between the previous mouse position and the new mouse position\n\t\t\tconst dx = event.clientX - positionRef.current.x;\n\n\t\t\t// == Assign the scrollLeft of the container to the difference between its previous horizontal scroll position and the change in the mouse position\n\t\t\tdragContainerRef.current.scrollLeft = positionRef.current.left - dx;\n\t\t}\n\n\t\tif (orientation === \"vertical\" || orientation === \"both\") {\n\t\t\t// == calculate the current change in the vertical scroll position based on the difference between the previous mouse position and the new mouse position\n\t\t\tconst dy = event.clientY - positionRef.current.y;\n\n\t\t\t// == Assign the scrollTop of the container to the difference between its previous vertical scroll position and the change in the mouse position\n\t\t\tdragContainerRef.current.scrollTop = positionRef.current.top - dy;\n\t\t}\n\t});\n\n\tconst handleMouseUpOrLeave = useCallbackRef(() => {\n\t\tif (!dragContainerRef.current) return;\n\n\t\toff(\"mousemove\", dragContainerRef.current, handleMouseMove);\n\t\toff(\"mouseup\", dragContainerRef.current, handleMouseUpOrLeave);\n\t\toff(\"mouseleave\", dragContainerRef.current, handleMouseUpOrLeave);\n\n\t\tresetCursor(dragContainerRef.current);\n\t});\n\n\tconst handleMouseDown = useCallbackRef((event: MouseEvent) => {\n\t\tif (usage === \"mobileAndTabletOnly\" && window.innerWidth >= 768) return;\n\t\tif (usage === \"desktopOnly\" && window.innerWidth < 768) return;\n\n\t\tif (!dragContainerRef.current) return;\n\n\t\t// == Update all initial position properties stored in the positionRef\n\t\tif (orientation === \"horizontal\" || orientation === \"both\") {\n\t\t\tpositionRef.current.x = event.clientX;\n\t\t\tpositionRef.current.left = dragContainerRef.current.scrollLeft;\n\t\t}\n\n\t\tif (orientation === \"vertical\" || orientation === \"both\") {\n\t\t\tpositionRef.current.y = event.clientY;\n\t\t\tpositionRef.current.top = dragContainerRef.current.scrollTop;\n\t\t}\n\n\t\tupdateCursor(dragContainerRef.current);\n\n\t\ton(\"mousemove\", dragContainerRef.current, handleMouseMove);\n\t\ton(\"mouseup\", dragContainerRef.current, handleMouseUpOrLeave);\n\t\ton(\"mouseleave\", dragContainerRef.current, handleMouseUpOrLeave);\n\t});\n\n\tconst refCallBack: RefCallback<TElement> = useCallbackRef((node) => {\n\t\tdragContainerRef.current = node;\n\n\t\tnode && handleScrollSnap(node);\n\n\t\tconst cleanup = on(\"mousedown\", dragContainerRef.current, handleMouseDown);\n\n\t\treturn cleanup;\n\t});\n\n\tconst getRootProps: DragScrollResult<TElement, TItemElement>[\"getRootProps\"] = (rootProps) => {\n\t\tconst mergedRootProps = mergeTwoProps(extraRootProps, rootProps);\n\n\t\treturn {\n\t\t\t...mergedRootProps,\n\t\t\tclassName: cnMerge(\n\t\t\t\t`scrollbar-hidden flex w-full cursor-grab snap-x snap-mandatory overflow-y-hidden\n\t\t\t\toverflow-x-scroll`,\n\t\t\t\torientation === \"horizontal\" && \"flex-row\",\n\t\t\t\torientation === \"vertical\" && \"flex-col\",\n\t\t\t\tusage === \"mobileAndTabletOnly\" && \"md:cursor-default md:flex-col\",\n\t\t\t\tusage === \"desktopOnly\" && \"max-md:cursor-default max-md:flex-col\",\n\t\t\t\tclassNames?.base,\n\t\t\t\tmergedRootProps.className\n\t\t\t),\n\t\t\t\"data-part\": \"root\",\n\t\t\t\"data-scope\": \"drag-scroll\",\n\t\t\t\"data-slot\": \"drag-scroll-root\",\n\t\t\tref: composeRefs(\n\t\t\t\trefCallBack,\n\t\t\t\t(mergedRootProps as { ref?: React.Ref<TElement> } | undefined)?.ref\n\t\t\t),\n\t\t};\n\t};\n\n\tconst getItemProps: DragScrollResult<TElement, TItemElement>[\"getItemProps\"] = (itemProps) => {\n\t\tconst mergedItemProps = mergeTwoProps(extraItemProps, itemProps);\n\n\t\treturn {\n\t\t\t...mergedItemProps,\n\t\t\tclassName: cnMerge(\"snap-center snap-always\", classNames?.item, mergedItemProps.className),\n\t\t\t\"data-part\": \"item\",\n\t\t\t\"data-scope\": \"drag-scroll\",\n\t\t\t\"data-slot\": \"drag-scroll-item\",\n\t\t};\n\t};\n\n\treturn { getItemProps, getRootProps };\n};\n\nexport { useDragScroll };\n"],"mappings":"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"}
|