@nsaa/core 0.1.0-alpha.3 → 0.1.0-alpha.4
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 +1 -1
- package/NOTICE +27 -0
- package/dist/alert/alert.d.ts +27 -3
- package/dist/alert/alert.js +198 -17
- package/dist/alert/index.d.ts +2 -2
- package/dist/badge/badge.d.ts +2 -2
- package/dist/badge/badge.js +1 -1
- package/dist/button/button.d.ts +2 -2
- package/dist/button/button.js +1 -1
- package/dist/empty/empty.d.ts +1 -1
- package/dist/empty/empty.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/input-group/input-group.d.ts +1 -1
- package/dist/input-otp/input-otp.js +1 -1
- package/dist/sources/alert.css +20 -0
- package/dist/toolbar/toolbar.js +1 -1
- package/package.json +5 -2
- package/src/feel.css +28 -1
package/LICENSE
CHANGED
|
@@ -25,4 +25,4 @@ SOFTWARE.
|
|
|
25
25
|
This licence covers the free packages in this repository. The Pro package
|
|
26
26
|
(`packages/blocks`, when it exists) ships under its own commercial licence,
|
|
27
27
|
stated in that folder. Third-party code adapted into Nsaa keeps its original
|
|
28
|
-
notice in the file header; colour scales come from
|
|
28
|
+
notice in the file header; colour scales come from Tailwind CSS (MIT).
|
package/NOTICE
CHANGED
|
@@ -152,3 +152,30 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
152
152
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
153
153
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
154
154
|
SOFTWARE.
|
|
155
|
+
|
|
156
|
+
-------------------------------------------------------------------------------
|
|
157
|
+
Tailwind CSS (https://github.com/tailwindlabs/tailwindcss), v4.3.3. Its default colour palette
|
|
158
|
+
(theme.css) is the source of the colour primitives in packages/tokens (src/primitives.json and
|
|
159
|
+
dist/), #149.
|
|
160
|
+
|
|
161
|
+
MIT License
|
|
162
|
+
|
|
163
|
+
Copyright (c) Tailwind Labs, Inc.
|
|
164
|
+
|
|
165
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
166
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
167
|
+
in the Software without restriction, including without limitation the rights
|
|
168
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
169
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
170
|
+
furnished to do so, subject to the following conditions:
|
|
171
|
+
|
|
172
|
+
The above copyright notice and this permission notice shall be included in all
|
|
173
|
+
copies or substantial portions of the Software.
|
|
174
|
+
|
|
175
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
176
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
177
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
178
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
179
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
180
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
181
|
+
SOFTWARE.
|
package/dist/alert/alert.d.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
4
|
import { VariantProps } from "class-variance-authority";
|
|
3
5
|
import * as React from "react";
|
|
4
6
|
declare const alertVariants: (props?: ({
|
|
5
7
|
variant?: "success" | "warning" | "default" | "destructive" | "info" | null | undefined;
|
|
8
|
+
appearance?: "soft" | "outline" | "solid" | null | undefined;
|
|
9
|
+
size?: "default" | "sm" | null | undefined;
|
|
6
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
|
|
11
|
+
type AlertAppearance = NonNullable<VariantProps<typeof alertVariants>["appearance"]>;
|
|
12
|
+
declare function Alert({ className, variant, appearance, size, announce, open, defaultOpen, onOpenChange, ref, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants> & {
|
|
13
|
+
/**
|
|
14
|
+
* How loud it is: `outline`, `soft` or `solid`. Defaults by variant: outline for default and
|
|
15
|
+
* destructive (base-nova), soft for success, warning and info.
|
|
16
|
+
*/
|
|
17
|
+
appearance?: AlertAppearance | null;
|
|
18
|
+
/** `default`, or `sm`: one compact line (icon, title, description, close) for tight places. */
|
|
19
|
+
size?: "default" | "sm" | null;
|
|
8
20
|
/**
|
|
9
21
|
* The error sound (feedback.error) when the Alert appears (#114). Left unset it's automatic: a
|
|
10
22
|
* destructive Alert plays it when a person's action caused it (within the browser's transient
|
|
@@ -12,8 +24,20 @@ declare function Alert({ className, variant, announce, ...props }: React.Compone
|
|
|
12
24
|
* warning are silent unless `announce` is set, then play feedback.success / feedback.warning.
|
|
13
25
|
*/
|
|
14
26
|
announce?: boolean;
|
|
15
|
-
|
|
27
|
+
/** Whether the Alert is shown (controlled). Only matters with an `AlertClose`. */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
/** Whether the Alert starts shown when uncontrolled. Defaults to `true`. */
|
|
30
|
+
defaultOpen?: boolean;
|
|
31
|
+
/** Called with `false` when `AlertClose` is pressed. */
|
|
32
|
+
onOpenChange?: (open: boolean) => void;
|
|
33
|
+
}): React.JSX.Element | null;
|
|
16
34
|
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
17
35
|
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
18
36
|
declare function AlertAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
|
-
|
|
37
|
+
/** Nsaa (#148): dismisses the Alert. A ghost icon Button named "Dismiss", at the inline end. */
|
|
38
|
+
declare function AlertClose({ className, children, onClick, ...props }: Omit<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
|
|
39
|
+
/** Nsaa (#148): a row of `AlertLink`s under the description. The ∙ between them is CSS, never read. */
|
|
40
|
+
declare function AlertLinks({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
41
|
+
/** Nsaa (#148): a real link in the Alert's own text colour, medium weight, underlined. */
|
|
42
|
+
declare function AlertLink({ className, render, ...props }: useRender.ComponentProps<"a">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
43
|
+
export { Alert, AlertAction, AlertClose, AlertDescription, AlertLink, AlertLinks, AlertTitle };
|
package/dist/alert/alert.js
CHANGED
|
@@ -1,22 +1,123 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import { recentUserAction } from "../lib/user-action.js";
|
|
4
3
|
import { useCue } from "../sound/sound-map.js";
|
|
5
|
-
import {
|
|
4
|
+
import { Button } from "../button/button.js";
|
|
5
|
+
import { mergeRefs } from "../lib/merge-refs.js";
|
|
6
|
+
import { recentUserAction } from "../lib/user-action.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
9
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
10
|
import { cva } from "class-variance-authority";
|
|
7
11
|
import * as React from "react";
|
|
8
12
|
// src/alert/alert.tsx
|
|
9
13
|
const alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
|
|
10
|
-
variants: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
variants: {
|
|
15
|
+
variant: {
|
|
16
|
+
default: "bg-card text-card-foreground",
|
|
17
|
+
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
|
|
18
|
+
success: "",
|
|
19
|
+
warning: "",
|
|
20
|
+
info: ""
|
|
21
|
+
},
|
|
22
|
+
appearance: {
|
|
23
|
+
outline: "",
|
|
24
|
+
soft: "",
|
|
25
|
+
solid: ""
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
default: "has-data-[slot=alert-close]:pr-10 has-data-[slot=alert-action]:has-data-[slot=alert-close]:pr-25 rtl:has-data-[slot=alert-close]:pr-2.5 rtl:has-data-[slot=alert-close]:pl-10 rtl:has-data-[slot=alert-action]:has-data-[slot=alert-close]:pl-25",
|
|
29
|
+
sm: "block rounded-md px-2 py-1.5 text-xs has-data-[slot=alert-close]:pr-8 rtl:has-data-[slot=alert-close]:pr-2 rtl:has-data-[slot=alert-close]:pl-8 *:[svg]:float-start *:[svg]:me-2 *:[svg]:translate-y-0 *:data-[slot=alert-title]:inline *:data-[slot=alert-description]:ms-1 *:data-[slot=alert-description]:inline *:data-[slot=alert-description]:text-xs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
compoundVariants: [
|
|
33
|
+
{
|
|
34
|
+
variant: "default",
|
|
35
|
+
appearance: "soft",
|
|
36
|
+
className: "bg-muted border-transparent text-foreground *:data-[slot=alert-description]:text-foreground *:data-[slot=alert-close]:text-muted-foreground *:[svg]:text-muted-foreground"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
variant: "destructive",
|
|
40
|
+
appearance: "soft",
|
|
41
|
+
className: "bg-danger-subtle border-transparent text-foreground *:data-[slot=alert-description]:text-foreground *:data-[slot=alert-close]:text-muted-foreground *:[svg]:text-(--nsaa-color-danger-foreground)"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
variant: "success",
|
|
45
|
+
appearance: "soft",
|
|
46
|
+
className: "bg-positive-subtle border-transparent text-foreground *:data-[slot=alert-description]:text-foreground *:data-[slot=alert-close]:text-muted-foreground *:[svg]:text-(--nsaa-color-positive-foreground)"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
variant: "warning",
|
|
50
|
+
appearance: "soft",
|
|
51
|
+
className: "bg-warning-subtle border-transparent text-foreground *:data-[slot=alert-description]:text-foreground *:data-[slot=alert-close]:text-muted-foreground *:[svg]:text-(--nsaa-color-warning-foreground)"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
variant: "info",
|
|
55
|
+
appearance: "soft",
|
|
56
|
+
className: "bg-info-subtle border-transparent text-foreground *:data-[slot=alert-description]:text-foreground *:data-[slot=alert-close]:text-muted-foreground *:[svg]:text-(--nsaa-color-info-foreground)"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
variant: "default",
|
|
60
|
+
appearance: "solid",
|
|
61
|
+
className: "border-inverted-solid bg-inverted-solid text-on-inverted-foreground *:data-[slot=alert-action]:rounded-[min(var(--radius-md),10px)] *:data-[slot=alert-action]:bg-background *:data-[slot=alert-action]:text-foreground *:data-[slot=alert-description]:text-on-inverted-foreground"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
variant: "destructive",
|
|
65
|
+
appearance: "outline",
|
|
66
|
+
className: "border-danger-border-default bg-card"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
variant: "success",
|
|
70
|
+
appearance: "outline",
|
|
71
|
+
className: "border-positive-border-default bg-card text-card-foreground *:[svg]:text-(--nsaa-color-positive-foreground)"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
variant: "warning",
|
|
75
|
+
appearance: "outline",
|
|
76
|
+
className: "border-warning-border-default bg-card text-card-foreground *:[svg]:text-(--nsaa-color-warning-foreground)"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
variant: "info",
|
|
80
|
+
appearance: "outline",
|
|
81
|
+
className: "border-info-border-default bg-card text-card-foreground *:[svg]:text-(--nsaa-color-info-foreground)"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
variant: "destructive",
|
|
85
|
+
appearance: "solid",
|
|
86
|
+
className: "border-transparent bg-danger-solid text-on-danger-solid-foreground *:data-[slot=alert-description]:text-on-danger-solid-foreground *:data-[slot=alert-action]:rounded-[min(var(--radius-md),10px)] *:data-[slot=alert-action]:bg-on-danger-solid-foreground *:data-[slot=alert-action]:text-danger-solid **:data-[slot=button]:text-danger-solid!"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
variant: "success",
|
|
90
|
+
appearance: "solid",
|
|
91
|
+
className: "border-transparent bg-positive-solid text-on-positive-solid-foreground *:data-[slot=alert-description]:text-on-positive-solid-foreground *:data-[slot=alert-action]:rounded-[min(var(--radius-md),10px)] *:data-[slot=alert-action]:bg-on-positive-solid-foreground *:data-[slot=alert-action]:text-positive-solid **:data-[slot=button]:text-positive-solid!"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
variant: "warning",
|
|
95
|
+
appearance: "solid",
|
|
96
|
+
className: "border-transparent bg-warning-solid text-on-warning-solid-foreground *:data-[slot=alert-description]:text-on-warning-solid-foreground *:data-[slot=alert-action]:rounded-[min(var(--radius-md),10px)] *:data-[slot=alert-action]:bg-on-warning-solid-foreground *:data-[slot=alert-action]:text-warning-solid **:data-[slot=button]:text-warning-solid!"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
variant: "info",
|
|
100
|
+
appearance: "solid",
|
|
101
|
+
className: "border-transparent bg-info-solid text-on-info-solid-foreground *:data-[slot=alert-description]:text-on-info-solid-foreground *:data-[slot=alert-action]:rounded-[min(var(--radius-md),10px)] *:data-[slot=alert-action]:bg-on-info-solid-foreground *:data-[slot=alert-action]:text-info-solid **:data-[slot=button]:text-info-solid!"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
appearance: ["soft", "solid"],
|
|
105
|
+
className: "[&_a:hover]:text-current!"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
defaultVariants: {
|
|
109
|
+
variant: "default",
|
|
110
|
+
size: "default"
|
|
111
|
+
}
|
|
18
112
|
});
|
|
19
|
-
|
|
113
|
+
const AlertContext = React.createContext(null);
|
|
114
|
+
const FOCUSABLE = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
115
|
+
/** The next focusable element after `el` in the page, or the previous one if there is none. */
|
|
116
|
+
function neighbour(el) {
|
|
117
|
+
const all = [...el.ownerDocument.querySelectorAll(FOCUSABLE)].filter((node) => !el.contains(node) && (node.checkVisibility?.() ?? true));
|
|
118
|
+
return all.find((node) => el.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_FOLLOWING) ?? all.filter((node) => el.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_PRECEDING).at(-1) ?? null;
|
|
119
|
+
}
|
|
120
|
+
function Alert({ className, variant, appearance, size, announce, open, defaultOpen = true, onOpenChange, ref, ...props }) {
|
|
20
121
|
const cue = useCue("alert");
|
|
21
122
|
const destructive = variant === "destructive";
|
|
22
123
|
const announceCue = variant === "success" || variant === "warning" ? variant : "destructive";
|
|
@@ -27,11 +128,47 @@ function Alert({ className, variant, announce, ...props }) {
|
|
|
27
128
|
React.useEffect(() => {
|
|
28
129
|
if (announce !== false && (destructive || announce)) appear();
|
|
29
130
|
}, [destructive, announce]);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
131
|
+
const [uncontrolled, setUncontrolled] = React.useState(defaultOpen);
|
|
132
|
+
const shown = open ?? uncontrolled;
|
|
133
|
+
const [mounted, setMounted] = React.useState(shown);
|
|
134
|
+
const node = React.useRef(null);
|
|
135
|
+
if (shown && !mounted) setMounted(true);
|
|
136
|
+
React.useLayoutEffect(() => {
|
|
137
|
+
const el = node.current;
|
|
138
|
+
if (shown || !el) return;
|
|
139
|
+
let live = true;
|
|
140
|
+
const running = el.getAnimations?.() ?? [];
|
|
141
|
+
Promise.allSettled(running.map((a) => a.finished)).then(() => {
|
|
142
|
+
if (!live) return;
|
|
143
|
+
if (el.contains(el.ownerDocument.activeElement)) neighbour(el)?.focus();
|
|
144
|
+
setMounted(false);
|
|
145
|
+
});
|
|
146
|
+
return () => {
|
|
147
|
+
live = false;
|
|
148
|
+
};
|
|
149
|
+
}, [shown]);
|
|
150
|
+
const context = React.useMemo(() => ({ close: () => {
|
|
151
|
+
if (open === void 0) setUncontrolled(false);
|
|
152
|
+
onOpenChange?.(false);
|
|
153
|
+
} }), [open, onOpenChange]);
|
|
154
|
+
if (!mounted) return null;
|
|
155
|
+
const status = variant ?? "default";
|
|
156
|
+
const look = appearance ?? (status === "success" || status === "warning" || status === "info" ? "soft" : "outline");
|
|
157
|
+
return /* @__PURE__ */ jsx(AlertContext.Provider, {
|
|
158
|
+
value: context,
|
|
159
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
160
|
+
ref: mergeRefs(node, ref),
|
|
161
|
+
"data-slot": "alert",
|
|
162
|
+
"data-size": size ?? "default",
|
|
163
|
+
"data-ending-style": shown ? void 0 : "",
|
|
164
|
+
role: destructive || status === "warning" ? "alert" : "status",
|
|
165
|
+
className: cn(alertVariants({
|
|
166
|
+
variant,
|
|
167
|
+
appearance: look,
|
|
168
|
+
size
|
|
169
|
+
}), "rtl:text-right rtl:has-data-[slot=alert-action]:pr-2.5 rtl:has-data-[slot=alert-action]:pl-18 rtl:*:data-[slot=alert-action]:right-auto rtl:*:data-[slot=alert-action]:left-2", "has-data-[slot=alert-close]:*:data-[slot=alert-action]:right-10 rtl:has-data-[slot=alert-close]:*:data-[slot=alert-action]:left-10", className),
|
|
170
|
+
...props
|
|
171
|
+
})
|
|
35
172
|
});
|
|
36
173
|
}
|
|
37
174
|
function AlertTitle({ className, ...props }) {
|
|
@@ -55,4 +192,48 @@ function AlertAction({ className, ...props }) {
|
|
|
55
192
|
...props
|
|
56
193
|
});
|
|
57
194
|
}
|
|
58
|
-
|
|
195
|
+
/** Nsaa (#148): dismisses the Alert. A ghost icon Button named "Dismiss", at the inline end. */
|
|
196
|
+
function AlertClose({ className, children, onClick, ...props }) {
|
|
197
|
+
const alert = React.useContext(AlertContext);
|
|
198
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
199
|
+
"data-slot": "alert-close",
|
|
200
|
+
variant: "ghost",
|
|
201
|
+
size: "icon-xs",
|
|
202
|
+
"aria-label": "Dismiss",
|
|
203
|
+
className: cn("absolute top-2 right-2 text-current rtl:right-auto rtl:left-2 group-data-[size=sm]/alert:top-1 group-data-[size=sm]/alert:right-1 rtl:group-data-[size=sm]/alert:right-auto rtl:group-data-[size=sm]/alert:left-1", className),
|
|
204
|
+
onClick: (event) => {
|
|
205
|
+
onClick?.(event);
|
|
206
|
+
if (!event.defaultPrevented) alert?.close();
|
|
207
|
+
},
|
|
208
|
+
...props,
|
|
209
|
+
children: children ?? /* @__PURE__ */ jsxs("svg", {
|
|
210
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
211
|
+
viewBox: "0 0 24 24",
|
|
212
|
+
fill: "none",
|
|
213
|
+
stroke: "currentColor",
|
|
214
|
+
strokeWidth: "2",
|
|
215
|
+
strokeLinecap: "round",
|
|
216
|
+
strokeLinejoin: "round",
|
|
217
|
+
"aria-hidden": "true",
|
|
218
|
+
children: [/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }), /* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })]
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
/** Nsaa (#148): a row of `AlertLink`s under the description. The ∙ between them is CSS, never read. */
|
|
223
|
+
function AlertLinks({ className, ...props }) {
|
|
224
|
+
return /* @__PURE__ */ jsx("div", {
|
|
225
|
+
"data-slot": "alert-links",
|
|
226
|
+
className: cn("mt-1 flex flex-wrap items-center gap-x-4 gap-y-1 group-has-[>svg]/alert:col-start-2", className),
|
|
227
|
+
...props
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
/** Nsaa (#148): a real link in the Alert's own text colour, medium weight, underlined. */
|
|
231
|
+
function AlertLink({ className, render, ...props }) {
|
|
232
|
+
return useRender({
|
|
233
|
+
defaultTagName: "a",
|
|
234
|
+
props: mergeProps({ className: cn("relative font-medium text-current underline underline-offset-3 hover:decoration-2", "not-first:before:pointer-events-none not-first:before:absolute not-first:before:-start-2.5 not-first:before:no-underline not-first:before:content-['∙'_/_'']", className) }, props),
|
|
235
|
+
render,
|
|
236
|
+
state: { slot: "alert-link" }
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
export { Alert, AlertAction, AlertClose, AlertDescription, AlertLink, AlertLinks, AlertTitle };
|
package/dist/alert/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import { Alert, AlertAction, AlertDescription, AlertTitle } from "./alert.js";
|
|
3
|
-
export { Alert, AlertAction, AlertDescription, AlertTitle };
|
|
2
|
+
import { Alert, AlertAction, AlertClose, AlertDescription, AlertLink, AlertLinks, AlertTitle } from "./alert.js";
|
|
3
|
+
export { Alert, AlertAction, AlertClose, AlertDescription, AlertLink, AlertLinks, AlertTitle };
|
package/dist/badge/badge.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
3
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
declare const badgeVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "destructive" | "link" | "
|
|
5
|
+
variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
8
8
|
export { Badge, badgeVariants };
|
package/dist/badge/badge.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
3
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
4
|
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
6
|
// src/badge/badge.tsx
|
|
7
7
|
const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
8
8
|
variants: { variant: {
|
package/dist/button/button.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import { Button } from "@base-ui/react/button";
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "destructive" | "link" | "
|
|
6
|
-
size?: "default" | "
|
|
5
|
+
variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
type LoadingPlacement = "auto" | "start" | "center";
|
|
9
9
|
declare function Button$1({ className, variant, size, loading, loadingLabel, loadingPlacement, children, onClick, onPointerDown, onPointerUp, onPointerLeave, onPointerCancel, ...props }: Button.Props & VariantProps<typeof buttonVariants> & {
|
package/dist/button/button.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import { useCue } from "../sound/sound-map.js";
|
|
4
3
|
import { useControlDefaults } from "../lib/control-defaults.js";
|
|
5
4
|
import { usePress } from "../lib/use-press.js";
|
|
5
|
+
import { useCue } from "../sound/sound-map.js";
|
|
6
6
|
import { Spinner } from "../spinner/spinner.js";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { cva } from "class-variance-authority";
|
package/dist/empty/empty.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
3
|
import { VariantProps } from "class-variance-authority";
|
|
3
4
|
import * as React from "react";
|
|
4
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
5
5
|
declare function Empty({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
6
|
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
7
|
declare const emptyMediaVariants: (props?: ({
|
package/dist/empty/empty.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
|
-
import * as React from "react";
|
|
6
4
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
5
|
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
import * as React from "react";
|
|
8
8
|
// src/empty/empty.tsx
|
|
9
9
|
function Empty({ className, ...props }) {
|
|
10
10
|
return /* @__PURE__ */ jsx("div", {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./accordion/accordion.js";
|
|
3
3
|
import "./accordion/index.js";
|
|
4
|
-
import { Alert, AlertAction, AlertDescription, AlertTitle } from "./alert/alert.js";
|
|
5
|
-
import "./alert/index.js";
|
|
6
4
|
import { Button, buttonVariants } from "./button/button.js";
|
|
5
|
+
import { Alert, AlertAction, AlertClose, AlertDescription, AlertLink, AlertLinks, AlertTitle } from "./alert/alert.js";
|
|
6
|
+
import "./alert/index.js";
|
|
7
7
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger } from "./alert-dialog/alert-dialog.js";
|
|
8
8
|
import "./alert-dialog/index.js";
|
|
9
9
|
import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "./avatar/avatar.js";
|
|
@@ -88,4 +88,4 @@ import "./toolbar/index.js";
|
|
|
88
88
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip/tooltip.js";
|
|
89
89
|
import "./tooltip/index.js";
|
|
90
90
|
import "./lib/track-input-modality.js";
|
|
91
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, type EmptyIllustrationOptions, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, IconSwap, type IconSwapProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, type LoaderComponent, LoaderProvider, type LoaderProviderProps, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, RadioGroup, RadioGroupItem, SOUND_MAP, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, SkeletonContent, Slider, type SoundComponent, type SoundCue, type SoundPlayer, SoundProvider, type SoundProviderProps, Spinner, type SpinnerProps, type SpinnerVariant, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, ToggleGroup, type ToggleGroupItemProps, type ToggleGroupMultipleProps, type ToggleGroupProps, type ToggleGroupSingleProps, type ToggleGroupSize, type ToggleGroupVariant, Toolbar, type ToolbarButtonProps, type ToolbarGroupProps, type ToolbarInputProps, type ToolbarLinkProps, type ToolbarProps, type ToolbarSize, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, createToastManager, lazyUisfxPlayer, registerLoader, registerLoaders, tabsListVariants, toast, useComboboxAnchor, useEmptyIllustration, useSound, useToastManager };
|
|
91
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertClose, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertLink, AlertLinks, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, type EmptyIllustrationOptions, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, IconSwap, type IconSwapProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, type LoaderComponent, LoaderProvider, type LoaderProviderProps, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, RadioGroup, RadioGroupItem, SOUND_MAP, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, SkeletonContent, Slider, type SoundComponent, type SoundCue, type SoundPlayer, SoundProvider, type SoundProviderProps, Spinner, type SpinnerProps, type SpinnerVariant, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, ToggleGroup, type ToggleGroupItemProps, type ToggleGroupMultipleProps, type ToggleGroupProps, type ToggleGroupSingleProps, type ToggleGroupSize, type ToggleGroupVariant, Toolbar, type ToolbarButtonProps, type ToolbarGroupProps, type ToolbarInputProps, type ToolbarLinkProps, type ToolbarProps, type ToolbarSize, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, createToastManager, lazyUisfxPlayer, registerLoader, registerLoaders, tabsListVariants, toast, useComboboxAnchor, useEmptyIllustration, useSound, useToastManager };
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import { cn } from "./lib/cn.js";
|
|
|
3
3
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./accordion/accordion.js";
|
|
4
4
|
import { SoundProvider, useSound } from "./sound/sound.js";
|
|
5
5
|
import { SOUND_MAP } from "./sound/sound-map.js";
|
|
6
|
-
import { Alert, AlertAction, AlertDescription, AlertTitle } from "./alert/alert.js";
|
|
7
6
|
import { LoaderProvider } from "./spinner/loader-provider.js";
|
|
8
7
|
import { registerLoader, registerLoaders } from "./spinner/registry.js";
|
|
9
8
|
import { Spinner } from "./spinner/spinner.js";
|
|
10
9
|
import { Button, buttonVariants } from "./button/button.js";
|
|
10
|
+
import { Alert, AlertAction, AlertClose, AlertDescription, AlertLink, AlertLinks, AlertTitle } from "./alert/alert.js";
|
|
11
11
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger } from "./alert-dialog/alert-dialog.js";
|
|
12
12
|
import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "./avatar/avatar.js";
|
|
13
13
|
import { Badge, badgeVariants } from "./badge/badge.js";
|
|
@@ -48,4 +48,4 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tool
|
|
|
48
48
|
import { ToggleGroup } from "./toggle-group/toggle-group.js";
|
|
49
49
|
import { Toolbar } from "./toolbar/toolbar.js";
|
|
50
50
|
import "./lib/track-input-modality.js";
|
|
51
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, IconSwap, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, LoaderProvider, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, RadioGroup, RadioGroupItem, SOUND_MAP, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, SkeletonContent, Slider, SoundProvider, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, ToggleGroup, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, createToastManager, lazyUisfxPlayer, registerLoader, registerLoaders, tabsListVariants, toast, useComboboxAnchor, useEmptyIllustration, useSound, useToastManager };
|
|
51
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertClose, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertLink, AlertLinks, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, IconSwap, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, LoaderProvider, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, RadioGroup, RadioGroupItem, SOUND_MAP, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, SkeletonContent, Slider, SoundProvider, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, ToggleGroup, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, createToastManager, lazyUisfxPlayer, registerLoader, registerLoaders, tabsListVariants, toast, useComboboxAnchor, useEmptyIllustration, useSound, useToastManager };
|
|
@@ -8,7 +8,7 @@ declare const inputGroupAddonVariants: (props?: ({
|
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
10
10
|
declare const inputGroupButtonVariants: (props?: ({
|
|
11
|
-
size?: "
|
|
11
|
+
size?: "sm" | "xs" | "icon-xs" | "icon-sm" | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
13
|
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size" | "type"> & VariantProps<typeof inputGroupButtonVariants> & {
|
|
14
14
|
type?: "button" | "submit" | "reset";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn } from "../lib/cn.js";
|
|
4
|
-
import { recentUserAction } from "../lib/user-action.js";
|
|
5
4
|
import { useCue } from "../sound/sound-map.js";
|
|
5
|
+
import { recentUserAction } from "../lib/user-action.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { OTPInput, OTPInputContext } from "input-otp";
|
package/dist/sources/alert.css
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
/* @nsaa/core: Tailwind sources for alert (generated). */
|
|
2
2
|
@source "../alert/alert.js";
|
|
3
|
+
@source "../button/button.js";
|
|
3
4
|
@source "../lib/cn.js";
|
|
5
|
+
@source "../lib/control-defaults.js";
|
|
4
6
|
@source "../lib/input-modality.js";
|
|
7
|
+
@source "../lib/merge-refs.js";
|
|
8
|
+
@source "../lib/use-press.js";
|
|
5
9
|
@source "../lib/user-action.js";
|
|
10
|
+
@source "../loaders/arc.js";
|
|
11
|
+
@source "../loaders/bouncing-dots.js";
|
|
12
|
+
@source "../loaders/cap.js";
|
|
13
|
+
@source "../loaders/circular-dots.js";
|
|
14
|
+
@source "../loaders/classic.js";
|
|
15
|
+
@source "../loaders/easing.js";
|
|
16
|
+
@source "../loaders/fade.js";
|
|
17
|
+
@source "../loaders/frame.js";
|
|
18
|
+
@source "../loaders/motion.js";
|
|
19
|
+
@source "../loaders/orbit.js";
|
|
20
|
+
@source "../loaders/pulse.js";
|
|
21
|
+
@source "../loaders/ring.js";
|
|
22
|
+
@source "../loaders/wave.js";
|
|
6
23
|
@source "../sound/sound-map.js";
|
|
7
24
|
@source "../sound/sound.js";
|
|
25
|
+
@source "../spinner/loader-provider.js";
|
|
26
|
+
@source "../spinner/registry.js";
|
|
27
|
+
@source "../spinner/spinner.js";
|
|
8
28
|
@source "../tokens/dist/motion.js";
|
package/dist/toolbar/toolbar.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { ControlDefaultsContext, useControlDefaults } from "../lib/control-defaults.js";
|
|
4
4
|
import { buttonVariants } from "../button/button.js";
|
|
5
|
+
import { mergeRefs } from "../lib/merge-refs.js";
|
|
5
6
|
import { Input } from "../input/input.js";
|
|
6
7
|
import { DropdownMenuCheckboxItem, DropdownMenuItem, DropdownMenuShortcut } from "../dropdown-menu/dropdown-menu.js";
|
|
7
8
|
import { tv } from "../lib/tv.js";
|
|
@@ -9,7 +10,6 @@ import { ariaShortcut, formatShortcut } from "../lib/shortcut.js";
|
|
|
9
10
|
import { TooltipProvider } from "../tooltip/tooltip.js";
|
|
10
11
|
import { ToolbarItem } from "./toolbar-item.js";
|
|
11
12
|
import { OverflowContext, OverflowMore, OverflowStore, useOverflowUnit } from "./overflow.js";
|
|
12
|
-
import { mergeRefs } from "../lib/merge-refs.js";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
15
15
|
import { Toolbar } from "@base-ui/react/toolbar";
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsaa/core",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.4",
|
|
4
4
|
"description": "Nsaa core components: accessible, token-driven, animated to the Nsaa feel spec.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": [
|
|
8
8
|
"**/*.css",
|
|
9
|
+
"./dist/index.js",
|
|
10
|
+
"./src/index.ts",
|
|
9
11
|
"./dist/lib/track-input-modality.js",
|
|
12
|
+
"./src/lib/track-input-modality.ts",
|
|
10
13
|
"./dist/spinner/spinner.js"
|
|
11
14
|
],
|
|
12
15
|
"files": [
|
|
@@ -50,7 +53,7 @@
|
|
|
50
53
|
"tailwind-merge": "^3.7.0",
|
|
51
54
|
"tailwind-variants": "^3.3.1",
|
|
52
55
|
"uisfx": "0.4.0",
|
|
53
|
-
"@nsaa/tokens": "^0.1.0-alpha.
|
|
56
|
+
"@nsaa/tokens": "^0.1.0-alpha.4"
|
|
54
57
|
},
|
|
55
58
|
"devDependencies": {
|
|
56
59
|
"@testing-library/jest-dom": "^7.0.1",
|
package/src/feel.css
CHANGED
|
@@ -53,6 +53,17 @@
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
/* Alert links (#148): 44 px tall, their own width (the AlertLinks gap keeps them apart);
|
|
57
|
+
::after, as ::before draws the separator. */
|
|
58
|
+
[data-slot="alert-link"]::after {
|
|
59
|
+
content: "";
|
|
60
|
+
position: absolute;
|
|
61
|
+
inset-inline: 0;
|
|
62
|
+
top: 50%;
|
|
63
|
+
height: calc(var(--spacing) * 11);
|
|
64
|
+
translate: 0 -50%;
|
|
65
|
+
}
|
|
66
|
+
|
|
56
67
|
:is([data-slot="input"], [data-slot="input-group"]) {
|
|
57
68
|
min-height: calc(var(--spacing) * 11);
|
|
58
69
|
}
|
|
@@ -461,6 +472,13 @@
|
|
|
461
472
|
}
|
|
462
473
|
}
|
|
463
474
|
|
|
475
|
+
/* Dismiss (#148): opacity only, duration.fast, then it unmounts. No height animation (not a
|
|
476
|
+
named layout exception); instant under reduced motion and after keyboard input. */
|
|
477
|
+
[data-slot="alert"][data-ending-style] {
|
|
478
|
+
opacity: 0;
|
|
479
|
+
transition-duration: calc(var(--nsaa-duration-fast) * var(--nsaa-time-scale));
|
|
480
|
+
}
|
|
481
|
+
|
|
464
482
|
/* ---------------------------------------------------------------- Avatar, Skeleton, Spinner
|
|
465
483
|
A loaded image fades in 150; Skeleton keeps its pulse; Spinner turns at duration.spin. */
|
|
466
484
|
/* SkeletonContent: what replaces a Skeleton fades in the same way (#128). */
|
|
@@ -710,6 +728,10 @@
|
|
|
710
728
|
}
|
|
711
729
|
}
|
|
712
730
|
|
|
731
|
+
& [data-slot="alert"][data-ending-style] {
|
|
732
|
+
transition-duration: 0s;
|
|
733
|
+
}
|
|
734
|
+
|
|
713
735
|
& :is([data-slot="skeleton"], [data-loader="lucide"]) {
|
|
714
736
|
animation: none;
|
|
715
737
|
}
|
|
@@ -874,6 +896,10 @@
|
|
|
874
896
|
}
|
|
875
897
|
}
|
|
876
898
|
|
|
899
|
+
& [data-slot="alert"][data-ending-style] {
|
|
900
|
+
transition-duration: 0s;
|
|
901
|
+
}
|
|
902
|
+
|
|
877
903
|
& :is([data-slot="skeleton"], [data-loader="lucide"]) {
|
|
878
904
|
animation: none;
|
|
879
905
|
}
|
|
@@ -933,7 +959,8 @@
|
|
|
933
959
|
[data-slot="drawer-overlay"],
|
|
934
960
|
[data-slot="accordion-content"],
|
|
935
961
|
[data-slot="collapsible-content"],
|
|
936
|
-
[data-slot="skeleton-content"]
|
|
962
|
+
[data-slot="skeleton-content"],
|
|
963
|
+
[data-slot="alert"][data-ending-style]
|
|
937
964
|
) {
|
|
938
965
|
transition-duration: 0s;
|
|
939
966
|
}
|