@shipfox/client-secrets 21.0.0 → 22.0.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": "@shipfox/client-secrets",
3
3
  "license": "MIT",
4
- "version": "21.0.0",
4
+ "version": "22.0.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -27,11 +27,11 @@
27
27
  "dependencies": {
28
28
  "@swc/helpers": "^0.5.17",
29
29
  "@tanstack/react-form": "^1.32.0",
30
+ "@shipfox/api-secrets-dto": "12.0.0",
30
31
  "@shipfox/client-api": "6.0.1",
31
- "@shipfox/client-shell": "21.0.0",
32
- "@shipfox/client-ui": "21.0.0",
33
- "@shipfox/react-ui": "2.0.0",
34
- "@shipfox/api-secrets-dto": "12.0.0"
32
+ "@shipfox/client-shell": "22.0.1",
33
+ "@shipfox/client-ui": "22.0.0",
34
+ "@shipfox/react-ui": "2.1.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@tanstack/react-query": "^5.101.0",
@@ -1,32 +1,27 @@
1
+ import {Panel, PanelBody, PanelRow} from '@shipfox/react-ui/panel';
1
2
  import {Skeleton} from '@shipfox/react-ui/skeleton';
2
- import {cn} from '@shipfox/react-ui/utils';
3
-
4
- export const STORE_SURFACE_CLASS =
5
- 'overflow-hidden rounded-8 border border-border-neutral-base bg-background-neutral-base';
6
3
 
7
4
  /** Placeholder rows shown while the store list loads. */
8
5
  export function StoreRowsSkeleton({label}: {label: string}) {
9
6
  return (
10
- <div role="status" aria-label={label} className={STORE_SURFACE_CLASS}>
11
- <ul className="divide-y divide-border-neutral-base">
12
- {[0, 1, 2].map((row) => (
13
- <li key={row} className="flex items-center gap-cluster px-row py-row">
14
- <Skeleton className="h-16 w-140" />
15
- <Skeleton className="h-16 w-96" />
16
- <Skeleton className="ml-auto h-14 w-80 shrink-0" />
17
- </li>
18
- ))}
19
- </ul>
20
- </div>
7
+ <Panel>
8
+ <PanelBody asChild>
9
+ <ul role="status" aria-label={label}>
10
+ {[0, 1, 2].map((row) => (
11
+ <PanelRow
12
+ asChild
13
+ className="justify-start gap-cluster hover:bg-background-neutral-base"
14
+ key={row}
15
+ >
16
+ <li>
17
+ <Skeleton className="h-16 w-140" />
18
+ <Skeleton className="h-16 w-96" />
19
+ <Skeleton className="ml-auto h-14 w-80 shrink-0" />
20
+ </li>
21
+ </PanelRow>
22
+ ))}
23
+ </ul>
24
+ </PanelBody>
25
+ </Panel>
21
26
  );
22
27
  }
23
-
24
- export function StoreSurface({
25
- className,
26
- children,
27
- }: {
28
- className?: string;
29
- children: React.ReactNode;
30
- }) {
31
- return <div className={cn(STORE_SURFACE_CLASS, className)}>{children}</div>;
32
- }
@@ -27,12 +27,11 @@ import {copyKeyName} from './copy-key.js';
27
27
  import {DeleteEntryDialog} from './delete-entry-dialog.js';
28
28
  import {secretsErrorToFormError} from './form-errors.js';
29
29
  import {SecretForm} from './secret-form.js';
30
- import {StoreRowsSkeleton, StoreSurface} from './store-section-shell.js';
30
+ import {StoreRowsSkeleton} from './store-section-shell.js';
31
31
 
32
- const SECRETS_DESCRIPTION =
33
- 'Encrypted, write-only values for sensitive data like API keys, tokens, and passwords.';
34
32
  const EMPTY_SECRETS_DESCRIPTION =
35
33
  'Create a secret to store sensitive values like API keys, tokens, and passwords.';
34
+ const SECRETS_SECURITY_NOTE = 'Encrypted, write-only values for sensitive data.';
36
35
 
37
36
  type FormState = {mode: 'create'} | {mode: 'edit'; key: string} | null;
38
37
 
@@ -58,9 +57,9 @@ export function WorkspaceSecretsSection({workspaceId}: {workspaceId: string}) {
58
57
  <section className="flex flex-col gap-group" aria-label="Secrets">
59
58
  <div className="flex items-start justify-between gap-group">
60
59
  <div className="flex flex-col gap-tight">
61
- <Header variant="h3">Secrets</Header>
60
+ <Header variant="h1">Secrets</Header>
62
61
  <Text size="sm" className="text-foreground-neutral-muted">
63
- {SECRETS_DESCRIPTION}
62
+ {SECRETS_SECURITY_NOTE}
64
63
  </Text>
65
64
  </div>
66
65
  <Button size="sm" onClick={() => setFormState({mode: 'create'})}>
@@ -71,24 +70,25 @@ export function WorkspaceSecretsSection({workspaceId}: {workspaceId: string}) {
71
70
  {secretsQuery.isPending ? <StoreRowsSkeleton label="Loading secrets" /> : null}
72
71
 
73
72
  {secretsQuery.isError && secretsQuery.data === undefined ? (
74
- <StoreSurface className="px-row">
75
- <QueryLoadError query={secretsQuery} subject="secrets" />
76
- </StoreSurface>
73
+ <Panel>
74
+ <QueryLoadError query={secretsQuery} subject="secrets" variant="panel" />
75
+ </Panel>
77
76
  ) : null}
78
77
 
79
78
  {secretsQuery.data !== undefined && secrets.length === 0 ? (
80
- <StoreSurface className="px-row">
79
+ <Panel>
81
80
  <EmptyState
82
81
  icon="keyLine"
83
82
  title="No secrets yet"
84
83
  description={EMPTY_SECRETS_DESCRIPTION}
84
+ variant="panel"
85
85
  action={
86
86
  <Button size="sm" onClick={() => setFormState({mode: 'create'})}>
87
87
  Create secret
88
88
  </Button>
89
89
  }
90
90
  />
91
- </StoreSurface>
91
+ </Panel>
92
92
  ) : null}
93
93
 
94
94
  {secrets.length > 0 ? (
@@ -19,18 +19,16 @@ import {
19
19
  TableRow,
20
20
  } from '@shipfox/react-ui/table';
21
21
  import {toast} from '@shipfox/react-ui/toast';
22
- import {Code, Header, Text} from '@shipfox/react-ui/typography';
22
+ import {Code, Header} from '@shipfox/react-ui/typography';
23
23
  import {useMemo, useState} from 'react';
24
24
  import {type VariablePreview, workspaceStoreScope} from '#core/store.js';
25
25
  import {useDeleteVariableMutation, useVariablesQuery} from '#hooks/api/variables.js';
26
26
  import {copyKeyName} from './copy-key.js';
27
27
  import {DeleteEntryDialog} from './delete-entry-dialog.js';
28
28
  import {secretsErrorToFormError} from './form-errors.js';
29
- import {StoreRowsSkeleton, StoreSurface} from './store-section-shell.js';
29
+ import {StoreRowsSkeleton} from './store-section-shell.js';
30
30
  import {VariableForm} from './variable-form.js';
31
31
 
32
- const VARIABLES_DESCRIPTION =
33
- 'Plaintext configuration values for non-sensitive data like regions, flags, and log levels.';
34
32
  const EMPTY_VARIABLES_DESCRIPTION =
35
33
  'Create a variable to store non-sensitive configuration like regions, flags, and log levels.';
36
34
 
@@ -58,10 +56,7 @@ export function WorkspaceVariablesSection({workspaceId}: {workspaceId: string})
58
56
  <section className="flex flex-col gap-group" aria-label="Variables">
59
57
  <div className="flex items-start justify-between gap-group">
60
58
  <div className="flex flex-col gap-tight">
61
- <Header variant="h3">Variables</Header>
62
- <Text size="sm" className="text-foreground-neutral-muted">
63
- {VARIABLES_DESCRIPTION}
64
- </Text>
59
+ <Header variant="h1">Variables</Header>
65
60
  </div>
66
61
  <Button size="sm" onClick={() => setFormState({mode: 'create'})}>
67
62
  Create variable
@@ -71,24 +66,25 @@ export function WorkspaceVariablesSection({workspaceId}: {workspaceId: string})
71
66
  {variablesQuery.isPending ? <StoreRowsSkeleton label="Loading variables" /> : null}
72
67
 
73
68
  {variablesQuery.isError && variablesQuery.data === undefined ? (
74
- <StoreSurface className="px-row">
75
- <QueryLoadError query={variablesQuery} subject="variables" />
76
- </StoreSurface>
69
+ <Panel>
70
+ <QueryLoadError query={variablesQuery} subject="variables" variant="panel" />
71
+ </Panel>
77
72
  ) : null}
78
73
 
79
74
  {variablesQuery.data !== undefined && variables.length === 0 ? (
80
- <StoreSurface className="px-row">
75
+ <Panel>
81
76
  <EmptyState
82
77
  icon="bracesLine"
83
78
  title="No variables yet"
84
79
  description={EMPTY_VARIABLES_DESCRIPTION}
80
+ variant="panel"
85
81
  action={
86
82
  <Button size="sm" onClick={() => setFormState({mode: 'create'})}>
87
83
  Create variable
88
84
  </Button>
89
85
  }
90
86
  />
91
- </StoreSurface>
87
+ </Panel>
92
88
  ) : null}
93
89
 
94
90
  {variables.length > 0 ? (