@yungu-fed/componentlibrary 0.0.1 → 0.0.3

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/README.md CHANGED
@@ -26,6 +26,12 @@ npm run preview
26
26
 
27
27
  # 监听模式构建
28
28
  npm run build:watch
29
+
30
+ # 登录npmjs
31
+ npm login
32
+
33
+ # 推向公共包
34
+ npm publish --access=public
29
35
  ```
30
36
 
31
37
  ## 项目结构
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+
1
2
  export { default as Button } from './components/Button';
2
3
  export { default as Popover } from './components/Popover';
package/dist/index.es.js CHANGED
@@ -13,15 +13,15 @@ var Me;
13
13
  function hr() {
14
14
  if (Me) return V;
15
15
  Me = 1;
16
- var A = Be, w = Symbol.for("react.element"), j = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, m = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, S = { key: !0, ref: !0, __self: !0, __source: !0 };
17
- function x(k, v, y) {
16
+ var A = Be, w = Symbol.for("react.element"), x = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, m = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, S = { key: !0, ref: !0, __self: !0, __source: !0 };
17
+ function j(k, v, g) {
18
18
  var h, C = {}, D = null, F = null;
19
- y !== void 0 && (D = "" + y), v.key !== void 0 && (D = "" + v.key), v.ref !== void 0 && (F = v.ref);
19
+ g !== void 0 && (D = "" + g), v.key !== void 0 && (D = "" + v.key), v.ref !== void 0 && (F = v.ref);
20
20
  for (h in v) d.call(v, h) && !S.hasOwnProperty(h) && (C[h] = v[h]);
21
21
  if (k && k.defaultProps) for (h in v = k.defaultProps, v) C[h] === void 0 && (C[h] = v[h]);
22
22
  return { $$typeof: w, type: k, key: D, ref: F, props: C, _owner: m.current };
23
23
  }
24
- return V.Fragment = j, V.jsx = x, V.jsxs = x, V;
24
+ return V.Fragment = x, V.jsx = j, V.jsxs = j, V;
25
25
  }
26
26
  var U = {};
27
27
  /**
@@ -36,7 +36,7 @@ var U = {};
36
36
  var Ye;
37
37
  function _r() {
38
38
  return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
39
- var A = Be, w = Symbol.for("react.element"), j = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), x = Symbol.for("react.provider"), k = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), $ = Symbol.iterator, J = "@@iterator";
39
+ var A = Be, w = Symbol.for("react.element"), x = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), k = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), $ = Symbol.iterator, J = "@@iterator";
40
40
  function O(e) {
41
41
  if (e === null || typeof e != "object")
42
42
  return null;
@@ -64,13 +64,13 @@ function _r() {
64
64
  var Z = !1, Q = !1, ee = !1, re = !1, a = !1, l;
65
65
  l = Symbol.for("react.module.reference");
66
66
  function _(e) {
67
- return !!(typeof e == "string" || typeof e == "function" || e === d || e === S || a || e === m || e === y || e === h || re || e === F || Z || Q || ee || typeof e == "object" && e !== null && (e.$$typeof === D || e.$$typeof === C || e.$$typeof === x || e.$$typeof === k || e.$$typeof === v || // This needs to include all possible module reference object
67
+ return !!(typeof e == "string" || typeof e == "function" || e === d || e === S || a || e === m || e === g || e === h || re || e === F || Z || Q || ee || typeof e == "object" && e !== null && (e.$$typeof === D || e.$$typeof === C || e.$$typeof === j || e.$$typeof === k || e.$$typeof === v || // This needs to include all possible module reference object
68
68
  // types supported by any Flight configuration anywhere since
69
69
  // we don't know which Flight build this will end up being used
70
70
  // with.
71
71
  e.$$typeof === l || e.getModuleId !== void 0));
72
72
  }
73
- function g(e, r, t) {
73
+ function b(e, r, t) {
74
74
  var n = e.displayName;
75
75
  if (n)
76
76
  return n;
@@ -90,13 +90,13 @@ function _r() {
90
90
  switch (e) {
91
91
  case d:
92
92
  return "Fragment";
93
- case j:
93
+ case x:
94
94
  return "Portal";
95
95
  case S:
96
96
  return "Profiler";
97
97
  case m:
98
98
  return "StrictMode";
99
- case y:
99
+ case g:
100
100
  return "Suspense";
101
101
  case h:
102
102
  return "SuspenseList";
@@ -106,11 +106,11 @@ function _r() {
106
106
  case k:
107
107
  var r = e;
108
108
  return Y(r) + ".Consumer";
109
- case x:
109
+ case j:
110
110
  var t = e;
111
111
  return Y(t._context) + ".Provider";
112
112
  case v:
113
- return g(e, e.render, "ForwardRef");
113
+ return b(e, e.render, "ForwardRef");
114
114
  case C:
115
115
  var n = e.displayName || null;
116
116
  return n !== null ? n : P(e.type) || "Memo";
@@ -125,14 +125,14 @@ function _r() {
125
125
  }
126
126
  return null;
127
127
  }
128
- var I = Object.assign, B = 0, pe, he, _e, ge, ye, be, me;
128
+ var I = Object.assign, B = 0, pe, he, _e, be, ge, ye, me;
129
129
  function Ee() {
130
130
  }
131
131
  Ee.__reactDisabledLog = !0;
132
132
  function Ne() {
133
133
  {
134
134
  if (B === 0) {
135
- pe = console.log, he = console.info, _e = console.warn, ge = console.error, ye = console.group, be = console.groupCollapsed, me = console.groupEnd;
135
+ pe = console.log, he = console.info, _e = console.warn, be = console.error, ge = console.group, ye = console.groupCollapsed, me = console.groupEnd;
136
136
  var e = {
137
137
  configurable: !0,
138
138
  enumerable: !0,
@@ -171,13 +171,13 @@ function _r() {
171
171
  value: _e
172
172
  }),
173
173
  error: I({}, e, {
174
- value: ge
174
+ value: be
175
175
  }),
176
176
  group: I({}, e, {
177
- value: ye
177
+ value: ge
178
178
  }),
179
179
  groupCollapsed: I({}, e, {
180
- value: be
180
+ value: ye
181
181
  }),
182
182
  groupEnd: I({}, e, {
183
183
  value: me
@@ -255,14 +255,14 @@ function _r() {
255
255
  } catch (E) {
256
256
  if (E && n && typeof E.stack == "string") {
257
257
  for (var o = E.stack.split(`
258
- `), b = n.stack.split(`
259
- `), c = o.length - 1, f = b.length - 1; c >= 1 && f >= 0 && o[c] !== b[f]; )
258
+ `), y = n.stack.split(`
259
+ `), c = o.length - 1, f = y.length - 1; c >= 1 && f >= 0 && o[c] !== y[f]; )
260
260
  f--;
261
261
  for (; c >= 1 && f >= 0; c--, f--)
262
- if (o[c] !== b[f]) {
262
+ if (o[c] !== y[f]) {
263
263
  if (c !== 1 || f !== 1)
264
264
  do
265
- if (c--, f--, f < 0 || o[c] !== b[f]) {
265
+ if (c--, f--, f < 0 || o[c] !== y[f]) {
266
266
  var T = `
267
267
  ` + o[c].replace(" at new ", " at ");
268
268
  return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, T), T;
@@ -292,7 +292,7 @@ function _r() {
292
292
  if (typeof e == "string")
293
293
  return K(e);
294
294
  switch (e) {
295
- case y:
295
+ case g:
296
296
  return K("Suspense");
297
297
  case h:
298
298
  return K("SuspenseList");
@@ -329,8 +329,8 @@ function _r() {
329
329
  var o = void 0;
330
330
  try {
331
331
  if (typeof e[i] != "function") {
332
- var b = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
- throw b.name = "Invariant Violation", b;
332
+ var y = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
+ throw y.name = "Invariant Violation", y;
334
334
  }
335
335
  o = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
336
  } catch (c) {
@@ -360,7 +360,7 @@ function _r() {
360
360
  function Te(e) {
361
361
  return "" + e;
362
362
  }
363
- function je(e) {
363
+ function xe(e) {
364
364
  if (He(e))
365
365
  return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ge(e)), Te(e);
366
366
  }
@@ -442,8 +442,8 @@ function _r() {
442
442
  };
443
443
  function ar(e, r, t, n, s) {
444
444
  {
445
- var u, i = {}, o = null, b = null;
446
- t !== void 0 && (je(t), o = "" + t), Qe(r) && (je(r.key), o = "" + r.key), Ze(r) && (b = r.ref, er(r, s));
445
+ var u, i = {}, o = null, y = null;
446
+ t !== void 0 && (xe(t), o = "" + t), Qe(r) && (xe(r.key), o = "" + r.key), Ze(r) && (y = r.ref, er(r, s));
447
447
  for (u in r)
448
448
  N.call(r, u) && !Xe.hasOwnProperty(u) && (i[u] = r[u]);
449
449
  if (e && e.defaultProps) {
@@ -451,11 +451,11 @@ function _r() {
451
451
  for (u in c)
452
452
  i[u] === void 0 && (i[u] = c[u]);
453
453
  }
454
- if (o || b) {
454
+ if (o || y) {
455
455
  var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
456
- o && rr(i, f), b && tr(i, f);
456
+ o && rr(i, f), y && tr(i, f);
457
457
  }
458
- return nr(e, o, b, s, n, ke.current, i);
458
+ return nr(e, o, y, s, n, ke.current, i);
459
459
  }
460
460
  }
461
461
  var ie = R.ReactCurrentOwner, Se = R.ReactDebugCurrentFrame;
@@ -471,7 +471,7 @@ function _r() {
471
471
  function ue(e) {
472
472
  return typeof e == "object" && e !== null && e.$$typeof === w;
473
473
  }
474
- function xe() {
474
+ function je() {
475
475
  {
476
476
  if (ie.current) {
477
477
  var e = P(ie.current.type);
@@ -489,7 +489,7 @@ Check the render method of \`` + e + "`.";
489
489
  var Fe = {};
490
490
  function ir(e) {
491
491
  {
492
- var r = xe();
492
+ var r = je();
493
493
  if (!r) {
494
494
  var t = typeof e == "string" ? e : e.displayName || e.name;
495
495
  t && (r = `
@@ -575,8 +575,8 @@ Check the top-level render call using <` + t + ">.");
575
575
  if (!i) {
576
576
  var o = "";
577
577
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
578
- var b = or();
579
- b ? o += b : o += xe();
578
+ var y = or();
579
+ y ? o += y : o += je();
580
580
  var c;
581
581
  e === null ? c = "null" : oe(e) ? c = "array" : e !== void 0 && e.$$typeof === w ? (c = "<" + (P(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, o);
582
582
  }
@@ -625,18 +625,18 @@ React keys must be passed directly to JSX without using spread:
625
625
  }
626
626
  process.env.NODE_ENV === "production" ? de.exports = hr() : de.exports = _r();
627
627
  var ve = de.exports;
628
- const gr = "_btn_jnyss_21", yr = "_small_jnyss_45", br = "_middle_jnyss_52", mr = "_large_jnyss_59", Er = "_danger_jnyss_66", Rr = "_primary_jnyss_70", wr = "_link_jnyss_70", Cr = "_text_jnyss_70", Tr = "_dashed_jnyss_70", jr = "_ghost_jnyss_70", kr = "_warning_jnyss_80", Or = "_info_jnyss_94", Pr = "_success_jnyss_108", Sr = "_disabled_jnyss_177", q = {
629
- btn: gr,
630
- small: yr,
631
- middle: br,
628
+ const br = "_btn_9ybrx_1", gr = "_small_9ybrx_25", yr = "_middle_9ybrx_32", mr = "_large_9ybrx_39", Er = "_danger_9ybrx_46", Rr = "_primary_9ybrx_50", wr = "_link_9ybrx_50", Cr = "_text_9ybrx_50", Tr = "_dashed_9ybrx_50", xr = "_ghost_9ybrx_50", kr = "_warning_9ybrx_60", Or = "_info_9ybrx_74", Pr = "_success_9ybrx_88", Sr = "_disabled_9ybrx_157", q = {
629
+ btn: br,
630
+ small: gr,
631
+ middle: yr,
632
632
  large: mr,
633
633
  danger: Er,
634
634
  primary: Rr,
635
635
  link: wr,
636
636
  text: Cr,
637
637
  dashed: Tr,
638
- ghost: jr,
639
- default: "_default_jnyss_70",
638
+ ghost: xr,
639
+ default: "_default_9ybrx_50",
640
640
  warning: kr,
641
641
  info: Or,
642
642
  success: Pr,
@@ -644,87 +644,87 @@ const gr = "_btn_jnyss_21", yr = "_small_jnyss_45", br = "_middle_jnyss_52", mr
644
644
  }, $r = ({
645
645
  type: A,
646
646
  size: w = "middle",
647
- color: j = "primary",
647
+ color: x = "primary",
648
648
  disabled: d = !1,
649
649
  onClick: m,
650
650
  className: S = "",
651
- style: x,
651
+ style: j,
652
652
  children: k,
653
653
  ...v
654
654
  }) => {
655
- const y = [q.btn];
656
- w && w !== "middle" && y.push(q[w]), A && y.push(q[A]), j && j !== "primary" && y.push(q[j]), S && y.push(S), d && y.push(q.disabled);
657
- const h = y.filter(Boolean).join(" ");
655
+ const g = [q.btn];
656
+ w && w !== "middle" && g.push(q[w]), A && g.push(q[A]), x && x !== "primary" && g.push(q[x]), S && g.push(S), d && g.push(q.disabled);
657
+ const h = g.filter(Boolean).join(" ");
658
658
  return /* @__PURE__ */ ve.jsx(
659
659
  "span",
660
660
  {
661
661
  className: h,
662
662
  onClick: d ? void 0 : m,
663
- style: x,
663
+ style: j,
664
664
  ...v,
665
665
  children: k
666
666
  }
667
667
  );
668
- }, xr = "_popoverWrapper_1hkwl_21", Fr = "_popoverContent_1hkwl_28", Dr = "_popoverFadeIn_1hkwl_1", fe = {
669
- popoverWrapper: xr,
668
+ }, jr = "_popoverWrapper_yvnlm_1", Fr = "_popoverContent_yvnlm_8", Dr = "_popoverFadeIn_yvnlm_1", fe = {
669
+ popoverWrapper: jr,
670
670
  popoverContent: Fr,
671
671
  popoverFadeIn: Dr
672
672
  }, Ir = ({
673
673
  children: A,
674
674
  content: w,
675
- placement: j = "BL",
675
+ placement: x = "BL",
676
676
  offset: d = 8,
677
677
  trigger: m = "click",
678
678
  visible: S,
679
- onVisibleChange: x,
679
+ onVisibleChange: j,
680
680
  className: k = "",
681
681
  style: v
682
682
  }) => {
683
- const [y, h] = Le(!1), [C, D] = Le({ top: 0, left: 0 }), F = We(null), $ = We(null), J = S !== void 0, O = J ? S : y, R = (a) => {
684
- J || h(a), x && x(a);
683
+ const [g, h] = Le(!1), [C, D] = Le({ top: 0, left: 0 }), F = We(null), $ = We(null), J = S !== void 0, O = J ? S : g, R = (a) => {
684
+ J || h(a), j && j(a);
685
685
  }, p = () => {
686
686
  if (!F.current || !$.current || !O)
687
687
  return;
688
688
  const a = F.current.getBoundingClientRect(), l = $.current.getBoundingClientRect();
689
- let _ = 0, g = 0;
690
- switch (j) {
689
+ let _ = 0, b = 0;
690
+ switch (x) {
691
691
  case "TL":
692
- _ = a.top - l.height - d, g = a.left;
692
+ _ = a.top - l.height - d, b = a.left;
693
693
  break;
694
694
  case "TC":
695
- _ = a.top - l.height - d, g = a.left + (a.width - l.width) / 2;
695
+ _ = a.top - l.height - d, b = a.left + (a.width - l.width) / 2;
696
696
  break;
697
697
  case "TR":
698
- _ = a.top - l.height - d, g = a.left + a.width - l.width;
698
+ _ = a.top - l.height - d, b = a.left + a.width - l.width;
699
699
  break;
700
700
  case "CL":
701
- _ = a.top + (a.height - l.height) / 2, g = a.left - l.width - d;
701
+ _ = a.top + (a.height - l.height) / 2, b = a.left - l.width - d;
702
702
  break;
703
703
  case "CC":
704
- _ = a.top + (a.height - l.height) / 2, g = a.left + (a.width - l.width) / 2;
704
+ _ = a.top + (a.height - l.height) / 2, b = a.left + (a.width - l.width) / 2;
705
705
  break;
706
706
  case "CR":
707
- _ = a.top + (a.height - l.height) / 2, g = a.left + a.width + d;
707
+ _ = a.top + (a.height - l.height) / 2, b = a.left + a.width + d;
708
708
  break;
709
709
  case "BL":
710
710
  default:
711
- _ = a.bottom + d, g = a.left;
711
+ _ = a.bottom + d, b = a.left;
712
712
  break;
713
713
  case "BC":
714
- _ = a.bottom + d, g = a.left + (a.width - l.width) / 2;
714
+ _ = a.bottom + d, b = a.left + (a.width - l.width) / 2;
715
715
  break;
716
716
  case "BR":
717
- _ = a.bottom + d, g = a.left + a.width - l.width;
717
+ _ = a.bottom + d, b = a.left + a.width - l.width;
718
718
  break;
719
719
  }
720
720
  const Y = window.innerWidth, P = window.innerHeight;
721
- g < 8 && (g = 8), g + l.width > Y - 8 && (g = Y - l.width - 8), _ < 8 && (_ = 8), _ + l.height > P - 8 && (_ = P - l.height - 8), D({ top: _, left: g });
721
+ b < 8 && (b = 8), b + l.width > Y - 8 && (b = Y - l.width - 8), _ < 8 && (_ = 8), _ + l.height > P - 8 && (_ = P - l.height - 8), D({ top: _, left: b });
722
722
  };
723
723
  ce(() => {
724
724
  O && requestAnimationFrame(() => {
725
725
  p();
726
726
  });
727
- }, [O, j, d]), ce(() => {
727
+ }, [O, x, d]), ce(() => {
728
728
  if (!O) return;
729
729
  const a = () => {
730
730
  p();
@@ -771,7 +771,7 @@ const gr = "_btn_jnyss_21", yr = "_small_jnyss_45", br = "_middle_jnyss_52", mr
771
771
  "div",
772
772
  {
773
773
  ref: $,
774
- className: `${fe.popoverContent} ${fe[`placement-${j}`]}`,
774
+ className: `${fe.popoverContent} ${fe[`placement-${x}`]}`,
775
775
  style: {
776
776
  top: `${C.top}px`,
777
777
  left: `${C.left}px`