@brightlocal/ui-components 3.1.0 → 3.2.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 +6 -1
- package/component-meta.json +663 -38
- package/deprecations.json +1 -1
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +32 -3
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +61 -58
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +58 -57
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +9 -0
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +50 -30
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +176 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +4 -3
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +21 -20
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +17 -0
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +8 -2
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +86 -6
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +185 -96
- package/dist/chart.cjs +3 -3
- package/dist/chart.d.ts +231 -13
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +466 -306
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +2 -1
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +2 -2
- package/dist/command.cjs +1 -1
- package/dist/command.js +1 -1
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +169 -22
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +695 -561
- package/dist/grid.d.ts +24 -1
- package/dist/grid.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +593 -561
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +41 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +1 -1
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +167 -54
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +9 -9
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +28 -6
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +5 -5
- package/dist/input.cjs +1 -1
- package/dist/input.js +10 -10
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +4 -1
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +12 -11
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +4 -3
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +178 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +463 -0
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +123 -16
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +89 -75
- package/dist/rating.cjs +1 -1
- package/dist/rating.js +18 -18
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +128 -0
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +11 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +97 -81
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +78 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +192 -85
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +81 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +226 -0
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +22 -22
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +13 -13
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +45 -4
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +90 -73
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +148 -126
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +262 -73
- package/dist/typography-text.d.ts +1 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography.d.ts +1 -1
- package/package.json +5 -6
- package/src/blocks/empty-state.tsx +8 -3
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +26 -2
- package/src/components/alert-dialog.tsx +50 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +40 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/card.tsx +211 -24
- package/src/components/chart.tsx +523 -35
- package/src/components/checkbox.tsx +1 -1
- package/src/components/combobox.tsx +2 -2
- package/src/components/command.tsx +1 -1
- package/src/components/data-table.tsx +778 -195
- package/src/components/grid.tsx +32 -1
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +246 -11
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +33 -11
- package/src/components/input.tsx +1 -1
- package/src/components/list.tsx +1 -1
- package/src/components/multi-select-filter.tsx +912 -0
- package/src/components/progress.tsx +190 -31
- package/src/components/rating.tsx +1 -1
- package/src/components/relative-date.tsx +230 -0
- package/src/components/select.tsx +35 -5
- package/src/components/sheet.tsx +240 -4
- package/src/components/single-select-filter.tsx +443 -0
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/table.tsx +71 -11
- package/src/components/tabs.tsx +93 -46
- package/src/components/textarea.tsx +1 -1
- package/src/components/tooltip.tsx +440 -68
- package/src/components/typography-text.tsx +1 -2
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/index.ts +5 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/utils.ts +1 -0
package/dist/badge.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { cn as
|
|
6
|
-
|
|
1
|
+
import { jsx as a, jsxs as g, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { Slot as v } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as _ } from "class-variance-authority";
|
|
5
|
+
import { cn as x } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
import { useDevWarning as h } from "@brightlocal/ui-components/lib/use-dev-warning";
|
|
7
|
+
const y = _(
|
|
7
8
|
[
|
|
8
9
|
// Layout
|
|
9
10
|
"inline-flex items-center justify-center gap-1 w-fit shrink-0 overflow-hidden",
|
|
@@ -15,8 +16,11 @@ const _ = l(
|
|
|
15
16
|
// Typography — type-scale role for badges (12/16 Figma 500; the weight
|
|
16
17
|
// drop from the old semibold is intentional, DS-925)
|
|
17
18
|
"text-label-sm whitespace-nowrap",
|
|
18
|
-
// Icons
|
|
19
|
+
// Icons — direct children, plus the one `srLabel` wrapper (display:
|
|
20
|
+
// contents) so an icon inside it keeps its size without resizing any
|
|
21
|
+
// other nested SVG
|
|
19
22
|
"[&>svg]:size-3 [&>svg]:pointer-events-none",
|
|
23
|
+
"[&>.contents>svg]:size-3 [&>.contents>svg]:pointer-events-none",
|
|
20
24
|
// Transition
|
|
21
25
|
"transition-[color,background-color,border-color,box-shadow] duration-fast ease-out",
|
|
22
26
|
// Focus
|
|
@@ -39,35 +43,51 @@ const _ = l(
|
|
|
39
43
|
variant: "primary"
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
|
-
),
|
|
46
|
+
), k = f.forwardRef(
|
|
43
47
|
({
|
|
44
|
-
className:
|
|
45
|
-
variant:
|
|
46
|
-
asChild:
|
|
47
|
-
dataHook:
|
|
48
|
-
trackingEl:
|
|
49
|
-
trackingLabel:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
className: n,
|
|
49
|
+
variant: s,
|
|
50
|
+
asChild: e = !1,
|
|
51
|
+
dataHook: i,
|
|
52
|
+
trackingEl: d,
|
|
53
|
+
trackingLabel: c,
|
|
54
|
+
srLabel: r,
|
|
55
|
+
children: t,
|
|
56
|
+
...u
|
|
57
|
+
}, p) => {
|
|
58
|
+
const l = e ? v : "span", o = r !== void 0 && !e;
|
|
59
|
+
h(
|
|
60
|
+
() => e && r !== void 0,
|
|
61
|
+
"srLabel is set on a <Badge asChild>. Slot renders the child element as-is, so the phrase cannot be injected — add an sr-only span inside the child instead.",
|
|
62
|
+
[e, r]
|
|
63
|
+
);
|
|
64
|
+
const b = typeof t == "string" && /^[0-9]$/.test(t);
|
|
65
|
+
return /* @__PURE__ */ a(
|
|
66
|
+
l,
|
|
56
67
|
{
|
|
57
|
-
ref:
|
|
58
|
-
className:
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
ref: p,
|
|
69
|
+
className: x(
|
|
70
|
+
y({ variant: s }),
|
|
71
|
+
/* sr-only is absolutely positioned: the badge is its positioning
|
|
72
|
+
context so the phrase never escapes a scroll viewport. */
|
|
73
|
+
o && "relative",
|
|
74
|
+
n
|
|
75
|
+
),
|
|
76
|
+
"data-hook": i,
|
|
77
|
+
"data-number": b,
|
|
61
78
|
"data-slot": "badge",
|
|
62
|
-
"data-tracking-el":
|
|
63
|
-
"data-tracking-label":
|
|
64
|
-
...
|
|
65
|
-
children:
|
|
79
|
+
"data-tracking-el": d,
|
|
80
|
+
"data-tracking-label": c,
|
|
81
|
+
...u,
|
|
82
|
+
children: o ? /* @__PURE__ */ g(m, { children: [
|
|
83
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: "contents", children: t }),
|
|
84
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: r })
|
|
85
|
+
] }) : t
|
|
66
86
|
}
|
|
67
87
|
);
|
|
68
88
|
}
|
|
69
89
|
);
|
|
70
|
-
|
|
90
|
+
k.displayName = "Badge";
|
|
71
91
|
export {
|
|
72
|
-
|
|
92
|
+
k as Badge
|
|
73
93
|
};
|
package/dist/banner.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),R=require("react"),I=require("class-variance-authority"),O=require("@brightlocal/icons"),q=require("@brightlocal/ui-components/button"),i=require("@brightlocal/ui-components/lib/utils");function D(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const s=D(R),x=I.cva("relative flex w-full flex-col gap-3 rounded-xl p-4 md:flex-row md:items-center md:gap-5 md:pl-5",{variants:{variant:{sky:"bg-highlight-sky text-highlight-sky-foreground",violet:"bg-highlight-violet text-highlight-violet-foreground"},dismissible:{true:"pr-12 md:pr-14",false:""}},defaultVariants:{variant:"sky",dismissible:!1}}),M={sky:"text-highlight-sky-muted-foreground",violet:"text-highlight-violet-muted-foreground"},S={sky:"text-highlight-sky-foreground hover:bg-highlight-sky-foreground/10",violet:"text-highlight-violet-foreground hover:bg-highlight-violet-foreground/10"},h=s.createContext({variant:"sky",titleId:"",registerTitle:()=>()=>{}}),p=s.forwardRef(({className:t,variant:e="sky",onDismiss:n,dismissLabel:a,dataHook:o,trackingEl:c,trackingLabel:l,children:d,...N},w)=>{const u=s.useId(),[C,f]=s.useState(0),m=s.useCallback(()=>(f(g=>g+1),()=>f(g=>g-1)),[]),T=s.useMemo(()=>({variant:e,titleId:u,registerTitle:m}),[e,u,m]),b=n!=null;return r.jsx(h.Provider,{value:T,children:r.jsxs("section",{ref:w,"aria-labelledby":C>0?u:void 0,className:i.cn(x({variant:e,dismissible:b}),t),"data-hook":o,"data-slot":"banner","data-tracking-el":c||`banner-${e}`,"data-tracking-label":l,...N,children:[d,b&&r.jsxs(q.Button,{iconOnly:!0,className:i.cn("absolute top-2 right-2",S[e]),dataHook:`${o}-dismiss`,variant:"ghost",onClick:n,children:[r.jsx(O.X,{}),r.jsx("span",{className:"sr-only",children:a??"Dismiss"})]})]})})});p.displayName="Banner";const y=s.forwardRef(({className:t,dataHook:e,...n},a)=>r.jsx("div",{ref:a,"aria-hidden":"true",className:i.cn("flex size-14 shrink-0 md:size-16 [&>svg]:size-full",t),"data-hook":e,"data-slot":"banner-illustration",...n}));y.displayName="BannerIllustration";const k=s.forwardRef(({className:t,dataHook:e,...n},a)=>r.jsx("div",{ref:a,className:i.cn("flex min-w-0 flex-1 flex-col gap-1",t),"data-hook":e,"data-slot":"banner-content",...n}));k.displayName="BannerContent";const v=s.forwardRef(({className:t,level:e,dataHook:n,...a},o)=>{const{titleId:c,registerTitle:l}=s.useContext(h);s.useLayoutEffect(()=>l(),[l]);const d=e?`h${e}`:"div";return r.jsx(d,{ref:o,className:i.cn("text-heading-subsection break-words",t),"data-hook":n,"data-slot":"banner-title",id:c,...a})});v.displayName="BannerTitle";const B=s.forwardRef(({className:t,dataHook:e,...n},a)=>{const{variant:o}=s.useContext(h);return r.jsx("div",{ref:a,className:i.cn("text-body-sm break-words",M[o],t),"data-hook":e,"data-slot":"banner-description",...n})});B.displayName="BannerDescription";const j=s.forwardRef(({className:t,dataHook:e,...n},a)=>r.jsx("div",{ref:a,className:i.cn("flex shrink-0 flex-wrap items-center gap-2",t),"data-hook":e,"data-slot":"banner-actions",...n}));j.displayName="BannerActions";exports.Banner=p;exports.BannerActions=j;exports.BannerContent=k;exports.BannerDescription=B;exports.BannerIllustration=y;exports.BannerTitle=v;exports.bannerVariants=x;
|
package/dist/banner.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Highlight surface the banner sits on — one per `highlight-*` token role */
|
|
3
|
+
type BannerVariant = "sky" | "violet";
|
|
4
|
+
/** Document outline level for the banner title */
|
|
5
|
+
type BannerTitleLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
declare const bannerVariants: (props?: ({
|
|
7
|
+
variant?: "violet" | "sky" | null | undefined;
|
|
8
|
+
dismissible?: boolean | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
/** Props for the Banner root */
|
|
11
|
+
interface BannerProps extends React.ComponentPropsWithoutRef<"section"> {
|
|
12
|
+
/** Required test hook identifier */
|
|
13
|
+
dataHook: string;
|
|
14
|
+
/**
|
|
15
|
+
* Highlight surface. Sky is the default; violet is the alternative when
|
|
16
|
+
* two banners must read as different invitations.
|
|
17
|
+
* @default "sky"
|
|
18
|
+
*/
|
|
19
|
+
variant?: BannerVariant;
|
|
20
|
+
/**
|
|
21
|
+
* Called when the close button is pressed. The close button renders only
|
|
22
|
+
* when this is set; the consumer decides where the dismissal is remembered.
|
|
23
|
+
*/
|
|
24
|
+
onDismiss?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Accessible label for the close button.
|
|
27
|
+
* @default "Dismiss"
|
|
28
|
+
*/
|
|
29
|
+
dismissLabel?: string;
|
|
30
|
+
/** Analytics element identifier */
|
|
31
|
+
trackingEl?: string;
|
|
32
|
+
/** Analytics label */
|
|
33
|
+
trackingLabel?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Branded, dismissible banner that invites the user to do something optional
|
|
37
|
+
* — an invitation, not a fault. Use an Alert when something happened.
|
|
38
|
+
*
|
|
39
|
+
* Compose it from `BannerIllustration`, `BannerContent` (with `BannerTitle`
|
|
40
|
+
* and `BannerDescription`) and `BannerActions`. The root owns the surface,
|
|
41
|
+
* the layout and the close button.
|
|
42
|
+
*/
|
|
43
|
+
declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLElement>>;
|
|
44
|
+
/** Shared props for the Banner parts */
|
|
45
|
+
interface BannerPartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
46
|
+
/** Test hook identifier */
|
|
47
|
+
dataHook?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Decorative illustration from `@brightlocal/illustrations`, sized by the
|
|
51
|
+
* banner (56px, 64px from `md`). Hidden from assistive technologies. Leave
|
|
52
|
+
* the illustration's `variant` unset so it follows light/dark mode.
|
|
53
|
+
*/
|
|
54
|
+
declare const BannerIllustration: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* The text column — takes the remaining width. Holds `BannerTitle` and
|
|
57
|
+
* `BannerDescription`, plus anything else the composition needs.
|
|
58
|
+
*/
|
|
59
|
+
declare const BannerContent: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
/** Props for BannerTitle */
|
|
61
|
+
interface BannerTitleProps extends Omit<BannerPartProps, "id"> {
|
|
62
|
+
/**
|
|
63
|
+
* Document outline level — renders the title as the corresponding heading
|
|
64
|
+
* element (`h1`–`h6`). With no `level` the title renders a `div`; it still
|
|
65
|
+
* names the banner region either way.
|
|
66
|
+
* @example <BannerTitle level={2}>Connect Facebook</BannerTitle>
|
|
67
|
+
*/
|
|
68
|
+
level?: BannerTitleLevel;
|
|
69
|
+
}
|
|
70
|
+
/** Heading — what the user is being invited to do. Names the banner region. */
|
|
71
|
+
declare const BannerTitle: React.ForwardRefExoticComponent<BannerTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
72
|
+
/** One or two lines of supporting copy, in the surface's muted text role */
|
|
73
|
+
declare const BannerDescription: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
/**
|
|
75
|
+
* The action(s) — usually one outline `sm` Button. Sits on the right from
|
|
76
|
+
* `md`, under the text on phones.
|
|
77
|
+
*/
|
|
78
|
+
declare const BannerActions: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
79
|
+
export { Banner, BannerIllustration, BannerContent, BannerTitle, BannerDescription, BannerActions, bannerVariants, };
|
|
80
|
+
export type { BannerProps, BannerPartProps, BannerTitleProps, BannerVariant, BannerTitleLevel, };
|
|
81
|
+
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../src/components/banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,8EAA8E;AAC9E,KAAK,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEtC,kDAAkD;AAClD,KAAK,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAK9C,QAAA,MAAM,cAAc;;;8EAmBnB,CAAC;AA2BF,gCAAgC;AAChC,UAAU,WAAY,SAAQ,KAAK,CAAC,wBAAwB,CAAC,SAAS,CAAC;IACrE,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,QAAA,MAAM,MAAM,iFAyDX,CAAC;AAGF,wCAAwC;AACxC,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,wFAcvB,CAAC;AAGF;;;GAGG;AACH,QAAA,MAAM,aAAa,wFAUlB,CAAC;AAGF,4BAA4B;AAC5B,UAAU,gBAAiB,SAAQ,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC;IAC5D;;;;;OAKG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,+EAA+E;AAC/E,QAAA,MAAM,WAAW,6FAiBhB,CAAC;AAGF,4EAA4E;AAC5E,QAAA,MAAM,iBAAiB,wFAkBtB,CAAC;AAGF;;;GAGG;AACH,QAAA,MAAM,aAAa,wFAUlB,CAAC;AAGF,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,CAAC;AACF,YAAY,EACV,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,CAAC"}
|
package/dist/banner.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { jsx as r, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { cva as B } from "class-variance-authority";
|
|
4
|
+
import { X as N } from "@brightlocal/icons";
|
|
5
|
+
import { Button as w } from "@brightlocal/ui-components/button";
|
|
6
|
+
import { cn as s } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
+
const C = B(
|
|
8
|
+
"relative flex w-full flex-col gap-3 rounded-xl p-4 md:flex-row md:items-center md:gap-5 md:pl-5",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
sky: "bg-highlight-sky text-highlight-sky-foreground",
|
|
13
|
+
violet: "bg-highlight-violet text-highlight-violet-foreground"
|
|
14
|
+
},
|
|
15
|
+
dismissible: {
|
|
16
|
+
// Keep the content clear of the absolutely positioned close button.
|
|
17
|
+
true: "pr-12 md:pr-14",
|
|
18
|
+
false: ""
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "sky",
|
|
23
|
+
dismissible: !1
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
), R = {
|
|
27
|
+
sky: "text-highlight-sky-muted-foreground",
|
|
28
|
+
violet: "text-highlight-violet-muted-foreground"
|
|
29
|
+
}, T = {
|
|
30
|
+
sky: "text-highlight-sky-foreground hover:bg-highlight-sky-foreground/10",
|
|
31
|
+
violet: "text-highlight-violet-foreground hover:bg-highlight-violet-foreground/10"
|
|
32
|
+
}, m = e.createContext({
|
|
33
|
+
variant: "sky",
|
|
34
|
+
titleId: "",
|
|
35
|
+
registerTitle: () => () => {
|
|
36
|
+
}
|
|
37
|
+
}), I = e.forwardRef(
|
|
38
|
+
({
|
|
39
|
+
className: o,
|
|
40
|
+
variant: t = "sky",
|
|
41
|
+
onDismiss: a,
|
|
42
|
+
dismissLabel: n,
|
|
43
|
+
dataHook: i,
|
|
44
|
+
trackingEl: d,
|
|
45
|
+
trackingLabel: l,
|
|
46
|
+
children: c,
|
|
47
|
+
...k
|
|
48
|
+
}, b) => {
|
|
49
|
+
const h = e.useId(), [v, f] = e.useState(0), u = e.useCallback(() => (f((g) => g + 1), () => f((g) => g - 1)), []), y = e.useMemo(
|
|
50
|
+
() => ({ variant: t, titleId: h, registerTitle: u }),
|
|
51
|
+
[t, h, u]
|
|
52
|
+
), p = a != null;
|
|
53
|
+
return /* @__PURE__ */ r(m.Provider, { value: y, children: /* @__PURE__ */ x(
|
|
54
|
+
"section",
|
|
55
|
+
{
|
|
56
|
+
ref: b,
|
|
57
|
+
"aria-labelledby": v > 0 ? h : void 0,
|
|
58
|
+
className: s(C({ variant: t, dismissible: p }), o),
|
|
59
|
+
"data-hook": i,
|
|
60
|
+
"data-slot": "banner",
|
|
61
|
+
"data-tracking-el": d || `banner-${t}`,
|
|
62
|
+
"data-tracking-label": l,
|
|
63
|
+
...k,
|
|
64
|
+
children: [
|
|
65
|
+
c,
|
|
66
|
+
p && /* @__PURE__ */ x(
|
|
67
|
+
w,
|
|
68
|
+
{
|
|
69
|
+
iconOnly: !0,
|
|
70
|
+
className: s("absolute top-2 right-2", T[t]),
|
|
71
|
+
dataHook: `${i}-dismiss`,
|
|
72
|
+
variant: "ghost",
|
|
73
|
+
onClick: a,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ r(N, {}),
|
|
76
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: n ?? "Dismiss" })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
) });
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
I.displayName = "Banner";
|
|
86
|
+
const z = e.forwardRef(
|
|
87
|
+
({ className: o, dataHook: t, ...a }, n) => /* @__PURE__ */ r(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
ref: n,
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
className: s(
|
|
93
|
+
"flex size-14 shrink-0 md:size-16 [&>svg]:size-full",
|
|
94
|
+
o
|
|
95
|
+
),
|
|
96
|
+
"data-hook": t,
|
|
97
|
+
"data-slot": "banner-illustration",
|
|
98
|
+
...a
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
z.displayName = "BannerIllustration";
|
|
103
|
+
const M = e.forwardRef(
|
|
104
|
+
({ className: o, dataHook: t, ...a }, n) => /* @__PURE__ */ r(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
ref: n,
|
|
108
|
+
className: s("flex min-w-0 flex-1 flex-col gap-1", o),
|
|
109
|
+
"data-hook": t,
|
|
110
|
+
"data-slot": "banner-content",
|
|
111
|
+
...a
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
M.displayName = "BannerContent";
|
|
116
|
+
const $ = e.forwardRef(
|
|
117
|
+
({ className: o, level: t, dataHook: a, ...n }, i) => {
|
|
118
|
+
const { titleId: d, registerTitle: l } = e.useContext(m);
|
|
119
|
+
e.useLayoutEffect(() => l(), [l]);
|
|
120
|
+
const c = t ? `h${t}` : "div";
|
|
121
|
+
return /* @__PURE__ */ r(
|
|
122
|
+
c,
|
|
123
|
+
{
|
|
124
|
+
ref: i,
|
|
125
|
+
className: s("text-heading-subsection break-words", o),
|
|
126
|
+
"data-hook": a,
|
|
127
|
+
"data-slot": "banner-title",
|
|
128
|
+
id: d,
|
|
129
|
+
...n
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
$.displayName = "BannerTitle";
|
|
135
|
+
const j = e.forwardRef(
|
|
136
|
+
({ className: o, dataHook: t, ...a }, n) => {
|
|
137
|
+
const { variant: i } = e.useContext(m);
|
|
138
|
+
return /* @__PURE__ */ r(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
ref: n,
|
|
142
|
+
className: s(
|
|
143
|
+
"text-body-sm break-words",
|
|
144
|
+
R[i],
|
|
145
|
+
o
|
|
146
|
+
),
|
|
147
|
+
"data-hook": t,
|
|
148
|
+
"data-slot": "banner-description",
|
|
149
|
+
...a
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
j.displayName = "BannerDescription";
|
|
155
|
+
const A = e.forwardRef(
|
|
156
|
+
({ className: o, dataHook: t, ...a }, n) => /* @__PURE__ */ r(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
ref: n,
|
|
160
|
+
className: s("flex shrink-0 flex-wrap items-center gap-2", o),
|
|
161
|
+
"data-hook": t,
|
|
162
|
+
"data-slot": "banner-actions",
|
|
163
|
+
...a
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
);
|
|
167
|
+
A.displayName = "BannerActions";
|
|
168
|
+
export {
|
|
169
|
+
I as Banner,
|
|
170
|
+
A as BannerActions,
|
|
171
|
+
M as BannerContent,
|
|
172
|
+
j as BannerDescription,
|
|
173
|
+
z as BannerIllustration,
|
|
174
|
+
$ as BannerTitle,
|
|
175
|
+
C as bannerVariants
|
|
176
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),S=require("react"),r=require("@brightlocal/ui-components/lib/utils"),T=require("../typography-heading.cjs"),I=require("../typography-text.cjs"),b=require("../lib/block-illustration.cjs"),_=require("../lib/empty-chip.cjs");function L(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const e=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(c,l,e.get?e:{enumerable:!0,get:()=>t[l]})}}return c.default=t,Object.freeze(c)}const o=L(S),O={md:"subsection",lg:"section"},q={lg:2,md:3},j=o.forwardRef((t,c)=>{const{className:l,dataHook:e,title:k,description:m,children:g,titleLevel:N,trackingEl:p,trackingLabel:u,size:n="md",...v}=t,y=t.icon,f=t.illustration,s=n==="lg"?"center":t.align??"center",i=v;delete i.icon,delete i.illustration,delete i.align;const E=o.Children.toArray(g).flatMap(d=>o.isValidElement(d)&&d.type===o.Fragment?o.Children.toArray(d.props.children):[d]).length>0,x=n==="lg"&&f?a.jsx(b.BlockIllustration,{size:b.BLOCK_ILLUSTRATION_SIZE,slot:"empty-state-illustration",children:f}):y?a.jsx("span",{"aria-hidden":"true",className:r.cn(_.emptyChipStyles({align:s}),n==="md"&&s==="center"&&"mb-1"),"data-hook":`${e}-icon`,"data-slot":"empty-state-icon",children:y}):null,h=a.jsxs("div",{className:r.cn("flex flex-col gap-2",s==="center"&&"w-full items-center"),"data-slot":"empty-state-content",children:[a.jsx(T.TypographyHeading,{align:s==="center"?"center":"left",className:n==="lg"?"max-w-lg":void 0,"data-slot":"empty-state-title",dataHook:`${e}-title`,level:N??q[n],variant:O[n],children:k}),m?a.jsx(I.TypographyText,{align:s==="center"?"center":"left",className:"max-w-md",color:"muted","data-slot":"empty-state-description",dataHook:`${e}-message`,variant:"body-sm",children:m}):null,E?a.jsx("div",{className:r.cn("mt-2 flex items-center gap-4",s==="center"&&"justify-center"),"data-slot":"empty-state-actions",children:g}):null]});return n==="lg"?a.jsxs("div",{ref:c,className:r.cn("flex w-full flex-col items-center gap-6",l),"data-hook":e,"data-size":"lg","data-slot":"empty-state","data-tracking-el":p??"empty-state","data-tracking-label":u,...i,children:[x,h]}):a.jsxs("div",{ref:c,className:r.cn(s==="left"?"flex items-start gap-4 text-left":"flex flex-col items-center gap-2 text-center",l),"data-hook":e,"data-size":"md","data-slot":"empty-state","data-tracking-el":p??"empty-state","data-tracking-label":u,...i,children:[x,h]})});j.displayName="EmptyState";exports.EmptyState=j;
|
|
@@ -27,7 +27,8 @@ interface EmptyStateBaseProps extends Omit<React.ComponentPropsWithoutRef<"div">
|
|
|
27
27
|
dataHook: string;
|
|
28
28
|
/**
|
|
29
29
|
* What is missing, as a real heading. Name the thing, not the condition:
|
|
30
|
-
* "No locations yet", never "Empty".
|
|
30
|
+
* "No locations yet", never "Empty". Keep it short — at size lg it wraps
|
|
31
|
+
* at 32rem; the explanation belongs in `description`.
|
|
31
32
|
*/
|
|
32
33
|
title: React.ReactNode;
|
|
33
34
|
/**
|
|
@@ -97,7 +98,7 @@ interface EmptyStateLgProps extends EmptyStateBaseProps {
|
|
|
97
98
|
* Pass the illustration itself and do NOT set a size: the block renders it at
|
|
98
99
|
* the size the design specifies, whatever the element carries, so there is no
|
|
99
100
|
* number to get wrong per call site.
|
|
100
|
-
* @example <
|
|
101
|
+
* @example <SmallBusiness aria-hidden />
|
|
101
102
|
*/
|
|
102
103
|
illustration?: React.ReactNode;
|
|
103
104
|
/**
|
|
@@ -154,7 +155,7 @@ export type EmptyStateProps = EmptyStateMdProps | EmptyStateLgProps;
|
|
|
154
155
|
* <EmptyState
|
|
155
156
|
* dataHook="locations-empty-page"
|
|
156
157
|
* description={t("locations.empty.description")}
|
|
157
|
-
* illustration={<
|
|
158
|
+
* illustration={<SmallBusiness aria-hidden />}
|
|
158
159
|
* size="lg"
|
|
159
160
|
* title={t("locations.empty.title")}
|
|
160
161
|
* >
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/blocks/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,kCAAkC,CAAC;AA+C1C;;;GAGG;AACH,KAAK,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AAElC;;;;;;;;GAQG;AACH,KAAK,eAAe,GAAG,QAAQ,GAAG,MAAM,CAAC;AAkBzC;;GAEG;AACH,UAAU,mBAAoB,SAAQ,IAAI,CACxC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,OAAO,CACR;IACC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB
|
|
1
|
+
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/blocks/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,kCAAkC,CAAC;AA+C1C;;;GAGG;AACH,KAAK,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AAElC;;;;;;;;GAQG;AACH,KAAK,eAAe,GAAG,QAAQ,GAAG,MAAM,CAAC;AAkBzC;;GAEG;AACH,UAAU,mBAAoB,SAAQ,IAAI,CACxC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,OAAO,CACR;IACC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,UAAU,iBAAkB,SAAQ,mBAAmB;IACrD;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB;AAED;;GAEG;AACH,UAAU,iBAAkB,SAAQ,mBAAmB;IACrD,IAAI,EAAE,IAAI,CAAC;IACX;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,QAAA,MAAM,UAAU,wFAqKf,CAAC;AAIF,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -8,31 +8,31 @@ import { emptyChipStyles as b } from "../lib/empty-chip.js";
|
|
|
8
8
|
const _ = {
|
|
9
9
|
md: "subsection",
|
|
10
10
|
lg: "section"
|
|
11
|
-
},
|
|
11
|
+
}, w = {
|
|
12
12
|
// An lg block is the page's message, under the layout's own page header,
|
|
13
13
|
// which owns h1.
|
|
14
14
|
lg: 2,
|
|
15
15
|
md: 3
|
|
16
|
-
},
|
|
16
|
+
}, H = s.forwardRef(
|
|
17
17
|
(o, m) => {
|
|
18
18
|
const {
|
|
19
19
|
className: d,
|
|
20
20
|
dataHook: a,
|
|
21
|
-
title:
|
|
21
|
+
title: N,
|
|
22
22
|
description: p,
|
|
23
23
|
children: g,
|
|
24
|
-
titleLevel:
|
|
24
|
+
titleLevel: E,
|
|
25
25
|
trackingEl: f,
|
|
26
26
|
trackingLabel: y,
|
|
27
|
-
size:
|
|
27
|
+
size: t = "md",
|
|
28
28
|
...v
|
|
29
|
-
} = o, h = o.icon, u = o.illustration,
|
|
29
|
+
} = o, h = o.icon, u = o.illustration, e = t === "lg" ? "center" : o.align ?? "center", l = v;
|
|
30
30
|
delete l.icon, delete l.illustration, delete l.align;
|
|
31
31
|
const I = s.Children.toArray(g).flatMap(
|
|
32
32
|
(r) => s.isValidElement(r) && r.type === s.Fragment ? s.Children.toArray(
|
|
33
33
|
r.props.children
|
|
34
34
|
) : [r]
|
|
35
|
-
).length > 0, x =
|
|
35
|
+
).length > 0, x = t === "lg" && u ? /* @__PURE__ */ n(
|
|
36
36
|
A,
|
|
37
37
|
{
|
|
38
38
|
size: S,
|
|
@@ -44,10 +44,10 @@ const _ = {
|
|
|
44
44
|
{
|
|
45
45
|
"aria-hidden": "true",
|
|
46
46
|
className: i(
|
|
47
|
-
b({ align:
|
|
47
|
+
b({ align: e }),
|
|
48
48
|
/* The chip's 4px of extra breathing room belongs to the title
|
|
49
49
|
under it — the lg column sets its own 16px rhythm instead. */
|
|
50
|
-
|
|
50
|
+
t === "md" && e === "center" && "mb-1"
|
|
51
51
|
),
|
|
52
52
|
"data-hook": `${a}-icon`,
|
|
53
53
|
"data-slot": "empty-state-icon",
|
|
@@ -58,19 +58,20 @@ const _ = {
|
|
|
58
58
|
{
|
|
59
59
|
className: i(
|
|
60
60
|
"flex flex-col gap-2",
|
|
61
|
-
|
|
61
|
+
e === "center" && "w-full items-center"
|
|
62
62
|
),
|
|
63
63
|
"data-slot": "empty-state-content",
|
|
64
64
|
children: [
|
|
65
65
|
/* @__PURE__ */ n(
|
|
66
66
|
L,
|
|
67
67
|
{
|
|
68
|
-
align:
|
|
68
|
+
align: e === "center" ? "center" : "left",
|
|
69
|
+
className: t === "lg" ? "max-w-lg" : void 0,
|
|
69
70
|
"data-slot": "empty-state-title",
|
|
70
71
|
dataHook: `${a}-title`,
|
|
71
|
-
level:
|
|
72
|
-
variant: _[
|
|
73
|
-
children:
|
|
72
|
+
level: E ?? w[t],
|
|
73
|
+
variant: _[t],
|
|
74
|
+
children: N
|
|
74
75
|
}
|
|
75
76
|
),
|
|
76
77
|
p ? (
|
|
@@ -79,7 +80,7 @@ const _ = {
|
|
|
79
80
|
/* @__PURE__ */ n(
|
|
80
81
|
T,
|
|
81
82
|
{
|
|
82
|
-
align:
|
|
83
|
+
align: e === "center" ? "center" : "left",
|
|
83
84
|
className: "max-w-md",
|
|
84
85
|
color: "muted",
|
|
85
86
|
"data-slot": "empty-state-description",
|
|
@@ -94,7 +95,7 @@ const _ = {
|
|
|
94
95
|
{
|
|
95
96
|
className: i(
|
|
96
97
|
"mt-2 flex items-center gap-4",
|
|
97
|
-
|
|
98
|
+
e === "center" && "justify-center"
|
|
98
99
|
),
|
|
99
100
|
"data-slot": "empty-state-actions",
|
|
100
101
|
children: g
|
|
@@ -103,7 +104,7 @@ const _ = {
|
|
|
103
104
|
]
|
|
104
105
|
}
|
|
105
106
|
);
|
|
106
|
-
return
|
|
107
|
+
return t === "lg" ? /* @__PURE__ */ c(
|
|
107
108
|
"div",
|
|
108
109
|
{
|
|
109
110
|
ref: m,
|
|
@@ -124,7 +125,7 @@ const _ = {
|
|
|
124
125
|
{
|
|
125
126
|
ref: m,
|
|
126
127
|
className: i(
|
|
127
|
-
|
|
128
|
+
e === "left" ? "flex items-start gap-4 text-left" : "flex flex-col items-center gap-2 text-center",
|
|
128
129
|
d
|
|
129
130
|
),
|
|
130
131
|
"data-hook": a,
|
|
@@ -141,7 +142,7 @@ const _ = {
|
|
|
141
142
|
);
|
|
142
143
|
}
|
|
143
144
|
);
|
|
144
|
-
|
|
145
|
+
H.displayName = "EmptyState";
|
|
145
146
|
export {
|
|
146
|
-
|
|
147
|
+
H as EmptyState
|
|
147
148
|
};
|
|
@@ -24,7 +24,7 @@ export interface ProgressStateProps extends Omit<React.ComponentPropsWithoutRef<
|
|
|
24
24
|
* title's companion, not the subject of the screen: much larger and it
|
|
25
25
|
* outweighs the 24px heading under it, and the eye lands on the artwork
|
|
26
26
|
* instead of the words that say what is happening.
|
|
27
|
-
* @example <
|
|
27
|
+
* @example <MapMagnifyingGlass aria-hidden />
|
|
28
28
|
*/
|
|
29
29
|
illustration?: React.ReactNode;
|
|
30
30
|
/**
|
|
@@ -88,7 +88,7 @@ export interface ProgressStateProps extends Omit<React.ComponentPropsWithoutRef<
|
|
|
88
88
|
* // The backend reports real progress.
|
|
89
89
|
* <ProgressState
|
|
90
90
|
* dataHook="lsg-generating"
|
|
91
|
-
* illustration={<
|
|
91
|
+
* illustration={<MapMagnifyingGlass aria-hidden />}
|
|
92
92
|
* title={t("reports.building.title")}
|
|
93
93
|
* description={t("reports.building.description")}
|
|
94
94
|
* value={run.percent}
|