@skeletonlabs/skeleton-react 1.0.0-next.12 → 1.0.0-next.14
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/README.md +1 -1
- package/dist/components/Accordion/types.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +2 -2
- package/dist/components/Avatar/types.d.ts +2 -0
- package/dist/components/Navigation/Navigation.js +6 -2
- package/dist/components/Segment/types.d.ts +2 -2
- package/dist/components/Switch/types.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ export interface AccordionItemProps extends React.PropsWithChildren, accordion.I
|
|
|
42
42
|
}
|
|
43
43
|
export interface AccordionControlProps extends React.PropsWithChildren {
|
|
44
44
|
/** The heading element. */
|
|
45
|
-
headingElement?: keyof JSX.IntrinsicElements;
|
|
45
|
+
headingElement?: keyof React.JSX.IntrinsicElements;
|
|
46
46
|
/** Set a disabled state for the item. */
|
|
47
47
|
disabled?: boolean;
|
|
48
48
|
/** Sets control's base styles. */
|
|
@@ -7,7 +7,7 @@ export const Avatar = ({ src, srcSet, name, filter,
|
|
|
7
7
|
// Root
|
|
8
8
|
base = 'overflow-hidden isolate', background = 'bg-surface-400-600', size = 'size-16', font = '', border = '', rounded = 'rounded-full', shadow = '', classes = '',
|
|
9
9
|
// Image
|
|
10
|
-
imageBase = 'w-full object-cover', imageClasses = '',
|
|
10
|
+
imageBase = 'w-full object-cover', imageClasses = '', style,
|
|
11
11
|
// Fallback
|
|
12
12
|
fallbackBase = 'w-full h-full flex justify-center items-center', fallbackClasses = '',
|
|
13
13
|
// Children
|
|
@@ -21,5 +21,5 @@ children }) => {
|
|
|
21
21
|
.map((word) => word[0])
|
|
22
22
|
.join('');
|
|
23
23
|
}
|
|
24
|
-
return (_jsxs("figure", { ...api.getRootProps(), className: `${base} ${background} ${size} ${font} ${border} ${rounded} ${shadow} ${classes}`, "data-testid": "avatar", children: [(src || srcSet) && (_jsx("img", { ...api.getImageProps(), src: src, srcSet: srcSet, alt: name, className: `${imageBase} ${imageClasses}`, style: { filter: filter ? `url(${filter})` : undefined }, "data-testid": "avatar-image" })), _jsx("span", { ...api.getFallbackProps(), className: `${fallbackBase} ${fallbackClasses}`, "data-testid": "avatar-fallback", children: children ? children : getInitials(name) })] }));
|
|
24
|
+
return (_jsxs("figure", { ...api.getRootProps(), className: `${base} ${background} ${size} ${font} ${border} ${rounded} ${shadow} ${classes}`, "data-testid": "avatar", children: [(src || srcSet) && (_jsx("img", { ...api.getImageProps(), src: src, srcSet: srcSet, alt: name, className: `${imageBase} ${imageClasses}`, style: { ...style, filter: filter ? `url(${filter})` : undefined }, "data-testid": "avatar-image" })), _jsx("span", { ...api.getFallbackProps(), className: `${fallbackBase} ${fallbackClasses}`, "data-testid": "avatar-fallback", children: children ? children : getInitials(name) })] }));
|
|
25
25
|
};
|
|
@@ -27,6 +27,8 @@ export interface AvatarProps extends React.PropsWithChildren {
|
|
|
27
27
|
imageBase?: string;
|
|
28
28
|
/** Provide avatar image arbitrary CSS classes. */
|
|
29
29
|
imageClasses?: string;
|
|
30
|
+
/** Set avatar image styles. */
|
|
31
|
+
style?: React.CSSProperties;
|
|
30
32
|
/** Set base classes for the fallback element. */
|
|
31
33
|
fallbackBase?: string;
|
|
32
34
|
/** Provide arbitrary CSS classes to fallback element. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext } from 'react';
|
|
3
|
+
import { createContext, useContext, useId } from 'react';
|
|
4
4
|
// Contexts ---
|
|
5
5
|
export const NavContext = createContext({
|
|
6
6
|
parent: 'none',
|
|
@@ -11,7 +11,7 @@ export const NavContext = createContext({
|
|
|
11
11
|
// Components ---
|
|
12
12
|
export const NavRail = ({ value = '', expanded = false,
|
|
13
13
|
// Root
|
|
14
|
-
base = '
|
|
14
|
+
base = 'flex flex-col', background = 'preset-filled-surface-100-900', padding = 'p-1', width = 'w-24', widthExpanded = 'w-64', height = 'h-full', classes = '',
|
|
15
15
|
// Header
|
|
16
16
|
headerBase = 'flex', headerFlexDirection = 'flex-col', headerJustify = 'justify-center', headerItems = 'items-center', headerGap = 'gap-1', headerClasses = '',
|
|
17
17
|
// Tiles
|
|
@@ -76,6 +76,10 @@ onClick,
|
|
|
76
76
|
children }) => {
|
|
77
77
|
// Get Context
|
|
78
78
|
const ctx = useContext(NavContext);
|
|
79
|
+
const generatedId = useId();
|
|
80
|
+
if (!id) {
|
|
81
|
+
id = generatedId;
|
|
82
|
+
}
|
|
79
83
|
// Local
|
|
80
84
|
const TileElement = href ? 'a' : 'button';
|
|
81
85
|
const role = href ? undefined : 'button';
|
|
@@ -52,9 +52,9 @@ export interface SegmentItemsProps extends React.PropsWithChildren, Omit<radio.I
|
|
|
52
52
|
base?: string;
|
|
53
53
|
/** Provide arbitrary CSS classes. */
|
|
54
54
|
classes?: string;
|
|
55
|
-
/** Set
|
|
55
|
+
/** Set classes for the disabled state. */
|
|
56
56
|
stateDisabled?: string;
|
|
57
|
-
/** Set
|
|
57
|
+
/** Set classes for the focus state. */
|
|
58
58
|
stateFocused?: string;
|
|
59
59
|
/** Sets base classes for the label element. */
|
|
60
60
|
labelBase?: string;
|
|
@@ -13,7 +13,7 @@ export interface SwitchProps extends React.PropsWithChildren, Omit<zagSwitch.Con
|
|
|
13
13
|
base?: string;
|
|
14
14
|
/** Provide arbitrary classes to the root element. */
|
|
15
15
|
classes?: string;
|
|
16
|
-
/** Set
|
|
16
|
+
/** Set classes for the focus state. */
|
|
17
17
|
stateFocused?: string;
|
|
18
18
|
/** Set base classes for the control element. */
|
|
19
19
|
controlBase?: string;
|
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.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"vite": "^6.0.2",
|
|
67
67
|
"vite-plugin-remix-router": "^2.0.0",
|
|
68
68
|
"vitest": "^2.1.8",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
69
|
+
"@skeletonlabs/skeleton": "3.0.0-next.10",
|
|
70
|
+
"vite-plugin-tw-plugin-watcher": "0.0.1-next.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"dev": "vite",
|