@luscii-healthtech/web-ui 46.2.2 → 46.2.4

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)";
@@ -0,0 +1,9 @@
1
+ import type { FC } from "react";
2
+ import type Quill from "quill";
3
+ interface Props {
4
+ linkElement: HTMLAnchorElement;
5
+ quillInstance: Quill;
6
+ onClose: () => void;
7
+ }
8
+ export declare const LinkTooltip: FC<Props>;
9
+ export {};
@@ -1,7 +1,7 @@
1
1
  import type { FC, HTMLAttributes } from "react";
2
2
  import type { Delta, EmitterSource } from "quill/core";
3
3
  import "quill-paste-smart";
4
- import "quill/dist/quill.snow.css";
4
+ import { type TextEditorToolbarOption } from "./TextEditorToolbar";
5
5
  import "./TextEditor.scss";
6
6
  type Props = HTMLAttributes<HTMLDivElement> & {
7
7
  /**
@@ -59,11 +59,6 @@ type Props = HTMLAttributes<HTMLDivElement> & {
59
59
  */
60
60
  placeholder?: string;
61
61
  };
62
- type TextEditorToolbarOption = "bold" | "italic" | "underline" | "strike" | "link" | "video" | {
63
- list: "ordered";
64
- } | {
65
- list: "bullet";
66
- };
67
62
  type TextEditorFormat = "background" | "bold" | "color" | "font" | "code" | "italic" | "link" | "size" | "strike" | "script" | "underline" | "blockquote" | "header" | "list" | "align";
68
63
  export declare const TextEditor: FC<Props>;
69
64
  export default TextEditor;
@@ -0,0 +1,13 @@
1
+ import type { FC } from "react";
2
+ export type TextEditorToolbarOption = "bold" | "italic" | "underline" | "strike" | "link" | "video" | {
3
+ list: "ordered";
4
+ } | {
5
+ list: "bullet";
6
+ };
7
+ interface Props {
8
+ toolbarId: string;
9
+ toolbar: TextEditorToolbarOption[][];
10
+ hasTextSelected: boolean;
11
+ }
12
+ export declare const TextEditorToolbar: FC<Props>;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { FC } from "react";
2
+ import { type TextEditorToolbarOption } from "./TextEditorToolbar";
3
+ interface Props {
4
+ option: TextEditorToolbarOption;
5
+ hasTextSelected: boolean;
6
+ }
7
+ export declare const TextEditorToolbarButton: FC<Props>;
8
+ export {};
@@ -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)";
@@ -0,0 +1,9 @@
1
+ import type { FC } from "react";
2
+ import type Quill from "quill";
3
+ interface Props {
4
+ linkElement: HTMLAnchorElement;
5
+ quillInstance: Quill;
6
+ onClose: () => void;
7
+ }
8
+ export declare const LinkTooltip: FC<Props>;
9
+ export {};
@@ -1,7 +1,7 @@
1
1
  import type { FC, HTMLAttributes } from "react";
2
2
  import type { Delta, EmitterSource } from "quill/core";
3
3
  import "quill-paste-smart";
4
- import "quill/dist/quill.snow.css";
4
+ import { type TextEditorToolbarOption } from "./TextEditorToolbar";
5
5
  import "./TextEditor.scss";
6
6
  type Props = HTMLAttributes<HTMLDivElement> & {
7
7
  /**
@@ -59,11 +59,6 @@ type Props = HTMLAttributes<HTMLDivElement> & {
59
59
  */
60
60
  placeholder?: string;
61
61
  };
62
- type TextEditorToolbarOption = "bold" | "italic" | "underline" | "strike" | "link" | "video" | {
63
- list: "ordered";
64
- } | {
65
- list: "bullet";
66
- };
67
62
  type TextEditorFormat = "background" | "bold" | "color" | "font" | "code" | "italic" | "link" | "size" | "strike" | "script" | "underline" | "blockquote" | "header" | "list" | "align";
68
63
  export declare const TextEditor: FC<Props>;
69
64
  export default TextEditor;
@@ -0,0 +1,13 @@
1
+ import type { FC } from "react";
2
+ export type TextEditorToolbarOption = "bold" | "italic" | "underline" | "strike" | "link" | "video" | {
3
+ list: "ordered";
4
+ } | {
5
+ list: "bullet";
6
+ };
7
+ interface Props {
8
+ toolbarId: string;
9
+ toolbar: TextEditorToolbarOption[][];
10
+ hasTextSelected: boolean;
11
+ }
12
+ export declare const TextEditorToolbar: FC<Props>;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { FC } from "react";
2
+ import { type TextEditorToolbarOption } from "./TextEditorToolbar";
3
+ interface Props {
4
+ option: TextEditorToolbarOption;
5
+ hasTextSelected: boolean;
6
+ }
7
+ export declare const TextEditorToolbarButton: FC<Props>;
8
+ export {};
@@ -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;
@@ -3,11 +3,7 @@ declare const _default: {
3
3
  component: import("react").FC<import("react").HTMLAttributes<HTMLDivElement> & {
4
4
  onValueChange: (html: string, delta: import("quill-delta").default, source: import("quill").EmitterSource) => void;
5
5
  formats?: ("bold" | "link" | "strike" | "blockquote" | "code" | "header" | "script" | "color" | "align" | "list" | "font" | "size" | "background" | "italic" | "underline")[];
6
- toolbar?: ("bold" | "link" | "strike" | "video" | "italic" | "underline" | {
7
- list: "ordered";
8
- } | {
9
- list: "bullet";
10
- })[][];
6
+ toolbar?: import("../src/components/TextEditor/TextEditorToolbar").TextEditorToolbarOption[][];
11
7
  defaultValue?: string;
12
8
  placeholder?: string;
13
9
  }>;
@@ -81,6 +81,7 @@
81
81
  --ui-color-blue-300: #93c5fd;
82
82
  --ui-color-blue-400: #60a5fa;
83
83
  --ui-color-blue-500: #3b82f6;
84
+ --ui-color-blue-600: #2563eb;
84
85
  --ui-color-blue-700: #1d4ed8;
85
86
  --ui-color-blue-800: #1e40af;
86
87
  --ui-color-blue-900: #1e3a8a;
@@ -1233,6 +1234,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1233
1234
  .ui\:min-h-15 {
1234
1235
  min-height: 3.75rem;
1235
1236
  }
1237
+ .ui\:min-h-40 {
1238
+ min-height: calc(var(--ui-spacing) * 40);
1239
+ }
1236
1240
  .ui\:min-h-\[650px\] {
1237
1241
  min-height: 650px;
1238
1242
  }
@@ -1422,6 +1426,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1422
1426
  .ui\:max-w-\[55ch\] {
1423
1427
  max-width: 55ch;
1424
1428
  }
1429
+ .ui\:max-w-\[60ch\] {
1430
+ max-width: 60ch;
1431
+ }
1425
1432
  .ui\:max-w-\[100vw\] {
1426
1433
  max-width: 100vw;
1427
1434
  }
@@ -1637,6 +1644,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1637
1644
  .ui\:cursor-wait {
1638
1645
  cursor: wait;
1639
1646
  }
1647
+ .ui\:resize-y {
1648
+ resize: vertical;
1649
+ }
1640
1650
  .ui\:snap-x {
1641
1651
  scroll-snap-type: x var(--tw-scroll-snap-strictness);
1642
1652
  }
@@ -2498,6 +2508,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
2498
2508
  .ui\:fill-secondary-background {
2499
2509
  fill: var(--ui-color-slate-600);
2500
2510
  }
2511
+ .ui\:fill-transparent {
2512
+ fill: transparent;
2513
+ }
2501
2514
  .ui\:fill-white {
2502
2515
  fill: var(--ui-color-white);
2503
2516
  }
@@ -2969,6 +2982,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
2969
2982
  .ui\:break-all {
2970
2983
  word-break: break-all;
2971
2984
  }
2985
+ .ui\:text-ellipsis {
2986
+ text-overflow: ellipsis;
2987
+ }
2972
2988
  .ui\:whitespace-break-spaces {
2973
2989
  white-space: break-spaces;
2974
2990
  }
@@ -2987,6 +3003,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
2987
3003
  .ui\:text-amber-800 {
2988
3004
  color: var(--ui-color-amber-800);
2989
3005
  }
3006
+ .ui\:text-blue-600 {
3007
+ color: var(--ui-color-blue-600);
3008
+ }
2990
3009
  .ui\:text-current {
2991
3010
  color: currentcolor;
2992
3011
  }
@@ -4672,6 +4691,16 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
4672
4691
  }
4673
4692
  }
4674
4693
  }
4694
+ .ui\:aria-disabled\:cursor-not-allowed {
4695
+ &[aria-disabled="true"] {
4696
+ cursor: not-allowed;
4697
+ }
4698
+ }
4699
+ .ui\:aria-pressed\:bg-primary-background {
4700
+ &[aria-pressed="true"] {
4701
+ background-color: var(--ui-color-blue-100);
4702
+ }
4703
+ }
4675
4704
  .ui\:data-\[side\=bottom\]\:slide-in-from-top-2 {
4676
4705
  &[data-side="bottom"] {
4677
4706
  --tw-enter-translate-y: -0.5rem;