@stratakit/structures 0.3.2 → 0.4.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 +128 -0
- package/dist/AccordionItem.js +10 -10
- package/dist/Banner.js +8 -8
- package/dist/Chip.js +4 -4
- package/dist/DEV/AccordionItem.js +10 -10
- package/dist/DEV/Banner.js +8 -8
- package/dist/DEV/Chip.js +4 -4
- package/dist/DEV/Dialog.js +179 -0
- package/dist/DEV/DropdownMenu.js +10 -10
- package/dist/DEV/ErrorRegion.js +12 -12
- package/dist/DEV/NavigationRail.js +213 -0
- package/dist/DEV/Table.js +7 -7
- package/dist/DEV/Tabs.js +7 -7
- package/dist/DEV/Toolbar.js +41 -18
- package/dist/DEV/Tree.js +1 -1
- package/dist/DEV/TreeItem.js +14 -14
- package/dist/DEV/index.js +4 -0
- package/dist/DEV/styles.css.js +1 -1
- package/dist/DEV/~utils.ListItem.js +3 -3
- package/dist/DEV/~utils.icons.js +1 -1
- package/dist/Dialog.d.ts +153 -0
- package/dist/Dialog.js +170 -0
- package/dist/DropdownMenu.d.ts +8 -8
- package/dist/DropdownMenu.js +9 -9
- package/dist/ErrorRegion.js +12 -12
- package/dist/NavigationRail.d.ts +203 -0
- package/dist/NavigationRail.js +201 -0
- package/dist/Table.js +7 -7
- package/dist/Tabs.d.ts +9 -9
- package/dist/Tabs.js +6 -6
- package/dist/Toolbar.d.ts +21 -3
- package/dist/Toolbar.js +41 -18
- package/dist/Tree.js +1 -1
- package/dist/TreeItem.js +14 -14
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/styles.css.js +1 -1
- package/dist/~utils.ListItem.js +3 -3
- package/dist/~utils.icons.js +1 -1
- package/package.json +23 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,133 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
- [#851](https://github.com/iTwin/design-system/pull/851): Added `Dialog` component that displays custom content in a window overlay over the primary window or another dialog window. Currently only modal dialog type is supported.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
const [open, setOpen] = useState(false);
|
|
9
|
+
|
|
10
|
+
<Button onClick={() => setOpen(true)}>Open dialog</Button>
|
|
11
|
+
<Dialog.Root modal={true} open={open} onClose={() => setOpen(false)}>
|
|
12
|
+
<Dialog.Header>
|
|
13
|
+
<Dialog.Heading>Dialog title</Dialog.Heading>
|
|
14
|
+
<Dialog.CloseButton />
|
|
15
|
+
</Dialog.Header>
|
|
16
|
+
<Dialog.Content>
|
|
17
|
+
<Text variant="body-sm">Content that describes the primary purpose of the dialog.</Text>
|
|
18
|
+
</Dialog.Content>
|
|
19
|
+
<Dialog.Footer>
|
|
20
|
+
<Dialog.ActionList
|
|
21
|
+
actions={[
|
|
22
|
+
<Button key="cancel" onClick={() => setOpen(false)}>Cancel</Button>,
|
|
23
|
+
<Button key="ok" tone="accent" onClick={() => setOpen(false)}>Ok</Button>,
|
|
24
|
+
]}
|
|
25
|
+
/>
|
|
26
|
+
</Dialog.Footer>
|
|
27
|
+
</Dialog.Root>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- [#884](https://github.com/iTwin/design-system/pull/884): Added new `unstable_NavigationRail` component intended to serve as the application's top-level navigation (e.g. for switching between pages).
|
|
31
|
+
|
|
32
|
+
```jsx
|
|
33
|
+
<NavigationRail.Root>
|
|
34
|
+
<NavigationRail.Header>
|
|
35
|
+
<IconButton label="…" icon={…} href="/" />
|
|
36
|
+
<NavigationRail.ToggleButton />
|
|
37
|
+
</NavigationRail.Header>
|
|
38
|
+
|
|
39
|
+
<NavigationRail.Content>
|
|
40
|
+
<NavigationRail.List>
|
|
41
|
+
<NavigationRail.ListItem>
|
|
42
|
+
<NavigationRail.Anchor label="…" icon={…} href="/…" />
|
|
43
|
+
</NavigationRail.ListItem>
|
|
44
|
+
<NavigationRail.ListItem>
|
|
45
|
+
<NavigationRail.Anchor label="…" icon={…} href="/…" />
|
|
46
|
+
</NavigationRail.ListItem>
|
|
47
|
+
<NavigationRail.ListItem>
|
|
48
|
+
<NavigationRail.Anchor label="…" icon={…} href="/…" />
|
|
49
|
+
</NavigationRail.ListItem>
|
|
50
|
+
</NavigationRail.List>
|
|
51
|
+
|
|
52
|
+
<NavigationRail.Footer>
|
|
53
|
+
<NavigationRail.List>
|
|
54
|
+
<NavigationRail.ListItem>
|
|
55
|
+
<NavigationRail.Button label="…" icon={…} onClick={…} />
|
|
56
|
+
</NavigationRail.ListItem>
|
|
57
|
+
<NavigationRail.ListItem>
|
|
58
|
+
<NavigationRail.Button label="…" icon={…} onClick={…} />
|
|
59
|
+
</NavigationRail.ListItem>
|
|
60
|
+
</NavigationRail.List>
|
|
61
|
+
</NavigationRail.Footer>
|
|
62
|
+
</NavigationRail.Content>
|
|
63
|
+
</NavigationRail.Root>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- Updated dependencies:
|
|
67
|
+
- @stratakit/foundations@0.3.1
|
|
68
|
+
- @stratakit/bricks@0.4.1
|
|
69
|
+
|
|
70
|
+
## 0.4.0
|
|
71
|
+
|
|
72
|
+
### Breaking changes
|
|
73
|
+
|
|
74
|
+
- [#888](https://github.com/iTwin/design-system/pull/888): `Toolbar.Item` component no longer automatically uses the large version of the icon.
|
|
75
|
+
|
|
76
|
+
`#icon-large` must now be explicitly added to the URL to select the large icons from `@stratakit/icons`. For example:
|
|
77
|
+
|
|
78
|
+
```diff
|
|
79
|
+
<Toolbar.Item
|
|
80
|
+
- render={<IconButton icon={placeholderIcon} />}
|
|
81
|
+
+ render={<IconButton icon={`${placeholderIcon}#icon-large`} />}
|
|
82
|
+
/>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- [#900](https://github.com/iTwin/design-system/pull/900): Renamed `Tabs.Root` component to `Tabs.Provider`.
|
|
86
|
+
|
|
87
|
+
```diff
|
|
88
|
+
- <Tabs.Root>
|
|
89
|
+
+ <Tabs.Provider>
|
|
90
|
+
<Tabs.TabList>…</Tabs.TabList>
|
|
91
|
+
<Tabs.TabPanel>…</Tabs.TabPanel>
|
|
92
|
+
- </Tabs.Root>
|
|
93
|
+
+ </Tabs.Provider>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This change makes StrataKit's naming convention more consistent. `Root` components always render a DOM element whereas `Provider` components have no underlying DOM element.
|
|
97
|
+
|
|
98
|
+
- [#900](https://github.com/iTwin/design-system/pull/900): Renamed `DropdownMenu.Root` component to `DropdownMenu.Provider`.
|
|
99
|
+
|
|
100
|
+
```diff
|
|
101
|
+
- <DropdownMenu.Root>
|
|
102
|
+
+ <DropdownMenu.Provider>
|
|
103
|
+
<DropdownMenu.Button>…</DropdownMenu.Button>
|
|
104
|
+
<DropdownMenu.Content>…</DropdownMenu.Content>
|
|
105
|
+
- </DropdownMenu.Root>
|
|
106
|
+
+ </DropdownMenu.Provider>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
This change makes StrataKit's naming convention more consistent. `Root` components always render a DOM element whereas `Provider` components have no underlying DOM element.
|
|
110
|
+
|
|
111
|
+
### Non-breaking changes
|
|
112
|
+
|
|
113
|
+
- [#903](https://github.com/iTwin/design-system/pull/903): Added proper styling for `Divider` rendered inside a `Toolbar.Group`.
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
<Toolbar.Group variant="solid">
|
|
117
|
+
<Toolbar.Item render={…} />
|
|
118
|
+
<Divider orientation="vertical" />
|
|
119
|
+
<Toolbar.Item render={…} />
|
|
120
|
+
<Toolbar.Item render={…} />
|
|
121
|
+
</Toolbar.Group>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- [#913](https://github.com/iTwin/design-system/pull/913): Updated internal CSS selectors in every component.
|
|
125
|
+
- [#901](https://github.com/iTwin/design-system/pull/901): Added `orientation` prop to `Toolbar.Group` component. Set the `orientation` prop to `"vertical"` to display the toolbar vertically.
|
|
126
|
+
- [#902](https://github.com/iTwin/design-system/pull/902): Updated active style of a ghost `IconButton` when used in a `Toolbar` component.
|
|
127
|
+
- Updated dependencies:
|
|
128
|
+
- @stratakit/foundations@0.3.0
|
|
129
|
+
- @stratakit/bricks@0.4.0
|
|
130
|
+
|
|
3
131
|
## 0.3.2
|
|
4
132
|
|
|
5
133
|
- [#881](https://github.com/iTwin/design-system/pull/881): Updated CSS to use `--stratakit-space-` variables instead of hardcoded values in all components.
|
package/dist/AccordionItem.js
CHANGED
|
@@ -39,8 +39,8 @@ const AccordionItemRoot = forwardRef(
|
|
|
39
39
|
Role,
|
|
40
40
|
{
|
|
41
41
|
...rest,
|
|
42
|
-
className: cx("\u{1F95D}
|
|
43
|
-
"data-
|
|
42
|
+
className: cx("\u{1F95D}AccordionItem", props.className),
|
|
43
|
+
"data-_sk-open": open,
|
|
44
44
|
ref: forwardedRef
|
|
45
45
|
}
|
|
46
46
|
)
|
|
@@ -53,7 +53,7 @@ const AccordionItemHeader = forwardRef(
|
|
|
53
53
|
Role,
|
|
54
54
|
{
|
|
55
55
|
...props,
|
|
56
|
-
className: cx("\u{1F95D}
|
|
56
|
+
className: cx("\u{1F95D}AccordionItemHeader", props.className),
|
|
57
57
|
ref: forwardedRef
|
|
58
58
|
}
|
|
59
59
|
) })
|
|
@@ -63,7 +63,7 @@ const AccordionItemButton = forwardRef(
|
|
|
63
63
|
Disclosure,
|
|
64
64
|
{
|
|
65
65
|
...props,
|
|
66
|
-
className: cx("\u{1F95D}
|
|
66
|
+
className: cx("\u{1F95D}AccordionItemButton", props.className),
|
|
67
67
|
ref: forwardedRef
|
|
68
68
|
}
|
|
69
69
|
)
|
|
@@ -74,7 +74,7 @@ const AccordionItemLabel = forwardRef(
|
|
|
74
74
|
{
|
|
75
75
|
...props,
|
|
76
76
|
variant: "body-sm",
|
|
77
|
-
className: cx("\u{1F95D}
|
|
77
|
+
className: cx("\u{1F95D}AccordionItemLabel", props.className),
|
|
78
78
|
ref: forwardedRef
|
|
79
79
|
}
|
|
80
80
|
)
|
|
@@ -84,7 +84,7 @@ const AccordionItemDecoration = forwardRef(
|
|
|
84
84
|
Role,
|
|
85
85
|
{
|
|
86
86
|
...props,
|
|
87
|
-
className: cx("\u{1F95D}
|
|
87
|
+
className: cx("\u{1F95D}AccordionItemDecoration", props.className),
|
|
88
88
|
ref: forwardedRef
|
|
89
89
|
}
|
|
90
90
|
)
|
|
@@ -95,13 +95,13 @@ const AccordionItemMarker = forwardRef(
|
|
|
95
95
|
{
|
|
96
96
|
...props,
|
|
97
97
|
variant: "ghost",
|
|
98
|
-
className: cx("\u{1F95D}
|
|
98
|
+
className: cx("\u{1F95D}AccordionItemMarker", props.className),
|
|
99
99
|
ref: forwardedRef,
|
|
100
100
|
children: props.children ?? /* @__PURE__ */ jsx(
|
|
101
101
|
ChevronDown,
|
|
102
102
|
{
|
|
103
103
|
"aria-hidden": "true",
|
|
104
|
-
className: "\u{1F95D}
|
|
104
|
+
className: "\u{1F95D}AccordionItemMarkerChevron"
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
}
|
|
@@ -112,7 +112,7 @@ const AccordionItemContent = forwardRef(
|
|
|
112
112
|
DisclosureContent,
|
|
113
113
|
{
|
|
114
114
|
...props,
|
|
115
|
-
className: cx("\u{1F95D}
|
|
115
|
+
className: cx("\u{1F95D}AccordionItemContent", props.className),
|
|
116
116
|
ref: forwardedRef
|
|
117
117
|
}
|
|
118
118
|
)
|
|
@@ -123,7 +123,7 @@ const AccordionItemHeading = forwardRef(
|
|
|
123
123
|
{
|
|
124
124
|
...props,
|
|
125
125
|
variant: "body-sm",
|
|
126
|
-
className: cx("\u{1F95D}
|
|
126
|
+
className: cx("\u{1F95D}AccordionItemHeading", props.className),
|
|
127
127
|
ref: forwardedRef
|
|
128
128
|
}
|
|
129
129
|
)
|
package/dist/Banner.js
CHANGED
|
@@ -40,9 +40,9 @@ const BannerRoot = forwardRef((props, forwardedRef) => {
|
|
|
40
40
|
Role,
|
|
41
41
|
{
|
|
42
42
|
...rest,
|
|
43
|
-
"data-
|
|
44
|
-
"data-
|
|
45
|
-
className: cx("\u{1F95D}
|
|
43
|
+
"data-_sk-tone": tone,
|
|
44
|
+
"data-_sk-variant": variant,
|
|
45
|
+
className: cx("\u{1F95D}Banner", props.className),
|
|
46
46
|
ref: forwardedRef
|
|
47
47
|
}
|
|
48
48
|
) });
|
|
@@ -59,7 +59,7 @@ const BannerIcon = forwardRef((props, forwardedRef) => {
|
|
|
59
59
|
{
|
|
60
60
|
...rest,
|
|
61
61
|
render,
|
|
62
|
-
className: cx("\u{1F95D}
|
|
62
|
+
className: cx("\u{1F95D}BannerIcon", props.className),
|
|
63
63
|
ref: forwardedRef
|
|
64
64
|
}
|
|
65
65
|
);
|
|
@@ -80,7 +80,7 @@ const BannerLabel = forwardRef(
|
|
|
80
80
|
id: labelId,
|
|
81
81
|
render: /* @__PURE__ */ jsx("span", {}),
|
|
82
82
|
...props,
|
|
83
|
-
className: cx("\u{1F95D}
|
|
83
|
+
className: cx("\u{1F95D}BannerLabel", props.className),
|
|
84
84
|
variant: "body-sm",
|
|
85
85
|
ref: forwardedRef
|
|
86
86
|
}
|
|
@@ -94,7 +94,7 @@ const BannerMessage = forwardRef(
|
|
|
94
94
|
{
|
|
95
95
|
...props,
|
|
96
96
|
variant: "body-sm",
|
|
97
|
-
className: cx("\u{1F95D}
|
|
97
|
+
className: cx("\u{1F95D}BannerMessage", props.className),
|
|
98
98
|
ref: forwardedRef
|
|
99
99
|
}
|
|
100
100
|
);
|
|
@@ -106,7 +106,7 @@ const BannerActions = forwardRef(
|
|
|
106
106
|
Role.div,
|
|
107
107
|
{
|
|
108
108
|
...props,
|
|
109
|
-
className: cx("\u{1F95D}
|
|
109
|
+
className: cx("\u{1F95D}BannerActions", props.className),
|
|
110
110
|
ref: forwardedRef
|
|
111
111
|
}
|
|
112
112
|
);
|
|
@@ -123,7 +123,7 @@ const BannerDismissButton = forwardRef(
|
|
|
123
123
|
{
|
|
124
124
|
...rest,
|
|
125
125
|
id,
|
|
126
|
-
className: cx("\u{1F95D}
|
|
126
|
+
className: cx("\u{1F95D}BannerDismissButton", props.className),
|
|
127
127
|
variant: "ghost",
|
|
128
128
|
label,
|
|
129
129
|
"aria-labelledby": `${id} ${labelId || ""}`,
|
package/dist/Chip.js
CHANGED
|
@@ -36,9 +36,9 @@ const ChipRoot = forwardRef((props, forwardedRef) => {
|
|
|
36
36
|
return /* @__PURE__ */ jsx(ChipProvider, { children: /* @__PURE__ */ jsx(
|
|
37
37
|
Role.div,
|
|
38
38
|
{
|
|
39
|
-
"data-
|
|
39
|
+
"data-_sk-variant": variant,
|
|
40
40
|
...rest,
|
|
41
|
-
className: cx("\u{1F95D}
|
|
41
|
+
className: cx("\u{1F95D}Chip", props.className),
|
|
42
42
|
ref: forwardedRef
|
|
43
43
|
}
|
|
44
44
|
) });
|
|
@@ -54,7 +54,7 @@ const ChipLabel = forwardRef((props, forwardedRef) => {
|
|
|
54
54
|
{
|
|
55
55
|
id: labelId,
|
|
56
56
|
...props,
|
|
57
|
-
className: cx("\u{1F95D}
|
|
57
|
+
className: cx("\u{1F95D}ChipLabel", props.className),
|
|
58
58
|
ref: forwardedRef
|
|
59
59
|
}
|
|
60
60
|
);
|
|
@@ -72,7 +72,7 @@ const ChipDismissButton = forwardRef(
|
|
|
72
72
|
"aria-labelledby": `${id} ${labelId}`,
|
|
73
73
|
...rest,
|
|
74
74
|
label,
|
|
75
|
-
className: cx("\u{1F95D}
|
|
75
|
+
className: cx("\u{1F95D}ChipDismissButton", props.className),
|
|
76
76
|
variant: "ghost",
|
|
77
77
|
labelVariant: "visually-hidden",
|
|
78
78
|
icon: /* @__PURE__ */ jsx(Dismiss, {}),
|
|
@@ -39,8 +39,8 @@ const AccordionItemRoot = forwardRef(
|
|
|
39
39
|
Role,
|
|
40
40
|
{
|
|
41
41
|
...rest,
|
|
42
|
-
className: cx("\u{1F95D}
|
|
43
|
-
"data-
|
|
42
|
+
className: cx("\u{1F95D}AccordionItem", props.className),
|
|
43
|
+
"data-_sk-open": open,
|
|
44
44
|
ref: forwardedRef
|
|
45
45
|
}
|
|
46
46
|
)
|
|
@@ -54,7 +54,7 @@ const AccordionItemHeader = forwardRef(
|
|
|
54
54
|
Role,
|
|
55
55
|
{
|
|
56
56
|
...props,
|
|
57
|
-
className: cx("\u{1F95D}
|
|
57
|
+
className: cx("\u{1F95D}AccordionItemHeader", props.className),
|
|
58
58
|
ref: forwardedRef
|
|
59
59
|
}
|
|
60
60
|
) })
|
|
@@ -65,7 +65,7 @@ const AccordionItemButton = forwardRef(
|
|
|
65
65
|
Disclosure,
|
|
66
66
|
{
|
|
67
67
|
...props,
|
|
68
|
-
className: cx("\u{1F95D}
|
|
68
|
+
className: cx("\u{1F95D}AccordionItemButton", props.className),
|
|
69
69
|
ref: forwardedRef
|
|
70
70
|
}
|
|
71
71
|
)
|
|
@@ -77,7 +77,7 @@ const AccordionItemLabel = forwardRef(
|
|
|
77
77
|
{
|
|
78
78
|
...props,
|
|
79
79
|
variant: "body-sm",
|
|
80
|
-
className: cx("\u{1F95D}
|
|
80
|
+
className: cx("\u{1F95D}AccordionItemLabel", props.className),
|
|
81
81
|
ref: forwardedRef
|
|
82
82
|
}
|
|
83
83
|
)
|
|
@@ -88,7 +88,7 @@ const AccordionItemDecoration = forwardRef(
|
|
|
88
88
|
Role,
|
|
89
89
|
{
|
|
90
90
|
...props,
|
|
91
|
-
className: cx("\u{1F95D}
|
|
91
|
+
className: cx("\u{1F95D}AccordionItemDecoration", props.className),
|
|
92
92
|
ref: forwardedRef
|
|
93
93
|
}
|
|
94
94
|
)
|
|
@@ -100,13 +100,13 @@ const AccordionItemMarker = forwardRef(
|
|
|
100
100
|
{
|
|
101
101
|
...props,
|
|
102
102
|
variant: "ghost",
|
|
103
|
-
className: cx("\u{1F95D}
|
|
103
|
+
className: cx("\u{1F95D}AccordionItemMarker", props.className),
|
|
104
104
|
ref: forwardedRef,
|
|
105
105
|
children: props.children ?? /* @__PURE__ */ jsx(
|
|
106
106
|
ChevronDown,
|
|
107
107
|
{
|
|
108
108
|
"aria-hidden": "true",
|
|
109
|
-
className: "\u{1F95D}
|
|
109
|
+
className: "\u{1F95D}AccordionItemMarkerChevron"
|
|
110
110
|
}
|
|
111
111
|
)
|
|
112
112
|
}
|
|
@@ -118,7 +118,7 @@ const AccordionItemContent = forwardRef(
|
|
|
118
118
|
DisclosureContent,
|
|
119
119
|
{
|
|
120
120
|
...props,
|
|
121
|
-
className: cx("\u{1F95D}
|
|
121
|
+
className: cx("\u{1F95D}AccordionItemContent", props.className),
|
|
122
122
|
ref: forwardedRef
|
|
123
123
|
}
|
|
124
124
|
)
|
|
@@ -130,7 +130,7 @@ const AccordionItemHeading = forwardRef(
|
|
|
130
130
|
{
|
|
131
131
|
...props,
|
|
132
132
|
variant: "body-sm",
|
|
133
|
-
className: cx("\u{1F95D}
|
|
133
|
+
className: cx("\u{1F95D}AccordionItemHeading", props.className),
|
|
134
134
|
ref: forwardedRef
|
|
135
135
|
}
|
|
136
136
|
)
|
package/dist/DEV/Banner.js
CHANGED
|
@@ -40,9 +40,9 @@ const BannerRoot = forwardRef((props, forwardedRef) => {
|
|
|
40
40
|
Role,
|
|
41
41
|
{
|
|
42
42
|
...rest,
|
|
43
|
-
"data-
|
|
44
|
-
"data-
|
|
45
|
-
className: cx("\u{1F95D}
|
|
43
|
+
"data-_sk-tone": tone,
|
|
44
|
+
"data-_sk-variant": variant,
|
|
45
|
+
className: cx("\u{1F95D}Banner", props.className),
|
|
46
46
|
ref: forwardedRef
|
|
47
47
|
}
|
|
48
48
|
) });
|
|
@@ -60,7 +60,7 @@ const BannerIcon = forwardRef((props, forwardedRef) => {
|
|
|
60
60
|
{
|
|
61
61
|
...rest,
|
|
62
62
|
render,
|
|
63
|
-
className: cx("\u{1F95D}
|
|
63
|
+
className: cx("\u{1F95D}BannerIcon", props.className),
|
|
64
64
|
ref: forwardedRef
|
|
65
65
|
}
|
|
66
66
|
);
|
|
@@ -82,7 +82,7 @@ const BannerLabel = forwardRef(
|
|
|
82
82
|
id: labelId,
|
|
83
83
|
render: /* @__PURE__ */ jsx("span", {}),
|
|
84
84
|
...props,
|
|
85
|
-
className: cx("\u{1F95D}
|
|
85
|
+
className: cx("\u{1F95D}BannerLabel", props.className),
|
|
86
86
|
variant: "body-sm",
|
|
87
87
|
ref: forwardedRef
|
|
88
88
|
}
|
|
@@ -97,7 +97,7 @@ const BannerMessage = forwardRef(
|
|
|
97
97
|
{
|
|
98
98
|
...props,
|
|
99
99
|
variant: "body-sm",
|
|
100
|
-
className: cx("\u{1F95D}
|
|
100
|
+
className: cx("\u{1F95D}BannerMessage", props.className),
|
|
101
101
|
ref: forwardedRef
|
|
102
102
|
}
|
|
103
103
|
);
|
|
@@ -110,7 +110,7 @@ const BannerActions = forwardRef(
|
|
|
110
110
|
Role.div,
|
|
111
111
|
{
|
|
112
112
|
...props,
|
|
113
|
-
className: cx("\u{1F95D}
|
|
113
|
+
className: cx("\u{1F95D}BannerActions", props.className),
|
|
114
114
|
ref: forwardedRef
|
|
115
115
|
}
|
|
116
116
|
);
|
|
@@ -128,7 +128,7 @@ const BannerDismissButton = forwardRef(
|
|
|
128
128
|
{
|
|
129
129
|
...rest,
|
|
130
130
|
id,
|
|
131
|
-
className: cx("\u{1F95D}
|
|
131
|
+
className: cx("\u{1F95D}BannerDismissButton", props.className),
|
|
132
132
|
variant: "ghost",
|
|
133
133
|
label,
|
|
134
134
|
"aria-labelledby": `${id} ${labelId || ""}`,
|
package/dist/DEV/Chip.js
CHANGED
|
@@ -36,9 +36,9 @@ const ChipRoot = forwardRef((props, forwardedRef) => {
|
|
|
36
36
|
return /* @__PURE__ */ jsx(ChipProvider, { children: /* @__PURE__ */ jsx(
|
|
37
37
|
Role.div,
|
|
38
38
|
{
|
|
39
|
-
"data-
|
|
39
|
+
"data-_sk-variant": variant,
|
|
40
40
|
...rest,
|
|
41
|
-
className: cx("\u{1F95D}
|
|
41
|
+
className: cx("\u{1F95D}Chip", props.className),
|
|
42
42
|
ref: forwardedRef
|
|
43
43
|
}
|
|
44
44
|
) });
|
|
@@ -55,7 +55,7 @@ const ChipLabel = forwardRef((props, forwardedRef) => {
|
|
|
55
55
|
{
|
|
56
56
|
id: labelId,
|
|
57
57
|
...props,
|
|
58
|
-
className: cx("\u{1F95D}
|
|
58
|
+
className: cx("\u{1F95D}ChipLabel", props.className),
|
|
59
59
|
ref: forwardedRef
|
|
60
60
|
}
|
|
61
61
|
);
|
|
@@ -74,7 +74,7 @@ const ChipDismissButton = forwardRef(
|
|
|
74
74
|
"aria-labelledby": `${id} ${labelId}`,
|
|
75
75
|
...rest,
|
|
76
76
|
label,
|
|
77
|
-
className: cx("\u{1F95D}
|
|
77
|
+
className: cx("\u{1F95D}ChipDismissButton", props.className),
|
|
78
78
|
variant: "ghost",
|
|
79
79
|
labelVariant: "visually-hidden",
|
|
80
80
|
icon: /* @__PURE__ */ jsx(Dismiss, {}),
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as AkDialog from "@ariakit/react/dialog";
|
|
4
|
+
import { Portal, PortalContext } from "@ariakit/react/portal";
|
|
5
|
+
import { Role } from "@ariakit/react/role";
|
|
6
|
+
import { useStoreState } from "@ariakit/react/store";
|
|
7
|
+
import { IconButton, Text } from "@stratakit/bricks";
|
|
8
|
+
import { GhostAligner } from "@stratakit/bricks/secret-internals";
|
|
9
|
+
import {
|
|
10
|
+
forwardRef,
|
|
11
|
+
usePopoverApi
|
|
12
|
+
} from "@stratakit/foundations/secret-internals";
|
|
13
|
+
import cx from "classnames";
|
|
14
|
+
import { Dismiss } from "./~utils.icons.js";
|
|
15
|
+
const DialogRoot = forwardRef((props, forwardedRef) => {
|
|
16
|
+
const { backdrop = true, unmountOnHide = true, ...rest } = props;
|
|
17
|
+
const store = AkDialog.useDialogStore();
|
|
18
|
+
const contentElement = useStoreState(store, "contentElement");
|
|
19
|
+
const mounted = useStoreState(store, (state) => {
|
|
20
|
+
if (!unmountOnHide) return true;
|
|
21
|
+
return props.open ?? state?.mounted;
|
|
22
|
+
});
|
|
23
|
+
if (!mounted) return null;
|
|
24
|
+
return /* @__PURE__ */ jsx(AkDialog.DialogProvider, { store, children: /* @__PURE__ */ jsx(DialogWrapper, { open: props.open, children: /* @__PURE__ */ jsxs(
|
|
25
|
+
AkDialog.Dialog,
|
|
26
|
+
{
|
|
27
|
+
unmountOnHide,
|
|
28
|
+
portal: false,
|
|
29
|
+
...rest,
|
|
30
|
+
backdrop: backdrop === true ? /* @__PURE__ */ jsx(DialogBackdrop, {}) : backdrop,
|
|
31
|
+
className: cx("\u{1F95D}Dialog", props.className),
|
|
32
|
+
ref: forwardedRef,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(AkDialog.DialogDismiss, { hidden: true }),
|
|
35
|
+
/* @__PURE__ */ jsx(PortalContext.Provider, { value: contentElement, children: props.children })
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
) }) });
|
|
39
|
+
});
|
|
40
|
+
DEV: DialogRoot.displayName = "Dialog.Root";
|
|
41
|
+
function DialogWrapper(props) {
|
|
42
|
+
const [wrapper, setWrapper] = React.useState(null);
|
|
43
|
+
const store = AkDialog.useDialogContext();
|
|
44
|
+
const open = useStoreState(store, (state) => {
|
|
45
|
+
return props.open ?? state?.open;
|
|
46
|
+
});
|
|
47
|
+
const popoverProps = usePopoverApi({
|
|
48
|
+
element: wrapper,
|
|
49
|
+
open
|
|
50
|
+
});
|
|
51
|
+
const mounted = useStoreState(store, "mounted");
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
Portal,
|
|
54
|
+
{
|
|
55
|
+
className: "\u{1F95D}DialogWrapper",
|
|
56
|
+
ref: setWrapper,
|
|
57
|
+
...popoverProps,
|
|
58
|
+
hidden: mounted ? void 0 : true,
|
|
59
|
+
children: props.children
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
DEV: DialogWrapper.displayName = "DialogWrapper";
|
|
64
|
+
const DialogHeader = forwardRef(
|
|
65
|
+
(props, forwardedRef) => {
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
Role,
|
|
68
|
+
{
|
|
69
|
+
...props,
|
|
70
|
+
className: cx("\u{1F95D}DialogHeader", props.className),
|
|
71
|
+
ref: forwardedRef
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
DEV: DialogHeader.displayName = "Dialog.Header";
|
|
77
|
+
const DialogHeading = forwardRef(
|
|
78
|
+
(props, forwardedRef) => {
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
AkDialog.DialogHeading,
|
|
81
|
+
{
|
|
82
|
+
...props,
|
|
83
|
+
className: cx("\u{1F95D}DialogHeading", props.className),
|
|
84
|
+
render: /* @__PURE__ */ jsx(Text, { variant: "body-lg", render: props.render ?? /* @__PURE__ */ jsx("h1", {}) }),
|
|
85
|
+
ref: forwardedRef
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
DEV: DialogHeading.displayName = "Dialog.Heading";
|
|
91
|
+
const DialogCloseButton = forwardRef(
|
|
92
|
+
(props, forwardedRef) => {
|
|
93
|
+
const { label = "Dismiss", ...rest } = props;
|
|
94
|
+
return /* @__PURE__ */ jsx(GhostAligner, { align: "inline-end", children: /* @__PURE__ */ jsx(
|
|
95
|
+
AkDialog.DialogDismiss,
|
|
96
|
+
{
|
|
97
|
+
...rest,
|
|
98
|
+
render: /* @__PURE__ */ jsx(
|
|
99
|
+
IconButton,
|
|
100
|
+
{
|
|
101
|
+
render: props.render,
|
|
102
|
+
variant: "ghost",
|
|
103
|
+
label,
|
|
104
|
+
icon: /* @__PURE__ */ jsx(Dismiss, {})
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
ref: forwardedRef
|
|
108
|
+
}
|
|
109
|
+
) });
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
DEV: DialogCloseButton.displayName = "Dialog.CloseButton";
|
|
113
|
+
const DialogContent = forwardRef(
|
|
114
|
+
(props, forwardedRef) => {
|
|
115
|
+
return /* @__PURE__ */ jsx(
|
|
116
|
+
Role,
|
|
117
|
+
{
|
|
118
|
+
...props,
|
|
119
|
+
className: cx("\u{1F95D}DialogContent", props.className),
|
|
120
|
+
ref: forwardedRef
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
DEV: DialogContent.displayName = "Dialog.Content";
|
|
126
|
+
const DialogFooter = forwardRef(
|
|
127
|
+
(props, forwardedRef) => {
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
Role,
|
|
130
|
+
{
|
|
131
|
+
...props,
|
|
132
|
+
className: cx("\u{1F95D}DialogFooter", props.className),
|
|
133
|
+
ref: forwardedRef
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
DEV: DialogFooter.displayName = "Dialog.Footer";
|
|
139
|
+
const DialogActionList = forwardRef(
|
|
140
|
+
(props, forwardedRef) => {
|
|
141
|
+
const { actions, ...rest } = props;
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
143
|
+
Role,
|
|
144
|
+
{
|
|
145
|
+
role: "list",
|
|
146
|
+
...rest,
|
|
147
|
+
className: cx("\u{1F95D}DialogActionList", props.className),
|
|
148
|
+
ref: forwardedRef,
|
|
149
|
+
children: React.Children.map(actions, (action) => {
|
|
150
|
+
return /* @__PURE__ */ jsx("div", { role: "listitem", children: action });
|
|
151
|
+
})
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
DEV: DialogActionList.displayName = "Dialog.ActionList";
|
|
157
|
+
const DialogBackdrop = forwardRef(
|
|
158
|
+
(props, forwardedRef) => {
|
|
159
|
+
return /* @__PURE__ */ jsx(
|
|
160
|
+
Role,
|
|
161
|
+
{
|
|
162
|
+
...props,
|
|
163
|
+
className: cx("\u{1F95D}DialogBackdrop", props.className),
|
|
164
|
+
ref: forwardedRef
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
DEV: DialogBackdrop.displayName = "Dialog.Backdrop";
|
|
170
|
+
export {
|
|
171
|
+
DialogActionList as ActionList,
|
|
172
|
+
DialogBackdrop as Backdrop,
|
|
173
|
+
DialogCloseButton as CloseButton,
|
|
174
|
+
DialogContent as Content,
|
|
175
|
+
DialogFooter as Footer,
|
|
176
|
+
DialogHeader as Header,
|
|
177
|
+
DialogHeading as Heading,
|
|
178
|
+
DialogRoot as Root
|
|
179
|
+
};
|