@zayne-labs/ui-react 0.8.10 → 0.8.12
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/css/preset.css +1 -0
- package/css/style.css +2 -0
- package/css/theme.css +0 -14
- package/css/utilities.css +7 -0
- package/dist/esm/{chunk-L2SROZYQ.js → chunk-2P3P5AXH.js} +5 -4
- package/dist/esm/chunk-2P3P5AXH.js.map +1 -0
- package/dist/esm/common/await/index.d.ts +5 -5
- package/dist/esm/common/await/index.js +4 -6
- package/dist/esm/common/await/index.js.map +1 -1
- package/dist/esm/common/error-boundary/index.d.ts +3 -3
- package/dist/esm/common/for/index.d.ts +6 -6
- package/dist/esm/common/show/index.d.ts +8 -8
- package/dist/esm/common/slot/index.d.ts +3 -3
- package/dist/esm/common/slot/index.js +1 -1
- package/dist/esm/common/suspense-with-boundary/index.d.ts +2 -2
- package/dist/esm/common/switch/index.d.ts +7 -7
- package/dist/esm/common/teleport/index.d.ts +4 -4
- package/dist/esm/common/teleport/index.js +11 -10
- package/dist/esm/common/teleport/index.js.map +1 -1
- package/dist/esm/ui/card/index.d.ts +8 -8
- package/dist/esm/ui/card/index.js +2 -2
- package/dist/esm/ui/card/index.js.map +1 -1
- package/dist/esm/ui/carousel/index.d.ts +11 -11
- package/dist/esm/ui/drag-scroll/index.d.ts +9 -298
- package/dist/esm/ui/drag-scroll/index.js +9 -7
- package/dist/esm/ui/drag-scroll/index.js.map +1 -1
- package/dist/esm/ui/drop-zone/index.d.ts +3 -3
- package/dist/esm/ui/drop-zone/index.js +7 -11
- package/dist/esm/ui/drop-zone/index.js.map +1 -1
- package/dist/esm/ui/form/index.d.ts +35 -35
- package/dist/esm/ui/form/index.js +6 -6
- package/dist/esm/ui/form/index.js.map +1 -1
- package/dist/style.css +467 -0
- package/package.json +12 -14
- package/dist/esm/chunk-L2SROZYQ.js.map +0 -1
package/css/preset.css
CHANGED
package/css/style.css
ADDED
package/css/theme.css
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
1
|
@theme {
|
|
2
|
-
--color-shadcn-accent: hsl(210, 40%, 96.1%);
|
|
3
|
-
--color-shadcn-accent-foreground: hsl(222.2, 47.4%, 11.2%);
|
|
4
|
-
--color-shadcn-background: hsl(0, 0%, 100%);
|
|
5
|
-
--color-shadcn-border: hsl(214.3, 31.8%, 91.4%);
|
|
6
|
-
--color-shadcn-foreground: hsl(222.2, 47.4%, 11.2%);
|
|
7
|
-
--color-shadcn-input: hsl(214.3, 31.8%, 91.4%);
|
|
8
|
-
--color-shadcn-muted: hsl(210, 40%, 96.1%);
|
|
9
2
|
--color-shadcn-muted-foreground: hsl(215.4, 16.3%, 46.9%);
|
|
10
|
-
--color-shadcn-popover: hsl(0, 0%, 100%);
|
|
11
|
-
--color-shadcn-popover-foreground: hsl(222.2, 47.4%, 11.2%);
|
|
12
|
-
--color-shadcn-primary: hsl(222.2, 47.4%, 11.2%);
|
|
13
|
-
--color-shadcn-primary-foreground: hsl(210, 40%, 98%);
|
|
14
|
-
--color-shadcn-ring: hsl(215, 20.2%, 65.1%);
|
|
15
|
-
--color-shadcn-secondary: hsl(210, 40%, 96.1%);
|
|
16
|
-
--color-shadcn-secondary-foreground: hsl(222.2, 47.4%, 11.2%);
|
|
17
3
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Children, isValidElement, cloneElement } from 'react';
|
|
2
|
+
import { Children, isValidElement, cloneElement, Fragment } from 'react';
|
|
3
3
|
import { composeRefs, mergeProps } from '@zayne-labs/toolkit-react/utils';
|
|
4
4
|
import { isArray } from '@zayne-labs/toolkit-type-helpers';
|
|
5
5
|
|
|
@@ -35,13 +35,14 @@ function SlotClone(props) {
|
|
|
35
35
|
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
36
36
|
}
|
|
37
37
|
const childRef = children.props.ref ?? children.ref;
|
|
38
|
+
const mergedRef = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;
|
|
38
39
|
const clonedProps = {
|
|
39
40
|
...mergeProps(restOfSlotProps, children.props),
|
|
40
|
-
|
|
41
|
+
...children.type !== Fragment && { ref: mergedRef }
|
|
41
42
|
};
|
|
42
43
|
return cloneElement(children, clonedProps);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export { Slot, Slottable };
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-2P3P5AXH.js.map
|
|
48
|
+
//# sourceMappingURL=chunk-2P3P5AXH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/common/slot/slot.tsx"],"names":["ReactFragment"],"mappings":";;;;;;AAYO,SAAS,SAAA,CAAU,EAAE,QAAA,EAAyC,EAAA;AACpE,EAAO,OAAA,QAAA;AACR;AAEA,IAAM,WAAA,GAAc,CAAC,KAAwD,KAAA;AAC5E,EAAA,OAAO,cAAe,CAAA,KAAK,CAAK,IAAA,KAAA,CAAM,IAAS,KAAA,SAAA;AAChD,CAAA;AAMO,SAAS,KAAK,KAAkB,EAAA;AACtC,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,eAAA,EAAoB,GAAA,KAAA;AAEzC,EAAA,MAAM,gBAAgB,OAAyB,CAAA,QAAQ,CAAI,GAAA,QAAA,GAAW,CAAC,QAAQ,CAAA;AAC/E,EAAA,MAAM,YAAY,aAAc,CAAA,IAAA,CAAK,CAAC,OAAY,KAAA,WAAA,CAAY,OAAO,CAAC,CAAA;AAEtE,EAAA,IAAI,SAAW,EAAA;AAEd,IAAM,MAAA,UAAA,GAAc,UAAU,KAAoB,CAAA,QAAA;AAElD,IAAA,IAAI,QAAS,CAAA,KAAA,CAAM,UAAU,CAAA,GAAI,CAAG,EAAA;AACnC,MAAO,OAAA,QAAA,CAAS,KAAK,IAAI,CAAA;AAAA;AAG1B,IAAA,MAAM,kBAAqB,GAAA,aAAA,CAAc,GAAI,CA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ferProps, composeRefs, mergeProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { isArray } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Children, Fragment as ReactFragment, cloneElement, isValidElement } from \"react\";\n\ntype SlotProps = InferProps<HTMLElement>;\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * ----------------------------------------------------------------------------------------------- */\n\nexport function Slottable({ children }: Pick<SlotProps, \"children\">) {\n\treturn children;\n}\n\nconst isSlottable = (child: React.ReactNode): child is React.ReactElement => {\n\treturn isValidElement(child) && child.type === Slottable;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * ----------------------------------------------------------------------------------------------- */\n\nexport function Slot(props: SlotProps) {\n\tconst { children, ...restOfSlotProps } = props;\n\n\tconst childrenArray = isArray<React.ReactNode>(children) ? children : [children];\n\tconst slottable = childrenArray.find((element) => isSlottable(element));\n\n\tif (slottable) {\n\t\t// == The new element to render is the one passed as a child of `Slottable`\n\t\tconst newElement = (slottable.props as SlotProps).children;\n\n\t\tif (Children.count(newElement) > 1) {\n\t\t\treturn Children.only(null);\n\t\t}\n\n\t\tconst newElementChildren = childrenArray.map((child) => {\n\t\t\tif (child === slottable) {\n\t\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\t\treturn isValidElement<SlotProps>(newElement) && newElement.props.children;\n\t\t\t}\n\n\t\t\treturn child;\n\t\t});\n\n\t\treturn (\n\t\t\t<SlotClone {...restOfSlotProps}>\n\t\t\t\t{isValidElement(newElement) && cloneElement(newElement, undefined, newElementChildren)}\n\t\t\t</SlotClone>\n\t\t);\n\t}\n\n\treturn <SlotClone {...restOfSlotProps}>{children}</SlotClone>;\n}\n\ntype SlotCloneProps = {\n\tchildren: React.ReactNode;\n\tref?: React.RefObject<HTMLElement>;\n};\n\ntype UnknownProps = Record<string, unknown>;\n\nfunction SlotClone(props: SlotCloneProps) {\n\tconst { children, ref: forwardedRef, ...restOfSlotProps } = props;\n\n\tif (!isValidElement<UnknownProps>(children)) {\n\t\treturn Children.count(children) > 1 ? Children.only(null) : null;\n\t}\n\n\tconst childRef = (children.props.ref\n\t\t?? (children as unknown as UnknownProps).ref) as React.Ref<HTMLElement>;\n\n\tconst mergedRef = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;\n\n\tconst clonedProps = {\n\t\t...mergeProps(restOfSlotProps, children.props),\n\t\t...(children.type !== ReactFragment && { ref: mergedRef }),\n\t};\n\n\treturn cloneElement(children, clonedProps);\n}\n"]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { DiscriminatedRenderProps } from '@zayne-labs/toolkit-react/utils';
|
|
3
3
|
import { SuspenseWithBoundaryProps } from '../suspense-with-boundary/index.js';
|
|
4
4
|
import '../../types-CeWumkhm.js';
|
|
5
5
|
|
|
6
|
-
type RenderPropFn<TValue> = (result: TValue) =>
|
|
6
|
+
type RenderPropFn<TValue> = (result: TValue) => React.ReactNode;
|
|
7
7
|
type AwaitProps<TValue> = AwaitInnerProps<TValue> & Pick<SuspenseWithBoundaryProps, "errorFallback" | "fallback"> & {
|
|
8
|
-
|
|
8
|
+
withErrorBoundary?: boolean;
|
|
9
9
|
};
|
|
10
|
-
declare function Await<TValue>(props: AwaitProps<TValue>):
|
|
11
|
-
type AwaitInnerProps<TValue> = DiscriminatedRenderProps<
|
|
10
|
+
declare function Await<TValue>(props: AwaitProps<TValue>): React.JSX.Element;
|
|
11
|
+
type AwaitInnerProps<TValue> = DiscriminatedRenderProps<React.ReactNode | RenderPropFn<TValue>> & {
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
promise: Promise<TValue>;
|
|
14
14
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Slot } from '../../chunk-
|
|
1
|
+
import { Slot } from '../../chunk-2P3P5AXH.js';
|
|
2
2
|
import { ErrorBoundary } from '../../chunk-7LEVEBD2.js';
|
|
3
3
|
import '../../chunk-PZ5AY32C.js';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -6,12 +6,10 @@ import { Fragment, Suspense, use } from 'react';
|
|
|
6
6
|
import { isFunction } from '@zayne-labs/toolkit-type-helpers';
|
|
7
7
|
|
|
8
8
|
function Await(props) {
|
|
9
|
-
const { errorFallback, fallback,
|
|
10
|
-
const WithErrorBoundary =
|
|
11
|
-
const WithSuspense = wrapperVariant === "only-suspense" || wrapperVariant === "suspense-and-boundary" ? Suspense : Fragment;
|
|
9
|
+
const { errorFallback, fallback, withErrorBoundary = true, ...restOfProps } = props;
|
|
10
|
+
const WithErrorBoundary = withErrorBoundary ? ErrorBoundary : Fragment;
|
|
12
11
|
const errorBoundaryProps = Boolean(errorFallback) && { fallback: errorFallback };
|
|
13
|
-
|
|
14
|
-
return /* @__PURE__ */ React.createElement(WithErrorBoundary, { ...errorBoundaryProps }, /* @__PURE__ */ React.createElement(WithSuspense, { ...suspenseProps }, /* @__PURE__ */ React.createElement(AwaitInner, { ...restOfProps })));
|
|
12
|
+
return /* @__PURE__ */ React.createElement(WithErrorBoundary, { ...errorBoundaryProps }, /* @__PURE__ */ React.createElement(Suspense, { fallback }, /* @__PURE__ */ React.createElement(AwaitInner, { ...restOfProps })));
|
|
15
13
|
}
|
|
16
14
|
function AwaitInner(props) {
|
|
17
15
|
const { asChild, children, promise, render } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/common/await/await.tsx"],"names":["ReactFragment"],"mappings":";;;;;;;AAmBO,SAAS,MAAc,KAA2B,EAAA;AACxD,EAAA,MAAM,EAAE,aAAe,EAAA,QAAA,EAAU,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/common/await/await.tsx"],"names":["ReactFragment"],"mappings":";;;;;;;AAmBO,SAAS,MAAc,KAA2B,EAAA;AACxD,EAAA,MAAM,EAAE,aAAe,EAAA,QAAA,EAAU,oBAAoB,IAAM,EAAA,GAAG,aAAgB,GAAA,KAAA;AAE9E,EAAM,MAAA,iBAAA,GAAoB,oBAAoB,aAAgB,GAAAA,QAAA;AAE9D,EAAA,MAAM,qBAAqB,OAAQ,CAAA,aAAa,CAAK,IAAA,EAAE,UAAU,aAAc,EAAA;AAE/E,EAAA,uBACE,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAmB,GAAG,kBAAA,EAAA,kBACrB,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,QACT,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAY,EAAA,EAAA,GAAG,WAAa,EAAA,CAC9B,CACD,CAAA;AAEF;AAOA,SAAS,WAAmB,KAAgC,EAAA;AAC3D,EAAA,MAAM,EAAE,OAAA,EAAS,QAAU,EAAA,OAAA,EAAS,QAAW,GAAA,KAAA;AAE/C,EAAM,MAAA,MAAA,GAAS,IAAI,OAAO,CAAA;AAE1B,EAAM,MAAA,SAAA,GAAY,UAAU,IAAO,GAAAA,QAAA;AAEnC,EAAA,MAAM,SAAY,GAAA,OAAA,IAAW,EAAE,OAAA,EAAS,MAAO,EAAA;AAE/C,EAAA,MAAM,mBAAmB,QAAY,IAAA,MAAA;AAErC,EAAA,MAAM,mBAAmB,UAAW,CAAA,gBAAgB,CAAI,GAAA,gBAAA,CAAiB,MAAM,CAAI,GAAA,gBAAA;AAEnF,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAW,GAAG,SAAA,EAAA,EAAY,gBAAiB,CAAA;AACpD","file":"index.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport type { DiscriminatedRenderProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { isFunction } from \"@zayne-labs/toolkit-type-helpers\";\nimport { Fragment as ReactFragment, Suspense, use } from \"react\";\nimport { ErrorBoundary } from \"../error-boundary\";\nimport { Slot } from \"../slot\";\nimport type { SuspenseWithBoundaryProps } from \"../suspense-with-boundary\";\n\ntype RenderPropFn<TValue> = (result: TValue) => React.ReactNode;\n\ntype AwaitProps<TValue> = AwaitInnerProps<TValue>\n\t& Pick<SuspenseWithBoundaryProps, \"errorFallback\" | \"fallback\"> & {\n\t\twithErrorBoundary?: boolean;\n\t};\n\n// TODO - Add Support for Slot components\nexport function Await<TValue>(props: AwaitProps<TValue>) {\n\tconst { errorFallback, fallback, withErrorBoundary = true, ...restOfProps } = props;\n\n\tconst WithErrorBoundary = withErrorBoundary ? ErrorBoundary : ReactFragment;\n\n\tconst errorBoundaryProps = Boolean(errorFallback) && { fallback: errorFallback };\n\n\treturn (\n\t\t<WithErrorBoundary {...errorBoundaryProps}>\n\t\t\t<Suspense fallback={fallback}>\n\t\t\t\t<AwaitInner {...restOfProps} />\n\t\t\t</Suspense>\n\t\t</WithErrorBoundary>\n\t);\n}\n\nexport type AwaitInnerProps<TValue> = DiscriminatedRenderProps<React.ReactNode | RenderPropFn<TValue>> & {\n\tasChild?: boolean;\n\tpromise: Promise<TValue>;\n};\n\nfunction AwaitInner<TValue>(props: AwaitInnerProps<TValue>) {\n\tconst { asChild, children, promise, render } = props;\n\n\tconst result = use(promise);\n\n\tconst Component = asChild ? Slot : ReactFragment;\n\n\tconst slotProps = asChild && { promise, result };\n\n\tconst selectedChildren = children ?? render;\n\n\tconst resolvedChildren = isFunction(selectedChildren) ? selectedChildren(result) : selectedChildren;\n\n\treturn <Component {...slotProps}>{resolvedChildren}</Component>;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as ErrorBoundaryProps } from '../../types-CeWumkhm.js';
|
|
2
2
|
export { F as FallbackProps } from '../../types-CeWumkhm.js';
|
|
3
|
-
import * as
|
|
3
|
+
import * as React from 'react';
|
|
4
4
|
import { Component } from 'react';
|
|
5
5
|
|
|
6
6
|
type ErrorBoundaryContextType = {
|
|
@@ -33,9 +33,9 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
|
|
|
33
33
|
error: Error;
|
|
34
34
|
hasError: boolean;
|
|
35
35
|
};
|
|
36
|
-
componentDidCatch(error: Error, info:
|
|
36
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
37
37
|
componentDidUpdate(prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState): void;
|
|
38
|
-
render():
|
|
38
|
+
render(): React.JSX.Element;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export { ErrorBoundary, type ErrorBoundaryContextType, ErrorBoundaryProps, useErrorBoundary, useErrorBoundaryContext };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { DiscriminatedRenderProps, PolymorphicProps } from '@zayne-labs/toolkit-react/utils';
|
|
3
3
|
import { Prettify } from '@zayne-labs/toolkit-type-helpers';
|
|
4
4
|
|
|
5
|
-
type RenderPropFn<TArrayItem> = (item: TArrayItem, index: number, array: TArrayItem[]) =>
|
|
5
|
+
type RenderPropFn<TArrayItem> = (item: TArrayItem, index: number, array: TArrayItem[]) => React.ReactNode;
|
|
6
6
|
type ForRenderProps<TArrayItem> = DiscriminatedRenderProps<RenderPropFn<TArrayItem>>;
|
|
7
7
|
type ForProps<TArrayItem> = Prettify<{
|
|
8
8
|
each: TArrayItem[];
|
|
9
|
-
fallback?:
|
|
9
|
+
fallback?: React.ReactNode;
|
|
10
10
|
} & ForRenderProps<TArrayItem>>;
|
|
11
11
|
type ForPropsWithNumber<TNumber> = Prettify<{
|
|
12
12
|
each: TNumber;
|
|
13
|
-
fallback?:
|
|
13
|
+
fallback?: React.ReactNode;
|
|
14
14
|
} & ForRenderProps<TNumber>>;
|
|
15
|
-
declare function ForBase<TArrayItem>(props: ForProps<TArrayItem> | ForPropsWithNumber<TArrayItem>):
|
|
15
|
+
declare function ForBase<TArrayItem>(props: ForProps<TArrayItem> | ForPropsWithNumber<TArrayItem>): React.ReactNode;
|
|
16
16
|
type ForListProps<TArrayItem> = {
|
|
17
17
|
className?: string;
|
|
18
18
|
} & (ForProps<TArrayItem> | ForPropsWithNumber<TArrayItem>);
|
|
19
|
-
declare function ForList<TArrayItem, TElement extends
|
|
19
|
+
declare function ForList<TArrayItem, TElement extends React.ElementType = "ul">(props: PolymorphicProps<TElement, ForListProps<TArrayItem>>): React.JSX.Element;
|
|
20
20
|
|
|
21
21
|
type GetElementListResult<TVariant extends "base" | "withWrapper"> = TVariant extends "base" ? [typeof ForBase] : [typeof ForList];
|
|
22
22
|
declare const getElementList: <TVariant extends "base" | "withWrapper" = "withWrapper">(variant?: TVariant) => GetElementListResult<TVariant>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
type ShowProps<TWhen> = {
|
|
4
|
-
children:
|
|
5
|
-
fallback?:
|
|
4
|
+
children: React.ReactNode | ((value: TWhen) => React.ReactNode);
|
|
5
|
+
fallback?: React.ReactNode;
|
|
6
6
|
when: false | TWhen | null | undefined;
|
|
7
7
|
};
|
|
8
|
-
declare function ShowRoot<TWhen>(props: ShowProps<TWhen>):
|
|
8
|
+
declare function ShowRoot<TWhen>(props: ShowProps<TWhen>): React.ReactNode;
|
|
9
9
|
declare function ShowContent({ children }: {
|
|
10
|
-
children:
|
|
11
|
-
}):
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}): React.ReactNode;
|
|
12
12
|
declare namespace ShowContent {
|
|
13
13
|
var slotSymbol: symbol;
|
|
14
14
|
}
|
|
15
15
|
declare function ShowFallback({ children }: {
|
|
16
|
-
children:
|
|
17
|
-
}):
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}): React.ReactNode;
|
|
18
18
|
declare namespace ShowFallback {
|
|
19
19
|
var slotSymbol: symbol;
|
|
20
20
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { InferProps } from '@zayne-labs/toolkit-react/utils';
|
|
3
3
|
|
|
4
4
|
type SlotProps = InferProps<HTMLElement>;
|
|
5
|
-
declare function Slottable({ children }: Pick<SlotProps, "children">):
|
|
6
|
-
declare function Slot(props: SlotProps):
|
|
5
|
+
declare function Slottable({ children }: Pick<SlotProps, "children">): React.ReactNode;
|
|
6
|
+
declare function Slot(props: SlotProps): React.JSX.Element | null;
|
|
7
7
|
|
|
8
8
|
export { Slot, Slottable };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
2
|
import { E as ErrorBoundaryProps } from '../../types-CeWumkhm.js';
|
|
3
3
|
|
|
4
4
|
type SuspenseWithBoundaryProps = {
|
|
@@ -6,6 +6,6 @@ type SuspenseWithBoundaryProps = {
|
|
|
6
6
|
errorFallback?: ErrorBoundaryProps["fallback"];
|
|
7
7
|
fallback?: React.ReactNode;
|
|
8
8
|
};
|
|
9
|
-
declare function SuspenseWithBoundary(props: SuspenseWithBoundaryProps):
|
|
9
|
+
declare function SuspenseWithBoundary(props: SuspenseWithBoundaryProps): React$1.JSX.Element;
|
|
10
10
|
|
|
11
11
|
export { SuspenseWithBoundary, type SuspenseWithBoundaryProps };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
type ValidSwitchComponentType =
|
|
3
|
+
type ValidSwitchComponentType = React.ReactElement<SwitchMatchProps>;
|
|
4
4
|
type SwitchProps<TCondition> = {
|
|
5
5
|
children: ValidSwitchComponentType | ValidSwitchComponentType[];
|
|
6
6
|
condition?: TCondition;
|
|
7
7
|
};
|
|
8
8
|
type SwitchMatchProps<TWhen = unknown> = {
|
|
9
|
-
children:
|
|
9
|
+
children: React.ReactNode | ((value: TWhen) => React.ReactNode);
|
|
10
10
|
when: false | TWhen | null | undefined;
|
|
11
11
|
};
|
|
12
|
-
declare function SwitchRoot<TCondition = true>(props: SwitchProps<TCondition>):
|
|
13
|
-
declare function SwitchMatch<TWhen>(props: SwitchMatchProps<TWhen>):
|
|
12
|
+
declare function SwitchRoot<TCondition = true>(props: SwitchProps<TCondition>): React.ReactNode;
|
|
13
|
+
declare function SwitchMatch<TWhen>(props: SwitchMatchProps<TWhen>): React.ReactNode;
|
|
14
14
|
declare function SwitchDefault({ children }: {
|
|
15
|
-
children:
|
|
16
|
-
}):
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}): React.ReactNode;
|
|
17
17
|
declare namespace SwitchDefault {
|
|
18
18
|
var slotSymbol: symbol;
|
|
19
19
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { AnyString } from '@zayne-labs/toolkit-type-helpers';
|
|
3
3
|
|
|
4
4
|
type ValidHtmlTags = keyof HTMLElementTagNameMap;
|
|
5
5
|
type PortalProps = {
|
|
6
|
-
children:
|
|
6
|
+
children: React.ReactNode;
|
|
7
7
|
insertPosition?: InsertPosition;
|
|
8
|
-
to
|
|
8
|
+
to: AnyString | HTMLElement | ValidHtmlTags | null;
|
|
9
9
|
};
|
|
10
|
-
declare function Teleport(props: PortalProps):
|
|
10
|
+
declare function Teleport(props: PortalProps): React.ReactPortal | null;
|
|
11
11
|
|
|
12
12
|
export { Teleport };
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import '../../chunk-PZ5AY32C.js';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { useEffectOnce, useMountEffect } from '@zayne-labs/toolkit-react';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
4
3
|
import { isString } from '@zayne-labs/toolkit-type-helpers';
|
|
5
4
|
import { createPortal } from 'react-dom';
|
|
6
5
|
|
|
7
6
|
function Teleport(props) {
|
|
8
7
|
const { children, insertPosition, to } = props;
|
|
9
8
|
const [reactPortal, setReactPortal] = useState(null);
|
|
10
|
-
|
|
11
|
-
if (!to
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!to) return;
|
|
11
|
+
if (insertPosition) return;
|
|
12
|
+
const destination = isString(to) ? document.querySelector(to) : to;
|
|
13
|
+
destination && setReactPortal(createPortal(children, destination));
|
|
14
|
+
}, [to, insertPosition]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!to) return;
|
|
17
|
+
if (!insertPosition) return;
|
|
12
18
|
const destination = isString(to) ? document.querySelector(to) : to;
|
|
13
19
|
const tempWrapper = document.createElement("div");
|
|
14
20
|
tempWrapper.style.display = "contents";
|
|
@@ -17,12 +23,7 @@ function Teleport(props) {
|
|
|
17
23
|
return () => {
|
|
18
24
|
tempWrapper.remove();
|
|
19
25
|
};
|
|
20
|
-
});
|
|
21
|
-
useMountEffect(() => {
|
|
22
|
-
if (!to || insertPosition) return;
|
|
23
|
-
const destination = isString(to) ? document.querySelector(to) : to;
|
|
24
|
-
destination && setReactPortal(createPortal(children, destination));
|
|
25
|
-
});
|
|
26
|
+
}, [to, insertPosition]);
|
|
26
27
|
return reactPortal;
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/common/teleport/teleport.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/common/teleport/teleport.tsx"],"names":[],"mappings":";;;;;AAgBA,SAAS,SAAS,KAAoB,EAAA;AACrC,EAAA,MAAM,EAAE,QAAA,EAAU,cAAgB,EAAA,EAAA,EAAO,GAAA,KAAA;AAEzC,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAmC,IAAI,CAAA;AAI7E,EAAA,SAAA,CAAU,MAAM;AACf,IAAA,IAAI,CAAC,EAAI,EAAA;AAET,IAAA,IAAI,cAAgB,EAAA;AAEpB,IAAA,MAAM,cAAc,QAAS,CAAA,EAAE,IAAI,QAAS,CAAA,aAAA,CAA2B,EAAE,CAAI,GAAA,EAAA;AAE7E,IAAA,WAAA,IAAe,cAAe,CAAA,YAAA,CAAa,QAAU,EAAA,WAAW,CAAC,CAAA;AAAA,GAE/D,EAAA,CAAC,EAAI,EAAA,cAAc,CAAC,CAAA;AAEvB,EAAA,SAAA,CAAU,MAAM;AACf,IAAA,IAAI,CAAC,EAAI,EAAA;AAET,IAAA,IAAI,CAAC,cAAgB,EAAA;AAErB,IAAA,MAAM,cAAc,QAAS,CAAA,EAAE,IAAI,QAAS,CAAA,aAAA,CAA2B,EAAE,CAAI,GAAA,EAAA;AAE7E,IAAM,MAAA,WAAA,GAAc,QAAS,CAAA,aAAA,CAAc,KAAK,CAAA;AAChD,IAAA,WAAA,CAAY,MAAM,OAAU,GAAA,UAAA;AAE5B,IAAa,WAAA,EAAA,qBAAA,CAAsB,gBAAgB,WAAW,CAAA;AAE9D,IAAe,cAAA,CAAA,YAAA,CAAa,QAAU,EAAA,WAAW,CAAC,CAAA;AAElD,IAAA,OAAO,MAAM;AACZ,MAAA,WAAA,CAAY,MAAO,EAAA;AAAA,KACpB;AAAA,GAEE,EAAA,CAAC,EAAI,EAAA,cAAc,CAAC,CAAA;AAIvB,EAAO,OAAA,WAAA;AACR","file":"index.js","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 [reactPortal, setReactPortal] = useState<React.ReactPortal | 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 && setReactPortal(createPortal(children, destination));\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps -- children should not be part of the dependency array\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\tsetReactPortal(createPortal(children, tempWrapper));\n\n\t\treturn () => {\n\t\t\ttempWrapper.remove();\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps -- children should not be part of the dependency array\n\t}, [to, insertPosition]);\n\n\t/* eslint-enable react-hooks-extra/no-direct-set-state-in-use-effect -- Allow */\n\n\treturn reactPortal;\n}\n\nexport { Teleport };\n"]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { PolymorphicProps } from '@zayne-labs/toolkit-react/utils';
|
|
3
3
|
|
|
4
|
-
declare function CardRoot<TElement extends
|
|
5
|
-
declare function CardHeader<TElement extends
|
|
6
|
-
declare function CardTitle<TElement extends
|
|
7
|
-
declare function CardDescription<TElement extends
|
|
8
|
-
declare function CardContent<TElement extends
|
|
9
|
-
declare function CardFooter<TElement extends
|
|
4
|
+
declare function CardRoot<TElement extends React.ElementType = "article">(props: PolymorphicProps<TElement>): React.JSX.Element;
|
|
5
|
+
declare function CardHeader<TElement extends React.ElementType = "header">(props: PolymorphicProps<TElement>): React.JSX.Element;
|
|
6
|
+
declare function CardTitle<TElement extends React.ElementType = "h3">(props: PolymorphicProps<TElement>): React.JSX.Element;
|
|
7
|
+
declare function CardDescription<TElement extends React.ElementType = "p">(props: PolymorphicProps<TElement>): React.JSX.Element;
|
|
8
|
+
declare function CardContent<TElement extends React.ElementType = "div">(props: PolymorphicProps<TElement>): React.JSX.Element;
|
|
9
|
+
declare function CardFooter<TElement extends React.ElementType = "footer">(props: PolymorphicProps<TElement, {
|
|
10
10
|
asChild?: boolean;
|
|
11
|
-
}>):
|
|
11
|
+
}>): React.JSX.Element;
|
|
12
12
|
|
|
13
13
|
declare namespace cardParts {
|
|
14
14
|
export { CardContent as Content, CardDescription as Description, CardFooter as Footer, CardHeader as Header, CardRoot as Root, CardTitle as Title };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cnMerge } from '../../chunk-OHG7GB7O.js';
|
|
2
|
-
import { Slot } from '../../chunk-
|
|
2
|
+
import { Slot } from '../../chunk-2P3P5AXH.js';
|
|
3
3
|
import { __export } from '../../chunk-PZ5AY32C.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
@@ -17,7 +17,7 @@ function CardTitle(props) {
|
|
|
17
17
|
}
|
|
18
18
|
function CardDescription(props) {
|
|
19
19
|
const { as: Element = "p", className, ...restOfProps } = props;
|
|
20
|
-
return /* @__PURE__ */ React.createElement(Element, { className: cnMerge("text-
|
|
20
|
+
return /* @__PURE__ */ React.createElement(Element, { className: cnMerge("text-shadcn-muted-foreground text-sm", className), ...restOfProps });
|
|
21
21
|
}
|
|
22
22
|
function CardContent(props) {
|
|
23
23
|
const { as: Element = "div", ...restOfProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/card/card.tsx","../../../../src/components/ui/card/card-parts.ts"],"names":[],"mappings":";;;;;AAMO,SAAS,SACf,KACC,EAAA;AACD,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,SAAW,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEpD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAS,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AAClC;AAEO,SAAS,WACf,KACC,EAAA;AACD,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,QAAU,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEnD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAS,EAAA,EAAA,GAAG,WA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AAA,QAAA;AAAA,EAAA,KAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\n\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport type { PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\n\nexport function CardRoot<TElement extends React.ElementType = \"article\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"article\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\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 <Element {...restOfProps} />;\n}\n\nexport function CardTitle<TElement extends React.ElementType = \"h3\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"h3\", className, ...restOfProps } = props;\n\n\treturn <Element className={cnMerge(\"font-semibold\", className)} {...restOfProps} />;\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 className={cnMerge(\"text-
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/card/card.tsx","../../../../src/components/ui/card/card-parts.ts"],"names":[],"mappings":";;;;;AAMO,SAAS,SACf,KACC,EAAA;AACD,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,SAAW,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEpD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAS,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AAClC;AAEO,SAAS,WACf,KACC,EAAA;AACD,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,QAAU,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEnD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAS,EAAA,EAAA,GAAG,WAAa,EAAA,CA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AAA,EAAA,KAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\n\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport type { PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\n\nexport function CardRoot<TElement extends React.ElementType = \"article\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"article\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\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 <Element {...restOfProps} />;\n}\n\nexport function CardTitle<TElement extends React.ElementType = \"h3\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"h3\", className, ...restOfProps } = props;\n\n\treturn <Element className={cnMerge(\"font-semibold\", className)} {...restOfProps} />;\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 className={cnMerge(\"text-shadcn-muted-foreground text-sm\", className)} {...restOfProps} />\n\t);\n}\n\nexport function CardContent<TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicProps<TElement>\n) {\n\tconst { as: Element = \"div\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nexport function CardFooter<TElement extends React.ElementType = \"footer\">(\n\tprops: PolymorphicProps<TElement, { asChild?: boolean }>\n) {\n\tconst { as: Element = \"footer\", asChild, ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot : Element;\n\n\treturn <Component {...restOfProps} />;\n}\n","export {\n\tCardContent as Content,\n\tCardDescription as Description,\n\tCardFooter as Footer,\n\tCardHeader as Header,\n\tCardRoot as Root,\n\tCardTitle as Title,\n} from \"./card\";\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
2
|
import { DiscriminatedRenderProps, PolymorphicProps } from '@zayne-labs/toolkit-react/utils';
|
|
3
|
+
import { StoreApi } from '@zayne-labs/toolkit-core';
|
|
3
4
|
import { Prettify } from '@zayne-labs/toolkit-type-helpers';
|
|
4
|
-
import { StoreApi } from 'zustand';
|
|
5
5
|
|
|
6
6
|
type ImagesType = Array<Record<string, string>> | string[];
|
|
7
7
|
type CarouselStore<TImages extends ImagesType = ImagesType> = {
|
|
@@ -75,16 +75,16 @@ type OtherCarouselProps = {
|
|
|
75
75
|
style?: React.CSSProperties;
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
declare function CarouselContent<TElement extends
|
|
79
|
-
declare function CarouselButton(props: CarouselButtonsProps):
|
|
80
|
-
declare function CarouselControls(props: CarouselControlProps):
|
|
81
|
-
declare function CarouselItemGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>):
|
|
82
|
-
declare function CarouselItem({ children, className, ...restOfProps }: OtherCarouselProps):
|
|
83
|
-
declare function CarouselCaption<TElement extends
|
|
84
|
-
declare function CarouselIndicatorGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>):
|
|
85
|
-
declare function CarouselIndicator(props: CarouselIndicatorProps):
|
|
78
|
+
declare function CarouselContent<TElement extends React$1.ElementType = "article">(props: PolymorphicProps<TElement, CarouselContentProps>): React$1.JSX.Element;
|
|
79
|
+
declare function CarouselButton(props: CarouselButtonsProps): React$1.JSX.Element;
|
|
80
|
+
declare function CarouselControls(props: CarouselControlProps): React$1.JSX.Element;
|
|
81
|
+
declare function CarouselItemGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>): React$1.JSX.Element;
|
|
82
|
+
declare function CarouselItem({ children, className, ...restOfProps }: OtherCarouselProps): React$1.JSX.Element;
|
|
83
|
+
declare function CarouselCaption<TElement extends React$1.ElementType = "div">(props: PolymorphicProps<TElement, OtherCarouselProps>): React$1.JSX.Element;
|
|
84
|
+
declare function CarouselIndicatorGroup<TArrayItem>(props: CarouselWrapperProps<TArrayItem>): React$1.JSX.Element;
|
|
85
|
+
declare function CarouselIndicator(props: CarouselIndicatorProps): React$1.JSX.Element;
|
|
86
86
|
|
|
87
|
-
declare function CarouselContextProvider<TImages extends ImagesType>(props: CarouselProviderProps<TImages>):
|
|
87
|
+
declare function CarouselContextProvider<TImages extends ImagesType>(props: CarouselProviderProps<TImages>): React$1.JSX.Element;
|
|
88
88
|
|
|
89
89
|
declare namespace carouselParts {
|
|
90
90
|
export { CarouselButton as Button, CarouselCaption as Caption, CarouselContent as Content, CarouselControls as Controls, CarouselIndicator as Indicator, CarouselIndicatorGroup as IndicatorGroup, CarouselItem as Item, CarouselItemGroup as ItemGroup, CarouselContextProvider as Root };
|