@itwin/itwinui-react 5.0.0-alpha.0 → 5.0.0-alpha.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/CHANGELOG.md +14 -0
- package/dist/DEV/bricks/Anchor.js +20 -22
- package/dist/DEV/bricks/Button.js +17 -15
- package/dist/DEV/bricks/Checkbox.js +16 -14
- package/dist/DEV/bricks/Divider.js +14 -16
- package/dist/DEV/bricks/DropdownMenu.js +60 -44
- package/dist/DEV/bricks/Field.js +14 -15
- package/dist/DEV/bricks/Icon.js +45 -44
- package/dist/DEV/bricks/IconButton.js +21 -19
- package/dist/DEV/bricks/Kbd.js +14 -16
- package/dist/DEV/bricks/Label.js +2 -2
- package/dist/DEV/bricks/ListItem.js +16 -16
- package/dist/DEV/bricks/Radio.js +2 -2
- package/dist/DEV/bricks/Root.js +45 -43
- package/dist/DEV/bricks/Select.js +55 -0
- package/dist/DEV/bricks/Switch.js +17 -15
- package/dist/DEV/bricks/Tabs.js +14 -15
- package/dist/DEV/bricks/Text.js +20 -0
- package/dist/DEV/bricks/TextBox.js +52 -45
- package/dist/DEV/bricks/Textarea.js +22 -20
- package/dist/DEV/bricks/Tooltip.js +65 -57
- package/dist/DEV/bricks/Tree.js +70 -64
- package/dist/DEV/bricks/VisuallyHidden.js +6 -4
- package/dist/DEV/bricks/index.js +4 -0
- package/dist/DEV/bricks/styles.css.js +1 -1
- package/dist/DEV/bricks/~utils.js +3 -0
- package/dist/bricks/Anchor.d.ts +12 -3
- package/dist/bricks/Anchor.js +20 -22
- package/dist/bricks/Button.d.ts +27 -4
- package/dist/bricks/Button.js +17 -15
- package/dist/bricks/Checkbox.d.ts +17 -3
- package/dist/bricks/Checkbox.js +16 -14
- package/dist/bricks/Divider.d.ts +3 -4
- package/dist/bricks/Divider.js +14 -16
- package/dist/bricks/DropdownMenu.d.ts +60 -10
- package/dist/bricks/DropdownMenu.js +60 -44
- package/dist/bricks/Field.d.ts +22 -2
- package/dist/bricks/Field.js +14 -15
- package/dist/bricks/Icon.d.ts +4 -4
- package/dist/bricks/Icon.js +44 -43
- package/dist/bricks/IconButton.d.ts +4 -4
- package/dist/bricks/IconButton.js +21 -19
- package/dist/bricks/Kbd.d.ts +2 -3
- package/dist/bricks/Kbd.js +14 -16
- package/dist/bricks/Label.d.ts +22 -3
- package/dist/bricks/Label.js +2 -2
- package/dist/bricks/ListItem.d.ts +2 -3
- package/dist/bricks/ListItem.js +15 -15
- package/dist/bricks/Radio.d.ts +17 -3
- package/dist/bricks/Radio.js +2 -2
- package/dist/bricks/Root.d.ts +11 -2
- package/dist/bricks/Root.js +45 -43
- package/dist/bricks/Select.d.ts +45 -0
- package/dist/bricks/Select.js +55 -0
- package/dist/bricks/Switch.d.ts +17 -3
- package/dist/bricks/Switch.js +17 -15
- package/dist/bricks/Tabs.d.ts +65 -4
- package/dist/bricks/Tabs.js +14 -15
- package/dist/bricks/Text.d.ts +22 -0
- package/dist/bricks/Text.js +19 -0
- package/dist/bricks/TextBox.d.ts +39 -9
- package/dist/bricks/TextBox.js +52 -45
- package/dist/bricks/Textarea.d.ts +14 -4
- package/dist/bricks/Textarea.js +22 -20
- package/dist/bricks/Tooltip.d.ts +11 -4
- package/dist/bricks/Tooltip.js +65 -57
- package/dist/bricks/Tree.d.ts +5 -5
- package/dist/bricks/Tree.js +67 -61
- package/dist/bricks/VisuallyHidden.d.ts +15 -3
- package/dist/bricks/VisuallyHidden.js +6 -4
- package/dist/bricks/index.d.ts +2 -0
- package/dist/bricks/index.js +4 -0
- package/dist/bricks/styles.css.js +1 -1
- package/dist/bricks/~utils.d.ts +20 -0
- package/dist/bricks/~utils.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 5.0.0-alpha.1
|
|
4
|
+
|
|
5
|
+
- Added `<Text>` component with a `variant` prop to support all text styles from Figma.
|
|
6
|
+
- Added `Select` component built on top of the HTML `<select>` element. Exposed as `<Select.Root>` and `<Select.HtmlSelect>`.
|
|
7
|
+
- Added `shortcuts` prop to `<DropdownMenu.Item>`.
|
|
8
|
+
- Added JSDoc comments to all components for inline IDE hints.
|
|
9
|
+
- Fixed `<Kbd>` component using the wrong font.
|
|
10
|
+
- Fixed some visual issues.
|
|
11
|
+
|
|
12
|
+
## 5.0.0-alpha.0
|
|
13
|
+
|
|
14
|
+
Initial release 🥳
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import cx from "classnames";
|
|
4
3
|
import * as Ariakit from "@ariakit/react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
4
|
+
import { forwardRef } from "./~utils.js";
|
|
5
|
+
const Anchor = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const { tone = "neutral", ...rest } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
Ariakit.Role.a,
|
|
9
|
+
{
|
|
10
|
+
"data-kiwi-tone": tone,
|
|
11
|
+
...rest,
|
|
12
|
+
className: cx("\u{1F95D}-anchor", props.className),
|
|
13
|
+
render: /* @__PURE__ */ jsx(
|
|
14
|
+
Ariakit.Focusable,
|
|
15
|
+
{
|
|
16
|
+
accessibleWhenDisabled: true,
|
|
17
|
+
render: props.render || /* @__PURE__ */ jsx("a", {})
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
ref: forwardedRef
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
});
|
|
26
24
|
DEV: Anchor.displayName = "Anchor";
|
|
27
25
|
export {
|
|
28
26
|
Anchor
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import cx from "classnames";
|
|
4
3
|
import * as Ariakit from "@ariakit/react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
4
|
+
import { forwardRef } from "./~utils.js";
|
|
5
|
+
const Button = forwardRef(
|
|
6
|
+
(props, forwardedRef) => {
|
|
7
|
+
const { variant = "solid", tone = "neutral", ...rest } = props;
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Ariakit.Button,
|
|
10
|
+
{
|
|
11
|
+
accessibleWhenDisabled: true,
|
|
12
|
+
"data-kiwi-variant": variant,
|
|
13
|
+
"data-kiwi-tone": tone,
|
|
14
|
+
...rest,
|
|
15
|
+
className: cx("\u{1F95D}-button", props.className),
|
|
16
|
+
ref: forwardedRef
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
);
|
|
19
21
|
DEV: Button.displayName = "Button";
|
|
20
22
|
export {
|
|
21
23
|
Button
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import cx from "classnames";
|
|
4
3
|
import * as Ariakit from "@ariakit/react";
|
|
5
4
|
import { useFieldId } from "./Field.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
5
|
+
import { forwardRef } from "./~utils.js";
|
|
6
|
+
const Checkbox = forwardRef(
|
|
7
|
+
(props, forwardedRef) => {
|
|
8
|
+
const fieldId = useFieldId();
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
Ariakit.Checkbox,
|
|
11
|
+
{
|
|
12
|
+
accessibleWhenDisabled: true,
|
|
13
|
+
id: fieldId,
|
|
14
|
+
...props,
|
|
15
|
+
className: cx("\u{1F95D}-checkbox", props.className),
|
|
16
|
+
ref: forwardedRef
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
);
|
|
19
21
|
DEV: Checkbox.displayName = "Checkbox";
|
|
20
22
|
export {
|
|
21
23
|
Checkbox
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import cx from "classnames";
|
|
4
3
|
import * as Ariakit from "@ariakit/react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
4
|
+
import { forwardRef } from "./~utils.js";
|
|
5
|
+
const Divider = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const { presentational, ...rest } = props;
|
|
7
|
+
const Comp = presentational ? Ariakit.Role : Ariakit.Separator;
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Comp,
|
|
10
|
+
{
|
|
11
|
+
...rest,
|
|
12
|
+
className: cx("\u{1F95D}-divider", props.className),
|
|
13
|
+
"data-kiwi-orientation": props.orientation,
|
|
14
|
+
ref: forwardedRef
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
});
|
|
20
18
|
DEV: Divider.displayName = "Divider";
|
|
21
19
|
export {
|
|
22
20
|
Divider
|
|
@@ -4,8 +4,9 @@ import cx from "classnames";
|
|
|
4
4
|
import * as Ariakit from "@ariakit/react";
|
|
5
5
|
import * as ListItem from "./ListItem.js";
|
|
6
6
|
import { Button } from "./Button.js";
|
|
7
|
+
import { Kbd } from "./Kbd.js";
|
|
7
8
|
import { DisclosureArrow } from "./Icon.js";
|
|
8
|
-
import { supportsPopover } from "./~utils.js";
|
|
9
|
+
import { forwardRef, supportsPopover } from "./~utils.js";
|
|
9
10
|
function DropdownMenu(props) {
|
|
10
11
|
const {
|
|
11
12
|
children,
|
|
@@ -15,8 +16,8 @@ function DropdownMenu(props) {
|
|
|
15
16
|
defaultOpen: defaultOpenProp
|
|
16
17
|
} = props;
|
|
17
18
|
const store = Ariakit.useMenuStore();
|
|
18
|
-
const open = Ariakit.useStoreState(store, (
|
|
19
|
-
const popover = Ariakit.useStoreState(store, (
|
|
19
|
+
const open = Ariakit.useStoreState(store, (state) => state.open);
|
|
20
|
+
const popover = Ariakit.useStoreState(store, (state) => state.popoverElement);
|
|
20
21
|
React.useEffect(
|
|
21
22
|
function syncPopoverWithOpenState() {
|
|
22
23
|
if (popover?.isConnected) {
|
|
@@ -38,49 +39,64 @@ function DropdownMenu(props) {
|
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
DEV: DropdownMenu.displayName = "DropdownMenu.Root";
|
|
41
|
-
const DropdownMenuContent =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
const DropdownMenuContent = forwardRef(
|
|
43
|
+
(props, forwardedRef) => {
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Ariakit.Menu,
|
|
46
|
+
{
|
|
47
|
+
portal: !supportsPopover,
|
|
48
|
+
unmountOnHide: true,
|
|
49
|
+
...props,
|
|
50
|
+
style: { zIndex: supportsPopover ? void 0 : 9999, ...props.style },
|
|
51
|
+
wrapperProps: { popover: "manual" },
|
|
52
|
+
className: cx("\u{1F95D}-dropdown-menu", props.className),
|
|
53
|
+
ref: forwardedRef
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
55
58
|
DEV: DropdownMenuContent.displayName = "DropdownMenu.Content";
|
|
56
|
-
const DropdownMenuButton =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
children
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
const DropdownMenuButton = forwardRef(
|
|
60
|
+
(props, forwardedRef) => {
|
|
61
|
+
const { accessibleWhenDisabled = true, children, ...rest } = props;
|
|
62
|
+
return /* @__PURE__ */ jsx(
|
|
63
|
+
Ariakit.MenuButton,
|
|
64
|
+
{
|
|
65
|
+
accessibleWhenDisabled: true,
|
|
66
|
+
render: /* @__PURE__ */ jsxs(Button, { accessibleWhenDisabled, children: [
|
|
67
|
+
children,
|
|
68
|
+
/* @__PURE__ */ jsx(DisclosureArrow, {})
|
|
69
|
+
] }),
|
|
70
|
+
...rest,
|
|
71
|
+
className: cx("\u{1F95D}-dropdown-menu-button", props.className),
|
|
72
|
+
ref: forwardedRef
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
72
77
|
DEV: DropdownMenuButton.displayName = "DropdownMenu.Button";
|
|
73
|
-
const DropdownMenuItem =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
const DropdownMenuItem = forwardRef(
|
|
79
|
+
(props, forwardedRef) => {
|
|
80
|
+
const { shortcuts, ...rest } = props;
|
|
81
|
+
const shortcutKeys = React.useMemo(() => {
|
|
82
|
+
return typeof shortcuts === "string" ? shortcuts.split("+").map((key) => key.trim()) : [];
|
|
83
|
+
}, [shortcuts]);
|
|
84
|
+
const hasShortcuts = shortcutKeys.length > 0;
|
|
85
|
+
return /* @__PURE__ */ jsxs(
|
|
86
|
+
Ariakit.MenuItem,
|
|
87
|
+
{
|
|
88
|
+
accessibleWhenDisabled: true,
|
|
89
|
+
...rest,
|
|
90
|
+
render: /* @__PURE__ */ jsx(ListItem.Root, { render: props.render }),
|
|
91
|
+
ref: forwardedRef,
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ jsx(ListItem.Content, { children: props.children }),
|
|
94
|
+
hasShortcuts && /* @__PURE__ */ jsx("span", { className: "\u{1F95D}-dropdown-menu-item-shortcuts", children: shortcutKeys.map((key, index) => /* @__PURE__ */ jsx(Kbd, { variant: "ghost", children: key }, `${key + index}`)) })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
);
|
|
84
100
|
DEV: DropdownMenuItem.displayName = "DropdownMenu.Item";
|
|
85
101
|
export {
|
|
86
102
|
DropdownMenuButton as Button,
|
package/dist/DEV/bricks/Field.js
CHANGED
|
@@ -2,21 +2,20 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as Ariakit from "@ariakit/react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
5
|
+
import { forwardRef } from "./~utils.js";
|
|
6
|
+
const Field = forwardRef((props, forwardedRef) => {
|
|
7
|
+
const fieldId = React.useId();
|
|
8
|
+
const { className, layout, ...rest } = props;
|
|
9
|
+
return /* @__PURE__ */ jsx(FieldIdContext.Provider, { value: fieldId, children: /* @__PURE__ */ jsx(
|
|
10
|
+
Ariakit.Role,
|
|
11
|
+
{
|
|
12
|
+
...rest,
|
|
13
|
+
className: cx("\u{1F95D}-field", className),
|
|
14
|
+
"data-kiwi-layout": layout,
|
|
15
|
+
ref: forwardedRef
|
|
16
|
+
}
|
|
17
|
+
) });
|
|
18
|
+
});
|
|
20
19
|
DEV: Field.displayName = "Field";
|
|
21
20
|
const FieldIdContext = React.createContext(void 0);
|
|
22
21
|
function useFieldId() {
|
package/dist/DEV/bricks/Icon.js
CHANGED
|
@@ -2,58 +2,59 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import cx from "classnames";
|
|
4
4
|
import * as Ariakit from "@ariakit/react";
|
|
5
|
-
|
|
5
|
+
import { forwardRef } from "./~utils.js";
|
|
6
|
+
const Icon = forwardRef((props, forwardedRef) => {
|
|
7
|
+
const { href, size = "regular", ...rest } = props;
|
|
8
|
+
const iconId = toIconId(size);
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
Ariakit.Role.svg,
|
|
11
|
+
{
|
|
12
|
+
"data-kiwi-size": size,
|
|
13
|
+
"aria-hidden": true,
|
|
14
|
+
...rest,
|
|
15
|
+
className: cx("\u{1F95D}-icon", props.className),
|
|
16
|
+
ref: forwardedRef,
|
|
17
|
+
children: /* @__PURE__ */ jsx("use", { href: `${props.href}#${iconId}` })
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
DEV: Icon.displayName = "Icon";
|
|
22
|
+
function toIconId(size) {
|
|
23
|
+
if (size === "large") return "icon-large";
|
|
24
|
+
return "icon";
|
|
25
|
+
}
|
|
26
|
+
const DisclosureArrow = forwardRef(
|
|
6
27
|
(props, forwardedRef) => {
|
|
7
|
-
const {
|
|
8
|
-
const
|
|
28
|
+
const { direction = "down", ...rest } = props;
|
|
29
|
+
const path = React.useMemo(() => {
|
|
30
|
+
switch (direction) {
|
|
31
|
+
case "down":
|
|
32
|
+
return /* @__PURE__ */ jsx("path", { d: "M8 10 5 7h6l-3 3Z" });
|
|
33
|
+
case "right":
|
|
34
|
+
return /* @__PURE__ */ jsx("path", { d: "M7 11V5l3 3-3 3Z" });
|
|
35
|
+
}
|
|
36
|
+
}, [direction]);
|
|
9
37
|
return /* @__PURE__ */ jsx(
|
|
10
|
-
|
|
38
|
+
Icon,
|
|
11
39
|
{
|
|
12
|
-
"data-kiwi-size": size,
|
|
13
|
-
"aria-hidden": true,
|
|
14
40
|
...rest,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
41
|
+
render: /* @__PURE__ */ jsx(
|
|
42
|
+
Ariakit.Role.svg,
|
|
43
|
+
{
|
|
44
|
+
width: "16",
|
|
45
|
+
height: "16",
|
|
46
|
+
fill: "currentColor",
|
|
47
|
+
viewBox: "0 0 16 16",
|
|
48
|
+
render: props.render,
|
|
49
|
+
children: path
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
className: cx("\u{1F95D}-disclosure-arrow", props.className),
|
|
53
|
+
ref: forwardedRef
|
|
18
54
|
}
|
|
19
55
|
);
|
|
20
56
|
}
|
|
21
57
|
);
|
|
22
|
-
DEV: Icon.displayName = "Icon";
|
|
23
|
-
function toIconId(size) {
|
|
24
|
-
if (size === "large") return "icon-large";
|
|
25
|
-
return "icon";
|
|
26
|
-
}
|
|
27
|
-
const DisclosureArrow = React.forwardRef((props, forwardedRef) => {
|
|
28
|
-
const { direction = "down", ...rest } = props;
|
|
29
|
-
const path = React.useMemo(() => {
|
|
30
|
-
switch (direction) {
|
|
31
|
-
case "down":
|
|
32
|
-
return /* @__PURE__ */ jsx("path", { d: "M8 10 5 7h6l-3 3Z" });
|
|
33
|
-
case "right":
|
|
34
|
-
return /* @__PURE__ */ jsx("path", { d: "M7 11V5l3 3-3 3Z" });
|
|
35
|
-
}
|
|
36
|
-
}, [direction]);
|
|
37
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
-
Icon,
|
|
39
|
-
{
|
|
40
|
-
...rest,
|
|
41
|
-
render: /* @__PURE__ */ jsx(
|
|
42
|
-
Ariakit.Role.svg,
|
|
43
|
-
{
|
|
44
|
-
width: "16",
|
|
45
|
-
height: "16",
|
|
46
|
-
fill: "currentColor",
|
|
47
|
-
viewBox: "0 0 16 16",
|
|
48
|
-
render: props.render,
|
|
49
|
-
children: path
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
className: cx("\u{1F95D}-disclosure-arrow", props.className),
|
|
53
|
-
ref: forwardedRef
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
});
|
|
57
58
|
DEV: DisclosureArrow.displayName = "DisclosureArrow";
|
|
58
59
|
export {
|
|
59
60
|
DisclosureArrow,
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import cx from "classnames";
|
|
4
3
|
import { Button } from "./Button.js";
|
|
5
4
|
import { VisuallyHidden } from "./VisuallyHidden.js";
|
|
6
5
|
import { Icon } from "./Icon.js";
|
|
7
6
|
import { Tooltip } from "./Tooltip.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
import { forwardRef } from "./~utils.js";
|
|
8
|
+
const IconButton = forwardRef(
|
|
9
|
+
(props, forwardedRef) => {
|
|
10
|
+
const { label, icon, isActive, labelVariant, ...rest } = props;
|
|
11
|
+
const button = /* @__PURE__ */ jsxs(
|
|
12
|
+
Button,
|
|
13
|
+
{
|
|
14
|
+
"aria-pressed": isActive,
|
|
15
|
+
...rest,
|
|
16
|
+
className: cx("\u{1F95D}-icon-button", props.className),
|
|
17
|
+
ref: forwardedRef,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: label }),
|
|
20
|
+
typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { href: icon }) : icon
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
if (labelVariant === "visually-hidden") {
|
|
25
|
+
return button;
|
|
21
26
|
}
|
|
22
|
-
|
|
23
|
-
if (labelVariant === "visually-hidden") {
|
|
24
|
-
return button;
|
|
27
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: label, type: "none", children: button });
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
});
|
|
29
|
+
);
|
|
28
30
|
DEV: IconButton.displayName = "IconButton";
|
|
29
31
|
export {
|
|
30
32
|
IconButton
|
package/dist/DEV/bricks/Kbd.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import cx from "classnames";
|
|
4
3
|
import * as Ariakit from "@ariakit/react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
4
|
+
import { forwardRef } from "./~utils.js";
|
|
5
|
+
const Kbd = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const { variant = "solid", ...rest } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
Ariakit.Role,
|
|
9
|
+
{
|
|
10
|
+
"data-kiwi-variant": variant,
|
|
11
|
+
...rest,
|
|
12
|
+
className: cx("\u{1F95D}-kbd", props.className),
|
|
13
|
+
render: props.render || /* @__PURE__ */ jsx("kbd", {}),
|
|
14
|
+
ref: forwardedRef
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
});
|
|
20
18
|
DEV: Kbd.displayName = "Kbd";
|
|
21
19
|
export {
|
|
22
20
|
Kbd
|
package/dist/DEV/bricks/Label.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import cx from "classnames";
|
|
4
3
|
import * as Ariakit from "@ariakit/react";
|
|
5
4
|
import { useFieldId } from "./Field.js";
|
|
6
|
-
|
|
5
|
+
import { forwardRef } from "./~utils.js";
|
|
6
|
+
const Label = forwardRef((props, forwardedRef) => {
|
|
7
7
|
const fieldId = useFieldId();
|
|
8
8
|
return /* @__PURE__ */ jsx(
|
|
9
9
|
Ariakit.Role.label,
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import cx from "classnames";
|
|
4
3
|
import * as Ariakit from "@ariakit/react";
|
|
5
|
-
|
|
4
|
+
import { forwardRef } from "./~utils.js";
|
|
5
|
+
const ListItem = forwardRef((props, forwardedRef) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
Ariakit.Role.div,
|
|
8
|
+
{
|
|
9
|
+
role: "listitem",
|
|
10
|
+
...props,
|
|
11
|
+
className: cx("\u{1F95D}-list-item", props.className),
|
|
12
|
+
ref: forwardedRef
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
DEV: ListItem.displayName = "ListItem.Root";
|
|
17
|
+
const ListItemContent = forwardRef(
|
|
6
18
|
(props, forwardedRef) => {
|
|
7
19
|
return /* @__PURE__ */ jsx(
|
|
8
|
-
Ariakit.Role.
|
|
20
|
+
Ariakit.Role.span,
|
|
9
21
|
{
|
|
10
|
-
role: "listitem",
|
|
11
22
|
...props,
|
|
12
|
-
className: cx("\u{1F95D}-list-item", props.className),
|
|
23
|
+
className: cx("\u{1F95D}-list-item-content", props.className),
|
|
13
24
|
ref: forwardedRef
|
|
14
25
|
}
|
|
15
26
|
);
|
|
16
27
|
}
|
|
17
28
|
);
|
|
18
|
-
DEV: ListItem.displayName = "ListItem.Root";
|
|
19
|
-
const ListItemContent = React.forwardRef((props, forwardedRef) => {
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
-
Ariakit.Role.span,
|
|
22
|
-
{
|
|
23
|
-
...props,
|
|
24
|
-
className: cx("\u{1F95D}-list-item-content", props.className),
|
|
25
|
-
ref: forwardedRef
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
});
|
|
29
29
|
DEV: ListItemContent.displayName = "ListItem.Content";
|
|
30
30
|
export {
|
|
31
31
|
ListItemContent as Content,
|
package/dist/DEV/bricks/Radio.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import cx from "classnames";
|
|
4
3
|
import * as Ariakit from "@ariakit/react";
|
|
5
4
|
import { useFieldId } from "./Field.js";
|
|
6
|
-
|
|
5
|
+
import { forwardRef } from "./~utils.js";
|
|
6
|
+
const Radio = forwardRef((props, forwardedRef) => {
|
|
7
7
|
const fieldId = useFieldId();
|
|
8
8
|
return /* @__PURE__ */ jsx(
|
|
9
9
|
Ariakit.Radio,
|