@galaxy-io/dls 2.13.5 → 2.13.7
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/dist/brand/GalaxyAlchemyWordmark.d.ts +3 -2
- package/dist/brand/GalaxyAlchemyWordmark.js +13 -6
- package/dist/brand/GalaxyFilamentWordmark.d.ts +3 -1
- package/dist/brand/GalaxyFilamentWordmark.js +13 -6
- package/dist/brand/GalaxyLatchkeyWordmark.d.ts +35 -0
- package/dist/brand/GalaxyLatchkeyWordmark.js +52 -0
- package/dist/brand/GalaxyLogomark.js +1 -1
- package/dist/brand/PoweredBy.d.ts +3 -1
- package/dist/brand/PoweredBy.js +23 -33
- package/dist/brand/brandMark.d.ts +35 -0
- package/dist/brand/brandMark.js +30 -4
- package/dist/brand/internal/svg/GalaxyLatchkeyWordmarkSvg.d.ts +13 -0
- package/dist/brand/internal/svg/GalaxyLatchkeyWordmarkSvg.js +59 -0
- package/dist/inputs/KeyValueInput.d.ts +10 -0
- package/dist/inputs/KeyValueInput.js +35 -2
- package/dist/inputs/PasswordInput.d.ts +28 -0
- package/dist/inputs/PasswordInput.js +9 -4
- package/dist/styles.css +1 -1
- package/package.json +5 -1
|
@@ -6,6 +6,20 @@ export type PasswordInputProps = Omit<InputProps, "type" | "trailing" | "isClear
|
|
|
6
6
|
* @default "current-password"
|
|
7
7
|
*/
|
|
8
8
|
autoComplete?: InputProps["autoComplete"];
|
|
9
|
+
/** Controlled reveal state: `true` shows the value as text. Pass it with `onRevealedChange`. */
|
|
10
|
+
isRevealed?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Initial reveal state while uncontrolled.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
defaultIsRevealed?: boolean;
|
|
16
|
+
/** Called with the next reveal state when the toggle is pressed. */
|
|
17
|
+
onRevealedChange?: (isRevealed: boolean) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Accessible name of the reveal toggle. Name the field when several share a view ("Show value 2").
|
|
20
|
+
* @default "Show password"
|
|
21
|
+
*/
|
|
22
|
+
revealAriaLabel?: string;
|
|
9
23
|
};
|
|
10
24
|
/** A masked single-line field with a "Show password" toggle: `Input` with `type="password"`. */
|
|
11
25
|
declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<InputProps, "type" | "trailing" | "spellCheck" | "prefix" | "inputMode" | "suffix" | "autoComplete" | "isClearable"> & {
|
|
@@ -14,5 +28,19 @@ declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<Inpu
|
|
|
14
28
|
* @default "current-password"
|
|
15
29
|
*/
|
|
16
30
|
autoComplete?: InputProps["autoComplete"];
|
|
31
|
+
/** Controlled reveal state: `true` shows the value as text. Pass it with `onRevealedChange`. */
|
|
32
|
+
isRevealed?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Initial reveal state while uncontrolled.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
defaultIsRevealed?: boolean;
|
|
38
|
+
/** Called with the next reveal state when the toggle is pressed. */
|
|
39
|
+
onRevealedChange?: (isRevealed: boolean) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Accessible name of the reveal toggle. Name the field when several share a view ("Show value 2").
|
|
42
|
+
* @default "Show password"
|
|
43
|
+
*/
|
|
44
|
+
revealAriaLabel?: string;
|
|
17
45
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
18
46
|
export default PasswordInput;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { useControlledState } from "../hooks/useControlledState.js";
|
|
1
2
|
import Button, { ButtonVariant } from "../buttons/Button.js";
|
|
2
3
|
import "./internal/innerButton.js";
|
|
3
4
|
import Input, { INPUT_SIZE_TO_BUTTON_SIZE_MAP, InputSize } from "./Input.js";
|
|
4
|
-
import { forwardRef
|
|
5
|
+
import { forwardRef } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
import { cx } from "@linaria/core";
|
|
7
8
|
import { EyeIcon, EyeSlashIcon } from "@phosphor-icons/react";
|
|
@@ -21,13 +22,17 @@ import { EyeIcon, EyeSlashIcon } from "@phosphor-icons/react";
|
|
|
21
22
|
*/
|
|
22
23
|
/** A masked single-line field with a "Show password" toggle: `Input` with `type="password"`. */
|
|
23
24
|
var PasswordInput = forwardRef(function PasswordInput(props, ref) {
|
|
24
|
-
const { autoComplete = "current-password", size = InputSize.MEDIUM, isDisabled = false, ...rest } = props;
|
|
25
|
-
const [isRevealed, setIsRevealed] =
|
|
25
|
+
const { autoComplete = "current-password", size = InputSize.MEDIUM, isDisabled = false, isRevealed: isRevealedProp, defaultIsRevealed = false, onRevealedChange, revealAriaLabel = "Show password", ...rest } = props;
|
|
26
|
+
const [isRevealed, setIsRevealed] = useControlledState({
|
|
27
|
+
value: isRevealedProp,
|
|
28
|
+
defaultValue: defaultIsRevealed,
|
|
29
|
+
onChange: onRevealedChange
|
|
30
|
+
});
|
|
26
31
|
const toggle = /* @__PURE__ */ jsx(Button, {
|
|
27
32
|
variant: ButtonVariant.TERTIARY,
|
|
28
33
|
size: INPUT_SIZE_TO_BUTTON_SIZE_MAP[size],
|
|
29
34
|
icon: isRevealed ? EyeSlashIcon : EyeIcon,
|
|
30
|
-
ariaLabel:
|
|
35
|
+
ariaLabel: revealAriaLabel,
|
|
31
36
|
"aria-pressed": isRevealed,
|
|
32
37
|
isDisabled,
|
|
33
38
|
onClick: () => setIsRevealed(!isRevealed),
|