@tcn/ui 0.3.0 → 0.3.1

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 (127) hide show
  1. package/dist/Color-ASIRERSW-B4GaVKuQ.js +990 -0
  2. package/dist/Color-ASIRERSW-B4GaVKuQ.js.map +1 -0
  3. package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js +1485 -0
  4. package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js.map +1 -0
  5. package/dist/actions/__docs__/components/gallery.d.ts +8 -0
  6. package/dist/actions/__docs__/components/gallery.d.ts.map +1 -0
  7. package/dist/actions/__docs__/components/gallery.js +20 -0
  8. package/dist/actions/__docs__/components/gallery.js.map +1 -0
  9. package/dist/actions/__docs__/components/showcase.d.ts +27 -0
  10. package/dist/actions/__docs__/components/showcase.d.ts.map +1 -0
  11. package/dist/actions/__docs__/components/showcase.js +15 -0
  12. package/dist/actions/__docs__/components/showcase.js.map +1 -0
  13. package/dist/actions/button/base_button/base_button.d.ts +2 -0
  14. package/dist/actions/button/base_button/base_button.d.ts.map +1 -1
  15. package/dist/actions/button/base_button/base_button.js +18 -16
  16. package/dist/actions/button/base_button/base_button.js.map +1 -1
  17. package/dist/actions/button/button/button.js +6 -6
  18. package/dist/actions/button/button_group/button_group.js +1 -1
  19. package/dist/actions/button/select_group/select_group.js +13 -13
  20. package/dist/actions/button/select_group/single_select_group.js +6 -6
  21. package/dist/actions/button/slim_button/slim_button.js +2 -2
  22. package/dist/actions/types.d.ts +2 -0
  23. package/dist/actions/types.d.ts.map +1 -0
  24. package/dist/actions/types.js +2 -0
  25. package/dist/actions/types.js.map +1 -0
  26. package/dist/feedback/loading/loading.js +12 -12
  27. package/dist/feedback/loading/loading.js.map +1 -1
  28. package/dist/feedback/progress/progress_bar.js +1 -1
  29. package/dist/form/field/common/field_control/field_control.js +8 -8
  30. package/dist/form/field/common/status_input/status_input.js +6 -6
  31. package/dist/form/field/field.js +5 -5
  32. package/dist/form/field/h_field/h_field.js +11 -11
  33. package/dist/form/field/v_field/v_field.js +10 -10
  34. package/dist/form/field_set/field_set.js +3 -3
  35. package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js +6 -0
  36. package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js.map +1 -0
  37. package/dist/gallery.css +1 -0
  38. package/dist/inputs/checkbox/checkbox.js +11 -11
  39. package/dist/inputs/color_input/color_picker.js +5 -5
  40. package/dist/inputs/combo_box/combo_box.js +16 -16
  41. package/dist/inputs/date_picker/date_picker.js +18 -18
  42. package/dist/inputs/date_picker/date_picker_body.js +2 -2
  43. package/dist/inputs/date_picker/date_picker_input.js +18 -18
  44. package/dist/inputs/input/input.js +5 -5
  45. package/dist/inputs/mask_input/key_capture_input.js +7 -7
  46. package/dist/inputs/mask_input/mask_input.js +4 -4
  47. package/dist/inputs/multi_combo_box/multi_combo_box.js +17 -17
  48. package/dist/inputs/multiselect/multiselect.js +13 -13
  49. package/dist/inputs/multiselect/multiselect_row.js +8 -8
  50. package/dist/inputs/phone_number_input/phone_number_input.js +11 -11
  51. package/dist/inputs/radio/radio.js +10 -10
  52. package/dist/inputs/radio/radio_row.js +3 -3
  53. package/dist/inputs/select/select.js +14 -14
  54. package/dist/inputs/slider/slider.js +10 -10
  55. package/dist/inputs/switch/switch.js +4 -4
  56. package/dist/inputs/textarea/textarea.js +7 -7
  57. package/dist/inputs/unit_input/unit_input.js +4 -4
  58. package/dist/layouts/body/h_body.js +7 -7
  59. package/dist/layouts/body/v_body.js +6 -6
  60. package/dist/layouts/column/column.js +17 -17
  61. package/dist/layouts/footer/footer.js +7 -7
  62. package/dist/layouts/grid/grid.js +24 -24
  63. package/dist/layouts/header/header.js +2 -2
  64. package/dist/layouts/list/item.js +2 -2
  65. package/dist/layouts/list/list.js +7 -7
  66. package/dist/layouts/list/section_header.js +6 -6
  67. package/dist/layouts/scaffold/scaffold.js +16 -16
  68. package/dist/layouts/sidebar_end/sidebar_end.js +14 -14
  69. package/dist/layouts/sidebar_start/sidebar_start.js +10 -10
  70. package/dist/layouts/utility_bar/utility_bar.js +10 -10
  71. package/dist/overlay/frame/frame.js +4 -4
  72. package/dist/overlay/menu/menu.js +34 -34
  73. package/dist/overlay/portal/portal_platform_context.js +4 -4
  74. package/dist/showcase-WfP6kBEb.js +58401 -0
  75. package/dist/showcase-WfP6kBEb.js.map +1 -0
  76. package/dist/showcase.css +1 -0
  77. package/dist/stacks/box/box.js +23 -23
  78. package/dist/stacks/h_collapsible_box.js +2 -2
  79. package/dist/stacks/h_stack.js +41 -41
  80. package/dist/stacks/spacer.js +11 -11
  81. package/dist/stacks/story_components/circle.js +10 -10
  82. package/dist/stacks/story_components/picture_placeholder.js +9 -9
  83. package/dist/stacks/story_components/rect.js +7 -7
  84. package/dist/stacks/story_components/style_box.js +4 -4
  85. package/dist/stacks/utils/use_is_collapsed.js +6 -6
  86. package/dist/stacks/v_collapsible_box.js +2 -2
  87. package/dist/stacks/v_stack.js +42 -42
  88. package/dist/stacks/z_stack.js +39 -39
  89. package/dist/surfaces/alert/alert.js +4 -4
  90. package/dist/surfaces/card/card.js +4 -4
  91. package/dist/surfaces/confirm/confirm.js +9 -9
  92. package/dist/surfaces/drawers/drawer_start/drawer_start.js +2 -2
  93. package/dist/surfaces/drawers/drawer_top/drawer_top.js +2 -2
  94. package/dist/surfaces/modal/modal.js +5 -5
  95. package/dist/surfaces/page/h_page.js +7 -7
  96. package/dist/surfaces/page/v_page.js +5 -5
  97. package/dist/surfaces/panel/h_panel.js +14 -14
  98. package/dist/surfaces/panel/v_panel.js +9 -9
  99. package/dist/surfaces/pop_confirm/pop_confirm.js +6 -6
  100. package/dist/surfaces/popconfirm/pop_confirm.js +8 -8
  101. package/dist/surfaces/tooltip/tooltip.js +8 -8
  102. package/dist/surfaces/window/window.js +9 -9
  103. package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js +3777 -0
  104. package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js.map +1 -0
  105. package/dist/themes/themes/ergo/ergo_theme.js +33 -1
  106. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  107. package/dist/tokens/badge/badge.js +9 -9
  108. package/dist/tokens/bubble/bubble.js +8 -8
  109. package/dist/tokens/chip/chip.js +3 -3
  110. package/dist/utils/click_away_listener.js +10 -10
  111. package/dist/utils/click_away_listener.js.map +1 -1
  112. package/dist/utils/dnd/draggable/draggable.js +4 -4
  113. package/dist/utils/dnd/handle.js +8 -8
  114. package/dist/utils/focus_redirect.js +5 -5
  115. package/dist/utils/hooks/make_context_hook.js +4 -4
  116. package/dist/utils/hooks/use_media_query.js +2 -2
  117. package/dist/utils/hooks/use_media_query.js.map +1 -1
  118. package/package.json +1 -1
  119. package/src/actions/__docs__/actions.mdx +131 -0
  120. package/src/actions/__docs__/actions.stories.tsx +309 -0
  121. package/src/actions/__docs__/components/gallery.module.css +6 -0
  122. package/src/actions/__docs__/components/gallery.tsx +28 -0
  123. package/src/actions/__docs__/components/showcase.module.css +55 -0
  124. package/src/actions/__docs__/components/showcase.tsx +121 -0
  125. package/src/actions/button/base_button/base_button.tsx +5 -1
  126. package/src/actions/types.ts +6 -0
  127. package/src/themes/themes/ergo/ergo_theme.css +33 -1
@@ -1,9 +1,9 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { Box as x } from "../../stacks/box/box.js";
3
- import { VStack as l } from "../../stacks/v_stack.js";
4
- import { clsx as B } from "clsx";
5
- import _ from "react";
6
- import '../../sidebar_start.css';const y = "_sidebarStartBox_4353011", u = "_sidebarStart_5b1e45b", e = { sidebarStartBox: y, sidebarStart: u }, I = _.forwardRef(
2
+ import { Box as p } from "../../stacks/box/box.js";
3
+ import { VStack as x } from "../../stacks/v_stack.js";
4
+ import { clsx as _ } from "clsx";
5
+ import B from "react";
6
+ import '../../sidebar_start.css';const u = "_sidebarStartBox_4353011", y = "_sidebarStart_5b1e45b", e = { sidebarStartBox: u, sidebarStart: y }, I = B.forwardRef(
7
7
  function({
8
8
  hierarchy: c = "secondary",
9
9
  children: d,
@@ -17,9 +17,9 @@ import '../../sidebar_start.css';const y = "_sidebarStartBox_4353011", u = "_sid
17
17
  vAlign: f = "start",
18
18
  className: m,
19
19
  ...n
20
- }, p) {
20
+ }, l) {
21
21
  return /* @__PURE__ */ s(
22
- x,
22
+ p,
23
23
  {
24
24
  width: b,
25
25
  height: i,
@@ -30,7 +30,7 @@ import '../../sidebar_start.css';const y = "_sidebarStartBox_4353011", u = "_sid
30
30
  className: e.sidebarStartBox,
31
31
  ...n,
32
32
  children: /* @__PURE__ */ s(
33
- l,
33
+ x,
34
34
  {
35
35
  minWidth: r,
36
36
  maxWidth: t,
@@ -38,9 +38,9 @@ import '../../sidebar_start.css';const y = "_sidebarStartBox_4353011", u = "_sid
38
38
  maxHeight: o,
39
39
  hAlign: S,
40
40
  vAlign: f,
41
- ref: p,
41
+ ref: l,
42
42
  "data-hierarchy": c,
43
- className: B(e.sidebarStart, m, "sidebar-start"),
43
+ className: _(e.sidebarStart, m, "sidebar-start"),
44
44
  zIndex: 0,
45
45
  children: d
46
46
  }
@@ -1,23 +1,23 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import l from "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import c from "react";
3
3
  import { clsx as y } from "clsx";
4
4
  import { HStack as m } from "../../stacks/h_stack.js";
5
- import '../../utility_bar.css';const u = "_utility-bar_3a92315", n = { "utility-bar": u }, x = l.forwardRef(
5
+ import '../../utility_bar.css';const u = "_utility-bar_3a92315", f = { "utility-bar": u }, h = c.forwardRef(
6
6
  function({
7
7
  hierarchy: t = "secondary",
8
8
  height: r = "auto",
9
9
  children: a,
10
10
  className: i,
11
11
  size: o = "md",
12
- ...s
13
- }, c) {
14
- return /* @__PURE__ */ e(
12
+ ...e
13
+ }, l) {
14
+ return /* @__PURE__ */ s(
15
15
  m,
16
16
  {
17
- ref: c,
17
+ ref: l,
18
18
  as: "header",
19
19
  className: y(
20
- n["utility-bar"],
20
+ f["utility-bar"],
21
21
  i,
22
22
  "utility-bar",
23
23
  "tcn-utility-bar"
@@ -25,13 +25,13 @@ import '../../utility_bar.css';const u = "_utility-bar_3a92315", n = { "utility-
25
25
  "data-hierarchy": t,
26
26
  "data-size": o,
27
27
  height: r,
28
- ...s,
28
+ ...e,
29
29
  children: a
30
30
  }
31
31
  );
32
32
  }
33
33
  );
34
34
  export {
35
- x as UtilityBar
35
+ h as UtilityBar
36
36
  };
37
37
  //# sourceMappingURL=utility_bar.js.map
@@ -11,21 +11,21 @@ import { Portal as s } from "../portal/portal.js";
11
11
  import { Draggable as n } from "../../utils/dnd/draggable/draggable.js";
12
12
  import { clsx as p } from "clsx";
13
13
  import '../../frame.css';const d = "_frame_ce82001", h = { frame: d }, D = c.forwardRef(function({
14
- children: m,
15
- isOpen: e = !1,
14
+ children: e,
15
+ isOpen: m = !1,
16
16
  draggable: o = !0,
17
17
  veil: a = !1,
18
18
  className: i,
19
19
  ...f
20
20
  }, l) {
21
- return e ? /* @__PURE__ */ r(s, { children: /* @__PURE__ */ r(t, { width: "100%", height: "100%", "data-is-veil": a, className: "tcn-frame-veil", children: /* @__PURE__ */ r(n, { draggable: o, children: /* @__PURE__ */ r(
21
+ return m ? /* @__PURE__ */ r(s, { children: /* @__PURE__ */ r(t, { width: "100%", height: "100%", "data-is-veil": a, className: "tcn-frame-veil", children: /* @__PURE__ */ r(n, { draggable: o, children: /* @__PURE__ */ r(
22
22
  t,
23
23
  {
24
24
  as: "dialog",
25
25
  ref: l,
26
26
  className: p(h.frame, "tcn-frame", i),
27
27
  ...f,
28
- children: m
28
+ children: e
29
29
  }
30
30
  ) }) }) }) : null;
31
31
  });
@@ -3,7 +3,7 @@ import { BodyText as O } from "../../typography/body_text/body_text.js";
3
3
  import "../../utils/click_away_listener.js";
4
4
  import "../../utils/focus_redirect.js";
5
5
  import "../../utils/scroll_away_listener.js";
6
- import f, { useState as F, useLayoutEffect as _, useRef as M } from "react";
6
+ import f, { useState as F, useLayoutEffect as V, useRef as M } from "react";
7
7
  import { useForkRef as T } from "../../utils/hooks/use_fork_ref.js";
8
8
  import "../../utils/hooks/use_resize_observer.js";
9
9
  import { HStack as G } from "../../stacks/h_stack.js";
@@ -12,23 +12,23 @@ import { Popper as K } from "../popper/legacy/popper.js";
12
12
  import { clsx as L } from "clsx";
13
13
  import '../../menu.css';const Q = "_menu_9ce21e3", U = "_menu-item_68b387f", j = { menu: Q, "menu-item": U }, Z = f.forwardRef(function({
14
14
  anchorElement: R,
15
- verticalAnchor: y,
15
+ verticalAnchor: d,
16
16
  verticalOrigin: S,
17
17
  verticalOffset: i,
18
18
  horizontalAnchor: C,
19
19
  horizontalOrigin: X,
20
20
  horizontalOffset: h,
21
- direction: m,
22
- open: d,
21
+ direction: l,
22
+ open: y,
23
23
  onClose: x,
24
24
  restoreFocus: Y,
25
25
  veil: s,
26
26
  onActivatedMenu: c,
27
- children: b = [],
27
+ children: _ = [],
28
28
  className: E,
29
- ...I
30
- }, z) {
31
- const [P, r] = F(-1), l = f.Children.toArray(b).map((t, a) => {
29
+ ...b
30
+ }, I) {
31
+ const [z, r] = F(-1), m = f.Children.toArray(_).map((t, a) => {
32
32
  if (!f.isValidElement(t))
33
33
  return t;
34
34
  if (t.type !== D)
@@ -41,13 +41,13 @@ import '../../menu.css';const Q = "_menu_9ce21e3", U = "_menu-item_68b387f", j =
41
41
  const k = {
42
42
  ...t.props,
43
43
  key: a,
44
- verticalAnchor: m === "up" ? "bottom" : "top",
45
- verticalOrigin: m === "up" ? "bottom" : "top",
44
+ verticalAnchor: l === "up" ? "bottom" : "top",
45
+ verticalOrigin: l === "up" ? "bottom" : "top",
46
46
  verticalOffset: i,
47
47
  horizontalAnchor: "end",
48
48
  horizontalOrigin: "start",
49
49
  horizontalOffset: h,
50
- direction: m,
50
+ direction: l,
51
51
  onClick: (e) => {
52
52
  t.props.children == null && x && x(), t.props.onClick && t.props.onClick(e);
53
53
  },
@@ -55,53 +55,53 @@ import '../../menu.css';const Q = "_menu_9ce21e3", U = "_menu-item_68b387f", j =
55
55
  r(a), c && c(!0), t.props.onMouseEnter && t.props.onMouseEnter(e);
56
56
  }
57
57
  };
58
- return t.type === D && (k.open = P === a), f.cloneElement(t, k);
58
+ return t.type === D && (k.open = z === a), f.cloneElement(t, k);
59
59
  });
60
- return m === "up" && l.reverse(), _(() => {
61
- d || (r(-1), c && c(!1));
62
- }, [d, c]), /* @__PURE__ */ g(
60
+ return l === "up" && m.reverse(), V(() => {
61
+ y || (r(-1), c && c(!1));
62
+ }, [y, c]), /* @__PURE__ */ g(
63
63
  K,
64
64
  {
65
65
  anchorElement: R,
66
- verticalAnchor: y,
66
+ verticalAnchor: d,
67
67
  verticalOrigin: S,
68
68
  verticalOffset: i,
69
69
  horizontalAnchor: C || "end",
70
70
  horizontalOrigin: X || "end",
71
71
  horizontalOffset: h,
72
- open: d,
72
+ open: y,
73
73
  onClose: x,
74
74
  restoreFocus: Y,
75
75
  veil: s,
76
- children: /* @__PURE__ */ g(J, { ref: z, className: L(j.menu, E, "menu"), ...I, children: l })
76
+ children: /* @__PURE__ */ g(J, { ref: I, className: L(j.menu, E, "menu"), ...b, children: m })
77
77
  }
78
78
  );
79
79
  }), D = f.forwardRef(function({
80
80
  selected: R,
81
- label: y,
81
+ label: d,
82
82
  className: S,
83
83
  children: i,
84
84
  direction: C = "down",
85
85
  verticalAnchor: X = "top",
86
86
  verticalOrigin: h = "top",
87
- verticalOffset: m,
88
- horizontalAnchor: d = "end",
87
+ verticalOffset: l,
88
+ horizontalAnchor: y = "end",
89
89
  horizontalOrigin: x = "start",
90
90
  horizontalOffset: Y,
91
91
  open: s = !1,
92
92
  ...c
93
- }, b) {
94
- const E = M(!1), I = M({ x: -1, y: -1 }), z = M({ x: -1, y: -1 }), [P, r] = F(!1), l = M(null), t = T(b, l), a = i != null && i.length > 0;
93
+ }, _) {
94
+ const E = M(!1), b = M({ x: -1, y: -1 }), I = M({ x: -1, y: -1 }), [z, r] = F(!1), m = M(null), t = T(_, m), a = i != null && i.length > 0;
95
95
  function k() {
96
96
  r(!1);
97
97
  }
98
- return _(() => {
99
- const e = l.current;
98
+ return V(() => {
99
+ const e = m.current;
100
100
  if (e && a && s) {
101
- const u = window.getComputedStyle(e).direction, o = I.current, p = z.current, B = (n) => {
101
+ const u = window.getComputedStyle(e).direction, o = b.current, p = I.current, B = (n) => {
102
102
  o.x === -1 && (o.x = n.clientX, o.y = n.clientY);
103
- const V = n.clientX - o.x, w = n.clientY - o.y;
104
- if (p.x = Math.max(Math.abs(V), 1e-3), p.y = Math.max(Math.abs(w), 1e-3), (V < 0 || u === "down" && w < 0 || u === "up" && w > 0) && u === "ltr" || (V > 0 || u === "down" && w < 0 || u === "up" && w > 0) && u === "rtl") {
103
+ const P = n.clientX - o.x, w = n.clientY - o.y;
104
+ if (p.x = Math.max(Math.abs(P), 1e-3), p.y = Math.max(Math.abs(w), 1e-3), (P < 0 || u === "down" && w < 0 || u === "up" && w > 0) && u === "ltr" || (P > 0 || u === "down" && w < 0 || u === "up" && w > 0) && u === "rtl") {
105
105
  o.x = n.clientX, o.y = n.clientY, r(!1);
106
106
  return;
107
107
  }
@@ -119,7 +119,7 @@ import '../../menu.css';const Q = "_menu_9ce21e3", U = "_menu-item_68b387f", j =
119
119
  window.removeEventListener("mousemove", B);
120
120
  };
121
121
  }
122
- }, [a, s]), _(() => {
122
+ }, [a, s]), V(() => {
123
123
  r(s);
124
124
  }, [s]), /* @__PURE__ */ W(q, { children: [
125
125
  /* @__PURE__ */ g(
@@ -132,21 +132,21 @@ import '../../menu.css';const Q = "_menu_9ce21e3", U = "_menu-item_68b387f", j =
132
132
  className: L(S, j["menu-item"], "menu-item"),
133
133
  "data-is-open": s,
134
134
  ...c,
135
- children: typeof y == "string" ? /* @__PURE__ */ g(O, { color: "inherit", children: y }) : y
135
+ children: typeof d == "string" ? /* @__PURE__ */ g(O, { color: "inherit", children: d }) : d
136
136
  }
137
137
  ),
138
138
  i && /* @__PURE__ */ g(
139
139
  Z,
140
140
  {
141
- anchorElement: l.current,
142
- veil: P,
141
+ anchorElement: m.current,
142
+ veil: z,
143
143
  onClose: k,
144
144
  open: s,
145
145
  direction: C,
146
146
  verticalAnchor: X,
147
147
  verticalOrigin: h,
148
- verticalOffset: m,
149
- horizontalAnchor: d,
148
+ verticalOffset: l,
149
+ horizontalAnchor: y,
150
150
  horizontalOrigin: x,
151
151
  horizontalOffset: Y,
152
152
  hAlign: "start",
@@ -1,12 +1,12 @@
1
1
  import o, { useContext as r } from "react";
2
2
  import { PortalPlatform as e } from "./portal_platform.js";
3
- const a = new e(), t = o.createContext(a), n = t.Provider;
4
- function f() {
3
+ const a = new e(), t = o.createContext(a), f = t.Provider;
4
+ function n() {
5
5
  return r(t);
6
6
  }
7
7
  export {
8
8
  t as PortalPlatformContext,
9
- n as PortalPlatformProvider,
10
- f as usePortalPlatform
9
+ f as PortalPlatformProvider,
10
+ n as usePortalPlatform
11
11
  };
12
12
  //# sourceMappingURL=portal_platform_context.js.map