@tcn/ui 0.9.0 → 0.11.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 (298) hide show
  1. package/dist/bar.css +1 -0
  2. package/dist/body.css +1 -1
  3. package/dist/body.module-BbFZ7KNP.js +5 -0
  4. package/dist/body.module-BbFZ7KNP.js.map +1 -0
  5. package/dist/divider.css +1 -1
  6. package/dist/footer.css +1 -1
  7. package/dist/form/field/h_field/h_field.d.ts.map +1 -1
  8. package/dist/form/field/h_field/h_field.js +33 -35
  9. package/dist/form/field/h_field/h_field.js.map +1 -1
  10. package/dist/form/field/v_field/v_field.d.ts.map +1 -1
  11. package/dist/form/field/v_field/v_field.js +34 -36
  12. package/dist/form/field/v_field/v_field.js.map +1 -1
  13. package/dist/frame.css +1 -1
  14. package/dist/inputs/color_input/color_input.d.ts.map +1 -1
  15. package/dist/inputs/color_input/color_input.js +47 -46
  16. package/dist/inputs/color_input/color_input.js.map +1 -1
  17. package/dist/inputs/combo_box/combo_box.d.ts.map +1 -1
  18. package/dist/inputs/combo_box/combo_box.js +61 -58
  19. package/dist/inputs/combo_box/combo_box.js.map +1 -1
  20. package/dist/inputs/index.d.ts +1 -0
  21. package/dist/inputs/index.d.ts.map +1 -1
  22. package/dist/inputs/index.js +34 -31
  23. package/dist/inputs/index.js.map +1 -1
  24. package/dist/inputs/input/input.js +9 -9
  25. package/dist/inputs/input/input.js.map +1 -1
  26. package/dist/inputs/input_group/input_group.d.ts +5 -0
  27. package/dist/inputs/input_group/input_group.d.ts.map +1 -0
  28. package/dist/inputs/input_group/input_group.js +20 -0
  29. package/dist/inputs/input_group/input_group.js.map +1 -0
  30. package/dist/inputs/phone_number_input/countries_phone_information.d.ts +2 -2
  31. package/dist/inputs/phone_number_input/countries_phone_information.d.ts.map +1 -1
  32. package/dist/inputs/phone_number_input/countries_phone_information.js +5 -353
  33. package/dist/inputs/phone_number_input/countries_phone_information.js.map +1 -1
  34. package/dist/inputs/phone_number_input/phone_number_context.d.ts +24 -0
  35. package/dist/inputs/phone_number_input/phone_number_context.d.ts.map +1 -0
  36. package/dist/inputs/phone_number_input/phone_number_context.js +23 -0
  37. package/dist/inputs/phone_number_input/phone_number_context.js.map +1 -0
  38. package/dist/inputs/phone_number_input/phone_number_country_select_adapter.d.ts +19 -0
  39. package/dist/inputs/phone_number_input/phone_number_country_select_adapter.d.ts.map +1 -0
  40. package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js +77 -0
  41. package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js.map +1 -0
  42. package/dist/inputs/phone_number_input/phone_number_input.d.ts +16 -14
  43. package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
  44. package/dist/inputs/phone_number_input/phone_number_input.js +104 -274
  45. package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
  46. package/dist/inputs/phone_number_input/phone_number_input_adapter.d.ts +6 -0
  47. package/dist/inputs/phone_number_input/phone_number_input_adapter.d.ts.map +1 -0
  48. package/dist/inputs/phone_number_input/phone_number_input_adapter.js +95 -0
  49. package/dist/inputs/phone_number_input/phone_number_input_adapter.js.map +1 -0
  50. package/dist/inputs/phone_number_input/sip_input.d.ts +12 -0
  51. package/dist/inputs/phone_number_input/sip_input.d.ts.map +1 -0
  52. package/dist/inputs/phone_number_input/sip_input.js +111 -0
  53. package/dist/inputs/phone_number_input/sip_input.js.map +1 -0
  54. package/dist/inputs/select/select.d.ts.map +1 -1
  55. package/dist/inputs/select/select.js +3 -2
  56. package/dist/inputs/select/select.js.map +1 -1
  57. package/dist/inputs/suggestions/suggestion_list.d.ts +4 -1
  58. package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
  59. package/dist/inputs/suggestions/suggestion_list.js +120 -111
  60. package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
  61. package/dist/inputs/textarea/textarea.js +8 -8
  62. package/dist/inputs/textarea/textarea.js.map +1 -1
  63. package/dist/inputs/unit_input/unit_input.d.ts.map +1 -1
  64. package/dist/inputs/unit_input/unit_input.js +39 -39
  65. package/dist/inputs/unit_input/unit_input.js.map +1 -1
  66. package/dist/layouts/bar/bar.d.ts +5 -0
  67. package/dist/layouts/bar/bar.d.ts.map +1 -0
  68. package/dist/layouts/bar/bar.js +20 -0
  69. package/dist/layouts/bar/bar.js.map +1 -0
  70. package/dist/layouts/body/body.d.ts +2 -2
  71. package/dist/layouts/body/body.d.ts.map +1 -1
  72. package/dist/layouts/body/body.js +12 -12
  73. package/dist/layouts/body/body.js.map +1 -1
  74. package/dist/layouts/body/h_body.d.ts.map +1 -1
  75. package/dist/layouts/body/h_body.js +18 -12
  76. package/dist/layouts/body/h_body.js.map +1 -1
  77. package/dist/layouts/body/v_body.d.ts.map +1 -1
  78. package/dist/layouts/body/v_body.js +16 -10
  79. package/dist/layouts/body/v_body.js.map +1 -1
  80. package/dist/layouts/footer/footer.d.ts +2 -3
  81. package/dist/layouts/footer/footer.d.ts.map +1 -1
  82. package/dist/layouts/footer/footer.js +7 -7
  83. package/dist/layouts/footer/footer.js.map +1 -1
  84. package/dist/layouts/header/header.d.ts +2 -2
  85. package/dist/layouts/header/header.d.ts.map +1 -1
  86. package/dist/layouts/header/header.js +13 -21
  87. package/dist/layouts/header/header.js.map +1 -1
  88. package/dist/layouts/index.d.ts +0 -1
  89. package/dist/layouts/index.d.ts.map +1 -1
  90. package/dist/layouts/index.js +17 -19
  91. package/dist/layouts/index.js.map +1 -1
  92. package/dist/layouts/rail/rail.js +41 -41
  93. package/dist/layouts/rail/rail.js.map +1 -1
  94. package/dist/layouts/rail/side/side.d.ts.map +1 -1
  95. package/dist/layouts/rail/side/side.js +1 -1
  96. package/dist/layouts/rail/side/side.js.map +1 -1
  97. package/dist/layouts/rail/utility_strip/utility_strip.d.ts.map +1 -1
  98. package/dist/layouts/rail/utility_strip/utility_strip.js +21 -17
  99. package/dist/layouts/rail/utility_strip/utility_strip.js.map +1 -1
  100. package/dist/layouts/scaffold/scaffold.js +32 -32
  101. package/dist/layouts/scaffold/scaffold.js.map +1 -1
  102. package/dist/layouts/utility_bar/utility_bar.d.ts +2 -2
  103. package/dist/layouts/utility_bar/utility_bar.d.ts.map +1 -1
  104. package/dist/layouts/utility_bar/utility_bar.js +17 -19
  105. package/dist/layouts/utility_bar/utility_bar.js.map +1 -1
  106. package/dist/overlay/frame/frame.d.ts +8 -4
  107. package/dist/overlay/frame/frame.d.ts.map +1 -1
  108. package/dist/overlay/frame/frame.js +87 -23
  109. package/dist/overlay/frame/frame.js.map +1 -1
  110. package/dist/overlay/popper/base/dismissal_decorator.js.map +1 -1
  111. package/dist/overlay/popper/legacy/popper.d.ts.map +1 -1
  112. package/dist/overlay/popper/legacy/popper.js +52 -50
  113. package/dist/overlay/popper/legacy/popper.js.map +1 -1
  114. package/dist/panel.css +1 -0
  115. package/dist/phone_number_input.css +1 -1
  116. package/dist/rail.css +1 -1
  117. package/dist/scaffold.css +1 -1
  118. package/dist/side.css +1 -1
  119. package/dist/stacks/box/bottom_resize_handle.d.ts +2 -2
  120. package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
  121. package/dist/stacks/box/bottom_resize_handle.js +12 -10
  122. package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
  123. package/dist/stacks/box/box.d.ts +4 -4
  124. package/dist/stacks/box/box.d.ts.map +1 -1
  125. package/dist/stacks/box/box.js +26 -26
  126. package/dist/stacks/box/box.js.map +1 -1
  127. package/dist/stacks/box/end_resize_handle.d.ts +2 -2
  128. package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
  129. package/dist/stacks/box/end_resize_handle.js +6 -5
  130. package/dist/stacks/box/end_resize_handle.js.map +1 -1
  131. package/dist/stacks/box/left_resize_handle.d.ts +2 -2
  132. package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
  133. package/dist/stacks/box/left_resize_handle.js +10 -9
  134. package/dist/stacks/box/left_resize_handle.js.map +1 -1
  135. package/dist/stacks/box/resize_handlers.d.ts +2 -2
  136. package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
  137. package/dist/stacks/box/resize_handlers.js +32 -32
  138. package/dist/stacks/box/resize_handlers.js.map +1 -1
  139. package/dist/stacks/box/right_resize_handle.d.ts +2 -2
  140. package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
  141. package/dist/stacks/box/right_resize_handle.js +6 -5
  142. package/dist/stacks/box/right_resize_handle.js.map +1 -1
  143. package/dist/stacks/box/start_resize_handle.d.ts +2 -2
  144. package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
  145. package/dist/stacks/box/start_resize_handle.js +6 -6
  146. package/dist/stacks/box/start_resize_handle.js.map +1 -1
  147. package/dist/stacks/box/top_resize_handle.d.ts +2 -2
  148. package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
  149. package/dist/stacks/box/top_resize_handle.js +6 -5
  150. package/dist/stacks/box/top_resize_handle.js.map +1 -1
  151. package/dist/stacks/h_collapsible_box.d.ts.map +1 -1
  152. package/dist/stacks/h_collapsible_box.js +25 -25
  153. package/dist/stacks/h_collapsible_box.js.map +1 -1
  154. package/dist/stacks/v_collapsible_box.js +25 -25
  155. package/dist/stacks/v_collapsible_box.js.map +1 -1
  156. package/dist/suggestion_list.css +1 -1
  157. package/dist/surfaces/index.d.ts +1 -2
  158. package/dist/surfaces/index.d.ts.map +1 -1
  159. package/dist/surfaces/index.js +18 -20
  160. package/dist/surfaces/index.js.map +1 -1
  161. package/dist/surfaces/panel/panel.d.ts +5 -0
  162. package/dist/surfaces/panel/panel.d.ts.map +1 -0
  163. package/dist/surfaces/panel/panel.js +19 -0
  164. package/dist/surfaces/panel/panel.js.map +1 -0
  165. package/dist/surfaces/pop_confirm/pop_confirm.js +2 -3
  166. package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
  167. package/dist/surfaces/window/window.d.ts +1 -1
  168. package/dist/surfaces/window/window.d.ts.map +1 -1
  169. package/dist/surfaces/window/window.js +20 -10
  170. package/dist/surfaces/window/window.js.map +1 -1
  171. package/dist/themes/stylesheets/reset.css +1 -1
  172. package/dist/themes/stylesheets/reset.js +8 -1
  173. package/dist/themes/stylesheets/reset.js.map +1 -1
  174. package/dist/themes/theme.d.ts +2 -1
  175. package/dist/themes/theme.d.ts.map +1 -1
  176. package/dist/themes/theme.js +16 -9
  177. package/dist/themes/theme.js.map +1 -1
  178. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  179. package/dist/themes/themes/ergo/ergo_theme.js +210 -18
  180. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  181. package/dist/typography/body_text/body_text.d.ts.map +1 -1
  182. package/dist/typography/body_text/body_text.js +12 -10
  183. package/dist/typography/body_text/body_text.js.map +1 -1
  184. package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +1 -1
  185. package/dist/utils/dnd/hooks/use_drag_container.js +22 -19
  186. package/dist/utils/dnd/hooks/use_drag_container.js.map +1 -1
  187. package/package.json +4 -2
  188. package/src/form/field/h_field/h_field.tsx +0 -4
  189. package/src/form/field/v_field/v_field.stories.tsx +8 -0
  190. package/src/form/field/v_field/v_field.tsx +1 -4
  191. package/src/form/field_set/field_set.stories.tsx +2 -1
  192. package/src/inputs/__docs__/inputs.mdx +81 -0
  193. package/src/inputs/__docs__/inputs.stories.tsx +268 -0
  194. package/src/inputs/color_input/color_input.tsx +17 -17
  195. package/src/inputs/combo_box/combo_box.tsx +17 -13
  196. package/src/inputs/index.ts +2 -0
  197. package/src/inputs/input/input.tsx +1 -1
  198. package/src/inputs/input_group/input_group.tsx +26 -0
  199. package/src/inputs/phone_number_input/countries_phone_information.ts +6 -353
  200. package/src/inputs/phone_number_input/phone_number_context.tsx +32 -0
  201. package/src/inputs/phone_number_input/phone_number_country_select_adapter.tsx +126 -0
  202. package/src/inputs/phone_number_input/phone_number_input.module.css +5 -63
  203. package/src/inputs/phone_number_input/phone_number_input.stories.tsx +180 -150
  204. package/src/inputs/phone_number_input/phone_number_input.tsx +133 -400
  205. package/src/inputs/phone_number_input/phone_number_input_adapter.tsx +123 -0
  206. package/src/inputs/phone_number_input/sip_input.tsx +147 -0
  207. package/src/inputs/select/select.tsx +13 -14
  208. package/src/inputs/suggestions/suggestion_list.module.css +1 -0
  209. package/src/inputs/suggestions/suggestion_list.stories.tsx +12 -8
  210. package/src/inputs/suggestions/suggestion_list.tsx +24 -3
  211. package/src/inputs/textarea/textarea.tsx +1 -1
  212. package/src/inputs/unit_input/unit_input.tsx +17 -17
  213. package/src/layouts/__stories__/composed.stories.tsx +0 -55
  214. package/src/layouts/__stories__/rail.stories.tsx +78 -0
  215. package/src/layouts/__stories__/scaffold.stories.tsx +90 -0
  216. package/src/layouts/__stories__/utils/content.tsx +27 -0
  217. package/src/layouts/__stories__/utils/layout_theme.css +88 -0
  218. package/src/layouts/__stories__/utils/layout_theme_provider.tsx +11 -0
  219. package/src/layouts/__stories__/utils.tsx +6 -6
  220. package/src/layouts/{utility_bar/utility_bar.module.css → bar/bar.module.css} +2 -1
  221. package/src/layouts/bar/bar.tsx +23 -0
  222. package/src/layouts/body/body.module.css +9 -4
  223. package/src/layouts/body/body.tsx +7 -6
  224. package/src/layouts/body/h_body.module.css +1 -2
  225. package/src/layouts/body/h_body.tsx +9 -4
  226. package/src/layouts/body/v_body.tsx +9 -4
  227. package/src/layouts/divider/divider.module.css +1 -1
  228. package/src/layouts/footer/footer.module.css +0 -3
  229. package/src/layouts/footer/footer.tsx +5 -6
  230. package/src/layouts/header/header.tsx +6 -15
  231. package/src/layouts/index.ts +0 -1
  232. package/src/layouts/rail/rail.module.css +9 -5
  233. package/src/layouts/rail/rail.tsx +1 -1
  234. package/src/layouts/rail/side/side.module.css +0 -1
  235. package/src/layouts/rail/side/side.tsx +1 -2
  236. package/src/layouts/rail/utility_strip/utility_strip.module.css +5 -0
  237. package/src/layouts/rail/utility_strip/utility_strip.tsx +4 -1
  238. package/src/layouts/scaffold/scaffold.module.css +10 -7
  239. package/src/layouts/scaffold/scaffold.tsx +1 -1
  240. package/src/layouts/utility_bar/utility_bar.tsx +6 -9
  241. package/src/overlay/frame/frame.module.css +2 -4
  242. package/src/overlay/frame/frame.stories.tsx +13 -10
  243. package/src/overlay/frame/frame.tsx +124 -16
  244. package/src/overlay/popper/base/dismissal_decorator.tsx +1 -1
  245. package/src/overlay/popper/legacy/popper.tsx +5 -1
  246. package/src/stacks/box/bottom_resize_handle.tsx +12 -5
  247. package/src/stacks/box/box.tsx +18 -14
  248. package/src/stacks/box/end_resize_handle.tsx +11 -6
  249. package/src/stacks/box/left_resize_handle.tsx +9 -3
  250. package/src/stacks/box/resize_handlers.ts +27 -13
  251. package/src/stacks/box/right_resize_handle.tsx +9 -3
  252. package/src/stacks/box/start_resize_handle.tsx +9 -4
  253. package/src/stacks/box/top_resize_handle.tsx +10 -4
  254. package/src/stacks/collapsible_box.stories.tsx +11 -11
  255. package/src/stacks/h_collapsible_box.tsx +5 -5
  256. package/src/stacks/v_collapsible_box.tsx +4 -4
  257. package/src/surfaces/index.ts +1 -2
  258. package/src/surfaces/panel/__stories__/panel.stories.tsx +12 -12
  259. package/src/surfaces/panel/__stories__/panel_stories.module.css +3 -3
  260. package/src/surfaces/panel/panel.module.css +1 -6
  261. package/src/surfaces/panel/panel.tsx +22 -0
  262. package/src/surfaces/window/window.tsx +14 -4
  263. package/src/themes/stories/controls_fieldset.tsx +1 -1
  264. package/src/themes/stylesheets/reset.css +8 -1
  265. package/src/themes/theme.tsx +6 -2
  266. package/src/themes/themes/ergo/__stories__/material.stories.tsx +15 -16
  267. package/src/themes/themes/ergo/ergo_theme.css +210 -18
  268. package/src/typography/body_text/body_text.tsx +2 -0
  269. package/src/utils/dnd/__stories__/draggable.stories.tsx +14 -8
  270. package/src/utils/dnd/hooks/use_drag_container.ts +13 -3
  271. package/dist/h_body.css +0 -1
  272. package/dist/h_panel.css +0 -1
  273. package/dist/header.css +0 -1
  274. package/dist/layouts/rail/main/main.d.ts +0 -6
  275. package/dist/layouts/rail/main/main.d.ts.map +0 -1
  276. package/dist/layouts/rail/main/main.js +0 -21
  277. package/dist/layouts/rail/main/main.js.map +0 -1
  278. package/dist/main.css +0 -1
  279. package/dist/surfaces/panel/h_panel.d.ts +0 -9
  280. package/dist/surfaces/panel/h_panel.d.ts.map +0 -1
  281. package/dist/surfaces/panel/h_panel.js +0 -60
  282. package/dist/surfaces/panel/h_panel.js.map +0 -1
  283. package/dist/surfaces/panel/v_panel.d.ts +0 -5
  284. package/dist/surfaces/panel/v_panel.d.ts.map +0 -1
  285. package/dist/surfaces/panel/v_panel.js +0 -19
  286. package/dist/surfaces/panel/v_panel.js.map +0 -1
  287. package/dist/utility_bar.css +0 -1
  288. package/dist/v_body.css +0 -1
  289. package/src/inputs/phone_number_input/__tests__/utils.test.ts +0 -52
  290. package/src/layouts/header/header.module.css +0 -8
  291. package/src/layouts/rail/__stories__/rail.stories.tsx +0 -64
  292. package/src/layouts/rail/__stories__/rail_stories.module.css +0 -25
  293. package/src/layouts/rail/main/main.module.css +0 -7
  294. package/src/layouts/rail/main/main.tsx +0 -26
  295. package/src/layouts/scaffold/__stories__/scaffold.stories.tsx +0 -53
  296. package/src/layouts/scaffold/__stories__/scaffold_stories.module.css +0 -31
  297. package/src/surfaces/panel/h_panel.tsx +0 -65
  298. package/src/surfaces/panel/v_panel.tsx +0 -20
@@ -0,0 +1,27 @@
1
+ import { Box } from '../../../stacks/index.js';
2
+ import type { PropsWithChildren } from 'react';
3
+ import type { BoxProps } from '../../../stacks/index.js';
4
+ import { clsx } from 'clsx';
5
+
6
+ export interface SBLayoutContentProps extends BoxProps {}
7
+
8
+ export const SBLayoutContent: React.FC<PropsWithChildren<SBLayoutContentProps>> = ({
9
+ className,
10
+ children,
11
+ minHeight = '200px',
12
+ minWidth = '200px',
13
+ ...props
14
+ }) => {
15
+ return (
16
+ <Box
17
+ minHeight={minHeight}
18
+ minWidth={minWidth}
19
+ className={clsx('sb-layout-content', className)}
20
+ {...props}
21
+ >
22
+ ↔ {minWidth}
23
+ <br />↕ {minHeight}
24
+ {children}
25
+ </Box>
26
+ );
27
+ };
@@ -0,0 +1,88 @@
1
+ /* A way to visualize layout components - since they are not themed until being used in a surface */
2
+ .sb-layout-theme {
3
+ /* Forest (5) - Greens & teals */
4
+ --pastel-forest-bg: #e8f5e9;
5
+ --pastel-forest-1: #a5d6a7;
6
+ --pastel-forest-2: #81c784;
7
+ --pastel-forest-3: #66bb6a;
8
+ --pastel-forest-4: #4caf50;
9
+
10
+ /* Sunset (5) - Warm peaches, corals & yellows */
11
+ --pastel-sunset-bg: #fff7e3;
12
+ --pastel-sunset-1: #f5c6a0;
13
+ --pastel-sunset-2: #eba985;
14
+ --pastel-sunset-3: #e08f6a;
15
+ --pastel-sunset-4: #d47550;
16
+
17
+ /* Berry (5) - Purples, lavenders & pinks */
18
+ --pastel-berry-bg: #f5eafa;
19
+ --pastel-berry-1: #e8d5f2;
20
+ --pastel-berry-2: #d4b8e8;
21
+ --pastel-berry-3: #c9a7e0;
22
+ --pastel-berry-4: #b78ed4;
23
+
24
+ --bg: var(--pastel-sunset-bg);
25
+ --bg-1: var(--pastel-sunset-1);
26
+ --bg-2: var(--pastel-sunset-2);
27
+ --bg-3: var(--pastel-sunset-3);
28
+ --bg-4: var(--pastel-sunset-4);
29
+ --bg-5: rgba(0, 0, 0, 0.25);
30
+
31
+ :where(.tcn-scaffold) {
32
+ background: var(--bg);
33
+ }
34
+
35
+ :where(.tcn-bar) {
36
+ min-height: 32px;
37
+ }
38
+
39
+ :where(.tcn-header) {
40
+ background: var(--bg-1);
41
+ }
42
+
43
+ :where(.tcn-utility-bar) {
44
+ background: var(--bg-2);
45
+ }
46
+
47
+ :where(.tcn-footer) {
48
+ background: var(--bg-3);
49
+ }
50
+
51
+ :where(.tcn-body) {
52
+ background: var(--bg-4);
53
+ }
54
+
55
+ :where(.tcn-rail) {
56
+ background: var(--bg);
57
+ }
58
+
59
+ :where(.tcn-utility-strip) {
60
+ background: var(--bg-1);
61
+ min-width: 32px;
62
+ padding: 8px;
63
+
64
+ :where(.tcn-title) {
65
+ writing-mode: vertical-rl;
66
+ text-orientation: mixed;
67
+ }
68
+ }
69
+
70
+ :where(.tcn-side) {
71
+ background: var(--bg-2);
72
+ min-width: 32px;
73
+ }
74
+
75
+ :where(.tcn-main) {
76
+ background: var(--bg-4);
77
+ gap: 8px;
78
+ }
79
+
80
+ :where(.sb-layout-content) {
81
+ background: var(--bg-5);
82
+ display: flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ /* flex-grow: 1; */
86
+ height: 100%;
87
+ }
88
+ }
@@ -0,0 +1,11 @@
1
+ import { Box } from '../../../stacks/index.js';
2
+
3
+ import './layout_theme.css';
4
+
5
+ export const LayoutStoryDecorator = ({ children }: { children: React.ReactNode }) => {
6
+ return (
7
+ <Box className="sb-layout-theme" height="100vh" width="100vw" minHeight="400px">
8
+ {children}
9
+ </Box>
10
+ );
11
+ };
@@ -3,13 +3,13 @@ import clsx from 'clsx';
3
3
 
4
4
  import { Scaffold, type ScaffoldProps } from '../scaffold/scaffold.js';
5
5
  import { Header } from '../header/header.js';
6
- import { Body } from '../body/body.js';
7
6
  import { Footer } from '../footer/footer.js';
8
7
  import { UtilityBar } from '../utility_bar/utility_bar.js';
9
8
 
10
9
  import { Rail, type RailProps } from '../rail/rail.js';
11
10
  import { Side } from '../rail/side/side.js';
12
- import { Main } from '../rail/main/main.js';
11
+ import { VBody } from '../body/v_body.js';
12
+ import { HBody } from '../body/h_body.js';
13
13
  import { Box, Spacer } from '../../stacks/index.js';
14
14
  import { UtilityStrip } from '../rail/utility_strip/utility_strip.js';
15
15
  import { SearchIcon } from '@tcn/icons/search_icon.js';
@@ -101,10 +101,10 @@ export const SBNestedRail: React.FC<PropsWithChildren<SBNestedRailProps>> = ({
101
101
  </UtilityStrip>
102
102
  )}
103
103
  {main && (
104
- <Main className={clsx(styles.main, styles.secondary)} width="200px">
105
- {mainLabel && <>Main</>}
104
+ <HBody className={clsx(styles.main, styles.secondary)} width="200px">
105
+ {mainLabel && <>Body</>}
106
106
  {children}
107
- </Main>
107
+ </HBody>
108
108
  )}
109
109
  {!main && children}
110
110
  {side && (
@@ -163,7 +163,7 @@ export const SBNestedScaffold: React.FC<PropsWithChildren<SBNestedScaffoldProps>
163
163
  </UtilityBar>
164
164
  )}
165
165
  {body && (
166
- <Body className={clsx(styles.body, styles.secondary)}>Body {children}</Body>
166
+ <VBody className={clsx(styles.body, styles.secondary)}>Body {children}</VBody>
167
167
  )}
168
168
  {!body && children}
169
169
  {footer && (
@@ -1,6 +1,7 @@
1
1
  @layer tcn-system {
2
- :where(.utility-bar) {
2
+ :where(.bar) {
3
3
  width: 100%;
4
+ height: auto;
4
5
  min-height: 0;
5
6
  }
6
7
  }
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { HStack, type HStackProps } from '../../stacks/h_stack.js';
4
+
5
+ import styles from './bar.module.css';
6
+
7
+ export type BarProps = HStackProps;
8
+
9
+ export const Bar = React.forwardRef<HTMLElement, BarProps>(function Bar(
10
+ { children, className, ...props }: BarProps,
11
+ ref
12
+ ) {
13
+ return (
14
+ <HStack
15
+ ref={ref}
16
+ as="header"
17
+ className={clsx(className, styles['bar'], 'tcn-bar')}
18
+ {...props}
19
+ >
20
+ {children}
21
+ </HStack>
22
+ );
23
+ });
@@ -1,11 +1,16 @@
1
1
  @layer tcn-system {
2
2
  .body {
3
3
  min-height: 0;
4
+ min-width: 0;
4
5
  flex-grow: 1;
5
- width: 100%;
6
- height: 100%;
6
+ flex-shrink: unset;
7
7
  }
8
- :where(.tcn-main) {
9
- height: auto;
8
+
9
+ .h-body {
10
+ overflow-x: auto;
11
+ }
12
+
13
+ .v-body {
14
+ overflow-y: auto;
10
15
  }
11
16
  }
@@ -1,23 +1,24 @@
1
- import { VStack, type VStackProps } from '../../stacks/v_stack.js';
2
1
  import React from 'react';
3
2
  import { clsx } from 'clsx';
4
3
  import styles from './body.module.css';
4
+ import { Box, type BoxProps } from '../../stacks/box/box.js';
5
5
 
6
- export interface BodyProps extends Omit<VStackProps, 'as'> {}
6
+ export interface BodyProps extends Omit<BoxProps, 'as'> {}
7
7
 
8
+ // Under construction: although this component behaves correctly, a content/child component that manages scrolling is needed.
9
+ // For now HBody and VBody are recommended.
8
10
  export const Body = React.forwardRef<HTMLElement, BodyProps>(function Body(
9
- { children, className, overflowY = 'auto', ...props }: BodyProps,
11
+ { children, className, ...props }: BodyProps,
10
12
  ref
11
13
  ) {
12
14
  return (
13
- <VStack
15
+ <Box
14
16
  ref={ref}
15
17
  as="div"
16
- overflowY={overflowY}
17
18
  className={clsx(styles['body'], className, 'tcn-body')}
18
19
  {...props}
19
20
  >
20
21
  {children}
21
- </VStack>
22
+ </Box>
22
23
  );
23
24
  });
@@ -2,7 +2,6 @@
2
2
  :where(.h-body) {
3
3
  min-width: 0;
4
4
  flex-grow: 1;
5
- flex-grow: 1;
6
- height: 100%;
5
+ height: auto;
7
6
  }
8
7
  }
@@ -1,20 +1,25 @@
1
1
  import { HStack, type HStackProps } from '../../stacks/h_stack.js';
2
2
  import React from 'react';
3
3
  import { clsx } from 'clsx';
4
- import styles from './h_body.module.css';
4
+ import styles from './body.module.css';
5
5
 
6
6
  export interface HBodyProps extends Omit<HStackProps, 'as'> {}
7
7
 
8
8
  export const HBody = React.forwardRef<HTMLElement, HBodyProps>(function HBody(
9
- { children, className, overflowX = 'auto', ...props }: HBodyProps,
9
+ { children, className, ...props }: HBodyProps,
10
10
  ref
11
11
  ) {
12
12
  return (
13
13
  <HStack
14
14
  ref={ref}
15
15
  as="div"
16
- overflowX={overflowX}
17
- className={clsx(styles['h-body'], className, 'tcn-h-body', 'tcn-body')}
16
+ className={clsx(
17
+ styles['body'],
18
+ styles['h-body'],
19
+ className,
20
+ 'tcn-h-body',
21
+ 'tcn-body'
22
+ )}
18
23
  {...props}
19
24
  >
20
25
  {children}
@@ -1,20 +1,25 @@
1
1
  import { VStack, type VStackProps } from '../../stacks/v_stack.js';
2
2
  import React from 'react';
3
3
  import { clsx } from 'clsx';
4
- import styles from './v_body.module.css';
4
+ import styles from './body.module.css';
5
5
 
6
6
  export interface VBodyProps extends Omit<VStackProps, 'as'> {}
7
7
 
8
8
  export const VBody = React.forwardRef<HTMLElement, VBodyProps>(function VBody(
9
- { children, className, overflowY = 'auto', ...props }: VBodyProps,
9
+ { children, className, ...props }: VBodyProps,
10
10
  ref
11
11
  ) {
12
12
  return (
13
13
  <VStack
14
14
  ref={ref}
15
15
  as="div"
16
- overflowY={overflowY}
17
- className={clsx(styles['v-body'], className, 'tcn-body', 'tcn-v-body')}
16
+ className={clsx(
17
+ styles['body'],
18
+ styles['v-body'],
19
+ className,
20
+ 'tcn-body',
21
+ 'tcn-v-body'
22
+ )}
18
23
  {...props}
19
24
  >
20
25
  {children}
@@ -19,7 +19,7 @@
19
19
  background: #aaa;
20
20
  }
21
21
 
22
- :where(.divider-line[data-emphasis="light"]) {
22
+ :where(.divider-line[data-emphasis="faint"]) {
23
23
  background: color-mix(in srgb, #aaa, white 20%);
24
24
  }
25
25
 
@@ -1,9 +1,6 @@
1
1
  @layer tcn-system {
2
2
  :where(.footer) {
3
- width: 100%;
4
3
  min-height: 0;
5
- padding: var(--padding) var(--padding-large);
6
- gap: var(--gap);
7
4
  }
8
5
 
9
6
  /*
@@ -1,13 +1,12 @@
1
1
  import React from 'react';
2
2
  import { clsx } from 'clsx';
3
- import { HStack, type HStackProps } from '../../stacks/h_stack.js';
4
3
  import type { Hierarchy, Size } from '../../utils/index.js';
5
- import styles from './footer.module.css';
4
+ import { Bar, type BarProps } from '../bar/bar.js';
6
5
 
7
- export interface FooterProps extends Omit<HStackProps, 'as' | 'children'> {
6
+ import styles from './footer.module.css';
7
+ export interface FooterProps extends Omit<BarProps, 'as'> {
8
8
  hierarchy?: Hierarchy;
9
9
  size?: Size;
10
- children?: React.ReactNode;
11
10
  }
12
11
 
13
12
  export const Footer = React.forwardRef<HTMLElement, FooterProps>(function Footer(
@@ -15,7 +14,7 @@ export const Footer = React.forwardRef<HTMLElement, FooterProps>(function Footer
15
14
  ref
16
15
  ) {
17
16
  return (
18
- <HStack
17
+ <Bar
19
18
  ref={ref}
20
19
  as="footer"
21
20
  className={clsx(styles.footer, className, 'tcn-footer')}
@@ -24,6 +23,6 @@ export const Footer = React.forwardRef<HTMLElement, FooterProps>(function Footer
24
23
  {...props}
25
24
  >
26
25
  {children}
27
- </HStack>
26
+ </Bar>
28
27
  );
29
28
  });
@@ -1,36 +1,27 @@
1
1
  import React from 'react';
2
2
  import { clsx } from 'clsx';
3
- import { HStack, type HStackProps } from '../../stacks/h_stack.js';
4
3
  import type { Hierarchy, Size } from '../../utils/index.js';
5
- import styles from './header.module.css';
4
+ import { Bar, type BarProps } from '../bar/bar.js';
6
5
 
7
- export interface HeaderProps extends Omit<HStackProps, 'as'> {
6
+ export interface HeaderProps extends Omit<BarProps, 'as'> {
8
7
  hierarchy?: Hierarchy;
9
8
  size?: Size;
10
9
  }
11
10
 
12
11
  export const Header = React.forwardRef<HTMLElement, HeaderProps>(function Header(
13
- {
14
- hierarchy = 'secondary',
15
- height = 'auto',
16
- children,
17
- className,
18
- size = 'md',
19
- ...props
20
- }: HeaderProps,
12
+ { hierarchy = 'secondary', size = 'md', children, className, ...props }: HeaderProps,
21
13
  ref
22
14
  ) {
23
15
  return (
24
- <HStack
16
+ <Bar
25
17
  ref={ref}
26
18
  as="header"
27
- className={clsx(styles.header, className, 'tcn-header')}
19
+ className={clsx(className, 'tcn-header')}
28
20
  data-hierarchy={hierarchy}
29
21
  data-size={size}
30
- height={height}
31
22
  {...props}
32
23
  >
33
24
  {children}
34
- </HStack>
25
+ </Bar>
35
26
  );
36
27
  });
@@ -21,7 +21,6 @@ export { Breakpoint, type BreakpointProps } from './responsive/breakpoint.js';
21
21
  export { TTable, THead, TBody, TFoot, TR, TH, TD } from './table/table.js';
22
22
 
23
23
  export { Rail, type RailProps } from './rail/rail.js';
24
- export { Main, type MainProps } from './rail/main/main.js';
25
24
  export { Side, type SideProps } from './rail/side/side.js';
26
25
  export {
27
26
  UtilityStrip,
@@ -1,10 +1,14 @@
1
1
  @layer tcn-system {
2
- :where(.rail-stack) {
3
- width: 100%;
4
- height: 100%;
5
- overflow: auto;
6
- :where(.tcn-body) {
2
+ .rail {
3
+ :where(.rail-stack) {
4
+ width: 100%;
7
5
  height: 100%;
6
+ overflow: auto;
7
+ > :global(.tcn-body) {
8
+ height: 100%;
9
+ width: auto;
10
+ overflow-x: auto;
11
+ }
8
12
  }
9
13
  }
10
14
  }
@@ -40,7 +40,7 @@ export const Rail = React.forwardRef<HTMLElement, RailProps>(function Rail(
40
40
  maxHeight={maxHeight}
41
41
  data-h-alignment={hAlign}
42
42
  data-v-alignment={vAlign}
43
- className={clsx(className, 'tcn-rail')}
43
+ className={clsx(className, styles['rail'], 'tcn-rail')}
44
44
  {...props}
45
45
  >
46
46
  <HStack
@@ -2,7 +2,6 @@
2
2
  :where(.side) {
3
3
  min-width: 0;
4
4
  height: 100%;
5
- flex-grow: 0;
6
5
  width: auto;
7
6
  }
8
7
  }
@@ -4,7 +4,6 @@ import { VStack, type VStackProps } from '../../../stacks/v_stack.js';
4
4
 
5
5
  import styles from './side.module.css';
6
6
 
7
- // UtilityBar
8
7
  export interface SideProps extends Omit<VStackProps, 'as'> {}
9
8
 
10
9
  export const Side = React.forwardRef<HTMLElement, SideProps>(function UtilityStrip(
@@ -14,9 +13,9 @@ export const Side = React.forwardRef<HTMLElement, SideProps>(function UtilityStr
14
13
  return (
15
14
  <VStack
16
15
  ref={ref}
16
+ width={width}
17
17
  className={clsx(styles['side'], 'tcn-side', className)}
18
18
  as="section"
19
- width={width}
20
19
  {...props}
21
20
  >
22
21
  {children}
@@ -2,5 +2,10 @@
2
2
  :where(.utility-strip) {
3
3
  height: 100%;
4
4
  min-width: 0;
5
+ /* WIP */
6
+ /* writing-mode: vertical-rl;
7
+ text-orientation: mixed;
8
+ align-items: start;
9
+ justify-content: center; */
5
10
  }
6
11
  }
@@ -5,7 +5,6 @@ import { VStack, type VStackProps } from '../../../stacks/v_stack.js';
5
5
 
6
6
  import styles from './utility_strip.module.css';
7
7
 
8
- // UtilityBar
9
8
  export interface UtilityStripProps extends Omit<VStackProps, 'as'> {
10
9
  hierarchy?: Hierarchy;
11
10
  size?: Size;
@@ -18,6 +17,8 @@ export const UtilityStrip = React.forwardRef<HTMLElement, UtilityStripProps>(
18
17
  className,
19
18
  width = 'auto',
20
19
  hierarchy = 'secondary',
20
+ vAlign = 'start',
21
+ hAlign = 'center',
21
22
  size = 'md',
22
23
  ...props
23
24
  }: UtilityStripProps,
@@ -27,6 +28,8 @@ export const UtilityStrip = React.forwardRef<HTMLElement, UtilityStripProps>(
27
28
  <VStack
28
29
  ref={ref}
29
30
  as="header"
31
+ vAlign={vAlign}
32
+ hAlign={hAlign}
30
33
  className={clsx(styles['utility-strip'], 'tcn-utility-strip', className)}
31
34
  data-hierarchy={hierarchy}
32
35
  data-size={size}
@@ -1,11 +1,14 @@
1
1
  @layer tcn-system {
2
- :where(.scaffold-stack) {
3
- width: 100%;
4
- height: 100%;
5
- overflow: auto;
6
- :where(.tcn-main) {
7
- height: auto;
8
- background: black !important;
2
+ .scaffold {
3
+ :where(.scaffold-stack) {
4
+ width: 100%;
5
+ height: 100%;
6
+ overflow: auto;
7
+ > :global(.tcn-body) {
8
+ width: 100%;
9
+ height: auto;
10
+ overflow-y: auto;
11
+ }
9
12
  }
10
13
  }
11
14
  }
@@ -38,7 +38,7 @@ export const Scaffold = React.forwardRef<HTMLElement, ScaffoldProps>(function Sc
38
38
  maxHeight={maxHeight}
39
39
  data-h-alignment={hAlign}
40
40
  data-v-alignment={vAlign}
41
- className={clsx(className, 'tcn-scaffold')}
41
+ className={clsx(className, styles['scaffold'], 'tcn-scaffold')}
42
42
  {...props}
43
43
  >
44
44
  <VStack
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
2
  import { clsx } from 'clsx';
3
- import { HStack, type HStackProps } from '../../stacks/h_stack.js';
4
3
  import type { Hierarchy, Size } from '../../utils/index.js';
5
- import styles from './utility_bar.module.css';
4
+ import { Bar, type BarProps } from '../bar/bar.js';
6
5
 
7
6
  // UtilityBar
8
- export interface UtilityBarProps extends Omit<HStackProps, 'as'> {
7
+ export interface UtilityBarProps extends Omit<BarProps, 'as'> {
9
8
  hierarchy?: Hierarchy;
10
9
  size?: Size;
11
10
  }
@@ -14,26 +13,24 @@ export const UtilityBar = React.forwardRef<HTMLElement, UtilityBarProps>(
14
13
  function UtilityBar(
15
14
  {
16
15
  hierarchy = 'secondary',
17
- height = 'auto',
16
+ size = 'md',
18
17
  children,
19
18
  className,
20
- size = 'md',
21
19
  ...props
22
20
  }: UtilityBarProps,
23
21
  ref
24
22
  ) {
25
23
  return (
26
- <HStack
24
+ <Bar
27
25
  ref={ref}
28
26
  as="header"
29
- className={clsx(styles['utility-bar'], className, 'tcn-utility-bar')}
27
+ className={clsx(className, 'tcn-utility-bar')}
30
28
  data-hierarchy={hierarchy}
31
29
  data-size={size}
32
- height={height}
33
30
  {...props}
34
31
  >
35
32
  {children}
36
- </HStack>
33
+ </Bar>
37
34
  );
38
35
  }
39
36
  );
@@ -1,7 +1,5 @@
1
1
  @layer tcn-system {
2
- :where(.frame) {
3
- padding: 0;
4
- border: none;
5
- background: none;
2
+ :where(.frame-dialog) {
3
+ overflow: hidden;
6
4
  }
7
5
  }
@@ -1,9 +1,9 @@
1
+ import { Header, Scaffold } from '../../layouts/index.js';
1
2
  import { ZStack } from '../../stacks/z_stack.js';
2
- import { Frame, type FrameOwnProps } from './frame.js';
3
- import { DragHandle } from '../../utils/dnd/handle.js';
4
- import { Title } from '../../typography/title/title.js';
5
3
  import { BodyText } from '../../typography/index.js';
6
- import { Header } from '../../layouts/index.js';
4
+ import { Title } from '../../typography/title/title.js';
5
+ import { DragHandle } from '../../utils/dnd/handle.js';
6
+ import { Frame, type FrameOwnProps } from './frame.js';
7
7
  import styles from './frame_stories.module.css';
8
8
  export default {
9
9
  title: 'Overlays/Floating/Frame',
@@ -14,6 +14,7 @@ export default {
14
14
  isOpen: true,
15
15
  draggable: true,
16
16
  veil: false,
17
+ resizable: true,
17
18
  },
18
19
  };
19
20
 
@@ -26,14 +27,16 @@ export const FrameStory = (args: Omit<FrameOwnProps, 'children'>) => {
26
27
  className={styles['sb-frame-container']}
27
28
  {...args}
28
29
  >
29
- <Header className={styles['sb-frame-header']}>
30
- <Title> This is a frame</Title>
31
- </Header>
32
- <DragHandle>
30
+ <Scaffold>
33
31
  <Header className={styles['sb-frame-header']}>
34
- <BodyText> You can drag here.</BodyText>
32
+ <Title> This is a frame</Title>
35
33
  </Header>
36
- </DragHandle>
34
+ <DragHandle>
35
+ <Header className={styles['sb-frame-header']}>
36
+ <BodyText> You can drag here.</BodyText>
37
+ </Header>
38
+ </DragHandle>
39
+ </Scaffold>
37
40
  </Frame>
38
41
  </ZStack>
39
42
  );