@waveso/ui 0.15.0 → 0.16.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/README.md +25 -22
- package/dist/accordion.d.ts +4 -20
- package/dist/accordion.js +2 -2
- package/dist/action-bar.d.ts +1 -10
- package/dist/action-bar.js +6 -5
- package/dist/alert-dialog.d.ts +12 -52
- package/dist/alert-dialog.js +5 -5
- package/dist/alert.d.ts +13 -22
- package/dist/alert.js +13 -4
- package/dist/animate.d.ts +6 -49
- package/dist/animate.js +8 -13
- package/dist/aspect-ratio.d.ts +3 -8
- package/dist/autocomplete.d.ts +21 -88
- package/dist/autocomplete.js +3 -3
- package/dist/avatar.d.ts +7 -28
- package/dist/avatar.js +4 -4
- package/dist/badge.d.ts +3 -11
- package/dist/badge.js +6 -6
- package/dist/breadcrumb.d.ts +7 -31
- package/dist/button-group.d.ts +7 -20
- package/dist/button-group.js +5 -4
- package/dist/button.d.ts +4 -12
- package/dist/button.js +6 -6
- package/dist/card.d.ts +16 -33
- package/dist/card.js +27 -14
- package/dist/checkbox.d.ts +1 -6
- package/dist/checkbox.js +2 -2
- package/dist/collapsible.d.ts +3 -12
- package/dist/combobox.d.ts +18 -81
- package/dist/combobox.js +4 -4
- package/dist/context-menu.d.ts +17 -68
- package/dist/context-menu.js +14 -14
- package/dist/count.d.ts +1 -15
- package/dist/count.js +3 -2
- package/dist/dialog.d.ts +10 -41
- package/dist/dialog.js +5 -5
- package/dist/direction.d.ts +0 -1
- package/dist/drawer.d.ts +11 -44
- package/dist/drawer.js +1 -1
- package/dist/encrypted-text.d.ts +15 -14
- package/dist/encrypted-text.js +205 -66
- package/dist/field.d.ts +27 -30
- package/dist/field.js +36 -8
- package/dist/fieldset.d.ts +14 -0
- package/dist/fieldset.js +26 -0
- package/dist/film-grain-shader.d.ts +3 -4
- package/dist/film-grain-webgl.d.ts +2 -9
- package/dist/film-grain-webgl.js +4 -1
- package/dist/film-grain.d.ts +1 -11
- package/dist/form.d.ts +23 -42
- package/dist/form.js +7 -4
- package/dist/glyph-matrix.d.ts +25 -0
- package/dist/glyph-matrix.js +266 -0
- package/dist/gradient-reveal-text.d.ts +4 -17
- package/dist/gradient-reveal-text.js +8 -8
- package/dist/hooks/use-mobile.d.ts +2 -3
- package/dist/infinite-scroll.d.ts +1 -16
- package/dist/input-group.d.ts +11 -37
- package/dist/input-group.js +1 -1
- package/dist/input-otp.d.ts +4 -20
- package/dist/input-otp.js +2 -2
- package/dist/input.d.ts +3 -11
- package/dist/input.js +1 -1
- package/dist/item.d.ts +14 -51
- package/dist/item.js +17 -11
- package/dist/kbd.d.ts +3 -11
- package/dist/kbd.js +2 -2
- package/dist/label.d.ts +1 -6
- package/dist/label.js +1 -1
- package/dist/lib/focus.d.ts +3 -5
- package/dist/lib/internal-icons.d.ts +19 -22
- package/dist/lib/merge-refs.d.ts +9 -0
- package/dist/lib/merge-refs.js +16 -0
- package/dist/lib/utils.d.ts +3 -5
- package/dist/lib/utils.js +9 -1
- package/dist/masonry.d.ts +2 -16
- package/dist/masonry.js +5 -3
- package/dist/menu.d.ts +17 -65
- package/dist/menu.js +7 -7
- package/dist/menubar.d.ts +16 -55
- package/dist/menubar.js +1 -1
- package/dist/pagination.d.ts +9 -33
- package/dist/pagination.js +1 -1
- package/dist/popover.d.ts +9 -43
- package/dist/popover.js +1 -1
- package/dist/preview-card.d.ts +5 -25
- package/dist/preview-card.js +1 -1
- package/dist/progress.d.ts +5 -24
- package/dist/progress.js +2 -2
- package/dist/radio-group.d.ts +2 -9
- package/dist/radio-group.js +1 -1
- package/dist/radio.d.ts +2 -10
- package/dist/radio.js +2 -2
- package/dist/resizable.d.ts +43 -0
- package/dist/resizable.js +53 -0
- package/dist/scroll-area.d.ts +14 -13
- package/dist/scroll-area.js +26 -7
- package/dist/select.d.ts +15 -64
- package/dist/select.js +4 -4
- package/dist/separator.d.ts +1 -7
- package/dist/separator.js +1 -1
- package/dist/sidebar.d.ts +29 -126
- package/dist/sidebar.js +14 -14
- package/dist/skeleton.d.ts +1 -6
- package/dist/slider.d.ts +1 -14
- package/dist/slider.js +5 -5
- package/dist/spinner.d.ts +8 -6
- package/dist/spinner.js +24 -6
- package/dist/styles.css +575 -182
- package/dist/switch.d.ts +2 -9
- package/dist/switch.js +6 -6
- package/dist/table.d.ts +14 -34
- package/dist/table.js +40 -9
- package/dist/tabs.d.ts +5 -22
- package/dist/tabs.js +3 -3
- package/dist/textarea.d.ts +3 -12
- package/dist/textarea.js +1 -1
- package/dist/toast.d.ts +13 -39
- package/dist/toast.js +4 -4
- package/dist/toggle-group.d.ts +3 -19
- package/dist/toggle-group.js +16 -10
- package/dist/toggle.d.ts +3 -11
- package/dist/toggle.js +11 -6
- package/dist/tooltip.d.ts +6 -24
- package/dist/tooltip.js +10 -6
- package/dist/typewriter.d.ts +1 -14
- package/dist/video-text.d.ts +25 -0
- package/dist/video-text.js +147 -0
- package/package.json +57 -51
package/README.md
CHANGED
|
@@ -85,11 +85,13 @@ Wave pays close attention to token taxonomy. Surfaces encode elevation; borders
|
|
|
85
85
|
- `--muted` — body text, icons, any mark
|
|
86
86
|
- `--soft` — placeholders, hints
|
|
87
87
|
|
|
88
|
-
###
|
|
88
|
+
### Form
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
- `--
|
|
90
|
+
The theme's foreground made translucent, at three strengths — the way a draughtsman renders a form. Each is translucent, so it reads the same on any surface, and each keeps one job on a border or a background.
|
|
91
|
+
|
|
92
|
+
- `--contour` — where a shape ends: hairline borders, separators, dividers
|
|
93
|
+
- `--highlight` — where attention lands: hovered, keyboard-highlighted and open items
|
|
94
|
+
- `--shade` — what gives a control its body: field and track fills, and the intense border (control outlines, layout regions)
|
|
93
95
|
|
|
94
96
|
### Ring
|
|
95
97
|
|
|
@@ -105,22 +107,21 @@ Wave pays close attention to token taxonomy. Surfaces encode elevation; borders
|
|
|
105
107
|
|
|
106
108
|
This is the sophisticated move most libraries skip.
|
|
107
109
|
|
|
108
|
-
Wave
|
|
110
|
+
Wave uses **transparent (alpha) borders only**: `contour` by default, and `shade` where a boundary has to be intense.
|
|
109
111
|
|
|
110
|
-
Wave's palette behaves like a layered _material system_, not a flat UI. Dark surfaces, a soft text hierarchy, and subtle elevation shifts (low-contrast steps) mean borders should not introduce a new "color layer" — that would break the illusion of depth — yet structure still needs
|
|
112
|
+
Wave's palette behaves like a layered _material system_, not a flat UI. Dark surfaces, a soft text hierarchy, and subtle elevation shifts (low-contrast steps) mean borders should not introduce a new "color layer" — that would break the illusion of depth — yet structure still needs an intense option.
|
|
111
113
|
|
|
112
114
|
Alpha borders **inherit the surface beneath them**, take the **content color as their luminance source**, keep hue consistent across surfaces, and scale naturally.
|
|
113
115
|
|
|
114
|
-
|
|
116
|
+
Intense borders compete with the surface ladder and create visual "grid noise" if overused, so use them sparingly. Overusing them flattens everything into "outlined boxes" with reduced perceived elevation — the "Bootstrap feel."
|
|
115
117
|
|
|
116
|
-
The default
|
|
118
|
+
The default **`contour`** borders are ideal for:
|
|
117
119
|
|
|
118
120
|
- Cards
|
|
119
121
|
- Panels
|
|
120
|
-
- Inputs
|
|
121
122
|
- Subtle separators
|
|
122
123
|
|
|
123
|
-
The
|
|
124
|
+
The intense **`shade`** borders are ideal for:
|
|
124
125
|
|
|
125
126
|
- Layout definition (sidebar vs. content)
|
|
126
127
|
- Component grouping
|
|
@@ -129,8 +130,8 @@ The **solid** borders are ideal for:
|
|
|
129
130
|
|
|
130
131
|
**Rule of thumb:**
|
|
131
132
|
|
|
132
|
-
- If it separates **surface from surface** →
|
|
133
|
-
- If it separates **layout regions** →
|
|
133
|
+
- If it separates **surface from surface** → `contour`
|
|
134
|
+
- If it separates **layout regions** → `shade`
|
|
134
135
|
- If it indicates **interaction / state** → colored alpha border
|
|
135
136
|
|
|
136
137
|
---
|
|
@@ -180,7 +181,7 @@ Every component is built on a [Base UI](https://base-ui.com) primitive — full
|
|
|
180
181
|
|
|
181
182
|
A comprehensive set spanning **actions, forms, layout, navigation, overlays, feedback, data display, and motion effects** — all built on Base UI primitives and driven by the theme tokens.
|
|
182
183
|
|
|
183
|
-
Browse every component, with live variants and source, in **Storybook** (`
|
|
184
|
+
Browse every component, with live variants and source, in **Storybook** (`pnpm storybook`). A full documentation site is on the way at **[ui.wave.so](https://ui.wave.so)**.
|
|
184
185
|
|
|
185
186
|
## Requirements
|
|
186
187
|
|
|
@@ -203,11 +204,13 @@ Some components have optional peer dependencies — install only what you use:
|
|
|
203
204
|
## Development
|
|
204
205
|
|
|
205
206
|
```bash
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
pnpm install
|
|
208
|
+
pnpm storybook # Start Storybook
|
|
209
|
+
pnpm build # Build the library
|
|
210
|
+
pnpm typecheck # Type-check
|
|
211
|
+
pnpm lint # Lint with oxlint (pnpm lint:fix to autofix)
|
|
212
|
+
pnpm format # Format with oxfmt (pnpm format:check to verify)
|
|
213
|
+
pnpm dev # Watch mode
|
|
211
214
|
```
|
|
212
215
|
|
|
213
216
|
### Project structure
|
|
@@ -228,7 +231,7 @@ src/
|
|
|
228
231
|
|
|
229
232
|
This project uses [Changesets](https://github.com/changesets/changesets) with GitHub Actions.
|
|
230
233
|
|
|
231
|
-
1. Run `
|
|
234
|
+
1. Run `pnpm changeset` to describe your changes (patch, minor, or major)
|
|
232
235
|
2. Commit the generated changeset file with your PR
|
|
233
236
|
3. When merged to `main`, CI automatically versions and publishes to npm
|
|
234
237
|
|
|
@@ -238,9 +241,9 @@ This project uses [Changesets](https://github.com/changesets/changesets) with Gi
|
|
|
238
241
|
If you're not using the GitHub Actions workflow, you can publish manually. Changesets skips versions already published to npm, so this won't conflict if CI has already run.
|
|
239
242
|
|
|
240
243
|
```bash
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
pnpm changeset # Create a changeset
|
|
245
|
+
pnpm changeset version # Apply version bump
|
|
246
|
+
pnpm release # Build and publish to npm
|
|
244
247
|
```
|
|
245
248
|
|
|
246
249
|
</details>
|
package/dist/accordion.d.ts
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import * as React from "react";
|
|
4
|
-
|
|
5
3
|
//#region src/accordion.d.ts
|
|
6
4
|
type AccordionProps = React.ComponentProps<typeof Accordion$1.Root>;
|
|
7
5
|
type AccordionItemProps = React.ComponentProps<typeof Accordion$1.Item>;
|
|
8
6
|
type AccordionTriggerProps = React.ComponentProps<typeof Accordion$1.Trigger>;
|
|
9
7
|
type AccordionContentProps = React.ComponentProps<typeof Accordion$1.Panel>;
|
|
10
|
-
declare function Accordion({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}:
|
|
14
|
-
declare function AccordionItem({
|
|
15
|
-
className,
|
|
16
|
-
...props
|
|
17
|
-
}: AccordionItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
18
|
-
declare function AccordionTrigger({
|
|
19
|
-
className,
|
|
20
|
-
children,
|
|
21
|
-
...props
|
|
22
|
-
}: AccordionTriggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
-
declare function AccordionContent({
|
|
24
|
-
className,
|
|
25
|
-
children,
|
|
26
|
-
...props
|
|
27
|
-
}: AccordionContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
8
|
+
declare function Accordion({ className, ...props }: AccordionProps): React.JSX.Element;
|
|
9
|
+
declare function AccordionItem({ className, ...props }: AccordionItemProps): React.JSX.Element;
|
|
10
|
+
declare function AccordionTrigger({ className, children, ...props }: AccordionTriggerProps): React.JSX.Element;
|
|
11
|
+
declare function AccordionContent({ className, children, ...props }: AccordionContentProps): React.JSX.Element;
|
|
28
12
|
//#endregion
|
|
29
13
|
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps };
|
package/dist/accordion.js
CHANGED
|
@@ -14,7 +14,7 @@ function Accordion({ className, ...props }) {
|
|
|
14
14
|
function AccordionItem({ className, ...props }) {
|
|
15
15
|
return /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
16
16
|
"data-slot": "accordion-item",
|
|
17
|
-
className: cn("not-last:border-b border-
|
|
17
|
+
className: cn("not-last:border-b border-shade", className),
|
|
18
18
|
...props
|
|
19
19
|
});
|
|
20
20
|
}
|
|
@@ -24,7 +24,7 @@ function AccordionTrigger({ className, children, ...props }) {
|
|
|
24
24
|
className: "flex",
|
|
25
25
|
children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
|
|
26
26
|
"data-slot": "accordion-trigger",
|
|
27
|
-
className: cn("cursor-clickable focus-visible:ring-focus/50 focus-visible:border-focus focus-visible:after:border-focus **:data-[slot=accordion-trigger-icon]:text-muted group/accordion-trigger relative flex flex-1 items-start justify-between rounded-md border border-transparent py-2.5 text-left text-sm font-medium motion-color outline-hidden hover:underline focus-visible:ring-3
|
|
27
|
+
className: cn("cursor-clickable focus-visible:ring-focus/50 focus-visible:border-focus focus-visible:after:border-focus **:data-[slot=accordion-trigger-icon]:text-muted group/accordion-trigger relative flex flex-1 items-start justify-between rounded-md border border-transparent py-2.5 text-left text-sm font-medium motion-color outline-hidden hover:underline focus-visible:ring-3 data-disabled:pointer-events-none data-disabled:opacity-30 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4", className),
|
|
28
28
|
...props,
|
|
29
29
|
children: [
|
|
30
30
|
children,
|
package/dist/action-bar.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
|
|
4
2
|
//#region src/action-bar.d.ts
|
|
5
3
|
/** State a form registers with the ActionBar. */
|
|
6
4
|
interface ActionBarEntry {
|
|
@@ -64,14 +62,7 @@ interface ActionBarProviderProps {
|
|
|
64
62
|
* useActionBar('profile', { hasChanges, saving, onSave, onReset });
|
|
65
63
|
* ```
|
|
66
64
|
*/
|
|
67
|
-
declare function ActionBarProvider({
|
|
68
|
-
children,
|
|
69
|
-
message,
|
|
70
|
-
pluralMessage,
|
|
71
|
-
blockedMessage,
|
|
72
|
-
labels,
|
|
73
|
-
className
|
|
74
|
-
}: ActionBarProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
65
|
+
declare function ActionBarProvider({ children, message, pluralMessage, blockedMessage, labels, className }: ActionBarProviderProps): React.JSX.Element;
|
|
75
66
|
/**
|
|
76
67
|
* Register a form's unsaved state with the global ActionBar.
|
|
77
68
|
*
|
package/dist/action-bar.js
CHANGED
|
@@ -24,6 +24,7 @@ function useIsMac() {
|
|
|
24
24
|
return isMac;
|
|
25
25
|
}
|
|
26
26
|
const ActionBarContext = React.createContext(null);
|
|
27
|
+
const defaultPluralMessage = (count) => `${count} unsaved changes`;
|
|
27
28
|
/**
|
|
28
29
|
* Global action bar for unsaved changes.
|
|
29
30
|
*
|
|
@@ -48,7 +49,7 @@ const ActionBarContext = React.createContext(null);
|
|
|
48
49
|
* useActionBar('profile', { hasChanges, saving, onSave, onReset });
|
|
49
50
|
* ```
|
|
50
51
|
*/
|
|
51
|
-
function ActionBarProvider({ children, message = "You have unsaved changes", pluralMessage =
|
|
52
|
+
function ActionBarProvider({ children, message = "You have unsaved changes", pluralMessage = defaultPluralMessage, blockedMessage = "Save or reset your changes before leaving this page", labels, className }) {
|
|
52
53
|
const text = {
|
|
53
54
|
save: "Save",
|
|
54
55
|
saving: "Saving",
|
|
@@ -208,10 +209,10 @@ function ActionBarProvider({ children, message = "You have unsaved changes", plu
|
|
|
208
209
|
className: "fixed bottom-6 left-1/2 z-50",
|
|
209
210
|
children: /* @__PURE__ */ jsxs("div", {
|
|
210
211
|
"data-slot": "action-bar-content",
|
|
211
|
-
className: cn("flex items-center gap-6 rounded-lg border border-
|
|
212
|
+
className: cn("flex items-center gap-6 rounded-lg border border-contour/60 bg-surface px-5 py-2.5 shadow-lg ring-1 ring-contour", className),
|
|
212
213
|
children: [/* @__PURE__ */ jsx("span", {
|
|
213
214
|
"data-slot": "action-bar-message",
|
|
214
|
-
className: cn("whitespace-nowrap text-sm font-medium", saveError ? "text-
|
|
215
|
+
className: cn("whitespace-nowrap text-sm font-medium", saveError ? "text-danger" : "text-contrast"),
|
|
215
216
|
children: saveError ? text.saveError : displayMessage
|
|
216
217
|
}), /* @__PURE__ */ jsxs("div", {
|
|
217
218
|
"data-slot": "action-bar-actions",
|
|
@@ -221,7 +222,7 @@ function ActionBarProvider({ children, message = "You have unsaved changes", plu
|
|
|
221
222
|
variant: "ghost",
|
|
222
223
|
disabled: anySaving,
|
|
223
224
|
onClick: handleResetAll,
|
|
224
|
-
className: "h-9 px-3 text-sm
|
|
225
|
+
className: "h-9 px-3 text-sm",
|
|
225
226
|
children: text.reset
|
|
226
227
|
}), /* @__PURE__ */ jsx(Button, {
|
|
227
228
|
type: "button",
|
|
@@ -230,7 +231,7 @@ function ActionBarProvider({ children, message = "You have unsaved changes", plu
|
|
|
230
231
|
onClick: handleSaveAll,
|
|
231
232
|
className: "h-9 px-4 text-sm",
|
|
232
233
|
children: anySaving ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Spinner, { className: "mr-1.5 h-3.5 w-3.5" }), text.saving] }) : /* @__PURE__ */ jsxs(Fragment, { children: [text.save, /* @__PURE__ */ jsx(Kbd, {
|
|
233
|
-
className: "
|
|
234
|
+
className: "ms-1.5 bg-transparent text-current",
|
|
234
235
|
children: isMac ? "⌘S" : "Ctrl+S"
|
|
235
236
|
})] })
|
|
236
237
|
})]
|
package/dist/alert-dialog.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Button } from "./button.js";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
5
|
-
|
|
6
4
|
//#region src/alert-dialog.d.ts
|
|
7
5
|
type AlertDialogProps = React.ComponentProps<typeof AlertDialog$1.Root>;
|
|
8
6
|
type AlertDialogTriggerProps = React.ComponentProps<typeof AlertDialog$1.Trigger>;
|
|
@@ -18,55 +16,17 @@ type AlertDialogTitleProps = React.ComponentProps<typeof AlertDialog$1.Title>;
|
|
|
18
16
|
type AlertDialogDescriptionProps = React.ComponentProps<typeof AlertDialog$1.Description>;
|
|
19
17
|
type AlertDialogActionProps = React.ComponentProps<typeof AlertDialog$1.Close> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">;
|
|
20
18
|
type AlertDialogCancelProps = React.ComponentProps<typeof AlertDialog$1.Close> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">;
|
|
21
|
-
declare function AlertDialog({
|
|
22
|
-
|
|
23
|
-
}:
|
|
24
|
-
declare function
|
|
25
|
-
|
|
26
|
-
}:
|
|
27
|
-
declare function
|
|
28
|
-
|
|
29
|
-
}:
|
|
30
|
-
declare function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}: AlertDialogOverlayProps): _$react_jsx_runtime0.JSX.Element;
|
|
34
|
-
declare function AlertDialogContent({
|
|
35
|
-
className,
|
|
36
|
-
size,
|
|
37
|
-
...props
|
|
38
|
-
}: AlertDialogContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
39
|
-
declare function AlertDialogHeader({
|
|
40
|
-
className,
|
|
41
|
-
...props
|
|
42
|
-
}: AlertDialogHeaderProps): _$react_jsx_runtime0.JSX.Element;
|
|
43
|
-
declare function AlertDialogFooter({
|
|
44
|
-
className,
|
|
45
|
-
...props
|
|
46
|
-
}: AlertDialogFooterProps): _$react_jsx_runtime0.JSX.Element;
|
|
47
|
-
declare function AlertDialogMedia({
|
|
48
|
-
className,
|
|
49
|
-
...props
|
|
50
|
-
}: AlertDialogMediaProps): _$react_jsx_runtime0.JSX.Element;
|
|
51
|
-
declare function AlertDialogTitle({
|
|
52
|
-
className,
|
|
53
|
-
...props
|
|
54
|
-
}: AlertDialogTitleProps): _$react_jsx_runtime0.JSX.Element;
|
|
55
|
-
declare function AlertDialogDescription({
|
|
56
|
-
className,
|
|
57
|
-
...props
|
|
58
|
-
}: AlertDialogDescriptionProps): _$react_jsx_runtime0.JSX.Element;
|
|
59
|
-
declare function AlertDialogAction({
|
|
60
|
-
className,
|
|
61
|
-
variant,
|
|
62
|
-
size,
|
|
63
|
-
...props
|
|
64
|
-
}: AlertDialogActionProps): _$react_jsx_runtime0.JSX.Element;
|
|
65
|
-
declare function AlertDialogCancel({
|
|
66
|
-
className,
|
|
67
|
-
variant,
|
|
68
|
-
size,
|
|
69
|
-
...props
|
|
70
|
-
}: AlertDialogCancelProps): _$react_jsx_runtime0.JSX.Element;
|
|
19
|
+
declare function AlertDialog({ ...props }: AlertDialogProps): React.JSX.Element;
|
|
20
|
+
declare function AlertDialogTrigger({ ...props }: AlertDialogTriggerProps): React.JSX.Element;
|
|
21
|
+
declare function AlertDialogPortal({ ...props }: AlertDialogPortalProps): React.JSX.Element;
|
|
22
|
+
declare function AlertDialogOverlay({ className, ...props }: AlertDialogOverlayProps): React.JSX.Element;
|
|
23
|
+
declare function AlertDialogContent({ className, size, ...props }: AlertDialogContentProps): React.JSX.Element;
|
|
24
|
+
declare function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): React.JSX.Element;
|
|
25
|
+
declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): React.JSX.Element;
|
|
26
|
+
declare function AlertDialogMedia({ className, ...props }: AlertDialogMediaProps): React.JSX.Element;
|
|
27
|
+
declare function AlertDialogTitle({ className, ...props }: AlertDialogTitleProps): React.JSX.Element;
|
|
28
|
+
declare function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): React.JSX.Element;
|
|
29
|
+
declare function AlertDialogAction({ className, variant, size, ...props }: AlertDialogActionProps): React.JSX.Element;
|
|
30
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialogCancelProps): React.JSX.Element;
|
|
71
31
|
//#endregion
|
|
72
32
|
export { AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogMedia, type AlertDialogMediaProps, AlertDialogOverlay, type AlertDialogOverlayProps, AlertDialogPortal, type AlertDialogPortalProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps };
|
package/dist/alert-dialog.js
CHANGED
|
@@ -33,35 +33,35 @@ function AlertDialogContent({ className, size = "default", ...props }) {
|
|
|
33
33
|
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog$1.Popup, {
|
|
34
34
|
"data-slot": "alert-dialog-content",
|
|
35
35
|
"data-size": size,
|
|
36
|
-
className: cn("motion-scale-lg bg-foundation ring-contrast/10 group/alert-dialog-content fixed top-1/2
|
|
36
|
+
className: cn("motion-scale-lg bg-foundation ring-contrast/10 group/alert-dialog-content fixed top-1/2 start-1/2 z-50 grid w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-6 rounded-lg p-6 ring-1 outline-hidden data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=lg]:max-w-lg data-[size=xl]:max-w-xl data-[size=default]:sm:max-w-sm data-[size=lg]:sm:max-w-lg data-[size=xl]:sm:max-w-xl shadow-lg", className),
|
|
37
37
|
...props
|
|
38
38
|
})] });
|
|
39
39
|
}
|
|
40
40
|
function AlertDialogHeader({ className, ...props }) {
|
|
41
41
|
return /* @__PURE__ */ jsx("div", {
|
|
42
42
|
"data-slot": "alert-dialog-header",
|
|
43
|
-
className: cn("grid grid-rows-[auto_1fr] place-items-center gap-
|
|
43
|
+
className: cn("grid grid-rows-[auto_1fr] place-items-center gap-3 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-start sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr] group-data-[size=lg]/alert-dialog-content:place-items-start group-data-[size=lg]/alert-dialog-content:text-start group-data-[size=xl]/alert-dialog-content:place-items-start group-data-[size=xl]/alert-dialog-content:text-start", className),
|
|
44
44
|
...props
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function AlertDialogFooter({ className, ...props }) {
|
|
48
48
|
return /* @__PURE__ */ jsx("div", {
|
|
49
49
|
"data-slot": "alert-dialog-footer",
|
|
50
|
-
className: cn("
|
|
50
|
+
className: cn("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className),
|
|
51
51
|
...props
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function AlertDialogMedia({ className, ...props }) {
|
|
55
55
|
return /* @__PURE__ */ jsx("div", {
|
|
56
56
|
"data-slot": "alert-dialog-media",
|
|
57
|
-
className: cn("bg-secondary mb-2 inline-flex size-
|
|
57
|
+
className: cn("bg-secondary mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8", className),
|
|
58
58
|
...props
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function AlertDialogTitle({ className, ...props }) {
|
|
62
62
|
return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
|
|
63
63
|
"data-slot": "alert-dialog-title",
|
|
64
|
-
className: cn("text-
|
|
64
|
+
className: cn("text-lg font-medium leading-none sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
|
|
65
65
|
...props
|
|
66
66
|
});
|
|
67
67
|
}
|
package/dist/alert.d.ts
CHANGED
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { VariantProps } from "class-variance-authority";
|
|
4
|
-
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
-
|
|
6
3
|
//#region src/alert.d.ts
|
|
7
4
|
declare const alertVariants: (props?: ({
|
|
8
|
-
variant?: "default" | "
|
|
9
|
-
} &
|
|
5
|
+
variant?: "danger" | "default" | "info" | "success" | "warning" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
7
|
type AlertProps = React.ComponentProps<"div"> & VariantProps<typeof alertVariants>;
|
|
11
8
|
type AlertTitleProps = React.ComponentProps<"div">;
|
|
12
9
|
type AlertDescriptionProps = React.ComponentProps<"div">;
|
|
13
10
|
type AlertActionProps = React.ComponentProps<"div">;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}: AlertTitleProps):
|
|
23
|
-
declare function AlertDescription({
|
|
24
|
-
|
|
25
|
-
...props
|
|
26
|
-
}: AlertDescriptionProps): _$react_jsx_runtime0.JSX.Element;
|
|
27
|
-
declare function AlertAction({
|
|
28
|
-
className,
|
|
29
|
-
...props
|
|
30
|
-
}: AlertActionProps): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* A callout for information the reader should notice. It has no live role
|
|
13
|
+
* by default: pass `role="alert"` for an urgent message that appears while
|
|
14
|
+
* someone is using the page (an error after an action), which screen readers
|
|
15
|
+
* announce at once, or `role="status"` for a polite update. A static callout
|
|
16
|
+
* needs neither.
|
|
17
|
+
*/
|
|
18
|
+
declare function Alert({ className, variant, ...props }: AlertProps): React.JSX.Element;
|
|
19
|
+
declare function AlertTitle({ className, ...props }: AlertTitleProps): React.JSX.Element;
|
|
20
|
+
declare function AlertDescription({ className, ...props }: AlertDescriptionProps): React.JSX.Element;
|
|
21
|
+
declare function AlertAction({ className, ...props }: AlertActionProps): React.JSX.Element;
|
|
31
22
|
//#endregion
|
|
32
23
|
export { Alert, AlertAction, type AlertActionProps, AlertDescription, type AlertDescriptionProps, type AlertProps, AlertTitle, type AlertTitleProps, alertVariants };
|
package/dist/alert.js
CHANGED
|
@@ -2,17 +2,26 @@ import { cn } from "./lib/utils.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
//#region src/alert.tsx
|
|
5
|
-
const alertVariants = cva("grid gap-0.5 rounded-md border border-
|
|
5
|
+
const alertVariants = cva("grid gap-0.5 rounded-md border border-shade px-4 py-3 text-start text-sm has-data-[slot=alert-action]:pe-18 has-data-[icon]:grid-cols-[auto_1fr] has-data-[icon]:gap-x-2.5 *:data-[icon]:col-start-1 *:data-[icon]:row-span-2 *:data-[icon]:translate-y-0.5 *:data-[icon]:text-current *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert", {
|
|
6
6
|
variants: { variant: {
|
|
7
7
|
default: "bg-surface text-contrast",
|
|
8
|
-
|
|
8
|
+
info: "bg-surface text-contrast *:data-[icon]:text-info *:[svg]:text-info",
|
|
9
|
+
success: "bg-surface text-contrast *:data-[icon]:text-success *:[svg]:text-success",
|
|
10
|
+
warning: "bg-surface text-contrast *:data-[icon]:text-warning *:[svg]:text-warning",
|
|
11
|
+
danger: "bg-surface text-contrast *:data-[icon]:text-danger *:[svg]:text-danger"
|
|
9
12
|
} },
|
|
10
13
|
defaultVariants: { variant: "default" }
|
|
11
14
|
});
|
|
15
|
+
/**
|
|
16
|
+
* A callout for information the reader should notice. It has no live role
|
|
17
|
+
* by default: pass `role="alert"` for an urgent message that appears while
|
|
18
|
+
* someone is using the page (an error after an action), which screen readers
|
|
19
|
+
* announce at once, or `role="status"` for a polite update. A static callout
|
|
20
|
+
* needs neither.
|
|
21
|
+
*/
|
|
12
22
|
function Alert({ className, variant, ...props }) {
|
|
13
23
|
return /* @__PURE__ */ jsx("div", {
|
|
14
24
|
"data-slot": "alert",
|
|
15
|
-
role: "alert",
|
|
16
25
|
className: cn(alertVariants({ variant }), className),
|
|
17
26
|
...props
|
|
18
27
|
});
|
|
@@ -34,7 +43,7 @@ function AlertDescription({ className, ...props }) {
|
|
|
34
43
|
function AlertAction({ className, ...props }) {
|
|
35
44
|
return /* @__PURE__ */ jsx("div", {
|
|
36
45
|
"data-slot": "alert-action",
|
|
37
|
-
className: cn("absolute top-2
|
|
46
|
+
className: cn("absolute top-2.5 end-3", className),
|
|
38
47
|
...props
|
|
39
48
|
});
|
|
40
49
|
}
|
package/dist/animate.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
-
import * as _$react from "react";
|
|
3
1
|
import { ReactElement } from "react";
|
|
4
|
-
|
|
5
2
|
//#region src/animate.d.ts
|
|
6
3
|
type Direction = "up" | "down" | "left" | "right";
|
|
7
4
|
/**
|
|
@@ -106,19 +103,7 @@ interface FloatProps {
|
|
|
106
103
|
* </AnimateOnView>
|
|
107
104
|
* ```
|
|
108
105
|
*/
|
|
109
|
-
declare function AnimateOnView({
|
|
110
|
-
children,
|
|
111
|
-
delay,
|
|
112
|
-
from,
|
|
113
|
-
distance,
|
|
114
|
-
scale,
|
|
115
|
-
blur,
|
|
116
|
-
rotate,
|
|
117
|
-
flip,
|
|
118
|
-
spring,
|
|
119
|
-
once,
|
|
120
|
-
transition
|
|
121
|
-
}: AnimateOnViewProps): ReactElement<unknown, string | _$react.JSXElementConstructor<any>>;
|
|
106
|
+
declare function AnimateOnView({ children, delay, from, distance, scale, blur, rotate, flip, spring, once, transition }: AnimateOnViewProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
122
107
|
/**
|
|
123
108
|
* Animates a child element immediately on mount.
|
|
124
109
|
*
|
|
@@ -132,18 +117,7 @@ declare function AnimateOnView({
|
|
|
132
117
|
* </AnimateIn>
|
|
133
118
|
* ```
|
|
134
119
|
*/
|
|
135
|
-
declare function AnimateIn({
|
|
136
|
-
children,
|
|
137
|
-
delay,
|
|
138
|
-
from,
|
|
139
|
-
distance,
|
|
140
|
-
scale,
|
|
141
|
-
blur,
|
|
142
|
-
rotate,
|
|
143
|
-
flip,
|
|
144
|
-
spring,
|
|
145
|
-
transition
|
|
146
|
-
}: AnimateInProps): ReactElement<unknown, string | _$react.JSXElementConstructor<any>>;
|
|
120
|
+
declare function AnimateIn({ children, delay, from, distance, scale, blur, rotate, flip, spring, transition }: AnimateInProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
147
121
|
/**
|
|
148
122
|
* Auto-staggers delay on child AnimateIn/AnimateOnView elements.
|
|
149
123
|
* Eliminates manual `delay={i * 0.08}` math.
|
|
@@ -156,11 +130,7 @@ declare function AnimateIn({
|
|
|
156
130
|
* </Stagger>
|
|
157
131
|
* ```
|
|
158
132
|
*/
|
|
159
|
-
declare function Stagger({
|
|
160
|
-
children,
|
|
161
|
-
interval,
|
|
162
|
-
baseDelay
|
|
163
|
-
}: StaggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
133
|
+
declare function Stagger({ children, interval, baseDelay }: StaggerProps): import("react").JSX.Element;
|
|
164
134
|
/**
|
|
165
135
|
* Continuous, subtle scale pulse. Great for live indicators and CTAs.
|
|
166
136
|
* Zero DOM overhead — injects a scoped keyframe via `<style>`.
|
|
@@ -168,18 +138,11 @@ declare function Stagger({
|
|
|
168
138
|
* @example
|
|
169
139
|
* ```tsx
|
|
170
140
|
* <Pulse>
|
|
171
|
-
* <span className="size-3 rounded-full bg-
|
|
141
|
+
* <span className="size-3 rounded-full bg-success" />
|
|
172
142
|
* </Pulse>
|
|
173
143
|
* ```
|
|
174
144
|
*/
|
|
175
|
-
declare function Pulse({
|
|
176
|
-
children,
|
|
177
|
-
min,
|
|
178
|
-
max,
|
|
179
|
-
duration,
|
|
180
|
-
opacity,
|
|
181
|
-
paused
|
|
182
|
-
}: PulseProps): _$react_jsx_runtime0.JSX.Element;
|
|
145
|
+
declare function Pulse({ children, min, max, duration, opacity, paused }: PulseProps): import("react").JSX.Element;
|
|
183
146
|
/**
|
|
184
147
|
* Gentle continuous up/down float. Perfect for decorative elements.
|
|
185
148
|
* Zero DOM overhead — injects a scoped keyframe via `<style>`.
|
|
@@ -191,12 +154,6 @@ declare function Pulse({
|
|
|
191
154
|
* </Float>
|
|
192
155
|
* ```
|
|
193
156
|
*/
|
|
194
|
-
declare function Float({
|
|
195
|
-
children,
|
|
196
|
-
distance,
|
|
197
|
-
duration,
|
|
198
|
-
rotate,
|
|
199
|
-
paused
|
|
200
|
-
}: FloatProps): _$react_jsx_runtime0.JSX.Element;
|
|
157
|
+
declare function Float({ children, distance, duration, rotate, paused }: FloatProps): import("react").JSX.Element;
|
|
201
158
|
//#endregion
|
|
202
159
|
export { AnimateIn, type AnimateInProps, AnimateOnView, type AnimateOnViewProps, type AnimateTransition, type Direction, Float, type FloatProps, Pulse, type PulseProps, Stagger, type StaggerProps };
|
package/dist/animate.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { mergeRefs } from "./lib/merge-refs.js";
|
|
2
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { Children, cloneElement, isValidElement, useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
4
5
|
import { useInView, useReducedMotion } from "motion/react";
|
|
@@ -76,14 +77,6 @@ function buildStyles(opts) {
|
|
|
76
77
|
hasFilter: blurPx > 0
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
|
-
function mergeRefs(...refs) {
|
|
80
|
-
return (el) => {
|
|
81
|
-
refs.forEach((ref) => {
|
|
82
|
-
if (typeof ref === "function") ref(el);
|
|
83
|
-
else if (ref && typeof ref === "object") ref.current = el;
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
80
|
function getTransitionParams(transition, useSpring, fallbackDuration = .15) {
|
|
88
81
|
return {
|
|
89
82
|
duration: transition?.duration ?? fallbackDuration,
|
|
@@ -256,7 +249,7 @@ function Stagger({ children, interval = .08, baseDelay = 0 }) {
|
|
|
256
249
|
* @example
|
|
257
250
|
* ```tsx
|
|
258
251
|
* <Pulse>
|
|
259
|
-
* <span className="size-3 rounded-full bg-
|
|
252
|
+
* <span className="size-3 rounded-full bg-success" />
|
|
260
253
|
* </Pulse>
|
|
261
254
|
* ```
|
|
262
255
|
*/
|
|
@@ -277,10 +270,11 @@ function Pulse({ children, min = .97, max = 1.03, duration = 2, opacity, paused
|
|
|
277
270
|
style: existingStyle
|
|
278
271
|
});
|
|
279
272
|
const name = `pulse-${id}`;
|
|
280
|
-
|
|
273
|
+
const keyframes = `@keyframes ${name} {
|
|
281
274
|
0%, 100% { transform: scale(${min}); opacity: ${opacity?.[0] ?? 1}; }
|
|
282
275
|
50% { transform: scale(${max}); opacity: ${opacity?.[1] ?? 1}; }
|
|
283
|
-
}
|
|
276
|
+
}`;
|
|
277
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", { children: keyframes }), cloneElement(children, {
|
|
284
278
|
ref: existingRef ? mergeRefs(existingRef) : void 0,
|
|
285
279
|
style: {
|
|
286
280
|
...existingStyle,
|
|
@@ -319,10 +313,11 @@ function Float({ children, distance = 6, duration = 3, rotate = 0, paused = fals
|
|
|
319
313
|
const name = `float-${id}`;
|
|
320
314
|
const rotA = rotate ? ` rotate(${-rotate}deg)` : "";
|
|
321
315
|
const rotB = rotate ? ` rotate(${rotate}deg)` : "";
|
|
322
|
-
|
|
316
|
+
const keyframes = `@keyframes ${name} {
|
|
323
317
|
0%, 100% { transform: translateY(0px)${rotA}; }
|
|
324
318
|
50% { transform: translateY(${-distance}px)${rotB}; }
|
|
325
|
-
}
|
|
319
|
+
}`;
|
|
320
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", { children: keyframes }), cloneElement(children, {
|
|
326
321
|
...existingRef ? { ref: existingRef } : {},
|
|
327
322
|
style: {
|
|
328
323
|
...existingStyle,
|
package/dist/aspect-ratio.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
|
|
4
2
|
//#region src/aspect-ratio.d.ts
|
|
5
3
|
type AspectRatioProps = React.ComponentProps<"div"> & {
|
|
6
|
-
/** The width-to-height ratio (e.g. 16/9, 4/3, 1) */
|
|
4
|
+
/** The width-to-height ratio (e.g. 16/9, 4/3, 1) */
|
|
5
|
+
ratio: number;
|
|
7
6
|
};
|
|
8
|
-
declare function AspectRatio({
|
|
9
|
-
ratio,
|
|
10
|
-
className,
|
|
11
|
-
...props
|
|
12
|
-
}: AspectRatioProps): _$react_jsx_runtime0.JSX.Element;
|
|
7
|
+
declare function AspectRatio({ ratio, className, ...props }: AspectRatioProps): React.JSX.Element;
|
|
13
8
|
//#endregion
|
|
14
9
|
export { AspectRatio, type AspectRatioProps };
|