@tcn/ui 0.3.3 → 0.5.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 (131) hide show
  1. package/dist/Color-6BZIO3FS-CWWwv-fq.js +1004 -0
  2. package/dist/Color-6BZIO3FS-CWWwv-fq.js.map +1 -0
  3. package/dist/{WithTooltip-IO6J4KBT-B1oq93K5.js → WithTooltip-65CFNBJE-DvcUZizH.js} +4 -4
  4. package/dist/WithTooltip-65CFNBJE-DvcUZizH.js.map +1 -0
  5. package/dist/actions/__docs__/components/showcase.d.ts.map +1 -1
  6. package/dist/actions/__docs__/components/showcase.js +1 -1
  7. package/dist/actions/button/base_button/base_button.d.ts +2 -4
  8. package/dist/actions/button/base_button/base_button.d.ts.map +1 -1
  9. package/dist/actions/button/base_button/base_button.js +35 -35
  10. package/dist/actions/button/base_button/base_button.js.map +1 -1
  11. package/dist/actions/button/button/button.d.ts +7 -1
  12. package/dist/actions/button/button/button.d.ts.map +1 -1
  13. package/dist/actions/button/button/button.js +9 -7
  14. package/dist/actions/button/button/button.js.map +1 -1
  15. package/dist/actions/button/slim_button/slim_button.d.ts +6 -1
  16. package/dist/actions/button/slim_button/slim_button.d.ts.map +1 -1
  17. package/dist/actions/button/slim_button/slim_button.js +13 -14
  18. package/dist/actions/button/slim_button/slim_button.js.map +1 -1
  19. package/dist/actions/toggle/toggle.d.ts +9 -0
  20. package/dist/actions/toggle/toggle.d.ts.map +1 -0
  21. package/dist/actions/toggle/toggle.js +21 -0
  22. package/dist/actions/toggle/toggle.js.map +1 -0
  23. package/dist/feedback/lazy/lazy.js +3 -3
  24. package/dist/formatter-EIJCOSYU-D6nmx63h.js +6 -0
  25. package/dist/formatter-EIJCOSYU-D6nmx63h.js.map +1 -0
  26. package/dist/inputs/mask_input/mask.d.ts.map +1 -1
  27. package/dist/inputs/mask_input/mask.js.map +1 -1
  28. package/dist/inputs/multiselect/multiselect_inline_values.js +3 -2
  29. package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
  30. package/dist/inputs/multiselect/multiselect_values.js +3 -2
  31. package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
  32. package/dist/layouts/index.d.ts +3 -1
  33. package/dist/layouts/index.d.ts.map +1 -1
  34. package/dist/layouts/index.js +22 -18
  35. package/dist/layouts/index.js.map +1 -1
  36. package/dist/layouts/row/row.d.ts +4 -0
  37. package/dist/layouts/row/row.d.ts.map +1 -0
  38. package/dist/layouts/row/row.js +11 -0
  39. package/dist/layouts/row/row.js.map +1 -0
  40. package/dist/layouts/section/heading.d.ts +7 -0
  41. package/dist/layouts/section/heading.d.ts.map +1 -0
  42. package/dist/layouts/section/heading.js +9 -0
  43. package/dist/layouts/section/heading.js.map +1 -0
  44. package/dist/layouts/section/section.d.ts +4 -0
  45. package/dist/layouts/section/section.d.ts.map +1 -0
  46. package/dist/layouts/section/section.js +22 -0
  47. package/dist/layouts/section/section.js.map +1 -0
  48. package/dist/navigation/tabs/primitives/tabs_list.d.ts.map +1 -1
  49. package/dist/navigation/tabs/primitives/tabs_list.js +17 -24
  50. package/dist/navigation/tabs/primitives/tabs_list.js.map +1 -1
  51. package/dist/overlay/carrot/base_carrot.d.ts +8 -0
  52. package/dist/overlay/carrot/base_carrot.d.ts.map +1 -0
  53. package/dist/overlay/carrot/base_carrot.js +21 -0
  54. package/dist/overlay/carrot/base_carrot.js.map +1 -0
  55. package/dist/row.css +1 -0
  56. package/dist/section.css +1 -0
  57. package/dist/section.module-0wyGkhDg.js +5 -0
  58. package/dist/section.module-0wyGkhDg.js.map +1 -0
  59. package/dist/{showcase-WfP6kBEb.js → showcase-DK557szS.js} +18018 -16269
  60. package/dist/showcase-DK557szS.js.map +1 -0
  61. package/dist/surfaces/pop_confirm/pop_confirm.js +6 -3
  62. package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
  63. package/dist/{syntaxhighlighter-IQDEPFLK-BX_eF8__.js → syntaxhighlighter-ED5Y7EFY-DaMS-2cF.js} +54 -54
  64. package/dist/syntaxhighlighter-ED5Y7EFY-DaMS-2cF.js.map +1 -0
  65. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  66. package/dist/themes/themes/ergo/ergo_theme.js +403 -263
  67. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  68. package/dist/themes/themes/windows_98/windows_98.css +1 -1
  69. package/dist/themes/themes/windows_98/windows_98_theme.js +108 -1
  70. package/dist/themes/themes/windows_98/windows_98_theme.js.map +1 -1
  71. package/dist/tokens/index.d.ts +2 -0
  72. package/dist/tokens/index.d.ts.map +1 -1
  73. package/dist/tokens/index.js +5 -1
  74. package/dist/tokens/index.js.map +1 -1
  75. package/dist/tokens/key/key.d.ts +3 -0
  76. package/dist/tokens/key/key.d.ts.map +1 -0
  77. package/dist/tokens/key/key.js +8 -0
  78. package/dist/tokens/key/key.js.map +1 -0
  79. package/dist/tokens/value/value.d.ts +3 -0
  80. package/dist/tokens/value/value.d.ts.map +1 -0
  81. package/dist/tokens/value/value.js +8 -0
  82. package/dist/tokens/value/value.js.map +1 -0
  83. package/package.json +1 -1
  84. package/src/actions/__docs__/actions.mdx +159 -34
  85. package/src/actions/__docs__/actions.stories.tsx +416 -101
  86. package/src/actions/__docs__/components/showcase.tsx +10 -6
  87. package/src/actions/button/__stories__/button.stories.tsx +10 -0
  88. package/src/actions/button/__stories__/toggle.stories.tsx +177 -0
  89. package/src/actions/button/base_button/base_button.tsx +8 -10
  90. package/src/actions/button/button/button.tsx +11 -2
  91. package/src/actions/button/slim_button/slim_button.tsx +20 -13
  92. package/src/actions/toggle/toggle.tsx +26 -0
  93. package/src/inputs/mask_input/mask.ts +7 -1
  94. package/src/layouts/index.ts +4 -2
  95. package/src/layouts/row/row.module.css +5 -0
  96. package/src/layouts/row/row.tsx +15 -0
  97. package/src/layouts/section/__stories__/section.stories.module.css +6 -0
  98. package/src/layouts/section/__stories__/section.stories.tsx +152 -0
  99. package/src/layouts/section/heading.tsx +16 -0
  100. package/src/layouts/section/section.module.css +41 -0
  101. package/src/layouts/section/section.tsx +21 -0
  102. package/src/navigation/tabs/primitives/tabs_list.tsx +5 -6
  103. package/src/overlay/carrot/base_carrot.tsx +24 -0
  104. package/src/overlay/carrot/carrot.stories.tsx +54 -0
  105. package/src/surfaces/card/card.stories.tsx +14 -14
  106. package/src/surfaces/modal/__stories__/modal.stories.tsx +16 -7
  107. package/src/surfaces/window/window.stories.tsx +16 -10
  108. package/src/themes/themes/ergo/__stories__/components/material_picker/sb_inverted_materials.module.css +4 -4
  109. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_picker.module.css +3 -0
  110. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_picker.tsx +5 -2
  111. package/src/themes/themes/ergo/__stories__/material.stories.tsx +2 -2
  112. package/src/themes/themes/ergo/__stories__/sb_materials.module.css +31 -26
  113. package/src/themes/themes/ergo/ergo_theme.css +400 -260
  114. package/src/themes/themes/windows_98/windows_98.css +108 -1
  115. package/src/tokens/index.ts +2 -0
  116. package/src/tokens/key/key.tsx +10 -0
  117. package/src/tokens/value/value.tsx +10 -0
  118. package/tsconfig.json +6 -0
  119. package/dist/Color-ASIRERSW-B4GaVKuQ.js +0 -990
  120. package/dist/Color-ASIRERSW-B4GaVKuQ.js.map +0 -1
  121. package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js.map +0 -1
  122. package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js +0 -6
  123. package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js.map +0 -1
  124. package/dist/layouts/list/section_header.d.ts +0 -6
  125. package/dist/layouts/list/section_header.d.ts.map +0 -1
  126. package/dist/layouts/list/section_header.js +0 -22
  127. package/dist/layouts/list/section_header.js.map +0 -1
  128. package/dist/showcase-WfP6kBEb.js.map +0 -1
  129. package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js.map +0 -1
  130. package/src/layouts/list/section_header.module.css +0 -20
  131. package/src/layouts/list/section_header.tsx +0 -21
@@ -0,0 +1,24 @@
1
+ import clsx from 'clsx';
2
+ import { Box, type BoxProps } from '../../stacks/box/box.js';
3
+
4
+ export interface BaseCarrotOwnProps {
5
+ direction: 'top' | 'bottom' | 'start' | 'end';
6
+ }
7
+
8
+ export interface BaseCarrotProps extends BaseCarrotOwnProps, BoxProps {}
9
+
10
+ export const BaseCarrot = ({
11
+ direction,
12
+ className,
13
+ as = 'span',
14
+ ...rest
15
+ }: BaseCarrotProps) => {
16
+ return (
17
+ <Box
18
+ as="span"
19
+ data-direction={direction}
20
+ className={clsx('tcn-base-carrot', className)}
21
+ {...rest}
22
+ />
23
+ );
24
+ };
@@ -0,0 +1,54 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ import { Box } from '../../stacks/index.js';
3
+ import { VStack } from '../../stacks/v_stack.js';
4
+ import { BaseCarrot } from './base_carrot.js';
5
+
6
+ export default {
7
+ title: 'Overlays/Carrot',
8
+ component: BaseCarrot,
9
+ tags: ['autodocs'],
10
+ };
11
+
12
+ interface CarrotStoryProps {
13
+ direction: 'top' | 'bottom' | 'start' | 'end';
14
+ }
15
+
16
+ const CarrotStory = ({ direction }: CarrotStoryProps) => {
17
+ return (
18
+ <VStack
19
+ minWidth="100px"
20
+ minHeight="100px"
21
+ height="100%"
22
+ style={{ backgroundColor: 'gray' }}
23
+ >
24
+ <Box width="100px" height="100px" padding="24px" style={{ backgroundColor: 'red' }}>
25
+ <BaseCarrot direction={direction} />
26
+ </Box>
27
+ </VStack>
28
+ );
29
+ };
30
+
31
+ export const Top: StoryObj<CarrotStoryProps> = {
32
+ render: args => <CarrotStory {...args} />,
33
+ args: {
34
+ direction: 'top',
35
+ },
36
+ };
37
+ export const Bottom: StoryObj<CarrotStoryProps> = {
38
+ render: args => <CarrotStory {...args} />,
39
+ args: {
40
+ direction: 'bottom',
41
+ },
42
+ };
43
+ export const Start: StoryObj<CarrotStoryProps> = {
44
+ render: args => <CarrotStory {...args} />,
45
+ args: {
46
+ direction: 'start',
47
+ },
48
+ };
49
+ export const End: StoryObj<CarrotStoryProps> = {
50
+ render: args => <CarrotStory {...args} />,
51
+ args: {
52
+ direction: 'end',
53
+ },
54
+ };
@@ -5,7 +5,7 @@ import { VBody } from '../../layouts/body/v_body.js';
5
5
  import { UtilityBar } from '../../layouts/utility_bar/utility_bar.js';
6
6
  import { Box, Spacer } from '../../stacks/index.js';
7
7
  import { Title } from '../../typography/title/title.js';
8
- import { SlimButton } from '../../actions/index.js';
8
+ import { Button } from '../../actions/index.js';
9
9
  import { Card } from './card.js';
10
10
 
11
11
  // Styles
@@ -24,28 +24,28 @@ export const Default = () => {
24
24
  <Header>
25
25
  <Title>Card Header</Title>
26
26
  <Spacer />
27
- <SlimButton hierarchy="tertiary">
27
+ <Button utility hierarchy="tertiary">
28
28
  <GridOneIcon />
29
- </SlimButton>
30
- <SlimButton hierarchy="tertiary">
29
+ </Button>
30
+ <Button utility hierarchy="secondary">
31
31
  <GridOneIcon />
32
- </SlimButton>
32
+ </Button>
33
+ <Button utility hierarchy="primary">
34
+ <GridOneIcon />
35
+ </Button>
33
36
  </Header>
34
37
  <UtilityBar>
35
38
  <Title>Utility Bar</Title>
36
39
  <Spacer />
37
- <SlimButton hierarchy="tertiary">
38
- <BugIcon />
39
- </SlimButton>
40
- <SlimButton hierarchy="tertiary">
40
+ <Button utility hierarchy="tertiary">
41
41
  <BugIcon />
42
- </SlimButton>
43
- <SlimButton size="md" hierarchy="tertiary">
42
+ </Button>
43
+ <Button utility hierarchy="secondary">
44
44
  <BugIcon />
45
- </SlimButton>
46
- <SlimButton hierarchy="tertiary">
45
+ </Button>
46
+ <Button utility size="md" hierarchy="primary">
47
47
  <BugIcon />
48
- </SlimButton>
48
+ </Button>
49
49
  </UtilityBar>
50
50
 
51
51
  <VBody>
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react';
2
- import { Button, SlimButton } from '../../../actions/index.js';
2
+ import { Button } from '../../../actions/index.js';
3
3
  import { Footer, Header, UtilityBar, VBody } from '../../../layouts/index.js';
4
4
  import { ZStack } from '../../../stacks/z_stack.js';
5
5
  import { BodyText, Title } from '../../../typography/index.js';
@@ -31,19 +31,28 @@ export const ModalStory = () => {
31
31
  <Header>
32
32
  <Title>Modal Title</Title>
33
33
  <Spacer />
34
- <SlimButton hierarchy="tertiary" size="md" onClick={toggle}>
34
+ <Button utility hierarchy="tertiary" size="md" onClick={toggle}>
35
35
  <CrossIcon />
36
- </SlimButton>
36
+ </Button>
37
+ <Button hierarchy="secondary" size="md" onClick={toggle}>
38
+ <CrossIcon />
39
+ </Button>
40
+ <Button utility hierarchy="primary" size="md" onClick={toggle}>
41
+ <CrossIcon />
42
+ </Button>
37
43
  </Header>
38
44
  <UtilityBar>
39
45
  <Title>Utility Bar</Title>
40
46
  <Spacer />
41
- <SlimButton hierarchy="tertiary">
47
+ <Button utility hierarchy="tertiary">
48
+ <BugIcon />
49
+ </Button>
50
+ <Button hierarchy="secondary">
42
51
  <BugIcon />
43
- </SlimButton>
44
- <SlimButton hierarchy="tertiary">
52
+ </Button>
53
+ <Button utility size="md" hierarchy="primary">
45
54
  <BugIcon />
46
- </SlimButton>
55
+ </Button>
47
56
  </UtilityBar>
48
57
  <VBody>
49
58
  <BodyText>This is a modal</BodyText>
@@ -3,7 +3,7 @@ import { Window } from './window.js';
3
3
  import { Footer, Header, UtilityBar, VBody } from '../../layouts/index.js';
4
4
  import { BodyText, Title } from '../../typography/index.js';
5
5
  import { Spacer } from '../../stacks/spacer.js';
6
- import { Button, SlimButton } from '../../actions/index.js';
6
+ import { Button } from '../../actions/index.js';
7
7
  import { CrossIcon } from '@tcn/icons/cross_icon.js';
8
8
  import { ZStack } from '../../stacks/z_stack.js';
9
9
  import { DragHandle } from '../../utils/dnd/handle.js';
@@ -24,29 +24,35 @@ export const WindowStory = () => {
24
24
 
25
25
  return (
26
26
  <ZStack height="100%" width="100%" minHeight="600px">
27
- <button onClick={toggle}>{isOpen ? 'Close' : 'Open'}</button>
27
+ <Button onClick={toggle}>{isOpen ? 'Close' : 'Open'}</Button>
28
28
  <Window isOpen={isOpen} width="400px" height="500px">
29
29
  <DragHandle>
30
30
  <Header>
31
31
  <Title>Window Title</Title>
32
32
  <Spacer />
33
- <SlimButton hierarchy="tertiary" size="md" onClick={toggle}>
33
+ <Button utility hierarchy="tertiary" size="md" onClick={toggle}>
34
34
  <CrossIcon />
35
- </SlimButton>
35
+ </Button>
36
+ <Button utility hierarchy="secondary" size="md" onClick={toggle}>
37
+ <CrossIcon />
38
+ </Button>
39
+ <Button utility hierarchy="primary" size="md" onClick={toggle}>
40
+ <CrossIcon />
41
+ </Button>
36
42
  </Header>
37
43
  </DragHandle>
38
44
  <UtilityBar>
39
45
  <Title>Utility Bar</Title>
40
46
  <Spacer />
41
- <SlimButton hierarchy="tertiary">
47
+ <Button utility hierarchy="tertiary">
42
48
  <BugIcon />
43
- </SlimButton>
44
- <SlimButton hierarchy="tertiary">
49
+ </Button>
50
+ <Button utility hierarchy="secondary">
45
51
  <BugIcon />
46
- </SlimButton>
47
- <SlimButton size="md" hierarchy="tertiary">
52
+ </Button>
53
+ <Button utility size="md" hierarchy="primary">
48
54
  <BugIcon />
49
- </SlimButton>
55
+ </Button>
50
56
  </UtilityBar>
51
57
  <VBody>
52
58
  <BodyText>This is a window</BodyText>
@@ -27,8 +27,8 @@
27
27
  }
28
28
 
29
29
  .surface-custom-inverted {
30
- --action: var(--custom-material);
31
- --on-action: var(--custom-on-material);
32
- --material: var(--navy);
33
- --on-material: var(--white);
30
+ --action: var(--custom-material-value);
31
+ --on-action: var(--custom-on-material-value);
32
+ --material: var(--custom-material-value);
33
+ --on-material: var(--custom-on-material-value);
34
34
  }
@@ -0,0 +1,3 @@
1
+ .heading {
2
+ background-color: color-mix(in srgb, var(--material), white 20%);
3
+ }
@@ -1,11 +1,14 @@
1
1
  import { useState } from 'react';
2
2
  import { BodyText } from '../../../../../../typography/body_text/body_text.js';
3
- import { Item, List, SectionHeader } from '../../../../../../layouts/index.js';
3
+ import { Item, List } from '../../../../../../layouts/index.js';
4
4
  import { HStack } from '../../../../../../stacks/h_stack.js';
5
5
  import type { SB_ToneListItem } from './types.js';
6
6
  import { SB_ToneCard } from './sb_tone_card.js';
7
7
  import { theme } from '../../../../../theme_variables.js';
8
8
  import { VStack } from '../../../../../../stacks/v_stack.js';
9
+ import { Heading } from '../../../../../../layouts/section/heading.js';
10
+
11
+ import styles from './sb_tone_picker.module.css';
9
12
 
10
13
  const items: SB_ToneListItem[] = [
11
14
  {
@@ -60,7 +63,7 @@ export const SB_TonePicker = () => {
60
63
  maxWidth="300px"
61
64
  minWidth="200px"
62
65
  >
63
- <SectionHeader>Tone Picker (WIP)</SectionHeader>
66
+ <Heading className={styles.heading}>Tone Picker (WIP)</Heading>
64
67
  <List padding={theme.padding.md} growWeight={1} height="100%" overflowY="auto">
65
68
  {items.map(item => (
66
69
  <Item
@@ -23,12 +23,12 @@ export default {
23
23
  materialColor: {
24
24
  control: { type: 'color', presetColors: [], disableAlpha: false },
25
25
  label: 'Custom Material Color',
26
- format: 'hsla',
26
+ format: 'rgb',
27
27
  },
28
28
  accentColor: {
29
29
  control: { type: 'color', presetColors: [], disableAlpha: false },
30
30
  label: 'Custom Accent Color',
31
- format: 'hsla',
31
+ format: 'rgb',
32
32
  },
33
33
  },
34
34
  args: {
@@ -1,32 +1,37 @@
1
1
  .storybook-palette {
2
- --background: #f1f1f1;
3
- --primary: 23, 65%, 49%;
4
- --navy: 213, 35.6%, 34.7%;
5
- --white: 0, 0%, 100%;
6
- --tan: 33, 22%, 84%;
7
- --secondary: 197, 34.2%, 55.3%;
8
- --secondary-light: 208 65.2% 95.5%;
9
- --slate: 217, 32.6%, 17.5%;
10
-
11
- --positive: 141, 71%, 48%; /* Green */
12
- --notice: 202, 76%, 50%; /* Blue */
13
- --neutral: 0, 0%, 100%; /* White */
14
- --warning: 48, 100%, 50%; /* Yellow */
15
- --danger: 0, 100%, 50%; /* Red */
2
+ --background: var(--ergo-white);
3
+ --primary: var(--ergo-primary);
4
+ --navy: var(--ergo-accent-blue);
5
+ --white: var(--ergo-white);
6
+ --tan: var(--ergo-tertiary);
7
+ --secondary: var(--ergo-secondary);
8
+ --secondary-light: var(--ergo-secondary-light);
9
+ --slate: #1e293b;
10
+
11
+ --positive: var(--ergo-status-green);
12
+ --notice: var(--ergo-status-blue);
13
+ --neutral: var(--ergo-primary);
14
+ --warning: var(--ergo-status-yellow);
15
+ --danger: var(--ergo-status-red);
16
+
17
+ --custom-action-value: hsl(var(--custom-action));
18
+ --custom-on-action-value: hsl(var(--custom-on-action));
19
+ --custom-material-value: hsl(var(--custom-material));
20
+ --custom-on-material-value: hsl(var(--custom-on-material));
16
21
 
17
22
  background: var(--background);
18
23
 
19
24
  /* This behavior can be moved to ergo theme once dialed and the global will be dropped */
20
25
  :global(.tcn-card) {
21
26
  :global(.tcn-header) {
22
- background: hsl(var(--material));
23
- color: hsl(var(--on-material));
27
+ background: var(--material);
28
+ color: var(--on-material);
24
29
  }
25
30
  }
26
31
 
27
32
  :global(.tcn-surface) {
28
- background: hsl(var(--material));
29
- color: hsl(var(--on-material));
33
+ background: var(--material);
34
+ color: var(--on-material);
30
35
  }
31
36
 
32
37
  :global(.tcn-card[data-tone="positive"]) {
@@ -104,15 +109,15 @@
104
109
  }
105
110
 
106
111
  .surface-custom {
107
- --action: var(--custom-action);
108
- --on-action: var(--custom-on-action);
109
- --material: var(--custom-material);
110
- --on-material: var(--custom-on-material);
112
+ --action: var(--custom-action-value);
113
+ --on-action: var(--custom-on-action-value);
114
+ --material: var(--custom-material-value);
115
+ --on-material: var(--custom-on-material-value);
111
116
  }
112
117
 
113
118
  .surface-custom-inverted {
114
- --action: var(--custom-material);
115
- --on-action: var(--custom-on-material);
116
- --material: var(--navy);
117
- --on-material: var(--white);
119
+ --action: var(--custom-material-value);
120
+ --on-action: var(--custom-on-material-value);
121
+ --material: var(--custom-action-value);
122
+ --on-material: var(--custom-on-action-value);
118
123
  }