@tcn/ui 0.8.0 → 0.9.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 (222) hide show
  1. package/dist/{Color-6BZIO3FS-CWWwv-fq.js → Color-6BZIO3FS-C9xkPWgz.js} +2 -2
  2. package/dist/{Color-6BZIO3FS-CWWwv-fq.js.map → Color-6BZIO3FS-C9xkPWgz.js.map} +1 -1
  3. package/dist/{WithTooltip-65CFNBJE-DvcUZizH.js → WithTooltip-65CFNBJE-DEnh547F.js} +2 -2
  4. package/dist/{WithTooltip-65CFNBJE-DvcUZizH.js.map → WithTooltip-65CFNBJE-DEnh547F.js.map} +1 -1
  5. package/dist/actions/__docs__/components/showcase.js +1 -1
  6. package/dist/actions/index.d.ts +1 -0
  7. package/dist/actions/index.d.ts.map +1 -1
  8. package/dist/actions/index.js +8 -6
  9. package/dist/actions/index.js.map +1 -1
  10. package/dist/body.css +1 -0
  11. package/dist/feedback/progress/progress_bar.js +13 -13
  12. package/dist/form/field/common/field_description.js +7 -8
  13. package/dist/form/field/common/field_description.js.map +1 -1
  14. package/dist/form/field/common/field_error.js +6 -6
  15. package/dist/form/field/common/field_label.js +7 -8
  16. package/dist/form/field/common/field_label.js.map +1 -1
  17. package/dist/form/field_set/field_set.js +7 -7
  18. package/dist/formatter-EIJCOSYU-DWmgEY3b.js +6 -0
  19. package/dist/{formatter-EIJCOSYU-D6nmx63h.js.map → formatter-EIJCOSYU-DWmgEY3b.js.map} +1 -1
  20. package/dist/inputs/color_input/color_input.js +10 -9
  21. package/dist/inputs/color_input/color_input.js.map +1 -1
  22. package/dist/inputs/date_picker/date_picker_date.js +6 -6
  23. package/dist/inputs/date_picker/date_picker_day.js +6 -6
  24. package/dist/inputs/date_picker/date_picker_header.js +7 -6
  25. package/dist/inputs/date_picker/date_picker_header.js.map +1 -1
  26. package/dist/inputs/date_picker/date_picker_input.js +3 -2
  27. package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
  28. package/dist/inputs/date_picker/date_picker_time_selector.js +8 -7
  29. package/dist/inputs/date_picker/date_picker_time_selector.js.map +1 -1
  30. package/dist/inputs/date_picker/date_picker_year_input.js +6 -5
  31. package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
  32. package/dist/inputs/date_picker/date_picker_year_selector.js +8 -7
  33. package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
  34. package/dist/inputs/multiselect/multiselect_inline_values.js +8 -7
  35. package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
  36. package/dist/inputs/multiselect/multiselect_values.js +3 -2
  37. package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
  38. package/dist/inputs/phone_number_input/phone_number_input.js +44 -43
  39. package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
  40. package/dist/inputs/select/select.js +3 -2
  41. package/dist/inputs/select/select.js.map +1 -1
  42. package/dist/inputs/suggestions/suggestion_list.js +9 -8
  43. package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
  44. package/dist/layouts/body/body.d.ts +6 -0
  45. package/dist/layouts/body/body.d.ts.map +1 -0
  46. package/dist/layouts/body/body.js +21 -0
  47. package/dist/layouts/body/body.js.map +1 -0
  48. package/dist/layouts/index.d.ts +7 -0
  49. package/dist/layouts/index.d.ts.map +1 -1
  50. package/dist/layouts/index.js +42 -22
  51. package/dist/layouts/index.js.map +1 -1
  52. package/dist/layouts/rail/main/main.d.ts +6 -0
  53. package/dist/layouts/rail/main/main.d.ts.map +1 -0
  54. package/dist/layouts/rail/main/main.js +21 -0
  55. package/dist/layouts/rail/main/main.js.map +1 -0
  56. package/dist/layouts/rail/rail.d.ts +9 -0
  57. package/dist/layouts/rail/rail.d.ts.map +1 -0
  58. package/dist/layouts/rail/rail.js +55 -0
  59. package/dist/layouts/rail/rail.js.map +1 -0
  60. package/dist/layouts/rail/side/side.d.ts +6 -0
  61. package/dist/layouts/rail/side/side.d.ts.map +1 -0
  62. package/dist/layouts/rail/side/side.js +21 -0
  63. package/dist/layouts/rail/side/side.js.map +1 -0
  64. package/dist/layouts/rail/utility_strip/utility_strip.d.ts +9 -0
  65. package/dist/layouts/rail/utility_strip/utility_strip.d.ts.map +1 -0
  66. package/dist/layouts/rail/utility_strip/utility_strip.js +32 -0
  67. package/dist/layouts/rail/utility_strip/utility_strip.js.map +1 -0
  68. package/dist/layouts/responsive/breakpoint.d.ts +11 -0
  69. package/dist/layouts/responsive/breakpoint.d.ts.map +1 -0
  70. package/dist/layouts/responsive/breakpoint.js +15 -0
  71. package/dist/layouts/responsive/breakpoint.js.map +1 -0
  72. package/dist/layouts/responsive/responsive.d.ts +7 -0
  73. package/dist/layouts/responsive/responsive.d.ts.map +1 -0
  74. package/dist/layouts/responsive/responsive.js +11 -0
  75. package/dist/layouts/responsive/responsive.js.map +1 -0
  76. package/dist/layouts/responsive/responsive_container.d.ts +7 -0
  77. package/dist/layouts/responsive/responsive_container.d.ts.map +1 -0
  78. package/dist/layouts/responsive/responsive_container.js +30 -0
  79. package/dist/layouts/responsive/responsive_container.js.map +1 -0
  80. package/dist/layouts/responsive/responsive_viewport.d.ts +7 -0
  81. package/dist/layouts/responsive/responsive_viewport.d.ts.map +1 -0
  82. package/dist/layouts/responsive/responsive_viewport.js +12 -0
  83. package/dist/layouts/responsive/responsive_viewport.js.map +1 -0
  84. package/dist/layouts/scaffold/scaffold.js +31 -31
  85. package/dist/layouts/scaffold/scaffold.js.map +1 -1
  86. package/dist/layouts/table/table.d.ts +27 -0
  87. package/dist/layouts/table/table.d.ts.map +1 -0
  88. package/dist/layouts/table/table.js +70 -0
  89. package/dist/layouts/table/table.js.map +1 -0
  90. package/dist/main.css +1 -0
  91. package/dist/rail.css +1 -0
  92. package/dist/scaffold.css +1 -1
  93. package/dist/{showcase-DK557szS.js → showcase-y9D3_Y8T.js} +3413 -3396
  94. package/dist/showcase-y9D3_Y8T.js.map +1 -0
  95. package/dist/side.css +1 -0
  96. package/dist/stacks/box/box.d.ts +2 -2
  97. package/dist/stacks/box/box.d.ts.map +1 -1
  98. package/dist/stacks/box/box.js.map +1 -1
  99. package/dist/stacks/story_components/style_box.d.ts +1 -1
  100. package/dist/stacks/story_components/style_box.d.ts.map +1 -1
  101. package/dist/surfaces/alert/alert.js +3 -2
  102. package/dist/surfaces/alert/alert.js.map +1 -1
  103. package/dist/surfaces/confirm/confirm.js +5 -5
  104. package/dist/surfaces/pop_confirm/pop_confirm.js +14 -2
  105. package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
  106. package/dist/{syntaxhighlighter-ED5Y7EFY-DaMS-2cF.js → syntaxhighlighter-ED5Y7EFY-CqInEOwQ.js} +2 -2
  107. package/dist/{syntaxhighlighter-ED5Y7EFY-DaMS-2cF.js.map → syntaxhighlighter-ED5Y7EFY-CqInEOwQ.js.map} +1 -1
  108. package/dist/table.css +1 -0
  109. package/dist/table.module-BtSxOntS.js +5 -0
  110. package/dist/table.module-BtSxOntS.js.map +1 -0
  111. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  112. package/dist/themes/themes/ergo/ergo_theme.js +174 -43
  113. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  114. package/dist/typography/body_text/body_text.d.ts +2 -1
  115. package/dist/typography/body_text/body_text.d.ts.map +1 -1
  116. package/dist/typography/body_text/body_text.js +24 -23
  117. package/dist/typography/body_text/body_text.js.map +1 -1
  118. package/dist/typography/callout/callout.d.ts +2 -1
  119. package/dist/typography/callout/callout.d.ts.map +1 -1
  120. package/dist/typography/callout/callout.js +28 -27
  121. package/dist/typography/callout/callout.js.map +1 -1
  122. package/dist/typography/caption/caption.d.ts +2 -1
  123. package/dist/typography/caption/caption.d.ts.map +1 -1
  124. package/dist/typography/caption/caption.js +18 -17
  125. package/dist/typography/caption/caption.js.map +1 -1
  126. package/dist/typography/footnote/footnote.d.ts +2 -1
  127. package/dist/typography/footnote/footnote.d.ts.map +1 -1
  128. package/dist/typography/footnote/footnote.js +25 -24
  129. package/dist/typography/footnote/footnote.js.map +1 -1
  130. package/dist/typography/headline/headline.d.ts +2 -1
  131. package/dist/typography/headline/headline.d.ts.map +1 -1
  132. package/dist/typography/headline/headline.js +36 -33
  133. package/dist/typography/headline/headline.js.map +1 -1
  134. package/dist/typography/subheadline/subheadline.d.ts +2 -1
  135. package/dist/typography/subheadline/subheadline.d.ts.map +1 -1
  136. package/dist/typography/subheadline/subheadline.js +35 -32
  137. package/dist/typography/subheadline/subheadline.js.map +1 -1
  138. package/dist/utility_strip.css +1 -0
  139. package/dist/utils/dnd/context.d.ts.map +1 -1
  140. package/dist/utils/dnd/context.js +9 -7
  141. package/dist/utils/dnd/context.js.map +1 -1
  142. package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +1 -1
  143. package/dist/utils/dnd/hooks/use_drag_container.js +29 -15
  144. package/dist/utils/dnd/hooks/use_drag_container.js.map +1 -1
  145. package/dist/utils/dnd/types.d.ts +3 -4
  146. package/dist/utils/dnd/types.d.ts.map +1 -1
  147. package/dist/utils/hooks/use_media_query.d.ts +5 -8
  148. package/dist/utils/hooks/use_media_query.d.ts.map +1 -1
  149. package/dist/utils/hooks/use_media_query.js +10 -11
  150. package/dist/utils/hooks/use_media_query.js.map +1 -1
  151. package/dist/utils/index.d.ts +1 -2
  152. package/dist/utils/index.d.ts.map +1 -1
  153. package/dist/utils/index.js +19 -21
  154. package/dist/utils/index.js.map +1 -1
  155. package/package.json +1 -1
  156. package/src/actions/index.ts +1 -0
  157. package/src/layouts/__stories__/composed.stories.tsx +113 -0
  158. package/src/layouts/__stories__/composed_stories.module.css +142 -0
  159. package/src/layouts/__stories__/utils.tsx +174 -0
  160. package/src/layouts/body/body.module.css +11 -0
  161. package/src/layouts/body/body.tsx +23 -0
  162. package/src/layouts/index.ts +12 -0
  163. package/src/layouts/rail/__stories__/rail.stories.tsx +64 -0
  164. package/src/layouts/rail/__stories__/rail_stories.module.css +25 -0
  165. package/src/layouts/rail/main/main.module.css +7 -0
  166. package/src/layouts/rail/main/main.tsx +26 -0
  167. package/src/layouts/rail/rail.module.css +10 -0
  168. package/src/layouts/rail/rail.tsx +62 -0
  169. package/src/layouts/rail/side/side.module.css +8 -0
  170. package/src/layouts/rail/side/side.tsx +25 -0
  171. package/src/layouts/rail/utility_strip/utility_strip.module.css +6 -0
  172. package/src/layouts/rail/utility_strip/utility_strip.tsx +40 -0
  173. package/src/layouts/responsive/breakpoint.tsx +29 -0
  174. package/src/layouts/responsive/responsive.stories.tsx +37 -0
  175. package/src/layouts/responsive/responsive.tsx +18 -0
  176. package/src/layouts/responsive/responsive_container.tsx +51 -0
  177. package/src/layouts/responsive/responsive_viewport.tsx +17 -0
  178. package/src/layouts/scaffold/__stories__/scaffold.stories.tsx +53 -0
  179. package/src/layouts/scaffold/__stories__/scaffold_stories.module.css +31 -0
  180. package/src/layouts/scaffold/scaffold.module.css +4 -0
  181. package/src/layouts/table/__stories__/mock_data.ts +420 -0
  182. package/src/layouts/table/__stories__/table.stories.tsx +326 -0
  183. package/src/layouts/table/__stories__/table_stories.module.css +30 -0
  184. package/src/layouts/table/table.module.css +37 -0
  185. package/src/layouts/table/table.tsx +132 -0
  186. package/src/stacks/box/box.tsx +1 -1
  187. package/src/surfaces/modal/__stories__/modal.stories.tsx +5 -5
  188. package/src/surfaces/panel/__stories__/panel.stories.tsx +114 -1
  189. package/src/surfaces/pop_confirm/pop_confirm.stories.tsx +4 -2
  190. package/src/themes/themes/ergo/ergo_theme.css +173 -42
  191. package/src/typography/body_text/body_text.tsx +21 -17
  192. package/src/typography/callout/callout.tsx +20 -16
  193. package/src/typography/caption/caption.tsx +20 -16
  194. package/src/typography/footnote/footnote.tsx +20 -16
  195. package/src/typography/headline/headline.tsx +60 -54
  196. package/src/typography/subheadline/subheadline.tsx +60 -54
  197. package/src/utils/dnd/__stories__/draggable.stories.tsx +34 -0
  198. package/src/utils/dnd/context.ts +1 -0
  199. package/src/utils/dnd/hooks/use_drag_container.ts +18 -1
  200. package/src/utils/dnd/types.ts +4 -1
  201. package/src/utils/hooks/use_media_query.ts +16 -27
  202. package/src/utils/index.ts +1 -3
  203. package/dist/body_text.module-h4XQE2pC.js +0 -5
  204. package/dist/body_text.module-h4XQE2pC.js.map +0 -1
  205. package/dist/callout.module-D8ECmxpO.js +0 -5
  206. package/dist/callout.module-D8ECmxpO.js.map +0 -1
  207. package/dist/caption.module-DDq0H4xZ.js +0 -5
  208. package/dist/caption.module-DDq0H4xZ.js.map +0 -1
  209. package/dist/footnote.module-DEyFuqOr.js +0 -5
  210. package/dist/footnote.module-DEyFuqOr.js.map +0 -1
  211. package/dist/formatter-EIJCOSYU-D6nmx63h.js +0 -6
  212. package/dist/headline.module-BiwHBtGf.js +0 -5
  213. package/dist/headline.module-BiwHBtGf.js.map +0 -1
  214. package/dist/showcase-DK557szS.js.map +0 -1
  215. package/dist/subheadline.module-C-v7zMkQ.js +0 -5
  216. package/dist/subheadline.module-C-v7zMkQ.js.map +0 -1
  217. package/dist/utils/responsive/responsive_renderer.d.ts +0 -21
  218. package/dist/utils/responsive/responsive_renderer.d.ts.map +0 -1
  219. package/dist/utils/responsive/responsive_renderer.js +0 -12
  220. package/dist/utils/responsive/responsive_renderer.js.map +0 -1
  221. package/src/utils/responsive/responsive_renderer.stories.tsx +0 -77
  222. package/src/utils/responsive/responsive_renderer.tsx +0 -31
@@ -1,6 +1,6 @@
1
1
  import { useRef, useState } from 'react';
2
2
  import { Button } from '../../actions/index.js';
3
- import { Footer, Header, VBody } from '../../layouts/index.js';
3
+ import { Footer, Header, Section, VBody } from '../../layouts/index.js';
4
4
  import { HStack } from '../../stacks/h_stack.js';
5
5
  import { PopConfirm as PopConfirmComponent } from './pop_confirm.js';
6
6
  import { BodyText, Title } from '../../typography/index.js';
@@ -52,7 +52,9 @@ export const DefaultPopConfirm = () => {
52
52
  <Title>Confirmation Title</Title>
53
53
  </Header>
54
54
  <VBody>
55
- <BodyText>Are you sure you want to confirm this action?</BodyText>
55
+ <Section>
56
+ <BodyText>Are you sure you want to confirm this action?</BodyText>
57
+ </Section>
56
58
  </VBody>
57
59
  <Footer>
58
60
  <Spacer />
@@ -1,10 +1,3 @@
1
- @layer tcn-reset {
2
- * {
3
- position: relative;
4
- box-sizing: border-box;
5
- }
6
- }
7
-
8
1
  @layer tcn-theme {
9
2
  /* ===== CSS VARIABLES ===== */
10
3
  :root {
@@ -63,6 +56,13 @@
63
56
  --padding-medium: 8px;
64
57
  --padding-large: 16px;
65
58
 
59
+ /* Sizing */
60
+ --bar-xs: 16px;
61
+ --bar-sm: 24px;
62
+ --bar-md: 32px;
63
+ --bar-lg: 40px;
64
+ --bar-xl: 48px;
65
+
66
66
  /* Status Colors */
67
67
  --status-color-disabled: var(--ergo-grey-light);
68
68
  --status-color-info: var(--ergo-status-blue);
@@ -70,7 +70,7 @@
70
70
  --status-color-positive: var(--ergo-status-green);
71
71
  --status-color-error: var(--ergo-status-red);
72
72
 
73
- --async-color-initial: var(--ergo-grey-main);
73
+ --async-color-initial: var(--ergo-grey);
74
74
  --async-color-pending: var(--ergo-status-blue);
75
75
  --async-color-success: var(--ergo-status-green);
76
76
  --async-color-failed: var(--ergo-status-red);
@@ -193,6 +193,7 @@
193
193
 
194
194
  --btn-pad-delta: 4px;
195
195
  --btn-size-delta: 4px;
196
+ --btn-font-size-delta: 2px;
196
197
  --btn-step: 1;
197
198
 
198
199
  /* Increase size and pad by 4px for each size "step" from medium */
@@ -223,6 +224,7 @@
223
224
  --util-ratio: 0.75;
224
225
  --btn-size-base: 18px;
225
226
 
227
+ font-size: calc(var(--font-size) + var(--btn-font-size-delta) * var(--btn-step));
226
228
  .tcn-icon {
227
229
  min-height: min(2px, calc(var(--btn-size) * var(--util-ratio)));
228
230
  min-width: min(2px, calc(var(--btn-size) * var(--util-ratio)));
@@ -606,19 +608,26 @@
606
608
  }
607
609
 
608
610
  /* Scaffold: */
611
+ .tcn-footer,
612
+ .tcn-header,
613
+ .tcn-utility-bar {
614
+ padding-inline: var(--pad-inline, var(--padding-medium));
615
+ gap: var(--gap-medium);
616
+ }
617
+
618
+ .tcn-utility-bar {
619
+ min-height: var(--bar-md);
620
+ }
621
+
622
+ .tcn-footer,
623
+ .tcn-header {
624
+ min-height: var(--bar-lg);
625
+ }
626
+
609
627
  .tcn-scaffold {
610
- --scaffold-v-inset: var(--v-inset, var(--padding-large));
611
- --scaffold-header-size: var(--header-size, 40px);
612
- --scaffold-footer-size: var(--footer-size, 40px);
613
- --scaffold-utility-bar-size: var(--utility-bar-size, 32px);
614
628
  --scaffold-divide-footer: var(--divide-footer, 1);
615
629
  --scaffold-divide-header: var(--divide-header, 1);
616
-
617
- :where(.tcn-header) {
618
- min-height: var(--scaffold-header-size);
619
- padding: 0 var(--scaffold-v-inset);
620
- gap: var(--gap-medium);
621
- }
630
+ --pad-inline: var(--padding-large);
622
631
 
623
632
  /* Border appears on body only when it follows header or utility-bar */
624
633
  :where(.tcn-header) + :where(.tcn-body),
@@ -633,25 +642,8 @@
633
642
  var(--foreground-color-primary);
634
643
  }
635
644
 
636
- :where(.tcn-utility-bar) {
637
- min-height: var(--scaffold-utility-bar-size);
638
- padding: 0 var(--scaffold-v-inset);
639
- gap: var(--gap-medium);
640
- }
641
-
642
645
  :where(.tcn-body) {
643
- --section-tab-start: var(--scaffold-v-inset);
644
-
645
- gap: var(--gap-medium);
646
- .tcn-section {
647
- --section-tab-start: var(--scaffold-v-inset);
648
- }
649
- }
650
-
651
- :where(.tcn-footer) {
652
646
  gap: var(--gap-medium);
653
- min-height: var(--scaffold-footer-size);
654
- padding: 0 var(--scaffold-v-inset);
655
647
  }
656
648
  }
657
649
 
@@ -712,9 +704,10 @@
712
704
 
713
705
  .tcn-pop-confirm {
714
706
  --divide-header: 0;
715
- --v-inset: var(--padding-medium);
716
707
 
717
708
  :where(.tcn-scaffold) {
709
+ --pad-inline: var(--padding-medium);
710
+
718
711
  box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.4);
719
712
  border-radius: var(--shape-radius-medium);
720
713
  background-color: var(--background-color-primary);
@@ -722,7 +715,7 @@
722
715
  }
723
716
 
724
717
  :where(.tcn-header) {
725
- min-height: 32px;
718
+ min-height: var(--bar-md);
726
719
 
727
720
  --material: var(--ergo-secondary-dark);
728
721
  --on-material: var(--ergo-white);
@@ -750,9 +743,6 @@
750
743
 
751
744
  /* Card */
752
745
  .tcn-card {
753
- --header-size: 32px;
754
- --footer-size: 32px;
755
- --utility-bar-size: 24px;
756
746
  --divide-header: 0;
757
747
 
758
748
  background-color: var(--background-color-primary);
@@ -761,7 +751,7 @@
761
751
  overflow: hidden;
762
752
 
763
753
  :where(.tcn-header) {
764
- min-height: 32px;
754
+ min-height: var(--bar-md);
765
755
 
766
756
  --material: var(--ergo-secondary-light);
767
757
  --on-material: var(--ergo-accent-blue);
@@ -774,13 +764,17 @@
774
764
  color: inherit;
775
765
  }
776
766
  }
767
+
768
+ :where(.tcn-utility-bar) {
769
+ min-height: var(--bar-sm);
770
+ }
777
771
  }
778
772
 
779
773
  /* SECTION */
780
774
  .tcn-section {
781
775
  --max-section-depth: 4;
782
776
  --section-tab-width: 4px;
783
- --section-tab-start: 8px;
777
+ --section-tab-start: var(--pad-inline, var(--padding-medium));
784
778
  --section-tab-depth: 0;
785
779
  --section-tab: calc(
786
780
  var(--section-tab-start) +
@@ -867,4 +861,141 @@
867
861
  border-bottom: var(--caret-triangle-base);
868
862
  }
869
863
  }
864
+
865
+ /* ===== TABLE ===== */
866
+ .tcn-table {
867
+ --table-pad-inline: var(--pad-inline, var(--padding-medium));
868
+
869
+ --material: var(--ergo-white);
870
+ --on-material: var(--ergo-ink-primary);
871
+ --action: var(--ergo-accent-blue);
872
+ --on-action: var(--ergo-white);
873
+ background-color: var(--material);
874
+ color: var(--on-material);
875
+ border-collapse: separate;
876
+ display: block;
877
+ }
878
+
879
+ /* TODO: cleanup - this needs merged with ui-table sticky logic/styles */
880
+ .tcn-table[data-is-sticky="true"] {
881
+ .tcn-tbody {
882
+ th:first-of-type {
883
+ border-right: 1px solid color-mix(in srgb, var(--material) 80%, black);
884
+ }
885
+
886
+ th:last-of-type {
887
+ border-left: 1px solid color-mix(in srgb, var(--material) 80%, black);
888
+ }
889
+ }
890
+ .tcn-thead {
891
+ th:first-of-type {
892
+ border-right: 1px solid color-mix(in srgb, var(--material) 80%, black);
893
+ }
894
+
895
+ th:last-of-type {
896
+ border-left: 1px solid color-mix(in srgb, var(--material) 80%, black);
897
+ }
898
+ }
899
+ }
900
+
901
+ .tcn-td {
902
+ text-align: start;
903
+ overflow: hidden;
904
+ white-space: nowrap;
905
+ text-overflow: ellipsis;
906
+ }
907
+
908
+ .tcn-thead {
909
+ /* Border for header row */
910
+ .tcn-tr {
911
+ height: var(--bar-md);
912
+ .tcn-th {
913
+ border-bottom: 1px solid var(--ergo-grey-light);
914
+ }
915
+ .tcn-th:not(:last-of-type):not(:nth-last-of-type(2)) {
916
+ border-right: 1px solid var(--ergo-grey);
917
+ }
918
+ .tcn-th:last-of-type {
919
+ border-left: 1px solid var(--ergo-grey);
920
+ }
921
+ }
922
+ }
923
+
924
+ .tcn-tfoot {
925
+ font-weight: bold;
926
+ /* Border for footer row */
927
+ .tcn-tr {
928
+ height: var(--bar-sm);
929
+ .tcn-th,
930
+ .tcn-td {
931
+ border-top: 1px solid var(--ergo-grey-light);
932
+ }
933
+ }
934
+ }
935
+
936
+ /* Header and footer - both are light blue */
937
+ .tcn-thead,
938
+ .tcn-tfoot {
939
+ font-size: 14px;
940
+ --material: var(--ergo-secondary-light);
941
+ --on-material: var(--ergo-accent-blue);
942
+ --action: var(--ergo-secondary);
943
+ --on-action: var(--ergo-white);
944
+
945
+ background-color: var(--material);
946
+ color: var(--on-material);
947
+ }
948
+
949
+ .tcn-tr {
950
+ height: var(--bar-sm);
951
+ align-content: center;
952
+ }
953
+
954
+ .tcn-td,
955
+ .tcn-th {
956
+ padding-inline: var(--padding-medium);
957
+ vertical-align: middle;
958
+ text-align: start;
959
+ background: var(--material);
960
+ }
961
+
962
+ /* First column (header, body, footer): use context for pad inline or default 8px */
963
+ .tcn-table .tcn-tr > .tcn-th:first-child,
964
+ .tcn-table .tcn-tr > .tcn-td:first-child {
965
+ padding-inline-start: var(--table-pad-inline);
966
+ }
967
+
968
+ /* Last column (header, body, footer): use context for pad inline or default 8px */
969
+ .tcn-table .tcn-tr > .tcn-th:last-child,
970
+ .tcn-table .tcn-tr > .tcn-td:last-child {
971
+ padding-inline-end: var(--table-pad-inline);
972
+ }
973
+
974
+ .tcn-tbody {
975
+ font-size: 12px;
976
+ .tcn-tr:nth-of-type(even) {
977
+ --material: var(--ergo-accent-blue-light);
978
+ }
979
+ .tcn-tr:nth-of-type(odd) {
980
+ --material: var(--ergo-white);
981
+ }
982
+ .tcn-tr:hover {
983
+ --material: color-mix(in srgb, var(--ergo-accent-blue-light), var(--action) 12%);
984
+ }
985
+ .tcn-tr[data-is-selected="true"] {
986
+ --material: var(--ergo-secondary);
987
+ --on-material: var(--ergo-white);
988
+ --action: var(--ergo-tertiary);
989
+ --on-action: var(--ergo-accent-blue);
990
+ }
991
+
992
+ .tcn-tr {
993
+ --material: var(--bg-row);
994
+ --on-material: var(--ergo-accent-blue);
995
+ --action: var(--ergo-accent-blue);
996
+ --on-action: var(--ergo-white);
997
+ background-color: var(--material);
998
+ color: var(--on-material);
999
+ }
1000
+ }
870
1001
  }
@@ -20,22 +20,25 @@ export interface BodyTextOwnProps {
20
20
 
21
21
  export type BodyTextProps = WithDetailedHTMLProps<BodyTextOwnProps, 'div'>;
22
22
 
23
- export function BodyText({
24
- size = 'md',
25
- emphasis = 'normal',
26
- hierarchy = 'primary',
27
- color,
28
- children,
29
- className,
30
- style = {},
31
- padStart,
32
- padEnd,
33
- padBottom,
34
- padTop,
35
- pad,
36
- selectable = true,
37
- breakWords = false,
38
- }: BodyTextProps) {
23
+ export const BodyText = React.forwardRef<HTMLDivElement, BodyTextProps>(function (
24
+ {
25
+ size = 'md',
26
+ emphasis = 'normal',
27
+ hierarchy = 'primary',
28
+ color,
29
+ children,
30
+ className,
31
+ style = {},
32
+ padStart,
33
+ padEnd,
34
+ padBottom,
35
+ padTop,
36
+ pad,
37
+ selectable = true,
38
+ breakWords = false,
39
+ }: BodyTextProps,
40
+ ref
41
+ ) {
39
42
  if (pad) {
40
43
  style.padding = pad;
41
44
  }
@@ -62,6 +65,7 @@ export function BodyText({
62
65
 
63
66
  return (
64
67
  <div
68
+ ref={ref}
65
69
  data-hierarchy={hierarchy}
66
70
  data-emphasis={emphasis}
67
71
  data-selectable={selectable}
@@ -73,4 +77,4 @@ export function BodyText({
73
77
  {children}
74
78
  </div>
75
79
  );
76
- }
80
+ });
@@ -20,21 +20,24 @@ export interface CalloutOwnProps {
20
20
 
21
21
  export type CalloutProps = WithDetailedHTMLProps<CalloutOwnProps, 'div'>;
22
22
 
23
- export function Callout({
24
- size = 'md',
25
- emphasis = 'normal',
26
- hierarchy = 'primary',
27
- color,
28
- children,
29
- className,
30
- style = {},
31
- padStart,
32
- padEnd,
33
- padBottom,
34
- padTop,
35
- pad,
36
- selectable = true,
37
- }: CalloutProps) {
23
+ export const Callout = React.forwardRef<HTMLDivElement, CalloutProps>(function Callout(
24
+ {
25
+ size = 'md',
26
+ emphasis = 'normal',
27
+ hierarchy = 'primary',
28
+ color,
29
+ children,
30
+ className,
31
+ style = {},
32
+ padStart,
33
+ padEnd,
34
+ padBottom,
35
+ padTop,
36
+ pad,
37
+ selectable = true,
38
+ }: CalloutProps,
39
+ ref
40
+ ) {
38
41
  if (pad) {
39
42
  style.padding = pad;
40
43
  }
@@ -61,6 +64,7 @@ export function Callout({
61
64
 
62
65
  return (
63
66
  <div
67
+ ref={ref}
64
68
  data-hierarchy={hierarchy}
65
69
  data-emphasis={emphasis}
66
70
  data-selectable={selectable}
@@ -71,4 +75,4 @@ export function Callout({
71
75
  {children}
72
76
  </div>
73
77
  );
74
- }
78
+ });
@@ -20,21 +20,24 @@ export interface CaptionOwnProps {
20
20
 
21
21
  export type CaptionProps = WithDetailedHTMLProps<CaptionOwnProps, 'div'>;
22
22
 
23
- export function Caption({
24
- size = 'md',
25
- emphasis = 'normal',
26
- hierarchy = 'primary',
27
- color,
28
- children,
29
- className,
30
- style = {},
31
- padStart,
32
- padEnd,
33
- padBottom,
34
- padTop,
35
- pad,
36
- selectable = true,
37
- }: CaptionProps) {
23
+ export const Caption = React.forwardRef<HTMLDivElement, CaptionProps>(function Caption(
24
+ {
25
+ size = 'md',
26
+ emphasis = 'normal',
27
+ hierarchy = 'primary',
28
+ color,
29
+ children,
30
+ className,
31
+ style = {},
32
+ padStart,
33
+ padEnd,
34
+ padBottom,
35
+ padTop,
36
+ pad,
37
+ selectable = true,
38
+ }: CaptionProps,
39
+ ref
40
+ ) {
38
41
  if (pad) {
39
42
  style.padding = pad;
40
43
  }
@@ -61,6 +64,7 @@ export function Caption({
61
64
 
62
65
  return (
63
66
  <div
67
+ ref={ref}
64
68
  data-hierarchy={hierarchy}
65
69
  data-emphasis={emphasis}
66
70
  data-selectable={selectable}
@@ -71,4 +75,4 @@ export function Caption({
71
75
  {children}
72
76
  </div>
73
77
  );
74
- }
78
+ });
@@ -20,21 +20,24 @@ export interface FootnoteOwnProps {
20
20
 
21
21
  export type FootnoteProps = WithDetailedHTMLProps<FootnoteOwnProps, 'div'>;
22
22
 
23
- export function Footnote({
24
- size = 'md',
25
- emphasis = 'normal',
26
- hierarchy = 'primary',
27
- color,
28
- children,
29
- className,
30
- style = {},
31
- padStart,
32
- padEnd,
33
- padBottom,
34
- padTop,
35
- pad,
36
- selectable = true,
37
- }: FootnoteProps) {
23
+ export const Footnote = React.forwardRef<HTMLDivElement, FootnoteProps>(function Footnote(
24
+ {
25
+ size = 'md',
26
+ emphasis = 'normal',
27
+ hierarchy = 'primary',
28
+ color,
29
+ children,
30
+ className,
31
+ style = {},
32
+ padStart,
33
+ padEnd,
34
+ padBottom,
35
+ padTop,
36
+ pad,
37
+ selectable = true,
38
+ }: FootnoteProps,
39
+ ref
40
+ ) {
38
41
  if (pad) {
39
42
  style.padding = pad;
40
43
  }
@@ -61,6 +64,7 @@ export function Footnote({
61
64
 
62
65
  return (
63
66
  <div
67
+ ref={ref}
64
68
  data-hierarchy={hierarchy}
65
69
  data-emphasis={emphasis}
66
70
  data-selectable={selectable}
@@ -71,4 +75,4 @@ export function Footnote({
71
75
  {children}
72
76
  </div>
73
77
  );
74
- }
78
+ });
@@ -20,65 +20,71 @@ export interface HeadlineOwnProps {
20
20
 
21
21
  export type HeadlineProps = WithDetailedHTMLProps<HeadlineOwnProps, 'h1' | 'h2' | 'h3'>;
22
22
 
23
- export function Headline({
24
- size = 'md',
25
- emphasis = 'normal',
26
- hierarchy = 'primary',
27
- color,
28
- children,
29
- className,
30
- style = {},
31
- padStart,
32
- padEnd,
33
- padBottom,
34
- padTop,
35
- pad,
36
- selectable = true,
37
- }: HeadlineProps) {
38
- let As: React.ElementType;
23
+ export const Headline = React.forwardRef<HTMLHeadingElement, HeadlineProps>(
24
+ function Headline(
25
+ {
26
+ size = 'md',
27
+ emphasis = 'normal',
28
+ hierarchy = 'primary',
29
+ color,
30
+ children,
31
+ className,
32
+ style = {},
33
+ padStart,
34
+ padEnd,
35
+ padBottom,
36
+ padTop,
37
+ pad,
38
+ selectable = true,
39
+ }: HeadlineProps,
40
+ ref
41
+ ) {
42
+ let As: React.ElementType;
39
43
 
40
- if (size === 'lg') {
41
- As = 'h1';
42
- } else if (size === 'md') {
43
- As = 'h2';
44
- } else {
45
- As = 'h3';
46
- }
44
+ if (size === 'lg') {
45
+ As = 'h1';
46
+ } else if (size === 'md') {
47
+ As = 'h2';
48
+ } else {
49
+ As = 'h3';
50
+ }
47
51
 
48
- if (pad) {
49
- style.padding = pad;
50
- }
52
+ if (pad) {
53
+ style.padding = pad;
54
+ }
51
55
 
52
- if (padStart) {
53
- style.paddingInlineStart = padStart;
54
- }
56
+ if (padStart) {
57
+ style.paddingInlineStart = padStart;
58
+ }
55
59
 
56
- if (padEnd) {
57
- style.paddingInlineEnd = padEnd;
58
- }
60
+ if (padEnd) {
61
+ style.paddingInlineEnd = padEnd;
62
+ }
59
63
 
60
- if (padTop) {
61
- style.paddingTop = padTop;
62
- }
64
+ if (padTop) {
65
+ style.paddingTop = padTop;
66
+ }
63
67
 
64
- if (padBottom) {
65
- style.paddingBottom = padBottom;
66
- }
68
+ if (padBottom) {
69
+ style.paddingBottom = padBottom;
70
+ }
67
71
 
68
- if (color) {
69
- style.color = color;
70
- }
72
+ if (color) {
73
+ style.color = color;
74
+ }
71
75
 
72
- return (
73
- <As
74
- data-hierarchy={hierarchy}
75
- data-emphasis={emphasis}
76
- data-selectable={selectable}
77
- className={clsx(styles['headline'], className, 'tcn-headline')}
78
- style={style}
79
- data-size={size}
80
- >
81
- {children}
82
- </As>
83
- );
84
- }
76
+ return (
77
+ <As
78
+ ref={ref}
79
+ data-hierarchy={hierarchy}
80
+ data-emphasis={emphasis}
81
+ data-selectable={selectable}
82
+ className={clsx(styles['headline'], className, 'tcn-headline')}
83
+ style={style}
84
+ data-size={size}
85
+ >
86
+ {children}
87
+ </As>
88
+ );
89
+ }
90
+ );