@seeqdev/qomponents 0.0.30 → 0.0.32
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/Button/Button.js +86 -0
- package/dist/Button/Button.js.map +1 -0
- package/dist/Button/Button.stories.js +77 -0
- package/dist/Button/Button.stories.js.map +1 -0
- package/dist/Button/Button.test.js +49 -0
- package/dist/Button/Button.test.js.map +1 -0
- package/dist/Button/Button.types.js +4 -0
- package/dist/Button/Button.types.js.map +1 -0
- package/dist/Button/index.js +2 -0
- package/dist/Button/index.js.map +1 -0
- package/dist/Checkbox/Checkbox.js +24 -0
- package/dist/Checkbox/Checkbox.js.map +1 -0
- package/dist/Checkbox/Checkbox.stories.js +32 -0
- package/dist/Checkbox/Checkbox.stories.js.map +1 -0
- package/dist/Checkbox/Checkbox.test.js +94 -0
- package/dist/Checkbox/Checkbox.test.js.map +1 -0
- package/dist/Checkbox/Checkbox.types.js +2 -0
- package/dist/Checkbox/Checkbox.types.js.map +1 -0
- package/dist/Checkbox/index.js +2 -0
- package/dist/Checkbox/index.js.map +1 -0
- package/dist/Icon/Icon.js +62 -0
- package/dist/Icon/Icon.js.map +1 -0
- package/dist/Icon/Icon.stories.js +40 -0
- package/dist/Icon/Icon.stories.js.map +1 -0
- package/dist/Icon/Icon.test.js +55 -0
- package/dist/Icon/Icon.test.js.map +1 -0
- package/dist/Icon/Icon.types.js +16 -0
- package/dist/Icon/Icon.types.js.map +1 -0
- package/dist/Icon/index.js +2 -0
- package/dist/Icon/index.js.map +1 -0
- package/dist/Select/Select.js +168 -0
- package/dist/Select/Select.js.map +1 -0
- package/dist/Select/Select.stories.js +72 -0
- package/dist/Select/Select.stories.js.map +1 -0
- package/dist/Select/Select.test.js +161 -0
- package/dist/Select/Select.test.js.map +1 -0
- package/dist/Select/Select.types.js +2 -0
- package/dist/Select/Select.types.js.map +1 -0
- package/dist/Select/index.js +2 -0
- package/dist/Select/index.js.map +1 -0
- package/dist/TextArea/TextArea.js +23 -0
- package/dist/TextArea/TextArea.js.map +1 -0
- package/dist/TextArea/TextArea.stories.js +39 -0
- package/dist/TextArea/TextArea.stories.js.map +1 -0
- package/dist/TextArea/TextArea.test.js +68 -0
- package/dist/TextArea/TextArea.test.js.map +1 -0
- package/dist/TextArea/TextArea.types.js +2 -0
- package/dist/TextArea/TextArea.types.js.map +1 -0
- package/dist/TextArea/index.js +2 -0
- package/dist/TextArea/index.js.map +1 -0
- package/dist/TextField/TextField.js +64 -0
- package/dist/TextField/TextField.js.map +1 -0
- package/dist/TextField/TextField.stories.js +41 -0
- package/dist/TextField/TextField.stories.js.map +1 -0
- package/dist/TextField/TextField.test.js +35 -0
- package/dist/TextField/TextField.test.js.map +1 -0
- package/dist/TextField/TextField.types.js +2 -0
- package/dist/TextField/TextField.types.js.map +1 -0
- package/dist/TextField/index.js +2 -0
- package/dist/TextField/index.js.map +1 -0
- package/dist/Tooltip/QTip.stories.js +40 -0
- package/dist/Tooltip/QTip.stories.js.map +1 -0
- package/dist/Tooltip/QTip.types.js +2 -0
- package/dist/Tooltip/QTip.types.js.map +1 -0
- package/dist/Tooltip/QTipPerformance.stories.js +30 -0
- package/dist/Tooltip/QTipPerformance.stories.js.map +1 -0
- package/dist/Tooltip/Qtip.d.ts +2 -1
- package/dist/Tooltip/Qtip.js +146 -0
- package/dist/Tooltip/Qtip.js.map +1 -0
- package/dist/Tooltip/Tooltip.js +36 -0
- package/dist/Tooltip/Tooltip.js.map +1 -0
- package/dist/Tooltip/Tooltip.stories.js +32 -0
- package/dist/Tooltip/Tooltip.stories.js.map +1 -0
- package/dist/Tooltip/Tooltip.types.js +3 -0
- package/dist/Tooltip/Tooltip.types.js.map +1 -0
- package/dist/Tooltip/TooltipPerformance.stories.js +30 -0
- package/dist/Tooltip/TooltipPerformance.stories.js.map +1 -0
- package/dist/Tooltip/index.js +3 -0
- package/dist/Tooltip/index.js.map +1 -0
- package/dist/index.esm.js +8 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/styles.css +5 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/browserId.js +29 -0
- package/dist/utils/browserId.js.map +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -30,6 +30,8 @@ const browserName = browserId && browserId.split(' ', 2)[0];
|
|
|
30
30
|
browserId && parseInt(browserId.split(' ', 2)[1], 10);
|
|
31
31
|
const browserIsFirefox = browserId && browserName === 'Firefox';
|
|
32
32
|
|
|
33
|
+
const DEFAULT_TOOL_TIP_DELAY = 1000;
|
|
34
|
+
|
|
33
35
|
const colorClassesThemeLight = {
|
|
34
36
|
'theme': 'tw-text-sq-color-dark',
|
|
35
37
|
'white': 'tw-text-white',
|
|
@@ -65,7 +67,7 @@ const colorClassesThemeDark = {
|
|
|
65
67
|
* - access to Seeq custom icons by providing the desired icon
|
|
66
68
|
* - leverage "type" to style your icon
|
|
67
69
|
*/
|
|
68
|
-
const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClassNames, id, large, small, color, testId, customId, tooltip, tooltipPlacement, number, isHtmlTooltip = false, tooltipTestId, tooltipDelay =
|
|
70
|
+
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, }) => {
|
|
69
71
|
if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {
|
|
70
72
|
const errorMessage = color === undefined || color === ''
|
|
71
73
|
? 'Icon with type="color" must have prop color specified.'
|
|
@@ -155,7 +157,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
155
157
|
'data-qtip-placement': tooltipOptions?.position,
|
|
156
158
|
'data-qtip-is-html': isHtmlTooltip,
|
|
157
159
|
'data-qtip-testid': tooltipTestId,
|
|
158
|
-
'data-qtip-delay': tooltipOptions?.delay ??
|
|
160
|
+
'data-qtip-delay': tooltipOptions?.delay ?? DEFAULT_TOOL_TIP_DELAY,
|
|
159
161
|
};
|
|
160
162
|
}
|
|
161
163
|
return (React__default.createElement("button", { id: id, ...tooltipData, disabled: disabled, "data-testid": testId, type: type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type, onClick: (e) => {
|
|
@@ -238,7 +240,7 @@ const baseClasses$2 = 'tw-border-1 tw-h-3.5 tw-w-3.5 focus:tw-ring-0 focus:tw-ri
|
|
|
238
240
|
' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:hover:tw-bg-sq-dark-background' +
|
|
239
241
|
' checked:tw-text-white checked:tw-border-sq-text-color checked:hover:tw-border-sq-color-dark' +
|
|
240
242
|
' checked:active:tw-border-sq-color-dark checked:focus:tw-border-sq-color-dark disabled:tw-border-sq-disabled-gray' +
|
|
241
|
-
' dark:disabled:tw-border-sq-fairly-dark-gray';
|
|
243
|
+
' dark:disabled:tw-border-sq-fairly-dark-gray dark:checked:focus:tw-bg-sq-dark-background';
|
|
242
244
|
const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses$2}`;
|
|
243
245
|
const radioClasses = `tw-form-radio ${baseClasses$2}`;
|
|
244
246
|
/**
|
|
@@ -275,8 +277,6 @@ const TextArea = ({ readonly = false, onChange, onKeyUp, id, name, rows = 3, col
|
|
|
275
277
|
return (React__default.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 }));
|
|
276
278
|
};
|
|
277
279
|
|
|
278
|
-
const DEFAULT_TOOL_TIP_DELAY = 1000;
|
|
279
|
-
|
|
280
280
|
/**
|
|
281
281
|
* @deprecated
|
|
282
282
|
* Note: Tooltip has been replaced by QTip - a singleton JS tooltip that behaves well even with overflow settings :)
|
|
@@ -3102,7 +3102,8 @@ const HTMLTip = ({ text }) => {
|
|
|
3102
3102
|
* 'data-qtip-placement': one of TooltipPosition (top, bottom, right, or left)
|
|
3103
3103
|
* 'data-qtip-is-html': set this to true if you provided a text that contains HTML,
|
|
3104
3104
|
* 'data-qtip-delay': this can be used to delay the showing of the tooltip. this should be a number representing
|
|
3105
|
-
* the # of milliseconds you want to delay the tooltip for.
|
|
3105
|
+
* the # of milliseconds you want to delay the tooltip for. If no delay is provided the DEFAULT_TOOL_TIP_DELAY is
|
|
3106
|
+
* applied!
|
|
3106
3107
|
* 'data-qtip-testid': use this attribute to provide a value for a data-testid of your tooltip; this is useful
|
|
3107
3108
|
* for tests
|
|
3108
3109
|
*
|
|
@@ -3157,7 +3158,7 @@ const QTip = () => {
|
|
|
3157
3158
|
tooltipTarget.current = e.target?.parentElement;
|
|
3158
3159
|
}
|
|
3159
3160
|
if (text) {
|
|
3160
|
-
const delay = parseInt(dataset?.qtipDelay ?? '
|
|
3161
|
+
const delay = parseInt(dataset?.qtipDelay ?? DEFAULT_TOOL_TIP_DELAY + '');
|
|
3161
3162
|
ttTimeout.current = setTimeout(() => makeTooltip(text, dataset?.qtipPlacement, dataset?.qtipIsHtml === 'true', dataset?.qtipTestid, delay), delay);
|
|
3162
3163
|
}
|
|
3163
3164
|
};
|