@tcn/ui 0.6.0 → 0.8.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 (137) hide show
  1. package/dist/draggable.module-BgelQsuJ.js +5 -0
  2. package/dist/draggable.module-BgelQsuJ.js.map +1 -0
  3. package/dist/form/field/field.js +13 -10
  4. package/dist/form/field/field.js.map +1 -1
  5. package/dist/form/field_presenters/field_presenter.d.ts +2 -2
  6. package/dist/form/field_presenters/field_presenter.d.ts.map +1 -1
  7. package/dist/form/field_presenters/field_presenter.js.map +1 -1
  8. package/dist/inputs/color_input/color_picker.js +5 -3
  9. package/dist/inputs/color_input/color_picker.js.map +1 -1
  10. package/dist/inputs/combo_box/combo_box.js +4 -2
  11. package/dist/inputs/combo_box/combo_box.js.map +1 -1
  12. package/dist/inputs/date_picker/date_picker.js +16 -14
  13. package/dist/inputs/date_picker/date_picker.js.map +1 -1
  14. package/dist/inputs/date_picker/date_picker_input.js +10 -8
  15. package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
  16. package/dist/inputs/date_picker/date_picker_year_selector.js +4 -2
  17. package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
  18. package/dist/inputs/mask_input/key_capture_input.js +15 -12
  19. package/dist/inputs/mask_input/key_capture_input.js.map +1 -1
  20. package/dist/inputs/mask_input/mask_input.js +13 -10
  21. package/dist/inputs/mask_input/mask_input.js.map +1 -1
  22. package/dist/inputs/multiselect/multiselect.js +9 -7
  23. package/dist/inputs/multiselect/multiselect.js.map +1 -1
  24. package/dist/inputs/phone_number_input/phone_number_input.d.ts +1 -0
  25. package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
  26. package/dist/inputs/phone_number_input/phone_number_input.js +136 -133
  27. package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
  28. package/dist/inputs/select/select.js +4 -2
  29. package/dist/inputs/select/select.js.map +1 -1
  30. package/dist/inputs/slider/slider.js +7 -5
  31. package/dist/inputs/slider/slider.js.map +1 -1
  32. package/dist/inputs/suggestions/suggestion_list.js +4 -2
  33. package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
  34. package/dist/inputs/switch/switch.js +16 -14
  35. package/dist/inputs/switch/switch.js.map +1 -1
  36. package/dist/inputs/unit_input/unit_input.js +16 -14
  37. package/dist/inputs/unit_input/unit_input.js.map +1 -1
  38. package/dist/navigation/tabs/primitives/tabs_list.d.ts.map +1 -1
  39. package/dist/navigation/tabs/primitives/tabs_list.js +61 -21
  40. package/dist/navigation/tabs/primitives/tabs_list.js.map +1 -1
  41. package/dist/navigation/tabs/state/link/tab_link.d.ts.map +1 -1
  42. package/dist/navigation/tabs/state/link/tab_link.js +25 -19
  43. package/dist/navigation/tabs/state/link/tab_link.js.map +1 -1
  44. package/dist/navigation/tabs/state/link/use_tab_link.js +8 -8
  45. package/dist/navigation/tabs/state/link/use_tab_link.js.map +1 -1
  46. package/dist/navigation/tabs/state/tab.d.ts.map +1 -1
  47. package/dist/navigation/tabs/state/tab.js +8 -3
  48. package/dist/navigation/tabs/state/tab.js.map +1 -1
  49. package/dist/overlay/caret/caret.d.ts +8 -0
  50. package/dist/overlay/caret/caret.d.ts.map +1 -0
  51. package/dist/overlay/caret/caret.js +20 -0
  52. package/dist/overlay/caret/caret.js.map +1 -0
  53. package/dist/overlay/menu/menu.js +34 -32
  54. package/dist/overlay/menu/menu.js.map +1 -1
  55. package/dist/overlay/popper/legacy/popper.js +22 -20
  56. package/dist/overlay/popper/legacy/popper.js.map +1 -1
  57. package/dist/overlay/popper/preview_popper.js +12 -9
  58. package/dist/overlay/popper/preview_popper.js.map +1 -1
  59. package/dist/overlay/tethered/hooks/calculate_origin.d.ts +23 -0
  60. package/dist/overlay/tethered/hooks/calculate_origin.d.ts.map +1 -0
  61. package/dist/overlay/tethered/hooks/calculate_origin.js +41 -0
  62. package/dist/overlay/tethered/hooks/calculate_origin.js.map +1 -0
  63. package/dist/overlay/tethered/hooks/useCaretRefDimensions.d.ts +9 -0
  64. package/dist/overlay/tethered/hooks/useCaretRefDimensions.d.ts.map +1 -0
  65. package/dist/overlay/tethered/hooks/useCaretRefDimensions.js +14 -0
  66. package/dist/overlay/tethered/hooks/useCaretRefDimensions.js.map +1 -0
  67. package/dist/overlay/tethered/hooks/useTether.d.ts +1 -1
  68. package/dist/overlay/tethered/hooks/useTether.d.ts.map +1 -1
  69. package/dist/overlay/tethered/hooks/useTether.js +22 -21
  70. package/dist/overlay/tethered/hooks/useTether.js.map +1 -1
  71. package/dist/overlay/tethered/hooks/useTetherContentRect.d.ts +3 -0
  72. package/dist/overlay/tethered/hooks/useTetherContentRect.d.ts.map +1 -0
  73. package/dist/overlay/tethered/hooks/useTetherContentRect.js +36 -0
  74. package/dist/overlay/tethered/hooks/useTetherContentRect.js.map +1 -0
  75. package/dist/overlay/tethered/hooks/useTetherOrigin.d.ts +14 -0
  76. package/dist/overlay/tethered/hooks/useTetherOrigin.d.ts.map +1 -0
  77. package/dist/overlay/tethered/hooks/useTetherOrigin.js +24 -0
  78. package/dist/overlay/tethered/hooks/useTetherOrigin.js.map +1 -0
  79. package/dist/overlay/tethered/tethered.d.ts +2 -1
  80. package/dist/overlay/tethered/tethered.d.ts.map +1 -1
  81. package/dist/overlay/tethered/tethered.js +71 -38
  82. package/dist/overlay/tethered/tethered.js.map +1 -1
  83. package/dist/stacks/box/box.js +29 -27
  84. package/dist/stacks/box/box.js.map +1 -1
  85. package/dist/stacks/h_collapsible_box.js +14 -12
  86. package/dist/stacks/h_collapsible_box.js.map +1 -1
  87. package/dist/stacks/v_collapsible_box.js +8 -6
  88. package/dist/stacks/v_collapsible_box.js.map +1 -1
  89. package/dist/surfaces/pop_confirm/pop_confirm.d.ts.map +1 -1
  90. package/dist/surfaces/pop_confirm/pop_confirm.js +14 -13
  91. package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
  92. package/dist/surfaces/tooltip/tooltip.d.ts.map +1 -1
  93. package/dist/surfaces/tooltip/tooltip.js +12 -11
  94. package/dist/surfaces/tooltip/tooltip.js.map +1 -1
  95. package/dist/tethered.css +1 -1
  96. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  97. package/dist/themes/themes/ergo/ergo_theme.js +87 -57
  98. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  99. package/dist/themes/themes/windows_98/windows_98.css +1 -1
  100. package/dist/themes/themes/windows_98/windows_98_theme.js +18 -18
  101. package/dist/themes/themes/windows_98/windows_98_theme.js.map +1 -1
  102. package/dist/utils/dnd/draggable/draggable.js +13 -12
  103. package/dist/utils/dnd/draggable/draggable.js.map +1 -1
  104. package/dist/utils/index.d.ts +2 -0
  105. package/dist/utils/index.d.ts.map +1 -1
  106. package/dist/utils/index.js +23 -19
  107. package/dist/utils/index.js.map +1 -1
  108. package/package.json +11 -11
  109. package/src/form/field_presenters/field_presenter.ts +3 -3
  110. package/src/inputs/phone_number_input/phone_number_input.stories.tsx +24 -0
  111. package/src/inputs/phone_number_input/phone_number_input.tsx +8 -6
  112. package/src/navigation/tabs/primitives/tabs_list.tsx +46 -2
  113. package/src/navigation/tabs/state/link/tab_link.tsx +4 -1
  114. package/src/navigation/tabs/state/link/use_tab_link.ts +4 -4
  115. package/src/navigation/tabs/state/tab.tsx +10 -0
  116. package/src/overlay/{carrot/carrot.stories.tsx → caret/caret.stories.tsx} +14 -14
  117. package/src/overlay/caret/caret.tsx +24 -0
  118. package/src/overlay/tethered/__stories__/shared/base_story_config.ts +8 -0
  119. package/src/overlay/tethered/hooks/calculate_origin.ts +74 -0
  120. package/src/overlay/tethered/hooks/useCaretRefDimensions.ts +22 -0
  121. package/src/overlay/tethered/hooks/useTether.ts +4 -3
  122. package/src/overlay/tethered/hooks/useTetherContentRect.ts +49 -0
  123. package/src/overlay/tethered/hooks/useTetherOrigin.ts +49 -0
  124. package/src/overlay/tethered/tethered.module.css +55 -0
  125. package/src/overlay/tethered/tethered.tsx +44 -6
  126. package/src/surfaces/panel/__stories__/panel.stories.tsx +62 -27
  127. package/src/surfaces/panel/__stories__/panel_stories.module.css +14 -1
  128. package/src/surfaces/pop_confirm/pop_confirm.tsx +4 -3
  129. package/src/surfaces/tooltip/tooltip.tsx +1 -0
  130. package/src/themes/themes/ergo/ergo_theme.css +87 -57
  131. package/src/themes/themes/windows_98/windows_98.css +18 -18
  132. package/src/utils/index.ts +3 -0
  133. package/dist/overlay/carrot/base_carrot.d.ts +0 -8
  134. package/dist/overlay/carrot/base_carrot.d.ts.map +0 -1
  135. package/dist/overlay/carrot/base_carrot.js +0 -21
  136. package/dist/overlay/carrot/base_carrot.js.map +0 -1
  137. package/src/overlay/carrot/base_carrot.tsx +0 -24
@@ -0,0 +1,49 @@
1
+ import { useRef } from 'react';
2
+ import type { Position } from '../../../utils/index.js';
3
+ import type { HorizontalTether, VerticalTether } from '../types.js';
4
+ import {
5
+ getOriginDirection,
6
+ getOriginOffset,
7
+ getOriginPosition,
8
+ type CaretDirection,
9
+ } from './calculate_origin.js';
10
+ import { useTetherContentRect } from './useTetherContentRect.js';
11
+
12
+ export interface UseTetherOriginResult {
13
+ originPosition: Position;
14
+ originOffset: { yOffset: number; xOffset: number };
15
+ containerRef: React.RefObject<HTMLDivElement>;
16
+ originDirection: CaretDirection;
17
+ }
18
+
19
+ export function useTetherOrigin(
20
+ tetherPosition: Position,
21
+ hOrigin: HorizontalTether,
22
+ vOrigin: VerticalTether,
23
+ precision: 'high' | 'low'
24
+ ): UseTetherOriginResult {
25
+ const containerRef = useRef<HTMLDivElement>(null);
26
+ const containerRect = useTetherContentRect(containerRef);
27
+
28
+ // If precision is low, return default values
29
+ if (precision === 'low') {
30
+ return {
31
+ originPosition: tetherPosition,
32
+ originOffset: { yOffset: 0, xOffset: 0 },
33
+ containerRef,
34
+ originDirection: 'none',
35
+ };
36
+ }
37
+
38
+ // Calculate origin values for high precision
39
+ const originOffset = getOriginOffset(containerRect, hOrigin, vOrigin);
40
+ const originPosition = getOriginPosition(containerRect.position, originOffset);
41
+ const originDirection = getOriginDirection(vOrigin, hOrigin);
42
+
43
+ return {
44
+ originPosition,
45
+ originOffset,
46
+ containerRef,
47
+ originDirection,
48
+ };
49
+ }
@@ -1,4 +1,8 @@
1
1
  @layer tcn-system {
2
+ :where(.origin-indicator) {
3
+ z-index: 2;
4
+ }
5
+
2
6
  :where(.tethered) {
3
7
  display: inline-block;
4
8
  position: absolute;
@@ -6,5 +10,56 @@
6
10
  height: auto;
7
11
  left: var(--tethered-left, 0);
8
12
  top: var(--tethered-top, 0);
13
+
14
+ .origin-indicator {
15
+ position: absolute;
16
+ display: inline-block;
17
+ left: var(--tethered-origin-delta-x, 0);
18
+ top: var(--tethered-origin-delta-y, 0);
19
+ --caret-tx: 0%;
20
+ --caret-ty: 0%;
21
+ transform: translateX(var(--caret-tx)) translateY(var(--caret-ty));
22
+ }
23
+
24
+ &[data-anchor-direction="top"] {
25
+ .origin-indicator {
26
+ --caret-tx: -50%;
27
+ --caret-ty: -100%;
28
+ }
29
+ }
30
+
31
+ &[data-anchor-direction="bottom"] {
32
+ .origin-indicator {
33
+ --caret-tx: -50%;
34
+ --caret-ty: -100%;
35
+ }
36
+ }
37
+
38
+ &[data-anchor-direction="start"] {
39
+ .origin-indicator {
40
+ --caret-tx: -100%;
41
+ --caret-ty: -50%;
42
+ }
43
+ }
44
+
45
+ &[data-anchor-direction="end"] {
46
+ .origin-indicator {
47
+ --caret-tx: -100%;
48
+ --caret-ty: -50%;
49
+ }
50
+ }
51
+
52
+ &[data-anchor-direction="bottom"] {
53
+ padding-bottom: var(--origin-indicator-dimensions-height);
54
+ }
55
+ &[data-anchor-direction="top"] {
56
+ padding-top: var(--origin-indicator-dimensions-height);
57
+ }
58
+ &[data-anchor-direction="start"] {
59
+ padding-left: var(--origin-indicator-dimensions-width);
60
+ }
61
+ &[data-anchor-direction="end"] {
62
+ padding-right: var(--origin-indicator-dimensions-width);
63
+ }
9
64
  }
10
65
  }
@@ -1,10 +1,13 @@
1
+ import { clsx } from 'clsx';
1
2
  import { forwardRef, type PropsWithChildren } from 'react';
2
- import type { HorizontalTether, VerticalTether } from './types.js';
3
3
  import { ZStack, type ZStackProps } from '../../stacks/index.js';
4
4
  import { useForkRef, type Rectangle } from '../../utils/index.js';
5
- import { useTether } from './hooks/useTether.js';
6
- import { clsx } from 'clsx';
5
+ import { Caret } from '../caret/caret.js';
7
6
  import { Portal } from '../portal/portal.js';
7
+ import { useCaretRefDimensions } from './hooks/useCaretRefDimensions.js';
8
+ import { useTether } from './hooks/useTether.js';
9
+ import { useTetherOrigin } from './hooks/useTetherOrigin.js';
10
+ import type { HorizontalTether, VerticalTether } from './types.js';
8
11
 
9
12
  // Styles
10
13
  import styles from './tethered.module.css';
@@ -20,6 +23,7 @@ export interface BaseTetheredOwnProps {
20
23
 
21
24
  export interface TetheredOwnProp extends BaseTetheredOwnProps {
22
25
  anchor: Rectangle | null;
26
+ precision?: 'high' | 'low';
23
27
  }
24
28
  export interface TetheredProps extends TetheredOwnProp, ZStackProps {}
25
29
 
@@ -33,6 +37,7 @@ export const Tethered = forwardRef<HTMLElement, PropsWithChildren<TetheredProps>
33
37
  horizontalOrigin = 'start',
34
38
  verticalOffset = 0,
35
39
  horizontalOffset = 0,
40
+ precision = 'low',
36
41
  children,
37
42
  style,
38
43
  className,
@@ -49,22 +54,55 @@ export const Tethered = forwardRef<HTMLElement, PropsWithChildren<TetheredProps>
49
54
  verticalOffset,
50
55
  horizontalOffset,
51
56
  });
52
- const forkedRef = useForkRef(ref, tetherRef);
57
+
58
+ // Convert position from { top, left } to Position type { x, y }
59
+ const tetherPosition = { x: position.left, y: position.top };
60
+
61
+ const { originPosition, originOffset, containerRef, originDirection } =
62
+ useTetherOrigin(tetherPosition, horizontalOrigin, verticalOrigin, precision);
63
+
64
+ const { caretElementRef: setCaretElement, caretSize } = useCaretRefDimensions(
65
+ precision,
66
+ originDirection
67
+ );
68
+
69
+ const forkedRef = useForkRef(ref, tetherRef, containerRef);
53
70
 
54
71
  const cssVariables = {
55
72
  '--tethered-top': `${position.top}px`,
56
73
  '--tethered-left': `${position.left}px`,
74
+ '--tethered-origin-y': `${originPosition.y}px`,
75
+ '--tethered-origin-x': `${originPosition.x}px`,
76
+ '--tethered-origin-delta-y': `${originOffset.yOffset}px`,
77
+ '--tethered-origin-delta-x': `${originOffset.xOffset}px`,
78
+ '--origin-indicator-dimensions-width': `${caretSize.width}px`,
79
+ '--origin-indicator-dimensions-height': `${caretSize.height}px`,
57
80
  };
58
81
 
59
82
  return (
60
83
  <Portal>
61
84
  <ZStack
62
85
  ref={forkedRef}
63
- className={clsx(styles.tethered, className)}
64
- style={{ position: 'absolute', ...cssVariables, ...style }}
86
+ className={clsx(styles.tethered, 'tcn-tethered', className)}
87
+ style={{ ...cssVariables, ...style }}
88
+ data-v-anchor={verticalAnchor}
89
+ data-h-anchor={horizontalAnchor}
90
+ data-v-origin={verticalOrigin}
91
+ data-h-origin={horizontalOrigin}
92
+ data-anchor-direction={originDirection}
65
93
  {...rest}
66
94
  >
67
95
  {children}
96
+ {precision === 'high' && originDirection !== 'none' && (
97
+ <Caret
98
+ ref={setCaretElement}
99
+ direction={originDirection}
100
+ className={clsx(
101
+ styles['origin-indicator'],
102
+ 'tcn-tethered-origin-indicator'
103
+ )}
104
+ />
105
+ )}
68
106
  </ZStack>
69
107
  </Portal>
70
108
  );
@@ -1,17 +1,14 @@
1
- import { BugIcon } from '@tcn/icons/bug_icon.js';
2
- import { CrossIcon } from '@tcn/icons/cross_icon.js';
3
1
  import { GridOneIcon } from '@tcn/icons/grid_one_icon.js';
4
2
  import { Button } from '../../../actions/button/button/button.js';
5
3
  import { Footer } from '../../../layouts/footer/footer.js';
6
4
  import { Header } from '../../../layouts/header/header.js';
7
- import { Divider, VBody } from '../../../layouts/index.js';
5
+ import { Heading, Section, VBody } from '../../../layouts/index.js';
8
6
  import { UtilityBar } from '../../../layouts/utility_bar/utility_bar.js';
9
7
  import { Box, Spacer } from '../../../stacks/index.js';
10
8
  import { Title } from '../../../typography/title/title.js';
11
9
  import { VPanel } from '../v_panel.js';
12
10
  // Styles
13
11
  import styles from './panel_stories.module.css';
14
- import { SlimButton } from '../../../actions/index.js';
15
12
 
16
13
  export default {
17
14
  title: 'Surfaces/Panel',
@@ -19,6 +16,48 @@ export default {
19
16
  tags: ['autodocs'],
20
17
  };
21
18
 
19
+ const Ipsum = () => {
20
+ return (
21
+ <Box className={styles['content-container']}>
22
+ <Box className={styles['content']} />
23
+ </Box>
24
+ );
25
+ };
26
+
27
+ const SectionMockData: React.FC<{
28
+ depth: number;
29
+ count: number;
30
+ children?: React.ReactNode;
31
+ }> = ({ depth = 0, count = 0, children }) => {
32
+ return (
33
+ <Section>
34
+ <Heading>
35
+ Section: {depth} - {count}
36
+ <Spacer />
37
+ <UtilGroupExample />
38
+ </Heading>
39
+ <Ipsum />
40
+ {children}
41
+ </Section>
42
+ );
43
+ };
44
+
45
+ const UtilGroupExample = () => {
46
+ return (
47
+ <>
48
+ <Button utility hierarchy="tertiary">
49
+ <GridOneIcon />
50
+ </Button>
51
+ <Button utility hierarchy="secondary">
52
+ <GridOneIcon />
53
+ </Button>
54
+ <Button utility hierarchy="primary">
55
+ <GridOneIcon />
56
+ </Button>
57
+ </>
58
+ );
59
+ };
60
+
22
61
  export const Default = () => {
23
62
  return (
24
63
  <div className={styles['stories-container']}>
@@ -26,36 +65,32 @@ export const Default = () => {
26
65
  <Header>
27
66
  <Title emphasis="strong">Panel Primary Header</Title>
28
67
  <Spacer />
29
- <SlimButton hierarchy="tertiary">
30
- <GridOneIcon />
31
- </SlimButton>
32
- <Divider length="md" vertical />
33
- <SlimButton hierarchy="tertiary">
34
- <CrossIcon />
35
- </SlimButton>
68
+ <UtilGroupExample />
36
69
  </Header>
37
70
  <UtilityBar>
38
71
  <Title>Utility Bar</Title>
39
72
  <Spacer />
40
- <SlimButton hierarchy="tertiary">
41
- <BugIcon />
42
- </SlimButton>
43
- <SlimButton hierarchy="tertiary">
44
- <BugIcon />
45
- </SlimButton>
46
- <SlimButton size="md" hierarchy="tertiary">
47
- <BugIcon />
48
- </SlimButton>
49
- <SlimButton hierarchy="tertiary">
50
- <BugIcon />
51
- </SlimButton>
73
+ <UtilGroupExample />
52
74
  </UtilityBar>
53
75
 
54
76
  <VBody>
55
- <Box className={styles['content-box']} />
56
- <Box className={styles['content-box']} />
57
- <Box className={styles['content-box']} />
58
- <Box className={styles['content-box']} />
77
+ <SectionMockData depth={1} count={1}>
78
+ <SectionMockData depth={2} count={1}>
79
+ <SectionMockData depth={3} count={1}>
80
+ <SectionMockData depth={4} count={1} />
81
+ </SectionMockData>
82
+ </SectionMockData>
83
+ </SectionMockData>
84
+ <SectionMockData depth={1} count={2}>
85
+ <SectionMockData depth={2} count={1}>
86
+ <SectionMockData depth={3} count={1}>
87
+ <SectionMockData depth={4} count={1} />
88
+ </SectionMockData>
89
+ </SectionMockData>
90
+ </SectionMockData>
91
+ <Ipsum />
92
+ <Ipsum />
93
+ <Ipsum />
59
94
  </VBody>
60
95
  <Footer>
61
96
  <Title>Footer</Title>
@@ -1,9 +1,22 @@
1
- .content-box {
1
+ .content-container {
2
2
  background: rgba(0, 128, 0, 0.5);
3
+ width: 100%;
4
+ height: auto;
5
+ min-height: auto;
6
+ }
7
+
8
+ .content {
9
+ background: rgba(0, 128, 0, 0.8);
3
10
  min-height: 200px;
4
11
  width: 100%;
5
12
  }
6
13
 
14
+ .content-2 {
15
+ background: rgba(185, 1, 142, 0.8);
16
+ min-height: 100px;
17
+ width: 100%;
18
+ }
19
+
7
20
  .stories-container {
8
21
  width: 100%;
9
22
  height: 100%;
@@ -1,11 +1,11 @@
1
- import React from 'react';
2
1
  import { clsx } from 'clsx';
2
+ import React from 'react';
3
+ import { Scaffold } from '../../layouts/index.js';
4
+ import { PopperDismissal } from '../../overlay/popper/base/dismissal_decorator.js';
3
5
  import {
4
6
  ElementPopper,
5
7
  type ElementPopperProps,
6
8
  } from '../../overlay/popper/element_popper.js';
7
- import { Scaffold } from '../../layouts/index.js';
8
- import { PopperDismissal } from '../../overlay/popper/base/dismissal_decorator.js';
9
9
 
10
10
  export type PopConfirmProps = ElementPopperProps;
11
11
 
@@ -17,6 +17,7 @@ export const PopConfirm = React.forwardRef<HTMLDivElement, PopConfirmProps>(
17
17
  return (
18
18
  <ElementPopper
19
19
  ref={ref}
20
+ precision="high"
20
21
  className={clsx(className, 'tcn-pop-confirm')}
21
22
  dismissals={dismissals}
22
23
  {...props}
@@ -49,6 +49,7 @@ export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(function T
49
49
  verticalOrigin={verticalOrigin}
50
50
  horizontalAnchor={horizontalAnchor}
51
51
  horizontalOrigin={horizontalOrigin}
52
+ precision="high"
52
53
  className={clsx(className, styles.tooltip, 'tcn-surface', 'tcn-tooltip')}
53
54
  {...props}
54
55
  >
@@ -14,12 +14,17 @@
14
14
  --ergo-secondary-light: #ecf4fb;
15
15
  --ergo-secondary-dark: #497485;
16
16
  --ergo-tertiary: #dfd7cd;
17
+ --ergo-tertiary-light: #f9f4ed;
18
+ --ergo-tertiary-dark: #7e6c5d;
17
19
  --ergo-white: #ffffff;
18
20
 
19
21
  --ergo-accent-blue: #395578;
22
+ --ergo-accent-blue-light: #f3f4f6;
20
23
  --ergo-accent-green: #97bba3;
24
+ --ergo-accent-green-light: #eef8ef;
25
+ --ergo-accent-green-dark: #4f785c;
21
26
  --ergo-accent-yellow: #dbc97e;
22
- --ergo-accent-green: #97bba3;
27
+ --ergo-accent-yellow-light: #fef9e7;
23
28
 
24
29
  --ergo-grey: #aaaaaa;
25
30
  --ergo-grey-light: #d3d3d3;
@@ -298,6 +303,24 @@
298
303
  &[data-hover] {
299
304
  transform: translateY(-1px);
300
305
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.12);
306
+
307
+ /* Increases the clickable area by 2px on hover to avoid click events not firing due to the button transform y - or slight mouse wiggles */
308
+ &::before,
309
+ &::after {
310
+ content: "";
311
+ position: absolute;
312
+ left: 0;
313
+ right: 0;
314
+ height: 4px;
315
+ }
316
+
317
+ &::before {
318
+ top: -2px;
319
+ }
320
+
321
+ &::after {
322
+ bottom: -2px;
323
+ }
301
324
  }
302
325
 
303
326
  &:active,
@@ -476,8 +499,12 @@
476
499
  --act: var(--ergo-primary);
477
500
  }
478
501
 
502
+ .tcn-tab-item:focus-visible {
503
+ z-index: 2;
504
+ }
479
505
  /* Hover Indicator */
480
- .tcn-tab-item[data-is-selected="false"]:hover::after {
506
+ .tcn-tab-item[data-is-selected="false"]:hover::after,
507
+ .tcn-tab-item[data-is-selected="false"]:focus-visible::after {
481
508
  content: "";
482
509
  display: block;
483
510
  position: absolute;
@@ -613,8 +640,12 @@
613
640
  }
614
641
 
615
642
  :where(.tcn-body) {
616
- padding: 0 var(--scaffold-v-inset);
643
+ --section-tab-start: var(--scaffold-v-inset);
644
+
617
645
  gap: var(--gap-medium);
646
+ .tcn-section {
647
+ --section-tab-start: var(--scaffold-v-inset);
648
+ }
618
649
  }
619
650
 
620
651
  :where(.tcn-footer) {
@@ -746,6 +777,20 @@
746
777
  }
747
778
 
748
779
  /* SECTION */
780
+ .tcn-section {
781
+ --max-section-depth: 4;
782
+ --section-tab-width: 4px;
783
+ --section-tab-start: 8px;
784
+ --section-tab-depth: 0;
785
+ --section-tab: calc(
786
+ var(--section-tab-start) +
787
+ (var(--section-tab-width) * var(--section-tab-depth))
788
+ );
789
+ --section-action: var(--ergo-secondary);
790
+ --section-mat: var(--ergo-secondary-light);
791
+ --section-on-mat: var(--ergo-ink-primary);
792
+ }
793
+
749
794
  .tcn-heading {
750
795
  background-color: #f1f1f1;
751
796
  padding-inline-start: 8px;
@@ -754,59 +799,44 @@
754
799
  }
755
800
 
756
801
  .tcn-section > .tcn-heading {
757
- background-color: #f2f4f6;
758
- padding-inline-start: 8px;
759
- color: rgb(51, 51, 51);
760
- z-index: 4;
761
- }
762
-
763
- .tcn-section > .tcn-section > .tcn-heading {
764
- background-color: #fff7f0;
765
- padding-inline-start: 12px;
766
- color: #395578;
767
- z-index: 3;
768
- }
769
-
770
- .tcn-section > .tcn-section > .tcn-section > .tcn-heading {
771
- background-color: #eef8ef;
772
- padding-inline-start: 16px;
773
- color: #395578;
774
- z-index: 2;
775
- }
776
-
777
- .tcn-section > .tcn-section > .tcn-section > .tcn-section .tcn-heading {
778
- background-color: #ecf4fb;
779
- padding-inline-start: 20px;
780
- color: #395578;
781
- z-index: 1;
802
+ z-index: calc(var(--max-section-depth) - var(--section-tab-depth));
803
+ padding-inline-start: var(--section-tab);
804
+ --material: var(--section-mat);
805
+ --on-material: var(--section-on-mat);
806
+ --action: var(--section-action);
807
+ background-color: var(--material);
808
+ color: var(--on-material);
809
+ gap: var(--gap-small);
782
810
  }
783
811
 
784
812
  .tcn-section > :not(.tcn-heading, .tcn-section) {
785
- padding-inline-start: 8px;
813
+ padding-inline-start: var(--section-tab);
786
814
  }
787
815
 
788
- .tcn-section > .tcn-section > :not(.tcn-heading, .tcn-section) {
789
- padding-inline-start: 12px;
816
+ .tcn-section > .tcn-section {
817
+ --section-tab-depth: 1;
818
+ --section-mat: var(--ergo-accent-blue-light);
819
+ --section-action: var(--ergo-accent-blue);
790
820
  }
791
821
 
792
- .tcn-section > .tcn-section > .tcn-section > :not(.tcn-heading, .tcn-section) {
793
- padding-inline-start: 16px;
822
+ .tcn-section > .tcn-section > .tcn-section {
823
+ --section-tab-depth: 2;
824
+ --section-mat: var(--ergo-accent-green-light);
825
+ --section-action: var(--ergo-accent-green-dark);
794
826
  }
795
827
 
796
- .tcn-section
797
- > .tcn-section
798
- > .tcn-section
799
- > .tcn-section
800
- > :not(.tcn-heading, .tcn-section) {
801
- padding-inline-start: 20px;
828
+ .tcn-section > .tcn-section > .tcn-section > .tcn-section {
829
+ --section-tab-depth: 3;
830
+ --section-mat: var(--ergo-tertiary-light);
831
+ --section-action: var(--ergo-tertiary-dark);
802
832
  }
803
833
 
804
- .tcn-base-carrot {
805
- --carrot-size: 12px;
806
- --carrot-triangle-height: calc(var(--carrot-size) / 2);
807
- --carrot-triangle-width: var(--carrot-size);
808
- --carrot-triangle-base: var(--carrot-triangle-height) solid transparent;
809
- --carrot-triangle-peak: var(--carrot-triangle-width) solid var(--material);
834
+ .tcn-caret {
835
+ --caret-size: 12px;
836
+ --caret-triangle-height: calc(var(--caret-size) / 2);
837
+ --caret-triangle-width: var(--caret-size);
838
+ --caret-triangle-base: var(--caret-triangle-height) solid transparent;
839
+ --caret-triangle-peak: var(--caret-triangle-width) solid var(--material);
810
840
 
811
841
  width: 0;
812
842
  height: 0;
@@ -814,27 +844,27 @@
814
844
  display: inline-block;
815
845
 
816
846
  &[data-direction="top"] {
817
- border-bottom: var(--carrot-triangle-peak);
818
- border-left: var(--carrot-triangle-base);
819
- border-right: var(--carrot-triangle-base);
847
+ border-bottom: var(--caret-triangle-peak);
848
+ border-left: var(--caret-triangle-base);
849
+ border-right: var(--caret-triangle-base);
820
850
  }
821
851
 
822
852
  &[data-direction="bottom"] {
823
- border-top: var(--carrot-triangle-peak);
824
- border-left: var(--carrot-triangle-base);
825
- border-right: var(--carrot-triangle-base);
853
+ border-top: var(--caret-triangle-peak);
854
+ border-left: var(--caret-triangle-base);
855
+ border-right: var(--caret-triangle-base);
826
856
  }
827
857
 
828
858
  &[data-direction="start"] {
829
- border-right: var(--carrot-triangle-peak);
830
- border-top: var(--carrot-triangle-base);
831
- border-bottom: var(--carrot-triangle-base);
859
+ border-right: var(--caret-triangle-peak);
860
+ border-top: var(--caret-triangle-base);
861
+ border-bottom: var(--caret-triangle-base);
832
862
  }
833
863
 
834
864
  &[data-direction="end"] {
835
- border-left: var(--carrot-triangle-peak);
836
- border-top: var(--carrot-triangle-base);
837
- border-bottom: var(--carrot-triangle-base);
865
+ border-left: var(--caret-triangle-peak);
866
+ border-top: var(--caret-triangle-base);
867
+ border-bottom: var(--caret-triangle-base);
838
868
  }
839
869
  }
840
870
  }
@@ -1107,12 +1107,12 @@
1107
1107
  gap: 4px;
1108
1108
  }
1109
1109
 
1110
- .tcn-base-carrot {
1111
- --carrot-size: 12px;
1112
- --carrot-triangle-height: calc(var(--carrot-size) / 2);
1113
- --carrot-triangle-width: var(--carrot-size);
1114
- --carrot-triangle-base: var(--carrot-triangle-height) solid transparent;
1115
- --carrot-triangle-peak: var(--carrot-triangle-width) solid #000;
1110
+ .tcn-caret {
1111
+ --caret-size: 12px;
1112
+ --caret-triangle-height: calc(var(--caret-size) / 2);
1113
+ --caret-triangle-width: var(--caret-size);
1114
+ --caret-triangle-base: var(--caret-triangle-height) solid transparent;
1115
+ --caret-triangle-peak: var(--caret-triangle-width) solid #000;
1116
1116
 
1117
1117
  width: 0;
1118
1118
  height: 0;
@@ -1120,27 +1120,27 @@
1120
1120
  display: inline-block;
1121
1121
 
1122
1122
  &[data-direction="top"] {
1123
- border-bottom: var(--carrot-triangle-peak);
1124
- border-left: var(--carrot-triangle-base);
1125
- border-right: var(--carrot-triangle-base);
1123
+ border-bottom: var(--caret-triangle-peak);
1124
+ border-left: var(--caret-triangle-base);
1125
+ border-right: var(--caret-triangle-base);
1126
1126
  }
1127
1127
 
1128
1128
  &[data-direction="bottom"] {
1129
- border-top: var(--carrot-triangle-peak);
1130
- border-left: var(--carrot-triangle-base);
1131
- border-right: var(--carrot-triangle-base);
1129
+ border-top: var(--caret-triangle-peak);
1130
+ border-left: var(--caret-triangle-base);
1131
+ border-right: var(--caret-triangle-base);
1132
1132
  }
1133
1133
 
1134
1134
  &[data-direction="start"] {
1135
- border-right: var(--carrot-triangle-peak);
1136
- border-top: var(--carrot-triangle-base);
1137
- border-bottom: var(--carrot-triangle-base);
1135
+ border-right: var(--caret-triangle-peak);
1136
+ border-top: var(--caret-triangle-base);
1137
+ border-bottom: var(--caret-triangle-base);
1138
1138
  }
1139
1139
 
1140
1140
  &[data-direction="end"] {
1141
- border-left: var(--carrot-triangle-peak);
1142
- border-top: var(--carrot-triangle-base);
1143
- border-bottom: var(--carrot-triangle-base);
1141
+ border-left: var(--caret-triangle-peak);
1142
+ border-top: var(--caret-triangle-base);
1143
+ border-bottom: var(--caret-triangle-base);
1144
1144
  }
1145
1145
  }
1146
1146
  }
@@ -20,3 +20,6 @@ export * from './types/dimensions.js';
20
20
  export * from './types/variations.js';
21
21
 
22
22
  export * from './responsive/responsive_renderer.js';
23
+
24
+ export * from './dnd/draggable/draggable.js';
25
+ export * from './dnd/handle.js';
@@ -1,8 +0,0 @@
1
- import { BoxProps } from '../../stacks/box/box.js';
2
- export interface BaseCarrotOwnProps {
3
- direction: 'top' | 'bottom' | 'start' | 'end';
4
- }
5
- export interface BaseCarrotProps extends BaseCarrotOwnProps, BoxProps {
6
- }
7
- export declare const BaseCarrot: ({ direction, className, as, ...rest }: BaseCarrotProps) => import("react/jsx-runtime").JSX.Element;
8
- //# sourceMappingURL=base_carrot.d.ts.map