opus-toolkit-components 1.7.8 → 1.8.0

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,19 +1,19 @@
1
- // Accordion Typescript Definitions - update when new props added
2
- export interface AccordionProps {
3
- title: string | React.ReactNode;
4
- handleToggle?: (index: number) => void;
5
- activeIndex?: number;
6
- index: number;
7
- isPreview?: boolean;
8
- isLocked?: boolean;
9
- onExitPreview?: () => void;
10
- content: React.ReactNode;
11
- preview?: React.ReactNode;
12
- isPill?: boolean;
13
- pillText?: string;
14
- pillStatus?: "success" | "warning" | "error" | "info" | string;
15
- pillIcon?: React.ReactNode;
16
- disabled?: boolean;
17
- }
1
+ // Accordion Typescript Definitions - update when new props added
2
+ export interface AccordionProps {
3
+ title: string | React.ReactNode;
4
+ handleToggle?: (index: number) => void;
5
+ activeIndex?: number;
6
+ index: number;
7
+ isPreview?: boolean;
8
+ isLocked?: boolean;
9
+ onExitPreview?: () => void;
10
+ content: React.ReactNode;
11
+ preview?: React.ReactNode;
12
+ isPill?: boolean;
13
+ pillText?: string;
14
+ pillStatus?: "success" | "warning" | "error" | "info" | string;
15
+ pillIcon?: React.ReactNode;
16
+ disabled?: boolean;
17
+ }
18
18
 
19
- export const Accordion: React.ComponentType<AccordionProps>;
19
+ export const Accordion: React.ComponentType<AccordionProps>;
@@ -1,8 +1,8 @@
1
- export interface BarLayoutProps {
2
- left?: React.ReactNode;
3
- center?: React.ReactNode;
4
- right?: React.ReactNode;
5
- className?: string;
6
- }
1
+ export interface BarLayoutProps {
2
+ left?: React.ReactNode;
3
+ center?: React.ReactNode;
4
+ right?: React.ReactNode;
5
+ className?: string;
6
+ }
7
7
 
8
- export const BarLayout: React.ComponentType<BarLayoutProps>;
8
+ export const BarLayout: React.ComponentType<BarLayoutProps>;
@@ -1,37 +1,36 @@
1
1
  export type ButtonRank =
2
- | "primary"
3
- | "secondary"
4
- | "tertiary"
5
- | "outline"
6
- | "destructive";
2
+ | "primary"
3
+ | "secondary"
4
+ | "tertiary"
5
+ | "outline"
6
+ | "destructive";
7
7
 
8
- export type ButtonState = "default" | "disabled";
8
+ export type ButtonState = "default" | "disabled";
9
9
 
10
- export type ButtonSize = "sm" | "md" | "lg" | "xl" | string;
10
+ export type ButtonSize = "sm" | "md" | "lg" | "xl" | string;
11
11
 
12
- export type IconComponent = (
13
- props: React.SVGProps<SVGSVGElement>,
14
- ) => JSX.Element;
12
+ export type IconComponent = (
13
+ props: React.SVGProps<SVGSVGElement>,
14
+ ) => JSX.Element;
15
15
 
16
- export interface ButtonProps
17
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
18
- type?: "button" | "submit" | "reset";
19
- rank?: ButtonRank;
20
- state?: ButtonState;
21
- text?: string;
22
- size?: ButtonSize;
23
- name?: string;
24
- dataCy?: string;
25
- tabIndex?: number;
26
- isFullWidth?: boolean;
27
- icon?: IconComponent;
28
- iconPosition?: "left" | "right";
29
- isIconAnimated?: boolean;
30
- isSaving?: boolean;
31
- savingText?: string;
32
- className?: string;
33
- title?: string;
34
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
35
- }
16
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
17
+ type?: "button" | "submit" | "reset";
18
+ rank?: ButtonRank;
19
+ state?: ButtonState;
20
+ text?: string;
21
+ size?: ButtonSize;
22
+ name?: string;
23
+ dataCy?: string;
24
+ tabIndex?: number;
25
+ isFullWidth?: boolean;
26
+ icon?: IconComponent;
27
+ iconPosition?: "left" | "right";
28
+ isIconAnimated?: boolean;
29
+ isSaving?: boolean;
30
+ savingText?: string;
31
+ className?: string;
32
+ title?: string;
33
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
34
+ }
36
35
 
37
- export const Button: React.ComponentType<ButtonProps>;
36
+ export const Button: React.ComponentType<ButtonProps>;
@@ -1,16 +1,16 @@
1
- export type CardIntent =
2
- | "default"
3
- | "info"
4
- | "warning"
5
- | "success"
6
- | "error"
7
- | "brand"
8
- | "brandSecondary";
1
+ export type CardIntent =
2
+ | "default"
3
+ | "info"
4
+ | "warning"
5
+ | "success"
6
+ | "error"
7
+ | "brand"
8
+ | "brandSecondary";
9
9
 
10
- export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
11
- intent?: CardIntent;
12
- className?: string;
13
- children?: React.ReactNode;
14
- }
10
+ export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
11
+ intent?: CardIntent;
12
+ className?: string;
13
+ children?: React.ReactNode;
14
+ }
15
15
 
16
- export const Card: React.ComponentType<CardProps>;
16
+ export const Card: React.ComponentType<CardProps>;
@@ -1,11 +1,11 @@
1
1
  export interface CookieBannerProps {
2
- logo?: string;
3
- policyTxt?: string;
4
- linkTxt?: string;
5
- isVisible?: boolean;
6
- onAccept?: () => void;
7
- onLearnMore?: () => void;
8
- intent?: string;
9
- }
2
+ logo?: string;
3
+ policyTxt?: string;
4
+ linkTxt?: string;
5
+ isVisible?: boolean;
6
+ onAccept?: () => void;
7
+ onLearnMore?: () => void;
8
+ intent?: string;
9
+ }
10
10
 
11
- export const CookieBanner: React.ComponentType<CookieBannerProps>;
11
+ export const CookieBanner: React.ComponentType<CookieBannerProps>;
@@ -1,8 +1,8 @@
1
- export interface FooterProps {
2
- left?: React.ReactNode;
3
- center?: React.ReactNode;
4
- right?: React.ReactNode;
5
- className?: string;
6
- }
1
+ export interface FooterProps {
2
+ left?: React.ReactNode;
3
+ center?: React.ReactNode;
4
+ right?: React.ReactNode;
5
+ className?: string;
6
+ }
7
7
 
8
- export const Footer: React.ComponentType<FooterProps>;
8
+ export const Footer: React.ComponentType<FooterProps>;
@@ -1,20 +1,20 @@
1
1
  export interface CheckboxChangeEvent {
2
- target: {
3
- name: string;
4
- value: boolean;
5
- };
6
- }
7
-
8
- export interface CheckboxProps extends React.HTMLAttributes<HTMLDivElement> {
9
- label: string;
2
+ target: {
10
3
  name: string;
11
- onChange?: (event: CheckboxChangeEvent) => void;
12
- value?: boolean;
13
- isValid?: boolean;
14
- errorMessage?: string;
15
- disabled?: boolean;
16
- title?: string;
17
- dataCy?: string;
18
- }
4
+ value: boolean;
5
+ };
6
+ }
7
+
8
+ export interface CheckboxProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ label: string;
10
+ name: string;
11
+ onChange?: (event: CheckboxChangeEvent) => void;
12
+ value?: boolean;
13
+ isValid?: boolean;
14
+ errorMessage?: string;
15
+ disabled?: boolean;
16
+ title?: string;
17
+ dataCy?: string;
18
+ }
19
19
 
20
- export const Checkbox: React.ComponentType<CheckboxProps>;
20
+ export const Checkbox: React.ComponentType<CheckboxProps>;
@@ -1,24 +1,23 @@
1
1
  export interface DatePickerChangeEvent {
2
- target: {
3
- name: string;
4
- value: string;
5
- };
6
- }
2
+ target: {
3
+ name: string;
4
+ value: string;
5
+ };
6
+ }
7
7
 
8
- export interface DatePickerProps
9
- extends React.HTMLAttributes<HTMLDivElement> {
10
- initialDate?: string;
11
- label?: string;
12
- isValid?: boolean;
13
- errorMessage?: string;
14
- name?: string;
15
- onChange?: (event: DatePickerChangeEvent) => void;
16
- value?: string;
17
- className?: string;
18
- title?: string;
19
- required?: boolean;
20
- dataCy?: string;
21
- disabled?: boolean;
22
- }
8
+ export interface DatePickerProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ initialDate?: string;
10
+ label?: string;
11
+ isValid?: boolean;
12
+ errorMessage?: string;
13
+ name?: string;
14
+ onChange?: (event: DatePickerChangeEvent) => void;
15
+ value?: string;
16
+ className?: string;
17
+ title?: string;
18
+ required?: boolean;
19
+ dataCy?: string;
20
+ disabled?: boolean;
21
+ }
23
22
 
24
- export const DatePicker: React.ComponentType<DatePickerProps>;
23
+ export const DatePicker: React.ComponentType<DatePickerProps>;
@@ -1,35 +1,35 @@
1
1
  export interface DropdownItem {
2
- label: string;
3
- value: string | number;
4
- }
2
+ label: string;
3
+ value: string | number;
4
+ }
5
5
 
6
- export interface DropdownChangeEvent {
7
- target: {
8
- name: string;
9
- value: string | number;
10
- };
11
- }
6
+ export interface DropdownChangeEvent {
7
+ target: {
8
+ name: string;
9
+ value: string | number;
10
+ };
11
+ }
12
12
 
13
- export type IconComponent = (
14
- props: React.SVGProps<SVGSVGElement>,
15
- ) => JSX.Element;
13
+ export type IconComponent = (
14
+ props: React.SVGProps<SVGSVGElement>,
15
+ ) => JSX.Element;
16
16
 
17
- export interface DropdownProps extends React.HTMLAttributes<HTMLDivElement> {
18
- items?: DropdownItem[];
19
- label?: string;
20
- isValid?: boolean;
21
- required?: boolean;
22
- placeholder?: string;
23
- name?: string;
24
- className?: string;
25
- title?: string;
26
- tabIndex?: string | number;
27
- onChange?: (event: DropdownChangeEvent) => void;
28
- value?: string | number;
29
- Icon?: IconComponent;
30
- errorMessage?: string;
31
- disabled?: boolean;
32
- dataCy?: string;
33
- }
17
+ export interface DropdownProps extends React.HTMLAttributes<HTMLDivElement> {
18
+ items?: DropdownItem[];
19
+ label?: string;
20
+ isValid?: boolean;
21
+ required?: boolean;
22
+ placeholder?: string;
23
+ name?: string;
24
+ className?: string;
25
+ title?: string;
26
+ tabIndex?: string | number;
27
+ onChange?: (event: DropdownChangeEvent) => void;
28
+ value?: string | number;
29
+ Icon?: IconComponent;
30
+ errorMessage?: string;
31
+ disabled?: boolean;
32
+ dataCy?: string;
33
+ }
34
34
 
35
- export const Dropdown: React.ComponentType<DropdownProps>;
35
+ export const Dropdown: React.ComponentType<DropdownProps>;
@@ -1,46 +1,45 @@
1
1
  export type IconComponent = (
2
- props: React.SVGProps<SVGSVGElement>,
3
- ) => JSX.Element;
2
+ props: React.SVGProps<SVGSVGElement>,
3
+ ) => JSX.Element;
4
4
 
5
- export type CustomComponent = (props: any) => JSX.Element;
5
+ export type CustomComponent = (props: any) => JSX.Element;
6
6
 
7
- export interface InputProps
8
- extends React.InputHTMLAttributes<HTMLInputElement> {
9
- label: string;
10
- placeholder?: string;
11
- type?:
12
- | "text"
13
- | "email"
14
- | "password"
15
- | "number"
16
- | "search"
17
- | "tel"
18
- | "url"
19
- | "date"
20
- | "datetime-local"
21
- | "month"
22
- | "time"
23
- | "week"
24
- | string;
25
- tabIndex?: string | number;
26
- title?: string;
27
- name?: string;
28
- isValid?: boolean;
29
- errorMessage?: string;
30
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
31
- className?: string;
32
- value?: string | number;
33
- Icon?: IconComponent;
34
- iconPosition?: "left" | "right";
35
- isAnimated?: boolean;
36
- required?: boolean;
37
- disabled?: boolean;
38
- shouldRenderCustomComponent?: boolean;
39
- customComponent?: CustomComponent;
40
- customComponentProps?: Record<string, any>;
41
- dataCy?: string;
42
- }
7
+ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
8
+ label: string;
9
+ placeholder?: string;
10
+ type?:
11
+ | "text"
12
+ | "email"
13
+ | "password"
14
+ | "number"
15
+ | "search"
16
+ | "tel"
17
+ | "url"
18
+ | "date"
19
+ | "datetime-local"
20
+ | "month"
21
+ | "time"
22
+ | "week"
23
+ | string;
24
+ tabIndex?: string | number;
25
+ title?: string;
26
+ name?: string;
27
+ isValid?: boolean;
28
+ errorMessage?: string;
29
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
30
+ className?: string;
31
+ value?: string | number;
32
+ Icon?: IconComponent;
33
+ iconPosition?: "left" | "right";
34
+ isAnimated?: boolean;
35
+ required?: boolean;
36
+ disabled?: boolean;
37
+ shouldRenderCustomComponent?: boolean;
38
+ customComponent?: CustomComponent;
39
+ customComponentProps?: Record<string, any>;
40
+ dataCy?: string;
41
+ }
43
42
 
44
- export const Input: React.ForwardRefExoticComponent<
45
- InputProps & React.RefAttributes<HTMLInputElement>
46
- >;
43
+ export const Input: React.ForwardRefExoticComponent<
44
+ InputProps & React.RefAttributes<HTMLInputElement>
45
+ >;
@@ -1,30 +1,29 @@
1
1
  export interface RadioOption {
2
- value: string | number;
3
- label: string;
4
- }
5
-
6
- export interface RadioChangeEvent {
7
- target: {
8
- name: string;
9
- value: string | number;
10
- };
11
- }
2
+ value: string | number;
3
+ label: string;
4
+ }
12
5
 
13
- export interface RadioButtonProps
14
- extends React.HTMLAttributes<HTMLDivElement> {
15
- label: string;
16
- options?: RadioOption[];
6
+ export interface RadioChangeEvent {
7
+ target: {
17
8
  name: string;
18
- value?: string | number;
19
- onChange?: (event: RadioChangeEvent) => void;
20
- className?: string;
21
- tabIndex?: string | number;
22
- title?: string;
23
- isValid?: boolean;
24
- errorMessage?: string;
25
- required?: boolean;
26
- dataCy?: string;
27
- disabled?: boolean;
28
- }
9
+ value: string | number;
10
+ };
11
+ }
12
+
13
+ export interface RadioButtonProps extends React.HTMLAttributes<HTMLDivElement> {
14
+ label: string;
15
+ options?: RadioOption[];
16
+ name: string;
17
+ value?: string | number;
18
+ onChange?: (event: RadioChangeEvent) => void;
19
+ className?: string;
20
+ tabIndex?: string | number;
21
+ title?: string;
22
+ isValid?: boolean;
23
+ errorMessage?: string;
24
+ required?: boolean;
25
+ dataCy?: string;
26
+ disabled?: boolean;
27
+ }
29
28
 
30
- export const RadioButton: React.FC<RadioButtonProps>;
29
+ export const RadioButton: React.FC<RadioButtonProps>;
@@ -1,8 +1,8 @@
1
1
  export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
2
- title: string;
3
- center?: React.ReactNode;
4
- right?: React.ReactNode;
5
- className?: string;
6
- }
2
+ title: string;
3
+ center?: React.ReactNode;
4
+ right?: React.ReactNode;
5
+ className?: string;
6
+ }
7
7
 
8
- export const Header: React.FC<HeaderProps>;
8
+ export const Header: React.FC<HeaderProps>;
@@ -1,15 +1,15 @@
1
1
  export type HeroIconName = keyof typeof HeroIcons;
2
- export type C247IconName = keyof typeof C247Icons;
3
- export type IconName = HeroIconName | C247IconName;
2
+ export type C247IconName = keyof typeof C247Icons;
3
+ export type IconName = HeroIconName | C247IconName;
4
4
 
5
- export type IconLibrary = "hero" | "c247";
5
+ export type IconLibrary = "hero" | "c247";
6
6
 
7
- export interface IconProps extends React.SVGProps<SVGSVGElement> {
8
- name: IconName;
9
- library?: IconLibrary;
10
- size?: number;
11
- className?: string;
12
- color?: string;
13
- }
7
+ export interface IconProps extends React.SVGProps<SVGSVGElement> {
8
+ name: IconName;
9
+ library?: IconLibrary;
10
+ size?: number;
11
+ className?: string;
12
+ color?: string;
13
+ }
14
14
 
15
- export const Icon: React.FC<IconProps>;
15
+ export const Icon: React.FC<IconProps>;
@@ -7,8 +7,7 @@ export type IconButtonRank =
7
7
 
8
8
  export type IconButtonSize = "sm" | "md" | "lg" | string;
9
9
 
10
- export interface IconButtonProps
11
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
10
+ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
12
11
  rank?: IconButtonRank;
13
12
  size?: IconButtonSize;
14
13
  title?: string;
@@ -1,8 +1,8 @@
1
1
  export interface LoaderProps {
2
- isLoading: boolean;
3
- loaderText?: string;
4
- customLoader?: React.ReactNode;
5
- className?: string;
6
- }
2
+ isLoading: boolean;
3
+ loaderText?: string;
4
+ customLoader?: React.ReactNode;
5
+ className?: string;
6
+ }
7
7
 
8
- export const Loader: React.FC<LoaderProps>;
8
+ export const Loader: React.FC<LoaderProps>;
@@ -1,16 +1,16 @@
1
1
  export interface ModalProps {
2
- isOpen: boolean;
3
- onClose?: () => void;
4
- isLoading?: boolean;
5
- loaderText?: string;
6
- header?: React.ReactNode;
7
- hideHeader?: boolean;
8
- body?: React.ReactNode;
9
- footer?: React.ReactNode;
10
- hideFooter?: boolean;
11
- className?: string;
12
- footerClassName?: string;
13
- headerClassName?: string;
14
- }
2
+ isOpen: boolean;
3
+ onClose?: () => void;
4
+ isLoading?: boolean;
5
+ loaderText?: string;
6
+ header?: React.ReactNode;
7
+ hideHeader?: boolean;
8
+ body?: React.ReactNode;
9
+ footer?: React.ReactNode;
10
+ hideFooter?: boolean;
11
+ className?: string;
12
+ footerClassName?: string;
13
+ headerClassName?: string;
14
+ }
15
15
 
16
- export const Modal: React.FC<ModalProps>;
16
+ export const Modal: React.FC<ModalProps>;
@@ -1,8 +1,8 @@
1
1
  export interface NavbarProps {
2
- children?: React.ReactNode;
3
- logo?: string;
4
- className?: string;
5
- maxWidth?: string;
6
- }
2
+ children?: React.ReactNode;
3
+ logo?: string;
4
+ className?: string;
5
+ maxWidth?: string;
6
+ }
7
7
 
8
- export const Navbar: React.FC<NavbarProps>;
8
+ export const Navbar: React.FC<NavbarProps>;
@@ -1,12 +1,12 @@
1
1
  export interface PageTemplateProps {
2
- headerTitle?: string;
3
- headerCenter?: React.ReactNode;
4
- headerRight?: React.ReactNode;
5
- footerLeft?: React.ReactNode;
6
- footerCenter?: React.ReactNode;
7
- footerRight?: React.ReactNode;
8
- children: React.ReactNode;
9
- className?: string;
10
- }
2
+ headerTitle?: string;
3
+ headerCenter?: React.ReactNode;
4
+ headerRight?: React.ReactNode;
5
+ footerLeft?: React.ReactNode;
6
+ footerCenter?: React.ReactNode;
7
+ footerRight?: React.ReactNode;
8
+ children: React.ReactNode;
9
+ className?: string;
10
+ }
11
11
 
12
- export const PageTemplate: React.FC<PageTemplateProps>;
12
+ export const PageTemplate: React.FC<PageTemplateProps>;
@@ -1,8 +1,8 @@
1
1
  export interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {
2
- text?: string;
3
- status?: "primary" | "danger" | "warning" | "success" | "info" | "notice";
4
- className?: string;
5
- icon?: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
6
- }
2
+ text?: string;
3
+ status?: "primary" | "danger" | "warning" | "success" | "info" | "notice";
4
+ className?: string;
5
+ icon?: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
6
+ }
7
7
 
8
- export const Pill: React.FC<PillProps>;
8
+ export const Pill: React.FC<PillProps>;