rivet-ui 0.1.0
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/LICENSE +21 -0
- package/README.md +120 -0
- package/dist/chunk-fjtwj9cw.js +79 -0
- package/dist/chunk-fjtwj9cw.js.map +10 -0
- package/dist/components/Accordion/Accordion.d.ts +7 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +10 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/index.js +62 -0
- package/dist/components/Accordion/index.js.map +10 -0
- package/dist/components/Alert/Alert.d.ts +15 -0
- package/dist/components/Alert/Alert.stories.d.ts +23 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Alert/index.js +57 -0
- package/dist/components/Alert/index.js.map +10 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts +11 -0
- package/dist/components/AlertDialog/AlertDialog.stories.d.ts +9 -0
- package/dist/components/AlertDialog/index.d.ts +1 -0
- package/dist/components/AlertDialog/index.js +66 -0
- package/dist/components/AlertDialog/index.js.map +10 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +17 -0
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts +6 -0
- package/dist/components/Autocomplete/index.d.ts +1 -0
- package/dist/components/Autocomplete/index.js +109 -0
- package/dist/components/Autocomplete/index.js.map +10 -0
- package/dist/components/Avatar/Avatar.d.ts +19 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +29 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/index.js +65 -0
- package/dist/components/Avatar/index.js.map +10 -0
- package/dist/components/AvatarLabel/AvatarLabel.d.ts +12 -0
- package/dist/components/AvatarLabel/AvatarLabel.stories.d.ts +10 -0
- package/dist/components/AvatarLabel/index.d.ts +2 -0
- package/dist/components/AvatarLabel/index.js +74 -0
- package/dist/components/AvatarLabel/index.js.map +10 -0
- package/dist/components/Badge/Badge.d.ts +13 -0
- package/dist/components/Badge/Badge.stories.d.ts +25 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +38 -0
- package/dist/components/Badge/index.js.map +10 -0
- package/dist/components/Button/Button.d.ts +15 -0
- package/dist/components/Button/Button.stories.d.ts +35 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/index.js +44 -0
- package/dist/components/Button/index.js.map +10 -0
- package/dist/components/Card/Card.d.ts +6 -0
- package/dist/components/Card/Card.stories.d.ts +13 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +47 -0
- package/dist/components/Card/index.js.map +10 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +25 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/index.js +68 -0
- package/dist/components/Checkbox/index.js.map +10 -0
- package/dist/components/Collapsible/Collapsible.d.ts +4 -0
- package/dist/components/Collapsible/Collapsible.stories.d.ts +10 -0
- package/dist/components/Collapsible/index.d.ts +1 -0
- package/dist/components/Collapsible/index.js +34 -0
- package/dist/components/Collapsible/index.js.map +10 -0
- package/dist/components/Combobox/Combobox.d.ts +24 -0
- package/dist/components/Combobox/Combobox.stories.d.ts +13 -0
- package/dist/components/Combobox/index.d.ts +1 -0
- package/dist/components/Combobox/index.js +162 -0
- package/dist/components/Combobox/index.js.map +10 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +22 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts +10 -0
- package/dist/components/ConfirmDialog/index.d.ts +2 -0
- package/dist/components/ConfirmDialog/index.js +85 -0
- package/dist/components/ConfirmDialog/index.js.map +10 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +21 -0
- package/dist/components/ContextMenu/ContextMenu.stories.d.ts +7 -0
- package/dist/components/ContextMenu/index.d.ts +1 -0
- package/dist/components/ContextMenu/index.js +117 -0
- package/dist/components/ContextMenu/index.js.map +10 -0
- package/dist/components/Dialog/Dialog.d.ts +11 -0
- package/dist/components/Dialog/Dialog.stories.d.ts +10 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +66 -0
- package/dist/components/Dialog/index.js.map +10 -0
- package/dist/components/Drawer/Drawer.d.ts +13 -0
- package/dist/components/Drawer/Drawer.stories.d.ts +9 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Drawer/index.js +81 -0
- package/dist/components/Drawer/index.js.map +10 -0
- package/dist/components/Field/Field.d.ts +8 -0
- package/dist/components/Field/Field.stories.d.ts +21 -0
- package/dist/components/Field/index.d.ts +1 -0
- package/dist/components/Field/index.js +52 -0
- package/dist/components/Field/index.js.map +10 -0
- package/dist/components/Fieldset/Fieldset.d.ts +3 -0
- package/dist/components/Fieldset/Fieldset.stories.d.ts +14 -0
- package/dist/components/Fieldset/index.d.ts +1 -0
- package/dist/components/Fieldset/index.js +27 -0
- package/dist/components/Fieldset/index.js.map +10 -0
- package/dist/components/Form/Form.d.ts +5 -0
- package/dist/components/Form/Form.stories.d.ts +5 -0
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/Form/index.js +20 -0
- package/dist/components/Form/index.js.map +10 -0
- package/dist/components/Input/Input.d.ts +16 -0
- package/dist/components/Input/Input.stories.d.ts +34 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/index.js +44 -0
- package/dist/components/Input/index.js.map +10 -0
- package/dist/components/Menu/Menu.d.ts +21 -0
- package/dist/components/Menu/Menu.stories.d.ts +9 -0
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/index.js +117 -0
- package/dist/components/Menu/index.js.map +10 -0
- package/dist/components/Menubar/Menubar.d.ts +2 -0
- package/dist/components/Menubar/Menubar.stories.d.ts +5 -0
- package/dist/components/Menubar/index.d.ts +1 -0
- package/dist/components/Menubar/index.js +20 -0
- package/dist/components/Menubar/index.js.map +10 -0
- package/dist/components/Meter/Meter.d.ts +6 -0
- package/dist/components/Meter/Meter.stories.d.ts +7 -0
- package/dist/components/Meter/index.d.ts +1 -0
- package/dist/components/Meter/index.js +48 -0
- package/dist/components/Meter/index.js.map +10 -0
- package/dist/components/NavigationMenu/NavigationMenu.d.ts +12 -0
- package/dist/components/NavigationMenu/NavigationMenu.stories.d.ts +5 -0
- package/dist/components/NavigationMenu/index.d.ts +1 -0
- package/dist/components/NavigationMenu/index.js +100 -0
- package/dist/components/NavigationMenu/index.js.map +10 -0
- package/dist/components/NumberField/NumberField.d.ts +8 -0
- package/dist/components/NumberField/NumberField.stories.d.ts +7 -0
- package/dist/components/NumberField/index.d.ts +1 -0
- package/dist/components/NumberField/index.js +84 -0
- package/dist/components/NumberField/index.js.map +10 -0
- package/dist/components/PageHeader/PageHeader.d.ts +10 -0
- package/dist/components/PageHeader/PageHeader.stories.d.ts +10 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/PageHeader/index.js +48 -0
- package/dist/components/PageHeader/index.js.map +10 -0
- package/dist/components/Popover/Popover.d.ts +12 -0
- package/dist/components/Popover/Popover.stories.d.ts +9 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Popover/index.js +74 -0
- package/dist/components/Popover/index.js.map +10 -0
- package/dist/components/PreviewCard/PreviewCard.d.ts +9 -0
- package/dist/components/PreviewCard/PreviewCard.stories.d.ts +8 -0
- package/dist/components/PreviewCard/index.d.ts +1 -0
- package/dist/components/PreviewCard/index.js +53 -0
- package/dist/components/PreviewCard/index.js.map +10 -0
- package/dist/components/ProfileCard/ProfileCard.d.ts +19 -0
- package/dist/components/ProfileCard/ProfileCard.stories.d.ts +11 -0
- package/dist/components/ProfileCard/index.d.ts +2 -0
- package/dist/components/ProfileCard/index.js +97 -0
- package/dist/components/ProfileCard/index.js.map +10 -0
- package/dist/components/Progress/Progress.d.ts +6 -0
- package/dist/components/Progress/Progress.stories.d.ts +7 -0
- package/dist/components/Progress/index.d.ts +1 -0
- package/dist/components/Progress/index.js +48 -0
- package/dist/components/Progress/index.js.map +10 -0
- package/dist/components/Radio/Radio.d.ts +6 -0
- package/dist/components/Radio/Radio.stories.d.ts +20 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Radio/index.js +35 -0
- package/dist/components/Radio/index.js.map +10 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +7 -0
- package/dist/components/ScrollArea/ScrollArea.stories.d.ts +6 -0
- package/dist/components/ScrollArea/index.d.ts +1 -0
- package/dist/components/ScrollArea/index.js +55 -0
- package/dist/components/ScrollArea/index.js.map +10 -0
- package/dist/components/SearchField/SearchField.d.ts +11 -0
- package/dist/components/SearchField/SearchField.stories.d.ts +9 -0
- package/dist/components/SearchField/index.d.ts +2 -0
- package/dist/components/SearchField/index.js +65 -0
- package/dist/components/SearchField/index.js.map +10 -0
- package/dist/components/Select/Select.d.ts +19 -0
- package/dist/components/Select/Select.stories.d.ts +20 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.js +143 -0
- package/dist/components/Select/index.js.map +10 -0
- package/dist/components/Separator/Separator.d.ts +2 -0
- package/dist/components/Separator/Separator.stories.d.ts +10 -0
- package/dist/components/Separator/index.d.ts +1 -0
- package/dist/components/Separator/index.js +20 -0
- package/dist/components/Separator/index.js.map +10 -0
- package/dist/components/Slider/Slider.d.ts +10 -0
- package/dist/components/Slider/Slider.stories.d.ts +7 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +55 -0
- package/dist/components/Slider/index.js.map +10 -0
- package/dist/components/Switch/Switch.d.ts +3 -0
- package/dist/components/Switch/Switch.stories.d.ts +24 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch/index.js +27 -0
- package/dist/components/Switch/index.js.map +10 -0
- package/dist/components/Tabs/Tabs.d.ts +6 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +9 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/index.js +43 -0
- package/dist/components/Tabs/index.js.map +10 -0
- package/dist/components/Toast/Toast.d.ts +14 -0
- package/dist/components/Toast/Toast.stories.d.ts +8 -0
- package/dist/components/Toast/index.d.ts +1 -0
- package/dist/components/Toast/index.js +127 -0
- package/dist/components/Toast/index.js.map +10 -0
- package/dist/components/Toggle/Toggle.d.ts +3 -0
- package/dist/components/Toggle/Toggle.stories.d.ts +8 -0
- package/dist/components/Toggle/index.d.ts +1 -0
- package/dist/components/Toggle/index.js +20 -0
- package/dist/components/Toggle/index.js.map +10 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +3 -0
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +6 -0
- package/dist/components/ToggleGroup/index.d.ts +1 -0
- package/dist/components/ToggleGroup/index.js +20 -0
- package/dist/components/ToggleGroup/index.js.map +10 -0
- package/dist/components/Toolbar/Toolbar.d.ts +7 -0
- package/dist/components/Toolbar/Toolbar.stories.d.ts +7 -0
- package/dist/components/Toolbar/index.d.ts +1 -0
- package/dist/components/Toolbar/index.js +50 -0
- package/dist/components/Toolbar/index.js.map +10 -0
- package/dist/components/Tooltip/Tooltip.d.ts +9 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +9 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +48 -0
- package/dist/components/Tooltip/index.js.map +10 -0
- package/dist/fonts.css +3 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +620 -0
- package/dist/index.js.map +9 -0
- package/dist/stories/Camps.stories.d.ts +11 -0
- package/dist/stories/Plains.stories.d.ts +11 -0
- package/dist/stories/Theming.stories.d.ts +8 -0
- package/dist/stories/Typography.stories.d.ts +5 -0
- package/dist/styles.css +2 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +1806 -0
- package/dist/utils/cn.js.map +12 -0
- package/dist/utils/cn.test.d.ts +1 -0
- package/package.json +266 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Seth Davis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Rivet UI
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/rivet-ui)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
|
|
6
|
+
A React 19 component library built with TypeScript, Tailwind CSS 4, and CVA (Class Variance Authority). Publishes ESM-only to npm with full type declarations.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
bun install rivet-ui
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Peer dependencies: `react`, `react-dom`, and `typescript`.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Import components and the required stylesheet:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import "rivet-ui/styles";
|
|
24
|
+
import { Button } from "rivet-ui";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Subpath imports are available for tree-shaking:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { Button } from "rivet-ui/button";
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Theming
|
|
34
|
+
|
|
35
|
+
All design tokens are CSS custom properties, so you can override them in your own stylesheet:
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
:root {
|
|
39
|
+
--color-ribbon: oklch(58% 0.10 185);
|
|
40
|
+
--color-mustard: oklch(72% 0.12 75);
|
|
41
|
+
--color-kraft: oklch(35% 0.04 55);
|
|
42
|
+
--color-denim: oklch(45% 0.12 250);
|
|
43
|
+
--color-canvas: oklch(95% 0.01 75);
|
|
44
|
+
--color-spool: oklch(55% 0.15 25);
|
|
45
|
+
--color-surface: #fdfbf7;
|
|
46
|
+
--font-display: 'Inter', sans-serif;
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Available tokens
|
|
51
|
+
|
|
52
|
+
| Token | Default (light) | Description |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `--color-ribbon` | `oklch(58% 0.10 185)` | Muted teal — focus rings, links |
|
|
55
|
+
| `--color-mustard` | `oklch(72% 0.12 75)` | Warm ochre — warning states |
|
|
56
|
+
| `--color-kraft` | `oklch(35% 0.04 55)` | Warm brown — text/borders |
|
|
57
|
+
| `--color-denim` | `oklch(45% 0.12 250)` | Muted navy — primary actions |
|
|
58
|
+
| `--color-canvas` | `oklch(95% 0.01 75)` | Warm cream — neutral backgrounds |
|
|
59
|
+
| `--color-spool` | `oklch(55% 0.15 25)` | Terracotta — destructive/error |
|
|
60
|
+
| `--color-surface` | `#fdfbf7` | Page/card background |
|
|
61
|
+
| `--font-display` | `'Lora', Georgia, serif` | Heading/display font |
|
|
62
|
+
|
|
63
|
+
Dark mode tokens are automatically redefined when the `.dark` class is applied.
|
|
64
|
+
|
|
65
|
+
### Fonts
|
|
66
|
+
|
|
67
|
+
The display font (Lora) is **not** loaded automatically. To use it, either:
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
@import 'rivet-ui/fonts';
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Or add a `<link>` tag to your HTML, or override `--font-display` with your own font.
|
|
74
|
+
|
|
75
|
+
### Variant utilities
|
|
76
|
+
|
|
77
|
+
CVA variant configs are exported so you can apply library styles to custom elements:
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import { buttonVariants } from 'rivet-ui';
|
|
81
|
+
|
|
82
|
+
<a href="/login" className={buttonVariants({ variant: 'primary', size: 'lg' })}>
|
|
83
|
+
Log in
|
|
84
|
+
</a>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The `cva` function and `VariantProps` type are also re-exported for building your own variant-driven components:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { cva, type VariantProps, cn } from 'rivet-ui';
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Development
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
bun install # Install dependencies
|
|
97
|
+
bun run build # Build library (Bun.build + tsc declarations)
|
|
98
|
+
bun run dev # Build in watch mode
|
|
99
|
+
bun run storybook # Start Storybook dev server on port 6006
|
|
100
|
+
bun run build-storybook # Build static Storybook
|
|
101
|
+
bun run typecheck # Type-check without emitting
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Architecture
|
|
105
|
+
|
|
106
|
+
Each component lives in `src/components/<Name>/` with three files:
|
|
107
|
+
|
|
108
|
+
- `<Name>.tsx` — implementation using CVA for variants + `cn()` for class merging
|
|
109
|
+
- `<Name>.stories.tsx` — Storybook stories with interactive `play` tests
|
|
110
|
+
- `index.ts` — barrel export
|
|
111
|
+
|
|
112
|
+
Styling uses Tailwind CSS 4 with CSS custom properties in oklch color space. Consumers must import `rivet-ui/styles` for Tailwind classes to work.
|
|
113
|
+
|
|
114
|
+
## Contributing
|
|
115
|
+
|
|
116
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines on how to get started.
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clsx
|
|
3
|
+
} from "./utils/cn.js";
|
|
4
|
+
|
|
5
|
+
// node_modules/cva/dist/index.mjs
|
|
6
|
+
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
7
|
+
var defineConfig = (options) => {
|
|
8
|
+
const cx = function() {
|
|
9
|
+
for (var _len = arguments.length, inputs = new Array(_len), _key = 0;_key < _len; _key++) {
|
|
10
|
+
inputs[_key] = arguments[_key];
|
|
11
|
+
}
|
|
12
|
+
var _options_hooks, _options_hooks1;
|
|
13
|
+
if (typeof (options === null || options === undefined ? undefined : (_options_hooks = options.hooks) === null || _options_hooks === undefined ? undefined : _options_hooks["cx:done"]) !== "undefined")
|
|
14
|
+
return options === null || options === undefined ? undefined : options.hooks["cx:done"](clsx(inputs));
|
|
15
|
+
if (typeof (options === null || options === undefined ? undefined : (_options_hooks1 = options.hooks) === null || _options_hooks1 === undefined ? undefined : _options_hooks1.onComplete) !== "undefined")
|
|
16
|
+
return options === null || options === undefined ? undefined : options.hooks.onComplete(clsx(inputs));
|
|
17
|
+
return clsx(inputs);
|
|
18
|
+
};
|
|
19
|
+
const cva = (config) => (props) => {
|
|
20
|
+
var _config_compoundVariants;
|
|
21
|
+
if ((config === null || config === undefined ? undefined : config.variants) == null)
|
|
22
|
+
return cx(config === null || config === undefined ? undefined : config.base, props === null || props === undefined ? undefined : props.class, props === null || props === undefined ? undefined : props.className);
|
|
23
|
+
const { variants, defaultVariants } = config;
|
|
24
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
25
|
+
const variantProp = props === null || props === undefined ? undefined : props[variant];
|
|
26
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === undefined ? undefined : defaultVariants[variant];
|
|
27
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
28
|
+
return variants[variant][variantKey];
|
|
29
|
+
});
|
|
30
|
+
const defaultsAndProps = {
|
|
31
|
+
...defaultVariants,
|
|
32
|
+
...props && Object.entries(props).reduce((acc, param) => {
|
|
33
|
+
let [key, value] = param;
|
|
34
|
+
return typeof value === "undefined" ? acc : {
|
|
35
|
+
...acc,
|
|
36
|
+
[key]: value
|
|
37
|
+
};
|
|
38
|
+
}, {})
|
|
39
|
+
};
|
|
40
|
+
const getCompoundVariantClassNames = config === null || config === undefined ? undefined : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === undefined ? undefined : _config_compoundVariants.reduce((acc, param) => {
|
|
41
|
+
let { class: cvClass, className: cvClassName, ...cvConfig } = param;
|
|
42
|
+
return Object.entries(cvConfig).every((param2) => {
|
|
43
|
+
let [cvKey, cvSelector] = param2;
|
|
44
|
+
const selector = defaultsAndProps[cvKey];
|
|
45
|
+
return Array.isArray(cvSelector) ? cvSelector.includes(selector) : selector === cvSelector;
|
|
46
|
+
}) ? [
|
|
47
|
+
...acc,
|
|
48
|
+
cvClass,
|
|
49
|
+
cvClassName
|
|
50
|
+
] : acc;
|
|
51
|
+
}, []);
|
|
52
|
+
return cx(config === null || config === undefined ? undefined : config.base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === undefined ? undefined : props.class, props === null || props === undefined ? undefined : props.className);
|
|
53
|
+
};
|
|
54
|
+
const compose = function() {
|
|
55
|
+
for (var _len = arguments.length, components = new Array(_len), _key = 0;_key < _len; _key++) {
|
|
56
|
+
components[_key] = arguments[_key];
|
|
57
|
+
}
|
|
58
|
+
return (props) => {
|
|
59
|
+
const propsWithoutClass = Object.fromEntries(Object.entries(props || {}).filter((param) => {
|
|
60
|
+
let [key] = param;
|
|
61
|
+
return ![
|
|
62
|
+
"class",
|
|
63
|
+
"className"
|
|
64
|
+
].includes(key);
|
|
65
|
+
}));
|
|
66
|
+
return cx(components.map((component) => component(propsWithoutClass)), props === null || props === undefined ? undefined : props.class, props === null || props === undefined ? undefined : props.className);
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
compose,
|
|
71
|
+
cva,
|
|
72
|
+
cx
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
var { compose, cva, cx } = defineConfig();
|
|
76
|
+
|
|
77
|
+
export { cva };
|
|
78
|
+
|
|
79
|
+
//# debugId=E5C08F9958A5254164756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/cva/dist/index.mjs"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\n/* Exports\n ============================================ */ const falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const defineConfig = (options)=>{\n const cx = function() {\n for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){\n inputs[_key] = arguments[_key];\n }\n var _options_hooks, _options_hooks1;\n if (typeof (options === null || options === void 0 ? void 0 : (_options_hooks = options.hooks) === null || _options_hooks === void 0 ? void 0 : _options_hooks[\"cx:done\"]) !== \"undefined\") return options === null || options === void 0 ? void 0 : options.hooks[\"cx:done\"](clsx(inputs));\n if (typeof (options === null || options === void 0 ? void 0 : (_options_hooks1 = options.hooks) === null || _options_hooks1 === void 0 ? void 0 : _options_hooks1.onComplete) !== \"undefined\") return options === null || options === void 0 ? void 0 : options.hooks.onComplete(clsx(inputs));\n return clsx(inputs);\n };\n const cva = (config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(config === null || config === void 0 ? void 0 : config.base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const defaultsAndProps = {\n ...defaultVariants,\n // remove `undefined` props\n ...props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n return typeof value === \"undefined\" ? acc : {\n ...acc,\n [key]: value\n };\n }, {})\n };\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...cvConfig } = param;\n return Object.entries(cvConfig).every((param)=>{\n let [cvKey, cvSelector] = param;\n const selector = defaultsAndProps[cvKey];\n return Array.isArray(cvSelector) ? cvSelector.includes(selector) : selector === cvSelector;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(config === null || config === void 0 ? void 0 : config.base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n const compose = function() {\n for(var _len = arguments.length, components = new Array(_len), _key = 0; _key < _len; _key++){\n components[_key] = arguments[_key];\n }\n return (props)=>{\n const propsWithoutClass = Object.fromEntries(Object.entries(props || {}).filter((param)=>{\n let [key] = param;\n return ![\n \"class\",\n \"className\"\n ].includes(key);\n }));\n return cx(components.map((component)=>component(propsWithoutClass)), props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n };\n return {\n compose,\n cva,\n cx\n };\n};\nexport const { compose, cva, cx } = defineConfig();\n\n\n//# sourceMappingURL=index.mjs.map"
|
|
6
|
+
],
|
|
7
|
+
"mappings": "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",
|
|
8
|
+
"debugId": "E5C08F9958A5254164756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Accordion } from '@base-ui/react/accordion';
|
|
3
|
+
export declare const AccordionRoot: React.ForwardRefExoticComponent<Omit<Accordion.Root.Props<unknown>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const AccordionItem: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AccordionItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const AccordionHeader: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AccordionHeaderProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
6
|
+
export declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AccordionTriggerProps, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare const AccordionPanel: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AccordionPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
tags: string[];
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj;
|
|
8
|
+
export declare const Default: Story;
|
|
9
|
+
export declare const DefaultOpen: Story;
|
|
10
|
+
export declare const MultipleOpen: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionPanel } from './Accordion';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../../utils/cn.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Accordion/Accordion.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Accordion } from "@base-ui/react/accordion";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var AccordionRoot = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Accordion.Root, {
|
|
10
|
+
ref,
|
|
11
|
+
className: cn("w-full", className),
|
|
12
|
+
...props
|
|
13
|
+
}));
|
|
14
|
+
AccordionRoot.displayName = "AccordionRoot";
|
|
15
|
+
var AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Accordion.Item, {
|
|
16
|
+
ref,
|
|
17
|
+
className: cn("border-b border-kraft/15", className),
|
|
18
|
+
...props
|
|
19
|
+
}));
|
|
20
|
+
AccordionItem.displayName = "AccordionItem";
|
|
21
|
+
var AccordionHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Accordion.Header, {
|
|
22
|
+
ref,
|
|
23
|
+
className: cn("m-0 flex", className),
|
|
24
|
+
...props
|
|
25
|
+
}));
|
|
26
|
+
AccordionHeader.displayName = "AccordionHeader";
|
|
27
|
+
var AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(Accordion.Trigger, {
|
|
28
|
+
ref,
|
|
29
|
+
className: cn("group flex w-full items-center justify-between py-3 text-left text-sm font-medium text-kraft transition-colors hover:text-kraft/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ribbon focus-visible:ring-inset data-disabled:pointer-events-none data-disabled:opacity-40", className),
|
|
30
|
+
...props,
|
|
31
|
+
children: [
|
|
32
|
+
children,
|
|
33
|
+
/* @__PURE__ */ jsx("svg", {
|
|
34
|
+
className: "size-4 shrink-0 text-kraft/50 transition-transform duration-200 ease-out group-data-panel-open:rotate-180",
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
fill: "none",
|
|
37
|
+
stroke: "currentColor",
|
|
38
|
+
strokeWidth: 2,
|
|
39
|
+
"aria-hidden": true,
|
|
40
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
41
|
+
d: "m6 9 6 6 6-6"
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
}));
|
|
46
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
47
|
+
var AccordionPanel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Accordion.Panel, {
|
|
48
|
+
ref,
|
|
49
|
+
className: cn("h-[var(--accordion-panel-height)] overflow-hidden text-sm text-kraft/70 transition-[height] duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0", className),
|
|
50
|
+
...props
|
|
51
|
+
}));
|
|
52
|
+
AccordionPanel.displayName = "AccordionPanel";
|
|
53
|
+
export {
|
|
54
|
+
AccordionTrigger,
|
|
55
|
+
AccordionRoot,
|
|
56
|
+
AccordionPanel,
|
|
57
|
+
AccordionItem,
|
|
58
|
+
AccordionHeader
|
|
59
|
+
};
|
|
60
|
+
export { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionPanel };
|
|
61
|
+
|
|
62
|
+
//# debugId=36F35BCCCB96B5EA64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/Accordion/Accordion.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import * as React from 'react';\nimport { Accordion } from '@base-ui/react/accordion';\nimport { cn } from '../../utils/cn';\n\nexport const AccordionRoot = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof Accordion.Root>\n>(({ className, ...props }, ref) => (\n <Accordion.Root ref={ref} className={cn('w-full', className)} {...props} />\n));\nAccordionRoot.displayName = 'AccordionRoot';\n\nexport const AccordionItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof Accordion.Item>\n>(({ className, ...props }, ref) => (\n <Accordion.Item\n ref={ref}\n className={cn('border-b border-kraft/15', className)}\n {...props}\n />\n));\nAccordionItem.displayName = 'AccordionItem';\n\nexport const AccordionHeader = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof Accordion.Header>\n>(({ className, ...props }, ref) => (\n <Accordion.Header\n ref={ref}\n className={cn('m-0 flex', className)}\n {...props}\n />\n));\nAccordionHeader.displayName = 'AccordionHeader';\n\nexport const AccordionTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof Accordion.Trigger>\n>(({ className, children, ...props }, ref) => (\n <Accordion.Trigger\n ref={ref}\n className={cn(\n 'group flex w-full items-center justify-between py-3 text-left text-sm font-medium text-kraft transition-colors hover:text-kraft/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ribbon focus-visible:ring-inset data-disabled:pointer-events-none data-disabled:opacity-40',\n className\n )}\n {...props}\n >\n {children}\n <svg\n className=\"size-4 shrink-0 text-kraft/50 transition-transform duration-200 ease-out group-data-panel-open:rotate-180\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n aria-hidden\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </Accordion.Trigger>\n));\nAccordionTrigger.displayName = 'AccordionTrigger';\n\nexport const AccordionPanel = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof Accordion.Panel>\n>(({ className, ...props }, ref) => (\n <Accordion.Panel\n ref={ref}\n className={cn(\n 'h-[var(--accordion-panel-height)] overflow-hidden text-sm text-kraft/70 transition-[height] duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0',\n className\n )}\n {...props}\n />\n));\nAccordionPanel.displayName = 'AccordionPanel';\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;AAAA;AACA;;AAGO,IAAM,gBAAsB,iBAGjC,GAAG,cAAc,SAAS,wBACxB,IAAC,UAAU,MAAX;AAAA,EAAgB;AAAA,EAAU,WAAW,GAAG,UAAU,SAAS;AAAA,KAAO;AAAA,CAAO,CAC5E;AACD,cAAc,cAAc;AAErB,IAAM,gBAAsB,iBAGjC,GAAG,cAAc,SAAS,wBACxB,IAAC,UAAU,MAAX;AAAA,EACI;AAAA,EACA,WAAW,GAAG,4BAA4B,SAAS;AAAA,KAC/C;AAAA,CACR,CACH;AACD,cAAc,cAAc;AAErB,IAAM,kBAAwB,iBAGnC,GAAG,cAAc,SAAS,wBACxB,IAAC,UAAU,QAAX;AAAA,EACI;AAAA,EACA,WAAW,GAAG,YAAY,SAAS;AAAA,KAC/B;AAAA,CACR,CACH;AACD,gBAAgB,cAAc;AAEvB,IAAM,mBAAyB,iBAGpC,GAAG,WAAW,aAAa,SAAS,wBAClC,KAmBE,UAAU,SAnBZ;AAAA,EACI;AAAA,EACA,WAAW,GACP,oSACA,SACJ;AAAA,KACI;AAAA,EANR,UAmBE;AAAA,IAXG;AAAA,oBACD,IASE,OATF;AAAA,MACI,WAAU;AAAA,MACV,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAa;AAAA,MACb,eAAW;AAAA,MANf,0BAQI,IAAC,QAAD;AAAA,QAAM,GAAE;AAAA,OAAe;AAAA,KACzB;AAAA;AAAA,CACJ,CACL;AACD,iBAAiB,cAAc;AAExB,IAAM,iBAAuB,iBAGlC,GAAG,cAAc,SAAS,wBACxB,IAAC,UAAU,OAAX;AAAA,EACI;AAAA,EACA,WAAW,GACP,mKACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,eAAe,cAAc;",
|
|
8
|
+
"debugId": "36F35BCCCB96B5EA64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type VariantProps } from 'cva';
|
|
2
|
+
export declare const alertVariants: (props?: ({
|
|
3
|
+
variant?: "default" | "error" | "info" | "warning" | undefined;
|
|
4
|
+
} & ({
|
|
5
|
+
class?: import("cva").ClassValue;
|
|
6
|
+
className?: never;
|
|
7
|
+
} | {
|
|
8
|
+
class?: never;
|
|
9
|
+
className?: import("cva").ClassValue;
|
|
10
|
+
})) | undefined) => string;
|
|
11
|
+
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
12
|
+
}
|
|
13
|
+
export declare function Alert({ className, variant, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function AlertTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function AlertDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Alert } from './Alert';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Alert;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
variant: {
|
|
12
|
+
control: "select";
|
|
13
|
+
options: string[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const Default: Story;
|
|
20
|
+
export declare const Info: Story;
|
|
21
|
+
export declare const Warning: Story;
|
|
22
|
+
export declare const Error: Story;
|
|
23
|
+
export declare const AllVariants: Story;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cva
|
|
3
|
+
} from "../../chunk-fjtwj9cw.js";
|
|
4
|
+
import {
|
|
5
|
+
cn
|
|
6
|
+
} from "../../utils/cn.js";
|
|
7
|
+
|
|
8
|
+
// src/components/Alert/Alert.tsx
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var alertVariants = cva({
|
|
11
|
+
base: "relative w-full rounded-lg border-l-4 p-4",
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
info: "border-l-ribbon bg-ribbon/6 text-kraft dark:bg-ribbon/12 dark:text-ribbon",
|
|
15
|
+
warning: "border-l-mustard bg-mustard/6 text-kraft dark:bg-mustard/12 dark:text-mustard",
|
|
16
|
+
error: "border-l-spool bg-spool/6 text-kraft dark:bg-spool/12 dark:text-spool",
|
|
17
|
+
default: "border-l-kraft bg-canvas text-kraft"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
function Alert({ className, variant, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("div", {
|
|
26
|
+
role: "alert",
|
|
27
|
+
className: cn(alertVariants({ variant }), className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function AlertTitle({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ jsx("h5", {
|
|
36
|
+
className: cn("mb-1 font-semibold leading-none tracking-tight", className),
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function AlertDescription({
|
|
41
|
+
className,
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
return /* @__PURE__ */ jsx("p", {
|
|
45
|
+
className: cn("text-sm opacity-90", className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
alertVariants,
|
|
51
|
+
AlertTitle,
|
|
52
|
+
AlertDescription,
|
|
53
|
+
Alert
|
|
54
|
+
};
|
|
55
|
+
export { alertVariants, Alert, AlertTitle, AlertDescription };
|
|
56
|
+
|
|
57
|
+
//# debugId=DEA2B63F05ED773A64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/Alert/Alert.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { cva, type VariantProps } from 'cva';\nimport { cn } from '../../utils/cn';\n\nexport const alertVariants = cva({\n base: 'relative w-full rounded-lg border-l-4 p-4',\n variants: {\n variant: {\n info: 'border-l-ribbon bg-ribbon/6 text-kraft dark:bg-ribbon/12 dark:text-ribbon',\n warning: 'border-l-mustard bg-mustard/6 text-kraft dark:bg-mustard/12 dark:text-mustard',\n error: 'border-l-spool bg-spool/6 text-kraft dark:bg-spool/12 dark:text-spool',\n default: 'border-l-kraft bg-canvas text-kraft'\n }\n },\n defaultVariants: {\n variant: 'default'\n }\n});\n\nexport interface AlertProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof alertVariants> {}\n\nexport function Alert({ className, variant, ...props }: AlertProps) {\n return (\n <div\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport function AlertTitle({\n className,\n ...props\n}: React.HTMLAttributes<HTMLHeadingElement>) {\n return (\n <h5\n className={cn(\n 'mb-1 font-semibold leading-none tracking-tight',\n className\n )}\n {...props}\n />\n );\n}\n\nexport function AlertDescription({\n className,\n ...props\n}: React.HTMLAttributes<HTMLParagraphElement>) {\n return <p className={cn('text-sm opacity-90', className)} {...props} />;\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;AAGO,IAAM,gBAAgB,IAAI;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,IACN,SAAS;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS;AAAA,IACb;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACb,SAAS;AAAA,EACb;AACJ,CAAC;AAOM,SAAS,KAAK,GAAG,WAAW,YAAY,SAAqB;AAAA,EAChE,uBACI,IAAC,OAAD;AAAA,IACI,MAAK;AAAA,IACL,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,OAC/C;AAAA,GACR;AAAA;AAID,SAAS,UAAU;AAAA,EACtB;AAAA,KACG;AAAA,GACsC;AAAA,EACzC,uBACI,IAAC,MAAD;AAAA,IACI,WAAW,GACP,kDACA,SACJ;AAAA,OACI;AAAA,GACR;AAAA;AAID,SAAS,gBAAgB;AAAA,EAC5B;AAAA,KACG;AAAA,GACwC;AAAA,EAC3C,uBAAO,IAAC,KAAD;AAAA,IAAG,WAAW,GAAG,sBAAsB,SAAS;AAAA,OAAO;AAAA,GAAO;AAAA;",
|
|
8
|
+
"debugId": "DEA2B63F05ED773A64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AlertDialog as BaseAlertDialog } from '@base-ui/react/alert-dialog';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const AlertDialogRoot: typeof BaseAlertDialog.Root;
|
|
4
|
+
export declare const AlertDialogPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const AlertDialogBackdrop: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const AlertDialogViewport: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogViewportProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const AlertDialogPopup: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
9
|
+
export declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
10
|
+
export declare const AlertDialogClose: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export declare const AlertDialogTrigger: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogTriggerProps<unknown> & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
tags: string[];
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
export declare const Default: StoryObj;
|
|
8
|
+
export declare const DiscardDraft: StoryObj;
|
|
9
|
+
export declare const SignOut: StoryObj;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AlertDialogRoot, AlertDialogPortal, AlertDialogBackdrop, AlertDialogViewport, AlertDialogPopup, AlertDialogTitle, AlertDialogDescription, AlertDialogClose, AlertDialogTrigger } from './AlertDialog';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../../utils/cn.js";
|
|
4
|
+
|
|
5
|
+
// src/components/AlertDialog/AlertDialog.tsx
|
|
6
|
+
import { AlertDialog as BaseAlertDialog } from "@base-ui/react/alert-dialog";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var AlertDialogRoot = BaseAlertDialog.Root;
|
|
10
|
+
var AlertDialogPortal = BaseAlertDialog.Portal;
|
|
11
|
+
var AlertDialogBackdrop = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BaseAlertDialog.Backdrop, {
|
|
12
|
+
ref,
|
|
13
|
+
className: cn("fixed inset-0 z-50 min-h-dvh bg-black/40 transition-all duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute", className),
|
|
14
|
+
...props
|
|
15
|
+
}));
|
|
16
|
+
AlertDialogBackdrop.displayName = "AlertDialogBackdrop";
|
|
17
|
+
var AlertDialogViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BaseAlertDialog.Viewport, {
|
|
18
|
+
ref,
|
|
19
|
+
className: cn("fixed inset-0 z-50 flex items-center justify-center p-4", className),
|
|
20
|
+
...props
|
|
21
|
+
}));
|
|
22
|
+
AlertDialogViewport.displayName = "AlertDialogViewport";
|
|
23
|
+
var AlertDialogPopup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BaseAlertDialog.Popup, {
|
|
24
|
+
ref,
|
|
25
|
+
className: cn("w-full max-w-md rounded-xl border border-kraft/15 bg-surface p-6 text-kraft shadow-xl transition-all duration-150 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0", className),
|
|
26
|
+
...props
|
|
27
|
+
}));
|
|
28
|
+
AlertDialogPopup.displayName = "AlertDialogPopup";
|
|
29
|
+
var AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BaseAlertDialog.Title, {
|
|
30
|
+
ref,
|
|
31
|
+
className: cn("mb-1 text-lg font-semibold text-kraft", className),
|
|
32
|
+
...props
|
|
33
|
+
}));
|
|
34
|
+
AlertDialogTitle.displayName = "AlertDialogTitle";
|
|
35
|
+
var AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BaseAlertDialog.Description, {
|
|
36
|
+
ref,
|
|
37
|
+
className: cn("mb-6 text-sm text-kraft/60", className),
|
|
38
|
+
...props
|
|
39
|
+
}));
|
|
40
|
+
AlertDialogDescription.displayName = "AlertDialogDescription";
|
|
41
|
+
var AlertDialogClose = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BaseAlertDialog.Close, {
|
|
42
|
+
ref,
|
|
43
|
+
className: cn("inline-flex h-9 items-center justify-center rounded-lg border border-kraft/25 bg-surface px-4 text-sm font-medium text-kraft transition-colors select-none hover:bg-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ribbon focus-visible:ring-offset-2", className),
|
|
44
|
+
...props
|
|
45
|
+
}));
|
|
46
|
+
AlertDialogClose.displayName = "AlertDialogClose";
|
|
47
|
+
var AlertDialogTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BaseAlertDialog.Trigger, {
|
|
48
|
+
ref,
|
|
49
|
+
className: cn("inline-flex h-9 items-center justify-center rounded-lg border border-spool/40 bg-surface px-4 text-sm font-medium text-spool transition-colors select-none hover:bg-spool/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-spool focus-visible:ring-offset-2", className),
|
|
50
|
+
...props
|
|
51
|
+
}));
|
|
52
|
+
AlertDialogTrigger.displayName = "AlertDialogTrigger";
|
|
53
|
+
export {
|
|
54
|
+
AlertDialogViewport,
|
|
55
|
+
AlertDialogTrigger,
|
|
56
|
+
AlertDialogTitle,
|
|
57
|
+
AlertDialogRoot,
|
|
58
|
+
AlertDialogPortal,
|
|
59
|
+
AlertDialogPopup,
|
|
60
|
+
AlertDialogDescription,
|
|
61
|
+
AlertDialogClose,
|
|
62
|
+
AlertDialogBackdrop
|
|
63
|
+
};
|
|
64
|
+
export { AlertDialogRoot, AlertDialogPortal, AlertDialogBackdrop, AlertDialogViewport, AlertDialogPopup, AlertDialogTitle, AlertDialogDescription, AlertDialogClose, AlertDialogTrigger };
|
|
65
|
+
|
|
66
|
+
//# debugId=FDE3F3E4FDB9F11164756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/AlertDialog/AlertDialog.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { AlertDialog as BaseAlertDialog } from '@base-ui/react/alert-dialog';\nimport React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport const AlertDialogRoot = BaseAlertDialog.Root;\nexport const AlertDialogPortal = BaseAlertDialog.Portal;\n\nexport const AlertDialogBackdrop = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Backdrop\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 min-h-dvh bg-black/40 transition-all duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute',\n className\n )}\n {...props}\n />\n));\nAlertDialogBackdrop.displayName = 'AlertDialogBackdrop';\n\nexport const AlertDialogViewport = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Viewport\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 flex items-center justify-center p-4',\n className\n )}\n {...props}\n />\n));\nAlertDialogViewport.displayName = 'AlertDialogViewport';\n\nexport const AlertDialogPopup = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Popup\n ref={ref}\n className={cn(\n 'w-full max-w-md rounded-xl border border-kraft/15 bg-surface p-6 text-kraft shadow-xl transition-all duration-150 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0',\n className\n )}\n {...props}\n />\n));\nAlertDialogPopup.displayName = 'AlertDialogPopup';\n\nexport const AlertDialogTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Title\n ref={ref}\n className={cn('mb-1 text-lg font-semibold text-kraft', className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = 'AlertDialogTitle';\n\nexport const AlertDialogDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Description>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Description\n ref={ref}\n className={cn('mb-6 text-sm text-kraft/60', className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName = 'AlertDialogDescription';\n\nexport const AlertDialogClose = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Close>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Close\n ref={ref}\n className={cn(\n 'inline-flex h-9 items-center justify-center rounded-lg border border-kraft/25 bg-surface px-4 text-sm font-medium text-kraft transition-colors select-none hover:bg-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ribbon focus-visible:ring-offset-2',\n className\n )}\n {...props}\n />\n));\nAlertDialogClose.displayName = 'AlertDialogClose';\n\nexport const AlertDialogTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Trigger\n ref={ref}\n className={cn(\n 'inline-flex h-9 items-center justify-center rounded-lg border border-spool/40 bg-surface px-4 text-sm font-medium text-spool transition-colors select-none hover:bg-spool/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-spool focus-visible:ring-offset-2',\n className\n )}\n {...props}\n />\n));\nAlertDialogTrigger.displayName = 'AlertDialogTrigger';\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;AAAA,wBAAS;AACT;;AAGO,IAAM,kBAAkB,gBAAgB;AACxC,IAAM,oBAAoB,gBAAgB;AAE1C,IAAM,sBAAsB,MAAM,WAGvC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,UAAjB;AAAA,EACI;AAAA,EACA,WAAW,GACP,iLACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,oBAAoB,cAAc;AAE3B,IAAM,sBAAsB,MAAM,WAGvC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,UAAjB;AAAA,EACI;AAAA,EACA,WAAW,GACP,2DACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,oBAAoB,cAAc;AAE3B,IAAM,mBAAmB,MAAM,WAGpC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,OAAjB;AAAA,EACI;AAAA,EACA,WAAW,GACP,uOACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,iBAAiB,cAAc;AAExB,IAAM,mBAAmB,MAAM,WAGpC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,OAAjB;AAAA,EACI;AAAA,EACA,WAAW,GAAG,yCAAyC,SAAS;AAAA,KAC5D;AAAA,CACR,CACH;AACD,iBAAiB,cAAc;AAExB,IAAM,yBAAyB,MAAM,WAG1C,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,aAAjB;AAAA,EACI;AAAA,EACA,WAAW,GAAG,8BAA8B,SAAS;AAAA,KACjD;AAAA,CACR,CACH;AACD,uBAAuB,cAAc;AAE9B,IAAM,mBAAmB,MAAM,WAGpC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,OAAjB;AAAA,EACI;AAAA,EACA,WAAW,GACP,oRACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,iBAAiB,cAAc;AAExB,IAAM,qBAAqB,MAAM,WAGtC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,SAAjB;AAAA,EACI;AAAA,EACA,WAAW,GACP,oRACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,mBAAmB,cAAc;",
|
|
8
|
+
"debugId": "FDE3F3E4FDB9F11164756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Autocomplete } from '@base-ui/react/autocomplete';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const AutocompleteRoot: typeof Autocomplete.Root;
|
|
4
|
+
export declare const AutocompleteValue: typeof Autocomplete.Value;
|
|
5
|
+
export declare const AutocompletePortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompletePortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const AutocompleteGroup: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const AutocompleteCollection: typeof Autocomplete.Collection;
|
|
8
|
+
export declare const AutocompleteInput: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteInputProps, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export declare const AutocompleteTrigger: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export declare const AutocompleteIcon: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ComboboxIconProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
11
|
+
export declare const AutocompleteClear: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").ComboboxClearProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export declare const AutocompletePositioner: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompletePositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const AutocompletePopup: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompletePopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const AutocompleteList: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteListProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const AutocompleteItem: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const AutocompleteEmpty: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteEmptyProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const AutocompleteGroupLabel: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteGroupLabelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AutocompleteRoot, AutocompleteValue, AutocompletePortal, AutocompleteGroup, AutocompleteCollection, AutocompleteInput, AutocompleteTrigger, AutocompleteIcon, AutocompleteClear, AutocompletePositioner, AutocompletePopup, AutocompleteList, AutocompleteItem, AutocompleteEmpty, AutocompleteGroupLabel } from './Autocomplete';
|