@tcn/ui 0.14.0 → 0.15.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 (87) hide show
  1. package/dist/inputs/multiselect/multiselect_inline_values.js +9 -7
  2. package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
  3. package/dist/inputs/multiselect/multiselect_values.js +4 -2
  4. package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
  5. package/dist/layouts/index.d.ts +1 -3
  6. package/dist/layouts/index.d.ts.map +1 -1
  7. package/dist/layouts/index.js +20 -20
  8. package/dist/layouts/section/detail.d.ts +4 -0
  9. package/dist/layouts/section/detail.d.ts.map +1 -0
  10. package/dist/layouts/section/detail.js +11 -0
  11. package/dist/layouts/section/detail.js.map +1 -0
  12. package/dist/layouts/section/heading.js +1 -1
  13. package/dist/layouts/section/index.d.ts +4 -0
  14. package/dist/layouts/section/index.d.ts.map +1 -0
  15. package/dist/layouts/section/index.js +9 -0
  16. package/dist/layouts/section/index.js.map +1 -0
  17. package/dist/layouts/section/section.js +1 -1
  18. package/dist/section.css +1 -1
  19. package/dist/section.module-BXlxYmJK.js +5 -0
  20. package/dist/section.module-BXlxYmJK.js.map +1 -0
  21. package/dist/surfaces/pop_confirm/pop_confirm.js +2 -2
  22. package/dist/term.css +1 -0
  23. package/dist/themes/build_stylesheet.d.ts +2 -0
  24. package/dist/themes/build_stylesheet.d.ts.map +1 -0
  25. package/dist/themes/build_stylesheet.js +9 -0
  26. package/dist/themes/build_stylesheet.js.map +1 -0
  27. package/dist/themes/theme_variables.d.ts +7 -0
  28. package/dist/themes/theme_variables.d.ts.map +1 -1
  29. package/dist/themes/theme_variables.js +16 -9
  30. package/dist/themes/theme_variables.js.map +1 -1
  31. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  32. package/dist/themes/themes/ergo/ergo_theme.d.ts.map +1 -1
  33. package/dist/themes/themes/ergo/ergo_theme.js +254 -152
  34. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  35. package/dist/themes/themes/ergo/tokens/system_tokens.css +1 -0
  36. package/dist/themes/themes/ergo/tokens/theme_tokens.css +1 -0
  37. package/dist/tokens/index.d.ts +1 -0
  38. package/dist/tokens/index.d.ts.map +1 -1
  39. package/dist/tokens/index.js +4 -2
  40. package/dist/tokens/index.js.map +1 -1
  41. package/dist/tokens/key/key.d.ts +8 -1
  42. package/dist/tokens/key/key.d.ts.map +1 -1
  43. package/dist/tokens/key/key.js +20 -3
  44. package/dist/tokens/key/key.js.map +1 -1
  45. package/dist/tokens/term/term.d.ts +4 -0
  46. package/dist/tokens/term/term.d.ts.map +1 -0
  47. package/dist/tokens/term/term.js +20 -0
  48. package/dist/tokens/term/term.js.map +1 -0
  49. package/dist/tokens/value/value.d.ts +8 -1
  50. package/dist/tokens/value/value.d.ts.map +1 -1
  51. package/dist/tokens/value/value.js +23 -5
  52. package/dist/tokens/value/value.js.map +1 -1
  53. package/dist/utils/types/variations.d.ts +1 -0
  54. package/dist/utils/types/variations.d.ts.map +1 -1
  55. package/dist/value.css +1 -0
  56. package/dist/value.module-DFaCouFD.js +5 -0
  57. package/dist/value.module-DFaCouFD.js.map +1 -0
  58. package/package.json +1 -1
  59. package/src/layouts/index.ts +1 -3
  60. package/src/layouts/section/__stories__/section.stories.tsx +79 -50
  61. package/src/layouts/section/detail.tsx +14 -0
  62. package/src/layouts/section/index.ts +3 -0
  63. package/src/layouts/section/section.module.css +0 -36
  64. package/src/surfaces/panel/__stories__/panel.stories.tsx +84 -40
  65. package/src/themes/build_stylesheet.ts +5 -0
  66. package/src/themes/theme_variables.ts +9 -0
  67. package/src/themes/themes/ergo/ergo_theme.css +148 -213
  68. package/src/themes/themes/ergo/ergo_theme.ts +4 -2
  69. package/src/themes/themes/ergo/tokens/system_tokens.css +68 -0
  70. package/src/themes/themes/ergo/tokens/theme_tokens.css +99 -0
  71. package/src/tokens/index.ts +1 -0
  72. package/src/tokens/key/key.tsx +23 -2
  73. package/src/tokens/term/term.module.css +14 -0
  74. package/src/tokens/term/term.stories.tsx +84 -0
  75. package/src/tokens/term/term.tsx +20 -0
  76. package/src/tokens/value/value.module.css +5 -0
  77. package/src/tokens/value/value.tsx +24 -2
  78. package/src/utils/types/variations.ts +1 -0
  79. package/dist/layouts/row/row.d.ts +0 -4
  80. package/dist/layouts/row/row.d.ts.map +0 -1
  81. package/dist/layouts/row/row.js +0 -11
  82. package/dist/layouts/row/row.js.map +0 -1
  83. package/dist/row.css +0 -1
  84. package/dist/section.module-0wyGkhDg.js +0 -5
  85. package/dist/section.module-0wyGkhDg.js.map +0 -1
  86. package/src/layouts/row/row.module.css +0 -5
  87. package/src/layouts/row/row.tsx +0 -15
@@ -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
  }
@@ -2,7 +2,7 @@ import { GridOneIcon } from '@tcn/icons/grid_one_icon.js';
2
2
  import { Button } from '../../../actions/button/button/button.js';
3
3
  import { Footer } from '../../../layouts/footer/footer.js';
4
4
  import { Header } from '../../../layouts/header/header.js';
5
- import { Heading, Scaffold, Section } from '../../../layouts/index.js';
5
+ import { Detail, Heading, Scaffold, Section } 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';
@@ -19,9 +19,11 @@ import { ChevronsRightIcon } from '@tcn/icons/chevrons_right_icon.js';
19
19
  import { ChevronRightIcon } from '@tcn/icons/chevron_right_icon.js';
20
20
  import { Toggle } from '../../../actions/toggle/toggle.js';
21
21
  import { CrossIcon } from '@tcn/icons/cross_icon.js';
22
- import { BodyText } from '../../../typography/index.js';
23
22
  import { Card } from '../../card/card.js';
24
- import { Row } from '../../../layouts/row/row.js';
23
+ import { Callout } from '../../../typography/index.js';
24
+ import { Term } from '../../../tokens/term/term.js';
25
+ import { Key } from '../../../tokens/key/key.js';
26
+ import { Value } from '../../../tokens/value/value.js';
25
27
 
26
28
  export default {
27
29
  title: 'Surfaces/Panel',
@@ -49,7 +51,9 @@ const SectionMockData: React.FC<{
49
51
  <Spacer />
50
52
  <UtilGroupExample />
51
53
  </Heading>
52
- <Ipsum />
54
+ <Detail>
55
+ <Ipsum />
56
+ </Detail>
53
57
  {children}
54
58
  </Section>
55
59
  );
@@ -204,12 +208,24 @@ export const WithTable = () => {
204
208
  <Scaffold>
205
209
  <Section>
206
210
  <Heading>Personal Information</Heading>
207
- <BodyText>
208
- John Doe is a software engineer at FooBaz. He is a very smart guy and he
209
- loves to code.
210
- </BodyText>
211
- <BodyText>Age: 25</BodyText>
212
- <BodyText>Email: john.doe@example.com</BodyText>
211
+ <Detail>
212
+ <Callout>
213
+ John Doe is a software engineer at FooBaz. He is a very smart guy and he
214
+ loves to code.
215
+ </Callout>
216
+ <Term>
217
+ <Key>Name</Key>
218
+ <Value>John Doe</Value>
219
+ </Term>
220
+ <Term>
221
+ <Key>Age</Key>
222
+ <Value>25</Value>
223
+ </Term>
224
+ <Term>
225
+ <Key>Email</Key>
226
+ <Value>john.doe@example.com</Value>
227
+ </Term>
228
+ </Detail>
213
229
  </Section>
214
230
  </Scaffold>
215
231
  </Panel>
@@ -237,7 +253,7 @@ export const WithCards = () => {
237
253
  <Scaffold>
238
254
  <Section>
239
255
  <Heading>Section with Cards</Heading>
240
- <Row>
256
+ <Detail>
241
257
  <Card>
242
258
  <Header>
243
259
  <Title>Card One</Title>
@@ -246,8 +262,6 @@ export const WithCards = () => {
246
262
  <CardIpsum />
247
263
  </Scaffold>
248
264
  </Card>
249
- </Row>
250
- <Row>
251
265
  <Card>
252
266
  <Header>
253
267
  <Title>Card Two</Title>
@@ -256,11 +270,11 @@ export const WithCards = () => {
256
270
  <CardIpsum />
257
271
  </Scaffold>
258
272
  </Card>
259
- </Row>
273
+ </Detail>
260
274
  </Section>
261
275
  <Section>
262
276
  <Heading>Another Section with a Card</Heading>
263
- <Row>
277
+ <Detail>
264
278
  <Card>
265
279
  <Header>
266
280
  <Title>Card Three</Title>
@@ -269,7 +283,7 @@ export const WithCards = () => {
269
283
  <CardIpsum />
270
284
  </Scaffold>
271
285
  </Card>
272
- </Row>
286
+ </Detail>
273
287
  </Section>
274
288
  </Scaffold>
275
289
  </Panel>
@@ -280,33 +294,63 @@ export const WithCards = () => {
280
294
  <UtilGroupExample />
281
295
  </Header>
282
296
  <Scaffold>
283
- <Card>
284
- <Header>
285
- <Title>Card A</Title>
286
- </Header>
287
- <Scaffold>
288
- <CardIpsum />
289
- </Scaffold>
290
- </Card>
291
- <Card>
292
- <Header>
293
- <Title>Card B</Title>
294
- </Header>
295
- <Scaffold>
296
- <CardIpsum />
297
- </Scaffold>
298
- </Card>
299
- <Card>
300
- <Header>
301
- <Title>Card C</Title>
302
- </Header>
303
- <Scaffold>
304
- <CardIpsum />
305
- </Scaffold>
306
- </Card>
297
+ <Detail>
298
+ <Card>
299
+ <Header>
300
+ <Title>Card A</Title>
301
+ </Header>
302
+ <Scaffold>
303
+ <CardIpsum />
304
+ </Scaffold>
305
+ </Card>
306
+ <Card>
307
+ <Header>
308
+ <Title>Card B</Title>
309
+ </Header>
310
+ <Scaffold>
311
+ <CardIpsum />
312
+ </Scaffold>
313
+ </Card>
314
+ <Card>
315
+ <Header>
316
+ <Title>Card C</Title>
317
+ </Header>
318
+ <Scaffold>
319
+ <CardIpsum />
320
+ </Scaffold>
321
+ </Card>
322
+ </Detail>
307
323
  </Scaffold>
308
324
  </Panel>
309
325
  </HStack>
310
326
  </Box>
311
327
  );
312
328
  };
329
+
330
+ export const WithDetailOnly = () => {
331
+ return (
332
+ <Box className={styles['stories-container']}>
333
+ <Panel maxHeight="400px" width="300px">
334
+ <Header>
335
+ <Title emphasis="strong">Request Details</Title>
336
+ </Header>
337
+ <Scaffold>
338
+ <Detail>
339
+ <Term>
340
+ <Key>Agent</Key>
341
+ <Value>John Doe</Value>
342
+ </Term>
343
+ <Term>
344
+ <Key>Start Date</Key>
345
+ <Value>12:00 05/27/2023</Value>
346
+ </Term>
347
+ <Term>
348
+ <Key>End Date</Key>
349
+ <Value>12:00 05/29/2023</Value>
350
+ </Term>
351
+ </Detail>
352
+ </Scaffold>
353
+ </Panel>
354
+ </Box>
355
+ );
356
+ };
@@ -0,0 +1,5 @@
1
+ export function buildStyleSheet(parts: string[]): CSSStyleSheet {
2
+ const sheet = new CSSStyleSheet();
3
+ sheet.replaceSync(parts.join('\n'));
4
+ return sheet;
5
+ }
@@ -24,6 +24,14 @@ const asyncColors = {
24
24
  failed: 'var(--async-color-failed)',
25
25
  };
26
26
 
27
+ const actionSeverity = {
28
+ dangerous: 'var(--action-severity-dangerous)',
29
+ cautious: 'var(--action-severity-cautious)',
30
+ neutral: 'var(--action-severity-neutral)',
31
+ suggested: 'var(--action-severity-suggested)',
32
+ encouraged: 'var(--action-severity-encouraged)',
33
+ };
34
+
27
35
  const colors = {
28
36
  primary: {
29
37
  faint: 'var(--primary-color-faint)',
@@ -78,4 +86,5 @@ export const theme = {
78
86
  accentColor: 'var(--accent-color)',
79
87
  statusColors,
80
88
  asyncColors,
89
+ actionSeverity,
81
90
  };