@sebgroup/green-react 1.0.0-beta.2 → 1.0.0-beta.20
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 +6 -0
- package/{react.esm.js → index.esm.js} +1332 -389
- package/index.umd.js +2928 -0
- package/lib/alert/alert.d.ts +3 -2
- package/lib/badge/badge.d.ts +12 -0
- package/lib/card/card.d.ts +3 -4
- package/lib/datepicker/datepicker.d.ts +2 -0
- package/lib/datepicker/hook.d.ts +12 -0
- package/lib/dropdown/dropdown.d.ts +10 -3
- package/lib/dropdown/hooks.d.ts +25 -7
- 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 +5 -4
- package/lib/form/formContext.d.ts +13 -0
- package/lib/form/formItems.d.ts +9 -0
- package/lib/form/group/group.d.ts +9 -0
- package/lib/form/index.d.ts +7 -4
- package/lib/form/input/input.d.ts +11 -0
- package/lib/form/radioButton/radioGroup.d.ts +13 -0
- package/lib/form/{text.d.ts → text/text.d.ts} +1 -1
- package/lib/form/types.d.ts +14 -16
- package/lib/form/useInput.d.ts +2 -3
- package/lib/form/validateInput.d.ts +9 -0
- package/lib/layout/flexbox/flexbox.d.ts +13 -0
- package/lib/layout/flexbox/types.d.ts +5 -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/stepper/hook.d.ts +3 -0
- package/lib/stepper/stepper.d.ts +8 -0
- package/lib/tabs/tabs.d.ts +13 -0
- package/package.json +7 -10
- package/lib/form/input.d.ts +0 -5
- package/lib/layout/group.d.ts +0 -6
- 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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLProps, ReactNode } from 'react';
|
|
2
|
+
import { BadgeType } from '@sebgroup/extract';
|
|
3
|
+
export interface BadgeProps extends HTMLProps<HTMLSpanElement> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
badgeType?: BadgeType;
|
|
6
|
+
isCloseable?: boolean;
|
|
7
|
+
closeText?: string;
|
|
8
|
+
customColor?: string;
|
|
9
|
+
customBackgroundColor?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function Badge({ children, badgeType, isCloseable, closeText, customColor, customBackgroundColor, ...props }: BadgeProps): JSX.Element | null;
|
|
12
|
+
export default Badge;
|
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { Datepicker, DatepickerData, DatepickerOptions, DatepickerState } from '@sebgroup/extract';
|
|
3
|
+
interface HookResult {
|
|
4
|
+
datepicker: Datepicker;
|
|
5
|
+
data: DatepickerData;
|
|
6
|
+
state: DatepickerState;
|
|
7
|
+
}
|
|
8
|
+
interface DatepickerHook {
|
|
9
|
+
(datepickerRef: RefObject<HTMLElement>, datepickerDialogRef: RefObject<HTMLElement>, dateInputRef: RefObject<HTMLInputElement>, datepickerTriggerRef: RefObject<HTMLButtonElement>, options?: DatepickerOptions): HookResult;
|
|
10
|
+
}
|
|
11
|
+
export declare const useDatepicker: DatepickerHook;
|
|
12
|
+
export {};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { DropdownOption } from '@sebgroup/extract';
|
|
1
|
+
import { DropdownOption, DropdownTexts } from '@sebgroup/extract';
|
|
2
|
+
import { IValidator } from "@sebgroup/extract";
|
|
2
3
|
export interface DropdownProps {
|
|
3
4
|
id?: string;
|
|
4
|
-
|
|
5
|
+
texts?: DropdownTexts;
|
|
5
6
|
options: DropdownOption[];
|
|
7
|
+
useValue?: string;
|
|
8
|
+
display?: string;
|
|
9
|
+
selectValue?: string;
|
|
6
10
|
loop?: boolean;
|
|
11
|
+
multiSelect?: boolean;
|
|
12
|
+
onChange?: (o: DropdownOption) => void;
|
|
13
|
+
validator?: IValidator;
|
|
7
14
|
}
|
|
8
|
-
export declare const Dropdown: ({ id, options, loop,
|
|
15
|
+
export declare const Dropdown: ({ id, options, loop, multiSelect, selectValue, useValue, display, texts, onChange, validator }: DropdownProps) => JSX.Element;
|
|
9
16
|
export default Dropdown;
|
package/lib/dropdown/hooks.d.ts
CHANGED
|
@@ -1,19 +1,37 @@
|
|
|
1
|
-
import { DropdownOption } from '@sebgroup/extract';
|
|
2
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { DropdownHandler, DropdownOption, DropdownTexts } from '@sebgroup/extract';
|
|
2
|
+
import { HTMLAttributes, InputHTMLAttributes, RefObject } from 'react';
|
|
3
|
+
import { IValidator } from "@sebgroup/extract";
|
|
3
4
|
interface HookArgs {
|
|
4
5
|
id?: string;
|
|
5
|
-
|
|
6
|
+
texts?: DropdownTexts;
|
|
6
7
|
options: DropdownOption[];
|
|
8
|
+
multiSelect?: boolean;
|
|
7
9
|
loop?: boolean;
|
|
10
|
+
selectValue?: string;
|
|
11
|
+
useValue?: string;
|
|
12
|
+
display?: string;
|
|
13
|
+
togglerRef: RefObject<HTMLElement>;
|
|
14
|
+
listboxRef: RefObject<HTMLElement>;
|
|
15
|
+
onChange?: (o: DropdownOption) => void;
|
|
16
|
+
validator?: IValidator;
|
|
8
17
|
}
|
|
9
18
|
declare type Props = HTMLAttributes<HTMLElement>;
|
|
19
|
+
interface CheckboxItem {
|
|
20
|
+
labelProps: Props;
|
|
21
|
+
inputProps: InputHTMLAttributes<HTMLInputElement>;
|
|
22
|
+
spanProps: Props;
|
|
23
|
+
}
|
|
24
|
+
interface MultiSelectProps {
|
|
25
|
+
fieldsetProps?: Props;
|
|
26
|
+
legendProps?: Props;
|
|
27
|
+
checkboxes?: CheckboxItem[];
|
|
28
|
+
}
|
|
10
29
|
interface HookResult {
|
|
30
|
+
dropdown?: DropdownHandler;
|
|
11
31
|
togglerProps: Props;
|
|
12
32
|
listboxProps: Props;
|
|
13
33
|
listItems: Props[];
|
|
14
|
-
|
|
15
|
-
deactivate: () => void;
|
|
16
|
-
close: () => void;
|
|
34
|
+
multiSelectProps: MultiSelectProps;
|
|
17
35
|
}
|
|
18
|
-
export declare const useDropdown: ({ id,
|
|
36
|
+
export declare const useDropdown: ({ id, texts, options, loop, multiSelect, selectValue, useValue, display, togglerRef, listboxRef, onChange, validator }: HookArgs) => HookResult;
|
|
19
37
|
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,10 @@
|
|
|
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
|
+
onFormSubmit?: (values: any) => void;
|
|
7
8
|
}
|
|
8
|
-
export declare
|
|
9
|
+
export declare const Form: React.FC<FormProps>;
|
|
9
10
|
export default Form;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormProps } from './form';
|
|
3
|
+
interface FormContextReturnType {
|
|
4
|
+
setValues: React.Dispatch<React.SetStateAction<Record<string, any>>>;
|
|
5
|
+
setErrors: React.Dispatch<React.SetStateAction<Record<string, any>>>;
|
|
6
|
+
setFields: React.Dispatch<React.SetStateAction<Record<string, any>>>;
|
|
7
|
+
errors?: Record<string, any>;
|
|
8
|
+
values?: Record<string, any>;
|
|
9
|
+
}
|
|
10
|
+
export declare const FormContext: React.Context<FormContextReturnType>;
|
|
11
|
+
export declare const useFormContext: () => FormContextReturnType;
|
|
12
|
+
export declare const FormProvider: ({ children, direction, formSize, onSubmit, onFormSubmit, ...props }: React.PropsWithChildren<FormProps>) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IValidator } from '@sebgroup/extract';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface FormItemsProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
validate?: IValidator;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const FormItems: React.FC<FormItemsProps>;
|
|
9
|
+
export default FormItems;
|
|
@@ -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,8 @@
|
|
|
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 './formItems';
|
|
5
|
+
export * from './group/group';
|
|
6
|
+
export * from './input/input';
|
|
7
|
+
export * from './text/text';
|
|
8
|
+
export * from './radioButton/radioGroup';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { CheckboxProps, NumberInputProps, RadioButtonProps, TextInputProps } from '../types';
|
|
3
|
+
import { IValidator } from '@sebgroup/extract';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export declare type Renderer = (type: string, props: InputHTMLAttributes<HTMLInputElement>, onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void, onChangeInput?: (value: string) => string, label?: string, info?: string, validator?: IValidator) => JSX.Element;
|
|
6
|
+
export declare const RenderInput: Renderer;
|
|
7
|
+
export declare const TextInput: ({ label, info, onChange, onChangeInput, validator, ...props }: TextInputProps) => JSX.Element;
|
|
8
|
+
export declare const EmailInput: ({ label, info, onChange, onChangeInput, validator, ...props }: TextInputProps) => JSX.Element;
|
|
9
|
+
export declare const NumberInput: ({ label, info, onChange, onChangeInput, validator, ...props }: NumberInputProps) => JSX.Element;
|
|
10
|
+
export declare const Checkbox: ({ label, onChange, validator, ...props }: CheckboxProps) => JSX.Element;
|
|
11
|
+
export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "label" | "onChange" | "validator" | "type" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IValidator } from '@sebgroup/extract';
|
|
3
|
+
export interface RadioGroupProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
defaultSelected?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
validator?: IValidator;
|
|
8
|
+
onChangeRadio?: (value: string) => string;
|
|
9
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const RadioGroup: ({ defaultSelected, description, title, validator, onChangeRadio, onChange, name, children }: React.PropsWithChildren<RadioGroupProps>) => JSX.Element;
|
|
13
|
+
export default RadioGroup;
|
package/lib/form/types.d.ts
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
label?: string;
|
|
5
|
-
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
6
|
-
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
7
|
-
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
8
|
-
}
|
|
9
|
-
export interface TextInputProps<T> extends InputProps {
|
|
1
|
+
import { IValidator } from '@sebgroup/extract';
|
|
2
|
+
import { HTMLProps } from 'react';
|
|
3
|
+
export interface TextInputProps extends HTMLProps<HTMLInputElement> {
|
|
10
4
|
type?: 'text' | 'email' | 'number';
|
|
11
|
-
|
|
5
|
+
label?: string;
|
|
12
6
|
info?: string;
|
|
13
|
-
|
|
7
|
+
validator?: IValidator;
|
|
8
|
+
onChangeInput?: (value: string) => string;
|
|
14
9
|
}
|
|
15
|
-
export interface NumberInputProps extends TextInputProps
|
|
10
|
+
export interface NumberInputProps extends TextInputProps {
|
|
16
11
|
min?: number;
|
|
17
12
|
max?: number;
|
|
18
13
|
step?: number;
|
|
19
14
|
}
|
|
20
|
-
export interface CheckboxProps extends
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
export interface CheckboxProps extends HTMLProps<HTMLInputElement> {
|
|
16
|
+
validator?: IValidator;
|
|
17
|
+
}
|
|
18
|
+
export interface RadioButtonProps extends HTMLProps<HTMLInputElement> {
|
|
19
|
+
label: string;
|
|
20
|
+
validator?: string;
|
|
21
|
+
value: string;
|
|
24
22
|
}
|
|
25
23
|
export declare type InputListener<T> = (newValue?: T) => unknown;
|
package/lib/form/useInput.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { InputHTMLAttributes, RefObject } from 'react';
|
|
2
|
-
|
|
3
|
-
declare const useInput: <T>(props: InputHTMLAttributes<HTMLInputElement>, evaluator: (element: HTMLInputElement) => T | undefined, notify?: InputListener<T> | undefined) => InputHTMLAttributes<HTMLInputElement> & {
|
|
1
|
+
import React, { InputHTMLAttributes, RefObject } from 'react';
|
|
2
|
+
declare const useInput: (props: InputHTMLAttributes<HTMLInputElement>, onChanges?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined, onChangeInput?: ((value: string) => string) | undefined) => React.InputHTMLAttributes<HTMLInputElement> & {
|
|
4
3
|
ref: RefObject<HTMLInputElement>;
|
|
5
4
|
};
|
|
6
5
|
export default useInput;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidatorRules } from '@sebgroup/extract';
|
|
2
|
+
interface InputTargetType {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const validateInputValue: (target: InputTargetType, rules: ValidatorRules, setError: React.Dispatch<React.SetStateAction<Record<string, any>>>) => string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PropsWithChildren, HTMLProps } from 'react';
|
|
2
|
+
import { AlignContentType, AlignType, FlexDirectionType, FlexWrapType, JustifyContentType } from './types';
|
|
3
|
+
export interface FlexboxProps extends HTMLProps<HTMLDivElement> {
|
|
4
|
+
alignContent?: AlignContentType;
|
|
5
|
+
alignItems?: AlignType;
|
|
6
|
+
alignSelf?: AlignType;
|
|
7
|
+
justifyContent?: JustifyContentType;
|
|
8
|
+
flexDirection?: FlexDirectionType;
|
|
9
|
+
flexWrap?: FlexWrapType;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Flexbox: ({ alignContent, alignItems, alignSelf, children, justifyContent, flexDirection, flexWrap, className, ...props }: PropsWithChildren<FlexboxProps>) => JSX.Element;
|
|
13
|
+
export default Flexbox;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare type AlignContentType = 'start' | 'between' | 'center' | 'stretch' | 'around' | 'end' | 'sm-start' | 'sm-between' | 'sm-center' | 'sm-stretch' | 'sm-around' | 'sm-end' | 'md-start' | 'md-between' | 'md-center' | 'md-stretch' | 'md-around' | 'md-end' | 'lg-start' | 'lg-between' | 'lg-center' | 'lg-stretch' | 'lg-around' | 'lg-end' | 'xl-start' | 'xl-between' | 'xl-center' | 'xl-stretch' | 'xl-around' | 'xl-end' | 'xxl-start' | 'xxl-between' | 'xxl-center' | 'xxl-stretch' | 'xxl-around' | 'xxl-end';
|
|
2
|
+
export declare type AlignType = 'start' | 'end' | 'center' | 'baseline' | 'stretch' | 'sm-start' | 'sm-end' | 'sm-center' | 'sm-baseline' | 'sm-stretch' | 'md-start' | 'md-end' | 'md-center' | 'md-baseline' | 'md-stretch' | 'lg-start' | 'lg-end' | 'lg-center' | 'lg-baseline' | 'lg-stretch' | 'xl-start' | 'xl-end' | 'xl-center' | 'xl-baseline' | 'xl-stretch' | 'xxl-start' | 'xxl-end' | 'xxl-center' | 'xxl-baseline' | 'xxl-stretch';
|
|
3
|
+
export declare type JustifyContentType = 'start' | 'between' | 'center' | 'evenly' | 'around' | 'end' | 'sm-start' | 'sm-between' | 'sm-center' | 'sm-evenly' | 'sm-around' | 'sm-end' | 'md-start' | 'md-between' | 'md-center' | 'md-evenly' | 'md-around' | 'md-end' | 'lg-start' | 'lg-between' | 'lg-center' | 'lg-evenly' | 'lg-around' | 'lg-end' | 'xl-start' | 'xl-between' | 'xl-center' | 'xl-evenly' | 'xl-around' | 'xl-end' | 'xxl-start' | 'xxl-between' | 'xxl-center' | 'xxl-evenly' | 'xxl-around' | 'xxl-end';
|
|
4
|
+
export declare type FlexDirectionType = 'row' | 'row-reverse' | 'column' | 'column-reverse' | 'sm-row' | 'sm-row-reverse' | 'sm-column' | 'sm-column-reverse' | 'md-row' | 'md-row-reverse' | 'md-column' | 'md-column-reverse' | 'lg-row' | 'lg-row-reverse' | 'lg-column' | 'lg-column-reverse' | 'xl-row' | 'xl-row-reverse' | 'xl-column' | 'xl-column-reverse' | 'xxl-row' | 'xxl-row-reverse' | 'xxl-column' | 'xxl-column-reverse';
|
|
5
|
+
export declare type FlexWrapType = 'nowrap' | 'wrap' | 'wrap-reverse' | 'sm-nowrap' | 'sm-wrap' | 'sm-wrap-reverse' | 'md-nowrap' | 'md-wrap' | 'md-wrap-reverse' | 'lg-nowrap' | 'lg-wrap' | 'lg-wrap-reverse' | 'xl-nowrap' | 'xl-wrap' | 'xl-wrap-reverse' | 'xxl-nowrap' | 'xxl-wrap' | 'xxl-wrap-reverse';
|
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,8 @@
|
|
|
1
|
+
import { StepperArgs } from './hook';
|
|
2
|
+
export interface StepperProps extends StepperArgs {
|
|
3
|
+
label?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
statusMessage?: string;
|
|
6
|
+
onChange?: (value: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function Stepper({ label, description, statusMessage, onChange, ...props }: StepperProps): JSX.Element;
|
|
@@ -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.20",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"react": "^17
|
|
6
|
-
"react-dom": "^17
|
|
7
|
-
"rxjs": "^6.6.7",
|
|
8
|
-
"merge": "^2.1.1"
|
|
5
|
+
"react": "^17 || ^18",
|
|
6
|
+
"react-dom": "^17 || ^18"
|
|
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.19",
|
|
10
|
+
"@sebgroup/extract": "^1.0.0-beta.19"
|
|
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
|
}
|
package/lib/form/input.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CheckboxProps, TextInputProps } from './types';
|
|
2
|
-
export declare const TextInput: ({ label, info, onChangeText, ...props }: TextInputProps<string>) => JSX.Element;
|
|
3
|
-
export declare const EmailInput: ({ label, info, onChangeText, ...props }: TextInputProps<string>) => JSX.Element;
|
|
4
|
-
export declare const NumberInput: ({ label, info, onChangeText, ...props }: TextInputProps<number>) => JSX.Element;
|
|
5
|
-
export declare const Checkbox: ({ label, onChecked, ...props }: CheckboxProps) => JSX.Element;
|