propro-common-components 0.1.45 → 0.1.47

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.
@@ -1,7 +1,7 @@
1
1
  import { QueryKey, UseMutationOptions, UseMutationResult } from "@tanstack/react-query";
2
2
  import { AxiosError, AxiosRequestConfig } from "axios";
3
3
  import { ToastOptions } from "react-toastify";
4
- declare const useMutate: <TData = unknown, TError = AxiosError<unknown, any>, TVariables = void, TContext = unknown>({ url, method, headers, invalidateAllQueries, successLog, errorLog, logURL, toastMessage, onSuccess, onError, }: {
4
+ declare const useMutate: <TData = unknown, TError = AxiosError<unknown, any>, TVariables = unknown, TContext = unknown>({ url, method, headers, invalidateAllQueries, successLog, errorLog, logURL, toastMessage, onSuccess, onError, }: {
5
5
  url: string;
6
6
  method: "POST" | "PUT" | "DELETE" | "PATCH";
7
7
  headers?: AxiosRequestConfig["headers"];
@@ -1,4 +1,5 @@
1
- declare const AvatarIcon: ({ width }: {
1
+ declare const AvatarIcon: ({ width, icon, }: {
2
2
  width: number;
3
+ icon?: string | null | undefined;
3
4
  }) => import("react/jsx-runtime").JSX.Element;
4
5
  export default AvatarIcon;
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
5
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
8
  asChild?: boolean;
@@ -25993,11 +25993,14 @@ const AvatarFallback = React.forwardRef(({ className: m, ...g }, b) => /* @__PUR
25993
25993
  }
25994
25994
  ));
25995
25995
  AvatarFallback.displayName = $cddcb0b647441e34$export$fb8d7f40caaeea67.displayName;
25996
- const AvatarIcon = ({ width: m }) => {
25997
- const g = getCookie("account");
25996
+ const AvatarIcon = ({
25997
+ width: m,
25998
+ icon: g
25999
+ }) => {
26000
+ const b = getCookie("account");
25998
26001
  return /* @__PURE__ */ jsxs(Avatar, { style: { width: 4 * m, height: 4 * m }, children: [
25999
- /* @__PURE__ */ jsx$2(AvatarImage, { src: g.avatar }),
26000
- /* @__PURE__ */ jsx$2(AvatarFallback, { style: { fontSize: m * 16 / 12 }, children: makeAvatarFallback(g.name) })
26002
+ /* @__PURE__ */ jsx$2(AvatarImage, { src: g || b.avatar }),
26003
+ /* @__PURE__ */ jsx$2(AvatarFallback, { style: { fontSize: m * 16 / 12 }, children: makeAvatarFallback(b.name) })
26001
26004
  ] });
26002
26005
  }, makeAvatarFallback = (m) => {
26003
26006
  let g;
@@ -29657,7 +29660,7 @@ const useMutate = ({
29657
29660
  theme: "light",
29658
29661
  isLoading: !0,
29659
29662
  autoClose: !1
29660
- })), checkAccessToken(), axios(m, { method: g, data: D, headers: b }).then((B) => B.data)),
29663
+ })), checkAccessToken(), console.log(D, "dnndnd"), axios(m, { method: g, data: D, headers: b }).then((B) => B.data)),
29661
29664
  onSuccess: (D) => {
29662
29665
  x && console.log(x, { res: D }), I && toast.update(id$2, {
29663
29666
  render: I.successMessage,
@@ -29677,19 +29680,22 @@ const useMutate = ({
29677
29680
  ...N
29678
29681
  });
29679
29682
  }, useUpdateAvatar = () => useMutate({
29680
- url: "/api/v1/accounts/avatar",
29683
+ url: `${process.env.AUTH_SERVER_URL}/api/v1/accounts/avatar`,
29681
29684
  method: "POST"
29682
29685
  }), AvatarUpdate = () => {
29683
29686
  const { mutateAsync: m } = useUpdateAvatar();
29684
- return console.log(m), /* @__PURE__ */ jsxs(Fragment$2, { children: [
29687
+ console.log(m);
29688
+ const [g, b] = useState(null);
29689
+ return /* @__PURE__ */ jsxs(Fragment$2, { children: [
29685
29690
  /* @__PURE__ */ jsx$2(
29686
29691
  "input",
29687
29692
  {
29688
29693
  type: "file",
29689
29694
  className: "hidden",
29690
29695
  id: "avatar-input",
29691
- onChange: async (g) => {
29692
- new FormData().append("file", g.target.files[0]);
29696
+ onChange: async (_) => {
29697
+ const x = new FormData();
29698
+ x.append("file", _.target.files[0]), b(URL.createObjectURL(_.target.files[0])), await m(x);
29693
29699
  }
29694
29700
  }
29695
29701
  ),
@@ -29702,7 +29708,7 @@ const useMutate = ({
29702
29708
  className: "absolute m-12 z-30 text-5xl opacity-0 peer-hover:opacity-100 pointer-events-none text-white"
29703
29709
  }
29704
29710
  ),
29705
- /* @__PURE__ */ jsx$2(AvatarIcon, { width: 36 })
29711
+ /* @__PURE__ */ jsx$2(AvatarIcon, { icon: g, width: 36 })
29706
29712
  ] })
29707
29713
  ] });
29708
29714
  }, Input$3 = React.forwardRef(
@@ -37188,7 +37194,7 @@ var parseStyle = function m(g) {
37188
37194
  function uniqueHash(m, g) {
37189
37195
  return murmur2$1("".concat(m.join("%")).concat(g));
37190
37196
  }
37191
- function Empty() {
37197
+ function Empty$1() {
37192
37198
  return null;
37193
37199
  }
37194
37200
  var STYLE_PREFIX = "style";
@@ -37248,7 +37254,7 @@ function useStyleRegister(m, g) {
37248
37254
  return function(be) {
37249
37255
  var ve;
37250
37256
  if (!Z || re || !B)
37251
- ve = /* @__PURE__ */ React.createElement(Empty, null);
37257
+ ve = /* @__PURE__ */ React.createElement(Empty$1, null);
37252
37258
  else {
37253
37259
  var Se;
37254
37260
  ve = /* @__PURE__ */ React.createElement("style", _extends$5({}, (Se = {}, _defineProperty$1(Se, ATTR_TOKEN, me), _defineProperty$1(Se, ATTR_MARK, ye), Se), {
@@ -56681,14 +56687,14 @@ var _propertyDesc = function(m, g) {
56681
56687
  writable: !(m & 4),
56682
56688
  value: g
56683
56689
  };
56684
- }, dP$1 = require_objectDp(), createDesc$2 = _propertyDesc, _hide = require_descriptors() ? function(m, g, b) {
56685
- return dP$1.f(m, g, createDesc$2(1, b));
56690
+ }, dP$2 = require_objectDp(), createDesc$2 = _propertyDesc, _hide = require_descriptors() ? function(m, g, b) {
56691
+ return dP$2.f(m, g, createDesc$2(1, b));
56686
56692
  } : function(m, g, b) {
56687
56693
  return m[g] = b, m;
56688
56694
  }, hasOwnProperty = {}.hasOwnProperty, _has = function(m, g) {
56689
56695
  return hasOwnProperty.call(m, g);
56690
- }, global$4 = _globalExports, core$2 = _coreExports, ctx = _ctx, hide$1 = _hide, has$6 = _has, PROTOTYPE$1 = "prototype", $export$5 = function(m, g, b) {
56691
- var _ = m & $export$5.F, x = m & $export$5.G, C = m & $export$5.S, $ = m & $export$5.P, I = m & $export$5.B, R = m & $export$5.W, P = x ? core$2 : core$2[g] || (core$2[g] = {}), N = P[PROTOTYPE$1], z = x ? global$4 : C ? global$4[g] : (global$4[g] || {})[PROTOTYPE$1], D, B, W;
56696
+ }, global$4 = _globalExports, core$2 = _coreExports, ctx = _ctx, hide$1 = _hide, has$6 = _has, PROTOTYPE$2 = "prototype", $export$5 = function(m, g, b) {
56697
+ var _ = m & $export$5.F, x = m & $export$5.G, C = m & $export$5.S, $ = m & $export$5.P, I = m & $export$5.B, R = m & $export$5.W, P = x ? core$2 : core$2[g] || (core$2[g] = {}), N = P[PROTOTYPE$2], z = x ? global$4 : C ? global$4[g] : (global$4[g] || {})[PROTOTYPE$2], D, B, W;
56692
56698
  x && (b = g);
56693
56699
  for (D in b)
56694
56700
  B = !_ && z && z[D] !== void 0, !(B && has$6(P, D)) && (W = B ? z[D] : b[D], P[D] = x && typeof z[D] != "function" ? b[D] : I && B ? ctx(W, global$4) : R && z[D] == W ? function(V) {
@@ -56706,7 +56712,7 @@ var _propertyDesc = function(m, g) {
56706
56712
  }
56707
56713
  return V.apply(this, arguments);
56708
56714
  };
56709
- return Z[PROTOTYPE$1] = V[PROTOTYPE$1], Z;
56715
+ return Z[PROTOTYPE$2] = V[PROTOTYPE$2], Z;
56710
56716
  }(W) : $ && typeof W == "function" ? ctx(Function.call, W) : W, $ && ((P.virtual || (P.virtual = {}))[D] = W, m & $export$5.R && N && !N[D] && hide$1(N, D, W)));
56711
56717
  };
56712
56718
  $export$5.F = 1;
@@ -56766,15 +56772,15 @@ var _sharedExports = _shared.exports, id$1 = 0, px = Math.random(), _uid = funct
56766
56772
  return "Symbol(".concat(m === void 0 ? "" : m, ")_", (++id$1 + px).toString(36));
56767
56773
  }, shared$1 = _sharedExports("keys"), uid$2 = _uid, _sharedKey = function(m) {
56768
56774
  return shared$1[m] || (shared$1[m] = uid$2(m));
56769
- }, has$5 = _has, toIObject$4 = _toIobject, arrayIndexOf = _arrayIncludes(!1), IE_PROTO$1 = _sharedKey("IE_PROTO"), _objectKeysInternal = function(m, g) {
56775
+ }, has$5 = _has, toIObject$4 = _toIobject, arrayIndexOf = _arrayIncludes(!1), IE_PROTO$2 = _sharedKey("IE_PROTO"), _objectKeysInternal = function(m, g) {
56770
56776
  var b = toIObject$4(m), _ = 0, x = [], C;
56771
56777
  for (C in b)
56772
- C != IE_PROTO$1 && has$5(b, C) && x.push(C);
56778
+ C != IE_PROTO$2 && has$5(b, C) && x.push(C);
56773
56779
  for (; g.length > _; )
56774
56780
  has$5(b, C = g[_++]) && (~arrayIndexOf(x, C) || x.push(C));
56775
56781
  return x;
56776
- }, _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), $keys$2 = _objectKeysInternal, enumBugKeys = _enumBugKeys, _objectKeys = Object.keys || function(g) {
56777
- return $keys$2(g, enumBugKeys);
56782
+ }, _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), $keys$2 = _objectKeysInternal, enumBugKeys$1 = _enumBugKeys, _objectKeys = Object.keys || function(g) {
56783
+ return $keys$2(g, enumBugKeys$1);
56778
56784
  }, _objectGops = {};
56779
56785
  _objectGops.f = Object.getOwnPropertySymbols;
56780
56786
  var _objectPie = {}, hasRequired_objectPie;
@@ -56817,8 +56823,8 @@ _extends.default = _assign2.default || function(m) {
56817
56823
  }
56818
56824
  return m;
56819
56825
  };
56820
- var has$4 = _has, toObject$2 = _toObject, IE_PROTO = _sharedKey("IE_PROTO"), ObjectProto$1 = Object.prototype, _objectGpo = Object.getPrototypeOf || function(m) {
56821
- return m = toObject$2(m), has$4(m, IE_PROTO) ? m[IE_PROTO] : typeof m.constructor == "function" && m instanceof m.constructor ? m.constructor.prototype : m instanceof Object ? ObjectProto$1 : null;
56826
+ var has$4 = _has, toObject$2 = _toObject, IE_PROTO$1 = _sharedKey("IE_PROTO"), ObjectProto$1 = Object.prototype, _objectGpo = Object.getPrototypeOf || function(m) {
56827
+ return m = toObject$2(m), has$4(m, IE_PROTO$1) ? m[IE_PROTO$1] : typeof m.constructor == "function" && m instanceof m.constructor ? m.constructor.prototype : m instanceof Object ? ObjectProto$1 : null;
56822
56828
  }, _objectSap, hasRequired_objectSap;
56823
56829
  function require_objectSap() {
56824
56830
  if (hasRequired_objectSap)
@@ -56870,20 +56876,12 @@ var possibleConstructorReturn = {}, _typeof$1 = {}, toInteger = _toInteger, defi
56870
56876
  var _ = String(defined(g)), x = toInteger(b), C = _.length, $, I;
56871
56877
  return x < 0 || x >= C ? m ? "" : void 0 : ($ = _.charCodeAt(x), $ < 55296 || $ > 56319 || x + 1 === C || (I = _.charCodeAt(x + 1)) < 56320 || I > 57343 ? m ? _.charAt(x) : $ : m ? _.slice(x, x + 2) : ($ - 55296 << 10) + (I - 56320) + 65536);
56872
56878
  };
56873
- }, _redefine = _hide, _iterators = {}, _objectDps, hasRequired_objectDps;
56874
- function require_objectDps() {
56875
- if (hasRequired_objectDps)
56876
- return _objectDps;
56877
- hasRequired_objectDps = 1;
56878
- var m = require_objectDp(), g = _anObject, b = _objectKeys;
56879
- return _objectDps = require_descriptors() ? Object.defineProperties : function(x, C) {
56880
- g(x);
56881
- for (var $ = b(C), I = $.length, R = 0, P; I > R; )
56882
- m.f(x, P = $[R++], C[P]);
56883
- return x;
56884
- }, _objectDps;
56885
- }
56886
- var _html, hasRequired_html;
56879
+ }, _redefine = _hide, _iterators = {}, dP$1 = require_objectDp(), anObject$2 = _anObject, getKeys$1 = _objectKeys, _objectDps = require_descriptors() ? Object.defineProperties : function(g, b) {
56880
+ anObject$2(g);
56881
+ for (var _ = getKeys$1(b), x = _.length, C = 0, $; x > C; )
56882
+ dP$1.f(g, $ = _[C++], b[$]);
56883
+ return g;
56884
+ }, _html, hasRequired_html;
56887
56885
  function require_html() {
56888
56886
  if (hasRequired_html)
56889
56887
  return _html;
@@ -56891,24 +56889,16 @@ function require_html() {
56891
56889
  var m = _globalExports.document;
56892
56890
  return _html = m && m.documentElement, _html;
56893
56891
  }
56894
- var _objectCreate, hasRequired_objectCreate;
56895
- function require_objectCreate() {
56896
- if (hasRequired_objectCreate)
56897
- return _objectCreate;
56898
- hasRequired_objectCreate = 1;
56899
- var m = _anObject, g = require_objectDps(), b = _enumBugKeys, _ = _sharedKey("IE_PROTO"), x = function() {
56900
- }, C = "prototype", $ = function() {
56901
- var I = require_domCreate()("iframe"), R = b.length, P = "<", N = ">", z;
56902
- for (I.style.display = "none", require_html().appendChild(I), I.src = "javascript:", z = I.contentWindow.document, z.open(), z.write(P + "script" + N + "document.F=Object" + P + "/script" + N), z.close(), $ = z.F; R--; )
56903
- delete $[C][b[R]];
56904
- return $();
56905
- };
56906
- return _objectCreate = Object.create || function(R, P) {
56907
- var N;
56908
- return R !== null ? (x[C] = m(R), N = new x(), x[C] = null, N[_] = R) : N = $(), P === void 0 ? N : g(N, P);
56909
- }, _objectCreate;
56910
- }
56911
- var _wks = { exports: {} }, store = _sharedExports("wks"), uid$1 = _uid, Symbol$1 = _globalExports.Symbol, USE_SYMBOL = typeof Symbol$1 == "function", $exports = _wks.exports = function(m) {
56892
+ var anObject$1 = _anObject, dPs = _objectDps, enumBugKeys = _enumBugKeys, IE_PROTO = _sharedKey("IE_PROTO"), Empty = function() {
56893
+ }, PROTOTYPE$1 = "prototype", createDict = function() {
56894
+ var m = require_domCreate()("iframe"), g = enumBugKeys.length, b = "<", _ = ">", x;
56895
+ for (m.style.display = "none", require_html().appendChild(m), m.src = "javascript:", x = m.contentWindow.document, x.open(), x.write(b + "script" + _ + "document.F=Object" + b + "/script" + _), x.close(), createDict = x.F; g--; )
56896
+ delete createDict[PROTOTYPE$1][enumBugKeys[g]];
56897
+ return createDict();
56898
+ }, _objectCreate = Object.create || function(g, b) {
56899
+ var _;
56900
+ return g !== null ? (Empty[PROTOTYPE$1] = anObject$1(g), _ = new Empty(), Empty[PROTOTYPE$1] = null, _[IE_PROTO] = g) : _ = createDict(), b === void 0 ? _ : dPs(_, b);
56901
+ }, _wks = { exports: {} }, store = _sharedExports("wks"), uid$1 = _uid, Symbol$1 = _globalExports.Symbol, USE_SYMBOL = typeof Symbol$1 == "function", $exports = _wks.exports = function(m) {
56912
56902
  return store[m] || (store[m] = USE_SYMBOL && Symbol$1[m] || (USE_SYMBOL ? Symbol$1 : uid$1)("Symbol." + m));
56913
56903
  };
56914
56904
  $exports.store = store;
@@ -56919,7 +56909,7 @@ function require_iterCreate() {
56919
56909
  if (hasRequired_iterCreate)
56920
56910
  return _iterCreate;
56921
56911
  hasRequired_iterCreate = 1;
56922
- var m = require_objectCreate(), g = _propertyDesc, b = _setToStringTag, _ = {};
56912
+ var m = _objectCreate, g = _propertyDesc, b = _setToStringTag, _ = {};
56923
56913
  return _hide(_, _wksExports("iterator"), function() {
56924
56914
  return this;
56925
56915
  }), _iterCreate = function(x, C, $) {
@@ -57066,7 +57056,7 @@ _objectGopd.f = require_descriptors() ? gOPD$1 : function(g, b) {
57066
57056
  if (has$1(g, b))
57067
57057
  return createDesc$1(!pIE.f.call(g, b), g[b]);
57068
57058
  };
57069
- var global$1 = _globalExports, has = _has, DESCRIPTORS = require_descriptors(), $export$2 = _export, redefine = _redefine, META = _metaExports.KEY, $fails = require_fails(), shared = _sharedExports, setToStringTag = _setToStringTag, uid = _uid, wks = _wksExports, wksExt = _wksExt, wksDefine = _wksDefine, enumKeys = _enumKeys, isArray = _isArray, anObject = _anObject, isObject = _isObject, toObject = _toObject, toIObject = _toIobject, toPrimitive = _toPrimitive, createDesc = _propertyDesc, _create$1 = require_objectCreate(), gOPNExt = _objectGopnExt, $GOPD = _objectGopd, $GOPS = _objectGops, $DP = require_objectDp(), $keys = _objectKeys, gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global$1.Symbol, $JSON = global$1.JSON, _stringify = $JSON && $JSON.stringify, PROTOTYPE = "prototype", HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object[PROTOTYPE], USE_NATIVE = typeof $Symbol == "function" && !!$GOPS.f, QObject = global$1.QObject, setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild, setSymbolDesc = DESCRIPTORS && $fails(function() {
57059
+ var global$1 = _globalExports, has = _has, DESCRIPTORS = require_descriptors(), $export$2 = _export, redefine = _redefine, META = _metaExports.KEY, $fails = require_fails(), shared = _sharedExports, setToStringTag = _setToStringTag, uid = _uid, wks = _wksExports, wksExt = _wksExt, wksDefine = _wksDefine, enumKeys = _enumKeys, isArray = _isArray, anObject = _anObject, isObject = _isObject, toObject = _toObject, toIObject = _toIobject, toPrimitive = _toPrimitive, createDesc = _propertyDesc, _create$1 = _objectCreate, gOPNExt = _objectGopnExt, $GOPD = _objectGopd, $GOPS = _objectGops, $DP = require_objectDp(), $keys = _objectKeys, gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global$1.Symbol, $JSON = global$1.JSON, _stringify = $JSON && $JSON.stringify, PROTOTYPE = "prototype", HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object[PROTOTYPE], USE_NATIVE = typeof $Symbol == "function" && !!$GOPS.f, QObject = global$1.QObject, setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild, setSymbolDesc = DESCRIPTORS && $fails(function() {
57070
57060
  return _create$1(dP({}, "a", {
57071
57061
  get: function() {
57072
57062
  return dP(this, "a", { value: 7 }).a;
@@ -57244,7 +57234,7 @@ function require_setProto() {
57244
57234
  var $export$1 = _export;
57245
57235
  $export$1($export$1.S, "Object", { setPrototypeOf: require_setProto().set });
57246
57236
  var setPrototypeOf$1 = _coreExports.Object.setPrototypeOf, setPrototypeOf = { default: setPrototypeOf$1, __esModule: !0 }, $export = _export;
57247
- $export($export.S, "Object", { create: require_objectCreate() });
57237
+ $export($export.S, "Object", { create: _objectCreate });
57248
57238
  var $Object = _coreExports.Object, create$1 = function(g, b) {
57249
57239
  return $Object.create(g, b);
57250
57240
  }, create = { default: create$1, __esModule: !0 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-common-components",
3
- "version": "0.1.45",
3
+ "version": "0.1.47",
4
4
  "type": "module",
5
5
  "main": "dist/propro-common-components.js",
6
6
  "types": "dist/main.d.ts",