@agility/plenum-ui 2.0.0-rc2 → 2.0.0-rc21
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/README.md +41 -11
- package/build.js +30 -25
- package/dist/index.d.ts +279 -93
- package/dist/index.js +1 -5935
- package/dist/index.js.map +4 -4
- package/dist/tailwind.css +63516 -0
- package/dist/types/stories/atoms/buttons/Button/Alternative/Alternative.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Button.d.ts +7 -9
- package/dist/types/stories/atoms/buttons/Button/Danger/Danger.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Primary/Primary.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Secondary/Secondary.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Capsule/Capsule.d.ts +1 -1
- package/dist/types/stories/atoms/icons/DynamicIcon.d.ts +1 -1
- package/dist/types/stories/atoms/icons/TablerIcon.d.ts +1 -1
- package/dist/types/stories/index.d.ts +4 -4
- package/dist/types/stories/molecules/index.d.ts +3 -3
- package/dist/types/stories/molecules/inputs/InputCounter/InputCounter.d.ts +10 -0
- package/dist/types/stories/molecules/inputs/InputCounter/index.d.ts +2 -0
- package/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +8 -4
- package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +39 -0
- package/dist/types/stories/molecules/inputs/TextInput/index.d.ts +4 -0
- package/dist/types/stories/molecules/inputs/index.d.ts +5 -4
- package/dist/types/stories/molecules/inputs/select/Select.d.ts +2 -2
- package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +34 -21
- package/dist/types/stories/molecules/inputs/textArea/TextArea.stories.d.ts +4 -4
- package/dist/types/stories/molecules/inputs/textArea/index.d.ts +3 -3
- package/dist/types/stories/molecules/inputs/toggleSwitch/ToggleSwitch.d.ts +9 -7
- package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +3 -5
- package/dist/types/stories/organisms/AnimatedLabelInput/index.d.ts +1 -1
- package/dist/types/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.d.ts +12 -0
- package/dist/types/stories/organisms/AnimatedLabelTextArea/index.d.ts +3 -0
- package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +18 -15
- package/dist/types/stories/organisms/DropdownComponent/index.d.ts +2 -2
- package/dist/types/stories/organisms/EmptySectionPlaceholder/index.d.ts +1 -1
- package/dist/types/stories/organisms/TextInputSelect/InputSelect.d.ts +16 -0
- package/dist/types/stories/organisms/TextInputSelect/TextInputSelect.d.ts +48 -0
- package/dist/types/stories/organisms/TextInputSelect/index.d.ts +3 -0
- package/dist/types/stories/organisms/index.d.ts +5 -3
- package/local.sh +100 -0
- package/package.json +35 -18
- package/rollup.config.mjs +42 -0
- package/stories/Introduction.mdx +1 -1
- package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +7 -0
- package/stories/atoms/buttons/Button/Button.tsx +45 -17
- package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +7 -0
- package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +7 -0
- package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +7 -0
- package/stories/atoms/buttons/Capsule/Capsule.tsx +2 -1
- package/stories/atoms/icons/DynamicIcon.tsx +3 -2
- package/stories/atoms/icons/TablerIcon.tsx +1 -1
- package/stories/atoms/loaders/Loader.tsx +12 -6
- package/stories/index.ts +22 -10
- package/stories/molecules/index.ts +22 -6
- package/stories/molecules/inputs/InputCounter/InputCounter.stories.tsx +18 -0
- package/stories/molecules/inputs/InputCounter/InputCounter.tsx +24 -0
- package/stories/molecules/inputs/InputCounter/index.tsx +3 -0
- package/stories/molecules/inputs/InputField/InputField.tsx +13 -7
- package/stories/molecules/inputs/TextInput/TextInput.stories.tsx +32 -0
- package/stories/molecules/inputs/TextInput/TextInput.tsx +165 -0
- package/stories/molecules/inputs/TextInput/index.tsx +5 -0
- package/stories/molecules/inputs/checkbox/Checkbox.tsx +1 -1
- package/stories/molecules/inputs/index.ts +18 -4
- package/stories/molecules/inputs/select/Select.tsx +1 -1
- package/stories/molecules/inputs/textArea/TextArea.stories.ts +7 -5
- package/stories/molecules/inputs/textArea/TextArea.tsx +139 -48
- package/stories/molecules/inputs/textArea/index.ts +3 -3
- package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +61 -57
- package/stories/molecules/tabs/index.tsx +2 -3
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +10 -1
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +43 -37
- package/stories/organisms/AnimatedLabelInput/index.tsx +1 -1
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -0
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -0
- package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -0
- package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +59 -58
- package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +13 -16
- package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +1 -1
- package/stories/organisms/DropdownComponent/DropdownComponent.tsx +155 -131
- package/stories/organisms/DropdownComponent/dropdownItems.ts +32 -8
- package/stories/organisms/DropdownComponent/index.ts +2 -2
- package/stories/organisms/EmptySectionPlaceholder/index.tsx +2 -1
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +7 -2
- package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -0
- package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -0
- package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -0
- package/stories/organisms/TextInputSelect/index.tsx +3 -0
- package/stories/organisms/index.ts +15 -4
- package/tsconfig.lib.json +13 -6
- package/watch.js +50 -0
- package/.yarnrc.yml +0 -1
- package/dist/types/stories/layouts/index.d.ts +0 -0
- package/stories/layouts/CardLayout/CardLayout.stories.tsx +0 -18
- package/stories/layouts/CardLayout/CardLayout.tsx +0 -22
- package/stories/layouts/CardLayout/index.tsx +0 -3
- package/stories/layouts/ModalLayout/ModalLayout.stories.tsx +0 -18
- package/stories/layouts/ModalLayout/ModalLayout.tsx +0 -22
- package/stories/layouts/ModalLayout/index.tsx +0 -3
- package/stories/layouts/index.ts +0 -0
- package/stories/organisms/DropdownComponent/Dropdown.test.tsx +0 -0
|
@@ -7,6 +7,7 @@ export declare const Alternative: Story;
|
|
|
7
7
|
export declare const AlternativeTrailingIcon: Story;
|
|
8
8
|
export declare const AlternativeLeadingIcon: Story;
|
|
9
9
|
export declare const AlternativeExtraSmall: Story;
|
|
10
|
+
export declare const AlternativeSimpleIconName: Story;
|
|
10
11
|
export declare const AlternativeSmall: Story;
|
|
11
12
|
export declare const AlternativeMedium: Story;
|
|
12
13
|
export declare const AlternativeLarge: Story;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { HTMLAttributeAnchorTarget } from "react";
|
|
2
|
-
import { IDynamicIconProps } from "../../icons";
|
|
1
|
+
import React, { HTMLAttributeAnchorTarget } from "react";
|
|
2
|
+
import { UnifiedIconName, IDynamicIconProps } from "../../icons";
|
|
3
3
|
export type BTNActionType = "primary" | "secondary" | "alternative" | "danger";
|
|
4
|
-
export interface IButtonProps extends React.
|
|
4
|
+
export interface IButtonProps extends Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> {
|
|
5
5
|
/** Is the button a Primary CTA, alternative or danger button? */
|
|
6
|
-
actionType
|
|
6
|
+
actionType?: BTNActionType;
|
|
7
7
|
/** How lg should the button be? - Defaults to 'base'. */
|
|
8
8
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
9
9
|
/** The Button's text content. */
|
|
10
10
|
label: string;
|
|
11
11
|
/** The Icon to be displayed inside the button. */
|
|
12
|
-
icon?: IDynamicIconProps;
|
|
12
|
+
icon?: IDynamicIconProps | UnifiedIconName;
|
|
13
13
|
/** Does the button width grow to fill it's container? */
|
|
14
14
|
fullWidth?: boolean;
|
|
15
15
|
/** Optionally render as anchor tag */
|
|
@@ -25,9 +25,7 @@ export interface IButtonProps extends React.ComponentPropsWithoutRef<"button"> {
|
|
|
25
25
|
/** Is the associated content loading? */
|
|
26
26
|
isLoading?: boolean;
|
|
27
27
|
className?: string;
|
|
28
|
+
iconObj?: React.ReactNode;
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
* Primary UI component for user interaction
|
|
31
|
-
*/
|
|
32
|
-
declare const Button: ({ actionType, size, label, icon, CustomSVGIcon, fullWidth, iconPosition, asLink, isLoading, className, ...props }: IButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare const Button: React.ForwardRefExoticComponent<IButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
31
|
export default Button;
|
|
@@ -6,6 +6,7 @@ type Story = StoryObj<typeof Button>;
|
|
|
6
6
|
export declare const Danger: Story;
|
|
7
7
|
export declare const DangerTrailingIcon: Story;
|
|
8
8
|
export declare const DangerLeadingIcon: Story;
|
|
9
|
+
export declare const DangerSimpleIconName: Story;
|
|
9
10
|
export declare const DangerExtraSmall: Story;
|
|
10
11
|
export declare const DangerSmall: Story;
|
|
11
12
|
export declare const DangerMedium: Story;
|
|
@@ -5,6 +5,7 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof Button>;
|
|
6
6
|
export declare const Primary: Story;
|
|
7
7
|
export declare const PrimaryLeadingIcon: Story;
|
|
8
|
+
export declare const PrimarySimpleIconName: Story;
|
|
8
9
|
export declare const PrimaryTrailingIcon: Story;
|
|
9
10
|
export declare const PrimaryExtraSmall: Story;
|
|
10
11
|
export declare const PrimarySmall: Story;
|
|
@@ -6,6 +6,7 @@ type Story = StoryObj<typeof Button>;
|
|
|
6
6
|
export declare const Secondary: Story;
|
|
7
7
|
export declare const SecondaryTrailingIcon: Story;
|
|
8
8
|
export declare const SecondaryLeadingIcon: Story;
|
|
9
|
+
export declare const SecondarySimpleIconName: Story;
|
|
9
10
|
export declare const SecondaryExtraSmall: Story;
|
|
10
11
|
export declare const SecondarySmall: Story;
|
|
11
12
|
export declare const SecondaryMedium: Story;
|
|
@@ -3,7 +3,7 @@ import { BTNActionType } from "../Button/Button";
|
|
|
3
3
|
/**
|
|
4
4
|
* Capsule Style Button
|
|
5
5
|
*/
|
|
6
|
-
export interface ICapsuleProps extends React.
|
|
6
|
+
export interface ICapsuleProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
7
7
|
/** Is the button a Primary CTA, alternative or danger button? */
|
|
8
8
|
actionType: BTNActionType;
|
|
9
9
|
/** How lg should the button be? - Defaults to 'base'. */
|
|
@@ -11,7 +11,7 @@ export declare function isHeroIcon(name: UnifiedIconName): name is keyof typeof
|
|
|
11
11
|
export declare function isTablerIcon(name: UnifiedIconName): name is TablerIconName;
|
|
12
12
|
export declare function isFAIcon(name: UnifiedIconName): name is keyof typeof FA;
|
|
13
13
|
export declare function isUnifiedIconName(name: UnifiedIconName): name is UnifiedIconName;
|
|
14
|
-
export interface IDynamicIconProps
|
|
14
|
+
export interface IDynamicIconProps {
|
|
15
15
|
icon: UnifiedIconName;
|
|
16
16
|
className?: ClassNameWithAutocomplete;
|
|
17
17
|
outline?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TablerIconName } from "./tablerIconNames";
|
|
3
3
|
import { ClassNameWithAutocomplete } from "@/utils/types";
|
|
4
|
-
export interface ITablerIconProps extends React.
|
|
4
|
+
export interface ITablerIconProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
5
5
|
icon: TablerIconName;
|
|
6
6
|
className?: ClassNameWithAutocomplete;
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAvatarProps, IBadgeProps, IButtonProps, ICapsuleProps, IDynamicIconProps, IIconWithShadowProps, ILoaderProps, IRadialProgressProps, UnifiedIconName, IconName, FAIconName, BTNActionType, Avatar, Badge, Button, Capsule, DynamicIcon, IconWithShadow, Loader, RadialProgress, isFAIcon, isHeroIcon, isTablerIcon, isUnifiedIconName } from "./atoms";
|
|
2
|
-
import { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps,
|
|
3
|
-
import { IAnimatedLabelInputProps,
|
|
4
|
-
export type { IAvatarProps, IBadgeProps, IButtonProps, ICapsuleProps, IDynamicIconProps, IIconWithShadowProps, ILoaderProps, IRadialProgressProps, ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps,
|
|
5
|
-
export { Avatar, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select,
|
|
2
|
+
import { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextareaProps, IToggleSwitchProps, AcceptedInputTypes, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, Textarea, ToggleSwitch, TextInput, ITextInputProps, ISimpleSelectOptions } from "./molecules";
|
|
3
|
+
import { IAnimatedLabelInputProps, AnimatedLabelTextArea, IAnimatedLabelTextAreaProps, IButtonDropdownProps, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, AnimatedLabelInput, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, TextInputSelect, ITextInputSelectProps } from "./organisms";
|
|
4
|
+
export type { IAvatarProps, IBadgeProps, IButtonProps, ICapsuleProps, ITextInputSelectProps, IDynamicIconProps, IIconWithShadowProps, ILoaderProps, IRadialProgressProps, ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextareaProps, IToggleSwitchProps, AcceptedInputTypes, IAnimatedLabelInputProps, IAnimatedLabelTextAreaProps, IButtonDropdownProps, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, UnifiedIconName, IconName, FAIconName, BTNActionType, ITextInputProps, ISimpleSelectOptions };
|
|
5
|
+
export { Avatar, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, Textarea, ToggleSwitch, AnimatedLabelInput, AnimatedLabelTextArea, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, Badge, Button, Capsule, DynamicIcon, IconWithShadow, Loader, RadialProgress, isFAIcon, isHeroIcon, isTablerIcon, isUnifiedIconName, TextInput, TextInputSelect };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps,
|
|
2
|
-
export type { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps,
|
|
3
|
-
export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select,
|
|
1
|
+
import { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ISimpleSelectOptions, ITextareaProps, IToggleSwitchProps, AcceptedInputTypes, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, Textarea, ToggleSwitch, ITextInputProps, TextInput } from "./inputs";
|
|
2
|
+
export type { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ISimpleSelectOptions, ITextareaProps, IToggleSwitchProps, AcceptedInputTypes, ITextInputProps };
|
|
3
|
+
export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, Textarea, ToggleSwitch, TextInput };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export interface IInputCounterProps {
|
|
3
|
+
/** Counter limit */
|
|
4
|
+
limit: number | undefined;
|
|
5
|
+
/** Counter current number */
|
|
6
|
+
current: number;
|
|
7
|
+
}
|
|
8
|
+
/** Primary UI component for user interaction */
|
|
9
|
+
declare const InputCounter: FC<IInputCounterProps>;
|
|
10
|
+
export default InputCounter;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type AcceptedInputTypes = "date" | "datetime-local" | "email" | "month" | "number" | "password" | "search" | "submit" | "tel" | "text" | "url";
|
|
3
|
-
export interface IInputFieldProps extends React.
|
|
2
|
+
export type AcceptedInputTypes = "date" | "datetime-local" | "email" | "month" | "number" | "password" | "search" | "submit" | "tel" | "text" | "url" | "currency";
|
|
3
|
+
export interface IInputFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> {
|
|
4
4
|
/** Callback on change */
|
|
5
5
|
handleChange: (value: string) => void;
|
|
6
6
|
/** Input ID*/
|
|
7
|
-
id
|
|
7
|
+
id?: string;
|
|
8
8
|
/** Input Name */
|
|
9
|
-
name
|
|
9
|
+
name?: string;
|
|
10
10
|
/** Force the focus state on the input */
|
|
11
11
|
isFocused?: boolean;
|
|
12
12
|
/** Error condition */
|
|
@@ -23,6 +23,10 @@ export interface IInputFieldProps extends React.ComponentPropsWithoutRef<"input"
|
|
|
23
23
|
required?: boolean;
|
|
24
24
|
/** use input psuedo classes for :valid and :invalid styles. on by default */
|
|
25
25
|
clientSideCheck?: boolean;
|
|
26
|
+
/** Placeholder text */
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
/**ref for input */
|
|
29
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
26
30
|
}
|
|
27
31
|
declare const InputField: React.FC<IInputFieldProps>;
|
|
28
32
|
export default InputField;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AcceptedInputTypes } from "../InputField";
|
|
3
|
+
export interface ITextInputProps {
|
|
4
|
+
/** Input type*/
|
|
5
|
+
type: AcceptedInputTypes;
|
|
6
|
+
/** Input ID */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** Input Name */
|
|
9
|
+
name?: string;
|
|
10
|
+
/** Label for the input */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Force the focus state on the input */
|
|
13
|
+
isFocused?: boolean;
|
|
14
|
+
/** Error state */
|
|
15
|
+
isError?: boolean;
|
|
16
|
+
/** If field is required */
|
|
17
|
+
isRequired?: boolean;
|
|
18
|
+
/** Disabled state */
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
/** Readonly state */
|
|
21
|
+
isReadonly?: boolean;
|
|
22
|
+
/** Set default value */
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
/** Message shown under the text field */
|
|
25
|
+
message?: string;
|
|
26
|
+
/** Input character counter */
|
|
27
|
+
isShowCounter?: boolean;
|
|
28
|
+
/** Max length of input character */
|
|
29
|
+
maxLength?: number;
|
|
30
|
+
/** Callback on change */
|
|
31
|
+
handleChange(value: string): void;
|
|
32
|
+
/** input value */
|
|
33
|
+
value: string;
|
|
34
|
+
/**Placeholder input text*/
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
declare const _TextInput: React.ForwardRefExoticComponent<ITextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
39
|
+
export default _TextInput;
|
|
@@ -4,8 +4,9 @@ import InputField, { AcceptedInputTypes, IInputFieldProps } from "./InputField";
|
|
|
4
4
|
import InputLabel, { IInputLabelProps } from "./InputLabel";
|
|
5
5
|
import NestedInputButton, { INestedInputButtonProps } from "./NestedInputButton";
|
|
6
6
|
import Radio, { IRadioProps } from "./radio";
|
|
7
|
-
import Select, { ISelectProps } from "./select";
|
|
8
|
-
import
|
|
7
|
+
import Select, { ISelectProps, ISimpleSelectOptions } from "./select";
|
|
8
|
+
import Textarea, { ITextareaProps } from "./textArea";
|
|
9
|
+
import TextInput, { ITextInputProps } from "./TextInput";
|
|
9
10
|
import ToggleSwitch, { IToggleSwitchProps } from "./toggleSwitch";
|
|
10
|
-
export type { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps,
|
|
11
|
-
export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select,
|
|
11
|
+
export type { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ISimpleSelectOptions, ITextareaProps, ITextInputProps, IToggleSwitchProps, AcceptedInputTypes };
|
|
12
|
+
export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, Textarea, ToggleSwitch, TextInput };
|
|
@@ -1,26 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/**
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ILabelProps extends React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
3
|
+
display: string;
|
|
4
|
+
htmlFor?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ITextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> {
|
|
7
|
+
/** Input ID */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Input Name */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Label for the input */
|
|
12
|
+
label?: ILabelProps;
|
|
13
|
+
/** Error state */
|
|
12
14
|
isError?: boolean;
|
|
15
|
+
/** If field is required */
|
|
16
|
+
isRequired?: boolean;
|
|
13
17
|
/** Disabled state */
|
|
14
18
|
isDisabled?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/** Set default value */
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
value?: string;
|
|
22
|
+
/** Message shown under the text field */
|
|
23
|
+
message?: string;
|
|
24
|
+
/** Input character counter */
|
|
25
|
+
isShowCounter?: boolean;
|
|
26
|
+
/** Max length of input character */
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
/** Callback on change */
|
|
29
|
+
onChange?(value: string): void;
|
|
30
|
+
/** Number of rows */
|
|
31
|
+
rows?: number;
|
|
32
|
+
/** Number of cols */
|
|
33
|
+
cols?: number;
|
|
34
|
+
placeholder?: string;
|
|
23
35
|
className?: string;
|
|
36
|
+
ref?: React.LegacyRef<HTMLTextAreaElement>;
|
|
24
37
|
}
|
|
25
|
-
declare const
|
|
26
|
-
export default
|
|
38
|
+
declare const Textarea: React.FC<ITextareaProps>;
|
|
39
|
+
export default Textarea;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import
|
|
3
|
-
declare const meta: Meta<typeof
|
|
4
|
-
type Story = StoryObj<typeof
|
|
5
|
-
export declare const
|
|
2
|
+
import Textarea from "./TextArea";
|
|
3
|
+
declare const meta: Meta<typeof Textarea>;
|
|
4
|
+
type Story = StoryObj<typeof Textarea>;
|
|
5
|
+
export declare const DefaultTextarea: Story;
|
|
6
6
|
export default meta;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type {
|
|
3
|
-
export default
|
|
1
|
+
import TextArea, { ITextareaProps } from "./TextArea";
|
|
2
|
+
export type { ITextareaProps };
|
|
3
|
+
export default TextArea;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IDynamicIconProps } from "@/stories/atoms";
|
|
3
|
+
interface ToggleSwitchLabel {
|
|
4
|
+
text: string | JSX.Element;
|
|
5
|
+
className?: string;
|
|
6
|
+
xPosition?: "left" | "right";
|
|
7
|
+
}
|
|
3
8
|
export interface IToggleSwitchProps {
|
|
4
9
|
isChecked: boolean;
|
|
5
10
|
onChange: (isChecked: boolean) => void;
|
|
6
|
-
label?:
|
|
7
|
-
|
|
8
|
-
className?: string;
|
|
9
|
-
xPosition?: "left" | "right";
|
|
10
|
-
};
|
|
11
|
-
screenReaderLabel: string;
|
|
11
|
+
label?: ToggleSwitchLabel;
|
|
12
|
+
screenReaderLabel?: string;
|
|
12
13
|
name: string;
|
|
13
14
|
id: string;
|
|
14
|
-
variant
|
|
15
|
+
variant?: "base" | "short";
|
|
15
16
|
withIcon?: IDynamicIconProps;
|
|
17
|
+
disabled?: boolean;
|
|
16
18
|
}
|
|
17
19
|
declare const ToggleSwitch: React.FC<IToggleSwitchProps>;
|
|
18
20
|
export default ToggleSwitch;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IInputFieldProps } from "@/stories/molecules/inputs/InputField";
|
|
3
|
-
|
|
4
|
-
interface ILabelProps extends React.ComponentPropsWithoutRef<"label"> {
|
|
3
|
+
interface ILabelProps extends React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
5
4
|
display: string;
|
|
6
5
|
}
|
|
7
|
-
export interface IAnimatedLabelInputProps {
|
|
6
|
+
export interface IAnimatedLabelInputProps extends Omit<IInputFieldProps, "handleChange"> {
|
|
8
7
|
id: string;
|
|
9
8
|
containerStyles?: string;
|
|
10
9
|
message?: string;
|
|
11
|
-
input?: IInputFieldProps;
|
|
12
|
-
textarea?: ITextAreaFieldProps;
|
|
13
10
|
required?: boolean;
|
|
14
11
|
isError?: boolean;
|
|
15
12
|
label: ILabelProps;
|
|
13
|
+
handleChange: (value: string) => void;
|
|
16
14
|
}
|
|
17
15
|
declare const AnimatedLabelInput: React.FC<IAnimatedLabelInputProps>;
|
|
18
16
|
export default AnimatedLabelInput;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ITextareaProps } from "@/stories/molecules/inputs/textArea";
|
|
3
|
+
export interface IAnimatedLabelTextAreaProps extends ITextareaProps {
|
|
4
|
+
id: string;
|
|
5
|
+
containerStyles?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
isError?: boolean;
|
|
9
|
+
handleChange: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const AnimatedLabelTextArea: React.FC<IAnimatedLabelTextAreaProps>;
|
|
12
|
+
export default AnimatedLabelTextArea;
|
|
@@ -3,30 +3,25 @@ import { Placement } from "@floating-ui/react";
|
|
|
3
3
|
import { ClassNameWithAutocomplete } from "utils/types";
|
|
4
4
|
import { IDynamicIconProps } from "@/stories/atoms/icons";
|
|
5
5
|
export interface IItemProp extends HTMLAttributes<HTMLButtonElement> {
|
|
6
|
-
icon?:
|
|
7
|
-
|
|
8
|
-
className?: ClassNameWithAutocomplete;
|
|
9
|
-
pos?: "trailing" | "leading";
|
|
10
|
-
outline?: boolean;
|
|
11
|
-
};
|
|
6
|
+
icon?: IDynamicIconProps;
|
|
7
|
+
iconPosition?: "trailing" | "leading";
|
|
12
8
|
label: string;
|
|
13
9
|
onClick?(): void;
|
|
14
10
|
isEmphasized?: boolean;
|
|
15
11
|
key: React.Key;
|
|
16
12
|
}
|
|
17
|
-
export interface IDropdownClassnames {
|
|
18
|
-
groupClassname?: ClassNameWithAutocomplete;
|
|
19
|
-
itemsClassname?: ClassNameWithAutocomplete;
|
|
20
|
-
itemClassname?: ClassNameWithAutocomplete;
|
|
21
|
-
activeItemClassname?: ClassNameWithAutocomplete;
|
|
22
|
-
buttonClassname?: ClassNameWithAutocomplete;
|
|
23
|
-
}
|
|
24
13
|
export interface IDropdownProps extends HTMLAttributes<HTMLDivElement> {
|
|
25
14
|
items: IItemProp[][];
|
|
26
15
|
label: string;
|
|
27
16
|
CustomDropdownTrigger?: React.ReactNode;
|
|
28
17
|
id: string;
|
|
29
|
-
|
|
18
|
+
groupClassname?: ClassNameWithAutocomplete;
|
|
19
|
+
itemsClassname?: ClassNameWithAutocomplete;
|
|
20
|
+
itemClassname?: ClassNameWithAutocomplete;
|
|
21
|
+
activeItemClassname?: ClassNameWithAutocomplete;
|
|
22
|
+
buttonClassname?: ClassNameWithAutocomplete;
|
|
23
|
+
iconClassname?: ClassNameWithAutocomplete;
|
|
24
|
+
iconSpacingClassname?: ClassNameWithAutocomplete;
|
|
30
25
|
placement?: Placement;
|
|
31
26
|
offsetOptions?: Partial<{
|
|
32
27
|
mainAxis: number;
|
|
@@ -34,7 +29,15 @@ export interface IDropdownProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
34
29
|
alignmentAxis: number | null;
|
|
35
30
|
}>;
|
|
36
31
|
}
|
|
37
|
-
export declare const defaultClassNames:
|
|
32
|
+
export declare const defaultClassNames: {
|
|
33
|
+
groupClassname: string;
|
|
34
|
+
itemsClassname: string;
|
|
35
|
+
itemClassname: string;
|
|
36
|
+
activeItemClassname: string;
|
|
37
|
+
buttonClassname: string;
|
|
38
|
+
iconClassname: string;
|
|
39
|
+
iconSpacingClassname: string;
|
|
40
|
+
};
|
|
38
41
|
/** Comment */
|
|
39
42
|
declare const Dropdown: React.FC<IDropdownProps>;
|
|
40
43
|
export default Dropdown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Dropdown, { IItemProp,
|
|
2
|
-
export type { IItemProp,
|
|
1
|
+
import Dropdown, { IItemProp, IDropdownProps, defaultClassNames } from "./DropdownComponent";
|
|
2
|
+
export type { IItemProp, IDropdownProps };
|
|
3
3
|
export { defaultClassNames };
|
|
4
4
|
export default Dropdown;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export type SelectOptions = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export interface InputSelectProps {
|
|
7
|
+
align: "left" | "right";
|
|
8
|
+
/** Show the CTA without Background color and a border seperator */
|
|
9
|
+
inputOptions: SelectOptions[];
|
|
10
|
+
/** Onclick callback */
|
|
11
|
+
onSelectOption?(value: string): void;
|
|
12
|
+
className?: string;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Comment */
|
|
16
|
+
export declare const InputSelect: FC<InputSelectProps>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { AcceptedInputTypes } from "@/stories/molecules";
|
|
3
|
+
export type SelectOptions = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
export interface ITextInputSelectProps {
|
|
8
|
+
/** Input type*/
|
|
9
|
+
type: AcceptedInputTypes;
|
|
10
|
+
/** Input ID */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Input Name */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Label for the input */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** placeholder for the input */
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Force the focus state on the input */
|
|
19
|
+
isFocused?: boolean;
|
|
20
|
+
/** Error state */
|
|
21
|
+
isError?: boolean;
|
|
22
|
+
/** If field is required */
|
|
23
|
+
isRequired?: boolean;
|
|
24
|
+
/** Disabled state */
|
|
25
|
+
isDisabled?: boolean;
|
|
26
|
+
/** Set default value */
|
|
27
|
+
defaultValue?: string;
|
|
28
|
+
/** Set value */
|
|
29
|
+
value: string;
|
|
30
|
+
/** Message shown under the text field */
|
|
31
|
+
message?: string;
|
|
32
|
+
/** Input character counter */
|
|
33
|
+
isShowCounter?: boolean;
|
|
34
|
+
/** Max length of input character */
|
|
35
|
+
maxLength?: number;
|
|
36
|
+
/** Select input location */
|
|
37
|
+
selectLocation?: "left" | "right";
|
|
38
|
+
/** Prefix */
|
|
39
|
+
prefix?: string;
|
|
40
|
+
/** List of options to show on the select field */
|
|
41
|
+
inputOptions?: SelectOptions[];
|
|
42
|
+
/** Callback on base input */
|
|
43
|
+
onChange?(value: string): void;
|
|
44
|
+
/** Callback on input select field */
|
|
45
|
+
onSelectOption?(value: string): void;
|
|
46
|
+
}
|
|
47
|
+
declare const TextInputSelect: FC<ITextInputSelectProps>;
|
|
48
|
+
export default TextInputSelect;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import AnimatedLabelInput, { IAnimatedLabelInputProps } from "./AnimatedLabelInput";
|
|
2
|
+
import AnimatedLabelTextArea, { IAnimatedLabelTextAreaProps } from "./AnimatedLabelTextArea";
|
|
2
3
|
import ButtonDropdown, { IButtonDropdownProps } from "./ButtonDropdown";
|
|
3
|
-
import Dropdown, {
|
|
4
|
+
import Dropdown, { IDropdownProps, IItemProp } from "./DropdownComponent";
|
|
4
5
|
import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder";
|
|
5
6
|
import FormInputWithAddons, { IFormInputWithAddonsProps } from "./FormInputWithAddons";
|
|
6
|
-
|
|
7
|
-
export {
|
|
7
|
+
import TextInputSelect, { ITextInputSelectProps } from "./TextInputSelect";
|
|
8
|
+
export type { IAnimatedLabelInputProps, IAnimatedLabelTextAreaProps, IButtonDropdownProps, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, ITextInputSelectProps };
|
|
9
|
+
export { AnimatedLabelInput, AnimatedLabelTextArea, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, TextInputSelect };
|