@skeletonlabs/skeleton-react 2.0.0-next.3 → 2.0.0-next.4
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 +6 -4
- package/dist/components/accordion/anatomy/content.js +6 -6
- package/dist/components/accordion/anatomy/heading.d.ts +6 -4
- package/dist/components/accordion/anatomy/heading.js +3 -3
- package/dist/components/accordion/anatomy/indicator.d.ts +6 -4
- package/dist/components/accordion/anatomy/indicator.js +6 -6
- package/dist/components/accordion/anatomy/item.d.ts +5 -4
- package/dist/components/accordion/anatomy/item.js +6 -9
- package/dist/components/accordion/anatomy/root-context.d.ts +2 -2
- package/dist/components/accordion/anatomy/root-context.js +3 -2
- package/dist/components/accordion/anatomy/root-provider.d.ts +11 -0
- package/dist/components/accordion/anatomy/root.d.ts +4 -4
- package/dist/components/accordion/anatomy/root.js +9 -13
- package/dist/components/accordion/anatomy/trigger.d.ts +6 -4
- package/dist/components/accordion/anatomy/trigger.js +6 -6
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/modules/anatomy.d.ts +8 -10
- package/dist/components/accordion/modules/anatomy.js +0 -2
- package/dist/components/accordion/modules/root-context.js +2 -2
- package/dist/components/accordion/modules/use-accordion.d.ts +8 -0
- package/dist/components/accordion/modules/use-accordion.js +15 -0
- package/dist/components/avatar/anatomy/fallback.d.ts +5 -4
- package/dist/components/avatar/anatomy/fallback.js +5 -5
- package/dist/components/avatar/anatomy/image.d.ts +5 -4
- package/dist/components/avatar/anatomy/image.js +5 -5
- package/dist/components/avatar/anatomy/root-context.d.ts +2 -2
- package/dist/components/avatar/anatomy/root-context.js +3 -2
- package/dist/components/avatar/anatomy/root-provider.d.ts +11 -0
- package/dist/components/avatar/anatomy/root.d.ts +4 -4
- package/dist/components/avatar/anatomy/root.js +9 -13
- package/dist/components/avatar/modules/root-context.js +2 -2
- package/dist/components/avatar/modules/use-avatar.d.ts +8 -0
- package/dist/components/avatar/modules/use-avatar.js +15 -0
- package/dist/components/progress-linear/anatomy/label.d.ts +5 -4
- package/dist/components/progress-linear/anatomy/label.js +5 -5
- package/dist/components/progress-linear/anatomy/range.d.ts +5 -4
- package/dist/components/progress-linear/anatomy/range.js +5 -5
- package/dist/components/progress-linear/anatomy/root-context.d.ts +2 -2
- package/dist/components/progress-linear/anatomy/root-context.js +3 -2
- package/dist/components/progress-linear/anatomy/root-provider.d.ts +12 -0
- package/dist/components/progress-linear/anatomy/root-provider.js +20 -0
- package/dist/components/progress-linear/anatomy/root.d.ts +4 -4
- package/dist/components/progress-linear/anatomy/root.js +9 -13
- package/dist/components/progress-linear/anatomy/track.d.ts +5 -4
- package/dist/components/progress-linear/anatomy/track.js +5 -5
- package/dist/components/progress-linear/index.js +1 -0
- package/dist/components/progress-linear/modules/anatomy.d.ts +10 -8
- package/dist/components/progress-linear/modules/anatomy.js +2 -0
- package/dist/components/progress-linear/modules/root-context.js +2 -2
- package/dist/components/progress-linear/modules/use-progress-linear.d.ts +8 -0
- package/dist/components/progress-linear/modules/use-progress-linear.js +15 -0
- package/dist/components/rating-group/anatomy/control.d.ts +5 -4
- package/dist/components/rating-group/anatomy/control.js +5 -5
- package/dist/components/rating-group/anatomy/hidden-input.d.ts +5 -4
- package/dist/components/rating-group/anatomy/hidden-input.js +5 -5
- package/dist/components/rating-group/anatomy/item.d.ts +6 -4
- package/dist/components/rating-group/anatomy/item.js +8 -12
- package/dist/components/rating-group/anatomy/label.d.ts +5 -4
- package/dist/components/rating-group/anatomy/label.js +5 -5
- package/dist/components/rating-group/anatomy/root-context.d.ts +2 -2
- package/dist/components/rating-group/anatomy/root-context.js +3 -2
- package/dist/components/rating-group/anatomy/root-provider.d.ts +12 -0
- package/dist/components/rating-group/anatomy/root-provider.js +20 -0
- package/dist/components/rating-group/anatomy/root.d.ts +4 -4
- package/dist/components/rating-group/anatomy/root.js +9 -13
- package/dist/components/rating-group/index.js +1 -0
- package/dist/components/rating-group/modules/anatomy.d.ts +10 -10
- package/dist/components/rating-group/modules/anatomy.js +2 -2
- package/dist/components/rating-group/modules/root-context.js +2 -2
- package/dist/components/rating-group/modules/use-rating-group.d.ts +8 -0
- package/dist/components/rating-group/modules/use-rating-group.js +15 -0
- package/dist/components/switch/anatomy/control.d.ts +10 -0
- package/dist/components/switch/anatomy/control.js +19 -0
- package/dist/components/switch/anatomy/hidden-input.d.ts +10 -0
- package/dist/components/switch/anatomy/hidden-input.js +16 -0
- package/dist/components/switch/anatomy/label.d.ts +10 -0
- package/dist/components/switch/anatomy/label.js +19 -0
- package/dist/components/switch/anatomy/root-context.d.ts +10 -0
- package/dist/components/switch/anatomy/root-context.js +12 -0
- package/dist/components/switch/anatomy/root-provider.d.ts +11 -0
- package/dist/components/switch/anatomy/root.d.ts +10 -0
- package/dist/components/switch/anatomy/root.js +24 -0
- package/dist/components/switch/anatomy/thumb.d.ts +10 -0
- package/dist/components/switch/anatomy/thumb.js +19 -0
- package/dist/components/switch/index.js +4 -0
- package/dist/components/switch/modules/anatomy.d.ts +17 -0
- package/dist/components/switch/modules/anatomy.js +18 -0
- package/dist/components/switch/modules/root-context.js +7 -0
- package/dist/components/switch/modules/use-switch.d.ts +8 -0
- package/dist/components/switch/modules/use-switch.js +15 -0
- package/dist/components/tabs/anatomy/content.d.ts +5 -4
- package/dist/components/tabs/anatomy/content.js +6 -6
- package/dist/components/tabs/anatomy/indicator.d.ts +5 -4
- package/dist/components/tabs/anatomy/indicator.js +5 -5
- package/dist/components/tabs/anatomy/list.d.ts +5 -4
- package/dist/components/tabs/anatomy/list.js +5 -5
- package/dist/components/tabs/anatomy/root-context.d.ts +2 -2
- package/dist/components/tabs/anatomy/root-context.js +3 -2
- package/dist/components/tabs/anatomy/root-provider.d.ts +12 -0
- package/dist/components/tabs/anatomy/root-provider.js +20 -0
- package/dist/components/tabs/anatomy/root.d.ts +4 -4
- package/dist/components/tabs/anatomy/root.js +9 -13
- package/dist/components/tabs/anatomy/trigger.d.ts +5 -4
- package/dist/components/tabs/anatomy/trigger.js +6 -6
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/tabs/modules/anatomy.d.ts +12 -10
- package/dist/components/tabs/modules/anatomy.js +2 -0
- package/dist/components/tabs/modules/root-context.js +2 -2
- package/dist/components/tabs/modules/use-tabs.d.ts +8 -0
- package/dist/components/tabs/modules/use-tabs.js +15 -0
- package/dist/components/toast/anatomy/action-trigger.d.ts +10 -0
- package/dist/components/toast/anatomy/action-trigger.js +19 -0
- package/dist/components/toast/anatomy/close-trigger.d.ts +10 -0
- package/dist/components/toast/anatomy/close-trigger.js +20 -0
- package/dist/components/toast/anatomy/description.d.ts +10 -0
- package/dist/components/toast/anatomy/description.js +19 -0
- package/dist/components/toast/anatomy/group.d.ts +14 -0
- package/dist/components/toast/anatomy/group.js +27 -0
- package/dist/components/toast/anatomy/message.d.ts +10 -0
- package/dist/components/toast/anatomy/message.js +16 -0
- package/dist/components/toast/anatomy/root-context.d.ts +10 -0
- package/dist/components/toast/anatomy/root-context.js +12 -0
- package/dist/components/toast/anatomy/root.d.ts +12 -0
- package/dist/components/toast/anatomy/root.js +57 -0
- package/dist/components/toast/anatomy/title.d.ts +10 -0
- package/dist/components/toast/anatomy/title.js +19 -0
- package/dist/components/toast/index.d.ts +10 -0
- package/dist/components/toast/index.js +4 -0
- package/dist/components/toast/modules/anatomy.d.ts +21 -0
- package/dist/components/toast/modules/anatomy.js +22 -0
- package/dist/components/toast/modules/group-context.js +7 -0
- package/dist/components/toast/modules/root-context.js +7 -0
- package/dist/index.d.ts +27 -10
- package/dist/index.js +10 -1
- package/dist/internal/components/x.js +20 -0
- package/dist/internal/create-context.js +9 -0
- package/dist/internal/html-attributes.d.ts +6 -0
- package/dist/internal/props-with-element.d.ts +4 -5
- package/package.json +15 -15
- package/dist/components/accordion/anatomy/item-context.d.ts +0 -10
- package/dist/components/accordion/anatomy/item-context.js +0 -11
- package/dist/components/accordion/modules/item-context.d.ts +0 -10
- package/dist/components/accordion/modules/root-context.d.ts +0 -9
- package/dist/components/avatar/modules/root-context.d.ts +0 -9
- package/dist/components/progress-linear/modules/root-context.d.ts +0 -9
- package/dist/components/rating-group/anatomy/item-context.d.ts +0 -10
- package/dist/components/rating-group/anatomy/item-context.js +0 -11
- package/dist/components/rating-group/modules/item-context.d.ts +0 -9
- package/dist/components/rating-group/modules/item-context.js +0 -7
- package/dist/components/rating-group/modules/root-context.d.ts +0 -9
- package/dist/components/tabs/modules/root-context.d.ts +0 -9
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { export_default } from "../anatomy/root.js";
|
|
2
|
-
import { export_default as export_default$1 } from "../anatomy/root-
|
|
3
|
-
import { export_default as export_default$2 } from "../anatomy/
|
|
4
|
-
import { export_default as export_default$3 } from "../anatomy/
|
|
5
|
-
import { export_default as export_default$4 } from "../anatomy/
|
|
6
|
-
import { export_default as export_default$5 } from "../anatomy/item
|
|
2
|
+
import { export_default as export_default$1 } from "../anatomy/root-provider.js";
|
|
3
|
+
import { export_default as export_default$2 } from "../anatomy/root-context.js";
|
|
4
|
+
import { export_default as export_default$3 } from "../anatomy/label.js";
|
|
5
|
+
import { export_default as export_default$4 } from "../anatomy/control.js";
|
|
6
|
+
import { export_default as export_default$5 } from "../anatomy/item.js";
|
|
7
7
|
import { export_default as export_default$6 } from "../anatomy/hidden-input.js";
|
|
8
8
|
|
|
9
9
|
//#region src/components/rating-group/modules/anatomy.d.ts
|
|
10
10
|
declare const RatingGroup: typeof export_default & {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
Provider: typeof export_default$1;
|
|
12
|
+
Context: typeof export_default$2;
|
|
13
|
+
Label: typeof export_default$3;
|
|
14
|
+
Control: typeof export_default$4;
|
|
15
|
+
Item: typeof export_default$5;
|
|
16
16
|
HiddenInput: typeof export_default$6;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import root_default from "../anatomy/root.js";
|
|
2
|
+
import root_provider_default from "../anatomy/root-provider.js";
|
|
2
3
|
import root_context_default from "../anatomy/root-context.js";
|
|
3
4
|
import label_default from "../anatomy/label.js";
|
|
4
5
|
import control_default from "../anatomy/control.js";
|
|
5
6
|
import item_default from "../anatomy/item.js";
|
|
6
|
-
import item_context_default from "../anatomy/item-context.js";
|
|
7
7
|
import hidden_input_default from "../anatomy/hidden-input.js";
|
|
8
8
|
|
|
9
9
|
//#region src/components/rating-group/modules/anatomy.ts
|
|
10
10
|
const RatingGroup = Object.assign(root_default, {
|
|
11
|
+
Provider: root_provider_default,
|
|
11
12
|
Context: root_context_default,
|
|
12
13
|
Label: label_default,
|
|
13
14
|
Control: control_default,
|
|
14
15
|
Item: item_default,
|
|
15
|
-
ItemContext: item_context_default,
|
|
16
16
|
HiddenInput: hidden_input_default
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createContext } from "
|
|
1
|
+
import { createContext } from "../../../internal/create-context.js";
|
|
2
2
|
|
|
3
3
|
//#region src/components/rating-group/modules/root-context.ts
|
|
4
|
-
const RatingGroupRootContext = createContext(
|
|
4
|
+
const RatingGroupRootContext = createContext();
|
|
5
5
|
|
|
6
6
|
//#endregion
|
|
7
7
|
export { RatingGroupRootContext };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _zag_js_react0 from "@zag-js/react";
|
|
2
|
+
import * as _zag_js_rating_group0 from "@zag-js/rating-group";
|
|
3
|
+
import { Props } from "@zag-js/rating-group";
|
|
4
|
+
|
|
5
|
+
//#region src/components/rating-group/modules/use-rating-group.d.ts
|
|
6
|
+
declare function useRatingGroup(props: Omit<Props, 'id'>): _zag_js_rating_group0.Api<_zag_js_react0.PropTypes>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { useRatingGroup };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { normalizeProps, useMachine } from "@zag-js/react";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { connect, machine } from "@zag-js/rating-group";
|
|
4
|
+
|
|
5
|
+
//#region src/components/rating-group/modules/use-rating-group.ts
|
|
6
|
+
function useRatingGroup(props) {
|
|
7
|
+
const service = useMachine(machine, {
|
|
8
|
+
id: useId(),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
return connect(service, normalizeProps);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { useRatingGroup };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react107 from "react";
|
|
4
|
+
import * as react_jsx_runtime34 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/switch/anatomy/control.d.ts
|
|
7
|
+
interface SwitchControlProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {}
|
|
8
|
+
declare function export_default(props: SwitchControlProps): string | number | bigint | boolean | Iterable<react107.ReactNode> | Promise<string | number | bigint | boolean | react107.ReactPortal | react107.ReactElement<unknown, string | react107.JSXElementConstructor<any>> | Iterable<react107.ReactNode> | null | undefined> | react_jsx_runtime34.JSX.Element | null | undefined;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SwitchControlProps, export_default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SwitchRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { mergeProps } from "@zag-js/react";
|
|
3
|
+
import { classesSwitch } from "@skeletonlabs/skeleton-common";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/switch/anatomy/control.tsx
|
|
8
|
+
function control_default(props) {
|
|
9
|
+
const switch_ = useContext(SwitchRootContext);
|
|
10
|
+
const { element, children,...rest } = props;
|
|
11
|
+
const attributes = mergeProps(switch_.getControlProps(), rest, { className: classesSwitch.control });
|
|
12
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("span", {
|
|
13
|
+
...attributes,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { control_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react102 from "react";
|
|
4
|
+
import * as react_jsx_runtime33 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/switch/anatomy/hidden-input.d.ts
|
|
7
|
+
interface SwitchHiddenInputProps extends PropsWithElement<'input'>, HTMLAttributes<'input', 'children'> {}
|
|
8
|
+
declare function export_default(props: SwitchHiddenInputProps): string | number | bigint | boolean | Iterable<react102.ReactNode> | Promise<string | number | bigint | boolean | react102.ReactPortal | react102.ReactElement<unknown, string | react102.JSXElementConstructor<any>> | Iterable<react102.ReactNode> | null | undefined> | react_jsx_runtime33.JSX.Element | null | undefined;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SwitchHiddenInputProps, export_default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SwitchRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { mergeProps } from "@zag-js/react";
|
|
3
|
+
import { classesSwitch } from "@skeletonlabs/skeleton-common";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/switch/anatomy/hidden-input.tsx
|
|
8
|
+
function hidden_input_default(props) {
|
|
9
|
+
const switch_ = useContext(SwitchRootContext);
|
|
10
|
+
const { element,...rest } = props;
|
|
11
|
+
const attributes = mergeProps(switch_.getHiddenInputProps(), rest, { className: classesSwitch.hiddenInput });
|
|
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 { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react117 from "react";
|
|
4
|
+
import * as react_jsx_runtime36 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/switch/anatomy/label.d.ts
|
|
7
|
+
interface SwitchLabelProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {}
|
|
8
|
+
declare function export_default(props: SwitchLabelProps): string | number | bigint | boolean | Iterable<react117.ReactNode> | Promise<string | number | bigint | boolean | react117.ReactPortal | react117.ReactElement<unknown, string | react117.JSXElementConstructor<any>> | Iterable<react117.ReactNode> | null | undefined> | react_jsx_runtime36.JSX.Element | null | undefined;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SwitchLabelProps, export_default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SwitchRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { mergeProps } from "@zag-js/react";
|
|
3
|
+
import { classesSwitch } from "@skeletonlabs/skeleton-common";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/switch/anatomy/label.tsx
|
|
8
|
+
function label_default(props) {
|
|
9
|
+
const switch_ = useContext(SwitchRootContext);
|
|
10
|
+
const { element, children,...rest } = props;
|
|
11
|
+
const attributes = mergeProps(switch_.getLabelProps(), rest, { className: classesSwitch.label });
|
|
12
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("span", {
|
|
13
|
+
...attributes,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { label_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useSwitch } from "../modules/use-switch.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/switch/anatomy/root-context.d.ts
|
|
5
|
+
interface SwitchRootContextProps {
|
|
6
|
+
children: (switch_: ReturnType<typeof useSwitch>) => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function export_default(props: SwitchRootContextProps): ReactNode;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SwitchRootContextProps, export_default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SwitchRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/switch/anatomy/root-context.tsx
|
|
5
|
+
function root_context_default(props) {
|
|
6
|
+
const switch_ = useContext(SwitchRootContext);
|
|
7
|
+
const { children } = props;
|
|
8
|
+
return children(switch_);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { root_context_default as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import { useSwitch } from "../modules/use-switch.js";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/switch/anatomy/root-provider.d.ts
|
|
7
|
+
interface SwitchRootProviderProps extends PropsWithElement<'label'>, HTMLAttributes<'label', 'id' | 'dir'> {
|
|
8
|
+
value: ReturnType<typeof useSwitch>;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { SwitchRootProviderProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react_jsx_runtime39 from "react/jsx-runtime";
|
|
4
|
+
import { Props } from "@zag-js/switch";
|
|
5
|
+
|
|
6
|
+
//#region src/components/switch/anatomy/root.d.ts
|
|
7
|
+
interface SwitchRootProps extends Omit<Props, 'id'>, PropsWithElement<'label'>, HTMLAttributes<'label', 'id' | 'dir'> {}
|
|
8
|
+
declare function export_default(props: SwitchRootProps): react_jsx_runtime39.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { export_default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SwitchRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useSwitch } from "../modules/use-switch.js";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
|
+
import { classesSwitch } from "@skeletonlabs/skeleton-common";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { splitProps } from "@zag-js/switch";
|
|
7
|
+
|
|
8
|
+
//#region src/components/switch/anatomy/root.tsx
|
|
9
|
+
function root_default(props) {
|
|
10
|
+
const [switchProps, componentProps] = splitProps(props);
|
|
11
|
+
const { element, children,...rest } = componentProps;
|
|
12
|
+
const switch_ = useSwitch(switchProps);
|
|
13
|
+
const attributes = mergeProps(switch_.getRootProps(), rest, { className: classesSwitch.root });
|
|
14
|
+
return /* @__PURE__ */ jsx(SwitchRootContext.Provider, {
|
|
15
|
+
value: switch_,
|
|
16
|
+
children: element ? element(attributes) : /* @__PURE__ */ jsx("label", {
|
|
17
|
+
...attributes,
|
|
18
|
+
children
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { root_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react112 from "react";
|
|
4
|
+
import * as react_jsx_runtime35 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/switch/anatomy/thumb.d.ts
|
|
7
|
+
interface SwitchThumbProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {}
|
|
8
|
+
declare function export_default(props: SwitchThumbProps): string | number | bigint | boolean | Iterable<react112.ReactNode> | Promise<string | number | bigint | boolean | react112.ReactPortal | react112.ReactElement<unknown, string | react112.JSXElementConstructor<any>> | Iterable<react112.ReactNode> | null | undefined> | react_jsx_runtime35.JSX.Element | null | undefined;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SwitchThumbProps, export_default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SwitchRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { mergeProps } from "@zag-js/react";
|
|
3
|
+
import { classesSwitch } from "@skeletonlabs/skeleton-common";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/switch/anatomy/thumb.tsx
|
|
8
|
+
function thumb_default(props) {
|
|
9
|
+
const switch_ = useContext(SwitchRootContext);
|
|
10
|
+
const { element, children,...rest } = props;
|
|
11
|
+
const attributes = mergeProps(switch_.getThumbProps(), rest, { className: classesSwitch.thumb });
|
|
12
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("span", {
|
|
13
|
+
...attributes,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { thumb_default as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
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/control.js";
|
|
4
|
+
import { export_default as export_default$3 } from "../anatomy/thumb.js";
|
|
5
|
+
import { export_default as export_default$4 } from "../anatomy/label.js";
|
|
6
|
+
import { export_default as export_default$5 } from "../anatomy/hidden-input.js";
|
|
7
|
+
|
|
8
|
+
//#region src/components/switch/modules/anatomy.d.ts
|
|
9
|
+
declare const Switch: typeof export_default & {
|
|
10
|
+
Context: typeof export_default$1;
|
|
11
|
+
Control: typeof export_default$2;
|
|
12
|
+
Thumb: typeof export_default$3;
|
|
13
|
+
Label: typeof export_default$4;
|
|
14
|
+
HiddenInput: typeof export_default$5;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Switch };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import root_default from "../anatomy/root.js";
|
|
2
|
+
import root_context_default from "../anatomy/root-context.js";
|
|
3
|
+
import control_default from "../anatomy/control.js";
|
|
4
|
+
import thumb_default from "../anatomy/thumb.js";
|
|
5
|
+
import label_default from "../anatomy/label.js";
|
|
6
|
+
import hidden_input_default from "../anatomy/hidden-input.js";
|
|
7
|
+
|
|
8
|
+
//#region src/components/switch/modules/anatomy.ts
|
|
9
|
+
const Switch = Object.assign(root_default, {
|
|
10
|
+
Context: root_context_default,
|
|
11
|
+
Control: control_default,
|
|
12
|
+
Thumb: thumb_default,
|
|
13
|
+
Label: label_default,
|
|
14
|
+
HiddenInput: hidden_input_default
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Switch };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _zag_js_react3 from "@zag-js/react";
|
|
2
|
+
import * as _zag_js_switch0 from "@zag-js/switch";
|
|
3
|
+
import { Props } from "@zag-js/switch";
|
|
4
|
+
|
|
5
|
+
//#region src/components/switch/modules/use-switch.d.ts
|
|
6
|
+
declare function useSwitch(props: Omit<Props, 'id'>): _zag_js_switch0.Api<_zag_js_react3.PropTypes>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { useSwitch };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { normalizeProps, useMachine } from "@zag-js/react";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { connect, machine } from "@zag-js/switch";
|
|
4
|
+
|
|
5
|
+
//#region src/components/switch/modules/use-switch.ts
|
|
6
|
+
function useSwitch(props) {
|
|
7
|
+
const service = useMachine(machine, {
|
|
8
|
+
id: useId(),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
return connect(service, normalizeProps);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { useSwitch };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
1
2
|
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
3
|
+
import * as react62 from "react";
|
|
4
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
4
5
|
import { ContentProps } from "@zag-js/tabs";
|
|
5
6
|
|
|
6
7
|
//#region src/components/tabs/anatomy/content.d.ts
|
|
7
|
-
interface TabsContentProps extends
|
|
8
|
-
declare function export_default(props: TabsContentProps):
|
|
8
|
+
interface TabsContentProps extends ContentProps, PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
9
|
+
declare function export_default(props: TabsContentProps): string | number | bigint | boolean | Iterable<react62.ReactNode> | Promise<string | number | bigint | boolean | react62.ReactPortal | react62.ReactElement<unknown, string | react62.JSXElementConstructor<any>> | Iterable<react62.ReactNode> | null | undefined> | react_jsx_runtime20.JSX.Element | null | undefined;
|
|
9
10
|
//#endregion
|
|
10
11
|
export { TabsContentProps, export_default };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { TabsRootContext } from "../modules/root-context.js";
|
|
2
|
-
import { useContext } from "react";
|
|
3
2
|
import { mergeProps } from "@zag-js/react";
|
|
4
3
|
import { classesTabs } from "@skeletonlabs/skeleton-common";
|
|
4
|
+
import { useContext } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { splitContentProps } from "@zag-js/tabs";
|
|
7
7
|
|
|
8
8
|
//#region src/components/tabs/anatomy/content.tsx
|
|
9
9
|
function content_default(props) {
|
|
10
|
-
const
|
|
11
|
-
const [
|
|
12
|
-
const { element, children,...
|
|
13
|
-
const attributes = mergeProps(
|
|
14
|
-
return element ? element(
|
|
10
|
+
const tabs = useContext(TabsRootContext);
|
|
11
|
+
const [contentProps, componentProps] = splitContentProps(props);
|
|
12
|
+
const { element, children,...rest } = componentProps;
|
|
13
|
+
const attributes = mergeProps(tabs.getContentProps(contentProps), rest, { className: classesTabs.content });
|
|
14
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("div", {
|
|
15
15
|
...attributes,
|
|
16
16
|
children
|
|
17
17
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
1
2
|
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
3
|
+
import * as react67 from "react";
|
|
4
|
+
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
4
5
|
|
|
5
6
|
//#region src/components/tabs/anatomy/indicator.d.ts
|
|
6
|
-
interface TabsIndicatorProps extends PropsWithElement
|
|
7
|
-
declare function export_default(props: TabsIndicatorProps):
|
|
7
|
+
interface TabsIndicatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'children'> {}
|
|
8
|
+
declare function export_default(props: TabsIndicatorProps): string | number | bigint | boolean | Iterable<react67.ReactNode> | Promise<string | number | bigint | boolean | react67.ReactPortal | react67.ReactElement<unknown, string | react67.JSXElementConstructor<any>> | Iterable<react67.ReactNode> | null | undefined> | react_jsx_runtime21.JSX.Element | null | undefined;
|
|
8
9
|
//#endregion
|
|
9
10
|
export { TabsIndicatorProps, export_default };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { TabsRootContext } from "../modules/root-context.js";
|
|
2
|
-
import { useContext } from "react";
|
|
3
2
|
import { mergeProps } from "@zag-js/react";
|
|
4
3
|
import { classesTabs } from "@skeletonlabs/skeleton-common";
|
|
4
|
+
import { useContext } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/tabs/anatomy/indicator.tsx
|
|
8
8
|
function indicator_default(props) {
|
|
9
|
-
const
|
|
10
|
-
const { element,...
|
|
11
|
-
const attributes = mergeProps(
|
|
12
|
-
return element ? element(
|
|
9
|
+
const tabs = useContext(TabsRootContext);
|
|
10
|
+
const { element,...rest } = props;
|
|
11
|
+
const attributes = mergeProps(tabs.getIndicatorProps(), rest, { className: classesTabs.indicator });
|
|
12
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("div", { ...attributes });
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
1
2
|
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
3
|
+
import * as react49 from "react";
|
|
4
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
4
5
|
|
|
5
6
|
//#region src/components/tabs/anatomy/list.d.ts
|
|
6
|
-
interface TabsListProps extends PropsWithElement
|
|
7
|
-
declare function export_default(props: TabsListProps):
|
|
7
|
+
interface TabsListProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {}
|
|
8
|
+
declare function export_default(props: TabsListProps): string | number | bigint | boolean | Iterable<react49.ReactNode> | Promise<string | number | bigint | boolean | react49.ReactPortal | react49.ReactElement<unknown, string | react49.JSXElementConstructor<any>> | Iterable<react49.ReactNode> | null | undefined> | react_jsx_runtime17.JSX.Element | null | undefined;
|
|
8
9
|
//#endregion
|
|
9
10
|
export { TabsListProps, export_default };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { TabsRootContext } from "../modules/root-context.js";
|
|
2
|
-
import { useContext } from "react";
|
|
3
2
|
import { mergeProps } from "@zag-js/react";
|
|
4
3
|
import { classesTabs } from "@skeletonlabs/skeleton-common";
|
|
4
|
+
import { useContext } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/tabs/anatomy/list.tsx
|
|
8
8
|
function list_default(props) {
|
|
9
|
-
const
|
|
10
|
-
const { element, children,...
|
|
11
|
-
const attributes = mergeProps(
|
|
12
|
-
return element ? element(
|
|
9
|
+
const tabs = useContext(TabsRootContext);
|
|
10
|
+
const { element, children,...rest } = props;
|
|
11
|
+
const attributes = mergeProps(tabs.getListProps(), rest, { className: classesTabs.list });
|
|
12
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("div", {
|
|
13
13
|
...attributes,
|
|
14
14
|
children
|
|
15
15
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useTabs } from "../modules/use-tabs.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tabs/anatomy/root-context.d.ts
|
|
5
5
|
interface TabsRootContextProps {
|
|
6
|
-
children: (
|
|
6
|
+
children: (tabs: ReturnType<typeof useTabs>) => ReactNode;
|
|
7
7
|
}
|
|
8
8
|
declare function export_default(props: TabsRootContextProps): ReactNode;
|
|
9
9
|
//#endregion
|
|
@@ -3,8 +3,9 @@ import { useContext } from "react";
|
|
|
3
3
|
|
|
4
4
|
//#region src/components/tabs/anatomy/root-context.tsx
|
|
5
5
|
function root_context_default(props) {
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const tabs = useContext(TabsRootContext);
|
|
7
|
+
const { children } = props;
|
|
8
|
+
return children(tabs);
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import { useTabs } from "../modules/use-tabs.js";
|
|
4
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/tabs/anatomy/root-provider.d.ts
|
|
7
|
+
interface TabsRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir' | 'defaultValue'> {
|
|
8
|
+
value: ReturnType<typeof useTabs>;
|
|
9
|
+
}
|
|
10
|
+
declare function export_default(props: TabsRootProviderProps): react_jsx_runtime16.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { TabsRootProviderProps, export_default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TabsRootContext } from "../modules/root-context.js";
|
|
2
|
+
import { mergeProps } from "@zag-js/react";
|
|
3
|
+
import { classesTabs } from "@skeletonlabs/skeleton-common";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/tabs/anatomy/root-provider.tsx
|
|
7
|
+
function root_provider_default(props) {
|
|
8
|
+
const { element, children, value: tabs,...rest } = props;
|
|
9
|
+
const attributes = mergeProps(tabs.getRootProps(), rest, { className: classesTabs.root });
|
|
10
|
+
return /* @__PURE__ */ jsx(TabsRootContext.Provider, {
|
|
11
|
+
value: tabs,
|
|
12
|
+
children: element ? element(attributes) : /* @__PURE__ */ jsx("div", {
|
|
13
|
+
...attributes,
|
|
14
|
+
children
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { root_provider_default as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
1
2
|
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
-
import
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
4
4
|
import { Props } from "@zag-js/tabs";
|
|
5
5
|
|
|
6
6
|
//#region src/components/tabs/anatomy/root.d.ts
|
|
7
|
-
interface TabsRootProps extends
|
|
8
|
-
declare function export_default(props: TabsRootProps):
|
|
7
|
+
interface TabsRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir' | 'defaultValue'> {}
|
|
8
|
+
declare function export_default(props: TabsRootProps): react_jsx_runtime15.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { TabsRootProps, export_default };
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import { TabsRootContext } from "../modules/root-context.js";
|
|
2
|
-
import {
|
|
3
|
-
import { mergeProps
|
|
2
|
+
import { useTabs } from "../modules/use-tabs.js";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
4
|
import { classesTabs } from "@skeletonlabs/skeleton-common";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
6
|
+
import { splitProps } from "@zag-js/tabs";
|
|
7
7
|
|
|
8
8
|
//#region src/components/tabs/anatomy/root.tsx
|
|
9
9
|
function root_default(props) {
|
|
10
|
-
const [
|
|
11
|
-
const { element, children,...
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
...machineProps
|
|
15
|
-
});
|
|
16
|
-
const api = connect(service, normalizeProps);
|
|
17
|
-
const attributes = mergeProps(api.getRootProps(), { className: classesTabs.root }, restAttributes);
|
|
10
|
+
const [tabsProps, componentProps] = splitProps(props);
|
|
11
|
+
const { element, children,...rest } = componentProps;
|
|
12
|
+
const tabs = useTabs(tabsProps);
|
|
13
|
+
const attributes = mergeProps(tabs.getRootProps(), rest, { className: classesTabs.root });
|
|
18
14
|
return /* @__PURE__ */ jsx(TabsRootContext.Provider, {
|
|
19
|
-
value:
|
|
20
|
-
children: element ? element(
|
|
15
|
+
value: tabs,
|
|
16
|
+
children: element ? element(attributes) : /* @__PURE__ */ jsx("div", {
|
|
21
17
|
...attributes,
|
|
22
18
|
children
|
|
23
19
|
})
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
1
2
|
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
3
|
+
import * as react54 from "react";
|
|
4
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
4
5
|
import { TriggerProps } from "@zag-js/tabs";
|
|
5
6
|
|
|
6
7
|
//#region src/components/tabs/anatomy/trigger.d.ts
|
|
7
|
-
interface TabsTriggerProps extends
|
|
8
|
-
declare function export_default(props: TabsTriggerProps):
|
|
8
|
+
interface TabsTriggerProps extends TriggerProps, PropsWithElement<'button'>, HTMLAttributes<'button', 'value'> {}
|
|
9
|
+
declare function export_default(props: TabsTriggerProps): string | number | bigint | boolean | Iterable<react54.ReactNode> | Promise<string | number | bigint | boolean | react54.ReactPortal | react54.ReactElement<unknown, string | react54.JSXElementConstructor<any>> | Iterable<react54.ReactNode> | null | undefined> | react_jsx_runtime18.JSX.Element | null | undefined;
|
|
9
10
|
//#endregion
|
|
10
11
|
export { TabsTriggerProps, export_default };
|