@tcn/ui 0.14.0 → 0.16.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 (116) hide show
  1. package/dist/column.css +1 -1
  2. package/dist/inputs/multiselect/multiselect_inline_values.js +9 -7
  3. package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
  4. package/dist/inputs/multiselect/multiselect_values.js +4 -2
  5. package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
  6. package/dist/layouts/containers/columns/column.d.ts +6 -0
  7. package/dist/layouts/containers/columns/column.d.ts.map +1 -0
  8. package/dist/layouts/containers/columns/column.js +20 -0
  9. package/dist/layouts/containers/columns/column.js.map +1 -0
  10. package/dist/layouts/containers/columns/columns.d.ts +6 -0
  11. package/dist/layouts/containers/columns/columns.d.ts.map +1 -0
  12. package/dist/layouts/containers/columns/columns.js +11 -0
  13. package/dist/layouts/containers/columns/columns.js.map +1 -0
  14. package/dist/layouts/index.d.ts +3 -5
  15. package/dist/layouts/index.d.ts.map +1 -1
  16. package/dist/layouts/index.js +27 -27
  17. package/dist/layouts/section/detail.d.ts +4 -0
  18. package/dist/layouts/section/detail.d.ts.map +1 -0
  19. package/dist/layouts/section/detail.js +11 -0
  20. package/dist/layouts/section/detail.js.map +1 -0
  21. package/dist/layouts/section/heading.js +1 -1
  22. package/dist/layouts/section/index.d.ts +4 -0
  23. package/dist/layouts/section/index.d.ts.map +1 -0
  24. package/dist/layouts/section/index.js +9 -0
  25. package/dist/layouts/section/index.js.map +1 -0
  26. package/dist/layouts/section/section.js +1 -1
  27. package/dist/section.css +1 -1
  28. package/dist/section.module-BXlxYmJK.js +5 -0
  29. package/dist/section.module-BXlxYmJK.js.map +1 -0
  30. package/dist/surfaces/pop_confirm/pop_confirm.js +4 -4
  31. package/dist/term.css +1 -0
  32. package/dist/themes/build_stylesheet.d.ts +2 -0
  33. package/dist/themes/build_stylesheet.d.ts.map +1 -0
  34. package/dist/themes/build_stylesheet.js +9 -0
  35. package/dist/themes/build_stylesheet.js.map +1 -0
  36. package/dist/themes/theme_variables.d.ts +7 -0
  37. package/dist/themes/theme_variables.d.ts.map +1 -1
  38. package/dist/themes/theme_variables.js +16 -9
  39. package/dist/themes/theme_variables.js.map +1 -1
  40. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  41. package/dist/themes/themes/ergo/ergo_theme.d.ts.map +1 -1
  42. package/dist/themes/themes/ergo/ergo_theme.js +281 -161
  43. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  44. package/dist/themes/themes/ergo/tokens/system_tokens.css +1 -0
  45. package/dist/themes/themes/ergo/tokens/theme_tokens.css +1 -0
  46. package/dist/tokens/index.d.ts +1 -0
  47. package/dist/tokens/index.d.ts.map +1 -1
  48. package/dist/tokens/index.js +4 -2
  49. package/dist/tokens/index.js.map +1 -1
  50. package/dist/tokens/key/key.d.ts +8 -1
  51. package/dist/tokens/key/key.d.ts.map +1 -1
  52. package/dist/tokens/key/key.js +20 -3
  53. package/dist/tokens/key/key.js.map +1 -1
  54. package/dist/tokens/term/term.d.ts +4 -0
  55. package/dist/tokens/term/term.d.ts.map +1 -0
  56. package/dist/tokens/term/term.js +20 -0
  57. package/dist/tokens/term/term.js.map +1 -0
  58. package/dist/tokens/value/value.d.ts +8 -1
  59. package/dist/tokens/value/value.d.ts.map +1 -1
  60. package/dist/tokens/value/value.js +23 -5
  61. package/dist/tokens/value/value.js.map +1 -1
  62. package/dist/utils/types/variations.d.ts +1 -0
  63. package/dist/utils/types/variations.d.ts.map +1 -1
  64. package/dist/value.css +1 -0
  65. package/dist/value.module-DFaCouFD.js +5 -0
  66. package/dist/value.module-DFaCouFD.js.map +1 -0
  67. package/package.json +1 -1
  68. package/src/layouts/__stories__/columns.stories.tsx +46 -0
  69. package/src/layouts/__stories__/rail.stories.tsx +4 -4
  70. package/src/layouts/__stories__/utils.tsx +4 -4
  71. package/src/layouts/containers/columns/column.module.css +14 -0
  72. package/src/layouts/containers/columns/column.tsx +22 -0
  73. package/src/layouts/containers/columns/columns.tsx +16 -0
  74. package/src/layouts/index.ts +3 -5
  75. package/src/layouts/section/__stories__/section.stories.tsx +79 -50
  76. package/src/layouts/section/detail.tsx +14 -0
  77. package/src/layouts/section/index.ts +3 -0
  78. package/src/layouts/section/section.module.css +0 -36
  79. package/src/surfaces/page/page.stories.tsx +32 -28
  80. package/src/surfaces/panel/__stories__/panel.stories.tsx +147 -40
  81. package/src/themes/build_stylesheet.ts +5 -0
  82. package/src/themes/theme_variables.ts +9 -0
  83. package/src/themes/themes/ergo/ergo_theme.css +175 -222
  84. package/src/themes/themes/ergo/ergo_theme.ts +4 -2
  85. package/src/themes/themes/ergo/tokens/system_tokens.css +68 -0
  86. package/src/themes/themes/ergo/tokens/theme_tokens.css +99 -0
  87. package/src/tokens/index.ts +1 -0
  88. package/src/tokens/key/key.tsx +23 -2
  89. package/src/tokens/term/term.module.css +14 -0
  90. package/src/tokens/term/term.stories.tsx +84 -0
  91. package/src/tokens/term/term.tsx +20 -0
  92. package/src/tokens/value/value.module.css +5 -0
  93. package/src/tokens/value/value.tsx +24 -2
  94. package/src/utils/types/variations.ts +1 -0
  95. package/dist/layouts/column/column.d.ts +0 -10
  96. package/dist/layouts/column/column.d.ts.map +0 -1
  97. package/dist/layouts/column/column.js +0 -52
  98. package/dist/layouts/column/column.js.map +0 -1
  99. package/dist/layouts/containers/side/side.d.ts +0 -6
  100. package/dist/layouts/containers/side/side.d.ts.map +0 -1
  101. package/dist/layouts/containers/side/side.js +0 -22
  102. package/dist/layouts/containers/side/side.js.map +0 -1
  103. package/dist/layouts/row/row.d.ts +0 -4
  104. package/dist/layouts/row/row.d.ts.map +0 -1
  105. package/dist/layouts/row/row.js +0 -11
  106. package/dist/layouts/row/row.js.map +0 -1
  107. package/dist/row.css +0 -1
  108. package/dist/section.module-0wyGkhDg.js +0 -5
  109. package/dist/section.module-0wyGkhDg.js.map +0 -1
  110. package/dist/side.css +0 -1
  111. package/src/layouts/column/column.module.css +0 -35
  112. package/src/layouts/column/column.tsx +0 -57
  113. package/src/layouts/containers/side/side.module.css +0 -7
  114. package/src/layouts/containers/side/side.tsx +0 -25
  115. package/src/layouts/row/row.module.css +0 -5
  116. package/src/layouts/row/row.tsx +0 -15
@@ -0,0 +1,14 @@
1
+ @layer tcn-system {
2
+ :where(.column) {
3
+ height: 100%;
4
+ min-height: 100%;
5
+ width: auto;
6
+ min-width: 0;
7
+ flex-grow: 0;
8
+ }
9
+
10
+ :where(.column[data-width="fill"]) {
11
+ flex-grow: 1;
12
+ width: 0; /* let flex-grow determine width, not content */
13
+ }
14
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { VStack, type VStackProps } from '../../../stacks/v_stack.js';
4
+ import styles from './column.module.css';
5
+
6
+ export interface ColumnProps extends Omit<VStackProps, 'as'> {}
7
+
8
+ export const Column = React.forwardRef<HTMLElement, ColumnProps>(function Column(
9
+ { children, className, ...props }: ColumnProps,
10
+ ref
11
+ ) {
12
+ return (
13
+ <VStack
14
+ ref={ref}
15
+ as="section"
16
+ className={clsx('tcn-column', styles['column'], className)}
17
+ {...props}
18
+ >
19
+ {children}
20
+ </VStack>
21
+ );
22
+ });
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { Rail, type RailProps } from '../rail.js';
4
+
5
+ export interface ColumnsProps extends Omit<RailProps, 'as'> {}
6
+
7
+ export const Columns = React.forwardRef<HTMLElement, ColumnsProps>(function Columns(
8
+ { children, className, ...props }: ColumnsProps,
9
+ ref
10
+ ) {
11
+ return (
12
+ <Rail ref={ref} className={clsx('tcn-columns', className)} {...props}>
13
+ {children}
14
+ </Rail>
15
+ );
16
+ });
@@ -1,4 +1,4 @@
1
- export * from './column/column.js';
1
+ export { Column, type ColumnProps } from './containers/columns/column.js';
2
2
  export * from './divider/divider.js';
3
3
  export * from './grid/grid.js';
4
4
  export * from './list/item.js';
@@ -13,16 +13,14 @@ export { Header, type HeaderProps } from './header/header.js';
13
13
  export { UtilityBar, type UtilityBarProps } from './utility_bar/utility_bar.js';
14
14
  export { Group, type GroupProps } from './group/group.js';
15
15
  export { Bar, type BarProps } from './bar/bar.js';
16
- export { Row } from './row/row.js';
17
- export { Section } from './section/section.js';
18
- export { Heading, type HeadingOwnProps } from './section/heading.js';
16
+ export { Section, Heading, Detail, type HeadingOwnProps } from './section/index.js';
19
17
  export { Responsive, type ResponsiveProps } from './responsive/responsive.js';
20
18
  export { Breakpoint, type BreakpointProps } from './responsive/breakpoint.js';
21
19
 
22
20
  export { TTable, THead, TBody, TFoot, TR, TH, TD } from './table/table.js';
23
21
 
24
22
  export { Rail, type RailProps } from './containers/rail.js';
25
- export { Side, type SideProps } from './containers/side/side.js';
23
+ export { Columns, type ColumnsProps } from './containers/columns/columns.js';
26
24
  export {
27
25
  UtilityStrip,
28
26
  type UtilityStripProps,
@@ -1,7 +1,8 @@
1
1
  import { Key } from '../../../tokens/key/key.js';
2
2
  import { Value } from '../../../tokens/value/value.js';
3
- import { Row } from '../../row/row.js';
3
+ import { Term } from '../../../tokens/term/term.js';
4
4
  import { Section } from '../section.js';
5
+ import { Detail } from '../detail.js';
5
6
  import styles from './section.stories.module.css';
6
7
  import { Heading } from '../heading.js';
7
8
 
@@ -17,56 +18,84 @@ export const Default = () => {
17
18
  <div className={styles['stories-container']}>
18
19
  <Section>
19
20
  <Heading>Section 1</Heading>
20
- <Rows />
21
+ <Detail>
22
+ <SBTermGroup />
23
+ </Detail>
21
24
  <Section>
22
25
  <Heading>Subsection 1 - 1</Heading>
23
- <Rows />
26
+ <Detail>
27
+ <SBTermGroup />
28
+ </Detail>
24
29
  <Section>
25
30
  <Heading>Subsection 1 - 1 - 1</Heading>
26
- <Rows />
31
+ <Detail>
32
+ <SBTermGroup />
33
+ </Detail>
27
34
  </Section>
28
35
  <Section>
29
36
  <Heading>Subsection 1 - 1 - 2</Heading>
30
- <Rows />
37
+ <Detail>
38
+ <SBTermGroup />
39
+ </Detail>
31
40
  </Section>
32
41
  <Section>
33
42
  <Heading>Subsection 1 - 1 - 3</Heading>
34
- <Rows />
43
+ <Detail>
44
+ <SBTermGroup />
45
+ </Detail>
35
46
  </Section>
36
47
  </Section>
37
48
  <Section>
38
49
  <Heading>Subsection 1 - 2</Heading>
39
- <Rows />
50
+ <Detail>
51
+ <SBTermGroup />
52
+ </Detail>
40
53
  <Section>
41
54
  <Heading>Subsection 1 - 2 - 1</Heading>
42
- <Rows />
55
+ <Detail>
56
+ <SBTermGroup />
57
+ </Detail>
43
58
  </Section>
44
59
  <Section>
45
60
  <Heading>Subsection 1 - 2 - 2</Heading>
46
- <Rows />
61
+ <Detail>
62
+ <SBTermGroup />
63
+ </Detail>
47
64
  </Section>
48
65
  <Section>
49
66
  <Heading>Subsection 1 - 2 - 3</Heading>
50
- <Rows />
67
+ <Detail>
68
+ <SBTermGroup />
69
+ </Detail>
51
70
  </Section>
52
71
  </Section>
53
72
  <Section>
54
73
  <Heading>Subsection 1 - 3</Heading>
55
- <Rows />
74
+ <Detail>
75
+ <SBTermGroup />
76
+ </Detail>
56
77
  <Section>
57
78
  <Heading>Subsection 1 - 3 - 1</Heading>
58
- <Rows />
79
+ <Detail>
80
+ <SBTermGroup />
81
+ </Detail>
59
82
  </Section>
60
83
  <Section>
61
84
  <Heading>Subsection 1 - 3 - 2</Heading>
62
- <Rows />
85
+ <Detail>
86
+ <SBTermGroup />
87
+ </Detail>
63
88
  </Section>
64
89
  <Section>
65
90
  <Heading>Subsection 1 - 3 - 3</Heading>
66
- <Rows />
91
+ <Detail>
92
+ <SBTermGroup />
93
+ </Detail>
67
94
  <Section>
68
95
  <Heading>Subsection 1 - 3 - 3 - 1</Heading>
69
- <Rows />
96
+ <Detail>
97
+ <SBTermGroup />
98
+ </Detail>
70
99
  </Section>
71
100
  </Section>
72
101
  </Section>
@@ -76,77 +105,77 @@ export const Default = () => {
76
105
  );
77
106
  };
78
107
 
79
- const Rows = () => {
108
+ const SBTermGroup = () => {
80
109
  return (
81
110
  <>
82
- <Row>
111
+ <Term>
83
112
  <Key>Key</Key>
84
113
  <Value>Value</Value>
85
- </Row>
86
- <Row>
114
+ </Term>
115
+ <Term>
87
116
  <Key>Key</Key>
88
117
  <Value>Value</Value>
89
- </Row>
90
- <Row>
118
+ </Term>
119
+ <Term>
91
120
  <Key>Key</Key>
92
121
  <Value>Value</Value>
93
- </Row>
94
- <Row>
122
+ </Term>
123
+ <Term>
95
124
  <Key>Key</Key>
96
125
  <Value>Value</Value>
97
- </Row>
98
- <Row>
126
+ </Term>
127
+ <Term>
99
128
  <Key>Key</Key>
100
129
  <Value>Value</Value>
101
- </Row>
102
- <Row>
130
+ </Term>
131
+ <Term>
103
132
  <Key>Key</Key>
104
133
  <Value>Value</Value>
105
- </Row>
106
- <Row>
134
+ </Term>
135
+ <Term>
107
136
  <Key>Key</Key>
108
137
  <Value>Value</Value>
109
- </Row>
110
- <Row>
138
+ </Term>
139
+ <Term>
111
140
  <Key>Key</Key>
112
141
  <Value>Value</Value>
113
- </Row>
114
- <Row>
142
+ </Term>
143
+ <Term>
115
144
  <Key>Key</Key>
116
145
  <Value>Value</Value>
117
- </Row>
118
- <Row>
146
+ </Term>
147
+ <Term>
119
148
  <Key>Key</Key>
120
149
  <Value>Value</Value>
121
- </Row>
122
- <Row>
150
+ </Term>
151
+ <Term>
123
152
  <Key>Key</Key>
124
153
  <Value>Value</Value>
125
- </Row>
126
- <Row>
154
+ </Term>
155
+ <Term>
127
156
  <Key>Key</Key>
128
157
  <Value>Value</Value>
129
- </Row>
130
- <Row>
158
+ </Term>
159
+ <Term>
131
160
  <Key>Key</Key>
132
161
  <Value>Value</Value>
133
- </Row>
134
- <Row>
162
+ </Term>
163
+ <Term>
135
164
  <Key>Key</Key>
136
165
  <Value>Value</Value>
137
- </Row>
138
- <Row>
166
+ </Term>
167
+ <Term>
139
168
  <Key>Key</Key>
140
169
  <Value>Value</Value>
141
- </Row>
142
- <Row>
170
+ </Term>
171
+ <Term>
143
172
  <Key>Key</Key>
144
173
  <Value>Value</Value>
145
- </Row>
146
- <Row>
174
+ </Term>
175
+ <Term>
147
176
  <Key>Key</Key>
148
177
  <Value>Value</Value>
149
- </Row>
178
+ </Term>
150
179
  </>
151
180
  );
152
181
  };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { VStack, type VStackProps } from '../../stacks/v_stack.js';
4
+
5
+ export const Detail = React.forwardRef<HTMLDivElement, VStackProps>(function Detail(
6
+ { children, className, ...props },
7
+ ref
8
+ ) {
9
+ return (
10
+ <VStack ref={ref} className={clsx(className, 'tcn-detail')} {...props}>
11
+ {children}
12
+ </VStack>
13
+ );
14
+ });
@@ -0,0 +1,3 @@
1
+ export { Section } from './section.js';
2
+ export { Heading, type HeadingOwnProps } from './heading.js';
3
+ export { Detail } from './detail.js';
@@ -2,40 +2,4 @@
2
2
  :where(.section) {
3
3
  position: relative;
4
4
  }
5
-
6
- :where(.heading) {
7
- position: sticky;
8
- height: 23px;
9
- z-index: 4;
10
- padding-inline-end: 8px;
11
- user-select: none;
12
- }
13
-
14
- :where(.section > .heading) {
15
- top: 0;
16
- padding-inline: 8px 8px;
17
- z-index: 3;
18
- }
19
-
20
- :where(.section > .section > .heading) {
21
- top: 30px;
22
- padding-inline: 12px 8px;
23
- z-index: 2;
24
- }
25
-
26
- :where(.section > .section > .section > .heading) {
27
- top: 60px;
28
- padding-inline: 16px 8px;
29
- z-index: 1;
30
- }
31
-
32
- :where(.section > .section > .section > .section > .heading) {
33
- top: 90px;
34
- padding-inline: 20px 8px;
35
- z-index: 0;
36
- }
37
-
38
- .section > :not(.heading, .section) {
39
- padding-inline-end: 8px;
40
- }
41
5
  }
@@ -1,7 +1,8 @@
1
1
  import { Header } from '../../layouts/header/header.js';
2
- import { Footer, Rail, Scaffold } from '../../layouts/index.js';
2
+ import { Detail, Footer, Scaffold } from '../../layouts/index.js';
3
+ import { Column } from '../../layouts/containers/columns/column.js';
4
+ import { Columns } from '../../layouts/containers/columns/columns.js';
3
5
  import { BodyText } from '../../typography/body_text/body_text.js';
4
- import { Section } from '../../layouts/section/section.js';
5
6
  import { Title } from '../../typography/title/title.js';
6
7
  import { Page } from './page.js';
7
8
  import { ZStack } from '../../stacks/z_stack.js';
@@ -21,9 +22,9 @@ export const Baseline = () => {
21
22
  <Title>Page Header</Title>
22
23
  </Header>
23
24
  <Scaffold>
24
- <Section>
25
+ <Detail>
25
26
  <BodyText>Page Content</BodyText>
26
- </Section>
27
+ </Detail>
27
28
  </Scaffold>
28
29
 
29
30
  <Footer>
@@ -34,33 +35,36 @@ export const Baseline = () => {
34
35
  );
35
36
  };
36
37
 
37
- export const WithPanelBody = () => {
38
+ export const WithColumns = () => {
38
39
  return (
39
40
  <ZStack height="100%" width="100%" minHeight="600px" minWidth="600px">
40
41
  <Page>
41
- <Rail>
42
- <Panel>
43
- <Header>
44
- <Title>Primary</Title>
45
- </Header>
46
- <Scaffold>
47
- <Section>
48
- <BodyText>Page Content</BodyText>
49
- </Section>
50
- </Scaffold>
51
- </Panel>
52
-
53
- <Panel width="300px">
54
- <Header>
55
- <Title>Secondary</Title>
56
- </Header>
57
- <Scaffold>
58
- <Section>
59
- <BodyText>Supporting Content</BodyText>
60
- </Section>
61
- </Scaffold>
62
- </Panel>
63
- </Rail>
42
+ <Columns>
43
+ <Column minWidth="400px" width="fill">
44
+ <Panel>
45
+ <Header>
46
+ <Title>Left Panel</Title>
47
+ </Header>
48
+ <Scaffold>
49
+ <Detail>
50
+ <BodyText>Left panel content</BodyText>
51
+ </Detail>
52
+ </Scaffold>
53
+ </Panel>
54
+ </Column>
55
+ <Column minWidth="400px">
56
+ <Panel>
57
+ <Header>
58
+ <Title>Right Panel</Title>
59
+ </Header>
60
+ <Scaffold>
61
+ <Detail>
62
+ <BodyText>Right panel content</BodyText>
63
+ </Detail>
64
+ </Scaffold>
65
+ </Panel>
66
+ </Column>
67
+ </Columns>
64
68
  </Page>
65
69
  </ZStack>
66
70
  );