@wellingtonhlc/shared-ui 0.29.2 → 0.29.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DismissiblePopover.d.ts","sourceRoot":"","sources":["../../src/components/DismissiblePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DismissiblePopover.d.ts","sourceRoot":"","sources":["../../src/components/DismissiblePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,UAAiB,EACjB,iBAAuB,GACxB,EAAE,uBAAuB,+BA4FzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useEffect, useRef, useState, } from 'react';
|
|
3
3
|
import { cn } from '../utils/cn';
|
|
4
4
|
export function DismissiblePopover({ open, onOpenChange, trigger, content, className, contentClassName, containerRef, closeDelay = 1500, animationDuration = 180, }) {
|
|
5
5
|
const closeTimerRef = useRef(null);
|
|
@@ -17,7 +17,7 @@ export function DismissiblePopover({ open, onOpenChange, trigger, content, class
|
|
|
17
17
|
animationTimerRef.current = window.setTimeout(() => {
|
|
18
18
|
setContentVisible(false);
|
|
19
19
|
animationTimerRef.current = null;
|
|
20
|
-
}, animationDuration);
|
|
20
|
+
}, animationDuration + 50);
|
|
21
21
|
return () => {
|
|
22
22
|
if (animationTimerRef.current !== null) {
|
|
23
23
|
window.clearTimeout(animationTimerRef.current);
|
|
@@ -37,6 +37,12 @@ export function DismissiblePopover({ open, onOpenChange, trigger, content, class
|
|
|
37
37
|
closeTimerRef.current = null;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
function clearAnimationTimer() {
|
|
41
|
+
if (animationTimerRef.current !== null) {
|
|
42
|
+
window.clearTimeout(animationTimerRef.current);
|
|
43
|
+
animationTimerRef.current = null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
40
46
|
function handleMouseEnter() {
|
|
41
47
|
clearCloseTimer();
|
|
42
48
|
}
|
|
@@ -47,5 +53,11 @@ export function DismissiblePopover({ open, onOpenChange, trigger, content, class
|
|
|
47
53
|
closeTimerRef.current = null;
|
|
48
54
|
}, closeDelay);
|
|
49
55
|
}
|
|
50
|
-
|
|
56
|
+
function handleTransitionEnd(event) {
|
|
57
|
+
if (open || event.currentTarget !== event.target || event.propertyName !== 'opacity')
|
|
58
|
+
return;
|
|
59
|
+
clearAnimationTimer();
|
|
60
|
+
setContentVisible(false);
|
|
61
|
+
}
|
|
62
|
+
return (_jsxs("div", { ref: containerRef, className: cn('relative', className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onFocus: handleMouseEnter, children: [trigger, contentVisible ? (_jsx("div", { "data-state": open ? 'open' : 'closed', className: cn('transition-[opacity,transform,translate,scale] ease-out', open ? 'translate-x-0 opacity-100' : 'pointer-events-none translate-x-2 opacity-0', contentClassName), style: { transitionDuration: `${animationDuration}ms` }, onTransitionEnd: handleTransitionEnd, children: content })) : null] }));
|
|
51
63
|
}
|
package/dist/styles.css
CHANGED
|
@@ -596,6 +596,9 @@ h2.react-datepicker__current-month {
|
|
|
596
596
|
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
597
597
|
--color-red-600: oklch(57.7% 0.245 27.325);
|
|
598
598
|
--color-red-950: oklch(25.8% 0.092 26.042);
|
|
599
|
+
--color-amber-600: oklch(66.6% 0.179 58.318);
|
|
600
|
+
--color-green-600: oklch(62.7% 0.194 149.214);
|
|
601
|
+
--color-sky-600: oklch(58.8% 0.158 241.966);
|
|
599
602
|
--spacing: 0.25rem;
|
|
600
603
|
--container-xs: 20rem;
|
|
601
604
|
--container-sm: 24rem;
|
|
@@ -859,6 +862,9 @@ h2.react-datepicker__current-month {
|
|
|
859
862
|
.inset-y-0 {
|
|
860
863
|
inset-block: calc(var(--spacing) * 0);
|
|
861
864
|
}
|
|
865
|
+
.-top-1 {
|
|
866
|
+
top: calc(var(--spacing) * -1);
|
|
867
|
+
}
|
|
862
868
|
.top-0 {
|
|
863
869
|
top: calc(var(--spacing) * 0);
|
|
864
870
|
}
|
|
@@ -880,6 +886,9 @@ h2.react-datepicker__current-month {
|
|
|
880
886
|
.top-full {
|
|
881
887
|
top: 100%;
|
|
882
888
|
}
|
|
889
|
+
.-right-1 {
|
|
890
|
+
right: calc(var(--spacing) * -1);
|
|
891
|
+
}
|
|
883
892
|
.right-0 {
|
|
884
893
|
right: calc(var(--spacing) * 0);
|
|
885
894
|
}
|
|
@@ -931,6 +940,9 @@ h2.react-datepicker__current-month {
|
|
|
931
940
|
.left-full {
|
|
932
941
|
left: 100%;
|
|
933
942
|
}
|
|
943
|
+
.z-10 {
|
|
944
|
+
z-index: 10;
|
|
945
|
+
}
|
|
934
946
|
.z-\[var\(--z-critical-dialog\)\] {
|
|
935
947
|
z-index: var(--z-critical-dialog);
|
|
936
948
|
}
|
|
@@ -1097,6 +1109,10 @@ h2.react-datepicker__current-month {
|
|
|
1097
1109
|
width: calc(var(--spacing) * 10) !important;
|
|
1098
1110
|
height: calc(var(--spacing) * 10) !important;
|
|
1099
1111
|
}
|
|
1112
|
+
.size-2 {
|
|
1113
|
+
width: calc(var(--spacing) * 2);
|
|
1114
|
+
height: calc(var(--spacing) * 2);
|
|
1115
|
+
}
|
|
1100
1116
|
.size-3 {
|
|
1101
1117
|
width: calc(var(--spacing) * 3);
|
|
1102
1118
|
height: calc(var(--spacing) * 3);
|
|
@@ -1231,6 +1247,9 @@ h2.react-datepicker__current-month {
|
|
|
1231
1247
|
.h-\[32rem\] {
|
|
1232
1248
|
height: 32rem;
|
|
1233
1249
|
}
|
|
1250
|
+
.h-\[40rem\] {
|
|
1251
|
+
height: 40rem;
|
|
1252
|
+
}
|
|
1234
1253
|
.h-\[calc\(100\%-1rem\)\] {
|
|
1235
1254
|
height: calc(100% - 1rem);
|
|
1236
1255
|
}
|
|
@@ -1255,6 +1274,9 @@ h2.react-datepicker__current-month {
|
|
|
1255
1274
|
.max-h-\[95vh\] {
|
|
1256
1275
|
max-height: 95vh;
|
|
1257
1276
|
}
|
|
1277
|
+
.max-h-\[560px\] {
|
|
1278
|
+
max-height: 560px;
|
|
1279
|
+
}
|
|
1258
1280
|
.max-h-\[calc\(100vh-5rem\)\] {
|
|
1259
1281
|
max-height: calc(100vh - 5rem);
|
|
1260
1282
|
}
|
|
@@ -1420,6 +1442,9 @@ h2.react-datepicker__current-month {
|
|
|
1420
1442
|
.w-\[34rem\] {
|
|
1421
1443
|
width: 34rem;
|
|
1422
1444
|
}
|
|
1445
|
+
.w-\[38rem\] {
|
|
1446
|
+
width: 38rem;
|
|
1447
|
+
}
|
|
1423
1448
|
.w-\[42rem\] {
|
|
1424
1449
|
width: 42rem;
|
|
1425
1450
|
}
|
|
@@ -1438,6 +1463,9 @@ h2.react-datepicker__current-month {
|
|
|
1438
1463
|
.w-\[min\(10rem\,24vw\)\] {
|
|
1439
1464
|
width: min(10rem, 24vw);
|
|
1440
1465
|
}
|
|
1466
|
+
.w-\[min\(24rem\,calc\(100vw-2rem\)\)\] {
|
|
1467
|
+
width: min(24rem, calc(100vw - 2rem));
|
|
1468
|
+
}
|
|
1441
1469
|
.w-auto {
|
|
1442
1470
|
width: auto;
|
|
1443
1471
|
}
|
|
@@ -1587,6 +1615,9 @@ h2.react-datepicker__current-month {
|
|
|
1587
1615
|
--tw-border-spacing-y: calc(var(--spacing) * 0);
|
|
1588
1616
|
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
|
|
1589
1617
|
}
|
|
1618
|
+
.origin-top-right {
|
|
1619
|
+
transform-origin: top right;
|
|
1620
|
+
}
|
|
1590
1621
|
.-translate-x-1\/2 {
|
|
1591
1622
|
--tw-translate-x: calc(calc(1/2 * 100%) * -1);
|
|
1592
1623
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
@@ -1669,6 +1700,9 @@ h2.react-datepicker__current-month {
|
|
|
1669
1700
|
.grid-rows-\[0fr\] {
|
|
1670
1701
|
grid-template-rows: 0fr;
|
|
1671
1702
|
}
|
|
1703
|
+
.grid-rows-\[auto_1fr\] {
|
|
1704
|
+
grid-template-rows: auto 1fr;
|
|
1705
|
+
}
|
|
1672
1706
|
.grid-rows-\[auto_minmax\(0\,1fr\)\] {
|
|
1673
1707
|
grid-template-rows: auto minmax(0,1fr);
|
|
1674
1708
|
}
|
|
@@ -1951,6 +1985,12 @@ h2.react-datepicker__current-month {
|
|
|
1951
1985
|
.border-brand {
|
|
1952
1986
|
border-color: var(--color-brand);
|
|
1953
1987
|
}
|
|
1988
|
+
.border-brand\/40 {
|
|
1989
|
+
border-color: var(--color-brand);
|
|
1990
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1991
|
+
border-color: color-mix(in oklab, var(--color-brand) 40%, transparent);
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1954
1994
|
.border-brand\/50 {
|
|
1955
1995
|
border-color: var(--color-brand);
|
|
1956
1996
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -2104,6 +2144,12 @@ h2.react-datepicker__current-month {
|
|
|
2104
2144
|
.bg-brand {
|
|
2105
2145
|
background-color: var(--color-brand);
|
|
2106
2146
|
}
|
|
2147
|
+
.bg-brand\/5 {
|
|
2148
|
+
background-color: var(--color-brand);
|
|
2149
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2150
|
+
background-color: color-mix(in oklab, var(--color-brand) 5%, transparent);
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2107
2153
|
.bg-brand\/10 {
|
|
2108
2154
|
background-color: var(--color-brand);
|
|
2109
2155
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -2290,6 +2336,9 @@ h2.react-datepicker__current-month {
|
|
|
2290
2336
|
.pb-2 {
|
|
2291
2337
|
padding-bottom: calc(var(--spacing) * 2);
|
|
2292
2338
|
}
|
|
2339
|
+
.pb-3 {
|
|
2340
|
+
padding-bottom: calc(var(--spacing) * 3);
|
|
2341
|
+
}
|
|
2293
2342
|
.pb-4 {
|
|
2294
2343
|
padding-bottom: calc(var(--spacing) * 4);
|
|
2295
2344
|
}
|
|
@@ -2384,6 +2433,12 @@ h2.react-datepicker__current-month {
|
|
|
2384
2433
|
font-size: var(--text-xs);
|
|
2385
2434
|
line-height: var(--tw-leading, var(--text-xs--line-height));
|
|
2386
2435
|
}
|
|
2436
|
+
.text-\[10px\] {
|
|
2437
|
+
font-size: 10px;
|
|
2438
|
+
}
|
|
2439
|
+
.text-\[11px\] {
|
|
2440
|
+
font-size: 11px;
|
|
2441
|
+
}
|
|
2387
2442
|
.text-\[length\:var\(--font-size-2xs\)\] {
|
|
2388
2443
|
font-size: var(--font-size-2xs);
|
|
2389
2444
|
}
|
|
@@ -2550,6 +2605,9 @@ h2.react-datepicker__current-month {
|
|
|
2550
2605
|
.text-\[var\(--status-warning-text\)\] {
|
|
2551
2606
|
color: var(--status-warning-text);
|
|
2552
2607
|
}
|
|
2608
|
+
.text-amber-600 {
|
|
2609
|
+
color: var(--color-amber-600);
|
|
2610
|
+
}
|
|
2553
2611
|
.text-brand {
|
|
2554
2612
|
color: var(--color-brand);
|
|
2555
2613
|
}
|
|
@@ -2574,6 +2632,9 @@ h2.react-datepicker__current-month {
|
|
|
2574
2632
|
color: color-mix(in oklab, var(--color-foreground-muted) 90%, transparent);
|
|
2575
2633
|
}
|
|
2576
2634
|
}
|
|
2635
|
+
.text-green-600 {
|
|
2636
|
+
color: var(--color-green-600);
|
|
2637
|
+
}
|
|
2577
2638
|
.text-primary {
|
|
2578
2639
|
color: var(--color-primary);
|
|
2579
2640
|
}
|
|
@@ -2583,6 +2644,9 @@ h2.react-datepicker__current-month {
|
|
|
2583
2644
|
.text-red-600 {
|
|
2584
2645
|
color: var(--color-red-600);
|
|
2585
2646
|
}
|
|
2647
|
+
.text-sky-600 {
|
|
2648
|
+
color: var(--color-sky-600);
|
|
2649
|
+
}
|
|
2586
2650
|
.uppercase {
|
|
2587
2651
|
text-transform: uppercase;
|
|
2588
2652
|
}
|
|
@@ -2703,6 +2767,10 @@ h2.react-datepicker__current-month {
|
|
|
2703
2767
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
2704
2768
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2705
2769
|
}
|
|
2770
|
+
.shadow-xl {
|
|
2771
|
+
--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
2772
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2773
|
+
}
|
|
2706
2774
|
.outline {
|
|
2707
2775
|
outline-style: var(--tw-outline-style);
|
|
2708
2776
|
outline-width: 1px;
|
|
@@ -2789,13 +2857,13 @@ h2.react-datepicker__current-month {
|
|
|
2789
2857
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
2790
2858
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
2791
2859
|
}
|
|
2792
|
-
.transition-\[opacity\,transform\,
|
|
2793
|
-
transition-property: opacity,transform,
|
|
2860
|
+
.transition-\[opacity\,transform\,translate\,scale\] {
|
|
2861
|
+
transition-property: opacity,transform,translate,scale;
|
|
2794
2862
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
2795
2863
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
2796
2864
|
}
|
|
2797
|
-
.transition-\[opacity\,transform\] {
|
|
2798
|
-
transition-property: opacity,transform;
|
|
2865
|
+
.transition-\[opacity\,transform\,visibility\] {
|
|
2866
|
+
transition-property: opacity,transform,visibility;
|
|
2799
2867
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
2800
2868
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
2801
2869
|
}
|
|
@@ -3261,6 +3329,16 @@ h2.react-datepicker__current-month {
|
|
|
3261
3329
|
}
|
|
3262
3330
|
}
|
|
3263
3331
|
}
|
|
3332
|
+
.hover\:bg-brand\/10 {
|
|
3333
|
+
&:hover {
|
|
3334
|
+
@media (hover: hover) {
|
|
3335
|
+
background-color: var(--color-brand);
|
|
3336
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3337
|
+
background-color: color-mix(in oklab, var(--color-brand) 10%, transparent);
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3264
3342
|
.hover\:bg-destructive {
|
|
3265
3343
|
&:hover {
|
|
3266
3344
|
@media (hover: hover) {
|
|
@@ -3685,6 +3763,22 @@ h2.react-datepicker__current-month {
|
|
|
3685
3763
|
color: var(--color-foreground);
|
|
3686
3764
|
}
|
|
3687
3765
|
}
|
|
3766
|
+
.data-\[state\=closed\]\:scale-95 {
|
|
3767
|
+
&[data-state="closed"] {
|
|
3768
|
+
--tw-scale-x: 95%;
|
|
3769
|
+
--tw-scale-y: 95%;
|
|
3770
|
+
--tw-scale-z: 95%;
|
|
3771
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
3772
|
+
}
|
|
3773
|
+
}
|
|
3774
|
+
.data-\[state\=open\]\:scale-100 {
|
|
3775
|
+
&[data-state="open"] {
|
|
3776
|
+
--tw-scale-x: 100%;
|
|
3777
|
+
--tw-scale-y: 100%;
|
|
3778
|
+
--tw-scale-z: 100%;
|
|
3779
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3688
3782
|
.data-\[state\=open\]\:bg-\[var\(--status-danger-bg\)\] {
|
|
3689
3783
|
&[data-state="open"] {
|
|
3690
3784
|
background-color: var(--status-danger-bg);
|
|
@@ -5101,6 +5195,21 @@ h2.react-datepicker__current-month {
|
|
|
5101
5195
|
initial-value: "";
|
|
5102
5196
|
inherits: false;
|
|
5103
5197
|
}
|
|
5198
|
+
@property --tw-scale-x {
|
|
5199
|
+
syntax: "*";
|
|
5200
|
+
inherits: false;
|
|
5201
|
+
initial-value: 1;
|
|
5202
|
+
}
|
|
5203
|
+
@property --tw-scale-y {
|
|
5204
|
+
syntax: "*";
|
|
5205
|
+
inherits: false;
|
|
5206
|
+
initial-value: 1;
|
|
5207
|
+
}
|
|
5208
|
+
@property --tw-scale-z {
|
|
5209
|
+
syntax: "*";
|
|
5210
|
+
inherits: false;
|
|
5211
|
+
initial-value: 1;
|
|
5212
|
+
}
|
|
5104
5213
|
@keyframes spin {
|
|
5105
5214
|
to {
|
|
5106
5215
|
transform: rotate(360deg);
|
|
@@ -5170,6 +5279,9 @@ h2.react-datepicker__current-month {
|
|
|
5170
5279
|
--tw-duration: initial;
|
|
5171
5280
|
--tw-ease: initial;
|
|
5172
5281
|
--tw-content: "";
|
|
5282
|
+
--tw-scale-x: 1;
|
|
5283
|
+
--tw-scale-y: 1;
|
|
5284
|
+
--tw-scale-z: 1;
|
|
5173
5285
|
}
|
|
5174
5286
|
}
|
|
5175
5287
|
}
|