@tcn/ui 0.12.6 → 0.13.1
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/aside.css +1 -0
- package/dist/body.css +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.d.ts +2 -1
- package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.js +28 -26
- package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
- package/dist/inputs/phone_number_input/sip_input.d.ts +2 -1
- package/dist/inputs/phone_number_input/sip_input.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/sip_input.js +45 -43
- package/dist/inputs/phone_number_input/sip_input.js.map +1 -1
- package/dist/layouts/body/body.d.ts +17 -0
- package/dist/layouts/body/body.d.ts.map +1 -1
- package/dist/layouts/body/body.js +11 -12
- package/dist/layouts/body/body.js.map +1 -1
- package/dist/layouts/index.d.ts +1 -2
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +38 -40
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/scaffold/scaffold.js +1 -1
- package/dist/layouts/scaffold/scaffold.js.map +1 -1
- package/dist/layouts/section/section.d.ts.map +1 -1
- package/dist/layouts/section/section.js +14 -13
- package/dist/layouts/section/section.js.map +1 -1
- package/dist/page.css +1 -1
- package/dist/surfaces/aside/aside.d.ts +5 -0
- package/dist/surfaces/aside/aside.d.ts.map +1 -0
- package/dist/surfaces/aside/aside.js +19 -0
- package/dist/surfaces/aside/aside.js.map +1 -0
- package/dist/surfaces/drawers/drawer.d.ts.map +1 -1
- package/dist/surfaces/drawers/drawer.js +19 -11
- package/dist/surfaces/drawers/drawer.js.map +1 -1
- package/dist/surfaces/index.d.ts +2 -2
- package/dist/surfaces/index.d.ts.map +1 -1
- package/dist/surfaces/index.js +14 -14
- package/dist/surfaces/modal/modal.d.ts.map +1 -1
- package/dist/surfaces/modal/modal.js +22 -14
- package/dist/surfaces/modal/modal.js.map +1 -1
- package/dist/surfaces/page/page.d.ts +5 -0
- package/dist/surfaces/page/page.d.ts.map +1 -0
- package/dist/surfaces/page/page.js +19 -0
- package/dist/surfaces/page/page.js.map +1 -0
- package/dist/surfaces/pop_confirm/pop_confirm.d.ts.map +1 -1
- package/dist/surfaces/pop_confirm/pop_confirm.js +23 -16
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +27 -19
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +88 -48
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/package.json +2 -2
- package/src/inputs/phone_number_input/phone_number_input.tsx +3 -0
- package/src/inputs/phone_number_input/sip_input.tsx +3 -0
- package/src/layouts/__stories__/composed_stories.module.css +1 -7
- package/src/layouts/__stories__/rail.stories.tsx +20 -13
- package/src/layouts/__stories__/scaffold.stories.tsx +34 -22
- package/src/layouts/__stories__/utils.tsx +10 -7
- package/src/layouts/body/body.module.css +0 -8
- package/src/layouts/body/body.tsx +19 -3
- package/src/layouts/index.ts +1 -2
- package/src/layouts/scaffold/scaffold.tsx +1 -1
- package/src/layouts/section/section.tsx +2 -1
- package/src/overlay/slide/slide.stories.tsx +9 -6
- package/src/surfaces/aside/aside.module.css +5 -0
- package/src/surfaces/aside/aside.stories.tsx +75 -0
- package/src/surfaces/aside/aside.tsx +22 -0
- package/src/surfaces/card/card.stories.tsx +8 -5
- package/src/surfaces/card/card_stories.module.css +4 -2
- package/src/surfaces/drawers/drawer.stories.tsx +21 -7
- package/src/surfaces/drawers/drawer.tsx +5 -1
- package/src/surfaces/index.ts +2 -2
- package/src/surfaces/modal/__stories__/modal.stories.tsx +21 -4
- package/src/surfaces/modal/modal.tsx +5 -1
- package/src/surfaces/page/page.module.css +0 -6
- package/src/surfaces/page/page.stories.tsx +71 -0
- package/src/surfaces/page/page.tsx +22 -0
- package/src/surfaces/panel/__stories__/panel.stories.tsx +66 -60
- package/src/surfaces/pop_confirm/pop_confirm.stories.tsx +43 -31
- package/src/surfaces/pop_confirm/pop_confirm.tsx +5 -1
- package/src/surfaces/tooltip/__stories__/tooltip.stories.tsx +31 -0
- package/src/surfaces/window/window.stories.tsx +15 -4
- package/src/surfaces/window/window.tsx +5 -1
- package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_card.tsx +16 -15
- package/src/themes/themes/ergo/__stories__/material.stories.tsx +6 -4
- package/src/themes/themes/ergo/ergo_theme.css +88 -48
- package/dist/body.module-BbFZ7KNP.js +0 -5
- package/dist/body.module-BbFZ7KNP.js.map +0 -1
- package/dist/layouts/body/h_body.d.ts +0 -6
- package/dist/layouts/body/h_body.d.ts.map +0 -1
- package/dist/layouts/body/h_body.js +0 -27
- package/dist/layouts/body/h_body.js.map +0 -1
- package/dist/layouts/body/v_body.d.ts +0 -6
- package/dist/layouts/body/v_body.d.ts.map +0 -1
- package/dist/layouts/body/v_body.js +0 -27
- package/dist/layouts/body/v_body.js.map +0 -1
- package/dist/page.module-DXhph-u6.js +0 -5
- package/dist/page.module-DXhph-u6.js.map +0 -1
- package/dist/surfaces/page/h_page.d.ts +0 -6
- package/dist/surfaces/page/h_page.d.ts.map +0 -1
- package/dist/surfaces/page/h_page.js +0 -22
- package/dist/surfaces/page/h_page.js.map +0 -1
- package/dist/surfaces/page/v_page.d.ts +0 -6
- package/dist/surfaces/page/v_page.d.ts.map +0 -1
- package/dist/surfaces/page/v_page.js +0 -21
- package/dist/surfaces/page/v_page.js.map +0 -1
- package/src/layouts/body/h_body.module.css +0 -7
- package/src/layouts/body/h_body.tsx +0 -28
- package/src/layouts/body/v_body.module.css +0 -7
- package/src/layouts/body/v_body.tsx +0 -28
- package/src/surfaces/page/h_page.tsx +0 -23
- package/src/surfaces/page/v_page.tsx +0 -22
|
@@ -16,6 +16,7 @@ export interface PhoneNumberInputProps
|
|
|
16
16
|
extends Omit<HStackProps, 'onChange' | 'children'> {
|
|
17
17
|
value?: string;
|
|
18
18
|
allowSip?: boolean;
|
|
19
|
+
sipAutoComplete?: string;
|
|
19
20
|
onChange: (value?: string) => void;
|
|
20
21
|
defaultCountry?: string;
|
|
21
22
|
allowedCountryCodes?: string[];
|
|
@@ -48,6 +49,7 @@ export function PhoneNumberInput({
|
|
|
48
49
|
limitMaxLength,
|
|
49
50
|
ariaSelectLabel,
|
|
50
51
|
ariaPhoneBookButtonLabel,
|
|
52
|
+
sipAutoComplete,
|
|
51
53
|
children,
|
|
52
54
|
...props
|
|
53
55
|
}: PhoneNumberInputProps) {
|
|
@@ -124,6 +126,7 @@ export function PhoneNumberInput({
|
|
|
124
126
|
autoFocus={autoFocus}
|
|
125
127
|
placeholder={placeholder}
|
|
126
128
|
countries={countries as CountryCode[]}
|
|
129
|
+
sipAutoComplete={sipAutoComplete}
|
|
127
130
|
/>
|
|
128
131
|
</PhoneBookProvider>
|
|
129
132
|
);
|
|
@@ -14,6 +14,7 @@ import { SuggestionList } from '../suggestions/suggestion_list.js';
|
|
|
14
14
|
|
|
15
15
|
export interface SipInputProps {
|
|
16
16
|
onChange: (value: string) => void;
|
|
17
|
+
sipAutoComplete?: string;
|
|
17
18
|
countries?: CountryCode[];
|
|
18
19
|
disabled?: boolean;
|
|
19
20
|
name?: string;
|
|
@@ -29,6 +30,7 @@ export function SipInput({
|
|
|
29
30
|
'aria-label': ariaLabel,
|
|
30
31
|
autoFocus,
|
|
31
32
|
placeholder,
|
|
33
|
+
sipAutoComplete = 'on',
|
|
32
34
|
}: SipInputProps) {
|
|
33
35
|
const inputRef = React.useRef<HTMLInputElement>(null);
|
|
34
36
|
const [phoneBookElement, setPhoneBookElement] =
|
|
@@ -120,6 +122,7 @@ export function SipInput({
|
|
|
120
122
|
aria-label={ariaLabel}
|
|
121
123
|
autoFocus={autoFocus}
|
|
122
124
|
placeholder={placeholder}
|
|
125
|
+
autoComplete={sipAutoComplete}
|
|
123
126
|
/>
|
|
124
127
|
{showPhoneBook && (
|
|
125
128
|
<Button
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.secondary {
|
|
28
|
-
padding: 8px
|
|
28
|
+
padding: 8px;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.primary {
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
|
|
77
77
|
.body {
|
|
78
78
|
background: var(--bg-4);
|
|
79
|
-
gap: 8px;
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
/* Horizontal Layouts */
|
|
@@ -89,11 +88,6 @@
|
|
|
89
88
|
background: var(--bg-2);
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
.main {
|
|
93
|
-
background: var(--bg-3);
|
|
94
|
-
gap: 8px;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
91
|
.content {
|
|
98
92
|
background: rgba(0, 0, 0, 0.25);
|
|
99
93
|
display: flex;
|
|
@@ -5,10 +5,10 @@ import { SBLayoutContent } from './utils/content.js';
|
|
|
5
5
|
import { Rail } from '../rail/rail.js';
|
|
6
6
|
import { Side } from '../rail/side/side.js';
|
|
7
7
|
import { UtilityStrip } from '../rail/utility_strip/utility_strip.js';
|
|
8
|
-
import { Title } from '../../typography/index.js';
|
|
9
|
-
import { HBody } from '../body/h_body.js';
|
|
10
|
-
import { VBody } from '../body/v_body.js';
|
|
8
|
+
import { BodyText, Title } from '../../typography/index.js';
|
|
11
9
|
import { Body } from '../body/body.js';
|
|
10
|
+
import { VStack } from '../../stacks/v_stack.js';
|
|
11
|
+
import { Scaffold } from '../scaffold/scaffold.js';
|
|
12
12
|
|
|
13
13
|
const meta: Meta<typeof Rail> = {
|
|
14
14
|
title: 'Layouts/Rail',
|
|
@@ -48,11 +48,16 @@ export const HorizontalContent: Story = {
|
|
|
48
48
|
<UtilityStrip>
|
|
49
49
|
<Title>Utility Strip</Title>
|
|
50
50
|
</UtilityStrip>
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
<Body>
|
|
52
|
+
<Rail>
|
|
53
|
+
<VStack minWidth="200px">
|
|
54
|
+
<BodyText>Body + Rail</BodyText>
|
|
55
|
+
</VStack>
|
|
56
|
+
<SBLayoutContent />
|
|
57
|
+
<SBLayoutContent />
|
|
58
|
+
<SBLayoutContent />
|
|
59
|
+
</Rail>
|
|
60
|
+
</Body>
|
|
56
61
|
<Side width="200px">Side</Side>
|
|
57
62
|
</Rail>
|
|
58
63
|
</LayoutStoryDecorator>
|
|
@@ -66,11 +71,13 @@ export const VerticalContent: Story = {
|
|
|
66
71
|
<UtilityStrip>
|
|
67
72
|
<Title>Utility Strip</Title>
|
|
68
73
|
</UtilityStrip>
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
<Body>
|
|
75
|
+
<Scaffold>
|
|
76
|
+
<SBLayoutContent />
|
|
77
|
+
<SBLayoutContent />
|
|
78
|
+
<SBLayoutContent />
|
|
79
|
+
</Scaffold>
|
|
80
|
+
</Body>
|
|
74
81
|
<Side width="200px">Side</Side>
|
|
75
82
|
</Rail>
|
|
76
83
|
</LayoutStoryDecorator>
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Scaffold } from '../scaffold/scaffold.js';
|
|
2
2
|
import { Header } from '../header/header.js';
|
|
3
3
|
import { UtilityBar } from '../utility_bar/utility_bar.js';
|
|
4
|
-
import { VBody } from '../body/v_body.js';
|
|
5
4
|
import { Footer } from '../footer/footer.js';
|
|
6
5
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
7
6
|
|
|
8
7
|
import { LayoutStoryDecorator } from './utils/layout_theme_provider.js';
|
|
9
8
|
import { SBLayoutContent } from './utils/content.js';
|
|
10
|
-
import { HBody } from '../body/h_body.js';
|
|
11
9
|
import { VStack } from '../../stacks/v_stack.js';
|
|
12
10
|
import { Body } from '../body/body.js';
|
|
11
|
+
import { Rail } from '../rail/rail.js';
|
|
12
|
+
import { Section } from '../section/section.js';
|
|
13
|
+
import { BodyText } from '../../typography/index.js';
|
|
14
|
+
import { Heading } from '../section/heading.js';
|
|
13
15
|
|
|
14
16
|
const meta: Meta<typeof Scaffold> = {
|
|
15
17
|
title: 'Layouts/Scaffold',
|
|
@@ -50,20 +52,30 @@ export const VerticalContent: Story = {
|
|
|
50
52
|
<Scaffold height="100vh">
|
|
51
53
|
<Header>Header</Header>
|
|
52
54
|
<UtilityBar>Utility Bar</UtilityBar>
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
<Body>
|
|
56
|
+
<Scaffold>
|
|
57
|
+
<VStack>
|
|
58
|
+
<BodyText>Body + Scaffold</BodyText>
|
|
59
|
+
</VStack>
|
|
60
|
+
<Section>
|
|
61
|
+
<Heading>Section 1 - A</Heading>
|
|
62
|
+
<SBLayoutContent />
|
|
63
|
+
<Section>
|
|
64
|
+
<Heading>Section 1 - B</Heading>
|
|
65
|
+
<SBLayoutContent />
|
|
66
|
+
</Section>
|
|
67
|
+
</Section>
|
|
68
|
+
<Section>
|
|
69
|
+
<Heading>Section 2</Heading>
|
|
70
|
+
<SBLayoutContent />
|
|
71
|
+
<SBLayoutContent />
|
|
72
|
+
</Section>
|
|
73
|
+
</Scaffold>
|
|
74
|
+
</Body>
|
|
62
75
|
</Scaffold>
|
|
63
76
|
</LayoutStoryDecorator>
|
|
64
77
|
),
|
|
65
78
|
};
|
|
66
|
-
|
|
67
79
|
export const HorizontalContent: Story = {
|
|
68
80
|
args: {
|
|
69
81
|
height: '100vh',
|
|
@@ -73,16 +85,16 @@ export const HorizontalContent: Story = {
|
|
|
73
85
|
<Scaffold height="100vh">
|
|
74
86
|
<Header>Header</Header>
|
|
75
87
|
<UtilityBar>Utility Bar</UtilityBar>
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</
|
|
88
|
+
<Body>
|
|
89
|
+
<Rail>
|
|
90
|
+
<VStack minWidth="200px">
|
|
91
|
+
<BodyText>Body + Rail</BodyText>
|
|
92
|
+
</VStack>
|
|
93
|
+
<SBLayoutContent />
|
|
94
|
+
<SBLayoutContent />
|
|
95
|
+
<SBLayoutContent />
|
|
96
|
+
</Rail>
|
|
97
|
+
</Body>
|
|
86
98
|
<Footer>Footer</Footer>
|
|
87
99
|
</Scaffold>
|
|
88
100
|
</LayoutStoryDecorator>
|
|
@@ -8,13 +8,12 @@ import { UtilityBar } from '../utility_bar/utility_bar.js';
|
|
|
8
8
|
|
|
9
9
|
import { Rail, type RailProps } from '../rail/rail.js';
|
|
10
10
|
import { Side } from '../rail/side/side.js';
|
|
11
|
-
import { VBody } from '../body/v_body.js';
|
|
12
|
-
import { HBody } from '../body/h_body.js';
|
|
13
11
|
import { Box, Spacer } from '../../stacks/index.js';
|
|
14
12
|
import { UtilityStrip } from '../rail/utility_strip/utility_strip.js';
|
|
15
13
|
import { SearchIcon } from '@tcn/icons/search_icon.js';
|
|
16
14
|
|
|
17
15
|
import styles from './composed_stories.module.css';
|
|
16
|
+
import { Body } from '../body/body.js';
|
|
18
17
|
|
|
19
18
|
const FloatingLabel = ({ children }: { children: React.ReactNode }) => {
|
|
20
19
|
return (
|
|
@@ -101,10 +100,12 @@ export const SBNestedRail: React.FC<PropsWithChildren<SBNestedRailProps>> = ({
|
|
|
101
100
|
</UtilityStrip>
|
|
102
101
|
)}
|
|
103
102
|
{main && (
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
<Body className={clsx(styles.main, styles.secondary)} width="200px">
|
|
104
|
+
<Scaffold>
|
|
105
|
+
{mainLabel && <>Body</>}
|
|
106
|
+
{children}
|
|
107
|
+
</Scaffold>
|
|
108
|
+
</Body>
|
|
108
109
|
)}
|
|
109
110
|
{!main && children}
|
|
110
111
|
{side && (
|
|
@@ -163,7 +164,9 @@ export const SBNestedScaffold: React.FC<PropsWithChildren<SBNestedScaffoldProps>
|
|
|
163
164
|
</UtilityBar>
|
|
164
165
|
)}
|
|
165
166
|
{body && (
|
|
166
|
-
<
|
|
167
|
+
<Body className={clsx(styles.body, styles.secondary)}>
|
|
168
|
+
<Scaffold>Body {children}</Scaffold>
|
|
169
|
+
</Body>
|
|
167
170
|
)}
|
|
168
171
|
{!body && children}
|
|
169
172
|
{footer && (
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import styles from './body.module.css';
|
|
4
3
|
import { Box, type BoxProps } from '../../stacks/box/box.js';
|
|
5
4
|
|
|
5
|
+
import styles from './body.module.css';
|
|
6
|
+
|
|
6
7
|
export interface BodyProps extends Omit<BoxProps, 'as'> {}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The Body component will fill the available space in in a flex container.
|
|
11
|
+
* It is typically used within a Scaffold or Rail component.
|
|
12
|
+
* And typically will return a Scaffold or Rail component to determine the scroll behavior of the body
|
|
13
|
+
* Example:
|
|
14
|
+
* <Body>
|
|
15
|
+
* <Scaffold>
|
|
16
|
+
* <VerticalContent />
|
|
17
|
+
* </Scaffold>
|
|
18
|
+
* </Body>
|
|
19
|
+
* or
|
|
20
|
+
* <Body>
|
|
21
|
+
* <Rail>
|
|
22
|
+
* <HorizontalContent />
|
|
23
|
+
* </Rail>
|
|
24
|
+
* </Body>
|
|
25
|
+
*/
|
|
10
26
|
export const Body = React.forwardRef<HTMLElement, BodyProps>(function Body(
|
|
11
27
|
{ children, className, ...props }: BodyProps,
|
|
12
28
|
ref
|
package/src/layouts/index.ts
CHANGED
|
@@ -7,8 +7,7 @@ export * from './sidebar_end/sidebar_end.js';
|
|
|
7
7
|
export * from './sidebar_start/sidebar_start.js';
|
|
8
8
|
|
|
9
9
|
export { Scaffold, type ScaffoldProps } from './scaffold/scaffold.js';
|
|
10
|
-
export {
|
|
11
|
-
export { VBody, type VBodyProps } from './body/v_body.js';
|
|
10
|
+
export { Body, type BodyProps } from './body/body.js';
|
|
12
11
|
export { Footer, type FooterProps } from './footer/footer.js';
|
|
13
12
|
export { Header, type HeaderProps } from './header/header.js';
|
|
14
13
|
export { UtilityBar, type UtilityBarProps } from './utility_bar/utility_bar.js';
|
|
@@ -4,13 +4,14 @@ import { VStack, type VStackProps } from '../../stacks/v_stack.js';
|
|
|
4
4
|
import styles from './section.module.css';
|
|
5
5
|
|
|
6
6
|
export const Section = React.forwardRef<HTMLDivElement, VStackProps>(function Section(
|
|
7
|
-
{ children, className, as = 'section', style, ...props },
|
|
7
|
+
{ children, className, hAlign = 'start', as = 'section', style, ...props },
|
|
8
8
|
ref
|
|
9
9
|
) {
|
|
10
10
|
return (
|
|
11
11
|
<VStack
|
|
12
12
|
as={as}
|
|
13
13
|
ref={ref}
|
|
14
|
+
hAlign={hAlign}
|
|
14
15
|
className={clsx(className, 'tcn-surface', styles.section, 'tcn-section')}
|
|
15
16
|
style={style}
|
|
16
17
|
{...props}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Header, Scaffold,
|
|
1
|
+
import { Header, Scaffold, Body } from '../../layouts/index.js';
|
|
2
2
|
import { ZStack } from '../../stacks/z_stack.js';
|
|
3
3
|
import { BodyText } from '../../typography/index.js';
|
|
4
4
|
import { Title } from '../../typography/title/title.js';
|
|
@@ -46,11 +46,14 @@ export const SlideStory = (args: Omit<SlideProps, 'children'>) => {
|
|
|
46
46
|
<Title> This is a Slide</Title>
|
|
47
47
|
</Header>
|
|
48
48
|
</DragHandle>
|
|
49
|
-
<
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
<Body>
|
|
50
|
+
<Scaffold>
|
|
51
|
+
<BodyText>
|
|
52
|
+
This component is fixed to a side of a container (top, bottom, start,
|
|
53
|
+
end).
|
|
54
|
+
</BodyText>
|
|
55
|
+
</Scaffold>
|
|
56
|
+
</Body>
|
|
54
57
|
</Scaffold>
|
|
55
58
|
</Slide>
|
|
56
59
|
</ZStack>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import {
|
|
3
|
+
Body,
|
|
4
|
+
Footer,
|
|
5
|
+
Header,
|
|
6
|
+
Heading,
|
|
7
|
+
Rail,
|
|
8
|
+
Scaffold,
|
|
9
|
+
Section,
|
|
10
|
+
} from '../../layouts/index.js';
|
|
11
|
+
import { Box } from '../../stacks/index.js';
|
|
12
|
+
import { Aside } from './aside.js';
|
|
13
|
+
import { BodyText, Title } from '../../typography/index.js';
|
|
14
|
+
import { Panel } from '../panel/panel.js';
|
|
15
|
+
import { theme } from '../../themes/theme_variables.js';
|
|
16
|
+
|
|
17
|
+
const meta: Meta<typeof Aside> = {
|
|
18
|
+
title: 'Surfaces/Aside',
|
|
19
|
+
component: Aside,
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
type Story = StoryObj<typeof Aside>;
|
|
26
|
+
|
|
27
|
+
export const Baseline: Story = {
|
|
28
|
+
render: () => (
|
|
29
|
+
<Box
|
|
30
|
+
height="100vh"
|
|
31
|
+
minHeight="400px"
|
|
32
|
+
padding="16px"
|
|
33
|
+
style={{ backgroundColor: theme.backgroundColors.tertiary }}
|
|
34
|
+
>
|
|
35
|
+
<Panel>
|
|
36
|
+
<Header>
|
|
37
|
+
<Title>Parent Container Title</Title>
|
|
38
|
+
</Header>
|
|
39
|
+
<Body>
|
|
40
|
+
<Rail>
|
|
41
|
+
<Aside width="240px">
|
|
42
|
+
<Header>
|
|
43
|
+
<Title>Aside - Secondary</Title>
|
|
44
|
+
</Header>
|
|
45
|
+
<Body>
|
|
46
|
+
<Scaffold>
|
|
47
|
+
<Section hAlign="start">
|
|
48
|
+
<Heading>Aside Section</Heading>
|
|
49
|
+
<BodyText>Section Content</BodyText>
|
|
50
|
+
</Section>
|
|
51
|
+
<Section hAlign="start">
|
|
52
|
+
<Heading>Aside Section 2</Heading>
|
|
53
|
+
<BodyText>Section Content 2</BodyText>
|
|
54
|
+
</Section>
|
|
55
|
+
</Scaffold>
|
|
56
|
+
</Body>
|
|
57
|
+
<Footer>
|
|
58
|
+
<Title>Aside Footer</Title>
|
|
59
|
+
</Footer>
|
|
60
|
+
</Aside>
|
|
61
|
+
<Body>
|
|
62
|
+
<Scaffold>
|
|
63
|
+
<BodyText>Primary Content</BodyText>
|
|
64
|
+
</Scaffold>
|
|
65
|
+
</Body>
|
|
66
|
+
</Rail>
|
|
67
|
+
</Body>
|
|
68
|
+
|
|
69
|
+
<Footer>
|
|
70
|
+
<Title>Parent Container Footer</Title>
|
|
71
|
+
</Footer>
|
|
72
|
+
</Panel>
|
|
73
|
+
</Box>
|
|
74
|
+
),
|
|
75
|
+
};
|
|
@@ -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 './aside.module.css';
|
|
6
|
+
|
|
7
|
+
export type AsideProps = ScaffoldProps;
|
|
8
|
+
|
|
9
|
+
export const Aside = React.forwardRef<HTMLElement, AsideProps>(function Aside(
|
|
10
|
+
{ children, className, ...props }: AsideProps,
|
|
11
|
+
ref
|
|
12
|
+
) {
|
|
13
|
+
return (
|
|
14
|
+
<Scaffold
|
|
15
|
+
ref={ref}
|
|
16
|
+
className={clsx(styles['aside'], 'tcn-surface', 'tcn-aside', className)}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
{children}
|
|
20
|
+
</Scaffold>
|
|
21
|
+
);
|
|
22
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BugIcon } from '@tcn/icons/bug_icon.js';
|
|
2
2
|
import { GridOneIcon } from '@tcn/icons/grid_one_icon.js';
|
|
3
3
|
import { Header } from '../../layouts/header/header.js';
|
|
4
|
-
import { VBody } from '../../layouts/body/v_body.js';
|
|
5
4
|
import { UtilityBar } from '../../layouts/utility_bar/utility_bar.js';
|
|
6
5
|
import { Box, Spacer } from '../../stacks/index.js';
|
|
7
6
|
import { Title } from '../../typography/title/title.js';
|
|
8
7
|
import { Button } from '../../actions/index.js';
|
|
9
8
|
import { Card } from './card.js';
|
|
9
|
+
import { Body, Scaffold } from '../../layouts/index.js';
|
|
10
10
|
|
|
11
11
|
// Styles
|
|
12
12
|
import styles from './card_stories.module.css';
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
export const Default = () => {
|
|
21
21
|
return (
|
|
22
22
|
<div className={styles['stories-container']}>
|
|
23
|
-
<Card maxHeight="400px">
|
|
23
|
+
<Card maxHeight="400px" maxWidth="400px">
|
|
24
24
|
<Header>
|
|
25
25
|
<Title>Card Header</Title>
|
|
26
26
|
<Spacer />
|
|
@@ -48,9 +48,12 @@ export const Default = () => {
|
|
|
48
48
|
</Button>
|
|
49
49
|
</UtilityBar>
|
|
50
50
|
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
|
|
51
|
+
<Body>
|
|
52
|
+
<Scaffold>
|
|
53
|
+
<Box className={styles['content-box']} />
|
|
54
|
+
<Box className={styles['content-box']} />
|
|
55
|
+
</Scaffold>
|
|
56
|
+
</Body>
|
|
54
57
|
{/* Cards typically do not have a footer */}
|
|
55
58
|
{/* <Footer>
|
|
56
59
|
<Title>Footer</Title>
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Button } from '../../actions/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Body,
|
|
5
|
+
Footer,
|
|
6
|
+
Header,
|
|
7
|
+
Heading,
|
|
8
|
+
Scaffold,
|
|
9
|
+
Section,
|
|
10
|
+
UtilityBar,
|
|
11
|
+
} from '../../layouts/index.js';
|
|
4
12
|
import { ZStack } from '../../stacks/z_stack.js';
|
|
5
13
|
import { BodyText, Title } from '../../typography/index.js';
|
|
6
14
|
import { Drawer, type DrawerProps } from './drawer.js';
|
|
@@ -86,8 +94,6 @@ export const Baseline = ({
|
|
|
86
94
|
minHeight={useWidth ? undefined : minSize}
|
|
87
95
|
maxHeight={useWidth ? undefined : maxSize}
|
|
88
96
|
>
|
|
89
|
-
{/* Add a drag handle around the areas of the modal you want to be draggable (usually the header) */}
|
|
90
|
-
{/* <DragHandle> */}
|
|
91
97
|
<Header>
|
|
92
98
|
<Title>Drawer Title</Title>
|
|
93
99
|
<Spacer />
|
|
@@ -101,7 +107,6 @@ export const Baseline = ({
|
|
|
101
107
|
<CrossIcon />
|
|
102
108
|
</Button>
|
|
103
109
|
</Header>
|
|
104
|
-
{/* </DragHandle> */}
|
|
105
110
|
|
|
106
111
|
<UtilityBar>
|
|
107
112
|
<Title>Utility Bar</Title>
|
|
@@ -116,9 +121,18 @@ export const Baseline = ({
|
|
|
116
121
|
<BugIcon />
|
|
117
122
|
</Button>
|
|
118
123
|
</UtilityBar>
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
|
|
124
|
+
<Body>
|
|
125
|
+
<Scaffold>
|
|
126
|
+
<Section>
|
|
127
|
+
<Heading>Drawer Section</Heading>
|
|
128
|
+
<BodyText>Section Content</BodyText>
|
|
129
|
+
</Section>
|
|
130
|
+
<Section>
|
|
131
|
+
<Heading>Drawer Section 2</Heading>
|
|
132
|
+
<BodyText>Section Content 2</BodyText>
|
|
133
|
+
</Section>
|
|
134
|
+
</Scaffold>
|
|
135
|
+
</Body>
|
|
122
136
|
<Footer>
|
|
123
137
|
<Spacer />
|
|
124
138
|
<Button hierarchy="secondary">Cancel</Button>
|
|
@@ -18,7 +18,11 @@ export const Drawer = React.forwardRef<HTMLElement, DrawerProps>(function Drawer
|
|
|
18
18
|
className={clsx('tcn-surface', 'tcn-drawer', className)}
|
|
19
19
|
{...props}
|
|
20
20
|
>
|
|
21
|
-
<Scaffold
|
|
21
|
+
<Scaffold
|
|
22
|
+
className={'tcn-overlay-content tcn-drawer-scaffold'}
|
|
23
|
+
width="100%"
|
|
24
|
+
height="100%"
|
|
25
|
+
>
|
|
22
26
|
{children}
|
|
23
27
|
</Scaffold>
|
|
24
28
|
</Slide>
|
package/src/surfaces/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from './alert/alert.js';
|
|
2
2
|
export * from './card/card.js';
|
|
3
3
|
export * from './confirm/confirm.js';
|
|
4
|
-
export * from './page/
|
|
5
|
-
export * from './page/v_page.js';
|
|
4
|
+
export * from './page/page.js';
|
|
6
5
|
export * from './panel/panel.js';
|
|
6
|
+
export * from './aside/aside.js';
|
|
7
7
|
export * from './popover/popover.js';
|
|
8
8
|
export { Drawer, type DrawerProps } from './drawers/drawer.js';
|
|
9
9
|
export { Window, type WindowProps } from './window/window.js';
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Button } from '../../../actions/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Footer,
|
|
5
|
+
Header,
|
|
6
|
+
UtilityBar,
|
|
7
|
+
Body,
|
|
8
|
+
Scaffold,
|
|
9
|
+
Heading,
|
|
10
|
+
Section,
|
|
11
|
+
} from '../../../layouts/index.js';
|
|
4
12
|
import { ZStack } from '../../../stacks/z_stack.js';
|
|
5
13
|
import { BodyText, Title } from '../../../typography/index.js';
|
|
6
14
|
import { Modal, type ModalProps } from '../modal.js';
|
|
@@ -121,9 +129,18 @@ export const Baseline = ({
|
|
|
121
129
|
<BugIcon />
|
|
122
130
|
</Button>
|
|
123
131
|
</UtilityBar>
|
|
124
|
-
<
|
|
125
|
-
<
|
|
126
|
-
|
|
132
|
+
<Body>
|
|
133
|
+
<Scaffold>
|
|
134
|
+
<Section>
|
|
135
|
+
<Heading>Modal Section</Heading>
|
|
136
|
+
<BodyText>Section Content</BodyText>
|
|
137
|
+
</Section>
|
|
138
|
+
<Section>
|
|
139
|
+
<Heading>Modal Section 2</Heading>
|
|
140
|
+
<BodyText>Section Content 2</BodyText>
|
|
141
|
+
</Section>
|
|
142
|
+
</Scaffold>
|
|
143
|
+
</Body>
|
|
127
144
|
<Footer>
|
|
128
145
|
<Spacer />
|
|
129
146
|
<Button hierarchy="secondary">Cancel</Button>
|
|
@@ -30,7 +30,11 @@ export const Modal = React.forwardRef<HTMLElement, ModalProps>(function Modal(
|
|
|
30
30
|
className={clsx(styles['modal'], 'tcn-surface', 'tcn-modal', className)}
|
|
31
31
|
{...props}
|
|
32
32
|
>
|
|
33
|
-
<Scaffold
|
|
33
|
+
<Scaffold
|
|
34
|
+
className={'tcn-overlay-content tcn-modal-scaffold'}
|
|
35
|
+
width="100%"
|
|
36
|
+
height="100%"
|
|
37
|
+
>
|
|
34
38
|
{children}
|
|
35
39
|
</Scaffold>
|
|
36
40
|
</Frame>
|