@rufous/ui 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +206 -145
- package/dist/Buttons/index.cjs +4 -4
- package/dist/Buttons/index.js +1 -1
- package/dist/Buttons/submitButton.cjs +4 -4
- package/dist/Buttons/submitButton.js +1 -1
- package/dist/Dialogs/BaseDialog.js +1 -1
- package/dist/Dialogs/index.js +1 -1
- package/dist/{chunk-SG65CGSF.js → chunk-7YKG3WYS.js} +4 -4
- package/dist/main.cjs +4 -4
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# @rufous/ui
|
|
2
2
|
|
|
3
|
-
A
|
|
4
|
-
Includes buttons, floating inputs, checkboxes, theme support, and icons.
|
|
3
|
+
A lightweight React UI component library with theming, buttons, inputs, dialogs, progress and a rich icon set.
|
|
5
4
|
|
|
6
5
|
---
|
|
7
6
|
|
|
@@ -9,58 +8,120 @@ Includes buttons, floating inputs, checkboxes, theme support, and icons.
|
|
|
9
8
|
|
|
10
9
|
```bash
|
|
11
10
|
npm install @rufous/ui
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
or
|
|
15
|
-
|
|
16
|
-
```bash
|
|
11
|
+
# or
|
|
17
12
|
yarn add @rufous/ui
|
|
18
13
|
```
|
|
19
14
|
|
|
20
15
|
---
|
|
21
16
|
|
|
22
|
-
##
|
|
17
|
+
## 🔧 Setup
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
Import the global styles once in your app entry (e.g. `src/main.tsx`, `pages/_app.tsx`).
|
|
25
20
|
|
|
26
21
|
```javascript
|
|
27
22
|
import "@rufous/ui/style.css";
|
|
28
23
|
```
|
|
29
24
|
|
|
30
|
-
|
|
25
|
+
Optional but recommended: wrap your app with the theme provider to enable theme utilities.
|
|
31
26
|
|
|
32
|
-
|
|
27
|
+
```tsx
|
|
28
|
+
import React from "react";
|
|
29
|
+
import ReactDOM from "react-dom/client";
|
|
30
|
+
import { RufousThemeProvider } from "@rufous/ui";
|
|
31
|
+
import "@rufous/ui/style.css";
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
34
|
+
<RufousThemeProvider>
|
|
35
|
+
<App />
|
|
36
|
+
</RufousThemeProvider>
|
|
37
|
+
);
|
|
38
|
+
```
|
|
35
39
|
|
|
36
40
|
---
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
## 🎨 Theming
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
import React from "react";
|
|
42
|
-
import { Button } from "@rufous/ui";
|
|
43
|
-
import "@rufous/ui/style.css";
|
|
44
|
+
`RufousThemeProvider` exposes `useRufousTheme` and `APP_THEMES`.
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
```tsx
|
|
47
|
+
import { useRufousTheme, APP_THEMES, Button } from "@rufous/ui";
|
|
48
|
+
|
|
49
|
+
export function ThemeToggle() {
|
|
50
|
+
const { previewTheme } = useRufousTheme();
|
|
46
51
|
return (
|
|
47
|
-
<
|
|
52
|
+
<div style={{ display: "flex", gap: 12 }}>
|
|
53
|
+
<Button
|
|
54
|
+
onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}
|
|
55
|
+
>
|
|
56
|
+
Light
|
|
57
|
+
</Button>
|
|
58
|
+
<Button
|
|
59
|
+
onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}
|
|
60
|
+
>
|
|
61
|
+
Dark
|
|
62
|
+
</Button>
|
|
63
|
+
</div>
|
|
48
64
|
);
|
|
49
65
|
}
|
|
50
66
|
```
|
|
51
67
|
|
|
52
68
|
---
|
|
53
69
|
|
|
54
|
-
|
|
70
|
+
## 🧩 Components
|
|
55
71
|
|
|
56
|
-
|
|
57
|
-
import React, { useState } from "react";
|
|
58
|
-
import { FloatingInput } from "@rufous/ui";
|
|
59
|
-
import "@rufous/ui/style.css";
|
|
72
|
+
Below are the primary components exported by the library with usage patterns and key props.
|
|
60
73
|
|
|
61
|
-
|
|
62
|
-
const [name, setName] = useState("");
|
|
74
|
+
### Buttons
|
|
63
75
|
|
|
76
|
+
All buttons accept native button props via `...rest`.
|
|
77
|
+
|
|
78
|
+
- **StandardButton**: Base neutral button
|
|
79
|
+
- **AddButton**: Prefixed with `+`
|
|
80
|
+
- **SubmitButton**: Submit/async actions with built-in loading and double-click handling
|
|
81
|
+
- **CancelButton**: Secondary/cancel action
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import {
|
|
85
|
+
StandardButton,
|
|
86
|
+
AddButton,
|
|
87
|
+
SubmitButton,
|
|
88
|
+
CancelButton,
|
|
89
|
+
} from "@rufous/ui";
|
|
90
|
+
|
|
91
|
+
export function ButtonsDemo() {
|
|
92
|
+
return (
|
|
93
|
+
<div style={{ display: "flex", gap: 12 }}>
|
|
94
|
+
<StandardButton onClick={() => alert("Standard")}>
|
|
95
|
+
Standard
|
|
96
|
+
</StandardButton>
|
|
97
|
+
<AddButton onClick={() => alert("Added")}>Add Item</AddButton>
|
|
98
|
+
<SubmitButton
|
|
99
|
+
onClick={async () => await new Promise((r) => setTimeout(r, 800))}
|
|
100
|
+
>
|
|
101
|
+
Save
|
|
102
|
+
</SubmitButton>
|
|
103
|
+
<CancelButton onClick={() => alert("Cancelled")}>Cancel</CancelButton>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- **SubmitButton props**
|
|
110
|
+
- `type`: "button" | "submit" | "reset" (auto-managed when `onClick` provided)
|
|
111
|
+
- `onClick(e)`: supports async; shows loader until resolved
|
|
112
|
+
- `onDoubleClick(e)`: optional alternate handler; debounced vs single click
|
|
113
|
+
- `isLoading`: boolean external control of loader
|
|
114
|
+
- `bgGradiant`: boolean gradient background
|
|
115
|
+
|
|
116
|
+
### Text Inputs
|
|
117
|
+
|
|
118
|
+
- **FloatingInput**: Floating label text input
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
import { FloatingInput } from "@rufous/ui";
|
|
122
|
+
|
|
123
|
+
export function NameField() {
|
|
124
|
+
const [name, setName] = React.useState("");
|
|
64
125
|
return (
|
|
65
126
|
<FloatingInput
|
|
66
127
|
label="Your Name"
|
|
@@ -73,167 +134,167 @@ export default function Example() {
|
|
|
73
134
|
}
|
|
74
135
|
```
|
|
75
136
|
|
|
76
|
-
|
|
137
|
+
- **FloatingInput props**
|
|
138
|
+
- `label`: string (required)
|
|
139
|
+
- `name`: string (required)
|
|
140
|
+
- `id`: string (defaults to `name`)
|
|
141
|
+
- `type`: string = "text"
|
|
142
|
+
- `value`: string
|
|
143
|
+
- `onChange(e)`: (required for controlled usage)
|
|
144
|
+
- `required`: boolean = false
|
|
145
|
+
- `placeholder`: string
|
|
146
|
+
- `className`: string
|
|
147
|
+
- `...divProps` applied to the wrapper
|
|
77
148
|
|
|
78
|
-
###
|
|
149
|
+
### Checkboxes
|
|
79
150
|
|
|
80
|
-
|
|
81
|
-
import React from "react";
|
|
82
|
-
import { Button, useRufousTheme, APP_THEMES } from "@rufous/ui";
|
|
83
|
-
import "@rufous/ui/style.css";
|
|
151
|
+
- **Checkbox**: Controlled checkbox with label
|
|
84
152
|
|
|
85
|
-
|
|
86
|
-
|
|
153
|
+
```tsx
|
|
154
|
+
import { Checkbox } from "@rufous/ui";
|
|
87
155
|
|
|
156
|
+
export function Terms() {
|
|
157
|
+
const [checked, setChecked] = React.useState(false);
|
|
88
158
|
return (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<Button
|
|
96
|
-
onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}
|
|
97
|
-
>
|
|
98
|
-
Dark
|
|
99
|
-
</Button>
|
|
100
|
-
</>
|
|
159
|
+
<Checkbox
|
|
160
|
+
id="terms"
|
|
161
|
+
label="I agree to the terms"
|
|
162
|
+
checked={checked}
|
|
163
|
+
onChange={setChecked}
|
|
164
|
+
/>
|
|
101
165
|
);
|
|
102
166
|
}
|
|
103
167
|
```
|
|
104
168
|
|
|
105
|
-
|
|
169
|
+
- **Checkbox props**
|
|
170
|
+
- `id`: string
|
|
171
|
+
- `label`: string
|
|
172
|
+
- `checked`: boolean
|
|
173
|
+
- `onChange(nextChecked: boolean)`: required
|
|
174
|
+
- `disabled`: boolean = false
|
|
175
|
+
- `className`: string
|
|
176
|
+
- `style`: React.CSSProperties
|
|
106
177
|
|
|
107
|
-
###
|
|
178
|
+
### Dialogs
|
|
108
179
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
import "@rufous/ui
|
|
180
|
+
- **BaseDialog**: Unopinionated modal container with header, close button, footer actions
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
import { BaseDialog, SubmitButton } from "@rufous/ui";
|
|
113
184
|
|
|
114
|
-
export
|
|
185
|
+
export function ConfirmDialog({ open, onClose, onConfirm }) {
|
|
115
186
|
return (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
187
|
+
<BaseDialog
|
|
188
|
+
open={open}
|
|
189
|
+
title="Confirm delete"
|
|
190
|
+
onClose={onClose}
|
|
191
|
+
onCancel={onClose}
|
|
192
|
+
onConfirm={onConfirm}
|
|
193
|
+
buttonAlign="flex-end"
|
|
194
|
+
showCancelButton
|
|
195
|
+
fullWidth
|
|
196
|
+
>
|
|
197
|
+
<p>Are you sure you want to delete this item?</p>
|
|
198
|
+
</BaseDialog>
|
|
120
199
|
);
|
|
121
200
|
}
|
|
122
201
|
```
|
|
123
202
|
|
|
124
|
-
|
|
203
|
+
- **BaseDialog props (key)**
|
|
204
|
+
- `open`: boolean (required to show)
|
|
205
|
+
- `title`: string
|
|
206
|
+
- `onClose()`: close handler
|
|
207
|
+
- `onCancel()`: cancel handler
|
|
208
|
+
- `onConfirm()`: sync/async confirm; built-in loading toggle
|
|
209
|
+
- `cancelText`, `confirmText`, `submitText`: strings
|
|
210
|
+
- `isLoading`, `loading`, `disableConfirmBtn`: booleans
|
|
211
|
+
- `minWidth`, `minHeight`, `fullWidth`, `fullScreen`: sizing controls
|
|
212
|
+
- `buttonAlign`: "flex-start" | "center" | "flex-end"
|
|
213
|
+
- `showCloseButton`, `showCancelButton`, `formatTitle`
|
|
214
|
+
- `className`, `dialogBodyStyle`
|
|
125
215
|
|
|
126
|
-
###
|
|
216
|
+
### Progress
|
|
127
217
|
|
|
128
|
-
|
|
129
|
-
import React from "react";
|
|
130
|
-
import { CopyIcon, EditIcon } from "@rufous/ui";
|
|
131
|
-
import "@rufous/ui/style.css";
|
|
218
|
+
- **CircularProgress**: Stroke-based loader
|
|
132
219
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
</div>
|
|
139
|
-
);
|
|
220
|
+
```tsx
|
|
221
|
+
import { CircularProgess } from "@rufous/ui"; // exported via SubmitButton internally as well
|
|
222
|
+
|
|
223
|
+
export function LoadingExample() {
|
|
224
|
+
return <CircularProgess size={36} color="#a81c08" />;
|
|
140
225
|
}
|
|
141
226
|
```
|
|
142
227
|
|
|
143
|
-
|
|
228
|
+
- **CircularProgess props**
|
|
229
|
+
- `size`: number = 50
|
|
230
|
+
- `color`: string = "#a81c08"
|
|
231
|
+
- `...divProps`
|
|
144
232
|
|
|
145
|
-
|
|
233
|
+
### Icons
|
|
146
234
|
|
|
147
|
-
|
|
235
|
+
All icons are React components that accept standard `svg`/`div`-style props depending on implementation; at minimum `className`, event handlers, and often `color` when applicable.
|
|
148
236
|
|
|
149
|
-
|
|
150
|
-
| ------- | -------- | ------- | --------------------- |
|
|
151
|
-
| variant | string | primary | Sets the button style |
|
|
152
|
-
| size | string | medium | Sets the button size |
|
|
153
|
-
| onClick | function | - | Click event handler |
|
|
237
|
+
Usage pattern:
|
|
154
238
|
|
|
155
|
-
|
|
239
|
+
```tsx
|
|
240
|
+
import { CopyIcon, EditIcon, DownloadIcon } from "@rufous/ui";
|
|
156
241
|
|
|
157
|
-
|
|
242
|
+
export function IconRow() {
|
|
243
|
+
return (
|
|
244
|
+
<div style={{ display: "flex", gap: 10 }}>
|
|
245
|
+
<CopyIcon onClick={() => alert("Copied!")} />
|
|
246
|
+
<EditIcon />
|
|
247
|
+
<DownloadIcon />
|
|
248
|
+
</div>
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
```
|
|
158
252
|
|
|
159
|
-
|
|
160
|
-
| -------- | -------- | ------- | ---------------------- |
|
|
161
|
-
| label | string | - | Floating label text |
|
|
162
|
-
| name | string | - | Input name attribute |
|
|
163
|
-
| value | string | - | Input value |
|
|
164
|
-
| onChange | function | - | Change event handler |
|
|
165
|
-
| required | boolean | false | Mark field as required |
|
|
253
|
+
Available icons include (non-exhaustive): `ActivateUserIcon`, `ArchivedIcon`, `AssignGroupIcon`, `CloseIcon`, `CopyIcon`, `DifficultyAllIcon`, `DifficultyEasyIcon`, `DifficultyMediumIcon`, `DifficultyHardIcon`, `DollarIcon`, `DownloadIcon`, `DownloadPdfIcon`, `EditChatIcon`, `EditIcon`, `EngagementIcon`, `FunctionIcon`, `HelpOutlinedIcon`, `HierarchyIcon`, `InactiveGroupIcon`, `IndustryIcon`, `InvoiceIcon`, `LocationPinIcon`, `LogsIcon`, `MinExperienceIcon`, `NineDotMenuIcon`, `NotificationIcon`, `ProjectIcon`, `QuestionStatusAllIcon`, `QuestionStatusPrivateIcon`, `QuestionStatusPublicIcon`, `QuestionTypeAllIcon`, `QuestionTypeCodingIcon`, `QuestionTypeDescriptiveIcon`, `QuestionTypeMultipleIcon`, `QuestionTypeSingleIcon`, `RefreshIcon`, `ResendInviteIcon`, `RolesIcon`, `RufousAiIcon`, `RufousBirdIcon`, `RufousLauncherIcon`, `SidebarIcon`, `SubscribeIcon`, `SuspendUserIcon`, `TickIcon`, `TimerIcon`, `TrashIcon`, `UnArchivedIcon`, `UnsubscribeIcon`, `UploadIcon`, `UserAssignIcon`, `ViewIcon`, `WorkItemIcon`.
|
|
166
254
|
|
|
167
255
|
---
|
|
168
256
|
|
|
169
|
-
|
|
257
|
+
## 🧾 Exports
|
|
170
258
|
|
|
171
|
-
|
|
172
|
-
| -------- | -------- | ------- | -------------------- |
|
|
173
|
-
| label | string | - | Checkbox label |
|
|
174
|
-
| checked | boolean | false | Checked state |
|
|
175
|
-
| onChange | function | - | Change event handler |
|
|
259
|
+
The package main re-exports everything you need from a single entry point:
|
|
176
260
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
261
|
+
```ts
|
|
262
|
+
// main entry exports
|
|
263
|
+
export { APP_THEMES } from "./utils/constants";
|
|
264
|
+
export * from "./icons"; // all icons
|
|
265
|
+
export * from "./Buttons"; // AddButton, SubmitButton, CancelButton, StandardButton
|
|
266
|
+
export * from "./Dialogs"; // BaseDialog
|
|
267
|
+
export {
|
|
268
|
+
RufousThemeProvider,
|
|
269
|
+
useRufousTheme,
|
|
270
|
+
} from "./Contexts/rufousThemeProvider";
|
|
271
|
+
```
|
|
180
272
|
|
|
181
|
-
|
|
273
|
+
Import from `@rufous/ui` directly:
|
|
182
274
|
|
|
183
|
-
```
|
|
184
|
-
import React, { useState } from "react";
|
|
275
|
+
```tsx
|
|
185
276
|
import {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
CopyIcon,
|
|
190
|
-
EditIcon,
|
|
277
|
+
SubmitButton,
|
|
278
|
+
BaseDialog,
|
|
279
|
+
RufousThemeProvider,
|
|
191
280
|
useRufousTheme,
|
|
192
281
|
APP_THEMES,
|
|
193
282
|
} from "@rufous/ui";
|
|
194
|
-
|
|
283
|
+
```
|
|
195
284
|
|
|
196
|
-
|
|
197
|
-
const [name, setName] = useState("");
|
|
198
|
-
const { previewTheme } = useRufousTheme();
|
|
285
|
+
---
|
|
199
286
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
required
|
|
212
|
-
/>
|
|
213
|
-
|
|
214
|
-
<Checkbox label="Accept Terms" />
|
|
215
|
-
|
|
216
|
-
<div style={{ marginTop: "10px" }}>
|
|
217
|
-
<Button
|
|
218
|
-
onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}
|
|
219
|
-
>
|
|
220
|
-
Light Theme
|
|
221
|
-
</Button>
|
|
222
|
-
<Button
|
|
223
|
-
onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}
|
|
224
|
-
>
|
|
225
|
-
Dark Theme
|
|
226
|
-
</Button>
|
|
227
|
-
</div>
|
|
228
|
-
|
|
229
|
-
<div style={{ display: "flex", gap: "10px", marginTop: "10px" }}>
|
|
230
|
-
<CopyIcon onClick={() => alert("Copied!")} />
|
|
231
|
-
<EditIcon onClick={() => alert("Edit clicked!")} />
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
```
|
|
287
|
+
## 🧠 Notes
|
|
288
|
+
|
|
289
|
+
- Always import `@rufous/ui/style.css` once to get base styles.
|
|
290
|
+
- `SubmitButton` manages `type` automatically when `onClick` is provided.
|
|
291
|
+
- Dialog confirm button disables while running async `onConfirm` to prevent repeats.
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## 🐛 Issues / Feedback
|
|
296
|
+
|
|
297
|
+
Please open an issue or PR in your repository to report bugs, request components, or propose improvements.
|
|
237
298
|
|
|
238
299
|
---
|
|
239
300
|
|
package/dist/Buttons/index.cjs
CHANGED
|
@@ -87,7 +87,7 @@ var SubmitButton = ({
|
|
|
87
87
|
const [loading, setLoading] = React3.useState(false);
|
|
88
88
|
const clickTimeout = React3.useRef(null);
|
|
89
89
|
const handleClick = async (e) => {
|
|
90
|
-
e.
|
|
90
|
+
const currentTarget = e.currentTarget;
|
|
91
91
|
if (loading) return;
|
|
92
92
|
if (clickTimeout.current) {
|
|
93
93
|
clearTimeout(clickTimeout.current);
|
|
@@ -97,7 +97,7 @@ var SubmitButton = ({
|
|
|
97
97
|
if (onClick) {
|
|
98
98
|
setLoading(true);
|
|
99
99
|
try {
|
|
100
|
-
await onClick(e);
|
|
100
|
+
await onClick({ ...e, currentTarget });
|
|
101
101
|
} finally {
|
|
102
102
|
setLoading(false);
|
|
103
103
|
}
|
|
@@ -105,7 +105,7 @@ var SubmitButton = ({
|
|
|
105
105
|
}, 250);
|
|
106
106
|
};
|
|
107
107
|
const handleDoubleClick = async (e) => {
|
|
108
|
-
e.
|
|
108
|
+
const currentTarget = e.currentTarget;
|
|
109
109
|
if (loading) return;
|
|
110
110
|
if (clickTimeout.current) {
|
|
111
111
|
clearTimeout(clickTimeout.current);
|
|
@@ -114,7 +114,7 @@ var SubmitButton = ({
|
|
|
114
114
|
if (onDoubleClick) {
|
|
115
115
|
setLoading(true);
|
|
116
116
|
try {
|
|
117
|
-
await onDoubleClick(e);
|
|
117
|
+
await onDoubleClick({ ...e, currentTarget });
|
|
118
118
|
} finally {
|
|
119
119
|
setLoading(false);
|
|
120
120
|
}
|
package/dist/Buttons/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var SubmitButton = ({
|
|
|
75
75
|
const [loading, setLoading] = React2.useState(false);
|
|
76
76
|
const clickTimeout = React2.useRef(null);
|
|
77
77
|
const handleClick = async (e) => {
|
|
78
|
-
e.
|
|
78
|
+
const currentTarget = e.currentTarget;
|
|
79
79
|
if (loading) return;
|
|
80
80
|
if (clickTimeout.current) {
|
|
81
81
|
clearTimeout(clickTimeout.current);
|
|
@@ -85,7 +85,7 @@ var SubmitButton = ({
|
|
|
85
85
|
if (onClick) {
|
|
86
86
|
setLoading(true);
|
|
87
87
|
try {
|
|
88
|
-
await onClick(e);
|
|
88
|
+
await onClick({ ...e, currentTarget });
|
|
89
89
|
} finally {
|
|
90
90
|
setLoading(false);
|
|
91
91
|
}
|
|
@@ -93,7 +93,7 @@ var SubmitButton = ({
|
|
|
93
93
|
}, 250);
|
|
94
94
|
};
|
|
95
95
|
const handleDoubleClick = async (e) => {
|
|
96
|
-
e.
|
|
96
|
+
const currentTarget = e.currentTarget;
|
|
97
97
|
if (loading) return;
|
|
98
98
|
if (clickTimeout.current) {
|
|
99
99
|
clearTimeout(clickTimeout.current);
|
|
@@ -102,7 +102,7 @@ var SubmitButton = ({
|
|
|
102
102
|
if (onDoubleClick) {
|
|
103
103
|
setLoading(true);
|
|
104
104
|
try {
|
|
105
|
-
await onDoubleClick(e);
|
|
105
|
+
await onDoubleClick({ ...e, currentTarget });
|
|
106
106
|
} finally {
|
|
107
107
|
setLoading(false);
|
|
108
108
|
}
|
|
@@ -61,7 +61,7 @@ import "../chunk-QPGJCRBS.js";
|
|
|
61
61
|
import "../chunk-U7SARO5B.js";
|
|
62
62
|
import "../chunk-BMMDUQDJ.js";
|
|
63
63
|
import "../chunk-R3GARAVJ.js";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-7YKG3WYS.js";
|
|
65
65
|
import "../chunk-YRFUVQDN.js";
|
|
66
66
|
export {
|
|
67
67
|
BaseDialog_default as default
|
package/dist/Dialogs/index.js
CHANGED
|
@@ -61,7 +61,7 @@ import "../chunk-QPGJCRBS.js";
|
|
|
61
61
|
import "../chunk-U7SARO5B.js";
|
|
62
62
|
import "../chunk-BMMDUQDJ.js";
|
|
63
63
|
import "../chunk-R3GARAVJ.js";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-7YKG3WYS.js";
|
|
65
65
|
import "../chunk-YRFUVQDN.js";
|
|
66
66
|
export {
|
|
67
67
|
BaseDialog_default as BaseDialog
|
|
@@ -16,7 +16,7 @@ var SubmitButton = ({
|
|
|
16
16
|
const [loading, setLoading] = React.useState(false);
|
|
17
17
|
const clickTimeout = React.useRef(null);
|
|
18
18
|
const handleClick = async (e) => {
|
|
19
|
-
e.
|
|
19
|
+
const currentTarget = e.currentTarget;
|
|
20
20
|
if (loading) return;
|
|
21
21
|
if (clickTimeout.current) {
|
|
22
22
|
clearTimeout(clickTimeout.current);
|
|
@@ -26,7 +26,7 @@ var SubmitButton = ({
|
|
|
26
26
|
if (onClick) {
|
|
27
27
|
setLoading(true);
|
|
28
28
|
try {
|
|
29
|
-
await onClick(e);
|
|
29
|
+
await onClick({ ...e, currentTarget });
|
|
30
30
|
} finally {
|
|
31
31
|
setLoading(false);
|
|
32
32
|
}
|
|
@@ -34,7 +34,7 @@ var SubmitButton = ({
|
|
|
34
34
|
}, 250);
|
|
35
35
|
};
|
|
36
36
|
const handleDoubleClick = async (e) => {
|
|
37
|
-
e.
|
|
37
|
+
const currentTarget = e.currentTarget;
|
|
38
38
|
if (loading) return;
|
|
39
39
|
if (clickTimeout.current) {
|
|
40
40
|
clearTimeout(clickTimeout.current);
|
|
@@ -43,7 +43,7 @@ var SubmitButton = ({
|
|
|
43
43
|
if (onDoubleClick) {
|
|
44
44
|
setLoading(true);
|
|
45
45
|
try {
|
|
46
|
-
await onDoubleClick(e);
|
|
46
|
+
await onDoubleClick({ ...e, currentTarget });
|
|
47
47
|
} finally {
|
|
48
48
|
setLoading(false);
|
|
49
49
|
}
|
package/dist/main.cjs
CHANGED
|
@@ -1137,7 +1137,7 @@ var SubmitButton = ({
|
|
|
1137
1137
|
const [loading, setLoading] = React56.useState(false);
|
|
1138
1138
|
const clickTimeout = React56.useRef(null);
|
|
1139
1139
|
const handleClick = async (e) => {
|
|
1140
|
-
e.
|
|
1140
|
+
const currentTarget = e.currentTarget;
|
|
1141
1141
|
if (loading) return;
|
|
1142
1142
|
if (clickTimeout.current) {
|
|
1143
1143
|
clearTimeout(clickTimeout.current);
|
|
@@ -1147,7 +1147,7 @@ var SubmitButton = ({
|
|
|
1147
1147
|
if (onClick) {
|
|
1148
1148
|
setLoading(true);
|
|
1149
1149
|
try {
|
|
1150
|
-
await onClick(e);
|
|
1150
|
+
await onClick({ ...e, currentTarget });
|
|
1151
1151
|
} finally {
|
|
1152
1152
|
setLoading(false);
|
|
1153
1153
|
}
|
|
@@ -1155,7 +1155,7 @@ var SubmitButton = ({
|
|
|
1155
1155
|
}, 250);
|
|
1156
1156
|
};
|
|
1157
1157
|
const handleDoubleClick = async (e) => {
|
|
1158
|
-
e.
|
|
1158
|
+
const currentTarget = e.currentTarget;
|
|
1159
1159
|
if (loading) return;
|
|
1160
1160
|
if (clickTimeout.current) {
|
|
1161
1161
|
clearTimeout(clickTimeout.current);
|
|
@@ -1164,7 +1164,7 @@ var SubmitButton = ({
|
|
|
1164
1164
|
if (onDoubleClick) {
|
|
1165
1165
|
setLoading(true);
|
|
1166
1166
|
try {
|
|
1167
|
-
await onDoubleClick(e);
|
|
1167
|
+
await onDoubleClick({ ...e, currentTarget });
|
|
1168
1168
|
} finally {
|
|
1169
1169
|
setLoading(false);
|
|
1170
1170
|
}
|
package/dist/main.js
CHANGED