@jinaan/uikit 0.1.31 → 0.1.34
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/dialog.d.ts +5 -0
- package/dist/dialog.d.ts.map +1 -1
- package/dist/index.js +255 -253
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/data-table.tsx +1 -1
- package/src/dialog.tsx +9 -2
- package/styles.css +69 -0
package/package.json
CHANGED
package/src/data-table.tsx
CHANGED
|
@@ -778,7 +778,7 @@ export function DataTable<T>({
|
|
|
778
778
|
</span>
|
|
779
779
|
<div className="flex items-center gap-2">
|
|
780
780
|
<Select value={String(pageSize)} onValueChange={(v) => setPageSize(Number(v))}>
|
|
781
|
-
<SelectTrigger aria-label="Rows per page" className="w-27.5">
|
|
781
|
+
<SelectTrigger aria-label="Rows per page" className="w-27.5" variant="inline">
|
|
782
782
|
<SelectValue />
|
|
783
783
|
</SelectTrigger>
|
|
784
784
|
<SelectContent>
|
package/src/dialog.tsx
CHANGED
|
@@ -263,6 +263,11 @@ export interface DialogContentProps
|
|
|
263
263
|
placement?: "center" | "top";
|
|
264
264
|
/** Top edge offset for top placement. Defaults to 11dvh. */
|
|
265
265
|
topOffset?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Entry/exit motion. `auto` flies from the caller when one is known, while
|
|
268
|
+
* `command` uses the compact spring used by command palettes.
|
|
269
|
+
*/
|
|
270
|
+
motion?: "auto" | "command";
|
|
266
271
|
}
|
|
267
272
|
|
|
268
273
|
function dialogTopFallback(offset: string): string {
|
|
@@ -279,6 +284,7 @@ export const DialogContent = forwardRef<
|
|
|
279
284
|
children,
|
|
280
285
|
placement = "center",
|
|
281
286
|
topOffset = "11dvh",
|
|
287
|
+
motion = "auto",
|
|
282
288
|
style,
|
|
283
289
|
onEscapeKeyDown,
|
|
284
290
|
onPointerDownOutside,
|
|
@@ -299,7 +305,7 @@ export const DialogContent = forwardRef<
|
|
|
299
305
|
const setRef = useCallback(
|
|
300
306
|
(node: HTMLDivElement | null) => {
|
|
301
307
|
contentRef.current = node;
|
|
302
|
-
if (node) startDialogMotion(node);
|
|
308
|
+
if (node && motion === "auto") startDialogMotion(node);
|
|
303
309
|
if (typeof ref === "function") {
|
|
304
310
|
ref(node);
|
|
305
311
|
return;
|
|
@@ -308,7 +314,7 @@ export const DialogContent = forwardRef<
|
|
|
308
314
|
(ref as { current: HTMLDivElement | null }).current = node;
|
|
309
315
|
}
|
|
310
316
|
},
|
|
311
|
-
[ref],
|
|
317
|
+
[motion, ref],
|
|
312
318
|
);
|
|
313
319
|
|
|
314
320
|
return (
|
|
@@ -339,6 +345,7 @@ export const DialogContent = forwardRef<
|
|
|
339
345
|
"dialog-content pointer-events-auto relative flex max-h-[min(85vh,44rem)] w-full max-w-[22.4rem] flex-col gap-0 overflow-hidden will-change-[transform,opacity]",
|
|
340
346
|
"rounded-2xl border border-(--dialog-shell-border) bg-(--dialog-shell-bg) pb-3 shadow-(--dialog-shell-shadow) sm:pb-4",
|
|
341
347
|
top && "dialog-anchor-top",
|
|
348
|
+
motion === "command" && "dialog-command-motion",
|
|
342
349
|
closing && "dialog-closing",
|
|
343
350
|
"focus:outline-none",
|
|
344
351
|
className,
|
package/styles.css
CHANGED
|
@@ -480,6 +480,75 @@
|
|
|
480
480
|
will-change: transform, opacity;
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
+
/*
|
|
484
|
+
* Command-palette motion: the panel springs from a smaller, slightly
|
|
485
|
+
* up-and-left pose. Kept separate from the caller-flight so command dialogs
|
|
486
|
+
* do not visibly travel from the trigger.
|
|
487
|
+
*/
|
|
488
|
+
@keyframes dialog-command-in {
|
|
489
|
+
from {
|
|
490
|
+
opacity: 1;
|
|
491
|
+
transform: translate(-27.4%, -6.3%) scale(0.85);
|
|
492
|
+
}
|
|
493
|
+
to {
|
|
494
|
+
opacity: 1;
|
|
495
|
+
transform: translate(0, 0) scale(1);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
@keyframes dialog-command-out {
|
|
500
|
+
from {
|
|
501
|
+
opacity: 1;
|
|
502
|
+
transform: translate(0, 0) scale(1);
|
|
503
|
+
}
|
|
504
|
+
to {
|
|
505
|
+
opacity: 1;
|
|
506
|
+
transform: translate(-26.6%, -11.1%) scale(0.85);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.dialog-command-motion {
|
|
511
|
+
transform-origin: center;
|
|
512
|
+
animation: dialog-command-in 500ms
|
|
513
|
+
linear(
|
|
514
|
+
0 0%,
|
|
515
|
+
0.1495 6.25%,
|
|
516
|
+
0.3955 12.5%,
|
|
517
|
+
0.6061 18.75%,
|
|
518
|
+
0.7562 25%,
|
|
519
|
+
0.8542 31.25%,
|
|
520
|
+
0.9148 37.5%,
|
|
521
|
+
0.9512 43.75%,
|
|
522
|
+
0.9724 50%,
|
|
523
|
+
0.9846 56.25%,
|
|
524
|
+
0.9914 62.5%,
|
|
525
|
+
0.9953 68.75%,
|
|
526
|
+
0.9974 75%,
|
|
527
|
+
0.9986 81.25%,
|
|
528
|
+
0.9992 87.5%,
|
|
529
|
+
1 93.75%,
|
|
530
|
+
1 100%
|
|
531
|
+
)
|
|
532
|
+
both;
|
|
533
|
+
backface-visibility: hidden;
|
|
534
|
+
will-change: transform;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.dialog-command-motion.dialog-closing {
|
|
538
|
+
animation: dialog-command-out 250ms
|
|
539
|
+
linear(
|
|
540
|
+
0 0%,
|
|
541
|
+
0.4615 14.2857%,
|
|
542
|
+
0.8176 28.5714%,
|
|
543
|
+
0.9471 42.8571%,
|
|
544
|
+
0.9858 57.1429%,
|
|
545
|
+
0.9964 71.4286%,
|
|
546
|
+
0.9991 85.7143%,
|
|
547
|
+
1 100%
|
|
548
|
+
)
|
|
549
|
+
both;
|
|
550
|
+
}
|
|
551
|
+
|
|
483
552
|
.dialog-noise {
|
|
484
553
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
|
|
485
554
|
background-size: 160px 160px;
|