@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,28 @@
1
+ import { ProgressLinearRootContext } from "../modules/root-context.js";
2
+ import { useId } from "react";
3
+ import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
4
+ import { classesProgressLinear } from "@skeletonlabs/skeleton-common";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { connect, machine, splitProps } from "@zag-js/progress";
7
+
8
+ //#region src/components/progress-linear/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: classesProgressLinear.root }, restAttributes);
18
+ return /* @__PURE__ */ jsx(ProgressLinearRootContext.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 } from "react";
3
+ import * as react_jsx_runtime15 from "react/jsx-runtime";
4
+
5
+ //#region src/components/progress-linear/anatomy/track.d.ts
6
+ interface ProgressLinearTrackProps extends PropsWithElement, ComponentProps<'div'> {}
7
+ declare function export_default(props: ProgressLinearTrackProps): react_jsx_runtime15.JSX.Element | null;
8
+ //#endregion
9
+ export { ProgressLinearTrackProps, 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/track.tsx
8
+ function track_default(props) {
9
+ const rootContext = useContext(ProgressLinearRootContext);
10
+ const { element, children,...restAttributes } = props;
11
+ const attributes = mergeProps(rootContext.api.getTrackProps(), { className: classesProgressLinear.track }, restAttributes);
12
+ return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
13
+ ...attributes,
14
+ children
15
+ });
16
+ }
17
+
18
+ //#endregion
19
+ export { track_default as default };
@@ -0,0 +1,3 @@
1
+ import { ProgressLinear } from "./modules/anatomy.js";
2
+
3
+ export { };
@@ -0,0 +1,15 @@
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/label.js";
4
+ import { export_default as export_default$3 } from "../anatomy/track.js";
5
+ import { export_default as export_default$4 } from "../anatomy/range.js";
6
+
7
+ //#region src/components/progress-linear/modules/anatomy.d.ts
8
+ declare const ProgressLinear: typeof export_default & {
9
+ Context: typeof export_default$1;
10
+ Label: typeof export_default$2;
11
+ Track: typeof export_default$3;
12
+ Range: typeof export_default$4;
13
+ };
14
+ //#endregion
15
+ export { ProgressLinear };
@@ -0,0 +1,16 @@
1
+ import root_default from "../anatomy/root.js";
2
+ import root_context_default from "../anatomy/root-context.js";
3
+ import label_default from "../anatomy/label.js";
4
+ import track_default from "../anatomy/track.js";
5
+ import range_default from "../anatomy/range.js";
6
+
7
+ //#region src/components/progress-linear/modules/anatomy.ts
8
+ const ProgressLinear = Object.assign(root_default, {
9
+ Context: root_context_default,
10
+ Label: label_default,
11
+ Track: track_default,
12
+ Range: range_default
13
+ });
14
+
15
+ //#endregion
16
+ export { ProgressLinear };
@@ -0,0 +1,9 @@
1
+ import "react";
2
+ import { Api } from "@zag-js/progress";
3
+
4
+ //#region src/components/progress-linear/modules/root-context.d.ts
5
+ interface ProgressLinearRootContextType {
6
+ api: Api;
7
+ }
8
+ //#endregion
9
+ export { ProgressLinearRootContextType };
@@ -0,0 +1,7 @@
1
+ import { createContext } from "react";
2
+
3
+ //#region src/components/progress-linear/modules/root-context.ts
4
+ const ProgressLinearRootContext = createContext(null);
5
+
6
+ //#endregion
7
+ export { ProgressLinearRootContext };
@@ -0,0 +1,9 @@
1
+ import { PropsWithElement } from "../../../internal/props-with-element.js";
2
+ import { ComponentProps } from "react";
3
+ import * as react_jsx_runtime19 from "react/jsx-runtime";
4
+
5
+ //#region src/components/rating-group/anatomy/control.d.ts
6
+ interface RatingGroupControlProps extends PropsWithElement, Omit<ComponentProps<'div'>, 'id' | 'defaultValue' | 'dir'> {}
7
+ declare function export_default(props: RatingGroupControlProps): react_jsx_runtime19.JSX.Element | null;
8
+ //#endregion
9
+ export { RatingGroupControlProps, export_default };
@@ -0,0 +1,19 @@
1
+ import { RatingGroupRootContext } from "../modules/root-context.js";
2
+ import { useContext } from "react";
3
+ import { mergeProps } from "@zag-js/react";
4
+ import { classesRatingGroup } from "@skeletonlabs/skeleton-common";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/components/rating-group/anatomy/control.tsx
8
+ function control_default(props) {
9
+ const rootContext = useContext(RatingGroupRootContext);
10
+ const { element, children,...restAttributes } = props;
11
+ const attributes = mergeProps(rootContext.api.getControlProps(), { className: classesRatingGroup.control }, restAttributes);
12
+ return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
13
+ ...attributes,
14
+ children
15
+ });
16
+ }
17
+
18
+ //#endregion
19
+ export { control_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_runtime21 from "react/jsx-runtime";
4
+
5
+ //#region src/components/rating-group/anatomy/hidden-input.d.ts
6
+ interface RatingGroupHiddenInputProps extends PropsWithElement, Omit<ComponentProps<'input'>, 'id' | 'defaultValue' | 'dir' | 'children'> {}
7
+ declare function export_default(props: RatingGroupHiddenInputProps): react_jsx_runtime21.JSX.Element | null;
8
+ //#endregion
9
+ export { RatingGroupHiddenInputProps, export_default };
@@ -0,0 +1,16 @@
1
+ import { RatingGroupRootContext } from "../modules/root-context.js";
2
+ import { useContext } from "react";
3
+ import { mergeProps } from "@zag-js/react";
4
+ import { classesRatingGroup } from "@skeletonlabs/skeleton-common";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/components/rating-group/anatomy/hidden-input.tsx
8
+ function hidden_input_default(props) {
9
+ const rootContext = useContext(RatingGroupRootContext);
10
+ const { element,...restAttributes } = props;
11
+ const attributes = mergeProps(rootContext.api.getHiddenInputProps(), { className: classesRatingGroup.hiddenInput }, restAttributes);
12
+ return element ? element({ attributes }) : /* @__PURE__ */ jsx("input", { ...attributes });
13
+ }
14
+
15
+ //#endregion
16
+ export { hidden_input_default as default };
@@ -0,0 +1,10 @@
1
+ import { RatingGroupItemContextType } from "../modules/item-context.js";
2
+ import { ReactNode } from "react";
3
+
4
+ //#region src/components/rating-group/anatomy/item-context.d.ts
5
+ interface RatingGroupItemContextProps {
6
+ children: (context: RatingGroupItemContextType) => ReactNode;
7
+ }
8
+ declare function export_default(props: RatingGroupItemContextProps): ReactNode;
9
+ //#endregion
10
+ export { RatingGroupItemContextProps, export_default };
@@ -0,0 +1,11 @@
1
+ import { RatingGroupItemContext } from "../modules/item-context.js";
2
+ import { useContext } from "react";
3
+
4
+ //#region src/components/rating-group/anatomy/item-context.tsx
5
+ function item_context_default(props) {
6
+ const itemContext = useContext(RatingGroupItemContext);
7
+ return props.children(itemContext);
8
+ }
9
+
10
+ //#endregion
11
+ export { item_context_default as default };
@@ -0,0 +1,29 @@
1
+ import { PropsWithElement } from "../../../internal/props-with-element.js";
2
+ import { ComponentProps, ReactNode } from "react";
3
+ import * as react_jsx_runtime20 from "react/jsx-runtime";
4
+ import { ItemProps } from "@zag-js/rating-group";
5
+
6
+ //#region src/components/rating-group/anatomy/item.d.ts
7
+ interface RatingGroupItemProps extends PropsWithElement, ItemProps, Omit<ComponentProps<'span'>, 'id' | 'defaultValue' | 'dir'> {
8
+ /**
9
+ * The content to render when the item is in the empty state.
10
+ *
11
+ * @default StarEmpty (SVG)
12
+ */
13
+ empty?: ReactNode;
14
+ /**
15
+ * The content to render when the item is in the half state.
16
+ *
17
+ * @default StarHalf (SVG)
18
+ */
19
+ half?: ReactNode;
20
+ /**
21
+ * The content to render when the item is in the full state.
22
+ *
23
+ * @default StarFull (SVG)
24
+ */
25
+ full?: ReactNode;
26
+ }
27
+ declare function export_default(props: RatingGroupItemProps): react_jsx_runtime20.JSX.Element;
28
+ //#endregion
29
+ export { RatingGroupItemProps, export_default };
@@ -0,0 +1,29 @@
1
+ import { RatingGroupRootContext } from "../modules/root-context.js";
2
+ import { RatingGroupItemContext } from "../modules/item-context.js";
3
+ import star_empty_default from "../../../internal/components/star-empty.js";
4
+ import star_half_default from "../../../internal/components/star-half.js";
5
+ import star_full_default from "../../../internal/components/star-full.js";
6
+ import { useContext } from "react";
7
+ import { mergeProps } from "@zag-js/react";
8
+ import { classesAccordion } from "@skeletonlabs/skeleton-common";
9
+ import { jsx } from "react/jsx-runtime";
10
+ import { splitItemProps } from "@zag-js/rating-group";
11
+
12
+ //#region src/components/rating-group/anatomy/item.tsx
13
+ function item_default(props) {
14
+ const rootContext = useContext(RatingGroupRootContext);
15
+ const [itemProps, componentProps] = splitItemProps(props);
16
+ const { element, children, empty = /* @__PURE__ */ jsx(star_empty_default, {}), half = /* @__PURE__ */ jsx(star_half_default, {}), full = /* @__PURE__ */ jsx(star_full_default, {}),...restAttributes } = componentProps;
17
+ const itemState = rootContext.api.getItemState(itemProps);
18
+ const attributes = mergeProps(rootContext.api.getItemProps(itemProps), { className: classesAccordion.item }, restAttributes);
19
+ return /* @__PURE__ */ jsx(RatingGroupItemContext.Provider, {
20
+ value: { itemState },
21
+ children: element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
22
+ ...attributes,
23
+ children: children ? children : !itemState.highlighted ? empty : itemState.half ? half : full
24
+ })
25
+ });
26
+ }
27
+
28
+ //#endregion
29
+ export { item_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_runtime18 from "react/jsx-runtime";
4
+
5
+ //#region src/components/rating-group/anatomy/label.d.ts
6
+ interface RatingGroupLabelProps extends PropsWithElement, Omit<ComponentProps<'label'>, 'id' | 'defaultValue' | 'dir'> {}
7
+ declare function export_default(props: RatingGroupLabelProps): react_jsx_runtime18.JSX.Element | null;
8
+ //#endregion
9
+ export { RatingGroupLabelProps, export_default };
@@ -0,0 +1,19 @@
1
+ import { RatingGroupRootContext } from "../modules/root-context.js";
2
+ import { useContext } from "react";
3
+ import { mergeProps } from "@zag-js/react";
4
+ import { classesRatingGroup } from "@skeletonlabs/skeleton-common";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/components/rating-group/anatomy/label.tsx
8
+ function label_default(props) {
9
+ const rootContext = useContext(RatingGroupRootContext);
10
+ const { element, children,...restAttributes } = props;
11
+ const attributes = mergeProps(rootContext.api.getLabelProps(), { className: classesRatingGroup.label }, restAttributes);
12
+ return element ? element({ attributes }) : /* @__PURE__ */ jsx("label", {
13
+ ...attributes,
14
+ children
15
+ });
16
+ }
17
+
18
+ //#endregion
19
+ export { label_default as default };
@@ -0,0 +1,10 @@
1
+ import { RatingGroupRootContextType } from "../modules/root-context.js";
2
+ import { ReactNode } from "react";
3
+
4
+ //#region src/components/rating-group/anatomy/root-context.d.ts
5
+ interface RatingGroupRootContextProps {
6
+ children: (context: RatingGroupRootContextType) => ReactNode;
7
+ }
8
+ declare function export_default(props: RatingGroupRootContextProps): ReactNode;
9
+ //#endregion
10
+ export { RatingGroupRootContextProps, export_default };
@@ -0,0 +1,11 @@
1
+ import { RatingGroupRootContext } from "../modules/root-context.js";
2
+ import { useContext } from "react";
3
+
4
+ //#region src/components/rating-group/anatomy/root-context.tsx
5
+ function root_context_default(props) {
6
+ const rootContext = useContext(RatingGroupRootContext);
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_runtime17 from "react/jsx-runtime";
4
+ import { Props } from "@zag-js/rating-group";
5
+
6
+ //#region src/components/rating-group/anatomy/root.d.ts
7
+ interface RatingGroupRootProps extends PropsWithElement, Omit<Props, 'id'>, Omit<ComponentProps<'div'>, 'id' | 'defaultValue' | 'dir'> {}
8
+ declare function export_default(props: RatingGroupRootProps): react_jsx_runtime17.JSX.Element;
9
+ //#endregion
10
+ export { RatingGroupRootProps, export_default };
@@ -0,0 +1,28 @@
1
+ import { RatingGroupRootContext } from "../modules/root-context.js";
2
+ import { useId } from "react";
3
+ import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
4
+ import { classesRatingGroup } from "@skeletonlabs/skeleton-common";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { connect, machine, splitProps } from "@zag-js/rating-group";
7
+
8
+ //#region src/components/rating-group/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: classesRatingGroup.root }, restAttributes);
18
+ return /* @__PURE__ */ jsx(RatingGroupRootContext.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 { RatingGroup } from "./modules/anatomy.js";
2
+
3
+ export { };
@@ -0,0 +1,19 @@
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/label.js";
4
+ import { export_default as export_default$3 } from "../anatomy/control.js";
5
+ import { export_default as export_default$4 } from "../anatomy/item.js";
6
+ import { export_default as export_default$5 } from "../anatomy/item-context.js";
7
+ import { export_default as export_default$6 } from "../anatomy/hidden-input.js";
8
+
9
+ //#region src/components/rating-group/modules/anatomy.d.ts
10
+ declare const RatingGroup: typeof export_default & {
11
+ Context: typeof export_default$1;
12
+ Label: typeof export_default$2;
13
+ Control: typeof export_default$3;
14
+ Item: typeof export_default$4;
15
+ ItemContext: typeof export_default$5;
16
+ HiddenInput: typeof export_default$6;
17
+ };
18
+ //#endregion
19
+ export { RatingGroup };
@@ -0,0 +1,20 @@
1
+ import root_default from "../anatomy/root.js";
2
+ import root_context_default from "../anatomy/root-context.js";
3
+ import label_default from "../anatomy/label.js";
4
+ import control_default from "../anatomy/control.js";
5
+ import item_default from "../anatomy/item.js";
6
+ import item_context_default from "../anatomy/item-context.js";
7
+ import hidden_input_default from "../anatomy/hidden-input.js";
8
+
9
+ //#region src/components/rating-group/modules/anatomy.ts
10
+ const RatingGroup = Object.assign(root_default, {
11
+ Context: root_context_default,
12
+ Label: label_default,
13
+ Control: control_default,
14
+ Item: item_default,
15
+ ItemContext: item_context_default,
16
+ HiddenInput: hidden_input_default
17
+ });
18
+
19
+ //#endregion
20
+ export { RatingGroup };
@@ -0,0 +1,9 @@
1
+ import "react";
2
+ import { ItemState } from "@zag-js/rating-group";
3
+
4
+ //#region src/components/rating-group/modules/item-context.d.ts
5
+ interface RatingGroupItemContextType {
6
+ itemState: ItemState;
7
+ }
8
+ //#endregion
9
+ export { RatingGroupItemContextType };
@@ -0,0 +1,7 @@
1
+ import { createContext } from "react";
2
+
3
+ //#region src/components/rating-group/modules/item-context.ts
4
+ const RatingGroupItemContext = createContext(null);
5
+
6
+ //#endregion
7
+ export { RatingGroupItemContext };
@@ -0,0 +1,9 @@
1
+ import "react";
2
+ import { Api } from "@zag-js/rating-group";
3
+
4
+ //#region src/components/rating-group/modules/root-context.d.ts
5
+ interface RatingGroupRootContextType {
6
+ api: Api;
7
+ }
8
+ //#endregion
9
+ export { RatingGroupRootContextType };
@@ -0,0 +1,7 @@
1
+ import { createContext } from "react";
2
+
3
+ //#region src/components/rating-group/modules/root-context.ts
4
+ const RatingGroupRootContext = createContext(null);
5
+
6
+ //#endregion
7
+ export { RatingGroupRootContext };
@@ -0,0 +1,10 @@
1
+ import { PropsWithElement } from "../../../internal/props-with-element.js";
2
+ import { ComponentProps } from "react";
3
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
4
+ import { ContentProps } from "@zag-js/tabs";
5
+
6
+ //#region src/components/tabs/anatomy/content.d.ts
7
+ interface TabsContentProps extends PropsWithElement, ContentProps, ComponentProps<'div'> {}
8
+ declare function export_default(props: TabsContentProps): react_jsx_runtime3.JSX.Element | null;
9
+ //#endregion
10
+ export { TabsContentProps, export_default };
@@ -0,0 +1,21 @@
1
+ import { TabsRootContext } from "../modules/root-context.js";
2
+ import { useContext } from "react";
3
+ import { mergeProps } from "@zag-js/react";
4
+ import { classesTabs } from "@skeletonlabs/skeleton-common";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { splitContentProps } from "@zag-js/tabs";
7
+
8
+ //#region src/components/tabs/anatomy/content.tsx
9
+ function content_default(props) {
10
+ const rootContext = useContext(TabsRootContext);
11
+ const [itemProps, componentProps] = splitContentProps(props);
12
+ const { element, children,...restAttributes } = componentProps;
13
+ const attributes = mergeProps(rootContext.api.getContentProps(itemProps), { className: classesTabs.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,9 @@
1
+ import { PropsWithElement } from "../../../internal/props-with-element.js";
2
+ import { ComponentProps } from "react";
3
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
4
+
5
+ //#region src/components/tabs/anatomy/indicator.d.ts
6
+ interface TabsIndicatorProps extends PropsWithElement, Omit<ComponentProps<'div'>, 'children'> {}
7
+ declare function export_default(props: TabsIndicatorProps): react_jsx_runtime2.JSX.Element | null;
8
+ //#endregion
9
+ export { TabsIndicatorProps, export_default };
@@ -0,0 +1,16 @@
1
+ import { TabsRootContext } from "../modules/root-context.js";
2
+ import { useContext } from "react";
3
+ import { mergeProps } from "@zag-js/react";
4
+ import { classesTabs } from "@skeletonlabs/skeleton-common";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/components/tabs/anatomy/indicator.tsx
8
+ function indicator_default(props) {
9
+ const rootContext = useContext(TabsRootContext);
10
+ const { element,...restAttributes } = props;
11
+ const attributes = mergeProps(rootContext.api.getIndicatorProps(), { className: classesTabs.indicator }, restAttributes);
12
+ return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", { ...attributes });
13
+ }
14
+
15
+ //#endregion
16
+ export { indicator_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_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/components/tabs/anatomy/list.d.ts
6
+ interface TabsListProps extends PropsWithElement, Omit<ComponentProps<'div'>, 'id' | 'defaultValue' | 'dir'> {}
7
+ declare function export_default(props: TabsListProps): react_jsx_runtime0.JSX.Element | null;
8
+ //#endregion
9
+ export { TabsListProps, export_default };
@@ -0,0 +1,19 @@
1
+ import { TabsRootContext } from "../modules/root-context.js";
2
+ import { useContext } from "react";
3
+ import { mergeProps } from "@zag-js/react";
4
+ import { classesTabs } from "@skeletonlabs/skeleton-common";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/components/tabs/anatomy/list.tsx
8
+ function list_default(props) {
9
+ const rootContext = useContext(TabsRootContext);
10
+ const { element, children,...restAttributes } = props;
11
+ const attributes = mergeProps(rootContext.api.getListProps(), { className: classesTabs.list }, restAttributes);
12
+ return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
13
+ ...attributes,
14
+ children
15
+ });
16
+ }
17
+
18
+ //#endregion
19
+ export { list_default as default };
@@ -0,0 +1,10 @@
1
+ import { TabsRootContextType } from "../modules/root-context.js";
2
+ import { ReactNode } from "react";
3
+
4
+ //#region src/components/tabs/anatomy/root-context.d.ts
5
+ interface TabsRootContextProps {
6
+ children: (context: TabsRootContextType) => ReactNode;
7
+ }
8
+ declare function export_default(props: TabsRootContextProps): ReactNode;
9
+ //#endregion
10
+ export { TabsRootContextProps, export_default };
@@ -0,0 +1,11 @@
1
+ import { TabsRootContext } from "../modules/root-context.js";
2
+ import { useContext } from "react";
3
+
4
+ //#region src/components/tabs/anatomy/root-context.tsx
5
+ function root_context_default(props) {
6
+ const rootContext = useContext(TabsRootContext);
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_runtime0 from "react/jsx-runtime";
4
+ import { Props } from "@zag-js/tabs";
5
+
6
+ //#region src/components/tabs/anatomy/root.d.ts
7
+ interface TabsRootProps extends PropsWithElement, Omit<Props, 'id'>, Omit<ComponentProps<'div'>, 'id' | 'defaultValue' | 'dir'> {}
8
+ declare function export_default(props: TabsRootProps): react_jsx_runtime0.JSX.Element;
9
+ //#endregion
10
+ export { TabsRootProps, export_default };
@@ -0,0 +1,28 @@
1
+ import { TabsRootContext } from "../modules/root-context.js";
2
+ import { useId } from "react";
3
+ import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
4
+ import { classesTabs } from "@skeletonlabs/skeleton-common";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { connect, machine, splitProps } from "@zag-js/tabs";
7
+
8
+ //#region src/components/tabs/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: classesTabs.root }, restAttributes);
18
+ return /* @__PURE__ */ jsx(TabsRootContext.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,10 @@
1
+ import { PropsWithElement } from "../../../internal/props-with-element.js";
2
+ import { ComponentProps } from "react";
3
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
4
+ import { TriggerProps } from "@zag-js/tabs";
5
+
6
+ //#region src/components/tabs/anatomy/trigger.d.ts
7
+ interface TabsTriggerProps extends PropsWithElement, TriggerProps, Omit<ComponentProps<'button'>, 'value'> {}
8
+ declare function export_default(props: TabsTriggerProps): react_jsx_runtime1.JSX.Element | null;
9
+ //#endregion
10
+ export { TabsTriggerProps, export_default };