@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,408 +1,408 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
ButtonWithDropdown,
|
|
5
|
-
ButtonWithPopover,
|
|
6
|
-
Checkbox,
|
|
7
|
-
Icon,
|
|
8
|
-
Modal,
|
|
9
|
-
QTip,
|
|
10
|
-
Select,
|
|
11
|
-
Tabs,
|
|
12
|
-
TextArea,
|
|
13
|
-
TextField,
|
|
14
|
-
ToolbarButton,
|
|
15
|
-
} from '@seeqdev/qomponents';
|
|
16
|
-
import ComplexSelectExample, { SelectOption } from './ComplexSelectExample';
|
|
17
|
-
import Accordion from '../../src/Accordion';
|
|
18
|
-
|
|
19
|
-
const availableThemes = [
|
|
20
|
-
{ display: 'Analysis', value: 'color_analysis' },
|
|
21
|
-
{ display: 'Topic', value: 'color_topic' },
|
|
22
|
-
{ display: 'DataLab', value: 'color_datalab' },
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
const options = [
|
|
26
|
-
{ value: '1', label: 'Beginner' },
|
|
27
|
-
{ value: '2', label: 'Advanced' },
|
|
28
|
-
{ value: '3', label: 'Expert' },
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
const Trigger = ({ label }: { label: string }) => (
|
|
32
|
-
<div className="tw-flex tw-justify-start tw-items-center tw-border-b tw-px-2 tw-text-sq-color-dark">
|
|
33
|
-
<Icon icon="fc-arrow-dropdown" extraClassNames="tw-text-sq-color-dark tw-mr-[0.5rem] tw-text-[0.75rem]" type="text" />
|
|
34
|
-
{label}
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
const accordionItems = [
|
|
39
|
-
{
|
|
40
|
-
value: 'phone',
|
|
41
|
-
id: 'phone',
|
|
42
|
-
itemTestId: 'phonecall',
|
|
43
|
-
trigger: <Trigger label="Phone" />,
|
|
44
|
-
content: (
|
|
45
|
-
<div className="tw-p-2 tw-text-[0.8125rem] dark:tw-text-sq-white">
|
|
46
|
-
If you need to reach us, please call us at 555-555-5555.
|
|
47
|
-
</div>
|
|
48
|
-
),
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
value: 'email',
|
|
52
|
-
id: 'email',
|
|
53
|
-
itemTestId: 'email',
|
|
54
|
-
trigger: <Trigger label="Email" />,
|
|
55
|
-
content: (
|
|
56
|
-
<div className="tw-p-2 tw-text-[0.8125rem] dark:tw-text-sq-white">
|
|
57
|
-
If you need to reach us, please mail example@seeqtest.com
|
|
58
|
-
</div>
|
|
59
|
-
),
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
value: 'address',
|
|
63
|
-
id: 'address',
|
|
64
|
-
itemTestId: 'address',
|
|
65
|
-
trigger: <Trigger label="Address" />,
|
|
66
|
-
content: (
|
|
67
|
-
<div className="tw-p-2 tw-text-[0.8125rem] dark:tw-text-sq-white">
|
|
68
|
-
If you need to reach us, please visit us at 1234 Main St., Anytown, USA.
|
|
69
|
-
</div>
|
|
70
|
-
),
|
|
71
|
-
},
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
const renderData = (text: string) => (
|
|
75
|
-
<div className="tw-text-sq-color-gray dark:tw-text-sq-white tw-p-6">
|
|
76
|
-
<p className="tw-mb-5 tw-text-[0.9375rem] tw-leading-normal">{text}</p>
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const tabsList = [
|
|
81
|
-
{
|
|
82
|
-
id: 'plugins',
|
|
83
|
-
label: 'Plugins',
|
|
84
|
-
icon: 'fc-data',
|
|
85
|
-
content: renderData("Here's where you can find all the plugins you need. Enjoy!"),
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: 'addons',
|
|
89
|
-
label: 'Addons',
|
|
90
|
-
icon: 'fc-gears-2',
|
|
91
|
-
content: renderData("Here's where you can find all the addons you need. Enjoy!"),
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: 'shelf',
|
|
95
|
-
label: 'Shelf',
|
|
96
|
-
icon: 'fc-workbook-lock',
|
|
97
|
-
content: renderData("Here's where you can find all the private documents you need. Enjoy!"),
|
|
98
|
-
},
|
|
99
|
-
];
|
|
100
|
-
|
|
101
|
-
function Example() {
|
|
102
|
-
/**
|
|
103
|
-
* Theming is supported "out of the box". To apply a theme wrap your addOn in a div and assign the class that
|
|
104
|
-
* matched the desired theme:
|
|
105
|
-
* - color_analysis for Analysis styled qomponents (green)
|
|
106
|
-
* - color_topic for Topic styled qomponents (blue)
|
|
107
|
-
* - DataLab for DataLab styled qomponents (orange)
|
|
108
|
-
*/
|
|
109
|
-
const [theme, setTheme] = React.useState('color_analysis');
|
|
110
|
-
/**
|
|
111
|
-
* qomponents also support dark-mode. To render qomponents using dark-mode wrap your addOn in a div and assign the
|
|
112
|
-
* class "tw-dark" for dark-mode or "tw-light" for light mode.
|
|
113
|
-
*/
|
|
114
|
-
const [mode, setMode] = React.useState('tw-light');
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* This example uses controlled inputs (https://blog.logrocket.com/controlled-vs-uncontrolled-components-in-react/)
|
|
118
|
-
*/
|
|
119
|
-
const [textFieldValue, setTextFieldValue] = React.useState('');
|
|
120
|
-
const [textAreaValue, setTextAreaValue] = React.useState('');
|
|
121
|
-
const [selectValue, setSelectValue] = React.useState();
|
|
122
|
-
const [complexSelectedValue, setComplexSelectedValue] = React.useState<SelectOption>();
|
|
123
|
-
const [display, setDisplay] = React.useState('');
|
|
124
|
-
const [easeOfUse, setEaseOfUse] = React.useState(false);
|
|
125
|
-
const [lookAndFeel, setLookAndFeel] = React.useState(false);
|
|
126
|
-
const [speed, setSpeed] = React.useState(false);
|
|
127
|
-
const [help, setHelp] = React.useState('phone');
|
|
128
|
-
const [openDropdown, setOpenDropdown] = React.useState('');
|
|
129
|
-
const [openPopver, setOpenPopover] = React.useState('');
|
|
130
|
-
const [modalOpen, setModalOpen] = React.useState(false);
|
|
131
|
-
const [modalTitle, setModalTitle] = React.useState('Modal Title');
|
|
132
|
-
const [activeTab, setActiveTab] = React.useState('plugins');
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
// outer-wrapper div that assigns the mode (dark-mode or light) as well as the theme
|
|
136
|
-
<div className={`backdrop ${mode} ${theme}`}>
|
|
137
|
-
{/*add the QTip component at the very top level or your application to ensure your tooltips display as expected!*/}
|
|
138
|
-
<QTip />
|
|
139
|
-
<div className="flex-container">
|
|
140
|
-
<div className="scroll-container">
|
|
141
|
-
<div className="header">qomponents - form example</div>
|
|
142
|
-
<div>Use this example to see qomponents in actions.</div>
|
|
143
|
-
No libraries other than Seeq's qomponents (and of course React) are used to create this example, however
|
|
144
|
-
minimal CSS is used to create an appealing form - you can find all that CSS in index.css.
|
|
145
|
-
<p className="mb-10">
|
|
146
|
-
<b>A note on CSS:</b> Seeq's qomponents come fully styled and ready to use. While it is tempting to use the
|
|
147
|
-
available <i>extraClassNames</i> property to provide yet additional styling we strongly advise you to use
|
|
148
|
-
this property to provide only width, margins and padding. This will ensure for a smooth upgrade experience
|
|
149
|
-
when Seeq's look and feel changes. <br />
|
|
150
|
-
Tip: to indicate missing or wrong user input use the <i>showError</i> property available on TextField,
|
|
151
|
-
TextArea, as well as Select.
|
|
152
|
-
</p>
|
|
153
|
-
<p className="mb-10">
|
|
154
|
-
Using FontAwesome? You can pass FontAwesome Icons to the qomponent Icon component
|
|
155
|
-
<Icon icon="fa-regular fa-face-smile" extraClassNames="ml-10" />
|
|
156
|
-
</p>
|
|
157
|
-
<div className="mb-10">
|
|
158
|
-
<a
|
|
159
|
-
href="#"
|
|
160
|
-
onClick={() => setMode(mode === 'tw-light' ? 'tw-dark' : 'tw-light')}
|
|
161
|
-
// this is how you display a q-tip for an element that doesn't come with an "out-of the box" tooltip
|
|
162
|
-
// property:
|
|
163
|
-
data-qtip-text="Toggle Dark/Light Mode."
|
|
164
|
-
// the position is optional and defaults to top
|
|
165
|
-
data-qtip-position="bottom">
|
|
166
|
-
<Icon icon="fc-sun" extraClassNames="mr-10" />
|
|
167
|
-
Click to toggle to {mode === 'tw-light' ? 'Dark Mode' : 'Light Mode'}
|
|
168
|
-
</a>
|
|
169
|
-
</div>
|
|
170
|
-
<div className="formRow">
|
|
171
|
-
<div className="labelWidth">Select theme:</div>
|
|
172
|
-
{availableThemes.map((t) => (
|
|
173
|
-
<Checkbox
|
|
174
|
-
type="radio"
|
|
175
|
-
checked={theme === t.value}
|
|
176
|
-
value={t.value}
|
|
177
|
-
label={t.display}
|
|
178
|
-
onChange={(e) => setTheme(e.target.value)}
|
|
179
|
-
extraClassNames="mr-10"
|
|
180
|
-
/>
|
|
181
|
-
))}
|
|
182
|
-
</div>
|
|
183
|
-
<div className="formRow">
|
|
184
|
-
<div className="labelWidth">AddOn Name</div>
|
|
185
|
-
<TextField
|
|
186
|
-
placeholder="you must enter a name"
|
|
187
|
-
extraClassNames="formElementWidth"
|
|
188
|
-
value={textFieldValue}
|
|
189
|
-
showError={textFieldValue === ''}
|
|
190
|
-
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setTextFieldValue(e.target.value)}
|
|
191
|
-
/>
|
|
192
|
-
</div>
|
|
193
|
-
<div className="formRow">
|
|
194
|
-
<div className="labelWidth">Description</div>
|
|
195
|
-
<TextArea
|
|
196
|
-
value={textAreaValue}
|
|
197
|
-
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setTextAreaValue(e.target.value)}
|
|
198
|
-
extraClassNames="formElementWidth"
|
|
199
|
-
placeholder="provide some text here"
|
|
200
|
-
/>
|
|
201
|
-
</div>
|
|
202
|
-
<div className="formRow">
|
|
203
|
-
<div className="labelWidth">Goals</div>
|
|
204
|
-
<div className="formColumn">
|
|
205
|
-
<div>
|
|
206
|
-
<Checkbox checked={easeOfUse} label="Ease of Use" onChange={() => setEaseOfUse(!easeOfUse)} />
|
|
207
|
-
<Checkbox
|
|
208
|
-
checked={lookAndFeel}
|
|
209
|
-
label="Improved Look & Feel"
|
|
210
|
-
onChange={() => setLookAndFeel(!lookAndFeel)}
|
|
211
|
-
/>
|
|
212
|
-
<Checkbox checked={speed} label="Speedy Development" onChange={() => setSpeed(!speed)} />
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
</div>
|
|
216
|
-
<div className="formRow">
|
|
217
|
-
<div className="labelWidth">Level</div>
|
|
218
|
-
<Select
|
|
219
|
-
value={selectValue}
|
|
220
|
-
extraClassNames="formElementWidth"
|
|
221
|
-
onChange={(selectValue) => setSelectValue(selectValue)}
|
|
222
|
-
options={options}
|
|
223
|
-
placeholder="please choose"
|
|
224
|
-
/>
|
|
225
|
-
</div>
|
|
226
|
-
<div className="formRow">
|
|
227
|
-
<div className="labelWidth">Advanced</div>
|
|
228
|
-
<ComplexSelectExample
|
|
229
|
-
value={complexSelectedValue}
|
|
230
|
-
onChange={(selectedOption: SelectOption) => setComplexSelectedValue(selectedOption)}
|
|
231
|
-
/>
|
|
232
|
-
</div>
|
|
233
|
-
<div className="formRow">
|
|
234
|
-
<div className="labelWidth">Website tools</div>
|
|
235
|
-
<div className="formElementWidth tw-border tw-rounded-sm">
|
|
236
|
-
<Tabs
|
|
237
|
-
stretchTabs={true}
|
|
238
|
-
activeTab={activeTab}
|
|
239
|
-
onTabSelect={setActiveTab}
|
|
240
|
-
defaultActiveTab="data"
|
|
241
|
-
tabs={tabsList}
|
|
242
|
-
/>
|
|
243
|
-
</div>
|
|
244
|
-
</div>
|
|
245
|
-
<div className="formRow">
|
|
246
|
-
<div className="labelWidth">Get help</div>
|
|
247
|
-
<div className="formElementWidth tw-border tw-rounded-sm">
|
|
248
|
-
<Accordion
|
|
249
|
-
accordionItems={accordionItems}
|
|
250
|
-
value={help}
|
|
251
|
-
testId="basic-accordion1"
|
|
252
|
-
onItemSelect={(value) => setHelp(value)}
|
|
253
|
-
/>
|
|
254
|
-
</div>
|
|
255
|
-
</div>
|
|
256
|
-
<div className="formRow">
|
|
257
|
-
<div className="labelWidth">Tools</div>
|
|
258
|
-
<div className="formElementWidth formRow tw-border tw-rounded-sm tw-p-4 tw-flex tw-justify-center">
|
|
259
|
-
<ToolbarButton
|
|
260
|
-
icon="fc-y-axis"
|
|
261
|
-
label="Analyzer"
|
|
262
|
-
testId="basic-analyzer"
|
|
263
|
-
tooltipText="Analize data from any csv document"
|
|
264
|
-
hasArrow
|
|
265
|
-
tooltipOptions={{ position: 'top', delay: 0 }}
|
|
266
|
-
isHtmlTooltip={false}
|
|
267
|
-
popoverContent={
|
|
268
|
-
<div className="tw-text-sm dark:tw-text-white">
|
|
269
|
-
<p className="tw-p-2">Select file from your computer or google drive</p>
|
|
270
|
-
<Button type="button" label="Click to select file" />
|
|
271
|
-
</div>
|
|
272
|
-
}
|
|
273
|
-
/>
|
|
274
|
-
<ToolbarButton
|
|
275
|
-
icon="fc-sun"
|
|
276
|
-
label={mode === 'tw-light' ? 'Dark Mode' : 'Light Mode'}
|
|
277
|
-
testId="basic-toggler"
|
|
278
|
-
isActive={mode === 'tw-light'}
|
|
279
|
-
tooltipText="Toggle light and dark modes"
|
|
280
|
-
onClick={() => setMode(mode === 'tw-light' ? 'tw-dark' : 'tw-light')}
|
|
281
|
-
tooltipOptions={{ position: 'top', delay: 0 }}
|
|
282
|
-
isHtmlTooltip={false}
|
|
283
|
-
/>
|
|
284
|
-
<ToolbarButton
|
|
285
|
-
icon="fc-marker"
|
|
286
|
-
label="Language"
|
|
287
|
-
testId="basic-language-changer"
|
|
288
|
-
tooltipText="Disabled toolbar to change website language"
|
|
289
|
-
tooltipOptions={{ position: 'top', delay: 0 }}
|
|
290
|
-
disabled
|
|
291
|
-
/>
|
|
292
|
-
</div>
|
|
293
|
-
</div>
|
|
294
|
-
<div className="formRow">
|
|
295
|
-
<div className="labelWidth">Take action</div>
|
|
296
|
-
<div className="formElementWidth">
|
|
297
|
-
<ButtonWithDropdown
|
|
298
|
-
onOpenChange={(isOpen) => setOpenDropdown(isOpen ? 'dropdown-1' : '')}
|
|
299
|
-
isOpen={openDropdown === 'dropdown-1'}
|
|
300
|
-
triggerIcon={
|
|
301
|
-
<Icon
|
|
302
|
-
icon="fc-more"
|
|
303
|
-
type="text"
|
|
304
|
-
extraClassNames="tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]"
|
|
305
|
-
/>
|
|
306
|
-
}
|
|
307
|
-
containerTestId="basic-dropdown1"
|
|
308
|
-
tooltip="See actions to take for plugins"
|
|
309
|
-
tooltipDelay={0}
|
|
310
|
-
hasArrow
|
|
311
|
-
tooltipPlacement="top"
|
|
312
|
-
dropdownItems={[
|
|
313
|
-
{ label: 'Create', icon: 'fc-add-row', onClick: () => setOpenDropdown('') },
|
|
314
|
-
{ label: 'Update', icon: 'fc-asset-tree', onClick: () => setOpenDropdown(''), hasDivider: true },
|
|
315
|
-
{
|
|
316
|
-
label: 'Sort',
|
|
317
|
-
icon: 'fc-search-power',
|
|
318
|
-
onClick: () => setOpenDropdown(''),
|
|
319
|
-
subMenuItems: [
|
|
320
|
-
{ label: 'Ascending', iconClass: 'fc-arrow_up', onClick: () => setOpenDropdown('') },
|
|
321
|
-
{ label: 'Descending', iconClass: 'fc-arrow_down', onClick: () => setOpenDropdown('') },
|
|
322
|
-
],
|
|
323
|
-
},
|
|
324
|
-
{ label: 'Delete', icon: 'fc-delete', onClick: () => setOpenDropdown('') },
|
|
325
|
-
]}
|
|
326
|
-
/>
|
|
327
|
-
</div>
|
|
328
|
-
</div>
|
|
329
|
-
<div className="formRow tw-mt-4">
|
|
330
|
-
<div className="labelWidth">More information</div>
|
|
331
|
-
<div className="formElementWidth">
|
|
332
|
-
<ButtonWithPopover
|
|
333
|
-
trigger={<Icon type="text" icon="fc-circle_info" />}
|
|
334
|
-
containerTestId="basic-popover-1"
|
|
335
|
-
isOpen={openPopver === 'basic-popover-1'}
|
|
336
|
-
onOpenChange={(isOpen) => setOpenPopover(isOpen ? 'basic-popover-1' : '')}
|
|
337
|
-
isHoverEnabled={false}
|
|
338
|
-
align="start"
|
|
339
|
-
tooltipPlacement="top"
|
|
340
|
-
hasArrow
|
|
341
|
-
isHtmlTooltip={false}>
|
|
342
|
-
<div className="tw-text-sm dark:tw-text-white tw-w-72 tw-p-4">
|
|
343
|
-
<p className="tw-font-bold">What are plugins?</p>
|
|
344
|
-
Plugins are modular software components that extend the functionality of an application. They allow
|
|
345
|
-
users to add new features or customize existing ones. Plugins can be easily integrated into an
|
|
346
|
-
application and provide a way to enhance its capabilities without modifying the core codebase.Plugins
|
|
347
|
-
are modular software components that extend the functionality of an application.
|
|
348
|
-
</div>
|
|
349
|
-
</ButtonWithPopover>
|
|
350
|
-
</div>
|
|
351
|
-
</div>
|
|
352
|
-
<div className="formRow">
|
|
353
|
-
<div className="labelWidth">Accept terms</div>
|
|
354
|
-
<div className="formElementWidth">
|
|
355
|
-
<Button
|
|
356
|
-
onClick={() => {
|
|
357
|
-
setModalOpen(true);
|
|
358
|
-
}}
|
|
359
|
-
label="View terms of use"
|
|
360
|
-
/>
|
|
361
|
-
<Modal
|
|
362
|
-
open={modalOpen}
|
|
363
|
-
onClose={() => setModalOpen(false)}
|
|
364
|
-
title="Terms of use"
|
|
365
|
-
titleIcon="fc-circle_info"
|
|
366
|
-
isTitleEditable
|
|
367
|
-
onTitleChanged={(event) => setModalTitle(event.target.value)}
|
|
368
|
-
hideCloseIcon={false}
|
|
369
|
-
size="lg"
|
|
370
|
-
customButton={true}
|
|
371
|
-
customButtonLabel="Back">
|
|
372
|
-
<div>
|
|
373
|
-
<p>
|
|
374
|
-
By using this website, you agree to the following terms of use: Lorem ipsum dolor sit amet,
|
|
375
|
-
consectetur adipiscing elit. Sed euismod, justo id aliquet aliquam, elit enim tincidunt mauris, nec
|
|
376
|
-
aliquam nunc elit vitae nunc. Sed vitae fringilla mauris. Nulla facilisi. Sed auctor, nunc vel
|
|
377
|
-
aliquet luctus, nisl nunc tincidunt nunc, id lacinia mauris metus id nunc. Sed auctor, nunc vel
|
|
378
|
-
aliquet luctus, nisl nunc tincidunt nunc, id lacinia mauris metus id nunc.
|
|
379
|
-
</p>
|
|
380
|
-
</div>
|
|
381
|
-
</Modal>
|
|
382
|
-
</div>
|
|
383
|
-
</div>
|
|
384
|
-
<div className="buttonRow">
|
|
385
|
-
<Button
|
|
386
|
-
label="Cancel"
|
|
387
|
-
onClick={() => {
|
|
388
|
-
setDisplay('cancel');
|
|
389
|
-
}}
|
|
390
|
-
extraClassNames="mr-10"
|
|
391
|
-
/>
|
|
392
|
-
<Button
|
|
393
|
-
label="Submit"
|
|
394
|
-
onClick={() => {
|
|
395
|
-
setDisplay('success');
|
|
396
|
-
}}
|
|
397
|
-
variant="theme"
|
|
398
|
-
/>
|
|
399
|
-
</div>
|
|
400
|
-
{display === 'success' && <div>submit button onClick function was called</div>}
|
|
401
|
-
{display === 'cancel' && <div>cancel button onClick function was called</div>}
|
|
402
|
-
</div>
|
|
403
|
-
</div>
|
|
404
|
-
</div>
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
export default Example;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
ButtonWithDropdown,
|
|
5
|
+
ButtonWithPopover,
|
|
6
|
+
Checkbox,
|
|
7
|
+
Icon,
|
|
8
|
+
Modal,
|
|
9
|
+
QTip,
|
|
10
|
+
Select,
|
|
11
|
+
Tabs,
|
|
12
|
+
TextArea,
|
|
13
|
+
TextField,
|
|
14
|
+
ToolbarButton,
|
|
15
|
+
} from '@seeqdev/qomponents';
|
|
16
|
+
import ComplexSelectExample, { SelectOption } from './ComplexSelectExample';
|
|
17
|
+
import Accordion from '../../src/Accordion';
|
|
18
|
+
|
|
19
|
+
const availableThemes = [
|
|
20
|
+
{ display: 'Analysis', value: 'color_analysis' },
|
|
21
|
+
{ display: 'Topic', value: 'color_topic' },
|
|
22
|
+
{ display: 'DataLab', value: 'color_datalab' },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const options = [
|
|
26
|
+
{ value: '1', label: 'Beginner' },
|
|
27
|
+
{ value: '2', label: 'Advanced' },
|
|
28
|
+
{ value: '3', label: 'Expert' },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
const Trigger = ({ label }: { label: string }) => (
|
|
32
|
+
<div className="tw-flex tw-justify-start tw-items-center tw-border-b tw-px-2 tw-text-sq-color-dark">
|
|
33
|
+
<Icon icon="fc-arrow-dropdown" extraClassNames="tw-text-sq-color-dark tw-mr-[0.5rem] tw-text-[0.75rem]" type="text" />
|
|
34
|
+
{label}
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const accordionItems = [
|
|
39
|
+
{
|
|
40
|
+
value: 'phone',
|
|
41
|
+
id: 'phone',
|
|
42
|
+
itemTestId: 'phonecall',
|
|
43
|
+
trigger: <Trigger label="Phone" />,
|
|
44
|
+
content: (
|
|
45
|
+
<div className="tw-p-2 tw-text-[0.8125rem] dark:tw-text-sq-white">
|
|
46
|
+
If you need to reach us, please call us at 555-555-5555.
|
|
47
|
+
</div>
|
|
48
|
+
),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: 'email',
|
|
52
|
+
id: 'email',
|
|
53
|
+
itemTestId: 'email',
|
|
54
|
+
trigger: <Trigger label="Email" />,
|
|
55
|
+
content: (
|
|
56
|
+
<div className="tw-p-2 tw-text-[0.8125rem] dark:tw-text-sq-white">
|
|
57
|
+
If you need to reach us, please mail example@seeqtest.com
|
|
58
|
+
</div>
|
|
59
|
+
),
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: 'address',
|
|
63
|
+
id: 'address',
|
|
64
|
+
itemTestId: 'address',
|
|
65
|
+
trigger: <Trigger label="Address" />,
|
|
66
|
+
content: (
|
|
67
|
+
<div className="tw-p-2 tw-text-[0.8125rem] dark:tw-text-sq-white">
|
|
68
|
+
If you need to reach us, please visit us at 1234 Main St., Anytown, USA.
|
|
69
|
+
</div>
|
|
70
|
+
),
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const renderData = (text: string) => (
|
|
75
|
+
<div className="tw-text-sq-color-gray dark:tw-text-sq-white tw-p-6">
|
|
76
|
+
<p className="tw-mb-5 tw-text-[0.9375rem] tw-leading-normal">{text}</p>
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const tabsList = [
|
|
81
|
+
{
|
|
82
|
+
id: 'plugins',
|
|
83
|
+
label: 'Plugins',
|
|
84
|
+
icon: 'fc-data',
|
|
85
|
+
content: renderData("Here's where you can find all the plugins you need. Enjoy!"),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'addons',
|
|
89
|
+
label: 'Addons',
|
|
90
|
+
icon: 'fc-gears-2',
|
|
91
|
+
content: renderData("Here's where you can find all the addons you need. Enjoy!"),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'shelf',
|
|
95
|
+
label: 'Shelf',
|
|
96
|
+
icon: 'fc-workbook-lock',
|
|
97
|
+
content: renderData("Here's where you can find all the private documents you need. Enjoy!"),
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
function Example() {
|
|
102
|
+
/**
|
|
103
|
+
* Theming is supported "out of the box". To apply a theme wrap your addOn in a div and assign the class that
|
|
104
|
+
* matched the desired theme:
|
|
105
|
+
* - color_analysis for Analysis styled qomponents (green)
|
|
106
|
+
* - color_topic for Topic styled qomponents (blue)
|
|
107
|
+
* - DataLab for DataLab styled qomponents (orange)
|
|
108
|
+
*/
|
|
109
|
+
const [theme, setTheme] = React.useState('color_analysis');
|
|
110
|
+
/**
|
|
111
|
+
* qomponents also support dark-mode. To render qomponents using dark-mode wrap your addOn in a div and assign the
|
|
112
|
+
* class "tw-dark" for dark-mode or "tw-light" for light mode.
|
|
113
|
+
*/
|
|
114
|
+
const [mode, setMode] = React.useState('tw-light');
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* This example uses controlled inputs (https://blog.logrocket.com/controlled-vs-uncontrolled-components-in-react/)
|
|
118
|
+
*/
|
|
119
|
+
const [textFieldValue, setTextFieldValue] = React.useState('');
|
|
120
|
+
const [textAreaValue, setTextAreaValue] = React.useState('');
|
|
121
|
+
const [selectValue, setSelectValue] = React.useState();
|
|
122
|
+
const [complexSelectedValue, setComplexSelectedValue] = React.useState<SelectOption>();
|
|
123
|
+
const [display, setDisplay] = React.useState('');
|
|
124
|
+
const [easeOfUse, setEaseOfUse] = React.useState(false);
|
|
125
|
+
const [lookAndFeel, setLookAndFeel] = React.useState(false);
|
|
126
|
+
const [speed, setSpeed] = React.useState(false);
|
|
127
|
+
const [help, setHelp] = React.useState('phone');
|
|
128
|
+
const [openDropdown, setOpenDropdown] = React.useState('');
|
|
129
|
+
const [openPopver, setOpenPopover] = React.useState('');
|
|
130
|
+
const [modalOpen, setModalOpen] = React.useState(false);
|
|
131
|
+
const [modalTitle, setModalTitle] = React.useState('Modal Title');
|
|
132
|
+
const [activeTab, setActiveTab] = React.useState('plugins');
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
// outer-wrapper div that assigns the mode (dark-mode or light) as well as the theme
|
|
136
|
+
<div className={`backdrop ${mode} ${theme}`}>
|
|
137
|
+
{/*add the QTip component at the very top level or your application to ensure your tooltips display as expected!*/}
|
|
138
|
+
<QTip />
|
|
139
|
+
<div className="flex-container">
|
|
140
|
+
<div className="scroll-container">
|
|
141
|
+
<div className="header">qomponents - form example</div>
|
|
142
|
+
<div>Use this example to see qomponents in actions.</div>
|
|
143
|
+
No libraries other than Seeq's qomponents (and of course React) are used to create this example, however
|
|
144
|
+
minimal CSS is used to create an appealing form - you can find all that CSS in index.css.
|
|
145
|
+
<p className="mb-10">
|
|
146
|
+
<b>A note on CSS:</b> Seeq's qomponents come fully styled and ready to use. While it is tempting to use the
|
|
147
|
+
available <i>extraClassNames</i> property to provide yet additional styling we strongly advise you to use
|
|
148
|
+
this property to provide only width, margins and padding. This will ensure for a smooth upgrade experience
|
|
149
|
+
when Seeq's look and feel changes. <br />
|
|
150
|
+
Tip: to indicate missing or wrong user input use the <i>showError</i> property available on TextField,
|
|
151
|
+
TextArea, as well as Select.
|
|
152
|
+
</p>
|
|
153
|
+
<p className="mb-10">
|
|
154
|
+
Using FontAwesome? You can pass FontAwesome Icons to the qomponent Icon component
|
|
155
|
+
<Icon icon="fa-regular fa-face-smile" extraClassNames="ml-10" />
|
|
156
|
+
</p>
|
|
157
|
+
<div className="mb-10">
|
|
158
|
+
<a
|
|
159
|
+
href="#"
|
|
160
|
+
onClick={() => setMode(mode === 'tw-light' ? 'tw-dark' : 'tw-light')}
|
|
161
|
+
// this is how you display a q-tip for an element that doesn't come with an "out-of the box" tooltip
|
|
162
|
+
// property:
|
|
163
|
+
data-qtip-text="Toggle Dark/Light Mode."
|
|
164
|
+
// the position is optional and defaults to top
|
|
165
|
+
data-qtip-position="bottom">
|
|
166
|
+
<Icon icon="fc-sun" extraClassNames="mr-10" />
|
|
167
|
+
Click to toggle to {mode === 'tw-light' ? 'Dark Mode' : 'Light Mode'}
|
|
168
|
+
</a>
|
|
169
|
+
</div>
|
|
170
|
+
<div className="formRow">
|
|
171
|
+
<div className="labelWidth">Select theme:</div>
|
|
172
|
+
{availableThemes.map((t) => (
|
|
173
|
+
<Checkbox
|
|
174
|
+
type="radio"
|
|
175
|
+
checked={theme === t.value}
|
|
176
|
+
value={t.value}
|
|
177
|
+
label={t.display}
|
|
178
|
+
onChange={(e) => setTheme(e.target.value)}
|
|
179
|
+
extraClassNames="mr-10"
|
|
180
|
+
/>
|
|
181
|
+
))}
|
|
182
|
+
</div>
|
|
183
|
+
<div className="formRow">
|
|
184
|
+
<div className="labelWidth">AddOn Name</div>
|
|
185
|
+
<TextField
|
|
186
|
+
placeholder="you must enter a name"
|
|
187
|
+
extraClassNames="formElementWidth"
|
|
188
|
+
value={textFieldValue}
|
|
189
|
+
showError={textFieldValue === ''}
|
|
190
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setTextFieldValue(e.target.value)}
|
|
191
|
+
/>
|
|
192
|
+
</div>
|
|
193
|
+
<div className="formRow">
|
|
194
|
+
<div className="labelWidth">Description</div>
|
|
195
|
+
<TextArea
|
|
196
|
+
value={textAreaValue}
|
|
197
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setTextAreaValue(e.target.value)}
|
|
198
|
+
extraClassNames="formElementWidth"
|
|
199
|
+
placeholder="provide some text here"
|
|
200
|
+
/>
|
|
201
|
+
</div>
|
|
202
|
+
<div className="formRow">
|
|
203
|
+
<div className="labelWidth">Goals</div>
|
|
204
|
+
<div className="formColumn">
|
|
205
|
+
<div>
|
|
206
|
+
<Checkbox checked={easeOfUse} label="Ease of Use" onChange={() => setEaseOfUse(!easeOfUse)} />
|
|
207
|
+
<Checkbox
|
|
208
|
+
checked={lookAndFeel}
|
|
209
|
+
label="Improved Look & Feel"
|
|
210
|
+
onChange={() => setLookAndFeel(!lookAndFeel)}
|
|
211
|
+
/>
|
|
212
|
+
<Checkbox checked={speed} label="Speedy Development" onChange={() => setSpeed(!speed)} />
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
<div className="formRow">
|
|
217
|
+
<div className="labelWidth">Level</div>
|
|
218
|
+
<Select
|
|
219
|
+
value={selectValue}
|
|
220
|
+
extraClassNames="formElementWidth"
|
|
221
|
+
onChange={(selectValue) => setSelectValue(selectValue)}
|
|
222
|
+
options={options}
|
|
223
|
+
placeholder="please choose"
|
|
224
|
+
/>
|
|
225
|
+
</div>
|
|
226
|
+
<div className="formRow">
|
|
227
|
+
<div className="labelWidth">Advanced</div>
|
|
228
|
+
<ComplexSelectExample
|
|
229
|
+
value={complexSelectedValue}
|
|
230
|
+
onChange={(selectedOption: SelectOption) => setComplexSelectedValue(selectedOption)}
|
|
231
|
+
/>
|
|
232
|
+
</div>
|
|
233
|
+
<div className="formRow">
|
|
234
|
+
<div className="labelWidth">Website tools</div>
|
|
235
|
+
<div className="formElementWidth tw-border tw-rounded-sm">
|
|
236
|
+
<Tabs
|
|
237
|
+
stretchTabs={true}
|
|
238
|
+
activeTab={activeTab}
|
|
239
|
+
onTabSelect={setActiveTab}
|
|
240
|
+
defaultActiveTab="data"
|
|
241
|
+
tabs={tabsList}
|
|
242
|
+
/>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
<div className="formRow">
|
|
246
|
+
<div className="labelWidth">Get help</div>
|
|
247
|
+
<div className="formElementWidth tw-border tw-rounded-sm">
|
|
248
|
+
<Accordion
|
|
249
|
+
accordionItems={accordionItems}
|
|
250
|
+
value={help}
|
|
251
|
+
testId="basic-accordion1"
|
|
252
|
+
onItemSelect={(value) => setHelp(value)}
|
|
253
|
+
/>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
<div className="formRow">
|
|
257
|
+
<div className="labelWidth">Tools</div>
|
|
258
|
+
<div className="formElementWidth formRow tw-border tw-rounded-sm tw-p-4 tw-flex tw-justify-center">
|
|
259
|
+
<ToolbarButton
|
|
260
|
+
icon="fc-y-axis"
|
|
261
|
+
label="Analyzer"
|
|
262
|
+
testId="basic-analyzer"
|
|
263
|
+
tooltipText="Analize data from any csv document"
|
|
264
|
+
hasArrow
|
|
265
|
+
tooltipOptions={{ position: 'top', delay: 0 }}
|
|
266
|
+
isHtmlTooltip={false}
|
|
267
|
+
popoverContent={
|
|
268
|
+
<div className="tw-text-sm dark:tw-text-white">
|
|
269
|
+
<p className="tw-p-2">Select file from your computer or google drive</p>
|
|
270
|
+
<Button type="button" label="Click to select file" />
|
|
271
|
+
</div>
|
|
272
|
+
}
|
|
273
|
+
/>
|
|
274
|
+
<ToolbarButton
|
|
275
|
+
icon="fc-sun"
|
|
276
|
+
label={mode === 'tw-light' ? 'Dark Mode' : 'Light Mode'}
|
|
277
|
+
testId="basic-toggler"
|
|
278
|
+
isActive={mode === 'tw-light'}
|
|
279
|
+
tooltipText="Toggle light and dark modes"
|
|
280
|
+
onClick={() => setMode(mode === 'tw-light' ? 'tw-dark' : 'tw-light')}
|
|
281
|
+
tooltipOptions={{ position: 'top', delay: 0 }}
|
|
282
|
+
isHtmlTooltip={false}
|
|
283
|
+
/>
|
|
284
|
+
<ToolbarButton
|
|
285
|
+
icon="fc-marker"
|
|
286
|
+
label="Language"
|
|
287
|
+
testId="basic-language-changer"
|
|
288
|
+
tooltipText="Disabled toolbar to change website language"
|
|
289
|
+
tooltipOptions={{ position: 'top', delay: 0 }}
|
|
290
|
+
disabled
|
|
291
|
+
/>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
<div className="formRow">
|
|
295
|
+
<div className="labelWidth">Take action</div>
|
|
296
|
+
<div className="formElementWidth">
|
|
297
|
+
<ButtonWithDropdown
|
|
298
|
+
onOpenChange={(isOpen) => setOpenDropdown(isOpen ? 'dropdown-1' : '')}
|
|
299
|
+
isOpen={openDropdown === 'dropdown-1'}
|
|
300
|
+
triggerIcon={
|
|
301
|
+
<Icon
|
|
302
|
+
icon="fc-more"
|
|
303
|
+
type="text"
|
|
304
|
+
extraClassNames="tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]"
|
|
305
|
+
/>
|
|
306
|
+
}
|
|
307
|
+
containerTestId="basic-dropdown1"
|
|
308
|
+
tooltip="See actions to take for plugins"
|
|
309
|
+
tooltipDelay={0}
|
|
310
|
+
hasArrow
|
|
311
|
+
tooltipPlacement="top"
|
|
312
|
+
dropdownItems={[
|
|
313
|
+
{ label: 'Create', icon: 'fc-add-row', onClick: () => setOpenDropdown('') },
|
|
314
|
+
{ label: 'Update', icon: 'fc-asset-tree', onClick: () => setOpenDropdown(''), hasDivider: true },
|
|
315
|
+
{
|
|
316
|
+
label: 'Sort',
|
|
317
|
+
icon: 'fc-search-power',
|
|
318
|
+
onClick: () => setOpenDropdown(''),
|
|
319
|
+
subMenuItems: [
|
|
320
|
+
{ label: 'Ascending', iconClass: 'fc-arrow_up', onClick: () => setOpenDropdown('') },
|
|
321
|
+
{ label: 'Descending', iconClass: 'fc-arrow_down', onClick: () => setOpenDropdown('') },
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
{ label: 'Delete', icon: 'fc-delete', onClick: () => setOpenDropdown('') },
|
|
325
|
+
]}
|
|
326
|
+
/>
|
|
327
|
+
</div>
|
|
328
|
+
</div>
|
|
329
|
+
<div className="formRow tw-mt-4">
|
|
330
|
+
<div className="labelWidth">More information</div>
|
|
331
|
+
<div className="formElementWidth">
|
|
332
|
+
<ButtonWithPopover
|
|
333
|
+
trigger={<Icon type="text" icon="fc-circle_info" />}
|
|
334
|
+
containerTestId="basic-popover-1"
|
|
335
|
+
isOpen={openPopver === 'basic-popover-1'}
|
|
336
|
+
onOpenChange={(isOpen) => setOpenPopover(isOpen ? 'basic-popover-1' : '')}
|
|
337
|
+
isHoverEnabled={false}
|
|
338
|
+
align="start"
|
|
339
|
+
tooltipPlacement="top"
|
|
340
|
+
hasArrow
|
|
341
|
+
isHtmlTooltip={false}>
|
|
342
|
+
<div className="tw-text-sm dark:tw-text-white tw-w-72 tw-p-4">
|
|
343
|
+
<p className="tw-font-bold">What are plugins?</p>
|
|
344
|
+
Plugins are modular software components that extend the functionality of an application. They allow
|
|
345
|
+
users to add new features or customize existing ones. Plugins can be easily integrated into an
|
|
346
|
+
application and provide a way to enhance its capabilities without modifying the core codebase.Plugins
|
|
347
|
+
are modular software components that extend the functionality of an application.
|
|
348
|
+
</div>
|
|
349
|
+
</ButtonWithPopover>
|
|
350
|
+
</div>
|
|
351
|
+
</div>
|
|
352
|
+
<div className="formRow">
|
|
353
|
+
<div className="labelWidth">Accept terms</div>
|
|
354
|
+
<div className="formElementWidth">
|
|
355
|
+
<Button
|
|
356
|
+
onClick={() => {
|
|
357
|
+
setModalOpen(true);
|
|
358
|
+
}}
|
|
359
|
+
label="View terms of use"
|
|
360
|
+
/>
|
|
361
|
+
<Modal
|
|
362
|
+
open={modalOpen}
|
|
363
|
+
onClose={() => setModalOpen(false)}
|
|
364
|
+
title="Terms of use"
|
|
365
|
+
titleIcon="fc-circle_info"
|
|
366
|
+
isTitleEditable
|
|
367
|
+
onTitleChanged={(event) => setModalTitle(event.target.value)}
|
|
368
|
+
hideCloseIcon={false}
|
|
369
|
+
size="lg"
|
|
370
|
+
customButton={true}
|
|
371
|
+
customButtonLabel="Back">
|
|
372
|
+
<div>
|
|
373
|
+
<p>
|
|
374
|
+
By using this website, you agree to the following terms of use: Lorem ipsum dolor sit amet,
|
|
375
|
+
consectetur adipiscing elit. Sed euismod, justo id aliquet aliquam, elit enim tincidunt mauris, nec
|
|
376
|
+
aliquam nunc elit vitae nunc. Sed vitae fringilla mauris. Nulla facilisi. Sed auctor, nunc vel
|
|
377
|
+
aliquet luctus, nisl nunc tincidunt nunc, id lacinia mauris metus id nunc. Sed auctor, nunc vel
|
|
378
|
+
aliquet luctus, nisl nunc tincidunt nunc, id lacinia mauris metus id nunc.
|
|
379
|
+
</p>
|
|
380
|
+
</div>
|
|
381
|
+
</Modal>
|
|
382
|
+
</div>
|
|
383
|
+
</div>
|
|
384
|
+
<div className="buttonRow">
|
|
385
|
+
<Button
|
|
386
|
+
label="Cancel"
|
|
387
|
+
onClick={() => {
|
|
388
|
+
setDisplay('cancel');
|
|
389
|
+
}}
|
|
390
|
+
extraClassNames="mr-10"
|
|
391
|
+
/>
|
|
392
|
+
<Button
|
|
393
|
+
label="Submit"
|
|
394
|
+
onClick={() => {
|
|
395
|
+
setDisplay('success');
|
|
396
|
+
}}
|
|
397
|
+
variant="theme"
|
|
398
|
+
/>
|
|
399
|
+
</div>
|
|
400
|
+
{display === 'success' && <div>submit button onClick function was called</div>}
|
|
401
|
+
{display === 'cancel' && <div>cancel button onClick function was called</div>}
|
|
402
|
+
</div>
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export default Example;
|