moduix 0.7.0 → 0.8.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 +101 -22
- package/dist/components/Autocomplete/Autocomplete.d.ts +3 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +43 -0
- package/dist/components/Breadcrumbs/index.d.ts +2 -0
- package/dist/components/Combobox/Combobox.d.ts +3 -3
- package/dist/components/Lightbox/Lightbox.d.ts +59 -0
- package/dist/components/Lightbox/index.d.ts +1 -0
- package/dist/components/List/List.d.ts +10 -3
- package/dist/components/Menu/Menu.d.ts +6 -2
- package/dist/components/Menubar/Menubar.d.ts +6 -2
- package/dist/components/NavigationMenu/NavigationMenu.d.ts +6 -2
- package/dist/components/Pagination/Pagination.d.ts +23 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +3 -3
- package/dist/components/PreviewCard/PreviewCard.d.ts +3 -3
- package/dist/components/Select/Select.d.ts +3 -3
- package/dist/components/Tabs/Tabs.d.ts +2 -3
- package/dist/components/Tooltip/Tooltip.d.ts +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2096 -1626
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,53 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/moduix)
|
|
4
|
+
[](https://www.typescriptlang.org/)
|
|
5
|
+
[](https://turbo.build/)
|
|
6
|
+
|
|
1
7
|
# moduix
|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
Composable React components for product interfaces, built on top of
|
|
10
|
+
[Base UI](https://base-ui.com/) primitives.
|
|
11
|
+
|
|
12
|
+
moduix gives you ready-made components with accessible behavior, native CSS styles, and a
|
|
13
|
+
composition-first API. It is inspired by the clarity of
|
|
14
|
+
[shadcn/ui](https://ui.shadcn.com/), and it is trying to combine two useful workflows: install
|
|
15
|
+
components as a regular npm package when that fits your project, or copy component source when
|
|
16
|
+
you need direct ownership.
|
|
17
|
+
|
|
18
|
+
## Why It Exists
|
|
19
|
+
|
|
20
|
+
moduix started as an internal tool for shared product UI. We needed a component library that
|
|
21
|
+
was practical enough for real application screens, predictable enough to use across teams, and
|
|
22
|
+
small enough to stay easy to understand.
|
|
23
|
+
|
|
24
|
+
The library is now public because it may be useful outside of the original company context. If
|
|
25
|
+
it helps another team build consistent interfaces faster, that is already a good outcome.
|
|
4
26
|
|
|
5
|
-
##
|
|
27
|
+
## Principles
|
|
6
28
|
|
|
7
|
-
|
|
29
|
+
- **Base UI underneath.** Components are built on accessible Base UI primitives instead of
|
|
30
|
+
reimplementing low-level interaction behavior.
|
|
31
|
+
- **Small dependency surface.** Base UI is the only external UI primitive layer. The package
|
|
32
|
+
keeps the runtime stack intentionally small and does not bring a styling framework with it.
|
|
33
|
+
- **Two installation paths.** Use moduix as an npm package, or copy component source into your
|
|
34
|
+
project when direct ownership is more important than package-managed updates.
|
|
35
|
+
- **Composable API.** Components are exposed as named parts, so complex UI can be assembled
|
|
36
|
+
without hiding important structure.
|
|
37
|
+
- **Native CSS.** Styles are distributed as CSS, use CSS custom properties, and are designed to
|
|
38
|
+
work with your existing styling approach.
|
|
39
|
+
- **Not a shadcn/ui competitor.** shadcn/ui is a major inspiration for the developer experience.
|
|
40
|
+
moduix explores whether package-managed components and copy-owned components can coexist in
|
|
41
|
+
one library.
|
|
8
42
|
|
|
9
|
-
##
|
|
43
|
+
## Installation
|
|
10
44
|
|
|
11
45
|
```bash
|
|
12
46
|
npm install moduix @base-ui/react
|
|
13
47
|
```
|
|
14
48
|
|
|
15
|
-
`react`, `react-dom`, and `@base-ui/react` are peer dependencies. They stay in your application
|
|
49
|
+
`react`, `react-dom`, and `@base-ui/react` are peer dependencies. They stay in your application
|
|
50
|
+
bundle, so moduix does not ship duplicate React or Base UI runtimes.
|
|
16
51
|
|
|
17
52
|
## Usage
|
|
18
53
|
|
|
@@ -22,7 +57,7 @@ Import the library styles once in your application entry point:
|
|
|
22
57
|
import 'moduix/style.css';
|
|
23
58
|
```
|
|
24
59
|
|
|
25
|
-
Then import the components you need:
|
|
60
|
+
Then import and compose the components you need:
|
|
26
61
|
|
|
27
62
|
```tsx
|
|
28
63
|
import { Button, Dialog, DialogContent, DialogTitle, DialogTrigger } from 'moduix';
|
|
@@ -39,11 +74,13 @@ export function Example() {
|
|
|
39
74
|
}
|
|
40
75
|
```
|
|
41
76
|
|
|
42
|
-
The
|
|
77
|
+
The distributed stylesheet includes component styles and design tokens. It does not force a
|
|
78
|
+
global application theme or utility CSS runtime.
|
|
43
79
|
|
|
44
80
|
## Styling
|
|
45
81
|
|
|
46
|
-
Components
|
|
82
|
+
Components accept `className` where customization is expected and expose stable `data-slot`
|
|
83
|
+
attributes for targeted styling. Theme values are regular CSS custom properties:
|
|
47
84
|
|
|
48
85
|
```css
|
|
49
86
|
:root {
|
|
@@ -52,17 +89,37 @@ Components expose stable `data-slot` attributes and accept `className` where cus
|
|
|
52
89
|
}
|
|
53
90
|
```
|
|
54
91
|
|
|
55
|
-
|
|
92
|
+
Library CSS is organized with cascade layers:
|
|
56
93
|
|
|
57
94
|
```css
|
|
58
95
|
@layer ui.reset, ui.tokens, ui.components;
|
|
59
96
|
```
|
|
60
97
|
|
|
61
|
-
This keeps
|
|
98
|
+
This keeps defaults predictable while still letting application styles override tokens,
|
|
99
|
+
classes, or component-level variables.
|
|
100
|
+
|
|
101
|
+
## What Is Included
|
|
102
|
+
|
|
103
|
+
The package exports composed components for common product UI needs, including Accordion,
|
|
104
|
+
AlertDialog, Autocomplete, Avatar, Button, Checkbox, Dialog, Drawer, Field, Form, Input,
|
|
105
|
+
Menu, NavigationMenu, Popover, Select, Tabs, Toast, Tooltip, and supporting primitives.
|
|
106
|
+
|
|
107
|
+
## Documentation
|
|
108
|
+
|
|
109
|
+
- Documentation: https://moduix.blinks44.workers.dev/
|
|
110
|
+
- npm package: https://www.npmjs.com/package/moduix
|
|
111
|
+
- UI package README: `packages/ui/README.md`
|
|
112
|
+
- Docs app README: `apps/docs/README.md`
|
|
113
|
+
|
|
114
|
+
## Repository Quick Start
|
|
62
115
|
|
|
63
|
-
|
|
116
|
+
From the monorepo root:
|
|
64
117
|
|
|
65
|
-
|
|
118
|
+
```bash
|
|
119
|
+
npm install
|
|
120
|
+
npm run build:ui
|
|
121
|
+
npm run dev
|
|
122
|
+
```
|
|
66
123
|
|
|
67
124
|
## Acknowledgements
|
|
68
125
|
|
|
@@ -76,16 +133,38 @@ This project could not exist without the work of these teams and communities:
|
|
|
76
133
|
- [TanStack](https://tanstack.com/) for the application tooling used by the docs.
|
|
77
134
|
- [Voidzero](https://voidzero.dev/) for awesome JS tools
|
|
78
135
|
|
|
79
|
-
##
|
|
136
|
+
## Contributing
|
|
80
137
|
|
|
81
|
-
|
|
138
|
+
Contributions are welcome, especially bug reports, accessibility fixes, documentation
|
|
139
|
+
improvements, and focused component improvements.
|
|
82
140
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
npm
|
|
89
|
-
```
|
|
141
|
+
Before opening a pull request:
|
|
142
|
+
|
|
143
|
+
1. Install dependencies from the repository root:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
npm install
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
2. Build the UI package when your change affects `packages/ui` or documentation examples:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
npm run build:ui
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
3. Run the required checks:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
npm run fmt:fix
|
|
159
|
+
npm run lint:check
|
|
160
|
+
npm run tsc:check
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Keep pull requests small and specific. For component changes, update the related stories,
|
|
164
|
+
exports, and documentation so the package and docs stay in sync.
|
|
90
165
|
|
|
91
|
-
|
|
166
|
+
Feel free to use agents or code generation tools, but
|
|
167
|
+
please review the result before submitting. The components are intentionally small and direct,
|
|
168
|
+
so the goal is to keep the code readable, maintainable, and free from unnecessary abstractions.
|
|
169
|
+
I added the `skills` folder so code written with agents stays consistent with the rest of the
|
|
170
|
+
library components.
|
|
@@ -10,8 +10,8 @@ type AutocompleteContentProps = AutocompletePrimitive.Popup.Props & Pick<Autocom
|
|
|
10
10
|
classNames?: AutocompleteContentClassNames;
|
|
11
11
|
container?: AutocompletePrimitive.Portal.Props['container'];
|
|
12
12
|
withBackdrop?: boolean;
|
|
13
|
-
|
|
14
|
-
arrow?: React.ReactNode;
|
|
13
|
+
withArrow?: boolean;
|
|
14
|
+
arrow?: boolean | React.ReactNode;
|
|
15
15
|
portalProps?: Omit<AutocompletePrimitive.Portal.Props, 'className' | 'children'>;
|
|
16
16
|
backdropProps?: Omit<AutocompletePrimitive.Backdrop.Props, 'className'>;
|
|
17
17
|
positionerProps?: Omit<AutocompletePrimitive.Positioner.Props, 'className' | 'children'>;
|
|
@@ -29,7 +29,7 @@ declare function AutocompleteTrigger({ className, children, ...props }: Autocomp
|
|
|
29
29
|
declare function AutocompleteFieldTrigger({ className, ...props }: AutocompletePrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
declare function AutocompleteIcon({ className, children, ...props }: AutocompletePrimitive.Icon.Props): import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
declare function AutocompleteClear({ className, children, ...props }: AutocompletePrimitive.Clear.Props): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
declare function AutocompleteContent({ className, classNames, container, withBackdrop,
|
|
32
|
+
declare function AutocompleteContent({ className, classNames, container, withBackdrop, withArrow, arrow, portalProps, backdropProps, positionerProps, arrowProps, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, ...props }: AutocompleteContentProps): import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
declare function AutocompleteStatus({ className, ...props }: AutocompletePrimitive.Status.Props): import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
declare function AutocompleteEmpty({ className, ...props }: AutocompletePrimitive.Empty.Props): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
declare function AutocompleteList({ className, ...props }: AutocompletePrimitive.List.Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type BreadcrumbsItemRenderProps = Omit<React.ComponentProps<'a'>, 'children'> & {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
type BreadcrumbsItem = {
|
|
7
|
+
key?: React.Key;
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
href?: string;
|
|
10
|
+
target?: React.ComponentProps<'a'>['target'];
|
|
11
|
+
rel?: React.ComponentProps<'a'>['rel'];
|
|
12
|
+
onClick?: React.ComponentProps<'a'>['onClick'];
|
|
13
|
+
render?: (props: BreadcrumbsItemRenderProps) => React.ReactElement;
|
|
14
|
+
};
|
|
15
|
+
type BreadcrumbsClassNames = {
|
|
16
|
+
ellipsisTrigger?: MenuPrimitive.Trigger.Props['className'];
|
|
17
|
+
popup?: MenuPrimitive.Popup.Props['className'];
|
|
18
|
+
popupItem?: MenuPrimitive.Item.Props['className'];
|
|
19
|
+
portal?: MenuPrimitive.Portal.Props['className'];
|
|
20
|
+
positioner?: MenuPrimitive.Positioner.Props['className'];
|
|
21
|
+
};
|
|
22
|
+
type BreadcrumbsSlotProps = {
|
|
23
|
+
ellipsisTrigger?: Omit<MenuPrimitive.Trigger.Props, 'children' | 'className'>;
|
|
24
|
+
popup?: Omit<MenuPrimitive.Popup.Props, 'children' | 'className'>;
|
|
25
|
+
popupItem?: Omit<MenuPrimitive.Item.Props, 'children' | 'className'>;
|
|
26
|
+
popupLinkItem?: Omit<MenuPrimitive.LinkItem.Props, 'children' | 'className' | 'href' | 'render'>;
|
|
27
|
+
portal?: Omit<MenuPrimitive.Portal.Props, 'children' | 'className'>;
|
|
28
|
+
positioner?: Omit<MenuPrimitive.Positioner.Props, 'children' | 'className'>;
|
|
29
|
+
};
|
|
30
|
+
type BreadcrumbsProps = Omit<React.ComponentProps<'nav'>, 'children'> & {
|
|
31
|
+
items: BreadcrumbsItem[];
|
|
32
|
+
separator?: React.ReactNode;
|
|
33
|
+
maxItems?: number;
|
|
34
|
+
itemsBeforeCollapse?: number;
|
|
35
|
+
itemsAfterCollapse?: number;
|
|
36
|
+
ellipsisLabel?: React.ReactNode;
|
|
37
|
+
hiddenItemsMenuLabel?: string;
|
|
38
|
+
classNames?: BreadcrumbsClassNames;
|
|
39
|
+
slotProps?: BreadcrumbsSlotProps;
|
|
40
|
+
};
|
|
41
|
+
declare function Breadcrumbs({ className, items, separator, maxItems, itemsBeforeCollapse, itemsAfterCollapse, ellipsisLabel, hiddenItemsMenuLabel, classNames, slotProps, ...props }: BreadcrumbsProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export { Breadcrumbs };
|
|
43
|
+
export type { BreadcrumbsProps, BreadcrumbsItem, BreadcrumbsItemRenderProps, BreadcrumbsClassNames, BreadcrumbsSlotProps, };
|
|
@@ -10,8 +10,8 @@ type ComboboxContentProps = ComboboxPrimitive.Popup.Props & Pick<ComboboxPrimiti
|
|
|
10
10
|
classNames?: ComboboxContentClassNames;
|
|
11
11
|
container?: ComboboxPrimitive.Portal.Props['container'];
|
|
12
12
|
withBackdrop?: boolean;
|
|
13
|
-
|
|
14
|
-
arrow?: React.ReactNode;
|
|
13
|
+
withArrow?: boolean;
|
|
14
|
+
arrow?: boolean | React.ReactNode;
|
|
15
15
|
portalProps?: Omit<ComboboxPrimitive.Portal.Props, 'className' | 'children'>;
|
|
16
16
|
backdropProps?: Omit<ComboboxPrimitive.Backdrop.Props, 'className'>;
|
|
17
17
|
positionerProps?: Omit<ComboboxPrimitive.Positioner.Props, 'className' | 'children'>;
|
|
@@ -33,7 +33,7 @@ declare function ComboboxTrigger({ className, children, ...props }: ComboboxPrim
|
|
|
33
33
|
declare function ComboboxIcon({ className, children, ...props }: ComboboxPrimitive.Icon.Props): import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
declare function ComboboxClear({ className, children, ...props }: ComboboxPrimitive.Clear.Props): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
declare function ComboboxInlineInputContainer({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
declare function ComboboxContent({ className, classNames, container, withBackdrop,
|
|
36
|
+
declare function ComboboxContent({ className, classNames, container, withBackdrop, withArrow, arrow, portalProps, backdropProps, positionerProps, arrowProps, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, ...props }: ComboboxContentProps): import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
declare function ComboboxStatus({ className, ...props }: ComboboxPrimitive.Status.Props): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
declare function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props): import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
declare function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type LightboxContentClassNames = {
|
|
4
|
+
portal?: DialogPrimitive.Portal.Props['className'];
|
|
5
|
+
backdrop?: DialogPrimitive.Backdrop.Props['className'];
|
|
6
|
+
viewport?: DialogPrimitive.Viewport.Props['className'];
|
|
7
|
+
frame?: string;
|
|
8
|
+
};
|
|
9
|
+
type LightboxContentSlotProps = {
|
|
10
|
+
portal?: Omit<DialogPrimitive.Portal.Props, 'className' | 'children'>;
|
|
11
|
+
backdrop?: Omit<DialogPrimitive.Backdrop.Props, 'className'>;
|
|
12
|
+
viewport?: Omit<DialogPrimitive.Viewport.Props, 'className' | 'children'>;
|
|
13
|
+
};
|
|
14
|
+
type LightboxContentProps = Omit<DialogPrimitive.Popup.Props, 'className'> & {
|
|
15
|
+
className?: DialogPrimitive.Popup.Props['className'];
|
|
16
|
+
classNames?: LightboxContentClassNames;
|
|
17
|
+
slotProps?: LightboxContentSlotProps;
|
|
18
|
+
container?: DialogPrimitive.Portal.Props['container'];
|
|
19
|
+
withBackdrop?: boolean;
|
|
20
|
+
closeLabel?: string;
|
|
21
|
+
closeButton?: DialogPrimitive.Close.Props['render'];
|
|
22
|
+
withCloseButton?: boolean;
|
|
23
|
+
closeOnContentClick?: boolean;
|
|
24
|
+
};
|
|
25
|
+
type LightboxImageProps = Omit<React.ComponentProps<'img'>, 'src'> & {
|
|
26
|
+
src: string;
|
|
27
|
+
/**
|
|
28
|
+
* Controls image source used in popup. Defaults to `src`.
|
|
29
|
+
*/
|
|
30
|
+
previewSrc?: string;
|
|
31
|
+
};
|
|
32
|
+
type LightboxGalleryProps = {
|
|
33
|
+
selector?: string;
|
|
34
|
+
rootRef?: React.RefObject<HTMLElement | null>;
|
|
35
|
+
rootSelector?: string;
|
|
36
|
+
withBackdrop?: boolean;
|
|
37
|
+
closeLabel?: string;
|
|
38
|
+
className?: DialogPrimitive.Popup.Props['className'];
|
|
39
|
+
classNames?: LightboxContentClassNames;
|
|
40
|
+
slotProps?: LightboxContentSlotProps;
|
|
41
|
+
container?: DialogPrimitive.Portal.Props['container'];
|
|
42
|
+
};
|
|
43
|
+
declare const Lightbox: typeof DialogPrimitive.Root;
|
|
44
|
+
declare const createLightboxHandle: typeof DialogPrimitive.createHandle;
|
|
45
|
+
declare function LightboxTrigger({ className, render, ...props }: DialogPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
declare function LightboxPortal({ className, ...props }: DialogPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare function LightboxBackdrop({ className, ...props }: DialogPrimitive.Backdrop.Props): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
declare function LightboxViewport({ className, ...props }: DialogPrimitive.Viewport.Props): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare function LightboxPopup({ className, ...props }: DialogPrimitive.Popup.Props): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
declare function LightboxClose({ className, ...props }: DialogPrimitive.Close.Props): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
declare function LightboxImage({ src, previewSrc, alt, className, ...props }: LightboxImageProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
declare function LightboxContent({ className, classNames, slotProps, container, withBackdrop, withCloseButton, closeOnContentClick, closeLabel, closeButton, children, ...props }: LightboxContentProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
declare function LightboxGallery({ selector, rootRef, rootSelector, withBackdrop, closeLabel, className, classNames, slotProps, container, }: LightboxGalleryProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
type LightboxProps<Payload = unknown> = DialogPrimitive.Root.Props<Payload>;
|
|
55
|
+
type LightboxHandle<Payload = unknown> = DialogPrimitive.Handle<Payload>;
|
|
56
|
+
type LightboxTriggerProps = DialogPrimitive.Trigger.Props;
|
|
57
|
+
type LightboxCloseProps = DialogPrimitive.Close.Props;
|
|
58
|
+
export { Lightbox, createLightboxHandle, LightboxTrigger, LightboxPortal, LightboxBackdrop, LightboxViewport, LightboxPopup, LightboxContent, LightboxClose, LightboxImage, LightboxGallery, };
|
|
59
|
+
export type { LightboxProps, LightboxHandle, LightboxTriggerProps, LightboxContentProps, LightboxCloseProps, LightboxImageProps, LightboxGalleryProps, LightboxContentClassNames, LightboxContentSlotProps, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Lightbox';
|
|
@@ -11,8 +11,15 @@ type ListProps = React.ComponentPropsWithoutRef<ListAs> & {
|
|
|
11
11
|
size?: ListSize;
|
|
12
12
|
tone?: ListTone;
|
|
13
13
|
};
|
|
14
|
-
type
|
|
14
|
+
type ListItemClassNames = {
|
|
15
|
+
marker?: string;
|
|
16
|
+
content?: string;
|
|
17
|
+
};
|
|
18
|
+
type ListItemProps = React.ComponentProps<'li'> & {
|
|
19
|
+
marker?: React.ReactNode;
|
|
20
|
+
classNames?: ListItemClassNames;
|
|
21
|
+
};
|
|
15
22
|
declare function List({ as, marker, gap, size, tone, className, ...props }: ListProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
declare function ListItem({ className, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function ListItem({ className, classNames, marker, children, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
24
|
export { List, ListItem };
|
|
18
|
-
export type { ListProps, ListItemProps, ListAs, ListMarker, ListGap, ListSize, ListTone };
|
|
25
|
+
export type { ListProps, ListItemProps, ListItemClassNames, ListAs, ListMarker, ListGap, ListSize, ListTone, };
|
|
@@ -4,18 +4,22 @@ type MenuContentClassNames = {
|
|
|
4
4
|
portal?: MenuPrimitive.Portal.Props['className'];
|
|
5
5
|
backdrop?: MenuPrimitive.Backdrop.Props['className'];
|
|
6
6
|
positioner?: MenuPrimitive.Positioner.Props['className'];
|
|
7
|
+
arrow?: MenuPrimitive.Arrow.Props['className'];
|
|
7
8
|
viewport?: MenuPrimitive.Viewport.Props['className'];
|
|
8
9
|
};
|
|
9
10
|
type MenuContentSlotProps = {
|
|
10
11
|
portal?: Omit<MenuPrimitive.Portal.Props, 'className' | 'children'>;
|
|
11
12
|
backdrop?: Omit<MenuPrimitive.Backdrop.Props, 'className'>;
|
|
12
13
|
positioner?: Omit<MenuPrimitive.Positioner.Props, 'className' | 'children'>;
|
|
14
|
+
arrow?: Omit<MenuPrimitive.Arrow.Props, 'className' | 'children'>;
|
|
13
15
|
viewport?: Omit<MenuPrimitive.Viewport.Props, 'className' | 'children'>;
|
|
14
16
|
};
|
|
15
17
|
type MenuContentProps = MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'arrowPadding' | 'anchor' | 'collisionAvoidance' | 'collisionBoundary' | 'collisionPadding' | 'sticky' | 'positionMethod' | 'disableAnchorTracking'> & {
|
|
16
18
|
classNames?: MenuContentClassNames;
|
|
17
19
|
slotProps?: MenuContentSlotProps;
|
|
18
20
|
container?: MenuPrimitive.Portal.Props['container'];
|
|
21
|
+
withArrow?: boolean;
|
|
22
|
+
arrow?: boolean | React.ReactNode;
|
|
19
23
|
withBackdrop?: boolean;
|
|
20
24
|
withViewport?: boolean;
|
|
21
25
|
};
|
|
@@ -32,8 +36,8 @@ declare const createMenuHandle: typeof MenuPrimitive.createHandle;
|
|
|
32
36
|
declare function MenuTrigger({ className, render, ...props }: MenuPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
33
37
|
declare function MenuTriggerIcon({ className, children, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
34
38
|
declare function MenuArrow({ className, children, ...props }: MenuPrimitive.Arrow.Props): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
declare function MenuContent({ className, classNames, slotProps, children, container, withBackdrop, withViewport, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, disableAnchorTracking, ...props }: MenuContentProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
declare function MenuSubmenuContent({ sideOffset, alignOffset, ...props }: MenuContentProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare function MenuContent({ className, classNames, slotProps, children, container, withArrow, arrow, withBackdrop, withViewport, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, disableAnchorTracking, ...props }: MenuContentProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare function MenuSubmenuContent({ withArrow, arrow, sideOffset, alignOffset, ...props }: MenuContentProps): import("react/jsx-runtime").JSX.Element;
|
|
37
41
|
declare function MenuItem({ className, ...props }: MenuPrimitive.Item.Props): import("react/jsx-runtime").JSX.Element;
|
|
38
42
|
declare function MenuLinkItem({ className, ...props }: MenuPrimitive.LinkItem.Props): import("react/jsx-runtime").JSX.Element;
|
|
39
43
|
declare function MenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,18 +5,22 @@ type MenubarContentClassNames = {
|
|
|
5
5
|
portal?: MenuPrimitive.Portal.Props['className'];
|
|
6
6
|
backdrop?: MenuPrimitive.Backdrop.Props['className'];
|
|
7
7
|
positioner?: MenuPrimitive.Positioner.Props['className'];
|
|
8
|
+
arrow?: MenuPrimitive.Arrow.Props['className'];
|
|
8
9
|
viewport?: MenuPrimitive.Viewport.Props['className'];
|
|
9
10
|
};
|
|
10
11
|
type MenubarContentSlotProps = {
|
|
11
12
|
portal?: Omit<MenuPrimitive.Portal.Props, 'className' | 'children'>;
|
|
12
13
|
backdrop?: Omit<MenuPrimitive.Backdrop.Props, 'className'>;
|
|
13
14
|
positioner?: Omit<MenuPrimitive.Positioner.Props, 'className' | 'children'>;
|
|
15
|
+
arrow?: Omit<MenuPrimitive.Arrow.Props, 'className' | 'children'>;
|
|
14
16
|
viewport?: Omit<MenuPrimitive.Viewport.Props, 'className' | 'children'>;
|
|
15
17
|
};
|
|
16
18
|
type MenubarContentProps = MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'arrowPadding' | 'anchor' | 'collisionAvoidance' | 'collisionBoundary' | 'collisionPadding' | 'sticky' | 'positionMethod' | 'disableAnchorTracking'> & {
|
|
17
19
|
classNames?: MenubarContentClassNames;
|
|
18
20
|
slotProps?: MenubarContentSlotProps;
|
|
19
21
|
container?: MenuPrimitive.Portal.Props['container'];
|
|
22
|
+
withArrow?: boolean;
|
|
23
|
+
arrow?: boolean | React.ReactNode;
|
|
20
24
|
withBackdrop?: boolean;
|
|
21
25
|
};
|
|
22
26
|
type IndicatorPosition = 'start' | 'end';
|
|
@@ -32,8 +36,8 @@ declare const createMenubarMenuHandle: typeof MenuPrimitive.createHandle;
|
|
|
32
36
|
declare function Menubar({ className, ...props }: MenubarPrimitive.Props): import("react/jsx-runtime").JSX.Element;
|
|
33
37
|
declare function MenubarTrigger({ className, render, ...props }: MenuPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
34
38
|
declare function MenubarArrow({ className, children, ...props }: MenuPrimitive.Arrow.Props): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
declare function MenubarContent({ className, classNames, slotProps, children, container, withBackdrop, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, disableAnchorTracking, ...props }: MenubarContentProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
declare function MenubarSubmenuContent({ sideOffset, alignOffset, ...props }: MenubarContentProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare function MenubarContent({ className, classNames, slotProps, children, container, withArrow, arrow, withBackdrop, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, disableAnchorTracking, ...props }: MenubarContentProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare function MenubarSubmenuContent({ withArrow, arrow, sideOffset, alignOffset, ...props }: MenubarContentProps): import("react/jsx-runtime").JSX.Element;
|
|
37
41
|
declare function MenubarItem({ className, ...props }: MenuPrimitive.Item.Props): import("react/jsx-runtime").JSX.Element;
|
|
38
42
|
declare function MenubarLinkItem({ className, ...props }: MenuPrimitive.LinkItem.Props): import("react/jsx-runtime").JSX.Element;
|
|
39
43
|
declare function MenubarSeparator({ className, ...props }: MenuPrimitive.Separator.Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -30,9 +30,13 @@ type NavigationMenuPopupOptions = NavigationMenuPrimitive.Popup.Props & {
|
|
|
30
30
|
classNames?: NavigationMenuPopupClassNames;
|
|
31
31
|
slotProps?: NavigationMenuPopupSlotProps;
|
|
32
32
|
container?: NavigationMenuPrimitive.Portal.Props['container'];
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
withArrow?: boolean;
|
|
34
|
+
arrow?: boolean | React.ReactNode;
|
|
35
35
|
withBackdrop?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Stretches the popup to viewport width while preserving trigger-driven vertical positioning.
|
|
38
|
+
*/
|
|
39
|
+
fullWidth?: boolean;
|
|
36
40
|
};
|
|
37
41
|
type NavigationMenuClassNames = {
|
|
38
42
|
viewport?: NavigationMenuPrimitive.Viewport.Props['className'];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type PaginationToolbarVariant = 'default' | 'outline' | 'ghost';
|
|
3
|
+
type PaginationToolbarSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
type PaginationSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
type PaginationProps = Omit<React.ComponentProps<'nav'>, 'onChange'> & {
|
|
6
|
+
count: number;
|
|
7
|
+
page?: number;
|
|
8
|
+
defaultPage?: number;
|
|
9
|
+
onPageChange?: (page: number) => void;
|
|
10
|
+
visiblePages?: number;
|
|
11
|
+
showPages?: boolean;
|
|
12
|
+
showArrows?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
getPageHref?: (page: number) => string;
|
|
15
|
+
size?: PaginationSize;
|
|
16
|
+
toolbarVariant?: PaginationToolbarVariant;
|
|
17
|
+
toolbarSize?: PaginationToolbarSize;
|
|
18
|
+
previousLabel?: string;
|
|
19
|
+
nextLabel?: string;
|
|
20
|
+
};
|
|
21
|
+
declare function Pagination({ className, count, page, defaultPage, onPageChange, visiblePages, showPages, showArrows, disabled, getPageHref, size, toolbarVariant, toolbarSize, previousLabel, nextLabel, ...props }: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export { Pagination };
|
|
23
|
+
export type { PaginationProps, PaginationToolbarVariant, PaginationToolbarSize, PaginationSize };
|
|
@@ -18,8 +18,8 @@ type PopoverContentProps = PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.
|
|
|
18
18
|
classNames?: PopoverContentClassNames;
|
|
19
19
|
slotProps?: PopoverContentSlotProps;
|
|
20
20
|
container?: PopoverPrimitive.Portal.Props['container'];
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
withArrow?: boolean;
|
|
22
|
+
arrow?: boolean | React.ReactNode;
|
|
23
23
|
withBackdrop?: boolean;
|
|
24
24
|
withViewport?: boolean;
|
|
25
25
|
};
|
|
@@ -32,7 +32,7 @@ declare function PopoverHeader({ className, ...props }: React.ComponentProps<'di
|
|
|
32
32
|
declare function PopoverBody({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
declare function PopoverFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
declare function PopoverClose({ className, ...props }: PopoverPrimitive.Close.Props): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
declare function PopoverContent({ className, classNames, slotProps, container,
|
|
35
|
+
declare function PopoverContent({ className, classNames, slotProps, container, withArrow, arrow, withBackdrop, withViewport, disableAnchorTracking, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, children, ...props }: PopoverContentProps): import("react/jsx-runtime").JSX.Element;
|
|
36
36
|
type PopoverProps<Payload = unknown> = PopoverPrimitive.Root.Props<Payload>;
|
|
37
37
|
type PopoverHandle<Payload = unknown> = PopoverPrimitive.Handle<Payload>;
|
|
38
38
|
type PopoverTriggerProps = PopoverPrimitive.Trigger.Props;
|
|
@@ -18,14 +18,14 @@ type PreviewCardContentProps = PreviewCardPrimitive.Popup.Props & Pick<PreviewCa
|
|
|
18
18
|
classNames?: PreviewCardContentClassNames;
|
|
19
19
|
slotProps?: PreviewCardContentSlotProps;
|
|
20
20
|
container?: PreviewCardPrimitive.Portal.Props['container'];
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
withArrow?: boolean;
|
|
22
|
+
arrow?: boolean | React.ReactNode;
|
|
23
23
|
withBackdrop?: boolean;
|
|
24
24
|
};
|
|
25
25
|
declare const PreviewCard: typeof PreviewCardPrimitive.Root;
|
|
26
26
|
declare const createPreviewCardHandle: typeof PreviewCardPrimitive.createHandle;
|
|
27
27
|
declare function PreviewCardTrigger({ className, render, ...props }: PreviewCardPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
declare function PreviewCardContent({ className, classNames, slotProps, container,
|
|
28
|
+
declare function PreviewCardContent({ className, classNames, slotProps, container, withArrow, arrow, withBackdrop, disableAnchorTracking, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, children, ...props }: PreviewCardContentProps): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
type PreviewCardProps<Payload = unknown> = PreviewCardPrimitive.Root.Props<Payload>;
|
|
30
30
|
type PreviewCardHandle<Payload = unknown> = PreviewCardPrimitive.Handle<Payload>;
|
|
31
31
|
type PreviewCardTriggerProps = PreviewCardPrimitive.Trigger.Props;
|
|
@@ -21,8 +21,8 @@ type SelectContentProps = SelectPopupProps & Pick<SelectPrimitive.Positioner.Pro
|
|
|
21
21
|
slotProps?: SelectContentSlotProps;
|
|
22
22
|
container?: SelectPrimitive.Portal.Props['container'];
|
|
23
23
|
withBackdrop?: boolean;
|
|
24
|
-
|
|
25
|
-
arrow?: React.ReactNode;
|
|
24
|
+
withArrow?: boolean;
|
|
25
|
+
arrow?: boolean | React.ReactNode;
|
|
26
26
|
};
|
|
27
27
|
type IndicatorPosition = 'start' | 'end';
|
|
28
28
|
type SelectItemProps = SelectPrimitive.Item.Props & {
|
|
@@ -34,7 +34,7 @@ declare function SelectLabel({ className, ...props }: SelectPrimitive.Label.Prop
|
|
|
34
34
|
declare function SelectTrigger({ className, ...props }: SelectPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
declare function SelectValue({ className, ...props }: SelectPrimitive.Value.Props): import("react/jsx-runtime").JSX.Element;
|
|
36
36
|
declare function SelectIcon({ className, children, ...props }: SelectPrimitive.Icon.Props): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
declare function SelectContent({ className, classNames, slotProps, container, withBackdrop,
|
|
37
|
+
declare function SelectContent({ className, classNames, slotProps, container, withBackdrop, withArrow, arrow, alignItemWithTrigger, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, disableAnchorTracking, ...props }: SelectContentProps): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
declare function SelectScrollUpArrow({ className, children, ...props }: SelectPrimitive.ScrollUpArrow.Props): import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
declare function SelectScrollDownArrow({ className, children, ...props }: SelectPrimitive.ScrollDownArrow.Props): import("react/jsx-runtime").JSX.Element;
|
|
40
40
|
declare function SelectList({ className, ...props }: SelectPrimitive.List.Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
|
|
2
|
-
import * as React from 'react';
|
|
2
|
+
import type * as React from 'react';
|
|
3
3
|
type TabsVariant = 'default' | 'line';
|
|
4
4
|
type TabsProps = TabsPrimitive.Root.Props & {
|
|
5
5
|
variant?: TabsVariant;
|
|
6
|
-
unstyled?: boolean;
|
|
7
6
|
};
|
|
8
7
|
type TabsListClassNames = {
|
|
9
8
|
indicator?: TabsPrimitive.Indicator.Props['className'];
|
|
@@ -16,7 +15,7 @@ type TabsListProps = TabsPrimitive.List.Props & {
|
|
|
16
15
|
slotProps?: TabsListSlotProps;
|
|
17
16
|
withIndicator?: boolean;
|
|
18
17
|
};
|
|
19
|
-
declare function Tabs({ className, variant,
|
|
18
|
+
declare function Tabs({ className, variant, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
20
19
|
declare function TabsList({ className, classNames, children, slotProps, withIndicator, ...props }: TabsListProps): import("react/jsx-runtime").JSX.Element;
|
|
21
20
|
declare function TabsTab({ className, ...props }: TabsPrimitive.Tab.Props): import("react/jsx-runtime").JSX.Element;
|
|
22
21
|
declare function TabsPanel({ className, ...props }: TabsPrimitive.Panel.Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,14 +16,14 @@ type TooltipContentProps = TooltipPrimitive.Popup.Props & Pick<TooltipPrimitive.
|
|
|
16
16
|
classNames?: TooltipContentClassNames;
|
|
17
17
|
slotProps?: TooltipContentSlotProps;
|
|
18
18
|
container?: TooltipPrimitive.Portal.Props['container'];
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
withArrow?: boolean;
|
|
20
|
+
arrow?: boolean | React.ReactNode;
|
|
21
21
|
};
|
|
22
22
|
declare const Tooltip: <Payload>(props: TooltipPrimitive.Root.Props<Payload>) => import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
declare const TooltipProvider: React.FC<import('@base-ui/react').TooltipProviderProps>;
|
|
24
24
|
declare const createTooltipHandle: typeof TooltipPrimitive.createHandle;
|
|
25
25
|
declare function TooltipTrigger<Payload = unknown>({ className, render, ...props }: TooltipPrimitive.Trigger.Props<Payload>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
declare function TooltipContent({ className, classNames, slotProps, container,
|
|
26
|
+
declare function TooltipContent({ className, classNames, slotProps, container, withArrow, arrow, disableAnchorTracking, side, sideOffset, align, alignOffset, arrowPadding, anchor, collisionAvoidance, collisionBoundary, collisionPadding, sticky, positionMethod, ...props }: TooltipContentProps): import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
type TooltipProps<Payload = unknown> = TooltipPrimitive.Root.Props<Payload>;
|
|
28
28
|
type TooltipProviderProps = TooltipPrimitive.Provider.Props;
|
|
29
29
|
type TooltipHandle<Payload = unknown> = TooltipPrimitive.Handle<Payload>;
|