@almadar/ui 4.53.4 → 4.53.6
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/avl/index.cjs +51 -20
- package/dist/avl/index.js +51 -20
- package/dist/components/index.cjs +50 -19
- package/dist/components/index.js +50 -19
- package/dist/marketing/index.cjs +5 -5
- package/dist/marketing/index.js +5 -5
- package/dist/providers/index.cjs +50 -19
- package/dist/providers/index.js +50 -19
- package/dist/runtime/index.cjs +50 -19
- package/dist/runtime/index.js +50 -19
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -12713,11 +12713,11 @@ var init_SimpleGrid = __esm({
|
|
|
12713
12713
|
};
|
|
12714
12714
|
colStyles = {
|
|
12715
12715
|
1: "grid-cols-1",
|
|
12716
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
12717
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
12718
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
12719
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
12720
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
12716
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
12717
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
12718
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
12719
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
12720
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
12721
12721
|
};
|
|
12722
12722
|
SimpleGrid = ({
|
|
12723
12723
|
minChildWidth = 250,
|
|
@@ -13173,17 +13173,36 @@ var init_Tooltip = __esm({
|
|
|
13173
13173
|
Tooltip.displayName = "Tooltip";
|
|
13174
13174
|
}
|
|
13175
13175
|
});
|
|
13176
|
-
|
|
13176
|
+
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
13177
|
+
if (position === "left" || position === "right") {
|
|
13178
|
+
return {
|
|
13179
|
+
left: triggerRect.left + (position === "left" ? 0 : triggerRect.width),
|
|
13180
|
+
top: triggerRect.top + triggerRect.height / 2
|
|
13181
|
+
};
|
|
13182
|
+
}
|
|
13183
|
+
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
13184
|
+
const centered = triggerRect.left + triggerRect.width / 2 - popoverWidth / 2;
|
|
13185
|
+
const maxLeft = viewportWidth - popoverWidth - VIEWPORT_EDGE_PADDING;
|
|
13186
|
+
const clamped = Math.max(
|
|
13187
|
+
VIEWPORT_EDGE_PADDING,
|
|
13188
|
+
Math.min(centered, Math.max(VIEWPORT_EDGE_PADDING, maxLeft))
|
|
13189
|
+
);
|
|
13190
|
+
return {
|
|
13191
|
+
left: clamped,
|
|
13192
|
+
top: triggerRect.top + (position === "top" ? 0 : triggerRect.height)
|
|
13193
|
+
};
|
|
13194
|
+
}
|
|
13195
|
+
var positionClasses2, arrowClasses2, VIEWPORT_EDGE_PADDING, Popover;
|
|
13177
13196
|
var init_Popover = __esm({
|
|
13178
13197
|
"components/molecules/Popover.tsx"() {
|
|
13179
13198
|
"use client";
|
|
13180
13199
|
init_Typography();
|
|
13181
13200
|
init_cn();
|
|
13182
13201
|
positionClasses2 = {
|
|
13183
|
-
top: "
|
|
13184
|
-
bottom: "
|
|
13185
|
-
left: "
|
|
13186
|
-
right: "
|
|
13202
|
+
top: "mb-2",
|
|
13203
|
+
bottom: "mt-2",
|
|
13204
|
+
left: "mr-2 -translate-y-1/2",
|
|
13205
|
+
right: "ml-2 -translate-y-1/2"
|
|
13187
13206
|
};
|
|
13188
13207
|
arrowClasses2 = {
|
|
13189
13208
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -13191,6 +13210,7 @@ var init_Popover = __esm({
|
|
|
13191
13210
|
left: "left-full top-1/2 -translate-y-1/2 border-l-white border-t-transparent border-b-transparent border-r-transparent",
|
|
13192
13211
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
13193
13212
|
};
|
|
13213
|
+
VIEWPORT_EDGE_PADDING = 8;
|
|
13194
13214
|
Popover = ({
|
|
13195
13215
|
content,
|
|
13196
13216
|
children,
|
|
@@ -13201,12 +13221,16 @@ var init_Popover = __esm({
|
|
|
13201
13221
|
}) => {
|
|
13202
13222
|
const [isOpen, setIsOpen] = React96.useState(false);
|
|
13203
13223
|
const [triggerRect, setTriggerRect] = React96.useState(null);
|
|
13224
|
+
const [popoverWidth, setPopoverWidth] = React96.useState(0);
|
|
13204
13225
|
const triggerRef = React96.useRef(null);
|
|
13205
13226
|
const popoverRef = React96.useRef(null);
|
|
13206
13227
|
const updatePosition = () => {
|
|
13207
13228
|
if (triggerRef.current) {
|
|
13208
13229
|
setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
13209
13230
|
}
|
|
13231
|
+
if (popoverRef.current) {
|
|
13232
|
+
setPopoverWidth(popoverRef.current.offsetWidth);
|
|
13233
|
+
}
|
|
13210
13234
|
};
|
|
13211
13235
|
const handleOpen = () => {
|
|
13212
13236
|
updatePosition();
|
|
@@ -13225,8 +13249,18 @@ var init_Popover = __esm({
|
|
|
13225
13249
|
React96.useEffect(() => {
|
|
13226
13250
|
if (isOpen) {
|
|
13227
13251
|
updatePosition();
|
|
13252
|
+
} else {
|
|
13253
|
+
setPopoverWidth(0);
|
|
13228
13254
|
}
|
|
13229
13255
|
}, [isOpen]);
|
|
13256
|
+
React96.useLayoutEffect(() => {
|
|
13257
|
+
if (isOpen && popoverRef.current) {
|
|
13258
|
+
const measured = popoverRef.current.offsetWidth;
|
|
13259
|
+
if (measured !== popoverWidth) {
|
|
13260
|
+
setPopoverWidth(measured);
|
|
13261
|
+
}
|
|
13262
|
+
}
|
|
13263
|
+
});
|
|
13230
13264
|
React96.useEffect(() => {
|
|
13231
13265
|
if (trigger !== "click") {
|
|
13232
13266
|
return;
|
|
@@ -13265,10 +13299,7 @@ var init_Popover = __esm({
|
|
|
13265
13299
|
positionClasses2[position],
|
|
13266
13300
|
className
|
|
13267
13301
|
),
|
|
13268
|
-
style:
|
|
13269
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
13270
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2
|
|
13271
|
-
},
|
|
13302
|
+
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
13272
13303
|
role: "dialog",
|
|
13273
13304
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
13274
13305
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -26078,11 +26109,11 @@ function DataGrid({
|
|
|
26078
26109
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
26079
26110
|
const colsClass = cols ? {
|
|
26080
26111
|
1: "grid-cols-1",
|
|
26081
|
-
2: "sm:grid-cols-2",
|
|
26082
|
-
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
26083
|
-
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
26084
|
-
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
|
|
26085
|
-
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
|
|
26112
|
+
2: "sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
26113
|
+
3: "sm:grid-cols-2 lg:grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
26114
|
+
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
26115
|
+
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
26116
|
+
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
26086
26117
|
}[cols] : void 0;
|
|
26087
26118
|
if (isLoading) {
|
|
26088
26119
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
@@ -60440,7 +60471,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
60440
60471
|
Box,
|
|
60441
60472
|
{
|
|
60442
60473
|
ref: isExpanded ? void 0 : l1SetNodeRef,
|
|
60443
|
-
className:
|
|
60474
|
+
className: `@container/preview rounded-lg border shadow-sm bg-card transition-all duration-200 overflow-hidden relative${isRunning ? " orb-preview-running" : ""}`,
|
|
60444
60475
|
style: {
|
|
60445
60476
|
borderColor: l1IsOver ? "var(--color-primary)" : borderColor,
|
|
60446
60477
|
borderWidth: l1IsOver ? "2px" : borderWidth,
|
package/dist/avl/index.js
CHANGED
|
@@ -12667,11 +12667,11 @@ var init_SimpleGrid = __esm({
|
|
|
12667
12667
|
};
|
|
12668
12668
|
colStyles = {
|
|
12669
12669
|
1: "grid-cols-1",
|
|
12670
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
12671
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
12672
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
12673
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
12674
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
12670
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
12671
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
12672
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
12673
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
12674
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
12675
12675
|
};
|
|
12676
12676
|
SimpleGrid = ({
|
|
12677
12677
|
minChildWidth = 250,
|
|
@@ -13127,17 +13127,36 @@ var init_Tooltip = __esm({
|
|
|
13127
13127
|
Tooltip.displayName = "Tooltip";
|
|
13128
13128
|
}
|
|
13129
13129
|
});
|
|
13130
|
-
|
|
13130
|
+
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
13131
|
+
if (position === "left" || position === "right") {
|
|
13132
|
+
return {
|
|
13133
|
+
left: triggerRect.left + (position === "left" ? 0 : triggerRect.width),
|
|
13134
|
+
top: triggerRect.top + triggerRect.height / 2
|
|
13135
|
+
};
|
|
13136
|
+
}
|
|
13137
|
+
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
13138
|
+
const centered = triggerRect.left + triggerRect.width / 2 - popoverWidth / 2;
|
|
13139
|
+
const maxLeft = viewportWidth - popoverWidth - VIEWPORT_EDGE_PADDING;
|
|
13140
|
+
const clamped = Math.max(
|
|
13141
|
+
VIEWPORT_EDGE_PADDING,
|
|
13142
|
+
Math.min(centered, Math.max(VIEWPORT_EDGE_PADDING, maxLeft))
|
|
13143
|
+
);
|
|
13144
|
+
return {
|
|
13145
|
+
left: clamped,
|
|
13146
|
+
top: triggerRect.top + (position === "top" ? 0 : triggerRect.height)
|
|
13147
|
+
};
|
|
13148
|
+
}
|
|
13149
|
+
var positionClasses2, arrowClasses2, VIEWPORT_EDGE_PADDING, Popover;
|
|
13131
13150
|
var init_Popover = __esm({
|
|
13132
13151
|
"components/molecules/Popover.tsx"() {
|
|
13133
13152
|
"use client";
|
|
13134
13153
|
init_Typography();
|
|
13135
13154
|
init_cn();
|
|
13136
13155
|
positionClasses2 = {
|
|
13137
|
-
top: "
|
|
13138
|
-
bottom: "
|
|
13139
|
-
left: "
|
|
13140
|
-
right: "
|
|
13156
|
+
top: "mb-2",
|
|
13157
|
+
bottom: "mt-2",
|
|
13158
|
+
left: "mr-2 -translate-y-1/2",
|
|
13159
|
+
right: "ml-2 -translate-y-1/2"
|
|
13141
13160
|
};
|
|
13142
13161
|
arrowClasses2 = {
|
|
13143
13162
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -13145,6 +13164,7 @@ var init_Popover = __esm({
|
|
|
13145
13164
|
left: "left-full top-1/2 -translate-y-1/2 border-l-white border-t-transparent border-b-transparent border-r-transparent",
|
|
13146
13165
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
13147
13166
|
};
|
|
13167
|
+
VIEWPORT_EDGE_PADDING = 8;
|
|
13148
13168
|
Popover = ({
|
|
13149
13169
|
content,
|
|
13150
13170
|
children,
|
|
@@ -13155,12 +13175,16 @@ var init_Popover = __esm({
|
|
|
13155
13175
|
}) => {
|
|
13156
13176
|
const [isOpen, setIsOpen] = useState(false);
|
|
13157
13177
|
const [triggerRect, setTriggerRect] = useState(null);
|
|
13178
|
+
const [popoverWidth, setPopoverWidth] = useState(0);
|
|
13158
13179
|
const triggerRef = useRef(null);
|
|
13159
13180
|
const popoverRef = useRef(null);
|
|
13160
13181
|
const updatePosition = () => {
|
|
13161
13182
|
if (triggerRef.current) {
|
|
13162
13183
|
setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
13163
13184
|
}
|
|
13185
|
+
if (popoverRef.current) {
|
|
13186
|
+
setPopoverWidth(popoverRef.current.offsetWidth);
|
|
13187
|
+
}
|
|
13164
13188
|
};
|
|
13165
13189
|
const handleOpen = () => {
|
|
13166
13190
|
updatePosition();
|
|
@@ -13179,8 +13203,18 @@ var init_Popover = __esm({
|
|
|
13179
13203
|
useEffect(() => {
|
|
13180
13204
|
if (isOpen) {
|
|
13181
13205
|
updatePosition();
|
|
13206
|
+
} else {
|
|
13207
|
+
setPopoverWidth(0);
|
|
13182
13208
|
}
|
|
13183
13209
|
}, [isOpen]);
|
|
13210
|
+
useLayoutEffect(() => {
|
|
13211
|
+
if (isOpen && popoverRef.current) {
|
|
13212
|
+
const measured = popoverRef.current.offsetWidth;
|
|
13213
|
+
if (measured !== popoverWidth) {
|
|
13214
|
+
setPopoverWidth(measured);
|
|
13215
|
+
}
|
|
13216
|
+
}
|
|
13217
|
+
});
|
|
13184
13218
|
useEffect(() => {
|
|
13185
13219
|
if (trigger !== "click") {
|
|
13186
13220
|
return;
|
|
@@ -13219,10 +13253,7 @@ var init_Popover = __esm({
|
|
|
13219
13253
|
positionClasses2[position],
|
|
13220
13254
|
className
|
|
13221
13255
|
),
|
|
13222
|
-
style:
|
|
13223
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
13224
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2
|
|
13225
|
-
},
|
|
13256
|
+
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
13226
13257
|
role: "dialog",
|
|
13227
13258
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
13228
13259
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -26032,11 +26063,11 @@ function DataGrid({
|
|
|
26032
26063
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
26033
26064
|
const colsClass = cols ? {
|
|
26034
26065
|
1: "grid-cols-1",
|
|
26035
|
-
2: "sm:grid-cols-2",
|
|
26036
|
-
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
26037
|
-
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
26038
|
-
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
|
|
26039
|
-
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
|
|
26066
|
+
2: "sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
26067
|
+
3: "sm:grid-cols-2 lg:grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
26068
|
+
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
26069
|
+
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
26070
|
+
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
26040
26071
|
}[cols] : void 0;
|
|
26041
26072
|
if (isLoading) {
|
|
26042
26073
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
@@ -60394,7 +60425,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
60394
60425
|
Box,
|
|
60395
60426
|
{
|
|
60396
60427
|
ref: isExpanded ? void 0 : l1SetNodeRef,
|
|
60397
|
-
className:
|
|
60428
|
+
className: `@container/preview rounded-lg border shadow-sm bg-card transition-all duration-200 overflow-hidden relative${isRunning ? " orb-preview-running" : ""}`,
|
|
60398
60429
|
style: {
|
|
60399
60430
|
borderColor: l1IsOver ? "var(--color-primary)" : borderColor,
|
|
60400
60431
|
borderWidth: l1IsOver ? "2px" : borderWidth,
|
|
@@ -6770,11 +6770,11 @@ var init_SimpleGrid = __esm({
|
|
|
6770
6770
|
};
|
|
6771
6771
|
colStyles = {
|
|
6772
6772
|
1: "grid-cols-1",
|
|
6773
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
6774
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
6775
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
6776
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
6777
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
6773
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
6774
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
6775
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
6776
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
6777
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
6778
6778
|
};
|
|
6779
6779
|
exports.SimpleGrid = ({
|
|
6780
6780
|
minChildWidth = 250,
|
|
@@ -7230,17 +7230,36 @@ var init_Tooltip = __esm({
|
|
|
7230
7230
|
exports.Tooltip.displayName = "Tooltip";
|
|
7231
7231
|
}
|
|
7232
7232
|
});
|
|
7233
|
-
|
|
7233
|
+
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
7234
|
+
if (position === "left" || position === "right") {
|
|
7235
|
+
return {
|
|
7236
|
+
left: triggerRect.left + (position === "left" ? 0 : triggerRect.width),
|
|
7237
|
+
top: triggerRect.top + triggerRect.height / 2
|
|
7238
|
+
};
|
|
7239
|
+
}
|
|
7240
|
+
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
7241
|
+
const centered = triggerRect.left + triggerRect.width / 2 - popoverWidth / 2;
|
|
7242
|
+
const maxLeft = viewportWidth - popoverWidth - VIEWPORT_EDGE_PADDING;
|
|
7243
|
+
const clamped = Math.max(
|
|
7244
|
+
VIEWPORT_EDGE_PADDING,
|
|
7245
|
+
Math.min(centered, Math.max(VIEWPORT_EDGE_PADDING, maxLeft))
|
|
7246
|
+
);
|
|
7247
|
+
return {
|
|
7248
|
+
left: clamped,
|
|
7249
|
+
top: triggerRect.top + (position === "top" ? 0 : triggerRect.height)
|
|
7250
|
+
};
|
|
7251
|
+
}
|
|
7252
|
+
var positionClasses2, arrowClasses2, VIEWPORT_EDGE_PADDING; exports.Popover = void 0;
|
|
7234
7253
|
var init_Popover = __esm({
|
|
7235
7254
|
"components/molecules/Popover.tsx"() {
|
|
7236
7255
|
"use client";
|
|
7237
7256
|
init_Typography();
|
|
7238
7257
|
init_cn();
|
|
7239
7258
|
positionClasses2 = {
|
|
7240
|
-
top: "
|
|
7241
|
-
bottom: "
|
|
7242
|
-
left: "
|
|
7243
|
-
right: "
|
|
7259
|
+
top: "mb-2",
|
|
7260
|
+
bottom: "mt-2",
|
|
7261
|
+
left: "mr-2 -translate-y-1/2",
|
|
7262
|
+
right: "ml-2 -translate-y-1/2"
|
|
7244
7263
|
};
|
|
7245
7264
|
arrowClasses2 = {
|
|
7246
7265
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -7248,6 +7267,7 @@ var init_Popover = __esm({
|
|
|
7248
7267
|
left: "left-full top-1/2 -translate-y-1/2 border-l-white border-t-transparent border-b-transparent border-r-transparent",
|
|
7249
7268
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
7250
7269
|
};
|
|
7270
|
+
VIEWPORT_EDGE_PADDING = 8;
|
|
7251
7271
|
exports.Popover = ({
|
|
7252
7272
|
content,
|
|
7253
7273
|
children,
|
|
@@ -7258,12 +7278,16 @@ var init_Popover = __esm({
|
|
|
7258
7278
|
}) => {
|
|
7259
7279
|
const [isOpen, setIsOpen] = React78.useState(false);
|
|
7260
7280
|
const [triggerRect, setTriggerRect] = React78.useState(null);
|
|
7281
|
+
const [popoverWidth, setPopoverWidth] = React78.useState(0);
|
|
7261
7282
|
const triggerRef = React78.useRef(null);
|
|
7262
7283
|
const popoverRef = React78.useRef(null);
|
|
7263
7284
|
const updatePosition = () => {
|
|
7264
7285
|
if (triggerRef.current) {
|
|
7265
7286
|
setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
7266
7287
|
}
|
|
7288
|
+
if (popoverRef.current) {
|
|
7289
|
+
setPopoverWidth(popoverRef.current.offsetWidth);
|
|
7290
|
+
}
|
|
7267
7291
|
};
|
|
7268
7292
|
const handleOpen = () => {
|
|
7269
7293
|
updatePosition();
|
|
@@ -7282,8 +7306,18 @@ var init_Popover = __esm({
|
|
|
7282
7306
|
React78.useEffect(() => {
|
|
7283
7307
|
if (isOpen) {
|
|
7284
7308
|
updatePosition();
|
|
7309
|
+
} else {
|
|
7310
|
+
setPopoverWidth(0);
|
|
7285
7311
|
}
|
|
7286
7312
|
}, [isOpen]);
|
|
7313
|
+
React78.useLayoutEffect(() => {
|
|
7314
|
+
if (isOpen && popoverRef.current) {
|
|
7315
|
+
const measured = popoverRef.current.offsetWidth;
|
|
7316
|
+
if (measured !== popoverWidth) {
|
|
7317
|
+
setPopoverWidth(measured);
|
|
7318
|
+
}
|
|
7319
|
+
}
|
|
7320
|
+
});
|
|
7287
7321
|
React78.useEffect(() => {
|
|
7288
7322
|
if (trigger !== "click") {
|
|
7289
7323
|
return;
|
|
@@ -7322,10 +7356,7 @@ var init_Popover = __esm({
|
|
|
7322
7356
|
positionClasses2[position],
|
|
7323
7357
|
className
|
|
7324
7358
|
),
|
|
7325
|
-
style:
|
|
7326
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
7327
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2
|
|
7328
|
-
},
|
|
7359
|
+
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
7329
7360
|
role: "dialog",
|
|
7330
7361
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
7331
7362
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -21245,11 +21276,11 @@ function DataGrid({
|
|
|
21245
21276
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
21246
21277
|
const colsClass = cols ? {
|
|
21247
21278
|
1: "grid-cols-1",
|
|
21248
|
-
2: "sm:grid-cols-2",
|
|
21249
|
-
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
21250
|
-
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
21251
|
-
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
|
|
21252
|
-
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
|
|
21279
|
+
2: "sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
21280
|
+
3: "sm:grid-cols-2 lg:grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
21281
|
+
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
21282
|
+
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
21283
|
+
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
21253
21284
|
}[cols] : void 0;
|
|
21254
21285
|
if (isLoading) {
|
|
21255
21286
|
return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
package/dist/components/index.js
CHANGED
|
@@ -6724,11 +6724,11 @@ var init_SimpleGrid = __esm({
|
|
|
6724
6724
|
};
|
|
6725
6725
|
colStyles = {
|
|
6726
6726
|
1: "grid-cols-1",
|
|
6727
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
6728
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
6729
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
6730
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
6731
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
6727
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
6728
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
6729
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
6730
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
6731
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
6732
6732
|
};
|
|
6733
6733
|
SimpleGrid = ({
|
|
6734
6734
|
minChildWidth = 250,
|
|
@@ -7184,17 +7184,36 @@ var init_Tooltip = __esm({
|
|
|
7184
7184
|
Tooltip.displayName = "Tooltip";
|
|
7185
7185
|
}
|
|
7186
7186
|
});
|
|
7187
|
-
|
|
7187
|
+
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
7188
|
+
if (position === "left" || position === "right") {
|
|
7189
|
+
return {
|
|
7190
|
+
left: triggerRect.left + (position === "left" ? 0 : triggerRect.width),
|
|
7191
|
+
top: triggerRect.top + triggerRect.height / 2
|
|
7192
|
+
};
|
|
7193
|
+
}
|
|
7194
|
+
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
7195
|
+
const centered = triggerRect.left + triggerRect.width / 2 - popoverWidth / 2;
|
|
7196
|
+
const maxLeft = viewportWidth - popoverWidth - VIEWPORT_EDGE_PADDING;
|
|
7197
|
+
const clamped = Math.max(
|
|
7198
|
+
VIEWPORT_EDGE_PADDING,
|
|
7199
|
+
Math.min(centered, Math.max(VIEWPORT_EDGE_PADDING, maxLeft))
|
|
7200
|
+
);
|
|
7201
|
+
return {
|
|
7202
|
+
left: clamped,
|
|
7203
|
+
top: triggerRect.top + (position === "top" ? 0 : triggerRect.height)
|
|
7204
|
+
};
|
|
7205
|
+
}
|
|
7206
|
+
var positionClasses2, arrowClasses2, VIEWPORT_EDGE_PADDING, Popover;
|
|
7188
7207
|
var init_Popover = __esm({
|
|
7189
7208
|
"components/molecules/Popover.tsx"() {
|
|
7190
7209
|
"use client";
|
|
7191
7210
|
init_Typography();
|
|
7192
7211
|
init_cn();
|
|
7193
7212
|
positionClasses2 = {
|
|
7194
|
-
top: "
|
|
7195
|
-
bottom: "
|
|
7196
|
-
left: "
|
|
7197
|
-
right: "
|
|
7213
|
+
top: "mb-2",
|
|
7214
|
+
bottom: "mt-2",
|
|
7215
|
+
left: "mr-2 -translate-y-1/2",
|
|
7216
|
+
right: "ml-2 -translate-y-1/2"
|
|
7198
7217
|
};
|
|
7199
7218
|
arrowClasses2 = {
|
|
7200
7219
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -7202,6 +7221,7 @@ var init_Popover = __esm({
|
|
|
7202
7221
|
left: "left-full top-1/2 -translate-y-1/2 border-l-white border-t-transparent border-b-transparent border-r-transparent",
|
|
7203
7222
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
7204
7223
|
};
|
|
7224
|
+
VIEWPORT_EDGE_PADDING = 8;
|
|
7205
7225
|
Popover = ({
|
|
7206
7226
|
content,
|
|
7207
7227
|
children,
|
|
@@ -7212,12 +7232,16 @@ var init_Popover = __esm({
|
|
|
7212
7232
|
}) => {
|
|
7213
7233
|
const [isOpen, setIsOpen] = useState(false);
|
|
7214
7234
|
const [triggerRect, setTriggerRect] = useState(null);
|
|
7235
|
+
const [popoverWidth, setPopoverWidth] = useState(0);
|
|
7215
7236
|
const triggerRef = useRef(null);
|
|
7216
7237
|
const popoverRef = useRef(null);
|
|
7217
7238
|
const updatePosition = () => {
|
|
7218
7239
|
if (triggerRef.current) {
|
|
7219
7240
|
setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
7220
7241
|
}
|
|
7242
|
+
if (popoverRef.current) {
|
|
7243
|
+
setPopoverWidth(popoverRef.current.offsetWidth);
|
|
7244
|
+
}
|
|
7221
7245
|
};
|
|
7222
7246
|
const handleOpen = () => {
|
|
7223
7247
|
updatePosition();
|
|
@@ -7236,8 +7260,18 @@ var init_Popover = __esm({
|
|
|
7236
7260
|
useEffect(() => {
|
|
7237
7261
|
if (isOpen) {
|
|
7238
7262
|
updatePosition();
|
|
7263
|
+
} else {
|
|
7264
|
+
setPopoverWidth(0);
|
|
7239
7265
|
}
|
|
7240
7266
|
}, [isOpen]);
|
|
7267
|
+
useLayoutEffect(() => {
|
|
7268
|
+
if (isOpen && popoverRef.current) {
|
|
7269
|
+
const measured = popoverRef.current.offsetWidth;
|
|
7270
|
+
if (measured !== popoverWidth) {
|
|
7271
|
+
setPopoverWidth(measured);
|
|
7272
|
+
}
|
|
7273
|
+
}
|
|
7274
|
+
});
|
|
7241
7275
|
useEffect(() => {
|
|
7242
7276
|
if (trigger !== "click") {
|
|
7243
7277
|
return;
|
|
@@ -7276,10 +7310,7 @@ var init_Popover = __esm({
|
|
|
7276
7310
|
positionClasses2[position],
|
|
7277
7311
|
className
|
|
7278
7312
|
),
|
|
7279
|
-
style:
|
|
7280
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
7281
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2
|
|
7282
|
-
},
|
|
7313
|
+
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
7283
7314
|
role: "dialog",
|
|
7284
7315
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
7285
7316
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -21199,11 +21230,11 @@ function DataGrid({
|
|
|
21199
21230
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
21200
21231
|
const colsClass = cols ? {
|
|
21201
21232
|
1: "grid-cols-1",
|
|
21202
|
-
2: "sm:grid-cols-2",
|
|
21203
|
-
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
21204
|
-
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
21205
|
-
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
|
|
21206
|
-
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
|
|
21233
|
+
2: "sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
21234
|
+
3: "sm:grid-cols-2 lg:grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
21235
|
+
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
21236
|
+
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
21237
|
+
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
21207
21238
|
}[cols] : void 0;
|
|
21208
21239
|
if (isLoading) {
|
|
21209
21240
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
package/dist/marketing/index.cjs
CHANGED
|
@@ -3900,11 +3900,11 @@ var gapStyles2 = {
|
|
|
3900
3900
|
};
|
|
3901
3901
|
var colStyles = {
|
|
3902
3902
|
1: "grid-cols-1",
|
|
3903
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
3904
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
3905
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
3906
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
3907
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
3903
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
3904
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
3905
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
3906
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
3907
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
3908
3908
|
};
|
|
3909
3909
|
var SimpleGrid = ({
|
|
3910
3910
|
minChildWidth = 250,
|
package/dist/marketing/index.js
CHANGED
|
@@ -3876,11 +3876,11 @@ var gapStyles2 = {
|
|
|
3876
3876
|
};
|
|
3877
3877
|
var colStyles = {
|
|
3878
3878
|
1: "grid-cols-1",
|
|
3879
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
3880
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
3881
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
3882
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
3883
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
3879
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
3880
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
3881
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
3882
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
3883
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
3884
3884
|
};
|
|
3885
3885
|
var SimpleGrid = ({
|
|
3886
3886
|
minChildWidth = 250,
|
package/dist/providers/index.cjs
CHANGED
|
@@ -8338,11 +8338,11 @@ var init_SimpleGrid = __esm({
|
|
|
8338
8338
|
};
|
|
8339
8339
|
colStyles = {
|
|
8340
8340
|
1: "grid-cols-1",
|
|
8341
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
8342
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
8343
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
8344
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
8345
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
8341
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
8342
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8343
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8344
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8345
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
8346
8346
|
};
|
|
8347
8347
|
SimpleGrid = ({
|
|
8348
8348
|
minChildWidth = 250,
|
|
@@ -8798,17 +8798,36 @@ var init_Tooltip = __esm({
|
|
|
8798
8798
|
Tooltip.displayName = "Tooltip";
|
|
8799
8799
|
}
|
|
8800
8800
|
});
|
|
8801
|
-
|
|
8801
|
+
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
8802
|
+
if (position === "left" || position === "right") {
|
|
8803
|
+
return {
|
|
8804
|
+
left: triggerRect.left + (position === "left" ? 0 : triggerRect.width),
|
|
8805
|
+
top: triggerRect.top + triggerRect.height / 2
|
|
8806
|
+
};
|
|
8807
|
+
}
|
|
8808
|
+
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
8809
|
+
const centered = triggerRect.left + triggerRect.width / 2 - popoverWidth / 2;
|
|
8810
|
+
const maxLeft = viewportWidth - popoverWidth - VIEWPORT_EDGE_PADDING;
|
|
8811
|
+
const clamped = Math.max(
|
|
8812
|
+
VIEWPORT_EDGE_PADDING,
|
|
8813
|
+
Math.min(centered, Math.max(VIEWPORT_EDGE_PADDING, maxLeft))
|
|
8814
|
+
);
|
|
8815
|
+
return {
|
|
8816
|
+
left: clamped,
|
|
8817
|
+
top: triggerRect.top + (position === "top" ? 0 : triggerRect.height)
|
|
8818
|
+
};
|
|
8819
|
+
}
|
|
8820
|
+
var positionClasses2, arrowClasses2, VIEWPORT_EDGE_PADDING, Popover;
|
|
8802
8821
|
var init_Popover = __esm({
|
|
8803
8822
|
"components/molecules/Popover.tsx"() {
|
|
8804
8823
|
"use client";
|
|
8805
8824
|
init_Typography();
|
|
8806
8825
|
init_cn();
|
|
8807
8826
|
positionClasses2 = {
|
|
8808
|
-
top: "
|
|
8809
|
-
bottom: "
|
|
8810
|
-
left: "
|
|
8811
|
-
right: "
|
|
8827
|
+
top: "mb-2",
|
|
8828
|
+
bottom: "mt-2",
|
|
8829
|
+
left: "mr-2 -translate-y-1/2",
|
|
8830
|
+
right: "ml-2 -translate-y-1/2"
|
|
8812
8831
|
};
|
|
8813
8832
|
arrowClasses2 = {
|
|
8814
8833
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -8816,6 +8835,7 @@ var init_Popover = __esm({
|
|
|
8816
8835
|
left: "left-full top-1/2 -translate-y-1/2 border-l-white border-t-transparent border-b-transparent border-r-transparent",
|
|
8817
8836
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
8818
8837
|
};
|
|
8838
|
+
VIEWPORT_EDGE_PADDING = 8;
|
|
8819
8839
|
Popover = ({
|
|
8820
8840
|
content,
|
|
8821
8841
|
children,
|
|
@@ -8826,12 +8846,16 @@ var init_Popover = __esm({
|
|
|
8826
8846
|
}) => {
|
|
8827
8847
|
const [isOpen, setIsOpen] = React84.useState(false);
|
|
8828
8848
|
const [triggerRect, setTriggerRect] = React84.useState(null);
|
|
8849
|
+
const [popoverWidth, setPopoverWidth] = React84.useState(0);
|
|
8829
8850
|
const triggerRef = React84.useRef(null);
|
|
8830
8851
|
const popoverRef = React84.useRef(null);
|
|
8831
8852
|
const updatePosition = () => {
|
|
8832
8853
|
if (triggerRef.current) {
|
|
8833
8854
|
setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
8834
8855
|
}
|
|
8856
|
+
if (popoverRef.current) {
|
|
8857
|
+
setPopoverWidth(popoverRef.current.offsetWidth);
|
|
8858
|
+
}
|
|
8835
8859
|
};
|
|
8836
8860
|
const handleOpen = () => {
|
|
8837
8861
|
updatePosition();
|
|
@@ -8850,8 +8874,18 @@ var init_Popover = __esm({
|
|
|
8850
8874
|
React84.useEffect(() => {
|
|
8851
8875
|
if (isOpen) {
|
|
8852
8876
|
updatePosition();
|
|
8877
|
+
} else {
|
|
8878
|
+
setPopoverWidth(0);
|
|
8853
8879
|
}
|
|
8854
8880
|
}, [isOpen]);
|
|
8881
|
+
React84.useLayoutEffect(() => {
|
|
8882
|
+
if (isOpen && popoverRef.current) {
|
|
8883
|
+
const measured = popoverRef.current.offsetWidth;
|
|
8884
|
+
if (measured !== popoverWidth) {
|
|
8885
|
+
setPopoverWidth(measured);
|
|
8886
|
+
}
|
|
8887
|
+
}
|
|
8888
|
+
});
|
|
8855
8889
|
React84.useEffect(() => {
|
|
8856
8890
|
if (trigger !== "click") {
|
|
8857
8891
|
return;
|
|
@@ -8890,10 +8924,7 @@ var init_Popover = __esm({
|
|
|
8890
8924
|
positionClasses2[position],
|
|
8891
8925
|
className
|
|
8892
8926
|
),
|
|
8893
|
-
style:
|
|
8894
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
8895
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2
|
|
8896
|
-
},
|
|
8927
|
+
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
8897
8928
|
role: "dialog",
|
|
8898
8929
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
8899
8930
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -22490,11 +22521,11 @@ function DataGrid({
|
|
|
22490
22521
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
22491
22522
|
const colsClass = cols ? {
|
|
22492
22523
|
1: "grid-cols-1",
|
|
22493
|
-
2: "sm:grid-cols-2",
|
|
22494
|
-
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
22495
|
-
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
22496
|
-
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
|
|
22497
|
-
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
|
|
22524
|
+
2: "sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
22525
|
+
3: "sm:grid-cols-2 lg:grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22526
|
+
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22527
|
+
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22528
|
+
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
22498
22529
|
}[cols] : void 0;
|
|
22499
22530
|
if (isLoading) {
|
|
22500
22531
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
package/dist/providers/index.js
CHANGED
|
@@ -8292,11 +8292,11 @@ var init_SimpleGrid = __esm({
|
|
|
8292
8292
|
};
|
|
8293
8293
|
colStyles = {
|
|
8294
8294
|
1: "grid-cols-1",
|
|
8295
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
8296
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
8297
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
8298
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
8299
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
8295
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
8296
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8297
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8298
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8299
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
8300
8300
|
};
|
|
8301
8301
|
SimpleGrid = ({
|
|
8302
8302
|
minChildWidth = 250,
|
|
@@ -8752,17 +8752,36 @@ var init_Tooltip = __esm({
|
|
|
8752
8752
|
Tooltip.displayName = "Tooltip";
|
|
8753
8753
|
}
|
|
8754
8754
|
});
|
|
8755
|
-
|
|
8755
|
+
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
8756
|
+
if (position === "left" || position === "right") {
|
|
8757
|
+
return {
|
|
8758
|
+
left: triggerRect.left + (position === "left" ? 0 : triggerRect.width),
|
|
8759
|
+
top: triggerRect.top + triggerRect.height / 2
|
|
8760
|
+
};
|
|
8761
|
+
}
|
|
8762
|
+
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
8763
|
+
const centered = triggerRect.left + triggerRect.width / 2 - popoverWidth / 2;
|
|
8764
|
+
const maxLeft = viewportWidth - popoverWidth - VIEWPORT_EDGE_PADDING;
|
|
8765
|
+
const clamped = Math.max(
|
|
8766
|
+
VIEWPORT_EDGE_PADDING,
|
|
8767
|
+
Math.min(centered, Math.max(VIEWPORT_EDGE_PADDING, maxLeft))
|
|
8768
|
+
);
|
|
8769
|
+
return {
|
|
8770
|
+
left: clamped,
|
|
8771
|
+
top: triggerRect.top + (position === "top" ? 0 : triggerRect.height)
|
|
8772
|
+
};
|
|
8773
|
+
}
|
|
8774
|
+
var positionClasses2, arrowClasses2, VIEWPORT_EDGE_PADDING, Popover;
|
|
8756
8775
|
var init_Popover = __esm({
|
|
8757
8776
|
"components/molecules/Popover.tsx"() {
|
|
8758
8777
|
"use client";
|
|
8759
8778
|
init_Typography();
|
|
8760
8779
|
init_cn();
|
|
8761
8780
|
positionClasses2 = {
|
|
8762
|
-
top: "
|
|
8763
|
-
bottom: "
|
|
8764
|
-
left: "
|
|
8765
|
-
right: "
|
|
8781
|
+
top: "mb-2",
|
|
8782
|
+
bottom: "mt-2",
|
|
8783
|
+
left: "mr-2 -translate-y-1/2",
|
|
8784
|
+
right: "ml-2 -translate-y-1/2"
|
|
8766
8785
|
};
|
|
8767
8786
|
arrowClasses2 = {
|
|
8768
8787
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -8770,6 +8789,7 @@ var init_Popover = __esm({
|
|
|
8770
8789
|
left: "left-full top-1/2 -translate-y-1/2 border-l-white border-t-transparent border-b-transparent border-r-transparent",
|
|
8771
8790
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
8772
8791
|
};
|
|
8792
|
+
VIEWPORT_EDGE_PADDING = 8;
|
|
8773
8793
|
Popover = ({
|
|
8774
8794
|
content,
|
|
8775
8795
|
children,
|
|
@@ -8780,12 +8800,16 @@ var init_Popover = __esm({
|
|
|
8780
8800
|
}) => {
|
|
8781
8801
|
const [isOpen, setIsOpen] = useState(false);
|
|
8782
8802
|
const [triggerRect, setTriggerRect] = useState(null);
|
|
8803
|
+
const [popoverWidth, setPopoverWidth] = useState(0);
|
|
8783
8804
|
const triggerRef = useRef(null);
|
|
8784
8805
|
const popoverRef = useRef(null);
|
|
8785
8806
|
const updatePosition = () => {
|
|
8786
8807
|
if (triggerRef.current) {
|
|
8787
8808
|
setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
8788
8809
|
}
|
|
8810
|
+
if (popoverRef.current) {
|
|
8811
|
+
setPopoverWidth(popoverRef.current.offsetWidth);
|
|
8812
|
+
}
|
|
8789
8813
|
};
|
|
8790
8814
|
const handleOpen = () => {
|
|
8791
8815
|
updatePosition();
|
|
@@ -8804,8 +8828,18 @@ var init_Popover = __esm({
|
|
|
8804
8828
|
useEffect(() => {
|
|
8805
8829
|
if (isOpen) {
|
|
8806
8830
|
updatePosition();
|
|
8831
|
+
} else {
|
|
8832
|
+
setPopoverWidth(0);
|
|
8807
8833
|
}
|
|
8808
8834
|
}, [isOpen]);
|
|
8835
|
+
useLayoutEffect(() => {
|
|
8836
|
+
if (isOpen && popoverRef.current) {
|
|
8837
|
+
const measured = popoverRef.current.offsetWidth;
|
|
8838
|
+
if (measured !== popoverWidth) {
|
|
8839
|
+
setPopoverWidth(measured);
|
|
8840
|
+
}
|
|
8841
|
+
}
|
|
8842
|
+
});
|
|
8809
8843
|
useEffect(() => {
|
|
8810
8844
|
if (trigger !== "click") {
|
|
8811
8845
|
return;
|
|
@@ -8844,10 +8878,7 @@ var init_Popover = __esm({
|
|
|
8844
8878
|
positionClasses2[position],
|
|
8845
8879
|
className
|
|
8846
8880
|
),
|
|
8847
|
-
style:
|
|
8848
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
8849
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2
|
|
8850
|
-
},
|
|
8881
|
+
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
8851
8882
|
role: "dialog",
|
|
8852
8883
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
8853
8884
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -22444,11 +22475,11 @@ function DataGrid({
|
|
|
22444
22475
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
22445
22476
|
const colsClass = cols ? {
|
|
22446
22477
|
1: "grid-cols-1",
|
|
22447
|
-
2: "sm:grid-cols-2",
|
|
22448
|
-
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
22449
|
-
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
22450
|
-
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
|
|
22451
|
-
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
|
|
22478
|
+
2: "sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
22479
|
+
3: "sm:grid-cols-2 lg:grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22480
|
+
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22481
|
+
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22482
|
+
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
22452
22483
|
}[cols] : void 0;
|
|
22453
22484
|
if (isLoading) {
|
|
22454
22485
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -8226,11 +8226,11 @@ var init_SimpleGrid = __esm({
|
|
|
8226
8226
|
};
|
|
8227
8227
|
colStyles = {
|
|
8228
8228
|
1: "grid-cols-1",
|
|
8229
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
8230
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
8231
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
8232
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
8233
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
8229
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
8230
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8231
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8232
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8233
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
8234
8234
|
};
|
|
8235
8235
|
SimpleGrid = ({
|
|
8236
8236
|
minChildWidth = 250,
|
|
@@ -8686,17 +8686,36 @@ var init_Tooltip = __esm({
|
|
|
8686
8686
|
Tooltip.displayName = "Tooltip";
|
|
8687
8687
|
}
|
|
8688
8688
|
});
|
|
8689
|
-
|
|
8689
|
+
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
8690
|
+
if (position === "left" || position === "right") {
|
|
8691
|
+
return {
|
|
8692
|
+
left: triggerRect.left + (position === "left" ? 0 : triggerRect.width),
|
|
8693
|
+
top: triggerRect.top + triggerRect.height / 2
|
|
8694
|
+
};
|
|
8695
|
+
}
|
|
8696
|
+
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
8697
|
+
const centered = triggerRect.left + triggerRect.width / 2 - popoverWidth / 2;
|
|
8698
|
+
const maxLeft = viewportWidth - popoverWidth - VIEWPORT_EDGE_PADDING;
|
|
8699
|
+
const clamped = Math.max(
|
|
8700
|
+
VIEWPORT_EDGE_PADDING,
|
|
8701
|
+
Math.min(centered, Math.max(VIEWPORT_EDGE_PADDING, maxLeft))
|
|
8702
|
+
);
|
|
8703
|
+
return {
|
|
8704
|
+
left: clamped,
|
|
8705
|
+
top: triggerRect.top + (position === "top" ? 0 : triggerRect.height)
|
|
8706
|
+
};
|
|
8707
|
+
}
|
|
8708
|
+
var positionClasses2, arrowClasses2, VIEWPORT_EDGE_PADDING, Popover;
|
|
8690
8709
|
var init_Popover = __esm({
|
|
8691
8710
|
"components/molecules/Popover.tsx"() {
|
|
8692
8711
|
"use client";
|
|
8693
8712
|
init_Typography();
|
|
8694
8713
|
init_cn();
|
|
8695
8714
|
positionClasses2 = {
|
|
8696
|
-
top: "
|
|
8697
|
-
bottom: "
|
|
8698
|
-
left: "
|
|
8699
|
-
right: "
|
|
8715
|
+
top: "mb-2",
|
|
8716
|
+
bottom: "mt-2",
|
|
8717
|
+
left: "mr-2 -translate-y-1/2",
|
|
8718
|
+
right: "ml-2 -translate-y-1/2"
|
|
8700
8719
|
};
|
|
8701
8720
|
arrowClasses2 = {
|
|
8702
8721
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -8704,6 +8723,7 @@ var init_Popover = __esm({
|
|
|
8704
8723
|
left: "left-full top-1/2 -translate-y-1/2 border-l-white border-t-transparent border-b-transparent border-r-transparent",
|
|
8705
8724
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
8706
8725
|
};
|
|
8726
|
+
VIEWPORT_EDGE_PADDING = 8;
|
|
8707
8727
|
Popover = ({
|
|
8708
8728
|
content,
|
|
8709
8729
|
children,
|
|
@@ -8714,12 +8734,16 @@ var init_Popover = __esm({
|
|
|
8714
8734
|
}) => {
|
|
8715
8735
|
const [isOpen, setIsOpen] = React83.useState(false);
|
|
8716
8736
|
const [triggerRect, setTriggerRect] = React83.useState(null);
|
|
8737
|
+
const [popoverWidth, setPopoverWidth] = React83.useState(0);
|
|
8717
8738
|
const triggerRef = React83.useRef(null);
|
|
8718
8739
|
const popoverRef = React83.useRef(null);
|
|
8719
8740
|
const updatePosition = () => {
|
|
8720
8741
|
if (triggerRef.current) {
|
|
8721
8742
|
setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
8722
8743
|
}
|
|
8744
|
+
if (popoverRef.current) {
|
|
8745
|
+
setPopoverWidth(popoverRef.current.offsetWidth);
|
|
8746
|
+
}
|
|
8723
8747
|
};
|
|
8724
8748
|
const handleOpen = () => {
|
|
8725
8749
|
updatePosition();
|
|
@@ -8738,8 +8762,18 @@ var init_Popover = __esm({
|
|
|
8738
8762
|
React83.useEffect(() => {
|
|
8739
8763
|
if (isOpen) {
|
|
8740
8764
|
updatePosition();
|
|
8765
|
+
} else {
|
|
8766
|
+
setPopoverWidth(0);
|
|
8741
8767
|
}
|
|
8742
8768
|
}, [isOpen]);
|
|
8769
|
+
React83.useLayoutEffect(() => {
|
|
8770
|
+
if (isOpen && popoverRef.current) {
|
|
8771
|
+
const measured = popoverRef.current.offsetWidth;
|
|
8772
|
+
if (measured !== popoverWidth) {
|
|
8773
|
+
setPopoverWidth(measured);
|
|
8774
|
+
}
|
|
8775
|
+
}
|
|
8776
|
+
});
|
|
8743
8777
|
React83.useEffect(() => {
|
|
8744
8778
|
if (trigger !== "click") {
|
|
8745
8779
|
return;
|
|
@@ -8778,10 +8812,7 @@ var init_Popover = __esm({
|
|
|
8778
8812
|
positionClasses2[position],
|
|
8779
8813
|
className
|
|
8780
8814
|
),
|
|
8781
|
-
style:
|
|
8782
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
8783
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2
|
|
8784
|
-
},
|
|
8815
|
+
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
8785
8816
|
role: "dialog",
|
|
8786
8817
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
8787
8818
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -22259,11 +22290,11 @@ function DataGrid({
|
|
|
22259
22290
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
22260
22291
|
const colsClass = cols ? {
|
|
22261
22292
|
1: "grid-cols-1",
|
|
22262
|
-
2: "sm:grid-cols-2",
|
|
22263
|
-
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
22264
|
-
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
22265
|
-
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
|
|
22266
|
-
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
|
|
22293
|
+
2: "sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
22294
|
+
3: "sm:grid-cols-2 lg:grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22295
|
+
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22296
|
+
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22297
|
+
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
22267
22298
|
}[cols] : void 0;
|
|
22268
22299
|
if (isLoading) {
|
|
22269
22300
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
package/dist/runtime/index.js
CHANGED
|
@@ -8180,11 +8180,11 @@ var init_SimpleGrid = __esm({
|
|
|
8180
8180
|
};
|
|
8181
8181
|
colStyles = {
|
|
8182
8182
|
1: "grid-cols-1",
|
|
8183
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
8184
|
-
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
|
|
8185
|
-
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
8186
|
-
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
8187
|
-
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
|
|
8183
|
+
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
8184
|
+
3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8185
|
+
4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8186
|
+
5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
8187
|
+
6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 @max-xl:!grid-cols-4 @max-lg:!grid-cols-3 @max-md:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
8188
8188
|
};
|
|
8189
8189
|
SimpleGrid = ({
|
|
8190
8190
|
minChildWidth = 250,
|
|
@@ -8640,17 +8640,36 @@ var init_Tooltip = __esm({
|
|
|
8640
8640
|
Tooltip.displayName = "Tooltip";
|
|
8641
8641
|
}
|
|
8642
8642
|
});
|
|
8643
|
-
|
|
8643
|
+
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
8644
|
+
if (position === "left" || position === "right") {
|
|
8645
|
+
return {
|
|
8646
|
+
left: triggerRect.left + (position === "left" ? 0 : triggerRect.width),
|
|
8647
|
+
top: triggerRect.top + triggerRect.height / 2
|
|
8648
|
+
};
|
|
8649
|
+
}
|
|
8650
|
+
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
8651
|
+
const centered = triggerRect.left + triggerRect.width / 2 - popoverWidth / 2;
|
|
8652
|
+
const maxLeft = viewportWidth - popoverWidth - VIEWPORT_EDGE_PADDING;
|
|
8653
|
+
const clamped = Math.max(
|
|
8654
|
+
VIEWPORT_EDGE_PADDING,
|
|
8655
|
+
Math.min(centered, Math.max(VIEWPORT_EDGE_PADDING, maxLeft))
|
|
8656
|
+
);
|
|
8657
|
+
return {
|
|
8658
|
+
left: clamped,
|
|
8659
|
+
top: triggerRect.top + (position === "top" ? 0 : triggerRect.height)
|
|
8660
|
+
};
|
|
8661
|
+
}
|
|
8662
|
+
var positionClasses2, arrowClasses2, VIEWPORT_EDGE_PADDING, Popover;
|
|
8644
8663
|
var init_Popover = __esm({
|
|
8645
8664
|
"components/molecules/Popover.tsx"() {
|
|
8646
8665
|
"use client";
|
|
8647
8666
|
init_Typography();
|
|
8648
8667
|
init_cn();
|
|
8649
8668
|
positionClasses2 = {
|
|
8650
|
-
top: "
|
|
8651
|
-
bottom: "
|
|
8652
|
-
left: "
|
|
8653
|
-
right: "
|
|
8669
|
+
top: "mb-2",
|
|
8670
|
+
bottom: "mt-2",
|
|
8671
|
+
left: "mr-2 -translate-y-1/2",
|
|
8672
|
+
right: "ml-2 -translate-y-1/2"
|
|
8654
8673
|
};
|
|
8655
8674
|
arrowClasses2 = {
|
|
8656
8675
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
@@ -8658,6 +8677,7 @@ var init_Popover = __esm({
|
|
|
8658
8677
|
left: "left-full top-1/2 -translate-y-1/2 border-l-white border-t-transparent border-b-transparent border-r-transparent",
|
|
8659
8678
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
8660
8679
|
};
|
|
8680
|
+
VIEWPORT_EDGE_PADDING = 8;
|
|
8661
8681
|
Popover = ({
|
|
8662
8682
|
content,
|
|
8663
8683
|
children,
|
|
@@ -8668,12 +8688,16 @@ var init_Popover = __esm({
|
|
|
8668
8688
|
}) => {
|
|
8669
8689
|
const [isOpen, setIsOpen] = useState(false);
|
|
8670
8690
|
const [triggerRect, setTriggerRect] = useState(null);
|
|
8691
|
+
const [popoverWidth, setPopoverWidth] = useState(0);
|
|
8671
8692
|
const triggerRef = useRef(null);
|
|
8672
8693
|
const popoverRef = useRef(null);
|
|
8673
8694
|
const updatePosition = () => {
|
|
8674
8695
|
if (triggerRef.current) {
|
|
8675
8696
|
setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
8676
8697
|
}
|
|
8698
|
+
if (popoverRef.current) {
|
|
8699
|
+
setPopoverWidth(popoverRef.current.offsetWidth);
|
|
8700
|
+
}
|
|
8677
8701
|
};
|
|
8678
8702
|
const handleOpen = () => {
|
|
8679
8703
|
updatePosition();
|
|
@@ -8692,8 +8716,18 @@ var init_Popover = __esm({
|
|
|
8692
8716
|
useEffect(() => {
|
|
8693
8717
|
if (isOpen) {
|
|
8694
8718
|
updatePosition();
|
|
8719
|
+
} else {
|
|
8720
|
+
setPopoverWidth(0);
|
|
8695
8721
|
}
|
|
8696
8722
|
}, [isOpen]);
|
|
8723
|
+
useLayoutEffect(() => {
|
|
8724
|
+
if (isOpen && popoverRef.current) {
|
|
8725
|
+
const measured = popoverRef.current.offsetWidth;
|
|
8726
|
+
if (measured !== popoverWidth) {
|
|
8727
|
+
setPopoverWidth(measured);
|
|
8728
|
+
}
|
|
8729
|
+
}
|
|
8730
|
+
});
|
|
8697
8731
|
useEffect(() => {
|
|
8698
8732
|
if (trigger !== "click") {
|
|
8699
8733
|
return;
|
|
@@ -8732,10 +8766,7 @@ var init_Popover = __esm({
|
|
|
8732
8766
|
positionClasses2[position],
|
|
8733
8767
|
className
|
|
8734
8768
|
),
|
|
8735
|
-
style:
|
|
8736
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
8737
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2
|
|
8738
|
-
},
|
|
8769
|
+
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
8739
8770
|
role: "dialog",
|
|
8740
8771
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
8741
8772
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -22213,11 +22244,11 @@ function DataGrid({
|
|
|
22213
22244
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
22214
22245
|
const colsClass = cols ? {
|
|
22215
22246
|
1: "grid-cols-1",
|
|
22216
|
-
2: "sm:grid-cols-2",
|
|
22217
|
-
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
22218
|
-
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
22219
|
-
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
|
|
22220
|
-
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
|
|
22247
|
+
2: "sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
22248
|
+
3: "sm:grid-cols-2 lg:grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22249
|
+
4: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22250
|
+
5: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1",
|
|
22251
|
+
6: "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 @max-xl:!grid-cols-3 @max-lg:!grid-cols-2 @max-sm:!grid-cols-1"
|
|
22221
22252
|
}[cols] : void 0;
|
|
22222
22253
|
if (isLoading) {
|
|
22223
22254
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|