react-science 0.32.2 → 0.33.0

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 (198) hide show
  1. package/lib/app/about/AboutDialogToolbarButton.d.ts.map +1 -1
  2. package/lib/app/about/AboutDialogToolbarButton.js +2 -9
  3. package/lib/app/about/AboutDialogToolbarButton.js.map +1 -1
  4. package/lib/app/kinds/ir/IrPeaksPanel.js +1 -1
  5. package/lib/app/kinds/ir/IrPeaksPanel.js.map +1 -1
  6. package/lib/app/panels/SignalProcessingPanel.js +1 -1
  7. package/lib/app/panels/SignalProcessingPanel.js.map +1 -1
  8. package/lib/app/panels/measurements/MeasurementsPanel.d.ts +1 -1
  9. package/lib/app/panels/measurements/MeasurementsPanel.d.ts.map +1 -1
  10. package/lib/app/panels/measurements/MeasurementsPanel.js +20 -12
  11. package/lib/app/panels/measurements/MeasurementsPanel.js.map +1 -1
  12. package/lib/app/panels/measurements/MeasurementsTable.d.ts +1 -1
  13. package/lib/app/panels/measurements/MeasurementsTable.d.ts.map +1 -1
  14. package/lib/app/panels/measurements/MeasurementsTable.js +15 -12
  15. package/lib/app/panels/measurements/MeasurementsTable.js.map +1 -1
  16. package/lib/components/dialog/ConfirmDialog.d.ts +12 -0
  17. package/lib/components/dialog/ConfirmDialog.d.ts.map +1 -0
  18. package/lib/components/dialog/ConfirmDialog.js +22 -0
  19. package/lib/components/dialog/ConfirmDialog.js.map +1 -0
  20. package/lib/components/dialog/index.d.ts +2 -0
  21. package/lib/components/dialog/index.d.ts.map +1 -0
  22. package/lib/components/{tabs → dialog}/index.js +1 -1
  23. package/lib/components/dialog/index.js.map +1 -0
  24. package/lib/components/index.d.ts +1 -2
  25. package/lib/components/index.d.ts.map +1 -1
  26. package/lib/components/index.js +1 -2
  27. package/lib/components/index.js.map +1 -1
  28. package/lib/components/info-panel/InfoPanel.d.ts +0 -1
  29. package/lib/components/info-panel/InfoPanel.d.ts.map +1 -1
  30. package/lib/components/info-panel/InfoPanel.js +2 -8
  31. package/lib/components/info-panel/InfoPanel.js.map +1 -1
  32. package/lib/components/layout-manager/LayoutManager.d.ts.map +1 -1
  33. package/lib/components/layout-manager/LayoutManager.js +0 -2
  34. package/lib/components/layout-manager/LayoutManager.js.map +1 -1
  35. package/lib/components/root-layout/RootLayout.js +1 -1
  36. package/lib/components/root-layout/RootLayout.js.map +1 -1
  37. package/lib/components/table/Table.d.ts +8 -3
  38. package/lib/components/table/Table.d.ts.map +1 -1
  39. package/lib/components/table/Table.js +14 -65
  40. package/lib/components/table/Table.js.map +1 -1
  41. package/lib/components/table/TableHeader.d.ts +3 -0
  42. package/lib/components/table/TableHeader.d.ts.map +1 -0
  43. package/lib/components/table/TableHeader.js +10 -0
  44. package/lib/components/table/TableHeader.js.map +1 -0
  45. package/lib/components/table/TableRow.d.ts +3 -0
  46. package/lib/components/table/TableRow.d.ts.map +1 -0
  47. package/lib/components/table/TableRow.js +57 -0
  48. package/lib/components/table/TableRow.js.map +1 -0
  49. package/lib/components/table/tableContext.d.ts +10 -0
  50. package/lib/components/table/tableContext.d.ts.map +1 -0
  51. package/lib/components/table/tableContext.js +11 -0
  52. package/lib/components/table/tableContext.js.map +1 -0
  53. package/lib/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -1
  54. package/lib/components/toolbar/PanelPreferencesToolbar.js +2 -2
  55. package/lib/components/toolbar/PanelPreferencesToolbar.js.map +1 -1
  56. package/lib/components/toolbar/Toolbar.d.ts +8 -5
  57. package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
  58. package/lib/components/toolbar/Toolbar.js +12 -9
  59. package/lib/components/toolbar/Toolbar.js.map +1 -1
  60. package/lib-esm/app/about/AboutDialogToolbarButton.d.ts.map +1 -1
  61. package/lib-esm/app/about/AboutDialogToolbarButton.js +4 -8
  62. package/lib-esm/app/about/AboutDialogToolbarButton.js.map +1 -1
  63. package/lib-esm/app/kinds/ir/IrPeaksPanel.js +1 -1
  64. package/lib-esm/app/kinds/ir/IrPeaksPanel.js.map +1 -1
  65. package/lib-esm/app/panels/SignalProcessingPanel.js +1 -1
  66. package/lib-esm/app/panels/SignalProcessingPanel.js.map +1 -1
  67. package/lib-esm/app/panels/measurements/MeasurementsPanel.d.ts +1 -1
  68. package/lib-esm/app/panels/measurements/MeasurementsPanel.d.ts.map +1 -1
  69. package/lib-esm/app/panels/measurements/MeasurementsPanel.js +16 -8
  70. package/lib-esm/app/panels/measurements/MeasurementsPanel.js.map +1 -1
  71. package/lib-esm/app/panels/measurements/MeasurementsTable.d.ts +1 -1
  72. package/lib-esm/app/panels/measurements/MeasurementsTable.d.ts.map +1 -1
  73. package/lib-esm/app/panels/measurements/MeasurementsTable.js +11 -8
  74. package/lib-esm/app/panels/measurements/MeasurementsTable.js.map +1 -1
  75. package/lib-esm/components/dialog/ConfirmDialog.d.ts +12 -0
  76. package/lib-esm/components/dialog/ConfirmDialog.d.ts.map +1 -0
  77. package/lib-esm/components/dialog/ConfirmDialog.js +18 -0
  78. package/lib-esm/components/dialog/ConfirmDialog.js.map +1 -0
  79. package/lib-esm/components/dialog/index.d.ts +2 -0
  80. package/lib-esm/components/dialog/index.d.ts.map +1 -0
  81. package/lib-esm/components/dialog/index.js +2 -0
  82. package/lib-esm/components/dialog/index.js.map +1 -0
  83. package/lib-esm/components/index.d.ts +1 -2
  84. package/lib-esm/components/index.d.ts.map +1 -1
  85. package/lib-esm/components/index.js +1 -2
  86. package/lib-esm/components/index.js.map +1 -1
  87. package/lib-esm/components/info-panel/InfoPanel.d.ts +0 -1
  88. package/lib-esm/components/info-panel/InfoPanel.d.ts.map +1 -1
  89. package/lib-esm/components/info-panel/InfoPanel.js +2 -8
  90. package/lib-esm/components/info-panel/InfoPanel.js.map +1 -1
  91. package/lib-esm/components/layout-manager/LayoutManager.d.ts.map +1 -1
  92. package/lib-esm/components/layout-manager/LayoutManager.js +0 -2
  93. package/lib-esm/components/layout-manager/LayoutManager.js.map +1 -1
  94. package/lib-esm/components/root-layout/RootLayout.js +1 -1
  95. package/lib-esm/components/root-layout/RootLayout.js.map +1 -1
  96. package/lib-esm/components/table/Table.d.ts +8 -3
  97. package/lib-esm/components/table/Table.d.ts.map +1 -1
  98. package/lib-esm/components/table/Table.js +12 -63
  99. package/lib-esm/components/table/Table.js.map +1 -1
  100. package/lib-esm/components/table/TableHeader.d.ts +3 -0
  101. package/lib-esm/components/table/TableHeader.d.ts.map +1 -0
  102. package/lib-esm/components/table/TableHeader.js +6 -0
  103. package/lib-esm/components/table/TableHeader.js.map +1 -0
  104. package/lib-esm/components/table/TableRow.d.ts +3 -0
  105. package/lib-esm/components/table/TableRow.d.ts.map +1 -0
  106. package/lib-esm/components/table/TableRow.js +53 -0
  107. package/lib-esm/components/table/TableRow.js.map +1 -0
  108. package/lib-esm/components/table/tableContext.d.ts +10 -0
  109. package/lib-esm/components/table/tableContext.d.ts.map +1 -0
  110. package/lib-esm/components/table/tableContext.js +7 -0
  111. package/lib-esm/components/table/tableContext.js.map +1 -0
  112. package/lib-esm/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -1
  113. package/lib-esm/components/toolbar/PanelPreferencesToolbar.js +2 -2
  114. package/lib-esm/components/toolbar/PanelPreferencesToolbar.js.map +1 -1
  115. package/lib-esm/components/toolbar/Toolbar.d.ts +8 -5
  116. package/lib-esm/components/toolbar/Toolbar.d.ts.map +1 -1
  117. package/lib-esm/components/toolbar/Toolbar.js +12 -9
  118. package/lib-esm/components/toolbar/Toolbar.js.map +1 -1
  119. package/package.json +30 -30
  120. package/src/app/about/AboutDialogToolbarButton.tsx +10 -14
  121. package/src/app/kinds/ir/IrPeaksPanel.tsx +1 -1
  122. package/src/app/panels/SignalProcessingPanel.tsx +5 -5
  123. package/src/app/panels/measurements/MeasurementsPanel.tsx +33 -15
  124. package/src/app/panels/measurements/MeasurementsTable.tsx +33 -26
  125. package/src/components/dialog/ConfirmDialog.tsx +65 -0
  126. package/src/components/dialog/index.ts +1 -0
  127. package/src/components/index.ts +1 -2
  128. package/src/components/info-panel/InfoPanel.tsx +4 -17
  129. package/src/components/layout-manager/LayoutManager.tsx +0 -2
  130. package/src/components/root-layout/RootLayout.tsx +1 -1
  131. package/src/components/table/Table.tsx +37 -96
  132. package/src/components/table/TableHeader.tsx +12 -0
  133. package/src/components/table/TableRow.tsx +89 -0
  134. package/src/components/table/tableContext.ts +7 -0
  135. package/src/components/toolbar/PanelPreferencesToolbar.tsx +17 -3
  136. package/src/components/toolbar/Toolbar.tsx +22 -13
  137. package/lib/components/modal/ConfirmModal.d.ts +0 -17
  138. package/lib/components/modal/ConfirmModal.d.ts.map +0 -1
  139. package/lib/components/modal/ConfirmModal.js +0 -71
  140. package/lib/components/modal/ConfirmModal.js.map +0 -1
  141. package/lib/components/modal/Modal.d.ts +0 -25
  142. package/lib/components/modal/Modal.d.ts.map +0 -1
  143. package/lib/components/modal/Modal.js +0 -85
  144. package/lib/components/modal/Modal.js.map +0 -1
  145. package/lib/components/modal/index.d.ts +0 -3
  146. package/lib/components/modal/index.d.ts.map +0 -1
  147. package/lib/components/modal/index.js +0 -19
  148. package/lib/components/modal/index.js.map +0 -1
  149. package/lib/components/modal/useDialog.d.ts +0 -19
  150. package/lib/components/modal/useDialog.d.ts.map +0 -1
  151. package/lib/components/modal/useDialog.js +0 -51
  152. package/lib/components/modal/useDialog.js.map +0 -1
  153. package/lib/components/tabs/Tabs.d.ts +0 -16
  154. package/lib/components/tabs/Tabs.d.ts.map +0 -1
  155. package/lib/components/tabs/Tabs.js +0 -99
  156. package/lib/components/tabs/Tabs.js.map +0 -1
  157. package/lib/components/tabs/TabsContext.d.ts +0 -8
  158. package/lib/components/tabs/TabsContext.d.ts.map +0 -1
  159. package/lib/components/tabs/TabsContext.js +0 -20
  160. package/lib/components/tabs/TabsContext.js.map +0 -1
  161. package/lib/components/tabs/index.d.ts +0 -2
  162. package/lib/components/tabs/index.d.ts.map +0 -1
  163. package/lib/components/tabs/index.js.map +0 -1
  164. package/lib-esm/components/modal/ConfirmModal.d.ts +0 -17
  165. package/lib-esm/components/modal/ConfirmModal.d.ts.map +0 -1
  166. package/lib-esm/components/modal/ConfirmModal.js +0 -64
  167. package/lib-esm/components/modal/ConfirmModal.js.map +0 -1
  168. package/lib-esm/components/modal/Modal.d.ts +0 -25
  169. package/lib-esm/components/modal/Modal.d.ts.map +0 -1
  170. package/lib-esm/components/modal/Modal.js +0 -78
  171. package/lib-esm/components/modal/Modal.js.map +0 -1
  172. package/lib-esm/components/modal/index.d.ts +0 -3
  173. package/lib-esm/components/modal/index.d.ts.map +0 -1
  174. package/lib-esm/components/modal/index.js +0 -3
  175. package/lib-esm/components/modal/index.js.map +0 -1
  176. package/lib-esm/components/modal/useDialog.d.ts +0 -19
  177. package/lib-esm/components/modal/useDialog.d.ts.map +0 -1
  178. package/lib-esm/components/modal/useDialog.js +0 -47
  179. package/lib-esm/components/modal/useDialog.js.map +0 -1
  180. package/lib-esm/components/tabs/Tabs.d.ts +0 -16
  181. package/lib-esm/components/tabs/Tabs.d.ts.map +0 -1
  182. package/lib-esm/components/tabs/Tabs.js +0 -95
  183. package/lib-esm/components/tabs/Tabs.js.map +0 -1
  184. package/lib-esm/components/tabs/TabsContext.d.ts +0 -8
  185. package/lib-esm/components/tabs/TabsContext.d.ts.map +0 -1
  186. package/lib-esm/components/tabs/TabsContext.js +0 -15
  187. package/lib-esm/components/tabs/TabsContext.js.map +0 -1
  188. package/lib-esm/components/tabs/index.d.ts +0 -2
  189. package/lib-esm/components/tabs/index.d.ts.map +0 -1
  190. package/lib-esm/components/tabs/index.js +0 -2
  191. package/lib-esm/components/tabs/index.js.map +0 -1
  192. package/src/components/modal/ConfirmModal.tsx +0 -134
  193. package/src/components/modal/Modal.tsx +0 -143
  194. package/src/components/modal/index.ts +0 -2
  195. package/src/components/modal/useDialog.ts +0 -95
  196. package/src/components/tabs/Tabs.tsx +0 -189
  197. package/src/components/tabs/TabsContext.tsx +0 -22
  198. package/src/components/tabs/index.ts +0 -1
@@ -1,55 +1,26 @@
1
1
  /** @jsxImportSource @emotion/react */
2
- import { css } from '@emotion/react';
2
+ import { HTMLTable } from '@blueprintjs/core';
3
3
  import {
4
4
  Children,
5
- createContext,
6
5
  isValidElement,
7
6
  ReactElement,
8
7
  ReactNode,
9
- useContext,
10
8
  useMemo,
11
9
  } from 'react';
12
10
 
13
- import {
14
- Boolean,
15
- Color,
16
- Component,
17
- Header,
18
- Number,
19
- Object,
20
- Text,
21
- Title,
22
- } from '../value-renderers';
23
-
24
- const styles = {
25
- border: css({
26
- border: '0.5px solid rgb(0, 0, 0)',
27
- padding: '5px',
28
- position: 'relative',
29
- }),
30
- noBorder: css({
31
- padding: '5px',
32
- position: 'relative',
33
- }),
34
- };
35
-
36
- const TableContext = createContext({ border: true });
37
- function useTableContext() {
38
- const context = useContext(TableContext);
39
- return context;
40
- }
11
+ import { TableHeader } from './TableHeader';
12
+ import { TableRow } from './TableRow';
13
+ import { TableContext } from './tableContext';
41
14
 
42
15
  function splitChildren(children: ReactNode) {
43
16
  const Rows: ReactElement[] = [];
44
17
  let Header: ReactElement | null = null;
45
18
  for (const child of Children.toArray(children)) {
46
19
  if (typeof child !== 'object' || !isValidElement(child)) {
47
- // eslint-disable-next-line no-console
48
- console.error('Invalid Table child:', child);
49
20
  throw new Error('invalid Table child');
50
- } else if (child.type === Table.Row) {
21
+ } else if (child.type === TableRow) {
51
22
  Rows.push(child);
52
- } else if (child.type === Table.Header) {
23
+ } else if (child.type === TableHeader) {
53
24
  Header = child;
54
25
  } else {
55
26
  throw new Error('invalid Table child');
@@ -59,76 +30,46 @@ function splitChildren(children: ReactNode) {
59
30
  }
60
31
  export interface TableProps extends React.HTMLAttributes<HTMLTableElement> {
61
32
  children?: ReactNode;
62
- border?: boolean;
33
+ bordered?: boolean;
34
+ compact?: boolean;
35
+ interactive?: boolean;
36
+ striped?: boolean;
37
+ hasBorder?: boolean;
38
+ color?: string;
63
39
  }
64
40
 
65
41
  export function Table(props: TableProps) {
66
- const { border = true, children, ...tableProps } = props;
42
+ const {
43
+ hasBorder = false,
44
+ bordered = false,
45
+ compact = false,
46
+ interactive = false,
47
+ striped = false,
48
+ color = '',
49
+ children,
50
+ ...tableProps
51
+ } = props;
67
52
  const { Header, Rows } = splitChildren(children);
68
- const tableContextValue = useMemo(() => ({ border }), [border]);
53
+
54
+ const tableContextValue = useMemo(
55
+ () => ({ hasBorder, color }),
56
+ [hasBorder, color],
57
+ );
69
58
  return (
70
59
  <TableContext.Provider value={tableContextValue}>
71
- <table {...tableProps}>
60
+ <HTMLTable
61
+ bordered={bordered}
62
+ compact={compact}
63
+ interactive={interactive}
64
+ striped={striped}
65
+ {...tableProps}
66
+ >
72
67
  {Header}
73
68
  <tbody>{Rows}</tbody>
74
- </table>
69
+ </HTMLTable>
75
70
  </TableContext.Provider>
76
71
  );
77
72
  }
78
73
 
79
- function useRowChildren(children: ReactNode) {
80
- const cells: ReactElement[] = [];
81
- const { border } = useTableContext();
82
- for (const child of Children.toArray(children)) {
83
- if (
84
- typeof child === 'object' &&
85
- isValidElement(child) &&
86
- (child.type === Color ||
87
- child.type === Boolean ||
88
- child.type === Text ||
89
- child.type === Number ||
90
- child.type === Title ||
91
- child.type === Object ||
92
- child.type === Header ||
93
- child.type === Component)
94
- ) {
95
- if (child.type === Header) {
96
- cells.push(
97
- <th key={child.key} css={border ? styles.border : styles.noBorder}>
98
- {child}
99
- </th>,
100
- );
101
- } else {
102
- cells.push(
103
- <td key={child.key} css={border ? styles.border : styles.noBorder}>
104
- {child}
105
- </td>,
106
- );
107
- }
108
- } else {
109
- // eslint-disable-next-line no-console
110
- console.error('Invalid Row child:', child);
111
- throw new Error('invalid Row child');
112
- }
113
- }
114
- return { cells };
115
- }
116
-
117
- function Row({ children, style = {}, border = false }: TableProps) {
118
- const { cells } = useRowChildren(children);
119
- return (
120
- <tr style={{ border: border ? '1px solid black' : '', ...style }}>
121
- {cells}
122
- </tr>
123
- );
124
- }
125
- Table.Row = Row;
126
- Table.Header = ({ children, style, border = false }: TableProps) => {
127
- return (
128
- <thead>
129
- <Table.Row border={border} style={style}>
130
- {children}
131
- </Table.Row>
132
- </thead>
133
- );
134
- };
74
+ Table.Row = TableRow;
75
+ Table.Header = TableHeader;
@@ -0,0 +1,12 @@
1
+ import type { TableProps } from './Table';
2
+ import { TableRow } from './TableRow';
3
+
4
+ export const TableHeader = ({ children, hasBorder, style }: TableProps) => {
5
+ return (
6
+ <thead>
7
+ <TableRow hasBorder={hasBorder} style={style}>
8
+ {children}
9
+ </TableRow>
10
+ </thead>
11
+ );
12
+ };
@@ -0,0 +1,89 @@
1
+ /** @jsxImportSource @emotion/react */
2
+ import { css } from '@emotion/react';
3
+ import { Children, isValidElement, ReactElement, ReactNode } from 'react';
4
+
5
+ import {
6
+ Boolean,
7
+ Color,
8
+ Component,
9
+ Header,
10
+ Number,
11
+ Object,
12
+ Text,
13
+ } from '../value-renderers';
14
+
15
+ import type { TableProps } from './Table';
16
+ import { useTableContext } from './tableContext';
17
+
18
+ const styles = {
19
+ hasBorder: css({
20
+ border: '0.5px solid rgb(0, 0, 0)',
21
+ padding: '5px',
22
+ position: 'relative',
23
+ }),
24
+ noBorder: css({
25
+ padding: '5px',
26
+ position: 'relative',
27
+ }),
28
+ };
29
+
30
+ export const TableRow = ({
31
+ children,
32
+ style = {},
33
+ hasBorder = false,
34
+ }: TableProps) => {
35
+ const { cells } = useRowChildren(children);
36
+ return (
37
+ <tr style={{ border: hasBorder ? '1px solid black' : '', ...style }}>
38
+ {cells}
39
+ </tr>
40
+ );
41
+ };
42
+
43
+ function useRowChildren(children: ReactNode) {
44
+ const cells: ReactElement[] = [];
45
+ const { hasBorder, color } = useTableContext();
46
+ for (const child of Children.toArray(children)) {
47
+ if (
48
+ typeof child === 'object' &&
49
+ isValidElement(child) &&
50
+ (child.type === Color ||
51
+ child.type === Boolean ||
52
+ child.type === Text ||
53
+ child.type === Number ||
54
+ child.type === Object ||
55
+ child.type === Header ||
56
+ child.type === Component)
57
+ ) {
58
+ if (child.type === Header) {
59
+ cells.push(
60
+ <th
61
+ key={child.key}
62
+ style={{ color }}
63
+ css={hasBorder ? styles.hasBorder : styles.noBorder}
64
+ >
65
+ {child}
66
+ </th>,
67
+ );
68
+ } else {
69
+ cells.push(
70
+ <td
71
+ key={child.key}
72
+ style={{
73
+ color,
74
+ position: 'relative',
75
+ }}
76
+ css={hasBorder ? styles.hasBorder : styles.noBorder}
77
+ >
78
+ {child}
79
+ </td>,
80
+ );
81
+ }
82
+ } else {
83
+ // eslint-disable-next-line no-console
84
+ console.error('Invalid Row child:', child);
85
+ throw new Error('invalid Row child');
86
+ }
87
+ }
88
+ return { cells };
89
+ }
@@ -0,0 +1,7 @@
1
+ import { createContext, useContext } from 'react';
2
+
3
+ export const TableContext = createContext({ hasBorder: true, color: '' });
4
+ export function useTableContext() {
5
+ const context = useContext(TableContext);
6
+ return context;
7
+ }
@@ -1,7 +1,7 @@
1
1
  /** @jsxImportSource @emotion/react */
2
2
  import { css } from '@emotion/react';
3
3
 
4
- import { Button } from '../button/Button';
4
+ import { Toolbar } from './Toolbar';
5
5
 
6
6
  interface PanelPreferencesToolbarProps {
7
7
  onClose?: () => void;
@@ -26,8 +26,22 @@ export function PanelPreferencesToolbar(props: PanelPreferencesToolbarProps) {
26
26
  const { onClose, onSave } = props;
27
27
  return (
28
28
  <div css={styles.toolbar}>
29
- <Button minimal onClick={onClose} intent="danger" icon="cross" />
30
- <Button minimal onClick={onSave} intent="success" icon="tick" />
29
+ <Toolbar>
30
+ <Toolbar.Item
31
+ title="close"
32
+ onClick={onClose}
33
+ intent="danger"
34
+ icon="cross"
35
+ noTooltip
36
+ />
37
+ <Toolbar.Item
38
+ title="save"
39
+ onClick={onSave}
40
+ intent="success"
41
+ icon="tick"
42
+ noTooltip
43
+ />
44
+ </Toolbar>
31
45
  </div>
32
46
  );
33
47
  }
@@ -17,11 +17,13 @@ import {
17
17
  useToolbarContext,
18
18
  } from './toolbarContext';
19
19
 
20
- export interface ToolbarProps {
21
- vertical?: boolean;
22
- large?: boolean;
20
+ interface ToolbarBaseProps {
23
21
  intent?: Intent;
24
22
  disabled?: boolean;
23
+ }
24
+ export interface ToolbarProps extends ToolbarBaseProps {
25
+ vertical?: boolean;
26
+ large?: boolean;
25
27
  children?:
26
28
  | Array<ReactElement<ToolbarItemProps>>
27
29
  | ReactElement<ToolbarItemProps>
@@ -30,14 +32,14 @@ export interface ToolbarProps {
30
32
  | null;
31
33
  }
32
34
 
33
- export interface ToolbarItemProps {
35
+ export interface ToolbarItemProps extends ToolbarBaseProps {
34
36
  id?: string;
35
37
  title: string;
36
38
  icon: ButtonProps['icon'];
37
39
  active?: boolean;
38
40
  onClick?: (item: ToolbarItemProps) => void;
39
41
  className?: string;
40
- intent?: Intent;
42
+ noTooltip?: boolean;
41
43
  }
42
44
 
43
45
  const border = '1px solid rgb(247, 247, 247)';
@@ -107,16 +109,19 @@ Toolbar.Item = function ToolbarItem(props: ToolbarItemProps) {
107
109
  title,
108
110
  id,
109
111
  intent: itemIntent,
112
+ disabled: itemDisabled,
113
+ noTooltip = false,
110
114
  ...other
111
115
  } = props;
112
116
 
113
117
  const {
114
118
  intent: toolbarIntent,
119
+ disabled: toolbarDisabled,
115
120
  large,
116
121
  vertical,
117
- disabled,
118
122
  } = useToolbarContext();
119
- const intent = itemIntent || toolbarIntent;
123
+ const intent = itemIntent ?? toolbarIntent;
124
+ const disabled = itemDisabled ?? toolbarDisabled;
120
125
  return (
121
126
  <Button
122
127
  minimal
@@ -139,12 +144,16 @@ Toolbar.Item = function ToolbarItem(props: ToolbarItemProps) {
139
144
  onClick={() => {
140
145
  onClick?.(props);
141
146
  }}
142
- tooltipProps={{
143
- content: title,
144
- placement: vertical ? 'right' : 'bottom',
145
- intent,
146
- compact: !large,
147
- }}
147
+ tooltipProps={
148
+ noTooltip
149
+ ? undefined
150
+ : {
151
+ content: title,
152
+ placement: vertical ? 'right' : 'bottom',
153
+ intent,
154
+ compact: !large,
155
+ }
156
+ }
148
157
  {...other}
149
158
  />
150
159
  );
@@ -1,17 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- interface ConfirmModalProps {
3
- children: ReactNode;
4
- isOpen: boolean;
5
- requestCloseOnEsc?: boolean;
6
- requestCloseOnBackdrop?: boolean;
7
- onConfirm: () => void;
8
- onCancel?: () => void;
9
- onRequestClose: () => void;
10
- saveText?: string;
11
- cancelText?: string;
12
- headerColor: string;
13
- maxWidth?: number;
14
- }
15
- export declare function ConfirmModal(props: ConfirmModalProps): import("react/jsx-runtime").JSX.Element | null;
16
- export {};
17
- //# sourceMappingURL=ConfirmModal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ConfirmModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,UAAU,iBAAiB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA8CD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,kDAiEpD"}
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ConfirmModal = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const styled_1 = __importDefault(require("@emotion/styled"));
9
- const react_1 = require("react");
10
- const __1 = require("..");
11
- const Portal_1 = require("../root-layout/Portal");
12
- const RootLayoutContext_1 = require("../root-layout/RootLayoutContext");
13
- const useDialog_1 = require("./useDialog");
14
- const ConfirmModalDialog = styled_1.default.dialog `
15
- background-color: transparent;
16
- :focus {
17
- outline: none;
18
- }
19
- ::backdrop {
20
- background-color: rgba(113, 113, 122, 0.75);
21
- }
22
- `;
23
- const ConfirmModalContents = styled_1.default.div `
24
- position: relative;
25
- display: flex;
26
- flex-direction: column;
27
- background-color: white;
28
- width: 100%;
29
- border-radius: 0.5rem;
30
- box-shadow:
31
- 0 0 0 0,
32
- 0 0px 16px rgba(0, 0, 0, 0.3);
33
- border-top: 10px solid ${({ headerColor }) => headerColor};
34
- `;
35
- const ConfirmModalChildrenRoot = styled_1.default.div `
36
- color: ${({ headerColor }) => headerColor};
37
- display: flex;
38
- flex: 1 1 0%;
39
- font-weight: bold;
40
- padding: 20px;
41
- font-size: 14px;
42
- `;
43
- const ConfirmModalFooter = styled_1.default.div `
44
- border-top: 2px solid rgb(247, 247, 247);
45
- padding: 10px 20px 10px 20px;
46
- display: flex;
47
- flex-direction: row-reverse;
48
- gap: 10px;
49
- `;
50
- function ConfirmModal(props) {
51
- const { isOpen, saveText = 'Save', cancelText = 'Cancel', headerColor, maxWidth, onRequestClose, onCancel = onRequestClose, onConfirm, requestCloseOnBackdrop = true, requestCloseOnEsc = true, children, } = props;
52
- const dialogRef = (0, react_1.useRef)(null);
53
- const { dialogProps, isModalShown } = (0, useDialog_1.useDialog)({
54
- dialogRef,
55
- isOpen,
56
- requestCloseOnEsc,
57
- requestCloseOnBackdrop,
58
- onRequestClose,
59
- });
60
- const [portalDomNode, setPortalDomNode] = (0, react_1.useState)(null);
61
- const dialogCallbackRef = (0, react_1.useCallback)((node) => {
62
- setPortalDomNode(node);
63
- }, []);
64
- (0, react_1.useImperativeHandle)(dialogCallbackRef, () => dialogRef.current);
65
- if (!isOpen) {
66
- return null;
67
- }
68
- return ((0, jsx_runtime_1.jsx)(Portal_1.Portal, { children: (0, jsx_runtime_1.jsx)(ConfirmModalDialog, { ...dialogProps, ref: dialogRef, children: isModalShown && ((0, jsx_runtime_1.jsx)(RootLayoutContext_1.RootLayoutProvider, { innerRef: portalDomNode, children: (0, jsx_runtime_1.jsxs)(ConfirmModalContents, { headerColor: headerColor, style: { maxWidth }, children: [(0, jsx_runtime_1.jsx)(ConfirmModalChildrenRoot, { headerColor: headerColor, children: children }), (0, jsx_runtime_1.jsxs)(ConfirmModalFooter, { children: [(0, jsx_runtime_1.jsx)(__1.Button, { intent: "primary", onClick: onConfirm, children: saveText }), (0, jsx_runtime_1.jsx)(__1.Button, { intent: "danger", onClick: onCancel, children: cancelText })] })] }) })) }) }));
69
- }
70
- exports.ConfirmModal = ConfirmModal;
71
- //# sourceMappingURL=ConfirmModal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfirmModal.js","sourceRoot":"","sources":["../../../src/components/modal/ConfirmModal.tsx"],"names":[],"mappings":";;;;;;;AAAA,6DAAqC;AAErC,iCAA2E;AAE3E,0BAA4B;AAC5B,kDAA+C;AAC/C,wEAAsE;AAEtE,2CAAwC;AAgBxC,MAAM,kBAAkB,GAAG,gBAAM,CAAC,MAAM,CAAA;;;;;;;;CAQvC,CAAC;AAEF,MAAM,oBAAoB,GAAG,gBAAM,CAAC,GAAG,CAErC;;;;;;;;;;2BAUyB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW;CAC1D,CAAC;AAEF,MAAM,wBAAwB,GAAG,gBAAM,CAAC,GAAG,CAAyB;WACzD,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW;;;;;;CAM1C,CAAC;AAEF,MAAM,kBAAkB,GAAG,gBAAM,CAAC,GAAG,CAAA;;;;;;CAMpC,CAAC;AAIF,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,EACJ,MAAM,EACN,QAAQ,GAAG,MAAM,EACjB,UAAU,GAAG,QAAQ,EACrB,WAAW,EACX,QAAQ,EACR,cAAc,EACd,QAAQ,GAAG,cAAc,EACzB,SAAS,EACT,sBAAsB,GAAG,IAAI,EAC7B,iBAAiB,GAAG,IAAI,EACxB,QAAQ,GACT,GAAG,KAAK,CAAC;IAEV,MAAM,SAAS,GAAG,IAAA,cAAM,EAAoB,IAAI,CAAC,CAAC;IAClD,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAA,qBAAS,EAAC;QAC9C,SAAS;QACT,MAAM;QACN,iBAAiB;QACjB,sBAAsB;QACtB,cAAc;KACf,CAAC,CAAC;IACH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GACrC,IAAA,gBAAQ,EAAyB,IAAI,CAAC,CAAC;IACzC,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EAAC,CAAC,IAA4B,EAAE,EAAE;QACrE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,2BAAmB,EACjB,iBAAiB,EACjB,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CACxB,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,uBAAC,eAAM,cACL,uBAAC,kBAAkB,OAAK,WAAW,EAAE,GAAG,EAAE,SAAS,YAChD,YAAY,IAAI,CACf,uBAAC,sCAAkB,IAAC,QAAQ,EAAE,aAAa,YACzC,wBAAC,oBAAoB,IACnB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,EAAE,QAAQ,EAAE,aAEnB,uBAAC,wBAAwB,IAAC,WAAW,EAAE,WAAW,YAC/C,QAAQ,GACgB,EAE3B,wBAAC,kBAAkB,eACjB,uBAAC,UAAM,IAAC,MAAM,EAAC,SAAS,EAAC,OAAO,EAAE,SAAS,YACxC,QAAQ,GACF,EACT,uBAAC,UAAM,IAAC,MAAM,EAAC,QAAQ,EAAC,OAAO,EAAE,QAAQ,YACtC,UAAU,GACJ,IACU,IACA,GACJ,CACtB,GACkB,GACd,CACV,CAAC;AACJ,CAAC;AAjED,oCAiEC"}
@@ -1,25 +0,0 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- export interface ModalProps {
3
- children: ReactElement | ReactElement[];
4
- isOpen: boolean;
5
- requestCloseOnEsc?: boolean;
6
- hasCloseButton?: boolean;
7
- requestCloseOnBackdrop?: boolean;
8
- onRequestClose: () => void;
9
- maxWidth?: number;
10
- width?: number;
11
- height?: number;
12
- }
13
- export declare function Modal(props: ModalProps): import("react/jsx-runtime").JSX.Element | null;
14
- export declare namespace Modal {
15
- var Header: (props: {
16
- children: ReactNode;
17
- }) => import("react/jsx-runtime").JSX.Element;
18
- var Body: (props: {
19
- children: ReactNode;
20
- }) => import("react/jsx-runtime").JSX.Element;
21
- var Footer: (props: {
22
- children: ReactNode;
23
- }) => import("react/jsx-runtime").JSX.Element;
24
- }
25
- //# sourceMappingURL=Modal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASrD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8CD,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,kDAgEtC;yBAhEe,KAAK"}
@@ -1,85 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Modal = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const styled_1 = __importDefault(require("@emotion/styled"));
9
- const react_1 = require("react");
10
- const index_1 = require("../index");
11
- const Portal_1 = require("../root-layout/Portal");
12
- const RootLayoutContext_1 = require("../root-layout/RootLayoutContext");
13
- const useDialog_1 = require("./useDialog");
14
- const DialogRoot = styled_1.default.dialog `
15
- background-color: transparent;
16
- :focus {
17
- outline: none;
18
- }
19
- ::backdrop {
20
- background-color: rgba(113, 113, 122, 0.75);
21
- }
22
- `;
23
- const DialogContents = styled_1.default.div `
24
- position: relative;
25
- display: flex;
26
- flex-direction: column;
27
- background-color: white;
28
- border-width: 1px;
29
- border-color: transparent;
30
- border-radius: 0.5rem;
31
- box-shadow:
32
- 0 0 0 0,
33
- 0 0px 16px rgba(0, 0, 0, 0.3);
34
- `;
35
- const ModalHeaderStyled = styled_1.default.div `
36
- display: flex;
37
- align-items: center;
38
- justify-content: space-between;
39
- padding: 10px 20px 10px 20px;
40
- border-bottom: 2px solid rgb(247, 247, 247);
41
- `;
42
- const ModalBodyStyled = styled_1.default.div `
43
- display: flex;
44
- flex: 1 1 0%;
45
- overflow-y: auto;
46
- `;
47
- const ModalFooterStyled = styled_1.default.div `
48
- border-top: 2px solid rgb(247, 247, 247);
49
- padding: 10px 20px 10px 20px;
50
- `;
51
- function Modal(props) {
52
- const { isOpen, onRequestClose, hasCloseButton = true, requestCloseOnBackdrop = true, requestCloseOnEsc = true, children, width, maxWidth, height, } = props;
53
- const dialogRef = (0, react_1.useRef)(null);
54
- const { dialogProps, isModalShown } = (0, useDialog_1.useDialog)({
55
- dialogRef,
56
- isOpen,
57
- requestCloseOnEsc,
58
- requestCloseOnBackdrop,
59
- onRequestClose,
60
- });
61
- const [portalDomNode, setPortalDomNode] = (0, react_1.useState)(null);
62
- const dialogCallbackRef = (0, react_1.useCallback)((node) => {
63
- setPortalDomNode(node);
64
- }, []);
65
- (0, react_1.useImperativeHandle)(dialogCallbackRef, () => dialogRef.current);
66
- if (!isOpen) {
67
- return null;
68
- }
69
- return ((0, jsx_runtime_1.jsx)(Portal_1.Portal, { children: (0, jsx_runtime_1.jsx)(DialogRoot, { ...dialogProps, ref: dialogRef, children: isModalShown && ((0, jsx_runtime_1.jsx)(RootLayoutContext_1.RootLayoutProvider, { innerRef: portalDomNode, children: (0, jsx_runtime_1.jsxs)(DialogContents, { style: {
70
- maxWidth,
71
- height: height || 'max-content',
72
- width: width || '100%',
73
- }, children: [children, hasCloseButton && ((0, jsx_runtime_1.jsx)(index_1.Button, { style: { position: 'absolute', top: 4, right: 4 }, onClick: onRequestClose, intent: "danger", minimal: true, icon: "cross" }))] }) })) }) }));
74
- }
75
- exports.Modal = Modal;
76
- Modal.Header = function ModalHeader(props) {
77
- return (0, jsx_runtime_1.jsx)(ModalHeaderStyled, { children: props.children });
78
- };
79
- Modal.Body = function ModalBody(props) {
80
- return (0, jsx_runtime_1.jsx)(ModalBodyStyled, { children: props.children });
81
- };
82
- Modal.Footer = function ModalFooter(props) {
83
- return (0, jsx_runtime_1.jsx)(ModalFooterStyled, { children: props.children });
84
- };
85
- //# sourceMappingURL=Modal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":";;;;;;;AAAA,6DAAqC;AAErC,iCAA2E;AAE3E,oCAAkC;AAClC,kDAA+C;AAC/C,wEAAsE;AAEtE,2CAAwC;AAcxC,MAAM,UAAU,GAAG,gBAAM,CAAC,MAAM,CAAA;;;;;;;;CAQ/B,CAAC;AAEF,MAAM,cAAc,GAAG,gBAAM,CAAC,GAAG,CAAA;;;;;;;;;;;CAWhC,CAAC;AAEF,MAAM,iBAAiB,GAAG,gBAAM,CAAC,GAAG,CAAA;;;;;;CAMnC,CAAC;AAEF,MAAM,eAAe,GAAG,gBAAM,CAAC,GAAG,CAAA;;;;CAIjC,CAAC;AAEF,MAAM,iBAAiB,GAAG,gBAAM,CAAC,GAAG,CAAA;;;CAGnC,CAAC;AAIF,SAAgB,KAAK,CAAC,KAAiB;IACrC,MAAM,EACJ,MAAM,EACN,cAAc,EACd,cAAc,GAAG,IAAI,EACrB,sBAAsB,GAAG,IAAI,EAC7B,iBAAiB,GAAG,IAAI,EACxB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,GACP,GAAG,KAAK,CAAC;IAEV,MAAM,SAAS,GAAG,IAAA,cAAM,EAAoB,IAAI,CAAC,CAAC;IAClD,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAA,qBAAS,EAAC;QAC9C,SAAS;QACT,MAAM;QACN,iBAAiB;QACjB,sBAAsB;QACtB,cAAc;KACf,CAAC,CAAC;IACH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GACrC,IAAA,gBAAQ,EAAyB,IAAI,CAAC,CAAC;IACzC,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EAAC,CAAC,IAA4B,EAAE,EAAE;QACrE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,2BAAmB,EACjB,iBAAiB,EACjB,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CACxB,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,uBAAC,eAAM,cACL,uBAAC,UAAU,OAAK,WAAW,EAAE,GAAG,EAAE,SAAS,YACxC,YAAY,IAAI,CACf,uBAAC,sCAAkB,IAAC,QAAQ,EAAE,aAAa,YACzC,wBAAC,cAAc,IACb,KAAK,EAAE;wBACL,QAAQ;wBACR,MAAM,EAAE,MAAM,IAAI,aAAa;wBAC/B,KAAK,EAAE,KAAK,IAAI,MAAM;qBACvB,aAEA,QAAQ,EACR,cAAc,IAAI,CACjB,uBAAC,cAAM,IACL,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EACjD,OAAO,EAAE,cAAc,EACvB,MAAM,EAAC,QAAQ,EACf,OAAO,QACP,IAAI,EAAC,OAAO,GACZ,CACH,IACc,GACE,CACtB,GACU,GACN,CACV,CAAC;AACJ,CAAC;AAhED,sBAgEC;AAED,KAAK,CAAC,MAAM,GAAG,SAAS,WAAW,CAAC,KAA8B;IAChE,OAAO,uBAAC,iBAAiB,cAAE,KAAK,CAAC,QAAQ,GAAqB,CAAC;AACjE,CAAC,CAAC;AAEF,KAAK,CAAC,IAAI,GAAG,SAAS,SAAS,CAAC,KAA8B;IAC5D,OAAO,uBAAC,eAAe,cAAE,KAAK,CAAC,QAAQ,GAAmB,CAAC;AAC7D,CAAC,CAAC;AAEF,KAAK,CAAC,MAAM,GAAG,SAAS,WAAW,CAAC,KAA8B;IAChE,OAAO,uBAAC,iBAAiB,cAAE,KAAK,CAAC,QAAQ,GAAqB,CAAC;AACjE,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './ConfirmModal';
2
- export * from './Modal';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/modal/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./ConfirmModal"), exports);
18
- __exportStar(require("./Modal"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/modal/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,0CAAwB"}
@@ -1,19 +0,0 @@
1
- import { MouseEventHandler, ReactEventHandler, RefObject } from 'react';
2
- interface UseDialogOptions {
3
- dialogRef: RefObject<HTMLDialogElement>;
4
- isOpen: boolean;
5
- requestCloseOnEsc: boolean;
6
- requestCloseOnBackdrop: boolean;
7
- onRequestClose: () => void;
8
- }
9
- interface UseDialogReturn {
10
- dialogProps: {
11
- onClick: MouseEventHandler<HTMLDialogElement>;
12
- onCancel: ReactEventHandler<HTMLDialogElement>;
13
- onClose: UseDialogOptions['onRequestClose'];
14
- };
15
- isModalShown: boolean;
16
- }
17
- export declare function useDialog({ dialogRef, isOpen, requestCloseOnEsc, requestCloseOnBackdrop, onRequestClose, }: UseDialogOptions): UseDialogReturn;
18
- export {};
19
- //# sourceMappingURL=useDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDialog.d.ts","sourceRoot":"","sources":["../../../src/components/modal/useDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EAIV,MAAM,OAAO,CAAC;AAKf,UAAU,gBAAgB;IACxB,SAAS,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,sBAAsB,EAAE,OAAO,CAAC;IAChC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,UAAU,eAAe;IACvB,WAAW,EAAE;QACX,OAAO,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;QAC9C,QAAQ,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;QAC/C,OAAO,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;KAC7C,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,EAAE,gBAAgB,GAAG,eAAe,CA2DpC"}