@seeqdev/qomponents 0.0.1 → 0.0.2
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/README.md +33 -13
- package/dist/Button/Button.js +35 -8
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Button.stories.js +15 -6
- package/dist/Button/Button.stories.js.map +1 -1
- package/dist/Icon/Icon.js +18 -2
- package/dist/Icon/Icon.js.map +1 -1
- package/dist/Icon/Icon.stories.js +8 -3
- package/dist/Icon/Icon.stories.js.map +1 -1
- package/dist/TextField/TextField.js +5 -3
- package/dist/TextField/TextField.js.map +1 -1
- package/dist/TextField/TextField.stories.js +15 -7
- package/dist/TextField/TextField.stories.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +59 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +59 -13
- package/dist/index.js.map +1 -1
- package/dist/styles.css +111 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,28 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- markdownlint-disable-next-line -->
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img width="150" src="https://seeq.com/sites/default/files/seeq-content/seeq-logo-blue-web-33h.svg" alt="Seeq logo">
|
|
4
|
+
</p>
|
|
5
|
+
<h1 align="center">qomponents</h1>
|
|
2
6
|
|
|
3
|
-
## Development
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
Seeq qomponents are a collection of UI components, including a Button, a TextField, an Icon, as well as a Tooltip
|
|
9
|
+
React component (more coming soon!)
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
These components are used by Seeq's application and are made publicly available for Developers who want to expand
|
|
12
|
+
the Seeq eco-system with their own plugins and add-ons without having to worry about creating a cohesive Seeq UX
|
|
13
|
+
experience. Every component comes fully styled (and with dark mode support).
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
npm run dev
|
|
11
|
-
```
|
|
15
|
+
## Installation
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
Seeq qomponents are available on npm.
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
**npm:**
|
|
16
20
|
|
|
21
|
+
```sh
|
|
22
|
+
npm install @seeqdev/qomponents
|
|
17
23
|
```
|
|
18
|
-
|
|
24
|
+
|
|
25
|
+
**yarn:**
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
yarn add @seeqdev/qomponents
|
|
19
29
|
```
|
|
20
30
|
|
|
21
|
-
|
|
31
|
+
## Getting started with Seeq qomponents
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
Here is an example of a basic app using the `Button` component:
|
|
24
34
|
|
|
25
|
-
|
|
35
|
+
```jsx
|
|
36
|
+
import * as React from 'react';
|
|
37
|
+
import {Button} from '@seeqdev/qomponents';
|
|
26
38
|
|
|
39
|
+
function App() {
|
|
40
|
+
return <Button variant="theme" label="Seeq Rocks" />;
|
|
41
|
+
}
|
|
42
|
+
```
|
|
27
43
|
|
|
44
|
+
To make sure all styles are properly applied be sure to inclue the qomponents css file in your main css file.
|
|
28
45
|
|
|
46
|
+
```css
|
|
47
|
+
@import '@seeqdev/qomponents/dist/styles.css';
|
|
48
|
+
```
|
package/dist/Button/Button.js
CHANGED
|
@@ -10,7 +10,15 @@ import Icon from '../Icon';
|
|
|
10
10
|
*/
|
|
11
11
|
const Button = ({ onClick, label, variant = 'outline', type = 'button', size = 'sm', disabled, extraClassNames, id, testId, stopPropagation = true, tooltip, tooltipOptions, iconStyle = 'text', icon, iconColor, }) => {
|
|
12
12
|
const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';
|
|
13
|
-
const
|
|
13
|
+
const baseClassesByVariant = {
|
|
14
|
+
'outline': 'tw-border-solid tw-border',
|
|
15
|
+
'theme': 'disabled:tw-bg-opacity-50',
|
|
16
|
+
'danger': 'tw-bg-sq-danger-color hover:tw-bg-sq-danger-color-hover disabled:tw-bg-opacity-50',
|
|
17
|
+
'theme-light': 'disabled:tw-bg-opacity-50',
|
|
18
|
+
'no-border': '',
|
|
19
|
+
'warning': 'tw-bg-sq-warning-color',
|
|
20
|
+
};
|
|
21
|
+
const textClassesByVariantLightTheme = {
|
|
14
22
|
'outline': 'tw-text-sq-text-color',
|
|
15
23
|
'theme': 'tw-text-white',
|
|
16
24
|
'theme-light': 'tw-text-white',
|
|
@@ -18,25 +26,44 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
18
26
|
'no-border': 'tw-text-sq-text-color',
|
|
19
27
|
'warning': 'tw-text-white',
|
|
20
28
|
};
|
|
21
|
-
const
|
|
22
|
-
'outline': '
|
|
29
|
+
const textClassesByVariantDarkTheme = {
|
|
30
|
+
'outline': 'dark:tw-text-sq-dark-text',
|
|
31
|
+
'theme': 'dark:tw-text-white',
|
|
32
|
+
'theme-light': 'dark:tw-text-white',
|
|
33
|
+
'danger': 'dark:tw-text-white',
|
|
34
|
+
'no-border': 'dark:tw-text-sq-dark-text',
|
|
35
|
+
'warning': 'dark:tw-text-white',
|
|
36
|
+
};
|
|
37
|
+
const classesByVariantLightTheme = {
|
|
38
|
+
'outline': 'tw-border-sq-disabled-gray hover:tw-bg-sq-light-gray' +
|
|
23
39
|
' focus:tw-bg-sq-dark-gray active:tw-bg-sq-dark-gray focus:tw-border-sq-color-dark active:tw-border-sq-color-dark',
|
|
24
|
-
'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight
|
|
25
|
-
'danger': '
|
|
26
|
-
'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link
|
|
40
|
+
'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight',
|
|
41
|
+
'danger': '',
|
|
42
|
+
'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link',
|
|
27
43
|
'no-border': '',
|
|
28
44
|
'warning': 'tw-bg-sq-warning-color',
|
|
29
45
|
};
|
|
46
|
+
const classesByVariantDarkTheme = {
|
|
47
|
+
'outline': 'dark:tw-border-sq-dark-disabled-gray dark:hover:tw-bg-sq-highlight-color-dark' +
|
|
48
|
+
' dark:focus:tw-bg-sq-dark-gray dark:active:tw-bg-sq-dark-gray dark:focus:tw-border-sq-color-dark' +
|
|
49
|
+
' dark:active:tw-border-sq-color-dark',
|
|
50
|
+
'theme': 'dark:tw-bg-sq-color-dark dark:hover:tw-bg-sq-color-highlight',
|
|
51
|
+
'danger': '',
|
|
52
|
+
'theme-light': 'dark:tw-bg-sq-icon-dark dark:hover:tw-bg-sq-link-dark',
|
|
53
|
+
'no-border': '',
|
|
54
|
+
'warning': '',
|
|
55
|
+
};
|
|
30
56
|
const sizeClasses = {
|
|
31
57
|
sm: 'tw-text-sm',
|
|
32
58
|
lg: 'tw-text-xl',
|
|
33
59
|
};
|
|
34
|
-
const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${
|
|
60
|
+
const appliedClasses = `${baseClasses} ${baseClassesByVariant[variant]} ${sizeClasses[size]} ${classesByVariantLightTheme[variant]} ${classesByVariantDarkTheme[variant]} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]} ${extraClassNames}`;
|
|
35
61
|
const button = (React.createElement("button", { id: id, disabled: disabled, "data-testid": testId, type: type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type, onClick: (e) => {
|
|
36
62
|
stopPropagation && e.stopPropagation();
|
|
37
63
|
onClick && onClick();
|
|
38
64
|
}, className: appliedClasses },
|
|
39
|
-
icon && (React.createElement(Icon, { icon: icon, type: iconStyle, color: iconColor, extraClassNames: label ?
|
|
65
|
+
icon && (React.createElement(Icon, { icon: icon, type: iconStyle, color: iconColor, extraClassNames: label ?
|
|
66
|
+
`tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : '', testId: `${id}_spinner` })),
|
|
40
67
|
label));
|
|
41
68
|
return tooltip ? (React.createElement(Tooltip, { text: tooltip, ...tooltipOptions }, button)) : (button);
|
|
42
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B;;;;GAIG;AACH,MAAM,MAAM,GAAyC,CAAC,EACpD,OAAO,EACP,KAAK,EACL,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,QAAQ,EACf,IAAI,GAAG,IAAI,EACX,QAAQ,EACR,eAAe,EACf,EAAE,EACF,MAAM,EACN,eAAe,GAAG,IAAI,EACtB,OAAO,EACP,cAAc,EACd,SAAS,GAAG,MAAM,EAClB,IAAI,EACJ,SAAS,GACV,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,iFAAiF,CAAC;IACtG,MAAM,oBAAoB,GAAG;QAC3B,SAAS,EAAE,uBAAuB;QAClC,OAAO,EAAE,eAAe;QACxB,aAAa,EAAE,eAAe;QAC9B,QAAQ,EAAE,eAAe;QACzB,WAAW,EAAE,uBAAuB;QACpC,SAAS,EAAE,eAAe;KAC3B,CAAC;IACF,MAAM,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B;;;;GAIG;AACH,MAAM,MAAM,GAAyC,CAAC,EACpD,OAAO,EACP,KAAK,EACL,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,QAAQ,EACf,IAAI,GAAG,IAAI,EACX,QA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
|
5
5
|
title: 'Button',
|
|
6
6
|
};
|
|
7
7
|
export const AllButtonVariants = () => {
|
|
8
|
-
const renderAllVariations = () => (React.createElement(React.Fragment, null, buttonVariants.map((variant) => (React.createElement("div", { key: `{variant_${variant}`, className: "tw-
|
|
9
|
-
React.createElement(
|
|
8
|
+
const renderAllVariations = () => (React.createElement(React.Fragment, null, buttonVariants.map((variant) => (React.createElement("div", { key: `{variant_${variant}`, className: "tw-grid tw-grid-cols-2 tw-gap-4" },
|
|
9
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
10
|
+
React.createElement(Button, { label: `Variant: ${variant}`, onClick: () => { }, variant: variant })),
|
|
11
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
12
|
+
React.createElement(Button, { label: `Variant: ${variant}`, onClick: () => { }, variant: variant })))))));
|
|
10
13
|
return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
|
|
11
14
|
React.createElement("div", { className: "color_topic" },
|
|
12
15
|
React.createElement("b", null, "Topic Colors"),
|
|
@@ -19,8 +22,11 @@ export const AllButtonVariants = () => {
|
|
|
19
22
|
renderAllVariations())));
|
|
20
23
|
};
|
|
21
24
|
export const ButtonWithTooltip = () => {
|
|
22
|
-
const renderButtonWithTooltip = () => (React.createElement(
|
|
23
|
-
React.createElement(
|
|
25
|
+
const renderButtonWithTooltip = () => (React.createElement(React.Fragment, null,
|
|
26
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
27
|
+
React.createElement(Button, { tooltip: "Helpful tooltip", variant: "theme", label: "Hover me" })),
|
|
28
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
29
|
+
React.createElement(Button, { tooltip: "Helpful tooltip", variant: "theme", label: "Hover me" }))));
|
|
24
30
|
return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
|
|
25
31
|
React.createElement("div", { className: "color_topic" },
|
|
26
32
|
React.createElement("b", null, "Topic Colors"),
|
|
@@ -33,8 +39,11 @@ export const ButtonWithTooltip = () => {
|
|
|
33
39
|
renderButtonWithTooltip())));
|
|
34
40
|
};
|
|
35
41
|
export const ButtonWithIcon = () => {
|
|
36
|
-
const renderButtonWithIcon = () => (React.createElement(
|
|
37
|
-
React.createElement(
|
|
42
|
+
const renderButtonWithIcon = () => (React.createElement(React.Fragment, null,
|
|
43
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
44
|
+
React.createElement(Button, { icon: "fc-search-power", variant: "theme", label: "With Icon" })),
|
|
45
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
46
|
+
React.createElement(Button, { icon: "fc-search-power", variant: "theme", label: "With Icon" }))));
|
|
38
47
|
return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
|
|
39
48
|
React.createElement("div", { className: "color_topic" },
|
|
40
49
|
React.createElement("b", null, "Topic Colors"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../src/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,eAAe;IACb,KAAK,EAAE,QAAQ;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC,0CACG,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC/B,6BAAK,GAAG,EAAE,YAAY,OAAO,EAAE,EAAE,SAAS,EAAC,QAAQ;
|
|
1
|
+
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../src/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO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@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
|
|
|
13
13
|
: 'Icon with prop color must have type="color".';
|
|
14
14
|
return React.createElement("div", { className: "tw-text-sq-danger-color" }, errorMessage);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const colorClassesThemeLight = {
|
|
17
17
|
'theme': 'tw-text-sq-color-dark',
|
|
18
18
|
'white': 'tw-text-white',
|
|
19
19
|
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
@@ -28,9 +28,25 @@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
|
|
|
28
28
|
'theme-light': 'tw-text-sq-color-light',
|
|
29
29
|
'success': 'tw-text-sq-success-color',
|
|
30
30
|
};
|
|
31
|
+
const colorClassesThemeDark = {
|
|
32
|
+
'theme': 'dark:tw-text-sq-color-dark-dark',
|
|
33
|
+
'white': '',
|
|
34
|
+
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
35
|
+
'warning': '',
|
|
36
|
+
'darkish-gray': 'tw-text-sq-darkish-gray',
|
|
37
|
+
'gray': 'dark:tw-text-sq-dark-disabled-gray',
|
|
38
|
+
'color': '',
|
|
39
|
+
'info': 'dark:tw-text-sq-link-dark',
|
|
40
|
+
'text': 'dark:tw-text-sq-dark-text',
|
|
41
|
+
'inherit': '',
|
|
42
|
+
'danger': 'tw-text-sq-danger-color',
|
|
43
|
+
'theme-light': 'tw-text-sq-color-light',
|
|
44
|
+
'success': 'tw-text-sq-success-color',
|
|
45
|
+
};
|
|
31
46
|
const iconPrefix = icon.startsWith('fc') ? 'fc' : 'fa';
|
|
32
47
|
const style = type === 'color' && color ? { color } : {};
|
|
33
|
-
const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
48
|
+
const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
49
|
+
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
|
|
34
50
|
const iconTag = (React.createElement("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number }));
|
|
35
51
|
return !hasExternalTooltipHandler && tooltip && tooltip !== '' ? (React.createElement(Tooltip, { text: tooltip, delay: tooltipDelay, position: tooltipPlacement }, iconTag)) : (iconTag);
|
|
36
52
|
};
|
package/dist/Icon/Icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,CAAC;AAEvB,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC;;;;GAIG;AACH,MAAM,IAAI,GAAuC,CAAC,EAChD,OAAO,EACP,IAAI,EACJ,IAAI,GAAG,OAAO,EACd,eAAe,EACf,EAAE,EACF,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,yBAAyB,GAAG,KAAK,GAClC,EAAE,EAAE;IACH,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,OAAO,CAAC,EAAE;QAC9F,MAAM,YAAY,GAChB,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;YACjC,CAAC,CAAC,wDAAwD;YAC1D,CAAC,CAAC,8CAA8C,CAAC;QACrD,OAAO,6BAAK,SAAS,EAAC,yBAAyB,IAAE,YAAY,CAAO,CAAC;KACtE;IAED,MAAM,
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,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AAC"}
|
|
@@ -15,9 +15,14 @@ export const AllIcons = () => {
|
|
|
15
15
|
"type=",
|
|
16
16
|
iconType),
|
|
17
17
|
React.createElement("br", null),
|
|
18
|
-
React.createElement(
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
React.createElement("div", null,
|
|
19
|
+
React.createElement(Icon, { icon: 'fc-announcements', small: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'purple' : undefined }),
|
|
20
|
+
React.createElement(Icon, { icon: 'fc-announcements', extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? '#928378' : undefined }),
|
|
21
|
+
React.createElement(Icon, { icon: 'fc-announcements', large: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'pink' : undefined })),
|
|
22
|
+
React.createElement("div", { className: "tw-dark tw-bg-sq-dark-background" },
|
|
23
|
+
React.createElement(Icon, { icon: 'fc-announcements', small: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'purple' : undefined }),
|
|
24
|
+
React.createElement(Icon, { icon: 'fc-announcements', extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? '#928378' : undefined }),
|
|
25
|
+
React.createElement(Icon, { icon: 'fc-announcements', large: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'pink' : undefined })),
|
|
21
26
|
React.createElement("br", null)));
|
|
22
27
|
})));
|
|
23
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.stories.js","sourceRoot":"","sources":["../../src/Icon/Icon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAe;IACb,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,mBAAmB,GAA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,iDAAsB;YACrB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -33,13 +33,15 @@ export const TextField = React.forwardRef((props, ref) => {
|
|
|
33
33
|
}
|
|
34
34
|
}, [value]);
|
|
35
35
|
const baseClasses = 'tw-height-34 tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm disabled:tw-pointer-events-none' +
|
|
36
|
-
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-
|
|
37
|
-
|
|
36
|
+
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border';
|
|
37
|
+
const darkTheme = 'dark:tw-border-sq-dark-disabled-gray dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text' +
|
|
38
|
+
' dark:focus:tw-border-sq-color-dark-dark dark:active:tw-border-sq-color-dark-dark';
|
|
39
|
+
const lightTheme = 'tw-border-sq-disabled-gray tw-text-sq-text-color focus:tw-border-sq-color-dark active:tw-border-sq-color-dark';
|
|
38
40
|
const sizeClasses = {
|
|
39
41
|
sm: 'tw-text-sm',
|
|
40
42
|
lg: 'tw-text-xl',
|
|
41
43
|
};
|
|
42
|
-
const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames}`;
|
|
44
|
+
const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames} ${lightTheme} ${darkTheme}`;
|
|
43
45
|
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 }));
|
|
44
46
|
});
|
|
45
47
|
//# sourceMappingURL=TextField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../src/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,K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ACF,CAAC"}
|
|
@@ -4,13 +4,21 @@ export default {
|
|
|
4
4
|
title: 'TextField',
|
|
5
5
|
};
|
|
6
6
|
export const AllTextFields = () => {
|
|
7
|
-
const renderAllVariations = () => (React.createElement(
|
|
8
|
-
React.createElement("div", { className: "tw-p-4" },
|
|
9
|
-
React.createElement(
|
|
10
|
-
|
|
11
|
-
React.createElement(
|
|
12
|
-
|
|
13
|
-
React.createElement(
|
|
7
|
+
const renderAllVariations = () => (React.createElement(React.Fragment, null,
|
|
8
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
9
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
10
|
+
React.createElement(TextField, { value: "value provided" })),
|
|
11
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
12
|
+
React.createElement(TextField, { placeholder: "placeholder text" })),
|
|
13
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
14
|
+
React.createElement(TextField, { value: "read-only", readonly: true }))),
|
|
15
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
16
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
17
|
+
React.createElement(TextField, { value: "value provided" })),
|
|
18
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
19
|
+
React.createElement(TextField, { placeholder: "placeholder text" })),
|
|
20
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
21
|
+
React.createElement(TextField, { value: "read-only", readonly: true })))));
|
|
14
22
|
return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
|
|
15
23
|
React.createElement("div", { className: "color_topic" },
|
|
16
24
|
React.createElement("b", null, "Topic Colors"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.stories.js","sourceRoot":"","sources":["../../src/TextField/TextField.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAe;IACb,KAA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;YAC1B,8CAAmB;YAClB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,iDAAsB;YACrB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -69,7 +69,7 @@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
|
|
|
69
69
|
: 'Icon with prop color must have type="color".';
|
|
70
70
|
return React.createElement("div", { className: "tw-text-sq-danger-color" }, errorMessage);
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const colorClassesThemeLight = {
|
|
73
73
|
'theme': 'tw-text-sq-color-dark',
|
|
74
74
|
'white': 'tw-text-white',
|
|
75
75
|
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
@@ -84,9 +84,25 @@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
|
|
|
84
84
|
'theme-light': 'tw-text-sq-color-light',
|
|
85
85
|
'success': 'tw-text-sq-success-color',
|
|
86
86
|
};
|
|
87
|
+
const colorClassesThemeDark = {
|
|
88
|
+
'theme': 'dark:tw-text-sq-color-dark-dark',
|
|
89
|
+
'white': '',
|
|
90
|
+
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
91
|
+
'warning': '',
|
|
92
|
+
'darkish-gray': 'tw-text-sq-darkish-gray',
|
|
93
|
+
'gray': 'dark:tw-text-sq-dark-disabled-gray',
|
|
94
|
+
'color': '',
|
|
95
|
+
'info': 'dark:tw-text-sq-link-dark',
|
|
96
|
+
'text': 'dark:tw-text-sq-dark-text',
|
|
97
|
+
'inherit': '',
|
|
98
|
+
'danger': 'tw-text-sq-danger-color',
|
|
99
|
+
'theme-light': 'tw-text-sq-color-light',
|
|
100
|
+
'success': 'tw-text-sq-success-color',
|
|
101
|
+
};
|
|
87
102
|
const iconPrefix = icon.startsWith('fc') ? 'fc' : 'fa';
|
|
88
103
|
const style = type === 'color' && color ? { color } : {};
|
|
89
|
-
const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
104
|
+
const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
105
|
+
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
|
|
90
106
|
const iconTag = (React.createElement("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number }));
|
|
91
107
|
return !hasExternalTooltipHandler && tooltip && tooltip !== '' ? (React.createElement(Tooltip, { text: tooltip, delay: tooltipDelay, position: tooltipPlacement }, iconTag)) : (iconTag);
|
|
92
108
|
};
|
|
@@ -98,7 +114,15 @@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
|
|
|
98
114
|
*/
|
|
99
115
|
const Button = ({ onClick, label, variant = 'outline', type = 'button', size = 'sm', disabled, extraClassNames, id, testId, stopPropagation = true, tooltip, tooltipOptions, iconStyle = 'text', icon, iconColor, }) => {
|
|
100
116
|
const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';
|
|
101
|
-
const
|
|
117
|
+
const baseClassesByVariant = {
|
|
118
|
+
'outline': 'tw-border-solid tw-border',
|
|
119
|
+
'theme': 'disabled:tw-bg-opacity-50',
|
|
120
|
+
'danger': 'tw-bg-sq-danger-color hover:tw-bg-sq-danger-color-hover disabled:tw-bg-opacity-50',
|
|
121
|
+
'theme-light': 'disabled:tw-bg-opacity-50',
|
|
122
|
+
'no-border': '',
|
|
123
|
+
'warning': 'tw-bg-sq-warning-color',
|
|
124
|
+
};
|
|
125
|
+
const textClassesByVariantLightTheme = {
|
|
102
126
|
'outline': 'tw-text-sq-text-color',
|
|
103
127
|
'theme': 'tw-text-white',
|
|
104
128
|
'theme-light': 'tw-text-white',
|
|
@@ -106,25 +130,44 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
106
130
|
'no-border': 'tw-text-sq-text-color',
|
|
107
131
|
'warning': 'tw-text-white',
|
|
108
132
|
};
|
|
109
|
-
const
|
|
110
|
-
'outline': '
|
|
133
|
+
const textClassesByVariantDarkTheme = {
|
|
134
|
+
'outline': 'dark:tw-text-sq-dark-text',
|
|
135
|
+
'theme': 'dark:tw-text-white',
|
|
136
|
+
'theme-light': 'dark:tw-text-white',
|
|
137
|
+
'danger': 'dark:tw-text-white',
|
|
138
|
+
'no-border': 'dark:tw-text-sq-dark-text',
|
|
139
|
+
'warning': 'dark:tw-text-white',
|
|
140
|
+
};
|
|
141
|
+
const classesByVariantLightTheme = {
|
|
142
|
+
'outline': 'tw-border-sq-disabled-gray hover:tw-bg-sq-light-gray' +
|
|
111
143
|
' focus:tw-bg-sq-dark-gray active:tw-bg-sq-dark-gray focus:tw-border-sq-color-dark active:tw-border-sq-color-dark',
|
|
112
|
-
'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight
|
|
113
|
-
'danger': '
|
|
114
|
-
'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link
|
|
144
|
+
'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight',
|
|
145
|
+
'danger': '',
|
|
146
|
+
'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link',
|
|
115
147
|
'no-border': '',
|
|
116
148
|
'warning': 'tw-bg-sq-warning-color',
|
|
117
149
|
};
|
|
150
|
+
const classesByVariantDarkTheme = {
|
|
151
|
+
'outline': 'dark:tw-border-sq-dark-disabled-gray dark:hover:tw-bg-sq-highlight-color-dark' +
|
|
152
|
+
' dark:focus:tw-bg-sq-dark-gray dark:active:tw-bg-sq-dark-gray dark:focus:tw-border-sq-color-dark' +
|
|
153
|
+
' dark:active:tw-border-sq-color-dark',
|
|
154
|
+
'theme': 'dark:tw-bg-sq-color-dark dark:hover:tw-bg-sq-color-highlight',
|
|
155
|
+
'danger': '',
|
|
156
|
+
'theme-light': 'dark:tw-bg-sq-icon-dark dark:hover:tw-bg-sq-link-dark',
|
|
157
|
+
'no-border': '',
|
|
158
|
+
'warning': '',
|
|
159
|
+
};
|
|
118
160
|
const sizeClasses = {
|
|
119
161
|
sm: 'tw-text-sm',
|
|
120
162
|
lg: 'tw-text-xl',
|
|
121
163
|
};
|
|
122
|
-
const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${
|
|
164
|
+
const appliedClasses = `${baseClasses} ${baseClassesByVariant[variant]} ${sizeClasses[size]} ${classesByVariantLightTheme[variant]} ${classesByVariantDarkTheme[variant]} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]} ${extraClassNames}`;
|
|
123
165
|
const button = (React.createElement("button", { id: id, disabled: disabled, "data-testid": testId, type: type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type, onClick: (e) => {
|
|
124
166
|
stopPropagation && e.stopPropagation();
|
|
125
167
|
onClick && onClick();
|
|
126
168
|
}, className: appliedClasses },
|
|
127
|
-
icon && (React.createElement(Icon, { icon: icon, type: iconStyle, color: iconColor, extraClassNames: label ?
|
|
169
|
+
icon && (React.createElement(Icon, { icon: icon, type: iconStyle, color: iconColor, extraClassNames: label ?
|
|
170
|
+
`tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : '', testId: `${id}_spinner` })),
|
|
128
171
|
label));
|
|
129
172
|
return tooltip ? (React.createElement(Tooltip, { text: tooltip, ...tooltipOptions }, button)) : (button);
|
|
130
173
|
};
|
|
@@ -162,15 +205,17 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
162
205
|
}
|
|
163
206
|
}, [value]);
|
|
164
207
|
const baseClasses = 'tw-height-34 tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm disabled:tw-pointer-events-none' +
|
|
165
|
-
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-
|
|
166
|
-
|
|
208
|
+
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border';
|
|
209
|
+
const darkTheme = 'dark:tw-border-sq-dark-disabled-gray dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text' +
|
|
210
|
+
' dark:focus:tw-border-sq-color-dark-dark dark:active:tw-border-sq-color-dark-dark';
|
|
211
|
+
const lightTheme = 'tw-border-sq-disabled-gray tw-text-sq-text-color focus:tw-border-sq-color-dark active:tw-border-sq-color-dark';
|
|
167
212
|
const sizeClasses = {
|
|
168
213
|
sm: 'tw-text-sm',
|
|
169
214
|
lg: 'tw-text-xl',
|
|
170
215
|
};
|
|
171
|
-
const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames}`;
|
|
216
|
+
const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames} ${lightTheme} ${darkTheme}`;
|
|
172
217
|
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 }));
|
|
173
218
|
});
|
|
174
219
|
|
|
175
|
-
export { Button, TextField, Tooltip };
|
|
220
|
+
export { Button, Icon, TextField, Tooltip };
|
|
176
221
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/utils/browserId.ts","../src/Tooltip/Tooltip.types.ts","../src/Tooltip/Tooltip.tsx","../src/Icon/Icon.tsx","../src/Button/Button.tsx","../src/TextField/TextField.tsx"],"sourcesContent":["/**\n * @exports the browser id (i.e., 'IE 11' 'Chrome 90')\n * @see http://stackoverflow.com/questions/2400935/browser-detection-in-javascript\n */\nexport const browserId: string = (function () {\n let tem;\n const ua = navigator.userAgent;\n let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return `IE ${tem[1] || ''}`;\n }\n\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\b(OPR|Edge?)\\/(\\d+)/);\n if (tem !== null) {\n return tem.slice(1).join(' ').replace('OPR', 'Opera').replace('Edg ', 'Edge ');\n }\n }\n\n M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) !== null) {\n M.splice(1, 1, tem[1]);\n }\n\n return M.join(' ');\n})();\nexport const browserName = browserId && browserId.split(' ', 2)[0];\nexport const browserVersion = browserId && parseInt(browserId.split(' ', 2)[1], 10);\nexport const browserIsFirefox = browserId && browserName === 'Firefox';\nexport const browserIsEdgeBeforeChromium =\n browserName && browserVersion && browserName === 'Edge' && browserVersion < 70;\n","export const DEFAULT_TOOL_TIP_DELAY = 1000;\nexport const tooltipPositions = ['top', 'left', 'right', 'bottom'] as const;\n\nexport type TooltipPosition = typeof tooltipPositions[number];\n\nexport interface TooltipProps {\n position?: TooltipPosition;\n children?: JSX.Element | string;\n text: JSX.Element | string;\n delay?: number;\n}\n","import React from 'react';\nimport '../styles.css';\nimport { DEFAULT_TOOL_TIP_DELAY, TooltipProps } from './Tooltip.types';\n\n/**\n * This component displays a Tooltip for the provided children.\n */\nexport const Tooltip: React.FunctionComponent<TooltipProps> = ({\n position = 'bottom',\n children,\n text,\n delay = DEFAULT_TOOL_TIP_DELAY,\n}) => {\n const arrowBaseClasses = \"before:tw-content-[''] before:tw-absolute before:tw-border-8\";\n const centerArrowVertically = 'before:tw-top-1/2 before:-tw-translate-y-1/2';\n const centerArrowHorizontally = 'before:tw-left-1/2 before:-tw-translate-x-1/2';\n const arrowRight = `${arrowBaseClasses} ${centerArrowVertically} before:tw-right-[100%] before:tw-border-y-transparent \n before:tw-border-l-transparent before:tw-border-r-black`;\n\n const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically} before:tw-left-[100%] before:tw-border-y-transparent\n before:tw-border-l-black before:tw-border-r-transparent`;\n\n const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-top-4 before:tw-border-b-black \n before:tw-border-r-transparent before:tw-border-l-transparent before:tw-border-t-transparent`;\n const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-bottom-4 before:tw-border-b-transparent \n before:tw-border-t-black before:tw-border-l-transparent before:tw-border-r-transparent`;\n\n const placements = {\n top: `-tw-top-2 -tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowTop}`,\n left: `-tw-translate-x-full -tw-left-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowLeft}`,\n right: `tw-translate-x-full -tw-right-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowRight}`,\n bottom: `-tw-bottom-2 tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowBottom}`,\n };\n\n return (\n <div className=\"tw-group tw-relative tw-inline-block\">\n {children}\n <div\n className={`tw-z-50 tw-whitespace-nowrap tw-hidden group-hover:tw-inline-block group-hover:tw-delay-[${delay}ms] \n tw-absolute tw-opacity-0 group-hover:tw-opacity-100 tw-rounded tw-bg-black tw-p-2 tw-text-xs tw-text-white ${placements[position]}`}>\n {text}\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport '../styles.css';\nimport { IconProps } from './Icon.types';\nimport Tooltip from '../Tooltip';\n\n/**\n * Icon:\n * - access to Seeq custom icons by providing the desired icon\n * - leverage \"type\" to style your icon\n */\nconst Icon: React.FunctionComponent<IconProps> = ({\n onClick,\n icon,\n type = 'theme',\n extraClassNames,\n id,\n large,\n small,\n color,\n testId,\n customId,\n tooltip,\n tooltipDelay,\n tooltipPlacement,\n number,\n hasExternalTooltipHandler = false,\n}) => {\n if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {\n const errorMessage =\n color === undefined || color === ''\n ? 'Icon with type=\"color\" must have prop color specified.'\n : 'Icon with prop color must have type=\"color\".';\n return <div className=\"tw-text-sq-danger-color\">{errorMessage}</div>;\n }\n\n const colorClasses = {\n 'theme': 'tw-text-sq-color-dark',\n 'white': 'tw-text-white',\n 'dark-gray': 'tw-text-sq-fairly-dark-gray',\n 'warning': 'tw-text-sq-warning-color',\n 'darkish-gray': 'tw-text-sq-darkish-gray',\n 'gray': 'tw-text-sq-disabled-gray',\n 'color': '',\n 'info': 'tw-text-sq-link',\n 'text': 'tw-text-sq-text-color',\n 'inherit': '',\n 'danger': 'tw-text-sq-danger-color',\n 'theme-light': 'tw-text-sq-color-light',\n 'success': 'tw-text-sq-success-color',\n };\n\n const iconPrefix = icon.startsWith('fc') ? 'fc' : 'fa';\n const style = type === 'color' && color ? { color } : {};\n const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''} ${\n colorClasses[type]\n } ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;\n\n const iconTag = (\n <i\n className={appliedClassNames}\n style={style}\n onClick={onClick}\n data-testid={testId}\n data-customid={customId}\n id={id}\n data-number={number}\n />\n );\n\n return !hasExternalTooltipHandler && tooltip && tooltip !== '' ? (\n <Tooltip text={tooltip} delay={tooltipDelay} position={tooltipPlacement}>\n {iconTag}\n </Tooltip>\n ) : (\n iconTag\n );\n};\nexport default Icon;\n","import React from 'react';\nimport { ButtonProps } from './Button.types';\nimport '../styles.css';\nimport { browserIsFirefox } from '../utils/browserId';\nimport Tooltip from '../Tooltip';\nimport Icon from '../Icon';\n\n/**\n * All-in-one Button:\n * - use \"variant\" to achieve the desired style\n * - include tooltips and/or icons\n */\nconst Button: React.FunctionComponent<ButtonProps> = ({\n onClick,\n label,\n variant = 'outline',\n type = 'button',\n size = 'sm',\n disabled,\n extraClassNames,\n id,\n testId,\n stopPropagation = true,\n tooltip,\n tooltipOptions,\n iconStyle = 'text',\n icon,\n iconColor,\n}) => {\n const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';\n const textClassesByVariant = {\n 'outline': 'tw-text-sq-text-color',\n 'theme': 'tw-text-white',\n 'theme-light': 'tw-text-white',\n 'danger': 'tw-text-white',\n 'no-border': 'tw-text-sq-text-color',\n 'warning': 'tw-text-white',\n };\n const classesByVariant = {\n 'outline':\n 'tw-border-sq-disabled-gray tw-border-solid tw-border hover:tw-bg-sq-light-gray' +\n ' focus:tw-bg-sq-dark-gray active:tw-bg-sq-dark-gray focus:tw-border-sq-color-dark active:tw-border-sq-color-dark',\n 'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight disabled:tw-bg-opacity-50',\n 'danger': 'tw-bg-sq-danger-color hover:tw-bg-sq-danger-color-hover disabled:tw-bg-opacity-50',\n 'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link disabled:tw-bg-opacity-50',\n 'no-border': '',\n 'warning': 'tw-bg-sq-warning-color',\n };\n const sizeClasses = {\n sm: 'tw-text-sm',\n lg: 'tw-text-xl',\n };\n const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${classesByVariant[variant]} ${textClassesByVariant[variant]} ${extraClassNames}`;\n\n const button = (\n <button\n id={id}\n disabled={disabled}\n data-testid={testId}\n type={type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type}\n onClick={(e) => {\n stopPropagation && e.stopPropagation();\n onClick && onClick();\n }}\n className={appliedClasses}>\n {icon && (\n <Icon\n icon={icon}\n type={iconStyle}\n color={iconColor}\n extraClassNames={label ? `tw-mr-1 ${textClassesByVariant[variant]}` : ''}\n testId={`${id}_spinner`}\n />\n )}\n {label}\n </button>\n );\n\n return tooltip ? (\n <Tooltip text={tooltip} {...tooltipOptions}>\n {button}\n </Tooltip>\n ) : (\n button\n );\n};\nexport default Button;\n","import React, { useEffect, useRef, useState } from 'react';\nimport { TextFieldProps } from './TextField.types';\nimport '../styles.css';\n\n/**\n * Textfield.\n */\nexport const TextField: React.FunctionComponent<TextFieldProps> = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (props, ref: any) => {\n const {\n readonly = false,\n onChange,\n onKeyUp,\n id,\n name,\n size = 'sm',\n value,\n placeholder,\n extraClassNames,\n testId,\n type = 'text',\n } = props;\n\n const internalRef = useRef<HTMLInputElement | null>(null);\n const [cursor, setCursor] = useState(null);\n\n const setAllRefs = (receivedRef: any) => {\n if (ref) ref.current = receivedRef;\n internalRef.current = receivedRef;\n };\n\n useEffect(() => {\n const input = internalRef.current! as unknown as HTMLInputElement;\n if (input) input.setSelectionRange(cursor, cursor);\n }, [ref, cursor, value]);\n\n const handleChange = (e: any) => {\n setCursor(e.target.selectionStart);\n onChange && onChange(e);\n };\n\n useEffect(() => {\n /**\n * we need to change the value only if it's different since the internal state of \"input\" will change it anyway\n * this will only be the case when the value has been changed externally via store (undo / redo)\n */\n if (value !== null && value !== undefined && value !== internalRef.current?.value && internalRef.current) {\n // we need to use this method because using the value props directly will switch the input to a \"controlled\"\n // component\n internalRef.current.value = `${value}`;\n }\n }, [value]);\n\n const baseClasses =\n 'tw-height-34 tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm disabled:tw-pointer-events-none' +\n ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-sq-disabled-gray tw-border-solid tw-border' +\n ' tw-text-sq-text-color focus:tw-border-sq-color-dark active:tw-border-sq-color-dark';\n\n const sizeClasses = {\n sm: 'tw-text-sm',\n lg: 'tw-text-xl',\n };\n\n const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames}`;\n\n return (\n <input\n ref={setAllRefs}\n data-testid={testId}\n name={name}\n id={id}\n type={type}\n value={value}\n className={appliedClasses}\n placeholder={placeholder}\n disabled={readonly}\n autoComplete=\"none\"\n onChange={handleChange}\n onKeyUp={onKeyUp}\n />\n );\n },\n);\n"],"names":[],"mappings":";;AAAA;;;AAGG;AACI,MAAM,SAAS,GAAW,CAAC,YAAA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}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/utils/browserId.ts","../src/Tooltip/Tooltip.types.ts","../src/Tooltip/Tooltip.tsx","../src/Icon/Icon.tsx","../src/Button/Button.tsx","../src/TextField/TextField.tsx"],"sourcesContent":["/**\n * @exports the browser id (i.e., 'IE 11' 'Chrome 90')\n * @see http://stackoverflow.com/questions/2400935/browser-detection-in-javascript\n */\nexport const browserId: string = (function () {\n let tem;\n const ua = navigator.userAgent;\n let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return `IE ${tem[1] || ''}`;\n }\n\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\b(OPR|Edge?)\\/(\\d+)/);\n if (tem !== null) {\n return tem.slice(1).join(' ').replace('OPR', 'Opera').replace('Edg ', 'Edge ');\n }\n }\n\n M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) !== null) {\n M.splice(1, 1, tem[1]);\n }\n\n return M.join(' ');\n})();\nexport const browserName = browserId && browserId.split(' ', 2)[0];\nexport const browserVersion = browserId && parseInt(browserId.split(' ', 2)[1], 10);\nexport const browserIsFirefox = browserId && browserName === 'Firefox';\nexport const browserIsEdgeBeforeChromium =\n browserName && browserVersion && browserName === 'Edge' && browserVersion < 70;\n","export const DEFAULT_TOOL_TIP_DELAY = 1000;\nexport const tooltipPositions = ['top', 'left', 'right', 'bottom'] as const;\n\nexport type TooltipPosition = typeof tooltipPositions[number];\n\nexport interface TooltipProps {\n position?: TooltipPosition;\n children?: JSX.Element | string;\n text: JSX.Element | string;\n delay?: number;\n}\n","import React from 'react';\nimport '../styles.css';\nimport { DEFAULT_TOOL_TIP_DELAY, TooltipProps } from './Tooltip.types';\n\n/**\n * This component displays a Tooltip for the provided children.\n */\nexport const Tooltip: React.FunctionComponent<TooltipProps> = ({\n position = 'bottom',\n children,\n text,\n delay = DEFAULT_TOOL_TIP_DELAY,\n}) => {\n const arrowBaseClasses = \"before:tw-content-[''] before:tw-absolute before:tw-border-8\";\n const centerArrowVertically = 'before:tw-top-1/2 before:-tw-translate-y-1/2';\n const centerArrowHorizontally = 'before:tw-left-1/2 before:-tw-translate-x-1/2';\n const arrowRight = `${arrowBaseClasses} ${centerArrowVertically} before:tw-right-[100%] before:tw-border-y-transparent \n before:tw-border-l-transparent before:tw-border-r-black`;\n\n const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically} before:tw-left-[100%] before:tw-border-y-transparent\n before:tw-border-l-black before:tw-border-r-transparent`;\n\n const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-top-4 before:tw-border-b-black \n before:tw-border-r-transparent before:tw-border-l-transparent before:tw-border-t-transparent`;\n const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-bottom-4 before:tw-border-b-transparent \n before:tw-border-t-black before:tw-border-l-transparent before:tw-border-r-transparent`;\n\n const placements = {\n top: `-tw-top-2 -tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowTop}`,\n left: `-tw-translate-x-full -tw-left-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowLeft}`,\n right: `tw-translate-x-full -tw-right-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowRight}`,\n bottom: `-tw-bottom-2 tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowBottom}`,\n };\n\n return (\n <div className=\"tw-group tw-relative tw-inline-block\">\n {children}\n <div\n className={`tw-z-50 tw-whitespace-nowrap tw-hidden group-hover:tw-inline-block group-hover:tw-delay-[${delay}ms] \n tw-absolute tw-opacity-0 group-hover:tw-opacity-100 tw-rounded tw-bg-black tw-p-2 tw-text-xs tw-text-white ${placements[position]}`}>\n {text}\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport '../styles.css';\nimport { IconProps } from './Icon.types';\nimport Tooltip from '../Tooltip';\n\n/**\n * Icon:\n * - access to Seeq custom icons by providing the desired icon\n * - leverage \"type\" to style your icon\n */\nconst Icon: React.FunctionComponent<IconProps> = ({\n onClick,\n icon,\n type = 'theme',\n extraClassNames,\n id,\n large,\n small,\n color,\n testId,\n customId,\n tooltip,\n tooltipDelay,\n tooltipPlacement,\n number,\n hasExternalTooltipHandler = false,\n}) => {\n if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {\n const errorMessage =\n color === undefined || color === ''\n ? 'Icon with type=\"color\" must have prop color specified.'\n : 'Icon with prop color must have type=\"color\".';\n return <div className=\"tw-text-sq-danger-color\">{errorMessage}</div>;\n }\n\n const colorClassesThemeLight = {\n 'theme': 'tw-text-sq-color-dark',\n 'white': 'tw-text-white',\n 'dark-gray': 'tw-text-sq-fairly-dark-gray',\n 'warning': 'tw-text-sq-warning-color',\n 'darkish-gray': 'tw-text-sq-darkish-gray',\n 'gray': 'tw-text-sq-disabled-gray',\n 'color': '',\n 'info': 'tw-text-sq-link',\n 'text': 'tw-text-sq-text-color',\n 'inherit': '',\n 'danger': 'tw-text-sq-danger-color',\n 'theme-light': 'tw-text-sq-color-light',\n 'success': 'tw-text-sq-success-color',\n };\n\n const colorClassesThemeDark = {\n 'theme': 'dark:tw-text-sq-color-dark-dark',\n 'white': '',\n 'dark-gray': 'tw-text-sq-fairly-dark-gray',\n 'warning': '',\n 'darkish-gray': 'tw-text-sq-darkish-gray',\n 'gray': 'dark:tw-text-sq-dark-disabled-gray',\n 'color': '',\n 'info': 'dark:tw-text-sq-link-dark',\n 'text': 'dark:tw-text-sq-dark-text',\n 'inherit': '',\n 'danger': 'tw-text-sq-danger-color',\n 'theme-light': 'tw-text-sq-color-light',\n 'success': 'tw-text-sq-success-color',\n };\n\n const iconPrefix = icon.startsWith('fc') ? 'fc' : 'fa';\n const style = type === 'color' && color ? { color } : {};\n const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''} \n ${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;\n\n const iconTag = (\n <i\n className={appliedClassNames}\n style={style}\n onClick={onClick}\n data-testid={testId}\n data-customid={customId}\n id={id}\n data-number={number}\n />\n );\n\n return !hasExternalTooltipHandler && tooltip && tooltip !== '' ? (\n <Tooltip text={tooltip} delay={tooltipDelay} position={tooltipPlacement}>\n {iconTag}\n </Tooltip>\n ) : (\n iconTag\n );\n};\nexport default Icon;\n","import React from 'react';\nimport { ButtonProps } from './Button.types';\nimport '../styles.css';\nimport { browserIsFirefox } from '../utils/browserId';\nimport Tooltip from '../Tooltip';\nimport Icon from '../Icon';\n\n/**\n * All-in-one Button:\n * - use \"variant\" to achieve the desired style\n * - include tooltips and/or icons\n */\nconst Button: React.FunctionComponent<ButtonProps> = ({\n onClick,\n label,\n variant = 'outline',\n type = 'button',\n size = 'sm',\n disabled,\n extraClassNames,\n id,\n testId,\n stopPropagation = true,\n tooltip,\n tooltipOptions,\n iconStyle = 'text',\n icon,\n iconColor,\n}) => {\n const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';\n const baseClassesByVariant = {\n 'outline':\n 'tw-border-solid tw-border',\n 'theme': 'disabled:tw-bg-opacity-50',\n 'danger': 'tw-bg-sq-danger-color hover:tw-bg-sq-danger-color-hover disabled:tw-bg-opacity-50',\n 'theme-light': 'disabled:tw-bg-opacity-50',\n 'no-border': '',\n 'warning': 'tw-bg-sq-warning-color',\n };\n const textClassesByVariantLightTheme = {\n 'outline': 'tw-text-sq-text-color',\n 'theme': 'tw-text-white',\n 'theme-light': 'tw-text-white',\n 'danger': 'tw-text-white',\n 'no-border': 'tw-text-sq-text-color',\n 'warning': 'tw-text-white',\n };\n const textClassesByVariantDarkTheme = {\n 'outline': 'dark:tw-text-sq-dark-text',\n 'theme': 'dark:tw-text-white',\n 'theme-light': 'dark:tw-text-white',\n 'danger': 'dark:tw-text-white',\n 'no-border': 'dark:tw-text-sq-dark-text',\n 'warning': 'dark:tw-text-white',\n };\n\n const classesByVariantLightTheme = {\n 'outline':\n 'tw-border-sq-disabled-gray hover:tw-bg-sq-light-gray' +\n ' focus:tw-bg-sq-dark-gray active:tw-bg-sq-dark-gray focus:tw-border-sq-color-dark active:tw-border-sq-color-dark',\n 'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight',\n 'danger': '',\n 'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link',\n 'no-border': '',\n 'warning': 'tw-bg-sq-warning-color',\n };\n\n const classesByVariantDarkTheme = {\n 'outline':\n 'dark:tw-border-sq-dark-disabled-gray dark:hover:tw-bg-sq-highlight-color-dark' +\n ' dark:focus:tw-bg-sq-dark-gray dark:active:tw-bg-sq-dark-gray dark:focus:tw-border-sq-color-dark' +\n ' dark:active:tw-border-sq-color-dark',\n 'theme': 'dark:tw-bg-sq-color-dark dark:hover:tw-bg-sq-color-highlight',\n 'danger': '',\n 'theme-light': 'dark:tw-bg-sq-icon-dark dark:hover:tw-bg-sq-link-dark',\n 'no-border': '',\n 'warning': '',\n };\n const sizeClasses = {\n sm: 'tw-text-sm',\n lg: 'tw-text-xl',\n };\n const appliedClasses = `${baseClasses} ${baseClassesByVariant[variant]} ${sizeClasses[size]} ${classesByVariantLightTheme[variant]} ${classesByVariantDarkTheme[variant]} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]} ${extraClassNames}`;\n\n const button = (\n <button\n id={id}\n disabled={disabled}\n data-testid={testId}\n type={type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type}\n onClick={(e) => {\n stopPropagation && e.stopPropagation();\n onClick && onClick();\n }}\n className={appliedClasses}>\n {icon && (\n <Icon\n icon={icon}\n type={iconStyle}\n color={iconColor}\n extraClassNames={label ?\n `tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : ''}\n testId={`${id}_spinner`}\n />\n )}\n {label}\n </button>\n );\n\n return tooltip ? (\n <Tooltip text={tooltip} {...tooltipOptions}>\n {button}\n </Tooltip>\n ) : (\n button\n );\n};\nexport default Button;\n","import React, { useEffect, useRef, useState } from 'react';\nimport { TextFieldProps } from './TextField.types';\nimport '../styles.css';\n\n/**\n * Textfield.\n */\nexport const TextField: React.FunctionComponent<TextFieldProps> = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (props, ref: any) => {\n const {\n readonly = false,\n onChange,\n onKeyUp,\n id,\n name,\n size = 'sm',\n value,\n placeholder,\n extraClassNames,\n testId,\n type = 'text',\n } = props;\n\n const internalRef = useRef<HTMLInputElement | null>(null);\n const [cursor, setCursor] = useState(null);\n\n const setAllRefs = (receivedRef: any) => {\n if (ref) ref.current = receivedRef;\n internalRef.current = receivedRef;\n };\n\n useEffect(() => {\n const input = internalRef.current! as unknown as HTMLInputElement;\n if (input) input.setSelectionRange(cursor, cursor);\n }, [ref, cursor, value]);\n\n const handleChange = (e: any) => {\n setCursor(e.target.selectionStart);\n onChange && onChange(e);\n };\n\n useEffect(() => {\n /**\n * we need to change the value only if it's different since the internal state of \"input\" will change it anyway\n * this will only be the case when the value has been changed externally via store (undo / redo)\n */\n if (value !== null && value !== undefined && value !== internalRef.current?.value && internalRef.current) {\n // we need to use this method because using the value props directly will switch the input to a \"controlled\"\n // component\n internalRef.current.value = `${value}`;\n }\n }, [value]);\n\n const baseClasses =\n 'tw-height-34 tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm disabled:tw-pointer-events-none' +\n ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border';\n\n const darkTheme = 'dark:tw-border-sq-dark-disabled-gray dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text' +\n ' dark:focus:tw-border-sq-color-dark-dark dark:active:tw-border-sq-color-dark-dark';\n const lightTheme = 'tw-border-sq-disabled-gray tw-text-sq-text-color focus:tw-border-sq-color-dark active:tw-border-sq-color-dark';\n\n const sizeClasses = {\n sm: 'tw-text-sm',\n lg: 'tw-text-xl',\n };\n\n const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames} ${lightTheme} ${darkTheme}`;\n\n return (\n <input\n ref={setAllRefs}\n data-testid={testId}\n name={name}\n id={id}\n type={type}\n value={value}\n className={appliedClasses}\n placeholder={placeholder}\n disabled={readonly}\n autoComplete=\"none\"\n onChange={handleChange}\n onKeyUp={onKeyUp}\n />\n );\n },\n);\n"],"names":[],"mappings":";;AAAA;;;AAGG;AACI,MAAM,SAAS,GAAW,CAAC,YAAA;AAChC,IAAA,IAAI,GAAG,CAAC;AACR,IAAA,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,8DAA8D,CAAC,IAAI,EAAE,CAAC;IACvF,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACzB,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;QACvC,OAAO,CAAA,GAAA,EAAM,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AAC7B,KAAA;AAED,IAAA,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;AACrB,QAAA,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACvC,IAAI,GAAG,KAAK,IAAI,EAAE;YAChB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChF,SAAA;AACF,KAAA;AAED,IAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAA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C9G,QAAA,kEAAkE,CAAC;IAErE,MAAM,SAAS,GAAG,8FAA8F;AAC9G,QAAA,mFAAmF,CAAC;IACtF,MAAM,UAAU,GAAG,+GAA+G,CAAC;AAEnI,IAAA,MAAM,WAAW,GAAG;AAClB,QAAA,EAAE,EAAE,YAAY;AAChB,QAAA,EAAE,EAAE,YAAY;KACjB,CAAC;AAEF,IAAA,MAAM,cAAc,GAAG,CAAA,EAAG,WAAW,CAAA,CAAA,EAAI,WAAW,CAAC,IAAI,CAAC,CAAA,CAAA,EAAI,eAAe,CAAI,CAAA,EAAA,UAAU,CAAI,CAAA,EAAA,SAAS,EAAE,CAAC;IAE3G,QACE,+BACE,GAAG,EAAE,UAAU,EACF,aAAA,EAAA,MAAM,EACnB,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,cAAc,EACzB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAC,MAAM,EACnB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,EAChB,CAAA,EACF;AACJ,CAAC;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
|
|
|
71
71
|
: 'Icon with prop color must have type="color".';
|
|
72
72
|
return React.createElement("div", { className: "tw-text-sq-danger-color" }, errorMessage);
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const colorClassesThemeLight = {
|
|
75
75
|
'theme': 'tw-text-sq-color-dark',
|
|
76
76
|
'white': 'tw-text-white',
|
|
77
77
|
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
@@ -86,9 +86,25 @@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
|
|
|
86
86
|
'theme-light': 'tw-text-sq-color-light',
|
|
87
87
|
'success': 'tw-text-sq-success-color',
|
|
88
88
|
};
|
|
89
|
+
const colorClassesThemeDark = {
|
|
90
|
+
'theme': 'dark:tw-text-sq-color-dark-dark',
|
|
91
|
+
'white': '',
|
|
92
|
+
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
93
|
+
'warning': '',
|
|
94
|
+
'darkish-gray': 'tw-text-sq-darkish-gray',
|
|
95
|
+
'gray': 'dark:tw-text-sq-dark-disabled-gray',
|
|
96
|
+
'color': '',
|
|
97
|
+
'info': 'dark:tw-text-sq-link-dark',
|
|
98
|
+
'text': 'dark:tw-text-sq-dark-text',
|
|
99
|
+
'inherit': '',
|
|
100
|
+
'danger': 'tw-text-sq-danger-color',
|
|
101
|
+
'theme-light': 'tw-text-sq-color-light',
|
|
102
|
+
'success': 'tw-text-sq-success-color',
|
|
103
|
+
};
|
|
89
104
|
const iconPrefix = icon.startsWith('fc') ? 'fc' : 'fa';
|
|
90
105
|
const style = type === 'color' && color ? { color } : {};
|
|
91
|
-
const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
106
|
+
const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
|
|
107
|
+
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
|
|
92
108
|
const iconTag = (React.createElement("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number }));
|
|
93
109
|
return !hasExternalTooltipHandler && tooltip && tooltip !== '' ? (React.createElement(Tooltip, { text: tooltip, delay: tooltipDelay, position: tooltipPlacement }, iconTag)) : (iconTag);
|
|
94
110
|
};
|
|
@@ -100,7 +116,15 @@ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small
|
|
|
100
116
|
*/
|
|
101
117
|
const Button = ({ onClick, label, variant = 'outline', type = 'button', size = 'sm', disabled, extraClassNames, id, testId, stopPropagation = true, tooltip, tooltipOptions, iconStyle = 'text', icon, iconColor, }) => {
|
|
102
118
|
const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';
|
|
103
|
-
const
|
|
119
|
+
const baseClassesByVariant = {
|
|
120
|
+
'outline': 'tw-border-solid tw-border',
|
|
121
|
+
'theme': 'disabled:tw-bg-opacity-50',
|
|
122
|
+
'danger': 'tw-bg-sq-danger-color hover:tw-bg-sq-danger-color-hover disabled:tw-bg-opacity-50',
|
|
123
|
+
'theme-light': 'disabled:tw-bg-opacity-50',
|
|
124
|
+
'no-border': '',
|
|
125
|
+
'warning': 'tw-bg-sq-warning-color',
|
|
126
|
+
};
|
|
127
|
+
const textClassesByVariantLightTheme = {
|
|
104
128
|
'outline': 'tw-text-sq-text-color',
|
|
105
129
|
'theme': 'tw-text-white',
|
|
106
130
|
'theme-light': 'tw-text-white',
|
|
@@ -108,25 +132,44 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
108
132
|
'no-border': 'tw-text-sq-text-color',
|
|
109
133
|
'warning': 'tw-text-white',
|
|
110
134
|
};
|
|
111
|
-
const
|
|
112
|
-
'outline': '
|
|
135
|
+
const textClassesByVariantDarkTheme = {
|
|
136
|
+
'outline': 'dark:tw-text-sq-dark-text',
|
|
137
|
+
'theme': 'dark:tw-text-white',
|
|
138
|
+
'theme-light': 'dark:tw-text-white',
|
|
139
|
+
'danger': 'dark:tw-text-white',
|
|
140
|
+
'no-border': 'dark:tw-text-sq-dark-text',
|
|
141
|
+
'warning': 'dark:tw-text-white',
|
|
142
|
+
};
|
|
143
|
+
const classesByVariantLightTheme = {
|
|
144
|
+
'outline': 'tw-border-sq-disabled-gray hover:tw-bg-sq-light-gray' +
|
|
113
145
|
' focus:tw-bg-sq-dark-gray active:tw-bg-sq-dark-gray focus:tw-border-sq-color-dark active:tw-border-sq-color-dark',
|
|
114
|
-
'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight
|
|
115
|
-
'danger': '
|
|
116
|
-
'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link
|
|
146
|
+
'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight',
|
|
147
|
+
'danger': '',
|
|
148
|
+
'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link',
|
|
117
149
|
'no-border': '',
|
|
118
150
|
'warning': 'tw-bg-sq-warning-color',
|
|
119
151
|
};
|
|
152
|
+
const classesByVariantDarkTheme = {
|
|
153
|
+
'outline': 'dark:tw-border-sq-dark-disabled-gray dark:hover:tw-bg-sq-highlight-color-dark' +
|
|
154
|
+
' dark:focus:tw-bg-sq-dark-gray dark:active:tw-bg-sq-dark-gray dark:focus:tw-border-sq-color-dark' +
|
|
155
|
+
' dark:active:tw-border-sq-color-dark',
|
|
156
|
+
'theme': 'dark:tw-bg-sq-color-dark dark:hover:tw-bg-sq-color-highlight',
|
|
157
|
+
'danger': '',
|
|
158
|
+
'theme-light': 'dark:tw-bg-sq-icon-dark dark:hover:tw-bg-sq-link-dark',
|
|
159
|
+
'no-border': '',
|
|
160
|
+
'warning': '',
|
|
161
|
+
};
|
|
120
162
|
const sizeClasses = {
|
|
121
163
|
sm: 'tw-text-sm',
|
|
122
164
|
lg: 'tw-text-xl',
|
|
123
165
|
};
|
|
124
|
-
const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${
|
|
166
|
+
const appliedClasses = `${baseClasses} ${baseClassesByVariant[variant]} ${sizeClasses[size]} ${classesByVariantLightTheme[variant]} ${classesByVariantDarkTheme[variant]} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]} ${extraClassNames}`;
|
|
125
167
|
const button = (React.createElement("button", { id: id, disabled: disabled, "data-testid": testId, type: type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type, onClick: (e) => {
|
|
126
168
|
stopPropagation && e.stopPropagation();
|
|
127
169
|
onClick && onClick();
|
|
128
170
|
}, className: appliedClasses },
|
|
129
|
-
icon && (React.createElement(Icon, { icon: icon, type: iconStyle, color: iconColor, extraClassNames: label ?
|
|
171
|
+
icon && (React.createElement(Icon, { icon: icon, type: iconStyle, color: iconColor, extraClassNames: label ?
|
|
172
|
+
`tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : '', testId: `${id}_spinner` })),
|
|
130
173
|
label));
|
|
131
174
|
return tooltip ? (React.createElement(Tooltip, { text: tooltip, ...tooltipOptions }, button)) : (button);
|
|
132
175
|
};
|
|
@@ -164,17 +207,20 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
164
207
|
}
|
|
165
208
|
}, [value]);
|
|
166
209
|
const baseClasses = 'tw-height-34 tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm disabled:tw-pointer-events-none' +
|
|
167
|
-
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-
|
|
168
|
-
|
|
210
|
+
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border';
|
|
211
|
+
const darkTheme = 'dark:tw-border-sq-dark-disabled-gray dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text' +
|
|
212
|
+
' dark:focus:tw-border-sq-color-dark-dark dark:active:tw-border-sq-color-dark-dark';
|
|
213
|
+
const lightTheme = 'tw-border-sq-disabled-gray tw-text-sq-text-color focus:tw-border-sq-color-dark active:tw-border-sq-color-dark';
|
|
169
214
|
const sizeClasses = {
|
|
170
215
|
sm: 'tw-text-sm',
|
|
171
216
|
lg: 'tw-text-xl',
|
|
172
217
|
};
|
|
173
|
-
const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames}`;
|
|
218
|
+
const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames} ${lightTheme} ${darkTheme}`;
|
|
174
219
|
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 }));
|
|
175
220
|
});
|
|
176
221
|
|
|
177
222
|
exports.Button = Button;
|
|
223
|
+
exports.Icon = Icon;
|
|
178
224
|
exports.TextField = TextField;
|
|
179
225
|
exports.Tooltip = Tooltip;
|
|
180
226
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/utils/browserId.ts","../src/Tooltip/Tooltip.types.ts","../src/Tooltip/Tooltip.tsx","../src/Icon/Icon.tsx","../src/Button/Button.tsx","../src/TextField/TextField.tsx"],"sourcesContent":["/**\n * @exports the browser id (i.e., 'IE 11' 'Chrome 90')\n * @see http://stackoverflow.com/questions/2400935/browser-detection-in-javascript\n */\nexport const browserId: string = (function () {\n let tem;\n const ua = navigator.userAgent;\n let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return `IE ${tem[1] || ''}`;\n }\n\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\b(OPR|Edge?)\\/(\\d+)/);\n if (tem !== null) {\n return tem.slice(1).join(' ').replace('OPR', 'Opera').replace('Edg ', 'Edge ');\n }\n }\n\n M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) !== null) {\n M.splice(1, 1, tem[1]);\n }\n\n return M.join(' ');\n})();\nexport const browserName = browserId && browserId.split(' ', 2)[0];\nexport const browserVersion = browserId && parseInt(browserId.split(' ', 2)[1], 10);\nexport const browserIsFirefox = browserId && browserName === 'Firefox';\nexport const browserIsEdgeBeforeChromium =\n browserName && browserVersion && browserName === 'Edge' && browserVersion < 70;\n","export const DEFAULT_TOOL_TIP_DELAY = 1000;\nexport const tooltipPositions = ['top', 'left', 'right', 'bottom'] as const;\n\nexport type TooltipPosition = typeof tooltipPositions[number];\n\nexport interface TooltipProps {\n position?: TooltipPosition;\n children?: JSX.Element | string;\n text: JSX.Element | string;\n delay?: number;\n}\n","import React from 'react';\nimport '../styles.css';\nimport { DEFAULT_TOOL_TIP_DELAY, TooltipProps } from './Tooltip.types';\n\n/**\n * This component displays a Tooltip for the provided children.\n */\nexport const Tooltip: React.FunctionComponent<TooltipProps> = ({\n position = 'bottom',\n children,\n text,\n delay = DEFAULT_TOOL_TIP_DELAY,\n}) => {\n const arrowBaseClasses = \"before:tw-content-[''] before:tw-absolute before:tw-border-8\";\n const centerArrowVertically = 'before:tw-top-1/2 before:-tw-translate-y-1/2';\n const centerArrowHorizontally = 'before:tw-left-1/2 before:-tw-translate-x-1/2';\n const arrowRight = `${arrowBaseClasses} ${centerArrowVertically} before:tw-right-[100%] before:tw-border-y-transparent \n before:tw-border-l-transparent before:tw-border-r-black`;\n\n const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically} before:tw-left-[100%] before:tw-border-y-transparent\n before:tw-border-l-black before:tw-border-r-transparent`;\n\n const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-top-4 before:tw-border-b-black \n before:tw-border-r-transparent before:tw-border-l-transparent before:tw-border-t-transparent`;\n const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-bottom-4 before:tw-border-b-transparent \n before:tw-border-t-black before:tw-border-l-transparent before:tw-border-r-transparent`;\n\n const placements = {\n top: `-tw-top-2 -tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowTop}`,\n left: `-tw-translate-x-full -tw-left-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowLeft}`,\n right: `tw-translate-x-full -tw-right-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowRight}`,\n bottom: `-tw-bottom-2 tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowBottom}`,\n };\n\n return (\n <div className=\"tw-group tw-relative tw-inline-block\">\n {children}\n <div\n className={`tw-z-50 tw-whitespace-nowrap tw-hidden group-hover:tw-inline-block group-hover:tw-delay-[${delay}ms] \n tw-absolute tw-opacity-0 group-hover:tw-opacity-100 tw-rounded tw-bg-black tw-p-2 tw-text-xs tw-text-white ${placements[position]}`}>\n {text}\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport '../styles.css';\nimport { IconProps } from './Icon.types';\nimport Tooltip from '../Tooltip';\n\n/**\n * Icon:\n * - access to Seeq custom icons by providing the desired icon\n * - leverage \"type\" to style your icon\n */\nconst Icon: React.FunctionComponent<IconProps> = ({\n onClick,\n icon,\n type = 'theme',\n extraClassNames,\n id,\n large,\n small,\n color,\n testId,\n customId,\n tooltip,\n tooltipDelay,\n tooltipPlacement,\n number,\n hasExternalTooltipHandler = false,\n}) => {\n if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {\n const errorMessage =\n color === undefined || color === ''\n ? 'Icon with type=\"color\" must have prop color specified.'\n : 'Icon with prop color must have type=\"color\".';\n return <div className=\"tw-text-sq-danger-color\">{errorMessage}</div>;\n }\n\n const colorClasses = {\n 'theme': 'tw-text-sq-color-dark',\n 'white': 'tw-text-white',\n 'dark-gray': 'tw-text-sq-fairly-dark-gray',\n 'warning': 'tw-text-sq-warning-color',\n 'darkish-gray': 'tw-text-sq-darkish-gray',\n 'gray': 'tw-text-sq-disabled-gray',\n 'color': '',\n 'info': 'tw-text-sq-link',\n 'text': 'tw-text-sq-text-color',\n 'inherit': '',\n 'danger': 'tw-text-sq-danger-color',\n 'theme-light': 'tw-text-sq-color-light',\n 'success': 'tw-text-sq-success-color',\n };\n\n const iconPrefix = icon.startsWith('fc') ? 'fc' : 'fa';\n const style = type === 'color' && color ? { color } : {};\n const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''} ${\n colorClasses[type]\n } ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;\n\n const iconTag = (\n <i\n className={appliedClassNames}\n style={style}\n onClick={onClick}\n data-testid={testId}\n data-customid={customId}\n id={id}\n data-number={number}\n />\n );\n\n return !hasExternalTooltipHandler && tooltip && tooltip !== '' ? (\n <Tooltip text={tooltip} delay={tooltipDelay} position={tooltipPlacement}>\n {iconTag}\n </Tooltip>\n ) : (\n iconTag\n );\n};\nexport default Icon;\n","import React from 'react';\nimport { ButtonProps } from './Button.types';\nimport '../styles.css';\nimport { browserIsFirefox } from '../utils/browserId';\nimport Tooltip from '../Tooltip';\nimport Icon from '../Icon';\n\n/**\n * All-in-one Button:\n * - use \"variant\" to achieve the desired style\n * - include tooltips and/or icons\n */\nconst Button: React.FunctionComponent<ButtonProps> = ({\n onClick,\n label,\n variant = 'outline',\n type = 'button',\n size = 'sm',\n disabled,\n extraClassNames,\n id,\n testId,\n stopPropagation = true,\n tooltip,\n tooltipOptions,\n iconStyle = 'text',\n icon,\n iconColor,\n}) => {\n const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';\n const textClassesByVariant = {\n 'outline': 'tw-text-sq-text-color',\n 'theme': 'tw-text-white',\n 'theme-light': 'tw-text-white',\n 'danger': 'tw-text-white',\n 'no-border': 'tw-text-sq-text-color',\n 'warning': 'tw-text-white',\n };\n const classesByVariant = {\n 'outline':\n 'tw-border-sq-disabled-gray tw-border-solid tw-border hover:tw-bg-sq-light-gray' +\n ' focus:tw-bg-sq-dark-gray active:tw-bg-sq-dark-gray focus:tw-border-sq-color-dark active:tw-border-sq-color-dark',\n 'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight disabled:tw-bg-opacity-50',\n 'danger': 'tw-bg-sq-danger-color hover:tw-bg-sq-danger-color-hover disabled:tw-bg-opacity-50',\n 'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link disabled:tw-bg-opacity-50',\n 'no-border': '',\n 'warning': 'tw-bg-sq-warning-color',\n };\n const sizeClasses = {\n sm: 'tw-text-sm',\n lg: 'tw-text-xl',\n };\n const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${classesByVariant[variant]} ${textClassesByVariant[variant]} ${extraClassNames}`;\n\n const button = (\n <button\n id={id}\n disabled={disabled}\n data-testid={testId}\n type={type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type}\n onClick={(e) => {\n stopPropagation && e.stopPropagation();\n onClick && onClick();\n }}\n className={appliedClasses}>\n {icon && (\n <Icon\n icon={icon}\n type={iconStyle}\n color={iconColor}\n extraClassNames={label ? `tw-mr-1 ${textClassesByVariant[variant]}` : ''}\n testId={`${id}_spinner`}\n />\n )}\n {label}\n </button>\n );\n\n return tooltip ? (\n <Tooltip text={tooltip} {...tooltipOptions}>\n {button}\n </Tooltip>\n ) : (\n button\n );\n};\nexport default Button;\n","import React, { useEffect, useRef, useState } from 'react';\nimport { TextFieldProps } from './TextField.types';\nimport '../styles.css';\n\n/**\n * Textfield.\n */\nexport const TextField: React.FunctionComponent<TextFieldProps> = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (props, ref: any) => {\n const {\n readonly = false,\n onChange,\n onKeyUp,\n id,\n name,\n size = 'sm',\n value,\n placeholder,\n extraClassNames,\n testId,\n type = 'text',\n } = props;\n\n const internalRef = useRef<HTMLInputElement | null>(null);\n const [cursor, setCursor] = useState(null);\n\n const setAllRefs = (receivedRef: any) => {\n if (ref) ref.current = receivedRef;\n internalRef.current = receivedRef;\n };\n\n useEffect(() => {\n const input = internalRef.current! as unknown as HTMLInputElement;\n if (input) input.setSelectionRange(cursor, cursor);\n }, [ref, cursor, value]);\n\n const handleChange = (e: any) => {\n setCursor(e.target.selectionStart);\n onChange && onChange(e);\n };\n\n useEffect(() => {\n /**\n * we need to change the value only if it's different since the internal state of \"input\" will change it anyway\n * this will only be the case when the value has been changed externally via store (undo / redo)\n */\n if (value !== null && value !== undefined && value !== internalRef.current?.value && internalRef.current) {\n // we need to use this method because using the value props directly will switch the input to a \"controlled\"\n // component\n internalRef.current.value = `${value}`;\n }\n }, [value]);\n\n const baseClasses =\n 'tw-height-34 tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm disabled:tw-pointer-events-none' +\n ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-sq-disabled-gray tw-border-solid tw-border' +\n ' tw-text-sq-text-color focus:tw-border-sq-color-dark active:tw-border-sq-color-dark';\n\n const sizeClasses = {\n sm: 'tw-text-sm',\n lg: 'tw-text-xl',\n };\n\n const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames}`;\n\n return (\n <input\n ref={setAllRefs}\n data-testid={testId}\n name={name}\n id={id}\n type={type}\n value={value}\n className={appliedClasses}\n placeholder={placeholder}\n disabled={readonly}\n autoComplete=\"none\"\n onChange={handleChange}\n onKeyUp={onKeyUp}\n />\n );\n },\n);\n"],"names":["useRef","useState","useEffect"],"mappings":";;;;AAAA;;;AAGG;AACI,MAAM,SAAS,GAAW,CAAC,YAAA;AAChC,IAAA,IAAI,GAAG,CAAC;AACR,IAAA,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,8DAA8D,CAAC,IAAI,EAAE,CAAC;IACvF,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACzB,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;QACvC,OAAO,CAAA,GAAA,EAAM,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AAC7B,KAAA;AAED,IAAA,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;AACrB,QAAA,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACvC,IAAI,GAAG,KAAK,IAAI,EAAE;YAChB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,OAAO,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ClB,QAAA,EAAE,EAAE,YAAY;AAChB,QAAA,EAAE,EAAE,YAAY;KACjB,CAAC;AAEF,IAAA,MAAM,cAAc,GAAG,CAAG,EAAA,WAAW,CAAI,CAAA,EAAA,WAAW,CAAC,IAAI,CAAC,CAAA,CAAA,EAAI,eAAe,CAAA,CAAE,CAAC;IAEhF,QACE,+BACE,GAAG,EAAE,UAAU,EACF,aAAA,EAAA,MAAM,EACnB,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,cAAc,EACzB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAC,MAAM,EACnB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,EAChB,CAAA,EACF;AACJ,CAAC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/browserId.ts","../src/Tooltip/Tooltip.types.ts","../src/Tooltip/Tooltip.tsx","../src/Icon/Icon.tsx","../src/Button/Button.tsx","../src/TextField/TextField.tsx"],"sourcesContent":["/**\n * @exports the browser id (i.e., 'IE 11' 'Chrome 90')\n * @see http://stackoverflow.com/questions/2400935/browser-detection-in-javascript\n */\nexport const browserId: string = (function () {\n let tem;\n const ua = navigator.userAgent;\n let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return `IE ${tem[1] || ''}`;\n }\n\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\b(OPR|Edge?)\\/(\\d+)/);\n if (tem !== null) {\n return tem.slice(1).join(' ').replace('OPR', 'Opera').replace('Edg ', 'Edge ');\n }\n }\n\n M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) !== null) {\n M.splice(1, 1, tem[1]);\n }\n\n return M.join(' ');\n})();\nexport const browserName = browserId && browserId.split(' ', 2)[0];\nexport const browserVersion = browserId && parseInt(browserId.split(' ', 2)[1], 10);\nexport const browserIsFirefox = browserId && browserName === 'Firefox';\nexport const browserIsEdgeBeforeChromium =\n browserName && browserVersion && browserName === 'Edge' && browserVersion < 70;\n","export const DEFAULT_TOOL_TIP_DELAY = 1000;\nexport const tooltipPositions = ['top', 'left', 'right', 'bottom'] as const;\n\nexport type TooltipPosition = typeof tooltipPositions[number];\n\nexport interface TooltipProps {\n position?: TooltipPosition;\n children?: JSX.Element | string;\n text: JSX.Element | string;\n delay?: number;\n}\n","import React from 'react';\nimport '../styles.css';\nimport { DEFAULT_TOOL_TIP_DELAY, TooltipProps } from './Tooltip.types';\n\n/**\n * This component displays a Tooltip for the provided children.\n */\nexport const Tooltip: React.FunctionComponent<TooltipProps> = ({\n position = 'bottom',\n children,\n text,\n delay = DEFAULT_TOOL_TIP_DELAY,\n}) => {\n const arrowBaseClasses = \"before:tw-content-[''] before:tw-absolute before:tw-border-8\";\n const centerArrowVertically = 'before:tw-top-1/2 before:-tw-translate-y-1/2';\n const centerArrowHorizontally = 'before:tw-left-1/2 before:-tw-translate-x-1/2';\n const arrowRight = `${arrowBaseClasses} ${centerArrowVertically} before:tw-right-[100%] before:tw-border-y-transparent \n before:tw-border-l-transparent before:tw-border-r-black`;\n\n const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically} before:tw-left-[100%] before:tw-border-y-transparent\n before:tw-border-l-black before:tw-border-r-transparent`;\n\n const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-top-4 before:tw-border-b-black \n before:tw-border-r-transparent before:tw-border-l-transparent before:tw-border-t-transparent`;\n const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-bottom-4 before:tw-border-b-transparent \n before:tw-border-t-black before:tw-border-l-transparent before:tw-border-r-transparent`;\n\n const placements = {\n top: `-tw-top-2 -tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowTop}`,\n left: `-tw-translate-x-full -tw-left-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowLeft}`,\n right: `tw-translate-x-full -tw-right-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowRight}`,\n bottom: `-tw-bottom-2 tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowBottom}`,\n };\n\n return (\n <div className=\"tw-group tw-relative tw-inline-block\">\n {children}\n <div\n className={`tw-z-50 tw-whitespace-nowrap tw-hidden group-hover:tw-inline-block group-hover:tw-delay-[${delay}ms] \n tw-absolute tw-opacity-0 group-hover:tw-opacity-100 tw-rounded tw-bg-black tw-p-2 tw-text-xs tw-text-white ${placements[position]}`}>\n {text}\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport '../styles.css';\nimport { IconProps } from './Icon.types';\nimport Tooltip from '../Tooltip';\n\n/**\n * Icon:\n * - access to Seeq custom icons by providing the desired icon\n * - leverage \"type\" to style your icon\n */\nconst Icon: React.FunctionComponent<IconProps> = ({\n onClick,\n icon,\n type = 'theme',\n extraClassNames,\n id,\n large,\n small,\n color,\n testId,\n customId,\n tooltip,\n tooltipDelay,\n tooltipPlacement,\n number,\n hasExternalTooltipHandler = false,\n}) => {\n if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {\n const errorMessage =\n color === undefined || color === ''\n ? 'Icon with type=\"color\" must have prop color specified.'\n : 'Icon with prop color must have type=\"color\".';\n return <div className=\"tw-text-sq-danger-color\">{errorMessage}</div>;\n }\n\n const colorClassesThemeLight = {\n 'theme': 'tw-text-sq-color-dark',\n 'white': 'tw-text-white',\n 'dark-gray': 'tw-text-sq-fairly-dark-gray',\n 'warning': 'tw-text-sq-warning-color',\n 'darkish-gray': 'tw-text-sq-darkish-gray',\n 'gray': 'tw-text-sq-disabled-gray',\n 'color': '',\n 'info': 'tw-text-sq-link',\n 'text': 'tw-text-sq-text-color',\n 'inherit': '',\n 'danger': 'tw-text-sq-danger-color',\n 'theme-light': 'tw-text-sq-color-light',\n 'success': 'tw-text-sq-success-color',\n };\n\n const colorClassesThemeDark = {\n 'theme': 'dark:tw-text-sq-color-dark-dark',\n 'white': '',\n 'dark-gray': 'tw-text-sq-fairly-dark-gray',\n 'warning': '',\n 'darkish-gray': 'tw-text-sq-darkish-gray',\n 'gray': 'dark:tw-text-sq-dark-disabled-gray',\n 'color': '',\n 'info': 'dark:tw-text-sq-link-dark',\n 'text': 'dark:tw-text-sq-dark-text',\n 'inherit': '',\n 'danger': 'tw-text-sq-danger-color',\n 'theme-light': 'tw-text-sq-color-light',\n 'success': 'tw-text-sq-success-color',\n };\n\n const iconPrefix = icon.startsWith('fc') ? 'fc' : 'fa';\n const style = type === 'color' && color ? { color } : {};\n const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''} \n ${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;\n\n const iconTag = (\n <i\n className={appliedClassNames}\n style={style}\n onClick={onClick}\n data-testid={testId}\n data-customid={customId}\n id={id}\n data-number={number}\n />\n );\n\n return !hasExternalTooltipHandler && tooltip && tooltip !== '' ? (\n <Tooltip text={tooltip} delay={tooltipDelay} position={tooltipPlacement}>\n {iconTag}\n </Tooltip>\n ) : (\n iconTag\n );\n};\nexport default Icon;\n","import React from 'react';\nimport { ButtonProps } from './Button.types';\nimport '../styles.css';\nimport { browserIsFirefox } from '../utils/browserId';\nimport Tooltip from '../Tooltip';\nimport Icon from '../Icon';\n\n/**\n * All-in-one Button:\n * - use \"variant\" to achieve the desired style\n * - include tooltips and/or icons\n */\nconst Button: React.FunctionComponent<ButtonProps> = ({\n onClick,\n label,\n variant = 'outline',\n type = 'button',\n size = 'sm',\n disabled,\n extraClassNames,\n id,\n testId,\n stopPropagation = true,\n tooltip,\n tooltipOptions,\n iconStyle = 'text',\n icon,\n iconColor,\n}) => {\n const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';\n const baseClassesByVariant = {\n 'outline':\n 'tw-border-solid tw-border',\n 'theme': 'disabled:tw-bg-opacity-50',\n 'danger': 'tw-bg-sq-danger-color hover:tw-bg-sq-danger-color-hover disabled:tw-bg-opacity-50',\n 'theme-light': 'disabled:tw-bg-opacity-50',\n 'no-border': '',\n 'warning': 'tw-bg-sq-warning-color',\n };\n const textClassesByVariantLightTheme = {\n 'outline': 'tw-text-sq-text-color',\n 'theme': 'tw-text-white',\n 'theme-light': 'tw-text-white',\n 'danger': 'tw-text-white',\n 'no-border': 'tw-text-sq-text-color',\n 'warning': 'tw-text-white',\n };\n const textClassesByVariantDarkTheme = {\n 'outline': 'dark:tw-text-sq-dark-text',\n 'theme': 'dark:tw-text-white',\n 'theme-light': 'dark:tw-text-white',\n 'danger': 'dark:tw-text-white',\n 'no-border': 'dark:tw-text-sq-dark-text',\n 'warning': 'dark:tw-text-white',\n };\n\n const classesByVariantLightTheme = {\n 'outline':\n 'tw-border-sq-disabled-gray hover:tw-bg-sq-light-gray' +\n ' focus:tw-bg-sq-dark-gray active:tw-bg-sq-dark-gray focus:tw-border-sq-color-dark active:tw-border-sq-color-dark',\n 'theme': 'tw-bg-sq-color-dark hover:tw-bg-sq-color-highlight',\n 'danger': '',\n 'theme-light': 'tw-bg-sq-icon hover:tw-bg-sq-link',\n 'no-border': '',\n 'warning': 'tw-bg-sq-warning-color',\n };\n\n const classesByVariantDarkTheme = {\n 'outline':\n 'dark:tw-border-sq-dark-disabled-gray dark:hover:tw-bg-sq-highlight-color-dark' +\n ' dark:focus:tw-bg-sq-dark-gray dark:active:tw-bg-sq-dark-gray dark:focus:tw-border-sq-color-dark' +\n ' dark:active:tw-border-sq-color-dark',\n 'theme': 'dark:tw-bg-sq-color-dark dark:hover:tw-bg-sq-color-highlight',\n 'danger': '',\n 'theme-light': 'dark:tw-bg-sq-icon-dark dark:hover:tw-bg-sq-link-dark',\n 'no-border': '',\n 'warning': '',\n };\n const sizeClasses = {\n sm: 'tw-text-sm',\n lg: 'tw-text-xl',\n };\n const appliedClasses = `${baseClasses} ${baseClassesByVariant[variant]} ${sizeClasses[size]} ${classesByVariantLightTheme[variant]} ${classesByVariantDarkTheme[variant]} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]} ${extraClassNames}`;\n\n const button = (\n <button\n id={id}\n disabled={disabled}\n data-testid={testId}\n type={type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type}\n onClick={(e) => {\n stopPropagation && e.stopPropagation();\n onClick && onClick();\n }}\n className={appliedClasses}>\n {icon && (\n <Icon\n icon={icon}\n type={iconStyle}\n color={iconColor}\n extraClassNames={label ?\n `tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : ''}\n testId={`${id}_spinner`}\n />\n )}\n {label}\n </button>\n );\n\n return tooltip ? (\n <Tooltip text={tooltip} {...tooltipOptions}>\n {button}\n </Tooltip>\n ) : (\n button\n );\n};\nexport default Button;\n","import React, { useEffect, useRef, useState } from 'react';\nimport { TextFieldProps } from './TextField.types';\nimport '../styles.css';\n\n/**\n * Textfield.\n */\nexport const TextField: React.FunctionComponent<TextFieldProps> = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (props, ref: any) => {\n const {\n readonly = false,\n onChange,\n onKeyUp,\n id,\n name,\n size = 'sm',\n value,\n placeholder,\n extraClassNames,\n testId,\n type = 'text',\n } = props;\n\n const internalRef = useRef<HTMLInputElement | null>(null);\n const [cursor, setCursor] = useState(null);\n\n const setAllRefs = (receivedRef: any) => {\n if (ref) ref.current = receivedRef;\n internalRef.current = receivedRef;\n };\n\n useEffect(() => {\n const input = internalRef.current! as unknown as HTMLInputElement;\n if (input) input.setSelectionRange(cursor, cursor);\n }, [ref, cursor, value]);\n\n const handleChange = (e: any) => {\n setCursor(e.target.selectionStart);\n onChange && onChange(e);\n };\n\n useEffect(() => {\n /**\n * we need to change the value only if it's different since the internal state of \"input\" will change it anyway\n * this will only be the case when the value has been changed externally via store (undo / redo)\n */\n if (value !== null && value !== undefined && value !== internalRef.current?.value && internalRef.current) {\n // we need to use this method because using the value props directly will switch the input to a \"controlled\"\n // component\n internalRef.current.value = `${value}`;\n }\n }, [value]);\n\n const baseClasses =\n 'tw-height-34 tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm disabled:tw-pointer-events-none' +\n ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border';\n\n const darkTheme = 'dark:tw-border-sq-dark-disabled-gray dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text' +\n ' dark:focus:tw-border-sq-color-dark-dark dark:active:tw-border-sq-color-dark-dark';\n const lightTheme = 'tw-border-sq-disabled-gray tw-text-sq-text-color focus:tw-border-sq-color-dark active:tw-border-sq-color-dark';\n\n const sizeClasses = {\n sm: 'tw-text-sm',\n lg: 'tw-text-xl',\n };\n\n const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames} ${lightTheme} ${darkTheme}`;\n\n return (\n <input\n ref={setAllRefs}\n data-testid={testId}\n name={name}\n id={id}\n type={type}\n value={value}\n className={appliedClasses}\n placeholder={placeholder}\n disabled={readonly}\n autoComplete=\"none\"\n onChange={handleChange}\n onKeyUp={onKeyUp}\n />\n );\n },\n);\n"],"names":["useRef","useState","useEffect"],"mappings":";;;;AAAA;;;AAGG;AACI,MAAM,SAAS,GAAW,CAAC,YAAA;AAChC,IAAA,IAAI,GAAG,CAAC;AACR,IAAA,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,8DAA8D,CAAC,IAAI,EAAE,CAAC;IACvF,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACzB,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;Q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,EACtB,OAAO,EAAE,OAAO,EAChB,CAAA,EACF;AACJ,CAAC;;;;;;;"}
|
package/dist/styles.css
CHANGED
|
@@ -1457,6 +1457,7 @@ video {
|
|
|
1457
1457
|
|
|
1458
1458
|
:root {
|
|
1459
1459
|
--sq-color-dark: 42, 92, 132;
|
|
1460
|
+
--sq-color-dark-dark: 145, 180, 203;
|
|
1460
1461
|
--sq-white: 255, 255, 255;
|
|
1461
1462
|
--sq-color-highlight: 4, 145, 194;
|
|
1462
1463
|
--sq-text-color: 58, 58, 58;
|
|
@@ -1470,26 +1471,37 @@ video {
|
|
|
1470
1471
|
--sq-success-color: 114, 192, 44;
|
|
1471
1472
|
--sq-icon: 4, 145, 194;
|
|
1472
1473
|
--sq-link: 42, 92, 132;
|
|
1474
|
+
--sq-dark-background: 36, 37, 37;
|
|
1475
|
+
--sq-dark-text: 194, 188, 176;
|
|
1476
|
+
--sq-dark-disabled-gray: 70, 73, 73;
|
|
1477
|
+
--sq-highlight-color-dark: 36, 45, 49;
|
|
1473
1478
|
}
|
|
1474
1479
|
|
|
1475
1480
|
.color_topic {
|
|
1476
1481
|
--sq-color-dark: 42, 92, 132;
|
|
1482
|
+
--sq-color-dark-dark: 145, 180, 203;
|
|
1477
1483
|
--sq-color-light: 237, 247, 246;
|
|
1478
1484
|
--sq-color-highlight: 4, 145, 194;
|
|
1479
1485
|
--sq-icon: 4, 145, 194;
|
|
1480
1486
|
--sq-link: 42, 92, 132;
|
|
1487
|
+
--sq-link-dark: 145, 180, 203;
|
|
1488
|
+
--sq-icon-dark: 4, 145, 194;
|
|
1481
1489
|
}
|
|
1482
1490
|
|
|
1483
1491
|
.color_analysis {
|
|
1484
1492
|
--sq-color-dark: 0, 121, 96;
|
|
1493
|
+
--sq-color-dark-dark: 31, 207, 166;
|
|
1485
1494
|
--sq-color-light: 237, 247, 246;
|
|
1486
1495
|
--sq-color-highlight: 0, 153, 100;
|
|
1487
1496
|
--sq-icon: 0, 160, 89;
|
|
1488
1497
|
--sq-link: 0, 121, 96;
|
|
1498
|
+
--sq-link-dark: 21, 99, 81;
|
|
1499
|
+
--sq-icon-dark: 23, 126, 77;
|
|
1489
1500
|
}
|
|
1490
1501
|
|
|
1491
1502
|
.color_datalab {
|
|
1492
1503
|
--sq-color-dark: 242, 103, 34;
|
|
1504
|
+
--sq-color-dark-dark: 242, 103, 34;
|
|
1493
1505
|
--sq-color-light: 237, 247, 246;
|
|
1494
1506
|
--sq-color-highlight: 244, 123, 62;
|
|
1495
1507
|
--sq-icon: 242, 103, 34;
|
|
@@ -1672,6 +1684,10 @@ video {
|
|
|
1672
1684
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1673
1685
|
}
|
|
1674
1686
|
|
|
1687
|
+
.tw-grid-cols-2 {
|
|
1688
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1675
1691
|
.tw-grid-cols-3 {
|
|
1676
1692
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
1677
1693
|
}
|
|
@@ -1724,6 +1740,11 @@ video {
|
|
|
1724
1740
|
background-color: rgba(var(--sq-danger-color), var(--tw-bg-opacity));
|
|
1725
1741
|
}
|
|
1726
1742
|
|
|
1743
|
+
.tw-bg-sq-dark-background {
|
|
1744
|
+
--tw-bg-opacity: 1;
|
|
1745
|
+
background-color: rgba(var(--sq-dark-background), var(--tw-bg-opacity));
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1727
1748
|
.tw-bg-sq-icon {
|
|
1728
1749
|
--tw-bg-opacity: 1;
|
|
1729
1750
|
background-color: rgba(var(--sq-icon), var(--tw-bg-opacity));
|
|
@@ -2031,3 +2052,93 @@ video {
|
|
|
2031
2052
|
opacity: 1;
|
|
2032
2053
|
}
|
|
2033
2054
|
|
|
2055
|
+
.tw-dark .dark\:tw-border-sq-dark-disabled-gray {
|
|
2056
|
+
--tw-border-opacity: 1;
|
|
2057
|
+
border-color: rgba(var(--sq-dark-disabled-gray), var(--tw-border-opacity));
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
.tw-dark .dark\:tw-bg-sq-color-dark {
|
|
2061
|
+
--tw-bg-opacity: 1;
|
|
2062
|
+
background-color: rgba(var(--sq-color-dark), var(--tw-bg-opacity));
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
.tw-dark .dark\:tw-bg-sq-dark-background {
|
|
2066
|
+
--tw-bg-opacity: 1;
|
|
2067
|
+
background-color: rgba(var(--sq-dark-background), var(--tw-bg-opacity));
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
.tw-dark .dark\:tw-bg-sq-icon-dark {
|
|
2071
|
+
--tw-bg-opacity: 1;
|
|
2072
|
+
background-color: rgba(var(--sq-icon-dark), var(--tw-bg-opacity));
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
.tw-dark .dark\:tw-text-sq-color-dark-dark {
|
|
2076
|
+
--tw-text-opacity: 1;
|
|
2077
|
+
color: rgba(var(--sq-color-dark-dark), var(--tw-text-opacity));
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
.tw-dark .dark\:tw-text-sq-dark-disabled-gray {
|
|
2081
|
+
--tw-text-opacity: 1;
|
|
2082
|
+
color: rgba(var(--sq-dark-disabled-gray), var(--tw-text-opacity));
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
.tw-dark .dark\:tw-text-sq-dark-text {
|
|
2086
|
+
--tw-text-opacity: 1;
|
|
2087
|
+
color: rgba(var(--sq-dark-text), var(--tw-text-opacity));
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
.tw-dark .dark\:tw-text-sq-link-dark {
|
|
2091
|
+
--tw-text-opacity: 1;
|
|
2092
|
+
color: rgba(var(--sq-link-dark), var(--tw-text-opacity));
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
.tw-dark .dark\:tw-text-white {
|
|
2096
|
+
--tw-text-opacity: 1;
|
|
2097
|
+
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
.tw-dark .dark\:hover\:tw-bg-sq-color-highlight:hover {
|
|
2101
|
+
--tw-bg-opacity: 1;
|
|
2102
|
+
background-color: rgba(var(--sq-color-highlight), var(--tw-bg-opacity));
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
.tw-dark .dark\:hover\:tw-bg-sq-highlight-color-dark:hover {
|
|
2106
|
+
--tw-bg-opacity: 1;
|
|
2107
|
+
background-color: rgba(var(--sq-highlight-color-dark), var(--tw-bg-opacity));
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
.tw-dark .dark\:hover\:tw-bg-sq-link-dark:hover {
|
|
2111
|
+
--tw-bg-opacity: 1;
|
|
2112
|
+
background-color: rgba(var(--sq-link-dark), var(--tw-bg-opacity));
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
.tw-dark .dark\:focus\:tw-border-sq-color-dark:focus {
|
|
2116
|
+
--tw-border-opacity: 1;
|
|
2117
|
+
border-color: rgba(var(--sq-color-dark), var(--tw-border-opacity));
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
.tw-dark .dark\:focus\:tw-border-sq-color-dark-dark:focus {
|
|
2121
|
+
--tw-border-opacity: 1;
|
|
2122
|
+
border-color: rgba(var(--sq-color-dark-dark), var(--tw-border-opacity));
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
.tw-dark .dark\:focus\:tw-bg-sq-dark-gray:focus {
|
|
2126
|
+
--tw-bg-opacity: 1;
|
|
2127
|
+
background-color: rgba(var(--sq-dark-gray), var(--tw-bg-opacity));
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
.tw-dark .dark\:active\:tw-border-sq-color-dark:active {
|
|
2131
|
+
--tw-border-opacity: 1;
|
|
2132
|
+
border-color: rgba(var(--sq-color-dark), var(--tw-border-opacity));
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
.tw-dark .dark\:active\:tw-border-sq-color-dark-dark:active {
|
|
2136
|
+
--tw-border-opacity: 1;
|
|
2137
|
+
border-color: rgba(var(--sq-color-dark-dark), var(--tw-border-opacity));
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
.tw-dark .dark\:active\:tw-bg-sq-dark-gray:active {
|
|
2141
|
+
--tw-bg-opacity: 1;
|
|
2142
|
+
background-color: rgba(var(--sq-dark-gray), var(--tw-bg-opacity));
|
|
2143
|
+
}
|
|
2144
|
+
|