@aveonline/ui-react 1.6.12 → 1.7.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 CHANGED
@@ -1,126 +1,126 @@
1
- <div align="center">
2
- <img height="100" src="https://user-images.githubusercontent.com/38017835/197309416-fd4390a0-cfb6-41f3-ac26-10d067d92a25.png">
3
- <h1 align="center">ui ecosystem react</h1>
4
- <p>The home base for Aveonline design system, ui-react provides essential design resources for our developers to use in the Aveonline-branded interfaces that they create.</p>
5
- <a href="https://ui-aveonline.netlify.app/">Go Storybook</a>
6
- </div>
7
-
8
- ## Before started
9
-
10
- For usage with tailwind config, install:
11
-
12
- ```shell
13
- npm i @tailwindcss/forms -D
14
- ```
15
-
16
- ## Getting started
17
-
18
- Working with all config from this library or only components availables
19
-
20
- ```shell
21
- npm i @aveonline/ui-react
22
- ```
23
-
24
- ## Usage with tailwind
25
-
26
- Import things into your JS app from the `@aveonline/ui-react` package.
27
-
28
- ```ts
29
- import { Button } from '@aveonline/ui-react'
30
- ```
31
-
32
- `tailwind.config.js`
33
-
34
- ```ts
35
- /** @type {import('tailwindcss').Config} */
36
-
37
- const tailwindConfig = require('@aveonline/ui-react/tailwind.config.js')
38
- const { content, ...all } = tailwindConfig
39
-
40
- const config = {
41
- content: [
42
- ...content,
43
- './pages/**/*.{ts,tsx}',
44
- './components/**/*.{ts,tsx}',
45
- './node_modules/@aveonline/ui-react/dist/*.{mjs,js}'
46
- ],
47
- ...all
48
- }
49
-
50
- module.exports = config
51
- ```
52
-
53
- ## Usage css
54
-
55
- Import things into your JS app from the `@aveonline/ui-react` package.
56
-
57
- ```css
58
- /* global.css or tailwind.css local */
59
- @tailwind base;
60
- @tailwind components;
61
- @tailwind utilities;
62
- ```
63
-
64
- ```ts
65
- // import this lines at main.ts or root
66
- import './global.css' // Reference tailwind local
67
- import '@aveonline/ui-react/reset.css' // Only not usage tailwind
68
- import '@aveonline/ui-react/tokens.css' // Required
69
- import '@aveonline/ui-react/tailwind.css' // Required
70
- import '@aveonline/ui-react/index.css' // Required
71
- ```
72
-
73
- ## Example usage
74
-
75
- ```html
76
- <!-- Class from library -->
77
- <div class="bg-letter-default">
78
- <p class="text-letter-subdued">Hello human</p>
79
- </div>
80
- ```
81
-
82
- ## Developing @aveonline/ui-react
83
-
84
- Developing locally against Storybook is easy; run `npm run storybook`.
85
-
86
- ```shell
87
- npm i
88
- ```
89
-
90
- Tests
91
-
92
- Run `npm run test` to execute all unit test components.
93
-
94
- We use `vitest` and `testing-library/react` for unit/integration tests and [Chromatic](https://www.chromaticqa.com/) for visual regression testing.
95
-
96
- Open Storybook
97
-
98
- ```shell
99
- npm run dev
100
- ```
101
-
102
- ui-react production
103
-
104
- ```shell
105
- npm run build
106
- ```
107
-
108
- Storybook production
109
-
110
- ```shell
111
- npm run build:storybook
112
- ```
113
-
114
- Run test
115
-
116
- ```shell
117
- npm run test
118
- ```
119
-
120
- Run regression testing
121
-
122
- - [Join](https://www.chromatic.com/library?appId=6362f0c0f36774d17ed0c3a0&inviteToken=4adce6358a9b439f8b636d0599e6db4b)
123
-
124
- ```shell
125
- npm run chromatic
126
- ```
1
+ <div align="center">
2
+ <img height="100" src="https://user-images.githubusercontent.com/38017835/197309416-fd4390a0-cfb6-41f3-ac26-10d067d92a25.png">
3
+ <h1 align="center">ui ecosystem react</h1>
4
+ <p>The home base for Aveonline design system, ui-react provides essential design resources for our developers to use in the Aveonline-branded interfaces that they create.</p>
5
+ <a href="https://ui-aveonline.netlify.app/">Go Storybook</a>
6
+ </div>
7
+
8
+ ## Before started
9
+
10
+ For usage with tailwind config, install:
11
+
12
+ ```shell
13
+ npm i @tailwindcss/forms -D
14
+ ```
15
+
16
+ ## Getting started
17
+
18
+ Working with all config from this library or only components availables
19
+
20
+ ```shell
21
+ npm i @aveonline/ui-react
22
+ ```
23
+
24
+ ## Usage with tailwind
25
+
26
+ Import things into your JS app from the `@aveonline/ui-react` package.
27
+
28
+ ```ts
29
+ import { Button } from '@aveonline/ui-react'
30
+ ```
31
+
32
+ `tailwind.config.js`
33
+
34
+ ```ts
35
+ /** @type {import('tailwindcss').Config} */
36
+
37
+ const tailwindConfig = require('@aveonline/ui-react/tailwind.config.js')
38
+ const { content, ...all } = tailwindConfig
39
+
40
+ const config = {
41
+ content: [
42
+ ...content,
43
+ './pages/**/*.{ts,tsx}',
44
+ './components/**/*.{ts,tsx}',
45
+ './node_modules/@aveonline/ui-react/dist/*.{mjs,js}'
46
+ ],
47
+ ...all
48
+ }
49
+
50
+ module.exports = config
51
+ ```
52
+
53
+ ## Usage css
54
+
55
+ Import things into your JS app from the `@aveonline/ui-react` package.
56
+
57
+ ```css
58
+ /* global.css or tailwind.css local */
59
+ @tailwind base;
60
+ @tailwind components;
61
+ @tailwind utilities;
62
+ ```
63
+
64
+ ```ts
65
+ // import this lines at main.ts or root
66
+ import './global.css' // Reference tailwind local
67
+ import '@aveonline/ui-react/reset.css' // Only not usage tailwind
68
+ import '@aveonline/ui-react/tokens.css' // Required
69
+ import '@aveonline/ui-react/tailwind.css' // Required
70
+ import '@aveonline/ui-react/index.css' // Required
71
+ ```
72
+
73
+ ## Example usage
74
+
75
+ ```html
76
+ <!-- Class from library -->
77
+ <div class="bg-letter-default">
78
+ <p class="text-letter-subdued">Hello human</p>
79
+ </div>
80
+ ```
81
+
82
+ ## Developing @aveonline/ui-react
83
+
84
+ Developing locally against Storybook is easy; run `npm run storybook`.
85
+
86
+ ```shell
87
+ npm i
88
+ ```
89
+
90
+ Tests
91
+
92
+ Run `npm run test` to execute all unit test components.
93
+
94
+ We use `vitest` and `testing-library/react` for unit/integration tests and [Chromatic](https://www.chromaticqa.com/) for visual regression testing.
95
+
96
+ Open Storybook
97
+
98
+ ```shell
99
+ npm run dev
100
+ ```
101
+
102
+ ui-react production
103
+
104
+ ```shell
105
+ npm run build
106
+ ```
107
+
108
+ Storybook production
109
+
110
+ ```shell
111
+ npm run build:storybook
112
+ ```
113
+
114
+ Run test
115
+
116
+ ```shell
117
+ npm run test
118
+ ```
119
+
120
+ Run regression testing
121
+
122
+ - [Join](https://www.chromatic.com/library?appId=6362f0c0f36774d17ed0c3a0&inviteToken=4adce6358a9b439f8b636d0599e6db4b)
123
+
124
+ ```shell
125
+ npm run chromatic
126
+ ```
@@ -27,6 +27,7 @@ export * from './molecules/Header';
27
27
  export * from './molecules/Summary';
28
28
  export * from './molecules/Field';
29
29
  export * from './molecules/Flag';
30
+ export * from './molecules/DropdownUser';
30
31
  export * from './molecules/Card/Select';
31
32
  export * from './organisms/Navigation';
32
33
  export * from './templates/Main';
@@ -0,0 +1,3 @@
1
+ import { IDropdownUser } from './IDropdownUser';
2
+ declare function DropdownUser({ name, email, items, onExit }: IDropdownUser): JSX.Element;
3
+ export default DropdownUser;
@@ -0,0 +1,11 @@
1
+ declare type ItemDropdownUser = {
2
+ title: string;
3
+ onClick: () => void;
4
+ };
5
+ interface IDropdownUser {
6
+ name: string;
7
+ email: string;
8
+ items: ItemDropdownUser[];
9
+ onExit: () => void;
10
+ }
11
+ export type { IDropdownUser, ItemDropdownUser };
@@ -0,0 +1,2 @@
1
+ export { default as DropdownUser } from './DropdownUser';
2
+ export * from './IDropdownUser';
@@ -3,5 +3,5 @@ import { IHeader } from './IHeader';
3
3
  * Atom: Header
4
4
  * The top bar is a header component that allows merchants to access menus, and navigate by clicking on the logo. It’s always visible at the top of interfaces.
5
5
  */
6
- declare function Header({ hasLogo, className, ...rest }: IHeader): JSX.Element;
6
+ declare function Header({ hasLogo, className, dropdownUser, ...rest }: IHeader): JSX.Element;
7
7
  export default Header;
@@ -1,6 +1,8 @@
1
+ import { IDropdownUser } from '../DropdownUser';
1
2
  declare type IHeader = {
2
3
  hasLogo?: boolean;
3
4
  className?: string;
5
+ dropdownUser: IDropdownUser;
4
6
  [rest: string]: any;
5
7
  };
6
8
  export type { IHeader };
@@ -3,5 +3,5 @@ import type { IAsyncCreatableSelect } from './IAsyncCreatableSelect';
3
3
  * Molecule: AsyncCreatableSelect
4
4
  * Async select lets merchants choose one option from an options menu. Consider select when you have 4 or more options, to avoid cluttering the interface. Data from network. To allow new values
5
5
  */
6
- declare function AsyncCreatableSelect({ placeholder, id, name, error, helpText, hasLabelPlaceholder, isDisabled, isClearable, defaultValue, onChange, isLoading, loadOptions, isError, showErrorText, onBlur, value, menuIsOpen, allowCreateWhileLoading, createOptionPosition, logo }: IAsyncCreatableSelect): JSX.Element;
6
+ declare function AsyncCreatableSelect({ placeholder, id, name, error, helpText, hasLabelPlaceholder, isDisabled, isClearable, defaultValue, onChange, isLoading, loadOptions, isError, showErrorText, onBlur, value, menuIsOpen, allowCreateWhileLoading, createOptionPosition, logo, instanceId }: IAsyncCreatableSelect): JSX.Element;
7
7
  export default AsyncCreatableSelect;
@@ -3,5 +3,5 @@ import type { IAsyncSelect } from './IAsyncSelect';
3
3
  * Molecule: AsyncSelect
4
4
  * Async select lets merchants choose one option from an options menu. Consider select when you have 4 or more options, to avoid cluttering the interface. Data from network
5
5
  */
6
- declare function AsyncSelect({ placeholder, id, name, error, helpText, hasLabelPlaceholder, isDisabled, isClearable, defaultValue, onChange, isLoading, loadOptions, isError, showErrorText, onBlur, value, menuIsOpen }: IAsyncSelect): JSX.Element;
6
+ declare function AsyncSelect({ placeholder, id, name, error, helpText, hasLabelPlaceholder, isDisabled, isClearable, defaultValue, onChange, isLoading, loadOptions, isError, showErrorText, onBlur, value, menuIsOpen, instanceId }: IAsyncSelect): JSX.Element;
7
7
  export default AsyncSelect;
@@ -66,6 +66,8 @@ export interface ISelect {
66
66
  * Open close menu
67
67
  */
68
68
  menuIsOpen?: boolean;
69
+ /** Define an id prefix for the select components e.g. {your-id}-value */
70
+ instanceId?: number | string;
69
71
  ref?: any;
70
72
  value?: any;
71
73
  }
@@ -3,5 +3,5 @@ import type { ISelect } from './ISelect';
3
3
  * Atom: Select
4
4
  * Select lets merchants choose one option from an options menu. Consider select when you have 4 or more options, to avoid cluttering the interface.
5
5
  */
6
- declare function Select({ options, placeholder, defaultValue, isDisabled, id, name, helpText, hasLabelPlaceholder, onChange, isSearchable, isClearable, error, isError, showErrorText, onBlur, value, menuIsOpen }: ISelect): JSX.Element;
6
+ declare function Select({ options, placeholder, defaultValue, isDisabled, id, name, helpText, hasLabelPlaceholder, onChange, isSearchable, isClearable, error, isError, showErrorText, onBlur, value, instanceId, menuIsOpen }: ISelect): JSX.Element;
7
7
  export default Select;
@@ -3,5 +3,5 @@ import type { ISelectButton } from './ISelectButton';
3
3
  * Molecule: SelectButton
4
4
  * Select with button for first item lets merchants choose one option from an options menu. Consider select when you have 4 or more options, to avoid cluttering the interface.
5
5
  */
6
- declare function SelectButton({ options, placeholder, defaultValue, isDisabled, id, error, name, helpText, hasLabelPlaceholder, onChange, isSearchable, isClearable, alignButton, onClickFirstItem, isError, showErrorText, onBlur, menuIsOpen, value }: ISelectButton): JSX.Element;
6
+ declare function SelectButton({ options, placeholder, defaultValue, isDisabled, id, error, name, helpText, hasLabelPlaceholder, onChange, isSearchable, isClearable, alignButton, onClickFirstItem, isError, showErrorText, onBlur, menuIsOpen, instanceId, value }: ISelectButton): JSX.Element;
7
7
  export default SelectButton;
@@ -3,5 +3,5 @@ import { ISelect } from '../Select/ISelect';
3
3
  * Molecule: SelectCountry
4
4
  * Select lets merchants choose one option from an options menu. Consider select when you have 4 or more options, to avoid cluttering the interface.
5
5
  */
6
- declare function SelectCountry({ id, name, placeholder, options, defaultValue, isDisabled, error, isSearchable, helpText, onChange, isClearable, isError, showErrorText, onBlur, menuIsOpen, value }: ISelect): JSX.Element;
6
+ declare function SelectCountry({ id, name, placeholder, options, defaultValue, isDisabled, error, isSearchable, helpText, onChange, isClearable, isError, showErrorText, onBlur, menuIsOpen, value, instanceId }: ISelect): JSX.Element;
7
7
  export default SelectCountry;
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export * from './components/molecules/Header';
27
27
  export * from './components/molecules/Summary';
28
28
  export * from './components/molecules/Field';
29
29
  export * from './components/molecules/Flag';
30
+ export * from './components/molecules/DropdownUser';
30
31
  export * from './components/molecules/Card/Select';
31
32
  export * from './components/organisms/Navigation';
32
33
  export * from './components/templates/Main';