@seeqdev/qomponents 0.0.14 → 0.0.16

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.
Files changed (92) hide show
  1. package/README.md +76 -2
  2. package/dist/Button/Button.js +71 -0
  3. package/dist/Button/Button.js.map +1 -0
  4. package/dist/Button/Button.stories.d.ts +1 -0
  5. package/dist/Button/Button.stories.js +58 -0
  6. package/dist/Button/Button.stories.js.map +1 -0
  7. package/dist/Button/Button.test.js +49 -0
  8. package/dist/Button/Button.test.js.map +1 -0
  9. package/dist/Button/Button.types.d.ts +2 -0
  10. package/dist/Button/Button.types.js +4 -0
  11. package/dist/Button/Button.types.js.map +1 -0
  12. package/dist/Button/index.js +2 -0
  13. package/dist/Button/index.js.map +1 -0
  14. package/dist/Checkbox/Checkbox.js +23 -0
  15. package/dist/Checkbox/Checkbox.js.map +1 -0
  16. package/dist/Checkbox/Checkbox.stories.js +29 -0
  17. package/dist/Checkbox/Checkbox.stories.js.map +1 -0
  18. package/dist/Checkbox/Checkbox.test.js +94 -0
  19. package/dist/Checkbox/Checkbox.test.js.map +1 -0
  20. package/dist/Checkbox/Checkbox.types.js +2 -0
  21. package/dist/Checkbox/Checkbox.types.js.map +1 -0
  22. package/dist/Checkbox/index.js +2 -0
  23. package/dist/Checkbox/index.js.map +1 -0
  24. package/dist/Icon/Icon.js +54 -0
  25. package/dist/Icon/Icon.js.map +1 -0
  26. package/dist/Icon/Icon.stories.js +40 -0
  27. package/dist/Icon/Icon.stories.js.map +1 -0
  28. package/dist/Icon/Icon.test.js +55 -0
  29. package/dist/Icon/Icon.test.js.map +1 -0
  30. package/dist/Icon/Icon.types.js +16 -0
  31. package/dist/Icon/Icon.types.js.map +1 -0
  32. package/dist/Icon/index.js +2 -0
  33. package/dist/Icon/index.js.map +1 -0
  34. package/dist/Select/Select.js +168 -0
  35. package/dist/Select/Select.js.map +1 -0
  36. package/dist/Select/Select.stories.js +72 -0
  37. package/dist/Select/Select.stories.js.map +1 -0
  38. package/dist/Select/Select.test.js +161 -0
  39. package/dist/Select/Select.test.js.map +1 -0
  40. package/dist/Select/Select.types.js +2 -0
  41. package/dist/Select/Select.types.js.map +1 -0
  42. package/dist/Select/index.js +2 -0
  43. package/dist/Select/index.js.map +1 -0
  44. package/dist/TextArea/TextArea.js +15 -0
  45. package/dist/TextArea/TextArea.js.map +1 -0
  46. package/dist/TextArea/TextArea.stories.js +35 -0
  47. package/dist/TextArea/TextArea.stories.js.map +1 -0
  48. package/dist/TextArea/TextArea.test.js +68 -0
  49. package/dist/TextArea/TextArea.test.js.map +1 -0
  50. package/dist/TextArea/TextArea.types.js +2 -0
  51. package/dist/TextArea/TextArea.types.js.map +1 -0
  52. package/dist/TextArea/index.js +2 -0
  53. package/dist/TextArea/index.js.map +1 -0
  54. package/dist/TextField/TextField.js +56 -0
  55. package/dist/TextField/TextField.js.map +1 -0
  56. package/dist/TextField/TextField.stories.js +37 -0
  57. package/dist/TextField/TextField.stories.js.map +1 -0
  58. package/dist/TextField/TextField.test.js +35 -0
  59. package/dist/TextField/TextField.test.js.map +1 -0
  60. package/dist/TextField/TextField.types.js +2 -0
  61. package/dist/TextField/TextField.types.js.map +1 -0
  62. package/dist/TextField/index.js +2 -0
  63. package/dist/TextField/index.js.map +1 -0
  64. package/dist/Tooltip/Tooltip.js +30 -0
  65. package/dist/Tooltip/Tooltip.js.map +1 -0
  66. package/dist/Tooltip/Tooltip.stories.js +32 -0
  67. package/dist/Tooltip/Tooltip.stories.js.map +1 -0
  68. package/dist/Tooltip/Tooltip.types.js +3 -0
  69. package/dist/Tooltip/Tooltip.types.js.map +1 -0
  70. package/dist/Tooltip/index.js +2 -0
  71. package/dist/Tooltip/index.js.map +1 -0
  72. package/dist/example/.eslintrc.cjs +14 -0
  73. package/dist/example/README.md +33 -0
  74. package/dist/example/index.html +13 -0
  75. package/dist/example/package.json +30 -0
  76. package/dist/example/src/Example.tsx +146 -0
  77. package/dist/example/src/index.css +73 -0
  78. package/dist/example/src/main.tsx +10 -0
  79. package/dist/example/src/vite-env.d.ts +1 -0
  80. package/dist/example/tsconfig.json +33 -0
  81. package/dist/example/tsconfig.node.json +10 -0
  82. package/dist/example/vite.config.ts +12 -0
  83. package/dist/index.esm.js +12 -9
  84. package/dist/index.esm.js.map +1 -1
  85. package/dist/index.js +12 -9
  86. package/dist/index.js.map +1 -1
  87. package/dist/styles.css +8 -4
  88. package/dist/types.js +2 -0
  89. package/dist/types.js.map +1 -0
  90. package/dist/utils/browserId.js +29 -0
  91. package/dist/utils/browserId.js.map +1 -0
  92. package/package.json +1 -1
package/README.md CHANGED
@@ -30,6 +30,9 @@ yarn add @seeqdev/qomponents
30
30
 
31
31
  ## Getting started with Seeq qomponents
32
32
 
33
+ Prefer a more complete example? <br/>Checkout the example folder provided.
34
+ It includes a ready to run example application. Start with the readme in the example folder to get up and running!
35
+
33
36
  Here is an example of a basic app using the `Button` component:
34
37
 
35
38
  ```jsx
@@ -41,8 +44,79 @@ function App() {
41
44
  }
42
45
  ```
43
46
 
44
- To make sure all styles are properly applied be sure to inclue the qomponents css file in your main css file.
47
+ To make sure all styles are properly applied be sure to include the qomponents css file in your main css file.
45
48
 
46
49
  ```css
47
50
  @import '@seeqdev/qomponents/dist/styles.css';
48
- ```
51
+ ```
52
+
53
+ <b>A note on CSS:</b> Seeq's qomponents come fully styled and ready to use. While it is tempting to use the
54
+ available <i>extraClassNames</i> property to provide yet additional styling we strongly advise you to use this
55
+ property to provide only width, margins and padding. This will ensure for a smooth upgrade experience when
56
+ Seeq's look and feel changes.
57
+
58
+ ## Frequently asked questions
59
+
60
+ <h3>1) I use webpack and I get a strange error once I added qomponents to my package.json!</h3>
61
+
62
+ Webpack needs a little help :)
63
+ Add the following to the <code>rules</code> array in your <code>webpack.config</code>
64
+
65
+ ```
66
+ {
67
+ test: /@?(seeqdev).*\.(ts|js)x?$/,
68
+ loader:'babel-loader'
69
+ }
70
+ ```
71
+
72
+ <h3>2) How do I get my Button to be green?</h3>
73
+
74
+ The colors of your qomponents are controlled by the "theme". </br>
75
+ If you do not provide a theme your qomponents will use the default blue or also known as Topic-based theme.
76
+ Themes are applied by adding the class of the desired theme to a wrapper of your application. The theme class can
77
+ also be applied to the body tag.
78
+
79
+ ```html
80
+
81
+ <div class="color_analysis">
82
+ ... your application here
83
+ </div>
84
+
85
+ ```
86
+
87
+ There are 3 themes available:
88
+
89
+ | Theme | Color | Class | Example |
90
+ |:---------|:-------|:---------------|:-----------------------|
91
+ | Topic | blue | color_topic | class="color_topic" |
92
+ | Analysis | green | color_analysis | class="color_analysis" |
93
+ | DataLab | orange | color_datalab | class="color_datalab" |
94
+
95
+ <h3>3) How do I use Fontawesome Icons?</h3>
96
+ Before you can use Fontawesome icons you must install FontAwesome.
97
+
98
+ ```
99
+ npm install --save @fortawesome/fontawesome-free
100
+ ```
101
+
102
+ Once it's installed simply import the required css files. To import all variations of FontAwesome's Icons you can
103
+ add the following import to your main css file:
104
+
105
+ ```
106
+ @import "@fortawesome/fontawesome-free/css/all.css";
107
+ ```
108
+
109
+ If your project only uses Classic Solid or (Sharp Solids, or any other one kind) it's better to import only the
110
+ required css for that Icon type to keep your packages size small.<br/> Note: if you don't import "all" like shown above
111
+ be sure to include <code>fontawesome.css</code> in addition to whatever Icon style you require.
112
+
113
+ For Example:
114
+
115
+ ```
116
+ @import "@fortawesome/fontawesome-free/css/fontawesome.css";
117
+ @import "@fortawesome/fontawesome-free/css/solid.css";
118
+ ```
119
+
120
+ <h3>4) How can I see all the props that are available?</h3>
121
+ Take a look at the <code>.types.d.ts</code> files that can be found in the <code>dist/{component name}/</code>
122
+ folder. This file contains all available properties including some descriptive text that tells you more about them.
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import '../styles.css';
3
+ import { browserIsFirefox } from '../utils/browserId';
4
+ import Tooltip from '../Tooltip';
5
+ import Icon from '../Icon';
6
+ /**
7
+ * All-in-one Button:
8
+ * - use "variant" to achieve the desired style
9
+ * - include tooltips and/or icons
10
+ */
11
+ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = 'sm', disabled, extraClassNames, id, testId, stopPropagation = true, tooltip, tooltipOptions, iconStyle = 'text', icon, iconColor, }) => {
12
+ const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';
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 = {
22
+ 'outline': 'tw-text-sq-text-color',
23
+ 'theme': 'tw-text-white',
24
+ 'theme-light': 'tw-text-white',
25
+ 'danger': 'tw-text-white',
26
+ 'no-border': 'tw-text-sq-text-color',
27
+ 'warning': 'tw-text-white',
28
+ };
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' +
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',
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',
43
+ 'no-border': '',
44
+ 'warning': 'tw-bg-sq-warning-color',
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
+ };
56
+ const sizeClasses = {
57
+ sm: 'tw-text-sm',
58
+ lg: 'tw-text-xl',
59
+ };
60
+ const appliedClasses = `${baseClasses} ${baseClassesByVariant[variant]} ${sizeClasses[size]} ${classesByVariantLightTheme[variant]} ${classesByVariantDarkTheme[variant]} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]} ${extraClassNames}`;
61
+ const button = (React.createElement("button", { id: id, disabled: disabled, "data-testid": testId, type: type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type, onClick: (e) => {
62
+ stopPropagation && e.stopPropagation();
63
+ onClick && onClick();
64
+ }, className: appliedClasses },
65
+ icon && (React.createElement(Icon, { icon: icon, type: iconStyle, color: iconColor, extraClassNames: label ?
66
+ `tw-mr-1 ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : '', testId: `${id}_spinner` })),
67
+ label));
68
+ return tooltip ? (React.createElement(Tooltip, { text: tooltip, ...tooltipOptions }, button)) : (button);
69
+ };
70
+ export default Button;
71
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +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,MAA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,EAAE,OAAO,KAAM,cAAc,IACvC,MAAM,CACC,CACX,CAAC,CAAC,CAAC,CACF,MAAM,CACP,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,MAAM,CAAC"}
@@ -5,3 +5,4 @@ export default _default;
5
5
  export declare const AllButtonVariants: () => JSX.Element;
6
6
  export declare const ButtonWithTooltip: () => JSX.Element;
7
7
  export declare const ButtonWithIcon: () => JSX.Element;
8
+ export declare const DisabledButton: () => JSX.Element;
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import Button from './Button';
3
+ import { buttonVariants } from './Button.types';
4
+ export default {
5
+ title: 'Button',
6
+ };
7
+ export const AllButtonVariants = () => {
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 })))))));
13
+ return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
14
+ React.createElement("div", { className: "color_topic" },
15
+ React.createElement("b", null, "Topic Colors"),
16
+ renderAllVariations()),
17
+ React.createElement("div", { className: "color_analysis" },
18
+ React.createElement("b", null, "Analysis Colors"),
19
+ renderAllVariations()),
20
+ React.createElement("div", { className: "color_datalab" },
21
+ React.createElement("b", null, "Datalab Colors"),
22
+ renderAllVariations())));
23
+ };
24
+ export const ButtonWithTooltip = () => {
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" }))));
30
+ return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
31
+ React.createElement("div", { className: "color_topic" },
32
+ React.createElement("b", null, "Topic Colors"),
33
+ renderButtonWithTooltip()),
34
+ React.createElement("div", { className: "color_analysis" },
35
+ React.createElement("b", null, "Analysis Colors"),
36
+ renderButtonWithTooltip()),
37
+ React.createElement("div", { className: "color_datalab" },
38
+ React.createElement("b", null, "Datalab Colors"),
39
+ renderButtonWithTooltip())));
40
+ };
41
+ export const ButtonWithIcon = () => {
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" }))));
47
+ return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
48
+ React.createElement("div", { className: "color_topic" },
49
+ React.createElement("b", null, "Topic Colors"),
50
+ renderButtonWithIcon()),
51
+ React.createElement("div", { className: "color_analysis" },
52
+ React.createElement("b", null, "Analysis Colors"),
53
+ renderButtonWithIcon()),
54
+ React.createElement("div", { className: "color_datalab" },
55
+ React.createElement("b", null, "Datalab Colors"),
56
+ renderButtonWithIcon())));
57
+ };
58
+ //# sourceMappingURL=Button.stories.js.map
@@ -0,0 +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,GAA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G,CACjE,CACL,CACJ,CAAC;IACF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,6BAAK,SAAS,EAAC,aAAa;YAC1B,8CAAmB;YAClB,uBAAuB,EAAE,CACtB;QAEN,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,iDAAsB;YACrB,uBAAuB,EAAE,CACtB;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,uBAAuB,EAAE,CACtB,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CACjC;QACE,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,MAAM,IAAC,IAAI,EAAC,iBAAiB,EAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,WAAW,GAAG,CAC/D;QACN,6BAAK,SAAS,EAAC,yCAAyC;YACtD,oBAAC,MAAM,IAAC,IAAI,EAAC,iBAAiB,EAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,WAAW,GAAG,CAC/D,CACL,CACJ,CAAC;IACF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,6BAAK,SAAS,EAAC,aAAa;YAC1B,8CAAmB;YAClB,oBAAoB,EAAE,CACnB;QAEN,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,iDAAsB;YACrB,oBAAoB,EAAE,CACnB;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,oBAAoB,EAAE,CACnB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import '@testing-library/jest-dom';
3
+ import { render, screen } from '@testing-library/react';
4
+ import userEvent from '@testing-library/user-event';
5
+ import Button from './Button';
6
+ describe('Button', () => {
7
+ class Context {
8
+ testId = 'buttonTestId';
9
+ label = 'button label';
10
+ props = {
11
+ label: this.label,
12
+ onClick: jest.fn(),
13
+ testId: this.testId,
14
+ };
15
+ }
16
+ let tc;
17
+ beforeEach(() => {
18
+ tc = new Context();
19
+ });
20
+ const renderButton = (props) => render(React.createElement(Button, { ...props }));
21
+ it('renders button label', () => {
22
+ renderButton(tc.props);
23
+ expect(screen.getByText(tc.label)).toBeInTheDocument();
24
+ });
25
+ it('calls on click', async () => {
26
+ renderButton(tc.props);
27
+ await userEvent.click(screen.getByTestId(tc.testId));
28
+ expect(tc.props.onClick).toHaveBeenCalled();
29
+ });
30
+ it('renders disabled button', () => {
31
+ renderButton({ ...tc.props, disabled: true });
32
+ expect(screen.getByText(tc.label)).toBeDisabled();
33
+ });
34
+ it('respects stopPropagation default', async () => {
35
+ const callOnPropagation = jest.fn();
36
+ render(React.createElement("div", { onClick: callOnPropagation },
37
+ React.createElement(Button, { ...tc.props })));
38
+ await userEvent.click(screen.getByTestId(tc.testId));
39
+ expect(callOnPropagation).not.toHaveBeenCalled();
40
+ });
41
+ it('propagates click event if not told not to', async () => {
42
+ const callOnPropagation = jest.fn();
43
+ render(React.createElement("div", { onClick: callOnPropagation },
44
+ React.createElement(Button, { ...{ ...tc.props, stopPropagation: false } })));
45
+ await userEvent.click(screen.getByTestId(tc.testId));
46
+ expect(callOnPropagation).toHaveBeenCalled();
47
+ });
48
+ });
49
+ //# sourceMappingURL=Button.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.test.js","sourceRoot":"","sources":["../../src/Button/Button.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAEpD,OAAO,MAAM,MAAM,UAAU,CAAC;AAG9B,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,MAAM,OAAO;QACX,MAAM,GAAG,cAAc,CAAC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EAAE;QAChD,MAAM,iBAAiB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,CACJ,6BAAK,OAAO,EAAE,iBAAiB;YAC7B,oBAAC,MAAM,OAAK,EAAE,CAAC,KAAK,GAAI,CACpB,CACP,CAAC;QACF,MAAM,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,iBAAiB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,CACJ,6BAAK,OAAO,EAAE,iBAAiB;YAC7B,oBAAC,MAAM,OAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,GAAI,CACnD,CACP,CAAC;QACF,MAAM,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -36,4 +36,6 @@ export interface ButtonProps {
36
36
  tooltip?: string;
37
37
  /** options for the tooltip */
38
38
  tooltipOptions?: Omit<TooltipProps, 'text'>;
39
+ /** if provided, determines whether to prevent the blur event from occurring onMouseDown*/
40
+ preventBlur?: boolean;
39
41
  }
@@ -0,0 +1,4 @@
1
+ export const buttonTypes = ['button', 'reset', 'submit', 'link'];
2
+ export const buttonSizes = ['sm', 'lg'];
3
+ export const buttonVariants = ['outline', 'theme', 'theme-light', 'warning', 'danger', 'no-border'];
4
+ //# sourceMappingURL=Button.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.types.js","sourceRoot":"","sources":["../../src/Button/Button.types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAC1E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,CAAU,CAAC;AACjD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./Button";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import '../styles.css';
3
+ const alignment = 'tw-flex tw-items-center';
4
+ const labelClasses = 'tw-ml-1.5 tw-text-sm';
5
+ const baseClasses = 'tw-border-1 tw-h-3.5 tw-w-3.5 focus:tw-ring-0 focus:tw-ring-offset-0 tw-outline-none focus:tw-outline-none' +
6
+ ' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:checked:tw-bg-sq-dark-text' +
7
+ ' checked:tw-text-sq-text-color' +
8
+ ' disabled:tw-text-sq-fairly-dark-gray';
9
+ const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses}`;
10
+ const radioClasses = `tw-form-radio ${baseClasses}`;
11
+ /**
12
+ * Checkbox and Radio Box Component.
13
+ */
14
+ export const Checkbox = (props) => {
15
+ const { type = 'checkbox', value, disabled = false, label, onChange, onClick, onKeyDown, checked, defaultChecked, id, name, extraClassNames, extraLabelClassNames, testId, } = props;
16
+ const assignedId = id ?? 'checkbox_' + Math.random();
17
+ return (React.createElement("span", { className: `${alignment} ${extraClassNames}` },
18
+ React.createElement("input", { value: value, type: type, "data-testid": testId, name: name, id: assignedId, checked: checked, defaultChecked: defaultChecked, className: `${type === 'checkbox' ? checkboxClasses : radioClasses} ${disabled ? 'tw-cursor-not-allowed' : 'tw-cursor-pointer'}`, disabled: disabled, onClick: onClick, onChange: onChange, onKeyDown: onKeyDown }),
19
+ React.createElement("label", { htmlFor: assignedId, className: `${labelClasses} ${extraLabelClassNames} ${disabled
20
+ ? 'tw-cursor-not-allowed dark:tw-text-sq-fairly-dark-gray tw-text-sq-fairly-dark-gray'
21
+ : 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}` }, label)));
22
+ };
23
+ //# sourceMappingURL=Checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,eAAe,CAAC;AAEvB,MAAM,SAAS,GAAG,yBAAyB,CAAC;AAC5C,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAE5C,MAAM,WAAW,GACf,4GAA4G;IAC5G,6FAA6F;IAC7F,iCAAiC;IACjC,uCAAuC,CAAC;AAE1C,MAAM,eAAe,GAAG,+BAA+B,WAAW,EAAE,CAAC;AAErE,MAAM,YAAY,GAAG,iBAAiB,WAAW,EAAE,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA2C,CAAC,KAAK,EAAE,EAAE;IACxE,MAAM,EACJ,IAAI,GAAG,UAAU,EACjB,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,cAAc,EACd,EAAE,EACF,IAAI,EACJ,eAAe,EACf,oBAAoB,EACpB,MAAM,GACP,GAAG,KAAK,CAAC;IAEV,MAAM,UAAU,GAAG,EAAE,IAAI,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAErD,OAAO,CACL,8BAAM,SAAS,EAAE,GAAG,SAAS,IAAI,eAAe,EAAE;QAChD,+BACE,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,iBACG,MAAM,EACnB,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,GAAG,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY,IAChE,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,mBACvC,EAAE,EACF,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,GACpB;QACF,+BACE,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,GAAG,YAAY,IAAI,oBAAoB,IAChD,QAAQ;gBACN,CAAC,CAAC,oFAAoF;gBACtF,CAAC,CAAC,mEACN,EAAE,IACD,KAAK,CACA,CACH,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { Checkbox } from './Checkbox';
3
+ export default {
4
+ title: 'Checkbox',
5
+ };
6
+ export const AllCheckboxes = () => {
7
+ const getDisplay = (type) => (React.createElement(React.Fragment, null,
8
+ React.createElement("div", { className: "tw-p-4" },
9
+ React.createElement(Checkbox, { value: "a", type: type, checked: true, label: 'with Label' })),
10
+ React.createElement("div", { className: "tw-p-4" },
11
+ React.createElement(Checkbox, { value: "d", type: type, checked: false, disabled: true, label: "Disabled" })),
12
+ React.createElement("div", { className: "tw-p-4" },
13
+ React.createElement(Checkbox, { value: "d", type: type, checked: true, disabled: true, label: "Disabled" })),
14
+ React.createElement("div", { className: "tw-p-4" },
15
+ React.createElement(Checkbox, { value: "b", type: type, checked: true })),
16
+ React.createElement("div", { className: "tw-p-4" },
17
+ React.createElement(Checkbox, { value: "c", type: type, checked: false }))));
18
+ const renderAllVariations = (type) => (React.createElement(React.Fragment, null,
19
+ React.createElement("div", { className: "tw-p-4 light" }, getDisplay(type)),
20
+ React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" }, getDisplay(type))));
21
+ return (React.createElement("div", { className: "tw-grid tw-grid-cols-2 tw-gap-4" },
22
+ React.createElement("div", null,
23
+ React.createElement("b", null, "Checkbox"),
24
+ renderAllVariations('checkbox')),
25
+ React.createElement("div", null,
26
+ React.createElement("b", null, "Radios"),
27
+ renderAllVariations('radio'))));
28
+ };
29
+ //# sourceMappingURL=Checkbox.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.stories.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAe;IACb,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,UAAU,GAAG,CAAC,IAA0B,EAAE,EAAE,CAAC,CACjD;QACE,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,GAAI,CAClE;QACN,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAC,UAAU,GAAG,CAC/E;QACN,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAC,UAAU,GAAG,CAC9E;QACN,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAI,CAC7C;QACN,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,GAAI,CAC9C,CACL,CACJ,CAAC;IACF,MAAM,mBAAmB,GAAG,CAAC,IAA0B,EAAE,EAAE,CAAC,CAC1D;QACE,6BAAK,SAAS,EAAC,cAAc,IAAE,UAAU,CAAC,IAAI,CAAC,CAAO;QACtD,6BAAK,SAAS,EAAC,yCAAyC,IAAE,UAAU,CAAC,IAAI,CAAC,CAAO,CAChF,CACJ,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C;YACE,0CAAe;YACd,mBAAmB,CAAC,UAAU,CAAC,CAC5B;QAEN;YACE,wCAAa;YACZ,mBAAmB,CAAC,OAAO,CAAC,CACzB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+ import '@testing-library/jest-dom';
3
+ import { render, screen } from '@testing-library/react';
4
+ import { Checkbox } from './Checkbox';
5
+ import userEvent from '@testing-library/user-event';
6
+ describe('Checkbox', () => {
7
+ class Context {
8
+ testId = 'checkboxTestId';
9
+ props = {
10
+ onChange: jest.fn(),
11
+ checked: false,
12
+ testId: this.testId,
13
+ };
14
+ }
15
+ let tc;
16
+ beforeEach(() => {
17
+ tc = new Context();
18
+ });
19
+ const renderCheckbox = (props) => render(React.createElement(Checkbox, { ...props }));
20
+ it('renders checkbox', () => {
21
+ renderCheckbox(tc.props);
22
+ expect(screen.getByTestId(tc.testId)).toBeInTheDocument();
23
+ });
24
+ it('renders radio', () => {
25
+ renderCheckbox({ ...tc.props, type: 'radio' });
26
+ expect(screen.getByTestId(tc.testId)).toHaveProperty('type', 'radio');
27
+ });
28
+ it('renders label', () => {
29
+ const label = 'look at this checkbox!';
30
+ renderCheckbox({ ...tc.props, label });
31
+ expect(screen.getByText(label)).toBeInTheDocument();
32
+ });
33
+ it('respects checked', () => {
34
+ renderCheckbox({ ...tc.props, checked: true });
35
+ expect(screen.getByTestId(tc.testId)).toBeChecked();
36
+ });
37
+ it('calls onChange handler', async () => {
38
+ const onChange = jest.fn();
39
+ renderCheckbox({ ...tc.props, onChange });
40
+ await userEvent.click(screen.getByTestId(tc.testId));
41
+ expect(onChange).toHaveBeenCalled();
42
+ });
43
+ it('calls onKeyDown handler', async () => {
44
+ const onKeyDown = jest.fn();
45
+ renderCheckbox({ ...tc.props, onKeyDown });
46
+ await userEvent.type(screen.getByTestId(tc.testId), 'a');
47
+ expect(onKeyDown).toHaveBeenCalled();
48
+ });
49
+ it('calls onClickHandler handler', async () => {
50
+ const onClick = jest.fn();
51
+ renderCheckbox({ ...tc.props, onClick });
52
+ await userEvent.click(screen.getByTestId(tc.testId));
53
+ expect(onClick).toHaveBeenCalled();
54
+ });
55
+ it('respects disabled', () => {
56
+ renderCheckbox({ ...tc.props, disabled: true });
57
+ expect(screen.getByTestId(tc.testId)).not.toBeEnabled();
58
+ });
59
+ it('renders label clickable', async () => {
60
+ const label = 'amazing checkbox';
61
+ const onClick = jest.fn();
62
+ renderCheckbox({ ...tc.props, label, onClick });
63
+ expect(screen.getByTestId(tc.testId)).not.toBeChecked();
64
+ await userEvent.click(screen.getByText(label));
65
+ expect(onClick).toHaveBeenCalled();
66
+ });
67
+ it('respects id', () => {
68
+ const id = 'checkboxId';
69
+ renderCheckbox({ ...tc.props, id });
70
+ expect(screen.getByTestId(tc.testId)).toHaveProperty('id', id);
71
+ });
72
+ it('respects name', () => {
73
+ const name = 'checkboxName';
74
+ renderCheckbox({ ...tc.props, name });
75
+ expect(screen.getByTestId(tc.testId)).toHaveProperty('name', name);
76
+ });
77
+ it('respects name', () => {
78
+ const value = 'priceless';
79
+ renderCheckbox({ ...tc.props, value });
80
+ expect(screen.getByTestId(tc.testId)).toHaveProperty('value', value);
81
+ });
82
+ it('applies extraClassNames', () => {
83
+ const extraClassNames = 'extra styling so fancy';
84
+ renderCheckbox({ ...tc.props, extraClassNames });
85
+ expect(screen.getByTestId(tc.testId).parentNode).toHaveClass(extraClassNames);
86
+ });
87
+ it('applies extraLabelClassNames', () => {
88
+ const extraLabelClassNames = 'special label';
89
+ const label = 'amazing checkbox';
90
+ renderCheckbox({ ...tc.props, extraLabelClassNames, label });
91
+ expect(screen.getByText(label)).toHaveClass(extraLabelClassNames);
92
+ });
93
+ });
94
+ //# sourceMappingURL=Checkbox.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.test.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAEpD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,MAAM,OAAO;QACX,MAAM,GAAG,gBAAgB,CAAC;QAC1B,KAAK,GAAkB;YACrB,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;YACnB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;KACH;IAED,IAAI,EAAW,CAAC;IAChB,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,CAAC,KAAoB,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAC,QAAQ,OAAK,KAAK,GAAI,CAAC,CAAC;IAEjF,EAAE,CAAC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CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,eAAe,GAAG,wBAAwB,CAAC;QACjD,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;QACjD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,oBAAoB,GAAG,eAAe,CAAC;QAC7C,MAAM,KAAK,GAAG,kBAAkB,CAAC;QACjC,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7D,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Checkbox.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.types.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { Checkbox as default } from './Checkbox';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import '../styles.css';
3
+ import Tooltip from '../Tooltip';
4
+ /**
5
+ * Icon:
6
+ * - access to Seeq custom icons by providing the desired icon
7
+ * - leverage "type" to style your icon
8
+ */
9
+ const Icon = ({ onClick, icon, type = 'theme', extraClassNames, id, large, small, color, testId, customId, tooltip, tooltipDelay, tooltipPlacement, number, hasExternalTooltipHandler = false, }) => {
10
+ if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {
11
+ const errorMessage = color === undefined || color === ''
12
+ ? 'Icon with type="color" must have prop color specified.'
13
+ : 'Icon with prop color must have type="color".';
14
+ return React.createElement("div", { className: "tw-text-sq-danger-color" }, errorMessage);
15
+ }
16
+ const colorClassesThemeLight = {
17
+ 'theme': 'tw-text-sq-color-dark',
18
+ 'white': 'tw-text-white',
19
+ 'dark-gray': 'tw-text-sq-fairly-dark-gray',
20
+ 'warning': 'tw-text-sq-warning-color',
21
+ 'darkish-gray': 'tw-text-sq-darkish-gray',
22
+ 'gray': 'tw-text-sq-disabled-gray',
23
+ 'color': '',
24
+ 'info': 'tw-text-sq-link',
25
+ 'text': 'tw-text-sq-text-color',
26
+ 'inherit': '',
27
+ 'danger': 'tw-text-sq-danger-color',
28
+ 'theme-light': 'tw-text-sq-color-light',
29
+ 'success': 'tw-text-sq-success-color',
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
+ };
46
+ const iconPrefix = icon.startsWith('fc') ? 'fc' : 'fa';
47
+ const style = type === 'color' && color ? { color } : {};
48
+ const appliedClassNames = `${iconPrefix} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
49
+ ${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'cursor-pointer' : ''} ${extraClassNames}`;
50
+ const iconTag = (React.createElement("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number }));
51
+ return !hasExternalTooltipHandler && tooltip && tooltip !== '' ? (React.createElement(Tooltip, { text: tooltip, delay: tooltipDelay, position: tooltipPlacement }, iconTag)) : (iconTag);
52
+ };
53
+ export default Icon;
54
+ //# sourceMappingURL=Icon.js.map
@@ -0,0 +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,sBAAsB,GAAG;QA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,CAAC,CAAC,CAAC,EAAE,IAAI,eAAe,EAAE,CAAC;IAEtH,MAAM,OAAO,GAAG,CACd,2BACE,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,iBACH,MAAM,mBACJ,QAAQ,EACvB,EAAE,EAAE,EAAE,iBACO,MAAM,GACnB,CACH,CAAC;IAEF,OAAO,CAAC,yBAAyB,IAAI,OAAO,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,CAC/D,oBAAC,OAAO,IAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,IACpE,OAAO,CACA,CACX,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import Icon from './Icon';
3
+ import { iconTypes } from './Icon.types';
4
+ export default {
5
+ title: 'Icons',
6
+ };
7
+ export const AllIcons = () => {
8
+ const renderAllVariations = () => {
9
+ return (React.createElement(React.Fragment, null,
10
+ React.createElement("br", null),
11
+ React.createElement("br", null),
12
+ iconTypes.map((iconType) => {
13
+ return (React.createElement("div", { key: `${iconType}` },
14
+ React.createElement("b", null,
15
+ "type=",
16
+ iconType),
17
+ React.createElement("br", null),
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 })),
26
+ React.createElement("br", null)));
27
+ })));
28
+ };
29
+ return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
30
+ React.createElement("div", { className: "color_topic" },
31
+ React.createElement("b", null, "Topic Colors"),
32
+ renderAllVariations()),
33
+ React.createElement("div", { className: "color_analysis" },
34
+ React.createElement("b", null, "Analysis Colors"),
35
+ renderAllVariations()),
36
+ React.createElement("div", { className: "color_datalab" },
37
+ React.createElement("b", null, "Datalab Colors"),
38
+ renderAllVariations())));
39
+ };
40
+ //# sourceMappingURL=Icon.stories.js.map
@@ -0,0 +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,GAAG,GAAG,EAAE;QAC/B,OAAO,CACL;YACE,+BAAM;YACN,+BAAM;YACL,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC1B,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,QAAQ,EAAE;oBACrB;;wBAAS,QAAQ,CAAK;oBACtB,+BAAM;oBACN;wBACE,oBAAC,IAAI,IACH,IAAI,EAAC,kBAAkB,EACvB,KAAK,EAAE,IAAI,EACX,eAAe,EAAE,QAAQ,EACzB,IAAI,EAAE,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