@contractspec/bundle.library 3.9.10 → 3.10.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 +54 -40
- package/CHANGELOG.md +47 -0
- package/README.md +1 -0
- package/dist/components/integrations/atoms/IntegrationCredentialFieldList.d.ts +6 -0
- package/dist/components/integrations/atoms/IntegrationCredentialFieldList.js +2 -0
- package/dist/components/integrations/atoms/IntegrationCredentialModeTabs.d.ts +7 -0
- package/dist/components/integrations/atoms/IntegrationCredentialModeTabs.js +2 -0
- package/dist/components/integrations/atoms/IntegrationEnvAliasPreview.d.ts +7 -0
- package/dist/components/integrations/atoms/IntegrationEnvAliasPreview.js +2 -0
- package/dist/components/integrations/blocks/IntegrationCredentialSetupBlock.d.ts +11 -0
- package/dist/components/integrations/blocks/IntegrationCredentialSetupBlock.js +2 -0
- package/dist/components/integrations/byok-env-ui-kit.test.d.ts +1 -0
- package/dist/components/integrations/helpers/credentialSetupAliases.d.ts +3 -0
- package/dist/components/integrations/helpers/credentialSetupAliases.js +2 -0
- package/dist/components/integrations/helpers/credentialSetupModel.d.ts +58 -0
- package/dist/components/integrations/helpers/credentialSetupModel.js +2 -0
- package/dist/components/integrations/index.d.ts +5 -0
- package/dist/components/integrations/index.js +2 -2
- package/dist/components/integrations/organisms/IntegrationSettings.d.ts +3 -1
- package/dist/components/integrations/organisms/IntegrationSettings.js +2 -2
- package/dist/components/integrations/organisms/IntegrationSettingsSecretReference.d.ts +8 -0
- package/dist/components/integrations/organisms/IntegrationSettingsSecretReference.js +2 -0
- package/dist/index.js +302 -302
- package/dist/node/components/integrations/atoms/IntegrationCredentialFieldList.js +1 -0
- package/dist/node/components/integrations/atoms/IntegrationCredentialModeTabs.js +1 -0
- package/dist/node/components/integrations/atoms/IntegrationEnvAliasPreview.js +1 -0
- package/dist/node/components/integrations/blocks/IntegrationCredentialSetupBlock.js +1 -0
- package/dist/node/components/integrations/helpers/credentialSetupAliases.js +1 -0
- package/dist/node/components/integrations/helpers/credentialSetupModel.js +1 -0
- package/dist/node/components/integrations/index.js +2 -2
- package/dist/node/components/integrations/organisms/IntegrationSettings.js +2 -2
- package/dist/node/components/integrations/organisms/IntegrationSettingsSecretReference.js +1 -0
- package/dist/node/index.js +302 -302
- package/package.json +107 -23
- package/src/components/integrations/atoms/IntegrationCredentialFieldList.tsx +51 -0
- package/src/components/integrations/atoms/IntegrationCredentialModeTabs.tsx +44 -0
- package/src/components/integrations/atoms/IntegrationEnvAliasPreview.tsx +56 -0
- package/src/components/integrations/blocks/IntegrationCredentialSetupBlock.tsx +95 -0
- package/src/components/integrations/byok-env-ui-kit.test.tsx +194 -0
- package/src/components/integrations/helpers/credentialSetupAliases.ts +137 -0
- package/src/components/integrations/helpers/credentialSetupModel.ts +218 -0
- package/src/components/integrations/index.ts +5 -0
- package/src/components/integrations/organisms/IntegrationSettings.tsx +91 -97
- package/src/components/integrations/organisms/IntegrationSettingsSecretReference.tsx +84 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
Input,
|
|
4
|
+
Small,
|
|
5
|
+
Text,
|
|
6
|
+
VStack,
|
|
7
|
+
} from '@contractspec/lib.design-system';
|
|
8
|
+
import { Label } from '@contractspec/lib.ui-kit-web/ui/label';
|
|
9
|
+
import {
|
|
10
|
+
Select,
|
|
11
|
+
SelectContent,
|
|
12
|
+
SelectItem,
|
|
13
|
+
SelectTrigger,
|
|
14
|
+
SelectValue,
|
|
15
|
+
} from '@contractspec/lib.ui-kit-web/ui/select';
|
|
16
|
+
import type React from 'react';
|
|
17
|
+
import type { IntegrationSettingsForm } from './IntegrationSettings';
|
|
18
|
+
|
|
19
|
+
export interface IntegrationSettingsSecretReferenceProps {
|
|
20
|
+
values: Pick<IntegrationSettingsForm, 'secretProvider' | 'secretRef'>;
|
|
21
|
+
onSecretProviderChange: (
|
|
22
|
+
next: IntegrationSettingsForm['secretProvider']
|
|
23
|
+
) => void;
|
|
24
|
+
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function IntegrationSettingsSecretReference({
|
|
28
|
+
values,
|
|
29
|
+
onSecretProviderChange,
|
|
30
|
+
onChange,
|
|
31
|
+
}: IntegrationSettingsSecretReferenceProps) {
|
|
32
|
+
return (
|
|
33
|
+
<VStack
|
|
34
|
+
gap="md"
|
|
35
|
+
align="stretch"
|
|
36
|
+
className="rounded-xl border border-blue-500/20 bg-blue-500/5 p-4"
|
|
37
|
+
>
|
|
38
|
+
<Small>BYOK secret reference</Small>
|
|
39
|
+
<Box className="grid gap-4 md:grid-cols-2">
|
|
40
|
+
<VStack gap="sm" align="stretch">
|
|
41
|
+
<Label htmlFor="secretProvider">
|
|
42
|
+
<Text>Secret provider</Text>
|
|
43
|
+
</Label>
|
|
44
|
+
<Select
|
|
45
|
+
value={values.secretProvider ?? 'env'}
|
|
46
|
+
onValueChange={(next) =>
|
|
47
|
+
onSecretProviderChange(
|
|
48
|
+
next as IntegrationSettingsForm['secretProvider']
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
>
|
|
52
|
+
<SelectTrigger id="secretProvider" className="w-full">
|
|
53
|
+
<SelectValue />
|
|
54
|
+
</SelectTrigger>
|
|
55
|
+
<SelectContent>
|
|
56
|
+
<SelectItem value="env">
|
|
57
|
+
<Text>Environment</Text>
|
|
58
|
+
</SelectItem>
|
|
59
|
+
<SelectItem value="gcp">
|
|
60
|
+
<Text>GCP Secret Manager</Text>
|
|
61
|
+
</SelectItem>
|
|
62
|
+
</SelectContent>
|
|
63
|
+
</Select>
|
|
64
|
+
</VStack>
|
|
65
|
+
<VStack gap="sm" align="stretch">
|
|
66
|
+
<Label htmlFor="secretRef">
|
|
67
|
+
<Text>Secret reference</Text>
|
|
68
|
+
</Label>
|
|
69
|
+
<Input
|
|
70
|
+
id="secretRef"
|
|
71
|
+
name="secretRef"
|
|
72
|
+
placeholder={
|
|
73
|
+
values.secretProvider === 'gcp'
|
|
74
|
+
? 'gcp://projects/.../secrets/...'
|
|
75
|
+
: 'env://MY_TOKEN_ENV_VAR'
|
|
76
|
+
}
|
|
77
|
+
value={values.secretRef ?? ''}
|
|
78
|
+
onChange={onChange}
|
|
79
|
+
/>
|
|
80
|
+
</VStack>
|
|
81
|
+
</Box>
|
|
82
|
+
</VStack>
|
|
83
|
+
);
|
|
84
|
+
}
|