@brightlocal/ui-components 3.0.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 +7 -1
- package/component-meta.json +749 -53
- package/deprecations.json +114 -4
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +36 -0
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +74 -61
- 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 +50 -57
- 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/button-group.cjs +1 -0
- package/dist/button-group.d.ts +36 -0
- package/dist/button-group.d.ts.map +1 -0
- package/dist/button-group.js +47 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +105 -7
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +198 -101
- package/dist/chart.cjs +3 -3
- package/dist/chart.d.ts +270 -24
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +497 -322
- 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/chip.cjs +1 -1
- package/dist/chip.d.ts +38 -4
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +95 -81
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +2 -2
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +251 -225
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +201 -23
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +712 -568
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +13 -5
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +54 -53
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +8 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +79 -52
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +105 -13
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +146 -129
- package/dist/grid.d.ts +26 -3
- 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/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.js +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +594 -553
- 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 +45 -15
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +31 -30
- 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/empty-chip.cjs +1 -0
- package/dist/lib/empty-chip.d.ts +4 -0
- package/dist/lib/empty-chip.d.ts.map +1 -0
- package/dist/lib/empty-chip.js +13 -0
- 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/pagination.cjs +1 -1
- package/dist/pagination.d.ts +3 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +57 -57
- 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/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +15 -6
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +38 -36
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +24 -3
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +130 -110
- 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-heading.cjs +1 -1
- package/dist/typography-heading.d.ts +13 -0
- package/dist/typography-heading.d.ts.map +1 -1
- package/dist/typography-heading.js +32 -21
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +15 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +35 -24
- package/dist/typography.d.ts +1 -1
- package/package.json +5 -6
- package/src/blocks/empty-state.tsx +17 -24
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +26 -2
- package/src/components/accordion.tsx +82 -27
- 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/button-group.tsx +112 -0
- package/src/components/button.tsx +1 -1
- package/src/components/card.tsx +249 -27
- package/src/components/chart.tsx +586 -53
- package/src/components/checkbox.tsx +1 -1
- package/src/components/chip.tsx +83 -10
- package/src/components/combobox.tsx +2 -2
- package/src/components/command.tsx +56 -4
- package/src/components/data-table.tsx +842 -199
- package/src/components/date-picker.tsx +18 -7
- package/src/components/field.tsx +81 -12
- package/src/components/global-layout.tsx +176 -38
- package/src/components/grid.tsx +34 -3
- 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 +56 -22
- 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/pagination.tsx +10 -3
- 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/scroll-area.tsx +23 -10
- package/src/components/select.tsx +65 -11
- 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-heading.tsx +24 -0
- package/src/components/typography-text.tsx +27 -3
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/index.ts +6 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/empty-chip.ts +24 -0
- package/src/lib/utils.ts +1 -0
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"),S=require("react"),
|
|
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;
|
|
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"}
|
|
@@ -1,93 +1,86 @@
|
|
|
1
1
|
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { cn as i } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
import { TypographyHeading as L } from "../typography-heading.js";
|
|
5
|
+
import { TypographyText as T } from "../typography-text.js";
|
|
6
|
+
import { BlockIllustration as A, BLOCK_ILLUSTRATION_SIZE as S } from "../lib/block-illustration.js";
|
|
7
|
+
import { emptyChipStyles as b } from "../lib/empty-chip.js";
|
|
8
8
|
const _ = {
|
|
9
|
-
md: "
|
|
10
|
-
lg: "
|
|
11
|
-
},
|
|
9
|
+
md: "subsection",
|
|
10
|
+
lg: "section"
|
|
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
|
-
}, H =
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
variants: {
|
|
20
|
-
align: { center: "", left: "shrink-0" }
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: { align: "center" }
|
|
23
|
-
}
|
|
24
|
-
), j = i.forwardRef(
|
|
25
|
-
(r, d) => {
|
|
16
|
+
}, H = s.forwardRef(
|
|
17
|
+
(o, m) => {
|
|
26
18
|
const {
|
|
27
|
-
className:
|
|
19
|
+
className: d,
|
|
28
20
|
dataHook: a,
|
|
29
|
-
title:
|
|
21
|
+
title: N,
|
|
30
22
|
description: p,
|
|
31
23
|
children: g,
|
|
32
24
|
titleLevel: E,
|
|
33
25
|
trackingEl: f,
|
|
34
26
|
trackingLabel: y,
|
|
35
|
-
size:
|
|
36
|
-
...
|
|
37
|
-
} =
|
|
27
|
+
size: t = "md",
|
|
28
|
+
...v
|
|
29
|
+
} = o, h = o.icon, u = o.illustration, e = t === "lg" ? "center" : o.align ?? "center", l = v;
|
|
38
30
|
delete l.icon, delete l.illustration, delete l.align;
|
|
39
|
-
const I =
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
) : [
|
|
43
|
-
).length > 0, x =
|
|
44
|
-
|
|
31
|
+
const I = s.Children.toArray(g).flatMap(
|
|
32
|
+
(r) => s.isValidElement(r) && r.type === s.Fragment ? s.Children.toArray(
|
|
33
|
+
r.props.children
|
|
34
|
+
) : [r]
|
|
35
|
+
).length > 0, x = t === "lg" && u ? /* @__PURE__ */ n(
|
|
36
|
+
A,
|
|
45
37
|
{
|
|
46
|
-
size:
|
|
38
|
+
size: S,
|
|
47
39
|
slot: "empty-state-illustration",
|
|
48
|
-
children:
|
|
40
|
+
children: u
|
|
49
41
|
}
|
|
50
|
-
) :
|
|
42
|
+
) : h ? /* @__PURE__ */ n(
|
|
51
43
|
"span",
|
|
52
44
|
{
|
|
53
45
|
"aria-hidden": "true",
|
|
54
|
-
className:
|
|
55
|
-
|
|
46
|
+
className: i(
|
|
47
|
+
b({ align: e }),
|
|
56
48
|
/* The chip's 4px of extra breathing room belongs to the title
|
|
57
49
|
under it — the lg column sets its own 16px rhythm instead. */
|
|
58
|
-
|
|
50
|
+
t === "md" && e === "center" && "mb-1"
|
|
59
51
|
),
|
|
60
52
|
"data-hook": `${a}-icon`,
|
|
61
53
|
"data-slot": "empty-state-icon",
|
|
62
|
-
children:
|
|
54
|
+
children: h
|
|
63
55
|
}
|
|
64
56
|
) : null, k = /* @__PURE__ */ c(
|
|
65
57
|
"div",
|
|
66
58
|
{
|
|
67
|
-
className:
|
|
59
|
+
className: i(
|
|
68
60
|
"flex flex-col gap-2",
|
|
69
|
-
|
|
61
|
+
e === "center" && "w-full items-center"
|
|
70
62
|
),
|
|
71
63
|
"data-slot": "empty-state-content",
|
|
72
64
|
children: [
|
|
73
65
|
/* @__PURE__ */ n(
|
|
74
|
-
|
|
66
|
+
L,
|
|
75
67
|
{
|
|
76
|
-
align:
|
|
68
|
+
align: e === "center" ? "center" : "left",
|
|
69
|
+
className: t === "lg" ? "max-w-lg" : void 0,
|
|
77
70
|
"data-slot": "empty-state-title",
|
|
78
71
|
dataHook: `${a}-title`,
|
|
79
|
-
level: E ??
|
|
80
|
-
variant: _[
|
|
81
|
-
children:
|
|
72
|
+
level: E ?? w[t],
|
|
73
|
+
variant: _[t],
|
|
74
|
+
children: N
|
|
82
75
|
}
|
|
83
76
|
),
|
|
84
77
|
p ? (
|
|
85
78
|
/* Capped at 28rem: a single line of support reads as one thought
|
|
86
79
|
only while it stays a couple of lines long. */
|
|
87
80
|
/* @__PURE__ */ n(
|
|
88
|
-
|
|
81
|
+
T,
|
|
89
82
|
{
|
|
90
|
-
align:
|
|
83
|
+
align: e === "center" ? "center" : "left",
|
|
91
84
|
className: "max-w-md",
|
|
92
85
|
color: "muted",
|
|
93
86
|
"data-slot": "empty-state-description",
|
|
@@ -100,9 +93,9 @@ const _ = {
|
|
|
100
93
|
I ? /* @__PURE__ */ n(
|
|
101
94
|
"div",
|
|
102
95
|
{
|
|
103
|
-
className:
|
|
96
|
+
className: i(
|
|
104
97
|
"mt-2 flex items-center gap-4",
|
|
105
|
-
|
|
98
|
+
e === "center" && "justify-center"
|
|
106
99
|
),
|
|
107
100
|
"data-slot": "empty-state-actions",
|
|
108
101
|
children: g
|
|
@@ -111,11 +104,11 @@ const _ = {
|
|
|
111
104
|
]
|
|
112
105
|
}
|
|
113
106
|
);
|
|
114
|
-
return
|
|
107
|
+
return t === "lg" ? /* @__PURE__ */ c(
|
|
115
108
|
"div",
|
|
116
109
|
{
|
|
117
|
-
ref:
|
|
118
|
-
className:
|
|
110
|
+
ref: m,
|
|
111
|
+
className: i("flex w-full flex-col items-center gap-6", d),
|
|
119
112
|
"data-hook": a,
|
|
120
113
|
"data-size": "lg",
|
|
121
114
|
"data-slot": "empty-state",
|
|
@@ -130,10 +123,10 @@ const _ = {
|
|
|
130
123
|
) : /* @__PURE__ */ c(
|
|
131
124
|
"div",
|
|
132
125
|
{
|
|
133
|
-
ref:
|
|
134
|
-
className:
|
|
135
|
-
|
|
136
|
-
|
|
126
|
+
ref: m,
|
|
127
|
+
className: i(
|
|
128
|
+
e === "left" ? "flex items-start gap-4 text-left" : "flex flex-col items-center gap-2 text-center",
|
|
129
|
+
d
|
|
137
130
|
),
|
|
138
131
|
"data-hook": a,
|
|
139
132
|
"data-size": "md",
|
|
@@ -149,7 +142,7 @@ const _ = {
|
|
|
149
142
|
);
|
|
150
143
|
}
|
|
151
144
|
);
|
|
152
|
-
|
|
145
|
+
H.displayName = "EmptyState";
|
|
153
146
|
export {
|
|
154
|
-
|
|
147
|
+
H as EmptyState
|
|
155
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}
|