@seeqdev/qomponents 0.0.63 → 0.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/ButtonWithDropdown/ButtonWithDropdown.js +14 -19
  2. package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
  3. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +6 -6
  4. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +1 -1
  5. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +1 -1
  6. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +1 -1
  7. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.d.ts +2 -12
  8. package/dist/ButtonWithPopover/ButtonWithPopover.js +3 -12
  9. package/dist/ButtonWithPopover/ButtonWithPopover.js.map +1 -1
  10. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +7 -7
  11. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +1 -1
  12. package/dist/ButtonWithPopover/ButtonWithPopover.test.js +1 -1
  13. package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +1 -1
  14. package/dist/ButtonWithPopover/ButtonWithPopover.types.d.ts +2 -12
  15. package/dist/Checkbox/Checkbox.js +4 -2
  16. package/dist/Checkbox/Checkbox.js.map +1 -1
  17. package/dist/Checkbox/Checkbox.stories.js +7 -5
  18. package/dist/Checkbox/Checkbox.stories.js.map +1 -1
  19. package/dist/Checkbox/Checkbox.types.d.ts +2 -1
  20. package/dist/Icon/Icon.js +3 -11
  21. package/dist/Icon/Icon.js.map +1 -1
  22. package/dist/Icon/Icon.types.d.ts +3 -12
  23. package/dist/Tooltip/Tooltip.types.d.ts +13 -1
  24. package/dist/Tooltip/qTip.utilities.d.ts +3 -0
  25. package/dist/Tooltip/qTip.utilities.js +11 -0
  26. package/dist/Tooltip/qTip.utilities.js.map +1 -0
  27. package/dist/index.esm.js +19 -34
  28. package/dist/index.esm.js.map +1 -1
  29. package/dist/index.js +19 -34
  30. package/dist/index.js.map +1 -1
  31. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -53,6 +53,16 @@ const browserIsFirefox = browserId && browserName === 'Firefox';
53
53
 
54
54
  const DEFAULT_TOOL_TIP_DELAY = 500;
55
55
 
56
+ const getQTipData = ({ tooltip, tooltipPlacement, isHtmlTooltip, tooltipTestId, tooltipDelay = DEFAULT_TOOL_TIP_DELAY, }) => tooltip
57
+ ? {
58
+ 'data-qtip-text': tooltip,
59
+ 'data-qtip-placement': tooltipPlacement,
60
+ 'data-qtip-is-html': isHtmlTooltip,
61
+ 'data-qtip-testid': tooltipTestId,
62
+ 'data-qtip-delay': tooltipDelay,
63
+ }
64
+ : undefined;
65
+
56
66
  const colorClassesThemeLight = {
57
67
  'theme': 'tw-text-sq-color-dark',
58
68
  'white': 'tw-text-white',
@@ -88,7 +98,7 @@ const colorClassesThemeDark = {
88
98
  * - access to Seeq custom icons by providing the desired icon
89
99
  * - leverage "type" to style your icon
90
100
  */
91
- const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClassNames, id, large, small, color, testId, customId, tooltip, tooltipPlacement, number, isHtmlTooltip = false, tooltipTestId, tooltipDelay = DEFAULT_TOOL_TIP_DELAY, }) => {
101
+ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClassNames, id, large, small, color, testId, customId, number, ...tooltipProps }) => {
92
102
  if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {
93
103
  const errorMessage = color === undefined || color === ''
94
104
  ? 'Icon with type="color" must have prop color specified.'
@@ -100,15 +110,7 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
100
110
  const style = type === 'color' && color ? { color } : {};
101
111
  const appliedClassNames = `${iconPrefixString} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
102
112
  ${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
103
- const tooltipData = tooltip
104
- ? {
105
- 'data-qtip-text': tooltip,
106
- 'data-qtip-placement': tooltipPlacement,
107
- 'data-qtip-is-html': isHtmlTooltip,
108
- 'data-qtip-testid': tooltipTestId,
109
- 'data-qtip-delay': tooltipDelay,
110
- }
111
- : undefined;
113
+ const tooltipData = getQTipData(tooltipProps);
112
114
  return (React.createElement("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number, ...tooltipData }));
113
115
  };
114
116
 
@@ -4709,10 +4711,11 @@ const radioClasses = `tw-form-radio ${baseClasses$2}`;
4709
4711
  * Checkbox and Radio Box Component.
4710
4712
  */
4711
4713
  const Checkbox = (props) => {
4712
- const { type = 'checkbox', value, disabled = false, label, onChange, onClick, onKeyDown, checked, defaultChecked, id, name, extraClassNames, extraLabelClassNames, testId, } = props;
4714
+ const { type = 'checkbox', value, disabled = false, label, onChange, onClick, onKeyDown, checked, defaultChecked, id, name, extraClassNames, extraLabelClassNames, testId, ...tooltipProps } = props;
4713
4715
  const assignedId = id ?? 'checkbox_' + Math.random();
4716
+ const tooltipData = getQTipData(tooltipProps);
4714
4717
  return (React.createElement("span", { className: `${alignment} ${extraClassNames}` },
4715
- React.createElement("input", { value: value, type: type, "data-testid": testId, name: name, id: assignedId, checked: checked, defaultChecked: defaultChecked, className: `${type === 'checkbox' ? checkboxClasses : radioClasses} ${disabled ? 'tw-cursor-not-allowed' : 'tw-cursor-pointer'}`, disabled: disabled, onClick: onClick, onChange: onChange, onKeyDown: onKeyDown }),
4718
+ React.createElement("input", { value: value, type: type, "data-testid": testId, name: name, id: assignedId, checked: checked, defaultChecked: defaultChecked, className: `${type === 'checkbox' ? checkboxClasses : radioClasses} ${disabled ? 'tw-cursor-not-allowed' : 'tw-cursor-pointer'}`, disabled: disabled, onClick: onClick, onChange: onChange, onKeyDown: onKeyDown, ...tooltipData }),
4716
4719
  React.createElement("label", { htmlFor: assignedId, className: `${labelClasses} ${extraLabelClassNames} ${disabled
4717
4720
  ? 'tw-cursor-not-allowed dark:tw-text-sq-fairly-dark-gray tw-text-sq-fairly-dark-gray'
4718
4721
  : 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}` }, label)));
@@ -15020,17 +15023,8 @@ const borderStyles$1 = [
15020
15023
  'dark:tw-border-gray-700',
15021
15024
  ].join(' ');
15022
15025
  const disabledClasses$1 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
15023
- const ButtonWithPopover = ({ children, trigger, tooltipText, id, hasArrow, extraTriggerClassNames, extraPopoverClassNames, containerTestId, tooltipTestId, tooltipDelay, tooltipPlacement, disabled = false, align = 'end', alignOffset = -5, placement = 'bottom', placementOffset = 2, onOpenChange, isOpen, isHtmlTooltip = false, isCloseOnContentClick = false, setFocusOnTriggerOnClose = true, }) => {
15024
- let tooltipData = undefined;
15025
- if (tooltipText) {
15026
- tooltipData = {
15027
- 'data-qtip-text': tooltipText,
15028
- 'data-qtip-placement': tooltipPlacement,
15029
- 'data-qtip-is-html': isHtmlTooltip,
15030
- 'data-qtip-testid': tooltipTestId,
15031
- 'data-qtip-delay': tooltipDelay ?? DEFAULT_TOOL_TIP_DELAY,
15032
- };
15033
- }
15026
+ const ButtonWithPopover = ({ children, trigger, id, hasArrow, extraTriggerClassNames, extraPopoverClassNames, containerTestId, disabled = false, align = 'end', alignOffset = -5, placement = 'bottom', placementOffset = 2, onOpenChange, isOpen, isCloseOnContentClick = false, setFocusOnTriggerOnClose = true, ...tooltipProps }) => {
15027
+ const tooltipData = getQTipData(tooltipProps);
15034
15028
  return (React__namespace.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open: isOpen, defaultOpen: false, onOpenChange: onOpenChange },
15035
15029
  React__namespace.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { id: id, className: `tw-border-none`, disabled: disabled },
15036
15030
  React__namespace.createElement("div", { ...tooltipData, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center tw-justify-center ${disabled ? disabledClasses$1 : ''} ${extraTriggerClassNames || ''}` }, trigger)),
@@ -15754,17 +15748,8 @@ const borderStyles = [
15754
15748
  ].join(' ');
15755
15749
  const bgStyles = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
15756
15750
  const disabledClasses = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
15757
- const ButtonWithDropdown = ({ dropdownItems, triggerIcon, tooltipText, id, extraClassNames, containerTestId, tooltipTestId, tooltipDelay, tooltipPlacement, disabled = false, align = 'end', placement = 'bottom', placementOffset = 2, alignOffset = -5, hasArrow = false, onOpenChange, isHtmlTooltip = false, isOpen, setFocusOnTriggerOnClose = true, keepFocusInsideDropdown = true, }) => {
15758
- let tooltipData = undefined;
15759
- if (tooltipText) {
15760
- tooltipData = {
15761
- 'data-qtip-text': tooltipText,
15762
- 'data-qtip-placement': tooltipPlacement,
15763
- 'data-qtip-is-html': isHtmlTooltip,
15764
- 'data-qtip-testid': tooltipTestId,
15765
- 'data-qtip-delay': tooltipDelay ?? DEFAULT_TOOL_TIP_DELAY,
15766
- };
15767
- }
15751
+ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, containerTestId, disabled = false, align = 'end', placement = 'bottom', placementOffset = 2, alignOffset = -5, hasArrow = false, onOpenChange, isOpen, setFocusOnTriggerOnClose = true, keepFocusInsideDropdown = true, ...tooltipProps }) => {
15752
+ const tooltipData = getQTipData(tooltipProps);
15768
15753
  return (React__namespace.createElement($d08ef79370b62062$export$be92b6f5f03c0fe9, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown },
15769
15754
  React__namespace.createElement($d08ef79370b62062$export$41fb9f06171c75f4, { id: id, className: `tw-border-none focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none`, disabled: disabled },
15770
15755
  React__namespace.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 || ''}` }, triggerIcon)),