@seeqdev/qomponents 0.0.154 → 0.0.155-react-19
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 +135 -135
- package/dist/Accordion/Accordion.stories.d.ts +2 -1
- package/dist/Alert/Alert.stories.d.ts +2 -1
- package/dist/Alert/Alert.types.d.ts +1 -0
- package/dist/Button/Button.stories.d.ts +5 -4
- package/dist/Button/Button.types.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroup.stories.d.ts +2 -1
- package/dist/ButtonGroup/ButtonGroup.types.d.ts +1 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.d.ts +2 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.d.ts +1 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.d.ts +2 -1
- package/dist/Carousel/Carousel.stories.d.ts +2 -1
- package/dist/Carousel/Carousel.types.d.ts +1 -0
- package/dist/Checkbox/Checkbox.stories.d.ts +2 -1
- package/dist/Checkbox/Checkbox.types.d.ts +1 -0
- package/dist/Collapse/Collapse.stories.d.ts +2 -1
- package/dist/Collapse/Collapse.types.d.ts +1 -0
- package/dist/Icon/Icon.stories.d.ts +2 -1
- package/dist/Icon/Icon.types.d.ts +1 -0
- package/dist/InputGroup/InputGroup.stories.d.ts +2 -1
- package/dist/InputGroup/InputGroup.types.d.ts +1 -0
- package/dist/ProgressBar/ProgressBar.stories.d.ts +2 -1
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.d.ts +2 -1
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.d.ts +1 -0
- package/dist/Select/Select.stories.d.ts +2 -1
- package/dist/Slider/Slider.stories.d.ts +2 -1
- package/dist/Slider/Slider.types.d.ts +1 -0
- package/dist/SvgIcon/SvgIcon.stories.d.ts +2 -1
- package/dist/SvgIcon/SvgIcon.types.d.ts +1 -0
- package/dist/Tabs/Tabs.stories.d.ts +2 -1
- package/dist/Tabs/Tabs.types.d.ts +2 -1
- package/dist/TextArea/TextArea.stories.d.ts +2 -1
- package/dist/TextArea/TextArea.types.d.ts +1 -0
- package/dist/TextField/TextField.stories.d.ts +2 -1
- package/dist/TextField/TextField.types.d.ts +1 -0
- package/dist/ToolbarButton/ToolbarButton.stories.d.ts +2 -1
- package/dist/Tooltip/QTip.stories.d.ts +2 -1
- package/dist/Tooltip/QTipPerformance.stories.d.ts +2 -1
- package/dist/Tooltip/Tooltip.stories.d.ts +2 -1
- package/dist/Tooltip/Tooltip.types.d.ts +3 -2
- package/dist/Tooltip/TooltipPerformance.stories.d.ts +2 -1
- package/dist/example/.eslintrc.cjs +14 -14
- package/dist/example/README.md +33 -33
- package/dist/example/index.html +13 -13
- package/dist/example/package.json +30 -30
- package/dist/example/src/ComplexSelectExample.tsx +81 -81
- package/dist/example/src/Example.tsx +408 -408
- package/dist/example/src/index.css +102 -102
- package/dist/example/src/main.tsx +10 -10
- package/dist/example/src/vite-env.d.ts +1 -1
- package/dist/example/tsconfig.json +33 -33
- package/dist/example/tsconfig.node.json +12 -12
- package/dist/example/vite.config.ts +12 -12
- package/dist/index.esm.js +14409 -7954
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14449 -7994
- package/dist/index.js.map +1 -1
- package/dist/styles.css +3819 -3819
- package/package.json +89 -88
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: { browser: true, es2020: true },
|
|
3
|
-
extends: [
|
|
4
|
-
'eslint:recommended',
|
|
5
|
-
'plugin:@typescript-eslint/recommended',
|
|
6
|
-
'plugin:react-hooks/recommended',
|
|
7
|
-
],
|
|
8
|
-
parser: '@typescript-eslint/parser',
|
|
9
|
-
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
|
|
10
|
-
plugins: ['react-refresh'],
|
|
11
|
-
rules: {
|
|
12
|
-
'react-refresh/only-export-components': 'warn',
|
|
13
|
-
},
|
|
14
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: { browser: true, es2020: true },
|
|
3
|
+
extends: [
|
|
4
|
+
'eslint:recommended',
|
|
5
|
+
'plugin:@typescript-eslint/recommended',
|
|
6
|
+
'plugin:react-hooks/recommended',
|
|
7
|
+
],
|
|
8
|
+
parser: '@typescript-eslint/parser',
|
|
9
|
+
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
|
|
10
|
+
plugins: ['react-refresh'],
|
|
11
|
+
rules: {
|
|
12
|
+
'react-refresh/only-export-components': 'warn',
|
|
13
|
+
},
|
|
14
|
+
}
|
package/dist/example/README.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
<!-- markdownlint-disable-next-line -->
|
|
2
|
-
<p align="center">
|
|
3
|
-
<img width="150" src="https://seeq.com/sites/default/files/seeq-content/seeq-logo-blue-web-33h.svg" alt="Seeq logo">
|
|
4
|
-
</p>
|
|
5
|
-
<h1 align="center">qomponents-form example</h1>
|
|
6
|
-
|
|
7
|
-
Time to see qomponents in action!
|
|
8
|
-
|
|
9
|
-
This is a simple form example that showcases Seeq's qomponents library.
|
|
10
|
-
|
|
11
|
-
This application is built using [vite](https://vitejs.dev/).
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
First, be sure to install all dependencies (React, and qomponents):
|
|
16
|
-
|
|
17
|
-
```sh
|
|
18
|
-
npm install
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Once you've installed all dependencies you can start up a dev server and observer any changes you make in real-time:
|
|
22
|
-
|
|
23
|
-
```sh
|
|
24
|
-
npm run dev
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Tip
|
|
28
|
-
|
|
29
|
-
All application code can be found in Example.tsx. Check out the source code to learn how to ensure your
|
|
30
|
-
components display using the correct theme (green, blue, orange) as well as the correct mode (light or dark).
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
<!-- markdownlint-disable-next-line -->
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img width="150" src="https://seeq.com/sites/default/files/seeq-content/seeq-logo-blue-web-33h.svg" alt="Seeq logo">
|
|
4
|
+
</p>
|
|
5
|
+
<h1 align="center">qomponents-form example</h1>
|
|
6
|
+
|
|
7
|
+
Time to see qomponents in action!
|
|
8
|
+
|
|
9
|
+
This is a simple form example that showcases Seeq's qomponents library.
|
|
10
|
+
|
|
11
|
+
This application is built using [vite](https://vitejs.dev/).
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
First, be sure to install all dependencies (React, and qomponents):
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Once you've installed all dependencies you can start up a dev server and observer any changes you make in real-time:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm run dev
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Tip
|
|
28
|
+
|
|
29
|
+
All application code can be found in Example.tsx. Check out the source code to learn how to ensure your
|
|
30
|
+
components display using the correct theme (green, blue, orange) as well as the correct mode (light or dark).
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
package/dist/example/index.html
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>qomponents form example</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>qomponents form example</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "example",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "tsc && vite build",
|
|
9
|
-
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
10
|
-
"preview": "vite preview"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@fortawesome/fontawesome-free": "^6.4.0",
|
|
14
|
-
"@seeqdev/qomponents": "0.0.72",
|
|
15
|
-
"react": "^18.2.0",
|
|
16
|
-
"react-dom": "^18.2.0"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@types/react": "^18.0.37",
|
|
20
|
-
"@types/react-dom": "^18.0.11",
|
|
21
|
-
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
22
|
-
"@typescript-eslint/parser": "^5.59.0",
|
|
23
|
-
"@vitejs/plugin-react": "^4.0.0",
|
|
24
|
-
"eslint": "^8.38.0",
|
|
25
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
26
|
-
"eslint-plugin-react-refresh": "^0.3.4",
|
|
27
|
-
"typescript": "^5.0.2",
|
|
28
|
-
"vite": "^4.3.9"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "example",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc && vite build",
|
|
9
|
+
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
10
|
+
"preview": "vite preview"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@fortawesome/fontawesome-free": "^6.4.0",
|
|
14
|
+
"@seeqdev/qomponents": "0.0.72",
|
|
15
|
+
"react": "^18.2.0",
|
|
16
|
+
"react-dom": "^18.2.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/react": "^18.0.37",
|
|
20
|
+
"@types/react-dom": "^18.0.11",
|
|
21
|
+
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
22
|
+
"@typescript-eslint/parser": "^5.59.0",
|
|
23
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
24
|
+
"eslint": "^8.38.0",
|
|
25
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
26
|
+
"eslint-plugin-react-refresh": "^0.3.4",
|
|
27
|
+
"typescript": "^5.0.2",
|
|
28
|
+
"vite": "^4.3.9"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Icon, Select } from '@seeqdev/qomponents';
|
|
3
|
-
|
|
4
|
-
export interface SelectOption {
|
|
5
|
-
id: string;
|
|
6
|
-
label: string;
|
|
7
|
-
color: string;
|
|
8
|
-
asset: string;
|
|
9
|
-
type: 'SCALAR' | 'STRING' | 'NUMERIC';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const options: SelectOption[] = [
|
|
13
|
-
{ id: '1', label: 'Label for the first entry', color: 'pink', asset: 'Asset 1', type: 'NUMERIC' },
|
|
14
|
-
{ id: '2', label: 'Label for the second entry', color: 'green', asset: 'Asset 2', type: 'SCALAR' },
|
|
15
|
-
{ id: '3', label: 'Label for the third entry', color: 'orange', asset: 'Asset 3', type: 'STRING' },
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
interface ComplexSelectExampleProps {
|
|
19
|
-
onChange: (selectedOption: SelectOption) => void;
|
|
20
|
-
value: SelectOption | undefined;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function ComplexSelectExample({ onChange, value }: ComplexSelectExampleProps) {
|
|
24
|
-
const getIcon = (type: string) => {
|
|
25
|
-
switch (type) {
|
|
26
|
-
case 'STRING':
|
|
27
|
-
return 'fa fa-font';
|
|
28
|
-
case 'SCALAR':
|
|
29
|
-
return 'fc-scalar';
|
|
30
|
-
default:
|
|
31
|
-
return 'fc-series';
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* This function formats the select option as desired. You can apply css styling here or use additional qomponents
|
|
36
|
-
* to style the select option display.
|
|
37
|
-
*
|
|
38
|
-
* You can use the same function to format the selected value or use a different one (sometimes having a separate
|
|
39
|
-
* function is helpful if you want to limit the space that is taken up by the selected option).
|
|
40
|
-
*
|
|
41
|
-
* This example shows how to use an additional Icon component (styled in color based on the select option) as well
|
|
42
|
-
* as how to display the properties of the select option
|
|
43
|
-
*/
|
|
44
|
-
const getOptionLabel = (optionValue: SelectOption): React.ReactNode => {
|
|
45
|
-
return (
|
|
46
|
-
<div className="selectOptionWrapperDiv">
|
|
47
|
-
<Icon icon={getIcon(optionValue.type)} type="color" color={optionValue.color} extraClassNames="mr-10" />
|
|
48
|
-
<div className="selectOptionDiv">
|
|
49
|
-
<div className="selectOption">
|
|
50
|
-
<strong>{optionValue.label}</strong>
|
|
51
|
-
</div>
|
|
52
|
-
<div className="selectOptionSubText">{optionValue.asset}</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
const getOptionValue = (option: SelectOption) => {
|
|
58
|
-
return option.id;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
// use the getOptionLabel function to provide a custom render function that determines how the select options
|
|
63
|
-
// are displayed
|
|
64
|
-
// use the getSelectedValueLabel function to provide a custom render function that determines how the selected
|
|
65
|
-
// option is displayed
|
|
66
|
-
<Select
|
|
67
|
-
placeholder="formatted select options"
|
|
68
|
-
extraClassNames="formElementWidth"
|
|
69
|
-
options={options}
|
|
70
|
-
value={value}
|
|
71
|
-
getOptionLabel={getOptionLabel}
|
|
72
|
-
getOptionValue={getOptionValue}
|
|
73
|
-
getSelectedValueLabel={getOptionLabel}
|
|
74
|
-
onChange={(selectedOption: SelectOption) => {
|
|
75
|
-
onChange(selectedOption);
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export default ComplexSelectExample;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon, Select } from '@seeqdev/qomponents';
|
|
3
|
+
|
|
4
|
+
export interface SelectOption {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
color: string;
|
|
8
|
+
asset: string;
|
|
9
|
+
type: 'SCALAR' | 'STRING' | 'NUMERIC';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const options: SelectOption[] = [
|
|
13
|
+
{ id: '1', label: 'Label for the first entry', color: 'pink', asset: 'Asset 1', type: 'NUMERIC' },
|
|
14
|
+
{ id: '2', label: 'Label for the second entry', color: 'green', asset: 'Asset 2', type: 'SCALAR' },
|
|
15
|
+
{ id: '3', label: 'Label for the third entry', color: 'orange', asset: 'Asset 3', type: 'STRING' },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
interface ComplexSelectExampleProps {
|
|
19
|
+
onChange: (selectedOption: SelectOption) => void;
|
|
20
|
+
value: SelectOption | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function ComplexSelectExample({ onChange, value }: ComplexSelectExampleProps) {
|
|
24
|
+
const getIcon = (type: string) => {
|
|
25
|
+
switch (type) {
|
|
26
|
+
case 'STRING':
|
|
27
|
+
return 'fa fa-font';
|
|
28
|
+
case 'SCALAR':
|
|
29
|
+
return 'fc-scalar';
|
|
30
|
+
default:
|
|
31
|
+
return 'fc-series';
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* This function formats the select option as desired. You can apply css styling here or use additional qomponents
|
|
36
|
+
* to style the select option display.
|
|
37
|
+
*
|
|
38
|
+
* You can use the same function to format the selected value or use a different one (sometimes having a separate
|
|
39
|
+
* function is helpful if you want to limit the space that is taken up by the selected option).
|
|
40
|
+
*
|
|
41
|
+
* This example shows how to use an additional Icon component (styled in color based on the select option) as well
|
|
42
|
+
* as how to display the properties of the select option
|
|
43
|
+
*/
|
|
44
|
+
const getOptionLabel = (optionValue: SelectOption): React.ReactNode => {
|
|
45
|
+
return (
|
|
46
|
+
<div className="selectOptionWrapperDiv">
|
|
47
|
+
<Icon icon={getIcon(optionValue.type)} type="color" color={optionValue.color} extraClassNames="mr-10" />
|
|
48
|
+
<div className="selectOptionDiv">
|
|
49
|
+
<div className="selectOption">
|
|
50
|
+
<strong>{optionValue.label}</strong>
|
|
51
|
+
</div>
|
|
52
|
+
<div className="selectOptionSubText">{optionValue.asset}</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
const getOptionValue = (option: SelectOption) => {
|
|
58
|
+
return option.id;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
// use the getOptionLabel function to provide a custom render function that determines how the select options
|
|
63
|
+
// are displayed
|
|
64
|
+
// use the getSelectedValueLabel function to provide a custom render function that determines how the selected
|
|
65
|
+
// option is displayed
|
|
66
|
+
<Select
|
|
67
|
+
placeholder="formatted select options"
|
|
68
|
+
extraClassNames="formElementWidth"
|
|
69
|
+
options={options}
|
|
70
|
+
value={value}
|
|
71
|
+
getOptionLabel={getOptionLabel}
|
|
72
|
+
getOptionValue={getOptionValue}
|
|
73
|
+
getSelectedValueLabel={getOptionLabel}
|
|
74
|
+
onChange={(selectedOption: SelectOption) => {
|
|
75
|
+
onChange(selectedOption);
|
|
76
|
+
}}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default ComplexSelectExample;
|