@skeletonlabs/skeleton-react 2.0.0-next.1 → 2.0.0-next.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/components/accordion/anatomy/content.d.ts +9 -0
- package/dist/components/accordion/anatomy/content.js +21 -0
- package/dist/components/accordion/anatomy/heading.d.ts +16 -0
- package/dist/components/accordion/anatomy/heading.js +17 -0
- package/dist/components/accordion/anatomy/indicator.d.ts +9 -0
- package/dist/components/accordion/anatomy/indicator.js +21 -0
- package/dist/components/accordion/anatomy/item-context.d.ts +10 -0
- package/dist/components/accordion/anatomy/item-context.js +11 -0
- package/dist/components/accordion/anatomy/item.d.ts +10 -0
- package/dist/components/accordion/anatomy/item.js +28 -0
- package/dist/components/accordion/anatomy/root-context.d.ts +10 -0
- package/dist/components/accordion/anatomy/root-context.js +11 -0
- package/dist/components/accordion/anatomy/root.d.ts +10 -0
- package/dist/components/accordion/anatomy/root.js +28 -0
- package/dist/components/accordion/anatomy/trigger.d.ts +9 -0
- package/dist/components/accordion/anatomy/trigger.js +21 -0
- package/dist/components/accordion/index.js +3 -0
- package/dist/components/accordion/modules/anatomy.d.ts +21 -0
- package/dist/components/accordion/modules/anatomy.js +22 -0
- package/dist/components/accordion/modules/item-context.d.ts +10 -0
- package/dist/components/accordion/modules/item-context.js +7 -0
- package/dist/components/accordion/modules/root-context.d.ts +9 -0
- package/dist/components/accordion/modules/root-context.js +7 -0
- package/dist/components/avatar/anatomy/fallback.d.ts +9 -0
- package/dist/components/avatar/anatomy/fallback.js +19 -0
- package/dist/components/avatar/anatomy/image.d.ts +9 -0
- package/dist/components/avatar/anatomy/image.js +16 -0
- package/dist/components/avatar/anatomy/root-context.d.ts +10 -0
- package/dist/components/avatar/anatomy/root-context.js +11 -0
- package/dist/components/avatar/anatomy/root.d.ts +10 -0
- package/dist/components/avatar/anatomy/root.js +28 -0
- package/dist/components/avatar/index.js +3 -0
- package/dist/components/avatar/modules/anatomy.d.ts +13 -0
- package/dist/components/avatar/modules/anatomy.js +14 -0
- package/dist/components/avatar/modules/root-context.d.ts +9 -0
- package/dist/components/avatar/modules/root-context.js +7 -0
- package/dist/components/progress-linear/anatomy/label.d.ts +9 -0
- package/dist/components/progress-linear/anatomy/label.js +19 -0
- package/dist/components/progress-linear/anatomy/range.d.ts +9 -0
- package/dist/components/progress-linear/anatomy/range.js +16 -0
- package/dist/components/progress-linear/anatomy/root-context.d.ts +10 -0
- package/dist/components/progress-linear/anatomy/root-context.js +11 -0
- package/dist/components/progress-linear/anatomy/root.d.ts +10 -0
- package/dist/components/progress-linear/anatomy/root.js +28 -0
- package/dist/components/progress-linear/anatomy/track.d.ts +9 -0
- package/dist/components/progress-linear/anatomy/track.js +19 -0
- package/dist/components/progress-linear/index.js +3 -0
- package/dist/components/progress-linear/modules/anatomy.d.ts +15 -0
- package/dist/components/progress-linear/modules/anatomy.js +16 -0
- package/dist/components/progress-linear/modules/root-context.d.ts +9 -0
- package/dist/components/progress-linear/modules/root-context.js +7 -0
- package/dist/components/rating-group/anatomy/control.d.ts +9 -0
- package/dist/components/rating-group/anatomy/control.js +19 -0
- package/dist/components/rating-group/anatomy/hidden-input.d.ts +9 -0
- package/dist/components/rating-group/anatomy/hidden-input.js +16 -0
- package/dist/components/rating-group/anatomy/item-context.d.ts +10 -0
- package/dist/components/rating-group/anatomy/item-context.js +11 -0
- package/dist/components/rating-group/anatomy/item.d.ts +29 -0
- package/dist/components/rating-group/anatomy/item.js +29 -0
- package/dist/components/rating-group/anatomy/label.d.ts +9 -0
- package/dist/components/rating-group/anatomy/label.js +19 -0
- package/dist/components/rating-group/anatomy/root-context.d.ts +10 -0
- package/dist/components/rating-group/anatomy/root-context.js +11 -0
- package/dist/components/rating-group/anatomy/root.d.ts +10 -0
- package/dist/components/rating-group/anatomy/root.js +28 -0
- package/dist/components/rating-group/index.js +3 -0
- package/dist/components/rating-group/modules/anatomy.d.ts +19 -0
- package/dist/components/rating-group/modules/anatomy.js +20 -0
- package/dist/components/rating-group/modules/item-context.d.ts +9 -0
- package/dist/components/rating-group/modules/item-context.js +7 -0
- package/dist/components/rating-group/modules/root-context.d.ts +9 -0
- package/dist/components/rating-group/modules/root-context.js +7 -0
- package/dist/components/tabs/anatomy/content.d.ts +10 -0
- package/dist/components/tabs/anatomy/content.js +21 -0
- package/dist/components/tabs/anatomy/indicator.d.ts +9 -0
- package/dist/components/tabs/anatomy/indicator.js +16 -0
- package/dist/components/tabs/anatomy/list.d.ts +9 -0
- package/dist/components/tabs/anatomy/list.js +19 -0
- package/dist/components/tabs/anatomy/root-context.d.ts +10 -0
- package/dist/components/tabs/anatomy/root-context.js +11 -0
- package/dist/components/tabs/anatomy/root.d.ts +10 -0
- package/dist/components/tabs/anatomy/root.js +28 -0
- package/dist/components/tabs/anatomy/trigger.d.ts +10 -0
- package/dist/components/tabs/anatomy/trigger.js +21 -0
- package/dist/components/tabs/index.js +3 -0
- package/dist/components/tabs/modules/anatomy.d.ts +17 -0
- package/dist/components/tabs/modules/anatomy.js +18 -0
- package/dist/components/tabs/modules/root-context.d.ts +9 -0
- package/dist/components/tabs/modules/root-context.js +7 -0
- package/dist/index.d.ts +43 -85
- package/dist/index.js +12 -162
- package/dist/internal/components/star-empty.js +22 -0
- package/dist/internal/components/star-full.js +20 -0
- package/dist/internal/components/star-half.js +36 -0
- package/dist/internal/props-with-element.d.ts +13 -0
- package/package.json +2 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps, PropsWithChildren } from "react";
|
|
3
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/accordion/anatomy/content.d.ts
|
|
6
|
+
interface AccordionContentProps extends PropsWithChildren, PropsWithElement, ComponentProps<'div'> {}
|
|
7
|
+
declare function export_default(props: AccordionContentProps): react_jsx_runtime9.JSX.Element | null;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AccordionContentProps, export_default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AccordionRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { AccordionItemContext } from "../modules/item-context.js";
|
|
3
|
+
import { useContext } from "react";
|
|
4
|
+
import { mergeProps } from "@zag-js/react";
|
|
5
|
+
import { classesAccordion } from "@skeletonlabs/skeleton-common";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/accordion/anatomy/content.tsx
|
|
9
|
+
function content_default(props) {
|
|
10
|
+
const rootContext = useContext(AccordionRootContext);
|
|
11
|
+
const itemContext = useContext(AccordionItemContext);
|
|
12
|
+
const { element, children,...restAttributes } = props;
|
|
13
|
+
const attributes = mergeProps(rootContext.api.getItemContentProps(itemContext.itemProps), { className: classesAccordion.content }, restAttributes);
|
|
14
|
+
return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
15
|
+
...attributes,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { content_default as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps, PropsWithChildren } from "react";
|
|
3
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/accordion/anatomy/heading.d.ts
|
|
6
|
+
interface AccordionHeadingProps extends PropsWithChildren, PropsWithElement, ComponentProps<'h3'> {
|
|
7
|
+
/**
|
|
8
|
+
* The level of the heading.
|
|
9
|
+
*
|
|
10
|
+
* @default 3
|
|
11
|
+
*/
|
|
12
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
13
|
+
}
|
|
14
|
+
declare function export_default(props: AccordionHeadingProps): react_jsx_runtime6.JSX.Element | null;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { AccordionHeadingProps, export_default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { mergeProps } from "@zag-js/react";
|
|
2
|
+
import { classesAccordion } from "@skeletonlabs/skeleton-common";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/accordion/anatomy/heading.tsx
|
|
6
|
+
function heading_default(props) {
|
|
7
|
+
const { level = 3, element, children,...restAttributes } = props;
|
|
8
|
+
const Tag = `h${level}`;
|
|
9
|
+
const attributes = mergeProps({ className: classesAccordion.heading }, restAttributes);
|
|
10
|
+
return element ? element({ attributes }) : /* @__PURE__ */ jsx(Tag, {
|
|
11
|
+
...attributes,
|
|
12
|
+
children
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { heading_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps, PropsWithChildren } from "react";
|
|
3
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/accordion/anatomy/indicator.d.ts
|
|
6
|
+
interface AccordionIndicatorProps extends PropsWithChildren, PropsWithElement, ComponentProps<'div'> {}
|
|
7
|
+
declare function export_default(props: AccordionIndicatorProps): react_jsx_runtime8.JSX.Element | null;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AccordionIndicatorProps, export_default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AccordionRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { AccordionItemContext } from "../modules/item-context.js";
|
|
3
|
+
import { useContext } from "react";
|
|
4
|
+
import { mergeProps } from "@zag-js/react";
|
|
5
|
+
import { classesAccordion } from "@skeletonlabs/skeleton-common";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/accordion/anatomy/indicator.tsx
|
|
9
|
+
function indicator_default(props) {
|
|
10
|
+
const rootContext = useContext(AccordionRootContext);
|
|
11
|
+
const itemContext = useContext(AccordionItemContext);
|
|
12
|
+
const { element, children,...restAttributes } = props;
|
|
13
|
+
const attributes = mergeProps(rootContext.api.getItemIndicatorProps(itemContext.itemProps), { className: classesAccordion.indicator }, restAttributes);
|
|
14
|
+
return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
15
|
+
...attributes,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { indicator_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AccordionItemContextType } from "../modules/item-context.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/accordion/anatomy/item-context.d.ts
|
|
5
|
+
interface AccordionItemContextProps {
|
|
6
|
+
children: (context: AccordionItemContextType) => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function export_default(props: AccordionItemContextProps): ReactNode;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AccordionItemContextProps, export_default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AccordionItemContext } from "../modules/item-context.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/accordion/anatomy/item-context.tsx
|
|
5
|
+
function item_context_default(props) {
|
|
6
|
+
const itemContext = useContext(AccordionItemContext);
|
|
7
|
+
return props.children(itemContext);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { item_context_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps, PropsWithChildren } from "react";
|
|
3
|
+
import { ItemProps } from "@zag-js/accordion";
|
|
4
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/accordion/anatomy/item.d.ts
|
|
7
|
+
interface AccordionItemProps extends PropsWithChildren, PropsWithElement, ItemProps, ComponentProps<'div'> {}
|
|
8
|
+
declare function export_default(props: AccordionItemProps): react_jsx_runtime5.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AccordionItemProps, export_default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AccordionRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { AccordionItemContext } from "../modules/item-context.js";
|
|
3
|
+
import { useContext } from "react";
|
|
4
|
+
import { splitItemProps } from "@zag-js/accordion";
|
|
5
|
+
import { mergeProps } from "@zag-js/react";
|
|
6
|
+
import { classesAccordion } from "@skeletonlabs/skeleton-common";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/components/accordion/anatomy/item.tsx
|
|
10
|
+
function item_default(props) {
|
|
11
|
+
const rootContext = useContext(AccordionRootContext);
|
|
12
|
+
const [itemProps, componentProps] = splitItemProps(props);
|
|
13
|
+
const { element, children,...restAttributes } = componentProps;
|
|
14
|
+
const attributes = mergeProps(rootContext.api.getItemProps(itemProps), { className: classesAccordion.item }, restAttributes);
|
|
15
|
+
return /* @__PURE__ */ jsx(AccordionItemContext.Provider, {
|
|
16
|
+
value: {
|
|
17
|
+
itemProps,
|
|
18
|
+
itemState: rootContext.api.getItemState(itemProps)
|
|
19
|
+
},
|
|
20
|
+
children: element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
21
|
+
...attributes,
|
|
22
|
+
children
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { item_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AccordionRootContextType } from "../modules/root-context.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/accordion/anatomy/root-context.d.ts
|
|
5
|
+
interface AccordionRootContextProps {
|
|
6
|
+
children: (context: AccordionRootContextType) => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function export_default(props: AccordionRootContextProps): ReactNode;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AccordionRootContextProps, export_default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AccordionRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/accordion/anatomy/root-context.tsx
|
|
5
|
+
function root_context_default(props) {
|
|
6
|
+
const rootContext = useContext(AccordionRootContext);
|
|
7
|
+
return props.children(rootContext);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { root_context_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps, PropsWithChildren } from "react";
|
|
3
|
+
import { Props } from "@zag-js/accordion";
|
|
4
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/accordion/anatomy/root.d.ts
|
|
7
|
+
interface AccordionRootProps extends PropsWithChildren, PropsWithElement, Omit<Props, 'id'>, Omit<ComponentProps<'div'>, 'id' | 'defaultValue' | 'dir'> {}
|
|
8
|
+
declare function export_default(props: AccordionRootProps): react_jsx_runtime4.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AccordionRootProps, export_default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AccordionRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { connect, machine, splitProps } from "@zag-js/accordion";
|
|
4
|
+
import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
|
|
5
|
+
import { classesAccordion } from "@skeletonlabs/skeleton-common";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/accordion/anatomy/root.tsx
|
|
9
|
+
function root_default(props) {
|
|
10
|
+
const [machineProps, componentProps] = splitProps(props);
|
|
11
|
+
const { element, children,...restAttributes } = componentProps;
|
|
12
|
+
const service = useMachine(machine, {
|
|
13
|
+
id: useId(),
|
|
14
|
+
...machineProps
|
|
15
|
+
});
|
|
16
|
+
const api = connect(service, normalizeProps);
|
|
17
|
+
const attributes = mergeProps(api.getRootProps(), { className: classesAccordion.root }, restAttributes);
|
|
18
|
+
return /* @__PURE__ */ jsx(AccordionRootContext.Provider, {
|
|
19
|
+
value: { api },
|
|
20
|
+
children: element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
21
|
+
...attributes,
|
|
22
|
+
children
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { root_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps, PropsWithChildren } from "react";
|
|
3
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/accordion/anatomy/trigger.d.ts
|
|
6
|
+
interface AccordionTriggerProps extends PropsWithChildren, PropsWithElement, ComponentProps<'button'> {}
|
|
7
|
+
declare function export_default(props: AccordionTriggerProps): react_jsx_runtime7.JSX.Element | null;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AccordionTriggerProps, export_default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AccordionRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { AccordionItemContext } from "../modules/item-context.js";
|
|
3
|
+
import { useContext } from "react";
|
|
4
|
+
import { mergeProps } from "@zag-js/react";
|
|
5
|
+
import { classesAccordion } from "@skeletonlabs/skeleton-common";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/accordion/anatomy/trigger.tsx
|
|
9
|
+
function trigger_default(props) {
|
|
10
|
+
const rootContext = useContext(AccordionRootContext);
|
|
11
|
+
const itemContext = useContext(AccordionItemContext);
|
|
12
|
+
const { element, children,...restAttributes } = props;
|
|
13
|
+
const attributes = mergeProps(rootContext.api.getItemTriggerProps(itemContext.itemProps), { className: classesAccordion.trigger }, restAttributes);
|
|
14
|
+
return element ? element({ attributes }) : /* @__PURE__ */ jsx("button", {
|
|
15
|
+
...attributes,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { trigger_default as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { export_default } from "../anatomy/root.js";
|
|
2
|
+
import { export_default as export_default$1 } from "../anatomy/root-context.js";
|
|
3
|
+
import { export_default as export_default$2 } from "../anatomy/item.js";
|
|
4
|
+
import { export_default as export_default$3 } from "../anatomy/item-context.js";
|
|
5
|
+
import { export_default as export_default$4 } from "../anatomy/heading.js";
|
|
6
|
+
import { export_default as export_default$5 } from "../anatomy/trigger.js";
|
|
7
|
+
import { export_default as export_default$6 } from "../anatomy/indicator.js";
|
|
8
|
+
import { export_default as export_default$7 } from "../anatomy/content.js";
|
|
9
|
+
|
|
10
|
+
//#region src/components/accordion/modules/anatomy.d.ts
|
|
11
|
+
declare const Accordion: typeof export_default & {
|
|
12
|
+
Context: typeof export_default$1;
|
|
13
|
+
Item: typeof export_default$2;
|
|
14
|
+
ItemContext: typeof export_default$3;
|
|
15
|
+
Heading: typeof export_default$4;
|
|
16
|
+
Trigger: typeof export_default$5;
|
|
17
|
+
Indicator: typeof export_default$6;
|
|
18
|
+
Content: typeof export_default$7;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Accordion };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import root_default from "../anatomy/root.js";
|
|
2
|
+
import root_context_default from "../anatomy/root-context.js";
|
|
3
|
+
import item_default from "../anatomy/item.js";
|
|
4
|
+
import item_context_default from "../anatomy/item-context.js";
|
|
5
|
+
import heading_default from "../anatomy/heading.js";
|
|
6
|
+
import trigger_default from "../anatomy/trigger.js";
|
|
7
|
+
import indicator_default from "../anatomy/indicator.js";
|
|
8
|
+
import content_default from "../anatomy/content.js";
|
|
9
|
+
|
|
10
|
+
//#region src/components/accordion/modules/anatomy.ts
|
|
11
|
+
const Accordion = Object.assign(root_default, {
|
|
12
|
+
Context: root_context_default,
|
|
13
|
+
Item: item_default,
|
|
14
|
+
ItemContext: item_context_default,
|
|
15
|
+
Heading: heading_default,
|
|
16
|
+
Trigger: trigger_default,
|
|
17
|
+
Indicator: indicator_default,
|
|
18
|
+
Content: content_default
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Accordion };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { ItemProps, ItemState } from "@zag-js/accordion";
|
|
3
|
+
|
|
4
|
+
//#region src/components/accordion/modules/item-context.d.ts
|
|
5
|
+
interface AccordionItemContextType {
|
|
6
|
+
itemProps: ItemProps;
|
|
7
|
+
itemState: ItemState;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AccordionItemContextType };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/avatar/anatomy/fallback.d.ts
|
|
6
|
+
interface AvatarFallbackProps extends PropsWithElement, ComponentProps<'span'> {}
|
|
7
|
+
declare function export_default(props: AvatarFallbackProps): react_jsx_runtime12.JSX.Element | null;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AvatarFallbackProps, export_default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AvatarRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
|
+
import { classesAvatar } from "@skeletonlabs/skeleton-common";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/avatar/anatomy/fallback.tsx
|
|
8
|
+
function fallback_default(props) {
|
|
9
|
+
const rootContext = useContext(AvatarRootContext);
|
|
10
|
+
const { element, children,...restAttributes } = props;
|
|
11
|
+
const attributes = mergeProps(rootContext.api.getFallbackProps(), { className: classesAvatar.fallback }, restAttributes);
|
|
12
|
+
return element ? element({ attributes }) : /* @__PURE__ */ jsx("span", {
|
|
13
|
+
...attributes,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { fallback_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/avatar/anatomy/image.d.ts
|
|
6
|
+
interface AvatarImageProps extends PropsWithElement, Omit<ComponentProps<'img'>, 'children'> {}
|
|
7
|
+
declare function export_default(props: AvatarImageProps): react_jsx_runtime11.JSX.Element | null;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AvatarImageProps, export_default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AvatarRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
|
+
import { classesAvatar } from "@skeletonlabs/skeleton-common";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/avatar/anatomy/image.tsx
|
|
8
|
+
function image_default(props) {
|
|
9
|
+
const rootContext = useContext(AvatarRootContext);
|
|
10
|
+
const { element,...restAttributes } = props;
|
|
11
|
+
const attributes = mergeProps(rootContext.api.getImageProps(), { className: classesAvatar.image }, restAttributes);
|
|
12
|
+
return element ? element({ attributes }) : /* @__PURE__ */ jsx("img", { ...attributes });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { image_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AvatarRootContextType } from "../modules/root-context.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/avatar/anatomy/root-context.d.ts
|
|
5
|
+
interface AvatarRootContextProps {
|
|
6
|
+
children: (context: AvatarRootContextType) => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function export_default(props: AvatarRootContextProps): ReactNode;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AvatarRootContextProps, export_default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AvatarRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/avatar/anatomy/root-context.tsx
|
|
5
|
+
function root_context_default(props) {
|
|
6
|
+
const rootContext = useContext(AvatarRootContext);
|
|
7
|
+
return props.children(rootContext);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { root_context_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
4
|
+
import { Props } from "@zag-js/avatar";
|
|
5
|
+
|
|
6
|
+
//#region src/components/avatar/anatomy/root.d.ts
|
|
7
|
+
interface AvatarRootProps extends PropsWithElement, Omit<Props, 'id'>, Omit<ComponentProps<'div'>, 'id' | 'dir'> {}
|
|
8
|
+
declare function export_default(props: AvatarRootProps): react_jsx_runtime10.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AvatarRootProps, export_default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AvatarRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
|
|
4
|
+
import { classesAvatar } from "@skeletonlabs/skeleton-common";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { connect, machine, splitProps } from "@zag-js/avatar";
|
|
7
|
+
|
|
8
|
+
//#region src/components/avatar/anatomy/root.tsx
|
|
9
|
+
function root_default(props) {
|
|
10
|
+
const [machineProps, componentProps] = splitProps(props);
|
|
11
|
+
const { element, children,...restAttributes } = componentProps;
|
|
12
|
+
const service = useMachine(machine, {
|
|
13
|
+
id: useId(),
|
|
14
|
+
...machineProps
|
|
15
|
+
});
|
|
16
|
+
const api = connect(service, normalizeProps);
|
|
17
|
+
const attributes = mergeProps(api.getRootProps(), { className: classesAvatar.root }, restAttributes);
|
|
18
|
+
return /* @__PURE__ */ jsx(AvatarRootContext.Provider, {
|
|
19
|
+
value: { api },
|
|
20
|
+
children: element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
21
|
+
...attributes,
|
|
22
|
+
children
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { root_default as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { export_default } from "../anatomy/root.js";
|
|
2
|
+
import { export_default as export_default$1 } from "../anatomy/root-context.js";
|
|
3
|
+
import { export_default as export_default$2 } from "../anatomy/image.js";
|
|
4
|
+
import { export_default as export_default$3 } from "../anatomy/fallback.js";
|
|
5
|
+
|
|
6
|
+
//#region src/components/avatar/modules/anatomy.d.ts
|
|
7
|
+
declare const Avatar: typeof export_default & {
|
|
8
|
+
Context: typeof export_default$1;
|
|
9
|
+
Image: typeof export_default$2;
|
|
10
|
+
Fallback: typeof export_default$3;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Avatar };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import root_default from "../anatomy/root.js";
|
|
2
|
+
import root_context_default from "../anatomy/root-context.js";
|
|
3
|
+
import image_default from "../anatomy/image.js";
|
|
4
|
+
import fallback_default from "../anatomy/fallback.js";
|
|
5
|
+
|
|
6
|
+
//#region src/components/avatar/modules/anatomy.ts
|
|
7
|
+
const Avatar = Object.assign(root_default, {
|
|
8
|
+
Context: root_context_default,
|
|
9
|
+
Image: image_default,
|
|
10
|
+
Fallback: fallback_default
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Avatar };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/progress-linear/anatomy/label.d.ts
|
|
6
|
+
interface ProgressLinearLabelProps extends PropsWithElement, ComponentProps<'div'> {}
|
|
7
|
+
declare function export_default(props: ProgressLinearLabelProps): react_jsx_runtime14.JSX.Element | null;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ProgressLinearLabelProps, export_default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ProgressLinearRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
|
+
import { classesProgressLinear } from "@skeletonlabs/skeleton-common";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/progress-linear/anatomy/label.tsx
|
|
8
|
+
function label_default(props) {
|
|
9
|
+
const rootContext = useContext(ProgressLinearRootContext);
|
|
10
|
+
const { element, children,...restAttributes } = props;
|
|
11
|
+
const attributes = mergeProps(rootContext.api.getLabelProps(), { className: classesProgressLinear.label }, restAttributes);
|
|
12
|
+
return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
13
|
+
...attributes,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { label_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/progress-linear/anatomy/range.d.ts
|
|
6
|
+
interface ProgressLinearRangeProps extends PropsWithElement, Omit<ComponentProps<'div'>, 'children'> {}
|
|
7
|
+
declare function export_default(props: ProgressLinearRangeProps): react_jsx_runtime16.JSX.Element | null;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ProgressLinearRangeProps, export_default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ProgressLinearRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
|
+
import { classesProgressLinear } from "@skeletonlabs/skeleton-common";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/progress-linear/anatomy/range.tsx
|
|
8
|
+
function range_default(props) {
|
|
9
|
+
const rootContext = useContext(ProgressLinearRootContext);
|
|
10
|
+
const { element,...restAttributes } = props;
|
|
11
|
+
const attributes = mergeProps(rootContext.api.getRangeProps(), { className: classesProgressLinear.range }, restAttributes);
|
|
12
|
+
return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", { ...attributes });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { range_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProgressLinearRootContextType } from "../modules/root-context.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/progress-linear/anatomy/root-context.d.ts
|
|
5
|
+
interface ProgressLinearRootContextProps {
|
|
6
|
+
children: (context: ProgressLinearRootContextType) => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function export_default(props: ProgressLinearRootContextProps): ReactNode;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ProgressLinearRootContextProps, export_default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProgressLinearRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/progress-linear/anatomy/root-context.tsx
|
|
5
|
+
function root_context_default(props) {
|
|
6
|
+
const rootContext = useContext(ProgressLinearRootContext);
|
|
7
|
+
return props.children(rootContext);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { root_context_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
4
|
+
import { Props } from "@zag-js/progress";
|
|
5
|
+
|
|
6
|
+
//#region src/components/progress-linear/anatomy/root.d.ts
|
|
7
|
+
interface ProgressLinearRootProps extends PropsWithElement, Omit<Props, 'id'>, Omit<ComponentProps<'div'>, 'id' | 'dir' | 'defaultValue'> {}
|
|
8
|
+
declare function export_default(props: ProgressLinearRootProps): react_jsx_runtime13.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ProgressLinearRootProps, export_default };
|