@syscore/ui-library 2.0.0-beta-publish-workflow-beta.8 → 2.0.0-beta-publish-workflow-beta.9
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/client/components/ui/hero-split-image.tsx +38 -5
- package/client/global.css +48 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +36 -1
- package/package.json +1 -1
|
@@ -1,15 +1,48 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { cn } from '@/lib/utils';
|
|
2
3
|
|
|
3
4
|
export interface HeroSplitImageProps {
|
|
4
5
|
src: string;
|
|
5
6
|
alt?: string;
|
|
6
7
|
}
|
|
7
8
|
|
|
9
|
+
|
|
8
10
|
export const HeroSplitImage = React.forwardRef<HTMLImageElement, HeroSplitImageProps>(
|
|
9
|
-
({ src, alt = '' }, ref) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
({ src, alt = '' }, ref) => {
|
|
12
|
+
const [current, setCurrent] = React.useState(src);
|
|
13
|
+
const [previous, setPrevious] = React.useState<string | null>(null);
|
|
14
|
+
const [isCurrentLoaded, setIsCurrentLoaded] = React.useState(false);
|
|
15
|
+
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (src === current) return;
|
|
18
|
+
setPrevious(current);
|
|
19
|
+
setCurrent(src);
|
|
20
|
+
setIsCurrentLoaded(false);
|
|
21
|
+
}, [src, current]);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<span className="hero-split-image-frame">
|
|
25
|
+
{previous ? (
|
|
26
|
+
<img
|
|
27
|
+
src={previous}
|
|
28
|
+
alt=""
|
|
29
|
+
aria-hidden="true"
|
|
30
|
+
className={cn('hero-split-image', !isCurrentLoaded && 'hero-split-image--loaded')}
|
|
31
|
+
onTransitionEnd={(event) => {
|
|
32
|
+
if (event.propertyName === 'opacity' && isCurrentLoaded) setPrevious(null);
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
) : null}
|
|
36
|
+
<img
|
|
37
|
+
ref={ref}
|
|
38
|
+
key={current}
|
|
39
|
+
src={current}
|
|
40
|
+
alt={alt}
|
|
41
|
+
className={cn('hero-split-image', isCurrentLoaded && 'hero-split-image--loaded')}
|
|
42
|
+
onLoad={() => setIsCurrentLoaded(true)}
|
|
43
|
+
/>
|
|
44
|
+
</span>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
14
47
|
);
|
|
15
48
|
HeroSplitImage.displayName = 'HeroSplitImage';
|
package/client/global.css
CHANGED
|
@@ -8554,16 +8554,20 @@ body {
|
|
|
8554
8554
|
background-color: hsl(var(--accent) / 0.5);
|
|
8555
8555
|
}
|
|
8556
8556
|
|
|
8557
|
-
|
|
8557
|
+
|
|
8558
|
+
.calendar-cell:has(.calendar-day-range-middle[aria-selected]),
|
|
8559
|
+
.calendar-cell:has(.calendar-day-range-end[aria-selected]) {
|
|
8558
8560
|
background-color: hsl(var(--accent));
|
|
8559
8561
|
}
|
|
8560
8562
|
|
|
8561
|
-
.calendar-cell:has([aria-selected]):first-child
|
|
8563
|
+
.calendar-cell:has(.calendar-day-range-middle[aria-selected]):first-child,
|
|
8564
|
+
.calendar-cell:has(.calendar-day-range-end[aria-selected]):first-child {
|
|
8562
8565
|
border-top-left-radius: calc(var(--radius-md, 8px));
|
|
8563
8566
|
border-bottom-left-radius: calc(var(--radius-md, 8px));
|
|
8564
8567
|
}
|
|
8565
8568
|
|
|
8566
|
-
.calendar-cell:has([aria-selected]):last-child
|
|
8569
|
+
.calendar-cell:has(.calendar-day-range-middle[aria-selected]):last-child,
|
|
8570
|
+
.calendar-cell:has(.calendar-day-range-end[aria-selected]):last-child {
|
|
8567
8571
|
border-top-right-radius: calc(var(--radius-md, 8px));
|
|
8568
8572
|
border-bottom-right-radius: calc(var(--radius-md, 8px));
|
|
8569
8573
|
}
|
|
@@ -8599,6 +8603,19 @@ body {
|
|
|
8599
8603
|
color: hsl(var(--primary-foreground));
|
|
8600
8604
|
}
|
|
8601
8605
|
|
|
8606
|
+
/* `<Calendar initialFocus>` (DatePicker/DateRangePicker) programmatically
|
|
8607
|
+
focuses the already-selected day the instant the popover opens — with no
|
|
8608
|
+
preceding pointer interaction, Chrome's :focus-visible heuristic treats
|
|
8609
|
+
that as a real focus event, so the base `.button:focus-visible` ring
|
|
8610
|
+
(box-shadow 2px currentColor + 4px white) stacks on top of this circle's
|
|
8611
|
+
own solid fill. That's the halo around the selected date on open, not an
|
|
8612
|
+
actual keyboard-navigation indicator — the fill already shows selection,
|
|
8613
|
+
so the redundant ring is suppressed here only. A real keyboard Tab/arrow
|
|
8614
|
+
move to a *different*, unselected day still gets the normal ring. */
|
|
8615
|
+
.calendar-day-selected:focus-visible {
|
|
8616
|
+
box-shadow: none;
|
|
8617
|
+
}
|
|
8618
|
+
|
|
8602
8619
|
.calendar-day-today {
|
|
8603
8620
|
background-color: hsl(var(--accent));
|
|
8604
8621
|
color: hsl(var(--accent-foreground));
|
|
@@ -15910,6 +15927,11 @@ body {
|
|
|
15910
15927
|
/* /DS_PENDING_CSS:ResourceThumbnail */
|
|
15911
15928
|
|
|
15912
15929
|
/* DS_PENDING_CSS:HeroSplitImage */
|
|
15930
|
+
@keyframes hero-split-image-shimmer {
|
|
15931
|
+
0% { background-position: 150% 0; }
|
|
15932
|
+
100% { background-position: -50% 0; }
|
|
15933
|
+
}
|
|
15934
|
+
|
|
15913
15935
|
.hero-split-image-frame {
|
|
15914
15936
|
display: block;
|
|
15915
15937
|
position: relative;
|
|
@@ -15918,6 +15940,20 @@ body {
|
|
|
15918
15940
|
margin: 0 -3.5rem 0 0;
|
|
15919
15941
|
border-radius: 0 var(--radius-lg, 12px) var(--radius-lg, 12px) 0;
|
|
15920
15942
|
overflow: hidden;
|
|
15943
|
+
background-color: var(--color-gray-100, #eff1f2);
|
|
15944
|
+
background-image: linear-gradient(
|
|
15945
|
+
100deg,
|
|
15946
|
+
transparent 35%,
|
|
15947
|
+
var(--color-gray-200, #d5d9dc) 50%,
|
|
15948
|
+
transparent 65%
|
|
15949
|
+
);
|
|
15950
|
+
background-size: 200% 100%;
|
|
15951
|
+
animation: hero-split-image-shimmer 1.6s ease-in-out infinite;
|
|
15952
|
+
}
|
|
15953
|
+
|
|
15954
|
+
.hero-split-image-frame:has(.hero-split-image--loaded) {
|
|
15955
|
+
animation: none;
|
|
15956
|
+
background-image: none;
|
|
15921
15957
|
}
|
|
15922
15958
|
|
|
15923
15959
|
.hero-split-image {
|
|
@@ -15927,6 +15963,15 @@ body {
|
|
|
15927
15963
|
width: 100%;
|
|
15928
15964
|
height: 100%;
|
|
15929
15965
|
object-fit: cover;
|
|
15966
|
+
opacity: 0;
|
|
15967
|
+
transform: scale(1.03);
|
|
15968
|
+
transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
|
|
15969
|
+
transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
|
|
15970
|
+
}
|
|
15971
|
+
|
|
15972
|
+
.hero-split-image--loaded {
|
|
15973
|
+
opacity: 1;
|
|
15974
|
+
transform: scale(1);
|
|
15930
15975
|
}
|
|
15931
15976
|
/* /DS_PENDING_CSS:HeroSplitImage */
|
|
15932
15977
|
|