@instantdb/components 0.22.91-experimental.btnfix.20320360874.1 → 0.22.91-experimental.btnfix.20321339485.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/.turbo/turbo-build.log +5 -5
- package/dist/components/DialogContentPrimitive.d.ts +1 -0
- package/dist/components/DialogContentPrimitive.d.ts.map +1 -0
- package/dist/components/ui.d.ts +2 -1
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +714 -711
- package/package.json +7 -7
- package/src/components/DialogContentPrimitive.tsx +0 -0
- package/src/components/explorer/inner-explorer.tsx +1 -1
- package/src/components/explorer/table-components.tsx +2 -2
- package/src/components/ui.tsx +51 -22
- package/vite.config.ts +3 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instantdb/components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.22.91-experimental.btnfix.
|
|
4
|
+
"version": "0.22.91-experimental.btnfix.20321339485.1",
|
|
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/
|
|
97
|
-
"@instantdb/
|
|
98
|
-
"@instantdb/
|
|
99
|
-
"@instantdb/
|
|
100
|
-
"@instantdb/
|
|
96
|
+
"@instantdb/admin": "0.22.91-experimental.btnfix.20321339485.1",
|
|
97
|
+
"@instantdb/core": "0.22.91-experimental.btnfix.20321339485.1",
|
|
98
|
+
"@instantdb/react": "0.22.91-experimental.btnfix.20321339485.1",
|
|
99
|
+
"@instantdb/platform": "0.22.91-experimental.btnfix.20321339485.1",
|
|
100
|
+
"@instantdb/version": "0.22.91-experimental.btnfix.20321339485.1"
|
|
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",
|
|
105
|
+
"dev": "vite build --watch --mode development",
|
|
106
106
|
"publish-package": "pnpm pack && npm publish *.tgz --access public",
|
|
107
107
|
"dev:demo": "vite"
|
|
108
108
|
}
|
|
File without changes
|
|
@@ -1212,7 +1212,7 @@ export const InnerExplorer: React.FC<{
|
|
|
1212
1212
|
{numItemsSelected > 0 && (
|
|
1213
1213
|
<div className="flex items-center gap-2 pl-4">
|
|
1214
1214
|
<DropdownMenu open={dropdownOpen} onOpenChange={setDropdownOpen}>
|
|
1215
|
-
<DropdownMenuTrigger
|
|
1215
|
+
<DropdownMenuTrigger>
|
|
1216
1216
|
<Button
|
|
1217
1217
|
onClick={() => {
|
|
1218
1218
|
setDropdownOpen(true);
|
|
@@ -246,7 +246,7 @@ export const TableCell = ({ cell }: { cell: Cell<any, unknown> }) => {
|
|
|
246
246
|
return (
|
|
247
247
|
<Tooltip>
|
|
248
248
|
{' '}
|
|
249
|
-
<TooltipTrigger asChild>
|
|
249
|
+
<TooltipTrigger className="text-left" asChild>
|
|
250
250
|
<div
|
|
251
251
|
ref={(el) => {
|
|
252
252
|
setNodeRef(el);
|
|
@@ -256,7 +256,7 @@ export const TableCell = ({ cell }: { cell: Cell<any, unknown> }) => {
|
|
|
256
256
|
...style,
|
|
257
257
|
padding: disablePadding ? 0 : '0.5rem',
|
|
258
258
|
}}
|
|
259
|
-
className={cn(`cursor-default truncate whitespace-nowrap
|
|
259
|
+
className={cn(`cursor-default truncate whitespace-nowrap`)}
|
|
260
260
|
key={cell.id}
|
|
261
261
|
>
|
|
262
262
|
<span
|
package/src/components/ui.tsx
CHANGED
|
@@ -616,19 +616,55 @@ function DialogPortal({
|
|
|
616
616
|
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
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
|
+
|
|
623
664
|
return (
|
|
624
|
-
<
|
|
625
|
-
|
|
626
|
-
|
|
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
|
-
/>
|
|
665
|
+
<VisuallyHidden>
|
|
666
|
+
<DialogPrimitive.Title ref={titleRef}>{title}</DialogPrimitive.Title>
|
|
667
|
+
</VisuallyHidden>
|
|
632
668
|
);
|
|
633
669
|
}
|
|
634
670
|
|
|
@@ -640,6 +676,7 @@ function DialogContent({
|
|
|
640
676
|
...props
|
|
641
677
|
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
642
678
|
showCloseButton?: boolean;
|
|
679
|
+
title: string;
|
|
643
680
|
}) {
|
|
644
681
|
const shadowRoot = useShadowRoot();
|
|
645
682
|
const darkMode = useShadowDarkMode();
|
|
@@ -648,6 +685,7 @@ function DialogContent({
|
|
|
648
685
|
<DialogPortal container={shadowRoot} data-slot="dialog-portal">
|
|
649
686
|
<DialogOverlay className={cn(darkMode ? 'dark' : '', 'overflow-y-auto')}>
|
|
650
687
|
<DialogPrimitive.Content
|
|
688
|
+
aria-label={title}
|
|
651
689
|
data-slot="dialog-content"
|
|
652
690
|
className={cn(
|
|
653
691
|
'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',
|
|
@@ -656,9 +694,7 @@ function DialogContent({
|
|
|
656
694
|
)}
|
|
657
695
|
{...props}
|
|
658
696
|
>
|
|
659
|
-
<
|
|
660
|
-
<DialogTitle>{title}</DialogTitle>
|
|
661
|
-
</VisuallyHidden>
|
|
697
|
+
<ShadowDialogTitle title={title} />
|
|
662
698
|
{children}
|
|
663
699
|
{showCloseButton && (
|
|
664
700
|
<DialogPrimitive.Close
|
|
@@ -703,12 +739,6 @@ export function Dialog({
|
|
|
703
739
|
}}
|
|
704
740
|
open={open}
|
|
705
741
|
>
|
|
706
|
-
<VisuallyHidden>
|
|
707
|
-
<DialogTitle>{title}</DialogTitle>
|
|
708
|
-
<DialogPrimitive.DialogDescription>
|
|
709
|
-
{title}
|
|
710
|
-
</DialogPrimitive.DialogDescription>
|
|
711
|
-
</VisuallyHidden>
|
|
712
742
|
<DialogContent
|
|
713
743
|
title={title}
|
|
714
744
|
onFocusCapture={(e) => {
|
|
@@ -1547,7 +1577,6 @@ export function Fence({
|
|
|
1547
1577
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
1548
1578
|
import { rosePineDawnTheme } from './rosePineDawnTheme';
|
|
1549
1579
|
import { useShadowRoot, useShadowDarkMode } from './StyleMe';
|
|
1550
|
-
import { DialogTitle } from '@radix-ui/react-dialog';
|
|
1551
1580
|
function Switch({
|
|
1552
1581
|
className,
|
|
1553
1582
|
...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({
|
|
10
|
+
export default defineConfig(({ mode }) => ({
|
|
11
11
|
clearScreen: false,
|
|
12
12
|
plugins: [react({}), tailwindcss({ optimize: true }), dts({})],
|
|
13
13
|
resolve: {
|
|
@@ -17,6 +17,7 @@ export default defineConfig({
|
|
|
17
17
|
},
|
|
18
18
|
build: {
|
|
19
19
|
outDir: 'dist',
|
|
20
|
+
minify: mode != 'development',
|
|
20
21
|
target: 'esnext',
|
|
21
22
|
emptyOutDir: false,
|
|
22
23
|
cssCodeSplit: true,
|
|
@@ -46,4 +47,4 @@ export default defineConfig({
|
|
|
46
47
|
},
|
|
47
48
|
},
|
|
48
49
|
},
|
|
49
|
-
});
|
|
50
|
+
}));
|