@tcn/ui 0.8.1 → 0.10.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 (285) 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/feedback/progress/progress_bar.js +13 -13
  7. package/dist/footer.css +1 -1
  8. package/dist/form/field/common/field_description.js +7 -8
  9. package/dist/form/field/common/field_description.js.map +1 -1
  10. package/dist/form/field/common/field_error.js +6 -6
  11. package/dist/form/field/common/field_label.js +7 -8
  12. package/dist/form/field/common/field_label.js.map +1 -1
  13. package/dist/form/field_set/field_set.js +7 -7
  14. package/dist/inputs/date_picker/date_picker_date.js +6 -6
  15. package/dist/inputs/date_picker/date_picker_day.js +6 -6
  16. package/dist/inputs/date_picker/date_picker_time_selector.js +5 -5
  17. package/dist/inputs/date_picker/date_picker_year_selector.js +5 -5
  18. package/dist/inputs/suggestions/suggestion_list.js +6 -6
  19. package/dist/layouts/bar/bar.d.ts +5 -0
  20. package/dist/layouts/bar/bar.d.ts.map +1 -0
  21. package/dist/layouts/bar/bar.js +20 -0
  22. package/dist/layouts/bar/bar.js.map +1 -0
  23. package/dist/layouts/body/body.d.ts +2 -2
  24. package/dist/layouts/body/body.d.ts.map +1 -1
  25. package/dist/layouts/body/body.js +12 -12
  26. package/dist/layouts/body/body.js.map +1 -1
  27. package/dist/layouts/body/h_body.d.ts.map +1 -1
  28. package/dist/layouts/body/h_body.js +18 -12
  29. package/dist/layouts/body/h_body.js.map +1 -1
  30. package/dist/layouts/body/v_body.d.ts.map +1 -1
  31. package/dist/layouts/body/v_body.js +16 -10
  32. package/dist/layouts/body/v_body.js.map +1 -1
  33. package/dist/layouts/footer/footer.d.ts +2 -3
  34. package/dist/layouts/footer/footer.d.ts.map +1 -1
  35. package/dist/layouts/footer/footer.js +7 -7
  36. package/dist/layouts/footer/footer.js.map +1 -1
  37. package/dist/layouts/header/header.d.ts +2 -2
  38. package/dist/layouts/header/header.d.ts.map +1 -1
  39. package/dist/layouts/header/header.js +13 -21
  40. package/dist/layouts/header/header.js.map +1 -1
  41. package/dist/layouts/index.d.ts +2 -1
  42. package/dist/layouts/index.d.ts.map +1 -1
  43. package/dist/layouts/index.js +40 -38
  44. package/dist/layouts/index.js.map +1 -1
  45. package/dist/layouts/rail/rail.js +41 -41
  46. package/dist/layouts/rail/rail.js.map +1 -1
  47. package/dist/layouts/rail/side/side.d.ts.map +1 -1
  48. package/dist/layouts/rail/side/side.js +1 -1
  49. package/dist/layouts/rail/side/side.js.map +1 -1
  50. package/dist/layouts/rail/utility_strip/utility_strip.d.ts.map +1 -1
  51. package/dist/layouts/rail/utility_strip/utility_strip.js +21 -17
  52. package/dist/layouts/rail/utility_strip/utility_strip.js.map +1 -1
  53. package/dist/layouts/responsive/breakpoint.d.ts +11 -0
  54. package/dist/layouts/responsive/breakpoint.d.ts.map +1 -0
  55. package/dist/layouts/responsive/breakpoint.js +15 -0
  56. package/dist/layouts/responsive/breakpoint.js.map +1 -0
  57. package/dist/layouts/responsive/responsive.d.ts +7 -0
  58. package/dist/layouts/responsive/responsive.d.ts.map +1 -0
  59. package/dist/layouts/responsive/responsive.js +11 -0
  60. package/dist/layouts/responsive/responsive.js.map +1 -0
  61. package/dist/layouts/responsive/responsive_container.d.ts +7 -0
  62. package/dist/layouts/responsive/responsive_container.d.ts.map +1 -0
  63. package/dist/layouts/responsive/responsive_container.js +30 -0
  64. package/dist/layouts/responsive/responsive_container.js.map +1 -0
  65. package/dist/layouts/responsive/responsive_viewport.d.ts +7 -0
  66. package/dist/layouts/responsive/responsive_viewport.d.ts.map +1 -0
  67. package/dist/layouts/responsive/responsive_viewport.js +12 -0
  68. package/dist/layouts/responsive/responsive_viewport.js.map +1 -0
  69. package/dist/layouts/scaffold/scaffold.js +32 -32
  70. package/dist/layouts/scaffold/scaffold.js.map +1 -1
  71. package/dist/layouts/utility_bar/utility_bar.d.ts +2 -2
  72. package/dist/layouts/utility_bar/utility_bar.d.ts.map +1 -1
  73. package/dist/layouts/utility_bar/utility_bar.js +17 -19
  74. package/dist/layouts/utility_bar/utility_bar.js.map +1 -1
  75. package/dist/overlay/frame/frame.js +3 -3
  76. package/dist/overlay/frame/frame.js.map +1 -1
  77. package/dist/panel.css +1 -0
  78. package/dist/rail.css +1 -1
  79. package/dist/scaffold.css +1 -1
  80. package/dist/side.css +1 -1
  81. package/dist/stacks/box/bottom_resize_handle.d.ts +2 -2
  82. package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
  83. package/dist/stacks/box/bottom_resize_handle.js +12 -10
  84. package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
  85. package/dist/stacks/box/box.d.ts +4 -4
  86. package/dist/stacks/box/box.d.ts.map +1 -1
  87. package/dist/stacks/box/box.js +26 -26
  88. package/dist/stacks/box/box.js.map +1 -1
  89. package/dist/stacks/box/end_resize_handle.d.ts +2 -2
  90. package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
  91. package/dist/stacks/box/end_resize_handle.js +6 -5
  92. package/dist/stacks/box/end_resize_handle.js.map +1 -1
  93. package/dist/stacks/box/left_resize_handle.d.ts +2 -2
  94. package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
  95. package/dist/stacks/box/left_resize_handle.js +10 -9
  96. package/dist/stacks/box/left_resize_handle.js.map +1 -1
  97. package/dist/stacks/box/resize_handlers.d.ts +2 -2
  98. package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
  99. package/dist/stacks/box/resize_handlers.js +24 -24
  100. package/dist/stacks/box/resize_handlers.js.map +1 -1
  101. package/dist/stacks/box/right_resize_handle.d.ts +2 -2
  102. package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
  103. package/dist/stacks/box/right_resize_handle.js +6 -5
  104. package/dist/stacks/box/right_resize_handle.js.map +1 -1
  105. package/dist/stacks/box/start_resize_handle.d.ts +2 -2
  106. package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
  107. package/dist/stacks/box/start_resize_handle.js +4 -4
  108. package/dist/stacks/box/start_resize_handle.js.map +1 -1
  109. package/dist/stacks/box/top_resize_handle.d.ts +2 -2
  110. package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
  111. package/dist/stacks/box/top_resize_handle.js +2 -1
  112. package/dist/stacks/box/top_resize_handle.js.map +1 -1
  113. package/dist/stacks/h_collapsible_box.d.ts.map +1 -1
  114. package/dist/stacks/h_collapsible_box.js +24 -24
  115. package/dist/stacks/h_collapsible_box.js.map +1 -1
  116. package/dist/stacks/v_collapsible_box.js +25 -25
  117. package/dist/stacks/v_collapsible_box.js.map +1 -1
  118. package/dist/surfaces/confirm/confirm.js +5 -5
  119. package/dist/surfaces/index.d.ts +1 -2
  120. package/dist/surfaces/index.d.ts.map +1 -1
  121. package/dist/surfaces/index.js +18 -20
  122. package/dist/surfaces/index.js.map +1 -1
  123. package/dist/surfaces/panel/panel.d.ts +5 -0
  124. package/dist/surfaces/panel/panel.d.ts.map +1 -0
  125. package/dist/surfaces/panel/panel.js +19 -0
  126. package/dist/surfaces/panel/panel.js.map +1 -0
  127. package/dist/surfaces/pop_confirm/pop_confirm.js +1 -1
  128. package/dist/themes/theme.d.ts +2 -1
  129. package/dist/themes/theme.d.ts.map +1 -1
  130. package/dist/themes/theme.js +16 -9
  131. package/dist/themes/theme.js.map +1 -1
  132. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  133. package/dist/themes/themes/ergo/ergo_theme.js +27 -0
  134. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  135. package/dist/typography/body_text/body_text.d.ts +2 -1
  136. package/dist/typography/body_text/body_text.d.ts.map +1 -1
  137. package/dist/typography/body_text/body_text.js +24 -23
  138. package/dist/typography/body_text/body_text.js.map +1 -1
  139. package/dist/typography/callout/callout.d.ts +2 -1
  140. package/dist/typography/callout/callout.d.ts.map +1 -1
  141. package/dist/typography/callout/callout.js +28 -27
  142. package/dist/typography/callout/callout.js.map +1 -1
  143. package/dist/typography/caption/caption.d.ts +2 -1
  144. package/dist/typography/caption/caption.d.ts.map +1 -1
  145. package/dist/typography/caption/caption.js +18 -17
  146. package/dist/typography/caption/caption.js.map +1 -1
  147. package/dist/typography/footnote/footnote.d.ts +2 -1
  148. package/dist/typography/footnote/footnote.d.ts.map +1 -1
  149. package/dist/typography/footnote/footnote.js +25 -24
  150. package/dist/typography/footnote/footnote.js.map +1 -1
  151. package/dist/typography/headline/headline.d.ts +2 -1
  152. package/dist/typography/headline/headline.d.ts.map +1 -1
  153. package/dist/typography/headline/headline.js +36 -33
  154. package/dist/typography/headline/headline.js.map +1 -1
  155. package/dist/typography/subheadline/subheadline.d.ts +2 -1
  156. package/dist/typography/subheadline/subheadline.d.ts.map +1 -1
  157. package/dist/typography/subheadline/subheadline.js +35 -32
  158. package/dist/typography/subheadline/subheadline.js.map +1 -1
  159. package/dist/utils/dnd/context.d.ts.map +1 -1
  160. package/dist/utils/dnd/context.js +9 -7
  161. package/dist/utils/dnd/context.js.map +1 -1
  162. package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +1 -1
  163. package/dist/utils/dnd/hooks/use_drag_container.js +29 -15
  164. package/dist/utils/dnd/hooks/use_drag_container.js.map +1 -1
  165. package/dist/utils/dnd/types.d.ts +3 -4
  166. package/dist/utils/dnd/types.d.ts.map +1 -1
  167. package/dist/utils/hooks/use_media_query.d.ts +5 -8
  168. package/dist/utils/hooks/use_media_query.d.ts.map +1 -1
  169. package/dist/utils/hooks/use_media_query.js +10 -11
  170. package/dist/utils/hooks/use_media_query.js.map +1 -1
  171. package/dist/utils/index.d.ts +1 -2
  172. package/dist/utils/index.d.ts.map +1 -1
  173. package/dist/utils/index.js +19 -21
  174. package/dist/utils/index.js.map +1 -1
  175. package/package.json +1 -1
  176. package/src/layouts/__stories__/composed.stories.tsx +0 -55
  177. package/src/layouts/__stories__/rail.stories.tsx +78 -0
  178. package/src/layouts/__stories__/scaffold.stories.tsx +90 -0
  179. package/src/layouts/__stories__/utils/content.tsx +27 -0
  180. package/src/layouts/__stories__/utils/layout_theme.css +88 -0
  181. package/src/layouts/__stories__/utils/layout_theme_provider.tsx +11 -0
  182. package/src/layouts/__stories__/utils.tsx +6 -6
  183. package/src/layouts/{utility_bar/utility_bar.module.css → bar/bar.module.css} +2 -1
  184. package/src/layouts/bar/bar.tsx +23 -0
  185. package/src/layouts/body/body.module.css +9 -4
  186. package/src/layouts/body/body.tsx +7 -6
  187. package/src/layouts/body/h_body.module.css +1 -2
  188. package/src/layouts/body/h_body.tsx +9 -4
  189. package/src/layouts/body/v_body.tsx +9 -4
  190. package/src/layouts/divider/divider.module.css +1 -1
  191. package/src/layouts/footer/footer.module.css +0 -3
  192. package/src/layouts/footer/footer.tsx +5 -6
  193. package/src/layouts/header/header.tsx +6 -15
  194. package/src/layouts/index.ts +2 -1
  195. package/src/layouts/rail/rail.module.css +9 -5
  196. package/src/layouts/rail/rail.tsx +1 -1
  197. package/src/layouts/rail/side/side.module.css +0 -1
  198. package/src/layouts/rail/side/side.tsx +1 -2
  199. package/src/layouts/rail/utility_strip/utility_strip.module.css +5 -0
  200. package/src/layouts/rail/utility_strip/utility_strip.tsx +4 -1
  201. package/src/layouts/responsive/breakpoint.tsx +29 -0
  202. package/src/layouts/responsive/responsive.stories.tsx +37 -0
  203. package/src/layouts/responsive/responsive.tsx +18 -0
  204. package/src/layouts/responsive/responsive_container.tsx +51 -0
  205. package/src/layouts/responsive/responsive_viewport.tsx +17 -0
  206. package/src/layouts/scaffold/scaffold.module.css +10 -7
  207. package/src/layouts/scaffold/scaffold.tsx +1 -1
  208. package/src/layouts/utility_bar/utility_bar.tsx +6 -9
  209. package/src/overlay/frame/frame.tsx +2 -2
  210. package/src/stacks/box/bottom_resize_handle.tsx +7 -5
  211. package/src/stacks/box/box.tsx +12 -18
  212. package/src/stacks/box/end_resize_handle.tsx +6 -6
  213. package/src/stacks/box/left_resize_handle.tsx +4 -3
  214. package/src/stacks/box/resize_handlers.ts +11 -9
  215. package/src/stacks/box/right_resize_handle.tsx +4 -3
  216. package/src/stacks/box/start_resize_handle.tsx +3 -3
  217. package/src/stacks/box/top_resize_handle.tsx +4 -3
  218. package/src/stacks/collapsible_box.stories.tsx +11 -11
  219. package/src/stacks/h_collapsible_box.tsx +5 -5
  220. package/src/stacks/v_collapsible_box.tsx +4 -4
  221. package/src/surfaces/index.ts +1 -2
  222. package/src/surfaces/panel/__stories__/panel.stories.tsx +12 -12
  223. package/src/surfaces/panel/__stories__/panel_stories.module.css +3 -3
  224. package/src/surfaces/panel/panel.module.css +1 -6
  225. package/src/surfaces/panel/panel.tsx +22 -0
  226. package/src/themes/theme.tsx +6 -2
  227. package/src/themes/themes/ergo/__stories__/material.stories.tsx +15 -16
  228. package/src/themes/themes/ergo/ergo_theme.css +27 -0
  229. package/src/typography/body_text/body_text.tsx +21 -17
  230. package/src/typography/callout/callout.tsx +20 -16
  231. package/src/typography/caption/caption.tsx +20 -16
  232. package/src/typography/footnote/footnote.tsx +20 -16
  233. package/src/typography/headline/headline.tsx +60 -54
  234. package/src/typography/subheadline/subheadline.tsx +60 -54
  235. package/src/utils/dnd/__stories__/draggable.stories.tsx +34 -0
  236. package/src/utils/dnd/context.ts +1 -0
  237. package/src/utils/dnd/hooks/use_drag_container.ts +18 -1
  238. package/src/utils/dnd/types.ts +4 -1
  239. package/src/utils/hooks/use_media_query.ts +16 -27
  240. package/src/utils/index.ts +1 -3
  241. package/dist/body_text.module-h4XQE2pC.js +0 -5
  242. package/dist/body_text.module-h4XQE2pC.js.map +0 -1
  243. package/dist/callout.module-D8ECmxpO.js +0 -5
  244. package/dist/callout.module-D8ECmxpO.js.map +0 -1
  245. package/dist/caption.module-DDq0H4xZ.js +0 -5
  246. package/dist/caption.module-DDq0H4xZ.js.map +0 -1
  247. package/dist/footnote.module-DEyFuqOr.js +0 -5
  248. package/dist/footnote.module-DEyFuqOr.js.map +0 -1
  249. package/dist/h_body.css +0 -1
  250. package/dist/h_panel.css +0 -1
  251. package/dist/header.css +0 -1
  252. package/dist/headline.module-BiwHBtGf.js +0 -5
  253. package/dist/headline.module-BiwHBtGf.js.map +0 -1
  254. package/dist/layouts/rail/main/main.d.ts +0 -6
  255. package/dist/layouts/rail/main/main.d.ts.map +0 -1
  256. package/dist/layouts/rail/main/main.js +0 -21
  257. package/dist/layouts/rail/main/main.js.map +0 -1
  258. package/dist/main.css +0 -1
  259. package/dist/subheadline.module-C-v7zMkQ.js +0 -5
  260. package/dist/subheadline.module-C-v7zMkQ.js.map +0 -1
  261. package/dist/surfaces/panel/h_panel.d.ts +0 -9
  262. package/dist/surfaces/panel/h_panel.d.ts.map +0 -1
  263. package/dist/surfaces/panel/h_panel.js +0 -60
  264. package/dist/surfaces/panel/h_panel.js.map +0 -1
  265. package/dist/surfaces/panel/v_panel.d.ts +0 -5
  266. package/dist/surfaces/panel/v_panel.d.ts.map +0 -1
  267. package/dist/surfaces/panel/v_panel.js +0 -19
  268. package/dist/surfaces/panel/v_panel.js.map +0 -1
  269. package/dist/utility_bar.css +0 -1
  270. package/dist/utils/responsive/responsive_renderer.d.ts +0 -21
  271. package/dist/utils/responsive/responsive_renderer.d.ts.map +0 -1
  272. package/dist/utils/responsive/responsive_renderer.js +0 -12
  273. package/dist/utils/responsive/responsive_renderer.js.map +0 -1
  274. package/dist/v_body.css +0 -1
  275. package/src/layouts/header/header.module.css +0 -8
  276. package/src/layouts/rail/__stories__/rail.stories.tsx +0 -64
  277. package/src/layouts/rail/__stories__/rail_stories.module.css +0 -25
  278. package/src/layouts/rail/main/main.module.css +0 -7
  279. package/src/layouts/rail/main/main.tsx +0 -26
  280. package/src/layouts/scaffold/__stories__/scaffold.stories.tsx +0 -53
  281. package/src/layouts/scaffold/__stories__/scaffold_stories.module.css +0 -31
  282. package/src/surfaces/panel/h_panel.tsx +0 -65
  283. package/src/surfaces/panel/v_panel.tsx +0 -20
  284. package/src/utils/responsive/responsive_renderer.stories.tsx +0 -77
  285. package/src/utils/responsive/responsive_renderer.tsx +0 -31
@@ -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
  });
@@ -15,11 +15,12 @@ export { UtilityBar, type UtilityBarProps } from './utility_bar/utility_bar.js';
15
15
  export { Row } from './row/row.js';
16
16
  export { Section } from './section/section.js';
17
17
  export { Heading, type HeadingOwnProps } from './section/heading.js';
18
+ export { Responsive, type ResponsiveProps } from './responsive/responsive.js';
19
+ export { Breakpoint, type BreakpointProps } from './responsive/breakpoint.js';
18
20
 
19
21
  export { TTable, THead, TBody, TFoot, TR, TH, TD } from './table/table.js';
20
22
 
21
23
  export { Rail, type RailProps } from './rail/rail.js';
22
- export { Main, type MainProps } from './rail/main/main.js';
23
24
  export { Side, type SideProps } from './rail/side/side.js';
24
25
  export {
25
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}
@@ -0,0 +1,29 @@
1
+ export interface BreakpointProps {
2
+ from?: number | string;
3
+ to?: number | string;
4
+ children: React.ReactNode;
5
+ }
6
+
7
+ export interface InternalBreakpointProps extends BreakpointProps {
8
+ width: number;
9
+ }
10
+
11
+ function toNumber(value: number | string) {
12
+ if (typeof value === 'number') {
13
+ return value;
14
+ }
15
+
16
+ return parseFloat(value);
17
+ }
18
+
19
+ export function Breakpoint(_: BreakpointProps) {
20
+ return null;
21
+ }
22
+
23
+ export function InternalBreakpoint(props: InternalBreakpointProps) {
24
+ const from = toNumber(props.from ?? 0);
25
+ const to = toNumber(props.to ?? Infinity);
26
+ const isWithinRange = props.width >= from && props.width < to;
27
+
28
+ return isWithinRange ? props.children : null;
29
+ }
@@ -0,0 +1,37 @@
1
+ import { HStack } from '../../stacks/h_stack.js';
2
+ import { Breakpoint } from './breakpoint.js';
3
+ import { Responsive } from './responsive.js';
4
+
5
+ export default {
6
+ title: 'Layouts/Responsive',
7
+ component: Responsive,
8
+ tags: ['autodocs'],
9
+ };
10
+
11
+ export function Container() {
12
+ return (
13
+ <HStack width="100%" hAlign="center">
14
+ <Responsive>
15
+ <Breakpoint to={200}>Small</Breakpoint>
16
+ <Breakpoint from={200} to={800}>
17
+ Medium
18
+ </Breakpoint>
19
+ <Breakpoint from={800}>Large</Breakpoint>
20
+ </Responsive>
21
+ </HStack>
22
+ );
23
+ }
24
+
25
+ export function Viewport() {
26
+ return (
27
+ <HStack width="100%" hAlign="center">
28
+ <Responsive on="viewport">
29
+ <Breakpoint to={200}>Small</Breakpoint>
30
+ <Breakpoint from={200} to={800}>
31
+ Medium
32
+ </Breakpoint>
33
+ <Breakpoint from={800}>Large</Breakpoint>
34
+ </Responsive>
35
+ </HStack>
36
+ );
37
+ }
@@ -0,0 +1,18 @@
1
+ import type { BreakpointProps } from './breakpoint.js';
2
+ import { ResponsiveContainer } from './responsive_container.js';
3
+ import { ResponsiveViewport } from './responsive_viewport.js';
4
+
5
+ export interface ResponsiveProps {
6
+ on?: 'viewport' | 'container';
7
+ children?: React.ReactElement<BreakpointProps>[] | React.ReactElement<BreakpointProps>;
8
+ }
9
+
10
+ export function Responsive(props: ResponsiveProps) {
11
+ const { on = 'container', children } = props;
12
+
13
+ if (on === 'viewport') {
14
+ return <ResponsiveViewport>{children}</ResponsiveViewport>;
15
+ }
16
+
17
+ return <ResponsiveContainer>{children}</ResponsiveContainer>;
18
+ }
@@ -0,0 +1,51 @@
1
+ import React, { useLayoutEffect, useState } from 'react';
2
+ import { useForkRef } from '../../utils/hooks/use_fork_ref.js';
3
+ import { useResizeObserver } from '../../utils/hooks/use_resize_observer.js';
4
+ import { InternalBreakpoint, BreakpointProps } from './breakpoint.js';
5
+
6
+ export interface ResponsiveContainerProps {
7
+ children?: React.ReactElement<BreakpointProps>[] | React.ReactElement<BreakpointProps>;
8
+ }
9
+
10
+ export function ResponsiveContainer(props: ResponsiveContainerProps) {
11
+ const [parent, setParent] = useState<Element | null>(null);
12
+ const [width, setWidth] = useState(0);
13
+
14
+ const resizeRef = useResizeObserver(width => {
15
+ setWidth(width);
16
+ });
17
+
18
+ const forkedRef = useForkRef((element: any) => {
19
+ if (element == null || element.parentElement == null) {
20
+ return;
21
+ }
22
+ resizeRef(element.parentElement);
23
+ setParent(element.parentElement);
24
+ });
25
+
26
+ const hiddenChild = (
27
+ <div
28
+ ref={forkedRef}
29
+ style={{
30
+ display: 'none',
31
+ }}
32
+ ></div>
33
+ );
34
+
35
+ const internalBreakpoints = React.Children.toArray(props.children).map((child: any) => {
36
+ return <InternalBreakpoint key={child.key} {...child.props} width={width} />;
37
+ });
38
+
39
+ useLayoutEffect(() => {
40
+ return () => {
41
+ setParent(null);
42
+ };
43
+ }, []);
44
+
45
+ return (
46
+ <>
47
+ {parent == null ? hiddenChild : null}
48
+ {internalBreakpoints}
49
+ </>
50
+ );
51
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { InternalBreakpoint, BreakpointProps } from './breakpoint.js';
3
+ import { useMediaQuery } from '../../utils/hooks/use_media_query.js';
4
+
5
+ export interface ResponsiveViewportProps {
6
+ children?: React.ReactElement<BreakpointProps>[] | React.ReactElement<BreakpointProps>;
7
+ }
8
+
9
+ export function ResponsiveViewport(props: ResponsiveViewportProps) {
10
+ const { width } = useMediaQuery();
11
+
12
+ const internalBreakpoints = React.Children.toArray(props.children).map((child: any) => {
13
+ return <InternalBreakpoint key={child.key} {...child.props} width={width} />;
14
+ });
15
+
16
+ return <>{internalBreakpoints}</>;
17
+ }
@@ -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,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { ZStack, type ZStackProps } from '../../stacks/index.js';
3
- import { Portal } from '../portal/portal.js';
4
3
  import { Draggable } from '../../utils/dnd/draggable/draggable.js';
4
+ import { Portal } from '../portal/portal.js';
5
5
 
6
6
  // Styles
7
- import styles from './frame.module.css';
8
7
  import { clsx } from 'clsx';
8
+ import styles from './frame.module.css';
9
9
 
10
10
  export interface FrameOwnProps {
11
11
  isOpen?: boolean;
@@ -1,14 +1,14 @@
1
+ import { clsx } from 'clsx';
1
2
  import React from 'react';
2
3
  import styles from './bottom_resize_handle.module.css';
3
- import { createVerticalResizeHandler } from './resize_handlers.js';
4
- import { clsx } from 'clsx';
5
4
  import type { HandleProps } from './handle_props.js';
5
+ import { createVerticalResizeHandler } from './resize_handlers.js';
6
6
 
7
7
  export interface BottomResizeHandleProps {
8
8
  targetRef: React.MutableRefObject<HTMLElement | null>;
9
9
  handleProps?: HandleProps;
10
- onHeightResize?: (value: number) => void;
11
- onHeightResizeEnd?: (value: number) => void;
10
+ onHeightResize?: (height: number, origin: 'top' | 'bottom', delta: number) => void;
11
+ onHeightResizeEnd?: (height: number, origin: 'top' | 'bottom') => void;
12
12
  }
13
13
 
14
14
  export function BottomResizeHandle({
@@ -20,7 +20,9 @@ export function BottomResizeHandle({
20
20
  const resizeHandler = createVerticalResizeHandler(
21
21
  targetRef,
22
22
  onHeightResize,
23
- onHeightResizeEnd
23
+ onHeightResizeEnd,
24
+ false,
25
+ 'bottom'
24
26
  );
25
27
  const offset = handleProps?.offset ? handleProps.offset : -8;
26
28