@seeqdev/qomponents 0.0.29 → 0.0.31

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/index.js CHANGED
@@ -50,6 +50,8 @@ const browserName = browserId && browserId.split(' ', 2)[0];
50
50
  browserId && parseInt(browserId.split(' ', 2)[1], 10);
51
51
  const browserIsFirefox = browserId && browserName === 'Firefox';
52
52
 
53
+ const DEFAULT_TOOL_TIP_DELAY = 1000;
54
+
53
55
  const colorClassesThemeLight = {
54
56
  'theme': 'tw-text-sq-color-dark',
55
57
  'white': 'tw-text-white',
@@ -85,7 +87,7 @@ const colorClassesThemeDark = {
85
87
  * - access to Seeq custom icons by providing the desired icon
86
88
  * - leverage "type" to style your icon
87
89
  */
88
- const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClassNames, id, large, small, color, testId, customId, tooltip, tooltipPlacement, number, isHtmlTooltip = false, tooltipTestId, tooltipDelay = 0, }) => {
90
+ 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, }) => {
89
91
  if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {
90
92
  const errorMessage = color === undefined || color === ''
91
93
  ? 'Icon with type="color" must have prop color specified.'
@@ -255,9 +257,10 @@ const TextField = React.forwardRef((props, ref) => {
255
257
  const alignment = 'tw-flex';
256
258
  const labelClasses = 'tw-ml-1.5 tw-text-sm tw--mt-0.5';
257
259
  const baseClasses$2 = 'tw-border-1 tw-h-3.5 tw-w-3.5 focus:tw-ring-0 focus:tw-ring-offset-0 tw-outline-none focus:tw-outline-none' +
258
- ' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:checked:tw-bg-sq-dark-text' +
259
- ' checked:tw-text-sq-text-color' +
260
- ' disabled:tw-text-sq-fairly-dark-gray';
260
+ ' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:hover:tw-bg-sq-dark-background' +
261
+ ' checked:tw-text-white checked:tw-border-sq-text-color checked:hover:tw-border-sq-color-dark' +
262
+ ' checked:active:tw-border-sq-color-dark checked:focus:tw-border-sq-color-dark disabled:tw-border-sq-disabled-gray' +
263
+ ' dark:disabled:tw-border-sq-fairly-dark-gray dark:checked:focus:tw-bg-sq-dark-background';
261
264
  const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses$2}`;
262
265
  const radioClasses = `tw-form-radio ${baseClasses$2}`;
263
266
  /**
@@ -294,8 +297,6 @@ const TextArea = ({ readonly = false, onChange, onKeyUp, id, name, rows = 3, col
294
297
  return (React.createElement("textarea", { "data-testid": testId, name: name, id: id, value: value, className: appliedClasses, placeholder: placeholder, disabled: readonly, onChange: onChange, onKeyUp: onKeyUp, rows: rows, cols: cols, autoFocus: autofocus }));
295
298
  };
296
299
 
297
- const DEFAULT_TOOL_TIP_DELAY = 1000;
298
-
299
300
  /**
300
301
  * @deprecated
301
302
  * Note: Tooltip has been replaced by QTip - a singleton JS tooltip that behaves well even with overflow settings :)
@@ -3121,7 +3122,8 @@ const HTMLTip = ({ text }) => {
3121
3122
  * 'data-qtip-placement': one of TooltipPosition (top, bottom, right, or left)
3122
3123
  * 'data-qtip-is-html': set this to true if you provided a text that contains HTML,
3123
3124
  * 'data-qtip-delay': this can be used to delay the showing of the tooltip. this should be a number representing
3124
- * the # of milliseconds you want to delay the tooltip for.
3125
+ * the # of milliseconds you want to delay the tooltip for. If no delay is provided the DEFAULT_TOOL_TIP_DELAY is
3126
+ * applied!
3125
3127
  * 'data-qtip-testid': use this attribute to provide a value for a data-testid of your tooltip; this is useful
3126
3128
  * for tests
3127
3129
  *
@@ -3176,7 +3178,7 @@ const QTip = () => {
3176
3178
  tooltipTarget.current = e.target?.parentElement;
3177
3179
  }
3178
3180
  if (text) {
3179
- const delay = parseInt(dataset?.qtipDelay ?? '0');
3181
+ const delay = parseInt(dataset?.qtipDelay ?? DEFAULT_TOOL_TIP_DELAY + '');
3180
3182
  ttTimeout.current = setTimeout(() => makeTooltip(text, dataset?.qtipPlacement, dataset?.qtipIsHtml === 'true', dataset?.qtipTestid, delay), delay);
3181
3183
  }
3182
3184
  };