@dmsi/wedgekit-react 0.0.441 → 0.0.443
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/{chunk-M6TSTDNZ.js → chunk-7HCS6TZN.js} +1 -1
- package/dist/{chunk-IMOIZFJZ.js → chunk-DNYGKNQM.js} +1 -1
- package/dist/chunk-ETAEB3TA.js +19 -0
- package/dist/{chunk-MDH7XDJS.js → chunk-EYESSAXQ.js} +2 -2
- package/dist/{chunk-7AXHAWJX.js → chunk-FFGIFICI.js} +1 -1
- package/dist/{chunk-P3MIP2FD.js → chunk-NAY4I3FL.js} +2 -2
- package/dist/{chunk-W55J2KJZ.js → chunk-RDJT63IS.js} +2 -2
- package/dist/{chunk-LUPHOXAQ.js → chunk-TJV3S52X.js} +1 -1
- package/dist/{chunk-G5DEC7H3.js → chunk-YCDDBSVU.js} +16 -23
- package/dist/components/CalendarRange.cjs +38 -40
- package/dist/components/CalendarRange.css +23 -14
- package/dist/components/CalendarRange.js +9 -9
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +38 -40
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +23 -14
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +9 -9
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +38 -40
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +23 -14
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +9 -9
- package/dist/components/DataGrid/PinnedColumns.cjs +38 -40
- package/dist/components/DataGrid/PinnedColumns.css +23 -14
- package/dist/components/DataGrid/PinnedColumns.js +9 -9
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +38 -40
- package/dist/components/DataGrid/TableBody/LoadingCell.css +23 -14
- package/dist/components/DataGrid/TableBody/LoadingCell.js +9 -9
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +38 -40
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +23 -14
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +9 -9
- package/dist/components/DataGrid/TableBody/index.cjs +38 -40
- package/dist/components/DataGrid/TableBody/index.css +23 -14
- package/dist/components/DataGrid/TableBody/index.js +9 -9
- package/dist/components/DataGrid/index.cjs +38 -40
- package/dist/components/DataGrid/index.css +23 -14
- package/dist/components/DataGrid/index.js +9 -9
- package/dist/components/DataGrid/utils.cjs +38 -40
- package/dist/components/DataGrid/utils.css +23 -14
- package/dist/components/DataGrid/utils.js +9 -9
- package/dist/components/DateInput.cjs +38 -40
- package/dist/components/DateInput.css +23 -14
- package/dist/components/DateInput.js +9 -9
- package/dist/components/DateRangeInput.cjs +38 -40
- package/dist/components/DateRangeInput.css +23 -14
- package/dist/components/DateRangeInput.js +9 -9
- package/dist/components/MobileDataGrid/ColumnList.cjs +2 -2
- package/dist/components/MobileDataGrid/ColumnList.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +38 -40
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +23 -14
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +9 -9
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.cjs +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +38 -40
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +23 -14
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +9 -9
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +2 -2
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +2 -2
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +3 -3
- package/dist/components/MobileDataGrid/index.cjs +64 -66
- package/dist/components/MobileDataGrid/index.css +23 -14
- package/dist/components/MobileDataGrid/index.js +9 -9
- package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +29 -83
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +1 -3
- package/dist/components/ProductImagePreview/index.cjs +44 -77
- package/dist/components/ProductImagePreview/index.js +2 -3
- package/dist/components/SkeletonParagraph.cjs +12 -2
- package/dist/components/SkeletonParagraph.js +1 -1
- package/dist/components/index.cjs +108 -101
- package/dist/components/index.css +23 -14
- package/dist/components/index.js +9 -9
- package/dist/index.css +23 -14
- package/package.json +1 -1
- package/src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx +1 -1
- package/src/components/MobileDataGrid/MobileDataGridCard/index.tsx +1 -1
- package/src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx +1 -1
- package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +24 -34
- package/src/components/SkeletonParagraph.tsx +20 -2
- package/src/index.css +27 -0
- package/dist/chunk-ESCNCQGI.js +0 -9
package/dist/index.css
CHANGED
|
@@ -647,9 +647,6 @@
|
|
|
647
647
|
.mr-auto {
|
|
648
648
|
margin-right: auto;
|
|
649
649
|
}
|
|
650
|
-
.mb-2 {
|
|
651
|
-
margin-bottom: calc(var(--spacing) * 2);
|
|
652
|
-
}
|
|
653
650
|
.mb-3 {
|
|
654
651
|
margin-bottom: calc(var(--spacing) * 3);
|
|
655
652
|
}
|
|
@@ -756,9 +753,6 @@
|
|
|
756
753
|
.h-60 {
|
|
757
754
|
height: calc(var(--spacing) * 60);
|
|
758
755
|
}
|
|
759
|
-
.h-\[24px\] {
|
|
760
|
-
height: 24px;
|
|
761
|
-
}
|
|
762
756
|
.h-\[166px\] {
|
|
763
757
|
height: 166px;
|
|
764
758
|
}
|
|
@@ -1848,10 +1842,6 @@
|
|
|
1848
1842
|
--tw-gradient-position: to right in oklab;
|
|
1849
1843
|
background-image: linear-gradient(var(--tw-gradient-stops));
|
|
1850
1844
|
}
|
|
1851
|
-
.from-neutral-100 {
|
|
1852
|
-
--tw-gradient-from: var(--color-neutral-100);
|
|
1853
|
-
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
1854
|
-
}
|
|
1855
1845
|
.from-neutral-300\/\[12\%\] {
|
|
1856
1846
|
--tw-gradient-from: color-mix(in srgb, #c1c1c1 12%, transparent);
|
|
1857
1847
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -1863,10 +1853,6 @@
|
|
|
1863
1853
|
--tw-gradient-from: var(--color-white);
|
|
1864
1854
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
1865
1855
|
}
|
|
1866
|
-
.to-\[\#f7f7f7\] {
|
|
1867
|
-
--tw-gradient-to: #f7f7f7;
|
|
1868
|
-
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
1869
|
-
}
|
|
1870
1856
|
.to-neutral-300\/\[24\%\] {
|
|
1871
1857
|
--tw-gradient-to: color-mix(in srgb, #c1c1c1 24%, transparent);
|
|
1872
1858
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -4652,6 +4638,29 @@
|
|
|
4652
4638
|
--color-background-action-critical-secondary-disabled: var( --color-neutral-200 );
|
|
4653
4639
|
--color-background-brand-normal: var( --color-brand-400 );
|
|
4654
4640
|
}
|
|
4641
|
+
.skeleton-paragraph {
|
|
4642
|
+
position: relative;
|
|
4643
|
+
overflow: hidden;
|
|
4644
|
+
background-color: #f7f7f7;
|
|
4645
|
+
}
|
|
4646
|
+
.skeleton-paragraph::after {
|
|
4647
|
+
content: "";
|
|
4648
|
+
position: absolute;
|
|
4649
|
+
inset: 0;
|
|
4650
|
+
transform: translateX(-100%);
|
|
4651
|
+
background-image:
|
|
4652
|
+
linear-gradient(
|
|
4653
|
+
90deg,
|
|
4654
|
+
rgba(255, 255, 255, 0) 0%,
|
|
4655
|
+
rgba(255, 255, 255, 0.6) 50%,
|
|
4656
|
+
rgba(255, 255, 255, 0) 100%);
|
|
4657
|
+
animation: skeleton-shimmer 1.4s ease-in-out infinite;
|
|
4658
|
+
}
|
|
4659
|
+
@keyframes skeleton-shimmer {
|
|
4660
|
+
100% {
|
|
4661
|
+
transform: translateX(100%);
|
|
4662
|
+
}
|
|
4663
|
+
}
|
|
4655
4664
|
@media (prefers-color-scheme: dark) {
|
|
4656
4665
|
:root {
|
|
4657
4666
|
--color-text-primary-normal: var(--color-neutral-000);
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ export function MobileDataGridColumn<T extends Record<string, unknown>>(props: {
|
|
|
8
8
|
const { column, data } = props;
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
|
-
<div className="
|
|
11
|
+
<div className="grid grid-cols-2 gap-2 px-3 flex-1">
|
|
12
12
|
<Paragraph color="text-secondary-normal" className="text-left">
|
|
13
13
|
{column.header?.toString()}:
|
|
14
14
|
</Paragraph>{" "}
|
|
@@ -95,7 +95,7 @@ export function MobileDataGridCard<T extends Record<string, unknown>>({
|
|
|
95
95
|
column.id ? (
|
|
96
96
|
<div
|
|
97
97
|
key={`${column.id}-${index}`}
|
|
98
|
-
className="
|
|
98
|
+
className="grid grid-cols-2 gap-2 px-3 items-center flex-1"
|
|
99
99
|
>
|
|
100
100
|
<Paragraph
|
|
101
101
|
color="text-secondary-normal"
|
|
@@ -18,7 +18,7 @@ export function ModalContent() {
|
|
|
18
18
|
column.id ? (
|
|
19
19
|
<div
|
|
20
20
|
key={`${column.id}-${index}`}
|
|
21
|
-
className="
|
|
21
|
+
className="grid grid-cols-2 gap-2 px-3 items-center flex-1"
|
|
22
22
|
>
|
|
23
23
|
<Paragraph color="text-secondary-normal" className="text-left">
|
|
24
24
|
{column.header?.toString()}:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useRef, useState, useCallback, useMemo, useEffect } from "react";
|
|
2
2
|
import type { CSSProperties } from "react";
|
|
3
|
-
import { Spinner } from "../Spinner";
|
|
4
3
|
import type { ProductPreviewImage } from "./index";
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
const placeholderImageUri = "/placeholder.svg";
|
|
6
6
|
|
|
7
7
|
export type ProductPrimaryImageProps = {
|
|
8
8
|
image?: ProductPreviewImage;
|
|
@@ -44,8 +44,6 @@ export function ProductPrimaryImage({
|
|
|
44
44
|
const rafRef = useRef<number | null>(null);
|
|
45
45
|
const [active, setActive] = useState(false);
|
|
46
46
|
const [, forceRerender] = useState(0);
|
|
47
|
-
const [imageLoading, setImageLoading] = useState(true);
|
|
48
|
-
const [imageError, setImageError] = useState(false);
|
|
49
47
|
|
|
50
48
|
// Memoize image src to prevent unnecessary re-requests
|
|
51
49
|
const imageSrc = useMemo(() => image?.src, [image?.src]);
|
|
@@ -83,7 +81,8 @@ export function ProductPrimaryImage({
|
|
|
83
81
|
React.PointerEventHandler<HTMLDivElement>
|
|
84
82
|
>(
|
|
85
83
|
(e) => {
|
|
86
|
-
if (
|
|
84
|
+
if (isPlaceholder) return;
|
|
85
|
+
if (!zoomEnabled || !active) return;
|
|
87
86
|
|
|
88
87
|
// Ignore touch events to prevent zoom on mobile
|
|
89
88
|
if (e.pointerType === "touch") return;
|
|
@@ -123,7 +122,7 @@ export function ProductPrimaryImage({
|
|
|
123
122
|
true,
|
|
124
123
|
);
|
|
125
124
|
},
|
|
126
|
-
[zoomEnabled, active,
|
|
125
|
+
[isPlaceholder, zoomEnabled, active, zoomLensSize, onZoomPositionChange],
|
|
127
126
|
);
|
|
128
127
|
|
|
129
128
|
// Set up non-passive wheel event listener to properly prevent default
|
|
@@ -149,12 +148,16 @@ export function ProductPrimaryImage({
|
|
|
149
148
|
};
|
|
150
149
|
}, [scrollToZoomEnabled, zoomEnabled, active, onScrollZoom]);
|
|
151
150
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
const handleImgError = useCallback(
|
|
152
|
+
(e: React.SyntheticEvent<HTMLImageElement>) => {
|
|
153
|
+
if (!placeholderImageUri) return;
|
|
154
|
+
const img = e.currentTarget;
|
|
155
|
+
// Prevent infinite loop if placeholder also 404s
|
|
156
|
+
if (img.src === placeholderImageUri) return;
|
|
157
|
+
img.src = placeholderImageUri;
|
|
158
|
+
},
|
|
159
|
+
[],
|
|
160
|
+
);
|
|
158
161
|
|
|
159
162
|
const pt = lastPointRef.current;
|
|
160
163
|
let lensStyle: CSSProperties | undefined;
|
|
@@ -190,28 +193,15 @@ export function ProductPrimaryImage({
|
|
|
190
193
|
onPointerLeave={handlePointerLeave}
|
|
191
194
|
onPointerMove={handlePointerMove}
|
|
192
195
|
>
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
key={imageSrc}
|
|
203
|
-
src={imageError ? "/placeholder.svg" : imageSrc}
|
|
204
|
-
alt={image?.alt || "Product image"}
|
|
205
|
-
className="object-cover min-w-full min-h-full select-none"
|
|
206
|
-
draggable={false}
|
|
207
|
-
loading="lazy"
|
|
208
|
-
onLoad={() => setImageLoading(false)}
|
|
209
|
-
onError={() => {
|
|
210
|
-
setImageLoading(false);
|
|
211
|
-
setImageError(true);
|
|
212
|
-
}}
|
|
213
|
-
/>
|
|
214
|
-
)}
|
|
196
|
+
<img
|
|
197
|
+
key={imageSrc}
|
|
198
|
+
src={imageSrc ?? placeholderImageUri}
|
|
199
|
+
alt={image?.alt || "Product image"}
|
|
200
|
+
className="object-cover min-w-full min-h-full select-none"
|
|
201
|
+
draggable={false}
|
|
202
|
+
loading="lazy"
|
|
203
|
+
onError={handleImgError}
|
|
204
|
+
/>
|
|
215
205
|
{zoomEnabled && active && lensStyle && (
|
|
216
206
|
<div
|
|
217
207
|
aria-hidden
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
interface SkeletonParagraphProps {
|
|
2
|
+
/** Optional custom class names to further style/size the skeleton */
|
|
3
|
+
className?: string;
|
|
4
|
+
/** Height of the skeleton (tailwind height utility), defaults to h-6 */
|
|
5
|
+
heightClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A shimmering paragraph skeleton placeholder.
|
|
10
|
+
* Provides an animated left-to-right shimmer to indicate loading text content.
|
|
11
|
+
*/
|
|
12
|
+
export function SkeletonParagraph({
|
|
13
|
+
className = "",
|
|
14
|
+
heightClassName = "h-6",
|
|
15
|
+
}: SkeletonParagraphProps) {
|
|
2
16
|
return (
|
|
3
|
-
<div
|
|
17
|
+
<div
|
|
18
|
+
aria-label="Loading content"
|
|
19
|
+
role="status"
|
|
20
|
+
className={`skeleton-paragraph ${heightClassName} w-full min-w-32 rounded-xs ${className}`}
|
|
21
|
+
/>
|
|
4
22
|
);
|
|
5
23
|
}
|
package/src/index.css
CHANGED
|
@@ -634,6 +634,33 @@
|
|
|
634
634
|
); /* Created for Main Navigation */
|
|
635
635
|
}
|
|
636
636
|
|
|
637
|
+
/* Skeleton / Shimmer */
|
|
638
|
+
.skeleton-paragraph {
|
|
639
|
+
position: relative;
|
|
640
|
+
overflow: hidden;
|
|
641
|
+
background-color: theme("colors.neutral.100");
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
.skeleton-paragraph::after {
|
|
645
|
+
content: "";
|
|
646
|
+
position: absolute;
|
|
647
|
+
inset: 0;
|
|
648
|
+
transform: translateX(-100%);
|
|
649
|
+
background-image: linear-gradient(
|
|
650
|
+
90deg,
|
|
651
|
+
rgba(255, 255, 255, 0) 0%,
|
|
652
|
+
rgba(255, 255, 255, 0.6) 50%,
|
|
653
|
+
rgba(255, 255, 255, 0) 100%
|
|
654
|
+
);
|
|
655
|
+
animation: skeleton-shimmer 1.4s ease-in-out infinite;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
@keyframes skeleton-shimmer {
|
|
659
|
+
100% {
|
|
660
|
+
transform: translateX(100%);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
637
664
|
@import "./darkmode.css";
|
|
638
665
|
@import "./brand.css";
|
|
639
666
|
|
package/dist/chunk-ESCNCQGI.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// src/components/SkeletonParagraph.tsx
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
function SkeletonParagraph() {
|
|
4
|
-
return /* @__PURE__ */ jsx("div", { className: "h-[24px] bg-gradient-to-r from-neutral-100 to-[#f7f7f7] w-full rounded-xs min-w-32 " });
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
SkeletonParagraph
|
|
9
|
-
};
|