@moduix/react 2.4.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -86
- package/dist/components/angle-slider/AngleSlider_module.css +2 -2
- package/dist/components/carousel/Carousel_module.css +3 -3
- package/dist/components/date-picker/DatePicker_module.css +9 -2
- package/dist/components/lightbox/Lightbox_module.css +0 -1
- package/dist/components/sidebar/Sidebar.d.ts +10 -9
- package/dist/components/sidebar/Sidebar.js +66 -36
- package/dist/components/sidebar/Sidebar_module.css +120 -70
- package/dist/components/toc/Toc.d.ts +23 -0
- package/dist/components/toc/Toc.js +144 -0
- package/dist/components/toc/Toc.module.js +13 -0
- package/dist/components/toc/Toc_module.css +184 -0
- package/dist/components/toc/index.d.ts +1 -0
- package/dist/components/toc/index.js +1 -0
- package/dist/presets/contrast.css +63 -129
- package/dist/presets/dense.css +63 -129
- package/dist/presets/soft.css +62 -128
- package/dist/styles/animations.css +5 -7
- package/dist/styles/borders.css +2 -2
- package/dist/styles/colors.css +79 -163
- package/dist/styles/opacity.css +4 -5
- package/dist/styles/radius.css +6 -6
- package/dist/styles/reset.css +215 -104
- package/dist/styles/shadows.css +1 -2
- package/dist/styles/sizing.css +5 -2
- package/dist/styles/spacing.css +9 -7
- package/dist/styles/style.css +12 -12
- package/dist/styles/transforms.css +3 -4
- package/dist/styles/transitions.css +19 -15
- package/dist/styles/typography.css +16 -6
- package/dist/styles/z-index.css +2 -2
- package/package.json +12 -8
package/README.md
CHANGED
|
@@ -6,28 +6,18 @@
|
|
|
6
6
|
|
|
7
7
|
# @moduix/react
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
React components built on [Ark UI](https://ark-ui.com/), with accessible behavior, explicit
|
|
10
|
+
composition, and CSS Modules styling.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
moduix gives Ark UI primitives a coherent visual system without adding a styling runtime. Components
|
|
13
|
+
are composed from named parts, styled with regular CSS, and customizable through CSS custom
|
|
14
|
+
properties, `className`, stable `data-slot` hooks, and Ark state attributes.
|
|
15
15
|
|
|
16
16
|
[Documentation](https://moduix.dev/) ·
|
|
17
17
|
[Quick start](https://moduix.dev/docs/quick-start) ·
|
|
18
18
|
[Components](https://moduix.dev/docs/components) ·
|
|
19
19
|
[Tokens](https://moduix.dev/docs/tokens)
|
|
20
20
|
|
|
21
|
-
## Highlights
|
|
22
|
-
|
|
23
|
-
- Ark-aligned composition, controlled and uncontrolled state, context, callbacks, and form behavior.
|
|
24
|
-
- Consistent `36px` primary controls and `32px` popup rows through shared size tokens.
|
|
25
|
-
- Native CSS, CSS Modules, cascade layers, semantic tokens, and component-level variables.
|
|
26
|
-
- Stable moduix `data-slot` hooks alongside Ark part and state attributes.
|
|
27
|
-
- Optional reset and curated `dense`, `soft`, and `contrast` presets.
|
|
28
|
-
- React 18 and 19 support.
|
|
29
|
-
- A matching hosted shadcn registry when source ownership is the better workflow.
|
|
30
|
-
|
|
31
21
|
## Install
|
|
32
22
|
|
|
33
23
|
Install the package and its Ark UI peer dependency:
|
|
@@ -36,42 +26,35 @@ Install the package and its Ark UI peer dependency:
|
|
|
36
26
|
npm install @moduix/react @ark-ui/react
|
|
37
27
|
```
|
|
38
28
|
|
|
39
|
-
`react`, `react-dom`, and `@ark-ui/react` are peer dependencies
|
|
40
|
-
duplicate framework or primitive runtimes.
|
|
41
|
-
|
|
42
|
-
## Compatibility
|
|
29
|
+
`react`, `react-dom`, and `@ark-ui/react` are peer dependencies. moduix supports React 18 and 19.
|
|
43
30
|
|
|
44
|
-
|
|
45
|
-
| ----------- | ------------------------------------------------------------------------- |
|
|
46
|
-
| React | 18 and 19 |
|
|
47
|
-
| Browsers | The latest two stable releases of Chrome, Edge, and Firefox; Safari 16.4+ |
|
|
48
|
-
| SSR | Node.js 20+ with native ESM imports |
|
|
31
|
+
The optional `Chart` component also requires its TanStack peer dependency:
|
|
49
32
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
33
|
+
```bash
|
|
34
|
+
npm install @tanstack/charts
|
|
35
|
+
```
|
|
53
36
|
|
|
54
|
-
## Add
|
|
37
|
+
## Add styles
|
|
55
38
|
|
|
56
|
-
Import the
|
|
39
|
+
Import the shared foundation stylesheet once in your application entry point:
|
|
57
40
|
|
|
58
41
|
```tsx
|
|
59
42
|
import '@moduix/react/style.css';
|
|
60
43
|
```
|
|
61
44
|
|
|
62
|
-
|
|
63
|
-
|
|
45
|
+
It provides the shared tokens and base layer styles. Component imports carry their own CSS Modules,
|
|
46
|
+
so their styles follow the components that use them.
|
|
64
47
|
|
|
65
|
-
The reset is optional
|
|
48
|
+
The reset is optional. Import it first when you choose to use it:
|
|
66
49
|
|
|
67
50
|
```tsx
|
|
68
51
|
import '@moduix/react/reset.css';
|
|
69
52
|
import '@moduix/react/style.css';
|
|
70
53
|
```
|
|
71
54
|
|
|
72
|
-
## Use
|
|
55
|
+
## Use components
|
|
73
56
|
|
|
74
|
-
Import
|
|
57
|
+
Import component subpaths and compose their named parts:
|
|
75
58
|
|
|
76
59
|
```tsx
|
|
77
60
|
import { Button } from '@moduix/react/button';
|
|
@@ -79,7 +62,7 @@ import { Dialog } from '@moduix/react/dialog';
|
|
|
79
62
|
|
|
80
63
|
export function Example() {
|
|
81
64
|
return (
|
|
82
|
-
<Dialog
|
|
65
|
+
<Dialog>
|
|
83
66
|
<Dialog.Trigger asChild>
|
|
84
67
|
<Button>Open settings</Button>
|
|
85
68
|
</Dialog.Trigger>
|
|
@@ -97,52 +80,39 @@ export function Example() {
|
|
|
97
80
|
</Dialog.Footer>
|
|
98
81
|
</Dialog.Content>
|
|
99
82
|
</Dialog.Positioner>
|
|
100
|
-
</Dialog
|
|
83
|
+
</Dialog>
|
|
101
84
|
);
|
|
102
85
|
}
|
|
103
86
|
```
|
|
104
87
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
cases.
|
|
88
|
+
Use the short root alias, such as `Dialog`, in application code. The matching `Dialog.Root` export is
|
|
89
|
+
available when an explicit namespace improves a local abstraction, but it is not required.
|
|
108
90
|
|
|
109
|
-
##
|
|
91
|
+
## Customize deliberately
|
|
110
92
|
|
|
111
|
-
|
|
112
|
-
|
|
93
|
+
CSS Modules keep the package defaults locally scoped while leaving clear extension points for your
|
|
94
|
+
application:
|
|
113
95
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
--moduix-size-md: 36px;
|
|
119
|
-
--moduix-size-sm: 32px;
|
|
120
|
-
}
|
|
96
|
+
- use `className` on a root or named part for local CSS;
|
|
97
|
+
- use stable moduix `data-slot` hooks and Ark state attributes for structural or state-specific
|
|
98
|
+
selectors;
|
|
99
|
+
- override public CSS custom properties at the theme, semantic, or component layer.
|
|
121
100
|
|
|
122
|
-
|
|
123
|
-
--moduix-button-size-md: 32px;
|
|
124
|
-
}
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
The token hierarchy is:
|
|
128
|
-
|
|
129
|
-
1. theme primitives such as `--moduix-primary`, `--moduix-spacing-2`, `--moduix-size-md`, and `--moduix-radius`;
|
|
130
|
-
2. semantic aliases such as `--moduix-color-primary`, `--moduix-spacing-md`, and `--moduix-radius-md`;
|
|
131
|
-
3. shared family defaults such as `--moduix-popup-item-min-height` and `--moduix-focus-ring-width`;
|
|
132
|
-
4. component aliases such as `--moduix-input-height` and `--moduix-select-item-min-height`.
|
|
133
|
-
|
|
134
|
-
Library styles use predictable cascade layers:
|
|
101
|
+
For example, set product-level theme primitives in your own stylesheet:
|
|
135
102
|
|
|
136
103
|
```css
|
|
137
|
-
|
|
104
|
+
:root {
|
|
105
|
+
--moduix-primary: oklch(0.5 0.17 285);
|
|
106
|
+
--moduix-radius: 0.875rem;
|
|
107
|
+
}
|
|
138
108
|
```
|
|
139
109
|
|
|
140
|
-
|
|
141
|
-
|
|
110
|
+
See [Tokens](https://moduix.dev/docs/tokens) and [Themes](https://moduix.dev/docs/themes) for the
|
|
111
|
+
token hierarchy and component-specific variables.
|
|
142
112
|
|
|
143
|
-
## Optional
|
|
113
|
+
## Optional presets
|
|
144
114
|
|
|
145
|
-
Import one preset after `style.css` and
|
|
115
|
+
Import one preset after `style.css` and enable it on the document root:
|
|
146
116
|
|
|
147
117
|
```tsx
|
|
148
118
|
import '@moduix/react/style.css';
|
|
@@ -153,32 +123,20 @@ import '@moduix/react/presets/soft.css';
|
|
|
153
123
|
<html data-moduix-theme="soft"></html>
|
|
154
124
|
```
|
|
155
125
|
|
|
156
|
-
|
|
157
|
-
[Themes](https://moduix.dev/docs/themes) before combining presets or creating a reusable custom
|
|
158
|
-
theme.
|
|
126
|
+
The available presets are `dense`, `soft`, and `contrast`.
|
|
159
127
|
|
|
160
|
-
## Prefer to
|
|
128
|
+
## Prefer to own the source?
|
|
161
129
|
|
|
162
|
-
The
|
|
163
|
-
|
|
164
|
-
|
|
130
|
+
The hosted shadcn-compatible registry provides the same Ark-aligned component contracts in source
|
|
131
|
+
form. Set up `components.json` with the [Quick start](https://moduix.dev/docs/quick-start), then add
|
|
132
|
+
the components you need:
|
|
165
133
|
|
|
166
134
|
```bash
|
|
167
135
|
npx shadcn@latest add @moduix-react/button @moduix-react/dialog
|
|
168
136
|
```
|
|
169
137
|
|
|
170
|
-
Generated files
|
|
171
|
-
|
|
172
|
-
dry runs, and generated stylesheet imports.
|
|
173
|
-
|
|
174
|
-
## Acknowledgements
|
|
175
|
-
|
|
176
|
-
- [Ark UI](https://ark-ui.com/) provides the primitive behavior and composition model.
|
|
177
|
-
- [Chakra UI](https://chakra-ui.com/) informs Ark-aligned ergonomics and design-system craft.
|
|
178
|
-
- [shadcn/ui](https://ui.shadcn.com/) inspires open-code delivery, beautiful defaults, and practical
|
|
179
|
-
documentation.
|
|
180
|
-
- [UnoCSS](https://unocss.dev/) and [Tailwind CSS](https://tailwindcss.com/) provide foundations
|
|
181
|
-
adapted by the optional reset.
|
|
138
|
+
Generated files include the component source, CSS Modules, and required supporting files. Their
|
|
139
|
+
destination paths are controlled by your `components.json` aliases.
|
|
182
140
|
|
|
183
141
|
## Links
|
|
184
142
|
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
|
|
48
48
|
@media (hover: hover) {
|
|
49
49
|
.control-TKuxcQ:not([data-disabled], [data-readonly]):hover {
|
|
50
|
-
background-color: var(--moduix-angle-slider-track-bg-hover,
|
|
50
|
+
background-color: var(--moduix-angle-slider-track-bg-hover, var(--moduix-angle-slider-track-bg, var(--moduix-color-muted)));
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.control-TKuxcQ:not([data-disabled], [data-readonly]):active {
|
|
55
|
-
background-color: var(--moduix-angle-slider-track-bg-active,
|
|
55
|
+
background-color: var(--moduix-angle-slider-track-bg-active, var(--moduix-angle-slider-track-bg, var(--moduix-color-muted)));
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.control-TKuxcQ:after {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
user-select: none;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.
|
|
50
|
+
.itemGroup-a7LtFI[data-orientation="vertical"] {
|
|
51
51
|
overscroll-behavior-x: auto;
|
|
52
52
|
overscroll-behavior-y: contain;
|
|
53
53
|
height: 100%;
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
display: flex;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
.
|
|
133
|
+
.indicatorGroup-TO_gj_[data-orientation="vertical"] {
|
|
134
134
|
flex-direction: column;
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
opacity: var(--moduix-opacity-disabled);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
.indicator-cjLdPK[data-orientation="vertical"][data-current] {
|
|
174
174
|
width: var(--moduix-carousel-indicator-size, var(--moduix-spacing-2));
|
|
175
175
|
height: calc(var(--moduix-carousel-indicator-size, var(--moduix-spacing-2)) * 3);
|
|
176
176
|
}
|
|
@@ -111,12 +111,12 @@
|
|
|
111
111
|
cursor: default;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
.control-pfUmnK:has(.input-c9DrcO
|
|
114
|
+
.control-pfUmnK:has(.input-c9DrcO[data-index="1"]) .input-c9DrcO {
|
|
115
115
|
min-width: min(var(--moduix-date-picker-range-input-min-width, 7.5rem), 100%);
|
|
116
116
|
padding-inline-end: var(--moduix-date-picker-input-padding-x-start, var(--moduix-spacing-3-5));
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
.control-pfUmnK
|
|
119
|
+
.control-pfUmnK .input-c9DrcO[data-index="1"] {
|
|
120
120
|
padding-inline-end: var(--moduix-date-picker-input-padding-x-end, 4.25rem);
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -246,6 +246,13 @@
|
|
|
246
246
|
pointer-events: none;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
@media (prefers-reduced-motion: reduce) {
|
|
250
|
+
.content-pUiIqD[data-state] {
|
|
251
|
+
animation-duration: 1ms;
|
|
252
|
+
animation-delay: 0s;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
249
256
|
.root-sgMq4I[data-inline] .content-pUiIqD {
|
|
250
257
|
min-width: var(--moduix-date-picker-inline-content-min-width, 18rem);
|
|
251
258
|
box-shadow: var(--moduix-date-picker-inline-content-shadow, none);
|
|
@@ -119,7 +119,6 @@
|
|
|
119
119
|
|
|
120
120
|
.gallery-d_JY9F {
|
|
121
121
|
--moduix-carousel-gap: var(--moduix-lightbox-gallery-gap, var(--moduix-spacing-4));
|
|
122
|
-
width: auto;
|
|
123
122
|
max-width: min(var(--moduix-lightbox-gallery-max-width, 72rem),
|
|
124
123
|
calc(100vw - var(--moduix-lightbox-positioner-padding, var(--moduix-spacing-4)) * 2));
|
|
125
124
|
justify-self: center;
|
|
@@ -4,7 +4,6 @@ import { Tooltip } from '../tooltip';
|
|
|
4
4
|
type SidebarSide = 'left' | 'right';
|
|
5
5
|
type SidebarRootProps = Omit<ComponentProps<typeof Splitter.Root>, 'orientation' | 'panels'> & {
|
|
6
6
|
panelId?: string;
|
|
7
|
-
panels?: ComponentProps<typeof Splitter.Root>['panels'];
|
|
8
7
|
side?: SidebarSide;
|
|
9
8
|
};
|
|
10
9
|
type SidebarPanelProps = Omit<ComponentProps<typeof Splitter.Panel>, 'id'>;
|
|
@@ -28,6 +27,8 @@ declare const Sidebar: import("react").ForwardRefExoticComponent<Omit<SidebarRoo
|
|
|
28
27
|
}, "ref"> & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
29
28
|
Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLElement>>;
|
|
30
29
|
Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
|
+
ExpandedContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
|
+
CollapsedContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
32
|
Footer: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLElement>>;
|
|
32
33
|
Separator: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & {
|
|
33
34
|
orientation?: "horizontal" | "vertical";
|
|
@@ -38,22 +39,22 @@ declare const Sidebar: import("react").ForwardRefExoticComponent<Omit<SidebarRoo
|
|
|
38
39
|
GroupLabel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
39
40
|
GroupAction: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
40
41
|
GroupContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
NavigationList: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
43
|
+
NavigationItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
43
44
|
Tooltip: ({ children, content, openDelay, closeDelay, positioning, ...props }: Omit<ComponentProps<typeof Tooltip>, "children" | "disabled" | "positioning"> & {
|
|
44
45
|
children: ComponentProps<typeof Tooltip.Trigger>["children"];
|
|
45
46
|
content: ComponentProps<typeof Tooltip.Content>["children"];
|
|
46
47
|
positioning?: ComponentProps<typeof Tooltip>["positioning"];
|
|
47
48
|
}) => import("react").JSX.Element;
|
|
48
|
-
|
|
49
|
+
NavigationButton: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & {
|
|
49
50
|
active?: boolean;
|
|
50
51
|
size?: "sm" | "md" | "lg";
|
|
51
52
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
NavigationAction: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
54
|
+
NavigationBadge: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
|
+
NavigationSubList: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
56
|
+
NavigationSubItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
57
|
+
NavigationSubButton: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & import("@ark-ui/react/factory").PolymorphicProps & {
|
|
57
58
|
active?: boolean;
|
|
58
59
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
59
60
|
};
|
|
@@ -53,7 +53,7 @@ function toggleSidebarPanel(splitter, panelId) {
|
|
|
53
53
|
if (splitter.isPanelCollapsed(panelId)) return void splitter.expandPanel(panelId);
|
|
54
54
|
splitter.collapsePanel(panelId);
|
|
55
55
|
}
|
|
56
|
-
const Sidebar_SidebarRoot = /*#__PURE__*/ forwardRef(function({ className,
|
|
56
|
+
const Sidebar_SidebarRoot = /*#__PURE__*/ forwardRef(function({ className, defaultSize, panelId = 'sidebar', side = 'left', ...props }, ref) {
|
|
57
57
|
return /*#__PURE__*/ jsx(SidebarConfigContext.Provider, {
|
|
58
58
|
value: {
|
|
59
59
|
panelId,
|
|
@@ -62,7 +62,7 @@ const Sidebar_SidebarRoot = /*#__PURE__*/ forwardRef(function({ className, panel
|
|
|
62
62
|
children: /*#__PURE__*/ jsx(Splitter.Root, {
|
|
63
63
|
...props,
|
|
64
64
|
ref: ref,
|
|
65
|
-
panels:
|
|
65
|
+
panels: getDefaultPanels(side, panelId),
|
|
66
66
|
defaultSize: defaultSize ?? getDefaultSidebarSize(side),
|
|
67
67
|
orientation: "horizontal",
|
|
68
68
|
"data-side": side,
|
|
@@ -118,7 +118,7 @@ const Sidebar_SidebarResizeTrigger = /*#__PURE__*/ forwardRef(function({ childre
|
|
|
118
118
|
"data-side": side,
|
|
119
119
|
"data-slot": "sidebar-resize-trigger",
|
|
120
120
|
className: clsx(Sidebar_module.resizeTrigger, normalizeClassName(className)),
|
|
121
|
-
children:
|
|
121
|
+
children: children
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
124
|
const Sidebar_SidebarTrigger = /*#__PURE__*/ forwardRef(function({ className, children, onClick, type = 'button', 'aria-label': ariaLabel = 'Toggle sidebar', ...props }, ref) {
|
|
@@ -176,6 +176,30 @@ const Sidebar_SidebarContent = /*#__PURE__*/ forwardRef(function({ className, ..
|
|
|
176
176
|
...props
|
|
177
177
|
});
|
|
178
178
|
});
|
|
179
|
+
const Sidebar_SidebarExpandedContent = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
180
|
+
const { collapsed } = useSidebar();
|
|
181
|
+
return /*#__PURE__*/ jsx(ark.div, {
|
|
182
|
+
ref: ref,
|
|
183
|
+
"data-scope": "sidebar",
|
|
184
|
+
"data-part": "expanded-content",
|
|
185
|
+
"data-slot": "sidebar-expanded-content",
|
|
186
|
+
className: normalizeClassName(className),
|
|
187
|
+
...props,
|
|
188
|
+
hidden: collapsed
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
const Sidebar_SidebarCollapsedContent = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
192
|
+
const { collapsed } = useSidebar();
|
|
193
|
+
return /*#__PURE__*/ jsx(ark.div, {
|
|
194
|
+
ref: ref,
|
|
195
|
+
"data-scope": "sidebar",
|
|
196
|
+
"data-part": "collapsed-content",
|
|
197
|
+
"data-slot": "sidebar-collapsed-content",
|
|
198
|
+
className: normalizeClassName(className),
|
|
199
|
+
...props,
|
|
200
|
+
hidden: !collapsed
|
|
201
|
+
});
|
|
202
|
+
});
|
|
179
203
|
const Sidebar_SidebarFooter = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
180
204
|
return /*#__PURE__*/ jsx(ark.footer, {
|
|
181
205
|
ref: ref,
|
|
@@ -227,91 +251,95 @@ const Sidebar_SidebarGroupContent = /*#__PURE__*/ forwardRef(function({ classNam
|
|
|
227
251
|
...props
|
|
228
252
|
});
|
|
229
253
|
});
|
|
230
|
-
const
|
|
254
|
+
const Sidebar_SidebarNavigationList = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
231
255
|
return /*#__PURE__*/ jsx(ark.ul, {
|
|
232
256
|
ref: ref,
|
|
233
257
|
"data-scope": "sidebar",
|
|
234
|
-
"data-part": "
|
|
235
|
-
"data-slot": "sidebar-
|
|
258
|
+
"data-part": "navigation-list",
|
|
259
|
+
"data-slot": "sidebar-navigation-list",
|
|
236
260
|
className: clsx(Sidebar_module.menu, normalizeClassName(className)),
|
|
237
261
|
...props
|
|
238
262
|
});
|
|
239
263
|
});
|
|
240
|
-
const
|
|
264
|
+
const Sidebar_SidebarNavigationItem = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
241
265
|
return /*#__PURE__*/ jsx(ark.li, {
|
|
242
266
|
ref: ref,
|
|
243
267
|
"data-scope": "sidebar",
|
|
244
|
-
"data-part": "
|
|
245
|
-
"data-slot": "sidebar-
|
|
268
|
+
"data-part": "navigation-item",
|
|
269
|
+
"data-slot": "sidebar-navigation-item",
|
|
246
270
|
className: clsx(Sidebar_module.menuItem, normalizeClassName(className)),
|
|
247
271
|
...props
|
|
248
272
|
});
|
|
249
273
|
});
|
|
250
|
-
const
|
|
274
|
+
const Sidebar_SidebarNavigationButton = /*#__PURE__*/ forwardRef(function({ active = false, className, size = 'md', type = 'button', 'aria-current': ariaCurrent, ...props }, ref) {
|
|
251
275
|
return /*#__PURE__*/ jsx(ark.button, {
|
|
252
276
|
ref: ref,
|
|
253
277
|
type: type,
|
|
254
278
|
"aria-current": ariaCurrent ?? (active ? 'page' : void 0),
|
|
255
279
|
"data-scope": "sidebar",
|
|
256
|
-
"data-part": "
|
|
257
|
-
"data-slot": "sidebar-
|
|
280
|
+
"data-part": "navigation-button",
|
|
281
|
+
"data-slot": "sidebar-navigation-button",
|
|
258
282
|
"data-active": active ? '' : void 0,
|
|
259
283
|
"data-size": size,
|
|
260
284
|
className: clsx(Sidebar_module.menuButton, normalizeClassName(className)),
|
|
261
285
|
...props
|
|
262
286
|
});
|
|
263
287
|
});
|
|
264
|
-
const
|
|
288
|
+
const Sidebar_SidebarNavigationAction = /*#__PURE__*/ forwardRef(function({ className, type = 'button', ...props }, ref) {
|
|
265
289
|
return /*#__PURE__*/ jsx(ark.button, {
|
|
266
290
|
ref: ref,
|
|
267
291
|
type: type,
|
|
268
292
|
"data-scope": "sidebar",
|
|
269
|
-
"data-part": "
|
|
270
|
-
"data-slot": "sidebar-
|
|
293
|
+
"data-part": "navigation-action",
|
|
294
|
+
"data-slot": "sidebar-navigation-action",
|
|
271
295
|
className: clsx(Sidebar_module.menuAction, normalizeClassName(className)),
|
|
272
296
|
...props
|
|
273
297
|
});
|
|
274
298
|
});
|
|
275
|
-
const
|
|
299
|
+
const Sidebar_SidebarNavigationBadge = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
276
300
|
return /*#__PURE__*/ jsx(ark.div, {
|
|
277
301
|
ref: ref,
|
|
278
302
|
"data-scope": "sidebar",
|
|
279
|
-
"data-part": "
|
|
280
|
-
"data-slot": "sidebar-
|
|
303
|
+
"data-part": "navigation-badge",
|
|
304
|
+
"data-slot": "sidebar-navigation-badge",
|
|
281
305
|
className: clsx(Sidebar_module.menuBadge, normalizeClassName(className)),
|
|
282
306
|
...props
|
|
283
307
|
});
|
|
284
308
|
});
|
|
285
|
-
const
|
|
309
|
+
const Sidebar_SidebarNavigationSubList = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
286
310
|
return /*#__PURE__*/ jsx(ark.ul, {
|
|
287
311
|
ref: ref,
|
|
288
312
|
"data-scope": "sidebar",
|
|
289
|
-
"data-part": "
|
|
290
|
-
"data-slot": "sidebar-
|
|
313
|
+
"data-part": "navigation-sub-list",
|
|
314
|
+
"data-slot": "sidebar-navigation-sub-list",
|
|
291
315
|
className: clsx(Sidebar_module.menuSub, normalizeClassName(className)),
|
|
292
316
|
...props
|
|
293
317
|
});
|
|
294
318
|
});
|
|
295
|
-
const
|
|
319
|
+
const Sidebar_SidebarNavigationSubItem = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
296
320
|
return /*#__PURE__*/ jsx(ark.li, {
|
|
297
321
|
ref: ref,
|
|
298
322
|
"data-scope": "sidebar",
|
|
299
|
-
"data-part": "
|
|
300
|
-
"data-slot": "sidebar-
|
|
323
|
+
"data-part": "navigation-sub-item",
|
|
324
|
+
"data-slot": "sidebar-navigation-sub-item",
|
|
301
325
|
className: clsx(Sidebar_module.menuSubItem, normalizeClassName(className)),
|
|
302
326
|
...props
|
|
303
327
|
});
|
|
304
328
|
});
|
|
305
|
-
const
|
|
329
|
+
const Sidebar_SidebarNavigationSubButton = /*#__PURE__*/ forwardRef(function({ active = false, children, className, 'aria-current': ariaCurrent, ...props }, ref) {
|
|
306
330
|
return /*#__PURE__*/ jsx(ark.a, {
|
|
307
331
|
ref: ref,
|
|
308
332
|
"aria-current": ariaCurrent ?? (active ? 'page' : void 0),
|
|
309
333
|
"data-scope": "sidebar",
|
|
310
|
-
"data-part": "
|
|
311
|
-
"data-slot": "sidebar-
|
|
334
|
+
"data-part": "navigation-sub-button",
|
|
335
|
+
"data-slot": "sidebar-navigation-sub-button",
|
|
312
336
|
"data-active": active ? '' : void 0,
|
|
313
337
|
className: clsx(Sidebar_module.menuSubButton, normalizeClassName(className)),
|
|
314
|
-
...props
|
|
338
|
+
...props,
|
|
339
|
+
children: 'string' == typeof children ? /*#__PURE__*/ jsx("span", {
|
|
340
|
+
"data-slot": "sidebar-navigation-sub-label",
|
|
341
|
+
children: children
|
|
342
|
+
}) : children
|
|
315
343
|
});
|
|
316
344
|
});
|
|
317
345
|
const Sidebar_SidebarTooltip = function({ children, content, openDelay = 200, closeDelay = 0, positioning, ...props }) {
|
|
@@ -365,20 +393,22 @@ const Sidebar = Object.assign(Sidebar_SidebarRoot, {
|
|
|
365
393
|
Input: Sidebar_SidebarInput,
|
|
366
394
|
Header: Sidebar_SidebarHeader,
|
|
367
395
|
Content: Sidebar_SidebarContent,
|
|
396
|
+
ExpandedContent: Sidebar_SidebarExpandedContent,
|
|
397
|
+
CollapsedContent: Sidebar_SidebarCollapsedContent,
|
|
368
398
|
Footer: Sidebar_SidebarFooter,
|
|
369
399
|
Separator: Sidebar_SidebarSeparator,
|
|
370
400
|
Group: Sidebar_SidebarGroup,
|
|
371
401
|
GroupLabel: Sidebar_SidebarGroupLabel,
|
|
372
402
|
GroupAction: Sidebar_SidebarGroupAction,
|
|
373
403
|
GroupContent: Sidebar_SidebarGroupContent,
|
|
374
|
-
|
|
375
|
-
|
|
404
|
+
NavigationList: Sidebar_SidebarNavigationList,
|
|
405
|
+
NavigationItem: Sidebar_SidebarNavigationItem,
|
|
376
406
|
Tooltip: Sidebar_SidebarTooltip,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
407
|
+
NavigationButton: Sidebar_SidebarNavigationButton,
|
|
408
|
+
NavigationAction: Sidebar_SidebarNavigationAction,
|
|
409
|
+
NavigationBadge: Sidebar_SidebarNavigationBadge,
|
|
410
|
+
NavigationSubList: Sidebar_SidebarNavigationSubList,
|
|
411
|
+
NavigationSubItem: Sidebar_SidebarNavigationSubItem,
|
|
412
|
+
NavigationSubButton: Sidebar_SidebarNavigationSubButton
|
|
383
413
|
});
|
|
384
414
|
export { Sidebar, useSidebar };
|