@sebgroup/green-react 1.14.0 → 2.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/index.esm.js +541 -518
- package/package.json +4 -3
- package/src/index.d.ts +1 -0
- package/src/lib/dropdown/dropdown.d.ts +51 -1
- package/src/lib/icons/edit.d.ts +2 -0
- package/src/lib/icons/index.d.ts +1 -0
- package/src/lib/in-page-wizard/inPageWizardStepCard.d.ts +16 -0
- package/src/lib/in-page-wizard/index.d.ts +1 -0
- package/src/types/props/index.d.ts +2 -0
- package/src/lib/dropdown/hooks.d.ts +0 -29
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebgroup/green-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "^17 || ^18",
|
|
6
6
|
"react-dom": "^17 || ^18"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@sebgroup/
|
|
10
|
-
"@sebgroup/
|
|
9
|
+
"@sebgroup/green-core": "^1.0.2",
|
|
10
|
+
"@sebgroup/chlorophyll": "^2.1.0",
|
|
11
|
+
"@sebgroup/extract": "^2.0.0",
|
|
11
12
|
"classnames": "^2.3.2"
|
|
12
13
|
},
|
|
13
14
|
"description": "React components built on top of @sebgroup/chlorophyll.",
|
package/src/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './lib/dropdown/dropdown';
|
|
|
7
7
|
export * from './lib/form';
|
|
8
8
|
export * from './lib/formItem';
|
|
9
9
|
export * from './lib/layout';
|
|
10
|
+
export * from './lib/in-page-wizard';
|
|
10
11
|
export * from './lib/link/link';
|
|
11
12
|
export * from './lib/list';
|
|
12
13
|
export * from './lib/navbar/navbar';
|
|
@@ -1,4 +1,54 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GdsDropdown, GdsOption } from '@sebgroup/green-core';
|
|
2
|
+
export declare type CompareWith<T = any> = (o1: T, o2: T) => boolean;
|
|
3
|
+
export declare type SearchFilter<T = any> = (search: string, value: T) => boolean;
|
|
4
|
+
export declare type DropdownPlacements = 'bottom-start' | 'top-start';
|
|
5
|
+
export declare type OnChange<T = any> = (value: T) => void;
|
|
6
|
+
export declare type IndicatorType = 'success' | 'error' | 'info';
|
|
7
|
+
export declare type ValidatorType = 'Required' | 'Email';
|
|
8
|
+
export interface ValidatorRules {
|
|
9
|
+
type: ValidatorType;
|
|
10
|
+
custom?: () => string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface IValidator {
|
|
13
|
+
message: string;
|
|
14
|
+
indicator: IndicatorType;
|
|
15
|
+
rules?: ValidatorRules;
|
|
16
|
+
}
|
|
17
|
+
export interface DropdownArgs {
|
|
18
|
+
compareWith?: CompareWith;
|
|
19
|
+
display?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
informationLabel?: string;
|
|
22
|
+
label?: string;
|
|
23
|
+
loop?: boolean;
|
|
24
|
+
multiSelect?: boolean;
|
|
25
|
+
onTouched?: () => void;
|
|
26
|
+
options: DropdownOption[];
|
|
27
|
+
searchFilter?: SearchFilter;
|
|
28
|
+
searchable?: boolean;
|
|
29
|
+
texts?: DropdownTexts;
|
|
30
|
+
useValue?: string;
|
|
31
|
+
validator?: IValidator;
|
|
32
|
+
value?: any;
|
|
33
|
+
}
|
|
34
|
+
export interface DropdownTexts {
|
|
35
|
+
select?: string;
|
|
36
|
+
selected?: string;
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
searchPlaceholder?: string;
|
|
39
|
+
close?: string;
|
|
40
|
+
optionsDescription?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface DropdownOption {
|
|
43
|
+
label?: string;
|
|
44
|
+
value?: any;
|
|
45
|
+
selected?: boolean;
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}
|
|
48
|
+
export declare const CoreDropdown: import("@lit-labs/react").ReactWebComponent<GdsDropdown<any>, {
|
|
49
|
+
onchange: string;
|
|
50
|
+
}>;
|
|
51
|
+
export declare const CoreOption: import("@lit-labs/react").ReactWebComponent<GdsOption, {}>;
|
|
2
52
|
export interface DropdownProps extends DropdownArgs {
|
|
3
53
|
onChange?: OnChange;
|
|
4
54
|
}
|
package/src/lib/icons/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface InPageWizardStepCardProps {
|
|
3
|
+
stepText: string;
|
|
4
|
+
title: string;
|
|
5
|
+
editBtnText: string;
|
|
6
|
+
nextBtnText: string;
|
|
7
|
+
nextBtnIcon?: ReactNode;
|
|
8
|
+
stepStatus: WizardStepStatus;
|
|
9
|
+
hideFooter?: boolean;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
onNextClick: () => void;
|
|
12
|
+
onEditClick: () => void;
|
|
13
|
+
dataTestid?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare type WizardStepStatus = 'NotStarted' | 'IsActive' | 'IsComplete';
|
|
16
|
+
export declare const InPageWizardStepCard: (props: InPageWizardStepCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './inPageWizardStepCard';
|
|
@@ -1,29 +0,0 @@
|
|
|
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 {};
|