@shellui/core 0.2.0-beta.3 → 0.2.0-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shellui/core",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "description": "ShellUI Core - Core React application runtime",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -36,29 +36,29 @@
36
36
  "author": "ShellUI",
37
37
  "license": "MIT",
38
38
  "dependencies": {
39
- "@radix-ui/react-collapsible": "^1.1.12",
40
- "@sentry/react": "^8.0.0",
41
39
  "@radix-ui/react-alert-dialog": "^1.1.15",
40
+ "@radix-ui/react-collapsible": "^1.1.12",
42
41
  "@radix-ui/react-dialog": "^1.1.15",
43
42
  "@radix-ui/react-separator": "^1.1.8",
44
43
  "@radix-ui/react-slot": "^1.2.4",
45
- "@radix-ui/react-tooltip": "^1.1.6",
44
+ "@radix-ui/react-tooltip": "^1.2.8",
45
+ "@sentry/react": "^10.39.0",
46
46
  "class-variance-authority": "^0.7.1",
47
47
  "clsx": "^2.1.1",
48
- "i18next": "^23.15.0",
49
- "react-i18next": "^15.1.0",
50
- "react-router": "^7.12.0",
51
- "roarr": "^7.21.2",
48
+ "i18next": "^25.8.11",
49
+ "react-i18next": "^16.5.4",
50
+ "react-router": "^7.13.0",
51
+ "roarr": "^7.21.4",
52
52
  "sonner": "^2.0.7",
53
- "tailwind-merge": "^3.4.0",
53
+ "tailwind-merge": "^3.5.0",
54
54
  "vaul": "^1.1.2",
55
- "workbox-window": "^7.1.0",
56
- "workbox-precaching": "^7.1.0",
57
- "workbox-routing": "^7.1.0",
58
- "workbox-strategies": "^7.1.0",
59
- "workbox-cacheable-response": "^7.1.0",
60
- "workbox-expiration": "^7.1.0",
61
- "@shellui/sdk": "0.2.0-beta.3"
55
+ "workbox-cacheable-response": "^7.4.0",
56
+ "workbox-expiration": "^7.4.0",
57
+ "workbox-precaching": "^7.4.0",
58
+ "workbox-routing": "^7.4.0",
59
+ "workbox-strategies": "^7.4.0",
60
+ "workbox-window": "^7.4.0",
61
+ "@shellui/sdk": "0.2.0-beta.4"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "react": "^18.0.0 || ^19.0.0",
@@ -69,12 +69,12 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@tailwindcss/typography": "^0.5.19",
72
- "@types/react": "^19.2.7",
72
+ "@types/react": "^19.2.14",
73
73
  "@types/react-dom": "^19.2.3",
74
- "react": "^18.2.0",
75
- "react-dom": "^18.2.0",
74
+ "react": "^19.2.4",
75
+ "react-dom": "^19.2.4",
76
76
  "tailwindcss-animate": "^1.0.7",
77
- "typescript": "^5.0.0"
77
+ "typescript": "^5.9.3"
78
78
  },
79
79
  "scripts": {
80
80
  "test": "echo \"No tests specified for @shellui/core\""
@@ -142,6 +142,7 @@ const AlertDialogAction = forwardRef<
142
142
  variant={variant}
143
143
  size={size}
144
144
  className={className}
145
+ onPointerDown={(e) => e.currentTarget.click()}
145
146
  {...props}
146
147
  />
147
148
  </AlertDialogPrimitive.Action>
@@ -159,6 +160,7 @@ const AlertDialogCancel = forwardRef<
159
160
  variant={variant}
160
161
  size={size}
161
162
  className={className}
163
+ onPointerDown={(e) => e.currentTarget.click()}
162
164
  {...props}
163
165
  />
164
166
  </AlertDialogPrimitive.Cancel>
@@ -75,7 +75,10 @@ const DialogContent = forwardRef<ElementRef<typeof DialogPrimitive.Content>, Dia
75
75
  >
76
76
  {children}
77
77
  {!hideCloseButton && (
78
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground cursor-pointer">
78
+ <DialogPrimitive.Close
79
+ onPointerDown={(e) => e.currentTarget.click()}
80
+ className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground cursor-pointer"
81
+ >
79
82
  <svg
80
83
  xmlns="http://www.w3.org/2000/svg"
81
84
  width="24"
@@ -102,6 +102,7 @@ const DrawerContent = forwardRef<ComponentRef<typeof VaulDrawer.Content>, Drawer
102
102
  <VaulDrawer.Close
103
103
  className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground cursor-pointer"
104
104
  aria-label="Close"
105
+ onPointerDown={(e) => e.currentTarget.click()}
105
106
  >
106
107
  <svg
107
108
  xmlns="http://www.w3.org/2000/svg"
@@ -1,13 +1,59 @@
1
- import type { ComponentProps } from 'react';
1
+ import { useEffect, type ComponentProps } from 'react';
2
2
  import { useSettings } from '../../features/settings/hooks/useSettings';
3
3
  import { Toaster as Sonner } from 'sonner';
4
4
  import { Z_INDEX } from '../../lib/z-index';
5
5
 
6
6
  type ToasterProps = ComponentProps<typeof Sonner>;
7
7
 
8
+ const TOAST_BUTTON_SELECTOR = '[data-close-button], [data-cancel], [data-action]';
9
+
10
+ /**
11
+ * Ensures toast action, cancel, and close buttons respond to pointer/touch on iPad
12
+ * and Apple Pencil by triggering click on pointerdown when the browser doesn't
13
+ * fire a subsequent click (e.g. pen/touch).
14
+ */
15
+ function useToastButtonPointerFix() {
16
+ useEffect(() => {
17
+ const onPointerDown: (e: Event) => void = (e) => {
18
+ const ev = e as PointerEvent;
19
+ const target = ev.target as HTMLElement;
20
+ const button = target.closest?.(TOAST_BUTTON_SELECTOR);
21
+ if (!button || button.getAttribute('data-disabled') === 'true') return;
22
+ // Only programmatically click for touch/pen to avoid double-firing on mouse
23
+ if (ev.pointerType === 'touch' || ev.pointerType === 'pen') {
24
+ (button as HTMLButtonElement).click();
25
+ }
26
+ };
27
+
28
+ function attach(toaster: Element) {
29
+ toaster.addEventListener('pointerdown', onPointerDown, true);
30
+ return () => toaster.removeEventListener('pointerdown', onPointerDown, true);
31
+ }
32
+
33
+ let toaster = document.querySelector('[data-sonner-toaster]');
34
+ if (!toaster) {
35
+ let cancelled = false;
36
+ let cleanup: (() => void) | undefined;
37
+ const id = requestAnimationFrame(() => {
38
+ if (cancelled) return;
39
+ toaster = document.querySelector('[data-sonner-toaster]');
40
+ if (toaster) cleanup = attach(toaster);
41
+ });
42
+ return () => {
43
+ cancelled = true;
44
+ cancelAnimationFrame(id);
45
+ cleanup?.();
46
+ };
47
+ }
48
+ return attach(toaster);
49
+ }, []);
50
+ }
51
+
8
52
  const Toaster = ({ ...props }: ToasterProps) => {
9
53
  const { settings } = useSettings();
10
54
 
55
+ useToastButtonPointerFix();
56
+
11
57
  return (
12
58
  <Sonner
13
59
  position="top-center"
@@ -24,8 +70,11 @@ const Toaster = ({ ...props }: ToasterProps) => {
24
70
  toast:
25
71
  'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
26
72
  description: 'group-[.toast]:text-muted-foreground',
27
- actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
28
- cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',
73
+ actionButton:
74
+ 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground [touch-action:manipulation]',
75
+ cancelButton:
76
+ 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground [touch-action:manipulation]',
77
+ closeButton: '[touch-action:manipulation]',
29
78
  },
30
79
  }}
31
80
  {...props}