@seeqdev/qomponents 0.0.27 → 0.0.29
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 +2 -2
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Button.types.d.ts +3 -0
- package/dist/Icon/Icon.js +4 -3
- package/dist/Icon/Icon.js.map +1 -1
- package/dist/Icon/Icon.types.d.ts +3 -0
- package/dist/index.esm.js +9 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/styles.css +12 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -85,16 +85,17 @@ const colorClassesThemeDark = {
|
|
|
85
85
|
* - access to Seeq custom icons by providing the desired icon
|
|
86
86
|
* - leverage "type" to style your icon
|
|
87
87
|
*/
|
|
88
|
-
const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small, color, testId, customId, tooltip, tooltipPlacement, number, isHtmlTooltip = false, tooltipTestId, tooltipDelay = 0, }) => {
|
|
88
|
+
const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClassNames, id, large, small, color, testId, customId, tooltip, tooltipPlacement, number, isHtmlTooltip = false, tooltipTestId, tooltipDelay = 0, }) => {
|
|
89
89
|
if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {
|
|
90
90
|
const errorMessage = color === undefined || color === ''
|
|
91
91
|
? 'Icon with type="color" must have prop color specified.'
|
|
92
92
|
: 'Icon with prop color must have type="color".';
|
|
93
93
|
return React.createElement("div", { className: "tw-text-sq-danger-color" }, errorMessage);
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const fontAwesomePrefix = iconPrefix ? iconPrefix : 'fa-sharp fa-regular';
|
|
96
|
+
const iconPrefixString = icon.startsWith('fc') ? 'fc' : fontAwesomePrefix;
|
|
96
97
|
const style = type === 'color' && color ? { color } : {};
|
|
97
|
-
const appliedClassNames = `${
|
|
98
|
+
const appliedClassNames = `${iconPrefixString} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
98
99
|
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
|
|
99
100
|
const tooltipData = tooltip
|
|
100
101
|
? {
|
|
@@ -113,7 +114,7 @@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
|
|
|
113
114
|
* - use "variant" to achieve the desired style
|
|
114
115
|
* - include tooltips and/or icons
|
|
115
116
|
*/
|
|
116
|
-
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, }) => {
|
|
117
|
+
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, }) => {
|
|
117
118
|
const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';
|
|
118
119
|
const baseClassesByVariant = {
|
|
119
120
|
'outline': 'disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
@@ -152,7 +153,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
152
153
|
};
|
|
153
154
|
const classesByVariantDarkTheme = {
|
|
154
155
|
'outline': 'dark:tw-border-sq-dark-disabled-gray dark:hover:tw-bg-sq-highlight-color-dark' +
|
|
155
|
-
' dark:focus:tw-bg-sq-
|
|
156
|
+
' dark:focus:tw-bg-sq-multi-gray-dark dark:active:tw-bg-sq-multi-gray-dark dark:focus:tw-border-sq-color-dark' +
|
|
156
157
|
' dark:active:tw-border-sq-color-dark',
|
|
157
158
|
'theme': 'dark:tw-bg-sq-color-dark dark:hover:tw-bg-sq-color-highlight dark:tw-border-sq-color-dark' +
|
|
158
159
|
' dark:hover:tw-border-sq-color-highlight',
|
|
@@ -185,7 +186,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
185
186
|
e.preventDefault();
|
|
186
187
|
}
|
|
187
188
|
}, className: appliedClasses },
|
|
188
|
-
icon && (React.createElement(Icon, { icon: icon, type: iconStyle, color: iconColor, extraClassNames: label ? `tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : '', testId: `${id}_spinner` })),
|
|
189
|
+
icon && (React.createElement(Icon, { icon: icon, iconPrefix: iconPrefix, type: iconStyle, color: iconColor, extraClassNames: label ? `tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : '', testId: `${id}_spinner` })),
|
|
189
190
|
label));
|
|
190
191
|
};
|
|
191
192
|
|
|
@@ -251,8 +252,8 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
251
252
|
return (React.createElement("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: readonly, autoComplete: "none", onChange: handleChange, onKeyUp: onKeyUp, step: step }));
|
|
252
253
|
});
|
|
253
254
|
|
|
254
|
-
const alignment = 'tw-flex
|
|
255
|
-
const labelClasses = 'tw-ml-1.5 tw-text-sm';
|
|
255
|
+
const alignment = 'tw-flex';
|
|
256
|
+
const labelClasses = 'tw-ml-1.5 tw-text-sm tw--mt-0.5';
|
|
256
257
|
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' +
|
|
257
258
|
' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:checked:tw-bg-sq-dark-text' +
|
|
258
259
|
' checked:tw-text-sq-text-color' +
|