@seeqdev/qomponents 0.0.60 → 0.0.61
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/ButtonWithDropdown/ButtonWithDropdown.d.ts +4 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.d.ts +5 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.d.ts +1 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.d.ts +70 -0
- package/dist/ButtonWithDropdown/index.d.ts +1 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.d.ts +4 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.d.ts +5 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.test.d.ts +1 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.types.d.ts +48 -0
- package/dist/ButtonWithPopover/index.d.ts +1 -0
- package/dist/ToolbarButton/ToolbarButton.types.d.ts +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +855 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +856 -19
- package/dist/index.js.map +1 -1
- package/dist/styles.css +183 -0
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { TooltipPosition } from '../Tooltip/Tooltip.types';
|
|
2
|
+
interface DropdownSubItems {
|
|
3
|
+
/** icon class to be used with the dropdown subitems - if available (i.e. 'fc-zoom') */
|
|
4
|
+
icon?: string;
|
|
5
|
+
/** label for the dropdown subitems */
|
|
6
|
+
label: string;
|
|
7
|
+
/** function called when the dropdown subitem is clicked on */
|
|
8
|
+
onClick: (e: Event) => void;
|
|
9
|
+
/** dropdown subitem container classes */
|
|
10
|
+
itemContainerClasses?: string;
|
|
11
|
+
/** dropdown subitem label classes */
|
|
12
|
+
labelClasses?: string;
|
|
13
|
+
/** is item disabled */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** dropdown container extra class names */
|
|
16
|
+
containerExtraClassNames?: string;
|
|
17
|
+
/** test id for the dropdown subitem */
|
|
18
|
+
labelTestId?: string;
|
|
19
|
+
/** test id for the dropdown subitem icon */
|
|
20
|
+
iconTestId?: string;
|
|
21
|
+
/** displays a divider line under present dropdown item */
|
|
22
|
+
hasDivider?: boolean;
|
|
23
|
+
/** test id for the dropdown subitem */
|
|
24
|
+
testId?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ButtonWithDropdownProps {
|
|
27
|
+
/** items for the dropdown content */
|
|
28
|
+
dropdownItems: DropdownSubItems[];
|
|
29
|
+
/** icon element to be used as the trigger */
|
|
30
|
+
triggerIcon: React.ReactNode;
|
|
31
|
+
/** id of the dropdown trigger */
|
|
32
|
+
id?: string;
|
|
33
|
+
/** extra class names to be placed on the dropdown container */
|
|
34
|
+
extraClassNames?: string;
|
|
35
|
+
/** id that will be used in the data-testid attribute on the container element */
|
|
36
|
+
containerTestId?: string;
|
|
37
|
+
/** the text to be displayed on the triggers's tooltip */
|
|
38
|
+
tooltipText?: string;
|
|
39
|
+
/** optional testId applied to the tooltip - useful for testing */
|
|
40
|
+
tooltipTestId?: string;
|
|
41
|
+
/** number of milliseconds to wait before showing a tooltip on-hover */
|
|
42
|
+
tooltipDelay?: number;
|
|
43
|
+
/** position of the tooltip */
|
|
44
|
+
tooltipPlacement?: TooltipPosition;
|
|
45
|
+
/** true if the provided tooltip text should be rendered as HTML */
|
|
46
|
+
isHtmlTooltip?: boolean;
|
|
47
|
+
/** is the button disabled */
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/** function called when the trigger is clicked on, i.e. for tracking (does not open the popover) */
|
|
50
|
+
onClick?: (e: MouseEvent) => void;
|
|
51
|
+
/** alignment of the content of the popover */
|
|
52
|
+
align?: 'start' | 'center' | 'end';
|
|
53
|
+
/** number offset from the aligned position */
|
|
54
|
+
alignOffset?: number;
|
|
55
|
+
/** the placement of the popover */
|
|
56
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
57
|
+
/** number offset from the placement position */
|
|
58
|
+
placementOffset?: number;
|
|
59
|
+
/** set to display arrow or not */
|
|
60
|
+
hasArrow?: boolean;
|
|
61
|
+
/** is popover open */
|
|
62
|
+
isOpen?: boolean;
|
|
63
|
+
/** function called to open and close popover */
|
|
64
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
65
|
+
/** should popover close when the content is clicked? */
|
|
66
|
+
isCloseOnContentClick?: boolean;
|
|
67
|
+
/** focus should be kept within dropdown */
|
|
68
|
+
keepFocusInsideDropdown?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ButtonWithDropdown';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipPosition } from '../Tooltip/Tooltip.types';
|
|
3
|
+
export interface ButtonWithPopoverProps {
|
|
4
|
+
/** icon class to be used with the toolbar (i.e. 'fc-zoom') */
|
|
5
|
+
trigger: React.ReactNode;
|
|
6
|
+
/** items for the popover content */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
id?: string;
|
|
9
|
+
/** extra class names to be placed on the Popover container component */
|
|
10
|
+
extraClassNames?: string;
|
|
11
|
+
/** id that will be used in the data-testid attribute on the container element */
|
|
12
|
+
containerTestId?: string;
|
|
13
|
+
/** the text to be displayed on the icon's tooltip */
|
|
14
|
+
tooltipText?: string;
|
|
15
|
+
/** optional testId applied to the tooltip - useful for testing */
|
|
16
|
+
tooltipTestId?: string;
|
|
17
|
+
/** number of milliseconds to wait before showing a tooltip on-hover */
|
|
18
|
+
tooltipDelay?: number;
|
|
19
|
+
/** position of the tooltip */
|
|
20
|
+
tooltipPlacement?: TooltipPosition;
|
|
21
|
+
/** true if the provided tooltip text should be rendered as HTML */
|
|
22
|
+
isHtmlTooltip?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** function called when the toolbar is clicked on, i.e. for tracking (does not open the popover) */
|
|
25
|
+
onClick?: (isOpen: boolean) => void;
|
|
26
|
+
/** called when popup is hidden */
|
|
27
|
+
onHide?: () => void;
|
|
28
|
+
/** alignment of the content of the popover */
|
|
29
|
+
align?: 'start' | 'center' | 'end';
|
|
30
|
+
/** number offset from the aligned position */
|
|
31
|
+
alignOffset?: number;
|
|
32
|
+
/** the placement of the popover */
|
|
33
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
34
|
+
/** number offset from the placement position */
|
|
35
|
+
placementOffset?: number;
|
|
36
|
+
/** is popover open */
|
|
37
|
+
isOpen?: boolean;
|
|
38
|
+
/** function called to open and close popover */
|
|
39
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
40
|
+
/** set to display arrow or not */
|
|
41
|
+
hasArrow?: boolean;
|
|
42
|
+
/** extra trigger container classnames */
|
|
43
|
+
extraTriggerClassNames?: string;
|
|
44
|
+
/** extra popover container classnames */
|
|
45
|
+
extraPopoverClassNames?: string;
|
|
46
|
+
/** should popover close when the content is clicked? */
|
|
47
|
+
isCloseOnContentClick?: boolean;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ButtonWithPopover';
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ import Select from './Select';
|
|
|
9
9
|
import Modal from './Modal';
|
|
10
10
|
import Tabs from './Tabs';
|
|
11
11
|
import Accordion from './Accordion';
|
|
12
|
+
import ButtonWithPopover from './ButtonWithPopover';
|
|
13
|
+
import ButtonWithDropdown from './ButtonWithDropdown';
|
|
12
14
|
export { Tabs };
|
|
13
15
|
export { Button };
|
|
14
16
|
export { ToolbarButton };
|
|
@@ -21,3 +23,5 @@ export { Select };
|
|
|
21
23
|
export { QTip };
|
|
22
24
|
export { Modal };
|
|
23
25
|
export { Accordion };
|
|
26
|
+
export { ButtonWithPopover };
|
|
27
|
+
export { ButtonWithDropdown };
|