@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.
Files changed (96) hide show
  1. package/dist/components/accordion/anatomy/content.d.ts +9 -0
  2. package/dist/components/accordion/anatomy/content.js +21 -0
  3. package/dist/components/accordion/anatomy/heading.d.ts +16 -0
  4. package/dist/components/accordion/anatomy/heading.js +17 -0
  5. package/dist/components/accordion/anatomy/indicator.d.ts +9 -0
  6. package/dist/components/accordion/anatomy/indicator.js +21 -0
  7. package/dist/components/accordion/anatomy/item-context.d.ts +10 -0
  8. package/dist/components/accordion/anatomy/item-context.js +11 -0
  9. package/dist/components/accordion/anatomy/item.d.ts +10 -0
  10. package/dist/components/accordion/anatomy/item.js +28 -0
  11. package/dist/components/accordion/anatomy/root-context.d.ts +10 -0
  12. package/dist/components/accordion/anatomy/root-context.js +11 -0
  13. package/dist/components/accordion/anatomy/root.d.ts +10 -0
  14. package/dist/components/accordion/anatomy/root.js +28 -0
  15. package/dist/components/accordion/anatomy/trigger.d.ts +9 -0
  16. package/dist/components/accordion/anatomy/trigger.js +21 -0
  17. package/dist/components/accordion/index.js +3 -0
  18. package/dist/components/accordion/modules/anatomy.d.ts +21 -0
  19. package/dist/components/accordion/modules/anatomy.js +22 -0
  20. package/dist/components/accordion/modules/item-context.d.ts +10 -0
  21. package/dist/components/accordion/modules/item-context.js +7 -0
  22. package/dist/components/accordion/modules/root-context.d.ts +9 -0
  23. package/dist/components/accordion/modules/root-context.js +7 -0
  24. package/dist/components/avatar/anatomy/fallback.d.ts +9 -0
  25. package/dist/components/avatar/anatomy/fallback.js +19 -0
  26. package/dist/components/avatar/anatomy/image.d.ts +9 -0
  27. package/dist/components/avatar/anatomy/image.js +16 -0
  28. package/dist/components/avatar/anatomy/root-context.d.ts +10 -0
  29. package/dist/components/avatar/anatomy/root-context.js +11 -0
  30. package/dist/components/avatar/anatomy/root.d.ts +10 -0
  31. package/dist/components/avatar/anatomy/root.js +28 -0
  32. package/dist/components/avatar/index.js +3 -0
  33. package/dist/components/avatar/modules/anatomy.d.ts +13 -0
  34. package/dist/components/avatar/modules/anatomy.js +14 -0
  35. package/dist/components/avatar/modules/root-context.d.ts +9 -0
  36. package/dist/components/avatar/modules/root-context.js +7 -0
  37. package/dist/components/progress-linear/anatomy/label.d.ts +9 -0
  38. package/dist/components/progress-linear/anatomy/label.js +19 -0
  39. package/dist/components/progress-linear/anatomy/range.d.ts +9 -0
  40. package/dist/components/progress-linear/anatomy/range.js +16 -0
  41. package/dist/components/progress-linear/anatomy/root-context.d.ts +10 -0
  42. package/dist/components/progress-linear/anatomy/root-context.js +11 -0
  43. package/dist/components/progress-linear/anatomy/root.d.ts +10 -0
  44. package/dist/components/progress-linear/anatomy/root.js +28 -0
  45. package/dist/components/progress-linear/anatomy/track.d.ts +9 -0
  46. package/dist/components/progress-linear/anatomy/track.js +19 -0
  47. package/dist/components/progress-linear/index.js +3 -0
  48. package/dist/components/progress-linear/modules/anatomy.d.ts +15 -0
  49. package/dist/components/progress-linear/modules/anatomy.js +16 -0
  50. package/dist/components/progress-linear/modules/root-context.d.ts +9 -0
  51. package/dist/components/progress-linear/modules/root-context.js +7 -0
  52. package/dist/components/rating-group/anatomy/control.d.ts +9 -0
  53. package/dist/components/rating-group/anatomy/control.js +19 -0
  54. package/dist/components/rating-group/anatomy/hidden-input.d.ts +9 -0
  55. package/dist/components/rating-group/anatomy/hidden-input.js +16 -0
  56. package/dist/components/rating-group/anatomy/item-context.d.ts +10 -0
  57. package/dist/components/rating-group/anatomy/item-context.js +11 -0
  58. package/dist/components/rating-group/anatomy/item.d.ts +29 -0
  59. package/dist/components/rating-group/anatomy/item.js +29 -0
  60. package/dist/components/rating-group/anatomy/label.d.ts +9 -0
  61. package/dist/components/rating-group/anatomy/label.js +19 -0
  62. package/dist/components/rating-group/anatomy/root-context.d.ts +10 -0
  63. package/dist/components/rating-group/anatomy/root-context.js +11 -0
  64. package/dist/components/rating-group/anatomy/root.d.ts +10 -0
  65. package/dist/components/rating-group/anatomy/root.js +28 -0
  66. package/dist/components/rating-group/index.js +3 -0
  67. package/dist/components/rating-group/modules/anatomy.d.ts +19 -0
  68. package/dist/components/rating-group/modules/anatomy.js +20 -0
  69. package/dist/components/rating-group/modules/item-context.d.ts +9 -0
  70. package/dist/components/rating-group/modules/item-context.js +7 -0
  71. package/dist/components/rating-group/modules/root-context.d.ts +9 -0
  72. package/dist/components/rating-group/modules/root-context.js +7 -0
  73. package/dist/components/tabs/anatomy/content.d.ts +10 -0
  74. package/dist/components/tabs/anatomy/content.js +21 -0
  75. package/dist/components/tabs/anatomy/indicator.d.ts +9 -0
  76. package/dist/components/tabs/anatomy/indicator.js +16 -0
  77. package/dist/components/tabs/anatomy/list.d.ts +9 -0
  78. package/dist/components/tabs/anatomy/list.js +19 -0
  79. package/dist/components/tabs/anatomy/root-context.d.ts +10 -0
  80. package/dist/components/tabs/anatomy/root-context.js +11 -0
  81. package/dist/components/tabs/anatomy/root.d.ts +10 -0
  82. package/dist/components/tabs/anatomy/root.js +28 -0
  83. package/dist/components/tabs/anatomy/trigger.d.ts +10 -0
  84. package/dist/components/tabs/anatomy/trigger.js +21 -0
  85. package/dist/components/tabs/index.js +3 -0
  86. package/dist/components/tabs/modules/anatomy.d.ts +17 -0
  87. package/dist/components/tabs/modules/anatomy.js +18 -0
  88. package/dist/components/tabs/modules/root-context.d.ts +9 -0
  89. package/dist/components/tabs/modules/root-context.js +7 -0
  90. package/dist/index.d.ts +43 -85
  91. package/dist/index.js +12 -162
  92. package/dist/internal/components/star-empty.js +22 -0
  93. package/dist/internal/components/star-full.js +20 -0
  94. package/dist/internal/components/star-half.js +36 -0
  95. package/dist/internal/props-with-element.d.ts +13 -0
  96. 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,3 @@
1
+ import { Accordion } from "./modules/anatomy.js";
2
+
3
+ export { };
@@ -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,7 @@
1
+ import { createContext } from "react";
2
+
3
+ //#region src/components/accordion/modules/item-context.ts
4
+ const AccordionItemContext = createContext(null);
5
+
6
+ //#endregion
7
+ export { AccordionItemContext };
@@ -0,0 +1,9 @@
1
+ import "react";
2
+ import { Api } from "@zag-js/accordion";
3
+
4
+ //#region src/components/accordion/modules/root-context.d.ts
5
+ interface AccordionRootContextType {
6
+ api: Api;
7
+ }
8
+ //#endregion
9
+ export { AccordionRootContextType };
@@ -0,0 +1,7 @@
1
+ import { createContext } from "react";
2
+
3
+ //#region src/components/accordion/modules/root-context.ts
4
+ const AccordionRootContext = createContext(null);
5
+
6
+ //#endregion
7
+ export { AccordionRootContext };
@@ -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,3 @@
1
+ import { Avatar } from "./modules/anatomy.js";
2
+
3
+ export { };
@@ -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 "react";
2
+ import { Api } from "@zag-js/avatar";
3
+
4
+ //#region src/components/avatar/modules/root-context.d.ts
5
+ interface AvatarRootContextType {
6
+ api: Api;
7
+ }
8
+ //#endregion
9
+ export { AvatarRootContextType };
@@ -0,0 +1,7 @@
1
+ import { createContext } from "react";
2
+
3
+ //#region src/components/avatar/modules/root-context.ts
4
+ const AvatarRootContext = createContext(null);
5
+
6
+ //#endregion
7
+ export { AvatarRootContext };
@@ -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 };