@seeqdev/qomponents 0.0.85 → 0.0.86

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 (170) hide show
  1. package/dist/TextField/TextField.types.d.ts +6 -0
  2. package/dist/index.esm.js +22 -3
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +22 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/utils/validateStyleDimension.d.ts +2 -0
  7. package/dist/utils/validateStyleDimension.js +14 -0
  8. package/dist/utils/validateStyleDimension.js.map +1 -0
  9. package/dist/utils/validateStyleDimension.test.d.ts +1 -0
  10. package/dist/utils/validateStyleDimension.test.js +20 -0
  11. package/dist/utils/validateStyleDimension.test.js.map +1 -0
  12. package/package.json +1 -1
  13. package/dist/Accordion/Accordion.js +0 -9
  14. package/dist/Accordion/Accordion.js.map +0 -1
  15. package/dist/Accordion/Accordion.stories.js +0 -115
  16. package/dist/Accordion/Accordion.stories.js.map +0 -1
  17. package/dist/Accordion/Accordion.test.js +0 -55
  18. package/dist/Accordion/Accordion.test.js.map +0 -1
  19. package/dist/Accordion/Accordion.types.js +0 -2
  20. package/dist/Accordion/Accordion.types.js.map +0 -1
  21. package/dist/Accordion/index.js +0 -2
  22. package/dist/Accordion/index.js.map +0 -1
  23. package/dist/Button/Button.js +0 -90
  24. package/dist/Button/Button.js.map +0 -1
  25. package/dist/Button/Button.stories.js +0 -98
  26. package/dist/Button/Button.stories.js.map +0 -1
  27. package/dist/Button/Button.test.js +0 -49
  28. package/dist/Button/Button.test.js.map +0 -1
  29. package/dist/Button/Button.types.js +0 -5
  30. package/dist/Button/Button.types.js.map +0 -1
  31. package/dist/Button/index.js +0 -2
  32. package/dist/Button/index.js.map +0 -1
  33. package/dist/ButtonWithDropdown/ButtonWithDropdown.js +0 -68
  34. package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +0 -1
  35. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +0 -96
  36. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +0 -1
  37. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +0 -72
  38. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +0 -1
  39. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +0 -2
  40. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js.map +0 -1
  41. package/dist/ButtonWithDropdown/index.js +0 -2
  42. package/dist/ButtonWithDropdown/index.js.map +0 -1
  43. package/dist/ButtonWithPopover/ButtonWithPopover.js +0 -53
  44. package/dist/ButtonWithPopover/ButtonWithPopover.js.map +0 -1
  45. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +0 -75
  46. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +0 -1
  47. package/dist/ButtonWithPopover/ButtonWithPopover.test.js +0 -82
  48. package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +0 -1
  49. package/dist/ButtonWithPopover/ButtonWithPopover.types.js +0 -2
  50. package/dist/ButtonWithPopover/ButtonWithPopover.types.js.map +0 -1
  51. package/dist/ButtonWithPopover/index.js +0 -2
  52. package/dist/ButtonWithPopover/index.js.map +0 -1
  53. package/dist/Checkbox/Checkbox.js +0 -26
  54. package/dist/Checkbox/Checkbox.js.map +0 -1
  55. package/dist/Checkbox/Checkbox.stories.js +0 -34
  56. package/dist/Checkbox/Checkbox.stories.js.map +0 -1
  57. package/dist/Checkbox/Checkbox.test.js +0 -94
  58. package/dist/Checkbox/Checkbox.test.js.map +0 -1
  59. package/dist/Checkbox/Checkbox.types.js +0 -2
  60. package/dist/Checkbox/Checkbox.types.js.map +0 -1
  61. package/dist/Checkbox/index.js +0 -2
  62. package/dist/Checkbox/index.js.map +0 -1
  63. package/dist/Icon/Icon.js +0 -55
  64. package/dist/Icon/Icon.js.map +0 -1
  65. package/dist/Icon/Icon.stories.js +0 -44
  66. package/dist/Icon/Icon.stories.js.map +0 -1
  67. package/dist/Icon/Icon.test.js +0 -55
  68. package/dist/Icon/Icon.test.js.map +0 -1
  69. package/dist/Icon/Icon.types.js +0 -16
  70. package/dist/Icon/Icon.types.js.map +0 -1
  71. package/dist/Icon/index.js +0 -2
  72. package/dist/Icon/index.js.map +0 -1
  73. package/dist/Modal/Modal.js +0 -100
  74. package/dist/Modal/Modal.js.map +0 -1
  75. package/dist/Modal/Modal.stories.js +0 -102
  76. package/dist/Modal/Modal.stories.js.map +0 -1
  77. package/dist/Modal/Modal.test.js +0 -108
  78. package/dist/Modal/Modal.test.js.map +0 -1
  79. package/dist/Modal/Modal.types.js +0 -2
  80. package/dist/Modal/Modal.types.js.map +0 -1
  81. package/dist/Modal/index.js +0 -2
  82. package/dist/Modal/index.js.map +0 -1
  83. package/dist/NewWorkbench/NewWorkbench.js +0 -48
  84. package/dist/NewWorkbench/NewWorkbench.js.map +0 -1
  85. package/dist/NewWorkbench/NewWorkbench.stories.js +0 -80
  86. package/dist/NewWorkbench/NewWorkbench.stories.js.map +0 -1
  87. package/dist/NewWorkbench/NewWorkbench.test.js +0 -73
  88. package/dist/NewWorkbench/NewWorkbench.test.js.map +0 -1
  89. package/dist/NewWorkbench/NewWorkbench.types.js +0 -2
  90. package/dist/NewWorkbench/NewWorkbench.types.js.map +0 -1
  91. package/dist/NewWorkbench/index.js +0 -2
  92. package/dist/NewWorkbench/index.js.map +0 -1
  93. package/dist/NewWorkbench/variants.js +0 -23
  94. package/dist/NewWorkbench/variants.js.map +0 -1
  95. package/dist/Select/Select.js +0 -171
  96. package/dist/Select/Select.js.map +0 -1
  97. package/dist/Select/Select.stories.js +0 -80
  98. package/dist/Select/Select.stories.js.map +0 -1
  99. package/dist/Select/Select.test.js +0 -182
  100. package/dist/Select/Select.test.js.map +0 -1
  101. package/dist/Select/Select.types.js +0 -2
  102. package/dist/Select/Select.types.js.map +0 -1
  103. package/dist/Select/index.js +0 -2
  104. package/dist/Select/index.js.map +0 -1
  105. package/dist/Tabs/Tabs.js +0 -22
  106. package/dist/Tabs/Tabs.js.map +0 -1
  107. package/dist/Tabs/Tabs.stories.js +0 -91
  108. package/dist/Tabs/Tabs.stories.js.map +0 -1
  109. package/dist/Tabs/Tabs.test.js +0 -91
  110. package/dist/Tabs/Tabs.test.js.map +0 -1
  111. package/dist/Tabs/Tabs.types.js +0 -2
  112. package/dist/Tabs/Tabs.types.js.map +0 -1
  113. package/dist/Tabs/index.js +0 -2
  114. package/dist/Tabs/index.js.map +0 -1
  115. package/dist/TextArea/TextArea.js +0 -23
  116. package/dist/TextArea/TextArea.js.map +0 -1
  117. package/dist/TextArea/TextArea.stories.js +0 -42
  118. package/dist/TextArea/TextArea.stories.js.map +0 -1
  119. package/dist/TextArea/TextArea.test.js +0 -68
  120. package/dist/TextArea/TextArea.test.js.map +0 -1
  121. package/dist/TextArea/TextArea.types.js +0 -2
  122. package/dist/TextArea/TextArea.types.js.map +0 -1
  123. package/dist/TextArea/index.js +0 -2
  124. package/dist/TextArea/index.js.map +0 -1
  125. package/dist/TextField/TextField.js +0 -66
  126. package/dist/TextField/TextField.js.map +0 -1
  127. package/dist/TextField/TextField.stories.js +0 -48
  128. package/dist/TextField/TextField.stories.js.map +0 -1
  129. package/dist/TextField/TextField.test.js +0 -35
  130. package/dist/TextField/TextField.test.js.map +0 -1
  131. package/dist/TextField/TextField.types.js +0 -2
  132. package/dist/TextField/TextField.types.js.map +0 -1
  133. package/dist/TextField/index.js +0 -2
  134. package/dist/TextField/index.js.map +0 -1
  135. package/dist/ToolbarButton/ToolbarButton.js +0 -75
  136. package/dist/ToolbarButton/ToolbarButton.js.map +0 -1
  137. package/dist/ToolbarButton/ToolbarButton.stories.js +0 -94
  138. package/dist/ToolbarButton/ToolbarButton.stories.js.map +0 -1
  139. package/dist/ToolbarButton/ToolbarButton.test.js +0 -93
  140. package/dist/ToolbarButton/ToolbarButton.test.js.map +0 -1
  141. package/dist/ToolbarButton/ToolbarButton.types.js +0 -2
  142. package/dist/ToolbarButton/ToolbarButton.types.js.map +0 -1
  143. package/dist/ToolbarButton/index.js +0 -2
  144. package/dist/ToolbarButton/index.js.map +0 -1
  145. package/dist/Tooltip/QTip.stories.js +0 -45
  146. package/dist/Tooltip/QTip.stories.js.map +0 -1
  147. package/dist/Tooltip/QTip.types.js +0 -2
  148. package/dist/Tooltip/QTip.types.js.map +0 -1
  149. package/dist/Tooltip/QTipPerformance.stories.js +0 -30
  150. package/dist/Tooltip/QTipPerformance.stories.js.map +0 -1
  151. package/dist/Tooltip/Qtip.js +0 -155
  152. package/dist/Tooltip/Qtip.js.map +0 -1
  153. package/dist/Tooltip/Tooltip.js +0 -36
  154. package/dist/Tooltip/Tooltip.js.map +0 -1
  155. package/dist/Tooltip/Tooltip.stories.js +0 -32
  156. package/dist/Tooltip/Tooltip.stories.js.map +0 -1
  157. package/dist/Tooltip/Tooltip.types.js +0 -3
  158. package/dist/Tooltip/Tooltip.types.js.map +0 -1
  159. package/dist/Tooltip/TooltipPerformance.stories.js +0 -30
  160. package/dist/Tooltip/TooltipPerformance.stories.js.map +0 -1
  161. package/dist/Tooltip/index.js +0 -3
  162. package/dist/Tooltip/index.js.map +0 -1
  163. package/dist/Tooltip/qTip.utilities.js +0 -11
  164. package/dist/Tooltip/qTip.utilities.js.map +0 -1
  165. package/dist/types.js +0 -2
  166. package/dist/types.js.map +0 -1
  167. package/dist/utils/browserId.js +0 -29
  168. package/dist/utils/browserId.js.map +0 -1
  169. package/dist/utils/svg.js +0 -20
  170. package/dist/utils/svg.js.map +0 -1
@@ -1,91 +0,0 @@
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 Tabs from './Tabs';
6
- const renderData = () => (React.createElement("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white" },
7
- React.createElement("p", { className: "tw-mb-5 tw-text-[15px] tw-leading-normal" }, "This is a data tab to show details about your data. You can make changes to your account"),
8
- React.createElement("button", null, "save data")));
9
- const renderTools = () => (React.createElement("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white" },
10
- React.createElement("p", { className: "tw-mb-5 tw-text-[15px] tw-leading-normal" }, "Make changes to your account here. Click save when you're done."),
11
- React.createElement("button", null, "save tools")));
12
- const renderJournal = () => (React.createElement("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white" },
13
- React.createElement("p", { className: "tw-mb-5 tw-text-[15px] tw-leading-normal" }, "Make changes to your account here. Click save when you're done."),
14
- React.createElement("button", null, "save journal")));
15
- const tabsList = [
16
- {
17
- id: 'data',
18
- label: 'Data',
19
- icon: 'fc-data',
20
- content: renderData(),
21
- },
22
- {
23
- id: 'tools',
24
- label: 'Tools',
25
- icon: 'fc-gears-2',
26
- content: renderTools(),
27
- },
28
- {
29
- id: 'journal',
30
- label: 'Journal',
31
- icon: 'fc-workbook-lock',
32
- content: renderJournal(),
33
- },
34
- ];
35
- const mockTabsClick = jest.fn();
36
- const SampleComponent = (props) => {
37
- const [activeTab, setActiveTab] = React.useState('data');
38
- return (React.createElement(Tabs, { ...props, activeTab: activeTab, onTabSelect: (tabId) => {
39
- setActiveTab(tabId);
40
- mockTabsClick(tabId);
41
- } }));
42
- };
43
- describe('Tabs', () => {
44
- class Context {
45
- props = {
46
- tabs: tabsList,
47
- defaultActiveTab: 'data',
48
- activeTab: 'data',
49
- id: 'tabs-table',
50
- onTabSelect: jest.fn(),
51
- };
52
- }
53
- let tc;
54
- beforeEach(() => {
55
- tc = new Context();
56
- });
57
- const renderTabs = (props) => render(React.createElement(SampleComponent, { ...props }));
58
- it('renders Tabs label with correct content based on default active tab', () => {
59
- renderTabs(tc.props);
60
- expect(screen.getByText('Data')).toBeInTheDocument();
61
- expect(screen.getByText('Tools')).toBeInTheDocument();
62
- expect(screen.getByText('Journal')).toBeInTheDocument();
63
- expect(screen.getByTestId('journal_tab-icon')).toBeInTheDocument();
64
- expect(screen.getByText('save data')).toBeInTheDocument();
65
- expect(screen.queryByText('save tools')).not.toBeInTheDocument();
66
- expect(screen.queryByText('save journals')).not.toBeInTheDocument();
67
- });
68
- it('renders correct content after tab is selected', async () => {
69
- renderTabs(tc.props);
70
- expect(screen.getByText('save data')).toBeInTheDocument();
71
- await userEvent.click(screen.getByText('Tools'));
72
- expect(mockTabsClick).toHaveBeenCalled();
73
- expect(screen.getByText('save tools')).toBeInTheDocument();
74
- });
75
- it('does not render icon if it is not provided', async () => {
76
- renderTabs({ ...tc.props, tabs: tc.props.tabs.map((tab) => ({ ...tab, icon: undefined })) });
77
- expect(screen.queryByText('journal_tab-icon')).not.toBeInTheDocument();
78
- });
79
- it('calls the onTabSelect callback when a new tab is clicked', async () => {
80
- mockTabsClick.mockClear();
81
- renderTabs(tc.props);
82
- await userEvent.click(screen.getByText('Journal'));
83
- expect(mockTabsClick).toBeCalledWith('journal');
84
- expect(mockTabsClick).toBeCalledTimes(1);
85
- mockTabsClick.mockClear();
86
- await userEvent.click(screen.getByText('Tools'));
87
- expect(mockTabsClick).toBeCalledWith('tools');
88
- expect(mockTabsClick).toBeCalledTimes(1);
89
- });
90
- });
91
- //# sourceMappingURL=Tabs.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.test.js","sourceRoot":"","sources":["../../src/Tabs/Tabs.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,IAAI,MAAM,QAAQ,CAAC;AAG1B,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CACvB,6BAAK,SAAS,EAAC,6CAA6C;IAC1D,2BAAG,SAAS,EAAC,0CAA0C,+FAEnD;IACJ,gDAA0B,CACtB,CACP,CAAC;AAEF,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,6BAAK,SAAS,EAAC,6CAA6C;IAC1D,2BAAG,SAAS,EAAC,0CAA0C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CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Tabs.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.types.js","sourceRoot":"","sources":["../../src/Tabs/Tabs.types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { default } from './Tabs';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC"}
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import '../styles.css';
3
- const baseClasses = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm' +
4
- ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-text-sm';
5
- const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text ' + 'dark:tw-placeholder-sq-dark-text-lighter';
6
- const lightTheme = 'tw-text-sq-text-color tw-placeholder-gray-400';
7
- const errorClasses = 'tw-border-sq-danger-color';
8
- const borderColorClasses = [
9
- 'tw-border-sq-disabled-gray',
10
- 'dark:tw-border-sq-dark-disabled-gray',
11
- 'dark:focus:tw-border-sq-color-dark-dark',
12
- 'dark:active:tw-border-sq-color-dark-dark',
13
- 'focus:tw-border-sq-color-dark',
14
- 'active:tw-border-sq-color-dark',
15
- ].join(' ');
16
- /**
17
- * TextArea.
18
- */
19
- export const TextArea = ({ readonly = false, onChange, onKeyUp, id, name, rows = 3, cols = undefined, value, placeholder, extraClassNames, testId, autofocus = false, showError, }) => {
20
- const appliedClasses = `${baseClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${showError ? errorClasses : borderColorClasses}`;
21
- return (React.createElement("textarea", { "data-testid": testId, name: name, id: id, value: value, className: appliedClasses, placeholder: placeholder, disabled: readonly, onChange: onChange, onKeyUp: onKeyUp, rows: rows, cols: cols, autoFocus: autofocus }));
22
- };
23
- //# sourceMappingURL=TextArea.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../src/TextArea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,eAAe,CAAC;AAEvB,MAAM,WAAW,GACf,iEAAiE;IACjE,6EAA6E,CAAC;AAEhF,MAAM,SAAS,GACb,0DAA0D,GAAG,0CAA0C,CAAC;AAC1G,MAAM,UAAU,GAAG,+CAA+C,CAAC;AAEnE,MAAM,YAAY,GAAG,2BAA2B,CAAC;AAEjD,MAAM,kBAAkB,GAAG;IACzB,4BAA4B;IAC5B,sCAAsC;IACtC,yCAAyC;IACzC,0CAA0C;IAC1C,+BAA+B;IAC/B,gCAAgC;CACjC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA2C,CAAC,EAC/D,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,OAAO,EACP,EAAE,EACF,IAAI,EACJ,IAAI,GAAG,CAAC,EACR,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,WAAW,EACX,eAAe,EACf,MAAM,EACN,SAAS,GAAG,KAAK,EACjB,SAAS,GACV,EAAE,EAAE;IACH,MAAM,cAAc,GAAG,GAAG,WAAW,IAAI,eAAe,IAAI,UAAU,IAAI,SAAS,IACjF,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,kBAC7B,EAAE,CAAC;IAEH,OAAO,CACL,iDACe,MAAM,EACnB,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,cAAc,EACzB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,42 +0,0 @@
1
- import React from 'react';
2
- import { TextArea } from './TextArea';
3
- export default {
4
- title: 'TextArea',
5
- };
6
- export const AllTextAreas = () => {
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(TextArea, { value: "Short text provided." })),
11
- React.createElement("div", { className: "tw-p-4" },
12
- React.createElement(TextArea, { value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Odio morbi quis commodo odio aenean. Lectus sit amet est placerat in egestas erat. Dui nunc mattis enim ut tellus. Dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Nibh mauris cursus mattis molestie a. Aenean vel elit scelerisque mauris pellentesque. Nunc sed id semper risus in hendrerit gravida rutrum quisque. Tortor dignissim convallis aenean et tortor at risus. Vitae congue mauris rhoncus aenean vel elit scelerisque. Tellus id interdum velit laoreet id donec ultrices. Ac turpis egestas maecenas pharetra. Commodo odio aenean sed adipiscing diam donec adipiscing tristique risus. Consequat interdum varius sit amet mattis. Lacus laoreet non curabitur gravida arcu ac tortor. Vulputate sapien nec sagittis aliquam malesuada bibendum arcu vitae elementum. Odio ut enim blandit volutpat maecenas volutpat." })),
13
- React.createElement("div", { className: "tw-p-4" },
14
- React.createElement(TextArea, { placeholder: "placeholder text" })),
15
- React.createElement("div", { className: "tw-p-4" },
16
- React.createElement(TextArea, { placeholder: "with error", showError: true })),
17
- React.createElement("div", { className: "tw-p-4" },
18
- React.createElement(TextArea, { value: "read-only", readonly: true }))),
19
- React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
20
- React.createElement("div", { className: "tw-p-4" },
21
- React.createElement(TextArea, { value: "value provided" })),
22
- React.createElement("div", { className: "tw-p-4" },
23
- React.createElement(TextArea, { placeholder: "placeholder text" })),
24
- React.createElement("div", { className: "tw-p-4" },
25
- React.createElement(TextArea, { placeholder: "with error", showError: true })),
26
- React.createElement("div", { className: "tw-p-4" },
27
- React.createElement(TextArea, { value: "read-only", readonly: true })))));
28
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
29
- React.createElement("div", { className: "color_topic" },
30
- React.createElement("b", null, "Topic Colors"),
31
- renderAllVariations()),
32
- React.createElement("div", { className: "color_analysis" },
33
- React.createElement("b", null, "Analysis Colors"),
34
- renderAllVariations()),
35
- React.createElement("div", { className: "color_datalab" },
36
- React.createElement("b", null, "Datalab Colors"),
37
- renderAllVariations()),
38
- React.createElement("div", { className: "color_vantage" },
39
- React.createElement("b", null, "Vantage Colors"),
40
- renderAllVariations())));
41
- };
42
- //# sourceMappingURL=TextArea.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextArea.stories.js","sourceRoot":"","sources":["../../src/TextArea/TextArea.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,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC;QACE,6BAAK,SAAS,EAAC,cAAc;YAC3B,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,sBAAsB,GAAG,CACrC;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,q7BAAq7B,GAAG,CACp8B;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,QAAQ,IAAC,WAAW,EAAC,kBAAkB,GAAG,CACvC;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,QAAQ,IAAC,WAAW,EAAC,YAAY,EAAC,SAAS,EAAE,IAAI,GAAI,CAClD;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,WAAW,EAAC,QAAQ,EAAE,IAAI,GAAI,CAC1C,CACF;QAEN,6BAAK,SAAS,EAAC,yCAAyC;YACtD,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,gBAAgB,GAAG,CAC/B;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,QAAQ,IAAC,WAAW,EAAC,kBAAkB,GAAG,CACvC;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,QAAQ,IAAC,WAAW,EAAC,YAAY,EAAC,SAAS,EAAE,IAAI,GAAI,CAClD;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,WAAW,EAAC,QAAQ,EAAE,IAAI,GAAI,CAC1C,CACF,CACL,CACJ,CAAC;IACF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,6BAAK,SAAS,EAAC,aAAa;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;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,68 +0,0 @@
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 { TextArea } from './TextArea';
6
- describe('TextArea', () => {
7
- class Context {
8
- testId = 'textAreaTestId';
9
- props = {
10
- onChange: jest.fn(),
11
- onKeyUp: jest.fn(),
12
- testId: this.testId,
13
- };
14
- }
15
- let tc;
16
- beforeEach(() => {
17
- tc = new Context();
18
- });
19
- const renderTextArea = (props) => render(React.createElement(TextArea, { ...props }));
20
- it('renders the provided value', () => {
21
- const value = 'hello, this is text for a text area.';
22
- renderTextArea({ ...tc.props, value });
23
- expect(screen.getByDisplayValue(value)).toBeInTheDocument();
24
- });
25
- it('renders the provided placeholder', () => {
26
- const placeholder = 'Prompt to enter';
27
- renderTextArea({ ...tc.props, placeholder });
28
- expect(screen.getByPlaceholderText(placeholder)).toBeInTheDocument();
29
- });
30
- it('calls onChange handler', async () => {
31
- renderTextArea({ ...tc.props });
32
- await userEvent.type(screen.getByTestId(tc.testId), 'trigger');
33
- expect(tc.props.onChange).toHaveBeenCalled();
34
- });
35
- it('calls the onKeyUp handler', async () => {
36
- renderTextArea({ ...tc.props });
37
- await userEvent.type(screen.getByTestId(tc.testId), 'trigger');
38
- expect(tc.props.onKeyUp).toHaveBeenCalled();
39
- });
40
- it('respects readOnly', async () => {
41
- renderTextArea({ ...tc.props, readonly: true });
42
- expect(screen.getByTestId(tc.testId)).not.toBeEnabled();
43
- });
44
- it('provides rows', async () => {
45
- renderTextArea({ ...tc.props, rows: 7 });
46
- expect(screen.getByTestId(tc.testId)).toHaveProperty('rows', 7);
47
- });
48
- it('provides cols', async () => {
49
- renderTextArea({ ...tc.props, cols: 8 });
50
- expect(screen.getByTestId(tc.testId)).toHaveProperty('cols', 8);
51
- });
52
- it('provides name', async () => {
53
- const name = 'myTextArea';
54
- renderTextArea({ ...tc.props, name });
55
- expect(screen.getByTestId(tc.testId)).toHaveProperty('name', name);
56
- });
57
- it('provides id', async () => {
58
- const id = 'myTextId';
59
- renderTextArea({ ...tc.props, id });
60
- expect(screen.getByTestId(tc.testId)).toHaveProperty('id', id);
61
- });
62
- it('provides extraClassNames', async () => {
63
- const extraClassNames = 'extra css';
64
- renderTextArea({ ...tc.props, extraClassNames });
65
- expect(screen.getByTestId(tc.testId)).toHaveClass(extraClassNames);
66
- });
67
- });
68
- //# sourceMappingURL=TextArea.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextArea.test.js","sourceRoot":"","sources":["../../src/TextArea/TextArea.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;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,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,IAAI,CAAC,EAAE,EAAE;YAClB,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,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,KAAK,GAAG,sCAAsC,CAAC;QACrD,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,WAAW,GAAG,iBAAiB,CAAC;QACtC,cAAc,CAAC,EAAE,GAAG,EAAE,CAA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AM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TextArea.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextArea.types.js","sourceRoot":"","sources":["../../src/TextArea/TextArea.types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { TextArea as default } from './TextArea';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TextArea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -1,66 +0,0 @@
1
- import React, { useEffect, useRef, useState } from 'react';
2
- import '../styles.css';
3
- const errorClasses = 'tw-border-sq-danger-color';
4
- const borderColorClasses = [
5
- 'tw-border-sq-disabled-gray',
6
- 'dark:tw-border-sq-dark-disabled-gray',
7
- 'dark:focus:tw-border-sq-color-dark-dark',
8
- 'dark:active:tw-border-sq-color-dark-dark',
9
- 'focus:tw-border-sq-color-dark',
10
- 'active:tw-border-sq-color-dark',
11
- ].join(' ');
12
- const baseClasses = 'tw-h-inputs tw-leading-normal tw-outline-none tw-py-1 tw-px-3' +
13
- ' disabled:tw-pointer-events-none' +
14
- ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-placeholder-gray-400' +
15
- ' dark:tw-placeholder-sq-dark-text-lighter specTextField';
16
- const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text';
17
- const lightTheme = 'tw-text-sq-text-color';
18
- const sizeClasses = {
19
- sm: 'tw-text-sm',
20
- lg: 'tw-text-xl',
21
- };
22
- /**
23
- * Textfield.
24
- */
25
- export const TextField = React.forwardRef((props, ref) => {
26
- const { readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, errorText, required = false, autoComplete = 'off' } = props;
27
- const internalRef = useRef(null);
28
- const [cursor, setCursor] = useState(null);
29
- const setAllRefs = (receivedRef) => {
30
- if (ref)
31
- ref.current = receivedRef;
32
- internalRef.current = receivedRef;
33
- };
34
- useEffect(() => {
35
- const input = internalRef.current;
36
- if (input && type !== 'number')
37
- input.setSelectionRange(cursor, cursor);
38
- }, [ref, cursor, value]);
39
- const handleChange = (e) => {
40
- setCursor(e.target.selectionStart);
41
- onChange && onChange(e);
42
- };
43
- useEffect(() => {
44
- /**
45
- * we need to change the value only if it's different since the internal state of "input" will change it anyway
46
- * this will only be the case when the value has been changed externally via store (undo / redo)
47
- */
48
- if (value !== null && value !== undefined && value !== internalRef.current?.value && internalRef.current) {
49
- // we need to use this method because using the value props directly will switch the input to a "controlled"
50
- // component
51
- internalRef.current.value = `${value}`;
52
- }
53
- }, [value]);
54
- let borderRadius = 'tw-rounded-sm';
55
- if (inputGroup === 'left') {
56
- borderRadius = 'tw-rounded-l-sm tw-border-r-0 focus:tw-border-r' + ' active:tw-border-r';
57
- }
58
- else if (inputGroup === 'right') {
59
- borderRadius = 'tw-rounded-r-sm tw-border-l-0 focus:tw-border-l active:tw-border-l';
60
- }
61
- const appliedClasses = `${baseClasses} ${sizeClasses[size]} ${extraClassNames} ${lightTheme} ${darkTheme} ${borderRadius} ${showError ? errorClasses : borderColorClasses} `;
62
- return (React.createElement("div", { className: "tw-w-full" },
63
- React.createElement("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: readonly, autoComplete: autoComplete, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, step: step, required: required }),
64
- errorText && showError && React.createElement("div", { className: "tw-text-sq-danger-color tw-text-xs tw-mt-1" }, errorText)));
65
- });
66
- //# sourceMapping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AAI,YAAY,IAAI,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,kBAAkB,GAAG,CAAC;IAEnH,OAAO,CACL,6BAAK,SAAS,EAAC,WAAW;QACxB,+BACE,GAAG,EAAE,UAAU,iBACF,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,EAAE,YAAY,EAC1B,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,GAClB;QACD,SAAS,IAAI,SAAS,IAAI,6BAAK,SAAS,EAAC,4CAA4C,IAAE,SAAS,CAAO,CACpG,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import { TextField } from './TextField';
3
- export default {
4
- title: 'TextField',
5
- };
6
- export const AllTextFields = () => {
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, { placeholder: "with error", showError: true })),
15
- React.createElement("div", { className: "tw-p-4" },
16
- React.createElement(TextField, { placeholder: "with error text", showError: true, errorText: "this is a major test error and it is long on purpose to see its looks" })),
17
- React.createElement("div", { className: "tw-p-4" },
18
- React.createElement(TextField, { value: "read-only", readonly: true })),
19
- React.createElement("div", { className: "tw-p-4" },
20
- React.createElement(TextField, { value: "large", size: "lg" }))),
21
- React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
22
- React.createElement("div", { className: "tw-p-4" },
23
- React.createElement(TextField, { value: "value provided" })),
24
- React.createElement("div", { className: "tw-p-4" },
25
- React.createElement(TextField, { placeholder: "placeholder text" })),
26
- React.createElement("div", { className: "tw-p-4" },
27
- React.createElement(TextField, { placeholder: "with error", showError: true })),
28
- React.createElement("div", { className: "tw-p-4" },
29
- React.createElement(TextField, { placeholder: "with error text", showError: true, errorText: "this is a major test error and it is long on purpose to see its looks" })),
30
- React.createElement("div", { className: "tw-p-4" },
31
- React.createElement(TextField, { value: "read-only", readonly: true })),
32
- React.createElement("div", { className: "tw-p-4" },
33
- React.createElement(TextField, { value: "large", size: "lg" })))));
34
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
35
- React.createElement("div", { className: "color_topic" },
36
- React.createElement("b", null, "Topic Colors"),
37
- renderAllVariations()),
38
- React.createElement("div", { className: "color_analysis" },
39
- React.createElement("b", null, "Analysis Colors"),
40
- renderAllVariations()),
41
- React.createElement("div", { className: "color_datalab" },
42
- React.createElement("b", null, "Datalab Colors"),
43
- renderAllVariations()),
44
- React.createElement("div", { className: "color_vantage" },
45
- React.createElement("b", null, "Vantage Colors"),
46
- renderAllVariations())));
47
- };
48
- //# sourceMappingURL=TextField.stories.js.map
@@ -1 +0,0 @@
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,KAAK,EAAE,WAAW;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC;QACE,6BAAK,SAAS,EAAC,cAAc;YAC3B,6BAAK,SAAS,EAAC,QAAQ;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C,QAAQ;gBACrB,oBAAC,SAAS,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,GAAG,CACjC,CACF,CACL,CACJ,CAAC;IACF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,6BAAK,SAAS,EAAC,aAAa;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;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,35 +0,0 @@
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 { TextField } from './TextField';
6
- describe('TextField', () => {
7
- class Context {
8
- testId = 'textFieldTestId';
9
- props = {
10
- onChange: jest.fn(),
11
- testId: this.testId,
12
- };
13
- }
14
- let tc;
15
- beforeEach(() => {
16
- tc = new Context();
17
- });
18
- const renderTextField = (props) => render(React.createElement(TextField, { ...props }));
19
- it('renders the provided value', () => {
20
- const value = 'hello';
21
- renderTextField({ ...tc.props, value });
22
- expect(screen.getByDisplayValue(value)).toBeInTheDocument();
23
- });
24
- it('renders the provided placeholder', () => {
25
- const placeholder = 'Prompt to enter';
26
- renderTextField({ ...tc.props, placeholder });
27
- expect(screen.getByPlaceholderText(placeholder)).toBeInTheDocument();
28
- });
29
- it('calls onChange handler', async () => {
30
- renderTextField({ ...tc.props });
31
- await userEvent.type(screen.getByTestId(tc.testId), 'trigger');
32
- expect(tc.props.onChange).toHaveBeenCalled();
33
- });
34
- });
35
- //# sourceMappingURL=TextField.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextField.test.js","sourceRoot":"","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CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QACjC,MAAM,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;QAC/D,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TextField.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextField.types.js","sourceRoot":"","sources":["../../src/TextField/TextField.types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { TextField as default } from './TextField';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC"}
@@ -1,75 +0,0 @@
1
- import * as React from 'react';
2
- import * as PopoverPrimitive from '@radix-ui/react-popover';
3
- import Icon from '../Icon';
4
- import { DEFAULT_TOOL_TIP_DELAY } from '../Tooltip/Tooltip.types';
5
- import { getSvgIconPath } from '../utils/svg';
6
- const borderStyles = [
7
- 'tw-border-solid',
8
- 'tw-border',
9
- 'tw-rounded-sm',
10
- 'tw-border-sq-disabled-gray',
11
- 'dark:tw-border-gray-500',
12
- ].join(' ');
13
- const triggerBorderStyles = [
14
- 'tw-border-solid',
15
- 'tw-border',
16
- 'tw-rounded-sm',
17
- 'tw-border-transparent',
18
- 'hover:tw-border-solid',
19
- 'hover:tw-border',
20
- 'hover:tw-rounded-sm',
21
- 'hover:tw-border-sq-darkish-gray',
22
- 'active:tw-border-sq-color-dark',
23
- 'dark:hover:tw-border-sq-color-dark-dark',
24
- 'dark:focus:tw-border-sq-color-dark-dark',
25
- 'dark:active:tw-border-sq-color-dark-dark',
26
- ].join(' ');
27
- const activeBorderStyles = [
28
- 'active',
29
- 'tw-border-solid',
30
- 'tw-border',
31
- 'tw-rounded-sm',
32
- 'tw-border-sq-color-dark',
33
- 'active:tw-border-sq-color-dark',
34
- 'dark:hover:tw-border-sq-color-dark-dark',
35
- ].join(' ');
36
- const bgStyles = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
37
- const disabledClasses = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
38
- const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (React.createElement(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, ...props, asChild: true })));
39
- export const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIcon = false, tooltipText, id, popoverContent, extraClassNames, testId, tooltipTestId, tooltipOptions, isActive = false, isHtmlTooltip = false, hasArrow = false, disabled = false, isPrimaryAnSvg = false, primaryIconExtraClassNames = false, iconHeight = 24, iconWidth = 24, primaryIconViewbox = '0 0 24 24', onClick, onHide, }) => {
40
- let tooltipData = undefined;
41
- if (tooltipText) {
42
- tooltipData = {
43
- 'data-qtip-text': tooltipText,
44
- 'data-qtip-placement': tooltipOptions?.position,
45
- 'data-qtip-is-html': isHtmlTooltip,
46
- 'data-qtip-testid': tooltipTestId,
47
- 'data-qtip-delay': tooltipOptions?.delay ?? DEFAULT_TOOL_TIP_DELAY,
48
- };
49
- }
50
- const onOpenChange = (open) => {
51
- if (!open) {
52
- onHide && onHide();
53
- }
54
- };
55
- return (React.createElement(PopoverPrimitive.Root, { defaultOpen: false, onOpenChange: onOpenChange },
56
- React.createElement(PopoverPrimitive.Trigger, { id: id, className: `tw-border-none ${isActive ? 'active' : ''}`, disabled: disabled, "data-testid": testId, onClick: (e) => {
57
- onClick && onClick(e);
58
- } },
59
- React.createElement("div", { ...tooltipData, className: `tw-bg-transparent tw-p-0 tw-flex tw-flex-col tw-items-center ${isSmall ? 'tw-py-[1px] tw-px-[5px]' : 'tw-px-2 tw-py-[5px]'} ${disabled ? disabledClasses : isActive ? activeBorderStyles : triggerBorderStyles} ${extraClassNames || ''}` },
60
- React.createElement("span", { className: "tw-nowrap" },
61
- isPrimaryAnSvg ? (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: `tw-text-sq-text-color dark:tw-text-sq-dark-text ${primaryIconExtraClassNames || ''}`, viewBox: primaryIconViewbox, height: `${iconHeight}px`, width: `${iconWidth}px`, fill: "currentColor", "data-testid": testId },
62
- React.createElement("path", { d: getSvgIconPath(icon) }))) : (React.createElement(Icon, { icon: icon, testId: "firstIcon", type: "text", large: !isSmall && !label && !secondIcon && !forceSmallIcon, extraClassNames: `tw-text-sq-text-color dark:tw-text-sq-dark-text` })),
63
- secondIcon && React.createElement(Icon, { icon: secondIcon, type: "text", testId: "secondIcon" }),
64
- popoverContent ? (React.createElement(Icon, { icon: "fc-arrow-dropdown", extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-dark-text tw-ml-[3px] tw-text-[8px]", type: "text" })) : undefined),
65
- !isSmall && (React.createElement("small", { className: "tw-text-sq-text-color dark:tw-text-sq-dark-text tw-text-[10px]" }, label)))),
66
- !!popoverContent ? (React.createElement(PopoverContent, { sideOffset: 2, align: "start" },
67
- React.createElement("div", { className: bgStyles +
68
- ' tw-relative tw-z-[1000] tw-min-w-6 tw-p-[0.5rem] focus-visible:tw-outline-none tw-outline-none data-[state=open]:animate-in data-[state=closed]:animate-out' +
69
- ' data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2' +
70
- borderStyles },
71
- hasArrow && (React.createElement(PopoverPrimitive.Arrow, { asChild: true },
72
- React.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-mt-[-7px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500" }))),
73
- popoverContent))) : undefined));
74
- };
75
- //# sourceMappingURL=ToolbarButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToolbarButton.js","sourceRoot":"","sources":["../../src/ToolbarButton/ToolbarButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAE5D,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,YAAY,GAAG;IACnB,iBAAiB;IACjB,WAAW;IACX,eAAe;IACf,4BAA4B;IAC5B,yBAAyB;CAC1B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,mBAAmB,GAAG;IAC1B,iBAAiB;IACjB,WAAW;IACX,eAAe;IACf,uBAAuB;IACvB,uBAAuB;IACvB,iBAAiB;IACjB,qBAAqB;IACrB,iCAAiC;IACjC,gCAAgC;IAChC,yCAAyC;IACzC,yCAAyC;IACzC,0CAA0C;CAC3C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,kBAAkB,GAAG;IACzB,QAAQ;IACR,iBAAiB;IACjB,WAAW;IACX,eAAe;IACf,yBAAyB;IACzB,gCAAgC;IAChC,yCAAyC;CAC1C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,QAAQ,GAAG,CAAC,gBAAgB,EAAE,+BAA+B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/E,MAAM,eAAe,GAAG,CAAC,eAAe,EAA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