@itwin/itwinui-react 5.0.0-alpha.8 → 5.0.0-alpha.9
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/CHANGELOG.md +11 -1
- package/LICENSE.md +1 -1
- package/dist/DEV/bricks/Anchor.js +4 -9
- package/dist/DEV/bricks/Avatar.js +2 -2
- package/dist/DEV/bricks/Badge.js +2 -2
- package/dist/DEV/bricks/Button.js +10 -3
- package/dist/DEV/bricks/Checkbox.js +4 -2
- package/dist/DEV/bricks/Chip.js +2 -2
- package/dist/DEV/bricks/Divider.js +3 -2
- package/dist/DEV/bricks/DropdownMenu.js +79 -19
- package/dist/DEV/bricks/Field.js +21 -17
- package/dist/DEV/bricks/Icon.js +5 -5
- package/dist/DEV/bricks/IconButton.js +14 -6
- package/dist/DEV/bricks/Kbd.internal.js +19 -0
- package/dist/DEV/bricks/Kbd.js +3 -18
- package/dist/DEV/bricks/Label.js +2 -2
- package/dist/DEV/bricks/Radio.js +4 -2
- package/dist/DEV/bricks/Root.js +35 -4
- package/dist/DEV/bricks/Select.js +3 -3
- package/dist/DEV/bricks/Spinner.js +2 -2
- package/dist/DEV/bricks/Switch.js +4 -2
- package/dist/DEV/bricks/Table.js +7 -7
- package/dist/DEV/bricks/Tabs.js +5 -5
- package/dist/DEV/bricks/Text.js +2 -2
- package/dist/DEV/bricks/TextBox.js +8 -7
- package/dist/DEV/bricks/Tooltip.js +5 -5
- package/dist/DEV/bricks/Tree.js +8 -195
- package/dist/DEV/bricks/TreeItem.js +219 -0
- package/dist/DEV/bricks/VisuallyHidden.js +2 -2
- package/dist/DEV/bricks/styles.css.js +1 -1
- package/dist/DEV/bricks/~hooks.js +11 -6
- package/dist/DEV/bricks/~utils.GhostAligner.js +13 -0
- package/dist/DEV/bricks/{ListItem.js → ~utils.ListItem.js} +3 -3
- package/dist/bricks/Anchor.js +4 -9
- package/dist/bricks/Avatar.js +2 -2
- package/dist/bricks/Badge.js +2 -2
- package/dist/bricks/Button.js +10 -3
- package/dist/bricks/Checkbox.d.ts +2 -2
- package/dist/bricks/Checkbox.js +4 -2
- package/dist/bricks/Chip.js +2 -2
- package/dist/bricks/Divider.d.ts +2 -2
- package/dist/bricks/Divider.js +3 -2
- package/dist/bricks/DropdownMenu.d.ts +38 -23
- package/dist/bricks/DropdownMenu.js +77 -19
- package/dist/bricks/Field.d.ts +5 -5
- package/dist/bricks/Field.js +21 -17
- package/dist/bricks/Icon.js +5 -5
- package/dist/bricks/IconButton.d.ts +18 -2
- package/dist/bricks/IconButton.js +14 -6
- package/dist/bricks/Kbd.d.ts +2 -17
- package/dist/bricks/Kbd.internal.d.ts +17 -0
- package/dist/bricks/Kbd.internal.js +19 -0
- package/dist/bricks/Kbd.js +3 -18
- package/dist/bricks/Label.js +2 -2
- package/dist/bricks/Radio.d.ts +2 -2
- package/dist/bricks/Radio.js +4 -2
- package/dist/bricks/Root.js +35 -4
- package/dist/bricks/Select.d.ts +1 -2
- package/dist/bricks/Select.js +3 -3
- package/dist/bricks/Spinner.js +2 -2
- package/dist/bricks/Switch.d.ts +2 -2
- package/dist/bricks/Switch.js +4 -2
- package/dist/bricks/Table.js +7 -7
- package/dist/bricks/Tabs.d.ts +4 -4
- package/dist/bricks/Tabs.js +5 -5
- package/dist/bricks/Text.js +2 -2
- package/dist/bricks/TextBox.js +8 -7
- package/dist/bricks/Tooltip.d.ts +2 -2
- package/dist/bricks/Tooltip.js +5 -5
- package/dist/bricks/Tree.d.ts +3 -110
- package/dist/bricks/Tree.js +8 -190
- package/dist/bricks/TreeItem.d.ts +123 -0
- package/dist/bricks/TreeItem.js +214 -0
- package/dist/bricks/VisuallyHidden.js +2 -2
- package/dist/bricks/styles.css.js +1 -1
- package/dist/bricks/~hooks.d.ts +11 -2
- package/dist/bricks/~hooks.js +11 -6
- package/dist/bricks/~utils.GhostAligner.d.ts +22 -0
- package/dist/bricks/~utils.GhostAligner.js +13 -0
- package/dist/bricks/{ListItem.d.ts → ~utils.ListItem.d.ts} +5 -5
- package/dist/bricks/{ListItem.js → ~utils.ListItem.js} +3 -3
- package/dist/bricks/~utils.d.ts +6 -3
- package/package.json +1 -1
package/dist/bricks/Kbd.js
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import
|
|
3
|
+
import { Role } from "@ariakit/react/role";
|
|
4
4
|
import { forwardRef } from "./~utils.js";
|
|
5
5
|
import { VisuallyHidden } from "./VisuallyHidden.js";
|
|
6
|
-
|
|
7
|
-
Backspace: "\u232B",
|
|
8
|
-
Command: "\u2318",
|
|
9
|
-
Control: "Ctrl",
|
|
10
|
-
Down: "\u2193",
|
|
11
|
-
Eject: "\u23CF",
|
|
12
|
-
Enter: "\u21B5",
|
|
13
|
-
Escape: "Esc",
|
|
14
|
-
Left: "\u2190",
|
|
15
|
-
Option: "\u2325",
|
|
16
|
-
Right: "\u2192",
|
|
17
|
-
Shift: "\u21E7",
|
|
18
|
-
Space: "\u2423",
|
|
19
|
-
Tab: "Tab",
|
|
20
|
-
Up: "\u2191"
|
|
21
|
-
};
|
|
6
|
+
import { predefinedSymbols } from "./Kbd.internal.js";
|
|
22
7
|
const Kbd = forwardRef((props, forwardedRef) => {
|
|
23
8
|
const { variant = "solid", symbol, children, ...rest } = props;
|
|
24
9
|
let content = children;
|
|
@@ -29,7 +14,7 @@ const Kbd = forwardRef((props, forwardedRef) => {
|
|
|
29
14
|
] });
|
|
30
15
|
}
|
|
31
16
|
return /* @__PURE__ */ jsx(
|
|
32
|
-
|
|
17
|
+
Role,
|
|
33
18
|
{
|
|
34
19
|
...rest,
|
|
35
20
|
"data-kiwi-variant": variant,
|
package/dist/bricks/Label.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import
|
|
3
|
+
import { Role } from "@ariakit/react/role";
|
|
4
4
|
import { forwardRef } from "./~utils.js";
|
|
5
5
|
import { FieldLabel } from "./Field.js";
|
|
6
6
|
const Label = forwardRef((props, forwardedRef) => {
|
|
@@ -8,7 +8,7 @@ const Label = forwardRef((props, forwardedRef) => {
|
|
|
8
8
|
FieldLabel,
|
|
9
9
|
{
|
|
10
10
|
render: /* @__PURE__ */ jsx(
|
|
11
|
-
|
|
11
|
+
Role.label,
|
|
12
12
|
{
|
|
13
13
|
...props,
|
|
14
14
|
className: cx("\u{1F95D}-label", props.className),
|
package/dist/bricks/Radio.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type RadioProps as AkRadioProps } from "@ariakit/react/radio";
|
|
2
2
|
import { type FocusableProps } from "./~utils.js";
|
|
3
3
|
type InputBaseProps = Omit<FocusableProps<"input">, "defaultValue" | "value">;
|
|
4
|
-
type RadioOwnProps = Pick<
|
|
4
|
+
type RadioOwnProps = Pick<AkRadioProps, "value" | "checked" | "onChange">;
|
|
5
5
|
interface RadioProps extends InputBaseProps, RadioOwnProps {
|
|
6
6
|
}
|
|
7
7
|
/**
|
package/dist/bricks/Radio.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
Radio as AkRadio
|
|
5
|
+
} from "@ariakit/react/radio";
|
|
4
6
|
import { FieldControl } from "./Field.js";
|
|
5
7
|
import { forwardRef } from "./~utils.js";
|
|
6
8
|
const Radio = forwardRef((props, forwardedRef) => {
|
|
@@ -11,7 +13,7 @@ const Radio = forwardRef((props, forwardedRef) => {
|
|
|
11
13
|
type: "checkable",
|
|
12
14
|
id,
|
|
13
15
|
render: /* @__PURE__ */ jsx(
|
|
14
|
-
|
|
16
|
+
AkRadio,
|
|
15
17
|
{
|
|
16
18
|
accessibleWhenDisabled: true,
|
|
17
19
|
...rest,
|
package/dist/bricks/Root.js
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as ReactDOM from "react-dom";
|
|
4
|
+
import { Role } from "@ariakit/react/role";
|
|
5
|
+
import { PortalContext } from "@ariakit/react/portal";
|
|
4
6
|
import cx from "classnames";
|
|
5
7
|
import foundationsCss from "../foundations/styles.css.js";
|
|
6
8
|
import bricksCss from "./styles.css.js";
|
|
7
9
|
import { forwardRef, isBrowser } from "./~utils.js";
|
|
8
|
-
import { useMergedRefs } from "./~hooks.js";
|
|
10
|
+
import { useIsClient, useMergedRefs } from "./~hooks.js";
|
|
9
11
|
const css = foundationsCss + bricksCss;
|
|
10
12
|
const Root = forwardRef((props, forwardedRef) => {
|
|
11
13
|
const { children, synchronizeColorScheme = false, ...rest } = props;
|
|
14
|
+
const [portalContainer, setPortalContainer] = React.useState(null);
|
|
12
15
|
return /* @__PURE__ */ jsxs(RootInternal, { ...rest, ref: forwardedRef, children: [
|
|
13
16
|
/* @__PURE__ */ jsx(Styles, {}),
|
|
14
17
|
/* @__PURE__ */ jsx(Fonts, {}),
|
|
15
18
|
synchronizeColorScheme ? /* @__PURE__ */ jsx(SynchronizeColorScheme, { colorScheme: props.colorScheme }) : null,
|
|
16
|
-
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
PortalContainer,
|
|
21
|
+
{
|
|
22
|
+
colorScheme: props.colorScheme,
|
|
23
|
+
density: props.density,
|
|
24
|
+
ref: setPortalContainer
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ jsx(PortalContext.Provider, { value: portalContainer, children })
|
|
17
28
|
] });
|
|
18
29
|
});
|
|
19
30
|
const RootNodeContext = React.createContext(null);
|
|
@@ -31,7 +42,7 @@ const RootInternal = forwardRef(
|
|
|
31
42
|
setRootNode(rootNode2);
|
|
32
43
|
}, []);
|
|
33
44
|
return /* @__PURE__ */ jsx(
|
|
34
|
-
|
|
45
|
+
Role,
|
|
35
46
|
{
|
|
36
47
|
...rest,
|
|
37
48
|
className: cx("\u{1F95D}-root", props.className),
|
|
@@ -59,6 +70,26 @@ function SynchronizeColorScheme({
|
|
|
59
70
|
}, [rootNode, colorScheme]);
|
|
60
71
|
return null;
|
|
61
72
|
}
|
|
73
|
+
const PortalContainer = forwardRef((props, forwardedRef) => {
|
|
74
|
+
const isClient = useIsClient();
|
|
75
|
+
const rootNode = useRootNode();
|
|
76
|
+
if (!isClient) return null;
|
|
77
|
+
const destination = rootNode && isDocument(rootNode) ? rootNode.body : rootNode;
|
|
78
|
+
if (!destination) return null;
|
|
79
|
+
return ReactDOM.createPortal(
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: "\u{1F95D}-root",
|
|
84
|
+
"data-kiwi-theme": props.colorScheme,
|
|
85
|
+
"data-kiwi-density": props.density,
|
|
86
|
+
style: { display: "contents" },
|
|
87
|
+
ref: forwardedRef
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
destination
|
|
91
|
+
);
|
|
92
|
+
});
|
|
62
93
|
function Styles() {
|
|
63
94
|
const rootNode = useRootNode();
|
|
64
95
|
useLayoutEffect(() => {
|
package/dist/bricks/Select.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as Ariakit from "@ariakit/react";
|
|
3
2
|
import { type FocusableProps } from "./~utils.js";
|
|
4
3
|
/**
|
|
5
4
|
* Compound component for a select element, which allows the user to select a value from a list of options.
|
|
@@ -20,7 +19,7 @@ import { type FocusableProps } from "./~utils.js";
|
|
|
20
19
|
* </Field>
|
|
21
20
|
* ```
|
|
22
21
|
*/
|
|
23
|
-
declare const SelectRoot: React.ForwardRefExoticComponent<Pick<
|
|
22
|
+
declare const SelectRoot: React.ForwardRefExoticComponent<Pick<import("@ariakit/react/role").RoleProps, "render"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "render"> & React.RefAttributes<HTMLElement | HTMLDivElement>>;
|
|
24
23
|
type HtmlSelectBaseProps = Omit<FocusableProps<"select">, "multiple" | "size">;
|
|
25
24
|
interface HtmlSelectProps extends HtmlSelectBaseProps {
|
|
26
25
|
/**
|
package/dist/bricks/Select.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import cx from "classnames";
|
|
4
|
-
import
|
|
4
|
+
import { Role } from "@ariakit/react/role";
|
|
5
5
|
import {
|
|
6
6
|
forwardRef,
|
|
7
7
|
isBrowser
|
|
@@ -14,7 +14,7 @@ const HtmlSelectContext = React.createContext(() => {
|
|
|
14
14
|
const SelectRoot = forwardRef((props, forwardedRef) => {
|
|
15
15
|
const [isHtmlSelect, setIsHtmlSelect] = React.useState(false);
|
|
16
16
|
return /* @__PURE__ */ jsx(HtmlSelectContext.Provider, { value: setIsHtmlSelect, children: /* @__PURE__ */ jsx(
|
|
17
|
-
|
|
17
|
+
Role.div,
|
|
18
18
|
{
|
|
19
19
|
...props,
|
|
20
20
|
className: cx("\u{1F95D}-select-root", props.className),
|
|
@@ -40,7 +40,7 @@ const HtmlSelect = forwardRef(
|
|
|
40
40
|
type: "textlike",
|
|
41
41
|
id,
|
|
42
42
|
render: /* @__PURE__ */ jsx(
|
|
43
|
-
|
|
43
|
+
Role.select,
|
|
44
44
|
{
|
|
45
45
|
...rest,
|
|
46
46
|
className: cx("\u{1F95D}-button", "\u{1F95D}-select", props.className),
|
package/dist/bricks/Spinner.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { Role } from "@ariakit/react/role";
|
|
3
3
|
import cx from "classnames";
|
|
4
4
|
import { VisuallyHidden } from "./VisuallyHidden.js";
|
|
5
5
|
import { forwardRef } from "./~utils.js";
|
|
@@ -12,7 +12,7 @@ const Spinner = forwardRef(
|
|
|
12
12
|
...rest
|
|
13
13
|
} = props;
|
|
14
14
|
return /* @__PURE__ */ jsxs(
|
|
15
|
-
|
|
15
|
+
Role,
|
|
16
16
|
{
|
|
17
17
|
...rest,
|
|
18
18
|
"data-kiwi-size": size,
|
package/dist/bricks/Switch.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type CheckboxProps as AkCheckboxProps } from "@ariakit/react/checkbox";
|
|
2
2
|
import { type FocusableProps } from "./~utils.js";
|
|
3
3
|
type InputBaseProps = Omit<FocusableProps<"input">, "defaultValue" | "value">;
|
|
4
|
-
type CheckboxOwnProps = Pick<
|
|
4
|
+
type CheckboxOwnProps = Pick<AkCheckboxProps, "value" | "defaultChecked" | "checked" | "onChange">;
|
|
5
5
|
interface SwitchProps extends InputBaseProps, CheckboxOwnProps {
|
|
6
6
|
/** The default checked state of the toggle switch. */
|
|
7
7
|
defaultChecked?: boolean;
|
package/dist/bricks/Switch.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
Checkbox as AkCheckbox
|
|
5
|
+
} from "@ariakit/react/checkbox";
|
|
4
6
|
import { FieldControl } from "./Field.js";
|
|
5
7
|
import { forwardRef } from "./~utils.js";
|
|
6
8
|
const Switch = forwardRef(
|
|
@@ -12,7 +14,7 @@ const Switch = forwardRef(
|
|
|
12
14
|
type: "checkable",
|
|
13
15
|
id,
|
|
14
16
|
render: /* @__PURE__ */ jsx(
|
|
15
|
-
|
|
17
|
+
AkCheckbox,
|
|
16
18
|
{
|
|
17
19
|
accessibleWhenDisabled: true,
|
|
18
20
|
...rest,
|
package/dist/bricks/Table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { Role } from "@ariakit/react/role";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { forwardRef } from "./~utils.js";
|
|
@@ -12,7 +12,7 @@ const Table = forwardRef((props, forwardedRef) => {
|
|
|
12
12
|
const [captionId, setCaptionId] = React.useState();
|
|
13
13
|
const tableContext = React.useMemo(() => ({ setCaptionId }), []);
|
|
14
14
|
return /* @__PURE__ */ jsx(TableContext.Provider, { value: tableContext, children: /* @__PURE__ */ jsx(
|
|
15
|
-
|
|
15
|
+
Role,
|
|
16
16
|
{
|
|
17
17
|
...props,
|
|
18
18
|
className: cx("\u{1F95D}-table", props.className),
|
|
@@ -27,7 +27,7 @@ const TableHeaderContext = React.createContext(false);
|
|
|
27
27
|
const TableHeader = forwardRef(
|
|
28
28
|
(props, forwardedRef) => {
|
|
29
29
|
return /* @__PURE__ */ jsx(TableHeaderContext.Provider, { value: true, children: /* @__PURE__ */ jsx(
|
|
30
|
-
|
|
30
|
+
Role.div,
|
|
31
31
|
{
|
|
32
32
|
...props,
|
|
33
33
|
className: cx("\u{1F95D}-table-header", props.className),
|
|
@@ -40,7 +40,7 @@ const TableHeader = forwardRef(
|
|
|
40
40
|
);
|
|
41
41
|
const TableBody = forwardRef((props, forwardedRef) => {
|
|
42
42
|
return /* @__PURE__ */ jsx(
|
|
43
|
-
|
|
43
|
+
Role.div,
|
|
44
44
|
{
|
|
45
45
|
...props,
|
|
46
46
|
className: cx("\u{1F95D}-table-body", props.className),
|
|
@@ -52,7 +52,7 @@ const TableBody = forwardRef((props, forwardedRef) => {
|
|
|
52
52
|
const TableRow = forwardRef((props, forwardedRef) => {
|
|
53
53
|
const { children, ...rest } = props;
|
|
54
54
|
return /* @__PURE__ */ jsx(
|
|
55
|
-
|
|
55
|
+
Role.div,
|
|
56
56
|
{
|
|
57
57
|
...rest,
|
|
58
58
|
className: cx("\u{1F95D}-table-row", props.className),
|
|
@@ -74,7 +74,7 @@ const TableCaption = forwardRef(
|
|
|
74
74
|
[id, setCaptionId]
|
|
75
75
|
);
|
|
76
76
|
return /* @__PURE__ */ jsx(
|
|
77
|
-
|
|
77
|
+
Role,
|
|
78
78
|
{
|
|
79
79
|
...rest,
|
|
80
80
|
id,
|
|
@@ -88,7 +88,7 @@ const TableCaption = forwardRef(
|
|
|
88
88
|
const TableCell = forwardRef((props, forwardedRef) => {
|
|
89
89
|
const isWithinTableHeader = React.useContext(TableHeaderContext);
|
|
90
90
|
return /* @__PURE__ */ jsx(
|
|
91
|
-
|
|
91
|
+
Role.span,
|
|
92
92
|
{
|
|
93
93
|
...props,
|
|
94
94
|
className: cx("\u{1F95D}-table-cell", props.className),
|
package/dist/bricks/Tabs.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as AkTab from "@ariakit/react/tab";
|
|
3
3
|
import { type FocusableProps, type BaseProps } from "./~utils.js";
|
|
4
|
-
interface TabsProps extends Pick<
|
|
4
|
+
interface TabsProps extends Pick<AkTab.TabProviderProps, "defaultSelectedId" | "selectedId" | "setSelectedId" | "selectOnMove" | "children"> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* A set of tabs that can be used to switch between different views.
|
|
@@ -53,7 +53,7 @@ interface TabListProps extends BaseProps {
|
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
declare const TabList: React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<HTMLElement | HTMLDivElement>>;
|
|
56
|
-
interface TabProps extends FocusableProps<"button">, Pick<
|
|
56
|
+
interface TabProps extends FocusableProps<"button">, Pick<AkTab.TabProps, "id"> {
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* An individual tab button that switches the selected tab panel when clicked.
|
|
@@ -67,7 +67,7 @@ interface TabProps extends FocusableProps<"button">, Pick<Ariakit.TabProps, "id"
|
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
69
|
declare const Tab: React.ForwardRefExoticComponent<TabProps & React.RefAttributes<HTMLElement | HTMLButtonElement>>;
|
|
70
|
-
interface TabPanelProps extends FocusableProps<"div">, Pick<
|
|
70
|
+
interface TabPanelProps extends FocusableProps<"div">, Pick<AkTab.TabPanelProps, "tabId" | "unmountOnHide" | "focusable"> {
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* The actual content of a tab, shown when the tab is selected. Should be used as a child of `Tabs.Root`.
|
package/dist/bricks/Tabs.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as ReactDOM from "react-dom";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import * as
|
|
5
|
+
import * as AkTab from "@ariakit/react/tab";
|
|
6
6
|
import { useControlledState } from "./~hooks.js";
|
|
7
7
|
import { forwardRef } from "./~utils.js";
|
|
8
8
|
function Tabs(props) {
|
|
@@ -19,7 +19,7 @@ function Tabs(props) {
|
|
|
19
19
|
setSelectedIdProp
|
|
20
20
|
);
|
|
21
21
|
return /* @__PURE__ */ jsx(
|
|
22
|
-
|
|
22
|
+
AkTab.TabProvider,
|
|
23
23
|
{
|
|
24
24
|
selectedId,
|
|
25
25
|
setSelectedId: React.useCallback(
|
|
@@ -45,7 +45,7 @@ const TabList = forwardRef((props, forwardedRef) => {
|
|
|
45
45
|
const { tone = "neutral", ...rest } = props;
|
|
46
46
|
const viewTransitionName = `\u{1F95D}active-stripe-${React.useId().replaceAll(":", "_")}`;
|
|
47
47
|
return /* @__PURE__ */ jsx(
|
|
48
|
-
|
|
48
|
+
AkTab.TabList,
|
|
49
49
|
{
|
|
50
50
|
...rest,
|
|
51
51
|
"data-kiwi-tone": tone,
|
|
@@ -60,7 +60,7 @@ const TabList = forwardRef((props, forwardedRef) => {
|
|
|
60
60
|
});
|
|
61
61
|
const Tab = forwardRef((props, forwardedRef) => {
|
|
62
62
|
return /* @__PURE__ */ jsx(
|
|
63
|
-
|
|
63
|
+
AkTab.Tab,
|
|
64
64
|
{
|
|
65
65
|
accessibleWhenDisabled: true,
|
|
66
66
|
...props,
|
|
@@ -71,7 +71,7 @@ const Tab = forwardRef((props, forwardedRef) => {
|
|
|
71
71
|
});
|
|
72
72
|
const TabPanel = forwardRef((props, forwardedRef) => {
|
|
73
73
|
return /* @__PURE__ */ jsx(
|
|
74
|
-
|
|
74
|
+
AkTab.TabPanel,
|
|
75
75
|
{
|
|
76
76
|
...props,
|
|
77
77
|
className: cx("\u{1F95D}-tab-panel", props.className),
|
package/dist/bricks/Text.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { Role } from "@ariakit/react/role";
|
|
3
3
|
import cx from "classnames";
|
|
4
4
|
import { forwardRef } from "./~utils.js";
|
|
5
5
|
const Text = forwardRef((props, forwardedRef) => {
|
|
6
6
|
const { variant, ...rest } = props;
|
|
7
7
|
return /* @__PURE__ */ jsx(
|
|
8
|
-
|
|
8
|
+
Role,
|
|
9
9
|
{
|
|
10
10
|
...rest,
|
|
11
11
|
className: cx("\u{1F95D}-text", props.className),
|
package/dist/bricks/TextBox.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import
|
|
3
|
+
import { Role } from "@ariakit/react/role";
|
|
4
|
+
import { Focusable } from "@ariakit/react/focusable";
|
|
4
5
|
import cx from "classnames";
|
|
5
6
|
import { FieldControl } from "./Field.js";
|
|
6
7
|
import { Icon } from "./Icon.js";
|
|
@@ -20,14 +21,14 @@ const TextBoxInput = forwardRef(
|
|
|
20
21
|
type: "textlike",
|
|
21
22
|
id,
|
|
22
23
|
render: /* @__PURE__ */ jsx(
|
|
23
|
-
|
|
24
|
+
Role.input,
|
|
24
25
|
{
|
|
25
26
|
readOnly: props.disabled,
|
|
26
27
|
...rest,
|
|
27
28
|
className: cx({ "\u{1F95D}-text-box": !rootContext }, props.className),
|
|
28
29
|
placeholder: props.placeholder ?? " ",
|
|
29
30
|
render: /* @__PURE__ */ jsx(
|
|
30
|
-
|
|
31
|
+
Focusable,
|
|
31
32
|
{
|
|
32
33
|
accessibleWhenDisabled: true,
|
|
33
34
|
render: props.render || /* @__PURE__ */ jsx("input", {})
|
|
@@ -49,14 +50,14 @@ const TextBoxTextarea = forwardRef(
|
|
|
49
50
|
type: "textlike",
|
|
50
51
|
id,
|
|
51
52
|
render: /* @__PURE__ */ jsx(
|
|
52
|
-
|
|
53
|
+
Role.textarea,
|
|
53
54
|
{
|
|
54
55
|
readOnly: props.disabled,
|
|
55
56
|
...rest,
|
|
56
57
|
className: cx("\u{1F95D}-text-box", props.className),
|
|
57
58
|
placeholder: props.placeholder ?? " ",
|
|
58
59
|
render: /* @__PURE__ */ jsx(
|
|
59
|
-
|
|
60
|
+
Focusable,
|
|
60
61
|
{
|
|
61
62
|
accessibleWhenDisabled: true,
|
|
62
63
|
render: props.render || /* @__PURE__ */ jsx("textarea", {})
|
|
@@ -78,7 +79,7 @@ const TextBoxRoot = forwardRef(
|
|
|
78
79
|
{
|
|
79
80
|
value: React.useMemo(() => ({ setDisabled, inputRef }), []),
|
|
80
81
|
children: /* @__PURE__ */ jsx(
|
|
81
|
-
|
|
82
|
+
Role.div,
|
|
82
83
|
{
|
|
83
84
|
...props,
|
|
84
85
|
"data-kiwi-disabled": disabled,
|
|
@@ -113,7 +114,7 @@ const TextBoxIcon = forwardRef(
|
|
|
113
114
|
const TextBoxText = forwardRef(
|
|
114
115
|
(props, forwardedRef) => {
|
|
115
116
|
return /* @__PURE__ */ jsx(
|
|
116
|
-
|
|
117
|
+
Role.span,
|
|
117
118
|
{
|
|
118
119
|
...props,
|
|
119
120
|
className: cx("\u{1F95D}-text-box-decoration", props.className),
|
package/dist/bricks/Tooltip.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as AkTooltip from "@ariakit/react/tooltip";
|
|
3
3
|
import { type FocusableProps } from "./~utils.js";
|
|
4
|
-
interface TooltipProps extends Omit<FocusableProps<"div">, "content">, Pick<
|
|
4
|
+
interface TooltipProps extends Omit<FocusableProps<"div">, "content">, Pick<AkTooltip.TooltipProps, "open" | "unmountOnHide">, Pick<AkTooltip.TooltipProviderProps, "defaultOpen" | "setOpen"> {
|
|
5
5
|
/**
|
|
6
6
|
* The content to be displayed inside the tooltip when the trigger element is hovered or focused.
|
|
7
7
|
*/
|
package/dist/bricks/Tooltip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import cx from "classnames";
|
|
4
|
-
import * as
|
|
4
|
+
import * as AkTooltip from "@ariakit/react/tooltip";
|
|
5
5
|
import { forwardRef } from "./~utils.js";
|
|
6
6
|
import { usePopoverApi } from "./~hooks.js";
|
|
7
7
|
const Tooltip = forwardRef(
|
|
@@ -18,10 +18,10 @@ const Tooltip = forwardRef(
|
|
|
18
18
|
unmountOnHide = type === "none",
|
|
19
19
|
...rest
|
|
20
20
|
} = props;
|
|
21
|
-
const store =
|
|
21
|
+
const store = AkTooltip.useTooltipStore();
|
|
22
22
|
const popover = usePopoverApi(store);
|
|
23
23
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
24
|
-
|
|
24
|
+
AkTooltip.TooltipProvider,
|
|
25
25
|
{
|
|
26
26
|
store,
|
|
27
27
|
defaultOpen: defaultOpenProp,
|
|
@@ -29,7 +29,7 @@ const Tooltip = forwardRef(
|
|
|
29
29
|
setOpen: setOpenProp,
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ jsx(
|
|
32
|
-
|
|
32
|
+
AkTooltip.TooltipAnchor,
|
|
33
33
|
{
|
|
34
34
|
render: children,
|
|
35
35
|
...type === "description" && { "aria-describedby": id },
|
|
@@ -37,7 +37,7 @@ const Tooltip = forwardRef(
|
|
|
37
37
|
}
|
|
38
38
|
),
|
|
39
39
|
/* @__PURE__ */ jsx(
|
|
40
|
-
|
|
40
|
+
AkTooltip.Tooltip,
|
|
41
41
|
{
|
|
42
42
|
"aria-hidden": "true",
|
|
43
43
|
...rest,
|
package/dist/bricks/Tree.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { IconButton } from "./IconButton.js";
|
|
3
1
|
import { type BaseProps } from "./~utils.js";
|
|
2
|
+
import { Root as TreeItemRoot, Action as TreeItemAction } from "./TreeItem.js";
|
|
4
3
|
interface TreeProps extends BaseProps {
|
|
5
4
|
}
|
|
6
5
|
/**
|
|
@@ -19,111 +18,5 @@ interface TreeProps extends BaseProps {
|
|
|
19
18
|
* </Tree.Root>
|
|
20
19
|
* ```
|
|
21
20
|
*/
|
|
22
|
-
declare const Tree:
|
|
23
|
-
|
|
24
|
-
/** Specifies the nesting level of the tree item. Nesting levels start at 1. */
|
|
25
|
-
"aria-level": number;
|
|
26
|
-
/** Defines tree item position in the current level of tree items. Integer greater than or equal to 1. */
|
|
27
|
-
"aria-posinset": number;
|
|
28
|
-
/** Defines tree item set size of the current level. */
|
|
29
|
-
"aria-setsize": number;
|
|
30
|
-
/**
|
|
31
|
-
* Specifies if the tree item is selected.
|
|
32
|
-
*
|
|
33
|
-
* If `undefined`, the tree item is not selectable.
|
|
34
|
-
*
|
|
35
|
-
* @default undefined
|
|
36
|
-
*/
|
|
37
|
-
selected?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Callback fired when the tree item is selected.
|
|
40
|
-
*
|
|
41
|
-
* Should be used with the `selected` prop.
|
|
42
|
-
*/
|
|
43
|
-
onSelectedChange?: (selected: boolean) => void;
|
|
44
|
-
/**
|
|
45
|
-
* Specifies if the tree item is expanded.
|
|
46
|
-
*
|
|
47
|
-
* Used to determine if a tree item is a parent node. If `undefined`, it is a leaf node (i.e. not expandable).
|
|
48
|
-
*
|
|
49
|
-
* @default undefined
|
|
50
|
-
* */
|
|
51
|
-
expanded?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Callback fired when the tree item is expanded.
|
|
54
|
-
*
|
|
55
|
-
* Should be used with the `expanded` prop.
|
|
56
|
-
*/
|
|
57
|
-
onExpandedChange?: (expanded: boolean) => void;
|
|
58
|
-
/**
|
|
59
|
-
* Icon to be displayed inside the tree item.
|
|
60
|
-
*
|
|
61
|
-
* Can be a URL of an SVG from the `@itwin/itwinui-icons` package, or a JSX element.
|
|
62
|
-
*/
|
|
63
|
-
icon?: string | React.JSX.Element;
|
|
64
|
-
/**
|
|
65
|
-
* The primary label that identifies the tree item and is displayed inside it.
|
|
66
|
-
*/
|
|
67
|
-
label?: React.ReactNode;
|
|
68
|
-
/** Secondary line of text to display additional information about the tree item. */
|
|
69
|
-
description?: React.ReactNode;
|
|
70
|
-
/**
|
|
71
|
-
* The actions available for the tree item. Must be a list of `Tree.ItemAction` components.
|
|
72
|
-
*
|
|
73
|
-
* Example:
|
|
74
|
-
* ```tsx
|
|
75
|
-
* actions={[
|
|
76
|
-
* <Tree.ItemAction key={…} icon={…} label={…} />,
|
|
77
|
-
* <Tree.ItemAction key={…} icon={…} label={…} />,
|
|
78
|
-
* ]}
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
actions?: React.ReactNode[];
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* A treeitem is a node in a tree structure that may be expanded or collapsed to reveal or hide its descendants.
|
|
85
|
-
*
|
|
86
|
-
* `Tree.Item`s can be rendered inside a `Tree.Root`. Additional properties are specified to the `Tree.Item`s to create a hierarchical tree structure.
|
|
87
|
-
*
|
|
88
|
-
* Example:
|
|
89
|
-
* ```tsx
|
|
90
|
-
* <Tree.Root>
|
|
91
|
-
* <Tree.Item label="Parent" aria-level={1} aria-posinset={1} aria-setsize={1} />
|
|
92
|
-
* <Tree.Item label="Child 1" aria-level={2} aria-posinset={1} aria-setsize={2} />
|
|
93
|
-
* <Tree.Item label="Child 2" aria-level={2} aria-posinset={2} aria-setsize={2} />
|
|
94
|
-
* </Tree.Root>
|
|
95
|
-
* ```
|
|
96
|
-
*
|
|
97
|
-
* The `label` and `icon` props can be used to specify the treeitem's own content.
|
|
98
|
-
*
|
|
99
|
-
* The `aria-level` prop is used to specify the nesting level of the treeitem. Nesting levels start at 1.
|
|
100
|
-
*
|
|
101
|
-
* The `aria-posinset` and `aria-setsize` props are used to define the treeitem's position in the current level of tree items.
|
|
102
|
-
*
|
|
103
|
-
* The `expanded` and `onExpandedChange` props can be used to control the expansion state of a treeitem.
|
|
104
|
-
*
|
|
105
|
-
* The `selected` and `onSelectedChange` props can be used to control the selection state of a treeitem.
|
|
106
|
-
*
|
|
107
|
-
* Secondary actions can be passed into the `actions` prop.
|
|
108
|
-
*/
|
|
109
|
-
declare const TreeItem: React.ForwardRefExoticComponent<TreeItemProps & React.RefAttributes<HTMLElement | HTMLDivElement>>;
|
|
110
|
-
type IconButtonProps = React.ComponentProps<typeof IconButton>;
|
|
111
|
-
interface TreeItemActionProps extends BaseProps<"button">, Pick<IconButtonProps, "label" | "icon"> {
|
|
112
|
-
/**
|
|
113
|
-
* Controls the visibility of the action.
|
|
114
|
-
*
|
|
115
|
-
* If `true`, the action is always visible.
|
|
116
|
-
* If `false`, the action is hidden and becomes inaccessible, but still occupies space.
|
|
117
|
-
*
|
|
118
|
-
* By default, the action is shown only when the treeitem receives hover/focus.
|
|
119
|
-
*/
|
|
120
|
-
visible?: boolean;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* A secondary action for `<Tree.Item>`, to be passed into the `actions` prop. The action is typically
|
|
124
|
-
* displayed as an icon-button on the right end of the treeitem.
|
|
125
|
-
*
|
|
126
|
-
* By default, the action appears only on hover/focus. This can be controlled by the `visible` prop.
|
|
127
|
-
*/
|
|
128
|
-
declare const TreeItemAction: React.ForwardRefExoticComponent<TreeItemActionProps & React.RefAttributes<HTMLElement | HTMLButtonElement>>;
|
|
129
|
-
export { Tree as Root, TreeItem as Item, TreeItemAction as ItemAction };
|
|
21
|
+
declare const Tree: import("react").ForwardRefExoticComponent<TreeProps & import("react").RefAttributes<HTMLElement | HTMLDivElement>>;
|
|
22
|
+
export { Tree as Root, TreeItemRoot as Item, TreeItemAction as ItemAction };
|