@galaxy-io/dls 1.5.16 → 1.5.17

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.
@@ -175,6 +175,8 @@ export interface InputProps<T> {
175
175
  labelTooltip?: string | React.ReactNode;
176
176
  /** Message shown under the field; also switches the border to the error color. */
177
177
  error?: string;
178
+ /** Switches the border to the error color without a message. Implied by `error`. */
179
+ isError?: boolean;
178
180
  /** Appends the red required asterisk to the label. */
179
181
  isRequired?: boolean;
180
182
  isDisabled?: boolean;
@@ -217,7 +217,7 @@ var TrailingActionButton = /*#__PURE__*/ styled("button")({
217
217
  * pin `type` and `parse` for you. Use this directly only for a value type none of
218
218
  * them cover.
219
219
  */
220
- var Input = forwardRef(({ parse, onChange, variant = "PRIMARY", size = "MEDIUM", type, value, label, labelTooltip, error, placeholder, leading, trailing, isRequired, isDisabled, autoFocus, min, max, step, onFocus, onBlur, onKeyDown, width, fillWidth, isMonospace }, ref) => {
220
+ var Input = forwardRef(({ parse, onChange, variant = "PRIMARY", size = "MEDIUM", type, value, label, labelTooltip, error, isError, placeholder, leading, trailing, isRequired, isDisabled, autoFocus, min, max, step, onFocus, onBlur, onKeyDown, width, fillWidth, isMonospace }, ref) => {
221
221
  const handleChange = (e) => {
222
222
  onChange(parse(e.target.value));
223
223
  };
@@ -250,7 +250,7 @@ var Input = forwardRef(({ parse, onChange, variant = "PRIMARY", size = "MEDIUM",
250
250
  $variant: variant,
251
251
  $width: width,
252
252
  $fillWidth: fillWidth || hasLeading || hasTrailing,
253
- $isError: !!error,
253
+ $isError: isError || !!error,
254
254
  $hasLeadingIcon: hasLeading,
255
255
  $hasTrailingAction: hasTrailing,
256
256
  $isMonospace: isMonospace,
@@ -6,5 +6,5 @@ export type NumberInputProps = Omit<InputProps<number>, "type" | "parse">;
6
6
  * where they bound character count) and values outside it are clamped, not
7
7
  * rejected — `onChange` only ever sees an in-range number.
8
8
  */
9
- declare const NumberInput: ({ value, placeholder, label, labelTooltip, variant, size, leading, trailing, error, isRequired, isDisabled, autoFocus, min, max, step, onChange, onFocus, onBlur, onKeyDown, width, fillWidth, isMonospace, }: NumberInputProps) => import("react").JSX.Element;
9
+ declare const NumberInput: ({ value, placeholder, label, labelTooltip, variant, size, leading, trailing, error, isError, isRequired, isDisabled, autoFocus, min, max, step, onChange, onFocus, onBlur, onKeyDown, width, fillWidth, isMonospace, }: NumberInputProps) => import("react").JSX.Element;
10
10
  export default NumberInput;
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
7
7
  * where they bound character count) and values outside it are clamped, not
8
8
  * rejected — `onChange` only ever sees an in-range number.
9
9
  */
10
- var NumberInput = ({ value, placeholder, label, labelTooltip, variant, size, leading, trailing, error, isRequired, isDisabled, autoFocus, min, max, step, onChange, onFocus, onBlur, onKeyDown, width, fillWidth, isMonospace }) => {
10
+ var NumberInput = ({ value, placeholder, label, labelTooltip, variant, size, leading, trailing, error, isError, isRequired, isDisabled, autoFocus, min, max, step, onChange, onFocus, onBlur, onKeyDown, width, fillWidth, isMonospace }) => {
11
11
  return /* @__PURE__ */ jsx(Input, {
12
12
  type: "number",
13
13
  value,
@@ -19,6 +19,7 @@ var NumberInput = ({ value, placeholder, label, labelTooltip, variant, size, lea
19
19
  leading,
20
20
  trailing,
21
21
  error,
22
+ isError,
22
23
  isRequired,
23
24
  isDisabled,
24
25
  autoFocus,
@@ -8,7 +8,7 @@ var DEFAULT_STATE = { showPassword: false };
8
8
  * A masked text field with a built-in reveal toggle in the trailing slot.
9
9
  * Toggling only flips the DOM `type` — the value is never transformed.
10
10
  */
11
- var PasswordInput = forwardRef(({ variant, size, value, placeholder, label, labelTooltip, leading, error, isRequired, isDisabled, autoFocus, onChange, width, fillWidth, onKeyDown, onBlur, onFocus, isMonospace }, ref) => {
11
+ var PasswordInput = forwardRef(({ variant, size, value, placeholder, label, labelTooltip, leading, error, isError, isRequired, isDisabled, autoFocus, onChange, width, fillWidth, onKeyDown, onBlur, onFocus, isMonospace }, ref) => {
12
12
  const [state, setState] = useState(DEFAULT_STATE);
13
13
  return /* @__PURE__ */ jsx(Input, {
14
14
  ref,
@@ -31,6 +31,7 @@ var PasswordInput = forwardRef(({ variant, size, value, placeholder, label, labe
31
31
  isDisabled
32
32
  },
33
33
  error,
34
+ isError,
34
35
  isRequired,
35
36
  isDisabled,
36
37
  autoFocus,
@@ -9,7 +9,7 @@ var DEFAULT_STATE = { error: "" };
9
9
  * `min`/`max` bound the *character count*, not a numeric range — the field
10
10
  * validates length on blur and shows its own error. A `error` you pass wins.
11
11
  */
12
- var TextInput = forwardRef(({ variant, size, value, min, max, placeholder, label, labelTooltip, leading, trailing, error, isRequired, isDisabled, autoFocus, onChange, onKeyDown, onBlur, fillWidth, width, isMonospace }, ref) => {
12
+ var TextInput = forwardRef(({ variant, size, value, min, max, placeholder, label, labelTooltip, leading, trailing, error, isError, isRequired, isDisabled, autoFocus, onChange, onKeyDown, onBlur, fillWidth, width, isMonospace }, ref) => {
13
13
  const [state, setState] = useState(DEFAULT_STATE);
14
14
  const handleFocus = () => {
15
15
  setState({
@@ -45,6 +45,7 @@ var TextInput = forwardRef(({ variant, size, value, min, max, placeholder, label
45
45
  trailing,
46
46
  autoFocus,
47
47
  error: state.error || error,
48
+ isError,
48
49
  isRequired,
49
50
  isDisabled,
50
51
  onKeyDown,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galaxy-io/dls",
3
- "version": "1.5.16",
3
+ "version": "1.5.17",
4
4
  "description": "Galaxy Design Language System",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",