@instantdb/components 0.22.89-experimental.drewh-require-app-and-admin.20279445710.1 → 0.22.89-experimental.drewh-dialog-titles.20280021373.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@instantdb/components",
3
3
  "private": false,
4
- "version": "0.22.89-experimental.drewh-require-app-and-admin.20279445710.1",
4
+ "version": "0.22.89-experimental.drewh-dialog-titles.20280021373.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",
@@ -74,6 +74,7 @@
74
74
  "@radix-ui/react-switch": "^1.2.6",
75
75
  "@radix-ui/react-toggle-group": "^1.0.4",
76
76
  "@radix-ui/react-tooltip": "^1.1.7",
77
+ "@radix-ui/react-visually-hidden": "^1.2.4",
77
78
  "@tanstack/react-table": "^8.21.3",
78
79
  "clsx": "^2.1.0",
79
80
  "copy-to-clipboard": "^3.3.3",
@@ -92,11 +93,11 @@
92
93
  "swr": "^2.2.4",
93
94
  "tailwind-merge": "^2.2.1",
94
95
  "uuid": "^11.1.0",
95
- "@instantdb/core": "0.22.89-experimental.drewh-require-app-and-admin.20279445710.1",
96
- "@instantdb/platform": "0.22.89-experimental.drewh-require-app-and-admin.20279445710.1",
97
- "@instantdb/admin": "0.22.89-experimental.drewh-require-app-and-admin.20279445710.1",
98
- "@instantdb/react": "0.22.89-experimental.drewh-require-app-and-admin.20279445710.1",
99
- "@instantdb/version": "0.22.89-experimental.drewh-require-app-and-admin.20279445710.1"
96
+ "@instantdb/platform": "0.22.89-experimental.drewh-dialog-titles.20280021373.1",
97
+ "@instantdb/admin": "0.22.89-experimental.drewh-dialog-titles.20280021373.1",
98
+ "@instantdb/react": "0.22.89-experimental.drewh-dialog-titles.20280021373.1",
99
+ "@instantdb/core": "0.22.89-experimental.drewh-dialog-titles.20280021373.1",
100
+ "@instantdb/version": "0.22.89-experimental.drewh-dialog-titles.20280021373.1"
100
101
  },
101
102
  "scripts": {
102
103
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -55,10 +55,10 @@ export const ExplorerLayout = ({
55
55
  props.className,
56
56
  )}
57
57
  >
58
- <Dialog {...recentlyDeletedNsDialog}>
58
+ <Dialog title="Recently Deleted Namespaces" {...recentlyDeletedNsDialog}>
59
59
  <RecentlyDeletedNamespaces appId={props.appId} db={db} />
60
60
  </Dialog>
61
- <Dialog {...newNsDialog}>
61
+ <Dialog title="New Namespace" {...newNsDialog}>
62
62
  <NewNamespaceDialog
63
63
  db={db}
64
64
  onClose={(p) => {
@@ -120,20 +120,12 @@ export const Explorer = (_props: WithOptional<ExplorerProps>) => {
120
120
  const [_explorerState, _setExplorerState] = useState<ExplorerNav | null>(
121
121
  null,
122
122
  );
123
-
124
123
  const props: WithDefaults<ExplorerProps> = fillPropsWithDefaults(
125
124
  _props,
126
125
  _explorerState,
127
126
  _setExplorerState,
128
127
  );
129
128
 
130
- if (!props.adminToken) {
131
- throw new Error('adminToken is required for explorer');
132
- }
133
- if (!props.appId) {
134
- throw new Error('appId is required for explorer');
135
- }
136
-
137
129
  // inside the component avoid setting explorer state directly
138
130
  // if change could be useful for history
139
131
  const { explorerState, setExplorerState } = props;
@@ -830,6 +830,7 @@ export const InnerExplorer: React.FC<{
830
830
  return (
831
831
  <>
832
832
  <Dialog
833
+ title="Delete Rows"
833
834
  open={deleteDataConfirmationOpen}
834
835
  onClose={() => setDeleteDataConfirmationOpen(false)}
835
836
  >
@@ -900,6 +901,7 @@ export const InnerExplorer: React.FC<{
900
901
  ) : null}
901
902
  </Dialog>
902
903
  <Dialog
904
+ title="Edit Row"
903
905
  open={addItemDialogOpen}
904
906
  onClose={() => setAddItemDialogOpen(false)}
905
907
  >
@@ -913,6 +915,7 @@ export const InnerExplorer: React.FC<{
913
915
  ) : null}
914
916
  </Dialog>
915
917
  <Dialog
918
+ title="Edit Row"
916
919
  open={!!selectedEditableItem}
917
920
  onClose={() => setEditableRowId(null)}
918
921
  >
@@ -926,6 +929,7 @@ export const InnerExplorer: React.FC<{
926
929
  ) : null}
927
930
  </Dialog>
928
931
  <Dialog
932
+ title="Edit Namespace"
929
933
  stopFocusPropagation={true}
930
934
  open={Boolean(editNs)}
931
935
  onClose={() => setEditNs(null)}
@@ -25,6 +25,7 @@ export const ViewSettings = ({
25
25
  onClick={() => setDialogOpen(true)}
26
26
  />
27
27
  <Dialog
28
+ title="Explorer View Settings"
28
29
  hideCloseButton={true}
29
30
  onClose={() => setDialogOpen(false)}
30
31
  open={dialogOpen}
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
  import { Toaster, toast } from 'sonner';
3
+ import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
3
4
  import { Editor, Monaco, OnMount } from '@monaco-editor/react';
4
5
  import type { ClassValue } from 'clsx';
5
6
  import clsx from 'clsx';
@@ -635,6 +636,7 @@ function DialogContent({
635
636
  className,
636
637
  children,
637
638
  showCloseButton = false,
639
+ title,
638
640
  ...props
639
641
  }: React.ComponentProps<typeof DialogPrimitive.Content> & {
640
642
  showCloseButton?: boolean;
@@ -654,6 +656,9 @@ function DialogContent({
654
656
  )}
655
657
  {...props}
656
658
  >
659
+ <VisuallyHidden>
660
+ <DialogTitle>{title}</DialogTitle>
661
+ </VisuallyHidden>
657
662
  {children}
658
663
  {showCloseButton && (
659
664
  <DialogPrimitive.Close
@@ -677,11 +682,13 @@ export function Dialog({
677
682
  children,
678
683
  onClose,
679
684
  className,
685
+ title,
680
686
  stopFocusPropagation = false,
681
687
  hideCloseButton = false,
682
688
  }: {
683
689
  open: boolean;
684
690
  children: React.ReactNode;
691
+ title: string;
685
692
  onClose: () => void;
686
693
  className?: string;
687
694
  stopFocusPropagation?: boolean;
@@ -697,6 +704,7 @@ export function Dialog({
697
704
  open={open}
698
705
  >
699
706
  <DialogContent
707
+ title={title}
700
708
  onFocusCapture={(e) => {
701
709
  if (stopFocusPropagation) {
702
710
  e.stopPropagation();
@@ -1533,6 +1541,7 @@ export function Fence({
1533
1541
  import * as SwitchPrimitive from '@radix-ui/react-switch';
1534
1542
  import { rosePineDawnTheme } from './rosePineDawnTheme';
1535
1543
  import { useShadowRoot, useShadowDarkMode } from './StyleMe';
1544
+ import { DialogTitle } from '@radix-ui/react-dialog';
1536
1545
  function Switch({
1537
1546
  className,
1538
1547
  ...props