@agility/plenum-ui 2.0.5 → 2.0.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.
@@ -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
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 };
3
+ import { IAnimatedLabelInputProps, AnimatedLabelTextArea, IAnimatedLabelTextAreaProps, IButtonDropdownProps, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, AnimatedLabelInput, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, TextInputSelect, ITextInputSelectProps, IAnimatedFormInputWithAddons, AnimatedFormInputWithAddons } 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, IAnimatedFormInputWithAddons };
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, AnimatedFormInputWithAddons };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { IDynamicIconProps } from "@/stories/atoms/icons";
3
- export interface INestedInputButtonProps {
3
+ export interface INestedInputButtonProps extends Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> {
4
4
  /** Icon to be included*/
5
5
  icon?: IDynamicIconProps;
6
6
  /** CTA label */
@@ -9,9 +9,6 @@ export interface INestedInputButtonProps {
9
9
  align: "left" | "right";
10
10
  /** Show the CTA without Background color and a border seperator */
11
11
  isClear?: boolean;
12
- /** Onclick callback */
13
- onClickHandler?(): void;
14
- buttonProps?: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
15
12
  }
16
13
  declare const NestedInputButton: React.FC<INestedInputButtonProps>;
17
14
  export default NestedInputButton;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { IInputFieldProps } from "@/stories/molecules/inputs/InputField";
3
+ import { INestedInputButtonProps } from "@/stories/molecules";
4
+ interface ILabelProps extends React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
5
+ display: string;
6
+ }
7
+ export interface IAnimatedFormInputWithAddons extends Omit<IInputFieldProps, "handleChange"> {
8
+ id: string;
9
+ containerStyles?: string;
10
+ message?: string;
11
+ required?: boolean;
12
+ isError?: boolean;
13
+ isShowCounter?: boolean;
14
+ maxLength?: number;
15
+ label: ILabelProps;
16
+ handleChange: (value: string) => void;
17
+ labelClassName?: string;
18
+ addonBTN: INestedInputButtonProps;
19
+ }
20
+ declare const AnimatedFormInputWithAddons: React.FC<IAnimatedFormInputWithAddons>;
21
+ export default AnimatedFormInputWithAddons;
@@ -0,0 +1,3 @@
1
+ import AnimatedFormInputWithAddons, { IAnimatedFormInputWithAddons } from "./AnimatedFormInputWithAddons";
2
+ export type { IAnimatedFormInputWithAddons };
3
+ export default AnimatedFormInputWithAddons;
@@ -5,5 +5,6 @@ import Dropdown, { IDropdownProps, IItemProp } from "./DropdownComponent";
5
5
  import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder";
6
6
  import FormInputWithAddons, { IFormInputWithAddonsProps } from "./FormInputWithAddons";
7
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 };
8
+ import AnimatedFormInputWithAddons, { IAnimatedFormInputWithAddons } from "./AnimatedFormInputWithAddons";
9
+ export type { IAnimatedLabelInputProps, IAnimatedLabelTextAreaProps, IButtonDropdownProps, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, ITextInputSelectProps, IAnimatedFormInputWithAddons };
10
+ export { AnimatedLabelInput, AnimatedLabelTextArea, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, TextInputSelect, AnimatedFormInputWithAddons };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agility/plenum-ui",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/stories/index.ts CHANGED
@@ -66,7 +66,9 @@ import {
66
66
  EmptySectionPlaceholder,
67
67
  FormInputWithAddons,
68
68
  TextInputSelect,
69
- ITextInputSelectProps
69
+ ITextInputSelectProps,
70
+ IAnimatedFormInputWithAddons,
71
+ AnimatedFormInputWithAddons
70
72
  } from "./organisms"
71
73
 
72
74
  export type {
@@ -101,7 +103,8 @@ export type {
101
103
  FAIconName,
102
104
  BTNActionType,
103
105
  ITextInputProps,
104
- ISimpleSelectOptions
106
+ ISimpleSelectOptions,
107
+ IAnimatedFormInputWithAddons
105
108
  }
106
109
  export {
107
110
  Avatar,
@@ -132,5 +135,6 @@ export {
132
135
  isTablerIcon,
133
136
  isUnifiedIconName,
134
137
  TextInput,
135
- TextInputSelect
138
+ TextInputSelect,
139
+ AnimatedFormInputWithAddons
136
140
  }
@@ -1,7 +1,8 @@
1
1
  import React from "react"
2
2
  import { DynamicIcon, IDynamicIconProps } from "@/stories/atoms/icons"
3
3
  import { default as cn } from "classnames"
4
- export interface INestedInputButtonProps {
4
+ export interface INestedInputButtonProps
5
+ extends Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> {
5
6
  /** Icon to be included*/
6
7
  icon?: IDynamicIconProps
7
8
  /** CTA label */
@@ -10,9 +11,6 @@ export interface INestedInputButtonProps {
10
11
  align: "left" | "right"
11
12
  /** Show the CTA without Background color and a border seperator */
12
13
  isClear?: boolean
13
- /** Onclick callback */
14
- onClickHandler?(): void
15
- buttonProps?: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
16
14
  }
17
15
 
18
16
  const NestedInputButton: React.FC<INestedInputButtonProps> = ({
@@ -20,12 +18,10 @@ const NestedInputButton: React.FC<INestedInputButtonProps> = ({
20
18
  ctaLabel,
21
19
  align = "right",
22
20
  isClear = false,
23
- onClickHandler,
24
- buttonProps
21
+ ...props
25
22
  }) => {
26
- const handleClick = () => {
27
- onClickHandler && onClickHandler()
28
- }
23
+ const { ...buttonProps } = props
24
+ const { onClick } = buttonProps
29
25
  const buttonStyle = cn(
30
26
  "relative flex items-center space-x-2 px-4 py-2 leading-5 border border-gray-300 text-sm font-medium focus:outline-none focus:ring-1 focus:ring-purple-500 focus:border-purple-500",
31
27
  {
@@ -35,10 +31,10 @@ const NestedInputButton: React.FC<INestedInputButtonProps> = ({
35
31
  "rounded-l text-gray-500 -mr-px": align === "left"
36
32
  },
37
33
  {
38
- "cursor-default": !onClickHandler
34
+ "cursor-default": !onClick
39
35
  },
40
36
  {
41
- "hover:bg-gray-100": onClickHandler && !isClear
37
+ "hover:bg-gray-100": onClick && !isClear
42
38
  },
43
39
  {
44
40
  "!border-l-white": isClear && align === "right"
@@ -54,7 +50,16 @@ const NestedInputButton: React.FC<INestedInputButtonProps> = ({
54
50
  }
55
51
  )
56
52
  return (
57
- <button {...{ ...buttonProps, className: buttonStyle, onClick: handleClick }}>
53
+ <button
54
+ {...{
55
+ ...buttonProps,
56
+ className: buttonStyle,
57
+ onClick: (e) => {
58
+ e.preventDefault()
59
+ onClick && onClick(e)
60
+ }
61
+ }}
62
+ >
58
63
  {icon && <DynamicIcon {...{ ...icon, className: "text-gray-400 h-5 w-5" }} />}
59
64
  {ctaLabel && <span>{ctaLabel}</span>}
60
65
  </button>
@@ -23,7 +23,7 @@ const DefaultArgs: IAnimatedFormInputWithAddons = {
23
23
  icon: { icon: "IconPencil" },
24
24
  align: "right",
25
25
  ctaLabel: "Edit",
26
- onClickHandler: () => {
26
+ onClick: () => {
27
27
  alert("clicked")
28
28
  }
29
29
  }
@@ -5,7 +5,7 @@ import Dropdown, { IDropdownProps, IItemProp } from "./DropdownComponent"
5
5
  import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder"
6
6
  import FormInputWithAddons, { IFormInputWithAddonsProps } from "./FormInputWithAddons"
7
7
  import TextInputSelect, { ITextInputSelectProps } from "./TextInputSelect"
8
-
8
+ import AnimatedFormInputWithAddons, { IAnimatedFormInputWithAddons } from "./AnimatedFormInputWithAddons"
9
9
  export type {
10
10
  IAnimatedLabelInputProps,
11
11
  IAnimatedLabelTextAreaProps,
@@ -14,7 +14,8 @@ export type {
14
14
  IEmptySectionPlaceholderProps,
15
15
  IItemProp,
16
16
  IFormInputWithAddonsProps,
17
- ITextInputSelectProps
17
+ ITextInputSelectProps,
18
+ IAnimatedFormInputWithAddons
18
19
  }
19
20
  export {
20
21
  AnimatedLabelInput,
@@ -23,5 +24,6 @@ export {
23
24
  Dropdown,
24
25
  EmptySectionPlaceholder,
25
26
  FormInputWithAddons,
26
- TextInputSelect
27
+ TextInputSelect,
28
+ AnimatedFormInputWithAddons
27
29
  }