@luscii-healthtech/web-ui 46.2.3 → 46.3.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.
@@ -1,11 +1,14 @@
1
- import { type FC } from "react";
1
+ import { type CSSProperties, type FC } from "react";
2
2
  import { Box } from "../Box/Box";
3
3
  type Color = string | readonly [string, string];
4
- export interface RangeCoverageSection {
4
+ interface RangeCoverageSection {
5
5
  from: number;
6
6
  to: number;
7
7
  color: Color;
8
8
  }
9
+ export interface RangeCoverageSectionWithBackground extends RangeCoverageSection {
10
+ background?: CSSProperties["background"];
11
+ }
9
12
  export interface Props extends React.ComponentPropsWithoutRef<typeof Box<"div">> {
10
13
  /**
11
14
  * Each section defines a colored range within the overall start-end range.
@@ -38,6 +41,7 @@ export interface Props extends React.ComponentPropsWithoutRef<typeof Box<"div">>
38
41
  */
39
42
  color: Color;
40
43
  }>;
44
+ onSectionFocus?: (section: RangeCoverageSection | null) => void;
41
45
  translations: {
42
46
  /**
43
47
  * This component doesn't support overlapping sections. If you cannot guarantee that
@@ -46,6 +50,12 @@ export interface Props extends React.ComponentPropsWithoutRef<typeof Box<"div">>
46
50
  */
47
51
  sectionOverlapsMessage: string;
48
52
  };
53
+ slots?: {
54
+ /**
55
+ * Return `null` to render the default segment without a tooltip.
56
+ */
57
+ renderTooltipContent?: (section: RangeCoverageSectionWithBackground) => React.ReactNode;
58
+ };
49
59
  }
50
60
  export declare const COLOR_GREY_LIGHT = "var(--ui-color-background-info-secondary-hovered)";
51
61
  export declare const COLOR_GREY_DARK = "var(--ui-color-border-info-secondary-hovered)";
@@ -1,6 +1,7 @@
1
1
  import * as RadixTooltip from "@radix-ui/react-tooltip";
2
2
  import { type FC } from "react";
3
3
  import { type LegacyTextProps } from "../Text/Text";
4
+ import { Box } from "../Box/Box";
4
5
  type StaticComponents = {
5
6
  Trigger: typeof RadixTooltip.Trigger;
6
7
  Root: typeof RadixTooltip.Root;
@@ -14,6 +15,7 @@ type ContentProps = {
14
15
  * When omitted the Tooltip will be rendered into the document.body.
15
16
  */
16
17
  container?: RadixTooltip.TooltipPortalProps["container"];
18
+ backgroundColor?: React.ComponentProps<typeof Box>["backgroundColor"] | "transparent";
17
19
  } & RadixTooltip.TooltipContentProps;
18
20
  declare const TooltipText: FC<LegacyTextProps<"span">>;
19
21
  /**
@@ -1,11 +1,14 @@
1
- import { type FC } from "react";
1
+ import { type CSSProperties, type FC } from "react";
2
2
  import { Box } from "../Box/Box";
3
3
  type Color = string | readonly [string, string];
4
- export interface RangeCoverageSection {
4
+ interface RangeCoverageSection {
5
5
  from: number;
6
6
  to: number;
7
7
  color: Color;
8
8
  }
9
+ export interface RangeCoverageSectionWithBackground extends RangeCoverageSection {
10
+ background?: CSSProperties["background"];
11
+ }
9
12
  export interface Props extends React.ComponentPropsWithoutRef<typeof Box<"div">> {
10
13
  /**
11
14
  * Each section defines a colored range within the overall start-end range.
@@ -38,6 +41,7 @@ export interface Props extends React.ComponentPropsWithoutRef<typeof Box<"div">>
38
41
  */
39
42
  color: Color;
40
43
  }>;
44
+ onSectionFocus?: (section: RangeCoverageSection | null) => void;
41
45
  translations: {
42
46
  /**
43
47
  * This component doesn't support overlapping sections. If you cannot guarantee that
@@ -46,6 +50,12 @@ export interface Props extends React.ComponentPropsWithoutRef<typeof Box<"div">>
46
50
  */
47
51
  sectionOverlapsMessage: string;
48
52
  };
53
+ slots?: {
54
+ /**
55
+ * Return `null` to render the default segment without a tooltip.
56
+ */
57
+ renderTooltipContent?: (section: RangeCoverageSectionWithBackground) => React.ReactNode;
58
+ };
49
59
  }
50
60
  export declare const COLOR_GREY_LIGHT = "var(--ui-color-background-info-secondary-hovered)";
51
61
  export declare const COLOR_GREY_DARK = "var(--ui-color-border-info-secondary-hovered)";
@@ -1,6 +1,7 @@
1
1
  import * as RadixTooltip from "@radix-ui/react-tooltip";
2
2
  import { type FC } from "react";
3
3
  import { type LegacyTextProps } from "../Text/Text";
4
+ import { Box } from "../Box/Box";
4
5
  type StaticComponents = {
5
6
  Trigger: typeof RadixTooltip.Trigger;
6
7
  Root: typeof RadixTooltip.Root;
@@ -14,6 +15,7 @@ type ContentProps = {
14
15
  * When omitted the Tooltip will be rendered into the document.body.
15
16
  */
16
17
  container?: RadixTooltip.TooltipPortalProps["container"];
18
+ backgroundColor?: React.ComponentProps<typeof Box>["backgroundColor"] | "transparent";
17
19
  } & RadixTooltip.TooltipContentProps;
18
20
  declare const TooltipText: FC<LegacyTextProps<"span">>;
19
21
  /**
@@ -19,10 +19,12 @@ declare const meta: {
19
19
  }) => number[];
20
20
  };
21
21
  parameters: {};
22
+ decorators: import("@storybook/react").Decorator[];
22
23
  };
23
24
  export default meta;
24
25
  type Story = StoryObj<typeof meta>;
25
26
  export declare const Base: Story;
27
+ export declare const AdjacentSections: Story;
26
28
  export declare const Reversed: Story;
27
29
  export declare const EdgeCases: Story;
28
30
  export declare const OverlappingSections: Story;
@@ -1426,6 +1426,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1426
1426
  .ui\:max-w-\[55ch\] {
1427
1427
  max-width: 55ch;
1428
1428
  }
1429
+ .ui\:max-w-\[60ch\] {
1430
+ max-width: 60ch;
1431
+ }
1429
1432
  .ui\:max-w-\[100vw\] {
1430
1433
  max-width: 100vw;
1431
1434
  }
@@ -2505,6 +2508,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
2505
2508
  .ui\:fill-secondary-background {
2506
2509
  fill: var(--ui-color-slate-600);
2507
2510
  }
2511
+ .ui\:fill-transparent {
2512
+ fill: transparent;
2513
+ }
2508
2514
  .ui\:fill-white {
2509
2515
  fill: var(--ui-color-white);
2510
2516
  }