@skeletonlabs/skeleton-react 2.0.0-next.1 → 2.0.0-next.2
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/accordion-content.d.ts +9 -0
- package/dist/components/accordion/anatomy/accordion-content.js +24 -0
- package/dist/components/accordion/anatomy/accordion-heading.d.ts +16 -0
- package/dist/components/accordion/anatomy/accordion-heading.js +17 -0
- package/dist/components/accordion/anatomy/accordion-indicator.d.ts +9 -0
- package/dist/components/accordion/anatomy/accordion-indicator.js +21 -0
- package/dist/components/accordion/anatomy/accordion-item-context.d.ts +10 -0
- package/dist/components/accordion/anatomy/accordion-item-context.js +11 -0
- package/dist/components/accordion/anatomy/accordion-item.d.ts +10 -0
- package/dist/components/accordion/anatomy/accordion-item.js +28 -0
- package/dist/components/accordion/anatomy/accordion-root-context.d.ts +10 -0
- package/dist/components/accordion/anatomy/accordion-root-context.js +11 -0
- package/dist/components/accordion/anatomy/accordion-root.d.ts +10 -0
- package/dist/components/accordion/anatomy/accordion-root.js +28 -0
- package/dist/components/accordion/anatomy/accordion-trigger.d.ts +9 -0
- package/dist/components/accordion/anatomy/accordion-trigger.js +21 -0
- package/dist/components/accordion/index.js +3 -0
- package/dist/components/accordion/modules/accordion-anatomy.d.ts +21 -0
- package/dist/components/accordion/modules/accordion-anatomy.js +22 -0
- package/dist/components/accordion/modules/accordion-item-context.d.ts +10 -0
- package/dist/components/accordion/modules/accordion-item-context.js +7 -0
- package/dist/components/accordion/modules/accordion-root-context.d.ts +9 -0
- package/dist/components/accordion/modules/accordion-root-context.js +7 -0
- package/dist/components/avatar/anatomy/avatar-fallback.d.ts +9 -0
- package/dist/components/avatar/anatomy/avatar-fallback.js +22 -0
- package/dist/components/avatar/anatomy/avatar-image.d.ts +9 -0
- package/dist/components/avatar/anatomy/avatar-image.js +19 -0
- package/dist/components/avatar/anatomy/avatar-root-context.d.ts +10 -0
- package/dist/components/avatar/anatomy/avatar-root-context.js +11 -0
- package/dist/components/avatar/anatomy/avatar-root.d.ts +10 -0
- package/dist/components/avatar/anatomy/avatar-root.js +31 -0
- package/dist/components/avatar/index.js +3 -0
- package/dist/components/avatar/modules/avatar-anatomy.d.ts +13 -0
- package/dist/components/avatar/modules/avatar-anatomy.js +14 -0
- package/dist/components/avatar/modules/avatar-root-context.d.ts +9 -0
- package/dist/components/avatar/modules/avatar-root-context.js +7 -0
- package/dist/components/rating-group/anatomy/rating-group-control.d.ts +9 -0
- package/dist/components/rating-group/anatomy/rating-group-control.js +19 -0
- package/dist/components/rating-group/anatomy/rating-group-hidden-input.d.ts +9 -0
- package/dist/components/rating-group/anatomy/rating-group-hidden-input.js +16 -0
- package/dist/components/rating-group/anatomy/rating-group-item-context.d.ts +10 -0
- package/dist/components/rating-group/anatomy/rating-group-item-context.js +11 -0
- package/dist/components/rating-group/anatomy/rating-group-item.d.ts +29 -0
- package/dist/components/rating-group/anatomy/rating-group-item.js +29 -0
- package/dist/components/rating-group/anatomy/rating-group-label.d.ts +9 -0
- package/dist/components/rating-group/anatomy/rating-group-label.js +19 -0
- package/dist/components/rating-group/anatomy/rating-group-root-context.d.ts +10 -0
- package/dist/components/rating-group/anatomy/rating-group-root-context.js +11 -0
- package/dist/components/rating-group/anatomy/rating-group-root.d.ts +10 -0
- package/dist/components/rating-group/anatomy/rating-group-root.js +28 -0
- package/dist/components/rating-group/index.js +3 -0
- package/dist/components/rating-group/modules/rating-group-anatomy.d.ts +19 -0
- package/dist/components/rating-group/modules/rating-group-anatomy.js +20 -0
- package/dist/components/rating-group/modules/rating-group-item-context.d.ts +9 -0
- package/dist/components/rating-group/modules/rating-group-item-context.js +7 -0
- package/dist/components/rating-group/modules/rating-group-root-context.d.ts +9 -0
- package/dist/components/rating-group/modules/rating-group-root-context.js +7 -0
- package/dist/components/tabs/anatomy/tabs-content.d.ts +10 -0
- package/dist/components/tabs/anatomy/tabs-content.js +21 -0
- package/dist/components/tabs/anatomy/tabs-indicator.d.ts +9 -0
- package/dist/components/tabs/anatomy/tabs-indicator.js +16 -0
- package/dist/components/tabs/anatomy/tabs-list.d.ts +9 -0
- package/dist/components/tabs/anatomy/tabs-list.js +19 -0
- package/dist/components/tabs/anatomy/tabs-root-context.d.ts +10 -0
- package/dist/components/tabs/anatomy/tabs-root-context.js +11 -0
- package/dist/components/tabs/anatomy/tabs-root.d.ts +10 -0
- package/dist/components/tabs/anatomy/tabs-root.js +28 -0
- package/dist/components/tabs/anatomy/tabs-trigger.d.ts +10 -0
- package/dist/components/tabs/anatomy/tabs-trigger.js +21 -0
- package/dist/components/tabs/index.js +3 -0
- package/dist/components/tabs/modules/tabs-anatomy.d.ts +17 -0
- package/dist/components/tabs/modules/tabs-anatomy.js +18 -0
- package/dist/components/tabs/modules/tabs-root-context.d.ts +9 -0
- package/dist/components/tabs/modules/tabs-root-context.js +7 -0
- package/dist/index.d.ts +36 -85
- package/dist/index.js +10 -162
- package/dist/internal/components/star-empty.js +22 -0
- package/dist/internal/components/star-full.js +20 -0
- package/dist/internal/components/star-half.js +36 -0
- package/dist/internal/props-with-element.d.ts +13 -0
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -1,162 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/components/accordion/anatomy/accordion-root.tsx
|
|
14
|
-
function accordion_root_default(props) {
|
|
15
|
-
const [machineProps, componentProps] = accordion.splitProps(props);
|
|
16
|
-
const { element, children,...restAttributes } = componentProps;
|
|
17
|
-
const service = useMachine(accordion.machine, {
|
|
18
|
-
id: useId(),
|
|
19
|
-
...machineProps
|
|
20
|
-
});
|
|
21
|
-
const api = accordion.connect(service, normalizeProps);
|
|
22
|
-
const attributes = mergeProps(api.getRootProps(), { className: classesAccordion.root }, restAttributes);
|
|
23
|
-
return /* @__PURE__ */ jsx(AccordionRootContext.Provider, {
|
|
24
|
-
value: { api },
|
|
25
|
-
children: element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
26
|
-
...attributes,
|
|
27
|
-
children
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/components/accordion/anatomy/accordion-item.tsx
|
|
34
|
-
function accordion_item_default(props) {
|
|
35
|
-
const rootContext = useContext(AccordionRootContext);
|
|
36
|
-
const [itemProps, componentProps] = accordion.splitItemProps(props);
|
|
37
|
-
const { element, children,...restAttributes } = componentProps;
|
|
38
|
-
const attributes = mergeProps(rootContext.api.getItemProps(itemProps), { className: classesAccordion.item }, restAttributes);
|
|
39
|
-
return /* @__PURE__ */ jsx(AccordionItemContext.Provider, {
|
|
40
|
-
value: { itemProps },
|
|
41
|
-
children: element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
42
|
-
...attributes,
|
|
43
|
-
children
|
|
44
|
-
})
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/components/accordion/anatomy/accordion-heading.tsx
|
|
50
|
-
function accordion_heading_default(props) {
|
|
51
|
-
const { level = 3, element, children,...restAttributes } = props;
|
|
52
|
-
const Tag = `h${level}`;
|
|
53
|
-
const attributes = mergeProps({ className: classesAccordion.heading }, restAttributes);
|
|
54
|
-
return element ? element({ attributes }) : /* @__PURE__ */ jsx(Tag, {
|
|
55
|
-
...attributes,
|
|
56
|
-
children
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/components/accordion/anatomy/accordion-trigger.tsx
|
|
62
|
-
function accordion_trigger_default(props) {
|
|
63
|
-
const rootContext = useContext(AccordionRootContext);
|
|
64
|
-
const itemContext = useContext(AccordionItemContext);
|
|
65
|
-
const { element, children,...restAttributes } = props;
|
|
66
|
-
const attributes = mergeProps(rootContext.api.getItemTriggerProps(itemContext.itemProps), { className: classesAccordion.trigger }, restAttributes);
|
|
67
|
-
return element ? element({ attributes }) : /* @__PURE__ */ jsx("button", {
|
|
68
|
-
...attributes,
|
|
69
|
-
children
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/components/accordion/anatomy/accordion-indicator.tsx
|
|
75
|
-
function accordion_indicator_default(props) {
|
|
76
|
-
const rootContext = useContext(AccordionRootContext);
|
|
77
|
-
const itemContext = useContext(AccordionItemContext);
|
|
78
|
-
const { element, children,...restAttributes } = props;
|
|
79
|
-
const attributes = mergeProps(rootContext.api.getItemIndicatorProps(itemContext.itemProps), { className: classesAccordion.indicator }, restAttributes);
|
|
80
|
-
return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
81
|
-
...attributes,
|
|
82
|
-
children
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/components/accordion/anatomy/accordion-content.tsx
|
|
88
|
-
function accordion_content_default(props) {
|
|
89
|
-
const rootContext = useContext(AccordionRootContext);
|
|
90
|
-
const itemContext = useContext(AccordionItemContext);
|
|
91
|
-
const { element, children,...restAttributes } = props;
|
|
92
|
-
const attributes = mergeProps(rootContext.api.getItemContentProps(itemContext.itemProps), { className: classesAccordion.content }, restAttributes);
|
|
93
|
-
return element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
94
|
-
...attributes,
|
|
95
|
-
children
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
//#endregion
|
|
100
|
-
//#region src/components/accordion/modules/anatomy.ts
|
|
101
|
-
const Accordion = Object.assign(accordion_root_default, {
|
|
102
|
-
Item: accordion_item_default,
|
|
103
|
-
Heading: accordion_heading_default,
|
|
104
|
-
Trigger: accordion_trigger_default,
|
|
105
|
-
Indicator: accordion_indicator_default,
|
|
106
|
-
Content: accordion_content_default
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
//#endregion
|
|
110
|
-
//#region src/components/avatar/modules/context.ts
|
|
111
|
-
const AvatarRootContext = createContext(null);
|
|
112
|
-
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/components/avatar/anatomy/avatar-root.tsx
|
|
115
|
-
function avatar_root_default(props) {
|
|
116
|
-
const [machineProps, componentProps] = avatar.splitProps(props);
|
|
117
|
-
const { element, children,...restAttributes } = componentProps;
|
|
118
|
-
const service = useMachine(avatar.machine, {
|
|
119
|
-
id: useId(),
|
|
120
|
-
...machineProps
|
|
121
|
-
});
|
|
122
|
-
const api = avatar.connect(service, normalizeProps);
|
|
123
|
-
const attributes = mergeProps(api.getRootProps(), { className: classesAvatar.root }, restAttributes);
|
|
124
|
-
return /* @__PURE__ */ jsx(AvatarRootContext.Provider, {
|
|
125
|
-
value: { api },
|
|
126
|
-
children: element ? element({ attributes }) : /* @__PURE__ */ jsx("div", {
|
|
127
|
-
...attributes,
|
|
128
|
-
children
|
|
129
|
-
})
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
//#endregion
|
|
134
|
-
//#region src/components/avatar/anatomy/avatar-image.tsx
|
|
135
|
-
function avatar_image_default(props) {
|
|
136
|
-
const rootContext = useContext(AvatarRootContext);
|
|
137
|
-
const { element,...restAttributes } = props;
|
|
138
|
-
const attributes = mergeProps(rootContext.api.getImageProps(), { className: classesAvatar.image }, restAttributes);
|
|
139
|
-
return element ? element({ attributes }) : /* @__PURE__ */ jsx("img", { ...attributes });
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region src/components/avatar/anatomy/avatar-fallback.tsx
|
|
144
|
-
function avatar_fallback_default(props) {
|
|
145
|
-
const rootContext = useContext(AvatarRootContext);
|
|
146
|
-
const { element, children,...restAttributes } = props;
|
|
147
|
-
const attributes = mergeProps(rootContext.api.getFallbackProps(), { className: classesAvatar.fallback }, restAttributes);
|
|
148
|
-
return element ? element({ attributes }) : /* @__PURE__ */ jsx("span", {
|
|
149
|
-
...attributes,
|
|
150
|
-
children
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
//#endregion
|
|
155
|
-
//#region src/components/avatar/modules/anatomy.ts
|
|
156
|
-
const Avatar = Object.assign(avatar_root_default, {
|
|
157
|
-
Image: avatar_image_default,
|
|
158
|
-
Fallback: avatar_fallback_default
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
//#endregion
|
|
162
|
-
export { Accordion, Avatar };
|
|
1
|
+
import { Accordion } from "./components/accordion/modules/accordion-anatomy.js";
|
|
2
|
+
import "./components/accordion/index.js";
|
|
3
|
+
import { Avatar } from "./components/avatar/modules/avatar-anatomy.js";
|
|
4
|
+
import "./components/avatar/index.js";
|
|
5
|
+
import { RatingGroup } from "./components/rating-group/modules/rating-group-anatomy.js";
|
|
6
|
+
import "./components/rating-group/index.js";
|
|
7
|
+
import { Tabs } from "./components/tabs/modules/tabs-anatomy.js";
|
|
8
|
+
import "./components/tabs/index.js";
|
|
9
|
+
|
|
10
|
+
export { Accordion, Avatar, RatingGroup, Tabs };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/internal/components/star-empty.tsx
|
|
4
|
+
function star_empty_default() {
|
|
5
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
height: "24",
|
|
9
|
+
width: "24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "1.5",
|
|
13
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
d: "M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345\n l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557\n l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0\n L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557\n l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345\n L11.48 3.5Z"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { star_empty_default as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/internal/components/star-full.tsx
|
|
4
|
+
function star_full_default() {
|
|
5
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
height: "24",
|
|
9
|
+
width: "24",
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
12
|
+
fillRule: "evenodd",
|
|
13
|
+
clipRule: "evenodd",
|
|
14
|
+
d: "M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 \n 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 \n 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 \n 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273 \n -4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 \n 2.082-5.005Z"
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { star_full_default as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/internal/components/star-half.tsx
|
|
4
|
+
function star_half_default() {
|
|
5
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
height: "24",
|
|
9
|
+
width: "24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "1.5",
|
|
13
|
+
children: [/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
|
|
14
|
+
id: "half-fill",
|
|
15
|
+
x1: "0%",
|
|
16
|
+
y1: "0%",
|
|
17
|
+
x2: "100%",
|
|
18
|
+
y2: "0%",
|
|
19
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
20
|
+
offset: "50%",
|
|
21
|
+
stopColor: "currentColor"
|
|
22
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
23
|
+
offset: "50%",
|
|
24
|
+
stopColor: "transparent"
|
|
25
|
+
})]
|
|
26
|
+
}) }), /* @__PURE__ */ jsx("path", {
|
|
27
|
+
fill: "url(#half-fill)",
|
|
28
|
+
strokeLinecap: "round",
|
|
29
|
+
strokeLinejoin: "round",
|
|
30
|
+
d: "M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345\n l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557\n l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0\n L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557\n l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345\n L11.48 3.5Z"
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { star_half_default as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/internal/props-with-element.d.ts
|
|
4
|
+
interface PropsWithElement {
|
|
5
|
+
/**
|
|
6
|
+
* Render the element yourself
|
|
7
|
+
*/
|
|
8
|
+
element?: (arg: {
|
|
9
|
+
attributes: Record<string, unknown>;
|
|
10
|
+
}) => JSX.Element | null;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { PropsWithElement };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton-react",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@zag-js/tabs": "^1.22.1",
|
|
29
29
|
"@zag-js/tags-input": "^1.22.1",
|
|
30
30
|
"@zag-js/toast": "^1.22.1",
|
|
31
|
-
"@skeletonlabs/skeleton-common": "1.0.0-next.
|
|
31
|
+
"@skeletonlabs/skeleton-common": "1.0.0-next.2"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@testing-library/jest-dom": "^6.8.0",
|
|
39
39
|
"@testing-library/react": "^16.3.0",
|
|
40
|
-
"@testing-library/user-event": "^14.6.1",
|
|
41
40
|
"@types/react": "^19.1.12",
|
|
42
41
|
"@types/react-dom": "^19.1.9",
|
|
43
42
|
"@vitejs/plugin-react": "^5.0.2",
|