@seeqdev/qomponents 0.0.26 → 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.
- package/dist/Button/Button.types.d.ts +3 -0
- package/dist/Icon/Icon.types.d.ts +3 -0
- package/dist/index.esm.js +7 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +80 -80
- package/package.json +1 -1
- package/dist/Button/Button.js +0 -86
- package/dist/Button/Button.js.map +0 -1
- package/dist/Button/Button.stories.js +0 -77
- package/dist/Button/Button.stories.js.map +0 -1
- package/dist/Button/Button.test.js +0 -49
- package/dist/Button/Button.test.js.map +0 -1
- package/dist/Button/Button.types.js +0 -4
- package/dist/Button/Button.types.js.map +0 -1
- package/dist/Button/index.js +0 -2
- package/dist/Button/index.js.map +0 -1
- package/dist/Checkbox/Checkbox.js +0 -23
- package/dist/Checkbox/Checkbox.js.map +0 -1
- package/dist/Checkbox/Checkbox.stories.js +0 -29
- package/dist/Checkbox/Checkbox.stories.js.map +0 -1
- package/dist/Checkbox/Checkbox.test.js +0 -94
- package/dist/Checkbox/Checkbox.test.js.map +0 -1
- package/dist/Checkbox/Checkbox.types.js +0 -2
- package/dist/Checkbox/Checkbox.types.js.map +0 -1
- package/dist/Checkbox/index.js +0 -2
- package/dist/Checkbox/index.js.map +0 -1
- package/dist/Icon/Icon.js +0 -61
- package/dist/Icon/Icon.js.map +0 -1
- package/dist/Icon/Icon.stories.js +0 -40
- package/dist/Icon/Icon.stories.js.map +0 -1
- package/dist/Icon/Icon.test.js +0 -55
- package/dist/Icon/Icon.test.js.map +0 -1
- package/dist/Icon/Icon.types.js +0 -16
- package/dist/Icon/Icon.types.js.map +0 -1
- package/dist/Icon/index.js +0 -2
- package/dist/Icon/index.js.map +0 -1
- package/dist/Select/Select.js +0 -168
- package/dist/Select/Select.js.map +0 -1
- package/dist/Select/Select.stories.js +0 -72
- package/dist/Select/Select.stories.js.map +0 -1
- package/dist/Select/Select.test.js +0 -161
- package/dist/Select/Select.test.js.map +0 -1
- package/dist/Select/Select.types.js +0 -2
- package/dist/Select/Select.types.js.map +0 -1
- package/dist/Select/index.js +0 -2
- package/dist/Select/index.js.map +0 -1
- package/dist/TextArea/TextArea.js +0 -23
- package/dist/TextArea/TextArea.js.map +0 -1
- package/dist/TextArea/TextArea.stories.js +0 -39
- package/dist/TextArea/TextArea.stories.js.map +0 -1
- package/dist/TextArea/TextArea.test.js +0 -68
- package/dist/TextArea/TextArea.test.js.map +0 -1
- package/dist/TextArea/TextArea.types.js +0 -2
- package/dist/TextArea/TextArea.types.js.map +0 -1
- package/dist/TextArea/index.js +0 -2
- package/dist/TextArea/index.js.map +0 -1
- package/dist/TextField/TextField.js +0 -64
- package/dist/TextField/TextField.js.map +0 -1
- package/dist/TextField/TextField.stories.js +0 -41
- package/dist/TextField/TextField.stories.js.map +0 -1
- package/dist/TextField/TextField.test.js +0 -35
- package/dist/TextField/TextField.test.js.map +0 -1
- package/dist/TextField/TextField.types.js +0 -2
- package/dist/TextField/TextField.types.js.map +0 -1
- package/dist/TextField/index.js +0 -2
- package/dist/TextField/index.js.map +0 -1
- package/dist/Tooltip/QTip.stories.js +0 -40
- package/dist/Tooltip/QTip.stories.js.map +0 -1
- package/dist/Tooltip/QTip.types.js +0 -2
- package/dist/Tooltip/QTip.types.js.map +0 -1
- package/dist/Tooltip/QTipPerformance.stories.js +0 -30
- package/dist/Tooltip/QTipPerformance.stories.js.map +0 -1
- package/dist/Tooltip/Qtip.js +0 -146
- package/dist/Tooltip/Qtip.js.map +0 -1
- package/dist/Tooltip/Tooltip.js +0 -36
- package/dist/Tooltip/Tooltip.js.map +0 -1
- package/dist/Tooltip/Tooltip.stories.js +0 -32
- package/dist/Tooltip/Tooltip.stories.js.map +0 -1
- package/dist/Tooltip/Tooltip.types.js +0 -3
- package/dist/Tooltip/Tooltip.types.js.map +0 -1
- package/dist/Tooltip/TooltipPerformance.stories.js +0 -30
- package/dist/Tooltip/TooltipPerformance.stories.js.map +0 -1
- package/dist/Tooltip/index.js +0 -3
- package/dist/Tooltip/index.js.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils/browserId.js +0 -29
- 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
|
|
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 = `${
|
|
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
|
|
|
@@ -285,7 +286,7 @@ const DEFAULT_TOOL_TIP_DELAY = 1000;
|
|
|
285
286
|
* display correctly.
|
|
286
287
|
*/
|
|
287
288
|
const Tooltip = ({ position = 'bottom', children, text, delay = DEFAULT_TOOL_TIP_DELAY, }) => {
|
|
288
|
-
const arrowBaseClasses =
|
|
289
|
+
const arrowBaseClasses = 'before:tw-content-[\'\'] before:tw-absolute before:tw-border-8';
|
|
289
290
|
const centerArrowVertically = 'before:tw-top-1/2 before:-tw-translate-y-1/2';
|
|
290
291
|
const centerArrowHorizontally = 'before:tw-left-1/2 before:-tw-translate-x-1/2';
|
|
291
292
|
const arrowRight = `${arrowBaseClasses} ${centerArrowVertically} before:tw-right-[100%] before:tw-border-y-transparent
|