@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.
- package/dist/bar.css +1 -0
- package/dist/body.css +1 -1
- package/dist/body.module-BbFZ7KNP.js +5 -0
- package/dist/body.module-BbFZ7KNP.js.map +1 -0
- package/dist/divider.css +1 -1
- package/dist/footer.css +1 -1
- package/dist/layouts/bar/bar.d.ts +5 -0
- package/dist/layouts/bar/bar.d.ts.map +1 -0
- package/dist/layouts/bar/bar.js +20 -0
- package/dist/layouts/bar/bar.js.map +1 -0
- package/dist/layouts/body/body.d.ts +2 -2
- package/dist/layouts/body/body.d.ts.map +1 -1
- package/dist/layouts/body/body.js +12 -12
- package/dist/layouts/body/body.js.map +1 -1
- package/dist/layouts/body/h_body.d.ts.map +1 -1
- package/dist/layouts/body/h_body.js +18 -12
- package/dist/layouts/body/h_body.js.map +1 -1
- package/dist/layouts/body/v_body.d.ts.map +1 -1
- package/dist/layouts/body/v_body.js +16 -10
- package/dist/layouts/body/v_body.js.map +1 -1
- package/dist/layouts/footer/footer.d.ts +2 -3
- package/dist/layouts/footer/footer.d.ts.map +1 -1
- package/dist/layouts/footer/footer.js +7 -7
- package/dist/layouts/footer/footer.js.map +1 -1
- package/dist/layouts/header/header.d.ts +2 -2
- package/dist/layouts/header/header.d.ts.map +1 -1
- package/dist/layouts/header/header.js +13 -21
- package/dist/layouts/header/header.js.map +1 -1
- package/dist/layouts/index.d.ts +0 -1
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +17 -19
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/rail/rail.js +41 -41
- package/dist/layouts/rail/rail.js.map +1 -1
- package/dist/layouts/rail/side/side.d.ts.map +1 -1
- package/dist/layouts/rail/side/side.js +1 -1
- package/dist/layouts/rail/side/side.js.map +1 -1
- package/dist/layouts/rail/utility_strip/utility_strip.d.ts.map +1 -1
- package/dist/layouts/rail/utility_strip/utility_strip.js +21 -17
- package/dist/layouts/rail/utility_strip/utility_strip.js.map +1 -1
- package/dist/layouts/scaffold/scaffold.js +32 -32
- package/dist/layouts/scaffold/scaffold.js.map +1 -1
- package/dist/layouts/utility_bar/utility_bar.d.ts +2 -2
- package/dist/layouts/utility_bar/utility_bar.d.ts.map +1 -1
- package/dist/layouts/utility_bar/utility_bar.js +17 -19
- package/dist/layouts/utility_bar/utility_bar.js.map +1 -1
- package/dist/overlay/frame/frame.js +3 -3
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/panel.css +1 -0
- package/dist/rail.css +1 -1
- package/dist/scaffold.css +1 -1
- package/dist/side.css +1 -1
- package/dist/stacks/box/bottom_resize_handle.d.ts +2 -2
- package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/bottom_resize_handle.js +12 -10
- package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
- package/dist/stacks/box/box.d.ts +4 -4
- package/dist/stacks/box/box.d.ts.map +1 -1
- package/dist/stacks/box/box.js +26 -26
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.d.ts +2 -2
- package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/end_resize_handle.js +6 -5
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/left_resize_handle.d.ts +2 -2
- package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/left_resize_handle.js +10 -9
- package/dist/stacks/box/left_resize_handle.js.map +1 -1
- package/dist/stacks/box/resize_handlers.d.ts +2 -2
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +24 -24
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.d.ts +2 -2
- package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/right_resize_handle.js +6 -5
- package/dist/stacks/box/right_resize_handle.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.d.ts +2 -2
- package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/start_resize_handle.js +4 -4
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/top_resize_handle.d.ts +2 -2
- package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/top_resize_handle.js +2 -1
- package/dist/stacks/box/top_resize_handle.js.map +1 -1
- package/dist/stacks/h_collapsible_box.d.ts.map +1 -1
- package/dist/stacks/h_collapsible_box.js +24 -24
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/v_collapsible_box.js +25 -25
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/surfaces/index.d.ts +1 -2
- package/dist/surfaces/index.d.ts.map +1 -1
- package/dist/surfaces/index.js +18 -20
- package/dist/surfaces/index.js.map +1 -1
- package/dist/surfaces/panel/panel.d.ts +5 -0
- package/dist/surfaces/panel/panel.d.ts.map +1 -0
- package/dist/surfaces/panel/panel.js +19 -0
- package/dist/surfaces/panel/panel.js.map +1 -0
- package/dist/surfaces/pop_confirm/pop_confirm.js +2 -3
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
- package/dist/themes/theme.d.ts +2 -1
- package/dist/themes/theme.d.ts.map +1 -1
- package/dist/themes/theme.js +16 -9
- package/dist/themes/theme.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +27 -0
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/package.json +1 -1
- package/src/layouts/__stories__/composed.stories.tsx +0 -55
- package/src/layouts/__stories__/rail.stories.tsx +78 -0
- package/src/layouts/__stories__/scaffold.stories.tsx +90 -0
- package/src/layouts/__stories__/utils/content.tsx +27 -0
- package/src/layouts/__stories__/utils/layout_theme.css +88 -0
- package/src/layouts/__stories__/utils/layout_theme_provider.tsx +11 -0
- package/src/layouts/__stories__/utils.tsx +6 -6
- package/src/layouts/{utility_bar/utility_bar.module.css → bar/bar.module.css} +2 -1
- package/src/layouts/bar/bar.tsx +23 -0
- package/src/layouts/body/body.module.css +9 -4
- package/src/layouts/body/body.tsx +7 -6
- package/src/layouts/body/h_body.module.css +1 -2
- package/src/layouts/body/h_body.tsx +9 -4
- package/src/layouts/body/v_body.tsx +9 -4
- package/src/layouts/divider/divider.module.css +1 -1
- package/src/layouts/footer/footer.module.css +0 -3
- package/src/layouts/footer/footer.tsx +5 -6
- package/src/layouts/header/header.tsx +6 -15
- package/src/layouts/index.ts +0 -1
- package/src/layouts/rail/rail.module.css +9 -5
- package/src/layouts/rail/rail.tsx +1 -1
- package/src/layouts/rail/side/side.module.css +0 -1
- package/src/layouts/rail/side/side.tsx +1 -2
- package/src/layouts/rail/utility_strip/utility_strip.module.css +5 -0
- package/src/layouts/rail/utility_strip/utility_strip.tsx +4 -1
- package/src/layouts/scaffold/scaffold.module.css +10 -7
- package/src/layouts/scaffold/scaffold.tsx +1 -1
- package/src/layouts/utility_bar/utility_bar.tsx +6 -9
- package/src/overlay/frame/frame.tsx +2 -2
- package/src/stacks/box/bottom_resize_handle.tsx +7 -5
- package/src/stacks/box/box.tsx +12 -18
- package/src/stacks/box/end_resize_handle.tsx +6 -6
- package/src/stacks/box/left_resize_handle.tsx +4 -3
- package/src/stacks/box/resize_handlers.ts +11 -9
- package/src/stacks/box/right_resize_handle.tsx +4 -3
- package/src/stacks/box/start_resize_handle.tsx +3 -3
- package/src/stacks/box/top_resize_handle.tsx +4 -3
- package/src/stacks/collapsible_box.stories.tsx +11 -11
- package/src/stacks/h_collapsible_box.tsx +5 -5
- package/src/stacks/v_collapsible_box.tsx +4 -4
- package/src/surfaces/index.ts +1 -2
- package/src/surfaces/panel/__stories__/panel.stories.tsx +12 -12
- package/src/surfaces/panel/__stories__/panel_stories.module.css +3 -3
- package/src/surfaces/panel/panel.module.css +1 -6
- package/src/surfaces/panel/panel.tsx +22 -0
- package/src/themes/theme.tsx +6 -2
- package/src/themes/themes/ergo/__stories__/material.stories.tsx +15 -16
- package/src/themes/themes/ergo/ergo_theme.css +27 -0
- package/dist/h_body.css +0 -1
- package/dist/h_panel.css +0 -1
- package/dist/header.css +0 -1
- package/dist/layouts/rail/main/main.d.ts +0 -6
- package/dist/layouts/rail/main/main.d.ts.map +0 -1
- package/dist/layouts/rail/main/main.js +0 -21
- package/dist/layouts/rail/main/main.js.map +0 -1
- package/dist/main.css +0 -1
- package/dist/surfaces/panel/h_panel.d.ts +0 -9
- package/dist/surfaces/panel/h_panel.d.ts.map +0 -1
- package/dist/surfaces/panel/h_panel.js +0 -60
- package/dist/surfaces/panel/h_panel.js.map +0 -1
- package/dist/surfaces/panel/v_panel.d.ts +0 -5
- package/dist/surfaces/panel/v_panel.d.ts.map +0 -1
- package/dist/surfaces/panel/v_panel.js +0 -19
- package/dist/surfaces/panel/v_panel.js.map +0 -1
- package/dist/utility_bar.css +0 -1
- package/dist/v_body.css +0 -1
- package/src/layouts/header/header.module.css +0 -8
- package/src/layouts/rail/__stories__/rail.stories.tsx +0 -64
- package/src/layouts/rail/__stories__/rail_stories.module.css +0 -25
- package/src/layouts/rail/main/main.module.css +0 -7
- package/src/layouts/rail/main/main.tsx +0 -26
- package/src/layouts/scaffold/__stories__/scaffold.stories.tsx +0 -53
- package/src/layouts/scaffold/__stories__/scaffold_stories.module.css +0 -31
- package/src/surfaces/panel/h_panel.tsx +0 -65
- 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<
|
|
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,
|
|
11
|
+
{ children, className, ...props }: BodyProps,
|
|
10
12
|
ref
|
|
11
13
|
) {
|
|
12
14
|
return (
|
|
13
|
-
<
|
|
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
|
-
</
|
|
22
|
+
</Box>
|
|
22
23
|
);
|
|
23
24
|
});
|
|
@@ -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 './
|
|
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,
|
|
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
|
-
|
|
17
|
-
|
|
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 './
|
|
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,
|
|
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
|
-
|
|
17
|
-
|
|
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}
|
|
@@ -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
|
|
4
|
+
import { Bar, type BarProps } from '../bar/bar.js';
|
|
6
5
|
|
|
7
|
-
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
|
4
|
+
import { Bar, type BarProps } from '../bar/bar.js';
|
|
6
5
|
|
|
7
|
-
export interface HeaderProps extends Omit<
|
|
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
|
-
<
|
|
16
|
+
<Bar
|
|
25
17
|
ref={ref}
|
|
26
18
|
as="header"
|
|
27
|
-
className={clsx(
|
|
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
|
-
</
|
|
25
|
+
</Bar>
|
|
35
26
|
);
|
|
36
27
|
});
|
package/src/layouts/index.ts
CHANGED
|
@@ -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
@@ -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}
|
|
@@ -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
4
|
+
import { Bar, type BarProps } from '../bar/bar.js';
|
|
6
5
|
|
|
7
6
|
// UtilityBar
|
|
8
|
-
export interface UtilityBarProps extends Omit<
|
|
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
|
-
|
|
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
|
-
<
|
|
24
|
+
<Bar
|
|
27
25
|
ref={ref}
|
|
28
26
|
as="header"
|
|
29
|
-
className={clsx(
|
|
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
|
-
</
|
|
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?: (
|
|
11
|
-
onHeightResizeEnd?: (
|
|
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
|
|
package/src/stacks/box/box.tsx
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
2
|
import React, { CSSProperties, HTMLAttributes, useRef } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
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
|
-
|
|
50
|
-
|
|
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?: (
|
|
11
|
-
onWidthResizeEnd?: (
|
|
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?: (
|
|
11
|
-
onWidthResizeEnd?: (
|
|
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?: (
|
|
13
|
-
onWidthResizeEnd?: (
|
|
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
|
|
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
|
|
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?: (
|
|
77
|
-
onHeightResizeEnd?: (
|
|
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
|
|
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
|
|
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?: (
|
|
11
|
-
onWidthResizeEnd?: (
|
|
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?: (
|
|
11
|
-
onWidthResizeEnd?: (
|
|
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
|
-
|
|
23
|
+
'left'
|
|
24
24
|
);
|
|
25
25
|
const offset = handleProps?.offset ? handleProps.offset : -8;
|
|
26
26
|
|