@cjlapao/ui-kit 0.2.15 → 0.2.17

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.cjs CHANGED
@@ -73880,6 +73880,14 @@ function MenuPopup({ anchor, placement, width, children }) {
73880
73880
 
73881
73881
  // src/components/Menu/Menu.tsx
73882
73882
  var import_jsx_runtime336 = require("react/jsx-runtime");
73883
+ var menuPadding = {
73884
+ none: "p-0",
73885
+ xs: "p-1 sm:p-1.5",
73886
+ sm: "p-2 sm:p-2.5",
73887
+ md: "p-3 sm:p-4",
73888
+ lg: "p-4 sm:p-5",
73889
+ xl: "p-5 sm:p-6"
73890
+ };
73883
73891
  var rowSizes = { xs: "px-2 py-1 text-xs", sm: "px-2.5 py-1.5 text-xs", md: "px-3 py-2 text-sm", lg: "px-4 py-2.5 text-base", xl: "px-5 py-3 text-lg" };
73884
73892
  var text = (item) => item.textValue ?? (typeof item.label === "string" ? item.label : item.id);
73885
73893
  function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount = false, grouped = false }) {
@@ -73984,7 +73992,9 @@ function MenuRow({ item, state, depth }) {
73984
73992
  item.label && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold text-neutral-500 dark:text-neutral-400", children: item.label }),
73985
73993
  item.items && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(MenuList, { items: item.disabled ? item.items.map((child) => ({ ...child, disabled: true })) : item.items, state, depth, parentLabel: label, grouped: true })
73986
73994
  ] });
73987
- const tokens = getSideMenuItemTokens(props.tone ?? "neutral");
73995
+ const itemTone2 = item.tone ?? props.itemTone ?? props.tone ?? "neutral";
73996
+ const itemPadding = item.padding ?? props.itemPadding;
73997
+ const tokens = getSideMenuItemTokens(itemTone2);
73988
73998
  const checkable = item.type === "checkbox" || item.type === "radio";
73989
73999
  const activate = (event) => {
73990
74000
  if (item.disabled) {
@@ -74026,9 +74036,10 @@ function MenuRow({ item, state, depth }) {
74026
74036
  "data-menu-text": label,
74027
74037
  tabIndex: -1,
74028
74038
  className: (0, import_classnames142.default)(
74029
- "flex w-full items-center gap-2 rounded-lg text-left font-medium outline-none transition-colors",
74030
- rowSizes[props.size ?? "md"],
74031
- getSurfaceTriggerTokens(props.tone ?? "neutral").focusRing,
74039
+ "flex w-full items-center gap-2 text-left font-medium outline-none transition-colors",
74040
+ itemPadding === void 0 ? rowSizes[props.size ?? "md"] : [rowSizes[props.size ?? "md"].split(" ").filter((token) => token.startsWith("text-")), menuPadding[itemPadding]],
74041
+ getSurfaceCornerClass(item.corner ?? props.itemCorner ?? "rounded-sm"),
74042
+ getSurfaceTriggerTokens(itemTone2).focusRing,
74032
74043
  item.disabled ? "cursor-not-allowed opacity-40" : item.danger ? "text-rose-700 hover:bg-rose-50 dark:text-rose-300 dark:hover:bg-rose-500/10" : [tokens.hoverBg, tokens.hoverText],
74033
74044
  expanded && !item.disabled && tokens.bg
74034
74045
  ),
@@ -74070,13 +74081,13 @@ function MenuRow({ item, state, depth }) {
74070
74081
  }
74071
74082
  function MenuSurface({ state, children, root = false }) {
74072
74083
  const { props } = state;
74073
- return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { "data-menu-owner": state.owner, onMouseEnter: state.cancelLeave, onMouseLeave: state.scheduleLeave, children: /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)(
74084
+ return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { "data-menu-owner": state.owner, onMouseEnter: state.cancelLeave, onMouseLeave: state.scheduleLeave, children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
74074
74085
  Panel_default,
74075
74086
  {
74076
74087
  variant: props.variant ?? "outlined",
74077
74088
  tone: props.tone ?? "neutral",
74078
74089
  corner: props.corner,
74079
- padding: props.padding ?? "xs",
74090
+ padding: "none",
74080
74091
  glassOpacity: props.glassOpacity,
74081
74092
  vibrancy: props.vibrancy,
74082
74093
  specularMode: props.specularMode,
@@ -74084,11 +74095,11 @@ function MenuSurface({ state, children, root = false }) {
74084
74095
  root ? props.className : void 0,
74085
74096
  (!root || props.popup || props.trigger || props.anchorRef) && "backdrop-blur-xl"
74086
74097
  ),
74087
- children: [
74098
+ children: /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("div", { "data-menu-padding": true, className: menuPadding[props.padding ?? "xs"], children: [
74088
74099
  root && props.header && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "mb-2 border-b border-neutral-200 pb-2 dark:border-white/10", children: props.header }),
74089
74100
  /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: (0, import_classnames142.default)("overflow-auto", THIN_SCROLLBAR), style: { maxHeight: `min(${props.maxHeight ?? 400}px, calc(100dvh - 32px))` }, children }),
74090
74101
  root && props.footer && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "mt-2 border-t border-neutral-200 pt-2 dark:border-white/10", children: props.footer })
74091
- ]
74102
+ ] })
74092
74103
  }
74093
74104
  ) });
74094
74105
  }