@almadar/ui 5.21.11 → 5.21.12
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 +20 -7
- package/dist/avl/index.js +20 -7
- package/dist/components/index.cjs +20 -7
- package/dist/components/index.js +20 -7
- package/dist/providers/index.cjs +20 -7
- package/dist/providers/index.js +20 -7
- package/dist/runtime/index.cjs +20 -7
- package/dist/runtime/index.js +20 -7
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -13675,7 +13675,7 @@ var init_Menu = __esm({
|
|
|
13675
13675
|
className
|
|
13676
13676
|
}) => {
|
|
13677
13677
|
const eventBus = useEventBus();
|
|
13678
|
-
const { t } = hooks.useTranslate();
|
|
13678
|
+
const { t, direction } = hooks.useTranslate();
|
|
13679
13679
|
const [isOpen, setIsOpen] = React97.useState(false);
|
|
13680
13680
|
const [activeSubMenu, setActiveSubMenu] = React97.useState(null);
|
|
13681
13681
|
const [triggerRect, setTriggerRect] = React97.useState(null);
|
|
@@ -13729,6 +13729,18 @@ var init_Menu = __esm({
|
|
|
13729
13729
|
"bottom-start": "top-full left-0 mt-2",
|
|
13730
13730
|
"bottom-end": "top-full right-0 mt-2"
|
|
13731
13731
|
};
|
|
13732
|
+
const rtlMirror = {
|
|
13733
|
+
"top-left": "top-right",
|
|
13734
|
+
"top-right": "top-left",
|
|
13735
|
+
"bottom-left": "bottom-right",
|
|
13736
|
+
"bottom-right": "bottom-left",
|
|
13737
|
+
"top-start": "top-end",
|
|
13738
|
+
"top-end": "top-start",
|
|
13739
|
+
"bottom-start": "bottom-end",
|
|
13740
|
+
"bottom-end": "bottom-start"
|
|
13741
|
+
};
|
|
13742
|
+
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
13743
|
+
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
13732
13744
|
const triggerChild = React97__namespace.default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
13733
13745
|
const triggerElement = React97__namespace.default.cloneElement(
|
|
13734
13746
|
triggerChild,
|
|
@@ -13756,7 +13768,7 @@ var init_Menu = __esm({
|
|
|
13756
13768
|
onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
|
|
13757
13769
|
"data-testid": item.event ? `action-${item.event}` : void 0,
|
|
13758
13770
|
className: cn(
|
|
13759
|
-
"w-full flex items-center justify-between gap-3 px-4 py-2 text-
|
|
13771
|
+
"w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
|
|
13760
13772
|
"text-sm transition-colors",
|
|
13761
13773
|
"hover:bg-muted",
|
|
13762
13774
|
"focus:outline-none focus:bg-muted",
|
|
@@ -13775,7 +13787,7 @@ var init_Menu = __esm({
|
|
|
13775
13787
|
}
|
|
13776
13788
|
),
|
|
13777
13789
|
item.badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", size: "sm", children: item.badge }),
|
|
13778
|
-
hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
13790
|
+
hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
13779
13791
|
] })
|
|
13780
13792
|
},
|
|
13781
13793
|
itemId
|
|
@@ -13795,7 +13807,8 @@ var init_Menu = __esm({
|
|
|
13795
13807
|
Box,
|
|
13796
13808
|
{
|
|
13797
13809
|
className: cn(
|
|
13798
|
-
"absolute
|
|
13810
|
+
"absolute top-0 z-50",
|
|
13811
|
+
subMenuSideClass,
|
|
13799
13812
|
menuContainerStyles
|
|
13800
13813
|
),
|
|
13801
13814
|
children: renderMenuItems(item.subMenu)
|
|
@@ -13813,12 +13826,12 @@ var init_Menu = __esm({
|
|
|
13813
13826
|
className: cn(
|
|
13814
13827
|
"absolute z-50",
|
|
13815
13828
|
menuContainerStyles,
|
|
13816
|
-
positionClasses3[
|
|
13829
|
+
positionClasses3[effectivePosition],
|
|
13817
13830
|
className
|
|
13818
13831
|
),
|
|
13819
13832
|
style: {
|
|
13820
|
-
left:
|
|
13821
|
-
right:
|
|
13833
|
+
left: effectivePosition.includes("left") ? 0 : "auto",
|
|
13834
|
+
right: effectivePosition.includes("right") ? 0 : "auto"
|
|
13822
13835
|
},
|
|
13823
13836
|
role: "menu",
|
|
13824
13837
|
children: renderMenuItems(items)
|
package/dist/avl/index.js
CHANGED
|
@@ -13626,7 +13626,7 @@ var init_Menu = __esm({
|
|
|
13626
13626
|
className
|
|
13627
13627
|
}) => {
|
|
13628
13628
|
const eventBus = useEventBus();
|
|
13629
|
-
const { t } = useTranslate();
|
|
13629
|
+
const { t, direction } = useTranslate();
|
|
13630
13630
|
const [isOpen, setIsOpen] = useState(false);
|
|
13631
13631
|
const [activeSubMenu, setActiveSubMenu] = useState(null);
|
|
13632
13632
|
const [triggerRect, setTriggerRect] = useState(null);
|
|
@@ -13680,6 +13680,18 @@ var init_Menu = __esm({
|
|
|
13680
13680
|
"bottom-start": "top-full left-0 mt-2",
|
|
13681
13681
|
"bottom-end": "top-full right-0 mt-2"
|
|
13682
13682
|
};
|
|
13683
|
+
const rtlMirror = {
|
|
13684
|
+
"top-left": "top-right",
|
|
13685
|
+
"top-right": "top-left",
|
|
13686
|
+
"bottom-left": "bottom-right",
|
|
13687
|
+
"bottom-right": "bottom-left",
|
|
13688
|
+
"top-start": "top-end",
|
|
13689
|
+
"top-end": "top-start",
|
|
13690
|
+
"bottom-start": "bottom-end",
|
|
13691
|
+
"bottom-end": "bottom-start"
|
|
13692
|
+
};
|
|
13693
|
+
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
13694
|
+
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
13683
13695
|
const triggerChild = React97__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
13684
13696
|
const triggerElement = React97__default.cloneElement(
|
|
13685
13697
|
triggerChild,
|
|
@@ -13707,7 +13719,7 @@ var init_Menu = __esm({
|
|
|
13707
13719
|
onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
|
|
13708
13720
|
"data-testid": item.event ? `action-${item.event}` : void 0,
|
|
13709
13721
|
className: cn(
|
|
13710
|
-
"w-full flex items-center justify-between gap-3 px-4 py-2 text-
|
|
13722
|
+
"w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
|
|
13711
13723
|
"text-sm transition-colors",
|
|
13712
13724
|
"hover:bg-muted",
|
|
13713
13725
|
"focus:outline-none focus:bg-muted",
|
|
@@ -13726,7 +13738,7 @@ var init_Menu = __esm({
|
|
|
13726
13738
|
}
|
|
13727
13739
|
),
|
|
13728
13740
|
item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge }),
|
|
13729
|
-
hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
13741
|
+
hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
13730
13742
|
] })
|
|
13731
13743
|
},
|
|
13732
13744
|
itemId
|
|
@@ -13746,7 +13758,8 @@ var init_Menu = __esm({
|
|
|
13746
13758
|
Box,
|
|
13747
13759
|
{
|
|
13748
13760
|
className: cn(
|
|
13749
|
-
"absolute
|
|
13761
|
+
"absolute top-0 z-50",
|
|
13762
|
+
subMenuSideClass,
|
|
13750
13763
|
menuContainerStyles
|
|
13751
13764
|
),
|
|
13752
13765
|
children: renderMenuItems(item.subMenu)
|
|
@@ -13764,12 +13777,12 @@ var init_Menu = __esm({
|
|
|
13764
13777
|
className: cn(
|
|
13765
13778
|
"absolute z-50",
|
|
13766
13779
|
menuContainerStyles,
|
|
13767
|
-
positionClasses3[
|
|
13780
|
+
positionClasses3[effectivePosition],
|
|
13768
13781
|
className
|
|
13769
13782
|
),
|
|
13770
13783
|
style: {
|
|
13771
|
-
left:
|
|
13772
|
-
right:
|
|
13784
|
+
left: effectivePosition.includes("left") ? 0 : "auto",
|
|
13785
|
+
right: effectivePosition.includes("right") ? 0 : "auto"
|
|
13773
13786
|
},
|
|
13774
13787
|
role: "menu",
|
|
13775
13788
|
children: renderMenuItems(items)
|
|
@@ -8124,7 +8124,7 @@ var init_Menu = __esm({
|
|
|
8124
8124
|
className
|
|
8125
8125
|
}) => {
|
|
8126
8126
|
const eventBus = useEventBus();
|
|
8127
|
-
const { t } = hooks.useTranslate();
|
|
8127
|
+
const { t, direction } = hooks.useTranslate();
|
|
8128
8128
|
const [isOpen, setIsOpen] = React79.useState(false);
|
|
8129
8129
|
const [activeSubMenu, setActiveSubMenu] = React79.useState(null);
|
|
8130
8130
|
const [triggerRect, setTriggerRect] = React79.useState(null);
|
|
@@ -8178,6 +8178,18 @@ var init_Menu = __esm({
|
|
|
8178
8178
|
"bottom-start": "top-full left-0 mt-2",
|
|
8179
8179
|
"bottom-end": "top-full right-0 mt-2"
|
|
8180
8180
|
};
|
|
8181
|
+
const rtlMirror = {
|
|
8182
|
+
"top-left": "top-right",
|
|
8183
|
+
"top-right": "top-left",
|
|
8184
|
+
"bottom-left": "bottom-right",
|
|
8185
|
+
"bottom-right": "bottom-left",
|
|
8186
|
+
"top-start": "top-end",
|
|
8187
|
+
"top-end": "top-start",
|
|
8188
|
+
"bottom-start": "bottom-end",
|
|
8189
|
+
"bottom-end": "bottom-start"
|
|
8190
|
+
};
|
|
8191
|
+
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
8192
|
+
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
8181
8193
|
const triggerChild = React79__namespace.default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", as: "span", children: trigger });
|
|
8182
8194
|
const triggerElement = React79__namespace.default.cloneElement(
|
|
8183
8195
|
triggerChild,
|
|
@@ -8205,7 +8217,7 @@ var init_Menu = __esm({
|
|
|
8205
8217
|
onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
|
|
8206
8218
|
"data-testid": item.event ? `action-${item.event}` : void 0,
|
|
8207
8219
|
className: cn(
|
|
8208
|
-
"w-full flex items-center justify-between gap-3 px-4 py-2 text-
|
|
8220
|
+
"w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
|
|
8209
8221
|
"text-sm transition-colors",
|
|
8210
8222
|
"hover:bg-muted",
|
|
8211
8223
|
"focus:outline-none focus:bg-muted",
|
|
@@ -8224,7 +8236,7 @@ var init_Menu = __esm({
|
|
|
8224
8236
|
}
|
|
8225
8237
|
),
|
|
8226
8238
|
item.badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: "default", size: "sm", children: item.badge }),
|
|
8227
|
-
hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
8239
|
+
hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
8228
8240
|
] })
|
|
8229
8241
|
},
|
|
8230
8242
|
itemId
|
|
@@ -8244,7 +8256,8 @@ var init_Menu = __esm({
|
|
|
8244
8256
|
exports.Box,
|
|
8245
8257
|
{
|
|
8246
8258
|
className: cn(
|
|
8247
|
-
"absolute
|
|
8259
|
+
"absolute top-0 z-50",
|
|
8260
|
+
subMenuSideClass,
|
|
8248
8261
|
menuContainerStyles
|
|
8249
8262
|
),
|
|
8250
8263
|
children: renderMenuItems(item.subMenu)
|
|
@@ -8262,12 +8275,12 @@ var init_Menu = __esm({
|
|
|
8262
8275
|
className: cn(
|
|
8263
8276
|
"absolute z-50",
|
|
8264
8277
|
menuContainerStyles,
|
|
8265
|
-
positionClasses3[
|
|
8278
|
+
positionClasses3[effectivePosition],
|
|
8266
8279
|
className
|
|
8267
8280
|
),
|
|
8268
8281
|
style: {
|
|
8269
|
-
left:
|
|
8270
|
-
right:
|
|
8282
|
+
left: effectivePosition.includes("left") ? 0 : "auto",
|
|
8283
|
+
right: effectivePosition.includes("right") ? 0 : "auto"
|
|
8271
8284
|
},
|
|
8272
8285
|
role: "menu",
|
|
8273
8286
|
children: renderMenuItems(items)
|
package/dist/components/index.js
CHANGED
|
@@ -8076,7 +8076,7 @@ var init_Menu = __esm({
|
|
|
8076
8076
|
className
|
|
8077
8077
|
}) => {
|
|
8078
8078
|
const eventBus = useEventBus();
|
|
8079
|
-
const { t } = useTranslate();
|
|
8079
|
+
const { t, direction } = useTranslate();
|
|
8080
8080
|
const [isOpen, setIsOpen] = useState(false);
|
|
8081
8081
|
const [activeSubMenu, setActiveSubMenu] = useState(null);
|
|
8082
8082
|
const [triggerRect, setTriggerRect] = useState(null);
|
|
@@ -8130,6 +8130,18 @@ var init_Menu = __esm({
|
|
|
8130
8130
|
"bottom-start": "top-full left-0 mt-2",
|
|
8131
8131
|
"bottom-end": "top-full right-0 mt-2"
|
|
8132
8132
|
};
|
|
8133
|
+
const rtlMirror = {
|
|
8134
|
+
"top-left": "top-right",
|
|
8135
|
+
"top-right": "top-left",
|
|
8136
|
+
"bottom-left": "bottom-right",
|
|
8137
|
+
"bottom-right": "bottom-left",
|
|
8138
|
+
"top-start": "top-end",
|
|
8139
|
+
"top-end": "top-start",
|
|
8140
|
+
"bottom-start": "bottom-end",
|
|
8141
|
+
"bottom-end": "bottom-start"
|
|
8142
|
+
};
|
|
8143
|
+
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
8144
|
+
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
8133
8145
|
const triggerChild = React79__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
8134
8146
|
const triggerElement = React79__default.cloneElement(
|
|
8135
8147
|
triggerChild,
|
|
@@ -8157,7 +8169,7 @@ var init_Menu = __esm({
|
|
|
8157
8169
|
onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
|
|
8158
8170
|
"data-testid": item.event ? `action-${item.event}` : void 0,
|
|
8159
8171
|
className: cn(
|
|
8160
|
-
"w-full flex items-center justify-between gap-3 px-4 py-2 text-
|
|
8172
|
+
"w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
|
|
8161
8173
|
"text-sm transition-colors",
|
|
8162
8174
|
"hover:bg-muted",
|
|
8163
8175
|
"focus:outline-none focus:bg-muted",
|
|
@@ -8176,7 +8188,7 @@ var init_Menu = __esm({
|
|
|
8176
8188
|
}
|
|
8177
8189
|
),
|
|
8178
8190
|
item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge }),
|
|
8179
|
-
hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
8191
|
+
hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
8180
8192
|
] })
|
|
8181
8193
|
},
|
|
8182
8194
|
itemId
|
|
@@ -8196,7 +8208,8 @@ var init_Menu = __esm({
|
|
|
8196
8208
|
Box,
|
|
8197
8209
|
{
|
|
8198
8210
|
className: cn(
|
|
8199
|
-
"absolute
|
|
8211
|
+
"absolute top-0 z-50",
|
|
8212
|
+
subMenuSideClass,
|
|
8200
8213
|
menuContainerStyles
|
|
8201
8214
|
),
|
|
8202
8215
|
children: renderMenuItems(item.subMenu)
|
|
@@ -8214,12 +8227,12 @@ var init_Menu = __esm({
|
|
|
8214
8227
|
className: cn(
|
|
8215
8228
|
"absolute z-50",
|
|
8216
8229
|
menuContainerStyles,
|
|
8217
|
-
positionClasses3[
|
|
8230
|
+
positionClasses3[effectivePosition],
|
|
8218
8231
|
className
|
|
8219
8232
|
),
|
|
8220
8233
|
style: {
|
|
8221
|
-
left:
|
|
8222
|
-
right:
|
|
8234
|
+
left: effectivePosition.includes("left") ? 0 : "auto",
|
|
8235
|
+
right: effectivePosition.includes("right") ? 0 : "auto"
|
|
8223
8236
|
},
|
|
8224
8237
|
role: "menu",
|
|
8225
8238
|
children: renderMenuItems(items)
|
package/dist/providers/index.cjs
CHANGED
|
@@ -9703,7 +9703,7 @@ var init_Menu = __esm({
|
|
|
9703
9703
|
className
|
|
9704
9704
|
}) => {
|
|
9705
9705
|
const eventBus = useEventBus();
|
|
9706
|
-
const { t } = hooks.useTranslate();
|
|
9706
|
+
const { t, direction } = hooks.useTranslate();
|
|
9707
9707
|
const [isOpen, setIsOpen] = React85.useState(false);
|
|
9708
9708
|
const [activeSubMenu, setActiveSubMenu] = React85.useState(null);
|
|
9709
9709
|
const [triggerRect, setTriggerRect] = React85.useState(null);
|
|
@@ -9757,6 +9757,18 @@ var init_Menu = __esm({
|
|
|
9757
9757
|
"bottom-start": "top-full left-0 mt-2",
|
|
9758
9758
|
"bottom-end": "top-full right-0 mt-2"
|
|
9759
9759
|
};
|
|
9760
|
+
const rtlMirror = {
|
|
9761
|
+
"top-left": "top-right",
|
|
9762
|
+
"top-right": "top-left",
|
|
9763
|
+
"bottom-left": "bottom-right",
|
|
9764
|
+
"bottom-right": "bottom-left",
|
|
9765
|
+
"top-start": "top-end",
|
|
9766
|
+
"top-end": "top-start",
|
|
9767
|
+
"bottom-start": "bottom-end",
|
|
9768
|
+
"bottom-end": "bottom-start"
|
|
9769
|
+
};
|
|
9770
|
+
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
9771
|
+
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
9760
9772
|
const triggerChild = React85__namespace.default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
9761
9773
|
const triggerElement = React85__namespace.default.cloneElement(
|
|
9762
9774
|
triggerChild,
|
|
@@ -9784,7 +9796,7 @@ var init_Menu = __esm({
|
|
|
9784
9796
|
onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
|
|
9785
9797
|
"data-testid": item.event ? `action-${item.event}` : void 0,
|
|
9786
9798
|
className: cn(
|
|
9787
|
-
"w-full flex items-center justify-between gap-3 px-4 py-2 text-
|
|
9799
|
+
"w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
|
|
9788
9800
|
"text-sm transition-colors",
|
|
9789
9801
|
"hover:bg-muted",
|
|
9790
9802
|
"focus:outline-none focus:bg-muted",
|
|
@@ -9803,7 +9815,7 @@ var init_Menu = __esm({
|
|
|
9803
9815
|
}
|
|
9804
9816
|
),
|
|
9805
9817
|
item.badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", size: "sm", children: item.badge }),
|
|
9806
|
-
hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
9818
|
+
hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
9807
9819
|
] })
|
|
9808
9820
|
},
|
|
9809
9821
|
itemId
|
|
@@ -9823,7 +9835,8 @@ var init_Menu = __esm({
|
|
|
9823
9835
|
Box,
|
|
9824
9836
|
{
|
|
9825
9837
|
className: cn(
|
|
9826
|
-
"absolute
|
|
9838
|
+
"absolute top-0 z-50",
|
|
9839
|
+
subMenuSideClass,
|
|
9827
9840
|
menuContainerStyles
|
|
9828
9841
|
),
|
|
9829
9842
|
children: renderMenuItems(item.subMenu)
|
|
@@ -9841,12 +9854,12 @@ var init_Menu = __esm({
|
|
|
9841
9854
|
className: cn(
|
|
9842
9855
|
"absolute z-50",
|
|
9843
9856
|
menuContainerStyles,
|
|
9844
|
-
positionClasses3[
|
|
9857
|
+
positionClasses3[effectivePosition],
|
|
9845
9858
|
className
|
|
9846
9859
|
),
|
|
9847
9860
|
style: {
|
|
9848
|
-
left:
|
|
9849
|
-
right:
|
|
9861
|
+
left: effectivePosition.includes("left") ? 0 : "auto",
|
|
9862
|
+
right: effectivePosition.includes("right") ? 0 : "auto"
|
|
9850
9863
|
},
|
|
9851
9864
|
role: "menu",
|
|
9852
9865
|
children: renderMenuItems(items)
|
package/dist/providers/index.js
CHANGED
|
@@ -9654,7 +9654,7 @@ var init_Menu = __esm({
|
|
|
9654
9654
|
className
|
|
9655
9655
|
}) => {
|
|
9656
9656
|
const eventBus = useEventBus();
|
|
9657
|
-
const { t } = useTranslate();
|
|
9657
|
+
const { t, direction } = useTranslate();
|
|
9658
9658
|
const [isOpen, setIsOpen] = useState(false);
|
|
9659
9659
|
const [activeSubMenu, setActiveSubMenu] = useState(null);
|
|
9660
9660
|
const [triggerRect, setTriggerRect] = useState(null);
|
|
@@ -9708,6 +9708,18 @@ var init_Menu = __esm({
|
|
|
9708
9708
|
"bottom-start": "top-full left-0 mt-2",
|
|
9709
9709
|
"bottom-end": "top-full right-0 mt-2"
|
|
9710
9710
|
};
|
|
9711
|
+
const rtlMirror = {
|
|
9712
|
+
"top-left": "top-right",
|
|
9713
|
+
"top-right": "top-left",
|
|
9714
|
+
"bottom-left": "bottom-right",
|
|
9715
|
+
"bottom-right": "bottom-left",
|
|
9716
|
+
"top-start": "top-end",
|
|
9717
|
+
"top-end": "top-start",
|
|
9718
|
+
"bottom-start": "bottom-end",
|
|
9719
|
+
"bottom-end": "bottom-start"
|
|
9720
|
+
};
|
|
9721
|
+
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
9722
|
+
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
9711
9723
|
const triggerChild = React85__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
9712
9724
|
const triggerElement = React85__default.cloneElement(
|
|
9713
9725
|
triggerChild,
|
|
@@ -9735,7 +9747,7 @@ var init_Menu = __esm({
|
|
|
9735
9747
|
onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
|
|
9736
9748
|
"data-testid": item.event ? `action-${item.event}` : void 0,
|
|
9737
9749
|
className: cn(
|
|
9738
|
-
"w-full flex items-center justify-between gap-3 px-4 py-2 text-
|
|
9750
|
+
"w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
|
|
9739
9751
|
"text-sm transition-colors",
|
|
9740
9752
|
"hover:bg-muted",
|
|
9741
9753
|
"focus:outline-none focus:bg-muted",
|
|
@@ -9754,7 +9766,7 @@ var init_Menu = __esm({
|
|
|
9754
9766
|
}
|
|
9755
9767
|
),
|
|
9756
9768
|
item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge }),
|
|
9757
|
-
hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
9769
|
+
hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
9758
9770
|
] })
|
|
9759
9771
|
},
|
|
9760
9772
|
itemId
|
|
@@ -9774,7 +9786,8 @@ var init_Menu = __esm({
|
|
|
9774
9786
|
Box,
|
|
9775
9787
|
{
|
|
9776
9788
|
className: cn(
|
|
9777
|
-
"absolute
|
|
9789
|
+
"absolute top-0 z-50",
|
|
9790
|
+
subMenuSideClass,
|
|
9778
9791
|
menuContainerStyles
|
|
9779
9792
|
),
|
|
9780
9793
|
children: renderMenuItems(item.subMenu)
|
|
@@ -9792,12 +9805,12 @@ var init_Menu = __esm({
|
|
|
9792
9805
|
className: cn(
|
|
9793
9806
|
"absolute z-50",
|
|
9794
9807
|
menuContainerStyles,
|
|
9795
|
-
positionClasses3[
|
|
9808
|
+
positionClasses3[effectivePosition],
|
|
9796
9809
|
className
|
|
9797
9810
|
),
|
|
9798
9811
|
style: {
|
|
9799
|
-
left:
|
|
9800
|
-
right:
|
|
9812
|
+
left: effectivePosition.includes("left") ? 0 : "auto",
|
|
9813
|
+
right: effectivePosition.includes("right") ? 0 : "auto"
|
|
9801
9814
|
},
|
|
9802
9815
|
role: "menu",
|
|
9803
9816
|
children: renderMenuItems(items)
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -9258,7 +9258,7 @@ var init_Menu = __esm({
|
|
|
9258
9258
|
className
|
|
9259
9259
|
}) => {
|
|
9260
9260
|
const eventBus = useEventBus();
|
|
9261
|
-
const { t } = hooks.useTranslate();
|
|
9261
|
+
const { t, direction } = hooks.useTranslate();
|
|
9262
9262
|
const [isOpen, setIsOpen] = React84.useState(false);
|
|
9263
9263
|
const [activeSubMenu, setActiveSubMenu] = React84.useState(null);
|
|
9264
9264
|
const [triggerRect, setTriggerRect] = React84.useState(null);
|
|
@@ -9312,6 +9312,18 @@ var init_Menu = __esm({
|
|
|
9312
9312
|
"bottom-start": "top-full left-0 mt-2",
|
|
9313
9313
|
"bottom-end": "top-full right-0 mt-2"
|
|
9314
9314
|
};
|
|
9315
|
+
const rtlMirror = {
|
|
9316
|
+
"top-left": "top-right",
|
|
9317
|
+
"top-right": "top-left",
|
|
9318
|
+
"bottom-left": "bottom-right",
|
|
9319
|
+
"bottom-right": "bottom-left",
|
|
9320
|
+
"top-start": "top-end",
|
|
9321
|
+
"top-end": "top-start",
|
|
9322
|
+
"bottom-start": "bottom-end",
|
|
9323
|
+
"bottom-end": "bottom-start"
|
|
9324
|
+
};
|
|
9325
|
+
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
9326
|
+
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
9315
9327
|
const triggerChild = React84__namespace.default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
9316
9328
|
const triggerElement = React84__namespace.default.cloneElement(
|
|
9317
9329
|
triggerChild,
|
|
@@ -9339,7 +9351,7 @@ var init_Menu = __esm({
|
|
|
9339
9351
|
onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
|
|
9340
9352
|
"data-testid": item.event ? `action-${item.event}` : void 0,
|
|
9341
9353
|
className: cn(
|
|
9342
|
-
"w-full flex items-center justify-between gap-3 px-4 py-2 text-
|
|
9354
|
+
"w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
|
|
9343
9355
|
"text-sm transition-colors",
|
|
9344
9356
|
"hover:bg-muted",
|
|
9345
9357
|
"focus:outline-none focus:bg-muted",
|
|
@@ -9358,7 +9370,7 @@ var init_Menu = __esm({
|
|
|
9358
9370
|
}
|
|
9359
9371
|
),
|
|
9360
9372
|
item.badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", size: "sm", children: item.badge }),
|
|
9361
|
-
hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
9373
|
+
hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
9362
9374
|
] })
|
|
9363
9375
|
},
|
|
9364
9376
|
itemId
|
|
@@ -9378,7 +9390,8 @@ var init_Menu = __esm({
|
|
|
9378
9390
|
Box,
|
|
9379
9391
|
{
|
|
9380
9392
|
className: cn(
|
|
9381
|
-
"absolute
|
|
9393
|
+
"absolute top-0 z-50",
|
|
9394
|
+
subMenuSideClass,
|
|
9382
9395
|
menuContainerStyles
|
|
9383
9396
|
),
|
|
9384
9397
|
children: renderMenuItems(item.subMenu)
|
|
@@ -9396,12 +9409,12 @@ var init_Menu = __esm({
|
|
|
9396
9409
|
className: cn(
|
|
9397
9410
|
"absolute z-50",
|
|
9398
9411
|
menuContainerStyles,
|
|
9399
|
-
positionClasses3[
|
|
9412
|
+
positionClasses3[effectivePosition],
|
|
9400
9413
|
className
|
|
9401
9414
|
),
|
|
9402
9415
|
style: {
|
|
9403
|
-
left:
|
|
9404
|
-
right:
|
|
9416
|
+
left: effectivePosition.includes("left") ? 0 : "auto",
|
|
9417
|
+
right: effectivePosition.includes("right") ? 0 : "auto"
|
|
9405
9418
|
},
|
|
9406
9419
|
role: "menu",
|
|
9407
9420
|
children: renderMenuItems(items)
|
package/dist/runtime/index.js
CHANGED
|
@@ -9209,7 +9209,7 @@ var init_Menu = __esm({
|
|
|
9209
9209
|
className
|
|
9210
9210
|
}) => {
|
|
9211
9211
|
const eventBus = useEventBus();
|
|
9212
|
-
const { t } = useTranslate();
|
|
9212
|
+
const { t, direction } = useTranslate();
|
|
9213
9213
|
const [isOpen, setIsOpen] = useState(false);
|
|
9214
9214
|
const [activeSubMenu, setActiveSubMenu] = useState(null);
|
|
9215
9215
|
const [triggerRect, setTriggerRect] = useState(null);
|
|
@@ -9263,6 +9263,18 @@ var init_Menu = __esm({
|
|
|
9263
9263
|
"bottom-start": "top-full left-0 mt-2",
|
|
9264
9264
|
"bottom-end": "top-full right-0 mt-2"
|
|
9265
9265
|
};
|
|
9266
|
+
const rtlMirror = {
|
|
9267
|
+
"top-left": "top-right",
|
|
9268
|
+
"top-right": "top-left",
|
|
9269
|
+
"bottom-left": "bottom-right",
|
|
9270
|
+
"bottom-right": "bottom-left",
|
|
9271
|
+
"top-start": "top-end",
|
|
9272
|
+
"top-end": "top-start",
|
|
9273
|
+
"bottom-start": "bottom-end",
|
|
9274
|
+
"bottom-end": "bottom-start"
|
|
9275
|
+
};
|
|
9276
|
+
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
9277
|
+
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
9266
9278
|
const triggerChild = React84__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
9267
9279
|
const triggerElement = React84__default.cloneElement(
|
|
9268
9280
|
triggerChild,
|
|
@@ -9290,7 +9302,7 @@ var init_Menu = __esm({
|
|
|
9290
9302
|
onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
|
|
9291
9303
|
"data-testid": item.event ? `action-${item.event}` : void 0,
|
|
9292
9304
|
className: cn(
|
|
9293
|
-
"w-full flex items-center justify-between gap-3 px-4 py-2 text-
|
|
9305
|
+
"w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
|
|
9294
9306
|
"text-sm transition-colors",
|
|
9295
9307
|
"hover:bg-muted",
|
|
9296
9308
|
"focus:outline-none focus:bg-muted",
|
|
@@ -9309,7 +9321,7 @@ var init_Menu = __esm({
|
|
|
9309
9321
|
}
|
|
9310
9322
|
),
|
|
9311
9323
|
item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge }),
|
|
9312
|
-
hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
9324
|
+
hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
|
|
9313
9325
|
] })
|
|
9314
9326
|
},
|
|
9315
9327
|
itemId
|
|
@@ -9329,7 +9341,8 @@ var init_Menu = __esm({
|
|
|
9329
9341
|
Box,
|
|
9330
9342
|
{
|
|
9331
9343
|
className: cn(
|
|
9332
|
-
"absolute
|
|
9344
|
+
"absolute top-0 z-50",
|
|
9345
|
+
subMenuSideClass,
|
|
9333
9346
|
menuContainerStyles
|
|
9334
9347
|
),
|
|
9335
9348
|
children: renderMenuItems(item.subMenu)
|
|
@@ -9347,12 +9360,12 @@ var init_Menu = __esm({
|
|
|
9347
9360
|
className: cn(
|
|
9348
9361
|
"absolute z-50",
|
|
9349
9362
|
menuContainerStyles,
|
|
9350
|
-
positionClasses3[
|
|
9363
|
+
positionClasses3[effectivePosition],
|
|
9351
9364
|
className
|
|
9352
9365
|
),
|
|
9353
9366
|
style: {
|
|
9354
|
-
left:
|
|
9355
|
-
right:
|
|
9367
|
+
left: effectivePosition.includes("left") ? 0 : "auto",
|
|
9368
|
+
right: effectivePosition.includes("right") ? 0 : "auto"
|
|
9356
9369
|
},
|
|
9357
9370
|
role: "menu",
|
|
9358
9371
|
children: renderMenuItems(items)
|