@brightlocal/ui-components 2.26.0 → 3.0.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 +9 -2
- package/component-meta.json +4010 -255
- package/deprecations.json +189 -2
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +2 -2
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.js +18 -18
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +11 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +31 -28
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +4 -4
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +15 -11
- package/dist/blocks/empty-state.cjs +1 -0
- package/dist/blocks/empty-state.d.ts +172 -0
- package/dist/blocks/empty-state.d.ts.map +1 -0
- package/dist/blocks/empty-state.js +155 -0
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +124 -108
- package/dist/blocks/progress-state.cjs +1 -0
- package/dist/blocks/progress-state.d.ts +121 -0
- package/dist/blocks/progress-state.d.ts.map +1 -0
- package/dist/blocks/progress-state.js +368 -0
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +297 -296
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +44 -40
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +23 -23
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +37 -38
- package/dist/callout.cjs +1 -1
- package/dist/callout.d.ts +24 -2
- package/dist/callout.d.ts.map +1 -1
- package/dist/callout.js +57 -55
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +23 -2
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +94 -91
- package/dist/chart-empty.cjs +1 -0
- package/dist/chart-empty.d.ts +59 -0
- package/dist/chart-empty.d.ts.map +1 -0
- package/dist/chart-empty.js +29 -0
- package/dist/chart.cjs +6 -6
- package/dist/chart.d.ts +6 -1
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +183 -183
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +47 -44
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +4 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +143 -141
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +74 -77
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +26 -29
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +182 -13
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +462 -314
- package/dist/description.cjs +1 -1
- package/dist/description.js +5 -5
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +20 -20
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +8 -11
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +17 -20
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +29 -25
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +58 -6
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +278 -194
- package/dist/grid.cjs +1 -0
- package/dist/grid.d.ts +56 -0
- package/dist/grid.d.ts.map +1 -0
- package/dist/grid.js +32 -0
- package/dist/header.d.ts +13 -0
- package/dist/header.d.ts.map +1 -1
- package/dist/hooks/use-delayed-pending.cjs +1 -0
- package/dist/hooks/use-delayed-pending.d.ts +34 -0
- package/dist/hooks/use-delayed-pending.d.ts.map +1 -0
- package/dist/hooks/use-delayed-pending.js +17 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.js +13 -13
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +523 -494
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +25 -25
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +9 -9
- 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.js +51 -51
- package/dist/input.cjs +1 -1
- package/dist/input.js +9 -9
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +25 -28
- package/dist/lib/block-illustration.cjs +1 -0
- package/dist/lib/block-illustration.d.ts +28 -0
- package/dist/lib/block-illustration.d.ts.map +1 -0
- package/dist/lib/block-illustration.js +21 -0
- package/dist/lib/empty-canvas.cjs +1 -0
- package/dist/lib/empty-canvas.d.ts +27 -0
- package/dist/lib/empty-canvas.d.ts.map +1 -0
- package/dist/lib/empty-canvas.js +62 -0
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.js +10 -8
- package/dist/lib/optical-center.cjs +1 -0
- package/dist/lib/optical-center.d.ts +12 -0
- package/dist/lib/optical-center.d.ts.map +1 -0
- package/dist/lib/optical-center.js +11 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +28 -5
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +8 -6
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +52 -20
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +87 -81
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts +60 -2
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +187 -164
- package/dist/media-empty.cjs +1 -0
- package/dist/media-empty.d.ts +72 -0
- package/dist/media-empty.d.ts.map +1 -0
- package/dist/media-empty.js +45 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +17 -20
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +7 -7
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +127 -1
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +189 -98
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +37 -3
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +102 -64
- package/dist/route-progress.cjs +1 -0
- package/dist/route-progress.d.ts +103 -0
- package/dist/route-progress.d.ts.map +1 -0
- package/dist/route-progress.js +106 -0
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +19 -18
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +8 -8
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +35 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +103 -66
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +38 -3
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +43 -20
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +32 -36
- package/dist/spinner.cjs +1 -0
- package/dist/spinner.d.ts +57 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/spinner.js +35 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.d.ts.map +1 -1
- package/dist/stepper.js +23 -22
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +36 -29
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-reveal-motion.d.ts +10 -0
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +11 -11
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +8 -8
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +8 -8
- package/dist/typography-heading.cjs +1 -0
- package/dist/typography-heading.d.ts +116 -0
- package/dist/typography-heading.d.ts.map +1 -0
- package/dist/typography-heading.js +84 -0
- package/dist/typography-text.cjs +1 -0
- package/dist/typography-text.d.ts +113 -0
- package/dist/typography-text.d.ts.map +1 -0
- package/dist/typography-text.js +81 -0
- package/dist/typography.d.ts +13 -0
- package/dist/typography.d.ts.map +1 -1
- package/package.json +42 -2
- package/src/blocks/empty-state.tsx +424 -0
- package/src/blocks/input-list.tsx +66 -36
- package/src/blocks/progress-state.tsx +542 -0
- package/src/blocks/sidebar.tsx +46 -40
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert-dialog.tsx +2 -2
- package/src/components/alert.tsx +27 -13
- package/src/components/avatar.tsx +1 -1
- package/src/components/badge.tsx +8 -4
- package/src/components/breadcrumb.tsx +9 -4
- package/src/components/button.tsx +5 -8
- package/src/components/calendar.tsx +5 -6
- package/src/components/callout.tsx +48 -15
- package/src/components/card.tsx +52 -17
- package/src/components/chart-empty.tsx +116 -0
- package/src/components/chart.tsx +43 -17
- package/src/components/chip.tsx +9 -6
- package/src/components/combobox.tsx +21 -12
- package/src/components/command.tsx +9 -10
- package/src/components/context-menu.tsx +6 -9
- package/src/components/data-table.tsx +405 -31
- package/src/components/description.tsx +1 -1
- package/src/components/dialog.tsx +2 -2
- package/src/components/drawer.tsx +2 -5
- package/src/components/dropdown-menu.tsx +8 -11
- package/src/components/field.tsx +8 -4
- package/src/components/global-layout.tsx +264 -65
- package/src/components/grid.tsx +130 -0
- package/src/components/header.tsx +13 -0
- package/src/components/hover-card.tsx +1 -1
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +1 -1
- package/src/components/input.tsx +1 -1
- package/src/components/label.tsx +10 -13
- package/src/components/link.tsx +39 -5
- package/src/components/list.tsx +18 -14
- package/src/components/map.tsx +101 -5
- package/src/components/media-empty.tsx +156 -0
- package/src/components/menubar.tsx +7 -10
- package/src/components/navigation-menu.tsx +1 -1
- package/src/components/pagination.tsx +279 -1
- package/src/components/progress.tsx +120 -11
- package/src/components/route-progress.tsx +354 -0
- package/src/components/select.tsx +5 -4
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +89 -7
- package/src/components/skeleton.tsx +78 -7
- package/src/components/sonner.tsx +5 -14
- package/src/components/spinner.tsx +94 -0
- package/src/components/stepper.tsx +6 -7
- package/src/components/table.tsx +11 -4
- package/src/components/tabs.tsx +1 -1
- package/src/components/text-reveal-motion.tsx +10 -0
- package/src/components/textarea.tsx +1 -1
- package/src/components/toggle.tsx +1 -1
- package/src/components/tooltip.tsx +1 -1
- package/src/components/typography-heading.tsx +229 -0
- package/src/components/typography-text.tsx +225 -0
- package/src/components/typography.tsx +13 -0
- package/src/hooks/use-delayed-pending.ts +60 -0
- package/src/index.ts +12 -0
- package/src/lib/block-illustration.tsx +88 -0
- package/src/lib/empty-canvas.tsx +128 -0
- package/src/lib/optical-center.tsx +45 -0
- package/src/lib/utils.ts +26 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Visual styles from the semantic type scale (DS-714).
|
|
4
|
+
* - `body` — Inter 500 · 16/24. The default; card copy, descriptions, input values.
|
|
5
|
+
* - `body-sm` — Inter 500 · 14/20. Table cells, dense lists, app chrome. Density, never hierarchy.
|
|
6
|
+
* - `body-xs` — Inter 500 · 12/16. Helper text, captions, timestamps; the 12px floor.
|
|
7
|
+
* - `metric` — Inter 600 · 24/28. Large numbers only: KPIs, stat cards,
|
|
8
|
+
* scores — a metric presented as the point of its card. Figures are
|
|
9
|
+
* proportional; add `tabular` where metrics sit in a column or the value
|
|
10
|
+
* updates in place.
|
|
11
|
+
* - `code` — Geist Mono 400 · 16/24. IDs, keys, coordinates a user copies verbatim.
|
|
12
|
+
* Inside a sentence use the `text-code-inline` utility on a `code` element instead
|
|
13
|
+
* (0.9em, inherits the line's height).
|
|
14
|
+
*
|
|
15
|
+
* There are no standalone label variants on purpose: the `text-label` /
|
|
16
|
+
* `text-label-sm` tokens are reserved for control-owning components
|
|
17
|
+
* (Label/Field, tabs, nav, badges, chips) to adopt in follow-up work.
|
|
18
|
+
*/
|
|
19
|
+
type TypographyTextVariant = "body" | "body-sm" | "body-xs" | "metric" | "code";
|
|
20
|
+
/**
|
|
21
|
+
* Text alignment options.
|
|
22
|
+
*/
|
|
23
|
+
type TypographyTextAlign = "left" | "center" | "right";
|
|
24
|
+
/**
|
|
25
|
+
* Color role from the scale.
|
|
26
|
+
* - `default` — regular foreground.
|
|
27
|
+
* - `muted` — de-emphasis by color only; same size and weight.
|
|
28
|
+
* - `destructive` — error/critical text; pair with an icon or wording, never
|
|
29
|
+
* color alone.
|
|
30
|
+
*/
|
|
31
|
+
type TypographyTextColor = "default" | "muted" | "destructive";
|
|
32
|
+
/**
|
|
33
|
+
* Props for the TypographyText component.
|
|
34
|
+
* Extends native element props with design system tracking attributes.
|
|
35
|
+
*/
|
|
36
|
+
interface TypographyTextProps extends React.HTMLAttributes<HTMLElement> {
|
|
37
|
+
/**
|
|
38
|
+
* Visual style from the semantic type scale. Pick the name that matches
|
|
39
|
+
* what the text is doing — never pick a size. When in doubt, it's "body".
|
|
40
|
+
* @default "body"
|
|
41
|
+
*/
|
|
42
|
+
variant?: TypographyTextVariant;
|
|
43
|
+
/**
|
|
44
|
+
* Color role: `muted` de-emphasises with color only (text-muted-foreground) —
|
|
45
|
+
* the scale never de-emphasises via lighter weight or smaller size;
|
|
46
|
+
* `destructive` is for error/critical text and must be paired with an icon
|
|
47
|
+
* or wording (color is never the only indicator).
|
|
48
|
+
* @default "default"
|
|
49
|
+
*/
|
|
50
|
+
color?: TypographyTextColor;
|
|
51
|
+
/**
|
|
52
|
+
* Tabular figures (fixed-width numerals) so columns align and live values
|
|
53
|
+
* don't jitter. Opt in with `true` for numbers outside a Table — timestamps,
|
|
54
|
+
* counters, metric columns. Inside Table/DataTable cells figures are already
|
|
55
|
+
* tabular (inherited from the Table root, DS-926) — no prop needed; pass an
|
|
56
|
+
* explicit `false` there to restore proportional figures for a prose-heavy
|
|
57
|
+
* column. When omitted, figures follow the surrounding context. Numbers
|
|
58
|
+
* only: never enable it on regular text/prose — it only affects digits, and
|
|
59
|
+
* digits inside prose should stay proportional.
|
|
60
|
+
*/
|
|
61
|
+
tabular?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Text alignment. When omitted, no alignment class is applied and
|
|
64
|
+
* text keeps the default (left) or inherited alignment.
|
|
65
|
+
* @example "center"
|
|
66
|
+
*/
|
|
67
|
+
align?: TypographyTextAlign;
|
|
68
|
+
/**
|
|
69
|
+
* Render as a different element using Radix Slot pattern.
|
|
70
|
+
* When true, merges props onto the child element.
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
asChild?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Data hook for automated testing (REQUIRED).
|
|
76
|
+
* Used to identify component in tests and E2E automation.
|
|
77
|
+
* @example "card-description", "kpi-value"
|
|
78
|
+
*/
|
|
79
|
+
dataHook: string;
|
|
80
|
+
/**
|
|
81
|
+
* Tracking element identifier for analytics.
|
|
82
|
+
* @default "typography-text-{variant}"
|
|
83
|
+
*/
|
|
84
|
+
trackingEl?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Tracking label for analytics context.
|
|
87
|
+
*/
|
|
88
|
+
trackingLabel?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Semantic text styled by the type scale (DS-714). The variant chooses
|
|
92
|
+
* family, size, line-height, weight and tracking together; the rendered
|
|
93
|
+
* element defaults per variant (p / span / code) and can be changed with
|
|
94
|
+
* `asChild` when a different tag carries the right meaning.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* <TypographyText variant="body-sm" color="muted" dataHook="card-hint">
|
|
98
|
+
* Biggest rank changes this week
|
|
99
|
+
* </TypographyText>
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* // Inline emphasis is Figma 700 — a few words inside a paragraph, never a
|
|
103
|
+
* // heading or a whole block. The `text-emphasis` utility encodes the weight
|
|
104
|
+
* // (and the Figma→Web parity offset) so nothing inline ever needs a raw
|
|
105
|
+
* // font-* class.
|
|
106
|
+
* <TypographyText dataHook="alert-body">
|
|
107
|
+
* Two locations are <strong className="text-emphasis">missing</strong> a primary category
|
|
108
|
+
* </TypographyText>
|
|
109
|
+
*/
|
|
110
|
+
declare const TypographyText: React.ForwardRefExoticComponent<TypographyTextProps & React.RefAttributes<HTMLElement>>;
|
|
111
|
+
export { TypographyText };
|
|
112
|
+
export type { TypographyTextProps, TypographyTextVariant, TypographyTextAlign, TypographyTextColor, };
|
|
113
|
+
//# sourceMappingURL=typography-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography-text.d.ts","sourceRoot":"","sources":["../../src/components/typography-text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;;;;;;;;;;;;;;GAgBG;AACH,KAAK,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEhF;;GAEG;AACH,KAAK,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEvD;;;;;;GAMG;AACH,KAAK,mBAAmB,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;AAsD/D;;;GAGG;AACH,UAAU,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACrE;;;;OAIG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,cAAc,yFA6CnB,CAAC;AAGF,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { Slot as x } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as f } from "class-variance-authority";
|
|
5
|
+
import { cn as u } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
const b = f("", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
body: "text-body",
|
|
10
|
+
"body-sm": "text-body-sm",
|
|
11
|
+
"body-xs": "text-body-xs",
|
|
12
|
+
metric: "text-metric",
|
|
13
|
+
code: "text-code"
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
default: "text-foreground",
|
|
17
|
+
muted: "text-muted-foreground",
|
|
18
|
+
// destructive-foreground is the legible error-text color in both modes
|
|
19
|
+
// (text-destructive is the surface red used behind destructive fills)
|
|
20
|
+
destructive: "text-destructive-foreground"
|
|
21
|
+
},
|
|
22
|
+
// Tri-state on purpose: `undefined` (the default) emits no class so the
|
|
23
|
+
// text inherits its context — proportional everywhere except inside a
|
|
24
|
+
// Table root, which sets `tabular-nums` (DS-926). Explicit `false` must
|
|
25
|
+
// therefore emit `proportional-nums`, or opting out inside a Table would
|
|
26
|
+
// be a silent no-op.
|
|
27
|
+
tabular: {
|
|
28
|
+
true: "tabular-nums",
|
|
29
|
+
false: "proportional-nums"
|
|
30
|
+
},
|
|
31
|
+
align: {
|
|
32
|
+
left: "text-left",
|
|
33
|
+
center: "text-center",
|
|
34
|
+
right: "text-right"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "body",
|
|
39
|
+
color: "default"
|
|
40
|
+
}
|
|
41
|
+
}), g = {
|
|
42
|
+
body: "p",
|
|
43
|
+
"body-sm": "p",
|
|
44
|
+
"body-xs": "p",
|
|
45
|
+
metric: "span",
|
|
46
|
+
code: "code"
|
|
47
|
+
}, h = i.forwardRef(
|
|
48
|
+
({
|
|
49
|
+
className: e,
|
|
50
|
+
variant: t = "body",
|
|
51
|
+
color: o = "default",
|
|
52
|
+
tabular: r,
|
|
53
|
+
align: a,
|
|
54
|
+
asChild: d = !1,
|
|
55
|
+
dataHook: s,
|
|
56
|
+
trackingEl: m,
|
|
57
|
+
trackingLabel: p,
|
|
58
|
+
...c
|
|
59
|
+
}, l) => {
|
|
60
|
+
const n = d ? x : g[t];
|
|
61
|
+
return /* @__PURE__ */ y(
|
|
62
|
+
n,
|
|
63
|
+
{
|
|
64
|
+
ref: l,
|
|
65
|
+
className: u(
|
|
66
|
+
b({ variant: t, color: o, tabular: r, align: a }),
|
|
67
|
+
e
|
|
68
|
+
),
|
|
69
|
+
"data-hook": s,
|
|
70
|
+
"data-slot": "typography-text",
|
|
71
|
+
"data-tracking-el": m || `typography-text-${t}`,
|
|
72
|
+
"data-tracking-label": p,
|
|
73
|
+
...c
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
h.displayName = "TypographyText";
|
|
79
|
+
export {
|
|
80
|
+
h as TypographyText
|
|
81
|
+
};
|
package/dist/typography.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ interface TypographyH1Props extends React.ComponentProps<"h1">, TypographyBasePr
|
|
|
52
52
|
* Main page heading component (h1).
|
|
53
53
|
* Used for the primary title on a page. Uses the display font (Poppins) with
|
|
54
54
|
* responsive sizing — 36px on mobile, 48px from the `md` breakpoint.
|
|
55
|
+
* @deprecated Use `<TypographyHeading level={1} variant="page">` (semantic type scale, DS-714). Note the scale's page title is 24px — the 48px look is `variant="display"`, reserved for brand moments.
|
|
55
56
|
*/
|
|
56
57
|
declare const TypographyH1: React.ForwardRefExoticComponent<Omit<TypographyH1Props, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
57
58
|
/**
|
|
@@ -63,6 +64,7 @@ interface TypographyH2Props extends React.ComponentProps<"h2">, TypographyBasePr
|
|
|
63
64
|
/**
|
|
64
65
|
* Section heading component (h2).
|
|
65
66
|
* Used for major section titles within a page.
|
|
67
|
+
* @deprecated Use `<TypographyHeading level={2} variant="section">` (semantic type scale, DS-714).
|
|
66
68
|
*/
|
|
67
69
|
declare const TypographyH2: React.ForwardRefExoticComponent<Omit<TypographyH2Props, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
68
70
|
/**
|
|
@@ -74,6 +76,7 @@ interface TypographyH3Props extends React.ComponentProps<"h3">, TypographyBasePr
|
|
|
74
76
|
/**
|
|
75
77
|
* Subsection heading component (h3).
|
|
76
78
|
* Used for subsections within a major section.
|
|
79
|
+
* @deprecated Use `<TypographyHeading level={3} variant="subsection">` (semantic type scale, DS-714).
|
|
77
80
|
*/
|
|
78
81
|
declare const TypographyH3: React.ForwardRefExoticComponent<Omit<TypographyH3Props, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
79
82
|
/**
|
|
@@ -85,6 +88,7 @@ interface TypographyH4Props extends React.ComponentProps<"h4">, TypographyBasePr
|
|
|
85
88
|
/**
|
|
86
89
|
* Minor heading component (h4).
|
|
87
90
|
* Used for smaller section headings and card titles.
|
|
91
|
+
* @deprecated Use `<TypographyHeading level={4} variant="subsection">` (semantic type scale, DS-714).
|
|
88
92
|
*/
|
|
89
93
|
declare const TypographyH4: React.ForwardRefExoticComponent<Omit<TypographyH4Props, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
90
94
|
/**
|
|
@@ -96,6 +100,7 @@ interface TypographyPProps extends React.ComponentProps<"p">, TypographyBaseProp
|
|
|
96
100
|
/**
|
|
97
101
|
* Paragraph text component (p).
|
|
98
102
|
* Used for body text and general content.
|
|
103
|
+
* @deprecated Use `<TypographyText>` (variant "body", semantic type scale, DS-714).
|
|
99
104
|
*/
|
|
100
105
|
declare const TypographyP: React.ForwardRefExoticComponent<Omit<TypographyPProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
101
106
|
/**
|
|
@@ -107,6 +112,7 @@ interface TypographyBlockquoteProps extends React.ComponentProps<"blockquote">,
|
|
|
107
112
|
/**
|
|
108
113
|
* Blockquote component for quoted content.
|
|
109
114
|
* Displays with a left border accent for visual distinction.
|
|
115
|
+
* @deprecated Use `<TypographyText asChild>` with a `blockquote` child (semantic type scale, DS-714); the border/quote treatment is consumer layout.
|
|
110
116
|
*/
|
|
111
117
|
declare const TypographyBlockquote: React.ForwardRefExoticComponent<Omit<TypographyBlockquoteProps, "ref"> & React.RefAttributes<HTMLQuoteElement>>;
|
|
112
118
|
/**
|
|
@@ -118,6 +124,7 @@ interface TypographyListProps extends React.ComponentProps<"ul">, TypographyBase
|
|
|
118
124
|
/**
|
|
119
125
|
* Unordered list component (ul).
|
|
120
126
|
* Used for bullet-point lists with consistent styling.
|
|
127
|
+
* @deprecated Use `<TypographyText asChild>` with a `ul` child (semantic type scale, DS-714); list markers and spacing are consumer layout.
|
|
121
128
|
*/
|
|
122
129
|
declare const TypographyList: React.ForwardRefExoticComponent<Omit<TypographyListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
123
130
|
/**
|
|
@@ -129,6 +136,7 @@ interface TypographyInlineCodeProps extends React.ComponentProps<"code">, Omit<T
|
|
|
129
136
|
/**
|
|
130
137
|
* Inline code component for code snippets within text.
|
|
131
138
|
* Displays with monospace font and muted background.
|
|
139
|
+
* @deprecated Use `<code className="text-code-inline">` inside a sentence (0.9em, inherits the line's height — semantic type scale, DS-714).
|
|
132
140
|
*/
|
|
133
141
|
declare const TypographyInlineCode: React.ForwardRefExoticComponent<Omit<TypographyInlineCodeProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
134
142
|
/**
|
|
@@ -140,6 +148,7 @@ interface TypographyCodeProps extends React.ComponentProps<"pre">, TypographyBas
|
|
|
140
148
|
/**
|
|
141
149
|
* Code block component for multi-line code snippets.
|
|
142
150
|
* Displays with dark background, monospace font, and horizontal scroll.
|
|
151
|
+
* @deprecated Use `<TypographyText variant="code">` for copyable identifiers, or a `pre` styled with `text-code` for multi-line snippets (semantic type scale, DS-714).
|
|
143
152
|
*/
|
|
144
153
|
declare const TypographyCode: React.ForwardRefExoticComponent<Omit<TypographyCodeProps, "ref"> & React.RefAttributes<HTMLPreElement>>;
|
|
145
154
|
/**
|
|
@@ -151,6 +160,7 @@ interface TypographyLeadProps extends React.ComponentProps<"p">, TypographyBaseP
|
|
|
151
160
|
/**
|
|
152
161
|
* Lead paragraph component for introductory text.
|
|
153
162
|
* Displays larger, muted text for page introductions and summaries.
|
|
163
|
+
* @deprecated Use `<TypographyText color="muted">` for an intro line (semantic type scale, DS-714).
|
|
154
164
|
*/
|
|
155
165
|
declare const TypographyLead: React.ForwardRefExoticComponent<Omit<TypographyLeadProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
156
166
|
/**
|
|
@@ -162,6 +172,7 @@ interface TypographyLargeProps extends React.ComponentProps<"div">, TypographyBa
|
|
|
162
172
|
/**
|
|
163
173
|
* Large text component for emphasized content.
|
|
164
174
|
* Displays larger, semibold text for callouts and highlights.
|
|
175
|
+
* @deprecated Use `<TypographyHeading level={n} variant="subsection">` for a small heading or `<TypographyText>` for emphasised copy (DS-714).
|
|
165
176
|
*/
|
|
166
177
|
declare const TypographyLarge: React.ForwardRefExoticComponent<Omit<TypographyLargeProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
167
178
|
/**
|
|
@@ -173,6 +184,7 @@ interface TypographySmallProps extends React.ComponentProps<"small">, Omit<Typog
|
|
|
173
184
|
/**
|
|
174
185
|
* Small text component for compact content.
|
|
175
186
|
* Used for captions, labels, and supplementary information.
|
|
187
|
+
* @deprecated Use `<TypographyText variant="body-sm">` (semantic type scale, DS-714).
|
|
176
188
|
*/
|
|
177
189
|
declare const TypographySmall: React.ForwardRefExoticComponent<Omit<TypographySmallProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
178
190
|
/**
|
|
@@ -184,6 +196,7 @@ interface TypographyMutedProps extends React.ComponentProps<"p">, TypographyBase
|
|
|
184
196
|
/**
|
|
185
197
|
* Muted text component for de-emphasized content.
|
|
186
198
|
* Displays with reduced visual prominence for secondary information.
|
|
199
|
+
* @deprecated Use `<TypographyText variant="body-sm" color="muted">` (semantic type scale, DS-714).
|
|
187
200
|
*/
|
|
188
201
|
declare const TypographyMuted: React.ForwardRefExoticComponent<Omit<TypographyMutedProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
189
202
|
export { TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyP, TypographyBlockquote, TypographyList, TypographyInlineCode, TypographyCode, TypographyLead, TypographyLarge, TypographySmall, TypographyMuted, };
|
package/dist/typography.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/components/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;GAEG;AACH,KAAK,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAYnD;;;GAGG;AACH,UAAU,mBAAmB;IAC3B;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,OAA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;;GAGG;AACH,UAAU,oBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC;CAAG;AAE9E;;;;GAIG;AACH,QAAA,MAAM,eAAe,uGAyBpB,CAAC;AAUF;;;GAGG;AACH,UAAU,oBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,mBAAmB;CAAG;AAE3D;;;;GAIG;AACH,QAAA,MAAM,eAAe,gHA6BpB,CAAC;AAMF,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,GAChB,CAAC;AAEF,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,GACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightlocal/ui-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "BrightLocal Design System UI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -61,6 +61,33 @@
|
|
|
61
61
|
"import": "./dist/lib/motion.js",
|
|
62
62
|
"require": "./dist/lib/motion.cjs"
|
|
63
63
|
},
|
|
64
|
+
"./empty-state": {
|
|
65
|
+
"source": {
|
|
66
|
+
"types": "./src/blocks/empty-state.tsx",
|
|
67
|
+
"import": "./src/blocks/empty-state.tsx"
|
|
68
|
+
},
|
|
69
|
+
"types": "./dist/blocks/empty-state.d.ts",
|
|
70
|
+
"import": "./dist/blocks/empty-state.js",
|
|
71
|
+
"require": "./dist/blocks/empty-state.cjs"
|
|
72
|
+
},
|
|
73
|
+
"./progress-state": {
|
|
74
|
+
"source": {
|
|
75
|
+
"types": "./src/blocks/progress-state.tsx",
|
|
76
|
+
"import": "./src/blocks/progress-state.tsx"
|
|
77
|
+
},
|
|
78
|
+
"types": "./dist/blocks/progress-state.d.ts",
|
|
79
|
+
"import": "./dist/blocks/progress-state.js",
|
|
80
|
+
"require": "./dist/blocks/progress-state.cjs"
|
|
81
|
+
},
|
|
82
|
+
"./progress-screen": {
|
|
83
|
+
"source": {
|
|
84
|
+
"types": "./src/blocks/progress-state.tsx",
|
|
85
|
+
"import": "./src/blocks/progress-state.tsx"
|
|
86
|
+
},
|
|
87
|
+
"types": "./dist/blocks/progress-state.d.ts",
|
|
88
|
+
"import": "./dist/blocks/progress-state.js",
|
|
89
|
+
"require": "./dist/blocks/progress-state.cjs"
|
|
90
|
+
},
|
|
64
91
|
"./input-list": {
|
|
65
92
|
"source": {
|
|
66
93
|
"types": "./src/blocks/input-list.tsx",
|
|
@@ -109,6 +136,15 @@
|
|
|
109
136
|
"lib/*": [
|
|
110
137
|
"dist/lib/*"
|
|
111
138
|
],
|
|
139
|
+
"empty-state": [
|
|
140
|
+
"dist/blocks/empty-state"
|
|
141
|
+
],
|
|
142
|
+
"progress-state": [
|
|
143
|
+
"dist/blocks/progress-state"
|
|
144
|
+
],
|
|
145
|
+
"progress-screen": [
|
|
146
|
+
"dist/blocks/progress-state"
|
|
147
|
+
],
|
|
112
148
|
"input-list": [
|
|
113
149
|
"dist/blocks/input-list"
|
|
114
150
|
],
|
|
@@ -192,7 +228,7 @@
|
|
|
192
228
|
"sonner": "^2.0.7",
|
|
193
229
|
"tailwind-merge": "^3.4.0",
|
|
194
230
|
"vaul": "^1.1.2",
|
|
195
|
-
"@brightlocal/icons": "2.
|
|
231
|
+
"@brightlocal/icons": "2.4.0",
|
|
196
232
|
"@brightlocal/illustrations": "0.6.0"
|
|
197
233
|
},
|
|
198
234
|
"size-limit": [
|
|
@@ -228,6 +264,10 @@
|
|
|
228
264
|
"token-drift:check": "node scripts/token-drift.mjs --check",
|
|
229
265
|
"token-drift:update-baseline": "node scripts/token-drift.mjs --update-baseline",
|
|
230
266
|
"token-drift:report": "node scripts/token-report.mjs",
|
|
267
|
+
"test": "node --test \"scripts/test/*.test.mjs\"",
|
|
268
|
+
"typography-drift": "node scripts/token-drift.mjs --only typography",
|
|
269
|
+
"typography-drift:check": "node scripts/token-drift.mjs --check --only typography",
|
|
270
|
+
"typography-drift:update-baseline": "node scripts/token-drift.mjs --update-baseline --only typography",
|
|
231
271
|
"build:changelog": "node scripts/generate-changelog.js",
|
|
232
272
|
"rel:patch": "node scripts/changeset-create.mjs patch",
|
|
233
273
|
"rel:minor": "node scripts/changeset-create.mjs minor",
|