framepexls-ui-lib 0.1.13 → 0.1.14
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/dist/ActionIconButton.d.mts +1 -0
- package/dist/ActionIconButton.d.ts +1 -0
- package/dist/ActionIconButton.js +12 -9
- package/dist/ActionIconButton.mjs +13 -10
- package/dist/AppTopbar.js +23 -6
- package/dist/AppTopbar.mjs +13 -6
- package/dist/AvatarGroup.d.mts +14 -0
- package/dist/AvatarGroup.d.ts +14 -0
- package/dist/AvatarGroup.js +77 -0
- package/dist/AvatarGroup.mjs +47 -0
- package/dist/AvatarSquare.d.mts +2 -5
- package/dist/AvatarSquare.d.ts +2 -5
- package/dist/AvatarSquare.js +52 -3
- package/dist/AvatarSquare.mjs +52 -3
- package/dist/Badge.d.mts +2 -1
- package/dist/Badge.d.ts +2 -1
- package/dist/Badge.js +3 -1
- package/dist/Badge.mjs +3 -1
- package/dist/BadgeCluster.js +3 -3
- package/dist/BadgeCluster.mjs +3 -3
- package/dist/Button.d.mts +3 -4
- package/dist/Button.d.ts +3 -4
- package/dist/Button.js +96 -8
- package/dist/Button.mjs +86 -8
- package/dist/CalendarPanel.js +20 -3
- package/dist/CalendarPanel.mjs +10 -3
- package/dist/Card.d.mts +6 -0
- package/dist/Card.d.ts +6 -0
- package/dist/Card.js +52 -0
- package/dist/Card.mjs +22 -0
- package/dist/CheckboxPillsGroup.d.mts +2 -1
- package/dist/CheckboxPillsGroup.d.ts +2 -1
- package/dist/CheckboxPillsGroup.js +8 -4
- package/dist/CheckboxPillsGroup.mjs +8 -4
- package/dist/ColumnSelector.js +16 -2
- package/dist/ColumnSelector.mjs +6 -2
- package/dist/ComboSelect.d.mts +0 -2
- package/dist/ComboSelect.d.ts +0 -2
- package/dist/ComboSelect.js +8 -4
- package/dist/ComboSelect.mjs +8 -4
- package/dist/DateTimeField.d.mts +0 -5
- package/dist/DateTimeField.d.ts +0 -5
- package/dist/DateTimeField.js +17 -8
- package/dist/DateTimeField.mjs +17 -8
- package/dist/Dialog.d.mts +2 -5
- package/dist/Dialog.d.ts +2 -5
- package/dist/Dialog.js +21 -22
- package/dist/Dialog.mjs +21 -22
- package/dist/Drawer.d.mts +38 -0
- package/dist/Drawer.d.ts +38 -0
- package/dist/Drawer.js +139 -0
- package/dist/Drawer.mjs +102 -0
- package/dist/Dropdown.d.mts +0 -3
- package/dist/Dropdown.d.ts +0 -3
- package/dist/Dropdown.js +61 -42
- package/dist/Dropdown.mjs +51 -42
- package/dist/Input.d.mts +2 -0
- package/dist/Input.d.ts +2 -0
- package/dist/Input.js +20 -5
- package/dist/Input.mjs +20 -5
- package/dist/Link.d.mts +15 -0
- package/dist/Link.d.ts +15 -0
- package/dist/Link.js +93 -0
- package/dist/Link.mjs +63 -0
- package/dist/MediaCard.d.mts +15 -0
- package/dist/MediaCard.d.ts +15 -0
- package/dist/MediaCard.js +153 -0
- package/dist/MediaCard.mjs +123 -0
- package/dist/MediaSelector.d.mts +48 -0
- package/dist/MediaSelector.d.ts +48 -0
- package/dist/MediaSelector.js +225 -0
- package/dist/MediaSelector.mjs +195 -0
- package/dist/Money.d.mts +2 -1
- package/dist/Money.d.ts +2 -1
- package/dist/Money.js +26 -2
- package/dist/Money.mjs +26 -2
- package/dist/MultiComboSelect.js +6 -11
- package/dist/MultiComboSelect.mjs +6 -11
- package/dist/OrderButton.js +13 -1
- package/dist/OrderButton.mjs +3 -1
- package/dist/Pagination.d.mts +2 -1
- package/dist/Pagination.d.ts +2 -1
- package/dist/Pagination.js +40 -3
- package/dist/Pagination.mjs +30 -3
- package/dist/ReviewHistory.js +3 -9
- package/dist/ReviewHistory.mjs +3 -9
- package/dist/SearchInput.js +17 -42
- package/dist/SearchInput.mjs +17 -42
- package/dist/Select.js +5 -2
- package/dist/Select.mjs +5 -2
- package/dist/Sidebar.d.mts +2 -3
- package/dist/Sidebar.d.ts +2 -3
- package/dist/Sidebar.js +132 -24
- package/dist/Sidebar.mjs +132 -24
- package/dist/Steps.d.mts +0 -2
- package/dist/Steps.d.ts +0 -2
- package/dist/Steps.js +19 -6
- package/dist/Steps.mjs +9 -6
- package/dist/Table.js +3 -1
- package/dist/Table.mjs +3 -1
- package/dist/TimePanel.js +21 -7
- package/dist/TimePanel.mjs +11 -7
- package/dist/TimePopover.js +32 -15
- package/dist/TimePopover.mjs +32 -15
- package/dist/TimeRangeField.js +13 -6
- package/dist/TimeRangeField.mjs +13 -6
- package/dist/Toast.d.mts +53 -0
- package/dist/Toast.d.ts +53 -0
- package/dist/Toast.js +273 -0
- package/dist/Toast.mjs +238 -0
- package/dist/Tooltip.d.mts +15 -0
- package/dist/Tooltip.d.ts +15 -0
- package/dist/Tooltip.js +135 -0
- package/dist/Tooltip.mjs +105 -0
- package/dist/UploadCard.d.mts +27 -0
- package/dist/UploadCard.d.ts +27 -0
- package/dist/UploadCard.js +143 -0
- package/dist/UploadCard.mjs +113 -0
- package/dist/index.d.mts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +30 -1
- package/dist/index.mjs +58 -39
- package/package.json +1 -1
package/dist/TimePopover.js
CHANGED
|
@@ -37,6 +37,8 @@ module.exports = __toCommonJS(TimePopover_exports);
|
|
|
37
37
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
38
|
var React = __toESM(require("react"));
|
|
39
39
|
var import_react_dom = require("react-dom");
|
|
40
|
+
var import_Button = __toESM(require("./Button"));
|
|
41
|
+
var import_Input = __toESM(require("./Input"));
|
|
40
42
|
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
41
43
|
function TimePopover({
|
|
42
44
|
anchorEl,
|
|
@@ -148,8 +150,9 @@ function TimePopover({
|
|
|
148
150
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
149
151
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-stretch gap-2", children: [
|
|
150
152
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
151
|
-
|
|
153
|
+
import_Button.default,
|
|
152
154
|
{
|
|
155
|
+
unstyled: true,
|
|
153
156
|
type: "button",
|
|
154
157
|
className: "h-8 rounded-lg ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:hover:bg-white/10",
|
|
155
158
|
onClick: () => incH(1),
|
|
@@ -158,8 +161,9 @@ function TimePopover({
|
|
|
158
161
|
}
|
|
159
162
|
),
|
|
160
163
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
-
|
|
164
|
+
import_Input.default,
|
|
162
165
|
{
|
|
166
|
+
unstyled: true,
|
|
163
167
|
inputMode: "numeric",
|
|
164
168
|
"aria-label": "Hora",
|
|
165
169
|
value: pad2(is12h ? hour12 : H),
|
|
@@ -184,8 +188,9 @@ function TimePopover({
|
|
|
184
188
|
}
|
|
185
189
|
),
|
|
186
190
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
187
|
-
|
|
191
|
+
import_Button.default,
|
|
188
192
|
{
|
|
193
|
+
unstyled: true,
|
|
189
194
|
type: "button",
|
|
190
195
|
className: "h-8 rounded-lg ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:hover:bg-white/10",
|
|
191
196
|
onClick: () => incH(-1),
|
|
@@ -196,8 +201,9 @@ function TimePopover({
|
|
|
196
201
|
] }),
|
|
197
202
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-stretch gap-2", children: [
|
|
198
203
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
199
|
-
|
|
204
|
+
import_Button.default,
|
|
200
205
|
{
|
|
206
|
+
unstyled: true,
|
|
201
207
|
type: "button",
|
|
202
208
|
className: "h-8 rounded-lg ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:hover:bg-white/10",
|
|
203
209
|
onClick: () => incM(+step),
|
|
@@ -206,8 +212,9 @@ function TimePopover({
|
|
|
206
212
|
}
|
|
207
213
|
),
|
|
208
214
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
209
|
-
|
|
215
|
+
import_Input.default,
|
|
210
216
|
{
|
|
217
|
+
unstyled: true,
|
|
211
218
|
inputMode: "numeric",
|
|
212
219
|
"aria-label": "Minutos",
|
|
213
220
|
value: pad2(M),
|
|
@@ -223,8 +230,9 @@ function TimePopover({
|
|
|
223
230
|
}
|
|
224
231
|
),
|
|
225
232
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
226
|
-
|
|
233
|
+
import_Button.default,
|
|
227
234
|
{
|
|
235
|
+
unstyled: true,
|
|
228
236
|
type: "button",
|
|
229
237
|
className: "h-8 rounded-lg ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:hover:bg-white/10",
|
|
230
238
|
onClick: () => incM(-step),
|
|
@@ -240,8 +248,9 @@ function TimePopover({
|
|
|
240
248
|
const light = active ? "bg-slate-900 text-white ring-slate-900" : "ring-slate-200 hover:bg-slate-50";
|
|
241
249
|
const dark = active ? "dark:bg-white dark:text-slate-900 dark:ring-white" : "dark:ring-white/10 dark:hover:bg-white/10";
|
|
242
250
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
243
|
-
|
|
251
|
+
import_Button.default,
|
|
244
252
|
{
|
|
253
|
+
unstyled: true,
|
|
245
254
|
type: "button",
|
|
246
255
|
className: `${base} ${light} ${dark}`,
|
|
247
256
|
"aria-pressed": active,
|
|
@@ -257,8 +266,9 @@ function TimePopover({
|
|
|
257
266
|
}) }),
|
|
258
267
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-3 flex items-center justify-between", children: [
|
|
259
268
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
260
|
-
|
|
269
|
+
import_Button.default,
|
|
261
270
|
{
|
|
271
|
+
unstyled: true,
|
|
262
272
|
type: "button",
|
|
263
273
|
className: "rounded-xl px-2.5 py-1.5 text-sm ring-1 ring-slate-200 hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
264
274
|
onClick: () => {
|
|
@@ -270,8 +280,9 @@ function TimePopover({
|
|
|
270
280
|
}
|
|
271
281
|
),
|
|
272
282
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
273
|
-
|
|
283
|
+
import_Button.default,
|
|
274
284
|
{
|
|
285
|
+
unstyled: true,
|
|
275
286
|
type: "button",
|
|
276
287
|
className: "rounded-xl bg-slate-900 px-3 py-1.5 text-sm text-white hover:opacity-95 active:scale-[0.98] dark:bg-white dark:text-slate-900",
|
|
277
288
|
onClick: onClose,
|
|
@@ -342,8 +353,9 @@ function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
342
353
|
const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: popRef, style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 }, className: "w-[340px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0e0d0e]", children: [
|
|
343
354
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
344
355
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
345
|
-
|
|
356
|
+
import_Button.default,
|
|
346
357
|
{
|
|
358
|
+
unstyled: true,
|
|
347
359
|
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
348
360
|
onClick: () => onCursorChange(new Date(year, month - 1, 1)),
|
|
349
361
|
children: "\u25C0"
|
|
@@ -351,8 +363,9 @@ function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
351
363
|
),
|
|
352
364
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-semibold", children: cursor.toLocaleDateString("es-MX", { month: "long", year: "numeric" }) }),
|
|
353
365
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
354
|
-
|
|
366
|
+
import_Button.default,
|
|
355
367
|
{
|
|
368
|
+
unstyled: true,
|
|
356
369
|
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
357
370
|
onClick: () => onCursorChange(new Date(year, month + 1, 1)),
|
|
358
371
|
children: "\u25B6"
|
|
@@ -362,8 +375,9 @@ function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
362
375
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid gap-2", children: weeks.map((w, idx) => {
|
|
363
376
|
const isSel = selFrom && selTo && sameDay(selFrom, w.from) && sameDay(selTo, w.to);
|
|
364
377
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
365
|
-
|
|
378
|
+
import_Button.default,
|
|
366
379
|
{
|
|
380
|
+
unstyled: true,
|
|
367
381
|
className: `flex items-center justify-between rounded-xl border px-3 py-2 text-sm ${isSel ? "bg-slate-900 text-white border-slate-900 dark:bg-white dark:text-slate-900 dark:border-white" : "border-slate-200 hover:bg-slate-100 dark:border-white/10 dark:hover:bg-white/10"}`,
|
|
368
382
|
onClick: () => onPick(w.from, w.to),
|
|
369
383
|
children: [
|
|
@@ -445,8 +459,9 @@ function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
445
459
|
const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: popRef, style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 }, className: "w-[300px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0e0d0e]", children: [
|
|
446
460
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
447
461
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
448
|
-
|
|
462
|
+
import_Button.default,
|
|
449
463
|
{
|
|
464
|
+
unstyled: true,
|
|
450
465
|
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
451
466
|
onClick: () => onCursorChange(new Date(year - 1, 0, 1)),
|
|
452
467
|
children: "\u25C0"
|
|
@@ -454,8 +469,9 @@ function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
454
469
|
),
|
|
455
470
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-semibold", children: year }),
|
|
456
471
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
457
|
-
|
|
472
|
+
import_Button.default,
|
|
458
473
|
{
|
|
474
|
+
unstyled: true,
|
|
459
475
|
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
460
476
|
onClick: () => onCursorChange(new Date(year + 1, 0, 1)),
|
|
461
477
|
children: "\u25B6"
|
|
@@ -468,8 +484,9 @@ function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
468
484
|
const light = isSel ? "bg-slate-900 text-white border-slate-900" : "border-slate-200 hover:bg-slate-100";
|
|
469
485
|
const dark = isSel ? "dark:bg-white dark:text-slate-900 dark:border-white" : "dark:border-white/10 dark:hover:bg-white/10";
|
|
470
486
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
471
|
-
|
|
487
|
+
import_Button.default,
|
|
472
488
|
{
|
|
489
|
+
unstyled: true,
|
|
473
490
|
className: `${base} ${light} ${dark}`,
|
|
474
491
|
onClick: () => onPick(new Date(year, idx, 1)),
|
|
475
492
|
children: m
|
package/dist/TimePopover.mjs
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
|
+
import Button from "./Button";
|
|
6
|
+
import Input from "./Input";
|
|
5
7
|
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
6
8
|
function TimePopover({
|
|
7
9
|
anchorEl,
|
|
@@ -113,8 +115,9 @@ function TimePopover({
|
|
|
113
115
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
114
116
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-stretch gap-2", children: [
|
|
115
117
|
/* @__PURE__ */ jsx(
|
|
116
|
-
|
|
118
|
+
Button,
|
|
117
119
|
{
|
|
120
|
+
unstyled: true,
|
|
118
121
|
type: "button",
|
|
119
122
|
className: "h-8 rounded-lg ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:hover:bg-white/10",
|
|
120
123
|
onClick: () => incH(1),
|
|
@@ -123,8 +126,9 @@ function TimePopover({
|
|
|
123
126
|
}
|
|
124
127
|
),
|
|
125
128
|
/* @__PURE__ */ jsx(
|
|
126
|
-
|
|
129
|
+
Input,
|
|
127
130
|
{
|
|
131
|
+
unstyled: true,
|
|
128
132
|
inputMode: "numeric",
|
|
129
133
|
"aria-label": "Hora",
|
|
130
134
|
value: pad2(is12h ? hour12 : H),
|
|
@@ -149,8 +153,9 @@ function TimePopover({
|
|
|
149
153
|
}
|
|
150
154
|
),
|
|
151
155
|
/* @__PURE__ */ jsx(
|
|
152
|
-
|
|
156
|
+
Button,
|
|
153
157
|
{
|
|
158
|
+
unstyled: true,
|
|
154
159
|
type: "button",
|
|
155
160
|
className: "h-8 rounded-lg ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:hover:bg-white/10",
|
|
156
161
|
onClick: () => incH(-1),
|
|
@@ -161,8 +166,9 @@ function TimePopover({
|
|
|
161
166
|
] }),
|
|
162
167
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-stretch gap-2", children: [
|
|
163
168
|
/* @__PURE__ */ jsx(
|
|
164
|
-
|
|
169
|
+
Button,
|
|
165
170
|
{
|
|
171
|
+
unstyled: true,
|
|
166
172
|
type: "button",
|
|
167
173
|
className: "h-8 rounded-lg ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:hover:bg-white/10",
|
|
168
174
|
onClick: () => incM(+step),
|
|
@@ -171,8 +177,9 @@ function TimePopover({
|
|
|
171
177
|
}
|
|
172
178
|
),
|
|
173
179
|
/* @__PURE__ */ jsx(
|
|
174
|
-
|
|
180
|
+
Input,
|
|
175
181
|
{
|
|
182
|
+
unstyled: true,
|
|
176
183
|
inputMode: "numeric",
|
|
177
184
|
"aria-label": "Minutos",
|
|
178
185
|
value: pad2(M),
|
|
@@ -188,8 +195,9 @@ function TimePopover({
|
|
|
188
195
|
}
|
|
189
196
|
),
|
|
190
197
|
/* @__PURE__ */ jsx(
|
|
191
|
-
|
|
198
|
+
Button,
|
|
192
199
|
{
|
|
200
|
+
unstyled: true,
|
|
193
201
|
type: "button",
|
|
194
202
|
className: "h-8 rounded-lg ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:hover:bg-white/10",
|
|
195
203
|
onClick: () => incM(-step),
|
|
@@ -205,8 +213,9 @@ function TimePopover({
|
|
|
205
213
|
const light = active ? "bg-slate-900 text-white ring-slate-900" : "ring-slate-200 hover:bg-slate-50";
|
|
206
214
|
const dark = active ? "dark:bg-white dark:text-slate-900 dark:ring-white" : "dark:ring-white/10 dark:hover:bg-white/10";
|
|
207
215
|
return /* @__PURE__ */ jsx(
|
|
208
|
-
|
|
216
|
+
Button,
|
|
209
217
|
{
|
|
218
|
+
unstyled: true,
|
|
210
219
|
type: "button",
|
|
211
220
|
className: `${base} ${light} ${dark}`,
|
|
212
221
|
"aria-pressed": active,
|
|
@@ -222,8 +231,9 @@ function TimePopover({
|
|
|
222
231
|
}) }),
|
|
223
232
|
/* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center justify-between", children: [
|
|
224
233
|
/* @__PURE__ */ jsx(
|
|
225
|
-
|
|
234
|
+
Button,
|
|
226
235
|
{
|
|
236
|
+
unstyled: true,
|
|
227
237
|
type: "button",
|
|
228
238
|
className: "rounded-xl px-2.5 py-1.5 text-sm ring-1 ring-slate-200 hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
229
239
|
onClick: () => {
|
|
@@ -235,8 +245,9 @@ function TimePopover({
|
|
|
235
245
|
}
|
|
236
246
|
),
|
|
237
247
|
/* @__PURE__ */ jsx(
|
|
238
|
-
|
|
248
|
+
Button,
|
|
239
249
|
{
|
|
250
|
+
unstyled: true,
|
|
240
251
|
type: "button",
|
|
241
252
|
className: "rounded-xl bg-slate-900 px-3 py-1.5 text-sm text-white hover:opacity-95 active:scale-[0.98] dark:bg-white dark:text-slate-900",
|
|
242
253
|
onClick: onClose,
|
|
@@ -307,8 +318,9 @@ function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
307
318
|
const body = /* @__PURE__ */ jsxs("div", { ref: popRef, style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 }, className: "w-[340px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0e0d0e]", children: [
|
|
308
319
|
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
309
320
|
/* @__PURE__ */ jsx(
|
|
310
|
-
|
|
321
|
+
Button,
|
|
311
322
|
{
|
|
323
|
+
unstyled: true,
|
|
312
324
|
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
313
325
|
onClick: () => onCursorChange(new Date(year, month - 1, 1)),
|
|
314
326
|
children: "\u25C0"
|
|
@@ -316,8 +328,9 @@ function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
316
328
|
),
|
|
317
329
|
/* @__PURE__ */ jsx("div", { className: "text-sm font-semibold", children: cursor.toLocaleDateString("es-MX", { month: "long", year: "numeric" }) }),
|
|
318
330
|
/* @__PURE__ */ jsx(
|
|
319
|
-
|
|
331
|
+
Button,
|
|
320
332
|
{
|
|
333
|
+
unstyled: true,
|
|
321
334
|
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
322
335
|
onClick: () => onCursorChange(new Date(year, month + 1, 1)),
|
|
323
336
|
children: "\u25B6"
|
|
@@ -327,8 +340,9 @@ function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
327
340
|
/* @__PURE__ */ jsx("div", { className: "grid gap-2", children: weeks.map((w, idx) => {
|
|
328
341
|
const isSel = selFrom && selTo && sameDay(selFrom, w.from) && sameDay(selTo, w.to);
|
|
329
342
|
return /* @__PURE__ */ jsxs(
|
|
330
|
-
|
|
343
|
+
Button,
|
|
331
344
|
{
|
|
345
|
+
unstyled: true,
|
|
332
346
|
className: `flex items-center justify-between rounded-xl border px-3 py-2 text-sm ${isSel ? "bg-slate-900 text-white border-slate-900 dark:bg-white dark:text-slate-900 dark:border-white" : "border-slate-200 hover:bg-slate-100 dark:border-white/10 dark:hover:bg-white/10"}`,
|
|
333
347
|
onClick: () => onPick(w.from, w.to),
|
|
334
348
|
children: [
|
|
@@ -410,8 +424,9 @@ function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
410
424
|
const body = /* @__PURE__ */ jsxs("div", { ref: popRef, style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 }, className: "w-[300px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0e0d0e]", children: [
|
|
411
425
|
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
412
426
|
/* @__PURE__ */ jsx(
|
|
413
|
-
|
|
427
|
+
Button,
|
|
414
428
|
{
|
|
429
|
+
unstyled: true,
|
|
415
430
|
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
416
431
|
onClick: () => onCursorChange(new Date(year - 1, 0, 1)),
|
|
417
432
|
children: "\u25C0"
|
|
@@ -419,8 +434,9 @@ function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
419
434
|
),
|
|
420
435
|
/* @__PURE__ */ jsx("div", { className: "text-sm font-semibold", children: year }),
|
|
421
436
|
/* @__PURE__ */ jsx(
|
|
422
|
-
|
|
437
|
+
Button,
|
|
423
438
|
{
|
|
439
|
+
unstyled: true,
|
|
424
440
|
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
425
441
|
onClick: () => onCursorChange(new Date(year + 1, 0, 1)),
|
|
426
442
|
children: "\u25B6"
|
|
@@ -433,8 +449,9 @@ function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
|
|
|
433
449
|
const light = isSel ? "bg-slate-900 text-white border-slate-900" : "border-slate-200 hover:bg-slate-100";
|
|
434
450
|
const dark = isSel ? "dark:bg-white dark:text-slate-900 dark:border-white" : "dark:border-white/10 dark:hover:bg-white/10";
|
|
435
451
|
return /* @__PURE__ */ jsx(
|
|
436
|
-
|
|
452
|
+
Button,
|
|
437
453
|
{
|
|
454
|
+
unstyled: true,
|
|
438
455
|
className: `${base} ${light} ${dark}`,
|
|
439
456
|
onClick: () => onPick(new Date(year, idx, 1)),
|
|
440
457
|
children: m
|
package/dist/TimeRangeField.js
CHANGED
|
@@ -36,6 +36,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_react = require("react");
|
|
37
37
|
var import_react_dom = require("react-dom");
|
|
38
38
|
var import_Input = __toESM(require("./Input"));
|
|
39
|
+
var import_Button = __toESM(require("./Button"));
|
|
39
40
|
var import_TimePopover = __toESM(require("./TimePopover"));
|
|
40
41
|
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
41
42
|
function parseHHmm(v) {
|
|
@@ -149,8 +150,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
149
150
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-2 px-3 py-2 text-sm", children: [
|
|
150
151
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "font-medium", children: "Selecciona horario" }),
|
|
151
152
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
-
|
|
153
|
+
import_Button.default,
|
|
153
154
|
{
|
|
155
|
+
unstyled: true,
|
|
154
156
|
type: "button",
|
|
155
157
|
className: "rounded-xl bg-slate-900 px-3 py-1.5 text-white hover:opacity-95 active:scale-[0.98] dark:bg-white dark:text-slate-900",
|
|
156
158
|
onClick: () => setOpen(false),
|
|
@@ -162,8 +164,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
162
164
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
163
165
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-1 text-xs text-slate-500 dark:text-slate-300", children: "Desde" }),
|
|
164
166
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
165
|
-
|
|
167
|
+
import_Button.default,
|
|
166
168
|
{
|
|
169
|
+
unstyled: true,
|
|
167
170
|
type: "button",
|
|
168
171
|
className: "rounded-xl ring-1 ring-slate-200 px-2.5 py-1.5 font-medium tracking-wide hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
169
172
|
onClick: () => setShowFromPop((v) => !v),
|
|
@@ -172,8 +175,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
172
175
|
}
|
|
173
176
|
),
|
|
174
177
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
175
|
-
|
|
178
|
+
import_Button.default,
|
|
176
179
|
{
|
|
180
|
+
unstyled: true,
|
|
177
181
|
type: "button",
|
|
178
182
|
className: "ml-2 rounded-xl ring-1 ring-slate-200 px-2.5 py-1.5 hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
179
183
|
onClick: () => {
|
|
@@ -188,8 +192,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
188
192
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
189
193
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-1 text-xs text-slate-500 dark:text-slate-300", children: "Hasta" }),
|
|
190
194
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
191
|
-
|
|
195
|
+
import_Button.default,
|
|
192
196
|
{
|
|
197
|
+
unstyled: true,
|
|
193
198
|
type: "button",
|
|
194
199
|
className: "rounded-xl ring-1 ring-slate-200 px-2.5 py-1.5 font-medium tracking-wide hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
195
200
|
onClick: () => setShowToPop((v) => !v),
|
|
@@ -198,8 +203,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
198
203
|
}
|
|
199
204
|
),
|
|
200
205
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
201
|
-
|
|
206
|
+
import_Button.default,
|
|
202
207
|
{
|
|
208
|
+
unstyled: true,
|
|
203
209
|
type: "button",
|
|
204
210
|
className: "ml-2 rounded-xl ring-1 ring-slate-200 px-2.5 py-1.5 hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
205
211
|
onClick: () => {
|
|
@@ -229,8 +235,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
229
235
|
},
|
|
230
236
|
disabled,
|
|
231
237
|
rightSlot: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
232
|
-
|
|
238
|
+
import_Button.default,
|
|
233
239
|
{
|
|
240
|
+
unstyled: true,
|
|
234
241
|
type: "button",
|
|
235
242
|
className: "pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-white/5",
|
|
236
243
|
onClick: (e) => {
|
package/dist/TimeRangeField.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import Input from "./Input";
|
|
6
|
+
import Button from "./Button";
|
|
6
7
|
import TimePopover from "./TimePopover";
|
|
7
8
|
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
8
9
|
function parseHHmm(v) {
|
|
@@ -116,8 +117,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
116
117
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 px-3 py-2 text-sm", children: [
|
|
117
118
|
/* @__PURE__ */ jsx("div", { className: "font-medium", children: "Selecciona horario" }),
|
|
118
119
|
/* @__PURE__ */ jsx(
|
|
119
|
-
|
|
120
|
+
Button,
|
|
120
121
|
{
|
|
122
|
+
unstyled: true,
|
|
121
123
|
type: "button",
|
|
122
124
|
className: "rounded-xl bg-slate-900 px-3 py-1.5 text-white hover:opacity-95 active:scale-[0.98] dark:bg-white dark:text-slate-900",
|
|
123
125
|
onClick: () => setOpen(false),
|
|
@@ -129,8 +131,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
129
131
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
130
132
|
/* @__PURE__ */ jsx("div", { className: "mb-1 text-xs text-slate-500 dark:text-slate-300", children: "Desde" }),
|
|
131
133
|
/* @__PURE__ */ jsx(
|
|
132
|
-
|
|
134
|
+
Button,
|
|
133
135
|
{
|
|
136
|
+
unstyled: true,
|
|
134
137
|
type: "button",
|
|
135
138
|
className: "rounded-xl ring-1 ring-slate-200 px-2.5 py-1.5 font-medium tracking-wide hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
136
139
|
onClick: () => setShowFromPop((v) => !v),
|
|
@@ -139,8 +142,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
139
142
|
}
|
|
140
143
|
),
|
|
141
144
|
/* @__PURE__ */ jsx(
|
|
142
|
-
|
|
145
|
+
Button,
|
|
143
146
|
{
|
|
147
|
+
unstyled: true,
|
|
144
148
|
type: "button",
|
|
145
149
|
className: "ml-2 rounded-xl ring-1 ring-slate-200 px-2.5 py-1.5 hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
146
150
|
onClick: () => {
|
|
@@ -155,8 +159,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
155
159
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
156
160
|
/* @__PURE__ */ jsx("div", { className: "mb-1 text-xs text-slate-500 dark:text-slate-300", children: "Hasta" }),
|
|
157
161
|
/* @__PURE__ */ jsx(
|
|
158
|
-
|
|
162
|
+
Button,
|
|
159
163
|
{
|
|
164
|
+
unstyled: true,
|
|
160
165
|
type: "button",
|
|
161
166
|
className: "rounded-xl ring-1 ring-slate-200 px-2.5 py-1.5 font-medium tracking-wide hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
162
167
|
onClick: () => setShowToPop((v) => !v),
|
|
@@ -165,8 +170,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
165
170
|
}
|
|
166
171
|
),
|
|
167
172
|
/* @__PURE__ */ jsx(
|
|
168
|
-
|
|
173
|
+
Button,
|
|
169
174
|
{
|
|
175
|
+
unstyled: true,
|
|
170
176
|
type: "button",
|
|
171
177
|
className: "ml-2 rounded-xl ring-1 ring-slate-200 px-2.5 py-1.5 hover:bg-slate-50 active:scale-[0.98] dark:ring-white/10 dark:hover:bg-white/10",
|
|
172
178
|
onClick: () => {
|
|
@@ -196,8 +202,9 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
|
|
|
196
202
|
},
|
|
197
203
|
disabled,
|
|
198
204
|
rightSlot: /* @__PURE__ */ jsx(
|
|
199
|
-
|
|
205
|
+
Button,
|
|
200
206
|
{
|
|
207
|
+
unstyled: true,
|
|
201
208
|
type: "button",
|
|
202
209
|
className: "pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-white/5",
|
|
203
210
|
onClick: (e) => {
|
package/dist/Toast.d.mts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type ToastType = "default" | "success" | "error" | "warning" | "info";
|
|
5
|
+
type ToastPlacement = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
6
|
+
type ToastAction = {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
};
|
|
10
|
+
type ToastInput = {
|
|
11
|
+
id?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: React__default.ReactNode;
|
|
14
|
+
type?: ToastType;
|
|
15
|
+
duration?: number;
|
|
16
|
+
dismissible?: boolean;
|
|
17
|
+
icon?: React__default.ReactNode;
|
|
18
|
+
action?: ToastAction;
|
|
19
|
+
};
|
|
20
|
+
type ToastItem = {
|
|
21
|
+
id: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
description?: React__default.ReactNode;
|
|
24
|
+
type: ToastType;
|
|
25
|
+
duration: number;
|
|
26
|
+
dismissible: boolean;
|
|
27
|
+
icon?: React__default.ReactNode;
|
|
28
|
+
action?: ToastAction;
|
|
29
|
+
createdAt: number;
|
|
30
|
+
};
|
|
31
|
+
type ToastContextValue = {
|
|
32
|
+
add: (t: ToastInput) => string;
|
|
33
|
+
remove: (id: string) => void;
|
|
34
|
+
clear: () => void;
|
|
35
|
+
update: (id: string, patch: Partial<ToastInput>) => void;
|
|
36
|
+
success: (msg: string | ToastInput, opts?: Omit<ToastInput, "description" | "type">) => string;
|
|
37
|
+
error: (msg: string | ToastInput, opts?: Omit<ToastInput, "description" | "type">) => string;
|
|
38
|
+
warning: (msg: string | ToastInput, opts?: Omit<ToastInput, "description" | "type">) => string;
|
|
39
|
+
info: (msg: string | ToastInput, opts?: Omit<ToastInput, "description" | "type">) => string;
|
|
40
|
+
};
|
|
41
|
+
declare function useToast(): ToastContextValue;
|
|
42
|
+
type ProviderProps = {
|
|
43
|
+
placement?: ToastPlacement;
|
|
44
|
+
max?: number;
|
|
45
|
+
duration?: number;
|
|
46
|
+
children?: React__default.ReactNode;
|
|
47
|
+
};
|
|
48
|
+
declare function ToastProvider({ placement, max, duration, children }: ProviderProps): react_jsx_runtime.JSX.Element;
|
|
49
|
+
declare const _default: {
|
|
50
|
+
Provider: typeof ToastProvider;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { type ToastAction, type ToastInput, type ToastItem, type ToastPlacement, ToastProvider, type ToastType, _default as default, useToast };
|
package/dist/Toast.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type ToastType = "default" | "success" | "error" | "warning" | "info";
|
|
5
|
+
type ToastPlacement = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
6
|
+
type ToastAction = {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
};
|
|
10
|
+
type ToastInput = {
|
|
11
|
+
id?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: React__default.ReactNode;
|
|
14
|
+
type?: ToastType;
|
|
15
|
+
duration?: number;
|
|
16
|
+
dismissible?: boolean;
|
|
17
|
+
icon?: React__default.ReactNode;
|
|
18
|
+
action?: ToastAction;
|
|
19
|
+
};
|
|
20
|
+
type ToastItem = {
|
|
21
|
+
id: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
description?: React__default.ReactNode;
|
|
24
|
+
type: ToastType;
|
|
25
|
+
duration: number;
|
|
26
|
+
dismissible: boolean;
|
|
27
|
+
icon?: React__default.ReactNode;
|
|
28
|
+
action?: ToastAction;
|
|
29
|
+
createdAt: number;
|
|
30
|
+
};
|
|
31
|
+
type ToastContextValue = {
|
|
32
|
+
add: (t: ToastInput) => string;
|
|
33
|
+
remove: (id: string) => void;
|
|
34
|
+
clear: () => void;
|
|
35
|
+
update: (id: string, patch: Partial<ToastInput>) => void;
|
|
36
|
+
success: (msg: string | ToastInput, opts?: Omit<ToastInput, "description" | "type">) => string;
|
|
37
|
+
error: (msg: string | ToastInput, opts?: Omit<ToastInput, "description" | "type">) => string;
|
|
38
|
+
warning: (msg: string | ToastInput, opts?: Omit<ToastInput, "description" | "type">) => string;
|
|
39
|
+
info: (msg: string | ToastInput, opts?: Omit<ToastInput, "description" | "type">) => string;
|
|
40
|
+
};
|
|
41
|
+
declare function useToast(): ToastContextValue;
|
|
42
|
+
type ProviderProps = {
|
|
43
|
+
placement?: ToastPlacement;
|
|
44
|
+
max?: number;
|
|
45
|
+
duration?: number;
|
|
46
|
+
children?: React__default.ReactNode;
|
|
47
|
+
};
|
|
48
|
+
declare function ToastProvider({ placement, max, duration, children }: ProviderProps): react_jsx_runtime.JSX.Element;
|
|
49
|
+
declare const _default: {
|
|
50
|
+
Provider: typeof ToastProvider;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { type ToastAction, type ToastInput, type ToastItem, type ToastPlacement, ToastProvider, type ToastType, _default as default, useToast };
|