@sebgroup/green-react 1.0.0-beta.2 → 1.0.0-beta.6
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/index.d.ts +3 -0
- package/index.esm.js +3386 -0
- package/index.umd.js +2928 -0
- package/lib/alert/alert.d.ts +3 -2
- package/lib/card/card.d.ts +3 -4
- package/lib/dropdown/hooks.d.ts +6 -6
- package/lib/form/{button.d.ts → button/button.d.ts} +0 -0
- package/lib/form/{buttonGroup.d.ts → buttonGroup/buttonGroup.d.ts} +2 -2
- package/lib/form/form.d.ts +4 -4
- package/lib/form/group/group.d.ts +9 -0
- package/lib/form/index.d.ts +6 -4
- package/lib/form/{input.d.ts → input/input.d.ts} +2 -1
- package/lib/form/radioButton/radioGroup.d.ts +9 -0
- package/lib/form/{text.d.ts → text/text.d.ts} +1 -1
- package/lib/form/types.d.ts +17 -0
- package/lib/layout/flexbox/flexbox.d.ts +9 -0
- package/lib/layout/index.d.ts +1 -1
- package/lib/link/link.d.ts +7 -0
- package/lib/list/list.d.ts +14 -0
- package/lib/list/listItem.d.ts +10 -0
- package/lib/modal/modal.d.ts +2 -1
- package/lib/navbar/navbar.d.ts +12 -0
- package/lib/tabs/tabs.d.ts +13 -0
- package/package.json +7 -10
- package/lib/layout/group.d.ts +0 -6
- package/react.esm.js +0 -1953
- package/react.umd.js +0 -1419
package/lib/alert/alert.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
export interface AlertProps {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
type: AlertType;
|
|
6
|
-
|
|
6
|
+
header?: ReactNode;
|
|
7
|
+
footer?: ReactNode;
|
|
7
8
|
isCloseable?: boolean;
|
|
8
9
|
closeText?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare function Alert({ type,
|
|
11
|
+
export declare function Alert({ type, header, footer, children, closeText, isCloseable, }: AlertProps): JSX.Element;
|
|
11
12
|
export default Alert;
|
package/lib/card/card.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import Button from '../form/button';
|
|
3
2
|
export interface CardProps {
|
|
4
3
|
children?: ReactNode;
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
header?: ReactNode;
|
|
5
|
+
footer?: ReactNode;
|
|
7
6
|
}
|
|
8
|
-
export declare function Card({ children,
|
|
7
|
+
export declare function Card({ children, header, footer }: CardProps): JSX.Element;
|
|
9
8
|
export default Card;
|
package/lib/dropdown/hooks.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { DropdownOption } from '@sebgroup/extract';
|
|
2
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { DropdownHandler, DropdownOption } from '@sebgroup/extract';
|
|
2
|
+
import { HTMLAttributes, RefObject } from 'react';
|
|
3
3
|
interface HookArgs {
|
|
4
4
|
id?: string;
|
|
5
5
|
text?: string;
|
|
6
6
|
options: DropdownOption[];
|
|
7
7
|
loop?: boolean;
|
|
8
|
+
togglerRef: RefObject<HTMLElement>;
|
|
9
|
+
listboxRef: RefObject<HTMLElement>;
|
|
8
10
|
}
|
|
9
11
|
declare type Props = HTMLAttributes<HTMLElement>;
|
|
10
12
|
interface HookResult {
|
|
13
|
+
dropdown?: DropdownHandler;
|
|
11
14
|
togglerProps: Props;
|
|
12
15
|
listboxProps: Props;
|
|
13
16
|
listItems: Props[];
|
|
14
|
-
activate: () => void;
|
|
15
|
-
deactivate: () => void;
|
|
16
|
-
close: () => void;
|
|
17
17
|
}
|
|
18
|
-
export declare const useDropdown: ({ id, text, options, loop }: HookArgs) => HookResult;
|
|
18
|
+
export declare const useDropdown: ({ id, text, options, loop, togglerRef, listboxRef }: HookArgs) => HookResult;
|
|
19
19
|
export {};
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { ButtonVariant } from '@sebgroup/extract';
|
|
3
|
-
import { ButtonProps } from '
|
|
3
|
+
import { ButtonProps } from '../button/button';
|
|
4
4
|
interface ButtonGroupProps {
|
|
5
5
|
children: ReactElement<ButtonProps> | ReactElement<ButtonProps>[];
|
|
6
6
|
selectedIndex?: number;
|
|
7
7
|
variant?: ButtonVariant;
|
|
8
8
|
}
|
|
9
|
-
export declare const ButtonGroup: ({ children, selectedIndex, variant }: ButtonGroupProps) => JSX.Element;
|
|
9
|
+
export declare const ButtonGroup: ({ children, selectedIndex, variant, }: ButtonGroupProps) => JSX.Element;
|
|
10
10
|
export default ButtonGroup;
|
package/lib/form/form.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FormDirection, Size } from '@sebgroup/extract';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
export interface FormProps {
|
|
2
|
+
import { HTMLProps, ReactNode } from 'react';
|
|
3
|
+
export interface FormProps extends HTMLProps<HTMLFormElement> {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
direction?: FormDirection;
|
|
6
|
-
|
|
6
|
+
formSize?: Size;
|
|
7
7
|
}
|
|
8
|
-
export declare function Form({ children, direction,
|
|
8
|
+
export declare function Form({ children, direction, formSize, }: FormProps): JSX.Element;
|
|
9
9
|
export default Form;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface GroupProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
error?: Error | string;
|
|
5
|
+
groupBorder?: boolean;
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function Group({ children, error, groupBorder }: GroupProps): JSX.Element;
|
|
9
|
+
export default Group;
|
package/lib/form/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export * from './button';
|
|
2
|
-
export * from './buttonGroup';
|
|
1
|
+
export * from './button/button';
|
|
2
|
+
export * from './buttonGroup/buttonGroup';
|
|
3
3
|
export * from './form';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
4
|
+
export * from './group/group';
|
|
5
|
+
export * from './input/input';
|
|
6
|
+
export * from './text/text';
|
|
7
|
+
export * from './radioButton/radioGroup';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { CheckboxProps, TextInputProps } from '
|
|
1
|
+
import { CheckboxProps, RadioButtonProps, TextInputProps } from '../types';
|
|
2
2
|
export declare const TextInput: ({ label, info, onChangeText, ...props }: TextInputProps<string>) => JSX.Element;
|
|
3
3
|
export declare const EmailInput: ({ label, info, onChangeText, ...props }: TextInputProps<string>) => JSX.Element;
|
|
4
4
|
export declare const NumberInput: ({ label, info, onChangeText, ...props }: TextInputProps<number>) => JSX.Element;
|
|
5
5
|
export declare const Checkbox: ({ label, onChecked, ...props }: CheckboxProps) => JSX.Element;
|
|
6
|
+
export declare const RadioButton: ({ label, onChangeRadioBtn, validator, ...props }: RadioButtonProps) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IValidator } from '../types';
|
|
3
|
+
export interface RadioGroupProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
validator?: IValidator;
|
|
7
|
+
}
|
|
8
|
+
export declare const RadioGroup: ({ description, title, validator, children, }: React.PropsWithChildren<RadioGroupProps>) => JSX.Element;
|
|
9
|
+
export default RadioGroup;
|
package/lib/form/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChangeEventHandler, FocusEventHandler } from 'react';
|
|
2
|
+
import { IndicatorType } from '@sebgroup/extract';
|
|
2
3
|
export interface InputProps {
|
|
3
4
|
id?: string;
|
|
4
5
|
label?: string;
|
|
@@ -22,4 +23,20 @@ export interface CheckboxProps extends InputProps {
|
|
|
22
23
|
value?: string;
|
|
23
24
|
onChecked?: (checked: boolean | undefined) => unknown;
|
|
24
25
|
}
|
|
26
|
+
export interface OnChangeRadioButton {
|
|
27
|
+
value?: string;
|
|
28
|
+
checked?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface RadioButtonProps {
|
|
31
|
+
label?: string;
|
|
32
|
+
value?: string;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
validator?: string;
|
|
35
|
+
checked?: boolean;
|
|
36
|
+
onChangeRadioBtn?: (checked: OnChangeRadioButton | undefined) => unknown;
|
|
37
|
+
}
|
|
25
38
|
export declare type InputListener<T> = (newValue?: T) => unknown;
|
|
39
|
+
export interface IValidator {
|
|
40
|
+
message: string;
|
|
41
|
+
indicator: IndicatorType;
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
interface FlexboxProps {
|
|
3
|
+
alignContent?: 'start' | 'between' | 'center' | 'stretch' | 'around' | 'end';
|
|
4
|
+
alignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
5
|
+
alignSelf?: 'auto' | 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
6
|
+
justifyContent?: 'start' | 'between' | 'center' | 'evenly' | 'around' | 'end';
|
|
7
|
+
}
|
|
8
|
+
export declare const Flexbox: ({ alignContent, alignItems, alignSelf, children, justifyContent, }: PropsWithChildren<FlexboxProps>) => JSX.Element;
|
|
9
|
+
export default Flexbox;
|
package/lib/layout/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './flexbox/flexbox';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PropsWithChildren } from 'react';
|
|
2
|
+
import { ButtonVariant } from '@sebgroup/extract';
|
|
3
|
+
interface LinkProps extends HTMLProps<HTMLAnchorElement> {
|
|
4
|
+
button?: boolean | ButtonVariant;
|
|
5
|
+
}
|
|
6
|
+
export declare const Link: ({ button, children, ...props }: PropsWithChildren<LinkProps>) => JSX.Element;
|
|
7
|
+
export default Link;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ListType } from '@sebgroup/extract';
|
|
2
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
3
|
+
export interface ListProps extends HTMLAttributes<HTMLOListElement | HTMLUListElement> {
|
|
4
|
+
listType?: ListType;
|
|
5
|
+
tableCaption?: string;
|
|
6
|
+
tableData?: TableListProps[];
|
|
7
|
+
children?: ReactNode[];
|
|
8
|
+
}
|
|
9
|
+
export interface TableListProps {
|
|
10
|
+
title: string;
|
|
11
|
+
definition: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare const List: ({ listType, tableCaption, tableData, children, ...props }: ListProps) => JSX.Element;
|
|
14
|
+
export default List;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ListType } from '@sebgroup/extract';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { TableListProps } from './list';
|
|
4
|
+
interface ListItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
5
|
+
listType?: ListType;
|
|
6
|
+
tableRowData?: TableListProps;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const ListItem: ({ listType, tableRowData, children, ...props }: ListItemProps) => JSX.Element;
|
|
10
|
+
export default ListItem;
|
package/lib/modal/modal.d.ts
CHANGED
|
@@ -8,9 +8,10 @@ export interface ModalProps {
|
|
|
8
8
|
confirm?: string;
|
|
9
9
|
dismiss?: string;
|
|
10
10
|
size?: Size;
|
|
11
|
+
isOpen?: boolean;
|
|
11
12
|
onClose?: ModalEventListener;
|
|
12
13
|
onConfirm?: ModalEventListener;
|
|
13
14
|
onDismiss?: ModalEventListener;
|
|
14
15
|
}
|
|
15
|
-
export declare const Modal: ({ type, ...props }: ModalProps) => JSX.Element;
|
|
16
|
+
export declare const Modal: ({ type, isOpen, ...props }: ModalProps) => JSX.Element | null;
|
|
16
17
|
export default Modal;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NavbarVariant } from '@sebgroup/extract';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
export interface NavProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
title?: string;
|
|
5
|
+
titleLink?: string;
|
|
6
|
+
brandLink?: string;
|
|
7
|
+
brandAriaLabel?: string;
|
|
8
|
+
variant?: NavbarVariant;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const Navbar: ({ children, variant, title, titleLink, brandLink, brandAriaLabel, }: NavProps) => JSX.Element;
|
|
12
|
+
export default Navbar;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface IList {
|
|
3
|
+
text?: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface TabsProps {
|
|
8
|
+
list?: IList[];
|
|
9
|
+
onTabChange?: (index: number) => void;
|
|
10
|
+
children?: ReactNode[];
|
|
11
|
+
}
|
|
12
|
+
export declare const Tabs: ({ list, onTabChange, children }: TabsProps) => JSX.Element;
|
|
13
|
+
export default Tabs;
|
package/package.json
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebgroup/green-react",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.6",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"react": "^17.0.
|
|
6
|
-
"react-dom": "^17.0.
|
|
7
|
-
"rxjs": "^6.6.7",
|
|
8
|
-
"merge": "^2.1.1"
|
|
5
|
+
"react": "^17.0.0",
|
|
6
|
+
"react-dom": "^17.0.0"
|
|
9
7
|
},
|
|
10
8
|
"dependencies": {
|
|
11
|
-
"@sebgroup/chlorophyll": "1.0.0-beta.
|
|
12
|
-
"@sebgroup/extract": "1.0.0-beta.
|
|
13
|
-
"react-popper": "^2.2.5"
|
|
9
|
+
"@sebgroup/chlorophyll": "^1.0.0-beta.6",
|
|
10
|
+
"@sebgroup/extract": "^1.0.0-beta.6"
|
|
14
11
|
},
|
|
15
12
|
"description": "React components built on top of @sebgroup/chlorophyll.",
|
|
16
13
|
"repository": {
|
|
@@ -28,7 +25,7 @@
|
|
|
28
25
|
"url": "https://github.com/sebgroup/green/labels/react"
|
|
29
26
|
},
|
|
30
27
|
"homepage": "https://sebgroup.github.io/green/latest/react/",
|
|
31
|
-
"main": "./
|
|
32
|
-
"module": "./
|
|
28
|
+
"main": "./index.umd.js",
|
|
29
|
+
"module": "./index.esm.js",
|
|
33
30
|
"typings": "./index.d.ts"
|
|
34
31
|
}
|