@skeletonlabs/skeleton-react 1.4.0 → 1.5.0-next.0

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.
@@ -2,13 +2,14 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useContext } from 'react';
4
4
  import { mergeProps } from '@zag-js/react';
5
+ import { classesAccordion } from '@skeletonlabs/skeleton-common';
5
6
  import { AccordionRootContext, AccordionItemContext } from '../modules/context.js';
6
7
  export default function (props) {
7
8
  const rootContext = useContext(AccordionRootContext);
8
9
  const itemContext = useContext(AccordionItemContext);
9
10
  const { element, children, ...restAttributes } = props;
10
11
  const attributes = mergeProps(rootContext.api.getItemContentProps(itemContext.itemProps), {
11
- className: 'skb:py-2 skb:px-4'
12
+ className: classesAccordion.content
12
13
  }, restAttributes);
13
14
  return element ? element({ attributes }) : _jsx("div", { ...attributes, children: children });
14
15
  }
@@ -1,6 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { mergeProps } from '@zag-js/react';
3
+ import { classesAccordion } from '@skeletonlabs/skeleton-common';
2
4
  export default function (props) {
3
5
  const { level = 3, element, children, ...restAttributes } = props;
4
6
  const Tag = `h${level}`;
5
- return element ? element({ attributes: restAttributes }) : _jsx(Tag, { ...restAttributes, children: children });
7
+ const attributes = mergeProps({
8
+ className: classesAccordion.heading
9
+ }, restAttributes);
10
+ return element ? element({ attributes }) : _jsx(Tag, { ...attributes, children: children });
6
11
  }
@@ -1,11 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { mergeProps } from '@zag-js/react';
3
3
  import { useContext } from 'react';
4
+ import { classesAccordion } from '@skeletonlabs/skeleton-common';
4
5
  import { AccordionRootContext, AccordionItemContext } from '../modules/context.js';
5
6
  export default function (props) {
6
7
  const rootContext = useContext(AccordionRootContext);
7
8
  const itemContext = useContext(AccordionItemContext);
8
9
  const { element, children, ...restAttributes } = props;
9
- const attributes = mergeProps(rootContext.api.getItemIndicatorProps(itemContext.itemProps), restAttributes);
10
+ const attributes = mergeProps(rootContext.api.getItemIndicatorProps(itemContext.itemProps), {
11
+ class: classesAccordion.indicator
12
+ }, restAttributes);
10
13
  return element ? element({ attributes }) : _jsx("div", { ...attributes, children: children });
11
14
  }
@@ -3,11 +3,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useContext } from 'react';
4
4
  import * as accordion from '@zag-js/accordion';
5
5
  import { mergeProps } from '@zag-js/react';
6
+ import { classesAccordion } from '@skeletonlabs/skeleton-common';
6
7
  import { AccordionRootContext, AccordionItemContext } from '../modules/context.js';
7
8
  export default function (props) {
8
9
  const rootContext = useContext(AccordionRootContext);
9
10
  const [itemProps, componentProps] = accordion.splitItemProps(props);
10
11
  const { element, children, ...restAttributes } = componentProps;
11
- const attributes = mergeProps(rootContext.api.getItemProps(itemProps), restAttributes);
12
+ const attributes = mergeProps(rootContext.api.getItemProps(itemProps), {
13
+ class: classesAccordion.item
14
+ }, restAttributes);
12
15
  return (_jsx(AccordionItemContext.Provider, { value: { itemProps }, children: element ? element({ attributes }) : _jsx("div", { ...attributes, children: children }) }));
13
16
  }
@@ -4,6 +4,7 @@ import { useId } from 'react';
4
4
  import * as accordion from '@zag-js/accordion';
5
5
  import { useMachine, normalizeProps, mergeProps } from '@zag-js/react';
6
6
  import { AccordionRootContext } from '../modules/context.js';
7
+ import { classesAccordion } from '@skeletonlabs/skeleton-common';
7
8
  export default function (props) {
8
9
  const [machineProps, componentProps] = accordion.splitProps(props);
9
10
  const { element, children, ...restAttributes } = componentProps;
@@ -13,7 +14,7 @@ export default function (props) {
13
14
  });
14
15
  const api = accordion.connect(service, normalizeProps);
15
16
  const attributes = mergeProps(api.getRootProps(), {
16
- className: 'skb:w-full skb:grid skb:gap-2'
17
+ className: classesAccordion.root
17
18
  }, restAttributes);
18
19
  return (_jsx(AccordionRootContext.Provider, { value: { api }, children: element ? element({ attributes }) : _jsx("div", { ...attributes, children: children }) }));
19
20
  }
@@ -3,12 +3,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useContext } from 'react';
4
4
  import { mergeProps } from '@zag-js/react';
5
5
  import { AccordionRootContext, AccordionItemContext } from '../modules/context.js';
6
+ import { classesAccordion } from '@skeletonlabs/skeleton-common';
6
7
  export default function (props) {
7
8
  const rootContext = useContext(AccordionRootContext);
8
9
  const itemContext = useContext(AccordionItemContext);
9
10
  const { element, children, ...restAttributes } = props;
10
11
  const attributes = mergeProps(rootContext.api.getItemTriggerProps(itemContext.itemProps), {
11
- className: 'skb:w-full skb:grid skb:grid-cols-[auto_1fr_auto] skb:items-center skb:gap-4 skb:py-2 skb:px-4 skb:rounded-base skb:text-left skb:hover:preset-tonal-primary'
12
+ className: classesAccordion.trigger
12
13
  }, restAttributes);
13
14
  return element ? element({ attributes }) : _jsx("button", { ...attributes, children: children });
14
15
  }
@@ -3,11 +3,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useContext } from 'react';
4
4
  import { mergeProps } from '@zag-js/react';
5
5
  import { AvatarRootContext } from '../modules/context.js';
6
+ import { classesAvatar } from '@skeletonlabs/skeleton-common';
6
7
  export default function (props) {
7
8
  const rootContext = useContext(AvatarRootContext);
8
9
  const { element, children, ...restAttributes } = props;
9
10
  const attributes = mergeProps(rootContext.api.getFallbackProps(), {
10
- className: 'skb:size-full skb:flex skb:justify-center skb:items-center'
11
+ className: classesAvatar.fallback
11
12
  }, restAttributes);
12
13
  return element ? element({ attributes }) : _jsx("span", { ...attributes, children: children });
13
14
  }
@@ -3,11 +3,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useContext } from 'react';
4
4
  import { mergeProps } from '@zag-js/react';
5
5
  import { AvatarRootContext } from '../modules/context.js';
6
+ import { classesAvatar } from '@skeletonlabs/skeleton-common';
6
7
  export default function (props) {
7
8
  const rootContext = useContext(AvatarRootContext);
8
9
  const { element, ...restAttributes } = props;
9
10
  const attributes = mergeProps(rootContext.api.getImageProps(), {
10
- className: 'skb:w-full skb:object-cover'
11
+ className: classesAvatar.image
11
12
  }, restAttributes);
12
13
  return element ? element({ attributes }) : _jsx("img", { ...attributes });
13
14
  }
@@ -4,6 +4,7 @@ import { useId } from 'react';
4
4
  import { useMachine, normalizeProps, mergeProps } from '@zag-js/react';
5
5
  import * as avatar from '@zag-js/avatar';
6
6
  import { AvatarRootContext } from '../modules/context.js';
7
+ import { classesAvatar } from '@skeletonlabs/skeleton-common';
7
8
  export default function (props) {
8
9
  const [machineProps, componentProps] = avatar.splitProps(props);
9
10
  const { element, children, ...restAttributes } = componentProps;
@@ -13,7 +14,7 @@ export default function (props) {
13
14
  });
14
15
  const api = avatar.connect(service, normalizeProps);
15
16
  const attributes = mergeProps(api.getRootProps(), {
16
- className: 'skb:isolate skb:bg-surface-400-600 skb:size-16 skb:rounded-full skb:overflow-hidden'
17
+ className: classesAvatar.root
17
18
  }, restAttributes);
18
19
  return (_jsx(AvatarRootContext.Provider, { value: { api }, children: element ? element({ attributes }) : _jsx("div", { ...attributes, children: children }) }));
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton-react",
3
- "version": "1.4.0",
3
+ "version": "1.5.0-next.0",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {
@@ -30,7 +30,8 @@
30
30
  "@zag-js/switch": "^1.18.3",
31
31
  "@zag-js/tabs": "^1.18.3",
32
32
  "@zag-js/tags-input": "^1.18.3",
33
- "@zag-js/toast": "^1.18.3"
33
+ "@zag-js/toast": "^1.18.3",
34
+ "@skeletonlabs/skeleton-common": "0.0.1-next.0"
34
35
  },
35
36
  "peerDependencies": {
36
37
  "react": "^18.0.0 || ^19.0.0",