@aveonline/ui-react 1.15.4 → 1.15.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/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
+ ```
@@ -0,0 +1,27 @@
1
+ import { GroupBase } from 'react-select'
2
+ import { IOptionSelectButton, ITooltipSelect } from '../..'
3
+
4
+ declare module 'react-select/dist/declarations/src/Select' {
5
+ export interface Props<
6
+ Option,
7
+ IsMulti extends boolean,
8
+ Group extends GroupBase<Option>
9
+ > {
10
+ /**
11
+ * Our prop for control icon tooltip inside component atom Control
12
+ */
13
+ iconTooltip?: ITooltipSelect
14
+ /**
15
+ * Our prop for control click first element - SelectButton
16
+ */
17
+ addButton?: ((value: IOptionSelectButton) => void) | undefined
18
+ /**
19
+ * Our prop for verify inside atom SingleValue show ui
20
+ */
21
+ hasLabelPlaceholder?: boolean
22
+ /**
23
+ * Our prop for verify dropdown indicator - default true
24
+ */
25
+ isActiveDropdownIndicator?: boolean
26
+ }
27
+ }
@@ -1,4 +1,4 @@
1
- import { ColumnDef } from '@tanstack/react-table';
1
+ import { ColumnDef, RowData, Table } from '@tanstack/react-table';
2
2
  interface IPropsTable<T> {
3
3
  defaultData: Array<T>;
4
4
  columns: Array<ColumnDef<any, any>>;
@@ -6,6 +6,8 @@ interface IPropsTable<T> {
6
6
  placeholder?: string;
7
7
  hasPagination?: boolean;
8
8
  paginationOptionList?: Array<number>;
9
+ sortTable?: boolean;
10
+ sortItem?: Array<ISortItem>;
9
11
  }
10
12
  interface IPagination {
11
13
  pageIndex: number;
@@ -18,4 +20,13 @@ interface IPagination {
18
20
  getCanNextPage: boolean;
19
21
  paginationOptionList?: Array<number>;
20
22
  }
21
- export type { IPropsTable, ColumnDef, IPagination };
23
+ interface ISortTable<T extends RowData> {
24
+ table: Table<T>;
25
+ sortItem: Array<ISortItem>;
26
+ }
27
+ interface ISortItem {
28
+ id: string;
29
+ up: string;
30
+ down: string;
31
+ }
32
+ export type { IPropsTable, ColumnDef, IPagination, ISortTable };
@@ -1,7 +1,8 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
- declare function InputSearch({ value: initialValue, onChange, debounce, ...props }: {
2
+ declare function InputSearch({ value: initialValue, onChange, debounce, sortTable, ...props }: {
3
3
  value: string | number;
4
4
  onChange: (value: string | number) => void;
5
5
  debounce?: number;
6
+ sortTable?: boolean;
6
7
  } & Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>): JSX.Element;
7
8
  export default InputSearch;
@@ -0,0 +1,4 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { ISortTable } from './ITable';
3
+ declare function SortTable<T extends RowData>({ table, sortItem }: ISortTable<T>): JSX.Element;
4
+ export default SortTable;
@@ -5,5 +5,5 @@ import { IPropsTable } from './ITable';
5
5
  * part of data set, a data table lets merchants view details from the entire set. This helps merchants compare and
6
6
  * analyze the data.
7
7
  */
8
- declare function Table<T>({ searchFilter, defaultData, columns, placeholder, hasPagination, paginationOptionList }: IPropsTable<T>): JSX.Element;
8
+ declare function Table<T>({ searchFilter, defaultData, columns, placeholder, hasPagination, paginationOptionList, sortTable, sortItem }: IPropsTable<T>): JSX.Element;
9
9
  export default Table;