@instantdb/components 0.22.92-experimental.sync-table-fixes.20350175943.1 → 0.22.92

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@instantdb/components",
3
3
  "private": false,
4
- "version": "0.22.92-experimental.sync-table-fixes.20350175943.1",
4
+ "version": "0.22.92",
5
5
  "type": "module",
6
6
  "description": "Instant's UI components",
7
7
  "homepage": "https://github.com/instantdb/instant/tree/main/client/packages/components",
@@ -93,16 +93,16 @@
93
93
  "swr": "^2.2.4",
94
94
  "tailwind-merge": "^2.2.1",
95
95
  "uuid": "^11.1.0",
96
- "@instantdb/core": "0.22.92-experimental.sync-table-fixes.20350175943.1",
97
- "@instantdb/version": "0.22.92-experimental.sync-table-fixes.20350175943.1",
98
- "@instantdb/react": "0.22.92-experimental.sync-table-fixes.20350175943.1",
99
- "@instantdb/platform": "0.22.92-experimental.sync-table-fixes.20350175943.1",
100
- "@instantdb/admin": "0.22.92-experimental.sync-table-fixes.20350175943.1"
96
+ "@instantdb/core": "0.22.92",
97
+ "@instantdb/admin": "0.22.92",
98
+ "@instantdb/platform": "0.22.92",
99
+ "@instantdb/react": "0.22.92",
100
+ "@instantdb/version": "0.22.92"
101
101
  },
102
102
  "scripts": {
103
103
  "test": "echo \"Error: no test specified\" && exit 1",
104
104
  "build": "vite build",
105
- "dev": "vite build --watch --mode development",
105
+ "dev": "vite build --watch",
106
106
  "publish-package": "pnpm pack && npm publish *.tgz --access public",
107
107
  "dev:demo": "vite"
108
108
  }
@@ -246,7 +246,7 @@ export const TableCell = ({ cell }: { cell: Cell<any, unknown> }) => {
246
246
  return (
247
247
  <Tooltip>
248
248
  {' '}
249
- <TooltipTrigger className="text-left" asChild>
249
+ <TooltipTrigger className="text-left">
250
250
  <div
251
251
  ref={(el) => {
252
252
  setNodeRef(el);
@@ -560,7 +560,7 @@ export const IconButton = ({
560
560
  }: IconButtonProps) => {
561
561
  return (
562
562
  <Tooltip>
563
- <TooltipTrigger asChild>
563
+ <TooltipTrigger>
564
564
  <button
565
565
  title={label}
566
566
  disabled={disabled}
@@ -616,55 +616,19 @@ function DialogPortal({
616
616
  return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
617
617
  }
618
618
 
619
- const DialogOverlay = React.forwardRef<
620
- React.ComponentRef<typeof DialogPrimitive.Overlay>,
621
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
622
- >(({ className, ...props }, ref) => (
623
- <DialogPrimitive.Overlay
624
- ref={ref}
625
- data-slot="dialog-overlay"
626
- className={cn(
627
- 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
628
- className,
629
- )}
630
- {...props}
631
- />
632
- ));
633
-
634
- /**
635
- * Radix Dialog's TitleWarning uses document.getElementById to check for a title,
636
- * but this doesn't work in Shadow DOM. This component creates a hidden element
637
- * in the main document to satisfy the check, using a ref to get the actual ID
638
- * that Radix assigns to the title.
639
- */
640
- function ShadowDialogTitle({ title }: { title: string }) {
641
- const shadowRoot = useShadowRoot();
642
- const titleRef = React.useRef<HTMLHeadingElement>(null);
643
-
644
- React.useEffect(() => {
645
- // Only needed in Shadow DOM and in development
646
- if (!shadowRoot || process.env.NODE_ENV === 'production') {
647
- return;
648
- }
649
-
650
- const titleId = titleRef.current?.id;
651
- if (!titleId) return;
652
-
653
- // Create a hidden element in the main document to satisfy Radix's getElementById check
654
- const hiddenTitle = document.createElement('span');
655
- hiddenTitle.id = titleId;
656
- hiddenTitle.style.display = 'none';
657
- document.body.appendChild(hiddenTitle);
658
-
659
- return () => {
660
- hiddenTitle.remove();
661
- };
662
- }, [shadowRoot]);
663
-
619
+ function DialogOverlay({
620
+ className,
621
+ ...props
622
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
664
623
  return (
665
- <VisuallyHidden>
666
- <DialogPrimitive.Title ref={titleRef}>{title}</DialogPrimitive.Title>
667
- </VisuallyHidden>
624
+ <DialogPrimitive.Overlay
625
+ data-slot="dialog-overlay"
626
+ className={cn(
627
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
628
+ className,
629
+ )}
630
+ {...props}
631
+ />
668
632
  );
669
633
  }
670
634
 
@@ -676,7 +640,6 @@ function DialogContent({
676
640
  ...props
677
641
  }: React.ComponentProps<typeof DialogPrimitive.Content> & {
678
642
  showCloseButton?: boolean;
679
- title: string;
680
643
  }) {
681
644
  const shadowRoot = useShadowRoot();
682
645
  const darkMode = useShadowDarkMode();
@@ -685,7 +648,6 @@ function DialogContent({
685
648
  <DialogPortal container={shadowRoot} data-slot="dialog-portal">
686
649
  <DialogOverlay className={cn(darkMode ? 'dark' : '', 'overflow-y-auto')}>
687
650
  <DialogPrimitive.Content
688
- aria-label={title}
689
651
  data-slot="dialog-content"
690
652
  className={cn(
691
653
  'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 relative top-[50%] left-[50%] z-50 grid max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-lg border border-gray-200 bg-white p-6 shadow-lg duration-200 sm:max-w-lg dark:border-neutral-700 dark:bg-neutral-800 dark:text-white',
@@ -694,7 +656,9 @@ function DialogContent({
694
656
  )}
695
657
  {...props}
696
658
  >
697
- <ShadowDialogTitle title={title} />
659
+ <VisuallyHidden>
660
+ <DialogTitle>{title}</DialogTitle>
661
+ </VisuallyHidden>
698
662
  {children}
699
663
  {showCloseButton && (
700
664
  <DialogPrimitive.Close
@@ -1577,6 +1541,7 @@ export function Fence({
1577
1541
  import * as SwitchPrimitive from '@radix-ui/react-switch';
1578
1542
  import { rosePineDawnTheme } from './rosePineDawnTheme';
1579
1543
  import { useShadowRoot, useShadowDarkMode } from './StyleMe';
1544
+ import { DialogTitle } from '@radix-ui/react-dialog';
1580
1545
  function Switch({
1581
1546
  className,
1582
1547
  ...props
package/vite.config.ts CHANGED
@@ -7,7 +7,7 @@ import dts from 'unplugin-dts/vite';
7
7
 
8
8
  import { peerDependencies, dependencies } from './package.json';
9
9
 
10
- export default defineConfig(({ mode }) => ({
10
+ export default defineConfig({
11
11
  clearScreen: false,
12
12
  plugins: [react({}), tailwindcss({ optimize: true }), dts({})],
13
13
  resolve: {
@@ -17,9 +17,8 @@ export default defineConfig(({ mode }) => ({
17
17
  },
18
18
  build: {
19
19
  outDir: 'dist',
20
- minify: mode !== 'development',
21
20
  target: 'esnext',
22
- emptyOutDir: mode !== 'development',
21
+ emptyOutDir: false,
23
22
  cssCodeSplit: true,
24
23
  lib: {
25
24
  formats: ['es', 'cjs'],
@@ -47,4 +46,4 @@ export default defineConfig(({ mode }) => ({
47
46
  },
48
47
  },
49
48
  },
50
- }));
49
+ });
@@ -1 +0,0 @@
1
- //# sourceMappingURL=DialogContentPrimitive.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialogContentPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/DialogContentPrimitive.tsx"],"names":[],"mappings":""}
File without changes