@seeqdev/qomponents 0.0.93 → 0.0.94
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/dist/SeeqActionDropdown/SeeqActionDropdown.d.ts +4 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.js +48 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.js.map +1 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.d.ts +5 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js +80 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js.map +1 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js +73 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js.map +1 -0
- package/dist/{NewWorkbench/NewWorkbench.types.d.ts → SeeqActionDropdown/SeeqActionDropdown.types.d.ts} +3 -3
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js +2 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js.map +1 -0
- package/dist/SeeqActionDropdown/index.d.ts +1 -0
- package/dist/SeeqActionDropdown/index.js +2 -0
- package/dist/SeeqActionDropdown/index.js.map +1 -0
- package/dist/SeeqActionDropdown/variants.d.ts +5 -0
- package/dist/SeeqActionDropdown/variants.js +23 -0
- package/dist/SeeqActionDropdown/variants.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/NewWorkbench/NewWorkbench.d.ts +0 -4
- package/dist/NewWorkbench/NewWorkbench.stories.d.ts +0 -5
- package/dist/NewWorkbench/index.d.ts +0 -1
- package/dist/NewWorkbench/variants.d.ts +0 -5
- /package/dist/{NewWorkbench/NewWorkbench.test.d.ts → SeeqActionDropdown/SeeqActionDropdown.test.d.ts} +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import { getQTipData } from '../Tooltip/qTip.utilities';
|
|
4
|
+
import { InsertSeeqContent, SeeqActionDropdownItem, ViewWorkbench } from './variants';
|
|
5
|
+
const borderStyles = [
|
|
6
|
+
'tw-border-solid',
|
|
7
|
+
'tw-border',
|
|
8
|
+
'tw-rounded-sm',
|
|
9
|
+
'tw-border-sq-disabled-gray',
|
|
10
|
+
'dark:tw-border-gray-500',
|
|
11
|
+
].join(' ');
|
|
12
|
+
const bgStyles = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
13
|
+
const disabledClasses = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
14
|
+
const renderItem = (variant, item) => {
|
|
15
|
+
switch (variant) {
|
|
16
|
+
case 'create-workbench':
|
|
17
|
+
return React.createElement(SeeqActionDropdownItem, { ...item });
|
|
18
|
+
case 'view-workbench':
|
|
19
|
+
return React.createElement(ViewWorkbench, { ...item });
|
|
20
|
+
case 'insert-seeq-content':
|
|
21
|
+
return React.createElement(InsertSeeqContent, { ...item });
|
|
22
|
+
default:
|
|
23
|
+
return React.createElement(SeeqActionDropdownItem, { ...item });
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const SeeqActionDropdown = ({ seeqActionDropdownItems, trigger, id, extraClassNames, containerTestId, disabled = false, align = 'end', placement = 'bottom', placementOffset = 5, alignOffset = -35, hasArrow = false, onOpenChange, isOpen, setFocusOnTriggerOnClose = true, keepFocusInsideDropdown = true, variant, ...tooltipProps }) => {
|
|
27
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
28
|
+
return (React.createElement(DropdownMenu.Root, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown },
|
|
29
|
+
React.createElement(DropdownMenu.Trigger, { id: id, "data-testid": id, className: `tw-border-none focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none`, asChild: true, disabled: disabled },
|
|
30
|
+
React.createElement("div", { ...tooltipData, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none ${disabled ? disabledClasses : ''} ${extraClassNames || ''}` }, trigger)),
|
|
31
|
+
React.createElement(DropdownMenu.Content, { sideOffset: placementOffset, side: placement, align: align, alignOffset: alignOffset, asChild: true, onCloseAutoFocus: (e) => !setFocusOnTriggerOnClose && e.preventDefault(), className: "focus-visible:tw-outline-none tw-outline-none" },
|
|
32
|
+
React.createElement("div", { "data-testid": containerTestId, className: bgStyles +
|
|
33
|
+
' tw-relative tw-z-[1200] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none' +
|
|
34
|
+
' data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out' +
|
|
35
|
+
' forceFont data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade ' +
|
|
36
|
+
borderStyles },
|
|
37
|
+
hasArrow && (React.createElement(DropdownMenu.Arrow, { asChild: true },
|
|
38
|
+
React.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500 tw-mt-[-7px]" }))),
|
|
39
|
+
seeqActionDropdownItems.map((item, index) => {
|
|
40
|
+
return (React.createElement("div", { key: item.display + index },
|
|
41
|
+
React.createElement(DropdownMenu.Item, { onSelect: (e) => {
|
|
42
|
+
item.action(e);
|
|
43
|
+
}, className: `tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-dark tw-relative tw-select-none tw-outline-none data-[disabled]:tw-text-sq-disabled-gray data-[disabled]:tw-pointer-events-none`, "data-testid": item.testId, disabled: !item.enabled }, renderItem(variant, item)),
|
|
44
|
+
item.divider && (React.createElement(DropdownMenu.Separator, { "data-testid": `dropdown-divider-${index}`, className: "tw-h-[1px] tw-bg-sq-disabled-gray dark:tw-bg-gray-500 tw-my-[8px]" }))));
|
|
45
|
+
})))));
|
|
46
|
+
};
|
|
47
|
+
export default SeeqActionDropdown;
|
|
48
|
+
//# sourceMappingURL=SeeqActionDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SeeqActionDropdown.js","sourceRoot":"","sources":["../../src/SeeqActionDropdown/SeeqActionDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtF,MAAM,YAAY,GAAG;IACnB,iBAAiB;IACjB,WAAW;IACX,eAAe;IACf,4BAA4B;IAC5B,yBAAyB;CAC1B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,QAAQ,GAAG,CAAC,gBAAgB,EAAE,+BAA+B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/E,MAAM,eAAe,GAAG,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE7E,MAAM,UAAU,GAAG,CAAC,OAA2C,EAAE,IAA6B,EAAE,EAAE;IAChG,QAAQ,OAAO,EAAE;QACf,KAAK,kBAAkB;YACrB,OAAO,oBAAC,sBAAsB,OAAK,IAAI,GAAI,CAAC;QAC9C,KAAK,gBAAgB;YACnB,OAAO,oBAAC,aAAa,OAAK,IAAI,GAAI,CAAC;QACrC,KAAK,qBAAqB;YACxB,OAAO,oBAAC,iBAAiB,OAAK,IAAI,GAAI,CAAC;QACzC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ACR,2FAA2F;oBAC3F,qEAAqE;oBACrE,kMAAkM;oBAClM,YAAY;gBAEb,QAAQ,IAAI,CACX,oBAAC,YAAY,CAAC,KAAK,IAAC,OAAO;oBACzB,6BAAK,SAAS,EAAC,6LAA6L,GAAG,CAC5L,CACtB;gBACA,uBAAuB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;oBAC3C,OAAO,CACL,6BAAK,GAAG,EAAE,IAAI,CAAC,OAAO,GAAG,KAAK;wBAC5B,oBAAC,YAAY,CAAC,IAAI,IAChB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gCACd,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;4BACjB,CAAC,EACD,SAAS,EAAE,kPAAkP,iBAChP,IAAI,CAAC,MAAM,EACxB,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,IACtB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CACR;wBACnB,IAAI,CAAC,OAAO,IAAI,CACf,oBAAC,YAAY,CAAC,SAAS,mBACR,oBAAoB,KAAK,EAAE,EACxC,SAAS,EAAC,mEAAmE,GAC7E,CACH,CACG,CACP,CAAC;gBACJ,CAAC,CAAC,CACE,CACe,CACL,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QTip } from '../Tooltip/Qtip';
|
|
3
|
+
import Button from '../Button/Button';
|
|
4
|
+
import SeeqActionDropdown from './SeeqActionDropdown';
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Seeq Action Dropdown',
|
|
7
|
+
};
|
|
8
|
+
const options = [
|
|
9
|
+
{
|
|
10
|
+
display: 'New Workbook',
|
|
11
|
+
text: 'This is a workbook to show details about your data. You can make changes to your account',
|
|
12
|
+
icon: 'fc-analysis',
|
|
13
|
+
id: 'newWorkbook',
|
|
14
|
+
enabled: true,
|
|
15
|
+
iconExtraClassNames: 'workbenchDisplay',
|
|
16
|
+
action: () => { },
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
display: 'New Report Binder',
|
|
20
|
+
text: 'This is a data tab to show details about your data. You can make changes to your account',
|
|
21
|
+
icon: 'fc-report',
|
|
22
|
+
enabled: true,
|
|
23
|
+
action: () => { },
|
|
24
|
+
id: 'newReportBinder',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
display: 'New Datalab',
|
|
28
|
+
text: 'This is a data tab to show details about your data. You can make changes to your account',
|
|
29
|
+
icon: 'fc-seeq-datalab',
|
|
30
|
+
id: 'newDataLab',
|
|
31
|
+
enabled: false,
|
|
32
|
+
action: () => { },
|
|
33
|
+
divider: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
display: 'Folder',
|
|
37
|
+
icon: 'fc-folder',
|
|
38
|
+
action: () => { },
|
|
39
|
+
id: 'newFolder',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
export const AllSeeqActionDropdownVariants = () => {
|
|
43
|
+
const [openDropdown, setOpenDropdown] = React.useState('');
|
|
44
|
+
const allSeeqActionDropdowns = (color, isDark) => (React.createElement("div", { className: isDark ? 'tw-dark tw-bg-sq-dark-background' : '' },
|
|
45
|
+
React.createElement("div", { className: "tw-p-5 " },
|
|
46
|
+
React.createElement(SeeqActionDropdown, { trigger: React.createElement(Button, { label: "New", icon: "fa-plus", variant: "theme" }), key: "seeqActionDropdownItem", "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "start", alignOffset: 0, placementOffset: 0, variant: "create-workbench", seeqActionDropdownItems: options })),
|
|
47
|
+
React.createElement("div", { className: "tw-p-5 " },
|
|
48
|
+
React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "New workbench with arrow"),
|
|
49
|
+
React.createElement(SeeqActionDropdown, { trigger: React.createElement(Button, { label: "New", icon: "fa-plus", variant: "theme" }), key: "seeqActionDropdownItem", "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "start", alignOffset: 0, hasArrow: true, variant: "create-workbench", placementOffset: 0, seeqActionDropdownItems: options })),
|
|
50
|
+
React.createElement("div", { className: "tw-p-5 " },
|
|
51
|
+
React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "New workbench with center align"),
|
|
52
|
+
React.createElement(SeeqActionDropdown, { trigger: React.createElement(Button, { label: "New", icon: "fa-plus", variant: "theme" }), key: "seeqActionDropdownItem", "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "center", alignOffset: 0, hasArrow: true, variant: "create-workbench", placementOffset: 0, seeqActionDropdownItems: options })),
|
|
53
|
+
React.createElement("div", { className: "tw-p-5 " },
|
|
54
|
+
React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "New workbench with disabled button"),
|
|
55
|
+
React.createElement(SeeqActionDropdown, { trigger: React.createElement(Button, { label: "New", icon: "fa-plus", variant: "theme" }), key: "seeqActionDropdownItem", "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "center", disabled: true, variant: "create-workbench", alignOffset: 0, hasArrow: true, placementOffset: 0, seeqActionDropdownItems: options })),
|
|
56
|
+
React.createElement("div", { className: "tw-p-5 " },
|
|
57
|
+
React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "View workbench"),
|
|
58
|
+
React.createElement(SeeqActionDropdown, { trigger: React.createElement(Button, { label: "View", icon: "fa-plus", variant: "theme" }), key: "seeqActionDropdownItem", "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "center", variant: "view-workbench", alignOffset: 0, placementOffset: 0, seeqActionDropdownItems: options })),
|
|
59
|
+
React.createElement("div", { className: "tw-p-5 " },
|
|
60
|
+
React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "Insert seeq content"),
|
|
61
|
+
React.createElement(SeeqActionDropdown, { trigger: React.createElement(Button, { label: "Insert", icon: "fc-plus", variant: "theme" }), key: "seeqActionDropdownItem", "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "center", variant: "insert-seeq-content", alignOffset: 0, placementOffset: 0, seeqActionDropdownItems: options }))));
|
|
62
|
+
const renderAllVariations = (color) => (React.createElement("div", { className: "tw-grid tw-grid-cols-2 tw-gap-4 tw-p-4" },
|
|
63
|
+
allSeeqActionDropdowns(color),
|
|
64
|
+
allSeeqActionDropdowns(color, true)));
|
|
65
|
+
return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
|
|
66
|
+
React.createElement(QTip, null),
|
|
67
|
+
React.createElement("div", { className: "color_topic" },
|
|
68
|
+
React.createElement("b", null, "Topic Colors"),
|
|
69
|
+
renderAllVariations('topic')),
|
|
70
|
+
React.createElement("div", { className: "color_analysis" },
|
|
71
|
+
React.createElement("b", null, "Analysis Colors"),
|
|
72
|
+
renderAllVariations('analysis')),
|
|
73
|
+
React.createElement("div", { className: "color_datalab" },
|
|
74
|
+
React.createElement("b", null, "Datalab Colors"),
|
|
75
|
+
renderAllVariations('datalab')),
|
|
76
|
+
React.createElement("div", { className: "color_vantage" },
|
|
77
|
+
React.createElement("b", null, "Vantage Colors"),
|
|
78
|
+
renderAllVariations('vantage'))));
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=SeeqActionDropdown.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SeeqActionDropdown.stories.js","sourceRoot":"","sources":["../../src/SeeqActionDropdown/SeeqActionDropdown.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,eAAe;IACb,KAAK,EAAE,sBAAsB;CAC9B,CAAC;AAEF,MAAM,OAAO,GAAG;IACd;QACE,OAAO,EAAE,cAAc;QACvB,IAAI,EAAE,0FAA0F;QAChG,IAAI,EAAE,aA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iC;QAC9C,oBAAC,IAAI,OAAG;QACR,6BAAK,SAAS,EAAC,aAAa;YAC1B,8CAAmB;YAClB,mBAAmB,CAAC,OAAO,CAAC,CACzB;QAEN,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,iDAAsB;YACrB,mBAAmB,CAAC,UAAU,CAAC,CAC5B;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,CAAC,SAAS,CAAC,CAC3B;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,CAAC,SAAS,CAAC,CAC3B,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 Icon from '../Icon';
|
|
6
|
+
import SeeqActionDropdown from './SeeqActionDropdown';
|
|
7
|
+
describe('SeeqActionDropdown', () => {
|
|
8
|
+
const mockOnClick = jest.fn();
|
|
9
|
+
const testId = 'trigger-icon';
|
|
10
|
+
class Context {
|
|
11
|
+
props = {
|
|
12
|
+
trigger: (React.createElement(Icon, { icon: "fc-more", type: "text", testId: testId, extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]" })),
|
|
13
|
+
containerTestId: 'basic-dropdown1',
|
|
14
|
+
tooltip: 'This is a small dropdown.',
|
|
15
|
+
tooltipDelay: 0,
|
|
16
|
+
tooltipPlacement: 'top',
|
|
17
|
+
variant: 'create-workbench',
|
|
18
|
+
isHtmlTooltip: false,
|
|
19
|
+
seeqActionDropdownItems: [
|
|
20
|
+
{ display: 'Orange', icon: 'fc-data-file', action: mockOnClick, enabled: true },
|
|
21
|
+
{ display: 'Mango', icon: 'fc-user-community', action: mockOnClick, enabled: true },
|
|
22
|
+
{ display: 'Guava', icon: 'fc-user-community', action: mockOnClick },
|
|
23
|
+
{ display: 'Banana', icon: 'fc-user-community', action: mockOnClick },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
let tc;
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
tc = new Context();
|
|
30
|
+
jest.clearAllMocks();
|
|
31
|
+
});
|
|
32
|
+
const renderSeeqActionDropdown = (props) => render(React.createElement(SeeqActionDropdown, { ...props }));
|
|
33
|
+
const openDropdown = async () => {
|
|
34
|
+
const popover = screen.getByTestId(testId);
|
|
35
|
+
await userEvent.click(popover);
|
|
36
|
+
};
|
|
37
|
+
test('renders trigger and opens dropdown content on trigger click', async () => {
|
|
38
|
+
renderSeeqActionDropdown(tc.props);
|
|
39
|
+
expect(screen.getByTestId('trigger-icon')).toBeInTheDocument();
|
|
40
|
+
await openDropdown();
|
|
41
|
+
expect(screen.getByText('Orange')).toBeInTheDocument();
|
|
42
|
+
});
|
|
43
|
+
test('renders dividers correctly', async () => {
|
|
44
|
+
tc.props.seeqActionDropdownItems[1].divider = true;
|
|
45
|
+
renderSeeqActionDropdown(tc.props);
|
|
46
|
+
expect(screen.getByTestId('trigger-icon')).toBeInTheDocument();
|
|
47
|
+
await openDropdown();
|
|
48
|
+
expect(screen.getByText('Orange')).toBeInTheDocument();
|
|
49
|
+
expect(screen.getByTestId('dropdown-divider-1')).toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
test('calls onClick handler when dropdown item is selected', async () => {
|
|
52
|
+
renderSeeqActionDropdown(tc.props);
|
|
53
|
+
await openDropdown();
|
|
54
|
+
const item1 = screen.getByText('Orange');
|
|
55
|
+
await userEvent.click(item1);
|
|
56
|
+
expect(mockOnClick).toHaveBeenCalledTimes(1);
|
|
57
|
+
});
|
|
58
|
+
test('closes dropdown when item is clicked', async () => {
|
|
59
|
+
renderSeeqActionDropdown(tc.props);
|
|
60
|
+
await openDropdown();
|
|
61
|
+
const item1 = screen.getByText('Orange');
|
|
62
|
+
await userEvent.click(item1);
|
|
63
|
+
expect(mockOnClick).toHaveBeenCalledTimes(1);
|
|
64
|
+
expect(screen.queryByText('Orange')).not.toBeInTheDocument();
|
|
65
|
+
});
|
|
66
|
+
test('does not open when disabled', async () => {
|
|
67
|
+
tc.props.disabled = true;
|
|
68
|
+
renderSeeqActionDropdown(tc.props);
|
|
69
|
+
await openDropdown();
|
|
70
|
+
expect(screen.queryByText('Orange')).not.toBeInTheDocument();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=SeeqActionDropdown.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SeeqActionDropdown.test.js","sourceRoot":"","sources":["../../src/SeeqActionDropdown/SeeqActionDropdown.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,cAAc,CAAC;IAC9B,MAAM,OAAO;QACX,KAAK,GAA4B;YAC/B,OAAO,EAAE,CACP,oBAAC,IAAI,IACH,IAAI,EAAC,SAAS,EACd,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,MAAM,EACd,eAAe,EAAC,yDAAyD,GACzE,CACH;YACD,eAAe,EAAE,iBAAiB;YAClC,OAAO,EAAE,2BAA2B;YACpC,YAAY,EAAE,CAAC;YACf,gBAAgB,EAAE,KAAK;YACvB,OAAO,EAAE,kBAAkB;YAC3B,aAAa,EAAE,KAAK;YACpB,uBAAuB,EAAE;gBACvB,EAAE,OAAO,EAAE,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IAC/D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;QACzB,wBAAwB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,YAAY,EAAE,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
|
|
2
|
-
export interface
|
|
2
|
+
export interface SeeqActionDropdownItems {
|
|
3
3
|
id?: string;
|
|
4
4
|
/** icon class to be used with the workbench items - if available (i.e. 'fc-zoom') */
|
|
5
5
|
icon?: string;
|
|
@@ -18,9 +18,9 @@ export interface NewWorkbenchItems {
|
|
|
18
18
|
/** subtext displayed below workbench item "headline" */
|
|
19
19
|
text?: string;
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface SeeqActionDropdownProps extends TooltipComponentProps {
|
|
22
22
|
/** items for the dropdown content */
|
|
23
|
-
|
|
23
|
+
seeqActionDropdownItems: SeeqActionDropdownItems[];
|
|
24
24
|
/** element to be used as the trigger */
|
|
25
25
|
trigger: React.ReactNode;
|
|
26
26
|
/** id of the trigger */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SeeqActionDropdown.types.js","sourceRoot":"","sources":["../../src/SeeqActionDropdown/SeeqActionDropdown.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SeeqActionDropdown';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/SeeqActionDropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SeeqActionDropdownItems } from './SeeqActionDropdown.types';
|
|
3
|
+
export declare const SeeqActionDropdownItem: React.FC<SeeqActionDropdownItems>;
|
|
4
|
+
export declare const ViewWorkbench: React.FC<SeeqActionDropdownItems>;
|
|
5
|
+
export declare const InsertSeeqContent: React.FC<SeeqActionDropdownItems>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Icon from '../Icon/Icon';
|
|
3
|
+
export const SeeqActionDropdownItem = (item) => {
|
|
4
|
+
return (React.createElement("div", { className: "tw-flex-col tw-flex tw-p-[10px] tw-pl-5 tw-w-[600px]" },
|
|
5
|
+
React.createElement("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-end" },
|
|
6
|
+
item.icon && (React.createElement(Icon, { icon: item.icon, type: "text", extraClassNames: 'tw-rounded-[3px] tw-h-8 tw-w-8 tw-flex tw-justify-center tw-items-center tw-bg-sq-color-dark dark:tw-text-sq-white tw-text-[22px] tw-text-sq-white ' +
|
|
7
|
+
item.iconExtraClassNames })),
|
|
8
|
+
React.createElement("h4", { className: "tw-text-base tw-font-[600] tw-leading-[20px] mb-0" }, item.display)),
|
|
9
|
+
React.createElement("div", { className: "tw-text-[13px] tw-font-normal" }, item.text)));
|
|
10
|
+
};
|
|
11
|
+
export const ViewWorkbench = (item) => {
|
|
12
|
+
return (React.createElement("div", { className: "tw-flex-col tw-flex tw-p-[10px]" },
|
|
13
|
+
React.createElement("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-end" },
|
|
14
|
+
item.icon && (React.createElement(Icon, { icon: item.icon, type: "text", extraClassNames: 'tw-flex tw-justify-center tw-items-center tw-text-[20px] dark:tw-text-sq-white tw-text-sq-text-color ' +
|
|
15
|
+
item.iconExtraClassNames })),
|
|
16
|
+
React.createElement("div", { className: "tw-text-[13px]" }, item.display))));
|
|
17
|
+
};
|
|
18
|
+
export const InsertSeeqContent = (item) => {
|
|
19
|
+
return (React.createElement("div", { className: "tw-flex-col tw-flex tw-justify-start tw-p-[10px] tw-font-normal tw-text-left dark:tw-text-sq-white tw-text-sq-text-color" },
|
|
20
|
+
React.createElement("h5", { className: "tw-text-[15px] tw-leading-[18px]" }, item.display),
|
|
21
|
+
React.createElement("div", { className: "tw-text-[11px] tw-text-[#999] !tw-mt-1" }, item.text)));
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.js","sourceRoot":"","sources":["../../src/SeeqActionDropdown/variants.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,IAAI,MAAM,cAAc,CAAC;AAEhC,MAAM,CAAC,MAAM,sBAAsB,GAAsC,CAAC,IAAI,EAAE,EAAE;IAChF,OAAO,CACL,6BAAK,SAAS,EAAC,sDAAsD;QACnE,6BAAK,SAAS,EAAC,2CAA2C;YACvD,IAAI,CAAC,IAAI,IAAI,CACZ,oBAAC,IAAI,IACH,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAC,MAAM,EACX,eAAe,EACb,qJAAqJ;oBACrJ,IAAI,CAAC,mBAAmB,GAE1B,CACH;YACD,4BAAI,SAAS,EAAC,mDAAmD,IAAE,IAAI,CAAC,OAAO,CAAM,CACjF;QACN,6BAAK,SAAS,EAAC,+BAA+B,IAAE,IAAI,CAAC,IAAI,CAAO,CAC5D,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAsC,CAAC,IAAI,EAAE,EAAE;IACvE,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,6BAAK,SAAS,EAAC,2CAA2C;YACvD,IAAI,CAAC,IAAI,IAAI,CACZ,oBAAC,IAAI,IACH,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAC,MAAM,EACX,eAAe,EACb,uGAAuG;oBACvG,IAAI,CAAC,mBAAmB,GAE1B,CACH;YACD,6BAAK,SAAS,EAAC,gBAAgB,IAAE,IAAI,CAAC,OAAO,CAAO,CAChD,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAsC,CAAC,IAAI,EAAE,EAAE;IAC3E,OAAO,CACL,6BAAK,SAAS,EAAC,0HAA0H;QACvI,4BAAI,SAAS,EAAC,kCAAkC,IAAE,IAAI,CAAC,OAAO,CAAM;QACpE,6BAAK,SAAS,EAAC,wCAAwC,IAAE,IAAI,CAAC,IAAI,CAAO,CACrE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import Tabs from './Tabs';
|
|
|
12
12
|
import Accordion from './Accordion';
|
|
13
13
|
import ButtonWithPopover from './ButtonWithPopover';
|
|
14
14
|
import ButtonWithDropdown from './ButtonWithDropdown';
|
|
15
|
-
import
|
|
15
|
+
import SeeqActionDropdown from './SeeqActionDropdown';
|
|
16
16
|
export { Tabs };
|
|
17
17
|
export { Button };
|
|
18
18
|
export { ToolbarButton };
|
|
@@ -28,4 +28,4 @@ export { Modal };
|
|
|
28
28
|
export { Accordion };
|
|
29
29
|
export { ButtonWithPopover };
|
|
30
30
|
export { ButtonWithDropdown };
|
|
31
|
-
export {
|
|
31
|
+
export { SeeqActionDropdown };
|
package/dist/index.esm.js
CHANGED
|
@@ -16162,7 +16162,7 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, c
|
|
|
16162
16162
|
}))))));
|
|
16163
16163
|
};
|
|
16164
16164
|
|
|
16165
|
-
const
|
|
16165
|
+
const SeeqActionDropdownItem = (item) => {
|
|
16166
16166
|
return (React__default.createElement("div", { className: "tw-flex-col tw-flex tw-p-[10px] tw-pl-5 tw-w-[600px]" },
|
|
16167
16167
|
React__default.createElement("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-end" },
|
|
16168
16168
|
item.icon && (React__default.createElement(Icon, { icon: item.icon, type: "text", extraClassNames: 'tw-rounded-[3px] tw-h-8 tw-w-8 tw-flex tw-justify-center tw-items-center tw-bg-sq-color-dark dark:tw-text-sq-white tw-text-[22px] tw-text-sq-white ' +
|
|
@@ -16195,16 +16195,16 @@ const disabledClasses = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
|
16195
16195
|
const renderItem = (variant, item) => {
|
|
16196
16196
|
switch (variant) {
|
|
16197
16197
|
case 'create-workbench':
|
|
16198
|
-
return React.createElement(
|
|
16198
|
+
return React.createElement(SeeqActionDropdownItem, { ...item });
|
|
16199
16199
|
case 'view-workbench':
|
|
16200
16200
|
return React.createElement(ViewWorkbench, { ...item });
|
|
16201
16201
|
case 'insert-seeq-content':
|
|
16202
16202
|
return React.createElement(InsertSeeqContent, { ...item });
|
|
16203
16203
|
default:
|
|
16204
|
-
return React.createElement(
|
|
16204
|
+
return React.createElement(SeeqActionDropdownItem, { ...item });
|
|
16205
16205
|
}
|
|
16206
16206
|
};
|
|
16207
|
-
const
|
|
16207
|
+
const SeeqActionDropdown = ({ seeqActionDropdownItems, trigger, id, extraClassNames, containerTestId, disabled = false, align = 'end', placement = 'bottom', placementOffset = 5, alignOffset = -35, hasArrow = false, onOpenChange, isOpen, setFocusOnTriggerOnClose = true, keepFocusInsideDropdown = true, variant, ...tooltipProps }) => {
|
|
16208
16208
|
const tooltipData = getQTipData(tooltipProps);
|
|
16209
16209
|
return (React.createElement($d08ef79370b62062$export$be92b6f5f03c0fe9, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown },
|
|
16210
16210
|
React.createElement($d08ef79370b62062$export$41fb9f06171c75f4, { id: id, "data-testid": id, className: `tw-border-none focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none`, asChild: true, disabled: disabled },
|
|
@@ -16217,7 +16217,7 @@ const NewWorkbench = ({ newWorkbenchItems, trigger, id, extraClassNames, contain
|
|
|
16217
16217
|
borderStyles },
|
|
16218
16218
|
hasArrow && (React.createElement($d08ef79370b62062$export$21b07c8f274aebd5, { asChild: true },
|
|
16219
16219
|
React.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500 tw-mt-[-7px]" }))),
|
|
16220
|
-
|
|
16220
|
+
seeqActionDropdownItems.map((item, index) => {
|
|
16221
16221
|
return (React.createElement("div", { key: item.display + index },
|
|
16222
16222
|
React.createElement($d08ef79370b62062$export$6d08773d2e66f8f2, { onSelect: (e) => {
|
|
16223
16223
|
item.action(e);
|
|
@@ -16226,5 +16226,5 @@ const NewWorkbench = ({ newWorkbenchItems, trigger, id, extraClassNames, contain
|
|
|
16226
16226
|
})))));
|
|
16227
16227
|
};
|
|
16228
16228
|
|
|
16229
|
-
export { Accordion, Button, ButtonWithDropdown, ButtonWithPopover, Checkbox, Icon, Modal,
|
|
16229
|
+
export { Accordion, Button, ButtonWithDropdown, ButtonWithPopover, Checkbox, Icon, Modal, QTip, SeeqActionDropdown, Select, components as SelectCompoents, Tabs, TextArea, TextField, ToolbarButton, Tooltip };
|
|
16230
16230
|
//# sourceMappingURL=index.esm.js.map
|