@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
|
@@ -14,8 +14,7 @@ import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
|
14
14
|
* proportional; add `tabular` where metrics sit in a column or the value
|
|
15
15
|
* updates in place.
|
|
16
16
|
* - `code` — Geist Mono 400 · 16/24. IDs, keys, coordinates a user copies verbatim.
|
|
17
|
-
* Inside a sentence use
|
|
18
|
-
* (0.9em, inherits the line's height).
|
|
17
|
+
* Inside a sentence use `text-code-inline` on a `code` element instead (deprecated alias — 0.9em, inherits the line's height).
|
|
19
18
|
*
|
|
20
19
|
* There are no standalone label variants on purpose: the `text-label` /
|
|
21
20
|
* `text-label-sm` tokens are reserved for control-owning components
|
|
@@ -67,6 +66,16 @@ const typographyTextVariants = cva("", {
|
|
|
67
66
|
center: "text-center",
|
|
68
67
|
right: "text-right",
|
|
69
68
|
},
|
|
69
|
+
// Boolean on purpose (no `false` class): unlike tabular there is no
|
|
70
|
+
// inherited context to undo — either the element clips or it doesn't.
|
|
71
|
+
// `block` is load-bearing: an inline box (the default `span` for metric,
|
|
72
|
+
// `code` for code, or an inline asChild child) cannot clip — overflow
|
|
73
|
+
// does not apply to non-replaced inlines — so the variant forces a block
|
|
74
|
+
// container. A no-op on the body variants (`p` is already block) and on
|
|
75
|
+
// flex/grid items (blockified by the layout).
|
|
76
|
+
truncate: {
|
|
77
|
+
true: "block truncate",
|
|
78
|
+
},
|
|
70
79
|
},
|
|
71
80
|
defaultVariants: {
|
|
72
81
|
variant: "body",
|
|
@@ -125,6 +134,20 @@ interface TypographyTextProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
125
134
|
* @example "center"
|
|
126
135
|
*/
|
|
127
136
|
align?: TypographyTextAlign;
|
|
137
|
+
/**
|
|
138
|
+
* Clip overflowing text to a single line with an ellipsis — table cells,
|
|
139
|
+
* list rows, dropdown options; anywhere text can outgrow its container.
|
|
140
|
+
* The surrounding layout must still allow the element to shrink: inside a
|
|
141
|
+
* flex row the element (or its wrapper) needs `min-w-0`, and in a grid
|
|
142
|
+
* column `minmax(0, …)` — otherwise the box grows instead of clipping.
|
|
143
|
+
* Forces `display: block` (an inline box cannot clip), so an inline
|
|
144
|
+
* default element (`metric`'s span, `code`'s code) or an inline `asChild`
|
|
145
|
+
* child becomes a block while truncating.
|
|
146
|
+
* Single-line only by design; a multi-line clamp can follow if demand
|
|
147
|
+
* appears.
|
|
148
|
+
* @default false
|
|
149
|
+
*/
|
|
150
|
+
truncate?: boolean;
|
|
128
151
|
/**
|
|
129
152
|
* Render as a different element using Radix Slot pattern.
|
|
130
153
|
* When true, merges props onto the child element.
|
|
@@ -176,6 +199,7 @@ const TypographyText = React.forwardRef<HTMLElement, TypographyTextProps>(
|
|
|
176
199
|
color = "default",
|
|
177
200
|
tabular,
|
|
178
201
|
align,
|
|
202
|
+
truncate = false,
|
|
179
203
|
asChild = false,
|
|
180
204
|
dataHook,
|
|
181
205
|
trackingEl,
|
|
@@ -202,7 +226,7 @@ const TypographyText = React.forwardRef<HTMLElement, TypographyTextProps>(
|
|
|
202
226
|
<Comp
|
|
203
227
|
ref={ref}
|
|
204
228
|
className={cn(
|
|
205
|
-
typographyTextVariants({ variant, color, tabular, align }),
|
|
229
|
+
typographyTextVariants({ variant, color, tabular, align, truncate }),
|
|
206
230
|
className
|
|
207
231
|
)}
|
|
208
232
|
data-hook={dataHook}
|
|
@@ -431,7 +431,7 @@ interface TypographyInlineCodeProps
|
|
|
431
431
|
/**
|
|
432
432
|
* Inline code component for code snippets within text.
|
|
433
433
|
* Displays with monospace font and muted background.
|
|
434
|
-
* @deprecated Use `<code className="text-code-inline">` inside a sentence (
|
|
434
|
+
* @deprecated Use `<code className="text-code-inline">` inside a sentence (semantic type scale, DS-714).
|
|
435
435
|
*/
|
|
436
436
|
const TypographyInlineCode = React.forwardRef<
|
|
437
437
|
HTMLElement,
|
|
@@ -3,10 +3,11 @@ import * as React from "react";
|
|
|
3
3
|
/**
|
|
4
4
|
* Breakpoint name matching design token keys from `@brightlocal/tokens/breakpoints`.
|
|
5
5
|
*/
|
|
6
|
-
type Breakpoint = "sm" | "md" | "lg" | "xl" | "2xl";
|
|
6
|
+
type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
7
7
|
|
|
8
8
|
/** Fallback values when CSS variables are not available (e.g. SSR) */
|
|
9
9
|
const BREAKPOINT_FALLBACKS: Record<Breakpoint, number> = {
|
|
10
|
+
xs: 480,
|
|
10
11
|
sm: 640,
|
|
11
12
|
md: 768,
|
|
12
13
|
lg: 1024,
|
package/src/index.ts
CHANGED
|
@@ -5,9 +5,11 @@ export * from "./components/alert-dialog";
|
|
|
5
5
|
export * from "./components/aspect-ratio";
|
|
6
6
|
export * from "./components/avatar";
|
|
7
7
|
export * from "./components/badge";
|
|
8
|
+
export * from "./components/banner";
|
|
8
9
|
export * from "./components/brand-illustration-motif";
|
|
9
10
|
export * from "./components/breadcrumb";
|
|
10
11
|
export * from "./components/button";
|
|
12
|
+
export * from "./components/button-group";
|
|
11
13
|
export * from "./components/calendar";
|
|
12
14
|
export * from "./components/callout";
|
|
13
15
|
export * from "./components/card";
|
|
@@ -35,6 +37,7 @@ export * from "./components/grid";
|
|
|
35
37
|
export * from "./components/header";
|
|
36
38
|
export * from "./components/height-transition";
|
|
37
39
|
export * from "./components/hover-card";
|
|
40
|
+
export * from "./components/info-tooltip";
|
|
38
41
|
export * from "./components/input";
|
|
39
42
|
export * from "./components/input-chip";
|
|
40
43
|
export * from "./components/input-group";
|
|
@@ -47,6 +50,7 @@ export * from "./components/logo";
|
|
|
47
50
|
export * from "./components/map";
|
|
48
51
|
export * from "./components/media-empty";
|
|
49
52
|
export * from "./components/menubar";
|
|
53
|
+
export * from "./components/multi-select-filter";
|
|
50
54
|
export * from "./components/navigation-menu";
|
|
51
55
|
export * from "./components/pagination";
|
|
52
56
|
export * from "./components/input-password";
|
|
@@ -54,12 +58,14 @@ export * from "./components/popover";
|
|
|
54
58
|
export * from "./components/progress";
|
|
55
59
|
export * from "./components/radio-group";
|
|
56
60
|
export * from "./components/rating";
|
|
61
|
+
export * from "./components/relative-date";
|
|
57
62
|
export * from "./components/resizable";
|
|
58
63
|
export * from "./components/route-progress";
|
|
59
64
|
export * from "./components/scroll-area";
|
|
60
65
|
export * from "./components/select";
|
|
61
66
|
export * from "./components/separator";
|
|
62
67
|
export * from "./components/sheet";
|
|
68
|
+
export * from "./components/single-select-filter";
|
|
63
69
|
export * from "./components/skeleton";
|
|
64
70
|
export * from "./components/slider";
|
|
65
71
|
export * from "./components/sonner";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ILLUSTRATION_SIZES } from "@brightlocal/illustrations";
|
|
2
3
|
|
|
3
4
|
/* -------------------------------------------------------------------------------------------------
|
|
4
5
|
* BlockIllustration (internal)
|
|
@@ -38,8 +39,11 @@ import * as React from "react";
|
|
|
38
39
|
* The artwork is the title's companion, not the subject of the screen: much
|
|
39
40
|
* larger and it outweighs the 24px heading under it, and the eye lands on the
|
|
40
41
|
* drawing instead of the words that say what to do next.
|
|
42
|
+
*
|
|
43
|
+
* This is the `md` step of the shared illustration scale, so a consumer who
|
|
44
|
+
* places the same artwork by hand with `size="md"` gets the identical size.
|
|
41
45
|
*/
|
|
42
|
-
const BLOCK_ILLUSTRATION_SIZE =
|
|
46
|
+
const BLOCK_ILLUSTRATION_SIZE = ILLUSTRATION_SIZES.md;
|
|
43
47
|
|
|
44
48
|
/**
|
|
45
49
|
* Props for the internal BlockIllustration wrapper.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4
|
+
* Empty chip (internal)
|
|
5
|
+
*
|
|
6
|
+
* The icon chip every "nothing here" moment shares — EmptyState at card
|
|
7
|
+
* scope, and CommandEmpty / ComboboxEmpty at popover scope. 40px of
|
|
8
|
+
* `bg-muted` around a 16px glyph. It lives once so the two cannot drift: the
|
|
9
|
+
* popover form used to be hand-rolled in consumer code with these classes
|
|
10
|
+
* copied in.
|
|
11
|
+
*
|
|
12
|
+
* A canvas drops the chip — but a canvas is a different component, so there
|
|
13
|
+
* is no variant for that here.
|
|
14
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
15
|
+
|
|
16
|
+
export const emptyChipStyles = cva(
|
|
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
|
+
);
|