@tcn/ui 0.9.0 → 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 (182) 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/layouts/bar/bar.d.ts +5 -0
  8. package/dist/layouts/bar/bar.d.ts.map +1 -0
  9. package/dist/layouts/bar/bar.js +20 -0
  10. package/dist/layouts/bar/bar.js.map +1 -0
  11. package/dist/layouts/body/body.d.ts +2 -2
  12. package/dist/layouts/body/body.d.ts.map +1 -1
  13. package/dist/layouts/body/body.js +12 -12
  14. package/dist/layouts/body/body.js.map +1 -1
  15. package/dist/layouts/body/h_body.d.ts.map +1 -1
  16. package/dist/layouts/body/h_body.js +18 -12
  17. package/dist/layouts/body/h_body.js.map +1 -1
  18. package/dist/layouts/body/v_body.d.ts.map +1 -1
  19. package/dist/layouts/body/v_body.js +16 -10
  20. package/dist/layouts/body/v_body.js.map +1 -1
  21. package/dist/layouts/footer/footer.d.ts +2 -3
  22. package/dist/layouts/footer/footer.d.ts.map +1 -1
  23. package/dist/layouts/footer/footer.js +7 -7
  24. package/dist/layouts/footer/footer.js.map +1 -1
  25. package/dist/layouts/header/header.d.ts +2 -2
  26. package/dist/layouts/header/header.d.ts.map +1 -1
  27. package/dist/layouts/header/header.js +13 -21
  28. package/dist/layouts/header/header.js.map +1 -1
  29. package/dist/layouts/index.d.ts +0 -1
  30. package/dist/layouts/index.d.ts.map +1 -1
  31. package/dist/layouts/index.js +17 -19
  32. package/dist/layouts/index.js.map +1 -1
  33. package/dist/layouts/rail/rail.js +41 -41
  34. package/dist/layouts/rail/rail.js.map +1 -1
  35. package/dist/layouts/rail/side/side.d.ts.map +1 -1
  36. package/dist/layouts/rail/side/side.js +1 -1
  37. package/dist/layouts/rail/side/side.js.map +1 -1
  38. package/dist/layouts/rail/utility_strip/utility_strip.d.ts.map +1 -1
  39. package/dist/layouts/rail/utility_strip/utility_strip.js +21 -17
  40. package/dist/layouts/rail/utility_strip/utility_strip.js.map +1 -1
  41. package/dist/layouts/scaffold/scaffold.js +32 -32
  42. package/dist/layouts/scaffold/scaffold.js.map +1 -1
  43. package/dist/layouts/utility_bar/utility_bar.d.ts +2 -2
  44. package/dist/layouts/utility_bar/utility_bar.d.ts.map +1 -1
  45. package/dist/layouts/utility_bar/utility_bar.js +17 -19
  46. package/dist/layouts/utility_bar/utility_bar.js.map +1 -1
  47. package/dist/overlay/frame/frame.js +3 -3
  48. package/dist/overlay/frame/frame.js.map +1 -1
  49. package/dist/panel.css +1 -0
  50. package/dist/rail.css +1 -1
  51. package/dist/scaffold.css +1 -1
  52. package/dist/side.css +1 -1
  53. package/dist/stacks/box/bottom_resize_handle.d.ts +2 -2
  54. package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
  55. package/dist/stacks/box/bottom_resize_handle.js +12 -10
  56. package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
  57. package/dist/stacks/box/box.d.ts +4 -4
  58. package/dist/stacks/box/box.d.ts.map +1 -1
  59. package/dist/stacks/box/box.js +26 -26
  60. package/dist/stacks/box/box.js.map +1 -1
  61. package/dist/stacks/box/end_resize_handle.d.ts +2 -2
  62. package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
  63. package/dist/stacks/box/end_resize_handle.js +6 -5
  64. package/dist/stacks/box/end_resize_handle.js.map +1 -1
  65. package/dist/stacks/box/left_resize_handle.d.ts +2 -2
  66. package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
  67. package/dist/stacks/box/left_resize_handle.js +10 -9
  68. package/dist/stacks/box/left_resize_handle.js.map +1 -1
  69. package/dist/stacks/box/resize_handlers.d.ts +2 -2
  70. package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
  71. package/dist/stacks/box/resize_handlers.js +24 -24
  72. package/dist/stacks/box/resize_handlers.js.map +1 -1
  73. package/dist/stacks/box/right_resize_handle.d.ts +2 -2
  74. package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
  75. package/dist/stacks/box/right_resize_handle.js +6 -5
  76. package/dist/stacks/box/right_resize_handle.js.map +1 -1
  77. package/dist/stacks/box/start_resize_handle.d.ts +2 -2
  78. package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
  79. package/dist/stacks/box/start_resize_handle.js +4 -4
  80. package/dist/stacks/box/start_resize_handle.js.map +1 -1
  81. package/dist/stacks/box/top_resize_handle.d.ts +2 -2
  82. package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
  83. package/dist/stacks/box/top_resize_handle.js +2 -1
  84. package/dist/stacks/box/top_resize_handle.js.map +1 -1
  85. package/dist/stacks/h_collapsible_box.d.ts.map +1 -1
  86. package/dist/stacks/h_collapsible_box.js +24 -24
  87. package/dist/stacks/h_collapsible_box.js.map +1 -1
  88. package/dist/stacks/v_collapsible_box.js +25 -25
  89. package/dist/stacks/v_collapsible_box.js.map +1 -1
  90. package/dist/surfaces/index.d.ts +1 -2
  91. package/dist/surfaces/index.d.ts.map +1 -1
  92. package/dist/surfaces/index.js +18 -20
  93. package/dist/surfaces/index.js.map +1 -1
  94. package/dist/surfaces/panel/panel.d.ts +5 -0
  95. package/dist/surfaces/panel/panel.d.ts.map +1 -0
  96. package/dist/surfaces/panel/panel.js +19 -0
  97. package/dist/surfaces/panel/panel.js.map +1 -0
  98. package/dist/surfaces/pop_confirm/pop_confirm.js +2 -3
  99. package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
  100. package/dist/themes/theme.d.ts +2 -1
  101. package/dist/themes/theme.d.ts.map +1 -1
  102. package/dist/themes/theme.js +16 -9
  103. package/dist/themes/theme.js.map +1 -1
  104. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  105. package/dist/themes/themes/ergo/ergo_theme.js +27 -0
  106. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  107. package/package.json +1 -1
  108. package/src/layouts/__stories__/composed.stories.tsx +0 -55
  109. package/src/layouts/__stories__/rail.stories.tsx +78 -0
  110. package/src/layouts/__stories__/scaffold.stories.tsx +90 -0
  111. package/src/layouts/__stories__/utils/content.tsx +27 -0
  112. package/src/layouts/__stories__/utils/layout_theme.css +88 -0
  113. package/src/layouts/__stories__/utils/layout_theme_provider.tsx +11 -0
  114. package/src/layouts/__stories__/utils.tsx +6 -6
  115. package/src/layouts/{utility_bar/utility_bar.module.css → bar/bar.module.css} +2 -1
  116. package/src/layouts/bar/bar.tsx +23 -0
  117. package/src/layouts/body/body.module.css +9 -4
  118. package/src/layouts/body/body.tsx +7 -6
  119. package/src/layouts/body/h_body.module.css +1 -2
  120. package/src/layouts/body/h_body.tsx +9 -4
  121. package/src/layouts/body/v_body.tsx +9 -4
  122. package/src/layouts/divider/divider.module.css +1 -1
  123. package/src/layouts/footer/footer.module.css +0 -3
  124. package/src/layouts/footer/footer.tsx +5 -6
  125. package/src/layouts/header/header.tsx +6 -15
  126. package/src/layouts/index.ts +0 -1
  127. package/src/layouts/rail/rail.module.css +9 -5
  128. package/src/layouts/rail/rail.tsx +1 -1
  129. package/src/layouts/rail/side/side.module.css +0 -1
  130. package/src/layouts/rail/side/side.tsx +1 -2
  131. package/src/layouts/rail/utility_strip/utility_strip.module.css +5 -0
  132. package/src/layouts/rail/utility_strip/utility_strip.tsx +4 -1
  133. package/src/layouts/scaffold/scaffold.module.css +10 -7
  134. package/src/layouts/scaffold/scaffold.tsx +1 -1
  135. package/src/layouts/utility_bar/utility_bar.tsx +6 -9
  136. package/src/overlay/frame/frame.tsx +2 -2
  137. package/src/stacks/box/bottom_resize_handle.tsx +7 -5
  138. package/src/stacks/box/box.tsx +12 -18
  139. package/src/stacks/box/end_resize_handle.tsx +6 -6
  140. package/src/stacks/box/left_resize_handle.tsx +4 -3
  141. package/src/stacks/box/resize_handlers.ts +11 -9
  142. package/src/stacks/box/right_resize_handle.tsx +4 -3
  143. package/src/stacks/box/start_resize_handle.tsx +3 -3
  144. package/src/stacks/box/top_resize_handle.tsx +4 -3
  145. package/src/stacks/collapsible_box.stories.tsx +11 -11
  146. package/src/stacks/h_collapsible_box.tsx +5 -5
  147. package/src/stacks/v_collapsible_box.tsx +4 -4
  148. package/src/surfaces/index.ts +1 -2
  149. package/src/surfaces/panel/__stories__/panel.stories.tsx +12 -12
  150. package/src/surfaces/panel/__stories__/panel_stories.module.css +3 -3
  151. package/src/surfaces/panel/panel.module.css +1 -6
  152. package/src/surfaces/panel/panel.tsx +22 -0
  153. package/src/themes/theme.tsx +6 -2
  154. package/src/themes/themes/ergo/__stories__/material.stories.tsx +15 -16
  155. package/src/themes/themes/ergo/ergo_theme.css +27 -0
  156. package/dist/h_body.css +0 -1
  157. package/dist/h_panel.css +0 -1
  158. package/dist/header.css +0 -1
  159. package/dist/layouts/rail/main/main.d.ts +0 -6
  160. package/dist/layouts/rail/main/main.d.ts.map +0 -1
  161. package/dist/layouts/rail/main/main.js +0 -21
  162. package/dist/layouts/rail/main/main.js.map +0 -1
  163. package/dist/main.css +0 -1
  164. package/dist/surfaces/panel/h_panel.d.ts +0 -9
  165. package/dist/surfaces/panel/h_panel.d.ts.map +0 -1
  166. package/dist/surfaces/panel/h_panel.js +0 -60
  167. package/dist/surfaces/panel/h_panel.js.map +0 -1
  168. package/dist/surfaces/panel/v_panel.d.ts +0 -5
  169. package/dist/surfaces/panel/v_panel.d.ts.map +0 -1
  170. package/dist/surfaces/panel/v_panel.js +0 -19
  171. package/dist/surfaces/panel/v_panel.js.map +0 -1
  172. package/dist/utility_bar.css +0 -1
  173. package/dist/v_body.css +0 -1
  174. package/src/layouts/header/header.module.css +0 -8
  175. package/src/layouts/rail/__stories__/rail.stories.tsx +0 -64
  176. package/src/layouts/rail/__stories__/rail_stories.module.css +0 -25
  177. package/src/layouts/rail/main/main.module.css +0 -7
  178. package/src/layouts/rail/main/main.tsx +0 -26
  179. package/src/layouts/scaffold/__stories__/scaffold.stories.tsx +0 -53
  180. package/src/layouts/scaffold/__stories__/scaffold_stories.module.css +0 -31
  181. package/src/surfaces/panel/h_panel.tsx +0 -65
  182. package/src/surfaces/panel/v_panel.tsx +0 -20
@@ -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,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
 
@@ -1,16 +1,16 @@
1
- import { useForkRef } from '../../utils/index.js';
1
+ import { clsx } from 'clsx';
2
2
  import React, { CSSProperties, HTMLAttributes, useRef } from 'react';
3
- import { LeftResizeHandle } from './left_resize_handle.js';
4
- import { RightResizeHandle } from './right_resize_handle.js';
3
+ import { useForkRef } from '../../utils/index.js';
4
+ import styles from '../stack.module.css';
5
+ import { isCustomSizeProp } from '../utils/isCustomSizeProp.js';
6
+ import { removeUndefinedProperties } from '../utils/remove_undefined_properties.js';
5
7
  import { BottomResizeHandle } from './bottom_resize_handle.js';
6
8
  import { EndResizeHandle } from './end_resize_handle.js';
9
+ import { HandleProps } from './handle_props.js';
10
+ import { LeftResizeHandle } from './left_resize_handle.js';
11
+ import { RightResizeHandle } from './right_resize_handle.js';
7
12
  import { StartResizeHandle } from './start_resize_handle.js';
8
13
  import { TopResizeHandle } from './top_resize_handle.js';
9
- import { clsx } from 'clsx';
10
- import { isCustomSizeProp } from '../utils/isCustomSizeProp.js';
11
- import { removeUndefinedProperties } from '../utils/remove_undefined_properties.js';
12
- import styles from '../stack.module.css';
13
- import { HandleProps } from './handle_props.js';
14
14
 
15
15
  export interface BoxProps<T extends HTMLElement = HTMLElement> extends HTMLAttributes<T> {
16
16
  as?: string;
@@ -45,16 +45,10 @@ export interface BoxProps<T extends HTMLElement = HTMLElement> extends HTMLAttri
45
45
  enableResizeOnRight?: boolean;
46
46
  horizontalHandleProps?: HandleProps;
47
47
  verticalHandleProps?: HandleProps;
48
- onWidthResize?: (
49
- width: number
50
- // origin: 'left' | 'right'
51
- ) => void;
52
- onHeightResize?: (
53
- height: number
54
- // origin: 'top' | 'bottom'
55
- ) => void;
56
- onWidthResizeEnd?: (width: number) => void;
57
- onHeightResizeEnd?: (width: number) => void;
48
+ onWidthResize?: (width: number, origin: 'left' | 'right', delta: number) => void;
49
+ onHeightResize?: (height: number, origin: 'top' | 'bottom', delta: number) => void;
50
+ onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
51
+ onHeightResizeEnd?: (height: number, origin: 'top' | 'bottom') => void;
58
52
  }
59
53
 
60
54
  export const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(
@@ -1,16 +1,15 @@
1
+ import { clsx } from 'clsx';
1
2
  import React from 'react';
2
3
  import styles from './end_resize_handle.module.css';
4
+ import { HandleProps } from './handle_props.js';
3
5
  import { createHorizontalResizeHandler } from './resize_handlers.js';
4
- import { clsx } from 'clsx';
5
- import type { HandleProps } from './handle_props.js';
6
6
 
7
7
  export interface EndResizeHandleProps {
8
8
  targetRef: React.MutableRefObject<HTMLElement | null>;
9
9
  handleProps?: HandleProps;
10
- onWidthResize?: (value: number) => void;
11
- onWidthResizeEnd?: (value: number) => void;
10
+ onWidthResize?: (width: number, origin: 'left' | 'right', delta: number) => void;
11
+ onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
12
12
  }
13
-
14
13
  export function EndResizeHandle({
15
14
  targetRef,
16
15
  handleProps,
@@ -20,7 +19,8 @@ export function EndResizeHandle({
20
19
  const resizeHandler = createHorizontalResizeHandler(
21
20
  targetRef,
22
21
  onWidthResize,
23
- onWidthResizeEnd
22
+ onWidthResizeEnd,
23
+ 'right'
24
24
  );
25
25
  const offset = handleProps?.offset ? handleProps.offset : -8;
26
26
 
@@ -1,14 +1,14 @@
1
+ import { clsx } from 'clsx';
1
2
  import React from 'react';
2
3
  import { HandleProps } from './handle_props.js';
3
4
  import styles from './left_resize_handle.module.css';
4
5
  import { createHorizontalResizeHandler } from './resize_handlers.js';
5
- import { clsx } from 'clsx';
6
6
 
7
7
  export interface LeftResizeHandleProps {
8
8
  targetRef: React.MutableRefObject<HTMLElement | null>;
9
9
  handleProps?: HandleProps;
10
- onWidthResize?: (value: number) => void;
11
- onWidthResizeEnd?: (value: number) => void;
10
+ onWidthResize?: (width: number, origin: 'left' | 'right', delta: number) => void;
11
+ onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
12
12
  }
13
13
  export function LeftResizeHandle({
14
14
  targetRef,
@@ -20,6 +20,7 @@ export function LeftResizeHandle({
20
20
  targetRef,
21
21
  onWidthResize,
22
22
  onWidthResizeEnd,
23
+ 'left',
23
24
  true,
24
25
  true
25
26
  );
@@ -9,8 +9,9 @@ function createVeil() {
9
9
 
10
10
  export function createHorizontalResizeHandler(
11
11
  targetRef: React.MutableRefObject<HTMLElement | null>,
12
- onWidthResize?: (value: number) => void,
13
- onWidthResizeEnd?: (value: number) => void,
12
+ onWidthResize?: (width: number, origin: 'left' | 'right', delta: number) => void,
13
+ onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void,
14
+ origin: 'left' | 'right' = 'right',
14
15
  invert = false,
15
16
  disableDirection = false
16
17
  ) {
@@ -40,7 +41,7 @@ export function createHorizontalResizeHandler(
40
41
  width = newWidth;
41
42
 
42
43
  box.style.width = `${newWidth}px`;
43
- onWidthResize && onWidthResize(newWidth);
44
+ onWidthResize?.(newWidth, origin, deltaX);
44
45
  event.stopPropagation();
45
46
  event.preventDefault();
46
47
  };
@@ -60,7 +61,7 @@ export function createHorizontalResizeHandler(
60
61
  event.stopPropagation();
61
62
  event.preventDefault();
62
63
 
63
- onWidthResizeEnd && onWidthResizeEnd(width);
64
+ onWidthResizeEnd?.(width, origin);
64
65
  };
65
66
 
66
67
  document.body.addEventListener('mousemove', drag);
@@ -73,9 +74,10 @@ export function createHorizontalResizeHandler(
73
74
 
74
75
  export function createVerticalResizeHandler(
75
76
  targetRef: React.MutableRefObject<HTMLElement | null>,
76
- onHeightResize?: (value: number) => void,
77
- onHeightResizeEnd?: (value: number) => void,
78
- invert = false
77
+ onHeightResize?: (height: number, origin: 'top' | 'bottom', delta: number) => void,
78
+ onHeightResizeEnd?: (height: number, origin: 'top' | 'bottom') => void,
79
+ invert = false,
80
+ origin: 'top' | 'bottom' = 'bottom'
79
81
  ) {
80
82
  const direction = invert ? -1 : 1;
81
83
  return function startVerticalResize(event: React.MouseEvent) {
@@ -97,7 +99,7 @@ export function createVerticalResizeHandler(
97
99
  const newHeight = startRect.height + deltaY;
98
100
  height = newHeight;
99
101
  box.style.height = `${newHeight}px`;
100
- onHeightResize && onHeightResize(newHeight);
102
+ onHeightResize?.(newHeight, origin, deltaY);
101
103
  event.stopPropagation();
102
104
  event.preventDefault();
103
105
  };
@@ -117,7 +119,7 @@ export function createVerticalResizeHandler(
117
119
  event.stopPropagation();
118
120
  event.preventDefault();
119
121
 
120
- onHeightResizeEnd && onHeightResizeEnd(height);
122
+ onHeightResizeEnd?.(height, origin);
121
123
  };
122
124
 
123
125
  document.body.addEventListener('mousemove', drag);
@@ -1,14 +1,14 @@
1
+ import { clsx } from 'clsx';
1
2
  import React from 'react';
2
3
  import { HandleProps } from './handle_props.js';
3
4
  import { createHorizontalResizeHandler } from './resize_handlers.js';
4
5
  import styles from './right_resize_handle.module.css';
5
- import { clsx } from 'clsx';
6
6
 
7
7
  export interface RightResizeHandleProps {
8
8
  targetRef: React.MutableRefObject<HTMLElement | null>;
9
9
  handleProps?: HandleProps;
10
- onWidthResize?: (value: number) => void;
11
- onWidthResizeEnd?: (value: number) => void;
10
+ onWidthResize?: (width: number, origin: 'left' | 'right', delta: number) => void;
11
+ onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
12
12
  }
13
13
  export function RightResizeHandle({
14
14
  targetRef,
@@ -20,6 +20,7 @@ export function RightResizeHandle({
20
20
  targetRef,
21
21
  onWidthResize,
22
22
  onWidthResizeEnd,
23
+ 'right',
23
24
  false,
24
25
  true
25
26
  );
@@ -7,8 +7,8 @@ import { clsx } from 'clsx';
7
7
  export interface StartResizeHandleProps {
8
8
  targetRef: React.MutableRefObject<HTMLElement | null>;
9
9
  handleProps?: HandleProps;
10
- onWidthResize?: (value: number) => void;
11
- onWidthResizeEnd?: (value: number) => void;
10
+ onWidthResize?: (width: number, origin: 'left' | 'right', delta: number) => void;
11
+ onWidthResizeEnd?: (width: number, origin: 'left' | 'right') => void;
12
12
  }
13
13
  export function StartResizeHandle({
14
14
  targetRef,
@@ -20,7 +20,7 @@ export function StartResizeHandle({
20
20
  targetRef,
21
21
  onWidthResize,
22
22
  onWidthResizeEnd,
23
- true
23
+ 'left'
24
24
  );
25
25
  const offset = handleProps?.offset ? handleProps.offset : -8;
26
26