@stevederico/skateboard-ui 3.6.1 → 3.7.1
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/App.jsx +1 -1
- package/CHANGELOG.md +10 -0
- package/components/ProtectedRoute.jsx +1 -1
- package/components/core/Utilities.js +1 -1
- package/components/layout/Layout.jsx +1 -1
- package/components/layout/Sidebar.jsx +1 -1
- package/components/layout/TabBar.jsx +1 -1
- package/components/views/LandingView.jsx +1 -1
- package/components/views/PaymentView.jsx +1 -1
- package/components/views/SettingsView.jsx +1 -1
- package/components/views/SignOutView.jsx +1 -1
- package/package.json +2 -2
- package/shadcn/ui/button.jsx +21 -2
package/App.jsx
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
Navigate,
|
|
7
7
|
useLocation,
|
|
8
8
|
useNavigate,
|
|
9
|
-
} from 'react-router
|
|
9
|
+
} from 'react-router';
|
|
10
10
|
import { useEffect } from 'react';
|
|
11
11
|
import { getState } from './components/core/Context.jsx';
|
|
12
12
|
import { ThemeProvider } from './components/core/ThemeProvider.jsx';
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
3.7.1
|
|
4
|
+
|
|
5
|
+
Fix: `Button` now bridges shadcn-style `asChild` onto Base UI's `render` prop instead of leaking it onto the DOM `<button>` — removes the "React does not recognize the `asChild` prop" warning for `<Button asChild><a/></Button>` (e.g. LandingSpecSheet "Learn more")
|
|
6
|
+
|
|
7
|
+
3.7.0
|
|
8
|
+
|
|
9
|
+
Breaking (peer dep rename): `react-router-dom` → `react-router`
|
|
10
|
+
In react-router v7 `react-router-dom` is just a re-export of `react-router`; consumers must install `react-router@^7.0.0` instead of `react-router-dom`
|
|
11
|
+
All internal imports rewritten (App, ProtectedRoute, Layout, Sidebar, TabBar, Utilities, Landing/Payment/Settings/SignOut views)
|
|
12
|
+
|
|
3
13
|
3.6.1
|
|
4
14
|
|
|
5
15
|
Fix: restore `icons/` in files allowlist (regressed in 3.6.0 — `@stevederico/skateboard-ui/icons` import was unresolvable in published tarball)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { Navigate, Outlet } from 'react-router
|
|
2
|
+
import { Navigate, Outlet } from 'react-router';
|
|
3
3
|
import { isAuthenticated, apiRequest, getAppKey, getConstants } from './core/Utilities';
|
|
4
4
|
import { Spinner } from '../shadcn/ui/spinner.jsx';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import { useInRouterContext, useNavigate } from 'react-router
|
|
2
|
+
import { useInRouterContext, useNavigate } from 'react-router';
|
|
3
3
|
import { getDispatch } from './Context.jsx';
|
|
4
4
|
|
|
5
5
|
// Constants will be initialized by the app shell
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Link, useLocation } from 'react-router
|
|
2
|
+
import { Link, useLocation } from 'react-router';
|
|
3
3
|
import DynamicIcon from '../core/DynamicIcon';
|
|
4
4
|
import { getState } from '../core/Context.jsx';
|
|
5
5
|
import { cn } from '../../shadcn/lib/utils.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router
|
|
2
|
+
import { useNavigate } from 'react-router';
|
|
3
3
|
import { useTheme } from '../core/ThemeProvider.jsx';
|
|
4
4
|
import { getState } from "../core/Context.jsx";
|
|
5
5
|
import DynamicIcon from '../core/DynamicIcon.jsx';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useCallback } from 'react';
|
|
2
|
-
import { useNavigate, useSearchParams } from 'react-router
|
|
2
|
+
import { useNavigate, useSearchParams } from 'react-router';
|
|
3
3
|
import { getState } from '../core/Context.jsx';
|
|
4
4
|
import { getCurrentUser, getAppKey } from '../core/Utilities.js'
|
|
5
5
|
import { Spinner } from '../../shadcn/ui/spinner.jsx';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router
|
|
2
|
+
import { useNavigate } from 'react-router';
|
|
3
3
|
import { getState } from '../core/Context.jsx';
|
|
4
4
|
import { useTheme } from '../core/ThemeProvider.jsx';
|
|
5
5
|
import { Sun, Moon } from '../../icons';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stevederico/skateboard-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.7.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./Sidebar": {
|
|
@@ -145,6 +145,6 @@
|
|
|
145
145
|
"peerDependencies": {
|
|
146
146
|
"react": "^19.1.0",
|
|
147
147
|
"react-dom": "^19.1.0",
|
|
148
|
-
"react-router
|
|
148
|
+
"react-router": "^7.0.0"
|
|
149
149
|
}
|
|
150
150
|
}
|
package/shadcn/ui/button.jsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Children } from "react";
|
|
1
2
|
import { Button as ButtonPrimitive } from "../lib/base-ui/button.js"
|
|
2
3
|
import { cva } from "../lib/cva.js";
|
|
3
4
|
|
|
@@ -42,19 +43,37 @@ const buttonVariants = cva(
|
|
|
42
43
|
* @param {string} [props.className] - Additional CSS classes
|
|
43
44
|
* @param {"default"|"outline"|"secondary"|"ghost"|"destructive"|"link"|"gradient"} [props.variant="default"] - Visual style
|
|
44
45
|
* @param {"default"|"xs"|"sm"|"lg"|"icon"|"icon-xs"|"icon-sm"|"icon-lg"|"cta"} [props.size="default"] - Button size
|
|
46
|
+
* @param {boolean} [props.asChild=false] - Render the single child element styled as a button (shadcn-style). Bridged onto Base UI's `render` prop.
|
|
45
47
|
* @returns {JSX.Element}
|
|
46
48
|
*/
|
|
47
49
|
function Button({
|
|
48
50
|
className,
|
|
49
51
|
variant = "default",
|
|
50
52
|
size = "default",
|
|
53
|
+
asChild = false,
|
|
54
|
+
children,
|
|
51
55
|
...props
|
|
52
56
|
}) {
|
|
57
|
+
const classes = cn(buttonVariants({ variant, size, className }));
|
|
58
|
+
// Base UI has no `asChild` — it uses a `render` prop. Bridge the shadcn-style
|
|
59
|
+
// `asChild` API so `<Button asChild><a .../></Button>` renders the child element
|
|
60
|
+
// (merged with button props) instead of leaking `asChild` onto the DOM <button>.
|
|
61
|
+
if (asChild) {
|
|
62
|
+
return (
|
|
63
|
+
<ButtonPrimitive
|
|
64
|
+
data-slot="button"
|
|
65
|
+
className={classes}
|
|
66
|
+
render={Children.only(children)}
|
|
67
|
+
{...props} />
|
|
68
|
+
);
|
|
69
|
+
}
|
|
53
70
|
return (
|
|
54
71
|
<ButtonPrimitive
|
|
55
72
|
data-slot="button"
|
|
56
|
-
className={
|
|
57
|
-
{...props}
|
|
73
|
+
className={classes}
|
|
74
|
+
{...props}>
|
|
75
|
+
{children}
|
|
76
|
+
</ButtonPrimitive>
|
|
58
77
|
);
|
|
59
78
|
}
|
|
60
79
|
|