mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 05:26:25 +00:00
Merge pull request #3434 from Infisical/fix/improveRandomValueGeneratorUI
Improve random value generator modal UI
This commit is contained in:
@@ -112,9 +112,8 @@ const PasswordGeneratorModal = ({
|
|||||||
className="w-full max-w-lg rounded-lg border border-mineshaft-600 bg-mineshaft-800 shadow-xl"
|
className="w-full max-w-lg rounded-lg border border-mineshaft-600 bg-mineshaft-800 shadow-xl"
|
||||||
>
|
>
|
||||||
<div className="p-6">
|
<div className="p-6">
|
||||||
<h2 className="mb-1 text-xl font-semibold text-bunker-200">Password Generator</h2>
|
<h2 className="mb-1 text-xl font-semibold text-bunker-200">Generate Random Value</h2>
|
||||||
<p className="mb-6 text-sm text-bunker-400">Generate strong unique passwords</p>
|
<p className="mb-6 text-sm text-bunker-400">Generate strong unique values</p>
|
||||||
|
|
||||||
<div className="relative mb-4 rounded-md bg-mineshaft-900 p-4">
|
<div className="relative mb-4 rounded-md bg-mineshaft-900 p-4">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="w-4/5 select-all break-all pr-2 font-mono text-lg">{password}</div>
|
<div className="w-4/5 select-all break-all pr-2 font-mono text-lg">{password}</div>
|
||||||
@@ -146,18 +145,18 @@ const PasswordGeneratorModal = ({
|
|||||||
|
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<div className="mb-1 flex items-center justify-between">
|
<div className="mb-1 flex items-center justify-between">
|
||||||
<label htmlFor="password-length" className="text-sm text-bunker-300">
|
<label htmlFor="value-length" className="text-sm text-bunker-300">
|
||||||
Password length: {passwordOptions.length}
|
Length: {passwordOptions.length}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<Slider
|
<Slider
|
||||||
id="password-length"
|
id="value-length"
|
||||||
min={minLength}
|
min={minLength}
|
||||||
max={maxLength}
|
max={maxLength}
|
||||||
value={passwordOptions.length}
|
value={passwordOptions.length}
|
||||||
onChange={(value) => setPasswordOptions({ ...passwordOptions, length: value })}
|
onChange={(value) => setPasswordOptions({ ...passwordOptions, length: value })}
|
||||||
className="mb-1"
|
className="mb-1"
|
||||||
aria-labelledby="password-length-label"
|
aria-labelledby="value-length-label"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -219,7 +218,7 @@ const PasswordGeneratorModal = ({
|
|||||||
onClick={usePassword}
|
onClick={usePassword}
|
||||||
className="ml-2"
|
className="ml-2"
|
||||||
>
|
>
|
||||||
Use Password
|
Use Value
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -251,12 +250,13 @@ export const PasswordGenerator = ({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<IconButton
|
<IconButton
|
||||||
ariaLabel="generate password"
|
ariaLabel="generate value"
|
||||||
colorSchema="secondary"
|
colorSchema="primary"
|
||||||
|
variant="outline_bg"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={toggleGenerator}
|
onClick={toggleGenerator}
|
||||||
isDisabled={isDisabled}
|
isDisabled={isDisabled}
|
||||||
className="rounded text-bunker-400 transition-colors duration-150 hover:bg-mineshaft-700 hover:text-bunker-200"
|
className="rounded"
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faKey} />
|
<FontAwesomeIcon icon={faKey} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|||||||
Reference in New Issue
Block a user