@skeletonlabs/skeleton-react 1.0.0-next.4 → 1.0.0-next.5
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/AppBar/AppBar.js +5 -5
- package/dist/components/Navigation/Navigation.js +2 -2
- package/dist/components/Rating/Rating.js +3 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +9 -9
- package/dist/components/Test/Test.d.ts +0 -2
- package/dist/components/Test/Test.js +0 -10
|
@@ -12,35 +12,35 @@ const Toolbar = ({
|
|
|
12
12
|
base = 'flex justify-between', gridCols = 'grid-cols-[auto_1fr_auto]', gap = 'gap-4', classes = '',
|
|
13
13
|
// Children
|
|
14
14
|
children }) => {
|
|
15
|
-
return _jsx("div", { className: `${base} ${gridCols} ${gap} ${classes}`, children: children });
|
|
15
|
+
return (_jsx("div", { className: `${base} ${gridCols} ${gap} ${classes}`, "data-testid": "app-bar-toolbar", children: children }));
|
|
16
16
|
};
|
|
17
17
|
const ToolbarLead = ({
|
|
18
18
|
// Lead
|
|
19
19
|
base = 'flex', spaceX = 'space-x-4 rtl:space-x-reverse', padding = '', classes = '',
|
|
20
20
|
// Children
|
|
21
21
|
children }) => {
|
|
22
|
-
return _jsx("div", { className: `${base} ${spaceX} ${padding} ${classes}`, children: children });
|
|
22
|
+
return (_jsx("div", { className: `${base} ${spaceX} ${padding} ${classes}`, "data-testid": "app-bar-toolbar-lead", children: children }));
|
|
23
23
|
};
|
|
24
24
|
const ToolbarCenter = ({
|
|
25
25
|
// Center
|
|
26
26
|
base = 'grow', align = 'text-center', padding = '', classes = '',
|
|
27
27
|
// Children
|
|
28
28
|
children }) => {
|
|
29
|
-
return _jsx("div", { className: `${base} ${align} ${padding} ${classes}`, children: children });
|
|
29
|
+
return (_jsx("div", { className: `${base} ${align} ${padding} ${classes}`, "data-testid": "app-bar-toolbar-center", children: children }));
|
|
30
30
|
};
|
|
31
31
|
const ToolbarTrail = ({
|
|
32
32
|
// Trail
|
|
33
33
|
base = 'flex', spaceX = 'space-x-4 rtl:space-x-reverse', padding = '', classes = '',
|
|
34
34
|
// Children
|
|
35
35
|
children }) => {
|
|
36
|
-
return _jsx("div", { className: `${base} ${spaceX} ${padding} ${classes}`, children: children });
|
|
36
|
+
return (_jsx("div", { className: `${base} ${spaceX} ${padding} ${classes}`, "data-testid": "app-bar-toolbar-trail", children: children }));
|
|
37
37
|
};
|
|
38
38
|
const AppBarHeadline = ({
|
|
39
39
|
// Headline
|
|
40
40
|
base = 'w-full', classes = '',
|
|
41
41
|
// Children
|
|
42
42
|
children }) => {
|
|
43
|
-
return _jsx("div", { className: `${base} ${classes}`, children: children });
|
|
43
|
+
return (_jsx("div", { className: `${base} ${classes}`, "data-testid": "app-bar-headline", children: children }));
|
|
44
44
|
};
|
|
45
45
|
export const AppBar = Object.assign(AppBarRoot, {
|
|
46
46
|
Toolbar: Toolbar,
|
|
@@ -36,7 +36,7 @@ header, children, footer }) => {
|
|
|
36
36
|
};
|
|
37
37
|
// Reactive
|
|
38
38
|
const rxWidth = expanded ? widthExpanded : width;
|
|
39
|
-
return (_jsx("aside", { className: `${base} ${background} ${height} ${padding} ${rxWidth} ${classes}`, "data-testid": "nav-rail", children: _jsxs(NavContext.Provider, { value: ctx, children: [header ? (_jsx("header", { className: `${headerBase} ${headerFlexDirection} ${headerJustify} ${headerItems} ${headerGap} ${headerClasses}`, children: header })) : null, children ? (_jsx("nav", { className: `${tilesBase} ${tilesFlexDirection} ${tilesJustify} ${tilesItems} ${tilesGap} ${tilesClasses}`, children: children })) : null, footer ? (_jsx("footer", { className: `${footerBase} ${footerFlexDirection} ${footerJustify} ${footerItems} ${footerGap} ${footerClasses}`, children: footer })) : null] }) }));
|
|
39
|
+
return (_jsx("aside", { className: `${base} ${background} ${height} ${padding} ${rxWidth} ${classes}`, "data-testid": "nav-rail", children: _jsxs(NavContext.Provider, { value: ctx, children: [header ? (_jsx("header", { className: `${headerBase} ${headerFlexDirection} ${headerJustify} ${headerItems} ${headerGap} ${headerClasses}`, "data-testid": "nav-rail-header", children: header })) : null, children ? (_jsx("nav", { className: `${tilesBase} ${tilesFlexDirection} ${tilesJustify} ${tilesItems} ${tilesGap} ${tilesClasses}`, "data-testid": "nav-rail-tiles", children: children })) : null, footer ? (_jsx("footer", { className: `${footerBase} ${footerFlexDirection} ${footerJustify} ${footerItems} ${footerGap} ${footerClasses}`, "data-testid": "nav-rail-footer", children: footer })) : null] }) }));
|
|
40
40
|
};
|
|
41
41
|
export const NavBar = ({ value = '',
|
|
42
42
|
// Root
|
|
@@ -94,7 +94,7 @@ children }) => {
|
|
|
94
94
|
if (ctx.onSelectionHandler && id)
|
|
95
95
|
ctx.onSelectionHandler(id);
|
|
96
96
|
}
|
|
97
|
-
return (_jsxs(TileElement, { className: `${base} ${width} ${rounded} ${rxBackground} ${rxMode}`, href: href, target: target, type: type, title: title, role: role, onClick: onClickHandler, "data-parent": ctx.parent, "data-expanded": ctx.expanded, "data-testid": "nav-tile", children: [children
|
|
97
|
+
return (_jsxs(TileElement, { className: `${base} ${width} ${rounded} ${rxBackground} ${rxMode}`, href: href, target: target, type: type, title: title, role: role, onClick: onClickHandler, "data-parent": ctx.parent, "data-expanded": ctx.expanded, "data-testid": "nav-tile", children: [children && _jsx("div", { children: children }), label && !ctx.expanded && (_jsx("div", { className: `${labelBase} ${labelClasses}`, "data-testid": "nav-tile-label", children: label })), labelExpanded && ctx.expanded && (_jsx("div", { className: `${labelExpandedBase} ${labelExpandedClasses}`, "data-testid": "nav-tile-label-expanded", children: labelExpanded }))] }));
|
|
98
98
|
};
|
|
99
99
|
// Exports ---
|
|
100
100
|
export const Nav = Object.assign(() => null, {
|
|
@@ -35,8 +35,8 @@ onValueChange = noop,
|
|
|
35
35
|
const rxInteractive = state.context.isInteractive ? stateInteractive : '';
|
|
36
36
|
const rxReadOnly = state.context.readOnly ? stateReadOnly : '';
|
|
37
37
|
const rxDisabled = state.context.disabled ? stateDisabled : '';
|
|
38
|
-
return (_jsxs("div", { ...api.getRootProps(), className: `${base} ${classes}`, "data-testid": "rating", children: [!!label && (_jsx("label", { ...api.getLabelProps(), className: `${labelBase} ${labelClasses}`, "data-testid": "rating-label", children: label })), _jsx("div", { ...api.getControlProps(), className: `${controlBase} ${controlGap} ${rxInteractive} ${rxReadOnly} ${rxDisabled} ${controlClasses}`, "data-testid": "rating-control", children: api.items.map((
|
|
39
|
-
const itemState = api.getItemState({ index });
|
|
38
|
+
return (_jsxs("div", { ...api.getRootProps(), className: `${base} ${classes}`, "data-testid": "rating", children: [!!label && (_jsx("label", { ...api.getLabelProps(), className: `${labelBase} ${labelClasses}`, "data-testid": "rating-label", children: label })), _jsx("div", { ...api.getControlProps(), className: `${controlBase} ${controlGap} ${rxInteractive} ${rxReadOnly} ${rxDisabled} ${controlClasses}`, "data-testid": "rating-control", children: api.items.map((item) => {
|
|
39
|
+
const itemState = api.getItemState({ index: item });
|
|
40
40
|
const icon = (() => {
|
|
41
41
|
if (!itemState.highlighted) {
|
|
42
42
|
return iconEmpty;
|
|
@@ -48,6 +48,6 @@ onValueChange = noop,
|
|
|
48
48
|
return iconFull;
|
|
49
49
|
}
|
|
50
50
|
})();
|
|
51
|
-
return (_jsx(_Fragment, { children: _jsx("span", { ...api.getItemProps({ index }), className: `${itemBase} ${itemClasses}`, "data-testid": "rating-item", children: icon },
|
|
51
|
+
return (_jsx(_Fragment, { children: _jsx("span", { ...api.getItemProps({ index: item }), className: `${itemBase} ${itemClasses}`, "data-testid": "rating-item", children: icon }, item) }));
|
|
52
52
|
}) }), _jsx("input", { ...api.getHiddenInputProps(), "data-testid": "rating-input" })] }));
|
|
53
53
|
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton-react",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -29,6 +29,14 @@
|
|
|
29
29
|
"!./dist/schemas.d.ts"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@zag-js/accordion": "^0.65.0",
|
|
33
|
+
"@zag-js/avatar": "^0.65.0",
|
|
34
|
+
"@zag-js/progress": "^0.65.0",
|
|
35
|
+
"@zag-js/radio-group": "^0.65.0",
|
|
36
|
+
"@zag-js/rating-group": "^0.65.0",
|
|
37
|
+
"@zag-js/react": "^0.65.0",
|
|
38
|
+
"@zag-js/switch": "^0.65.0",
|
|
39
|
+
"@zag-js/tabs": "^0.65.0",
|
|
32
40
|
"react": "^18.3.1",
|
|
33
41
|
"react-dom": "^18.3.1"
|
|
34
42
|
},
|
|
@@ -40,14 +48,6 @@
|
|
|
40
48
|
"@types/react": "^18.3.3",
|
|
41
49
|
"@types/react-dom": "^18.3.0",
|
|
42
50
|
"@vitejs/plugin-react": "^4.3.1",
|
|
43
|
-
"@zag-js/accordion": "^0.65.0",
|
|
44
|
-
"@zag-js/avatar": "^0.65.0",
|
|
45
|
-
"@zag-js/progress": "^0.65.0",
|
|
46
|
-
"@zag-js/radio-group": "^0.65.0",
|
|
47
|
-
"@zag-js/rating-group": "^0.65.0",
|
|
48
|
-
"@zag-js/react": "^0.65.0",
|
|
49
|
-
"@zag-js/switch": "^0.65.0",
|
|
50
|
-
"@zag-js/tabs": "^0.65.0",
|
|
51
51
|
"autoprefixer": "^10.4.19",
|
|
52
52
|
"jsdom": "^24.1.1",
|
|
53
53
|
"lucide-react": "^0.341.0",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
function Test() {
|
|
4
|
-
const [count, setCount] = useState(0);
|
|
5
|
-
function countUp() {
|
|
6
|
-
setCount((count) => count + 1);
|
|
7
|
-
}
|
|
8
|
-
return (_jsx(_Fragment, { children: _jsxs("button", { className: "btn preset-filled", onClick: countUp, children: ["Count is ", count] }) }));
|
|
9
|
-
}
|
|
10
|
-
export default Test;
|