@seeqdev/qomponents 0.0.170 → 0.0.172

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,136 +1,136 @@
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</h1>
6
-
7
-
8
- Seeq qomponents are a collection of UI components, including a Button, a TextField, an Icon, as well as a Tooltip
9
- React component (more coming soon!)
10
-
11
- These components are used by Seeq's application and are made publicly available for Developers who want to expand
12
- the Seeq eco-system with their own plugins and add-ons without having to worry about creating a cohesive Seeq UX
13
- experience. Every component comes fully styled (and with dark mode support).
14
-
15
- ## Installation
16
-
17
- Seeq qomponents are available on npm.
18
-
19
- **npm:**
20
-
21
- ```sh
22
- npm install @seeqdev/qomponents
23
- ```
24
-
25
- **yarn:**
26
-
27
- ```sh
28
- yarn add @seeqdev/qomponents
29
- ```
30
-
31
- ## Getting started with Seeq qomponents
32
-
33
- Prefer a more complete example? <br/>Checkout the example folder provided.
34
- It includes a ready to run example application. Start with the readme in the example folder to get up and running!
35
-
36
- Here is an example of a basic app using the `Button` component:
37
-
38
- ```jsx
39
- import * as React from 'react';
40
- import {Button} from '@seeqdev/qomponents';
41
-
42
- function App() {
43
- return <Button variant="theme" label="Seeq Rocks" />;
44
- }
45
- ```
46
-
47
- To make sure all styles are properly applied be sure to include the qomponents css file in your main css file.
48
-
49
- ```css
50
- @import '@seeqdev/qomponents/dist/styles.css';
51
- ```
52
-
53
- <b>A note on CSS:</b> Seeq's qomponents come fully styled and ready to use. While it is tempting to use the
54
- available <i>extraClassNames</i> property to provide yet additional styling we strongly advise you to use this
55
- property to provide only width, margins and padding. This will ensure for a smooth upgrade experience when
56
- Seeq's look and feel changes.
57
- <br />
58
- <b>Tip:</b>: to indicate missing or wrong user input use the <i>showError</i> property available on TextField,
59
- TextArea, as well as Select.
60
-
61
- ## Frequently asked questions
62
-
63
- <h3>1) I use webpack and I get a strange error once I added qomponents to my package.json!</h3>
64
-
65
- Webpack needs a little help :)
66
- Add the following to the <code>rules</code> array in your <code>webpack.config</code>
67
-
68
- ```
69
- {
70
- test: /@?(seeqdev).*\.(ts|js)x?$/,
71
- loader:'babel-loader'
72
- },
73
- {
74
- test: /\.(woff|woff2|eot|ttf|otf)$/i,
75
- type: 'asset/resource',
76
- }
77
- ```
78
-
79
- If you're using webpack + scss be sure to include a <code>~</code> as part of the css import path:
80
-
81
- ```
82
- @import '~@seeqdev/qomponents/dist/styles.css';
83
- @import '~@fortawesome/fontawesome-free/css/all.css';
84
- ```
85
-
86
- <h3>2) How do I get my Button to be green?</h3>
87
-
88
- The colors of your qomponents are controlled by the "theme". </br>
89
- If you do not provide a theme your qomponents will use the default blue or also known as Topic-based theme.
90
- Themes are applied by adding the class of the desired theme to a wrapper of your application. The theme class can
91
- also be applied to the body tag.
92
-
93
- ```html
94
-
95
- <div class="color_analysis">
96
- ... your application here
97
- </div>
98
-
99
- ```
100
-
101
- There are 3 themes available:
102
-
103
- | Theme | Color | Class | Example |
104
- |:---------|:-------|:---------------|:-----------------------|
105
- | Topic | blue | color_topic | class="color_topic" |
106
- | Analysis | green | color_analysis | class="color_analysis" |
107
- | DataLab | orange | color_datalab | class="color_datalab" |
108
-
109
- <h3>3) How do I use Fontawesome Icons?</h3>
110
- Before you can use Fontawesome icons you must install FontAwesome.
111
-
112
- ```
113
- npm install --save @fortawesome/fontawesome-free
114
- ```
115
-
116
- Once it's installed simply import the required css files. To import all variations of FontAwesome's Icons you can
117
- add the following import to your main css file:
118
-
119
- ```
120
- @import "@fortawesome/fontawesome-free/css/all.css";
121
- ```
122
-
123
- If your project only uses Classic Solid or (Sharp Solids, or any other one kind) it's better to import only the
124
- required css for that Icon type to keep your packages size small.<br/> Note: if you don't import "all" like shown above
125
- be sure to include <code>fontawesome.css</code> in addition to whatever Icon style you require.
126
-
127
- For Example:
128
-
129
- ```
130
- @import "@fortawesome/fontawesome-free/css/fontawesome.css";
131
- @import "@fortawesome/fontawesome-free/css/solid.css";
132
- ```
133
-
134
- <h3>4) How can I see all the props that are available?</h3>
135
- Take a look at the <code>.types.d.ts</code> files that can be found in the <code>dist/{component name}/</code>
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</h1>
6
+
7
+
8
+ Seeq qomponents are a collection of UI components, including a Button, a TextField, an Icon, as well as a Tooltip
9
+ React component (more coming soon!)
10
+
11
+ These components are used by Seeq's application and are made publicly available for Developers who want to expand
12
+ the Seeq eco-system with their own plugins and add-ons without having to worry about creating a cohesive Seeq UX
13
+ experience. Every component comes fully styled (and with dark mode support).
14
+
15
+ ## Installation
16
+
17
+ Seeq qomponents are available on npm.
18
+
19
+ **npm:**
20
+
21
+ ```sh
22
+ npm install @seeqdev/qomponents
23
+ ```
24
+
25
+ **yarn:**
26
+
27
+ ```sh
28
+ yarn add @seeqdev/qomponents
29
+ ```
30
+
31
+ ## Getting started with Seeq qomponents
32
+
33
+ Prefer a more complete example? <br/>Checkout the example folder provided.
34
+ It includes a ready to run example application. Start with the readme in the example folder to get up and running!
35
+
36
+ Here is an example of a basic app using the `Button` component:
37
+
38
+ ```jsx
39
+ import * as React from 'react';
40
+ import {Button} from '@seeqdev/qomponents';
41
+
42
+ function App() {
43
+ return <Button variant="theme" label="Seeq Rocks" />;
44
+ }
45
+ ```
46
+
47
+ To make sure all styles are properly applied be sure to include the qomponents css file in your main css file.
48
+
49
+ ```css
50
+ @import '@seeqdev/qomponents/dist/styles.css';
51
+ ```
52
+
53
+ <b>A note on CSS:</b> Seeq's qomponents come fully styled and ready to use. While it is tempting to use the
54
+ available <i>extraClassNames</i> property to provide yet additional styling we strongly advise you to use this
55
+ property to provide only width, margins and padding. This will ensure for a smooth upgrade experience when
56
+ Seeq's look and feel changes.
57
+ <br />
58
+ <b>Tip:</b>: to indicate missing or wrong user input use the <i>showError</i> property available on TextField,
59
+ TextArea, as well as Select.
60
+
61
+ ## Frequently asked questions
62
+
63
+ <h3>1) I use webpack and I get a strange error once I added qomponents to my package.json!</h3>
64
+
65
+ Webpack needs a little help :)
66
+ Add the following to the <code>rules</code> array in your <code>webpack.config</code>
67
+
68
+ ```
69
+ {
70
+ test: /@?(seeqdev).*\.(ts|js)x?$/,
71
+ loader:'babel-loader'
72
+ },
73
+ {
74
+ test: /\.(woff|woff2|eot|ttf|otf)$/i,
75
+ type: 'asset/resource',
76
+ }
77
+ ```
78
+
79
+ If you're using webpack + scss be sure to include a <code>~</code> as part of the css import path:
80
+
81
+ ```
82
+ @import '~@seeqdev/qomponents/dist/styles.css';
83
+ @import '~@fortawesome/fontawesome-free/css/all.css';
84
+ ```
85
+
86
+ <h3>2) How do I get my Button to be green?</h3>
87
+
88
+ The colors of your qomponents are controlled by the "theme". </br>
89
+ If you do not provide a theme your qomponents will use the default blue or also known as Topic-based theme.
90
+ Themes are applied by adding the class of the desired theme to a wrapper of your application. The theme class can
91
+ also be applied to the body tag.
92
+
93
+ ```html
94
+
95
+ <div class="color_analysis">
96
+ ... your application here
97
+ </div>
98
+
99
+ ```
100
+
101
+ There are 3 themes available:
102
+
103
+ | Theme | Color | Class | Example |
104
+ |:---------|:-------|:---------------|:-----------------------|
105
+ | Topic | blue | color_topic | class="color_topic" |
106
+ | Analysis | green | color_analysis | class="color_analysis" |
107
+ | DataLab | orange | color_datalab | class="color_datalab" |
108
+
109
+ <h3>3) How do I use Fontawesome Icons?</h3>
110
+ Before you can use Fontawesome icons you must install FontAwesome.
111
+
112
+ ```
113
+ npm install --save @fortawesome/fontawesome-free
114
+ ```
115
+
116
+ Once it's installed simply import the required css files. To import all variations of FontAwesome's Icons you can
117
+ add the following import to your main css file:
118
+
119
+ ```
120
+ @import "@fortawesome/fontawesome-free/css/all.css";
121
+ ```
122
+
123
+ If your project only uses Classic Solid or (Sharp Solids, or any other one kind) it's better to import only the
124
+ required css for that Icon type to keep your packages size small.<br/> Note: if you don't import "all" like shown above
125
+ be sure to include <code>fontawesome.css</code> in addition to whatever Icon style you require.
126
+
127
+ For Example:
128
+
129
+ ```
130
+ @import "@fortawesome/fontawesome-free/css/fontawesome.css";
131
+ @import "@fortawesome/fontawesome-free/css/solid.css";
132
+ ```
133
+
134
+ <h3>4) How can I see all the props that are available?</h3>
135
+ Take a look at the <code>.types.d.ts</code> files that can be found in the <code>dist/{component name}/</code>
136
136
  folder. This file contains all available properties including some descriptive text that tells you more about them.
Binary file
Binary file
@@ -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
+ }
@@ -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
+
@@ -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,32 +1,32 @@
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.153",
15
- "@tailwindcss/vite": "4.1.8",
16
- "react": "18.2.0",
17
- "react-dom": "18.2.0",
18
- "tailwindcss": "4.1.8"
19
- },
20
- "devDependencies": {
21
- "@types/react": "18.0.37",
22
- "@types/react-dom": "18.0.11",
23
- "@typescript-eslint/eslint-plugin": "5.59.0",
24
- "@typescript-eslint/parser": "5.59.0",
25
- "@vitejs/plugin-react": "4.5.1",
26
- "eslint": "8.38.0",
27
- "eslint-plugin-react-hooks": "4.6.0",
28
- "eslint-plugin-react-refresh": "0.3.4",
29
- "typescript": "5.0.2",
30
- "vite": "6.3.5"
31
- }
32
- }
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.153",
15
+ "@tailwindcss/vite": "4.1.8",
16
+ "react": "18.2.0",
17
+ "react-dom": "18.2.0",
18
+ "tailwindcss": "4.1.8"
19
+ },
20
+ "devDependencies": {
21
+ "@types/react": "18.0.37",
22
+ "@types/react-dom": "18.0.11",
23
+ "@typescript-eslint/eslint-plugin": "5.59.0",
24
+ "@typescript-eslint/parser": "5.59.0",
25
+ "@vitejs/plugin-react": "4.5.1",
26
+ "eslint": "8.38.0",
27
+ "eslint-plugin-react-hooks": "4.6.0",
28
+ "eslint-plugin-react-refresh": "0.3.4",
29
+ "typescript": "5.0.2",
30
+ "vite": "6.3.5"
31
+ }
32
+ }
@@ -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;