@tensor_1/react 2.39.0 → 2.40.1
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.
- package/README.md +18 -0
- package/dist/chart-analytic-model.d.ts +10 -2
- package/dist/chart-analytic-model.js +24 -17
- package/dist/chart-analytic.cjs +25 -18
- package/dist/chart-analytic.d.cts +10 -2
- package/dist/chart-panels-model.js +1 -1
- package/dist/components/Comments.d.ts +4 -1
- package/dist/components/Comments.js +3 -2
- package/dist/components/Markdown.d.ts +9 -2
- package/dist/components/Markdown.js +16 -2
- package/dist/components/RichTextEditor.d.ts +17 -0
- package/dist/components/RichTextEditor.js +179 -11
- package/dist/components/ToggleRow.d.ts +8 -1
- package/dist/components/ToggleRow.js +17 -3
- package/dist/icons/Icon.d.ts +12 -12
- package/dist/index.cjs +490 -475
- package/dist/index.d.cts +12 -2
- package/dist/markdown-model-Cuwi6pIk.d.cts +110 -0
- package/dist/markdown-model.d.ts +38 -1
- package/dist/markdown-model.js +67 -0
- package/dist/markdown.cjs +90 -4
- package/dist/markdown.d.cts +11 -75
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.js +16 -2
- package/dist/rich-text/mention.d.ts +14 -0
- package/dist/rich-text/mention.js +57 -0
- package/dist/rich-text/pipeline.js +4 -1
- package/dist/rich-text.cjs +1795 -1483
- package/dist/rich-text.d.cts +27 -1
- package/dist/rich-text.d.ts +3 -0
- package/dist/rich-text.js +6 -0
- package/package.json +1 -1
|
@@ -2,12 +2,19 @@ import * as react from 'react';
|
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
interface ToggleRowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
5
|
+
/** The row's visible label. It is the switch's `<label>`: clicking it flips the switch, and it names the switch. */
|
|
5
6
|
label: ReactNode;
|
|
7
|
+
/** Shown under the label and announced as the switch's description (`aria-describedby`). */
|
|
6
8
|
description?: ReactNode;
|
|
7
9
|
checked: boolean;
|
|
8
10
|
onCheckedChange: (checked: boolean) => void;
|
|
9
11
|
disabled?: boolean;
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The switch's name when the visible label is not text (an icon, an image).
|
|
14
|
+
* Leave it out for a text label: the label already names the switch, and a
|
|
15
|
+
* repeated `aria-label` would replace it.
|
|
16
|
+
*/
|
|
17
|
+
accessibleLabel?: string;
|
|
11
18
|
}
|
|
12
19
|
declare function ToggleRow({ label, description, checked, onCheckedChange, disabled, accessibleLabel, className, ...props }: ToggleRowProps): react.JSX.Element;
|
|
13
20
|
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
3
4
|
import { cx } from "../cx.js";
|
|
4
5
|
import { Switch } from "./Switch.js";
|
|
5
6
|
function ToggleRow({ label, description, checked, onCheckedChange, disabled, accessibleLabel, className, ...props }) {
|
|
7
|
+
const id = useId();
|
|
8
|
+
const switchId = `${id}-switch`;
|
|
9
|
+
const descriptionId = `${id}-description`;
|
|
6
10
|
return /* @__PURE__ */ jsxs("div", { className: cx("uix-toggle-row", className), ...props, children: [
|
|
7
11
|
/* @__PURE__ */ jsxs("div", { className: "uix-toggle-row__copy", children: [
|
|
8
|
-
/* @__PURE__ */ jsx("div", { className: "uix-toggle-row__label", children: label }),
|
|
9
|
-
description != null && /* @__PURE__ */ jsx("div", { className: "uix-toggle-row__description", children: description })
|
|
12
|
+
/* @__PURE__ */ jsx("div", { className: "uix-toggle-row__label", children: /* @__PURE__ */ jsx("label", { htmlFor: switchId, children: label }) }),
|
|
13
|
+
description != null && /* @__PURE__ */ jsx("div", { className: "uix-toggle-row__description", id: descriptionId, children: description })
|
|
10
14
|
] }),
|
|
11
|
-
/* @__PURE__ */ jsx(
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
Switch,
|
|
17
|
+
{
|
|
18
|
+
id: switchId,
|
|
19
|
+
checked,
|
|
20
|
+
disabled,
|
|
21
|
+
...accessibleLabel ? { "aria-label": accessibleLabel } : {},
|
|
22
|
+
...description != null ? { "aria-describedby": descriptionId } : {},
|
|
23
|
+
onChange: (event) => onCheckedChange(event.currentTarget.checked)
|
|
24
|
+
}
|
|
25
|
+
)
|
|
12
26
|
] });
|
|
13
27
|
}
|
|
14
28
|
export {
|
package/dist/icons/Icon.d.ts
CHANGED
|
@@ -5,30 +5,30 @@ import { IconNode, UixIcon, IconProps } from './types.js';
|
|
|
5
5
|
/** Renders a glyph as an inline SVG; the props contract shared by every icon. */
|
|
6
6
|
declare function renderIcon(node: IconNode, { size, tone, label, strokeWidth, className, style, ...rest }: IconProps, ref?: unknown): react.ReactElement<{
|
|
7
7
|
string?: number | string | undefined | undefined;
|
|
8
|
-
target?: string | undefined | undefined;
|
|
9
8
|
filter?: string | undefined | undefined;
|
|
10
|
-
fill: string;
|
|
11
9
|
values?: string | undefined | undefined;
|
|
10
|
+
fill: string;
|
|
11
|
+
color?: string | undefined | undefined;
|
|
12
|
+
fontStyle?: number | string | undefined | undefined;
|
|
13
|
+
fontWeight?: number | string | undefined | undefined;
|
|
14
|
+
fontSize?: number | string | undefined | undefined;
|
|
15
|
+
fontFamily?: string | undefined | undefined;
|
|
16
|
+
width?: number | string | undefined | undefined;
|
|
17
|
+
height?: number | string | undefined | undefined;
|
|
12
18
|
type?: string | undefined | undefined;
|
|
19
|
+
z?: number | string | undefined | undefined;
|
|
20
|
+
opacity?: number | string | undefined | undefined;
|
|
21
|
+
r?: number | string | undefined | undefined;
|
|
22
|
+
target?: string | undefined | undefined;
|
|
13
23
|
min?: number | string | undefined | undefined;
|
|
14
24
|
max?: number | string | undefined | undefined;
|
|
15
25
|
name?: string | undefined | undefined;
|
|
16
|
-
color?: string | undefined | undefined;
|
|
17
|
-
width?: number | string | undefined | undefined;
|
|
18
26
|
rotate?: number | string | undefined | undefined;
|
|
19
27
|
offset?: number | string | undefined | undefined;
|
|
20
28
|
overflow?: number | string | undefined | undefined;
|
|
21
|
-
fontStyle?: number | string | undefined | undefined;
|
|
22
|
-
fontWeight?: number | string | undefined | undefined;
|
|
23
|
-
fontFamily?: string | undefined | undefined;
|
|
24
|
-
fontSize?: number | string | undefined | undefined;
|
|
25
|
-
opacity?: number | string | undefined | undefined;
|
|
26
|
-
height?: number | string | undefined | undefined;
|
|
27
29
|
end?: number | string | undefined | undefined;
|
|
28
30
|
scale?: number | string | undefined | undefined;
|
|
29
31
|
to?: number | string | undefined | undefined;
|
|
30
|
-
z?: number | string | undefined | undefined;
|
|
31
|
-
r?: number | string | undefined | undefined;
|
|
32
32
|
x?: number | string | undefined | undefined;
|
|
33
33
|
cursor?: number | string | undefined | undefined;
|
|
34
34
|
id?: string | undefined | undefined;
|