@sebgroup/green-react 0.1.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.
- package/README.md +61 -0
- package/index.d.ts +13 -0
- package/index.esm.js +3235 -0
- package/index.umd.js +3269 -0
- package/lib/accordion/accordion-item.d.ts +17 -0
- package/lib/accordion/accordion.d.ts +6 -0
- package/lib/alert-ribbon/alert-ribbon.d.ts +16 -0
- package/lib/badge/badge.d.ts +12 -0
- package/lib/card/card.d.ts +8 -0
- package/lib/datepicker/datepicker.d.ts +2 -0
- package/lib/datepicker/hook.d.ts +12 -0
- package/lib/dropdown/dropdown.d.ts +6 -0
- package/lib/dropdown/hooks.d.ts +29 -0
- package/lib/form/button/button.d.ts +13 -0
- package/lib/form/buttonGroup/buttonGroup.d.ts +10 -0
- package/lib/form/form.d.ts +10 -0
- 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 +8 -0
- package/lib/form/input/input.d.ts +11 -0
- package/lib/form/radioButton/radioGroup.d.ts +13 -0
- package/lib/form/text/text.d.ts +6 -0
- package/lib/form/types.d.ts +23 -0
- package/lib/form/useInput.d.ts +5 -0
- package/lib/form/validateInput.d.ts +9 -0
- package/lib/icons/check.d.ts +1 -0
- package/lib/icons/index.d.ts +3 -0
- package/lib/icons/square-exclamation.d.ts +1 -0
- package/lib/icons/square-info.d.ts +1 -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 -0
- 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 +17 -0
- package/lib/navbar/navbar.d.ts +12 -0
- package/lib/stepper/hook.d.ts +3 -0
- package/lib/stepper/stepper.d.ts +9 -0
- package/lib/tabs/tabs.d.ts +13 -0
- package/package.json +31 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface AccordionItemProps {
|
|
3
|
+
item: AccordionItemInterface;
|
|
4
|
+
index: number;
|
|
5
|
+
uuid: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AccordionItemInterface {
|
|
8
|
+
label: string;
|
|
9
|
+
labelElementLevel: 2 | 3 | 4 | 5 | 6;
|
|
10
|
+
subLabel?: string;
|
|
11
|
+
content: JSX.Element;
|
|
12
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
onOpen?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
14
|
+
onClose?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const AccordionItem: ({ item, index, uuid }: AccordionItemProps) => JSX.Element;
|
|
17
|
+
export default AccordionItem;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { AriaAttributes, ReactNode } from 'react';
|
|
2
|
+
import { AlertRibbonType } from '@sebgroup/extract';
|
|
3
|
+
export interface AlertRibbonProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
type?: AlertRibbonType;
|
|
6
|
+
header?: ReactNode;
|
|
7
|
+
footer?: ReactNode;
|
|
8
|
+
isCloseable?: boolean;
|
|
9
|
+
closeText?: string;
|
|
10
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
role?: 'alert';
|
|
12
|
+
["aria-live"]?: AriaAttributes["aria-live"];
|
|
13
|
+
closeAriaLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function AlertRibbon({ type, header, footer, children, closeText, isCloseable, onClose, role, "aria-live": ariaLive, closeAriaLabel }: AlertRibbonProps): JSX.Element;
|
|
16
|
+
export default AlertRibbon;
|
|
@@ -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;
|
|
@@ -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 {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DropdownArgs, OnChange } from '@sebgroup/extract';
|
|
2
|
+
export interface DropdownProps extends DropdownArgs {
|
|
3
|
+
onChange?: OnChange;
|
|
4
|
+
}
|
|
5
|
+
export declare const Dropdown: ({ compareWith, display, id, informationLabel, label, loop, multiSelect, onChange, options, searchFilter, searchable, texts, useValue, validator, value, }: DropdownProps) => JSX.Element;
|
|
6
|
+
export default Dropdown;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DropdownHandler, OnChange, DropdownArgs } from '@sebgroup/extract';
|
|
2
|
+
import { HTMLAttributes, InputHTMLAttributes, RefObject } from 'react';
|
|
3
|
+
import { IValidator } from '@sebgroup/extract';
|
|
4
|
+
interface HookArgs extends DropdownArgs {
|
|
5
|
+
togglerRef: RefObject<HTMLElement>;
|
|
6
|
+
listboxRef: RefObject<HTMLElement>;
|
|
7
|
+
onChange?: OnChange;
|
|
8
|
+
validator?: IValidator;
|
|
9
|
+
}
|
|
10
|
+
declare type Props = HTMLAttributes<HTMLElement>;
|
|
11
|
+
interface CheckboxItem {
|
|
12
|
+
labelProps: Props;
|
|
13
|
+
inputProps: InputHTMLAttributes<HTMLInputElement>;
|
|
14
|
+
spanProps: Props;
|
|
15
|
+
}
|
|
16
|
+
interface MultiSelectProps {
|
|
17
|
+
fieldsetProps?: Props;
|
|
18
|
+
legendProps?: Props;
|
|
19
|
+
checkboxes?: CheckboxItem[];
|
|
20
|
+
}
|
|
21
|
+
interface HookResult {
|
|
22
|
+
dropdown?: DropdownHandler;
|
|
23
|
+
togglerProps: Props;
|
|
24
|
+
listboxProps: Props;
|
|
25
|
+
listItems: Props[];
|
|
26
|
+
multiSelectProps: MultiSelectProps;
|
|
27
|
+
}
|
|
28
|
+
export declare const useDropdown: ({ id, value, texts, options, loop, multiSelect, searchable, searchFilter, compareWith, useValue, display, togglerRef, listboxRef, onChange, validator, }: HookArgs) => HookResult;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { ButtonSize, ButtonType, ButtonVariant } from '@sebgroup/extract';
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
type?: ButtonType;
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
size?: ButtonSize;
|
|
11
|
+
}
|
|
12
|
+
export declare function Button({ children, variant, onClick, disabled, active, type, size }: ButtonProps): JSX.Element;
|
|
13
|
+
export default Button;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ButtonVariant } from '@sebgroup/extract';
|
|
3
|
+
import { ButtonProps } from '../button/button';
|
|
4
|
+
interface ButtonGroupProps {
|
|
5
|
+
children: ReactElement<ButtonProps> | ReactElement<ButtonProps>[];
|
|
6
|
+
selectedIndex?: number;
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
}
|
|
9
|
+
export declare const ButtonGroup: ({ children, selectedIndex, variant, }: ButtonGroupProps) => JSX.Element;
|
|
10
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormDirection, Size } from '@sebgroup/extract';
|
|
2
|
+
import { HTMLProps, ReactNode } from 'react';
|
|
3
|
+
export interface FormProps extends HTMLProps<HTMLFormElement> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
direction?: FormDirection;
|
|
6
|
+
formSize?: Size;
|
|
7
|
+
onFormSubmit?: (values: any) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Form: React.FC<FormProps>;
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './button/button';
|
|
2
|
+
export * from './buttonGroup/buttonGroup';
|
|
3
|
+
export * from './form';
|
|
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;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IValidator } from '@sebgroup/extract';
|
|
2
|
+
import { HTMLProps } from 'react';
|
|
3
|
+
export interface TextInputProps extends HTMLProps<HTMLInputElement> {
|
|
4
|
+
type?: 'text' | 'email' | 'number';
|
|
5
|
+
label?: string;
|
|
6
|
+
info?: string;
|
|
7
|
+
validator?: IValidator;
|
|
8
|
+
onChangeInput?: (value: string) => string;
|
|
9
|
+
}
|
|
10
|
+
export interface NumberInputProps extends TextInputProps {
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
step?: number;
|
|
14
|
+
}
|
|
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;
|
|
22
|
+
}
|
|
23
|
+
export declare type InputListener<T> = (newValue?: T) => unknown;
|
|
@@ -0,0 +1,5 @@
|
|
|
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> & {
|
|
3
|
+
ref: RefObject<HTMLInputElement>;
|
|
4
|
+
};
|
|
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 @@
|
|
|
1
|
+
export declare const checkIcon: JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const squareExclamationIcon: JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const squareInfoIcon: JSX.Element;
|
|
@@ -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';
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ModalType, Size } from '@sebgroup/extract';
|
|
2
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
3
|
+
declare type ModalEventListener = (event: MouseEvent<HTMLButtonElement>) => unknown;
|
|
4
|
+
export interface ModalProps {
|
|
5
|
+
type?: ModalType;
|
|
6
|
+
header?: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
confirm?: string;
|
|
9
|
+
dismiss?: string;
|
|
10
|
+
size?: Size;
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
onClose?: ModalEventListener;
|
|
13
|
+
onConfirm?: ModalEventListener;
|
|
14
|
+
onDismiss?: ModalEventListener;
|
|
15
|
+
}
|
|
16
|
+
export declare const Modal: ({ type, isOpen, ...props }: ModalProps) => JSX.Element | null;
|
|
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,9 @@
|
|
|
1
|
+
import { StepperArgs } from './hook';
|
|
2
|
+
import { IValidator } from "@sebgroup/extract";
|
|
3
|
+
export interface StepperProps extends StepperArgs {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
statusMessage?: string;
|
|
7
|
+
validator?: IValidator;
|
|
8
|
+
}
|
|
9
|
+
export declare function Stepper({ label, description, statusMessage, validator, ...stepperArgs }: 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
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sebgroup/green-react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"react": "^17 || ^18",
|
|
6
|
+
"react-dom": "^17 || ^18"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@sebgroup/chlorophyll": "^0.1.0",
|
|
10
|
+
"@sebgroup/extract": "^0.0.1"
|
|
11
|
+
},
|
|
12
|
+
"description": "React components built on top of @sebgroup/chlorophyll.",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/sebgroup/green.git"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"registry": "https://registry.npmjs.org/",
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"author": "Johan Öbrink <johan.obrink@gmail.com> (http://www.linkedin.com/in/johanobrink/)",
|
|
22
|
+
"contributors": [],
|
|
23
|
+
"license": "Apache-2.0",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/sebgroup/green/labels/react"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://sebgroup.github.io/green/latest/react/",
|
|
28
|
+
"main": "./index.umd.js",
|
|
29
|
+
"module": "./index.esm.js",
|
|
30
|
+
"typings": "./index.d.ts"
|
|
31
|
+
}
|