@zayne-labs/ui-react 0.9.21 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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-BnSpmc4f.js} +14 -18
- package/dist/esm/form-BnSpmc4f.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-BwnMUHzm.d.ts → index-BBJzo-WC.d.ts} +2 -3
- package/dist/esm/index-BEv8nXKb.d.ts +183 -0
- 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-YFi-sIuR.d.ts → index-BaONHZq0.d.ts} +6 -6
- 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-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-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-CFNg1R-m.d.ts → index-eCX5RJ41.d.ts} +2 -2
- 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,9 +1,9 @@
|
|
|
1
1
|
import { __export } from "./chunk-Cl8Af3a2.js";
|
|
2
|
-
import { getSlotMap, withSlotNameAndSymbol } from "./utils-
|
|
3
|
-
import { ErrorBoundary, useErrorBoundaryContext } from "./error-boundary-
|
|
4
|
-
import { SlotRoot } from "./slot-
|
|
5
|
-
import { Fragment, Suspense, use, useMemo } from "react";
|
|
2
|
+
import { getSlotMap, withSlotNameAndSymbol } from "./utils-ChjmDoRe.js";
|
|
3
|
+
import { ErrorBoundary, useErrorBoundaryContext } from "./error-boundary-xM9An3gz.js";
|
|
4
|
+
import { SlotRoot } from "./slot-D1062oA5.js";
|
|
6
5
|
import { isFunction } from "@zayne-labs/toolkit-type-helpers";
|
|
6
|
+
import { Fragment, Suspense, use, useMemo } from "react";
|
|
7
7
|
import { createCustomContext } from "@zayne-labs/toolkit-react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
|
|
@@ -18,9 +18,7 @@ const useAwaitContext = () => useAwaitContextImpl();
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/components/common/await/await.tsx
|
|
20
20
|
function AwaitRoot(props) {
|
|
21
|
-
const { children, errorFallback, fallback,
|
|
22
|
-
const withErrorBoundary = wrapperVariant === "all" || wrapperVariant === "only-errorBoundary";
|
|
23
|
-
const withSuspense = wrapperVariant === "all" || wrapperVariant === "only-suspense";
|
|
21
|
+
const { children, errorFallback, fallback, withErrorBoundary = true, withSuspense = true,...restOfProps } = props;
|
|
24
22
|
const WithErrorBoundary = withErrorBoundary ? ErrorBoundary : Fragment;
|
|
25
23
|
const WithSuspense = withSuspense ? Suspense : Fragment;
|
|
26
24
|
const slots = !isFunction(children) ? getSlotMap(children) : { default: children };
|
|
@@ -86,4 +84,4 @@ __export(await_parts_exports, {
|
|
|
86
84
|
|
|
87
85
|
//#endregion
|
|
88
86
|
export { AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, await_parts_exports, useAwaitContext };
|
|
89
|
-
//# sourceMappingURL=await-
|
|
87
|
+
//# sourceMappingURL=await-fjas2Q-C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"await-fjas2Q-C.js","names":["ReactFragment","Component"],"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 { isFunction } from \"@zayne-labs/toolkit-type-helpers\";\nimport * as React from \"react\";\nimport { Fragment as ReactFragment, Suspense, use, useMemo } from \"react\";\nimport { type GetSlotComponentProps, getSlotMap, withSlotNameAndSymbol } from \"@/lib/utils\";\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\twithErrorBoundary?: boolean;\n\twithSuspense?: boolean;\n};\n\nexport function AwaitRoot<TValue>(props: AwaitRootProps<TValue>) {\n\tconst {\n\t\tchildren,\n\t\terrorFallback,\n\t\tfallback,\n\t\twithErrorBoundary = true,\n\t\twithSuspense = true,\n\t\t...restOfProps\n\t} = props;\n\n\tconst WithErrorBoundary = withErrorBoundary ? ErrorBoundary : ReactFragment;\n\tconst WithSuspense = withSuspense ? Suspense : ReactFragment;\n\n\tconst slots =\n\t\t!isFunction(children) ?\n\t\t\tgetSlotMap<SlotComponentProps>(children)\n\t\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;CACd;AAED,MAAa,wBAAgC;;;;ACU7C,SAAgB,UAAkB,OAA+B;CAChE,MAAM,EACL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./chunk-Cl8Af3a2.js";
|
|
2
|
-
import { SlotRoot } from "./slot-
|
|
2
|
+
import { SlotRoot } from "./slot-D1062oA5.js";
|
|
3
3
|
import { cnMerge } from "./cn-_FbtIrlZ.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -92,4 +92,4 @@ __export(card_parts_exports, {
|
|
|
92
92
|
|
|
93
93
|
//#endregion
|
|
94
94
|
export { CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardRoot, CardTitle, card_parts_exports };
|
|
95
|
-
//# sourceMappingURL=card-
|
|
95
|
+
//# sourceMappingURL=card-TD60Xux0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-TD60Xux0.js","names":["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,SACf,OACC;CACD,MAAM,EAAE,IAAI,UAAU,UAAW,GAAG,aAAa,GAAG;AAEpD,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAU;EACV,GAAI;;AAGN;AAED,SAAgB,WACf,OACC;CACD,MAAM,EAAE,IAAI,UAAU,SAAU,GAAG,aAAa,GAAG;AAEnD,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAU;EAEV,GAAI;;AAGN;AAED,SAAgB,UAAqD,OAAmC;CACvG,MAAM,EAAE,IAAI,UAAU,MAAM,UAAW,GAAG,aAAa,GAAG;AAE1D,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,8BAA8B;EACjD,GAAI;;AAGN;AAED,SAAgB,gBACf,OACC;CACD,MAAM,EAAE,IAAI,UAAU,KAAK,UAAW,GAAG,aAAa,GAAG;AAEzD,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,wCAAwC;EAC3D,GAAI;;AAGN;AAED,SAAgB,YACf,OACC;CACD,MAAM,EAAE,IAAI,UAAU,OAAO,UAAW,GAAG,aAAa,GAAG;AAE3D,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,QAAQ;EAC3B,GAAI;;AAGN;AAED,SAAgB,WAAuD,OAAmC;CACzG,MAAM,EAAE,IAAI,UAAU,OAAO,UAAW,GAAG,aAAa,GAAG;AAE3D,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,kEAAkE;EACrF,GAAI;;AAGN;AAED,SAAgB,WACf,OACC;CACD,MAAM,EAAE,IAAI,UAAU,UAAU,SAAS,UAAW,GAAG,aAAa,GAAG;CAEvE,MAAMA,cAAY,qBAAsB;AAExC,QACC,oBAACA;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,QAAQ;EAC3B,GAAI;;AAGN"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { __export } from "./chunk-Cl8Af3a2.js";
|
|
2
|
-
import {
|
|
3
|
-
import { ShowFallback, ShowRoot } from "./show-
|
|
2
|
+
import { For } from "./for-DGs2XZ21.js";
|
|
3
|
+
import { ShowContent, ShowFallback, ShowRoot } from "./show-BabiXbf7.js";
|
|
4
4
|
import { cnMerge } from "./cn-_FbtIrlZ.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { isFunction } from "@zayne-labs/toolkit-type-helpers";
|
|
6
|
+
import { useMemo, useState } from "react";
|
|
7
|
+
import { createStore } from "@zayne-labs/toolkit-core";
|
|
8
|
+
import { useAnimationInterval, useCallbackRef, useStore } from "@zayne-labs/toolkit-react";
|
|
7
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
10
|
import { createZustandContext } from "@zayne-labs/toolkit-react/zustand";
|
|
9
|
-
import { create } from "zustand";
|
|
10
11
|
|
|
11
|
-
//#region src/components/ui/carousel/carousel-store-context.
|
|
12
|
-
const [
|
|
12
|
+
//#region src/components/ui/carousel/carousel-store-context.ts
|
|
13
|
+
const [CarouselStoreContextProvider, useCarouselStoreContext] = createZustandContext({
|
|
13
14
|
hookName: "useCarouselStore",
|
|
14
15
|
name: "CarouselStoreContext",
|
|
15
|
-
providerName: "
|
|
16
|
+
providerName: "CarouselRoot"
|
|
16
17
|
});
|
|
17
18
|
const createCarouselStore = (storeValues) => {
|
|
18
19
|
const { images, onSlideBtnClick } = storeValues;
|
|
19
|
-
const
|
|
20
|
+
const carouselStore = createStore((set, get) => ({
|
|
20
21
|
currentSlide: 0,
|
|
21
22
|
images,
|
|
22
23
|
maxSlide: images.length - 1,
|
|
@@ -45,30 +46,24 @@ const createCarouselStore = (storeValues) => {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}));
|
|
48
|
-
return
|
|
49
|
+
return carouselStore;
|
|
49
50
|
};
|
|
50
51
|
const useCarousel = (props) => {
|
|
51
52
|
const { images, onSlideBtnClick } = props;
|
|
52
|
-
const
|
|
53
|
+
const savedOnSlideBtnClick = useCallbackRef(onSlideBtnClick);
|
|
54
|
+
const carouselStore = useMemo(() => createCarouselStore({
|
|
53
55
|
images,
|
|
54
|
-
onSlideBtnClick
|
|
55
|
-
}));
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
56
|
+
onSlideBtnClick: savedOnSlideBtnClick
|
|
57
|
+
}), [images, savedOnSlideBtnClick]);
|
|
58
|
+
const useCarouselStore = (selector) => {
|
|
59
|
+
return useStore(carouselStore, selector);
|
|
60
|
+
};
|
|
61
|
+
const savedUseCarouselStore = useCallbackRef(useCarouselStore);
|
|
62
|
+
return useMemo(() => ({
|
|
63
|
+
carouselStore,
|
|
64
|
+
useCarouselStore: savedUseCarouselStore
|
|
65
|
+
}), [carouselStore, savedUseCarouselStore]);
|
|
60
66
|
};
|
|
61
|
-
function CarouselContextProvider(props) {
|
|
62
|
-
const { children, images, onSlideBtnClick } = props;
|
|
63
|
-
const useInitCarouselStore = useCarousel({
|
|
64
|
-
images,
|
|
65
|
-
onSlideBtnClick
|
|
66
|
-
});
|
|
67
|
-
return /* @__PURE__ */ jsx(Provider, {
|
|
68
|
-
value: useInitCarouselStore,
|
|
69
|
-
children
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
67
|
|
|
73
68
|
//#endregion
|
|
74
69
|
//#region src/components/ui/carousel/icons.tsx
|
|
@@ -94,14 +89,13 @@ const ChevronLeftIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
|
94
89
|
|
|
95
90
|
//#endregion
|
|
96
91
|
//#region src/components/ui/carousel/useCarouselOptions.ts
|
|
97
|
-
const useCarouselOptions = (options
|
|
98
|
-
const { autoSlideInterval = 5e3, hasAutoSlide = false, shouldPauseOnHover = false } = options;
|
|
99
|
-
const { goToNextSlide } = useCarouselStoreContext((state) => state.actions);
|
|
92
|
+
const useCarouselOptions = (options) => {
|
|
93
|
+
const { actions, autoSlideInterval = 5e3, hasAutoSlide = false, shouldPauseOnHover = false } = options;
|
|
100
94
|
const [isPaused, setIsPaused] = useState(false);
|
|
101
95
|
const shouldAutoSlide = hasAutoSlide && !isPaused;
|
|
102
96
|
useAnimationInterval({
|
|
103
97
|
intervalDuration: shouldAutoSlide ? autoSlideInterval : null,
|
|
104
|
-
onAnimation: goToNextSlide
|
|
98
|
+
onAnimation: actions.goToNextSlide
|
|
105
99
|
});
|
|
106
100
|
const pauseAutoSlide = useCallbackRef(() => shouldPauseOnHover && setIsPaused(true));
|
|
107
101
|
const resumeAutoSlide = useCallbackRef(() => shouldPauseOnHover && setIsPaused(false));
|
|
@@ -113,22 +107,32 @@ const useCarouselOptions = (options = {}) => {
|
|
|
113
107
|
|
|
114
108
|
//#endregion
|
|
115
109
|
//#region src/components/ui/carousel/carousel.tsx
|
|
116
|
-
function
|
|
117
|
-
const { as:
|
|
110
|
+
function CarouselRoot(props) {
|
|
111
|
+
const { as: Element = "div", autoSlideInterval, children, classNames, hasAutoSlide, images, onSlideBtnClick, shouldPauseOnHover } = props;
|
|
112
|
+
const { carouselStore } = useCarousel({
|
|
113
|
+
images,
|
|
114
|
+
onSlideBtnClick
|
|
115
|
+
});
|
|
116
|
+
const actions = carouselStore.getState().actions;
|
|
118
117
|
const { pauseAutoSlide, resumeAutoSlide } = useCarouselOptions({
|
|
118
|
+
actions,
|
|
119
119
|
autoSlideInterval,
|
|
120
120
|
hasAutoSlide,
|
|
121
121
|
shouldPauseOnHover
|
|
122
122
|
});
|
|
123
|
-
return /* @__PURE__ */ jsx(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
123
|
+
return /* @__PURE__ */ jsx(CarouselStoreContextProvider, {
|
|
124
|
+
store: carouselStore,
|
|
125
|
+
children: /* @__PURE__ */ jsx(Element, {
|
|
126
|
+
"data-scope": "carousel",
|
|
127
|
+
"data-part": "content",
|
|
128
|
+
"data-slot": "carousel-content",
|
|
129
|
+
className: cnMerge("relative select-none", classNames?.base),
|
|
130
|
+
onMouseEnter: pauseAutoSlide,
|
|
131
|
+
onMouseLeave: resumeAutoSlide,
|
|
132
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
133
|
+
className: cnMerge("flex size-full overflow-x-scroll [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", classNames?.scrollContainer),
|
|
134
|
+
children
|
|
135
|
+
})
|
|
132
136
|
})
|
|
133
137
|
});
|
|
134
138
|
}
|
|
@@ -136,6 +140,9 @@ function CarouselButton(props) {
|
|
|
136
140
|
const { classNames, icon, variant } = props;
|
|
137
141
|
const { goToNextSlide, goToPreviousSlide } = useCarouselStoreContext((state) => state.actions);
|
|
138
142
|
return /* @__PURE__ */ jsx("button", {
|
|
143
|
+
"data-scope": "carousel",
|
|
144
|
+
"data-part": "button",
|
|
145
|
+
"data-slot": "carousel-button",
|
|
139
146
|
type: "button",
|
|
140
147
|
className: cnMerge("z-30 flex h-full w-fit items-center", variant === "prev" ? "justify-start" : "justify-end", classNames?.base),
|
|
141
148
|
onClick: variant === "prev" ? goToPreviousSlide : goToNextSlide,
|
|
@@ -148,66 +155,71 @@ function CarouselButton(props) {
|
|
|
148
155
|
function CarouselControls(props) {
|
|
149
156
|
const { classNames, icon } = props;
|
|
150
157
|
return /* @__PURE__ */ jsx("div", {
|
|
158
|
+
"data-scope": "carousel",
|
|
159
|
+
"data-part": "controls",
|
|
160
|
+
"data-slot": "carousel-controls",
|
|
151
161
|
className: cnMerge("absolute inset-0 flex justify-between", classNames?.base),
|
|
152
162
|
children: /* @__PURE__ */ jsxs(ShowRoot, {
|
|
153
163
|
when: icon?.iconType,
|
|
154
|
-
children: [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
icon: icon?.next
|
|
185
|
-
})] })
|
|
186
|
-
]
|
|
164
|
+
children: [/* @__PURE__ */ jsxs(ShowContent, { children: [/* @__PURE__ */ jsx(CarouselButton, {
|
|
165
|
+
variant: "prev",
|
|
166
|
+
classNames: {
|
|
167
|
+
defaultIcon: classNames?.defaultIcon,
|
|
168
|
+
iconContainer: cnMerge(icon?.iconType === "nextIcon" && "rotate-180", classNames?.iconContainer)
|
|
169
|
+
},
|
|
170
|
+
icon: icon?.icon
|
|
171
|
+
}), /* @__PURE__ */ jsx(CarouselButton, {
|
|
172
|
+
variant: "next",
|
|
173
|
+
classNames: {
|
|
174
|
+
defaultIcon: classNames?.defaultIcon,
|
|
175
|
+
iconContainer: cnMerge(icon?.iconType === "prevIcon" && "rotate-180", classNames?.iconContainer)
|
|
176
|
+
},
|
|
177
|
+
icon: icon?.icon
|
|
178
|
+
})] }), /* @__PURE__ */ jsxs(ShowFallback, { children: [/* @__PURE__ */ jsx(CarouselButton, {
|
|
179
|
+
variant: "prev",
|
|
180
|
+
classNames: {
|
|
181
|
+
defaultIcon: classNames?.defaultIcon,
|
|
182
|
+
iconContainer: classNames?.iconContainer
|
|
183
|
+
},
|
|
184
|
+
icon: icon?.prev
|
|
185
|
+
}), /* @__PURE__ */ jsx(CarouselButton, {
|
|
186
|
+
variant: "next",
|
|
187
|
+
classNames: {
|
|
188
|
+
defaultIcon: classNames?.defaultIcon,
|
|
189
|
+
iconContainer: classNames?.iconContainer
|
|
190
|
+
},
|
|
191
|
+
icon: icon?.next
|
|
192
|
+
})] })]
|
|
187
193
|
})
|
|
188
194
|
});
|
|
189
195
|
}
|
|
190
196
|
function CarouselItemGroup(props) {
|
|
191
|
-
const { children, className, each
|
|
192
|
-
const [ItemList] = getElementList("base");
|
|
197
|
+
const { children, className, each } = props;
|
|
193
198
|
const currentSlide = useCarouselStoreContext((state) => state.currentSlide);
|
|
194
199
|
const images = useCarouselStoreContext((state) => each ?? state.images);
|
|
195
200
|
return /* @__PURE__ */ jsx("ul", {
|
|
196
|
-
"data-
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
"data-scope": "carousel",
|
|
202
|
+
"data-part": "item-group",
|
|
203
|
+
"data-slot": "carousel-item-group",
|
|
204
|
+
className: cnMerge(`duration-800 transform-[translate3d(var(--translate-distance),0,0)] flex w-full shrink-0
|
|
205
|
+
snap-center transition-transform`, className),
|
|
199
206
|
style: { "--translate-distance": `-${currentSlide * 100}%` },
|
|
200
|
-
children:
|
|
207
|
+
children: isFunction(children) ? /* @__PURE__ */ jsx(For, {
|
|
201
208
|
each: images,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
209
|
+
renderItem: (image, index, array) => children({
|
|
210
|
+
array,
|
|
211
|
+
image,
|
|
212
|
+
index
|
|
213
|
+
})
|
|
214
|
+
}) : children
|
|
207
215
|
});
|
|
208
216
|
}
|
|
209
|
-
function CarouselItem(
|
|
217
|
+
function CarouselItem(props) {
|
|
218
|
+
const { children, className,...restOfProps } = props;
|
|
210
219
|
return /* @__PURE__ */ jsx("li", {
|
|
220
|
+
"data-scope": "carousel",
|
|
221
|
+
"data-part": "item",
|
|
222
|
+
"data-slot": "carousel-item",
|
|
211
223
|
className: cnMerge("flex w-full shrink-0 snap-center justify-center", className),
|
|
212
224
|
...restOfProps,
|
|
213
225
|
children
|
|
@@ -216,31 +228,38 @@ function CarouselItem({ children, className,...restOfProps }) {
|
|
|
216
228
|
function CarouselCaption(props) {
|
|
217
229
|
const { as: HtmlElement = "div", children, className } = props;
|
|
218
230
|
return /* @__PURE__ */ jsx(HtmlElement, {
|
|
219
|
-
"data-
|
|
231
|
+
"data-scope": "carousel",
|
|
232
|
+
"data-part": "caption",
|
|
233
|
+
"data-slot": "carousel-caption",
|
|
220
234
|
className: cnMerge("absolute z-10", className),
|
|
221
235
|
children
|
|
222
236
|
});
|
|
223
237
|
}
|
|
224
238
|
function CarouselIndicatorGroup(props) {
|
|
225
|
-
const { children, className, each
|
|
239
|
+
const { children, className, each } = props;
|
|
226
240
|
const images = useCarouselStoreContext((state) => each ?? state.images);
|
|
227
|
-
const [IndicatorList] = getElementList("base");
|
|
228
241
|
return /* @__PURE__ */ jsx("ul", {
|
|
229
|
-
"data-
|
|
242
|
+
"data-scope": "carousel",
|
|
243
|
+
"data-part": "indicator-group",
|
|
244
|
+
"data-slot": "carousel-indicator-group",
|
|
230
245
|
className: cnMerge("absolute bottom-[25px] z-[2] flex w-full items-center justify-center gap-[15px]", className),
|
|
231
|
-
children:
|
|
246
|
+
children: isFunction(children) ? /* @__PURE__ */ jsx(For, {
|
|
232
247
|
each: images,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
248
|
+
renderItem: (image, index, array) => children({
|
|
249
|
+
array,
|
|
250
|
+
image,
|
|
251
|
+
index
|
|
252
|
+
})
|
|
253
|
+
}) : children
|
|
238
254
|
});
|
|
239
255
|
}
|
|
240
256
|
function CarouselIndicator(props) {
|
|
241
257
|
const { classNames, currentIndex } = props;
|
|
242
258
|
const { actions: { goToSlide }, currentSlide } = useCarouselStoreContext((state) => state);
|
|
243
259
|
return /* @__PURE__ */ jsx("li", {
|
|
260
|
+
"data-scope": "carousel",
|
|
261
|
+
"data-part": "indicator",
|
|
262
|
+
"data-slot": "carousel-indicator",
|
|
244
263
|
className: cnMerge("inline-flex", classNames?.base),
|
|
245
264
|
children: /* @__PURE__ */ jsx("button", {
|
|
246
265
|
type: "button",
|
|
@@ -256,15 +275,14 @@ var carousel_parts_exports = {};
|
|
|
256
275
|
__export(carousel_parts_exports, {
|
|
257
276
|
Button: () => CarouselButton,
|
|
258
277
|
Caption: () => CarouselCaption,
|
|
259
|
-
Content: () => CarouselContent,
|
|
260
278
|
Controls: () => CarouselControls,
|
|
261
279
|
Indicator: () => CarouselIndicator,
|
|
262
280
|
IndicatorGroup: () => CarouselIndicatorGroup,
|
|
263
281
|
Item: () => CarouselItem,
|
|
264
282
|
ItemGroup: () => CarouselItemGroup,
|
|
265
|
-
Root: () =>
|
|
283
|
+
Root: () => CarouselRoot
|
|
266
284
|
});
|
|
267
285
|
|
|
268
286
|
//#endregion
|
|
269
|
-
export { CarouselButton, CarouselCaption,
|
|
270
|
-
//# sourceMappingURL=carousel-
|
|
287
|
+
export { CarouselButton, CarouselCaption, CarouselControls, CarouselIndicator, CarouselIndicatorGroup, CarouselItem, CarouselItemGroup, CarouselRoot, carousel_parts_exports };
|
|
288
|
+
//# sourceMappingURL=carousel-YXXtZ85s.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-YXXtZ85s.js","names":["useCarouselStore: typeof useCarouselStoreContext"],"sources":["../../src/components/ui/carousel/carousel-store-context.ts","../../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 { createStore } from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef, useStore } from \"@zayne-labs/toolkit-react\";\nimport { createZustandContext } from \"@zayne-labs/toolkit-react/zustand\";\nimport type { PrettyOmit } from \"@zayne-labs/toolkit-type-helpers\";\nimport { useMemo } from \"react\";\nimport type { CarouselRootProps, CarouselStore, ImagesType } from \"./types\";\n\nconst [CarouselStoreContextProvider, useCarouselStoreContext] = createZustandContext<CarouselStore>({\n\thookName: \"useCarouselStore\",\n\tname: \"CarouselStoreContext\",\n\tproviderName: \"CarouselRoot\",\n});\n\n// CarouselStore Creation\nconst createCarouselStore = <TImages extends ImagesType>(\n\tstoreValues: PrettyOmit<CarouselRootProps<TImages>, \"children\">\n) => {\n\tconst { images, onSlideBtnClick } = storeValues;\n\n\tconst carouselStore = createStore<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 carouselStore;\n};\n\nconst useCarousel = <TImages extends ImagesType>(props: Omit<CarouselRootProps<TImages>, \"children\">) => {\n\tconst { images, onSlideBtnClick } = props;\n\n\tconst savedOnSlideBtnClick = useCallbackRef(onSlideBtnClick);\n\n\tconst carouselStore = useMemo(\n\t\t() => createCarouselStore({ images, onSlideBtnClick: savedOnSlideBtnClick }),\n\t\t[images, savedOnSlideBtnClick]\n\t);\n\n\tconst useCarouselStore: typeof useCarouselStoreContext = (selector) => {\n\t\treturn useStore(carouselStore, selector);\n\t};\n\n\tconst savedUseCarouselStore = useCallbackRef(useCarouselStore);\n\n\treturn useMemo(\n\t\t() => ({ carouselStore, useCarouselStore: savedUseCarouselStore }),\n\t\t[carouselStore, savedUseCarouselStore]\n\t);\n};\n\nexport { CarouselStoreContextProvider, useCarousel, useCarouselStoreContext };\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 type { CarouselStore } from \"./types\";\n\ntype CarouselOptions = {\n\tactions: CarouselStore[\"actions\"];\n\tautoSlideInterval?: number;\n\thasAutoSlide?: boolean;\n\tshouldPauseOnHover?: boolean;\n};\n\nconst useCarouselOptions = (options: CarouselOptions) => {\n\tconst { actions, autoSlideInterval = 5000, hasAutoSlide = false, shouldPauseOnHover = false } = options;\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: actions.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 type { CssWithCustomProperties, PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { isFunction } from \"@zayne-labs/toolkit-type-helpers\";\nimport * as React from \"react\";\nimport { Show } from \"@/components/common\";\nimport { For } from \"@/components/common/for\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport {\n\tCarouselStoreContextProvider,\n\tuseCarousel,\n\tuseCarouselStoreContext,\n} from \"./carousel-store-context\";\nimport { ChevronLeftIcon } from \"./icons\";\nimport type {\n\tCarouselButtonsProps,\n\tCarouselControlProps,\n\tCarouselIndicatorProps,\n\tCarouselRootProps,\n\tCarouselWrapperProps,\n\tImagesType,\n\tOtherCarouselProps,\n} from \"./types\";\nimport { useCarouselOptions } from \"./useCarouselOptions\";\n\n// TODO - Add dragging and swiping support\nexport function CarouselRoot<TImages extends ImagesType, TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicProps<TElement, CarouselRootProps<TImages>>\n) {\n\tconst {\n\t\tas: Element = \"div\",\n\t\tautoSlideInterval,\n\t\tchildren,\n\t\tclassNames,\n\t\thasAutoSlide,\n\t\timages,\n\t\tonSlideBtnClick,\n\t\tshouldPauseOnHover,\n\t} = props;\n\n\tconst { carouselStore } = useCarousel({ images, onSlideBtnClick });\n\n\tconst actions = carouselStore.getState().actions;\n\n\tconst { pauseAutoSlide, resumeAutoSlide } = useCarouselOptions({\n\t\tactions,\n\t\tautoSlideInterval,\n\t\thasAutoSlide,\n\t\tshouldPauseOnHover,\n\t});\n\n\treturn (\n\t\t<CarouselStoreContextProvider store={carouselStore}>\n\t\t\t<Element\n\t\t\t\tdata-scope=\"carousel\"\n\t\t\t\tdata-part=\"content\"\n\t\t\t\tdata-slot=\"carousel-content\"\n\t\t\t\tclassName={cnMerge(\"relative select-none\", classNames?.base)}\n\t\t\t\tonMouseEnter={pauseAutoSlide}\n\t\t\t\tonMouseLeave={resumeAutoSlide}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\"flex size-full overflow-x-scroll [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n\t\t\t\t\t\tclassNames?.scrollContainer\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</Element>\n\t\t</CarouselStoreContextProvider>\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\tdata-scope=\"carousel\"\n\t\t\tdata-part=\"button\"\n\t\t\tdata-slot=\"carousel-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\n\t\t\tdata-scope=\"carousel\"\n\t\t\tdata-part=\"controls\"\n\t\t\tdata-slot=\"carousel-controls\"\n\t\t\tclassName={cnMerge(\"absolute inset-0 flex justify-between\", classNames?.base)}\n\t\t>\n\t\t\t<Show.Root when={icon?.iconType}>\n\t\t\t\t<Show.Content>\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: cnMerge(\n\t\t\t\t\t\t\t\ticon?.iconType === \"nextIcon\" && \"rotate-180\",\n\t\t\t\t\t\t\t\tclassNames?.iconContainer\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}}\n\t\t\t\t\t\ticon={icon?.icon}\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: cnMerge(\n\t\t\t\t\t\t\t\ticon?.iconType === \"prevIcon\" && \"rotate-180\",\n\t\t\t\t\t\t\t\tclassNames?.iconContainer\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}}\n\t\t\t\t\t\ticon={icon?.icon}\n\t\t\t\t\t/>\n\t\t\t\t</Show.Content>\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 } = props;\n\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-scope=\"carousel\"\n\t\t\tdata-part=\"item-group\"\n\t\t\tdata-slot=\"carousel-item-group\"\n\t\t\tclassName={cnMerge(\n\t\t\t\t`duration-800 transform-[translate3d(var(--translate-distance),0,0)] flex w-full shrink-0\n\t\t\t\tsnap-center transition-transform`,\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{isFunction(children) ?\n\t\t\t\t<For each={images} renderItem={(image, index, array) => children({ array, image, index })} />\n\t\t\t:\tchildren}\n\t\t</ul>\n\t);\n}\n\nexport function CarouselItem(props: OtherCarouselProps) {\n\tconst { children, className, ...restOfProps } = props;\n\n\treturn (\n\t\t<li\n\t\t\tdata-scope=\"carousel\"\n\t\t\tdata-part=\"item\"\n\t\t\tdata-slot=\"carousel-item\"\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\n\t\t\tdata-scope=\"carousel\"\n\t\t\tdata-part=\"caption\"\n\t\t\tdata-slot=\"carousel-caption\"\n\t\t\tclassName={cnMerge(\"absolute z-10\", className)}\n\t\t>\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 } = props;\n\n\tconst images = useCarouselStoreContext((state) => each ?? (state.images as TArrayItem[]));\n\n\treturn (\n\t\t<ul\n\t\t\tdata-scope=\"carousel\"\n\t\t\tdata-part=\"indicator-group\"\n\t\t\tdata-slot=\"carousel-indicator-group\"\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{isFunction(children) ?\n\t\t\t\t<For each={images} renderItem={(image, index, array) => children({ array, image, index })} />\n\t\t\t:\tchildren}\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\n\t\t\tdata-scope=\"carousel\"\n\t\t\tdata-part=\"indicator\"\n\t\t\tdata-slot=\"carousel-indicator\"\n\t\t\tclassName={cnMerge(\"inline-flex\", classNames?.base)}\n\t\t>\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 {\n\tCarouselButton as Button,\n\tCarouselCaption as Caption,\n\tCarouselControls as Controls,\n\tCarouselIndicator as Indicator,\n\tCarouselIndic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a,GAAG;AAEhD,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,mDAAmD;EACtE,GAAI;EAEH;;AAGH;AAED,SAAgB,gBACf,OACC;CACD,MAAM,EAAE,IAAI,cAAc,OAAO,UAAU,WAAW,GAAG;AAEzD,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,iBAAiB;EAEnC;;AAGH;AAED,SAAgB,uBAAmC,OAAyC;CAC3F,MAAM,EAAE,UAAU,WAAW,MAAM,GAAG;CAEtC,MAAM,SAAS,yBAAyB,UAAU,QAAS,MAAM;AAEjE,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QACV,mFACA;YAGA,WAAW,YACX,oBAAC;GAAI,MAAM;GAAQ,aAAa,OAAO,OAAO,UAAU,SAAS;IAAE;IAAO;IAAO;IAAO;OACvF;;AAGJ;AAED,SAAgB,kBAAkB,OAA+B;CAChE,MAAM,EAAE,YAAY,cAAc,GAAG;CAErC,MAAM,EACL,SAAS,EAAE,WAAW,EACtB,cACA,GAAG,yBAAyB,UAAU;AAEvC,QACC,oBAAC;EACA,cAAW;EACX,aAAU;EACV,aAAU;EACV,WAAW,QAAQ,eAAe,YAAY;YAE9C,oBAAC;GACA,MAAK;GACL,eAAe,UAAU;GACzB,WAAW,QACV,4BACA,YAAY,MACZ,iBAAiB,gBAAgB,CAAC,0BAA0B,YAAY,SAAS;;;AAKrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn-_FbtIrlZ.js","names":[],"sources":["../../src/lib/utils/cn.ts"],"sourcesContent":["import { type ClassNameValue, twMerge } from \"tailwind-merge\";\n\nexport const cnMerge = (...classNames: ClassNameValue[]) => twMerge(classNames);\n"],"mappings":";;;AAEA,MAAa,
|
|
1
|
+
{"version":3,"file":"cn-_FbtIrlZ.js","names":[],"sources":["../../src/lib/utils/cn.ts"],"sourcesContent":["import { type ClassNameValue, twMerge } from \"tailwind-merge\";\n\nexport const cnMerge = (...classNames: ClassNameValue[]) => twMerge(classNames);\n"],"mappings":";;;AAEA,MAAa,WAAW,GAAG,eAAiC,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import "../../../
|
|
2
|
-
import "../../../index-
|
|
3
|
-
import "../../../index-
|
|
4
|
-
import "../../../index-
|
|
5
|
-
import { AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, await_parts_d_exports, useAwaitContext } from "../../../index-YFi-sIuR.js";
|
|
1
|
+
import "../../../index-BNrCAe9Y.js";
|
|
2
|
+
import "../../../index-lKxE9WPi.js";
|
|
3
|
+
import "../../../index-eCX5RJ41.js";
|
|
4
|
+
import { AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, await_parts_d_exports, useAwaitContext } from "../../../index-BaONHZq0.js";
|
|
6
5
|
export { await_parts_d_exports as Await, AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, useAwaitContext };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
import "../../../utils-
|
|
5
|
-
import "../../../getSlot-
|
|
6
|
-
import "../../../error-boundary-
|
|
7
|
-
import "../../../slot-
|
|
8
|
-
import { AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, await_parts_exports, useAwaitContext } from "../../../await-
|
|
4
|
+
import "../../../utils-ChjmDoRe.js";
|
|
5
|
+
import "../../../getSlot-Cf5ON6lE.js";
|
|
6
|
+
import "../../../error-boundary-xM9An3gz.js";
|
|
7
|
+
import "../../../slot-D1062oA5.js";
|
|
8
|
+
import { AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, await_parts_exports, useAwaitContext } from "../../../await-fjas2Q-C.js";
|
|
9
9
|
|
|
10
10
|
export { await_parts_exports as Await, AwaitError, AwaitPending, AwaitRoot, AwaitSuccess, useAwaitContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ErrorBoundary, ErrorBoundaryContextType, ErrorBoundaryProps, FallbackProps, useErrorBoundary, useErrorBoundaryContext } from "../../../index-
|
|
1
|
+
import { ErrorBoundary, ErrorBoundaryContextType, ErrorBoundaryProps, FallbackProps, useErrorBoundary, useErrorBoundaryContext } from "../../../index-lKxE9WPi.js";
|
|
2
2
|
export { ErrorBoundary, ErrorBoundaryContextType, ErrorBoundaryProps, FallbackProps, useErrorBoundary, useErrorBoundaryContext };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
import { ErrorBoundary, useErrorBoundary, useErrorBoundaryContext } from "../../../error-boundary-
|
|
4
|
+
import { ErrorBoundary, useErrorBoundary, useErrorBoundaryContext } from "../../../error-boundary-xM9An3gz.js";
|
|
5
5
|
|
|
6
6
|
export { ErrorBoundary, useErrorBoundary, useErrorBoundaryContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { For, ForRenderProps, ForWithWrapper, getElementList } from "../../../index-
|
|
1
|
+
import { For, ForRenderProps, ForWithWrapper, getElementList } from "../../../index-CnvH74ea.js";
|
|
2
2
|
export { For, ForRenderProps, ForWithWrapper, getElementList };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../index-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Teleport } from "../../index-B3N6YbN8.js";
|
|
1
|
+
import "../../index-BNrCAe9Y.js";
|
|
2
|
+
import { ErrorBoundary } from "../../index-lKxE9WPi.js";
|
|
3
|
+
import { SuspenseWithBoundary } from "../../index-eCX5RJ41.js";
|
|
4
|
+
import { await_parts_d_exports } from "../../index-BaONHZq0.js";
|
|
5
|
+
import { For, ForWithWrapper } from "../../index-CnvH74ea.js";
|
|
6
|
+
import { show_parts_d_exports } from "../../index-DVr1tbxh.js";
|
|
7
|
+
import { slot_parts_d_exports } from "../../index-BBJzo-WC.js";
|
|
8
|
+
import { switch_parts_d_exports } from "../../index-DJjxpXUk.js";
|
|
9
|
+
import { Teleport } from "../../index-CWKQ5V4B.js";
|
|
11
10
|
export { await_parts_d_exports as Await, ErrorBoundary, For, ForWithWrapper, show_parts_d_exports as Show, slot_parts_d_exports as Slot, SuspenseWithBoundary, switch_parts_d_exports as Switch, Teleport };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "../../utils-
|
|
2
|
-
import "../../getSlot-
|
|
3
|
-
import { ErrorBoundary } from "../../error-boundary-
|
|
4
|
-
import { slot_parts_exports } from "../../slot-
|
|
5
|
-
import { await_parts_exports } from "../../await-
|
|
6
|
-
import { For, ForWithWrapper } from "../../for-
|
|
7
|
-
import { show_parts_exports } from "../../show-
|
|
8
|
-
import { SuspenseWithBoundary } from "../../suspense-with-boundary-
|
|
9
|
-
import { switch_parts_exports } from "../../switch-
|
|
10
|
-
import { Teleport } from "../../teleport-
|
|
1
|
+
import "../../utils-ChjmDoRe.js";
|
|
2
|
+
import "../../getSlot-Cf5ON6lE.js";
|
|
3
|
+
import { ErrorBoundary } from "../../error-boundary-xM9An3gz.js";
|
|
4
|
+
import { slot_parts_exports } from "../../slot-D1062oA5.js";
|
|
5
|
+
import { await_parts_exports } from "../../await-fjas2Q-C.js";
|
|
6
|
+
import { For, ForWithWrapper } from "../../for-DGs2XZ21.js";
|
|
7
|
+
import { show_parts_exports } from "../../show-BabiXbf7.js";
|
|
8
|
+
import { SuspenseWithBoundary } from "../../suspense-with-boundary-CEVORL8K.js";
|
|
9
|
+
import { switch_parts_exports } from "../../switch-CCMD01Rs.js";
|
|
10
|
+
import { Teleport } from "../../teleport-DfuYOzsj.js";
|
|
11
11
|
import "../../common-BYWy8Q78.js";
|
|
12
12
|
|
|
13
13
|
export { await_parts_exports as Await, ErrorBoundary, For, ForWithWrapper, show_parts_exports as Show, slot_parts_exports as Slot, SuspenseWithBoundary, switch_parts_exports as Switch, Teleport };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ShowContent, ShowFallback, ShowRoot, show_parts_d_exports } from "../../../index-
|
|
1
|
+
import { ShowContent, ShowFallback, ShowRoot, show_parts_d_exports } from "../../../index-DVr1tbxh.js";
|
|
2
2
|
export { show_parts_d_exports as Show, ShowContent, ShowFallback, ShowRoot };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
import "../../../getSlot-
|
|
5
|
-
import { ShowContent, ShowFallback, ShowRoot, show_parts_exports } from "../../../show-
|
|
4
|
+
import "../../../getSlot-Cf5ON6lE.js";
|
|
5
|
+
import { ShowContent, ShowFallback, ShowRoot, show_parts_exports } from "../../../show-BabiXbf7.js";
|
|
6
6
|
|
|
7
7
|
export { show_parts_exports as Show, ShowContent, ShowFallback, ShowRoot };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SlotRoot, SlotSlottable, slot_parts_d_exports } from "../../../index-
|
|
1
|
+
import { SlotRoot, SlotSlottable, slot_parts_d_exports } from "../../../index-BBJzo-WC.js";
|
|
2
2
|
export { slot_parts_d_exports as Slot, SlotRoot, SlotSlottable };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../../index-
|
|
2
|
-
import { SuspenseWithBoundary, SuspenseWithBoundaryProps } from "../../../index-
|
|
1
|
+
import "../../../index-lKxE9WPi.js";
|
|
2
|
+
import { SuspenseWithBoundary, SuspenseWithBoundaryProps } from "../../../index-eCX5RJ41.js";
|
|
3
3
|
export { SuspenseWithBoundary, SuspenseWithBoundaryProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../../error-boundary-
|
|
2
|
-
import { SuspenseWithBoundary } from "../../../suspense-with-boundary-
|
|
1
|
+
import "../../../error-boundary-xM9An3gz.js";
|
|
2
|
+
import { SuspenseWithBoundary } from "../../../suspense-with-boundary-CEVORL8K.js";
|
|
3
3
|
|
|
4
4
|
export { SuspenseWithBoundary };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SwitchDefault, SwitchMatch, SwitchRoot, switch_parts_d_exports } from "../../../index-
|
|
1
|
+
import { SwitchDefault, SwitchMatch, SwitchRoot, switch_parts_d_exports } from "../../../index-DJjxpXUk.js";
|
|
2
2
|
export { switch_parts_d_exports as Switch, SwitchDefault, SwitchMatch, SwitchRoot };
|