@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
@@ -7,8 +7,8 @@ import { clsx } from 'clsx';
7
7
  export interface TopResizeHandleProps {
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
  export function TopResizeHandle({
14
14
  targetRef,
@@ -20,7 +20,8 @@ export function TopResizeHandle({
20
20
  targetRef,
21
21
  onHeightResize,
22
22
  onHeightResizeEnd,
23
- true
23
+ true,
24
+ 'top'
24
25
  );
25
26
  const offset = handleProps?.offset ? handleProps.offset : -8;
26
27
 
@@ -1,13 +1,13 @@
1
+ import { ChevronLeftIcon as ChevronLeft } from '@tcn/icons/chevron_left_icon.js';
2
+ import { PlusIcon as Plus } from '@tcn/icons/plus_icon.js';
1
3
  import React from 'react';
2
4
  import { Button, SlimButton } from '../actions/index.js';
3
- import { HCollapsibleBox as HComponent } from './h_collapsible_box.js';
4
- import { VCollapsibleBox as VComponent } from './v_collapsible_box.js';
5
5
  import { Title } from '../typography/index.js';
6
- import { Spacer } from './spacer.js';
6
+ import { HCollapsibleBox } from './h_collapsible_box.js';
7
7
  import { HStack } from './h_stack.js';
8
+ import { Spacer } from './spacer.js';
9
+ import { VCollapsibleBox } from './v_collapsible_box.js';
8
10
  import { VStack } from './v_stack.js';
9
- import { ChevronLeftIcon as ChevronLeft } from '@tcn/icons/chevron_left_icon.js';
10
- import { PlusIcon as Plus } from '@tcn/icons/plus_icon.js';
11
11
 
12
12
  export default {
13
13
  title: 'Stacks/Collapsible Box',
@@ -49,13 +49,13 @@ export function CollapsibleBox() {
49
49
  <Button onClick={() => setVHopen(c => !c)}>toggle vertical collapse</Button>
50
50
  <Button onClick={() => setHOpen(c => !c)}>toggle horizontal collapse</Button>
51
51
  </VStack>
52
- <VComponent open={vOpen} enableResizeOnTop>
52
+ <VCollapsibleBox open={vOpen} enableResizeOnTop>
53
53
  <MyPanel />
54
- </VComponent>
54
+ </VCollapsibleBox>
55
55
  </VStack>
56
- <HComponent open={hOpen} enableResizeOnStart>
56
+ <HCollapsibleBox open={hOpen} enableResizeOnStart>
57
57
  <MyPanel />
58
- </HComponent>
58
+ </HCollapsibleBox>
59
59
  </HStack>
60
60
  );
61
61
  }
@@ -67,9 +67,9 @@ export function VerticalCollapsibleBox() {
67
67
  <HStack height="flex" hAlign="end" gap="16px">
68
68
  <Button onClick={() => setOpen(c => !c)}>toggle collapse</Button>
69
69
  </HStack>
70
- <VComponent open={open} enableResizeOnTop defaultHeight="300px">
70
+ <VCollapsibleBox open={open} enableResizeOnTop defaultHeight="300px">
71
71
  <MyPanel />
72
- </VComponent>
72
+ </VCollapsibleBox>
73
73
  </VStack>
74
74
  );
75
75
  }
@@ -1,6 +1,6 @@
1
+ import { clsx } from 'clsx';
1
2
  import React, { useLayoutEffect } from 'react';
2
3
  import { useForkRef } from '../utils/index.js';
3
- import { clsx } from 'clsx';
4
4
  import { Box, BoxProps } from './box/box.js';
5
5
  import styles from './collapsible_box.module.css';
6
6
  import { useIsCollapsed } from './utils/use_is_collapsed.js';
@@ -32,13 +32,13 @@ export const HCollapsibleBox = React.forwardRef(function CollapsibleBox(
32
32
  data-is-collapsed={!open}
33
33
  data-collapse-orientation="horizontal"
34
34
  data-is-resizing={resizing}
35
- onWidthResize={width => {
35
+ onWidthResize={(width, origin, delta) => {
36
36
  setIsResizing(true);
37
- props.onWidthResize?.(width);
37
+ props.onWidthResize?.(width, origin, delta);
38
38
  }}
39
- onWidthResizeEnd={width => {
39
+ onWidthResizeEnd={(width, origin) => {
40
40
  setIsResizing(false);
41
- props.onWidthResizeEnd?.(width);
41
+ props.onWidthResizeEnd?.(width, origin);
42
42
  collapsibleRef.current?.style.setProperty('--collapsible-size', `${width}px`);
43
43
  }}
44
44
  className={clsx(
@@ -32,14 +32,14 @@ export const VCollapsibleBox = React.forwardRef(function CollapsibleBox(
32
32
  data-is-collapsed={!open}
33
33
  data-collapse-orientation="vertical"
34
34
  data-is-resizing={resizing}
35
- onHeightResize={height => {
35
+ onHeightResize={(height, origin, delta) => {
36
36
  setIsResizing(true);
37
- props.onHeightResize?.(height);
37
+ props.onHeightResize?.(height, origin, delta);
38
38
  }}
39
- onHeightResizeEnd={height => {
39
+ onHeightResizeEnd={(height, origin) => {
40
40
  setIsResizing(false);
41
41
  collapsibleRef.current?.style.setProperty('--collapsible-size', `${height}px`);
42
- props.onHeightResizeEnd?.(height);
42
+ props.onHeightResizeEnd?.(height, origin);
43
43
  }}
44
44
  className={clsx(
45
45
  props.className,
@@ -3,8 +3,7 @@ export * from './card/card.js';
3
3
  export * from './confirm/confirm.js';
4
4
  export * from './page/h_page.js';
5
5
  export * from './page/v_page.js';
6
- export * from './panel/h_panel.js';
7
- export * from './panel/v_panel.js';
6
+ export * from './panel/panel.js';
8
7
  export * from './popover/popover.js';
9
8
  export * from './drawers/drawer_bottom/drawer_bottom.js';
10
9
  export * from './drawers/drawer_top/drawer_top.js';
@@ -6,7 +6,7 @@ import { Heading, Section, VBody } from '../../../layouts/index.js';
6
6
  import { UtilityBar } from '../../../layouts/utility_bar/utility_bar.js';
7
7
  import { Box, HStack, Spacer } from '../../../stacks/index.js';
8
8
  import { Title } from '../../../typography/title/title.js';
9
- import { VPanel } from '../v_panel.js';
9
+ import { Panel } from '../panel.js';
10
10
  // Styles
11
11
  import styles from './panel_stories.module.css';
12
12
  import { TTable, TBody, TD, TH, THead, TR } from '../../../layouts/table/table.js';
@@ -23,7 +23,7 @@ import { BodyText } from '../../../typography/index.js';
23
23
 
24
24
  export default {
25
25
  title: 'Surfaces/Panel',
26
- component: VPanel,
26
+ component: Panel,
27
27
  tags: ['autodocs'],
28
28
  };
29
29
 
@@ -71,8 +71,8 @@ const UtilGroupExample = () => {
71
71
 
72
72
  export const Default = () => {
73
73
  return (
74
- <div className={styles['stories-container']}>
75
- <VPanel maxHeight="600px">
74
+ <Box className={styles['stories-container']}>
75
+ <Panel maxHeight="600px">
76
76
  <Header>
77
77
  <Title emphasis="strong">Panel Primary Header</Title>
78
78
  <Spacer />
@@ -109,16 +109,16 @@ export const Default = () => {
109
109
  <Button hierarchy="secondary">Secondary</Button>
110
110
  <Button hierarchy="primary">Primary</Button>
111
111
  </Footer>
112
- </VPanel>
113
- </div>
112
+ </Panel>
113
+ </Box>
114
114
  );
115
115
  };
116
116
 
117
117
  export const WithTable = () => {
118
118
  return (
119
- <div className={styles['stories-container']}>
119
+ <Box className={styles['stories-container']}>
120
120
  <HStack gap="16px" maxHeight="600px" height="100%" maxWidth="1440px">
121
- <VPanel minWidth="300px">
121
+ <Panel minWidth="300px">
122
122
  <Header>
123
123
  <Title emphasis="strong">Table Title</Title>
124
124
  <Spacer />
@@ -190,8 +190,8 @@ export const WithTable = () => {
190
190
  </Button>
191
191
  </HStack>
192
192
  </Footer>
193
- </VPanel>
194
- <VPanel maxHeight="600px" width="300px" minWidth="300px">
193
+ </Panel>
194
+ <Panel maxHeight="600px" width="300px" minWidth="300px">
195
195
  <Header>
196
196
  <Title emphasis="strong">John Doe</Title>
197
197
  <Spacer />
@@ -210,8 +210,8 @@ export const WithTable = () => {
210
210
  <BodyText>Email: john.doe@example.com</BodyText>
211
211
  </Section>
212
212
  </VBody>
213
- </VPanel>
213
+ </Panel>
214
214
  </HStack>
215
- </div>
215
+ </Box>
216
216
  );
217
217
  };
@@ -19,8 +19,8 @@
19
19
 
20
20
  .stories-container {
21
21
  width: 100%;
22
- height: 100%;
23
- padding: 16px;
22
+ height: 100vh;
23
+ min-height: 400px;
24
24
  background-color: #ccc;
25
- overflow: auto;
25
+ padding: 16px;
26
26
  }
@@ -1,10 +1,5 @@
1
1
  @layer tcn-system {
2
- :where(.panel-stack) {
3
- width: 100%;
2
+ .panel {
4
3
  height: 100%;
5
- overflow: auto;
6
4
  }
7
- /* .page-stack > :global(.stack) {
8
- gap: var(--gap);
9
- } */
10
5
  }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { Scaffold, type ScaffoldProps } from '../../layouts/scaffold/scaffold.js';
3
+ import clsx from 'clsx';
4
+
5
+ import styles from './panel.module.css';
6
+
7
+ export type PanelProps = ScaffoldProps;
8
+
9
+ export const Panel = React.forwardRef<HTMLElement, PanelProps>(function Panel(
10
+ { children, className, ...props }: PanelProps,
11
+ ref
12
+ ) {
13
+ return (
14
+ <Scaffold
15
+ ref={ref}
16
+ className={clsx(styles['panel'], 'tcn-surface', 'tcn-panel', className)}
17
+ {...props}
18
+ >
19
+ {children}
20
+ </Scaffold>
21
+ );
22
+ });
@@ -10,9 +10,10 @@ import layers from '../css/layers.css?raw';
10
10
  export interface ThemeProps extends BoxProps {
11
11
  styleSheets: CSSStyleSheet[];
12
12
  children: React.ReactNode;
13
+ className?: string;
13
14
  }
14
15
 
15
- export function Theme({ styleSheets, children, ...boxProps }: ThemeProps) {
16
+ export function Theme({ styleSheets, children, className, ...boxProps }: ThemeProps) {
16
17
  useLayoutEffect(() => {
17
18
  document.adoptedStyleSheets = styleSheets;
18
19
  }, [styleSheets]);
@@ -33,7 +34,10 @@ export function Theme({ styleSheets, children, ...boxProps }: ThemeProps) {
33
34
  }, []);
34
35
 
35
36
  return (
36
- <Box className={clsx('tcn-theme-root', styles['tcn-theme-provider'])} {...boxProps}>
37
+ <Box
38
+ className={clsx('tcn-theme-root', styles['tcn-theme-provider'], className)}
39
+ {...boxProps}
40
+ >
37
41
  {children}
38
42
  </Box>
39
43
  );
@@ -3,10 +3,9 @@ import { VStack } from '../../../../stacks/v_stack.js';
3
3
  import { clsx } from 'clsx';
4
4
  import { PlusIcon } from '@tcn/icons/plus_icon.js';
5
5
  import { Divider, Footer, Header, VBody } from '../../../../layouts/index.js';
6
- import { VPanel } from '../../../../surfaces/index.js';
6
+ import { Panel } from '../../../../surfaces/index.js';
7
7
  import { Button } from '../../../../actions/button/button/button.js';
8
8
  import { Spacer } from '../../../../stacks/spacer.js';
9
- import { SlimButton } from '../../../../actions/button/slim_button/slim_button.js';
10
9
  import { SB_TonePicker } from './components/tone_picker/sb_tone_picker.js';
11
10
  import { formatHSLString, getContrastText, parseHSL } from './utils.js';
12
11
  import { SB_MaterialPicker } from './components/material_picker/sb_material_picker.js';
@@ -86,7 +85,7 @@ export const DynamicSurface = (args: {
86
85
  <Title>Ergo Theme: Materials and Surfaces</Title>
87
86
  </Header>
88
87
  <SB_MaterialPicker handleSurfaceClick={handleSurfaceClick} />
89
- <VPanel
88
+ <Panel
90
89
  minHeight="200px"
91
90
  maxHeight="700px"
92
91
  height="100%"
@@ -95,30 +94,30 @@ export const DynamicSurface = (args: {
95
94
  <Header>
96
95
  Enabled Utilities
97
96
  <Spacer />
98
- <SlimButton hierarchy="tertiary">
97
+ <Button utility hierarchy="tertiary">
99
98
  <PlusIcon />
100
- </SlimButton>
101
- <SlimButton hierarchy="secondary">
99
+ </Button>
100
+ <Button utility hierarchy="secondary">
102
101
  <PlusIcon />
103
- </SlimButton>
102
+ </Button>
104
103
  <Divider vertical length="md" />
105
- <SlimButton hierarchy="primary">
104
+ <Button utility hierarchy="primary">
106
105
  <PlusIcon />
107
- </SlimButton>
106
+ </Button>
108
107
  </Header>
109
108
  <Header>
110
109
  Disabled Utilities
111
110
  <Spacer />
112
- <SlimButton hierarchy="tertiary" disabled>
111
+ <Button utility hierarchy="tertiary" disabled>
113
112
  <PlusIcon />
114
- </SlimButton>
115
- <SlimButton hierarchy="secondary" disabled>
113
+ </Button>
114
+ <Button utility hierarchy="secondary" disabled>
116
115
  <PlusIcon />
117
- </SlimButton>
116
+ </Button>
118
117
  <Divider vertical length="md" />
119
- <SlimButton hierarchy="primary" disabled>
118
+ <Button utility hierarchy="primary" disabled>
120
119
  <PlusIcon />
121
- </SlimButton>
120
+ </Button>
122
121
  </Header>
123
122
  <VBody>
124
123
  <SB_TonePicker />
@@ -143,7 +142,7 @@ export const DynamicSurface = (args: {
143
142
  <Button hierarchy="secondary">Secondary</Button>
144
143
  <Button hierarchy="primary">Primary</Button>
145
144
  </Footer>
146
- </VPanel>
145
+ </Panel>
147
146
  <Header></Header>
148
147
  </VStack>
149
148
  );
@@ -579,6 +579,18 @@
579
579
  color: var(--on-material);
580
580
  }
581
581
 
582
+ /* Divider: use material-line; emphasis variants for strong/faint */
583
+ .tcn-divider-line,
584
+ .tcn-divider-line[data-emphasis="normal"] {
585
+ background: var(--material-line);
586
+ }
587
+ .tcn-divider-line[data-emphasis="strong"] {
588
+ background: color-mix(in srgb, var(--material-line) 80%, black 20%);
589
+ }
590
+ .tcn-divider-line[data-emphasis="faint"] {
591
+ background: color-mix(in srgb, var(--material-line) 80%, white 20%);
592
+ }
593
+
582
594
  /* ===== SURFACES ===== */
583
595
  .tcn-draggable[data-is-draggable="true"] {
584
596
  .tcn-drag-handle {
@@ -606,7 +618,22 @@
606
618
  border-radius: var(--shape-radius-medium);
607
619
  }
608
620
  }
621
+ /* Rail: */
622
+ .tcn-utility-strip {
623
+ min-width: var(--bar-md);
624
+ }
625
+
626
+ .tcn-utility-strip,
627
+ .tcn-side {
628
+ padding-block: var(--padding-medium);
629
+ gap: var(--gap-medium);
630
+ }
609
631
 
632
+ .tcn-rail {
633
+ :where(.tcn-body) {
634
+ gap: var(--gap-medium);
635
+ }
636
+ }
610
637
  /* Scaffold: */
611
638
  .tcn-footer,
612
639
  .tcn-header,
package/dist/h_body.css DELETED
@@ -1 +0,0 @@
1
- @layer tcn-system{:where(._h-body_d56f4f1){min-width:0;flex-grow:1;height:100%}}
package/dist/h_panel.css DELETED
@@ -1 +0,0 @@
1
- @layer tcn-system{:where(._panel-stack_f1896f3){width:100%;height:100%;overflow:auto}}
package/dist/header.css DELETED
@@ -1 +0,0 @@
1
- @layer tcn-system{:where(._header_3155fa4){width:100%;min-height:0;padding:var(--padding) var(--padding-large);gap:var(--gap)}}
@@ -1,6 +0,0 @@
1
- import { default as React } from 'react';
2
- import { HStackProps } from '../../../stacks/h_stack.js';
3
- export interface MainProps extends Omit<HStackProps, 'as'> {
4
- }
5
- export declare const Main: React.ForwardRefExoticComponent<MainProps & React.RefAttributes<HTMLElement>>;
6
- //# sourceMappingURL=main.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/layouts/rail/main/main.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAKtE,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC;CAAG;AAG7D,eAAO,MAAM,IAAI,+EAef,CAAC"}
@@ -1,21 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import i from "react";
3
- import { clsx as c } from "clsx";
4
- import { HStack as s } from "../../../stacks/h_stack.js";
5
- import '../../../main.css';const e = "_main_bc17de6", f = { main: e }, x = i.forwardRef(function({ children: t, className: o, overflowX: a = "auto", ...m }, n) {
6
- return /* @__PURE__ */ r(
7
- s,
8
- {
9
- ref: n,
10
- as: "div",
11
- overflowX: a,
12
- className: c(f.main, o, "tcn-main"),
13
- ...m,
14
- children: t
15
- }
16
- );
17
- });
18
- export {
19
- x as Main
20
- };
21
- //# sourceMappingURL=main.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js","sources":["../../../../src/layouts/rail/main/main.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { HStack, type HStackProps } from '../../../stacks/h_stack.js';\n\n// Styles\nimport styles from './main.module.css';\n\nexport interface MainProps extends Omit<HStackProps, 'as'> {}\n\n// WIP: This component is not fully implemented.\nexport const Main = React.forwardRef<HTMLElement, MainProps>(function Main(\n { children, className, overflowX = 'auto', ...props }: MainProps,\n ref\n) {\n return (\n <HStack\n ref={ref}\n as=\"div\"\n overflowX={overflowX}\n className={clsx(styles['main'], className, 'tcn-main')}\n {...props}\n >\n {children}\n </HStack>\n );\n});\n"],"names":["Main","React","children","className","overflowX","props","ref","jsx","HStack","clsx","styles"],"mappings":";;;;4CAUaA,IAAOC,EAAM,WAAmC,SAC3D,EAAE,UAAAC,GAAU,WAAAC,GAAW,WAAAC,IAAY,QAAQ,GAAGC,EAAA,GAC9CC,GACA;AACA,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,IAAG;AAAA,MACH,WAAAF;AAAA,MACA,WAAWK,EAAKC,EAAO,MAASP,GAAW,UAAU;AAAA,MACpD,GAAGE;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
package/dist/main.css DELETED
@@ -1 +0,0 @@
1
- @layer tcn-system{:where(._main_bc17de6){min-width:0;flex-grow:1;height:100%}}
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- import { BoxProps } from '../../stacks/box/box.js';
3
- import { Alignment } from '../../stacks/types/alignment.js';
4
- export interface HPanelProps extends Omit<BoxProps, 'as'> {
5
- vAlign?: Alignment;
6
- hAlign?: Alignment;
7
- }
8
- export declare const HPanel: React.ForwardRefExoticComponent<HPanelProps & React.RefAttributes<HTMLElement>>;
9
- //# sourceMappingURL=h_panel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"h_panel.d.ts","sourceRoot":"","sources":["../../../src/surfaces/panel/h_panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAIjE,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,iFAmDjB,CAAC"}
@@ -1,60 +0,0 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import u from "react";
3
- import { clsx as r } from "clsx";
4
- import { Box as x } from "../../stacks/box/box.js";
5
- import { HStack as i } from "../../stacks/h_stack.js";
6
- import '../../h_panel.css';const P = "_panel-stack_f1896f3", f = { "panel-stack": P }, B = u.forwardRef(function({
7
- children: m,
8
- width: k,
9
- height: d,
10
- minWidth: a,
11
- maxWidth: t,
12
- minHeight: n,
13
- maxHeight: e,
14
- hAlign: c,
15
- vAlign: o = "start",
16
- className: l,
17
- ..._
18
- }, s) {
19
- return /* @__PURE__ */ p(
20
- x,
21
- {
22
- ref: s,
23
- width: k,
24
- height: d,
25
- minWidth: a,
26
- maxWidth: t,
27
- minHeight: n,
28
- maxHeight: e,
29
- "data-h-alignment": c,
30
- "data-v-alignment": o,
31
- className: r(f.panel, l, "panel", "tcn-panel", "tcn-h-panel"),
32
- ..._,
33
- children: /* @__PURE__ */ p(
34
- i,
35
- {
36
- as: "section",
37
- minWidth: a,
38
- maxWidth: t,
39
- minHeight: n,
40
- maxHeight: e,
41
- hAlign: c,
42
- vAlign: o,
43
- ref: s,
44
- className: r(
45
- f["panel-stack"],
46
- l,
47
- "panel-stack",
48
- "tcn-panel-stack"
49
- ),
50
- zIndex: 0,
51
- children: m
52
- }
53
- )
54
- }
55
- );
56
- });
57
- export {
58
- B as HPanel
59
- };
60
- //# sourceMappingURL=h_panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"h_panel.js","sources":["../../../src/surfaces/panel/h_panel.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { Box, type BoxProps } from '../../stacks/box/box.js';\nimport { HStack } from '../../stacks/h_stack.js';\nimport type { Alignment } from '../../stacks/types/alignment.js';\n// Styles\nimport styles from './panel.module.css';\n\nexport interface HPanelProps extends Omit<BoxProps, 'as'> {\n vAlign?: Alignment;\n hAlign?: Alignment;\n}\n\nexport const HPanel = React.forwardRef<HTMLElement, HPanelProps>(function HPanel(\n {\n children,\n width,\n height,\n minWidth,\n maxWidth,\n minHeight,\n maxHeight,\n hAlign,\n vAlign = 'start',\n className,\n ...props\n }: HPanelProps,\n ref\n) {\n return (\n <Box\n ref={ref}\n width={width}\n height={height}\n minWidth={minWidth}\n maxWidth={maxWidth}\n minHeight={minHeight}\n maxHeight={maxHeight}\n data-h-alignment={hAlign}\n data-v-alignment={vAlign}\n className={clsx(styles['panel'], className, 'panel', 'tcn-panel', 'tcn-h-panel')}\n {...props}\n >\n <HStack\n as=\"section\"\n minWidth={minWidth}\n maxWidth={maxWidth}\n minHeight={minHeight}\n maxHeight={maxHeight}\n hAlign={hAlign}\n vAlign={vAlign}\n ref={ref}\n className={clsx(\n styles['panel-stack'],\n className,\n 'panel-stack',\n 'tcn-panel-stack'\n )}\n zIndex={0}\n >\n {children}\n </HStack>\n </Box>\n );\n});\n"],"names":["HPanel","React","children","width","height","minWidth","maxWidth","minHeight","maxHeight","hAlign","vAlign","className","props","ref","jsx","Box","clsx","styles","HStack"],"mappings":";;;;;4DAaaA,IAASC,EAAM,WAAqC,SAC/D;AAAA,EACE,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,WAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,OAAAV;AAAA,MACA,QAAAC;AAAA,MACA,UAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,oBAAkBC;AAAA,MAClB,oBAAkBC;AAAA,MAClB,WAAWM,EAAKC,EAAO,OAAUN,GAAW,SAAS,aAAa,aAAa;AAAA,MAC9E,GAAGC;AAAA,MAEJ,UAAA,gBAAAE;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,IAAG;AAAA,UACH,UAAAb;AAAA,UACA,UAAAC;AAAA,UACA,WAAAC;AAAA,UACA,WAAAC;AAAA,UACA,QAAAC;AAAA,UACA,QAAAC;AAAA,UACA,KAAAG;AAAA,UACA,WAAWG;AAAA,YACTC,EAAO,aAAa;AAAA,YACpBN;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,UAEF,QAAQ;AAAA,UAEP,UAAAT;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN,CAAC;"}
@@ -1,5 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ScaffoldProps } from '../../layouts/scaffold/scaffold.js';
3
- export type VPanelProps = ScaffoldProps;
4
- export declare const VPanel: React.ForwardRefExoticComponent<ScaffoldProps & React.RefAttributes<HTMLElement>>;
5
- //# sourceMappingURL=v_panel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v_panel.d.ts","sourceRoot":"","sources":["../../../src/surfaces/panel/v_panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGlF,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC;AAExC,eAAO,MAAM,MAAM,mFAajB,CAAC"}
@@ -1,19 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import f from "react";
3
- import { Scaffold as n } from "../../layouts/scaffold/scaffold.js";
4
- import c from "clsx";
5
- const u = f.forwardRef(function({ children: r, className: o, ...t }, a) {
6
- return /* @__PURE__ */ e(
7
- n,
8
- {
9
- ref: a,
10
- className: c("tcn-surface", "tcn-panel", "tcn-v-panel", o),
11
- ...t,
12
- children: r
13
- }
14
- );
15
- });
16
- export {
17
- u as VPanel
18
- };
19
- //# sourceMappingURL=v_panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v_panel.js","sources":["../../../src/surfaces/panel/v_panel.tsx"],"sourcesContent":["import React from 'react';\nimport { Scaffold, type ScaffoldProps } from '../../layouts/scaffold/scaffold.js';\nimport clsx from 'clsx';\n\nexport type VPanelProps = ScaffoldProps;\n\nexport const VPanel = React.forwardRef<HTMLElement, VPanelProps>(function VPanel(\n { children, className, ...props }: VPanelProps,\n ref\n) {\n return (\n <Scaffold\n ref={ref}\n className={clsx('tcn-surface', 'tcn-panel', 'tcn-v-panel', className)}\n {...props}\n >\n {children}\n </Scaffold>\n );\n});\n"],"names":["VPanel","React","children","className","props","ref","jsx","Scaffold","clsx"],"mappings":";;;;AAMO,MAAMA,IAASC,EAAM,WAAqC,SAC/D,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAA,GAC1BC,GACA;AACA,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,WAAWG,EAAK,eAAe,aAAa,eAAeL,CAAS;AAAA,MACnE,GAAGC;AAAA,MAEH,UAAAF;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1 +0,0 @@
1
- @layer tcn-system{:where(._utility-bar_3a92315){width:100%;min-height:0}}
package/dist/v_body.css DELETED
@@ -1 +0,0 @@
1
- @layer tcn-system{._v-body_d8f1917{min-height:0;flex-grow:1;width:100%}}
@@ -1,8 +0,0 @@
1
- @layer tcn-system {
2
- :where(.header) {
3
- width: 100%;
4
- min-height: 0;
5
- padding: var(--padding) var(--padding-large);
6
- gap: var(--gap);
7
- }
8
- }
@@ -1,64 +0,0 @@
1
- import { Main } from '../main/main.js';
2
- import { Rail } from '../rail.js';
3
- import type { Meta, StoryObj } from '@storybook/react-vite';
4
- import { Side } from '../side/side.js';
5
- import { VStack } from '../../../stacks/v_stack.js';
6
-
7
- import styles from './rail_stories.module.css';
8
-
9
- const meta: Meta<typeof Rail> = {
10
- title: 'Layouts/Rail',
11
- component: Rail,
12
- tags: ['autodocs'],
13
- parameters: {
14
- docs: {
15
- description: {
16
- component: 'A rail component that lays out content in a horizontal hierarchy.',
17
- },
18
- },
19
- },
20
- };
21
-
22
- export default meta;
23
-
24
- type Story = StoryObj<typeof Rail>;
25
-
26
- const Content = ({ children }: { children?: React.ReactNode }) => {
27
- return (
28
- <VStack hAlign="start" className={styles.content}>
29
- {children}
30
- </VStack>
31
- );
32
- };
33
-
34
- export const Baseline: Story = {
35
- args: {
36
- height: '100vh',
37
- },
38
- render: () => (
39
- <Rail height="100vh" className={styles.rail}>
40
- <Side className={styles.side}>
41
- <p>Side (Start)</p>
42
- <p>Fills available space</p>
43
- <p>Scrolls horizontally</p>
44
- </Side>
45
-
46
- <Main className={styles.main}>
47
- <Content>
48
- <p>Main</p>
49
- <p>Fills available space</p>
50
- <p>Scrolls horizontally</p>
51
- </Content>
52
- <Content />
53
- <Content />
54
- <Content />
55
- <Content />
56
- </Main>
57
- <Side className={styles.side}>
58
- <p>Side (End)</p>
59
- <p>Fills available space</p>
60
- <p>Scrolls horizontally</p>
61
- </Side>
62
- </Rail>
63
- ),
64
- };