@sqrzro/ui 4.0.0-alpha.76 → 4.0.0-alpha.77

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.
@@ -5,8 +5,8 @@ import { usePathname } from 'next/navigation';
5
5
  import Switch from '../../../forms/components/Switch';
6
6
  import { useClassNames } from '../../../styles/context';
7
7
  import tw from '../../../styles/classnames/utility/tw';
8
+ import normalizeHref from '../../../utility/normalize-href';
8
9
  import Link from '../../elements/Link';
9
- import normalizeHref from '../utility/normalize-href';
10
10
  import ListItemSecondary from '../ListItemSecondary';
11
11
  import ListItemMeta from '../ListItemMeta';
12
12
  import ListItemMenu from '../ListItemMenu';
@@ -4,7 +4,7 @@ import { formatDate, formatDatetime, formatMoney, formatPoints, formatTime } fro
4
4
  import { usePathname } from 'next/navigation';
5
5
  import Link from '../../../components/elements/Link';
6
6
  import Reference from '../../../components/elements/Reference';
7
- import normalizeHref from './normalize-href';
7
+ import normalizeHref from '../../../utility/normalize-href';
8
8
  function renderDefault(value) {
9
9
  return value;
10
10
  }
@@ -1,5 +1,7 @@
1
- import { useRouter } from 'next/navigation';
1
+ import { usePathname, useRouter } from 'next/navigation';
2
+ import normalizeHref from '../utility/normalize-href';
2
3
  function useSuccess({ onSuccess, redirectOnSuccess, refreshOnSuccess, }) {
4
+ const pathname = usePathname();
3
5
  const router = useRouter();
4
6
  async function handleSuccess(response) {
5
7
  if (onSuccess) {
@@ -10,7 +12,7 @@ function useSuccess({ onSuccess, redirectOnSuccess, refreshOnSuccess, }) {
10
12
  ? await redirectOnSuccess(response)
11
13
  : redirectOnSuccess;
12
14
  if (url) {
13
- router.push(url);
15
+ router.push(normalizeHref(url, pathname));
14
16
  }
15
17
  }
16
18
  else if (refreshOnSuccess) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sqrzro/ui",
3
3
  "type": "module",
4
- "version": "4.0.0-alpha.76",
4
+ "version": "4.0.0-alpha.77",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "ISC",
@@ -50,15 +50,15 @@
50
50
  "dist/**/*"
51
51
  ],
52
52
  "dependencies": {
53
+ "@sqrzro/addons": "^4.0.0-alpha.14",
54
+ "@sqrzro/utility": "^4.0.0-alpha.22",
53
55
  "clsx": "^2.1.1",
54
56
  "drizzle-orm": "^0.45.2",
55
57
  "next": "^16.2.11",
56
58
  "react": "^19.2.8",
57
59
  "react-dom": "^19.2.8",
58
60
  "tailwind-merge": "^3.6.0",
59
- "use-deep-compare-effect": "^1.8.1",
60
- "@sqrzro/addons": "^4.0.0-alpha.14",
61
- "@sqrzro/utility": "^4.0.0-alpha.21"
61
+ "use-deep-compare-effect": "^1.8.1"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@storybook/addon-a11y": "^10.5.3",