@seeqdev/qomponents 0.0.41 → 0.0.43
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/Button/Button.js +86 -86
- package/dist/Button/Button.stories.js +76 -76
- package/dist/Button/Button.test.js +48 -48
- package/dist/Button/Button.types.js +3 -3
- package/dist/Button/index.js +1 -1
- package/dist/Checkbox/Checkbox.js +23 -23
- package/dist/Checkbox/Checkbox.stories.js +31 -31
- package/dist/Checkbox/Checkbox.test.js +93 -93
- package/dist/Checkbox/Checkbox.types.js +1 -1
- package/dist/Checkbox/index.js +1 -1
- package/dist/FontCustom.woff +0 -0
- package/dist/FontCustom.woff2 +0 -0
- package/dist/Icon/Icon.js +62 -62
- package/dist/Icon/Icon.stories.js +39 -39
- package/dist/Icon/Icon.test.js +54 -54
- package/dist/Icon/Icon.types.js +15 -15
- package/dist/Icon/index.js +1 -1
- package/dist/Select/Select.js +167 -167
- package/dist/Select/Select.stories.js +71 -71
- package/dist/Select/Select.test.js +160 -160
- package/dist/Select/Select.types.js +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/Tabs/Tabs.d.ts +4 -0
- package/dist/Tabs/Tabs.js +23 -0
- package/dist/Tabs/Tabs.js.map +1 -0
- package/dist/Tabs/Tabs.stories.d.ts +5 -0
- package/dist/Tabs/Tabs.stories.js +63 -0
- package/dist/Tabs/Tabs.stories.js.map +1 -0
- package/dist/Tabs/Tabs.test.d.ts +1 -0
- package/dist/Tabs/Tabs.test.js +91 -0
- package/dist/Tabs/Tabs.test.js.map +1 -0
- package/dist/Tabs/Tabs.types.d.ts +18 -0
- package/dist/Tabs/Tabs.types.js +2 -0
- package/dist/Tabs/Tabs.types.js.map +1 -0
- package/dist/Tabs/index.d.ts +1 -0
- package/dist/Tabs/index.js +2 -0
- package/dist/Tabs/index.js.map +1 -0
- package/dist/TextArea/TextArea.js +22 -22
- package/dist/TextArea/TextArea.stories.js +38 -38
- package/dist/TextArea/TextArea.test.js +67 -67
- package/dist/TextArea/TextArea.types.js +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/TextField/TextField.js +63 -63
- package/dist/TextField/TextField.stories.js +40 -40
- package/dist/TextField/TextField.test.js +34 -34
- package/dist/TextField/TextField.types.js +1 -1
- package/dist/TextField/index.js +1 -1
- package/dist/ToolbarButton/ToolbarButton.js +73 -73
- package/dist/ToolbarButton/ToolbarButton.stories.js +78 -78
- package/dist/ToolbarButton/ToolbarButton.test.js +92 -92
- package/dist/ToolbarButton/ToolbarButton.types.js +1 -1
- package/dist/ToolbarButton/index.js +1 -1
- package/dist/Tooltip/QTip.stories.js +39 -39
- package/dist/Tooltip/QTip.types.js +1 -1
- package/dist/Tooltip/QTipPerformance.stories.js +29 -29
- package/dist/Tooltip/Qtip.js +147 -147
- package/dist/Tooltip/Tooltip.js +35 -35
- package/dist/Tooltip/Tooltip.stories.js +31 -31
- package/dist/Tooltip/Tooltip.types.js +2 -2
- package/dist/Tooltip/TooltipPerformance.stories.js +29 -29
- package/dist/Tooltip/index.js +2 -2
- 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 +167 -167
- 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.d.ts +2 -0
- package/dist/index.esm.js +486 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +486 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2730 -2644
- package/dist/types.js +1 -1
- package/dist/utils/browserId.js +28 -28
- package/package.json +80 -79
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Select from './Select';
|
|
3
|
-
import TextField from '../TextField';
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Select',
|
|
6
|
-
};
|
|
7
|
-
export const AllSelectVariants = () => {
|
|
8
|
-
const options = [
|
|
9
|
-
{ value: 'a', label: 'Chocolate' },
|
|
10
|
-
{ value: 'b', label: 'Strawberry' },
|
|
11
|
-
{ value: 'c', label: 'Vanilla' },
|
|
12
|
-
{ value: 'd', label: 'Rocky Road' },
|
|
13
|
-
{ value: 'e', label: 'Crazy Cow' },
|
|
14
|
-
{ value: 'f', label: 'Almond Joy' },
|
|
15
|
-
{ value: 'g', label: 'All of the above' },
|
|
16
|
-
];
|
|
17
|
-
const colorOptions = [
|
|
18
|
-
{ value: 'h', label: 'pink' },
|
|
19
|
-
{ value: 'i', label: 'purple' },
|
|
20
|
-
{ value: 'j', label: 'green' },
|
|
21
|
-
{ value: 'k', label: 'red' },
|
|
22
|
-
];
|
|
23
|
-
const groupedOptions = [
|
|
24
|
-
{
|
|
25
|
-
label: 'Ice Cream Flavors',
|
|
26
|
-
options: options,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: 'Colors',
|
|
30
|
-
options: colorOptions,
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
const allSelects = () => (React.createElement(React.Fragment, null,
|
|
34
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
35
|
-
React.createElement(Select, { id: "hello", onChange: () => { }, options: options, placeholder: "single value" })),
|
|
36
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
37
|
-
React.createElement(Select, { id: "hello", onChange: () => { }, options: options, placeholder: "single value - small", small: true })),
|
|
38
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
39
|
-
React.createElement(Select, { id: "disabled", onChange: () => { }, options: options, placeholder: "disabled", isDisabled: true })),
|
|
40
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
41
|
-
React.createElement(Select, { id: "error", onChange: () => { }, options: options, placeholder: "error", showError: true })),
|
|
42
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
43
|
-
React.createElement(Select, { onChange: () => { }, options: options, placeholder: "stays open", closeMenuOnSelect: false, creatable: true })),
|
|
44
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
45
|
-
React.createElement(Select, { onChange: () => { }, options: groupedOptions, placeholder: "grouped" })),
|
|
46
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
47
|
-
React.createElement(Select, { onChange: () => { }, options: options, creatable: true, placeholder: "create option" })),
|
|
48
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
49
|
-
React.createElement(Select, { onChange: () => { }, options: options, isClearable: true, placeholder: "clearable" })),
|
|
50
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
51
|
-
React.createElement(Select, { onChange: () => { }, options: options, placeholder: "multi-select", isMulti: true, isSearchable: false })),
|
|
52
|
-
React.createElement("div", { className: "tw-p-5" },
|
|
53
|
-
React.createElement(Select, { onChange: () => { }, placeholder: "type to search", options: options, isSearchable: true })),
|
|
54
|
-
React.createElement("div", { className: "tw-p-5 tw-flex tw-flex-row" },
|
|
55
|
-
React.createElement(Select, { onChange: () => { }, placeholder: "type to search", options: options, inputGroup: "left", extraClassNames: "tw-w-[200px]" }),
|
|
56
|
-
React.createElement(TextField, { onChange: () => { }, placeholder: "text goes here", inputGroup: "right" }))));
|
|
57
|
-
const renderAllVariations = () => (React.createElement(React.Fragment, null,
|
|
58
|
-
React.createElement("div", { className: "tw-grid tw-gap-4" },
|
|
59
|
-
allSelects(),
|
|
60
|
-
React.createElement("div", { className: "tw-dark tw-bg-sq-dark-background" }, allSelects()))));
|
|
61
|
-
return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
|
|
62
|
-
React.createElement("div", { className: "color_topic" },
|
|
63
|
-
React.createElement("b", null, "Topic Colors"),
|
|
64
|
-
renderAllVariations()),
|
|
65
|
-
React.createElement("div", { className: "color_analysis" },
|
|
66
|
-
React.createElement("b", null, "Analysis Colors"),
|
|
67
|
-
renderAllVariations()),
|
|
68
|
-
React.createElement("div", { className: "color_datalab" },
|
|
69
|
-
React.createElement("b", null, "Datalab Colors"),
|
|
70
|
-
renderAllVariations())));
|
|
71
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Select from './Select';
|
|
3
|
+
import TextField from '../TextField';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Select',
|
|
6
|
+
};
|
|
7
|
+
export const AllSelectVariants = () => {
|
|
8
|
+
const options = [
|
|
9
|
+
{ value: 'a', label: 'Chocolate' },
|
|
10
|
+
{ value: 'b', label: 'Strawberry' },
|
|
11
|
+
{ value: 'c', label: 'Vanilla' },
|
|
12
|
+
{ value: 'd', label: 'Rocky Road' },
|
|
13
|
+
{ value: 'e', label: 'Crazy Cow' },
|
|
14
|
+
{ value: 'f', label: 'Almond Joy' },
|
|
15
|
+
{ value: 'g', label: 'All of the above' },
|
|
16
|
+
];
|
|
17
|
+
const colorOptions = [
|
|
18
|
+
{ value: 'h', label: 'pink' },
|
|
19
|
+
{ value: 'i', label: 'purple' },
|
|
20
|
+
{ value: 'j', label: 'green' },
|
|
21
|
+
{ value: 'k', label: 'red' },
|
|
22
|
+
];
|
|
23
|
+
const groupedOptions = [
|
|
24
|
+
{
|
|
25
|
+
label: 'Ice Cream Flavors',
|
|
26
|
+
options: options,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'Colors',
|
|
30
|
+
options: colorOptions,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
const allSelects = () => (React.createElement(React.Fragment, null,
|
|
34
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
35
|
+
React.createElement(Select, { id: "hello", onChange: () => { }, options: options, placeholder: "single value" })),
|
|
36
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
37
|
+
React.createElement(Select, { id: "hello", onChange: () => { }, options: options, placeholder: "single value - small", small: true })),
|
|
38
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
39
|
+
React.createElement(Select, { id: "disabled", onChange: () => { }, options: options, placeholder: "disabled", isDisabled: true })),
|
|
40
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
41
|
+
React.createElement(Select, { id: "error", onChange: () => { }, options: options, placeholder: "error", showError: true })),
|
|
42
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
43
|
+
React.createElement(Select, { onChange: () => { }, options: options, placeholder: "stays open", closeMenuOnSelect: false, creatable: true })),
|
|
44
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
45
|
+
React.createElement(Select, { onChange: () => { }, options: groupedOptions, placeholder: "grouped" })),
|
|
46
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
47
|
+
React.createElement(Select, { onChange: () => { }, options: options, creatable: true, placeholder: "create option" })),
|
|
48
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
49
|
+
React.createElement(Select, { onChange: () => { }, options: options, isClearable: true, placeholder: "clearable" })),
|
|
50
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
51
|
+
React.createElement(Select, { onChange: () => { }, options: options, placeholder: "multi-select", isMulti: true, isSearchable: false })),
|
|
52
|
+
React.createElement("div", { className: "tw-p-5" },
|
|
53
|
+
React.createElement(Select, { onChange: () => { }, placeholder: "type to search", options: options, isSearchable: true })),
|
|
54
|
+
React.createElement("div", { className: "tw-p-5 tw-flex tw-flex-row" },
|
|
55
|
+
React.createElement(Select, { onChange: () => { }, placeholder: "type to search", options: options, inputGroup: "left", extraClassNames: "tw-w-[200px]" }),
|
|
56
|
+
React.createElement(TextField, { onChange: () => { }, placeholder: "text goes here", inputGroup: "right" }))));
|
|
57
|
+
const renderAllVariations = () => (React.createElement(React.Fragment, null,
|
|
58
|
+
React.createElement("div", { className: "tw-grid tw-gap-4" },
|
|
59
|
+
allSelects(),
|
|
60
|
+
React.createElement("div", { className: "tw-dark tw-bg-sq-dark-background" }, allSelects()))));
|
|
61
|
+
return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
|
|
62
|
+
React.createElement("div", { className: "color_topic" },
|
|
63
|
+
React.createElement("b", null, "Topic Colors"),
|
|
64
|
+
renderAllVariations()),
|
|
65
|
+
React.createElement("div", { className: "color_analysis" },
|
|
66
|
+
React.createElement("b", null, "Analysis Colors"),
|
|
67
|
+
renderAllVariations()),
|
|
68
|
+
React.createElement("div", { className: "color_datalab" },
|
|
69
|
+
React.createElement("b", null, "Datalab Colors"),
|
|
70
|
+
renderAllVariations())));
|
|
71
|
+
};
|
|
72
72
|
//# sourceMappingURL=Select.stories.js.map
|
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '@testing-library/jest-dom';
|
|
3
|
-
import { render, screen } from '@testing-library/react';
|
|
4
|
-
import userEvent from '@testing-library/user-event';
|
|
5
|
-
import Select from './Select';
|
|
6
|
-
describe('Select', () => {
|
|
7
|
-
class Context {
|
|
8
|
-
testId = 'selectTestId';
|
|
9
|
-
label = 'button label';
|
|
10
|
-
options = [
|
|
11
|
-
{ label: 'vanilla', value: 'a' },
|
|
12
|
-
{ label: 'chocolate', value: 'b' },
|
|
13
|
-
{ label: 'strawberry', value: 'c' },
|
|
14
|
-
];
|
|
15
|
-
otherOptions = [
|
|
16
|
-
{ label: 'red', value: 'd' },
|
|
17
|
-
{ label: 'green', value: 'e' },
|
|
18
|
-
];
|
|
19
|
-
groupedOptions = [
|
|
20
|
-
{
|
|
21
|
-
label: 'Ice Cream Flavors',
|
|
22
|
-
options: this.options,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: 'Colors',
|
|
26
|
-
options: this.otherOptions,
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
props = {
|
|
30
|
-
onChange: jest.fn(),
|
|
31
|
-
options: this.options,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
let tc;
|
|
35
|
-
beforeEach(() => {
|
|
36
|
-
tc = new Context();
|
|
37
|
-
});
|
|
38
|
-
const openSelect = async () => {
|
|
39
|
-
const select = document.querySelector(`.specOpenSelect`);
|
|
40
|
-
await userEvent.click(select);
|
|
41
|
-
};
|
|
42
|
-
const renderSelect = (props) => render(React.createElement("div", { id: "wrapper" },
|
|
43
|
-
React.createElement(Select, { ...props })));
|
|
44
|
-
it('renders the select', () => {
|
|
45
|
-
renderSelect(tc.props);
|
|
46
|
-
expect(document.querySelector('.specSelectControl')).toBeInTheDocument();
|
|
47
|
-
});
|
|
48
|
-
it('displays options', async () => {
|
|
49
|
-
renderSelect(tc.props);
|
|
50
|
-
await openSelect();
|
|
51
|
-
expect(document.querySelectorAll('.specSelectOption')).toHaveLength(3);
|
|
52
|
-
});
|
|
53
|
-
it('displays grouped options', async () => {
|
|
54
|
-
renderSelect({ ...tc.props, options: tc.groupedOptions });
|
|
55
|
-
await openSelect();
|
|
56
|
-
expect(document.querySelectorAll('.specSelectOption')).toHaveLength(5);
|
|
57
|
-
expect(document.querySelectorAll('.specSelectGroupHeading')).toHaveLength(2);
|
|
58
|
-
expect(document.querySelectorAll('.specSelectGroup')).toHaveLength(2);
|
|
59
|
-
});
|
|
60
|
-
it('reflects error state', () => {
|
|
61
|
-
renderSelect({ ...tc.props, showError: true });
|
|
62
|
-
expect(document.querySelector('.specSelectControl')).toHaveClass('tw-border-sq-danger-color');
|
|
63
|
-
});
|
|
64
|
-
it('reflects custom render function for option', async () => {
|
|
65
|
-
const getOptionLabel = (option) => (React.createElement("div", null,
|
|
66
|
-
option.label,
|
|
67
|
-
React.createElement("br", null),
|
|
68
|
-
"custom formatting applied"));
|
|
69
|
-
renderSelect({ ...tc.props, getOptionLabel });
|
|
70
|
-
await openSelect();
|
|
71
|
-
expect(document.querySelectorAll('.specSelectOption')[0]).toHaveTextContent('custom formatting applied');
|
|
72
|
-
});
|
|
73
|
-
it('reflects custom render for selected option', async () => {
|
|
74
|
-
const getSelectedValueLabel = (option) => (React.createElement("div", null,
|
|
75
|
-
option.label,
|
|
76
|
-
React.createElement("br", null),
|
|
77
|
-
"the chosen one"));
|
|
78
|
-
renderSelect({ ...tc.props, getSelectedValueLabel });
|
|
79
|
-
await openSelect();
|
|
80
|
-
await userEvent.click(screen.getByText(tc.options[0].label));
|
|
81
|
-
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent('the chosen one');
|
|
82
|
-
});
|
|
83
|
-
it('renders the provided value as selected', () => {
|
|
84
|
-
const value = tc.options[1];
|
|
85
|
-
renderSelect({ ...tc.props, value });
|
|
86
|
-
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent(value.label);
|
|
87
|
-
});
|
|
88
|
-
it('renders the provided placeholder', () => {
|
|
89
|
-
const placeholder = 'choose your favorite flavor';
|
|
90
|
-
renderSelect({ ...tc.props, placeholder });
|
|
91
|
-
expect(screen.getByText(placeholder)).toBeInTheDocument();
|
|
92
|
-
});
|
|
93
|
-
it('renders the provided noOptionsMessage', async () => {
|
|
94
|
-
const noOptionsMessage = 'Nothing to see here.';
|
|
95
|
-
renderSelect({ ...tc.props, noOptionsMessage, options: [] });
|
|
96
|
-
await openSelect();
|
|
97
|
-
expect(screen.getByText(noOptionsMessage)).toBeInTheDocument();
|
|
98
|
-
});
|
|
99
|
-
it('supports multi selection', async () => {
|
|
100
|
-
const isMulti = true;
|
|
101
|
-
renderSelect({ ...tc.props, isMulti });
|
|
102
|
-
await openSelect();
|
|
103
|
-
await userEvent.click(screen.getByText(tc.options[0].label));
|
|
104
|
-
await openSelect();
|
|
105
|
-
await userEvent.click(screen.getByText(tc.options[1].label));
|
|
106
|
-
expect(document.querySelectorAll('.specOpenSelect')).toHaveLength(2);
|
|
107
|
-
});
|
|
108
|
-
it('renders isClearable', async () => {
|
|
109
|
-
const isClearable = true;
|
|
110
|
-
const placeholder = 'no worries - you can clear this.';
|
|
111
|
-
renderSelect({ ...tc.props, isClearable, placeholder });
|
|
112
|
-
await openSelect();
|
|
113
|
-
await userEvent.click(screen.getByText(tc.options[0].label));
|
|
114
|
-
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent(tc.options[0].label);
|
|
115
|
-
expect(document.querySelector('.specClearSelect')).toBeInTheDocument();
|
|
116
|
-
await userEvent.click(document.querySelector('.specClearSelect'));
|
|
117
|
-
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent(placeholder);
|
|
118
|
-
});
|
|
119
|
-
it('supports menuIsOpen', async () => {
|
|
120
|
-
const menuIsOpen = true;
|
|
121
|
-
renderSelect({ ...tc.props, menuIsOpen, menuPortalTarget: document.querySelector('#wrapper') });
|
|
122
|
-
expect(document.querySelectorAll('.specSelectOption')).toHaveLength(tc.options.length);
|
|
123
|
-
});
|
|
124
|
-
it('supports closeMenuOnSelect', async () => {
|
|
125
|
-
const closeMenuOnSelect = false;
|
|
126
|
-
renderSelect({ ...tc.props, closeMenuOnSelect });
|
|
127
|
-
await openSelect();
|
|
128
|
-
await userEvent.click(screen.getByText(tc.options[1].label));
|
|
129
|
-
await userEvent.click(screen.getByText(tc.options[2].label));
|
|
130
|
-
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent(tc.options[2].label);
|
|
131
|
-
});
|
|
132
|
-
it('removes selected option from multi-select options list', async () => {
|
|
133
|
-
const closeMenuOnSelect = false;
|
|
134
|
-
renderSelect({ ...tc.props, isMulti: true, closeMenuOnSelect });
|
|
135
|
-
await openSelect();
|
|
136
|
-
await userEvent.click(screen.getByText(tc.options[1].label));
|
|
137
|
-
await userEvent.click(screen.getByText(tc.options[2].label));
|
|
138
|
-
expect(document.querySelectorAll('.specSelectOption')).toHaveLength(tc.options.length - 2);
|
|
139
|
-
});
|
|
140
|
-
it('calls onChange handler', async () => {
|
|
141
|
-
const onChange = jest.fn();
|
|
142
|
-
renderSelect({ ...tc.props, onChange });
|
|
143
|
-
await openSelect();
|
|
144
|
-
await userEvent.click(screen.getByText(tc.options[1].label));
|
|
145
|
-
expect(onChange).toHaveBeenCalledWith(tc.options[1]);
|
|
146
|
-
});
|
|
147
|
-
it('includes inputId', async () => {
|
|
148
|
-
const inputId = 'idMe';
|
|
149
|
-
renderSelect({ ...tc.props, inputId });
|
|
150
|
-
expect(document.querySelector(`#${inputId}`)).toBeInTheDocument();
|
|
151
|
-
});
|
|
152
|
-
it('supports creating options', async () => {
|
|
153
|
-
const inputId = 'idMe';
|
|
154
|
-
const favorite = 'Almond Joy';
|
|
155
|
-
renderSelect({ ...tc.props, creatable: true, inputId });
|
|
156
|
-
await openSelect();
|
|
157
|
-
await userEvent.type(document.querySelector(`#${inputId}`), favorite);
|
|
158
|
-
expect(screen.getByText(`Create "${favorite}"`)).toBeInTheDocument();
|
|
159
|
-
});
|
|
160
|
-
});
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@testing-library/jest-dom';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import Select from './Select';
|
|
6
|
+
describe('Select', () => {
|
|
7
|
+
class Context {
|
|
8
|
+
testId = 'selectTestId';
|
|
9
|
+
label = 'button label';
|
|
10
|
+
options = [
|
|
11
|
+
{ label: 'vanilla', value: 'a' },
|
|
12
|
+
{ label: 'chocolate', value: 'b' },
|
|
13
|
+
{ label: 'strawberry', value: 'c' },
|
|
14
|
+
];
|
|
15
|
+
otherOptions = [
|
|
16
|
+
{ label: 'red', value: 'd' },
|
|
17
|
+
{ label: 'green', value: 'e' },
|
|
18
|
+
];
|
|
19
|
+
groupedOptions = [
|
|
20
|
+
{
|
|
21
|
+
label: 'Ice Cream Flavors',
|
|
22
|
+
options: this.options,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: 'Colors',
|
|
26
|
+
options: this.otherOptions,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
props = {
|
|
30
|
+
onChange: jest.fn(),
|
|
31
|
+
options: this.options,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
let tc;
|
|
35
|
+
beforeEach(() => {
|
|
36
|
+
tc = new Context();
|
|
37
|
+
});
|
|
38
|
+
const openSelect = async () => {
|
|
39
|
+
const select = document.querySelector(`.specOpenSelect`);
|
|
40
|
+
await userEvent.click(select);
|
|
41
|
+
};
|
|
42
|
+
const renderSelect = (props) => render(React.createElement("div", { id: "wrapper" },
|
|
43
|
+
React.createElement(Select, { ...props })));
|
|
44
|
+
it('renders the select', () => {
|
|
45
|
+
renderSelect(tc.props);
|
|
46
|
+
expect(document.querySelector('.specSelectControl')).toBeInTheDocument();
|
|
47
|
+
});
|
|
48
|
+
it('displays options', async () => {
|
|
49
|
+
renderSelect(tc.props);
|
|
50
|
+
await openSelect();
|
|
51
|
+
expect(document.querySelectorAll('.specSelectOption')).toHaveLength(3);
|
|
52
|
+
});
|
|
53
|
+
it('displays grouped options', async () => {
|
|
54
|
+
renderSelect({ ...tc.props, options: tc.groupedOptions });
|
|
55
|
+
await openSelect();
|
|
56
|
+
expect(document.querySelectorAll('.specSelectOption')).toHaveLength(5);
|
|
57
|
+
expect(document.querySelectorAll('.specSelectGroupHeading')).toHaveLength(2);
|
|
58
|
+
expect(document.querySelectorAll('.specSelectGroup')).toHaveLength(2);
|
|
59
|
+
});
|
|
60
|
+
it('reflects error state', () => {
|
|
61
|
+
renderSelect({ ...tc.props, showError: true });
|
|
62
|
+
expect(document.querySelector('.specSelectControl')).toHaveClass('tw-border-sq-danger-color');
|
|
63
|
+
});
|
|
64
|
+
it('reflects custom render function for option', async () => {
|
|
65
|
+
const getOptionLabel = (option) => (React.createElement("div", null,
|
|
66
|
+
option.label,
|
|
67
|
+
React.createElement("br", null),
|
|
68
|
+
"custom formatting applied"));
|
|
69
|
+
renderSelect({ ...tc.props, getOptionLabel });
|
|
70
|
+
await openSelect();
|
|
71
|
+
expect(document.querySelectorAll('.specSelectOption')[0]).toHaveTextContent('custom formatting applied');
|
|
72
|
+
});
|
|
73
|
+
it('reflects custom render for selected option', async () => {
|
|
74
|
+
const getSelectedValueLabel = (option) => (React.createElement("div", null,
|
|
75
|
+
option.label,
|
|
76
|
+
React.createElement("br", null),
|
|
77
|
+
"the chosen one"));
|
|
78
|
+
renderSelect({ ...tc.props, getSelectedValueLabel });
|
|
79
|
+
await openSelect();
|
|
80
|
+
await userEvent.click(screen.getByText(tc.options[0].label));
|
|
81
|
+
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent('the chosen one');
|
|
82
|
+
});
|
|
83
|
+
it('renders the provided value as selected', () => {
|
|
84
|
+
const value = tc.options[1];
|
|
85
|
+
renderSelect({ ...tc.props, value });
|
|
86
|
+
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent(value.label);
|
|
87
|
+
});
|
|
88
|
+
it('renders the provided placeholder', () => {
|
|
89
|
+
const placeholder = 'choose your favorite flavor';
|
|
90
|
+
renderSelect({ ...tc.props, placeholder });
|
|
91
|
+
expect(screen.getByText(placeholder)).toBeInTheDocument();
|
|
92
|
+
});
|
|
93
|
+
it('renders the provided noOptionsMessage', async () => {
|
|
94
|
+
const noOptionsMessage = 'Nothing to see here.';
|
|
95
|
+
renderSelect({ ...tc.props, noOptionsMessage, options: [] });
|
|
96
|
+
await openSelect();
|
|
97
|
+
expect(screen.getByText(noOptionsMessage)).toBeInTheDocument();
|
|
98
|
+
});
|
|
99
|
+
it('supports multi selection', async () => {
|
|
100
|
+
const isMulti = true;
|
|
101
|
+
renderSelect({ ...tc.props, isMulti });
|
|
102
|
+
await openSelect();
|
|
103
|
+
await userEvent.click(screen.getByText(tc.options[0].label));
|
|
104
|
+
await openSelect();
|
|
105
|
+
await userEvent.click(screen.getByText(tc.options[1].label));
|
|
106
|
+
expect(document.querySelectorAll('.specOpenSelect')).toHaveLength(2);
|
|
107
|
+
});
|
|
108
|
+
it('renders isClearable', async () => {
|
|
109
|
+
const isClearable = true;
|
|
110
|
+
const placeholder = 'no worries - you can clear this.';
|
|
111
|
+
renderSelect({ ...tc.props, isClearable, placeholder });
|
|
112
|
+
await openSelect();
|
|
113
|
+
await userEvent.click(screen.getByText(tc.options[0].label));
|
|
114
|
+
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent(tc.options[0].label);
|
|
115
|
+
expect(document.querySelector('.specClearSelect')).toBeInTheDocument();
|
|
116
|
+
await userEvent.click(document.querySelector('.specClearSelect'));
|
|
117
|
+
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent(placeholder);
|
|
118
|
+
});
|
|
119
|
+
it('supports menuIsOpen', async () => {
|
|
120
|
+
const menuIsOpen = true;
|
|
121
|
+
renderSelect({ ...tc.props, menuIsOpen, menuPortalTarget: document.querySelector('#wrapper') });
|
|
122
|
+
expect(document.querySelectorAll('.specSelectOption')).toHaveLength(tc.options.length);
|
|
123
|
+
});
|
|
124
|
+
it('supports closeMenuOnSelect', async () => {
|
|
125
|
+
const closeMenuOnSelect = false;
|
|
126
|
+
renderSelect({ ...tc.props, closeMenuOnSelect });
|
|
127
|
+
await openSelect();
|
|
128
|
+
await userEvent.click(screen.getByText(tc.options[1].label));
|
|
129
|
+
await userEvent.click(screen.getByText(tc.options[2].label));
|
|
130
|
+
expect(document.querySelectorAll('.specOpenSelect')[0]).toHaveTextContent(tc.options[2].label);
|
|
131
|
+
});
|
|
132
|
+
it('removes selected option from multi-select options list', async () => {
|
|
133
|
+
const closeMenuOnSelect = false;
|
|
134
|
+
renderSelect({ ...tc.props, isMulti: true, closeMenuOnSelect });
|
|
135
|
+
await openSelect();
|
|
136
|
+
await userEvent.click(screen.getByText(tc.options[1].label));
|
|
137
|
+
await userEvent.click(screen.getByText(tc.options[2].label));
|
|
138
|
+
expect(document.querySelectorAll('.specSelectOption')).toHaveLength(tc.options.length - 2);
|
|
139
|
+
});
|
|
140
|
+
it('calls onChange handler', async () => {
|
|
141
|
+
const onChange = jest.fn();
|
|
142
|
+
renderSelect({ ...tc.props, onChange });
|
|
143
|
+
await openSelect();
|
|
144
|
+
await userEvent.click(screen.getByText(tc.options[1].label));
|
|
145
|
+
expect(onChange).toHaveBeenCalledWith(tc.options[1]);
|
|
146
|
+
});
|
|
147
|
+
it('includes inputId', async () => {
|
|
148
|
+
const inputId = 'idMe';
|
|
149
|
+
renderSelect({ ...tc.props, inputId });
|
|
150
|
+
expect(document.querySelector(`#${inputId}`)).toBeInTheDocument();
|
|
151
|
+
});
|
|
152
|
+
it('supports creating options', async () => {
|
|
153
|
+
const inputId = 'idMe';
|
|
154
|
+
const favorite = 'Almond Joy';
|
|
155
|
+
renderSelect({ ...tc.props, creatable: true, inputId });
|
|
156
|
+
await openSelect();
|
|
157
|
+
await userEvent.type(document.querySelector(`#${inputId}`), favorite);
|
|
158
|
+
expect(screen.getByText(`Create "${favorite}"`)).toBeInTheDocument();
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
161
|
//# sourceMappingURL=Select.test.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=Select.types.js.map
|
package/dist/Select/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './Select';
|
|
1
|
+
export { default } from './Select';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Content, List, Root, Trigger } from '@radix-ui/react-tabs';
|
|
3
|
+
import Icon from '../Icon';
|
|
4
|
+
const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames, testId, id, }) => {
|
|
5
|
+
const handleTabSelect = (tabId) => {
|
|
6
|
+
if (activeTab === tabId)
|
|
7
|
+
return;
|
|
8
|
+
onTabSelect && onTabSelect(tabId);
|
|
9
|
+
};
|
|
10
|
+
return (React.createElement(Root, { className: `tw-flex tw-flex-col tw-min-w-[300px] ${extraClassNames || ''}`, defaultValue: defaultActiveTab, "data-testid": testId, id: id, value: activeTab, onValueChange: handleTabSelect },
|
|
11
|
+
React.createElement(List, { className: `tw-bg-sq-light-gray dark:tw-bg-gray-700 tw-flex tw-flex-row tw-gap-[2px]` }, tabs.map(({ id, icon, label, tabExtraClassNames, testId: tabsTestId, disabled }, index) => (React.createElement(Trigger, { className: `tw-bg-sq-white dark:tw-bg-sq-dark-background tw-h-[45px] tw-border-solid dark:tw-border-gray-700 tw-flex tw-flex-1 tw-justify-center tw-items-center ${tabExtraClassNames || ''} ${activeTab === id
|
|
12
|
+
? 'tw-border-b-sq-color-dark dark:tw-border-b-sq-color-dark tw-border-b-[3px]'
|
|
13
|
+
: 'hover:tw-bg-sq-light-gray tw-border-b-[1px] hover:dark:tw-bg-gray-700'}`, "data-testid": tabsTestId, disabled: disabled, key: `${label}-${id}-${index}`, value: id },
|
|
14
|
+
React.createElement("span", null,
|
|
15
|
+
icon && React.createElement(Icon, { icon: icon, testId: `${id}_tab-icon`, extraClassNames: "tw-text-[15px] tw-mr-[7px]" }),
|
|
16
|
+
React.createElement("span", { className: `tw-text-[14px] tw-font-medium ${activeTab === id
|
|
17
|
+
? 'dark:tw-text-sq-dark-text tw-text-gray-500'
|
|
18
|
+
: 'dark:tw-text-sq-color-dark-dark tw-text-sq-color-dark'}` }, label)))))),
|
|
19
|
+
tabs.map((tab, index) => (React.createElement(Content, { key: `${tab.label}_${index}_content`, value: tab.id },
|
|
20
|
+
React.createElement("div", { className: "tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-4" }, tab.content))))));
|
|
21
|
+
};
|
|
22
|
+
export default Tabs;
|
|
23
|
+
//# sourceMappingURL=Tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,MAAM,IAAI,GAAuC,CAAC,EAChD,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,eAAe,EACf,MAAM,EACN,EAAE,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GAAG,CAAC,KAAK,IAAI,KAAK,UAAU,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE;YAC1D,6BAAK,SAAS,EAAC,qDAAqD,IAAE,GAAG,CAAC,OAAO,CAAO,CAChF,CACX,CAAC,CACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Tabs from './Tabs';
|
|
3
|
+
import Button from '../Button';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Tabs',
|
|
6
|
+
};
|
|
7
|
+
const renderData = () => (React.createElement("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white" },
|
|
8
|
+
React.createElement("p", { className: "tw-mb-5 tw-text-[15px] tw-leading-normal" }, "This is a data tab to show details about your data. You can make changes to your account"),
|
|
9
|
+
React.createElement(Button, { variant: "outline", label: "Save data" })));
|
|
10
|
+
const renderTools = () => (React.createElement("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white" },
|
|
11
|
+
React.createElement("p", { className: "tw-mb-5 tw-text-[15px] tw-leading-normal" }, "Make changes to your account here. Click save when you're done."),
|
|
12
|
+
React.createElement(Button, { variant: "outline", label: "Save tools" })));
|
|
13
|
+
const renderJournal = () => (React.createElement("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white" },
|
|
14
|
+
React.createElement("p", { className: "tw-mb-5 tw-text-[15px] tw-leading-normal" }, "Make changes to your account here. Click save when you're done."),
|
|
15
|
+
React.createElement(Button, { variant: "outline", label: "Save journal" })));
|
|
16
|
+
const tabsList = [
|
|
17
|
+
{
|
|
18
|
+
id: 'data',
|
|
19
|
+
label: 'Data',
|
|
20
|
+
icon: 'fc-data',
|
|
21
|
+
content: renderData(),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'tools',
|
|
25
|
+
label: 'Tools',
|
|
26
|
+
icon: 'fc-gears-2',
|
|
27
|
+
content: renderTools(),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'journal',
|
|
31
|
+
label: 'Journal',
|
|
32
|
+
icon: 'fc-workbook-lock',
|
|
33
|
+
content: renderJournal(),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'data2',
|
|
37
|
+
label: 'Data 2',
|
|
38
|
+
icon: 'fc-data',
|
|
39
|
+
content: renderData(),
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
const colors = ['topic', 'analysis', 'datalab'];
|
|
43
|
+
export const AllTabsVariants = () => {
|
|
44
|
+
const [activeTab, setActiveTab] = React.useState('data');
|
|
45
|
+
const renderAllVariations = (color) => (React.createElement("div", { key: color + '_wrapper' },
|
|
46
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
47
|
+
React.createElement(Tabs, { activeTab: activeTab, onTabSelect: setActiveTab, defaultActiveTab: "data", tabs: tabsList })),
|
|
48
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
49
|
+
React.createElement(Tabs, { activeTab: activeTab, onTabSelect: (tabId) => setActiveTab(tabId), defaultActiveTab: "tool", tabs: tabsList.map((tab) => ({ ...tab, icon: undefined })) })),
|
|
50
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background " },
|
|
51
|
+
React.createElement("p", { className: "tw-text-sq-color-dark dark:tw-text-sq-color-dark-dark tw-mb-8" },
|
|
52
|
+
color[0].toUpperCase() + color.slice(1),
|
|
53
|
+
" Dark mode"),
|
|
54
|
+
React.createElement(Tabs, { activeTab: activeTab, onTabSelect: (tabId) => setActiveTab(tabId), defaultActiveTab: "tools", tabs: tabsList.map((tab) => ({ ...tab, icon: undefined })) }))));
|
|
55
|
+
return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" }, colors.map((color) => {
|
|
56
|
+
return (React.createElement("div", { key: color, className: `color_${color}` },
|
|
57
|
+
React.createElement("b", null,
|
|
58
|
+
color[0].toUpperCase() + color.slice(1),
|
|
59
|
+
" Colors"),
|
|
60
|
+
renderAllVariations(color)));
|
|
61
|
+
})));
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=Tabs.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.stories.js","sourceRoot":"","sources":["../../src/Tabs/Tabs.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,eAAe;IACb,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CACvB,6BAAK,SAAS,EAAC,6CAA6C;IAC1D,2BAAG,SAAS,EAAC,0CAA0C,+FAEnD;IACJ,oBAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,WAAW,GAAG,CAC1C,CACP,CAAC;AAEF,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,6BAAK,SAAS,EAAC,6CAA6C;IAC1D,2BAAG,SAAS,EAAC,0CAA0C,sEAEnD;IACJ,oBAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,YAAY,GAAG,CAC3C,CACP,CAAC;AAEF,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAC1B,6BAAK,SAAS,EAAC,6CAA6C;IAC1D,2BAAG,SAAS,EAAC,0CAA0C,sEAEnD;IACJ,oBAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,cAAc,GAAG,CAC7C,CACP,CAAC;AAEF,MAAM,QAAQ,GAAG;IACf;QACE,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,UAAU,EAAE;KACtB;IACD;QACE,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,WA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