@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.
Files changed (235) hide show
  1. package/README.md +7 -1
  2. package/component-meta.json +749 -53
  3. package/deprecations.json +114 -4
  4. package/dist/accordion.cjs +1 -1
  5. package/dist/accordion.d.ts +36 -0
  6. package/dist/accordion.d.ts.map +1 -1
  7. package/dist/accordion.js +74 -61
  8. package/dist/alert-dialog.cjs +1 -1
  9. package/dist/alert-dialog.d.ts +32 -3
  10. package/dist/alert-dialog.d.ts.map +1 -1
  11. package/dist/alert-dialog.js +61 -58
  12. package/dist/alert.cjs +1 -1
  13. package/dist/alert.d.ts.map +1 -1
  14. package/dist/alert.js +58 -57
  15. package/dist/badge.cjs +1 -1
  16. package/dist/badge.d.ts +9 -0
  17. package/dist/badge.d.ts.map +1 -1
  18. package/dist/badge.js +50 -30
  19. package/dist/banner.cjs +1 -0
  20. package/dist/banner.d.ts +81 -0
  21. package/dist/banner.d.ts.map +1 -0
  22. package/dist/banner.js +176 -0
  23. package/dist/blocks/empty-state.cjs +1 -1
  24. package/dist/blocks/empty-state.d.ts +4 -3
  25. package/dist/blocks/empty-state.d.ts.map +1 -1
  26. package/dist/blocks/empty-state.js +50 -57
  27. package/dist/blocks/progress-state.d.ts +2 -2
  28. package/dist/blocks/sidebar.cjs +1 -1
  29. package/dist/blocks/sidebar.d.ts +17 -0
  30. package/dist/blocks/sidebar.d.ts.map +1 -1
  31. package/dist/blocks/sidebar.js +8 -2
  32. package/dist/brand-illustration-motif.d.ts +1 -1
  33. package/dist/button-group.cjs +1 -0
  34. package/dist/button-group.d.ts +36 -0
  35. package/dist/button-group.d.ts.map +1 -0
  36. package/dist/button-group.js +47 -0
  37. package/dist/button.cjs +1 -1
  38. package/dist/button.js +1 -1
  39. package/dist/card.cjs +1 -1
  40. package/dist/card.d.ts +105 -7
  41. package/dist/card.d.ts.map +1 -1
  42. package/dist/card.js +198 -101
  43. package/dist/chart.cjs +3 -3
  44. package/dist/chart.d.ts +270 -24
  45. package/dist/chart.d.ts.map +1 -1
  46. package/dist/chart.js +497 -322
  47. package/dist/checkbox.cjs +1 -1
  48. package/dist/checkbox.d.ts +1 -1
  49. package/dist/checkbox.d.ts.map +1 -1
  50. package/dist/checkbox.js +2 -1
  51. package/dist/chip.cjs +1 -1
  52. package/dist/chip.d.ts +38 -4
  53. package/dist/chip.d.ts.map +1 -1
  54. package/dist/chip.js +95 -81
  55. package/dist/combobox.cjs +1 -1
  56. package/dist/combobox.js +2 -2
  57. package/dist/command.cjs +1 -1
  58. package/dist/command.d.ts +23 -1
  59. package/dist/command.d.ts.map +1 -1
  60. package/dist/command.js +251 -225
  61. package/dist/data-table.cjs +1 -1
  62. package/dist/data-table.d.ts +201 -23
  63. package/dist/data-table.d.ts.map +1 -1
  64. package/dist/data-table.js +712 -568
  65. package/dist/date-picker.cjs +1 -1
  66. package/dist/date-picker.d.ts +13 -5
  67. package/dist/date-picker.d.ts.map +1 -1
  68. package/dist/date-picker.js +54 -53
  69. package/dist/field.cjs +1 -1
  70. package/dist/field.d.ts +8 -1
  71. package/dist/field.d.ts.map +1 -1
  72. package/dist/field.js +79 -52
  73. package/dist/global-layout.cjs +1 -1
  74. package/dist/global-layout.d.ts +105 -13
  75. package/dist/global-layout.d.ts.map +1 -1
  76. package/dist/global-layout.js +146 -129
  77. package/dist/grid.d.ts +26 -3
  78. package/dist/grid.d.ts.map +1 -1
  79. package/dist/hooks/use-breakpoint.cjs +1 -1
  80. package/dist/hooks/use-breakpoint.d.ts +1 -1
  81. package/dist/hooks/use-breakpoint.d.ts.map +1 -1
  82. package/dist/hooks/use-breakpoint.js +1 -0
  83. package/dist/hooks/use-mobile.cjs +1 -0
  84. package/dist/hooks/use-mobile.js +8 -0
  85. package/dist/index.cjs +1 -1
  86. package/dist/index.d.ts +6 -0
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +594 -553
  89. package/dist/info-tooltip.cjs +1 -0
  90. package/dist/info-tooltip.d.ts +39 -0
  91. package/dist/info-tooltip.d.ts.map +1 -0
  92. package/dist/info-tooltip.js +41 -0
  93. package/dist/input-chip.cjs +1 -1
  94. package/dist/input-chip.js +1 -1
  95. package/dist/input-group.cjs +1 -1
  96. package/dist/input-group.d.ts +33 -2
  97. package/dist/input-group.d.ts.map +1 -1
  98. package/dist/input-group.js +167 -54
  99. package/dist/input-otp.cjs +1 -1
  100. package/dist/input-otp.js +9 -9
  101. package/dist/input-password.cjs +1 -1
  102. package/dist/input-password.d.ts +45 -15
  103. package/dist/input-password.d.ts.map +1 -1
  104. package/dist/input-password.js +31 -30
  105. package/dist/input.cjs +1 -1
  106. package/dist/input.js +10 -10
  107. package/dist/lib/block-illustration.cjs +1 -1
  108. package/dist/lib/block-illustration.d.ts +4 -1
  109. package/dist/lib/block-illustration.d.ts.map +1 -1
  110. package/dist/lib/block-illustration.js +12 -11
  111. package/dist/lib/empty-chip.cjs +1 -0
  112. package/dist/lib/empty-chip.d.ts +4 -0
  113. package/dist/lib/empty-chip.d.ts.map +1 -0
  114. package/dist/lib/empty-chip.js +13 -0
  115. package/dist/lib/utils.cjs +1 -1
  116. package/dist/lib/utils.d.ts.map +1 -1
  117. package/dist/lib/utils.js +4 -3
  118. package/dist/list.cjs +1 -1
  119. package/dist/list.js +1 -1
  120. package/dist/multi-select-filter.cjs +1 -0
  121. package/dist/multi-select-filter.d.ts +178 -0
  122. package/dist/multi-select-filter.d.ts.map +1 -0
  123. package/dist/multi-select-filter.js +463 -0
  124. package/dist/pagination.cjs +1 -1
  125. package/dist/pagination.d.ts +3 -0
  126. package/dist/pagination.d.ts.map +1 -1
  127. package/dist/pagination.js +57 -57
  128. package/dist/progress.cjs +1 -1
  129. package/dist/progress.d.ts +123 -16
  130. package/dist/progress.d.ts.map +1 -1
  131. package/dist/progress.js +89 -75
  132. package/dist/rating.cjs +1 -1
  133. package/dist/rating.js +18 -18
  134. package/dist/relative-date.cjs +1 -0
  135. package/dist/relative-date.d.ts +65 -0
  136. package/dist/relative-date.d.ts.map +1 -0
  137. package/dist/relative-date.js +128 -0
  138. package/dist/scroll-area.cjs +1 -1
  139. package/dist/scroll-area.d.ts +15 -6
  140. package/dist/scroll-area.d.ts.map +1 -1
  141. package/dist/scroll-area.js +38 -36
  142. package/dist/select.cjs +2 -2
  143. package/dist/select.d.ts +24 -3
  144. package/dist/select.d.ts.map +1 -1
  145. package/dist/select.js +130 -110
  146. package/dist/sheet.cjs +1 -1
  147. package/dist/sheet.d.ts +78 -2
  148. package/dist/sheet.d.ts.map +1 -1
  149. package/dist/sheet.js +192 -85
  150. package/dist/single-select-filter.cjs +1 -0
  151. package/dist/single-select-filter.d.ts +81 -0
  152. package/dist/single-select-filter.d.ts.map +1 -0
  153. package/dist/single-select-filter.js +226 -0
  154. package/dist/sonner.cjs +1 -1
  155. package/dist/sonner.d.ts.map +1 -1
  156. package/dist/sonner.js +22 -22
  157. package/dist/split-layout.cjs +1 -1
  158. package/dist/split-layout.d.ts +1 -1
  159. package/dist/split-layout.js +13 -13
  160. package/dist/table.cjs +1 -1
  161. package/dist/table.d.ts +45 -4
  162. package/dist/table.d.ts.map +1 -1
  163. package/dist/table.js +90 -73
  164. package/dist/tabs.cjs +1 -1
  165. package/dist/tabs.d.ts +12 -1
  166. package/dist/tabs.d.ts.map +1 -1
  167. package/dist/tabs.js +148 -126
  168. package/dist/textarea.cjs +1 -1
  169. package/dist/textarea.js +1 -1
  170. package/dist/tooltip.cjs +1 -1
  171. package/dist/tooltip.d.ts +38 -36
  172. package/dist/tooltip.d.ts.map +1 -1
  173. package/dist/tooltip.js +262 -73
  174. package/dist/typography-heading.cjs +1 -1
  175. package/dist/typography-heading.d.ts +13 -0
  176. package/dist/typography-heading.d.ts.map +1 -1
  177. package/dist/typography-heading.js +32 -21
  178. package/dist/typography-text.cjs +1 -1
  179. package/dist/typography-text.d.ts +15 -2
  180. package/dist/typography-text.d.ts.map +1 -1
  181. package/dist/typography-text.js +35 -24
  182. package/dist/typography.d.ts +1 -1
  183. package/package.json +5 -6
  184. package/src/blocks/empty-state.tsx +17 -24
  185. package/src/blocks/progress-state.tsx +2 -2
  186. package/src/blocks/sidebar.tsx +26 -2
  187. package/src/components/accordion.tsx +82 -27
  188. package/src/components/alert-dialog.tsx +50 -5
  189. package/src/components/alert.tsx +16 -8
  190. package/src/components/badge.tsx +40 -3
  191. package/src/components/banner.tsx +288 -0
  192. package/src/components/brand-illustration-motif.tsx +1 -1
  193. package/src/components/button-group.tsx +112 -0
  194. package/src/components/button.tsx +1 -1
  195. package/src/components/card.tsx +249 -27
  196. package/src/components/chart.tsx +586 -53
  197. package/src/components/checkbox.tsx +1 -1
  198. package/src/components/chip.tsx +83 -10
  199. package/src/components/combobox.tsx +2 -2
  200. package/src/components/command.tsx +56 -4
  201. package/src/components/data-table.tsx +842 -199
  202. package/src/components/date-picker.tsx +18 -7
  203. package/src/components/field.tsx +81 -12
  204. package/src/components/global-layout.tsx +176 -38
  205. package/src/components/grid.tsx +34 -3
  206. package/src/components/info-tooltip.tsx +94 -0
  207. package/src/components/input-chip.tsx +1 -1
  208. package/src/components/input-group.tsx +246 -11
  209. package/src/components/input-otp.tsx +1 -1
  210. package/src/components/input-password.tsx +56 -22
  211. package/src/components/input.tsx +1 -1
  212. package/src/components/list.tsx +1 -1
  213. package/src/components/multi-select-filter.tsx +912 -0
  214. package/src/components/pagination.tsx +10 -3
  215. package/src/components/progress.tsx +190 -31
  216. package/src/components/rating.tsx +1 -1
  217. package/src/components/relative-date.tsx +230 -0
  218. package/src/components/scroll-area.tsx +23 -10
  219. package/src/components/select.tsx +65 -11
  220. package/src/components/sheet.tsx +240 -4
  221. package/src/components/single-select-filter.tsx +443 -0
  222. package/src/components/sonner.tsx +16 -5
  223. package/src/components/split-layout.tsx +2 -2
  224. package/src/components/table.tsx +71 -11
  225. package/src/components/tabs.tsx +93 -46
  226. package/src/components/textarea.tsx +1 -1
  227. package/src/components/tooltip.tsx +440 -68
  228. package/src/components/typography-heading.tsx +24 -0
  229. package/src/components/typography-text.tsx +27 -3
  230. package/src/components/typography.tsx +1 -1
  231. package/src/hooks/use-breakpoint.ts +2 -1
  232. package/src/index.ts +6 -0
  233. package/src/lib/block-illustration.tsx +5 -1
  234. package/src/lib/empty-chip.ts +24 -0
  235. package/src/lib/utils.ts +1 -0
@@ -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":"","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,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"),T=require("class-variance-authority"),i=require("@brightlocal/ui-components/lib/utils"),I=require("../typography-heading.cjs"),_=require("../typography-text.cjs"),j=require("../lib/block-illustration.cjs");function A(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const e=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(s,n,e.get?e:{enumerable:!0,get:()=>t[n]})}}return s.default=t,Object.freeze(s)}const o=A(S),L={md:"section",lg:"page"},O={lg:2,md:3},q=T.cva("bg-muted text-muted-foreground flex size-10 items-center justify-center rounded-full",{variants:{align:{center:"",left:"shrink-0"}},defaultVariants:{align:"center"}}),k=o.forwardRef((t,s)=>{const{className:n,dataHook:e,title:b,description:m,children:u,titleLevel:v,trackingEl:g,trackingLabel:p,size:r="md",...E}=t,y=t.icon,f=t.illustration,l=r==="lg"?"center":t.align??"center",c=E;delete c.icon,delete c.illustration,delete c.align;const N=o.Children.toArray(u).flatMap(d=>o.isValidElement(d)&&d.type===o.Fragment?o.Children.toArray(d.props.children):[d]).length>0,x=r==="lg"&&f?a.jsx(j.BlockIllustration,{size:j.BLOCK_ILLUSTRATION_SIZE,slot:"empty-state-illustration",children:f}):y?a.jsx("span",{"aria-hidden":"true",className:i.cn(q({align:l}),r==="md"&&l==="center"&&"mb-1"),"data-hook":`${e}-icon`,"data-slot":"empty-state-icon",children:y}):null,h=a.jsxs("div",{className:i.cn("flex flex-col gap-2",l==="center"&&"w-full items-center"),"data-slot":"empty-state-content",children:[a.jsx(I.TypographyHeading,{align:l==="center"?"center":"left","data-slot":"empty-state-title",dataHook:`${e}-title`,level:v??O[r],variant:L[r],children:b}),m?a.jsx(_.TypographyText,{align:l==="center"?"center":"left",className:"max-w-md",color:"muted","data-slot":"empty-state-description",dataHook:`${e}-message`,variant:"body-sm",children:m}):null,N?a.jsx("div",{className:i.cn("mt-2 flex items-center gap-4",l==="center"&&"justify-center"),"data-slot":"empty-state-actions",children:u}):null]});return r==="lg"?a.jsxs("div",{ref:s,className:i.cn("flex w-full flex-col items-center gap-6",n),"data-hook":e,"data-size":"lg","data-slot":"empty-state","data-tracking-el":g??"empty-state","data-tracking-label":p,...c,children:[x,h]}):a.jsxs("div",{ref:s,className:i.cn(l==="left"?"flex items-start gap-4 text-left":"flex flex-col items-center gap-2 text-center",n),"data-hook":e,"data-size":"md","data-slot":"empty-state","data-tracking-el":g??"empty-state","data-tracking-label":p,...c,children:[x,h]})});k.displayName="EmptyState";exports.EmptyState=k;
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 <BusinessLocation aria-hidden />
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={<BusinessLocation aria-hidden />}
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":"","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,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 i from "react";
3
- import { cva as L } from "class-variance-authority";
4
- import { cn as s } from "@brightlocal/ui-components/lib/utils";
5
- import { TypographyHeading as T } from "../typography-heading.js";
6
- import { TypographyText as A } from "../typography-text.js";
7
- import { BlockIllustration as S, BLOCK_ILLUSTRATION_SIZE as b } from "../lib/block-illustration.js";
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: "section",
10
- lg: "page"
11
- }, z = {
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 = L(
17
- "bg-muted text-muted-foreground flex size-10 items-center justify-center rounded-full",
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: m,
19
+ className: d,
28
20
  dataHook: a,
29
- title: v,
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: e = "md",
36
- ...N
37
- } = r, u = r.icon, h = r.illustration, t = e === "lg" ? "center" : r.align ?? "center", l = N;
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 = i.Children.toArray(g).flatMap(
40
- (o) => i.isValidElement(o) && o.type === i.Fragment ? i.Children.toArray(
41
- o.props.children
42
- ) : [o]
43
- ).length > 0, x = e === "lg" && h ? /* @__PURE__ */ n(
44
- S,
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: b,
38
+ size: S,
47
39
  slot: "empty-state-illustration",
48
- children: h
40
+ children: u
49
41
  }
50
- ) : u ? /* @__PURE__ */ n(
42
+ ) : h ? /* @__PURE__ */ n(
51
43
  "span",
52
44
  {
53
45
  "aria-hidden": "true",
54
- className: s(
55
- H({ align: t }),
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
- e === "md" && t === "center" && "mb-1"
50
+ t === "md" && e === "center" && "mb-1"
59
51
  ),
60
52
  "data-hook": `${a}-icon`,
61
53
  "data-slot": "empty-state-icon",
62
- children: u
54
+ children: h
63
55
  }
64
56
  ) : null, k = /* @__PURE__ */ c(
65
57
  "div",
66
58
  {
67
- className: s(
59
+ className: i(
68
60
  "flex flex-col gap-2",
69
- t === "center" && "w-full items-center"
61
+ e === "center" && "w-full items-center"
70
62
  ),
71
63
  "data-slot": "empty-state-content",
72
64
  children: [
73
65
  /* @__PURE__ */ n(
74
- T,
66
+ L,
75
67
  {
76
- align: t === "center" ? "center" : "left",
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 ?? z[e],
80
- variant: _[e],
81
- children: v
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
- A,
81
+ T,
89
82
  {
90
- align: t === "center" ? "center" : "left",
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: s(
96
+ className: i(
104
97
  "mt-2 flex items-center gap-4",
105
- t === "center" && "justify-center"
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 e === "lg" ? /* @__PURE__ */ c(
107
+ return t === "lg" ? /* @__PURE__ */ c(
115
108
  "div",
116
109
  {
117
- ref: d,
118
- className: s("flex w-full flex-col items-center gap-6", m),
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: d,
134
- className: s(
135
- t === "left" ? "flex items-start gap-4 text-left" : "flex flex-col items-center gap-2 text-center",
136
- m
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
- j.displayName = "EmptyState";
145
+ H.displayName = "EmptyState";
153
146
  export {
154
- j as EmptyState
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 <MapMagnifyingGlassSearchLocation aria-hidden />
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={<MapMagnifyingGlassSearchLocation aria-hidden />}
91
+ * illustration={<MapMagnifyingGlass aria-hidden />}
92
92
  * title={t("reports.building.title")}
93
93
  * description={t("reports.building.description")}
94
94
  * value={run.percent}