@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
@@ -2,7 +2,9 @@ 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 { Column } from '../../../layouts/containers/columns/column.js';
6
+ import { Columns } from '../../../layouts/containers/columns/columns.js';
7
+ import { Detail, Heading, Scaffold, Section } from '../../../layouts/index.js';
6
8
  import { UtilityBar } from '../../../layouts/utility_bar/utility_bar.js';
7
9
  import { Box, HStack, Spacer } from '../../../stacks/index.js';
8
10
  import { Title } from '../../../typography/title/title.js';
@@ -19,9 +21,11 @@ import { ChevronsRightIcon } from '@tcn/icons/chevrons_right_icon.js';
19
21
  import { ChevronRightIcon } from '@tcn/icons/chevron_right_icon.js';
20
22
  import { Toggle } from '../../../actions/toggle/toggle.js';
21
23
  import { CrossIcon } from '@tcn/icons/cross_icon.js';
22
- import { BodyText } from '../../../typography/index.js';
23
24
  import { Card } from '../../card/card.js';
24
- import { Row } from '../../../layouts/row/row.js';
25
+ import { Callout } from '../../../typography/index.js';
26
+ import { Term } from '../../../tokens/term/term.js';
27
+ import { Key } from '../../../tokens/key/key.js';
28
+ import { Value } from '../../../tokens/value/value.js';
25
29
 
26
30
  export default {
27
31
  title: 'Surfaces/Panel',
@@ -49,7 +53,9 @@ const SectionMockData: React.FC<{
49
53
  <Spacer />
50
54
  <UtilGroupExample />
51
55
  </Heading>
52
- <Ipsum />
56
+ <Detail>
57
+ <Ipsum />
58
+ </Detail>
53
59
  {children}
54
60
  </Section>
55
61
  );
@@ -204,12 +210,24 @@ export const WithTable = () => {
204
210
  <Scaffold>
205
211
  <Section>
206
212
  <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>
213
+ <Detail>
214
+ <Callout>
215
+ John Doe is a software engineer at FooBaz. He is a very smart guy and he
216
+ loves to code.
217
+ </Callout>
218
+ <Term>
219
+ <Key>Name</Key>
220
+ <Value>John Doe</Value>
221
+ </Term>
222
+ <Term>
223
+ <Key>Age</Key>
224
+ <Value>25</Value>
225
+ </Term>
226
+ <Term>
227
+ <Key>Email</Key>
228
+ <Value>john.doe@example.com</Value>
229
+ </Term>
230
+ </Detail>
213
231
  </Section>
214
232
  </Scaffold>
215
233
  </Panel>
@@ -237,7 +255,7 @@ export const WithCards = () => {
237
255
  <Scaffold>
238
256
  <Section>
239
257
  <Heading>Section with Cards</Heading>
240
- <Row>
258
+ <Detail>
241
259
  <Card>
242
260
  <Header>
243
261
  <Title>Card One</Title>
@@ -246,8 +264,6 @@ export const WithCards = () => {
246
264
  <CardIpsum />
247
265
  </Scaffold>
248
266
  </Card>
249
- </Row>
250
- <Row>
251
267
  <Card>
252
268
  <Header>
253
269
  <Title>Card Two</Title>
@@ -256,11 +272,11 @@ export const WithCards = () => {
256
272
  <CardIpsum />
257
273
  </Scaffold>
258
274
  </Card>
259
- </Row>
275
+ </Detail>
260
276
  </Section>
261
277
  <Section>
262
278
  <Heading>Another Section with a Card</Heading>
263
- <Row>
279
+ <Detail>
264
280
  <Card>
265
281
  <Header>
266
282
  <Title>Card Three</Title>
@@ -269,7 +285,7 @@ export const WithCards = () => {
269
285
  <CardIpsum />
270
286
  </Scaffold>
271
287
  </Card>
272
- </Row>
288
+ </Detail>
273
289
  </Section>
274
290
  </Scaffold>
275
291
  </Panel>
@@ -280,33 +296,124 @@ export const WithCards = () => {
280
296
  <UtilGroupExample />
281
297
  </Header>
282
298
  <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>
299
+ <Detail>
300
+ <Card>
301
+ <Header>
302
+ <Title>Card A</Title>
303
+ </Header>
304
+ <Scaffold>
305
+ <CardIpsum />
306
+ </Scaffold>
307
+ </Card>
308
+ <Card>
309
+ <Header>
310
+ <Title>Card B</Title>
311
+ </Header>
312
+ <Scaffold>
313
+ <CardIpsum />
314
+ </Scaffold>
315
+ </Card>
316
+ <Card>
317
+ <Header>
318
+ <Title>Card C</Title>
319
+ </Header>
320
+ <Scaffold>
321
+ <CardIpsum />
322
+ </Scaffold>
323
+ </Card>
324
+ </Detail>
307
325
  </Scaffold>
308
326
  </Panel>
309
327
  </HStack>
310
328
  </Box>
311
329
  );
312
330
  };
331
+
332
+ export const WithColumns = () => {
333
+ return (
334
+ <Box className={styles['stories-container']}>
335
+ <Panel maxHeight="600px">
336
+ <Header>
337
+ <Title emphasis="strong">Panel With Columns</Title>
338
+ <Spacer />
339
+ <UtilGroupExample />
340
+ </Header>
341
+ <Scaffold>
342
+ <Columns>
343
+ <Column minWidth="300px">
344
+ <Section>
345
+ <Heading>General</Heading>
346
+ <Detail>
347
+ <Term>
348
+ <Key>Agent</Key>
349
+ <Value>John Doe</Value>
350
+ </Term>
351
+ <Term>
352
+ <Key>Queue</Key>
353
+ <Value>Support</Value>
354
+ </Term>
355
+ <Term>
356
+ <Key>Status</Key>
357
+ <Value>Active</Value>
358
+ </Term>
359
+ </Detail>
360
+ </Section>
361
+ </Column>
362
+ <Column minWidth="300px">
363
+ <Section>
364
+ <Heading>Contact</Heading>
365
+ <Detail>
366
+ <Term>
367
+ <Key>Email</Key>
368
+ <Value>john.doe@example.com</Value>
369
+ </Term>
370
+ <Term>
371
+ <Key>Phone</Key>
372
+ <Value>+1 555 000 1234</Value>
373
+ </Term>
374
+ <Term>
375
+ <Key>Start Date</Key>
376
+ <Value>05/27/2023</Value>
377
+ </Term>
378
+ </Detail>
379
+ </Section>
380
+ </Column>
381
+ </Columns>
382
+ </Scaffold>
383
+ <Footer>
384
+ <Spacer />
385
+ <Button hierarchy="secondary">Cancel</Button>
386
+ <Button hierarchy="primary">Save</Button>
387
+ </Footer>
388
+ </Panel>
389
+ </Box>
390
+ );
391
+ };
392
+
393
+ export const WithDetailOnly = () => {
394
+ return (
395
+ <Box className={styles['stories-container']}>
396
+ <Panel maxHeight="400px" width="300px">
397
+ <Header>
398
+ <Title emphasis="strong">Request Details</Title>
399
+ </Header>
400
+ <Scaffold>
401
+ <Detail>
402
+ <Term>
403
+ <Key>Agent</Key>
404
+ <Value>John Doe</Value>
405
+ </Term>
406
+ <Term>
407
+ <Key>Start Date</Key>
408
+ <Value>12:00 05/27/2023</Value>
409
+ </Term>
410
+ <Term>
411
+ <Key>End Date</Key>
412
+ <Value>12:00 05/29/2023</Value>
413
+ </Term>
414
+ </Detail>
415
+ </Scaffold>
416
+ </Panel>
417
+ </Box>
418
+ );
419
+ };
@@ -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
  };