@seeqdev/qomponents 0.0.27 → 0.0.28

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 (89) hide show
  1. package/dist/Button/Button.types.d.ts +3 -0
  2. package/dist/Icon/Icon.types.d.ts +3 -0
  3. package/dist/index.esm.js +6 -5
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +6 -5
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/dist/Button/Button.js +0 -86
  9. package/dist/Button/Button.js.map +0 -1
  10. package/dist/Button/Button.stories.js +0 -77
  11. package/dist/Button/Button.stories.js.map +0 -1
  12. package/dist/Button/Button.test.js +0 -49
  13. package/dist/Button/Button.test.js.map +0 -1
  14. package/dist/Button/Button.types.js +0 -4
  15. package/dist/Button/Button.types.js.map +0 -1
  16. package/dist/Button/index.js +0 -2
  17. package/dist/Button/index.js.map +0 -1
  18. package/dist/Checkbox/Checkbox.js +0 -23
  19. package/dist/Checkbox/Checkbox.js.map +0 -1
  20. package/dist/Checkbox/Checkbox.stories.js +0 -29
  21. package/dist/Checkbox/Checkbox.stories.js.map +0 -1
  22. package/dist/Checkbox/Checkbox.test.js +0 -94
  23. package/dist/Checkbox/Checkbox.test.js.map +0 -1
  24. package/dist/Checkbox/Checkbox.types.js +0 -2
  25. package/dist/Checkbox/Checkbox.types.js.map +0 -1
  26. package/dist/Checkbox/index.js +0 -2
  27. package/dist/Checkbox/index.js.map +0 -1
  28. package/dist/Icon/Icon.js +0 -61
  29. package/dist/Icon/Icon.js.map +0 -1
  30. package/dist/Icon/Icon.stories.js +0 -40
  31. package/dist/Icon/Icon.stories.js.map +0 -1
  32. package/dist/Icon/Icon.test.js +0 -55
  33. package/dist/Icon/Icon.test.js.map +0 -1
  34. package/dist/Icon/Icon.types.js +0 -16
  35. package/dist/Icon/Icon.types.js.map +0 -1
  36. package/dist/Icon/index.js +0 -2
  37. package/dist/Icon/index.js.map +0 -1
  38. package/dist/Select/Select.js +0 -168
  39. package/dist/Select/Select.js.map +0 -1
  40. package/dist/Select/Select.stories.js +0 -72
  41. package/dist/Select/Select.stories.js.map +0 -1
  42. package/dist/Select/Select.test.js +0 -161
  43. package/dist/Select/Select.test.js.map +0 -1
  44. package/dist/Select/Select.types.js +0 -2
  45. package/dist/Select/Select.types.js.map +0 -1
  46. package/dist/Select/index.js +0 -2
  47. package/dist/Select/index.js.map +0 -1
  48. package/dist/TextArea/TextArea.js +0 -23
  49. package/dist/TextArea/TextArea.js.map +0 -1
  50. package/dist/TextArea/TextArea.stories.js +0 -39
  51. package/dist/TextArea/TextArea.stories.js.map +0 -1
  52. package/dist/TextArea/TextArea.test.js +0 -68
  53. package/dist/TextArea/TextArea.test.js.map +0 -1
  54. package/dist/TextArea/TextArea.types.js +0 -2
  55. package/dist/TextArea/TextArea.types.js.map +0 -1
  56. package/dist/TextArea/index.js +0 -2
  57. package/dist/TextArea/index.js.map +0 -1
  58. package/dist/TextField/TextField.js +0 -64
  59. package/dist/TextField/TextField.js.map +0 -1
  60. package/dist/TextField/TextField.stories.js +0 -41
  61. package/dist/TextField/TextField.stories.js.map +0 -1
  62. package/dist/TextField/TextField.test.js +0 -35
  63. package/dist/TextField/TextField.test.js.map +0 -1
  64. package/dist/TextField/TextField.types.js +0 -2
  65. package/dist/TextField/TextField.types.js.map +0 -1
  66. package/dist/TextField/index.js +0 -2
  67. package/dist/TextField/index.js.map +0 -1
  68. package/dist/Tooltip/QTip.stories.js +0 -40
  69. package/dist/Tooltip/QTip.stories.js.map +0 -1
  70. package/dist/Tooltip/QTip.types.js +0 -2
  71. package/dist/Tooltip/QTip.types.js.map +0 -1
  72. package/dist/Tooltip/QTipPerformance.stories.js +0 -30
  73. package/dist/Tooltip/QTipPerformance.stories.js.map +0 -1
  74. package/dist/Tooltip/Qtip.js +0 -146
  75. package/dist/Tooltip/Qtip.js.map +0 -1
  76. package/dist/Tooltip/Tooltip.js +0 -36
  77. package/dist/Tooltip/Tooltip.js.map +0 -1
  78. package/dist/Tooltip/Tooltip.stories.js +0 -32
  79. package/dist/Tooltip/Tooltip.stories.js.map +0 -1
  80. package/dist/Tooltip/Tooltip.types.js +0 -3
  81. package/dist/Tooltip/Tooltip.types.js.map +0 -1
  82. package/dist/Tooltip/TooltipPerformance.stories.js +0 -30
  83. package/dist/Tooltip/TooltipPerformance.stories.js.map +0 -1
  84. package/dist/Tooltip/index.js +0 -3
  85. package/dist/Tooltip/index.js.map +0 -1
  86. package/dist/types.js +0 -2
  87. package/dist/types.js.map +0 -1
  88. package/dist/utils/browserId.js +0 -29
  89. package/dist/utils/browserId.js.map +0 -1
@@ -26,6 +26,9 @@ export interface ButtonProps {
26
26
  iconStyle?: IconType;
27
27
  /** color of the icon if it is custom (required if iconStyle is "color") */
28
28
  iconColor?: string;
29
+ /** normally we want for Icon to prefix FontAwesome icons with the fa-sharp fa-regular prefix however there are a
30
+ * select few icons that are not pulled from that set. For those we need to pass specific prefixes instead.*/
31
+ iconPrefix?: string;
29
32
  /** id to place on the button element */
30
33
  id?: string;
31
34
  /** id that will be used in the data-testid attribute on the button element */
@@ -4,6 +4,9 @@ export type IconType = typeof iconTypes[number];
4
4
  export interface IconProps {
5
5
  /** icon class to be used (i.e. fc-zoom) */
6
6
  icon: string;
7
+ /** normally we want for Icon to prefix FontAwesome icons with the fa-sharp fa-regular prefix however there are a
8
+ * select few icons that are not pulled from that set. For those we need to pass specific prefixes instead.*/
9
+ iconPrefix?: string;
7
10
  /** icon color option (text, white, theme, color, inherit; default is "theme") */
8
11
  type?: IconType;
9
12
  /** used to add a custom color to the icon (required if type="color") */
package/dist/index.esm.js CHANGED
@@ -65,16 +65,17 @@ const colorClassesThemeDark = {
65
65
  * - access to Seeq custom icons by providing the desired icon
66
66
  * - leverage "type" to style your icon
67
67
  */
68
- const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small, color, testId, customId, tooltip, tooltipPlacement, number, isHtmlTooltip = false, tooltipTestId, tooltipDelay = 0, }) => {
68
+ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClassNames, id, large, small, color, testId, customId, tooltip, tooltipPlacement, number, isHtmlTooltip = false, tooltipTestId, tooltipDelay = 0, }) => {
69
69
  if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {
70
70
  const errorMessage = color === undefined || color === ''
71
71
  ? 'Icon with type="color" must have prop color specified.'
72
72
  : 'Icon with prop color must have type="color".';
73
73
  return React__default.createElement("div", { className: "tw-text-sq-danger-color" }, errorMessage);
74
74
  }
75
- const iconPrefix = icon.startsWith('fc') ? 'fc' : 'fa-sharp fa-regular';
75
+ const fontAwesomePrefix = iconPrefix ? iconPrefix : 'fa-sharp fa-regular';
76
+ const iconPrefixString = icon.startsWith('fc') ? 'fc' : fontAwesomePrefix;
76
77
  const style = type === 'color' && color ? { color } : {};
77
- const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
78
+ const appliedClassNames = `${iconPrefixString} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
78
79
  ${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
79
80
  const tooltipData = tooltip
80
81
  ? {
@@ -93,7 +94,7 @@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
93
94
  * - use "variant" to achieve the desired style
94
95
  * - include tooltips and/or icons
95
96
  */
96
- const Button = ({ onClick, label, variant = 'outline', type = 'button', size = 'sm', disabled, extraClassNames, id, testId, stopPropagation = true, tooltip, tooltipOptions, iconStyle = 'text', icon, iconColor, preventBlur = false, isHtmlTooltip = false, tooltipTestId, }) => {
97
+ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = 'sm', disabled, extraClassNames, id, testId, stopPropagation = true, tooltip, tooltipOptions, iconStyle = 'text', icon, iconColor, iconPrefix = undefined, preventBlur = false, isHtmlTooltip = false, tooltipTestId, }) => {
97
98
  const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';
98
99
  const baseClassesByVariant = {
99
100
  'outline': 'disabled:tw-opacity-50 tw-border-solid tw-border',
@@ -165,7 +166,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
165
166
  e.preventDefault();
166
167
  }
167
168
  }, className: appliedClasses },
168
- icon && (React__default.createElement(Icon, { icon: icon, type: iconStyle, color: iconColor, extraClassNames: label ? `tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : '', testId: `${id}_spinner` })),
169
+ icon && (React__default.createElement(Icon, { icon: icon, iconPrefix: iconPrefix, type: iconStyle, color: iconColor, extraClassNames: label ? `tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : '', testId: `${id}_spinner` })),
169
170
  label));
170
171
  };
171
172