@seeqdev/qomponents 0.0.106 → 0.0.108

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 (110) hide show
  1. package/dist/Accordion/Accordion.js +8 -8
  2. package/dist/Accordion/Accordion.stories.js +114 -114
  3. package/dist/Accordion/Accordion.test.js +54 -54
  4. package/dist/Accordion/Accordion.types.js +1 -1
  5. package/dist/Accordion/index.js +1 -1
  6. package/dist/Alert/Alert.js +31 -31
  7. package/dist/Alert/Alert.stories.js +44 -44
  8. package/dist/Alert/Alert.test.js +50 -50
  9. package/dist/Alert/Alert.types.js +1 -1
  10. package/dist/Alert/index.js +1 -1
  11. package/dist/Button/Button.js +91 -89
  12. package/dist/Button/Button.js.map +1 -1
  13. package/dist/Button/Button.stories.js +97 -97
  14. package/dist/Button/Button.test.js +48 -48
  15. package/dist/Button/Button.types.js +4 -4
  16. package/dist/Button/index.js +1 -1
  17. package/dist/ButtonWithDropdown/ButtonWithDropdown.js +66 -66
  18. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +97 -97
  19. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +84 -84
  20. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +1 -1
  21. package/dist/ButtonWithDropdown/index.js +1 -1
  22. package/dist/ButtonWithPopover/ButtonWithPopover.js +50 -50
  23. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +74 -74
  24. package/dist/ButtonWithPopover/ButtonWithPopover.test.js +81 -81
  25. package/dist/ButtonWithPopover/ButtonWithPopover.types.js +1 -1
  26. package/dist/ButtonWithPopover/index.js +1 -1
  27. package/dist/Checkbox/Checkbox.js +25 -25
  28. package/dist/Checkbox/Checkbox.stories.js +33 -33
  29. package/dist/Checkbox/Checkbox.test.js +93 -93
  30. package/dist/Checkbox/Checkbox.types.js +1 -1
  31. package/dist/Checkbox/index.js +1 -1
  32. package/dist/Icon/Icon.js +53 -53
  33. package/dist/Icon/Icon.stories.js +44 -44
  34. package/dist/Icon/Icon.test.js +54 -54
  35. package/dist/Icon/Icon.types.js +15 -15
  36. package/dist/Icon/index.js +1 -1
  37. package/dist/InputGroup/InputGroup.d.ts +7 -0
  38. package/dist/InputGroup/InputGroup.js +25 -26
  39. package/dist/InputGroup/InputGroup.js.map +1 -1
  40. package/dist/InputGroup/InputGroup.stories.d.ts +5 -0
  41. package/dist/InputGroup/InputGroup.stories.js +141 -65
  42. package/dist/InputGroup/InputGroup.stories.js.map +1 -1
  43. package/dist/InputGroup/InputGroup.test.d.ts +1 -1
  44. package/dist/InputGroup/InputGroup.test.js +42 -39
  45. package/dist/InputGroup/InputGroup.test.js.map +1 -1
  46. package/dist/InputGroup/InputGroup.types.d.ts +20 -0
  47. package/dist/InputGroup/InputGroup.types.js +1 -1
  48. package/dist/InputGroup/index.d.ts +1 -0
  49. package/dist/InputGroup/index.js +1 -1
  50. package/dist/Modal/Modal.js +97 -97
  51. package/dist/Modal/Modal.stories.js +126 -126
  52. package/dist/Modal/Modal.test.js +107 -107
  53. package/dist/Modal/Modal.types.js +1 -1
  54. package/dist/Modal/index.js +1 -1
  55. package/dist/SeeqActionDropdown/SeeqActionDropdown.js +47 -47
  56. package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js +79 -79
  57. package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js +72 -72
  58. package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js +1 -1
  59. package/dist/SeeqActionDropdown/index.js +1 -1
  60. package/dist/SeeqActionDropdown/variants.js +22 -22
  61. package/dist/Select/Select.js +173 -173
  62. package/dist/Select/Select.stories.js +79 -79
  63. package/dist/Select/Select.test.js +181 -181
  64. package/dist/Select/Select.types.js +1 -1
  65. package/dist/Select/index.js +2 -2
  66. package/dist/Tabs/Tabs.js +21 -21
  67. package/dist/Tabs/Tabs.stories.js +90 -90
  68. package/dist/Tabs/Tabs.test.js +90 -90
  69. package/dist/Tabs/Tabs.types.js +1 -1
  70. package/dist/Tabs/index.js +1 -1
  71. package/dist/TextArea/TextArea.js +24 -24
  72. package/dist/TextArea/TextArea.stories.js +45 -45
  73. package/dist/TextArea/TextArea.test.js +67 -67
  74. package/dist/TextArea/TextArea.types.js +1 -1
  75. package/dist/TextArea/index.js +1 -1
  76. package/dist/TextField/TextField.js +78 -76
  77. package/dist/TextField/TextField.js.map +1 -1
  78. package/dist/TextField/TextField.stories.js +69 -63
  79. package/dist/TextField/TextField.stories.js.map +1 -1
  80. package/dist/TextField/TextField.test.js +38 -38
  81. package/dist/TextField/TextField.types.d.ts +2 -1
  82. package/dist/TextField/TextField.types.js +1 -1
  83. package/dist/TextField/index.js +1 -1
  84. package/dist/ToolbarButton/ToolbarButton.js +74 -74
  85. package/dist/ToolbarButton/ToolbarButton.stories.js +93 -93
  86. package/dist/ToolbarButton/ToolbarButton.test.js +92 -92
  87. package/dist/ToolbarButton/ToolbarButton.types.js +1 -1
  88. package/dist/ToolbarButton/index.js +1 -1
  89. package/dist/Tooltip/QTip.stories.js +44 -44
  90. package/dist/Tooltip/QTip.types.js +1 -1
  91. package/dist/Tooltip/QTipPerformance.stories.js +29 -29
  92. package/dist/Tooltip/Qtip.js +154 -154
  93. package/dist/Tooltip/Tooltip.js +30 -30
  94. package/dist/Tooltip/Tooltip.stories.js +31 -31
  95. package/dist/Tooltip/Tooltip.types.js +2 -2
  96. package/dist/Tooltip/TooltipPerformance.stories.js +29 -29
  97. package/dist/Tooltip/index.js +2 -2
  98. package/dist/Tooltip/qTip.utilities.js +10 -10
  99. package/dist/index.d.ts +2 -0
  100. package/dist/index.esm.js +41 -17
  101. package/dist/index.esm.js.map +1 -1
  102. package/dist/index.js +41 -16
  103. package/dist/index.js.map +1 -1
  104. package/dist/styles.css +563 -520
  105. package/dist/types.js +1 -1
  106. package/dist/utils/browserId.js +28 -28
  107. package/dist/utils/svg.js +19 -19
  108. package/dist/utils/validateStyleDimension.js +13 -13
  109. package/dist/utils/validateStyleDimension.test.js +19 -19
  110. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const AllTextFields: () => JSX.Element;
@@ -1,66 +1,142 @@
1
- import React from 'react';
2
- import { InputGroup } from './InputGroup';
3
- import TextField from '../TextField';
4
- import Button from '../Button';
5
- import { QTip } from '../Tooltip/Qtip';
6
- export default {
7
- title: 'InputGroup',
8
- };
9
- export const AllTextFields = () => {
10
- const renderAllVariations = () => (React.createElement(React.Fragment, null,
11
- React.createElement("div", { className: "light" },
12
- React.createElement("div", { className: "tw-p-4" },
13
- React.createElement(InputGroup, { input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "value provided" }), append: [
14
- React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" }),
15
- React.createElement(Button, { icon: "fc-trash", iconStyle: "theme", extraClassNames: "tw-h-full" }),
16
- ] })),
17
- React.createElement("div", { className: "tw-p-4" },
18
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "with tooltip" }), append: [
19
- React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" }),
20
- React.createElement(Button, { icon: "fc-trash", iconStyle: "theme", extraClassNames: "tw-h-full" }),
21
- ] })),
22
- React.createElement("div", { className: "tw-p-4" },
23
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "with tooltip" }), append: [React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" })] })),
24
- React.createElement("div", { className: "tw-p-4" },
25
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "with tooltip" }), append: [React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" })], prepend: [React.createElement(Button, { icon: "fc-causality", iconStyle: "theme", extraClassNames: "tw-h-full" })] })),
26
- React.createElement("div", { className: "tw-p-4" },
27
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "with tooltip" }), append: [
28
- React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" }),
29
- React.createElement(Button, { icon: "fc-trash", iconStyle: "theme", extraClassNames: "tw-h-full" }),
30
- ], prepend: [React.createElement(Button, { icon: "fc-causality", iconStyle: "theme", extraClassNames: "tw-h-full" })] }))),
31
- React.createElement("div", { className: "tw-dark tw-bg-sq-dark-background" },
32
- React.createElement("div", { className: "tw-p-4" },
33
- React.createElement(InputGroup, { input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "value provided" }), append: [
34
- React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" }),
35
- React.createElement(Button, { icon: "fc-trash", iconStyle: "theme", extraClassNames: "tw-h-full" }),
36
- ] })),
37
- React.createElement("div", { className: "tw-p-4" },
38
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "with tooltip" }), append: [
39
- React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" }),
40
- React.createElement(Button, { icon: "fc-trash", iconStyle: "theme", extraClassNames: "tw-h-full" }),
41
- ] })),
42
- React.createElement("div", { className: "tw-p-4" },
43
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "with tooltip" }), append: [React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" })] })),
44
- React.createElement("div", { className: "tw-p-4" },
45
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "with tooltip" }), append: [React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" })], prepend: [React.createElement(Button, { icon: "fc-causality", iconStyle: "theme", extraClassNames: "tw-h-full" })] })),
46
- React.createElement("div", { className: "tw-p-4" },
47
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, input: React.createElement(TextField, { extraClassNames: "tw-w-full tw-rounded-r-none", value: "with tooltip" }), append: [
48
- React.createElement(Button, { icon: "fc-annotate", iconStyle: "theme", extraClassNames: "tw-h-full" }),
49
- React.createElement(Button, { icon: "fc-trash", iconStyle: "theme", extraClassNames: "tw-h-full" }),
50
- ], prepend: [React.createElement(Button, { icon: "fc-causality", iconStyle: "theme", extraClassNames: "tw-h-full" })] })))));
51
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
52
- React.createElement(QTip, null),
53
- React.createElement("div", { className: "color_topic" },
54
- React.createElement("b", null, "Topic Colors"),
55
- renderAllVariations()),
56
- React.createElement("div", { className: "color_analysis" },
57
- React.createElement("b", null, "Analysis Colors"),
58
- renderAllVariations()),
59
- React.createElement("div", { className: "color_datalab" },
60
- React.createElement("b", null, "Datalab Colors"),
61
- renderAllVariations()),
62
- React.createElement("div", { className: "color_vantage" },
63
- React.createElement("b", null, "Vantage Colors"),
64
- renderAllVariations())));
65
- };
1
+ import React from 'react';
2
+ import { InputGroup } from './InputGroup';
3
+ import { QTip } from '../Tooltip/Qtip';
4
+ export default {
5
+ title: 'InputGroup',
6
+ };
7
+ export const AllTextFields = () => {
8
+ const renderAllVariations = () => (React.createElement(React.Fragment, null,
9
+ React.createElement("div", { className: "light" },
10
+ React.createElement("div", { className: "tw-p-4" },
11
+ React.createElement(InputGroup, { value: "value provided", append: [
12
+ {
13
+ variant: 'button',
14
+ buttonProps: {
15
+ icon: 'fc-annotate',
16
+ iconStyle: 'theme',
17
+ },
18
+ },
19
+ {
20
+ variant: 'button',
21
+ buttonProps: {
22
+ icon: 'fc-trash',
23
+ iconStyle: 'theme',
24
+ },
25
+ },
26
+ ] })),
27
+ React.createElement("div", { className: "tw-p-4" },
28
+ React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with tooltip", append: [
29
+ {
30
+ variant: 'button',
31
+ buttonProps: {
32
+ icon: 'fc-annotate',
33
+ iconStyle: 'theme',
34
+ },
35
+ },
36
+ {
37
+ variant: 'button',
38
+ buttonProps: {
39
+ icon: 'fc-trash',
40
+ iconStyle: 'theme',
41
+ },
42
+ },
43
+ ] })),
44
+ React.createElement("div", { className: "tw-p-4" },
45
+ React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with tooltip", append: [
46
+ {
47
+ variant: 'button',
48
+ buttonProps: {
49
+ icon: 'fc-annotate',
50
+ iconStyle: 'theme',
51
+ },
52
+ },
53
+ ] })),
54
+ React.createElement("div", { className: "tw-p-4" },
55
+ React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with custom element", append: [
56
+ {
57
+ variant: 'element',
58
+ element: React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background" }, "Custom"),
59
+ },
60
+ ] })),
61
+ React.createElement("div", { className: "tw-p-4" },
62
+ React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "button input group", onClick: () => console.log('clicked'), append: [
63
+ {
64
+ variant: 'element',
65
+ element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Custom")),
66
+ },
67
+ ] }))),
68
+ React.createElement("div", { className: "tw-dark tw-bg-sq-dark-background" },
69
+ React.createElement("div", { className: "tw-p-4" },
70
+ React.createElement(InputGroup, { value: "value provided", append: [
71
+ {
72
+ variant: 'button',
73
+ buttonProps: {
74
+ icon: 'fc-annotate',
75
+ iconStyle: 'theme',
76
+ },
77
+ },
78
+ {
79
+ variant: 'button',
80
+ buttonProps: {
81
+ icon: 'fc-trash',
82
+ iconStyle: 'theme',
83
+ },
84
+ },
85
+ ] })),
86
+ React.createElement("div", { className: "tw-p-4" },
87
+ React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with tooltip", append: [
88
+ {
89
+ variant: 'button',
90
+ buttonProps: {
91
+ icon: 'fc-annotate',
92
+ iconStyle: 'theme',
93
+ },
94
+ },
95
+ {
96
+ variant: 'button',
97
+ buttonProps: {
98
+ icon: 'fc-trash',
99
+ iconStyle: 'theme',
100
+ },
101
+ },
102
+ ] })),
103
+ React.createElement("div", { className: "tw-p-4" },
104
+ React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with tooltip", append: [
105
+ {
106
+ variant: 'button',
107
+ buttonProps: {
108
+ icon: 'fc-annotate',
109
+ iconStyle: 'theme',
110
+ },
111
+ },
112
+ ] })),
113
+ React.createElement("div", { className: "tw-p-4" },
114
+ React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with custom element", append: [
115
+ {
116
+ variant: 'element',
117
+ element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Custom")),
118
+ },
119
+ ] })),
120
+ React.createElement("div", { className: "tw-p-4" },
121
+ React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "button input group", onClick: () => console.log('clicked'), append: [
122
+ {
123
+ variant: 'element',
124
+ element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Custom")),
125
+ },
126
+ ] })))));
127
+ return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
128
+ React.createElement(QTip, null),
129
+ React.createElement("div", { className: "color_topic" },
130
+ React.createElement("b", null, "Topic Colors"),
131
+ renderAllVariations()),
132
+ React.createElement("div", { className: "color_analysis" },
133
+ React.createElement("b", null, "Analysis Colors"),
134
+ renderAllVariations()),
135
+ React.createElement("div", { className: "color_datalab" },
136
+ React.createElement("b", null, "Datalab Colors"),
137
+ renderAllVariations()),
138
+ React.createElement("div", { className: "color_vantage" },
139
+ React.createElement("b", null, "Vantage Colors"),
140
+ renderAllVariations())));
141
+ };
66
142
  //# sourceMappingURL=InputGroup.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputGroup.stories.js","sourceRoot":"","sources":["../../src/InputGroup/InputGroup.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,eAAe;IACb,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC;QACE,6BAAK,SAAS,EAAC,OAAO;YACpB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oB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EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"InputGroup.stories.js","sourceRoot":"","sources":["../../src/InputGroup/InputGroup.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,eAAe;IACb,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC;QACE,6BAAK,SAAS,EAAC,OAAO;YACpB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,UAAU,IACT,KAAK,EAAC,gBAAgB,EACtB,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,QAAQ;4BACjB,WAAW,EAAE;gCACX,IAAI,EAAE,aAAa;gCACnB,SAAS,EAAE,OAAO;6BACnB;yBACF;wBACD;4BACE,OAAO,EAAE,QAAQ;4BACjB,WAAW,EAAE;gCACX,IAAI,EAAE,UAAU;gCAChB,SAAS,EAAE,OAAO;6BACnB;yBACF;qBACF,GACD,CACE;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,UAAU,IACT,OAAO,EAAC,8BAA8B,EACtC,YAAY,EAAE,CAAC,EACf,gBAAgB,EAAC,KAAK,EACtB,aAAa,EAAE,KAAK,EACpB,KAAK,EAAC,cAAc,EACpB,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,QAAQ;4BACjB,WAAW,EAAE;gCACX,IAAI,EAAE,aAAa;gCACnB,SAAS,EAAE,OAAO;6BACnB;yBACF;wBACD;4BACE,OAAO,EAAE,QAAQ;4BACjB,WAAW,EAAE;gCACX,IAAI,EAAE,UAAU;gCAChB,SAAS,EAAE,OA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yBACF;qBACF,GACD,CACE;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,UAAU,IACT,OAAO,EAAC,8BAA8B,EACtC,YAAY,EAAE,CAAC,EACf,gBAAgB,EAAC,KAAK,EACtB,aAAa,EAAE,KAAK,EACpB,KAAK,EAAC,oBAAoB,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EACrC,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,SAAS;4BAClB,OAAO,EAAE,CACP,6BAAK,SAAS,EAAC,uEAAuE,aAAa,CACpG;yBACF;qBACF,GACD,CACE,CACF,CACL,CACJ,CAAC;IACF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,oBAAC,IAAI,OAAG;QACR,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 +1 @@
1
- import '@testing-library/jest-dom/extend-expect';
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -1,40 +1,43 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import '@testing-library/jest-dom/extend-expect';
4
- import { InputGroup } from './InputGroup';
5
- describe('InputGroup', () => {
6
- const defaultProps = {
7
- input: React.createElement("input", { type: "text" }),
8
- append: [React.createElement("span", { key: "append" }, "Append")],
9
- prepend: [React.createElement("span", { key: "prepend" }, "Prepend")],
10
- extraClassNames: 'extra-class',
11
- tooltip: 'Tooltip title',
12
- tooltipDelay: 0,
13
- id: 'input-group-id',
14
- testId: 'input-group-test-id',
15
- };
16
- it('renders without crashing', () => {
17
- const { getByTestId } = render(React.createElement(InputGroup, { ...defaultProps }));
18
- expect(getByTestId('input-group-test-id')).toBeInTheDocument();
19
- });
20
- it('applies the correct classes', () => {
21
- const { getByTestId } = render(React.createElement(InputGroup, { ...defaultProps }));
22
- const inputGroup = getByTestId('input-group-test-id');
23
- expect(inputGroup).toHaveClass('tw-flex');
24
- expect(inputGroup).toHaveClass('tw-outline-none');
25
- expect(inputGroup).toHaveClass('extra-class');
26
- });
27
- it('renders prepend items', () => {
28
- const { getByText } = render(React.createElement(InputGroup, { ...defaultProps }));
29
- expect(getByText('Prepend')).toBeInTheDocument();
30
- });
31
- it('renders append items', () => {
32
- const { getByText } = render(React.createElement(InputGroup, { ...defaultProps }));
33
- expect(getByText('Append')).toBeInTheDocument();
34
- });
35
- it('renders input element', () => {
36
- const { container } = render(React.createElement(InputGroup, { ...defaultProps }));
37
- expect(container.querySelector('input[type="text"]')).toBeInTheDocument();
38
- });
39
- });
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import '@testing-library/jest-dom/extend-expect';
4
+ import { InputGroup } from './InputGroup';
5
+ describe('InputGroup', () => {
6
+ const defaultProps = {
7
+ value: 'with tooltip',
8
+ append: [
9
+ {
10
+ variant: 'button',
11
+ buttonProps: {
12
+ icon: 'fc-annotate',
13
+ iconStyle: 'theme',
14
+ },
15
+ },
16
+ ],
17
+ extraClassNames: 'extra-class',
18
+ tooltip: 'Tooltip title',
19
+ tooltipDelay: 0,
20
+ id: 'input-group-id',
21
+ testId: 'input-group-test-id',
22
+ };
23
+ it('renders without crashing', () => {
24
+ const { getByTestId } = render(React.createElement(InputGroup, { ...defaultProps }));
25
+ expect(getByTestId('input-group-test-id')).toBeInTheDocument();
26
+ });
27
+ it('applies the correct classes', () => {
28
+ const { getByTestId } = render(React.createElement(InputGroup, { ...defaultProps }));
29
+ const inputGroup = getByTestId('input-group-test-id');
30
+ expect(inputGroup).toHaveClass('tw-flex');
31
+ expect(inputGroup).toHaveClass('tw-outline-none');
32
+ expect(inputGroup).toHaveClass('extra-class');
33
+ });
34
+ it('renders append items', () => {
35
+ const { getByRole } = render(React.createElement(InputGroup, { ...defaultProps }));
36
+ expect(getByRole('button')).toBeInTheDocument();
37
+ });
38
+ it('renders input element', () => {
39
+ const { container } = render(React.createElement(InputGroup, { ...defaultProps }));
40
+ expect(container.querySelector('input[type="text"]')).toBeInTheDocument();
41
+ });
42
+ });
40
43
  //# sourceMappingURL=InputGroup.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputGroup.test.js","sourceRoot":"","sources":["../../src/InputGroup/InputGroup.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,MAAM,YAAY,GAAoB;QACpC,KAAK,EAAE,+BAAO,IAAI,EAAC,MAAM,GAAG;QAC5B,MAAM,EAAE,CAAC,8BAAM,GAAG,EAAC,QAAQ,aAAc,CAAC;QAC1C,OAAO,EAAE,CAAC,8BAAM,GAAG,EAAC,SAAS,cAAe,CAAC;QAC7C,eAAe,EAAE,aAAa;QAC9B,OAAO,EAAE,eAAe;QACxB,YAAY,EAAE,CAAC;QACf,EAAE,EAAE,gBAAgB;QACpB,MAAM,EAAE,qBAAqB;KAC9B,CAAC;IAEF,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,oBAAC,UAAU,OAAK,YAAY,GAAI,CAAC,CAAC;QACjE,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA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AC9B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,UAAU,OAAK,YAAY,GAAI,CAAC,CAAC;QAC/D,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,UAAU,OAAK,YAAY,GAAI,CAAC,CAAC;QAC/D,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { ButtonProps } from '../Button/Button.types';
2
+ import { TextFieldProps } from '../TextField/TextField.types';
3
+ import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
4
+ interface AppendedButtonProps {
5
+ variant: 'button';
6
+ buttonProps: ButtonProps;
7
+ }
8
+ interface ElementProps {
9
+ variant: 'element';
10
+ element: React.ReactNode;
11
+ }
12
+ type AppendedProps = AppendedButtonProps | ElementProps;
13
+ interface BaseInputGroupProps extends TextFieldProps {
14
+ /** Append elements */
15
+ append: AppendedProps[];
16
+ onClick?: React.MouseEventHandler;
17
+ }
18
+ /** Combined InputGroupProps */
19
+ export type InputGroupProps = BaseInputGroupProps & TooltipComponentProps;
20
+ export {};
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=InputGroup.types.js.map
@@ -0,0 +1 @@
1
+ export { InputGroup as default } from './InputGroup';
@@ -1,2 +1,2 @@
1
- export { InputGroup as default } from './InputGroup';
1
+ export { InputGroup as default } from './InputGroup';
2
2
  //# sourceMappingURL=index.js.map
@@ -1,100 +1,100 @@
1
- import React, { useEffect, useState } from 'react';
2
- import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- import classNames from 'classnames';
4
- import '../styles.css';
5
- import Button from '../Button';
6
- import Icon from '../Icon';
7
- import TextField from '../TextField';
8
- const Dialog = DialogPrimitive.Root;
9
- const DialogPortal = DialogPrimitive.Portal;
10
- const DialogClose = DialogPrimitive.Close;
11
- const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DialogPortal, null,
12
- React.createElement("div", { className: "tw-select-none tw-fixed tw-w-full tw-h-full tw-opacity-50 tw-inset-0 tw-z-[1009] tw-bg-sq-dark-background\n data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 " }),
1
+ import React, { useEffect, useState } from 'react';
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ import classNames from 'classnames';
4
+ import '../styles.css';
5
+ import Button from '../Button';
6
+ import Icon from '../Icon';
7
+ import TextField from '../TextField';
8
+ const Dialog = DialogPrimitive.Root;
9
+ const DialogPortal = DialogPrimitive.Portal;
10
+ const DialogClose = DialogPrimitive.Close;
11
+ const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DialogPortal, null,
12
+ React.createElement("div", { className: "tw-select-none tw-fixed tw-w-full tw-h-full tw-opacity-50 tw-inset-0 tw-z-[1009] tw-bg-sq-dark-background\n data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 " }),
13
13
  React.createElement(DialogPrimitive.Content, { ref: ref, className: `tw-fixed tw-left-[50%] tw-top-0 tw-my-6 tw-translate-x-[-50%] tw-z-[1010] tw-grid
14
14
  tw-gap-4 tw-border tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-6 tw-shadow-lg tw-duration-200
15
- tw-rounded-lg ${className}`, ...props }, children))));
16
- DialogContent.displayName = DialogPrimitive.Content.displayName;
17
- const DialogHeader = (props) => (React.createElement("div", { className: "tw-w-full tw-justify-between" },
18
- React.createElement("div", { ...props })));
19
- DialogHeader.displayName = 'DialogHeader';
20
- const DialogFooter = (props) => React.createElement("div", { ...props });
21
- DialogFooter.displayName = 'DialogFooter';
22
- const DialogTitle = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Title, { ref: ref, ...props }));
23
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
24
- const DialogDescription = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Description, { ref: ref, ...props }));
25
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
26
- const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = React.createElement(React.Fragment, null), customButtonVariant = 'outline', submitButtonVariant = 'theme', keepFocusInsideModal = true, onPointerDownOutside, }) => {
27
- const [isLoading, setIsLoading] = useState(false);
28
- // the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
29
- useEffect(() => {
30
- if (open) {
31
- // Pushing the change to the end of the call stack
32
- const timer = setTimeout(() => {
33
- document.body.style.pointerEvents = '';
34
- }, 0);
35
- return () => clearTimeout(timer);
36
- }
37
- else {
38
- document.body.style.pointerEvents = 'auto';
39
- }
40
- }, [open]);
41
- const handleSubmit = async (e) => {
42
- if (!onSubmit)
43
- return;
44
- try {
45
- setIsLoading(true);
46
- await onSubmit(e);
47
- }
48
- finally {
49
- setIsLoading(false);
50
- }
51
- };
52
- const renderTitle = () => {
53
- let titleIconElement = React.createElement(React.Fragment, null);
54
- if (titleIcon) {
55
- if (typeof titleIcon === 'string') {
56
- titleIconElement = (React.createElement(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw-flex tw-text-xl tw-mt-1" }));
57
- }
58
- else {
59
- titleIconElement = React.createElement("div", { className: "tw-mt-1.5" }, titleIcon);
60
- }
61
- }
62
- return (React.createElement(React.Fragment, null,
63
- titleIcon && titleIconPosition === 'left' ? React.createElement("div", { className: "tw-flex tw-mr-2" }, titleIconElement) : React.createElement(React.Fragment, null),
64
- React.createElement(DialogTitle, { asChild: true }, isTitleEditable ? (React.createElement("div", { className: "tw-flex tw-w-full tw-items-center" },
65
- React.createElement(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }),
66
- titleError && React.createElement("p", { className: "tw-text-sq-danger-color tw-min-w-fit tw-pl-2 tw-mb-0" }, titleError))) : (customHeader ?? (React.createElement("div", { "data-testid": "modalTitle", className: "modal-title" },
67
- React.createElement("div", { className: "tw-flex tw-items-center" },
68
- React.createElement("h3", null, title),
69
- titleSuffixLabel && React.createElement("span", { className: "tw-text-xl tw-pl-0.5" }, titleSuffixLabel)),
70
- subtitle && (React.createElement("div", { className: "tw-italic tw-text-sm tw-text-left tw-mt-1", "data-testid": "modal-subtitle" }, subtitle)))))),
71
- titleIcon && titleIconPosition === 'right' ? React.createElement("div", { className: "tw-flex tw-ml-4" }, titleIconElement) : React.createElement(React.Fragment, null)));
72
- };
73
- return open ? (React.createElement(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal },
74
- React.createElement(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), "data-testid": testId, className: classNames(`modalContent tw-w-full !tw-p-0 tw-border-none tw-shadow-none dark:tw-text-sq-dark-text !tw-gap-0`, {
75
- 'tw-max-w-xs': size === 'xs',
76
- 'tw-max-w-sm': size === 'sm',
77
- 'tw-max-w-md': size === 'md',
78
- 'tw-max-w-lg': size === 'lg',
79
- 'tw-max-w-xl': size === 'xl',
80
- 'tw-max-w-2xl': size === '2xl',
81
- 'tw-max-w-3xl': size === '3xl',
82
- 'tw-max-w-4xl': size === '4xl',
83
- 'tw-max-w-5xl': size === '5xl',
84
- 'tw-max-w-6xl': size === '6xl',
85
- }, dialogClassName) },
86
- React.createElement(DialogHeader, { className: "modal-header tw-flex tw-w-full tw-justify-between tw-border-sq-disabled-gray\n dark:tw-border-sq-dark-disabled-gray tw-border-0 tw-border-b tw-px-6 tw-py-4" },
87
- React.createElement("div", { className: "tw-flex tw-w-full" }, renderTitle()),
88
- !hideCloseIcon && (React.createElement(DialogClose, { autoFocus: false, className: "[&:has(:focus-visible)]:none tw-opacity-70 tw-bg-transparent hover:tw-opacity-100 close tw-cursor-pointer tw-ml-4", "data-testid": "closeButton" },
89
- React.createElement("span", { className: "tw-cursor-pointer" }, "\u00D7")))),
90
- React.createElement(DialogDescription, { className: "modal-body tw-px-6 tw-py-4 tw-overflow-y-auto", asChild: true }, children),
91
- !hideFooterButtons && (React.createElement(DialogFooter, { className: "modal-footer tw-px-6 tw-py-4" }, modalFooter ?? (React.createElement("div", { className: "tw-flex tw-w-full tw-justify-between", "data-testid": "modalFooter" },
92
- React.createElement("div", { className: "tw-flex tw-justify-start" }, customButton && (React.createElement(Button, { label: customButtonLabel, onClick: onClickCustomButton, disabled: disableCustomButton, extraClassNames: "tw-justify-start tw-min-w-[100px]", testId: "customButton", variant: customButtonVariant }))),
93
- React.createElement("div", { className: "tw-flex tw-justify-end" },
94
- React.createElement("div", { className: "tw-flex tw-items-center" }, middleFooterSection),
95
- !hideCancelButton && (React.createElement(DialogClose, { asChild: true },
96
- React.createElement(Button, { label: cancelButtonLabel, extraClassNames: "tw-mr-5 tw-min-w-[100px]", tooltip: cancelButtonTooltip, variant: "outline", stopPropagation: false, testId: "cancelButton" }))),
97
- !hideSubmitButton && (React.createElement(Button, { label: submitButtonLabel, onClick: handleSubmit, disabled: disableSubmitButton || isLoading, variant: submitButtonVariant, stopPropagation: stopPropagationSubmitButton, tooltip: submitButtonTooltip, icon: isLoading ? 'fc-loading-notch tw-animate-spin' : undefined, iconPosition: "left", testId: "submitButton", extraClassNames: "tw-min-w-[100px]" })))))))))) : (React.createElement(React.Fragment, null));
98
- };
99
- export default Modal;
15
+ tw-rounded-lg ${className}`, ...props }, children))));
16
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
17
+ const DialogHeader = (props) => (React.createElement("div", { className: "tw-w-full tw-justify-between" },
18
+ React.createElement("div", { ...props })));
19
+ DialogHeader.displayName = 'DialogHeader';
20
+ const DialogFooter = (props) => React.createElement("div", { ...props });
21
+ DialogFooter.displayName = 'DialogFooter';
22
+ const DialogTitle = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Title, { ref: ref, ...props }));
23
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
24
+ const DialogDescription = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Description, { ref: ref, ...props }));
25
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
26
+ const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = React.createElement(React.Fragment, null), customButtonVariant = 'outline', submitButtonVariant = 'theme', keepFocusInsideModal = true, onPointerDownOutside, }) => {
27
+ const [isLoading, setIsLoading] = useState(false);
28
+ // the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
29
+ useEffect(() => {
30
+ if (open) {
31
+ // Pushing the change to the end of the call stack
32
+ const timer = setTimeout(() => {
33
+ document.body.style.pointerEvents = '';
34
+ }, 0);
35
+ return () => clearTimeout(timer);
36
+ }
37
+ else {
38
+ document.body.style.pointerEvents = 'auto';
39
+ }
40
+ }, [open]);
41
+ const handleSubmit = async (e) => {
42
+ if (!onSubmit)
43
+ return;
44
+ try {
45
+ setIsLoading(true);
46
+ await onSubmit(e);
47
+ }
48
+ finally {
49
+ setIsLoading(false);
50
+ }
51
+ };
52
+ const renderTitle = () => {
53
+ let titleIconElement = React.createElement(React.Fragment, null);
54
+ if (titleIcon) {
55
+ if (typeof titleIcon === 'string') {
56
+ titleIconElement = (React.createElement(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw-flex tw-text-xl tw-mt-1" }));
57
+ }
58
+ else {
59
+ titleIconElement = React.createElement("div", { className: "tw-mt-1.5" }, titleIcon);
60
+ }
61
+ }
62
+ return (React.createElement(React.Fragment, null,
63
+ titleIcon && titleIconPosition === 'left' ? React.createElement("div", { className: "tw-flex tw-mr-2" }, titleIconElement) : React.createElement(React.Fragment, null),
64
+ React.createElement(DialogTitle, { asChild: true }, isTitleEditable ? (React.createElement("div", { className: "tw-flex tw-w-full tw-items-center" },
65
+ React.createElement(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }),
66
+ titleError && React.createElement("p", { className: "tw-text-sq-danger-color tw-min-w-fit tw-pl-2 tw-mb-0" }, titleError))) : (customHeader ?? (React.createElement("div", { "data-testid": "modalTitle", className: "modal-title" },
67
+ React.createElement("div", { className: "tw-flex tw-items-center" },
68
+ React.createElement("h3", null, title),
69
+ titleSuffixLabel && React.createElement("span", { className: "tw-text-xl tw-pl-0.5" }, titleSuffixLabel)),
70
+ subtitle && (React.createElement("div", { className: "tw-italic tw-text-sm tw-text-left tw-mt-1", "data-testid": "modal-subtitle" }, subtitle)))))),
71
+ titleIcon && titleIconPosition === 'right' ? React.createElement("div", { className: "tw-flex tw-ml-4" }, titleIconElement) : React.createElement(React.Fragment, null)));
72
+ };
73
+ return open ? (React.createElement(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal },
74
+ React.createElement(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), "data-testid": testId, className: classNames(`modalContent tw-w-full !tw-p-0 tw-border-none tw-shadow-none dark:tw-text-sq-dark-text !tw-gap-0`, {
75
+ 'tw-max-w-xs': size === 'xs',
76
+ 'tw-max-w-sm': size === 'sm',
77
+ 'tw-max-w-md': size === 'md',
78
+ 'tw-max-w-lg': size === 'lg',
79
+ 'tw-max-w-xl': size === 'xl',
80
+ 'tw-max-w-2xl': size === '2xl',
81
+ 'tw-max-w-3xl': size === '3xl',
82
+ 'tw-max-w-4xl': size === '4xl',
83
+ 'tw-max-w-5xl': size === '5xl',
84
+ 'tw-max-w-6xl': size === '6xl',
85
+ }, dialogClassName) },
86
+ React.createElement(DialogHeader, { className: "modal-header tw-flex tw-w-full tw-justify-between tw-border-sq-disabled-gray\n dark:tw-border-sq-dark-disabled-gray tw-border-0 tw-border-b tw-px-6 tw-py-4" },
87
+ React.createElement("div", { className: "tw-flex tw-w-full" }, renderTitle()),
88
+ !hideCloseIcon && (React.createElement(DialogClose, { autoFocus: false, className: "[&:has(:focus-visible)]:none tw-opacity-70 tw-bg-transparent hover:tw-opacity-100 close tw-cursor-pointer tw-ml-4", "data-testid": "closeButton" },
89
+ React.createElement("span", { className: "tw-cursor-pointer" }, "\u00D7")))),
90
+ React.createElement(DialogDescription, { className: "modal-body tw-px-6 tw-py-4 tw-overflow-y-auto", asChild: true }, children),
91
+ !hideFooterButtons && (React.createElement(DialogFooter, { className: "modal-footer tw-px-6 tw-py-4" }, modalFooter ?? (React.createElement("div", { className: "tw-flex tw-w-full tw-justify-between", "data-testid": "modalFooter" },
92
+ React.createElement("div", { className: "tw-flex tw-justify-start" }, customButton && (React.createElement(Button, { label: customButtonLabel, onClick: onClickCustomButton, disabled: disableCustomButton, extraClassNames: "tw-justify-start tw-min-w-[100px]", testId: "customButton", variant: customButtonVariant }))),
93
+ React.createElement("div", { className: "tw-flex tw-justify-end" },
94
+ React.createElement("div", { className: "tw-flex tw-items-center" }, middleFooterSection),
95
+ !hideCancelButton && (React.createElement(DialogClose, { asChild: true },
96
+ React.createElement(Button, { label: cancelButtonLabel, extraClassNames: "tw-mr-5 tw-min-w-[100px]", tooltip: cancelButtonTooltip, variant: "outline", stopPropagation: false, testId: "cancelButton" }))),
97
+ !hideSubmitButton && (React.createElement(Button, { label: submitButtonLabel, onClick: handleSubmit, disabled: disableSubmitButton || isLoading, variant: submitButtonVariant, stopPropagation: stopPropagationSubmitButton, tooltip: submitButtonTooltip, icon: isLoading ? 'fc-loading-notch tw-animate-spin' : undefined, iconPosition: "left", testId: "submitButton", extraClassNames: "tw-min-w-[100px]" })))))))))) : (React.createElement(React.Fragment, null));
98
+ };
99
+ export default Modal;
100
100
  //# sourceMappingURL=Modal.js.map