@stenajs-webui/forms 19.0.0-next.7 → 19.0.0-next.70

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.
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ export interface InputLabelProps {
3
+ htmlFor?: string;
4
+ label?: string;
5
+ screenReaderLabel?: string;
6
+ className?: string;
7
+ disabled?: boolean;
8
+ }
9
+ export declare const InputLabel: React.FC<InputLabelProps>;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ export interface InputLabelTextProps {
3
+ disabled?: boolean;
4
+ text?: string;
5
+ }
6
+ export declare const InputLabelText: React.FC<InputLabelTextProps>;
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import { PropsWithChildren } from "react";
3
+ import { ValueAndOnValueChangeProps } from "../types";
4
+ import { SelectElementProps } from "@stenajs-webui/core";
5
+ export declare type SelectBorderVariant = "normalBorder" | "onlyTopBorder" | "onlyBottomBorder";
6
+ export interface LabelledSelectProps extends ValueAndOnValueChangeProps<string>, PropsWithChildren, Omit<SelectElementProps, "value"> {
7
+ id?: string;
8
+ name: string;
9
+ label?: string;
10
+ screenReaderLabel?: string;
11
+ borderVariant?: SelectBorderVariant;
12
+ variant?: LabelledSelectVariant;
13
+ }
14
+ export declare type LabelledSelectVariant = "normal" | "error";
15
+ export declare const LabelledSelect: React.FC<LabelledSelectProps>;
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { InputElementProps } from "@stenajs-webui/core";
3
+ import { ValueAndOnValueChangeProps } from "../types";
4
+ export declare type LabelledTextInputVariant = "normal" | "error";
5
+ export declare type LabelledTextInputSize = "medium" | "large";
6
+ export declare type LabelledTextInputBorderVariant = "normalBorder" | "onlyTop" | "onlyBottom";
7
+ export interface LabelledTextInputProps extends Omit<InputElementProps, "value" | "size">, ValueAndOnValueChangeProps<string> {
8
+ id?: string;
9
+ label?: string;
10
+ size?: LabelledTextInputSize;
11
+ screenReaderLabel?: string;
12
+ pattern?: string;
13
+ borderRadiusVariant?: LabelledTextInputBorderVariant;
14
+ variant?: LabelledTextInputVariant;
15
+ }
16
+ export declare const LabelledTextInput: React.ForwardRefExoticComponent<LabelledTextInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,17 @@
1
+ import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
2
+ import * as React from "react";
3
+ import { RadioButtonProps } from "./RadioButton";
4
+ export declare type RadioButtonBoxVariant = "normal" | "danger";
5
+ export interface RadioButtonBoxProps extends RadioButtonProps {
6
+ label?: string;
7
+ /**
8
+ * If set, this label is used by screen readers instead of label prop.
9
+ * For example, label could be "male", while screenReaderLabel is "Gender male".
10
+ * If not set, screen readers will use label prop.
11
+ */
12
+ screenReaderLabel?: string;
13
+ variant?: RadioButtonBoxVariant;
14
+ icon?: IconDefinition;
15
+ radioButtonClassName?: string;
16
+ }
17
+ export declare const RadioButtonBox: React.FC<RadioButtonBoxProps>;
@@ -10,6 +10,10 @@ interface ExtraContent {
10
10
  contentLeft?: React.ReactNode;
11
11
  /** React node to put to the right. Right icon is ignored if this is set. */
12
12
  contentRight?: React.ReactNode;
13
+ /** TextInputButton to the left. Left icon and content is ignored if this is set. */
14
+ buttonLeft?: React.ReactNode;
15
+ /** React node to put to the right. Right icon and content is ignored if this is set. */
16
+ buttonRight?: React.ReactNode;
13
17
  /** If true, there will be no padding between contentLeft/contentRight and the border. */
14
18
  disableContentPadding?: boolean;
15
19
  /** If true, there will be no padding between contentLeft and the border. */
@@ -20,10 +24,6 @@ interface ExtraContent {
20
24
  iconLeft?: IconDefinition;
21
25
  /** Icon on the right side. */
22
26
  iconRight?: IconDefinition;
23
- /** On click left. */
24
- onClickLeft?: () => void;
25
- /** On click right. */
26
- onClickRight?: () => void;
27
27
  }
28
28
  export interface TextInputProps extends FullOnChangeProps<string, ChangeEvent<HTMLInputElement>>, InputProps, ExtraContent {
29
29
  wrapperStyle?: CSSProperties;
@@ -1,7 +1,13 @@
1
1
  import * as React from "react";
2
2
  import { ReactNode } from "react";
3
3
  import { TextInputProps } from "./TextInput";
4
- export interface TextInputBoxProps extends Pick<TextInputProps, "variant" | "wrapperClassName" | "disabled" | "wrapperStyle" | "contentLeft" | "contentRight" | "disableContentPadding" | "disableContentPaddingLeft" | "disableContentPaddingRight" | "iconRight" | "iconLeft" | "onClickLeft" | "onClickRight"> {
4
+ import { ButtonElementProps } from "@stenajs-webui/core";
5
+ import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
6
+ export interface TextInputBoxProps extends Pick<TextInputProps, "variant" | "wrapperClassName" | "disabled" | "wrapperStyle" | "contentLeft" | "contentRight" | "disableContentPadding" | "disableContentPaddingLeft" | "disableContentPaddingRight"> {
5
7
  children?: ReactNode;
8
+ iconRight?: IconDefinition;
9
+ iconLeft?: IconDefinition;
10
+ onClickLeft?: ButtonElementProps["onClick"];
11
+ onClickRight?: ButtonElementProps["onClick"];
6
12
  }
7
13
  export declare const TextInputBox: React.FC<TextInputBoxProps>;
@@ -3,12 +3,12 @@ import * as React from "react";
3
3
  export interface TextInputIconProps {
4
4
  iconClassName?: string;
5
5
  content?: React.ReactNode;
6
+ button?: React.ReactNode;
6
7
  icon?: IconDefinition;
7
8
  spaceOnRight?: boolean;
8
9
  spaceOnLeft?: boolean;
9
10
  disableContentPadding?: boolean;
10
11
  disableContentPaddingLeft?: boolean;
11
12
  disableContentPaddingRight?: boolean;
12
- onClick?: () => void;
13
13
  }
14
14
  export declare const TextInputIcon: React.FC<TextInputIconProps>;
package/dist/index.d.ts CHANGED
@@ -3,10 +3,15 @@ export * from "./components/ui/switch/SwitchWithLabel";
3
3
  export * from "./components/ui/checkbox/CheckboxWithLabel";
4
4
  export * from "./components/ui/checkbox/Checkbox";
5
5
  export * from "./components/ui/radio/RadioButton";
6
+ export * from "./components/ui/radio/RadioButtonBox";
6
7
  export * from "./components/ui/radio/RadioButtonWithLabel";
7
8
  export * from "./components/ui/numeric-text-input/NumericTextInput";
8
9
  export * from "./components/ui/numeric-text-input/hooks/UseNumericInputValue";
9
10
  export * from "./components/ui/password-input/PasswordInput";
11
+ export * from "./components/ui/input-label/InputLabel";
12
+ export * from "./components/ui/input-label/InputLabelText";
13
+ export * from "./components/ui/labelled-select/LabelledSelect";
14
+ export * from "./components/ui/labelled-text-input/LabelledTextInput";
10
15
  export * from "./components/ui/text-input/TextInput";
11
16
  export * from "./components/ui/text-input/TextInputBox";
12
17
  export * from "./components/ui/text-area/TextArea";