@tcn/ui 0.0.4 → 0.2.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 (198) hide show
  1. package/README.md +38 -3
  2. package/dist/actions/button/base_button/base_button.d.ts.map +1 -1
  3. package/dist/actions/button/base_button/base_button.js +17 -12
  4. package/dist/actions/button/base_button/base_button.js.map +1 -1
  5. package/dist/actions/button/button/button.d.ts.map +1 -1
  6. package/dist/actions/button/button/button.js +7 -7
  7. package/dist/actions/button/button/button.js.map +1 -1
  8. package/dist/actions/button/slim_button/slim_button.js +2 -2
  9. package/dist/actions/button/slim_button/slim_button.js.map +1 -1
  10. package/dist/button.css +1 -1
  11. package/dist/draggable.css +1 -0
  12. package/dist/feedback/progress/progress_bar.js +1 -1
  13. package/dist/footer.css +1 -1
  14. package/dist/form/field/common/field_description.js +1 -1
  15. package/dist/form/field/common/field_error.js +4 -3
  16. package/dist/form/field/common/field_error.js.map +1 -1
  17. package/dist/form/field/common/field_label.js +1 -1
  18. package/dist/inputs/date_picker/date_picker_date.js +1 -1
  19. package/dist/inputs/date_picker/date_picker_day.js +1 -1
  20. package/dist/inputs/date_picker/date_picker_time_selector.js +1 -1
  21. package/dist/inputs/date_picker/date_picker_year_selector.js +1 -1
  22. package/dist/inputs/input/input.d.ts +2 -2
  23. package/dist/inputs/input/input.d.ts.map +1 -1
  24. package/dist/inputs/input/input.js.map +1 -1
  25. package/dist/inputs/options/option.d.ts +1 -0
  26. package/dist/inputs/options/option.d.ts.map +1 -1
  27. package/dist/inputs/options/option.js.map +1 -1
  28. package/dist/inputs/phone_number_input/phone_number_input.d.ts +8 -1
  29. package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
  30. package/dist/inputs/phone_number_input/phone_number_input.js +187 -137
  31. package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
  32. package/dist/inputs/suggestions/suggestion_item.d.ts +1 -1
  33. package/dist/inputs/suggestions/suggestion_item.d.ts.map +1 -1
  34. package/dist/inputs/suggestions/suggestion_item.js +23 -18
  35. package/dist/inputs/suggestions/suggestion_item.js.map +1 -1
  36. package/dist/inputs/suggestions/suggestion_list.d.ts +1 -1
  37. package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
  38. package/dist/inputs/suggestions/suggestion_list.js +106 -96
  39. package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
  40. package/dist/inputs/textarea/textarea.d.ts +2 -2
  41. package/dist/inputs/textarea/textarea.d.ts.map +1 -1
  42. package/dist/inputs/textarea/textarea.js.map +1 -1
  43. package/dist/layouts/footer/footer.js +5 -5
  44. package/dist/layouts/footer/footer.js.map +1 -1
  45. package/dist/layouts/header/header.d.ts.map +1 -1
  46. package/dist/layouts/header/header.js.map +1 -1
  47. package/dist/layouts/index.d.ts +3 -2
  48. package/dist/layouts/index.d.ts.map +1 -1
  49. package/dist/layouts/index.js +26 -24
  50. package/dist/layouts/index.js.map +1 -1
  51. package/dist/layouts/list/item.d.ts +1 -0
  52. package/dist/layouts/list/item.d.ts.map +1 -1
  53. package/dist/layouts/list/item.js +17 -6
  54. package/dist/layouts/list/item.js.map +1 -1
  55. package/dist/layouts/list/list.js +10 -10
  56. package/dist/layouts/list/list.js.map +1 -1
  57. package/dist/overlay/context_menu/context_menu.js +4 -4
  58. package/dist/overlay/frame/frame.d.ts +11 -0
  59. package/dist/overlay/frame/frame.d.ts.map +1 -0
  60. package/dist/overlay/frame/frame.js +18 -0
  61. package/dist/overlay/frame/frame.js.map +1 -0
  62. package/dist/overlay/index.d.ts +1 -0
  63. package/dist/overlay/index.d.ts.map +1 -1
  64. package/dist/overlay/index.js +5 -3
  65. package/dist/overlay/index.js.map +1 -1
  66. package/dist/overlay/popper/popper.js +12 -12
  67. package/dist/{portal-qqIp4SIl.js → overlay/portal/portal.js} +3 -3
  68. package/dist/overlay/portal/portal.js.map +1 -0
  69. package/dist/overlay/portal/portal_platform.js +3 -4
  70. package/dist/overlay/portal/portal_platform.js.map +1 -1
  71. package/dist/phone_number_input.css +1 -1
  72. package/dist/slim_button.css +1 -1
  73. package/dist/stacks/box/box.d.ts +1 -1
  74. package/dist/stacks/box/box.d.ts.map +1 -1
  75. package/dist/stacks/box/box.js.map +1 -1
  76. package/dist/surfaces/card/card.d.ts.map +1 -1
  77. package/dist/surfaces/card/card.js +7 -16
  78. package/dist/surfaces/card/card.js.map +1 -1
  79. package/dist/surfaces/confirm/confirm.js +4 -4
  80. package/dist/surfaces/index.d.ts +2 -2
  81. package/dist/surfaces/index.d.ts.map +1 -1
  82. package/dist/surfaces/index.js +22 -22
  83. package/dist/surfaces/modal/modal.d.ts +3 -2
  84. package/dist/surfaces/modal/modal.d.ts.map +1 -1
  85. package/dist/surfaces/modal/modal.js +14 -13
  86. package/dist/surfaces/modal/modal.js.map +1 -1
  87. package/dist/surfaces/window/window.d.ts +3 -2
  88. package/dist/surfaces/window/window.d.ts.map +1 -1
  89. package/dist/surfaces/window/window.js +17 -7
  90. package/dist/surfaces/window/window.js.map +1 -1
  91. package/dist/themes/index.js +6 -141
  92. package/dist/themes/index.js.map +1 -1
  93. package/dist/themes/stylesheets/reset.js +140 -0
  94. package/dist/themes/stylesheets/reset.js.map +1 -0
  95. package/dist/themes/themes/ergo/ergo_theme.js +664 -0
  96. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -0
  97. package/dist/tokens/bubble/bubble.js +17 -16
  98. package/dist/tokens/bubble/bubble.js.map +1 -1
  99. package/dist/tokens/chip/chip.js +9 -8
  100. package/dist/tokens/chip/chip.js.map +1 -1
  101. package/dist/typography/title/title.d.ts +2 -1
  102. package/dist/typography/title/title.d.ts.map +1 -1
  103. package/dist/typography/title/title.js +24 -23
  104. package/dist/typography/title/title.js.map +1 -1
  105. package/dist/utils/dnd/context.d.ts +4 -0
  106. package/dist/utils/dnd/context.d.ts.map +1 -0
  107. package/dist/utils/dnd/context.js +20 -0
  108. package/dist/utils/dnd/context.js.map +1 -0
  109. package/dist/utils/dnd/draggable/draggable.d.ts +7 -0
  110. package/dist/utils/dnd/draggable/draggable.d.ts.map +1 -0
  111. package/dist/utils/dnd/draggable/draggable.js +27 -0
  112. package/dist/utils/dnd/draggable/draggable.js.map +1 -0
  113. package/dist/utils/dnd/handle.d.ts +6 -0
  114. package/dist/utils/dnd/handle.d.ts.map +1 -0
  115. package/dist/utils/dnd/handle.js +22 -0
  116. package/dist/utils/dnd/handle.js.map +1 -0
  117. package/dist/utils/dnd/hooks/use_drag_container.d.ts +7 -0
  118. package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +1 -0
  119. package/dist/utils/dnd/hooks/use_drag_container.js +30 -0
  120. package/dist/utils/dnd/hooks/use_drag_container.js.map +1 -0
  121. package/dist/utils/{hooks → dnd/hooks}/use_draggable.d.ts +3 -3
  122. package/dist/utils/dnd/hooks/use_draggable.d.ts.map +1 -0
  123. package/dist/utils/dnd/hooks/use_draggable.js +41 -0
  124. package/dist/utils/dnd/hooks/use_draggable.js.map +1 -0
  125. package/dist/utils/dnd/types.d.ts +10 -0
  126. package/dist/utils/dnd/types.d.ts.map +1 -0
  127. package/dist/utils/dnd/types.js +2 -0
  128. package/dist/utils/dnd/types.js.map +1 -0
  129. package/dist/utils/index.d.ts +1 -1
  130. package/dist/utils/index.d.ts.map +1 -1
  131. package/dist/utils/index.js +1 -1
  132. package/package.json +9 -3
  133. package/src/actions/button/base_button/base_button.tsx +7 -2
  134. package/src/actions/button/button/button.module.css +0 -78
  135. package/src/actions/button/button/button.tsx +2 -4
  136. package/src/actions/button/slim_button/slim_button.module.css +0 -26
  137. package/src/actions/button/slim_button/slim_button.tsx +1 -1
  138. package/src/inputs/input/input.tsx +3 -2
  139. package/src/inputs/options/option.tsx +1 -0
  140. package/src/inputs/phone_number_input/phone_number_input.module.css +12 -0
  141. package/src/inputs/phone_number_input/phone_number_input.stories.tsx +8 -0
  142. package/src/inputs/phone_number_input/phone_number_input.tsx +107 -21
  143. package/src/inputs/suggestions/suggestion_item.tsx +12 -2
  144. package/src/inputs/suggestions/suggestion_list.tsx +22 -3
  145. package/src/inputs/textarea/textarea.tsx +2 -2
  146. package/src/layouts/footer/footer.module.css +0 -1
  147. package/src/layouts/footer/footer.tsx +1 -1
  148. package/src/layouts/header/header.tsx +0 -1
  149. package/src/layouts/index.ts +3 -2
  150. package/src/layouts/list/item.tsx +10 -2
  151. package/src/layouts/list/list.tsx +2 -2
  152. package/src/overlay/frame/frame.stories.tsx +40 -0
  153. package/src/overlay/frame/frame.tsx +34 -0
  154. package/src/overlay/frame/frame_stories.module.css +14 -0
  155. package/src/overlay/index.ts +1 -0
  156. package/src/stacks/box/box.tsx +8 -2
  157. package/src/surfaces/card/card.tsx +2 -8
  158. package/src/surfaces/index.ts +2 -2
  159. package/src/surfaces/modal/__stories__/modal.stories.tsx +19 -27
  160. package/src/surfaces/modal/modal.tsx +13 -10
  161. package/src/surfaces/panel/__stories__/panel.stories.tsx +13 -12
  162. package/src/surfaces/window/window.stories.tsx +37 -4
  163. package/src/surfaces/window/window.tsx +14 -6
  164. package/src/themes/themes/ergo/__stories__/components/material_picker/sb_inverted_materials.module.css +34 -0
  165. package/src/themes/themes/ergo/__stories__/components/material_picker/sb_material_picker.tsx +52 -0
  166. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_card.module.css +5 -0
  167. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_card.tsx +40 -0
  168. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_picker.tsx +83 -0
  169. package/src/themes/themes/ergo/__stories__/components/tone_picker/types.ts +7 -0
  170. package/src/themes/themes/ergo/__stories__/material.stories.tsx +154 -0
  171. package/src/themes/themes/ergo/__stories__/sb_materials.module.css +110 -0
  172. package/src/themes/themes/ergo/__stories__/utils.ts +92 -0
  173. package/src/themes/themes/ergo/ergo_theme.css +358 -26
  174. package/src/typography/title/title.tsx +23 -19
  175. package/src/utils/dnd/__stories__/draggable.stories.tsx +48 -0
  176. package/src/utils/dnd/__stories__/draggable_stories.module.css +21 -0
  177. package/src/utils/{__stories__ → dnd/__stories__}/use_draggable.stories.tsx +15 -10
  178. package/src/utils/dnd/context.ts +24 -0
  179. package/src/utils/dnd/draggable/draggable.module.css +8 -0
  180. package/src/utils/dnd/draggable/draggable.tsx +42 -0
  181. package/src/utils/dnd/handle.tsx +32 -0
  182. package/src/utils/dnd/hooks/use_drag_container.ts +42 -0
  183. package/src/utils/{hooks → dnd/hooks}/use_draggable.ts +23 -17
  184. package/src/utils/dnd/types.ts +6 -0
  185. package/src/utils/index.ts +1 -1
  186. package/tsconfig.json +0 -3
  187. package/dist/card.css +0 -1
  188. package/dist/portal-qqIp4SIl.js.map +0 -1
  189. package/dist/themes/stylesheets/reset.css +0 -1
  190. package/dist/themes/themes/ergo/ergo_theme.css +0 -1
  191. package/dist/themes/themes/windows_98/windows_98.css +0 -1
  192. package/dist/title.module-B16de2jd.js +0 -5
  193. package/dist/title.module-B16de2jd.js.map +0 -1
  194. package/dist/utils/hooks/use_draggable.d.ts.map +0 -1
  195. package/dist/utils/hooks/use_draggable.js +0 -30
  196. package/dist/utils/hooks/use_draggable.js.map +0 -1
  197. package/src/surfaces/card/card.module.css +0 -5
  198. /package/dist/{overlay/portal/portal.css → portal_platform.css} +0 -0
@@ -1,21 +1,21 @@
1
- import { jsx as o, jsxs as E, Fragment as ce } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as K, Fragment as ce } from "react/jsx-runtime";
2
2
  import { BodyText as ae } from "../../typography/body_text/body_text.js";
3
- import { clsx as K } from "clsx";
3
+ import { clsx as N } from "clsx";
4
4
  import "../../callout.module-D8ECmxpO.js";
5
5
  import "../../caption.module-DDq0H4xZ.js";
6
6
  import "../../footnote.module-DEyFuqOr.js";
7
7
  import "../../headline.module-BiwHBtGf.js";
8
8
  import "../../subheadline.module-C-v7zMkQ.js";
9
- import "../../title.module-B16de2jd.js";
10
- import { VStack as N } from "../../stacks/v_stack.js";
9
+ import "../../typography/title/title.js";
10
+ import { VStack as O } from "../../stacks/v_stack.js";
11
11
  import { ZStack as ue } from "../../stacks/z_stack.js";
12
- import { Children as pe, isValidElement as de, useState as c, useRef as O, useLayoutEffect as S } from "react";
12
+ import { Children as pe, isValidElement as de, useState as a, useRef as T, useLayoutEffect as S } from "react";
13
13
  import { FocusRedirect as fe } from "../../utils/focus_redirect.js";
14
14
  import "../../utils/click_away_listener.js";
15
15
  import "../../utils/scroll_away_listener.js";
16
16
  import "../../utils/hooks/use_resize_observer.js";
17
17
  import { SuggestionItem as ge } from "./suggestion_item.js";
18
- import { Option as T } from "../options/option.js";
18
+ import { Option as U } from "../options/option.js";
19
19
  import "../../actions/button/base_button/base_button.js";
20
20
  import "../../actions/button/button_group/button_group.js";
21
21
  import "../../actions/button/slim_button/slim_button.js";
@@ -26,68 +26,78 @@ import { Popper as me } from "../../overlay/popper/popper.js";
26
26
  import '../../suggestion_list.css';const we = "_suggestion-list_711fb17", be = "_input_a0df060", R = { "suggestion-list": we, input: be }, I = 50, xe = 50;
27
27
  function je({
28
28
  value: A = "",
29
- scrollToValue: d,
30
- anchorElement: r,
31
- children: U,
32
- onOptionSelect: f,
33
- noSuggestionMessage: V = "-- No Matches --",
34
- onClose: w,
29
+ scrollToValue: g,
30
+ anchorElement: l,
31
+ children: V,
32
+ onOptionSelect: h,
33
+ noSuggestionMessage: P = "-- No Matches --",
34
+ onClose: b,
35
35
  onChange: D,
36
36
  onKeyUp: F,
37
37
  onKeyDown: H,
38
- trimCustomInput: P = !1,
39
- haveValueAsOption: W = !1,
40
- ...$
38
+ trimCustomInput: W = !1,
39
+ haveValueAsOption: $ = !1,
40
+ ...j
41
41
  }) {
42
- const b = pe.toArray(U).filter(
43
- (e) => de(e) && e.type === T
44
- ), [x, j] = c(() => {
45
- if (d != null) {
46
- const e = b.findIndex((i) => i.props.value === d);
42
+ const x = pe.toArray(V).filter(
43
+ (e) => de(e) && e.type === U
44
+ ), [L, q] = a(() => {
45
+ if (g != null) {
46
+ const e = x.findIndex((o) => o.props.value === g);
47
47
  if (e !== -1)
48
48
  return e;
49
49
  }
50
50
  return -1;
51
- }), M = O(""), [q, _] = c(I), [u, L] = c(x), [g, Z] = c(A), l = O(null), [X, z] = c(b.length), [n, B] = c(
51
+ }), M = T(""), [Z, _] = a(I), [f, k] = a(L), [m, X] = a(A), c = T(null), [z, G] = a(x.length), [n, B] = a(
52
52
  () => C(A, I)
53
- ), [G, J] = c(), [Q, Y] = c();
54
- function ee(e) {
55
- const i = e.key, t = e.currentTarget, s = M.current = i;
53
+ ), [J, Q] = a(), [Y, ee] = a();
54
+ function te(e) {
55
+ const o = e.key, t = e.currentTarget, s = M.current = o;
56
56
  if (M.current = "", s)
57
- switch (i) {
57
+ switch (o) {
58
58
  case "Enter": {
59
- if (n[u] == null) {
60
- const p = P ? t.value.trim() : t.value;
59
+ if (n[f] == null) {
60
+ const p = W ? t.value.trim() : t.value;
61
61
  if (p === "")
62
62
  return;
63
- const y = p.toLocaleLowerCase(), a = b.find(
63
+ const y = p.toLocaleLowerCase(), i = x.find(
64
64
  (v) => v.props.value.toLocaleLowerCase() === y || v.props.label != null && v.props.label.toLocaleLowerCase() === y
65
- ), m = a != null, re = a?.props.label || p, le = a?.props.value || p;
65
+ ), E = i != null, d = i?.props.label || p, le = i?.props.value || p;
66
66
  requestAnimationFrame(() => {
67
- f && f(le, re, m);
67
+ h && h(
68
+ le,
69
+ d,
70
+ E,
71
+ i?.props.obfuscate ?? !1
72
+ );
68
73
  });
69
74
  break;
70
75
  }
71
- const h = n[u].props;
72
- if (h.disabled)
76
+ const u = n[f].props;
77
+ if (u.disabled)
73
78
  break;
74
79
  requestAnimationFrame(() => {
75
- f && f(h.value, h.label, !0);
80
+ h && h(
81
+ u.value,
82
+ u.label,
83
+ !0,
84
+ u.obfuscate ?? !1
85
+ );
76
86
  });
77
87
  break;
78
88
  }
79
89
  case "Escape": {
80
- w && w(t.value, t.selectionStart, t.selectionEnd);
90
+ b && b(t.value, t.selectionStart, t.selectionEnd);
81
91
  break;
82
92
  }
83
93
  }
84
94
  F && F(e);
85
95
  }
86
- function te(e) {
87
- const i = e.key;
88
- switch (M.current = i, i) {
96
+ function se(e) {
97
+ const o = e.key;
98
+ switch (M.current = o, o) {
89
99
  case "ArrowDown": {
90
- let t = u + 1;
100
+ let t = f + 1;
91
101
  for (; t < n.length && n[t]?.props.disabled; )
92
102
  t++;
93
103
  if (t === n.length) {
@@ -95,13 +105,13 @@ function je({
95
105
  t++;
96
106
  t === n.length && (t = -1);
97
107
  }
98
- L(t), e.preventDefault();
108
+ k(t), e.preventDefault();
99
109
  break;
100
110
  }
101
111
  case "Tab": {
102
112
  let t = 1;
103
113
  e.shiftKey && (t = -1);
104
- let s = u + t;
114
+ let s = f + t;
105
115
  if (t > 0)
106
116
  for (; s < n.length && n[s]?.props.disabled; )
107
117
  s++;
@@ -117,11 +127,11 @@ function je({
117
127
  s--;
118
128
  s === -1 && (s = -1);
119
129
  }
120
- L(s), e.preventDefault();
130
+ k(s), e.preventDefault();
121
131
  break;
122
132
  }
123
133
  case "ArrowUp": {
124
- let t = u - 1;
134
+ let t = f - 1;
125
135
  for (; t >= 0 && n[t]?.props.disabled; )
126
136
  t--;
127
137
  if (t === -1) {
@@ -129,105 +139,105 @@ function je({
129
139
  t--;
130
140
  t === -1 && (t = -1);
131
141
  }
132
- L(t), e.preventDefault();
142
+ k(t), e.preventDefault();
133
143
  break;
134
144
  }
135
145
  }
136
146
  H && H(e);
137
147
  }
138
- function C(e, i) {
139
- const t = b.filter((s) => {
140
- const k = s.props, h = String(k.label).toLocaleLowerCase(), p = k.keywords?.map((m) => m.toLocaleLowerCase()) || [], y = String(k.value).toLocaleLowerCase(), a = e.toLocaleLowerCase();
141
- return h.includes(a) || p.some((m) => m.includes(a)) || y.includes(a);
148
+ function C(e, o) {
149
+ const t = x.filter((s) => {
150
+ const w = s.props, u = String(w.label).toLocaleLowerCase(), p = w.keywords?.map((d) => d.toLocaleLowerCase()) || [], y = String(w.value).toLocaleLowerCase(), i = e.toLocaleLowerCase();
151
+ return w.obfuscate ?? !1 ? u.includes(i) || p.some((d) => d.includes(i)) : u.includes(i) || p.some((d) => d.includes(i)) || y.includes(i);
142
152
  });
143
- return W && e.trim().length > 0 && !t.some((s) => s.props.value === e) && t.unshift(
144
- /* @__PURE__ */ o(T, { value: e, label: e, keywords: [e], children: e }, "value")
145
- ), z(t.length), t.slice(0, i);
153
+ return $ && e.trim().length > 0 && !t.some((s) => s.props.value === e) && t.unshift(
154
+ /* @__PURE__ */ r(U, { value: e, label: e, keywords: [e], children: e }, "value")
155
+ ), G(t.length), t.slice(0, o);
146
156
  }
147
- function se() {
148
- const e = l.current;
157
+ function ne() {
158
+ const e = c.current;
149
159
  e?.focus();
150
160
  }
151
- function ne() {
152
- const e = l.current;
153
- e != null && w && w(e.value, e.selectionStart, e.selectionEnd);
161
+ function oe() {
162
+ const e = c.current;
163
+ e != null && b && b(e.value, e.selectionStart, e.selectionEnd);
154
164
  }
155
165
  function ie(e) {
156
- const i = e.currentTarget;
157
- _(I), Z(e.target.value);
158
- const t = C(i.value, I);
166
+ const o = e.currentTarget;
167
+ _(I), X(e.target.value);
168
+ const t = C(o.value, I);
159
169
  B(t), D && D(e.target.value);
160
170
  }
161
- function oe() {
162
- const e = q + xe;
171
+ function re() {
172
+ const e = Z + xe;
163
173
  _(e);
164
- const i = C(g, e);
165
- B(i);
174
+ const o = C(m, e);
175
+ B(o);
166
176
  }
167
177
  return S(() => {
168
- const e = l.current;
178
+ const e = c.current;
169
179
  e != null && e.value.length > 0 ? e.select() : e?.focus();
170
180
  }, []), S(() => {
171
- if (r != null) {
172
- const e = r.getBoundingClientRect();
173
- J(`${e.width}px`), Y(`${e.height}px`), l.current != null && r instanceof HTMLInputElement && (l.current.value = r.value, l.current.selectionStart = r.selectionStart, l.current.selectionEnd = r.selectionEnd);
181
+ if (l != null) {
182
+ const e = l.getBoundingClientRect();
183
+ Q(`${e.width}px`), ee(`${e.height}px`), c.current != null && l instanceof HTMLInputElement && (c.current.value = l.value, c.current.selectionStart = l.selectionStart, c.current.selectionEnd = l.selectionEnd);
174
184
  }
175
- }, [r]), S(() => {
176
- if (d != null) {
185
+ }, [l]), S(() => {
186
+ if (g != null) {
177
187
  const e = n.findIndex(
178
- (i) => i.props.value === d
188
+ (o) => o.props.value === g
179
189
  );
180
- j(e);
190
+ q(e);
181
191
  }
182
- }, [n, d]), S(() => {
183
- L(g === "" ? x : -1);
184
- }, [g, x]), /* @__PURE__ */ o(
192
+ }, [n, g]), S(() => {
193
+ k(m === "" ? L : -1);
194
+ }, [m, L]), /* @__PURE__ */ r(
185
195
  me,
186
196
  {
187
197
  open: !0,
188
- anchorElement: r,
189
- onClose: ne,
198
+ anchorElement: l,
199
+ onClose: oe,
190
200
  verticalAnchor: "top",
191
201
  verticalOrigin: "top",
192
202
  verticalOffset: -4,
193
- children: /* @__PURE__ */ E(
194
- N,
203
+ children: /* @__PURE__ */ K(
204
+ O,
195
205
  {
196
- minHeight: `calc(${Q}, 8px)`,
206
+ minHeight: `calc(${Y}, 8px)`,
197
207
  maxHeight: "300px",
198
- minWidth: G,
208
+ minWidth: J,
199
209
  width: "auto",
200
210
  hAlign: "start",
201
- className: K(R["suggestion-list"], "suggestion-list"),
211
+ className: N(R["suggestion-list"], "suggestion-list"),
202
212
  children: [
203
- /* @__PURE__ */ o(
213
+ /* @__PURE__ */ r(
204
214
  "input",
205
215
  {
206
- ref: l,
207
- value: g,
208
- onKeyUp: ee,
209
- onKeyDown: te,
216
+ ref: c,
217
+ value: m,
218
+ onKeyUp: te,
219
+ onKeyDown: se,
210
220
  onChange: ie,
211
- className: K(R.input, "suggestion-list-search-input"),
212
- ...$
221
+ className: N(R.input, "suggestion-list-search-input"),
222
+ ...j
213
223
  },
214
224
  -1
215
225
  ),
216
- /* @__PURE__ */ E(N, { children: [
217
- n.map((e, i) => /* @__PURE__ */ o(
226
+ /* @__PURE__ */ K(O, { children: [
227
+ n.map((e, o) => /* @__PURE__ */ r(
218
228
  ge,
219
229
  {
220
230
  option: e,
221
- isSelected: i === x && g !== "",
222
- isFocused: i === u,
223
- onClick: f
231
+ isSelected: o === L && m !== "",
232
+ isFocused: o === f,
233
+ onClick: h
224
234
  },
225
- i
235
+ o
226
236
  )),
227
- X > n.length && /* @__PURE__ */ o(ce, { children: /* @__PURE__ */ o(he, { marginBlock: "8px", hierarchy: "tertiary", onClick: oe, children: "Show More" }) })
237
+ z > n.length && /* @__PURE__ */ r(ce, { children: /* @__PURE__ */ r(he, { marginBlock: "8px", hierarchy: "tertiary", onClick: re, children: "Show More" }) })
228
238
  ] }),
229
- n.length === 0 && /* @__PURE__ */ o(ue, { padding: "8px", className: R["no-results"], children: /* @__PURE__ */ o(ae, { children: V }) }),
230
- /* @__PURE__ */ o(fe, { onRedirect: se }, n.length + 1)
239
+ n.length === 0 && /* @__PURE__ */ r(ue, { padding: "8px", className: R["no-results"], children: /* @__PURE__ */ r(ae, { children: P }) }),
240
+ /* @__PURE__ */ r(fe, { onRedirect: ne }, n.length + 1)
231
241
  ]
232
242
  }
233
243
  )
@@ -1 +1 @@
1
- {"version":3,"file":"suggestion_list.js","sources":["../../../src/inputs/suggestions/suggestion_list.tsx"],"sourcesContent":["import { BodyText } from '../../typography/index.js';\nimport { VStack } from '../../stacks/v_stack.js';\nimport { ZStack } from '../../stacks/z_stack.js';\nimport { clsx } from 'clsx';\nimport React, { useLayoutEffect, Children, isValidElement } from 'react';\nimport { useRef, useState } from 'react';\nimport { FocusRedirect } from '../../utils/index.js';\nimport { SuggestionItem } from './suggestion_item.js';\nimport { OptionProps, Option } from '../options/option.js';\nimport styles from './suggestion_list.module.css';\n\nimport { Button } from '../../actions/index.js';\nimport { Popper } from '../../overlay/popper/popper.js';\n\nconst MAX_RESULTS = 50;\nconst BATCH_SIZE = 50;\n\nexport interface SuggestionListProps\n extends Omit<React.HTMLAttributes<HTMLInputElement>, 'onChange'> {\n value?: string;\n scrollToValue?: string;\n anchorElement: HTMLElement | null;\n children?: React.ReactNode;\n onChange?: (value: string) => void;\n onOptionSelect?: (\n value: string,\n label: string | undefined,\n isSuggestion: boolean\n ) => void;\n noSuggestionMessage?: React.ReactNode;\n trimCustomInput?: boolean;\n haveValueAsOption?: boolean;\n onClose?: (\n inputValue: string,\n cursorStartPosition: number | null,\n cursorEndPosition: number | null\n ) => void;\n}\n\nexport function SuggestionList({\n value = '',\n scrollToValue,\n anchorElement,\n children,\n onOptionSelect,\n noSuggestionMessage = '-- No Matches --',\n onClose,\n onChange,\n onKeyUp,\n onKeyDown,\n trimCustomInput = false,\n haveValueAsOption = false,\n ...props\n}: SuggestionListProps) {\n // Extract valid Option components from children\n const suggestions = Children.toArray(children).filter(\n (child): child is React.ReactElement<OptionProps> =>\n isValidElement(child) && child.type === Option\n );\n\n const [selectedIndex, setSelectedIndex] = useState(() => {\n if (scrollToValue != null) {\n const index = suggestions.findIndex(option => option.props.value === scrollToValue);\n if (index !== -1) {\n return index;\n }\n }\n return -1;\n });\n\n const keyPressedDownRef = useRef('');\n const [maxResults, setMaxResults] = useState(MAX_RESULTS);\n const [focusedIndex, setFocusedIndex] = useState(selectedIndex);\n const [internalValue, setInternalValue] = useState(value);\n const internalInputRef = useRef<HTMLInputElement | null>(null);\n const [totalMatchedLength, setTotalMatchedLength] = useState(suggestions.length);\n const [matchedOptions, setMatchedOptions] = useState<React.ReactElement<OptionProps>[]>(\n () => getMatchedOptions(value, MAX_RESULTS)\n );\n const [suggestionsWidth, setSuggestionsWidth] = useState<string | undefined>();\n const [suggestionsHeight, setSuggestionsHeight] = useState<string | undefined>();\n\n function handleKeyUp(event: React.KeyboardEvent<HTMLInputElement>) {\n const key = event.key;\n const input = event.currentTarget;\n\n const isSameKey = (keyPressedDownRef.current = key);\n keyPressedDownRef.current = '';\n\n // Enter and Escape remove the popover, so we want to handle this on keyup.\n // This prevents from another element from getting the key events.\n if (isSameKey) {\n switch (key) {\n case 'Enter': {\n if (matchedOptions[focusedIndex] == null) {\n const value = trimCustomInput ? input.value.trim() : input.value;\n\n if (value === '') {\n return;\n }\n\n const lowercaseValue = value.toLocaleLowerCase();\n const option = suggestions.find(\n option =>\n option.props.value.toLocaleLowerCase() === lowercaseValue ||\n (option.props.label != null &&\n option.props.label.toLocaleLowerCase() === lowercaseValue)\n );\n\n const isSuggestion = option != null;\n const label = option?.props.label || value;\n const optionValue = option?.props.value || value;\n\n requestAnimationFrame(() => {\n onOptionSelect && onOptionSelect(optionValue, label, isSuggestion);\n });\n\n break;\n }\n const selectedOption = matchedOptions[focusedIndex];\n const optionProps = selectedOption.props;\n\n // Don't select disabled options\n if (optionProps.disabled) {\n break;\n }\n\n requestAnimationFrame(() => {\n onOptionSelect && onOptionSelect(optionProps.value, optionProps.label, true);\n });\n break;\n }\n case 'Escape': {\n onClose && onClose(input.value, input.selectionStart, input.selectionEnd);\n break;\n }\n }\n }\n\n onKeyUp && onKeyUp(event);\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n const key = event.key;\n keyPressedDownRef.current = key;\n\n // We handle these key events on keydown to be responsive navigation.\n switch (key) {\n case 'ArrowDown': {\n let newIndex = focusedIndex + 1;\n\n // Skip disabled options\n while (\n newIndex < matchedOptions.length &&\n matchedOptions[newIndex]?.props.disabled\n ) {\n newIndex++;\n }\n\n if (newIndex === matchedOptions.length) {\n // Wrap around to first non-disabled option\n newIndex = 0;\n while (\n newIndex < matchedOptions.length &&\n matchedOptions[newIndex]?.props.disabled\n ) {\n newIndex++;\n }\n // If all options are disabled, stay at -1\n if (newIndex === matchedOptions.length) {\n newIndex = -1;\n }\n }\n\n setFocusedIndex(newIndex);\n event.preventDefault();\n break;\n }\n case 'Tab': {\n let step = 1;\n if (event.shiftKey) {\n step = -1;\n }\n let newIndex = focusedIndex + step;\n // Skip disabled options\n if (step > 0) {\n while (\n newIndex < matchedOptions.length &&\n matchedOptions[newIndex]?.props.disabled\n ) {\n newIndex++;\n }\n } else {\n while (newIndex >= 0 && matchedOptions[newIndex]?.props.disabled) {\n newIndex--;\n }\n }\n\n if (newIndex === matchedOptions.length) {\n // Wrap around to first non-disabled option\n newIndex = 0;\n while (\n newIndex < matchedOptions.length &&\n matchedOptions[newIndex]?.props.disabled\n ) {\n newIndex++;\n }\n // If all options are disabled, stay at -1\n if (newIndex === matchedOptions.length) {\n newIndex = -1;\n }\n } else if (newIndex <= -1) {\n // Wrap around to last non-disabled option\n newIndex = matchedOptions.length - 1;\n while (newIndex >= 0 && matchedOptions[newIndex]?.props.disabled) {\n newIndex--;\n }\n // If all options are disabled, stay at -1\n if (newIndex === -1) {\n newIndex = -1;\n }\n }\n\n setFocusedIndex(newIndex);\n event.preventDefault();\n break;\n }\n case 'ArrowUp': {\n let newIndex = focusedIndex - 1;\n\n // Skip disabled options\n while (newIndex >= 0 && matchedOptions[newIndex]?.props.disabled) {\n newIndex--;\n }\n\n if (newIndex === -1) {\n // Wrap around to last non-disabled option\n newIndex = matchedOptions.length - 1;\n while (newIndex >= 0 && matchedOptions[newIndex]?.props.disabled) {\n newIndex--;\n }\n // If all options are disabled, stay at -1\n if (newIndex === -1) {\n newIndex = -1;\n }\n }\n\n setFocusedIndex(newIndex);\n event.preventDefault();\n break;\n }\n }\n onKeyDown && onKeyDown(event);\n }\n\n function getMatchedOptions(value: string, maxResults: number) {\n const results = suggestions.filter(option => {\n const props = option.props;\n const label = String(props.label).toLocaleLowerCase();\n const keywords = props.keywords?.map(k => k.toLocaleLowerCase()) || [];\n const optionValue = String(props.value).toLocaleLowerCase();\n const searchValue = value.toLocaleLowerCase();\n\n return (\n label.includes(searchValue) ||\n keywords.some(k => k.includes(searchValue)) ||\n optionValue.includes(searchValue)\n );\n });\n\n if (\n haveValueAsOption &&\n value.trim().length > 0 &&\n !results.some(r => r.props.value === value)\n ) {\n results.unshift(\n <Option key=\"value\" value={value} label={value} keywords={[value]}>\n {value}\n </Option>\n );\n }\n\n setTotalMatchedLength(results.length);\n return results.slice(0, maxResults);\n }\n\n function focusInput() {\n const input = internalInputRef.current;\n if (input != null) {\n input.focus();\n }\n }\n\n function handleUseClose() {\n const input = internalInputRef.current;\n if (input != null) {\n onClose && onClose(input.value, input.selectionStart, input.selectionEnd);\n }\n }\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const input = event.currentTarget;\n\n setMaxResults(MAX_RESULTS);\n setInternalValue(event.target.value);\n\n const newMatches = getMatchedOptions(input.value, MAX_RESULTS);\n setMatchedOptions(newMatches);\n\n onChange && onChange(event.target.value);\n }\n\n function handleShowMore() {\n const newMaxResults = maxResults + BATCH_SIZE;\n setMaxResults(newMaxResults);\n const newMatches = getMatchedOptions(internalValue, newMaxResults);\n setMatchedOptions(newMatches);\n }\n\n useLayoutEffect(() => {\n const input = internalInputRef.current;\n\n if (input != null && input.value.length > 0) {\n input.select();\n } else if (input != null) {\n input.focus();\n }\n }, []);\n\n useLayoutEffect(() => {\n if (anchorElement != null) {\n const rect = anchorElement.getBoundingClientRect();\n setSuggestionsWidth(`${rect.width}px`);\n setSuggestionsHeight(`${rect.height}px`);\n\n if (internalInputRef.current != null && anchorElement instanceof HTMLInputElement) {\n internalInputRef.current.value = anchorElement.value;\n internalInputRef.current.selectionStart = anchorElement.selectionStart;\n internalInputRef.current.selectionEnd = anchorElement.selectionEnd;\n }\n }\n }, [anchorElement]);\n\n useLayoutEffect(() => {\n if (scrollToValue != null) {\n const index = matchedOptions.findIndex(\n option => option.props.value === scrollToValue\n );\n setSelectedIndex(index);\n }\n }, [matchedOptions, scrollToValue]);\n\n useLayoutEffect(() => {\n setFocusedIndex(internalValue === '' ? selectedIndex : -1);\n }, [internalValue, selectedIndex]);\n\n return (\n <Popper\n open\n anchorElement={anchorElement}\n onClose={handleUseClose}\n verticalAnchor=\"top\"\n verticalOrigin=\"top\"\n verticalOffset={-4}\n >\n <VStack\n minHeight={`calc(${suggestionsHeight}, 8px)`}\n maxHeight=\"300px\"\n minWidth={suggestionsWidth}\n width=\"auto\"\n hAlign=\"start\"\n className={clsx(styles['suggestion-list'], 'suggestion-list')}\n >\n <input\n ref={internalInputRef}\n key={-1}\n value={internalValue}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n className={clsx(styles.input, 'suggestion-list-search-input')}\n {...props}\n />\n <VStack>\n {matchedOptions.map((option, index) => (\n <SuggestionItem\n key={index}\n option={option}\n isSelected={index === selectedIndex && internalValue !== ''}\n isFocused={index === focusedIndex}\n onClick={onOptionSelect}\n />\n ))}\n {totalMatchedLength > matchedOptions.length && (\n <>\n <Button marginBlock=\"8px\" hierarchy=\"tertiary\" onClick={handleShowMore}>\n Show More\n </Button>\n </>\n )}\n </VStack>\n {matchedOptions.length === 0 && (\n <ZStack padding=\"8px\" className={styles['no-results']}>\n <BodyText>{noSuggestionMessage}</BodyText>\n </ZStack>\n )}\n <FocusRedirect key={matchedOptions.length + 1} onRedirect={focusInput} />\n </VStack>\n </Popper>\n );\n}\n"],"names":["MAX_RESULTS","BATCH_SIZE","SuggestionList","value","scrollToValue","anchorElement","children","onOptionSelect","noSuggestionMessage","onClose","onChange","onKeyUp","onKeyDown","trimCustomInput","haveValueAsOption","props","suggestions","Children","child","isValidElement","Option","selectedIndex","setSelectedIndex","useState","index","option","keyPressedDownRef","useRef","maxResults","setMaxResults","focusedIndex","setFocusedIndex","internalValue","setInternalValue","internalInputRef","totalMatchedLength","setTotalMatchedLength","matchedOptions","setMatchedOptions","getMatchedOptions","suggestionsWidth","setSuggestionsWidth","suggestionsHeight","setSuggestionsHeight","handleKeyUp","event","key","input","isSameKey","lowercaseValue","isSuggestion","label","optionValue","optionProps","handleKeyDown","newIndex","step","results","keywords","k","searchValue","r","jsx","focusInput","handleUseClose","handleChange","newMatches","handleShowMore","newMaxResults","useLayoutEffect","rect","Popper","jsxs","VStack","clsx","styles","SuggestionItem","Fragment","Button","ZStack","BodyText","FocusRedirect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;wGAcMA,IAAc,IACdC,KAAa;AAwBZ,SAASC,GAAe;AAAA,EAC7B,OAAAC,IAAQ;AAAA,E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estion_list.tsx"],"sourcesContent":["import { BodyText } from '../../typography/index.js';\nimport { VStack } from '../../stacks/v_stack.js';\nimport { ZStack } from '../../stacks/z_stack.js';\nimport { clsx } from 'clsx';\nimport React, { useLayoutEffect, Children, isValidElement } from 'react';\nimport { useRef, useState } from 'react';\nimport { FocusRedirect } from '../../utils/index.js';\nimport { SuggestionItem } from './suggestion_item.js';\nimport { OptionProps, Option } from '../options/option.js';\nimport styles from './suggestion_list.module.css';\n\nimport { Button } from '../../actions/index.js';\nimport { Popper } from '../../overlay/popper/popper.js';\n\nconst MAX_RESULTS = 50;\nconst BATCH_SIZE = 50;\n\nexport interface SuggestionListProps\n extends Omit<React.HTMLAttributes<HTMLInputElement>, 'onChange'> {\n value?: string;\n scrollToValue?: string;\n anchorElement: HTMLElement | null;\n children?: React.ReactNode;\n onChange?: (value: string) => void;\n onOptionSelect?: (\n value: string,\n label: string | undefined,\n isSuggestion: boolean,\n obfuscate: boolean\n ) => void;\n noSuggestionMessage?: React.ReactNode;\n trimCustomInput?: boolean;\n haveValueAsOption?: boolean;\n onClose?: (\n inputValue: string,\n cursorStartPosition: number | null,\n cursorEndPosition: number | null\n ) => void;\n}\n\nexport function SuggestionList({\n value = '',\n scrollToValue,\n anchorElement,\n children,\n onOptionSelect,\n noSuggestionMessage = '-- No Matches --',\n onClose,\n onChange,\n onKeyUp,\n onKeyDown,\n trimCustomInput = false,\n haveValueAsOption = false,\n ...props\n}: SuggestionListProps) {\n // Extract valid Option components from children\n const suggestions = Children.toArray(children).filter(\n (child): child is React.ReactElement<OptionProps> =>\n isValidElement(child) && child.type === Option\n );\n\n const [selectedIndex, setSelectedIndex] = useState(() => {\n if (scrollToValue != null) {\n const index = suggestions.findIndex(option => option.props.value === scrollToValue);\n if (index !== -1) {\n return index;\n }\n }\n return -1;\n });\n\n const keyPressedDownRef = useRef('');\n const [maxResults, setMaxResults] = useState(MAX_RESULTS);\n const [focusedIndex, setFocusedIndex] = useState(selectedIndex);\n const [internalValue, setInternalValue] = useState(value);\n const internalInputRef = useRef<HTMLInputElement | null>(null);\n const [totalMatchedLength, setTotalMatchedLength] = useState(suggestions.length);\n const [matchedOptions, setMatchedOptions] = useState<React.ReactElement<OptionProps>[]>(\n () => getMatchedOptions(value, MAX_RESULTS)\n );\n const [suggestionsWidth, setSuggestionsWidth] = useState<string | undefined>();\n const [suggestionsHeight, setSuggestionsHeight] = useState<string | undefined>();\n\n function handleKeyUp(event: React.KeyboardEvent<HTMLInputElement>) {\n const key = event.key;\n const input = event.currentTarget;\n\n const isSameKey = (keyPressedDownRef.current = key);\n keyPressedDownRef.current = '';\n\n // Enter and Escape remove the popover, so we want to handle this on keyup.\n // This prevents from another element from getting the key events.\n if (isSameKey) {\n switch (key) {\n case 'Enter': {\n if (matchedOptions[focusedIndex] == null) {\n const value = trimCustomInput ? input.value.trim() : input.value;\n\n if (value === '') {\n return;\n }\n\n const lowercaseValue = value.toLocaleLowerCase();\n const option = suggestions.find(\n option =>\n option.props.value.toLocaleLowerCase() === lowercaseValue ||\n (option.props.label != null &&\n option.props.label.toLocaleLowerCase() === lowercaseValue)\n );\n\n const isSuggestion = option != null;\n const label = option?.props.label || value;\n const optionValue = option?.props.value || value;\n\n requestAnimationFrame(() => {\n onOptionSelect &&\n onOptionSelect(\n optionValue,\n label,\n isSuggestion,\n option?.props.obfuscate ?? false\n );\n });\n\n break;\n }\n const selectedOption = matchedOptions[focusedIndex];\n const optionProps = selectedOption.props;\n\n // Don't select disabled options\n if (optionProps.disabled) {\n break;\n }\n\n requestAnimationFrame(() => {\n onOptionSelect &&\n onOptionSelect(\n optionProps.value,\n optionProps.label,\n true,\n optionProps.obfuscate ?? false\n );\n });\n break;\n }\n case 'Escape': {\n onClose && onClose(input.value, input.selectionStart, input.selectionEnd);\n break;\n }\n }\n }\n\n onKeyUp && onKeyUp(event);\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n const key = event.key;\n keyPressedDownRef.current = key;\n\n // We handle these key events on keydown to be responsive navigation.\n switch (key) {\n case 'ArrowDown': {\n let newIndex = focusedIndex + 1;\n\n // Skip disabled options\n while (\n newIndex < matchedOptions.length &&\n matchedOptions[newIndex]?.props.disabled\n ) {\n newIndex++;\n }\n\n if (newIndex === matchedOptions.length) {\n // Wrap around to first non-disabled option\n newIndex = 0;\n while (\n newIndex < matchedOptions.length &&\n matchedOptions[newIndex]?.props.disabled\n ) {\n newIndex++;\n }\n // If all options are disabled, stay at -1\n if (newIndex === matchedOptions.length) {\n newIndex = -1;\n }\n }\n\n setFocusedIndex(newIndex);\n event.preventDefault();\n break;\n }\n case 'Tab': {\n let step = 1;\n if (event.shiftKey) {\n step = -1;\n }\n let newIndex = focusedIndex + step;\n // Skip disabled options\n if (step > 0) {\n while (\n newIndex < matchedOptions.length &&\n matchedOptions[newIndex]?.props.disabled\n ) {\n newIndex++;\n }\n } else {\n while (newIndex >= 0 && matchedOptions[newIndex]?.props.disabled) {\n newIndex--;\n }\n }\n\n if (newIndex === matchedOptions.length) {\n // Wrap around to first non-disabled option\n newIndex = 0;\n while (\n newIndex < matchedOptions.length &&\n matchedOptions[newIndex]?.props.disabled\n ) {\n newIndex++;\n }\n // If all options are disabled, stay at -1\n if (newIndex === matchedOptions.length) {\n newIndex = -1;\n }\n } else if (newIndex <= -1) {\n // Wrap around to last non-disabled option\n newIndex = matchedOptions.length - 1;\n while (newIndex >= 0 && matchedOptions[newIndex]?.props.disabled) {\n newIndex--;\n }\n // If all options are disabled, stay at -1\n if (newIndex === -1) {\n newIndex = -1;\n }\n }\n\n setFocusedIndex(newIndex);\n event.preventDefault();\n break;\n }\n case 'ArrowUp': {\n let newIndex = focusedIndex - 1;\n\n // Skip disabled options\n while (newIndex >= 0 && matchedOptions[newIndex]?.props.disabled) {\n newIndex--;\n }\n\n if (newIndex === -1) {\n // Wrap around to last non-disabled option\n newIndex = matchedOptions.length - 1;\n while (newIndex >= 0 && matchedOptions[newIndex]?.props.disabled) {\n newIndex--;\n }\n // If all options are disabled, stay at -1\n if (newIndex === -1) {\n newIndex = -1;\n }\n }\n\n setFocusedIndex(newIndex);\n event.preventDefault();\n break;\n }\n }\n onKeyDown && onKeyDown(event);\n }\n\n function getMatchedOptions(value: string, maxResults: number) {\n const results = suggestions.filter(option => {\n const props = option.props;\n const label = String(props.label).toLocaleLowerCase();\n const keywords = props.keywords?.map(k => k.toLocaleLowerCase()) || [];\n const optionValue = String(props.value).toLocaleLowerCase();\n const searchValue = value.toLocaleLowerCase();\n const obfuscate = props.obfuscate ?? false;\n\n // Obfuscated options can only be searched by label or keywords, not by value\n if (obfuscate) {\n return label.includes(searchValue) || keywords.some(k => k.includes(searchValue));\n }\n\n return (\n label.includes(searchValue) ||\n keywords.some(k => k.includes(searchValue)) ||\n optionValue.includes(searchValue)\n );\n });\n\n if (\n haveValueAsOption &&\n value.trim().length > 0 &&\n !results.some(r => r.props.value === value)\n ) {\n results.unshift(\n <Option key=\"value\" value={value} label={value} keywords={[value]}>\n {value}\n </Option>\n );\n }\n\n setTotalMatchedLength(results.length);\n return results.slice(0, maxResults);\n }\n\n function focusInput() {\n const input = internalInputRef.current;\n if (input != null) {\n input.focus();\n }\n }\n\n function handleUseClose() {\n const input = internalInputRef.current;\n if (input != null) {\n onClose && onClose(input.value, input.selectionStart, input.selectionEnd);\n }\n }\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const input = event.currentTarget;\n\n setMaxResults(MAX_RESULTS);\n setInternalValue(event.target.value);\n\n const newMatches = getMatchedOptions(input.value, MAX_RESULTS);\n setMatchedOptions(newMatches);\n\n onChange && onChange(event.target.value);\n }\n\n function handleShowMore() {\n const newMaxResults = maxResults + BATCH_SIZE;\n setMaxResults(newMaxResults);\n const newMatches = getMatchedOptions(internalValue, newMaxResults);\n setMatchedOptions(newMatches);\n }\n\n useLayoutEffect(() => {\n const input = internalInputRef.current;\n\n if (input != null && input.value.length > 0) {\n input.select();\n } else if (input != null) {\n input.focus();\n }\n }, []);\n\n useLayoutEffect(() => {\n if (anchorElement != null) {\n const rect = anchorElement.getBoundingClientRect();\n setSuggestionsWidth(`${rect.width}px`);\n setSuggestionsHeight(`${rect.height}px`);\n\n if (internalInputRef.current != null && anchorElement instanceof HTMLInputElement) {\n internalInputRef.current.value = anchorElement.value;\n internalInputRef.current.selectionStart = anchorElement.selectionStart;\n internalInputRef.current.selectionEnd = anchorElement.selectionEnd;\n }\n }\n }, [anchorElement]);\n\n useLayoutEffect(() => {\n if (scrollToValue != null) {\n const index = matchedOptions.findIndex(\n option => option.props.value === scrollToValue\n );\n setSelectedIndex(index);\n }\n }, [matchedOptions, scrollToValue]);\n\n useLayoutEffect(() => {\n setFocusedIndex(internalValue === '' ? selectedIndex : -1);\n }, [internalValue, selectedIndex]);\n\n return (\n <Popper\n open\n anchorElement={anchorElement}\n onClose={handleUseClose}\n verticalAnchor=\"top\"\n verticalOrigin=\"top\"\n verticalOffset={-4}\n >\n <VStack\n minHeight={`calc(${suggestionsHeight}, 8px)`}\n maxHeight=\"300px\"\n minWidth={suggestionsWidth}\n width=\"auto\"\n hAlign=\"start\"\n className={clsx(styles['suggestion-list'], 'suggestion-list')}\n >\n <input\n ref={internalInputRef}\n key={-1}\n value={internalValue}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n className={clsx(styles.input, 'suggestion-list-search-input')}\n {...props}\n />\n <VStack>\n {matchedOptions.map((option, index) => (\n <SuggestionItem\n key={index}\n option={option}\n isSelected={index === selectedIndex && internalValue !== ''}\n isFocused={index === focusedIndex}\n onClick={onOptionSelect}\n />\n ))}\n {totalMatchedLength > matchedOptions.length && (\n <>\n <Button marginBlock=\"8px\" hierarchy=\"tertiary\" onClick={handleShowMore}>\n Show More\n </Button>\n </>\n )}\n </VStack>\n {matchedOptions.length === 0 && (\n <ZStack padding=\"8px\" className={styles['no-results']}>\n <BodyText>{noSuggestionMessage}</BodyText>\n </ZStack>\n )}\n <FocusRedirect key={matchedOptions.length + 1} onRedirect={focusInput} />\n </VStack>\n </Popper>\n );\n}\n"],"names":["MAX_RESULTS","BATCH_SIZE","SuggestionList","value","scrollToValue","anchorElement","children","onOptionSelect","noSuggestionMessage","onClose","onChange","onKeyUp","onKeyDown","trimCustomInput","haveValueAsOption","props","suggestions","Children","child","isValidElement","Option","selectedIndex","setSelectedIndex","useState","index","option","keyPressedDownRef","useRef","maxResults","setMaxResults","focusedIndex","setFocusedIndex","internalValue","setInternalValue","internalInputRef","totalMatchedLength","setTotalMatchedLength","matchedOptions","setMatchedOptions","getMatchedOptions","suggestionsWidth","setSuggestionsWidth","suggestionsHeight","setSuggestionsHeight","handleKeyUp","event","key","input","isSameKey","lowercaseValue","isSuggestion","label","optionValue","optionProps","handleKeyDown","newIndex","step","results","keywords","k","searchValue","r","jsx","focusInput","handleUseClose","handleChange","newMatches","handleShowMore","newMaxResults","useLayoutEffect","rect","Popper","jsxs","VStack","clsx","styles","SuggestionItem","Fragment","Button","ZStack","BodyText","FocusRedirect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;wGAcMA,IAAc,IACdC,KAAa;AAyBZ,SAASC,GAAe;AAAA,EAC7B,OAAAC,IAAQ;AAAA,EACR,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,mBAAAC,IAAoB;AAAA,EACpB,GAAGC;AACL,GAAwB;AAEtB,QAAMC,IAAcC,GAAS,QAAQX,CAAQ,EAAE;AAAA,IAC7C,CAACY,MACCC,GAAeD,CAAK,KAAKA,EAAM,SAASE;AAAA,EAAA,GAGtC,CAACC,GAAeC,CAAgB,IAAIC,EAAS,MAAM;AACvD,QAAInB,KAAiB,MAAM;AACzB,YAAMoB,IAAQR,EAAY,UAAU,OAAUS,EAAO,MAAM,UAAUrB,CAAa;AA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P,SAASY;AAAA,gBACT,WAAWU;AAAA,gBACX,UAAUW;AAAA,gBACV,WAAWS,EAAKC,EAAO,OAAO,8BAA8B;AAAA,gBAC3D,GAAG5D;AAAA,cAAA;AAAA,cANC;AAAA,YAAA;AAAA,8BAQN0D,GAAA,EACE,UAAA;AAAA,cAAApC,EAAe,IAAI,CAACZ,GAAQD,MAC3B,gBAAAsC;AAAA,gBAACc;AAAA,gBAAA;AAAA,kBAEC,QAAAnD;AAAA,kBACA,YAAYD,MAAUH,KAAiBW,MAAkB;AAAA,kBACzD,WAAWR,MAAUM;AAAA,kBACrB,SAASvB;AAAA,gBAAA;AAAA,gBAJJiB;AAAA,cAAA,CAMR;AAAA,cACAW,IAAqBE,EAAe,UACnC,gBAAAyB,EAAAe,IAAA,EACE,UAAA,gBAAAf,EAACgB,IAAA,EAAO,aAAY,OAAM,WAAU,YAAW,SAASX,IAAgB,uBAExE,EAAA,CACF;AAAA,YAAA,GAEJ;AAAA,YACC9B,EAAe,WAAW,KACzB,gBAAAyB,EAACiB,MAAO,SAAQ,OAAM,WAAWJ,EAAO,YAAY,GAClD,UAAA,gBAAAb,EAACkB,IAAA,EAAU,aAAoB,GACjC;AAAA,8BAEDC,IAAA,EAA8C,YAAYlB,GAAA,GAAvC1B,EAAe,SAAS,CAA2B;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACzE;AAAA,EAAA;AAGN;"}
@@ -1,5 +1,5 @@
1
- import { default as React, HTMLAttributes } from 'react';
2
- export interface TextareaProps extends Omit<HTMLAttributes<HTMLTextAreaElement>, 'onChange'> {
1
+ import { default as React, TextareaHTMLAttributes } from 'react';
2
+ export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'> {
3
3
  value?: string;
4
4
  width?: string;
5
5
  height?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/inputs/textarea/textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAAE,UAAU,CAAC;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;CACnF;AAED,eAAO,MAAM,QAAQ,2FAgBnB,CAAC"}
1
+ {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/inputs/textarea/textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAG/C,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;CACnF;AAED,eAAO,MAAM,QAAQ,2FAgBnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.js","sources":["../../../src/inputs/textarea/textarea.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { HTMLAttributes } from 'react';\nimport styles from './textarea.module.css';\n\nexport interface TextareaProps\n extends Omit<HTMLAttributes<HTMLTextAreaElement>, 'onChange'> {\n value?: string;\n width?: string;\n height?: string;\n disabled?: boolean;\n placeholder?: string;\n onChange?: (value: string, event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n}\n\nexport const Textarea = React.forwardRef(function Textarea(\n { className, width, height, style, onChange, ...props }: TextareaProps,\n ref: React.Ref<HTMLTextAreaElement>\n) {\n return (\n <textarea\n style={{ width, height, ...style }}\n className={clsx(className, styles.textarea, 'textarea')}\n data-is-disabled={props.disabled || false}\n ref={ref}\n onChange={e => {\n onChange && onChange(e.currentTarget.value, e);\n }}\n {...props}\n />\n );\n});\n"],"names":["Textarea","React","className","width","height","style","onChange","props","ref","jsx","clsx","styles","e"],"mappings":";;;oDAeaA,IAAWC,EAAM,WAAW,SACvC,EAAE,WAAAC,GAAW,OAAAC,GAAO,QAAAC,GAAQ,OAAAC,GAAO,UAAAC,GAAU,GAAGC,EAAA,GAChDC,GACA;AACA,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,OAAAN,GAAO,QAAAC,GAAQ,GAAGC,EAAA;AAAA,MAC3B,WAAWK,EAAKR,GAAWS,EAAO,UAAU,UAAU;AAAA,MACtD,oBAAkBJ,EAAM,YAAY;AAAA,MACpC,KAAAC;AAAA,MACA,UAAU,CAAAI,MAAK;AACb,QAAAN,KAAYA,EAASM,EAAE,cAAc,OAAOA,CAAC;AAAA,MAC/C;AAAA,MACC,GAAGL;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
1
+ {"version":3,"file":"textarea.js","sources":["../../../src/inputs/textarea/textarea.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { TextareaHTMLAttributes } from 'react';\nimport styles from './textarea.module.css';\n\nexport interface TextareaProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'> {\n value?: string;\n width?: string;\n height?: string;\n disabled?: boolean;\n placeholder?: string;\n onChange?: (value: string, event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n}\n\nexport const Textarea = React.forwardRef(function Textarea(\n { className, width, height, style, onChange, ...props }: TextareaProps,\n ref: React.Ref<HTMLTextAreaElement>\n) {\n return (\n <textarea\n style={{ width, height, ...style }}\n className={clsx(className, styles.textarea, 'textarea')}\n data-is-disabled={props.disabled || false}\n ref={ref}\n onChange={e => {\n onChange && onChange(e.currentTarget.value, e);\n }}\n {...props}\n />\n );\n});\n"],"names":["Textarea","React","className","width","height","style","onChange","props","ref","jsx","clsx","styles","e"],"mappings":";;;oDAeaA,IAAWC,EAAM,WAAW,SACvC,EAAE,WAAAC,GAAW,OAAAC,GAAO,QAAAC,GAAQ,OAAAC,GAAO,UAAAC,GAAU,GAAGC,EAAA,GAChDC,GACA;AACA,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,OAAAN,GAAO,QAAAC,GAAQ,GAAGC,EAAA;AAAA,MAC3B,WAAWK,EAAKR,GAAWS,EAAO,UAAU,UAAU;AAAA,MACtD,oBAAkBJ,EAAM,YAAY;AAAA,MACpC,KAAAC;AAAA,MACA,UAAU,CAAAI,MAAK;AACb,QAAAN,KAAYA,EAASM,EAAE,cAAc,OAAOA,CAAC;AAAA,MAC/C;AAAA,MACC,GAAGL;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
@@ -1,14 +1,14 @@
1
- import { jsx as c } from "react/jsx-runtime";
1
+ import { jsx as f } from "react/jsx-runtime";
2
2
  import s from "react";
3
3
  import { clsx as m } from "clsx";
4
4
  import { HStack as n } from "../../stacks/h_stack.js";
5
- import '../../footer.css';const i = "_footer_4a43c3e", d = { footer: i }, u = s.forwardRef(function({ hierarchy: o = "secondary", size: r = "md", children: t, className: e, ...a }, f) {
6
- return /* @__PURE__ */ c(
5
+ import '../../footer.css';const i = "_footer_4a43c3e", d = { footer: i }, u = s.forwardRef(function({ hierarchy: o = "secondary", size: r = "md", children: t, className: e, ...a }, c) {
6
+ return /* @__PURE__ */ f(
7
7
  n,
8
8
  {
9
- ref: f,
9
+ ref: c,
10
10
  as: "footer",
11
- className: m(d.footer, e, "footer", "tcn-footer"),
11
+ className: m(d.footer, e, "tcn-footer"),
12
12
  "data-hierarchy": o,
13
13
  "data-size": r,
14
14
  ...a,
@@ -1 +1 @@
1
- {"version":3,"file":"footer.js","sources":["../../../src/layouts/footer/footer.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { HStack, type HStackProps } from '../../stacks/h_stack.js';\nimport type { Hierarchy, Size } from '../../utils/index.js';\nimport styles from './footer.module.css';\n\nexport interface FooterProps extends Omit<HStackProps, 'as' | 'children'> {\n hierarchy?: Hierarchy;\n size?: Size;\n children?: React.ReactNode;\n}\n\nexport const Footer = React.forwardRef<HTMLElement, FooterProps>(function Footer(\n { hierarchy = 'secondary', size = 'md', children, className, ...props }: FooterProps,\n ref\n) {\n return (\n <HStack\n ref={ref}\n as=\"footer\"\n className={clsx(styles.footer, className, 'footer', 'tcn-footer')}\n data-hierarchy={hierarchy}\n data-size={size}\n {...props}\n >\n {children}\n </HStack>\n );\n});\n"],"names":["Footer","React","hierarchy","size","children","className","props","ref","jsx","HStack","clsx","styles"],"mappings":";;;;gDAYaA,IAASC,EAAM,WAAqC,SAC/D,EAAE,WAAAC,IAAY,aAAa,MAAAC,IAAO,MAAM,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAA,GAChEC,GACA;AACA,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,IAAG;AAAA,MACH,WAAWG,EAAKC,EAAO,QAAQN,GAAW,UAAU,YAAY;AAAA,MAChE,kBAAgBH;AAAA,MAChB,aAAWC;AAAA,MACV,GAAGG;AAAA,MAEH,UAAAF;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"footer.js","sources":["../../../src/layouts/footer/footer.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { HStack, type HStackProps } from '../../stacks/h_stack.js';\nimport type { Hierarchy, Size } from '../../utils/index.js';\nimport styles from './footer.module.css';\n\nexport interface FooterProps extends Omit<HStackProps, 'as' | 'children'> {\n hierarchy?: Hierarchy;\n size?: Size;\n children?: React.ReactNode;\n}\n\nexport const Footer = React.forwardRef<HTMLElement, FooterProps>(function Footer(\n { hierarchy = 'secondary', size = 'md', children, className, ...props }: FooterProps,\n ref\n) {\n return (\n <HStack\n ref={ref}\n as=\"footer\"\n className={clsx(styles.footer, className, 'tcn-footer')}\n data-hierarchy={hierarchy}\n data-size={size}\n {...props}\n >\n {children}\n </HStack>\n );\n});\n"],"names":["Footer","React","hierarchy","size","children","className","props","ref","jsx","HStack","clsx","styles"],"mappings":";;;;gDAYaA,IAASC,EAAM,WAAqC,SAC/D,EAAE,WAAAC,IAAY,aAAa,MAAAC,IAAO,MAAM,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAA,GAChEC,GACA;AACA,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,IAAG;AAAA,MACH,WAAWG,EAAKC,EAAO,QAAQN,GAAW,YAAY;AAAA,MACtD,kBAAgBH;AAAA,MAChB,aAAWC;AAAA,MACV,GAAGG;AAAA,MAEH,UAAAF;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/layouts/header/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAI5D,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC;IAC1D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,eAAO,MAAM,MAAM,iFAwBjB,CAAC"}
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/layouts/header/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5D,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC;IAC1D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,eAAO,MAAM,MAAM,iFAwBjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","sources":["../../../src/layouts/header/header.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { HStack, type HStackProps } from '../../stacks/h_stack.js';\nimport type { Hierarchy, Size } from '../../utils/index.js';\nimport styles from './header.module.css';\n\n// UtilityBar\nexport interface HeaderProps extends Omit<HStackProps, 'as'> {\n hierarchy?: Hierarchy;\n size?: Size;\n}\n\nexport const Header = React.forwardRef<HTMLElement, HeaderProps>(function Header(\n {\n hierarchy = 'secondary',\n height = 'auto',\n children,\n className,\n size = 'md',\n ...props\n }: HeaderProps,\n ref\n) {\n return (\n <HStack\n ref={ref}\n as=\"header\"\n className={clsx(styles.header, className, 'tcn-header', 'header')}\n data-hierarchy={hierarchy}\n data-size={size}\n height={height}\n {...props}\n >\n {children}\n </HStack>\n );\n});\n"],"names":["Header","React","hierarchy","height","children","className","size","props","ref","jsx","HStack","clsx","styles"],"mappings":";;;;gDAYaA,IAASC,EAAM,WAAqC,SAC/D;AAAA,EACE,WAAAC,IAAY;AAAA,EACZ,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,GACAC,GACA;AACA,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,IAAG;AAAA,MACH,WAAWG,EAAKC,EAAO,QAAQP,GAAW,cAAc,QAAQ;AAAA,MAChE,kBAAgBH;AAAA,MAChB,aAAWI;AAAA,MACX,QAAAH;AAAA,MACC,GAAGI;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"header.js","sources":["../../../src/layouts/header/header.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { HStack, type HStackProps } from '../../stacks/h_stack.js';\nimport type { Hierarchy, Size } from '../../utils/index.js';\nimport styles from './header.module.css';\n\nexport interface HeaderProps extends Omit<HStackProps, 'as'> {\n hierarchy?: Hierarchy;\n size?: Size;\n}\n\nexport const Header = React.forwardRef<HTMLElement, HeaderProps>(function Header(\n {\n hierarchy = 'secondary',\n height = 'auto',\n children,\n className,\n size = 'md',\n ...props\n }: HeaderProps,\n ref\n) {\n return (\n <HStack\n ref={ref}\n as=\"header\"\n className={clsx(styles.header, className, 'tcn-header', 'header')}\n data-hierarchy={hierarchy}\n data-size={size}\n height={height}\n {...props}\n >\n {children}\n </HStack>\n );\n});\n"],"names":["Header","React","hierarchy","height","children","className","size","props","ref","jsx","HStack","clsx","styles"],"mappings":";;;;gDAWaA,IAASC,EAAM,WAAqC,SAC/D;AAAA,EACE,WAAAC,IAAY;AAAA,EACZ,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,GACAC,GACA;AACA,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,IAAG;AAAA,MACH,WAAWG,EAAKC,EAAO,QAAQP,GAAW,cAAc,QAAQ;AAAA,MAChE,kBAAgBH;AAAA,MAChB,aAAWI;AAAA,MACX,QAAAH;AAAA,MACC,GAAGI;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1,3 +1,5 @@
1
+ export * from './body/h_body.js';
2
+ export * from './body/v_body.js';
1
3
  export * from './column/column.js';
2
4
  export * from './divider/divider.js';
3
5
  export * from './footer/footer.js';
@@ -8,6 +10,5 @@ export * from './list/list.js';
8
10
  export * from './list/section_header.js';
9
11
  export * from './sidebar_end/sidebar_end.js';
10
12
  export * from './sidebar_start/sidebar_start.js';
11
- export * from './body/h_body.js';
12
- export * from './body/v_body.js';
13
+ export * from './utility_bar/utility_bar.js';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC"}
@@ -1,27 +1,29 @@
1
- import { Column as e } from "./column/column.js";
2
- import { Divider as m } from "./divider/divider.js";
3
- import { Footer as p } from "./footer/footer.js";
4
- import { Grid as d } from "./grid/grid.js";
5
- import { Header as a } from "./header/header.js";
6
- import { Item as n } from "./list/item.js";
7
- import { List as b } from "./list/list.js";
8
- import { SectionHeader as B } from "./list/section_header.js";
9
- import { SidebarEnd as l } from "./sidebar_end/sidebar_end.js";
10
- import { SidebarStart as u } from "./sidebar_start/sidebar_start.js";
11
- import { HBody as C } from "./body/h_body.js";
12
- import { VBody as E } from "./body/v_body.js";
1
+ import { HBody as e } from "./body/h_body.js";
2
+ import { VBody as m } from "./body/v_body.js";
3
+ import { Column as p } from "./column/column.js";
4
+ import { Divider as d } from "./divider/divider.js";
5
+ import { Footer as a } from "./footer/footer.js";
6
+ import { Grid as n } from "./grid/grid.js";
7
+ import { Header as B } from "./header/header.js";
8
+ import { Item as b } from "./list/item.js";
9
+ import { List as c } from "./list/list.js";
10
+ import { SectionHeader as u } from "./list/section_header.js";
11
+ import { SidebarEnd as C } from "./sidebar_end/sidebar_end.js";
12
+ import { SidebarStart as E } from "./sidebar_start/sidebar_start.js";
13
+ import { UtilityBar as G } from "./utility_bar/utility_bar.js";
13
14
  export {
14
- e as Column,
15
- m as Divider,
16
- p as Footer,
17
- d as Grid,
18
- C as HBody,
19
- a as Header,
20
- n as Item,
21
- b as List,
22
- B as SectionHeader,
23
- l as SidebarEnd,
24
- u as SidebarStart,
25
- E as VBody
15
+ p as Column,
16
+ d as Divider,
17
+ a as Footer,
18
+ n as Grid,
19
+ e as HBody,
20
+ B as Header,
21
+ b as Item,
22
+ c as List,
23
+ u as SectionHeader,
24
+ C as SidebarEnd,
25
+ E as SidebarStart,
26
+ G as UtilityBar,
27
+ m as VBody
26
28
  };
27
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { HStackProps } from '../../stacks/h_stack.js';
3
3
  export interface ItemProps extends Omit<HStackProps, 'as' | 'children'> {
4
4
  children?: React.ReactNode;
5
+ selected?: boolean;
5
6
  }
6
7
  export declare const Item: React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLDivElement>>;
7
8
  //# sourceMappingURL=item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/layouts/list/item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGnE,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,UAAU,CAAC;IACrE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,IAAI,kFASf,CAAC"}
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/layouts/list/item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGnE,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,UAAU,CAAC;IACrE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,IAAI,kFAgBf,CAAC"}