@agility/plenum-ui 2.0.0-rc3 → 2.0.0-rc30

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.
Files changed (101) hide show
  1. package/README.md +104 -31
  2. package/build.js +30 -25
  3. package/dist/index.d.ts +274 -89
  4. package/dist/index.js +1 -5976
  5. package/dist/index.js.map +4 -4
  6. package/dist/tailwind.css +63516 -0
  7. package/dist/types/stories/atoms/buttons/Button/Button.d.ts +3 -7
  8. package/dist/types/stories/atoms/buttons/Capsule/Capsule.d.ts +1 -1
  9. package/dist/types/stories/atoms/icons/DynamicIcon.d.ts +2 -2
  10. package/dist/types/stories/atoms/icons/TablerIcon.d.ts +1 -1
  11. package/dist/types/stories/index.d.ts +4 -4
  12. package/dist/types/stories/molecules/index.d.ts +3 -3
  13. package/dist/types/stories/molecules/inputs/InputCounter/InputCounter.d.ts +10 -0
  14. package/dist/types/stories/molecules/inputs/InputCounter/index.d.ts +2 -0
  15. package/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +8 -4
  16. package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +39 -0
  17. package/dist/types/stories/molecules/inputs/TextInput/index.d.ts +4 -0
  18. package/dist/types/stories/molecules/inputs/index.d.ts +5 -4
  19. package/dist/types/stories/molecules/inputs/select/Select.d.ts +2 -2
  20. package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +34 -21
  21. package/dist/types/stories/molecules/inputs/textArea/TextArea.stories.d.ts +4 -4
  22. package/dist/types/stories/molecules/inputs/textArea/index.d.ts +3 -3
  23. package/dist/types/stories/molecules/inputs/toggleSwitch/ToggleSwitch.d.ts +9 -7
  24. package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +3 -5
  25. package/dist/types/stories/organisms/AnimatedLabelInput/index.d.ts +1 -1
  26. package/dist/types/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.d.ts +12 -0
  27. package/dist/types/stories/organisms/AnimatedLabelTextArea/index.d.ts +3 -0
  28. package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +20 -12
  29. package/dist/types/stories/organisms/DropdownComponent/index.d.ts +2 -2
  30. package/dist/types/stories/organisms/EmptySectionPlaceholder/index.d.ts +1 -1
  31. package/dist/types/stories/organisms/TextInputSelect/InputSelect.d.ts +16 -0
  32. package/dist/types/stories/organisms/TextInputSelect/TextInputSelect.d.ts +48 -0
  33. package/dist/types/stories/organisms/TextInputSelect/index.d.ts +3 -0
  34. package/dist/types/stories/organisms/index.d.ts +5 -3
  35. package/local.sh +100 -0
  36. package/package.json +36 -19
  37. package/rollup.config.mjs +42 -0
  38. package/stories/Introduction.mdx +1 -1
  39. package/stories/atoms/badges/Badge.tsx +1 -1
  40. package/stories/atoms/buttons/Button/Button.tsx +23 -18
  41. package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +2 -2
  42. package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +2 -2
  43. package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +1 -1
  44. package/stories/atoms/buttons/Button/defaultArgs.ts +1 -1
  45. package/stories/atoms/buttons/Capsule/Capsule.tsx +2 -1
  46. package/stories/atoms/icons/DynamicIcon.stories.ts +1 -1
  47. package/stories/atoms/icons/DynamicIcon.tsx +7 -7
  48. package/stories/atoms/icons/IconWithShadow.stories.ts +3 -3
  49. package/stories/atoms/icons/TablerIcon.tsx +1 -1
  50. package/stories/atoms/loaders/Loader.tsx +12 -6
  51. package/stories/index.ts +22 -10
  52. package/stories/molecules/index.ts +22 -6
  53. package/stories/molecules/inputs/InputCounter/InputCounter.stories.tsx +18 -0
  54. package/stories/molecules/inputs/InputCounter/InputCounter.tsx +24 -0
  55. package/stories/molecules/inputs/InputCounter/index.tsx +3 -0
  56. package/stories/molecules/inputs/InputField/InputField.tsx +13 -7
  57. package/stories/molecules/inputs/TextInput/TextInput.stories.tsx +32 -0
  58. package/stories/molecules/inputs/TextInput/TextInput.tsx +165 -0
  59. package/stories/molecules/inputs/TextInput/index.tsx +5 -0
  60. package/stories/molecules/inputs/checkbox/Checkbox.tsx +1 -1
  61. package/stories/molecules/inputs/combobox/ComboBox.tsx +126 -135
  62. package/stories/molecules/inputs/index.ts +18 -4
  63. package/stories/molecules/inputs/select/Select.tsx +1 -1
  64. package/stories/molecules/inputs/textArea/TextArea.stories.ts +7 -5
  65. package/stories/molecules/inputs/textArea/TextArea.tsx +139 -48
  66. package/stories/molecules/inputs/textArea/index.ts +3 -3
  67. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +61 -57
  68. package/stories/molecules/tabs/index.tsx +2 -3
  69. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +10 -1
  70. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +43 -37
  71. package/stories/organisms/AnimatedLabelInput/index.tsx +1 -1
  72. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -0
  73. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -0
  74. package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -0
  75. package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +60 -58
  76. package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +13 -17
  77. package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +2 -2
  78. package/stories/organisms/DropdownComponent/DropdownComponent.tsx +89 -70
  79. package/stories/organisms/DropdownComponent/dropdownItems.ts +27 -3
  80. package/stories/organisms/DropdownComponent/index.ts +2 -2
  81. package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +3 -3
  82. package/stories/organisms/EmptySectionPlaceholder/index.tsx +2 -1
  83. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +1 -1
  84. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +7 -2
  85. package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -0
  86. package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -0
  87. package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -0
  88. package/stories/organisms/TextInputSelect/index.tsx +3 -0
  89. package/stories/organisms/index.ts +15 -4
  90. package/tsconfig.lib.json +13 -6
  91. package/watch.js +50 -0
  92. package/.yarnrc.yml +0 -1
  93. package/dist/types/stories/layouts/index.d.ts +0 -0
  94. package/stories/layouts/CardLayout/CardLayout.stories.tsx +0 -18
  95. package/stories/layouts/CardLayout/CardLayout.tsx +0 -22
  96. package/stories/layouts/CardLayout/index.tsx +0 -3
  97. package/stories/layouts/ModalLayout/ModalLayout.stories.tsx +0 -18
  98. package/stories/layouts/ModalLayout/ModalLayout.tsx +0 -22
  99. package/stories/layouts/ModalLayout/index.tsx +0 -3
  100. package/stories/layouts/index.ts +0 -0
  101. package/stories/organisms/DropdownComponent/Dropdown.test.tsx +0 -0
@@ -1,7 +1,7 @@
1
- import { HTMLAttributeAnchorTarget } from "react";
1
+ import React, { HTMLAttributeAnchorTarget } from "react";
2
2
  import { UnifiedIconName, IDynamicIconProps } from "../../icons";
3
3
  export type BTNActionType = "primary" | "secondary" | "alternative" | "danger";
4
- export interface IButtonProps extends React.ComponentPropsWithoutRef<"button"> {
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
6
  actionType?: BTNActionType;
7
7
  /** How lg should the button be? - Defaults to 'base'. */
@@ -26,10 +26,6 @@ export interface IButtonProps extends React.ComponentPropsWithoutRef<"button"> {
26
26
  isLoading?: boolean;
27
27
  className?: string;
28
28
  iconObj?: React.ReactNode;
29
- ref?: React.LegacyRef<HTMLButtonElement>;
30
29
  }
31
- /**
32
- * Primary UI component for user interaction
33
- */
34
- declare const Button: ({ actionType, size, label, icon, iconObj, CustomSVGIcon, fullWidth, iconPosition, asLink, isLoading, className, ref, ...props }: IButtonProps) => import("react/jsx-runtime").JSX.Element;
30
+ declare const Button: React.ForwardRefExoticComponent<IButtonProps & React.RefAttributes<HTMLButtonElement>>;
35
31
  export default Button;
@@ -3,7 +3,7 @@ import { BTNActionType } from "../Button/Button";
3
3
  /**
4
4
  * Capsule Style Button
5
5
  */
6
- export interface ICapsuleProps extends React.ComponentPropsWithoutRef<"button"> {
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'. */
@@ -6,12 +6,12 @@ import { TablerIconName } from "./tablerIconNames";
6
6
  import { ClassNameWithAutocomplete } from "@/utils/types";
7
7
  export type IconName = keyof typeof SolidIcons | keyof typeof OutlineIcons;
8
8
  export type FAIconName = keyof typeof FA;
9
- export type UnifiedIconName = IconName | TablerIconName | FAIconName;
9
+ export type UnifiedIconName = TablerIconName | IconName | FAIconName;
10
10
  export declare function isHeroIcon(name: UnifiedIconName): name is keyof typeof SolidIcons | keyof typeof OutlineIcons;
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 extends React.ComponentProps<"i"> {
14
+ export interface IDynamicIconProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
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.ComponentProps<"i"> {
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, ITextAreaFieldProps, IToggleSwitchProps, AcceptedInputTypes, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, TextAreaField, ToggleSwitch } from "./molecules";
3
- import { IAnimatedLabelInputProps, IButtonDropdownProps, IDropdownClassnames, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, AnimatedLabelInput, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons } from "./organisms";
4
- export type { IAvatarProps, IBadgeProps, IButtonProps, ICapsuleProps, IDynamicIconProps, IIconWithShadowProps, ILoaderProps, IRadialProgressProps, ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextAreaFieldProps, IToggleSwitchProps, AcceptedInputTypes, IAnimatedLabelInputProps, IButtonDropdownProps, IDropdownClassnames, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, UnifiedIconName, IconName, FAIconName, BTNActionType };
5
- export { Avatar, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, TextAreaField, ToggleSwitch, AnimatedLabelInput, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, Badge, Button, Capsule, DynamicIcon, IconWithShadow, Loader, RadialProgress, isFAIcon, isHeroIcon, isTablerIcon, isUnifiedIconName };
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, ITextAreaFieldProps, IToggleSwitchProps, AcceptedInputTypes, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, TextAreaField, ToggleSwitch } from "./inputs";
2
- export type { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextAreaFieldProps, IToggleSwitchProps, AcceptedInputTypes };
3
- export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, TextAreaField, ToggleSwitch };
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;
@@ -0,0 +1,2 @@
1
+ export { default } from './InputCounter';
2
+ export * from './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.ComponentPropsWithoutRef<"input"> {
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: string;
7
+ id?: string;
8
8
  /** Input Name */
9
- name: string;
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;
@@ -0,0 +1,4 @@
1
+ import TextInput from "./TextInput";
2
+ import { ITextInputProps } from "./TextInput";
3
+ export type { ITextInputProps };
4
+ 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 TextAreaField, { ITextAreaFieldProps } from "./textArea";
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, ITextAreaFieldProps, IToggleSwitchProps, AcceptedInputTypes };
11
- export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, TextAreaField, ToggleSwitch };
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,8 +1,8 @@
1
1
  import React from "react";
2
- export type ISimpleSelectOptions = {
2
+ export interface ISimpleSelectOptions {
3
3
  label: string;
4
4
  value: string;
5
- };
5
+ }
6
6
  export interface ISelectProps {
7
7
  /** Label */
8
8
  label?: string;
@@ -1,26 +1,39 @@
1
- /// <reference types="react" />
2
- export interface ITextAreaFieldProps extends React.ComponentPropsWithoutRef<"textarea"> {
3
- /** Callback on change */
4
- handleChange: (value: string) => void;
5
- /** textarea ID*/
6
- id: string;
7
- /** textarea Name */
8
- name: string;
9
- /** Force the focus state on the textarea */
10
- isFocused?: boolean;
11
- /** Error condition */
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
- /** Readonly state */
16
- isReadonly?: boolean;
17
- /** textarea value */
18
- value: string;
19
- /** If field is required */
20
- required?: boolean;
21
- /**Allow Text Area Resize*/
22
- textAreaResize?: boolean;
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 TextAreaField: React.FC<ITextAreaFieldProps>;
26
- export default TextAreaField;
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 TextArea from "./TextArea";
3
- declare const meta: Meta<typeof TextArea>;
4
- type Story = StoryObj<typeof TextArea>;
5
- export declare const DefaultTextArea: Story;
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 TextAreaField, { ITextAreaFieldProps } from "./TextArea";
2
- export type { ITextAreaFieldProps };
3
- export default TextAreaField;
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
- text: string | JSX.Element;
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: "base" | "short";
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
- import { ITextAreaFieldProps } from "@/stories/molecules/inputs/textArea/TextArea";
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;
@@ -1,3 +1,3 @@
1
1
  import AnimatedLabelInput, { IAnimatedLabelInputProps } from "./AnimatedLabelInput";
2
- export default AnimatedLabelInput;
3
2
  export type { IAnimatedLabelInputProps };
3
+ 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;
@@ -0,0 +1,3 @@
1
+ import AnimatedLabelTextArea, { IAnimatedLabelTextAreaProps } from "./AnimatedLabelTextArea";
2
+ export type { IAnimatedLabelTextAreaProps };
3
+ export default AnimatedLabelTextArea;
@@ -1,28 +1,28 @@
1
1
  import React, { HTMLAttributes } from "react";
2
2
  import { Placement } from "@floating-ui/react";
3
3
  import { ClassNameWithAutocomplete } from "utils/types";
4
- import { IDynamicIconProps, UnifiedIconName } from "@/stories/atoms/icons";
5
- export interface IItemProp extends HTMLAttributes<HTMLButtonElement> {
6
- icon?: IDynamicIconProps | UnifiedIconName;
4
+ import { IDynamicIconProps } from "@/stories/atoms/icons";
5
+ export interface IItemProp {
6
+ icon?: IDynamicIconProps;
7
7
  iconPosition?: "trailing" | "leading";
8
8
  label: string;
9
9
  onClick?(): void;
10
10
  isEmphasized?: boolean;
11
11
  key: React.Key;
12
- }
13
- export interface IDropdownClassnames {
14
- groupClassname?: ClassNameWithAutocomplete;
15
- itemsClassname?: ClassNameWithAutocomplete;
16
- itemClassname?: ClassNameWithAutocomplete;
17
- activeItemClassname?: ClassNameWithAutocomplete;
18
- buttonClassname?: ClassNameWithAutocomplete;
12
+ iconObj?: JSX.Element;
19
13
  }
20
14
  export interface IDropdownProps extends HTMLAttributes<HTMLDivElement> {
21
15
  items: IItemProp[][];
22
16
  label: string;
23
17
  CustomDropdownTrigger?: React.ReactNode;
24
18
  id: string;
25
- classNames?: IDropdownClassnames;
19
+ groupClassname?: ClassNameWithAutocomplete;
20
+ itemsClassname?: ClassNameWithAutocomplete;
21
+ itemClassname?: ClassNameWithAutocomplete;
22
+ activeItemClassname?: ClassNameWithAutocomplete;
23
+ buttonClassname?: ClassNameWithAutocomplete;
24
+ iconClassname?: ClassNameWithAutocomplete;
25
+ iconSpacingClassname?: ClassNameWithAutocomplete;
26
26
  placement?: Placement;
27
27
  offsetOptions?: Partial<{
28
28
  mainAxis: number;
@@ -30,7 +30,15 @@ export interface IDropdownProps extends HTMLAttributes<HTMLDivElement> {
30
30
  alignmentAxis: number | null;
31
31
  }>;
32
32
  }
33
- export declare const defaultClassNames: IDropdownClassnames;
33
+ export declare const defaultClassNames: {
34
+ groupClassname: string;
35
+ itemsClassname: string;
36
+ itemClassname: string;
37
+ activeItemClassname: string;
38
+ buttonClassname: string;
39
+ iconClassname: string;
40
+ iconSpacingClassname: string;
41
+ };
34
42
  /** Comment */
35
43
  declare const Dropdown: React.FC<IDropdownProps>;
36
44
  export default Dropdown;
@@ -1,4 +1,4 @@
1
- import Dropdown, { IItemProp, IDropdownClassnames, IDropdownProps, defaultClassNames } from "./DropdownComponent";
2
- export type { IItemProp, IDropdownClassnames, IDropdownProps };
1
+ import Dropdown, { IItemProp, IDropdownProps, defaultClassNames } from "./DropdownComponent";
2
+ export type { IItemProp, IDropdownProps };
3
3
  export { defaultClassNames };
4
4
  export default Dropdown;
@@ -1,3 +1,3 @@
1
1
  import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder";
2
- export default EmptySectionPlaceholder;
3
2
  export type { IEmptySectionPlaceholderProps };
3
+ export default EmptySectionPlaceholder;
@@ -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;
@@ -0,0 +1,3 @@
1
+ import TextInputSelect, { ITextInputSelectProps } from "./TextInputSelect";
2
+ export type { ITextInputSelectProps };
3
+ 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, { IDropdownClassnames, IDropdownProps, IItemProp } from "./DropdownComponent";
4
+ import Dropdown, { IDropdownProps, IItemProp } from "./DropdownComponent";
4
5
  import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder";
5
6
  import FormInputWithAddons, { IFormInputWithAddonsProps } from "./FormInputWithAddons";
6
- export type { IAnimatedLabelInputProps, IButtonDropdownProps, IDropdownClassnames, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps };
7
- export { AnimatedLabelInput, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons };
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 };
package/local.sh ADDED
@@ -0,0 +1,100 @@
1
+ #! /usr/bin/bash
2
+
3
+ # ANSI escape codes for formatting
4
+ GREEN_BOLD='\033[1;32m'
5
+ ORANGE_BOLD='\033[1;33m'
6
+ RED_BOLD='\033[1;31m'
7
+ BLUE_BOLD='\033[1;34m'
8
+ RESET='\033[0m'
9
+ DIR="$PWD"
10
+
11
+ # The required yarn version to use this script
12
+ REQUIRED_YARN_VERSION="1.22.19"
13
+
14
+ # Get the installed Yarn version
15
+ INSTALLED_YARN_VERSION=$(yarn --version 2>/dev/null)
16
+
17
+ unlink_package() {
18
+ local package_name="${1:-@agility/plenum-ui}"
19
+ if [ -z "$1" ]; then
20
+ yarn unlink
21
+ else
22
+ cd "$DIR/node_modules/$package_name"
23
+ yarn unlink
24
+ fi
25
+ unlink_exit_code=$?
26
+ if [ $unlink_exit_code -ne 0 ]; then
27
+ echo -e "${ORANGE_BOLD}agility-cms-manager-app-react:warning${RESET} yarn unlink for '$package_name' encountered an error, but script will continue. \n"
28
+ fi
29
+
30
+ cd "$DIR"
31
+ echo -e "\n"
32
+ }
33
+
34
+ link_package() {
35
+ local package_name="${1:-@agility/plenum-ui}"
36
+ if [ -z "$1" ]; then
37
+ yarn link
38
+ else
39
+ cd "$DIR/node_modules/$package_name"
40
+ yarn link
41
+ fi
42
+ unlink_exit_code=$?
43
+ if [ $unlink_exit_code -ne 0 ]; then
44
+ echo -e "${RED_BOLD}agility-cms-manager-app-react:error${RESET} yarn link for '$package_name' failed. Script cannot continue, exiting script."
45
+ exit 1
46
+ else
47
+ echo -e "${GREEN_BOLD}@agility/plenum-ui:success${RESET} yarn link for '$package_name' successful\n"
48
+ fi
49
+
50
+ cd "$DIR"
51
+ }
52
+
53
+ check_yarn_version() {
54
+ # Check if Yarn is installed and compare the version
55
+ if [ -n "$INSTALLED_YARN_VERSION" ] && [ "$INSTALLED_YARN_VERSION" != "$REQUIRED_YARN_VERSION" ]; then
56
+ echo -e "${RED_BOLD}error${RESET} Yarn version $required_version is required, but found version $INSTALLED_YARN_VERSION."
57
+ exit 1
58
+ fi
59
+
60
+ echo -e "${BLUE_BOLD}info${RESET} Yarn version is $INSTALLED_YARN_VERSION. Proceeding with the script...\n"
61
+ }
62
+
63
+ ### START SCRIPT
64
+
65
+ check_yarn_version
66
+
67
+ echo -e "Starting @agility/plenum-ui local watch script \n"
68
+ echo -e "${BLUE_BOLD}@agility/plenum-ui:info${RESET} unlinking existing symlink"
69
+ yarn unlink
70
+ if [ $? -ne 0 ]; then
71
+ echo "yarn unlink for @agility/plenum-ui encountered an error, but script will continue. \n"
72
+ fi
73
+
74
+ if [ ! -d "node_modules" ] || [ ! -d "node_modules/react" ] || [ ! -d "node_modules/react-dom" ]; then
75
+ echo -e "${ORANGE_BOLD}@agility/plenum-ui:warning${RESET} Could not find node_modules."
76
+ echo -e "${BLUE_BOLD}@agility/plenum-ui:info${RESET} installing dependencies...\n"
77
+
78
+ yarn install
79
+
80
+ if [ $? -eq 0 ]; then
81
+ echo -e "${GREEN_BOLD}@agility/plenum-ui:success${RESET} Finished installing dependencies"
82
+ else
83
+ echo -e "${RED_BOLD}@agility/plenum-ui:error${RESET} Couldn't install dependencies. Exiting script."
84
+ exit 1
85
+ fi
86
+ fi
87
+
88
+ echo -e "${BLUE_BOLD}@agility/plenum-ui:info${RESET} unlinking existing symlinks"
89
+ unlink_package react
90
+ unlink_package react-dom
91
+ unlink_package
92
+
93
+ echo -e "${BLUE_BOLD}@agility/plenum-ui:info${RESET} setting up symlinks...\n"
94
+
95
+ link_package react
96
+ link_package react-dom
97
+ link_package
98
+
99
+ echo -e "${GREEN_BOLD}@agility/plenum-ui:success${RESET} You can now run 'yarn start-cms:local' in agility-cms-manager-app-react\n"
100
+ yarn start:watch