@weing-dev/ui-kit-primitive 0.4.5 → 0.5.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.
Files changed (55) hide show
  1. package/README.md +6 -0
  2. package/dist/{Icon-DExqF865.js → Icon-DEdvzMs-.js} +1 -1
  3. package/dist/{color-B71xRiyK.js → baseColor-DYa5_IOB.js} +3 -120
  4. package/dist/calendar.js +12 -12
  5. package/dist/chart.css +1 -0
  6. package/dist/chart.d.ts +6 -2
  7. package/dist/chart.js +532 -85
  8. package/dist/color-qJrSCDan.js +155 -0
  9. package/dist/components/Calendar/Calendar.d.ts +1 -55
  10. package/dist/components/Calendar/Calendar.type.d.ts +61 -0
  11. package/dist/components/Cascader/Cascader.d.ts +2 -36
  12. package/dist/components/Cascader/Cascader.type.d.ts +37 -0
  13. package/dist/components/Chart/Chart.context.d.ts +9 -0
  14. package/dist/components/Chart/Chart.hooks.d.ts +4 -0
  15. package/dist/components/Chart/Chart.options.d.ts +24 -0
  16. package/dist/components/Chart/Chart.palette.d.ts +20 -0
  17. package/dist/components/Chart/Chart.preset.d.ts +7 -0
  18. package/dist/components/Chart/Chart.register.d.ts +1 -0
  19. package/dist/components/Chart/Chart.style.d.ts +21 -0
  20. package/dist/components/Chart/Chart.theme.d.ts +9 -0
  21. package/dist/components/Chart/Chart.type.d.ts +114 -0
  22. package/dist/components/Chart/ChartFrame.d.ts +14 -0
  23. package/dist/components/Chart/ChartRenderer.d.ts +11 -0
  24. package/dist/components/Chart/charts/BarChart.d.ts +3 -0
  25. package/dist/components/Chart/charts/DoughnutChart.d.ts +3 -0
  26. package/dist/components/Chart/charts/LineChart.d.ts +3 -0
  27. package/dist/components/Chart/charts/PieChart.d.ts +3 -0
  28. package/dist/components/Form/Dropdown/Dropdown.d.ts +1 -47
  29. package/dist/components/Form/Dropdown/Dropdown.type.d.ts +48 -0
  30. package/dist/components/Form/TextArea/TextArea.d.ts +1 -18
  31. package/dist/components/Form/TextArea/TextArea.type.d.ts +19 -0
  32. package/dist/components/Form/TextInput/TextInput.d.ts +1 -17
  33. package/dist/components/Form/TextInput/TextInput.type.d.ts +18 -0
  34. package/dist/components/Thumbnail/Thumbnail.context.d.ts +38 -3
  35. package/dist/components/Thumbnail/Thumbnail.d.ts +6 -9
  36. package/dist/components/Thumbnail/thumbnailImage.util.d.ts +13 -0
  37. package/dist/components/TimeInput/TimeInput.d.ts +1 -27
  38. package/dist/components/TimeInput/TimeInput.type.d.ts +27 -0
  39. package/dist/display.css +1 -1
  40. package/dist/display.js +2248 -2073
  41. package/dist/entry/chart.d.ts +6 -2
  42. package/dist/entry/components.d.ts +1 -2
  43. package/dist/feedback.js +2 -2
  44. package/dist/form.js +463 -462
  45. package/dist/icon.js +2 -2
  46. package/dist/index.css +1 -1
  47. package/dist/index.js +4904 -4786
  48. package/dist/index.umd.cjs +22 -22
  49. package/dist/navigation.js +41 -40
  50. package/dist/styles/color.d.ts +30 -0
  51. package/dist/video-player.js +83 -83
  52. package/docs/subpath-imports.md +80 -0
  53. package/package.json +5 -4
  54. package/dist/components/Chart/Chart.d.ts +0 -19
  55. /package/dist/components/Cascader/{Cacader.data.d.ts → Cascader.data.d.ts} +0 -0
@@ -1,8 +1,9 @@
1
1
  import { c as L, j as h } from "./compiler-runtime-BFrE5JtX.js";
2
2
  import p from "react";
3
3
  import { c as W } from "./bind-D3ZJ5k4I.js";
4
- import { a as w } from "./Icon-DExqF865.js";
5
- import { c as C, T } from "./color-B71xRiyK.js";
4
+ import { a as w } from "./Icon-DEdvzMs-.js";
5
+ import { c as C } from "./color-qJrSCDan.js";
6
+ import { T } from "./baseColor-DYa5_IOB.js";
6
7
  const it = "_Unset_hr4h9_2", at = "_Root_hr4h9_6", dt = "_transition_hr4h9_15", ut = "_contained_hr4h9_20", mt = "_outlined_hr4h9_24", _t = "_adaptived_hr4h9_27", ft = "_open_hr4h9_31", ht = "_bottomLined_hr4h9_34", bt = "_sideLined_hr4h9_43", gt = "_shadow_hr4h9_52", xt = "_disabled_hr4h9_57", vt = "_unset_hr4h9_69", Ct = "_Trigger_hr4h9_77", pt = "_TriggerIcon_hr4h9_91", $t = "_Item_hr4h9_112", yt = {
7
8
  Unset: it,
8
9
  Root: at,
@@ -39,7 +40,7 @@ const it = "_Unset_hr4h9_2", at = "_Root_hr4h9_6", dt = "_transition_hr4h9_15",
39
40
  const t = L.c(13), {
40
41
  children: l,
41
42
  className: r
42
- } = o, e = p.useRef(null), s = p.useContext(Z), {
43
+ } = o, e = p.useRef(null), s = p.use(Z), {
43
44
  open: n,
44
45
  disabled: a,
45
46
  transition: i,
@@ -49,7 +50,7 @@ const it = "_Unset_hr4h9_2", at = "_Root_hr4h9_6", dt = "_transition_hr4h9_15",
49
50
  t[0] !== c || t[1] !== n || t[2] !== i ? (u = () => {
50
51
  if (!e.current || !i)
51
52
  return;
52
- const f = window.getComputedStyle(e.current).paddingBottom, v = `${Array.from(e.current.childNodes).reduce(It, +f.split("px")[0])}`, x = {
53
+ const f = window.getComputedStyle(e.current).paddingBottom, v = `${Array.from(e.current.childNodes).reduce(Pt, +f.split("px")[0])}`, x = {
53
54
  duration: typeof i == "boolean" ? 250 : (i == null ? void 0 : i.duration) ?? 250,
54
55
  easing: typeof i == "boolean" ? "ease-in-out" : (i == null ? void 0 : i.timingFC) ?? "ease-in-out"
55
56
  }, $ = (...y) => {
@@ -104,7 +105,7 @@ const it = "_Unset_hr4h9_2", at = "_Root_hr4h9_6", dt = "_transition_hr4h9_15",
104
105
  onClick: c,
105
106
  onChange: u,
106
107
  "#triggerRef": d
107
- } = p.useContext(Z);
108
+ } = p.use(Z);
108
109
  let _;
109
110
  t[0] !== a || t[1] !== s || t[2] !== u || t[3] !== c || t[4] !== n ? (_ = {
110
111
  hidden: !0,
@@ -147,7 +148,7 @@ const it = "_Unset_hr4h9_2", at = "_Root_hr4h9_6", dt = "_transition_hr4h9_15",
147
148
  } = o, u = s === void 0 ? "contained" : s, d = n === void 0 ? !1 : n, _ = a === void 0 ? !0 : a, m = i === void 0 ? !0 : i, [b, g] = p.useState(!1), [f, v] = p.useState(!1), x = p.useId(), $ = p.useRef(null), y = p.useRef(null);
148
149
  let k;
149
150
  t[0] !== d || t[1] !== f || t[2] !== c || t[3] !== e ? (k = () => {
150
- d || (e === void 0 && (g == null || g(Pt)), f || v == null || v(!0), c == null || c());
151
+ d || (e === void 0 && (g == null || g(It)), f || v == null || v(!0), c == null || c());
151
152
  }, t[0] = d, t[1] = f, t[2] = c, t[3] = e, t[4] = k) : k = t[4];
152
153
  const S = k, j = e ?? b, N = o.id ?? x;
153
154
  let R;
@@ -175,34 +176,34 @@ const it = "_Unset_hr4h9_2", at = "_Root_hr4h9_6", dt = "_transition_hr4h9_15",
175
176
  };
176
177
  }, M = [d, j, _, O], t[12] = _, t[13] = j, t[14] = d, t[15] = z, t[16] = M) : (z = t[15], M = t[16]), p.useEffect(z, M);
177
178
  const G = u === "unset" ? "Unset" : "Root", U = !!m;
178
- let I;
179
- t[17] !== r || t[18] !== j || t[19] !== d || t[20] !== G || t[21] !== U || t[22] !== u ? (I = J(G, r, u, {
179
+ let P;
180
+ t[17] !== r || t[18] !== j || t[19] !== d || t[20] !== G || t[21] !== U || t[22] !== u ? (P = J(G, r, u, {
180
181
  open: j,
181
182
  transition: U,
182
183
  disabled: d
183
- }), t[17] = r, t[18] = j, t[19] = d, t[20] = G, t[21] = U, t[22] = u, t[23] = I) : I = t[23];
184
+ }), t[17] = r, t[18] = j, t[19] = d, t[20] = G, t[21] = U, t[22] = u, t[23] = P) : P = t[23];
184
185
  let D;
185
186
  t[24] !== m ? (D = typeof m != "boolean" && {
186
187
  transitionDuration: `${+((m == null ? void 0 : m.duration) ?? 250) / 1e3}s`,
187
188
  transitionTimingFunction: (m == null ? void 0 : m.timingFC) ?? "ease-in-out"
188
189
  }, t[24] = m, t[25] = D) : D = t[25];
189
- let P;
190
- t[26] !== D ? (P = {
190
+ let I;
191
+ t[26] !== D ? (I = {
191
192
  ...D
192
- }, t[26] = D, t[27] = P) : P = t[27];
193
+ }, t[26] = D, t[27] = I) : I = t[27];
193
194
  let A;
194
- t[28] !== l || t[29] !== I || t[30] !== P ? (A = /* @__PURE__ */ h.jsx("div", { ref: $, className: I, style: P, children: l }), t[28] = l, t[29] = I, t[30] = P, t[31] = A) : A = t[31];
195
+ t[28] !== l || t[29] !== P || t[30] !== I ? (A = /* @__PURE__ */ h.jsx("div", { ref: $, className: P, style: I, children: l }), t[28] = l, t[29] = P, t[30] = I, t[31] = A) : A = t[31];
195
196
  let V;
196
197
  return t[32] !== F || t[33] !== A ? (V = /* @__PURE__ */ h.jsx(kt, { ...F, children: A }), t[32] = F, t[33] = A, t[34] = V) : V = t[34], V;
197
- }, xo = {
198
+ }, vo = {
198
199
  Root: jt,
199
200
  Trigger: St,
200
201
  Item: Lt
201
202
  };
202
- function It(o, t) {
203
+ function Pt(o, t) {
203
204
  return o + t.scrollHeight;
204
205
  }
205
- function Pt(o) {
206
+ function It(o) {
206
207
  return !o;
207
208
  }
208
209
  const Tt = "_List_oqxbn_2", Nt = "_Link_oqxbn_7", Dt = "_href_oqxbn_12", wt = "_focused_oqxbn_15", Rt = "_Separator_oqxbn_18", Bt = "_Ellipsis_oqxbn_21", zt = {
@@ -277,7 +278,7 @@ const Tt = "_List_oqxbn_2", Nt = "_Link_oqxbn_7", Dt = "_href_oqxbn_12", wt = "_
277
278
  t[3] !== r ? (a = X("List", r), t[3] = r, t[4] = a) : a = t[4];
278
279
  let i;
279
280
  return t[5] !== n || t[6] !== a ? (i = /* @__PURE__ */ h.jsx("div", { className: a, children: n }), t[5] = n, t[6] = a, t[7] = i) : i = t[7], i;
280
- }, vo = {
281
+ }, Co = {
281
282
  List: Et,
282
283
  Link: qt,
283
284
  Separator: At,
@@ -294,7 +295,7 @@ const Tt = "_List_oqxbn_2", Nt = "_Link_oqxbn_7", Dt = "_href_oqxbn_12", wt = "_
294
295
  text: Vt,
295
296
  contentsHeader: Jt,
296
297
  Label: Kt
297
- }, q = W.bind(Qt), Co = (o) => {
298
+ }, q = W.bind(Qt), po = (o) => {
298
299
  const t = L.c(27);
299
300
  let l, r, e, s, n, a, i, c, u, d;
300
301
  if (t[0] !== o) {
@@ -513,7 +514,7 @@ const Tt = "_List_oqxbn_2", Nt = "_Link_oqxbn_7", Dt = "_href_oqxbn_12", wt = "_
513
514
  t[1] !== r ? (n = E("Wrapper", r), t[1] = r, t[2] = n) : n = t[2];
514
515
  let a;
515
516
  return t[3] !== l || t[4] !== n ? (a = /* @__PURE__ */ h.jsx(me, { value: s, children: /* @__PURE__ */ h.jsx("div", { className: n, children: l }) }), t[3] = l, t[4] = n, t[5] = a) : a = t[5], a;
516
- }, po = {
517
+ }, $o = {
517
518
  Logo: fe,
518
519
  List: be,
519
520
  Item: he,
@@ -544,7 +545,7 @@ function ve({
544
545
  };
545
546
  });
546
547
  }
547
- const Ce = "_Root_hmncd_2", pe = "_medium_hmncd_8", $e = "_small_hmncd_11", ye = "_PageItem_hmncd_14", ke = "_square_hmncd_39", Le = "_round_hmncd_42", Se = "_active_hmncd_45", je = "_disabled_hmncd_62", Ie = "_Icon_hmncd_65", Pe = {
548
+ const Ce = "_Root_hmncd_2", pe = "_medium_hmncd_8", $e = "_small_hmncd_11", ye = "_PageItem_hmncd_14", ke = "_square_hmncd_39", Le = "_round_hmncd_42", Se = "_active_hmncd_45", je = "_disabled_hmncd_62", Pe = "_Icon_hmncd_65", Ie = {
548
549
  Root: Ce,
549
550
  medium: pe,
550
551
  small: $e,
@@ -553,7 +554,7 @@ const Ce = "_Root_hmncd_2", pe = "_medium_hmncd_8", $e = "_small_hmncd_11", ye =
553
554
  round: Le,
554
555
  active: Se,
555
556
  disabled: je,
556
- Icon: Ie
557
+ Icon: Pe
557
558
  }, Te = {
558
559
  colorType: "primary",
559
560
  variant: "soft",
@@ -639,7 +640,7 @@ const Ce = "_Root_hmncd_2", pe = "_medium_hmncd_8", $e = "_small_hmncd_11", ye =
639
640
  selected: o,
640
641
  unselected: t
641
642
  };
642
- }, K = W.bind(Pe), De = () => {
643
+ }, K = W.bind(Ie), De = () => {
643
644
  const o = L.c(15), {
644
645
  size: t,
645
646
  onClick: l,
@@ -661,7 +662,7 @@ const Ce = "_Root_hmncd_2", pe = "_medium_hmncd_8", $e = "_small_hmncd_11", ye =
661
662
  o[5] !== c || o[6] !== t ? (_ = K("Icon", t, {
662
663
  disabled: c
663
664
  }), o[5] = c, o[6] = t, o[7] = _) : _ = o[7];
664
- const m = t === "medium" ? 24 : 20, b = c ? "#C4CDD5" : "#1C252E";
665
+ const m = t === "medium" ? 24 : 20, b = c ? "var(--textDisabled, #C4CDD5)" : "var(--textPrimary, #1C252E)";
665
666
  let g;
666
667
  o[8] !== m || o[9] !== b ? (g = /* @__PURE__ */ h.jsx(w, { name: "GoNext", size: m, color: b }), o[8] = m, o[9] = b, o[10] = g) : g = o[10];
667
668
  let f;
@@ -688,7 +689,7 @@ const Ce = "_Root_hmncd_2", pe = "_medium_hmncd_8", $e = "_small_hmncd_11", ye =
688
689
  o[5] !== c || o[6] !== t ? (_ = K("Icon", t, {
689
690
  disabled: c
690
691
  }), o[5] = c, o[6] = t, o[7] = _) : _ = o[7];
691
- const m = t === "medium" ? 24 : 20, b = c ? "#C4CDD5" : "#1C252E";
692
+ const m = t === "medium" ? 24 : 20, b = c ? "var(--textDisabled, #C4CDD5)" : "var(--textPrimary, #1C252E)";
692
693
  let g;
693
694
  o[8] !== m || o[9] !== b ? (g = /* @__PURE__ */ h.jsx(w, { name: "GoBefore", size: m, color: b }), o[8] = m, o[9] = b, o[10] = g) : g = o[10];
694
695
  let f;
@@ -797,7 +798,7 @@ const Ce = "_Root_hmncd_2", pe = "_medium_hmncd_8", $e = "_small_hmncd_11", ye =
797
798
  t[14] !== c || t[15] !== $ ? (y = /* @__PURE__ */ h.jsx("nav", { className: $, children: c }), t[14] = c, t[15] = $, t[16] = y) : y = t[16];
798
799
  let k;
799
800
  return t[17] !== x || t[18] !== y ? (k = /* @__PURE__ */ h.jsx(Y, { value: x, children: y }), t[17] = x, t[18] = y, t[19] = k) : k = t[19], k;
800
- }, $o = {
801
+ }, yo = {
801
802
  Next: De,
802
803
  Prev: we,
803
804
  PageItem: nt,
@@ -822,10 +823,10 @@ function ze(o, t, l) {
822
823
  t.forEach((f) => {
823
824
  if (!f)
824
825
  return;
825
- const v = f, x = v.getBoundingClientRect(), $ = x.left + x.width / 2, y = x.top + x.height / 2, k = Math.abs(b - $), S = Math.abs(g - y), j = k / (m.width / 2), N = S / (m.height / 2), R = Math.max(x.left, m.left), F = Math.min(x.right, m.left + m.width), B = Math.max(x.top, m.top), O = Math.min(x.bottom, m.top + m.height), z = Math.max(0, F - R), M = Math.max(0, O - B), G = z * M, U = x.width * x.height, I = G / U, D = 1 - Math.min(1, (j + N) / 2), P = I * (1 + D);
826
- P > _.score && I > 0.1 && (_ = {
826
+ const v = f, x = v.getBoundingClientRect(), $ = x.left + x.width / 2, y = x.top + x.height / 2, k = Math.abs(b - $), S = Math.abs(g - y), j = k / (m.width / 2), N = S / (m.height / 2), R = Math.max(x.left, m.left), F = Math.min(x.right, m.left + m.width), B = Math.max(x.top, m.top), O = Math.min(x.bottom, m.top + m.height), z = Math.max(0, F - R), M = Math.max(0, O - B), G = z * M, U = x.width * x.height, P = G / U, D = 1 - Math.min(1, (j + N) / 2), I = P * (1 + D);
827
+ I > _.score && P > 0.1 && (_ = {
827
828
  id: v.id,
828
- score: P
829
+ score: I
829
830
  });
830
831
  }), _.score > 0 && s(_.id);
831
832
  }, u = setTimeout(c, 100), d = setInterval(c, 500);
@@ -843,7 +844,7 @@ function ze(o, t, l) {
843
844
  }
844
845
  return e;
845
846
  }
846
- const yo = {
847
+ const ko = {
847
848
  useScrollSpy: ze
848
849
  }, st = {
849
850
  align: "center",
@@ -896,7 +897,7 @@ const yo = {
896
897
  index: s
897
898
  } = o, {
898
899
  active: n
899
- } = p.useContext(Q);
900
+ } = p.use(Q);
900
901
  let a;
901
902
  t[0] !== e || t[1] !== s ? (a = e ?? s.toString(), t[0] = e, t[1] = s, t[2] = a) : a = t[2];
902
903
  const c = n === a;
@@ -924,7 +925,7 @@ const yo = {
924
925
  align: s,
925
926
  isFitted: n,
926
927
  size: a
927
- } = p.useContext(Q);
928
+ } = p.use(Q);
928
929
  let i;
929
930
  t[0] !== s || t[1] !== l || t[2] !== e || t[3] !== n || t[4] !== a || t[5] !== r ? (i = H("List", e, s, r, l, a, {
930
931
  fitted: n
@@ -945,7 +946,7 @@ const yo = {
945
946
  size: u,
946
947
  active: d,
947
948
  isFitted: _
948
- } = p.useContext(Q);
949
+ } = p.use(Q);
949
950
  let m;
950
951
  t[0] !== e || t[1] !== s ? (m = e ?? s.toString(), t[0] = e, t[1] = s, t[2] = m) : m = t[2];
951
952
  const g = d === m, f = a ?? g;
@@ -977,7 +978,7 @@ const yo = {
977
978
  t[3] !== l || t[4] !== s ? (n = /* @__PURE__ */ h.jsx("div", { className: s, children: l }), t[3] = l, t[4] = s, t[5] = n) : n = t[5];
978
979
  let a;
979
980
  return t[6] !== o || t[7] !== n ? (a = /* @__PURE__ */ h.jsx(Me, { ...o, children: n }), t[6] = o, t[7] = n, t[8] = a) : a = t[8], a;
980
- }, ko = {
981
+ }, Lo = {
981
982
  Root: mo,
982
983
  List: ao,
983
984
  Item: uo,
@@ -985,12 +986,12 @@ const yo = {
985
986
  Panels: io
986
987
  };
987
988
  export {
988
- xo as Accordion,
989
- vo as Breadcrumb,
990
- po as LNB,
991
- Co as List,
992
- $o as Pagination,
993
- yo as ScrollSpy,
994
- ko as Tab,
989
+ vo as Accordion,
990
+ Co as Breadcrumb,
991
+ $o as LNB,
992
+ po as List,
993
+ yo as Pagination,
994
+ ko as ScrollSpy,
995
+ Lo as Tab,
995
996
  ve as makeNavigation
996
997
  };
@@ -35,6 +35,21 @@ export declare const colorThemes: {
35
35
  swapDarkLightGold: "#b76e00";
36
36
  swapDarkLightBlue: "#063ba7";
37
37
  swapDarkLightPrimary: "#007867";
38
+ chartCategorical: {
39
+ "0": "#00a76f";
40
+ "1": "#0c68e9";
41
+ "2": "#ffab00";
42
+ "3": "#8e33ff";
43
+ "4": "#00b8d9";
44
+ "5": "#f5222d";
45
+ "6": "#1cc95c";
46
+ "7": "#919eab";
47
+ };
48
+ chartGrid: string;
49
+ chartAxis: "#919eab";
50
+ chartLabel: "#637381";
51
+ chartTooltipBg: "#1c252e";
52
+ chartTooltipText: "#ffffff";
38
53
  };
39
54
  dark: {
40
55
  textPrimary: "#ffffff";
@@ -72,6 +87,21 @@ export declare const colorThemes: {
72
87
  swapDarkLightGold: "#ffd666";
73
88
  swapDarkLightBlue: "#6bb1f8";
74
89
  swapDarkLightPrimary: "#5be49b";
90
+ chartCategorical: {
91
+ "0": "#5be49b";
92
+ "1": "#6bb1f8";
93
+ "2": "#ffd666";
94
+ "3": "#c684ff";
95
+ "4": "#61f3f3";
96
+ "5": "#ff8587";
97
+ "6": "#77ed8b";
98
+ "7": "#c4cdd5";
99
+ };
100
+ chartGrid: string;
101
+ chartAxis: "#919eab";
102
+ chartLabel: "#c4cdd5";
103
+ chartTooltipBg: "#f9fafb";
104
+ chartTooltipText: "#1c252e";
75
105
  };
76
106
  primary: {
77
107
  pLighter: "#c8fad6";