@sudobility/components 2.0.3 → 2.0.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/index.esm.js +23 -28
- package/dist/index.umd.js +2 -2
- package/dist/ui/dropdown.d.ts +1 -0
- package/dist/ui/dropdown.d.ts.map +1 -1
- package/package.json +39 -61
package/dist/index.esm.js
CHANGED
|
@@ -2609,8 +2609,9 @@ const h = {
|
|
|
2609
2609
|
// Dropdown menus
|
|
2610
2610
|
dropdown: {
|
|
2611
2611
|
container: () => "relative inline-block",
|
|
2612
|
-
trigger: () => "inline-flex justify-center items-center bg-
|
|
2613
|
-
|
|
2612
|
+
trigger: () => "inline-flex justify-center items-center bg-transparent border-0 text-gray-900 dark:text-gray-100 focus:outline-none transition-colors",
|
|
2613
|
+
triggerBordered: () => "inline-flex justify-center items-center bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-950 transition-colors",
|
|
2614
|
+
menu: () => "absolute z-50 w-56 bg-white dark:bg-gray-800 rounded-md shadow-lg focus:outline-none transition-all duration-200",
|
|
2614
2615
|
menuSmall: () => "w-40",
|
|
2615
2616
|
menuLarge: () => "w-72",
|
|
2616
2617
|
menuAuto: () => "w-auto min-w-40",
|
|
@@ -5823,56 +5824,50 @@ const ra = {
|
|
|
5823
5824
|
trigger: t,
|
|
5824
5825
|
items: e,
|
|
5825
5826
|
align: r = "right",
|
|
5826
|
-
className: a = ""
|
|
5827
|
+
className: a = "",
|
|
5828
|
+
variant: o = "default"
|
|
5827
5829
|
}) => {
|
|
5828
|
-
const [
|
|
5829
|
-
Hr(
|
|
5830
|
-
const
|
|
5831
|
-
|
|
5832
|
-
},
|
|
5830
|
+
const [i, l] = E(!1), s = k.useRef(null);
|
|
5831
|
+
Hr(s, () => l(!1));
|
|
5832
|
+
const d = (b) => {
|
|
5833
|
+
b.disabled || (b.onClick(), l(!1));
|
|
5834
|
+
}, g = r === "left" ? v.overlays.dropdown.menuRight() : v.overlays.dropdown.menuLeft(), m = o === "bordered" ? v.overlays.dropdown.triggerBordered() : v.overlays.dropdown.trigger();
|
|
5833
5835
|
return /* @__PURE__ */ u(
|
|
5834
5836
|
"div",
|
|
5835
5837
|
{
|
|
5836
5838
|
className: `${v.overlays.dropdown.container()} ${a}`,
|
|
5837
|
-
ref:
|
|
5839
|
+
ref: s,
|
|
5838
5840
|
children: [
|
|
5839
|
-
/* @__PURE__ */ n(
|
|
5840
|
-
|
|
5841
|
-
{
|
|
5842
|
-
className: v.overlays.dropdown.trigger(),
|
|
5843
|
-
onClick: () => i(!o),
|
|
5844
|
-
children: t
|
|
5845
|
-
}
|
|
5846
|
-
),
|
|
5847
|
-
o && /* @__PURE__ */ n(
|
|
5841
|
+
/* @__PURE__ */ n("div", { className: m, onClick: () => l(!i), children: t }),
|
|
5842
|
+
i && /* @__PURE__ */ n(
|
|
5848
5843
|
"div",
|
|
5849
5844
|
{
|
|
5850
|
-
className: `${v.overlays.dropdown.menu()} ${
|
|
5845
|
+
className: `${v.overlays.dropdown.menu()} ${g} ${v.overlays.dropdown.menuBottom()}`,
|
|
5851
5846
|
children: /* @__PURE__ */ n("div", { className: v.overlays.dropdown.itemContainer(), children: e.map(
|
|
5852
|
-
(
|
|
5847
|
+
(b) => b.separator ? /* @__PURE__ */ n(
|
|
5853
5848
|
"div",
|
|
5854
5849
|
{
|
|
5855
5850
|
className: "my-1 h-px bg-gray-200 dark:bg-gray-700",
|
|
5856
5851
|
role: "separator"
|
|
5857
5852
|
},
|
|
5858
|
-
|
|
5853
|
+
b.id
|
|
5859
5854
|
) : /* @__PURE__ */ u(
|
|
5860
5855
|
"button",
|
|
5861
5856
|
{
|
|
5862
|
-
onClick: () =>
|
|
5863
|
-
disabled:
|
|
5864
|
-
className:
|
|
5857
|
+
onClick: () => d(b),
|
|
5858
|
+
disabled: b.disabled,
|
|
5859
|
+
className: b.disabled ? v.overlays.dropdown.itemDisabled() : v.overlays.dropdown.item(),
|
|
5865
5860
|
children: [
|
|
5866
|
-
|
|
5867
|
-
|
|
5861
|
+
b.icon && /* @__PURE__ */ n(
|
|
5862
|
+
b.icon,
|
|
5868
5863
|
{
|
|
5869
5864
|
className: v.overlays.dropdown.itemIcon()
|
|
5870
5865
|
}
|
|
5871
5866
|
),
|
|
5872
|
-
/* @__PURE__ */ n("span", { children:
|
|
5867
|
+
/* @__PURE__ */ n("span", { children: b.label })
|
|
5873
5868
|
]
|
|
5874
5869
|
},
|
|
5875
|
-
|
|
5870
|
+
b.id
|
|
5876
5871
|
)
|
|
5877
5872
|
) })
|
|
5878
5873
|
}
|