@stratakit/structures 0.2.1 → 0.2.3
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 +73 -2
- package/dist/Banner.d.ts +2 -1
- package/dist/Banner.js +3 -2
- package/dist/Chip.d.ts +42 -7
- package/dist/Chip.js +82 -26
- package/dist/DEV/Banner.js +3 -2
- package/dist/DEV/Chip.js +85 -26
- package/dist/DEV/DropdownMenu.js +4 -4
- package/dist/DEV/ErrorRegion.js +4 -4
- package/dist/DEV/Table.js +2 -2
- package/dist/DEV/Toolbar.js +13 -7
- package/dist/DEV/TreeItem.js +9 -9
- package/dist/DEV/index.js +4 -4
- package/dist/DEV/styles.css.js +1 -1
- package/dist/DEV/~utils.icons.js +8 -8
- package/dist/DropdownMenu.js +4 -4
- package/dist/ErrorRegion.js +4 -4
- package/dist/Table.js +2 -2
- package/dist/Tabs.d.ts +10 -0
- package/dist/Toolbar.js +13 -7
- package/dist/TreeItem.js +9 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/styles.css.js +1 -1
- package/dist/~utils.icons.js +8 -8
- package/package.json +71 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.3
|
|
4
|
+
|
|
5
|
+
- [#788](https://github.com/iTwin/design-system/pull/788): Updated `Tabs.Tab` component to support optional start and end icons.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
// Add end icon to a tab.
|
|
9
|
+
<Tabs.Tab id="tab-1">
|
|
10
|
+
Tab 1
|
|
11
|
+
<Icon href={…} />
|
|
12
|
+
</Tabs.Tab>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- [#773](https://github.com/iTwin/design-system/pull/773): Added [subpath exports](https://nodejs.org/api/packages.html#subpath-exports) for individual components. These new exports allow StrataKit to expose both convenience and compositional APIs of the same component.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
// Convenience import
|
|
19
|
+
import Chip from "@stratakit/structures/Chip";
|
|
20
|
+
// Alternative
|
|
21
|
+
import { default as Chip } from "@stratakit/structures/Chip";
|
|
22
|
+
|
|
23
|
+
<Chip />;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
// Compositional import
|
|
28
|
+
import * as Chip from "@stratakit/structures/Chip";
|
|
29
|
+
|
|
30
|
+
<Chip.Root>
|
|
31
|
+
<Chip.Label>Label</Chip.Label>
|
|
32
|
+
<Chip.DismissButton />
|
|
33
|
+
</Chip.Root>;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Compositional components are useful for building custom components that require more control over the structure and behavior, while convenience components provide a ready-to-use solution for common use cases. See [#405](https://github.com/iTwin/design-system/discussions/405) for more details.
|
|
37
|
+
|
|
38
|
+
APIs exported from the barrel file are not changed in this release. Some exported components are compositional, while others are convenience components.
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
// Chip is exported as a convenience API in the barrel file:
|
|
42
|
+
import { Chip } from "@stratakit/structures";
|
|
43
|
+
|
|
44
|
+
<Chip />;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- [#763](https://github.com/iTwin/design-system/pull/763): Added compositional `Chip.Root`, `Chip.Label` and `Chip.DismissButton` components. These new components can be used when you need fine grained configuration.
|
|
48
|
+
|
|
49
|
+
To use the compositional components, import them from the `/Chip` subpath:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import * as Chip from "@stratakit/structures/Chip";
|
|
53
|
+
|
|
54
|
+
<Chip.Root>
|
|
55
|
+
<Chip.Label>Label</Chip.Label>
|
|
56
|
+
<Chip.DismissButton onClick={onDismiss} />
|
|
57
|
+
</Chip.Root>;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- [#815](https://github.com/iTwin/design-system/pull/815): Fixed an issue where Toolbar was using Context as a component which doesn't work in React 18.
|
|
61
|
+
- [#781](https://github.com/iTwin/design-system/pull/781): Updated `Chip.Label` component styling when rendered as a button.
|
|
62
|
+
- [#793](https://github.com/iTwin/design-system/pull/793): Added `zustand` as a dependency.
|
|
63
|
+
|
|
64
|
+
- Updated dependencies:
|
|
65
|
+
- @stratakit/foundations@0.2.0
|
|
66
|
+
- @stratakit/bricks@0.3.1
|
|
67
|
+
|
|
68
|
+
## 0.2.2
|
|
69
|
+
|
|
70
|
+
- [#756](https://github.com/iTwin/design-system/pull/756): `DropdownMenu.Button` will now ignore `render={undefined}`.
|
|
71
|
+
- [#755](https://github.com/iTwin/design-system/pull/755): Updated the code for icons used internally by components.
|
|
72
|
+
- Updated dependencies:
|
|
73
|
+
- @stratakit/bricks@0.3.0
|
|
74
|
+
- @stratakit/foundations@0.1.6
|
|
75
|
+
|
|
3
76
|
## 0.2.1
|
|
4
77
|
|
|
5
78
|
- [#736](https://github.com/iTwin/design-system/pull/736): Updated the `label` prop type in the `<Chip />` component from `string` to `ReactNode`.
|
|
@@ -16,7 +89,6 @@
|
|
|
16
89
|
- [#720](https://github.com/iTwin/design-system/pull/720): Renamed `onExpandedChange` prop for `unstable_ErrorRegion.Root` to `setOpen`.
|
|
17
90
|
Renamed `expanded` prop for `unstable_ErrorRegion.Root` to `open`.
|
|
18
91
|
- [#709](https://github.com/iTwin/design-system/pull/709): `unstable_AccordionItem` breaking changes:
|
|
19
|
-
|
|
20
92
|
- `AccordionItem.Trigger` renamed to `AccordionItem.Header` and no longer represents the underlying `<button>` element (see `AccordionItem.Label`).
|
|
21
93
|
- `AccordionItem.Label` must be wrapped with the new `AccordionItem.Button`.
|
|
22
94
|
|
|
@@ -45,7 +117,6 @@
|
|
|
45
117
|
## 0.1.1
|
|
46
118
|
|
|
47
119
|
- [#704](https://github.com/iTwin/design-system/pull/704): The following components have been moved from `@stratakit/bricks` into `@stratakit/structures`.
|
|
48
|
-
|
|
49
120
|
- `unstable_AccordionItem`
|
|
50
121
|
- `unstable_Banner`
|
|
51
122
|
- `Chip`
|
package/dist/Banner.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { BaseProps } from "@stratakit/foundations/secret-internals";
|
|
|
9
9
|
* <Banner label="Title" message="Message" icon={placeholderIcon} onDismiss={() => {}} />
|
|
10
10
|
* ```
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
declare const Banner: React.ForwardRefExoticComponent<Omit<BaseProps, "children"> & {
|
|
13
13
|
/**
|
|
14
14
|
* Icon to be displayed inside the banner.
|
|
15
15
|
*
|
|
@@ -79,3 +79,4 @@ export declare const Banner: React.ForwardRefExoticComponent<Omit<BaseProps, "ch
|
|
|
79
79
|
*/
|
|
80
80
|
variant?: "outline";
|
|
81
81
|
} & React.RefAttributes<HTMLDivElement | HTMLElement>>;
|
|
82
|
+
export default Banner;
|
package/dist/Banner.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { Role } from "@ariakit/react/role";
|
|
3
4
|
import { IconButton, Text } from "@stratakit/bricks";
|
|
4
5
|
import { GhostAligner } from "@stratakit/bricks/secret-internals";
|
|
5
6
|
import { Icon } from "@stratakit/foundations";
|
|
6
7
|
import { forwardRef } from "@stratakit/foundations/secret-internals";
|
|
7
8
|
import cx from "classnames";
|
|
8
|
-
import * as React from "react";
|
|
9
9
|
import { Dismiss, StatusIcon } from "./~utils.icons.js";
|
|
10
10
|
const Banner = forwardRef((props, forwardedRef) => {
|
|
11
11
|
const {
|
|
@@ -66,6 +66,7 @@ const Banner = forwardRef((props, forwardedRef) => {
|
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
});
|
|
69
|
+
var Banner_default = Banner;
|
|
69
70
|
export {
|
|
70
|
-
|
|
71
|
+
Banner_default as default
|
|
71
72
|
};
|
package/dist/Chip.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { BaseProps } from "@stratakit/foundations/secret-internals";
|
|
3
|
-
interface
|
|
4
|
-
/**
|
|
5
|
-
* The label displayed inside the chip.
|
|
6
|
-
*/
|
|
7
|
-
label: React.ReactNode;
|
|
3
|
+
interface ChipRootProps extends BaseProps<"div"> {
|
|
8
4
|
/**
|
|
9
5
|
* The variant style of the Chip.
|
|
10
6
|
* Use "solid" for primary states and "outline" for less prominent states.
|
|
@@ -12,6 +8,44 @@ interface ChipProps extends Omit<BaseProps<"div">, "children"> {
|
|
|
12
8
|
* @default "solid"
|
|
13
9
|
*/
|
|
14
10
|
variant?: "solid" | "outline";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Root component of the compositional Chip component.
|
|
14
|
+
*
|
|
15
|
+
* Example:
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Chip.Root>
|
|
18
|
+
* <Chip.Label>Label</Chip.Label>
|
|
19
|
+
* <Chip.DismissButton onClick={onClick} />
|
|
20
|
+
* </Chip.Root>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const ChipRoot: React.ForwardRefExoticComponent<ChipRootProps & React.RefAttributes<HTMLDivElement | HTMLElement>>;
|
|
24
|
+
interface ChipLabelProps extends BaseProps<"span"> {
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Label component that should be used with the compositional Chip component.
|
|
28
|
+
*/
|
|
29
|
+
declare const ChipLabel: React.ForwardRefExoticComponent<ChipLabelProps & React.RefAttributes<HTMLElement | HTMLSpanElement>>;
|
|
30
|
+
interface ChipDismissButtonProps extends Omit<BaseProps<"button">, "children"> {
|
|
31
|
+
/**
|
|
32
|
+
* Label for the dismiss button.
|
|
33
|
+
*
|
|
34
|
+
* The final accessible name of the dismiss button is a combination of this `label` and the text content of `Chip.Label`.
|
|
35
|
+
*
|
|
36
|
+
* @default "Dismiss"
|
|
37
|
+
*/
|
|
38
|
+
label?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Dismiss button component that should be used with the compositional Chip component.
|
|
42
|
+
*/
|
|
43
|
+
declare const ChipDismissButton: React.ForwardRefExoticComponent<ChipDismissButtonProps & React.RefAttributes<HTMLElement | HTMLButtonElement>>;
|
|
44
|
+
interface ChipProps extends Omit<BaseProps<"div">, "children">, Pick<ChipRootProps, "variant"> {
|
|
45
|
+
/**
|
|
46
|
+
* The label displayed inside the chip.
|
|
47
|
+
*/
|
|
48
|
+
label: React.ReactNode;
|
|
15
49
|
/**
|
|
16
50
|
* Callback invoked when the dismiss ("❌") button is clicked.
|
|
17
51
|
*
|
|
@@ -31,5 +65,6 @@ interface ChipProps extends Omit<BaseProps<"div">, "children"> {
|
|
|
31
65
|
* <Chip label="Value" variant="outline" />
|
|
32
66
|
* ```
|
|
33
67
|
*/
|
|
34
|
-
|
|
35
|
-
export
|
|
68
|
+
declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement | HTMLElement>>;
|
|
69
|
+
export default Chip;
|
|
70
|
+
export { ChipRoot as Root, ChipLabel as Label, ChipDismissButton as DismissButton, };
|
package/dist/Chip.js
CHANGED
|
@@ -1,41 +1,97 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { Role } from "@ariakit/react/role";
|
|
3
4
|
import { IconButton } from "@stratakit/bricks";
|
|
4
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
forwardRef,
|
|
7
|
+
useSafeContext
|
|
8
|
+
} from "@stratakit/foundations/secret-internals";
|
|
5
9
|
import cx from "classnames";
|
|
6
|
-
import
|
|
10
|
+
import { createStore, useStore } from "zustand";
|
|
11
|
+
import { combine } from "zustand/middleware";
|
|
7
12
|
import { Dismiss } from "./~utils.icons.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
function createChipStore(initialState) {
|
|
14
|
+
return createStore(
|
|
15
|
+
combine(initialState, (set, _, store) => ({
|
|
16
|
+
setLabelId: (labelId) => {
|
|
17
|
+
set({ labelId: labelId || store.getInitialState().labelId });
|
|
18
|
+
}
|
|
19
|
+
}))
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const ChipContext = React.createContext(void 0);
|
|
23
|
+
function ChipProvider(props) {
|
|
24
|
+
const defaultLabelId = React.useId();
|
|
25
|
+
const [store] = React.useState(
|
|
26
|
+
() => createChipStore({ labelId: defaultLabelId })
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ jsx(ChipContext.Provider, { value: store, children: props.children });
|
|
29
|
+
}
|
|
30
|
+
function useChipState(selectorFn) {
|
|
31
|
+
const store = useSafeContext(ChipContext);
|
|
32
|
+
return useStore(store, selectorFn);
|
|
33
|
+
}
|
|
34
|
+
const ChipRoot = forwardRef((props, forwardedRef) => {
|
|
35
|
+
const { variant = "solid", ...rest } = props;
|
|
36
|
+
return /* @__PURE__ */ jsx(ChipProvider, { children: /* @__PURE__ */ jsx(
|
|
14
37
|
Role.div,
|
|
15
38
|
{
|
|
16
39
|
"data-kiwi-variant": variant,
|
|
17
40
|
...rest,
|
|
18
41
|
className: cx("\u{1F95D}-chip", props.className),
|
|
19
|
-
ref: forwardedRef
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
ref: forwardedRef
|
|
43
|
+
}
|
|
44
|
+
) });
|
|
45
|
+
});
|
|
46
|
+
const ChipLabel = forwardRef((props, forwardedRef) => {
|
|
47
|
+
const labelId = useChipState((state) => state.labelId);
|
|
48
|
+
const setLabelId = useChipState((state) => state.setLabelId);
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
setLabelId(props.id);
|
|
51
|
+
}, [setLabelId, props.id]);
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
Role.span,
|
|
54
|
+
{
|
|
55
|
+
id: labelId,
|
|
56
|
+
...props,
|
|
57
|
+
className: cx("\u{1F95D}-chip-label", props.className),
|
|
58
|
+
ref: forwardedRef
|
|
36
59
|
}
|
|
37
60
|
);
|
|
38
61
|
});
|
|
62
|
+
const ChipDismissButton = forwardRef(
|
|
63
|
+
(props, forwardedRef) => {
|
|
64
|
+
const { label = "Dismiss", ...rest } = props;
|
|
65
|
+
const labelId = useChipState((state) => state.labelId);
|
|
66
|
+
const defaultId = React.useId();
|
|
67
|
+
const id = props.id ?? defaultId;
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
IconButton,
|
|
70
|
+
{
|
|
71
|
+
id,
|
|
72
|
+
"aria-labelledby": `${id} ${labelId}`,
|
|
73
|
+
...rest,
|
|
74
|
+
label,
|
|
75
|
+
className: cx("\u{1F95D}-chip-dismiss-button", props.className),
|
|
76
|
+
variant: "ghost",
|
|
77
|
+
labelVariant: "visually-hidden",
|
|
78
|
+
icon: /* @__PURE__ */ jsx(Dismiss, {}),
|
|
79
|
+
ref: forwardedRef
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
const Chip = forwardRef((props, forwardedRef) => {
|
|
85
|
+
const { onDismiss, label, ...rest } = props;
|
|
86
|
+
return /* @__PURE__ */ jsxs(ChipRoot, { ...rest, ref: forwardedRef, children: [
|
|
87
|
+
/* @__PURE__ */ jsx(ChipLabel, { children: label }),
|
|
88
|
+
onDismiss && /* @__PURE__ */ jsx(ChipDismissButton, { onClick: onDismiss })
|
|
89
|
+
] });
|
|
90
|
+
});
|
|
91
|
+
var Chip_default = Chip;
|
|
39
92
|
export {
|
|
40
|
-
|
|
93
|
+
ChipDismissButton as DismissButton,
|
|
94
|
+
ChipLabel as Label,
|
|
95
|
+
ChipRoot as Root,
|
|
96
|
+
Chip_default as default
|
|
41
97
|
};
|
package/dist/DEV/Banner.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { Role } from "@ariakit/react/role";
|
|
3
4
|
import { IconButton, Text } from "@stratakit/bricks";
|
|
4
5
|
import { GhostAligner } from "@stratakit/bricks/secret-internals";
|
|
5
6
|
import { Icon } from "@stratakit/foundations";
|
|
6
7
|
import { forwardRef } from "@stratakit/foundations/secret-internals";
|
|
7
8
|
import cx from "classnames";
|
|
8
|
-
import * as React from "react";
|
|
9
9
|
import { Dismiss, StatusIcon } from "./~utils.icons.js";
|
|
10
10
|
const Banner = forwardRef((props, forwardedRef) => {
|
|
11
11
|
const {
|
|
@@ -67,6 +67,7 @@ const Banner = forwardRef((props, forwardedRef) => {
|
|
|
67
67
|
);
|
|
68
68
|
});
|
|
69
69
|
DEV: Banner.displayName = "Banner";
|
|
70
|
+
var Banner_default = Banner;
|
|
70
71
|
export {
|
|
71
|
-
|
|
72
|
+
Banner_default as default
|
|
72
73
|
};
|
package/dist/DEV/Chip.js
CHANGED
|
@@ -1,42 +1,101 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { Role } from "@ariakit/react/role";
|
|
3
4
|
import { IconButton } from "@stratakit/bricks";
|
|
4
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
forwardRef,
|
|
7
|
+
useSafeContext
|
|
8
|
+
} from "@stratakit/foundations/secret-internals";
|
|
5
9
|
import cx from "classnames";
|
|
6
|
-
import
|
|
10
|
+
import { createStore, useStore } from "zustand";
|
|
11
|
+
import { combine } from "zustand/middleware";
|
|
7
12
|
import { Dismiss } from "./~utils.icons.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
function createChipStore(initialState) {
|
|
14
|
+
return createStore(
|
|
15
|
+
combine(initialState, (set, _, store) => ({
|
|
16
|
+
setLabelId: (labelId) => {
|
|
17
|
+
set({ labelId: labelId || store.getInitialState().labelId });
|
|
18
|
+
}
|
|
19
|
+
}))
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const ChipContext = React.createContext(void 0);
|
|
23
|
+
function ChipProvider(props) {
|
|
24
|
+
const defaultLabelId = React.useId();
|
|
25
|
+
const [store] = React.useState(
|
|
26
|
+
() => createChipStore({ labelId: defaultLabelId })
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ jsx(ChipContext.Provider, { value: store, children: props.children });
|
|
29
|
+
}
|
|
30
|
+
function useChipState(selectorFn) {
|
|
31
|
+
const store = useSafeContext(ChipContext);
|
|
32
|
+
return useStore(store, selectorFn);
|
|
33
|
+
}
|
|
34
|
+
const ChipRoot = forwardRef((props, forwardedRef) => {
|
|
35
|
+
const { variant = "solid", ...rest } = props;
|
|
36
|
+
return /* @__PURE__ */ jsx(ChipProvider, { children: /* @__PURE__ */ jsx(
|
|
14
37
|
Role.div,
|
|
15
38
|
{
|
|
16
39
|
"data-kiwi-variant": variant,
|
|
17
40
|
...rest,
|
|
18
41
|
className: cx("\u{1F95D}-chip", props.className),
|
|
19
|
-
ref: forwardedRef
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
ref: forwardedRef
|
|
43
|
+
}
|
|
44
|
+
) });
|
|
45
|
+
});
|
|
46
|
+
DEV: ChipRoot.displayName = "Chip.Root";
|
|
47
|
+
const ChipLabel = forwardRef((props, forwardedRef) => {
|
|
48
|
+
const labelId = useChipState((state) => state.labelId);
|
|
49
|
+
const setLabelId = useChipState((state) => state.setLabelId);
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
setLabelId(props.id);
|
|
52
|
+
}, [setLabelId, props.id]);
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
Role.span,
|
|
55
|
+
{
|
|
56
|
+
id: labelId,
|
|
57
|
+
...props,
|
|
58
|
+
className: cx("\u{1F95D}-chip-label", props.className),
|
|
59
|
+
ref: forwardedRef
|
|
36
60
|
}
|
|
37
61
|
);
|
|
38
62
|
});
|
|
63
|
+
DEV: ChipLabel.displayName = "Chip.Label";
|
|
64
|
+
const ChipDismissButton = forwardRef(
|
|
65
|
+
(props, forwardedRef) => {
|
|
66
|
+
const { label = "Dismiss", ...rest } = props;
|
|
67
|
+
const labelId = useChipState((state) => state.labelId);
|
|
68
|
+
const defaultId = React.useId();
|
|
69
|
+
const id = props.id ?? defaultId;
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
IconButton,
|
|
72
|
+
{
|
|
73
|
+
id,
|
|
74
|
+
"aria-labelledby": `${id} ${labelId}`,
|
|
75
|
+
...rest,
|
|
76
|
+
label,
|
|
77
|
+
className: cx("\u{1F95D}-chip-dismiss-button", props.className),
|
|
78
|
+
variant: "ghost",
|
|
79
|
+
labelVariant: "visually-hidden",
|
|
80
|
+
icon: /* @__PURE__ */ jsx(Dismiss, {}),
|
|
81
|
+
ref: forwardedRef
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
DEV: ChipDismissButton.displayName = "Chip.DismissButton";
|
|
87
|
+
const Chip = forwardRef((props, forwardedRef) => {
|
|
88
|
+
const { onDismiss, label, ...rest } = props;
|
|
89
|
+
return /* @__PURE__ */ jsxs(ChipRoot, { ...rest, ref: forwardedRef, children: [
|
|
90
|
+
/* @__PURE__ */ jsx(ChipLabel, { children: label }),
|
|
91
|
+
onDismiss && /* @__PURE__ */ jsx(ChipDismissButton, { onClick: onDismiss })
|
|
92
|
+
] });
|
|
93
|
+
});
|
|
39
94
|
DEV: Chip.displayName = "Chip";
|
|
95
|
+
var Chip_default = Chip;
|
|
40
96
|
export {
|
|
41
|
-
|
|
97
|
+
ChipDismissButton as DismissButton,
|
|
98
|
+
ChipLabel as Label,
|
|
99
|
+
ChipRoot as Root,
|
|
100
|
+
Chip_default as default
|
|
42
101
|
};
|
package/dist/DEV/DropdownMenu.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { Button as ButtonAk } from "@ariakit/react/button";
|
|
3
4
|
import {
|
|
4
5
|
Menu,
|
|
@@ -22,9 +23,8 @@ import {
|
|
|
22
23
|
usePopoverApi
|
|
23
24
|
} from "@stratakit/foundations/secret-internals";
|
|
24
25
|
import cx from "classnames";
|
|
25
|
-
import * as React from "react";
|
|
26
|
-
import * as ListItem from "./~utils.ListItem.js";
|
|
27
26
|
import { Checkmark } from "./~utils.icons.js";
|
|
27
|
+
import * as ListItem from "./~utils.ListItem.js";
|
|
28
28
|
function DropdownMenuRoot(props) {
|
|
29
29
|
const {
|
|
30
30
|
children,
|
|
@@ -73,11 +73,11 @@ const DropdownMenuButton = forwardRef(
|
|
|
73
73
|
MenuButton,
|
|
74
74
|
{
|
|
75
75
|
accessibleWhenDisabled: true,
|
|
76
|
-
|
|
76
|
+
...rest,
|
|
77
|
+
render: props.render ?? /* @__PURE__ */ jsxs(Button, { accessibleWhenDisabled, children: [
|
|
77
78
|
children,
|
|
78
79
|
/* @__PURE__ */ jsx(DisclosureArrow, {})
|
|
79
80
|
] }),
|
|
80
|
-
...rest,
|
|
81
81
|
className: cx("\u{1F95D}-dropdown-menu-button", props.className),
|
|
82
82
|
"data-has-popover-open": open || void 0,
|
|
83
83
|
ref: forwardedRef
|
package/dist/DEV/ErrorRegion.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import {
|
|
3
4
|
Collection,
|
|
4
5
|
CollectionItem,
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
useControlledState
|
|
19
20
|
} from "@stratakit/foundations/secret-internals";
|
|
20
21
|
import cx from "classnames";
|
|
21
|
-
import * as React from "react";
|
|
22
22
|
import { ChevronDown, StatusIcon } from "./~utils.icons.js";
|
|
23
23
|
const ErrorRegionRoot = forwardRef(
|
|
24
24
|
(props, forwardedRef) => {
|
|
@@ -46,16 +46,16 @@ const ErrorRegionRoot = forwardRef(
|
|
|
46
46
|
el.animate(
|
|
47
47
|
[
|
|
48
48
|
{
|
|
49
|
-
boxShadow: "0 0 0 0 var(--
|
|
49
|
+
boxShadow: "0 0 0 0 var(--stratakit-color-border-attention-base)",
|
|
50
50
|
opacity: 1
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
boxShadow: "0 0 15px 2px var(--
|
|
53
|
+
boxShadow: "0 0 15px 2px var(--stratakit-color-border-attention-base)",
|
|
54
54
|
opacity: 0.7,
|
|
55
55
|
offset: 0.5
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
boxShadow: "0 0 0 0 var(--
|
|
58
|
+
boxShadow: "0 0 0 0 var(--stratakit-color-border-attention-base)",
|
|
59
59
|
opacity: 1
|
|
60
60
|
}
|
|
61
61
|
],
|
package/dist/DEV/Table.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { Role } from "@ariakit/react/role";
|
|
3
|
-
import { forwardRef } from "@stratakit/foundations/secret-internals";
|
|
4
4
|
import {
|
|
5
|
+
forwardRef,
|
|
5
6
|
useMergedRefs,
|
|
6
7
|
useSafeContext
|
|
7
8
|
} from "@stratakit/foundations/secret-internals";
|
|
8
9
|
import cx from "classnames";
|
|
9
|
-
import * as React from "react";
|
|
10
10
|
const TableContext = React.createContext(void 0);
|
|
11
11
|
const TableHeaderContext = React.createContext(false);
|
|
12
12
|
const HtmlTable = forwardRef((props, forwardedRef) => {
|
package/dist/DEV/Toolbar.js
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import * as Toolbar from "@ariakit/react/toolbar";
|
|
3
4
|
import { IconButtonContext } from "@stratakit/bricks/secret-internals";
|
|
4
5
|
import { forwardRef } from "@stratakit/foundations/secret-internals";
|
|
5
6
|
import cx from "classnames";
|
|
6
|
-
import * as React from "react";
|
|
7
7
|
const ToolbarGroup = forwardRef((props, forwardedRef) => {
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
9
|
-
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
IconButtonContext.Provider,
|
|
10
10
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
value: React.useMemo(() => ({ iconSize: "large" }), []),
|
|
12
|
+
children: /* @__PURE__ */ jsx(
|
|
13
|
+
Toolbar.Toolbar,
|
|
14
|
+
{
|
|
15
|
+
...props,
|
|
16
|
+
className: cx("\u{1F95D}-toolbar", props.className),
|
|
17
|
+
ref: forwardedRef
|
|
18
|
+
}
|
|
19
|
+
)
|
|
14
20
|
}
|
|
15
|
-
)
|
|
21
|
+
);
|
|
16
22
|
});
|
|
17
23
|
DEV: ToolbarGroup.displayName = "Toolbar.Group";
|
|
18
24
|
const ToolbarItem = forwardRef(
|
package/dist/DEV/TreeItem.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { CompositeItem } from "@ariakit/react/composite";
|
|
3
4
|
import { PopoverProvider } from "@ariakit/react/popover";
|
|
4
5
|
import { Role } from "@ariakit/react/role";
|
|
@@ -14,10 +15,9 @@ import {
|
|
|
14
15
|
useEventHandlers
|
|
15
16
|
} from "@stratakit/foundations/secret-internals";
|
|
16
17
|
import cx from "classnames";
|
|
17
|
-
import * as React from "react";
|
|
18
|
-
import * as DropdownMenu from "./DropdownMenu.js";
|
|
19
|
-
import * as ListItem from "./~utils.ListItem.js";
|
|
20
18
|
import { ChevronDown, MoreHorizontal, StatusIcon } from "./~utils.icons.js";
|
|
19
|
+
import * as ListItem from "./~utils.ListItem.js";
|
|
20
|
+
import * as DropdownMenu from "./DropdownMenu.js";
|
|
21
21
|
const TreeItemErrorContext = React.createContext(void 0);
|
|
22
22
|
const TreeItemActionsContext = React.createContext(void 0);
|
|
23
23
|
const TreeItemDecorationsContext = React.createContext(void 0);
|
|
@@ -43,12 +43,12 @@ const TreeItem = React.memo(
|
|
|
43
43
|
onSelectedChange,
|
|
44
44
|
expanded,
|
|
45
45
|
onExpandedChange,
|
|
46
|
-
icon,
|
|
47
|
-
unstable_decorations,
|
|
48
|
-
label,
|
|
49
|
-
description,
|
|
50
|
-
actions,
|
|
51
|
-
error:
|
|
46
|
+
icon: _icon,
|
|
47
|
+
unstable_decorations: _unstable_decorations,
|
|
48
|
+
label: _label,
|
|
49
|
+
description: _description,
|
|
50
|
+
actions: _actions,
|
|
51
|
+
error: _error,
|
|
52
52
|
onClick: onClickProp,
|
|
53
53
|
onKeyDown: onKeyDownProp,
|
|
54
54
|
...rest
|
package/dist/DEV/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as unstable_AccordionItem from "./AccordionItem.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { default as default2 } from "./Banner.js";
|
|
4
|
+
import { default as default3 } from "./Chip.js";
|
|
5
5
|
import * as DropdownMenu from "./DropdownMenu.js";
|
|
6
6
|
import * as unstable_ErrorRegion from "./ErrorRegion.js";
|
|
7
7
|
import * as Table from "./Table.js";
|
|
@@ -9,13 +9,13 @@ import * as Tabs from "./Tabs.js";
|
|
|
9
9
|
import * as unstable_Toolbar from "./Toolbar.js";
|
|
10
10
|
import * as Tree from "./Tree.js";
|
|
11
11
|
export {
|
|
12
|
-
Chip,
|
|
12
|
+
default3 as Chip,
|
|
13
13
|
DropdownMenu,
|
|
14
14
|
Table,
|
|
15
15
|
Tabs,
|
|
16
16
|
Tree,
|
|
17
17
|
unstable_AccordionItem,
|
|
18
|
-
|
|
18
|
+
default2 as unstable_Banner,
|
|
19
19
|
unstable_ErrorRegion,
|
|
20
20
|
unstable_Toolbar
|
|
21
21
|
};
|