@skeletonlabs/skeleton-react 1.0.0-next.13 → 1.0.0-next.15
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/Accordion.js +2 -2
- 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/FileUpload/FileUpload.js +1 -1
- package/dist/components/Navigation/Navigation.js +8 -3
- package/dist/components/Progress/Progress.js +2 -2
- package/dist/components/Segment/Segment.js +1 -1
- package/dist/components/Segment/types.d.ts +2 -2
- package/dist/components/Switch/types.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/TagsInput/TagsInput.js +1 -1
- package/package.json +9 -13
|
@@ -18,7 +18,7 @@ export const AccordionItemContext = createContext({
|
|
|
18
18
|
// Components ---
|
|
19
19
|
const AccordionRoot = ({ animDuration = 0.2,
|
|
20
20
|
// Root
|
|
21
|
-
base = '', padding = '', spaceY = 'space-y-2', rounded = 'rounded', width = 'w-full', classes = '',
|
|
21
|
+
base = '', padding = '', spaceY = 'space-y-2', rounded = 'rounded-base', width = 'w-full', classes = '',
|
|
22
22
|
// Icons
|
|
23
23
|
iconOpen = '-', iconClosed = '+',
|
|
24
24
|
// Events
|
|
@@ -45,7 +45,7 @@ children, ...zagProps }) => {
|
|
|
45
45
|
};
|
|
46
46
|
const AccordionControl = ({ headingElement = 'h3',
|
|
47
47
|
// Control
|
|
48
|
-
base = 'flex text-start items-center space-x-4 w-full', hover = 'hover:preset-tonal-primary', padding = 'py-2 px-4', rounded = 'rounded', classes = '',
|
|
48
|
+
base = 'flex text-start items-center space-x-4 w-full', hover = 'hover:preset-tonal-primary', padding = 'py-2 px-4', rounded = 'rounded-base', classes = '',
|
|
49
49
|
// Lead
|
|
50
50
|
leadBase = '', leadClasses = '',
|
|
51
51
|
// Content
|
|
@@ -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", {
|
|
24
|
+
return (_jsxs("figure", { ...api.getRootProps(), className: `${base} ${background} ${size} ${font} ${border} ${rounded} ${shadow} ${classes}`, "data-testid": "avatar", children: [(src || srcSet) && (_jsx("img", { src: src, srcSet: srcSet, alt: name, className: `${imageBase} ${imageClasses}`, style: { ...style, filter: filter ? `url(${filter})` : undefined }, "data-testid": "avatar-image", ...api.getImageProps() })), _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. */
|
|
@@ -13,7 +13,7 @@ interfaceIcon = '', interfaceText = '', interfaceSubtext = 'type-scale-1 opacity
|
|
|
13
13
|
// Files List
|
|
14
14
|
filesListBase = 'mt-2 space-y-2', filesListClasses = '',
|
|
15
15
|
// File
|
|
16
|
-
fileBase = 'grid grid-cols-[auto_1fr_auto] rtl:grid-cols-[1fr_auto_auto] items-center', fileBg = 'preset-tonal', fileGap = 'gap-4 px-4', filePadding = 'py-2', fileRounded = 'rounded', fileClasses = '',
|
|
16
|
+
fileBase = 'grid grid-cols-[auto_1fr_auto] rtl:grid-cols-[1fr_auto_auto] items-center', fileBg = 'preset-tonal', fileGap = 'gap-4 px-4', filePadding = 'py-2', fileRounded = 'rounded-base', fileClasses = '',
|
|
17
17
|
// File (content)
|
|
18
18
|
fileIcon = '', fileName = 'type-scale-2 flex items-center gap-4', fileSize = 'type-scale-1 opacity-60', fileButton = '',
|
|
19
19
|
// State
|
|
@@ -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',
|
|
@@ -61,7 +61,7 @@ children }) => {
|
|
|
61
61
|
};
|
|
62
62
|
return (_jsx("aside", { className: `${base} ${background} ${width} ${height} ${padding} ${classes}`, "data-testid": "nav-bar", children: _jsx(NavContext.Provider, { value: ctx, children: children ? (_jsx("nav", { className: `${tilesBase} ${tilesFlexDirection} ${tilesJustify} ${tilesItems} ${tilesGap} ${tilesClasses}`, children: children })) : null }) }));
|
|
63
63
|
};
|
|
64
|
-
export const NavTile = ({ id, href, target, label, labelExpanded, title, selected =
|
|
64
|
+
export const NavTile = ({ id, href, target, label, labelExpanded, title, selected = undefined, type = 'button',
|
|
65
65
|
// Root
|
|
66
66
|
base = 'flex items-center', width = 'w-full', aspect = 'aspect-square', background = '', hover = 'hover:preset-filled-surface-50-950', active = 'preset-filled-primary-500', padding = 'p-2', gap = 'gap-1', rounded = 'rounded-container', classes = 'flex-col justify-center',
|
|
67
67
|
// Expanded
|
|
@@ -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';
|
|
@@ -84,7 +88,8 @@ children }) => {
|
|
|
84
88
|
const classesCollapsed = `${rxSize} ${padding} ${gap} ${classes}`;
|
|
85
89
|
const classesExtended = `${expandedPadding} ${expandedGap} ${expandedClasses}`;
|
|
86
90
|
const rxMode = ctx.expanded ? classesExtended : classesCollapsed;
|
|
87
|
-
const
|
|
91
|
+
const isActive = selected !== undefined ? selected : ctx.value === id;
|
|
92
|
+
const rxBackground = isActive ? active : `${background} ${hover}`;
|
|
88
93
|
function onClickHandler() {
|
|
89
94
|
if (onClick && !id)
|
|
90
95
|
throw new Error('No ID was provided');
|
|
@@ -9,9 +9,9 @@ base = 'flex items-center gap-4', height = 'h-2', width = 'w-full', classes = ''
|
|
|
9
9
|
// Label
|
|
10
10
|
labelBase = 'whitespace-nowrap', labelText = 'text-xs', labelClasses = '',
|
|
11
11
|
// Track
|
|
12
|
-
trackBase = 'h-full w-full overflow-x-hidden', trackBg = 'bg-surface-200-800', trackRounded = 'rounded', trackClasses = '',
|
|
12
|
+
trackBase = 'h-full w-full overflow-x-hidden', trackBg = 'bg-surface-200-800', trackRounded = 'rounded-base', trackClasses = '',
|
|
13
13
|
// Meter
|
|
14
|
-
meterBase = 'h-full w-full', meterBg = 'bg-surface-950-50', meterRounded = 'rounded', meterTransition = 'transition-[width]', meterAnimate = 'animate-progress-indeterminate', meterClasses = '',
|
|
14
|
+
meterBase = 'h-full w-full', meterBg = 'bg-surface-950-50', meterRounded = 'rounded-base', meterTransition = 'transition-[width]', meterAnimate = 'animate-progress-indeterminate', meterClasses = '',
|
|
15
15
|
// Children
|
|
16
16
|
children,
|
|
17
17
|
// Zag
|
|
@@ -16,7 +16,7 @@ base = 'inline-flex items-stretch overflow-hidden', background = 'preset-outline
|
|
|
16
16
|
// States
|
|
17
17
|
orientVertical = 'flex-col', orientHorizontal = 'flex-row', stateDisabled = 'disabled', stateReadOnly = 'pointer-events-none',
|
|
18
18
|
// Indicator
|
|
19
|
-
indicatorBase = 'top-[var(--top)] left-[var(--left)] w-[var(--width)] h-[var(--height)]', indicatorBg = 'preset-filled', indicatorText = 'text-surface-contrast-950 dark:text-surface-contrast-50', indicatorRounded = 'rounded', indicatorClasses = '',
|
|
19
|
+
indicatorBase = 'top-[var(--top)] left-[var(--left)] w-[var(--width)] h-[var(--height)]', indicatorBg = 'preset-filled', indicatorText = 'text-surface-contrast-950 dark:text-surface-contrast-50', indicatorRounded = 'rounded-base', indicatorClasses = '',
|
|
20
20
|
// Events
|
|
21
21
|
onValueChange = noop,
|
|
22
22
|
// Label
|
|
@@ -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;
|
|
@@ -41,7 +41,7 @@ base = 'border-b-[1px] border-transparent', padding = 'pb-2', translateX = 'tran
|
|
|
41
41
|
// Label
|
|
42
42
|
labelBase = 'btn hover:preset-tonal-primary', labelClasses = '',
|
|
43
43
|
// State
|
|
44
|
-
stateInactive = '[&:not(:hover)]:opacity-50', stateActive = 'border-surface-950-50 opacity-100', stateLabelInactive = '', stateLabelActive = '',
|
|
44
|
+
stateInactive = '[&:not(:hover)]:opacity-50', stateActive = 'border-b-surface-950-50 opacity-100', stateLabelInactive = '', stateLabelActive = '',
|
|
45
45
|
// Nodes
|
|
46
46
|
lead,
|
|
47
47
|
// Children
|
|
@@ -6,7 +6,7 @@ import { useMachine, normalizeProps } from '@zag-js/react';
|
|
|
6
6
|
import { noop } from '../../internal/noop.js';
|
|
7
7
|
export const TagsInput = ({ placeholder = '',
|
|
8
8
|
// Root
|
|
9
|
-
base = 'grid input', gap = 'gap-2', padding = 'p-3', classes = '',
|
|
9
|
+
base = 'grid input !h-auto', gap = 'gap-2', padding = 'p-3', classes = '',
|
|
10
10
|
// Input: Add
|
|
11
11
|
inputBase = 'input-ghost', inputClasses = '',
|
|
12
12
|
// Tag List
|
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.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
+
"tailwindcss": "^4.0.7",
|
|
51
|
+
"@tailwindcss/vite": "^4.0.2",
|
|
50
52
|
"@tailwindcss/forms": "^0.5.9",
|
|
51
53
|
"@testing-library/jest-dom": "^6.6.3",
|
|
52
54
|
"@testing-library/react": "^16.0.1",
|
|
@@ -54,27 +56,21 @@
|
|
|
54
56
|
"@types/react": "^18.3.13",
|
|
55
57
|
"@types/react-dom": "^18.3.1",
|
|
56
58
|
"@vitejs/plugin-react": "^4.3.4",
|
|
57
|
-
"autoprefixer": "^10.4.20",
|
|
58
59
|
"jsdom": "^25.0.1",
|
|
59
60
|
"lucide-react": "^0.465.0",
|
|
60
|
-
"postcss": "^8.4.49",
|
|
61
61
|
"react": "^18.3.1",
|
|
62
62
|
"react-dom": "^18.3.1",
|
|
63
63
|
"react-router-dom": "^7.0.2",
|
|
64
|
-
"
|
|
65
|
-
"typescript": "^5.6.3",
|
|
64
|
+
"typescript": "^5.7.3",
|
|
66
65
|
"vite": "^6.0.2",
|
|
67
66
|
"vite-plugin-remix-router": "^2.0.0",
|
|
68
67
|
"vitest": "^2.1.8",
|
|
69
|
-
"@skeletonlabs/skeleton": "3.0.0-next.
|
|
70
|
-
"vite-plugin-tw-plugin-watcher": "0.0.1-next.0"
|
|
68
|
+
"@skeletonlabs/skeleton": "3.0.0-next.11"
|
|
71
69
|
},
|
|
72
70
|
"scripts": {
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"package:watch": "tsc --project tsconfig.package.json --watch --preserveWatchOutput",
|
|
78
|
-
"test": "vitest run"
|
|
71
|
+
"build": "tsc --noCheck --project tsconfig.package.json",
|
|
72
|
+
"dev": "tsc --noCheck --project tsconfig.package.json --watch --preserveWatchOutput",
|
|
73
|
+
"test": "vitest run",
|
|
74
|
+
"test:watch": "vitest run --watch"
|
|
79
75
|
}
|
|
80
76
|
}
|