@hiver/connector-admin 4.19.0-multiStore-beta.1 → 4.19.0

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/index.es.js CHANGED
@@ -34532,6 +34532,12 @@ const Lb = (e) => {
34532
34532
  MuiButton: {
34533
34533
  styleOverrides: {
34534
34534
  root: {
34535
+ // `createTheme(baseTheme, {...})` can't deep-merge this plain object
34536
+ // into baseTheme's function-based `root` override, so it replaces it
34537
+ // outright — losing the base theme's `textTransform: 'unset'` and
34538
+ // leaving MUI's default `uppercase` (from `typography.button`) in
34539
+ // effect for any Button that doesn't set its own textTransform.
34540
+ textTransform: "unset",
34535
34541
  "&.MuiButton-outlined": {
34536
34542
  color: t.textPrimary,
34537
34543
  borderColor: t.borderStrong,
@@ -38013,7 +38019,7 @@ const AB = S(Dn)`
38013
38019
  `, py = (e) => {
38014
38020
  const { isLoading: t = !1 } = e;
38015
38021
  return t ? /* @__PURE__ */ c.jsx(V, { className: "h-[38px] w-[58px] justify-center items-center", children: /* @__PURE__ */ c.jsx(YK, {}) }) : /* @__PURE__ */ c.jsx(PC, { ...e });
38016
- }, JK = "Add New Store", KK = "Add New Store", XK = "Each instance has its own configuration. Choose a descriptive name to help distinguish it from other instances", qK = "Enter app name", ZK = "App Name", $K = "Submit", eX = "Cancel", tX = (e, t) => `${e}/${t} stores used`, nX = (e) => `${e} added successfully`, cB = {
38022
+ }, JK = "Add store", KK = "Add store", XK = "Choose a unique name for your store.", qK = "e.g. US Store", ZK = "Store name", $K = "Add store", eX = "Cancel", tX = (e) => `You've reached the ${e}-store limit`, nX = (e) => `${e} added successfully`, cB = {
38017
38023
  NAME_TAKEN: "A connector with this name already exists.",
38018
38024
  LIMIT_REACHED: "You've reached the maximum number of stores.",
38019
38025
  MULTI_STORE_DISABLED: "Adding stores isn't available for this app.",
@@ -38076,11 +38082,11 @@ const AB = S(Dn)`
38076
38082
  fontWeight: 500,
38077
38083
  fontSize: "14px",
38078
38084
  lineHeight: "18px",
38079
- padding: "4px 20px",
38080
- borderRadius: 0,
38085
+ padding: "9px 20px",
38086
+ borderRadius: "4px",
38081
38087
  color: ((g = T.palette.gray) == null ? void 0 : g.gray3) ?? "#6F7C90",
38082
38088
  backgroundColor: "transparent",
38083
- "&:hover": { backgroundColor: "transparent", color: ((p = T.palette.gray) == null ? void 0 : p.gray2) ?? "#4D596C" }
38089
+ "&:hover": { color: ((p = T.palette.gray) == null ? void 0 : p.gray2) ?? "#4D596C" }
38084
38090
  },
38085
38091
  children: eX
38086
38092
  }
@@ -38124,37 +38130,37 @@ const AB = S(Dn)`
38124
38130
  const t = aX(e);
38125
38131
  return hy(t ? rX[t] : void 0);
38126
38132
  }, sX = ({ connectorDetails: e }) => {
38127
- const [t, n] = Z(!1), [r, o] = Z(!1), [i, a] = Z(void 0), A = nn(), s = Zn(), l = !!(e != null && e.showAddStore), g = (!!(e != null && e.isStore) ? e == null ? void 0 : e.parentConnectorId : e == null ? void 0 : e.id) ?? "", p = async (v) => {
38133
+ const [t, n] = Z(!1), [r, o] = Z(!1), [i, a] = Z(void 0), A = nn(), s = Zn(), l = !!(e != null && e.showAddStore), g = (!!(e != null && e.isStore) ? e == null ? void 0 : e.parentConnectorId : e == null ? void 0 : e.id) ?? "", p = async (m) => {
38128
38134
  if (!e) return;
38129
38135
  a(void 0), o(!0);
38130
- const y = e.templateId ?? "";
38136
+ const v = e.templateId ?? "";
38131
38137
  try {
38132
- const { valid: b, reason: Q } = await GW({
38133
- templateId: y,
38138
+ const { valid: y, reason: b } = await GW({
38139
+ templateId: v,
38134
38140
  parentConnectorId: g,
38135
- name: v
38141
+ name: m
38136
38142
  });
38137
- if (!b) {
38138
- a(hy(Q)), o(!1);
38143
+ if (!y) {
38144
+ a(hy(b)), o(!1);
38139
38145
  return;
38140
38146
  }
38141
- await WW({ templateId: y, parentConnectorId: g, name: v }), n(!1), Ht({ message: nX(v), type: Mr }), s($i()), A(`${Ue.BASEPATH}${Ue.DASHBOARD}`);
38142
- } catch (b) {
38143
- a(AX(b)), o(!1);
38147
+ await WW({ templateId: v, parentConnectorId: g, name: m }), n(!1), Ht({ message: nX(m), type: Mr }), s($i()), A(`${Ue.BASEPATH}${Ue.DASHBOARD}`);
38148
+ } catch (y) {
38149
+ a(AX(y)), o(!1);
38144
38150
  }
38145
38151
  };
38146
38152
  if (!l)
38147
38153
  return null;
38148
- const h = !!(e != null && e.canAddStore), f = (e == null ? void 0 : e.storesUsed) ?? 0, C = (e == null ? void 0 : e.maxStores) ?? 0, d = (e == null ? void 0 : e.addStoreDisabledMessage) ?? null, B = !h || d !== null, E = B ? d ?? tX(f, C) : "", I = () => {
38154
+ const h = !!(e != null && e.canAddStore), f = (e == null ? void 0 : e.maxStores) ?? 0, C = (e == null ? void 0 : e.addStoreDisabledMessage) ?? null, d = !h || C !== null, B = d ? C ?? tX(f) : "", E = () => {
38149
38155
  a(void 0), n(!0);
38150
- }, m = /* @__PURE__ */ c.jsx(
38156
+ }, I = /* @__PURE__ */ c.jsx(
38151
38157
  it,
38152
38158
  {
38153
38159
  "data-testid": "add-new-store-button",
38154
38160
  variant: "outlined",
38155
38161
  color: "tertiary",
38156
38162
  size: "medium",
38157
- disabled: B,
38163
+ disabled: d,
38158
38164
  sx: {
38159
38165
  height: "32px",
38160
38166
  textTransform: "none",
@@ -38163,16 +38169,16 @@ const AB = S(Dn)`
38163
38169
  color: "#343C45",
38164
38170
  "&:hover": { borderColor: "#D6DDE8" }
38165
38171
  },
38166
- onClick: I,
38172
+ onClick: E,
38167
38173
  children: JK
38168
38174
  }
38169
38175
  );
38170
38176
  return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
38171
- B ? (
38177
+ d ? (
38172
38178
  // MUI Tooltip does not fire on a disabled button; wrap in a span so the
38173
38179
  // usage tooltip still shows on hover.
38174
- /* @__PURE__ */ c.jsx(Ct, { title: E, placement: "bottom", children: /* @__PURE__ */ c.jsx("span", { "data-testid": "add-new-store-button-tooltip-wrapper", children: m }) })
38175
- ) : m,
38180
+ /* @__PURE__ */ c.jsx(Ct, { title: B, placement: "bottom", children: /* @__PURE__ */ c.jsx("span", { "data-testid": "add-new-store-button-tooltip-wrapper", children: I }) })
38181
+ ) : I,
38176
38182
  /* @__PURE__ */ c.jsx("div", { "data-testid": "add-new-store-divider", className: "w-px h-6 bg-[#D6DDE8] mx-2" }),
38177
38183
  /* @__PURE__ */ c.jsx(
38178
38184
  iX,