@fiestaboard/ui 5.12.2 → 5.12.3
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.
|
@@ -3,7 +3,25 @@ import * as React from "react";
|
|
|
3
3
|
declare const alertVariants: (props?: ({
|
|
4
4
|
variant?: "destructive" | "default" | "info" | "success" | "warning" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
|
|
6
|
+
export type AlertProps = React.ComponentProps<"div"> & VariantProps<typeof alertVariants> & {
|
|
7
|
+
/**
|
|
8
|
+
* Override the announcement urgency the variant would otherwise pick.
|
|
9
|
+
*
|
|
10
|
+
* The default is derived from `variant` (see {@link ASSERTIVE_VARIANTS}),
|
|
11
|
+
* which is right for the overwhelming majority of call sites — reach for
|
|
12
|
+
* this only when the message's urgency genuinely disagrees with its
|
|
13
|
+
* colour. A `destructive`-tinted alert that has been on the page since
|
|
14
|
+
* load is `politeness="polite"`; a `default`-tinted alert announcing that
|
|
15
|
+
* a save just failed is `politeness="assertive"`.
|
|
16
|
+
*
|
|
17
|
+
* Named for the ARIA term rather than spelled as a role so the two
|
|
18
|
+
* spellings cannot drift: this picks `alert` vs `status`, and no
|
|
19
|
+
* `aria-live` is set alongside, because the role already implies it (the
|
|
20
|
+
* same rule `EmptyState` follows).
|
|
21
|
+
*/
|
|
22
|
+
politeness?: "assertive" | "polite";
|
|
23
|
+
};
|
|
24
|
+
declare function Alert({ className, variant, politeness, ...props }: AlertProps): React.JSX.Element;
|
|
7
25
|
declare function AlertTitle({ className, ...props }: React.ComponentProps<"h5">): React.JSX.Element;
|
|
8
26
|
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
27
|
export { Alert, AlertDescription, AlertTitle, alertVariants };
|
|
@@ -12,23 +12,24 @@ var r = n("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:trans
|
|
|
12
12
|
warning: "border-warning bg-warning/8 text-foreground [&>svg]:text-warning"
|
|
13
13
|
} },
|
|
14
14
|
defaultVariants: { variant: "default" }
|
|
15
|
-
});
|
|
16
|
-
function
|
|
15
|
+
}), i = ["destructive", "warning"];
|
|
16
|
+
function a({ className: n, variant: a, politeness: o, ...s }) {
|
|
17
|
+
let c = o ?? (a && i.includes(a) ? "assertive" : "polite");
|
|
17
18
|
return /* @__PURE__ */ t("div", {
|
|
18
19
|
"data-slot": "alert",
|
|
19
|
-
role: "alert",
|
|
20
|
-
className: e(r({ variant:
|
|
21
|
-
...
|
|
20
|
+
role: c === "assertive" ? "alert" : "status",
|
|
21
|
+
className: e(r({ variant: a }), n),
|
|
22
|
+
...s
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function o({ className: n, ...r }) {
|
|
25
26
|
return /* @__PURE__ */ t("h5", {
|
|
26
27
|
"data-slot": "alert-title",
|
|
27
28
|
className: e("mb-1 font-semibold leading-tight tracking-tight", n),
|
|
28
29
|
...r
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function s({ className: n, ...r }) {
|
|
32
33
|
return /* @__PURE__ */ t("div", {
|
|
33
34
|
"data-slot": "alert-description",
|
|
34
35
|
className: e("text-sm [&_p]:leading-relaxed", n),
|
|
@@ -36,6 +37,6 @@ function o({ className: n, ...r }) {
|
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
//#endregion
|
|
39
|
-
export {
|
|
40
|
+
export { a as Alert, s as AlertDescription, o as AlertTitle, r as alertVariants };
|
|
40
41
|
|
|
41
42
|
//# sourceMappingURL=alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/feedback/alert.tsx"],"mappings":";;;;;AAqBA,IAAM,IAAgB,EACpB,2KACA;CACE,UAAU,EACR,SAAS;EAKP,SAAS;EAiBT,aAAa;EACb,MAAM;EACN,SAAS;EACT,SAAS;CACX,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;
|
|
1
|
+
{"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/feedback/alert.tsx"],"mappings":";;;;;AAqBA,IAAM,IAAgB,EACpB,2KACA;CACE,UAAU,EACR,SAAS;EAKP,SAAS;EAiBT,aAAa;EACb,MAAM;EACN,SAAS;EACT,SAAS;CACX,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF,GA0BM,IAA8C,CAAC,eAAe,SAAS;AAsB7E,SAAS,EAAM,EAAE,cAAW,YAAS,eAAY,GAAG,KAAqB;CACvE,IAAM,IAAU,MAAe,KAAW,EAAmB,SAAS,CAAO,IAAI,cAAc;CAE/F,OACE,kBAAC,OAAD;EACE,aAAU;EACV,MAAM,MAAY,cAAc,UAAU;EAC1C,WAAW,EAAG,EAAc,EAAE,WAAQ,CAAC,GAAG,CAAS;EAMnD,GAAI;CACL,CAAA;AAEL;AAIA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAqC;CACvE,OACE,kBAAC,MAAD;EACE,aAAU;EACV,WAAW,EAAG,mDAAmD,CAAS;EAC1E,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAiB,EAAE,cAAW,GAAG,KAAsC;CAC9E,OAAO,kBAAC,OAAD;EAAK,aAAU;EAAoB,WAAW,EAAG,iCAAiC,CAAS;EAAG,GAAI;CAAQ,CAAA;AACnH"}
|