@seeqdev/qomponents 0.0.20 → 0.0.21

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.
Files changed (41) hide show
  1. package/dist/Button/Button.js +12 -4
  2. package/dist/Button/Button.js.map +1 -1
  3. package/dist/Button/Button.types.d.ts +4 -0
  4. package/dist/Icon/Icon.js +41 -34
  5. package/dist/Icon/Icon.js.map +1 -1
  6. package/dist/Icon/Icon.types.d.ts +4 -6
  7. package/dist/TextArea/TextArea.js +10 -4
  8. package/dist/TextArea/TextArea.js.map +1 -1
  9. package/dist/TextField/TextField.js +10 -4
  10. package/dist/TextField/TextField.js.map +1 -1
  11. package/dist/Tooltip/QTip.stories.d.ts +5 -0
  12. package/dist/Tooltip/QTip.stories.js +40 -0
  13. package/dist/Tooltip/QTip.stories.js.map +1 -0
  14. package/dist/Tooltip/QTip.types.d.ts +13 -0
  15. package/dist/Tooltip/QTip.types.js +2 -0
  16. package/dist/Tooltip/QTip.types.js.map +1 -0
  17. package/dist/Tooltip/QTipPerformance.stories.d.ts +5 -0
  18. package/dist/Tooltip/QTipPerformance.stories.js +30 -0
  19. package/dist/Tooltip/QTipPerformance.stories.js.map +1 -0
  20. package/dist/Tooltip/Qtip.d.ts +25 -0
  21. package/dist/Tooltip/Qtip.js +146 -0
  22. package/dist/Tooltip/Qtip.js.map +1 -0
  23. package/dist/Tooltip/Tooltip.d.ts +7 -1
  24. package/dist/Tooltip/Tooltip.js +7 -1
  25. package/dist/Tooltip/Tooltip.js.map +1 -1
  26. package/dist/Tooltip/TooltipPerformance.stories.d.ts +5 -0
  27. package/dist/Tooltip/TooltipPerformance.stories.js +30 -0
  28. package/dist/Tooltip/TooltipPerformance.stories.js.map +1 -0
  29. package/dist/Tooltip/index.d.ts +2 -1
  30. package/dist/Tooltip/index.js +2 -1
  31. package/dist/Tooltip/index.js.map +1 -1
  32. package/dist/example/src/Example.tsx +109 -100
  33. package/dist/example/src/index.css +55 -46
  34. package/dist/index.d.ts +2 -1
  35. package/dist/index.esm.js +3127 -215
  36. package/dist/index.esm.js.map +1 -1
  37. package/dist/index.js +3127 -214
  38. package/dist/index.js.map +1 -1
  39. package/dist/styles.css +46 -1
  40. package/package.json +7 -2
  41. package/dist/example/package-lock.json +0 -3369
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const TooltipPerformance: () => JSX.Element;
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { Tooltip } from './Tooltip';
3
+ import Icon from '../Icon';
4
+ export default {
5
+ title: 'Tooltip',
6
+ };
7
+ const renderManyTooltips = () => {
8
+ const colsCount = 100;
9
+ const rowCount = 100;
10
+ const rows = [];
11
+ const getCols = (rowId) => {
12
+ const cols = [];
13
+ for (let i = 0; i < colsCount; i++) {
14
+ cols.push(React.createElement("td", { key: 'col_' + i + '_row_' + rowId },
15
+ React.createElement(Tooltip, { text: `hello there ${i}` },
16
+ React.createElement(Icon, { icon: "fc-sun" }))));
17
+ }
18
+ return cols;
19
+ };
20
+ for (let i = 0; i < rowCount; i++) {
21
+ rows.push(React.createElement("tr", { key: 'row_' + i }, ...getCols(i)));
22
+ }
23
+ return (React.createElement("table", null,
24
+ React.createElement("tbody", null, rows.map((row) => row))));
25
+ };
26
+ export const TooltipPerformance = () => {
27
+ return (React.createElement(React.Fragment, null,
28
+ React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4 tw-text-center" }, renderManyTooltips())));
29
+ };
30
+ //# sourceMappingURL=TooltipPerformance.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipPerformance.stories.js","sourceRoot":"","sources":["../../src/Tooltip/TooltipPerformance.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,eAAe;IACb,KAA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export { Tooltip as default } from './Tooltip';
1
+ export { Tooltip } from './Tooltip';
2
+ export { QTip } from './Qtip';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Button, Checkbox, Icon, Select, TextArea, TextField, Tooltip } from '@seeqdev/qomponents';
2
+ import { Button, Checkbox, Icon, QTip, Select, TextArea, TextField } from '@seeqdev/qomponents';
3
3
  import ComplexSelectExample, { SelectOption } from './ComplexSelectExample';
4
4
 
5
5
  const availableThemes = [
@@ -43,113 +43,122 @@ function Example() {
43
43
 
44
44
  return (
45
45
  // outer-wrapper div that assigns the mode (dark-mode or light) as well as the theme
46
- <div className={`backdrop ${mode} ${theme}`}>
47
- <div className="container">
48
- <div className="header">qomponents - form example</div>
49
- <div>Use this example to see qomponents in actions.</div>
50
- No libraries other than Seeq's qomponents (and of course React) are used to create this example, however minimal
51
- CSS is used to create an appealing form - you can find all that CSS in index.css.
52
- <p>
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. <br />
57
- Tip: to indicate missing or wrong user input use the <i>showError</i> property available on TextField,
58
- TextArea, as well as Select.
59
- </p>
60
- <p>
61
- Using FontAwesome? You can pass FontAwesome Icons to the qomponent Icon component
62
- <Icon icon="fa-regular fa-face-smile" extraClassNames="ml-10" />
63
- </p>
64
- <div>
65
- <Tooltip text="Toggle Dark/Light Mode." position="bottom">
66
- <a href="#" onClick={() => setMode(mode === 'tw-light' ? 'tw-dark' : 'tw-light')}>
46
+ <div className={`backdrop ${mode} ${theme}`}>
47
+ {/*add the QTip component at the very top level or your application to ensure your tooltips display as expected!*/}
48
+ <QTip />
49
+ <div className="flex-container">
50
+ <div className="scroll-container">
51
+ <div className="header">qomponents - form example</div>
52
+ <div>Use this example to see qomponents in actions.</div>
53
+ No libraries other than Seeq's qomponents (and of course React) are used to create this example, however
54
+ minimal CSS is used to create an appealing form - you can find all that CSS in index.css.
55
+ <p className="mb-10">
56
+ <b>A note on CSS:</b> Seeq's qomponents come fully styled and ready to use. While it is tempting to use the
57
+ available <i>extraClassNames</i> property to provide yet additional styling we strongly advise you to use
58
+ this property to provide only width, margins and padding. This will ensure for a smooth upgrade experience
59
+ when Seeq's look and feel changes. <br />
60
+ Tip: to indicate missing or wrong user input use the <i>showError</i> property available on TextField,
61
+ TextArea, as well as Select.
62
+ </p>
63
+ <p className="mb-10">
64
+ Using FontAwesome? You can pass FontAwesome Icons to the qomponent Icon component
65
+ <Icon icon="fa-regular fa-face-smile" extraClassNames="ml-10" />
66
+ </p>
67
+ <div className="mb-10">
68
+ <a
69
+ href="#"
70
+ onClick={() => setMode(mode === 'tw-light' ? 'tw-dark' : 'tw-light')}
71
+ // this is how you display a q-tip for an element that doesn't come with an "out-of the box" tooltip
72
+ // property:
73
+ data-qtip-text="Toggle Dark/Light Mode."
74
+ // the position is optional and defaults to top
75
+ data-qtip-position="bottom">
67
76
  <Icon icon="fc-sun" extraClassNames="mr-10" />
68
77
  Click to toggle to {mode === 'tw-light' ? 'Dark Mode' : 'Light Mode'}
69
78
  </a>
70
- </Tooltip>
71
- </div>
72
- <div className="formRow">
73
- <div className="labelWidth">Select theme:</div>
74
- {availableThemes.map((t) => (
75
- <Checkbox
76
- type="radio"
77
- checked={theme === t.value}
78
- value={t.value}
79
- label={t.display}
80
- onChange={(e) => setTheme(e.target.value)}
81
- extraClassNames="mr-10"
82
- />
83
- ))}
84
- </div>
85
- <div className="formRow">
86
- <div className="labelWidth">AddOn Name</div>
87
- <TextField
88
- placeholder="you must enter a name"
89
- extraClassNames="formElementWidth"
90
- value={textFieldValue}
91
- showError={textFieldValue === ''}
92
- onChange={(e: React.ChangeEvent<HTMLInputElement>) => setTextFieldValue(e.target.value)}
93
- />
94
- </div>
95
- <div className="formRow">
96
- <div className="labelWidth">Description</div>
97
- <TextArea
98
- value={textAreaValue}
99
- onChange={(e: React.ChangeEvent<HTMLInputElement>) => setTextAreaValue(e.target.value)}
100
- extraClassNames="formElementWidth"
101
- placeholder="provide some text here"
102
- />
103
- </div>
104
- <div className="formRow">
105
- <div className="labelWidth">Goals</div>
106
- <div className="formColumn">
107
- <div>
108
- <Checkbox checked={easeOfUse} label="Ease of Use" onChange={() => setEaseOfUse(!easeOfUse)} />
79
+ </div>
80
+ <div className="formRow">
81
+ <div className="labelWidth">Select theme:</div>
82
+ {availableThemes.map((t) => (
109
83
  <Checkbox
110
- checked={lookAndFeel}
111
- label="Improved Look & Feel"
112
- onChange={() => setLookAndFeel(!lookAndFeel)}
84
+ type="radio"
85
+ checked={theme === t.value}
86
+ value={t.value}
87
+ label={t.display}
88
+ onChange={(e) => setTheme(e.target.value)}
89
+ extraClassNames="mr-10"
113
90
  />
114
- <Checkbox checked={speed} label="Speedy Development" onChange={() => setSpeed(!speed)} />
91
+ ))}
92
+ </div>
93
+ <div className="formRow">
94
+ <div className="labelWidth">AddOn Name</div>
95
+ <TextField
96
+ placeholder="you must enter a name"
97
+ extraClassNames="formElementWidth"
98
+ value={textFieldValue}
99
+ showError={textFieldValue === ''}
100
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) => setTextFieldValue(e.target.value)}
101
+ />
102
+ </div>
103
+ <div className="formRow">
104
+ <div className="labelWidth">Description</div>
105
+ <TextArea
106
+ value={textAreaValue}
107
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) => setTextAreaValue(e.target.value)}
108
+ extraClassNames="formElementWidth"
109
+ placeholder="provide some text here"
110
+ />
111
+ </div>
112
+ <div className="formRow">
113
+ <div className="labelWidth">Goals</div>
114
+ <div className="formColumn">
115
+ <div>
116
+ <Checkbox checked={easeOfUse} label="Ease of Use" onChange={() => setEaseOfUse(!easeOfUse)} />
117
+ <Checkbox
118
+ checked={lookAndFeel}
119
+ label="Improved Look & Feel"
120
+ onChange={() => setLookAndFeel(!lookAndFeel)}
121
+ />
122
+ <Checkbox checked={speed} label="Speedy Development" onChange={() => setSpeed(!speed)} />
123
+ </div>
115
124
  </div>
116
125
  </div>
126
+ <div className="formRow">
127
+ <div className="labelWidth">Level</div>
128
+ <Select
129
+ value={selectValue}
130
+ extraClassNames="formElementWidth"
131
+ onChange={(selectValue) => setSelectValue(selectValue)}
132
+ options={options}
133
+ placeholder="please choose"
134
+ />
135
+ </div>
136
+ <div className="formRow">
137
+ <div className="labelWidth">Advanced</div>
138
+ <ComplexSelectExample
139
+ value={complexSelectedValue}
140
+ onChange={(selectedOption: SelectOption) => setComplexSelectedValue(selectedOption)}
141
+ />
142
+ </div>
143
+ <div className="buttonRow">
144
+ <Button
145
+ label="Cancel"
146
+ onClick={() => {
147
+ setDisplay('cancel');
148
+ }}
149
+ extraClassNames="mr-10"
150
+ />
151
+ <Button
152
+ label="Submit"
153
+ onClick={() => {
154
+ setDisplay('success');
155
+ }}
156
+ variant="theme"
157
+ />
158
+ </div>
159
+ {display === 'success' && <div>submit button onClick function was called</div>}
160
+ {display === 'cancel' && <div>cancel button onClick function was called</div>}
117
161
  </div>
118
- <div className="formRow">
119
- <div className="labelWidth">Level</div>
120
- <Select
121
- value={selectValue}
122
- extraClassNames="formElementWidth"
123
- onChange={(selectValue) => setSelectValue(selectValue)}
124
- options={options}
125
- placeholder="please choose"
126
- />
127
- </div>
128
- <div className="formRow">
129
- <div className="labelWidth">Advanced</div>
130
- <ComplexSelectExample
131
- value={complexSelectedValue}
132
- onChange={(selectedOption: SelectOption) => setComplexSelectedValue(selectedOption)}
133
- />
134
- </div>
135
- <div className="buttonRow">
136
- <Button
137
- label="Cancel"
138
- onClick={() => {
139
- setDisplay('cancel');
140
- }}
141
- extraClassNames="mr-10"
142
- />
143
- <Button
144
- label="Submit"
145
- onClick={() => {
146
- setDisplay('success');
147
- }}
148
- variant="theme"
149
- />
150
- </div>
151
- {display === 'success' && <div>submit button onClick function was called</div>}
152
- {display === 'cancel' && <div>cancel button onClick function was called</div>}
153
162
  </div>
154
163
  </div>
155
164
  );
@@ -1,93 +1,102 @@
1
1
  @import '@seeqdev/qomponents/dist/styles.css';
2
- @import "@fortawesome/fontawesome-free/css/all.css";
2
+ @import '@fortawesome/fontawesome-free/css/all.css';
3
3
 
4
4
  .tw-light {
5
- background-color: white;
6
- color: #1a1a1a;
5
+ background-color: white;
6
+ color: #1a1a1a;
7
7
  }
8
8
 
9
9
  .tw-dark {
10
- background-color: rgb(36, 36, 34);
11
- color: rgb(194, 188, 176);
12
- }
13
-
14
- .backdrop {
15
- display: flex;
16
- height: 100vh;
17
- width: 100vw;
18
- align-items: center;
19
- justify-content: center;
10
+ background-color: rgb(36, 36, 34);
11
+ color: rgb(194, 188, 176);
20
12
  }
21
13
 
22
14
  .formPanel {
23
- align-items: center;
24
- width: 500px;
25
- display: flex;
15
+ align-items: center;
16
+ width: 500px;
17
+ display: flex;
26
18
  }
27
19
 
28
20
  .header {
29
- font-size: larger;
30
- font-weight: bold;
21
+ font-size: larger;
22
+ font-weight: bold;
23
+ }
24
+
25
+ .backdrop {
26
+ margin: 0;
27
+ display: flex;
28
+ justify-content: center;
29
+ align-items: center;
30
+ }
31
+
32
+ .scroll-container {
33
+ margin: auto;
34
+ max-height: 100%;
35
+ overflow: auto;
31
36
  }
32
37
 
33
- .container {
34
- display: flex;
35
- gap: 20px;
36
- flex-direction: column;
37
- width: 500px;
38
- margin-left: auto;
39
- margin-right: auto;
40
- margin-top: 30px;
38
+ .flex-container {
39
+ margin-top: 30px;
40
+ margin-bottom: 70px;
41
+ display: flex;
42
+ flex-direction: column;
43
+ justify-content: center;
44
+ width: 500px;
41
45
  }
42
46
 
43
47
  .formRow {
44
- display: flex;
45
- flex-direction: row;
48
+ display: flex;
49
+ flex-direction: row;
50
+ margin-bottom: 15px;
46
51
  }
47
52
 
48
53
  .formColumn {
49
- display: flex;
50
- flex-direction: column;
54
+ display: flex;
55
+ flex-direction: column;
51
56
  }
52
57
 
53
58
  .buttonRow {
54
- display: flex;
55
- justify-content: center;
59
+ display: flex;
60
+ justify-content: center;
56
61
  }
57
62
 
58
63
  .labelWidth {
59
- width: 150px;
64
+ width: 150px;
60
65
  }
61
66
 
62
67
  .formElementWidth {
63
- width: 350px;
68
+ width: 350px;
64
69
  }
65
70
 
66
71
  .mr-10 {
67
- margin-right: 10px;
72
+ margin-right: 10px;
68
73
  }
69
74
 
70
75
  .ml-10 {
71
- margin-left: 10px;
76
+ margin-left: 10px;
77
+ }
78
+
79
+ .mb-10 {
80
+ margin-bottom: 10px;
72
81
  }
73
82
 
74
83
  /* styles for complexSelect*/
75
84
  .selectOptionWrapperDiv {
76
- display: flex;
77
- flex-direction: row;
78
- align-items: center;
79
- height: 34px;
85
+ display: flex;
86
+ flex-direction: row;
87
+ align-items: center;
88
+ height: 34px;
80
89
  }
81
90
 
82
91
  .selectOptionDiv {
83
- display: flex;
84
- flex-direction: column;
92
+ display: flex;
93
+ flex-direction: column;
85
94
  }
86
95
 
87
96
  .selectOptionSubText {
88
- font-size: smaller;
89
- padding: 0;
90
- margin-top: -6px;
97
+ font-size: smaller;
98
+ padding: 0;
99
+ margin-top: -6px;
91
100
  }
92
101
 
93
- /* end styles for complexSelect*/
102
+ /* end styles for complexSelect*/
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import Button from './Button';
2
2
  import TextField from './TextField';
3
3
  import Checkbox from './Checkbox';
4
4
  import TextArea from './TextArea';
5
- import Tooltip from './Tooltip';
5
+ import { QTip, Tooltip } from './Tooltip';
6
6
  import Icon from './Icon';
7
7
  import Select from './Select';
8
8
  export { Button };
@@ -12,3 +12,4 @@ export { Tooltip };
12
12
  export { Checkbox };
13
13
  export { Icon };
14
14
  export { Select };
15
+ export { QTip };