@brightlocal/ui-components 2.27.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 +6 -1
- package/component-meta.json +480 -126
- 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-screen.d.ts → progress-state.d.ts} +30 -18
- package/dist/blocks/progress-state.d.ts.map +1 -0
- package/dist/blocks/{progress-screen.js → progress-state.js} +100 -71
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +160 -161
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +11 -11
- 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.map +1 -1
- package/dist/chip.js +5 -3
- package/dist/combobox.cjs +2 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +81 -79
- 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 +44 -10
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +13 -11
- 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 +27 -1
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +18 -16
- 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 +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +512 -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/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/list.cjs +1 -1
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +62 -58
- 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 +2 -26
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +79 -118
- 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.js +2 -2
- 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.js +26 -26
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +40 -40
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +31 -28
- 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 +35 -7
- package/src/blocks/empty-state.tsx +424 -0
- package/src/blocks/input-list.tsx +66 -36
- package/src/blocks/{progress-screen.tsx → progress-state.tsx} +154 -93
- package/src/blocks/sidebar.tsx +25 -26
- 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 +1 -1
- package/src/components/button.tsx +3 -3
- 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 +5 -3
- package/src/components/combobox.tsx +12 -10
- package/src/components/command.tsx +9 -10
- package/src/components/context-menu.tsx +6 -9
- package/src/components/data-table.tsx +72 -17
- 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 +36 -3
- 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/list.tsx +13 -9
- 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 +35 -113
- package/src/components/select.tsx +5 -4
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +2 -2
- package/src/components/skeleton.tsx +78 -7
- package/src/components/sonner.tsx +2 -2
- package/src/components/stepper.tsx +3 -3
- package/src/components/table.tsx +6 -3
- 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 +10 -1
- 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
- package/dist/blocks/progress-screen.cjs +0 -1
- package/dist/blocks/progress-screen.d.ts.map +0 -1
package/dist/table.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as s from "react";
|
|
3
3
|
import { cva as c } from "class-variance-authority";
|
|
4
4
|
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
5
5
|
const u = c(
|
|
6
|
-
"align-middle bg-transparent text-
|
|
6
|
+
"align-middle bg-transparent text-body-sm text-foreground break-words",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
size: {
|
|
@@ -25,7 +25,7 @@ const u = c(
|
|
|
25
25
|
), p = c(
|
|
26
26
|
// bg-muted only for column headers inside <thead> — a <TableHead
|
|
27
27
|
// scope="row"> in the body must not paint over its row's state tint.
|
|
28
|
-
"[thead_&]:bg-muted h-12 p-2 align-middle text-muted-foreground text-
|
|
28
|
+
"[thead_&]:bg-muted h-12 p-2 align-middle text-muted-foreground text-label font-semibold break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-fast ease-out",
|
|
29
29
|
{
|
|
30
30
|
variants: {
|
|
31
31
|
align: {
|
|
@@ -38,14 +38,14 @@ const u = c(
|
|
|
38
38
|
align: "left"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
),
|
|
41
|
+
), h = s.forwardRef(
|
|
42
42
|
({
|
|
43
43
|
className: a,
|
|
44
44
|
dataHook: t,
|
|
45
45
|
trackingEl: e,
|
|
46
46
|
trackingLabel: o,
|
|
47
47
|
layout: n = "auto",
|
|
48
|
-
minWidth:
|
|
48
|
+
minWidth: r,
|
|
49
49
|
scrollRegionLabel: i,
|
|
50
50
|
style: b,
|
|
51
51
|
...f
|
|
@@ -54,10 +54,10 @@ const u = c(
|
|
|
54
54
|
{
|
|
55
55
|
className: d(
|
|
56
56
|
"relative w-full overflow-x-auto",
|
|
57
|
-
|
|
57
|
+
r && "focus-visible:shadow-default rounded-md outline-none"
|
|
58
58
|
),
|
|
59
59
|
"data-slot": "table-container",
|
|
60
|
-
...
|
|
60
|
+
...r ? {
|
|
61
61
|
role: "region",
|
|
62
62
|
"aria-label": i ?? "Scrollable table",
|
|
63
63
|
tabIndex: 0
|
|
@@ -67,7 +67,10 @@ const u = c(
|
|
|
67
67
|
{
|
|
68
68
|
ref: m,
|
|
69
69
|
className: d(
|
|
70
|
-
|
|
70
|
+
// tabular-nums inherits into every cell (and into DataTable, which
|
|
71
|
+
// renders this root), so numeric columns align by default; a
|
|
72
|
+
// prose-heavy column can opt out with proportional-nums.
|
|
73
|
+
"text-body-sm w-full caption-bottom tabular-nums",
|
|
71
74
|
n === "fixed" && "table-fixed",
|
|
72
75
|
a
|
|
73
76
|
),
|
|
@@ -75,15 +78,15 @@ const u = c(
|
|
|
75
78
|
"data-slot": "table",
|
|
76
79
|
"data-tracking-el": e,
|
|
77
80
|
"data-tracking-label": o,
|
|
78
|
-
style: { minWidth:
|
|
81
|
+
style: { minWidth: r, ...b },
|
|
79
82
|
...f
|
|
80
83
|
}
|
|
81
84
|
)
|
|
82
85
|
}
|
|
83
86
|
)
|
|
84
87
|
);
|
|
85
|
-
|
|
86
|
-
const
|
|
88
|
+
h.displayName = "Table";
|
|
89
|
+
const g = s.forwardRef(
|
|
87
90
|
({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
|
|
88
91
|
"thead",
|
|
89
92
|
{
|
|
@@ -95,8 +98,8 @@ const h = r.forwardRef(
|
|
|
95
98
|
}
|
|
96
99
|
)
|
|
97
100
|
);
|
|
98
|
-
|
|
99
|
-
const w =
|
|
101
|
+
g.displayName = "TableHeader";
|
|
102
|
+
const w = s.forwardRef(
|
|
100
103
|
({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
|
|
101
104
|
"tbody",
|
|
102
105
|
{
|
|
@@ -109,7 +112,7 @@ const w = r.forwardRef(
|
|
|
109
112
|
)
|
|
110
113
|
);
|
|
111
114
|
w.displayName = "TableBody";
|
|
112
|
-
const x =
|
|
115
|
+
const x = s.forwardRef(
|
|
113
116
|
({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
|
|
114
117
|
"tfoot",
|
|
115
118
|
{
|
|
@@ -122,7 +125,7 @@ const x = r.forwardRef(
|
|
|
122
125
|
)
|
|
123
126
|
);
|
|
124
127
|
x.displayName = "TableFooter";
|
|
125
|
-
const
|
|
128
|
+
const y = s.forwardRef(
|
|
126
129
|
({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
|
|
127
130
|
"tr",
|
|
128
131
|
{
|
|
@@ -139,15 +142,15 @@ const N = r.forwardRef(
|
|
|
139
142
|
}
|
|
140
143
|
)
|
|
141
144
|
);
|
|
142
|
-
|
|
143
|
-
const
|
|
145
|
+
y.displayName = "TableRow";
|
|
146
|
+
const N = s.forwardRef(
|
|
144
147
|
({
|
|
145
148
|
className: a,
|
|
146
149
|
dataHook: t,
|
|
147
150
|
align: e,
|
|
148
151
|
width: o,
|
|
149
152
|
minWidth: n,
|
|
150
|
-
style:
|
|
153
|
+
style: r,
|
|
151
154
|
scope: i = "col",
|
|
152
155
|
...b
|
|
153
156
|
}, f) => /* @__PURE__ */ l(
|
|
@@ -158,27 +161,27 @@ const y = r.forwardRef(
|
|
|
158
161
|
"data-hook": t,
|
|
159
162
|
"data-slot": "table-head",
|
|
160
163
|
scope: i,
|
|
161
|
-
style: { width: o, minWidth: n, ...
|
|
164
|
+
style: { width: o, minWidth: n, ...r },
|
|
162
165
|
...b
|
|
163
166
|
}
|
|
164
167
|
)
|
|
165
168
|
);
|
|
166
|
-
|
|
167
|
-
const T =
|
|
168
|
-
({ className: a, dataHook: t, size: e, align: o, width: n, minWidth:
|
|
169
|
+
N.displayName = "TableHead";
|
|
170
|
+
const T = s.forwardRef(
|
|
171
|
+
({ className: a, dataHook: t, size: e, align: o, width: n, minWidth: r, style: i, ...b }, f) => /* @__PURE__ */ l(
|
|
169
172
|
"td",
|
|
170
173
|
{
|
|
171
174
|
ref: f,
|
|
172
175
|
className: d(u({ size: e, align: o }), a),
|
|
173
176
|
"data-hook": t,
|
|
174
177
|
"data-slot": "table-cell",
|
|
175
|
-
style: { width: n, minWidth:
|
|
178
|
+
style: { width: n, minWidth: r, ...i },
|
|
176
179
|
...b
|
|
177
180
|
}
|
|
178
181
|
)
|
|
179
182
|
);
|
|
180
183
|
T.displayName = "TableCell";
|
|
181
|
-
const k =
|
|
184
|
+
const k = s.forwardRef(({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
|
|
182
185
|
"caption",
|
|
183
186
|
{
|
|
184
187
|
ref: o,
|
|
@@ -190,12 +193,12 @@ const k = r.forwardRef(({ className: a, dataHook: t, ...e }, o) => /* @__PURE__
|
|
|
190
193
|
));
|
|
191
194
|
k.displayName = "TableCaption";
|
|
192
195
|
export {
|
|
193
|
-
|
|
196
|
+
h as Table,
|
|
194
197
|
w as TableBody,
|
|
195
198
|
k as TableCaption,
|
|
196
199
|
T as TableCell,
|
|
197
200
|
x as TableFooter,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
N as TableHead,
|
|
202
|
+
g as TableHeader,
|
|
203
|
+
y as TableRow
|
|
201
204
|
};
|
package/dist/tabs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),q=require("react"),I=require("@radix-ui/react-tabs"),g=require("@brightlocal/ui-components/lib/utils");function h(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return s.default=t,Object.freeze(s)}const i=h(q),T=h(I),w=i.createContext({lazyMount:!1,unmountOnExit:!1,activeValue:void 0,visitedTabs:new Set});function L({className:t,dataHook:s,trackingEl:a,trackingLabel:n,lazyMount:e=!1,unmountOnExit:r=!1,value:b,defaultValue:u,onValueChange:o,...v},m){const c=e||r,[S,R]=i.useState(u),l=b??S,[x,O]=i.useState(()=>new Set(l!=null?[l]:[])),P=i.useCallback(f=>{R(f),e&&O(p=>{if(p.has(f))return p;const k=new Set(p);return k.add(f),k}),o?.(f)},[e,o]),_=i.useMemo(()=>({lazyMount:e,unmountOnExit:r,activeValue:l,visitedTabs:x}),[e,r,l,x]);return d.jsx(w.Provider,{value:_,children:d.jsx(T.Root,{ref:m,className:g.cn("flex flex-col gap-2",t),"data-hook":s,"data-slot":"tabs","data-tracking-el":a,"data-tracking-label":n,defaultValue:c?void 0:u,value:c?l:b,onValueChange:c?P:o,...v})})}const j=i.forwardRef(L);j.displayName="Tabs";const y=i.forwardRef(({className:t,dataHook:s,trackingEl:a,trackingLabel:n,...e},r)=>d.jsx(T.List,{ref:r,className:g.cn("inline-flex h-9 w-fit items-center justify-center","bg-muted rounded-lg","p-1",t),"data-hook":s,"data-slot":"tabs-list","data-tracking-el":a,"data-tracking-label":n,...e}));y.displayName="TabsList";function V({className:t,dataHook:s,trackingEl:a,trackingLabel:n,...e},r){return d.jsx(T.Trigger,{ref:r,className:g.cn("inline-flex items-center justify-center gap-2 px-2 py-1","text-label whitespace-nowrap","rounded-md","border border-transparent","text-foreground","duration-fast transition-[color,box-shadow] ease-out","data-[state=active]:bg-background data-[state=active]:shadow-sm","focus-visible:border-ring focus-visible:outline-none","data-[state=inactive]:focus-visible:shadow-default","data-[state=active]:focus-visible:shadow-default","dark:data-[state=active]:border-white/15 dark:data-[state=active]:bg-white/5","disabled:pointer-events-none disabled:opacity-50",t),"data-hook":s,"data-slot":"tabs-trigger","data-tracking-el":a,"data-tracking-label":n,...e})}const C=i.forwardRef(V);C.displayName="TabsTrigger";function D({className:t,dataHook:s,trackingEl:a,trackingLabel:n,value:e,...r},b){const{lazyMount:u,unmountOnExit:o,activeValue:v,visitedTabs:m}=i.useContext(w),c=e===v;return u&&!m.has(e)||o&&!c?null:d.jsx(T.Content,{ref:b,className:g.cn("flex-1 outline-none",t),"data-hook":s,"data-slot":"tabs-content","data-tracking-el":a,"data-tracking-label":n,value:e,...r})}const N=i.forwardRef(D);N.displayName="TabsContent";exports.Tabs=j;exports.TabsContent=N;exports.TabsList=y;exports.TabsTrigger=C;
|
package/dist/tabs.js
CHANGED
|
@@ -14,6 +14,11 @@ import * as React from "react";
|
|
|
14
14
|
* <TypographyP dataHook="w2">Processing</TypographyP>
|
|
15
15
|
* </TextRevealMotion>
|
|
16
16
|
* ```
|
|
17
|
+
*
|
|
18
|
+
* @deprecated Removal planned once product usage is gone (DS-907). Cycling
|
|
19
|
+
* phrases on a timer violates the Loading pattern's Honesty principle — the
|
|
20
|
+
* phrases are not stages the backend reported. Use a section skeleton, or a
|
|
21
|
+
* named-stages running screen driven by real stage data (Patterns / Loading).
|
|
17
22
|
*/
|
|
18
23
|
export interface TextRevealMotionProps extends Omit<React.ComponentPropsWithoutRef<"div">, "children"> {
|
|
19
24
|
/**
|
|
@@ -72,6 +77,11 @@ export interface TextRevealMotionProps extends Omit<React.ComponentPropsWithoutR
|
|
|
72
77
|
* The ball rolls across each child, revealing it via clip-path, holds,
|
|
73
78
|
* then rolls back and cycles to the next child. Supports any Typography
|
|
74
79
|
* component as children.
|
|
80
|
+
*
|
|
81
|
+
* @deprecated Removal planned once product usage is gone (DS-907). Cycling
|
|
82
|
+
* phrases on a timer violates the Loading pattern's Honesty principle — the
|
|
83
|
+
* phrases are not stages the backend reported. Use a section skeleton, or a
|
|
84
|
+
* named-stages running screen driven by real stage data (Patterns / Loading).
|
|
75
85
|
*/
|
|
76
86
|
declare const TextRevealMotion: React.ForwardRefExoticComponent<TextRevealMotionProps & React.RefAttributes<HTMLDivElement>>;
|
|
77
87
|
export { TextRevealMotion };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-reveal-motion.d.ts","sourceRoot":"","sources":["../../src/components/text-reveal-motion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4H/B
|
|
1
|
+
{"version":3,"file":"text-reveal-motion.d.ts","sourceRoot":"","sources":["../../src/components/text-reveal-motion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4H/B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,UAAU,CACX;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;OAQG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,gBAAgB,8FAkiBrB,CAAC;AAIF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),d=require("react"),l=require("class-variance-authority"),b=require("@brightlocal/ui-components/lib/utils");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const g=f(d),v=l.cva(["flex w-full","border border-input bg-background rounded-md","outline-none transition-[border-color,background-color,box-shadow] duration-fast ease-out","text-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),d=require("react"),l=require("class-variance-authority"),b=require("@brightlocal/ui-components/lib/utils");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const g=f(d),v=l.cva(["flex w-full","border border-input bg-background rounded-md","outline-none transition-[border-color,background-color,box-shadow] duration-fast ease-out","text-body","text-foreground","px-3 py-2","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground"]),n=g.forwardRef(({className:e,dataHook:r,error:t,trackingEl:a,trackingLabel:s,...o},c)=>{const i=t||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return u.jsx("textarea",{ref:c,"aria-invalid":i?"true":void 0,className:b.cn(v(),i&&"border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",e),"data-hook":r,"data-slot":"textarea","data-tracking-el":a,"data-tracking-label":s,...o})});n.displayName="Textarea";exports.Textarea=n;
|
package/dist/textarea.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
3
|
import { cva as u } from "class-variance-authority";
|
|
4
4
|
import { cn as c } from "@brightlocal/ui-components/lib/utils";
|
|
5
5
|
const b = u([
|
|
@@ -9,7 +9,7 @@ const b = u([
|
|
|
9
9
|
"border border-input bg-background rounded-md",
|
|
10
10
|
"outline-none transition-[border-color,background-color,box-shadow] duration-fast ease-out",
|
|
11
11
|
// Typography
|
|
12
|
-
"text-
|
|
12
|
+
"text-body",
|
|
13
13
|
"text-foreground",
|
|
14
14
|
// Spacing
|
|
15
15
|
"px-3 py-2",
|
|
@@ -20,24 +20,24 @@ const b = u([
|
|
|
20
20
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
21
21
|
// Pseudo-elements
|
|
22
22
|
"placeholder:text-muted-foreground"
|
|
23
|
-
]), f =
|
|
24
|
-
({ className:
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */
|
|
23
|
+
]), f = n.forwardRef(
|
|
24
|
+
({ className: a, dataHook: o, error: t, trackingEl: i, trackingLabel: d, ...e }, s) => {
|
|
25
|
+
const r = t || e["aria-invalid"] === !0 || e["aria-invalid"] === "true";
|
|
26
|
+
return /* @__PURE__ */ l(
|
|
27
27
|
"textarea",
|
|
28
28
|
{
|
|
29
29
|
ref: s,
|
|
30
|
-
"aria-invalid":
|
|
30
|
+
"aria-invalid": r ? "true" : void 0,
|
|
31
31
|
className: c(
|
|
32
32
|
b(),
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
r && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
|
|
34
|
+
a
|
|
35
35
|
),
|
|
36
36
|
"data-hook": o,
|
|
37
37
|
"data-slot": "textarea",
|
|
38
38
|
"data-tracking-el": i,
|
|
39
39
|
"data-tracking-label": d,
|
|
40
|
-
...
|
|
40
|
+
...e
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
}
|
package/dist/toggle.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),b=require("react"),f=require("@radix-ui/react-toggle"),p=require("class-variance-authority"),m=require("@brightlocal/ui-components/lib/utils");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const v=o(b),h=o(f),r=p.cva("inline-flex items-center justify-center gap-2 rounded-md text-label hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:shadow-default outline-none transition-[color,box-shadow] duration-fast ease-out whitespace-nowrap",{variants:{variant:{simple:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"simple",size:"default"}}),i=v.forwardRef(({className:e,variant:t,size:a,dataHook:n,trackingEl:s,trackingLabel:l,ariaLabel:c,...g},u)=>d.jsx(h.Root,{ref:u,"aria-label":c,className:m.cn(r({variant:t,size:a,className:e})),"data-hook":n,"data-slot":"toggle","data-tracking-el":s||`toggle-${t}`,"data-tracking-label":l,...g}));i.displayName="Toggle";exports.Toggle=i;exports.toggleVariants=r;
|
package/dist/toggle.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import * as g from "react";
|
|
3
|
-
import * as
|
|
4
|
-
import { cva as
|
|
3
|
+
import * as c from "@radix-ui/react-toggle";
|
|
4
|
+
import { cva as m } from "class-variance-authority";
|
|
5
5
|
import { cn as p } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
-
const f =
|
|
7
|
-
"inline-flex items-center justify-center gap-2 rounded-md text-
|
|
6
|
+
const f = m(
|
|
7
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-label hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:shadow-default outline-none transition-[color,box-shadow] duration-fast ease-out whitespace-nowrap",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
@@ -32,10 +32,10 @@ const f = c(
|
|
|
32
32
|
trackingLabel: n,
|
|
33
33
|
ariaLabel: i,
|
|
34
34
|
...s
|
|
35
|
-
},
|
|
36
|
-
|
|
35
|
+
}, l) => /* @__PURE__ */ d(
|
|
36
|
+
c.Root,
|
|
37
37
|
{
|
|
38
|
-
ref:
|
|
38
|
+
ref: l,
|
|
39
39
|
"aria-label": i,
|
|
40
40
|
className: p(f({ variant: e, size: a, className: t })),
|
|
41
41
|
"data-hook": o,
|
package/dist/tooltip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),x=require("@radix-ui/react-tooltip"),l=require("@brightlocal/ui-components/lib/utils");function s(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const c=s(m),i=s(x);function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),x=require("@radix-ui/react-tooltip"),l=require("@brightlocal/ui-components/lib/utils");function s(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const c=s(m),i=s(x);function y({delayDuration:t=0,skipDelayDuration:o=0,...e}){return a.jsx(i.Provider,{delayDuration:t,skipDelayDuration:o,...e})}function b({...t}){return a.jsx(i.Root,{...t})}const d=c.forwardRef(({dataHook:t,trackingEl:o,trackingLabel:e,...r},n)=>a.jsx(i.Trigger,{ref:n,"data-hook":t,"data-slot":"tooltip-trigger","data-tracking-el":o,"data-tracking-label":e,...r}));d.displayName="TooltipTrigger";const p=c.forwardRef(({className:t,sideOffset:o=0,dataHook:e,trackingEl:r,trackingLabel:n,hideArrow:u=!1,children:g,...T},f)=>a.jsx(i.Portal,{children:a.jsxs(i.Content,{ref:f,className:l.cn("bg-secondary text-secondary-foreground text-body-xs z-50 w-max max-w-sm rounded-md px-3 py-1.5",l.FLOATING_CONTENT_ANIMATION,"**:data-[slot=tooltip-arrow]:-translate-y-px",t),"data-hook":e,"data-slot":"tooltip-content","data-tracking-el":r,"data-tracking-label":n,sideOffset:o,...T,children:[g,!u&&a.jsx(i.Arrow,{className:"fill-secondary","data-slot":"tooltip-arrow",height:7,width:14})]})}));p.displayName="TooltipContent";exports.Tooltip=b;exports.TooltipContent=p;exports.TooltipProvider=y;exports.TooltipTrigger=d;
|
package/dist/tooltip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-tooltip";
|
|
4
|
-
import { cn as g, FLOATING_CONTENT_ANIMATION as
|
|
4
|
+
import { cn as g, FLOATING_CONTENT_ANIMATION as T } from "@brightlocal/ui-components/lib/utils";
|
|
5
5
|
function w({
|
|
6
6
|
delayDuration: t = 0,
|
|
7
7
|
skipDelayDuration: r = 0,
|
|
@@ -16,12 +16,12 @@ function w({
|
|
|
16
16
|
}
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function y({
|
|
20
20
|
...t
|
|
21
21
|
}) {
|
|
22
22
|
return /* @__PURE__ */ e(o.Root, { ...t });
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const f = n.forwardRef(({ dataHook: t, trackingEl: r, trackingLabel: a, ...i }, l) => /* @__PURE__ */ e(
|
|
25
25
|
o.Trigger,
|
|
26
26
|
{
|
|
27
27
|
ref: l,
|
|
@@ -32,7 +32,7 @@ const T = n.forwardRef(({ dataHook: t, trackingEl: r, trackingLabel: a, ...i },
|
|
|
32
32
|
...i
|
|
33
33
|
}
|
|
34
34
|
));
|
|
35
|
-
|
|
35
|
+
f.displayName = "TooltipTrigger";
|
|
36
36
|
const x = n.forwardRef(
|
|
37
37
|
({
|
|
38
38
|
className: t,
|
|
@@ -48,8 +48,8 @@ const x = n.forwardRef(
|
|
|
48
48
|
{
|
|
49
49
|
ref: c,
|
|
50
50
|
className: g(
|
|
51
|
-
"bg-secondary text-secondary-foreground z-50 w-max max-w-sm rounded-md px-3 py-1.5
|
|
52
|
-
|
|
51
|
+
"bg-secondary text-secondary-foreground text-body-xs z-50 w-max max-w-sm rounded-md px-3 py-1.5",
|
|
52
|
+
T,
|
|
53
53
|
"**:data-[slot=tooltip-arrow]:-translate-y-px",
|
|
54
54
|
t
|
|
55
55
|
),
|
|
@@ -76,8 +76,8 @@ const x = n.forwardRef(
|
|
|
76
76
|
);
|
|
77
77
|
x.displayName = "TooltipContent";
|
|
78
78
|
export {
|
|
79
|
-
|
|
79
|
+
y as Tooltip,
|
|
80
80
|
x as TooltipContent,
|
|
81
81
|
w as TooltipProvider,
|
|
82
|
-
|
|
82
|
+
f as TooltipTrigger
|
|
83
83
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),b=require("react"),h=require("@radix-ui/react-slot"),m=require("class-variance-authority"),x=require("@brightlocal/ui-components/lib/utils");function j(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const v=j(b),O=m.cva("",{variants:{variant:{display:"text-display",page:"text-heading-page",section:"text-heading-section",subsection:"text-heading-subsection",compact:"text-heading-compact"},color:{default:"text-foreground",muted:"text-muted-foreground"},align:{left:"text-left",center:"text-center",right:"text-right"},tabular:{true:"tabular-nums",false:"proportional-nums"}},defaultVariants:{color:"default"}}),S={1:"page",2:"section",3:"subsection",4:"subsection",5:"subsection",6:"subsection"},o=v.forwardRef(({className:t,level:e,variant:a,color:n="default",align:i,tabular:s,asChild:c=!1,dataHook:u,trackingEl:l,trackingLabel:d,...g},p)=>{const r=a??S[e],f=c?h.Slot:`h${e}`;return y.jsx(f,{ref:p,className:x.cn(O({variant:r,color:n,align:i,tabular:s}),t),"data-hook":u,"data-slot":"typography-heading","data-tracking-el":l||`typography-heading-${r}`,"data-tracking-label":d,...g})});o.displayName="TypographyHeading";exports.TypographyHeading=o;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Heading levels — the rendered HTML tag (h1–h6).
|
|
4
|
+
* The level encodes the document outline position only; it is fully
|
|
5
|
+
* independent of the visual style, which is chosen via `variant`.
|
|
6
|
+
*/
|
|
7
|
+
type TypographyHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
8
|
+
/**
|
|
9
|
+
* Visual styles from the semantic type scale (DS-714). Weights below are the
|
|
10
|
+
* Figma spec values; each utility renders one step lighter in CSS — the
|
|
11
|
+
* Figma→Web parity offset (DS-305).
|
|
12
|
+
* Every heading is Figma 600 (renders 500) — Figma 700 (the `text-emphasis`
|
|
13
|
+
* utility) is inline emphasis only, never a heading.
|
|
14
|
+
* - `display` — Poppins 600 · 36/40. Brand moments only; never a default.
|
|
15
|
+
* Callout is the one component that uses it.
|
|
16
|
+
* - `page` — Poppins 600 · 24/32. The page title; exactly one per screen.
|
|
17
|
+
* - `section` — Inter 600 · 20/28. Card, dialog and sheet titles.
|
|
18
|
+
* - `subsection` — Inter 600 · 16/24. Sections inside a card, panel headers.
|
|
19
|
+
* - `compact` — Inter 600 · 14/20. Titles inside dense surfaces — alert and
|
|
20
|
+
* toast titles, step titles; the smallest heading. Table column headers are
|
|
21
|
+
* not headings — style the `th` as label-size text at 600 instead.
|
|
22
|
+
*/
|
|
23
|
+
type TypographyHeadingVariant = "display" | "page" | "section" | "subsection" | "compact";
|
|
24
|
+
/**
|
|
25
|
+
* Text alignment options.
|
|
26
|
+
*/
|
|
27
|
+
type TypographyHeadingAlign = "left" | "center" | "right";
|
|
28
|
+
/**
|
|
29
|
+
* Color role from the scale.
|
|
30
|
+
* - `default` — regular foreground.
|
|
31
|
+
* - `muted` — de-emphasis by color only; same size and weight.
|
|
32
|
+
* Headings have no destructive role — error/critical text is TypographyText
|
|
33
|
+
* `color="destructive"`, never a heading.
|
|
34
|
+
*/
|
|
35
|
+
type TypographyHeadingColor = "default" | "muted";
|
|
36
|
+
/**
|
|
37
|
+
* Props for the TypographyHeading component.
|
|
38
|
+
* Extends native heading props with design system tracking attributes.
|
|
39
|
+
*/
|
|
40
|
+
interface TypographyHeadingProps extends React.ComponentProps<"h1"> {
|
|
41
|
+
/**
|
|
42
|
+
* Document outline level — renders the corresponding h1–h6 tag.
|
|
43
|
+
* Pick it as if CSS didn't exist (one h1 per page, no skipped levels);
|
|
44
|
+
* the visual size is controlled separately via `variant`.
|
|
45
|
+
*/
|
|
46
|
+
level: TypographyHeadingLevel;
|
|
47
|
+
/**
|
|
48
|
+
* Visual style from the semantic type scale, independent of `level`.
|
|
49
|
+
* When omitted, derived from the level: 1 → "page", 2 → "section",
|
|
50
|
+
* 3–6 → "subsection". "display" is always explicit.
|
|
51
|
+
*/
|
|
52
|
+
variant?: TypographyHeadingVariant;
|
|
53
|
+
/**
|
|
54
|
+
* Color role: `muted` de-emphasises with color only (text-muted-foreground) —
|
|
55
|
+
* the scale never de-emphasises via lighter weight or smaller size. There is
|
|
56
|
+
* no destructive heading — error/critical text uses TypographyText
|
|
57
|
+
* `color="destructive"`.
|
|
58
|
+
* @default "default"
|
|
59
|
+
*/
|
|
60
|
+
color?: TypographyHeadingColor;
|
|
61
|
+
/**
|
|
62
|
+
* Text alignment. When omitted, no alignment class is applied and
|
|
63
|
+
* text keeps the default (left) or inherited alignment.
|
|
64
|
+
* @example "center"
|
|
65
|
+
*/
|
|
66
|
+
align?: TypographyHeadingAlign;
|
|
67
|
+
/**
|
|
68
|
+
* Tabular figures (fixed-width numerals) so live values don't jitter —
|
|
69
|
+
* for headings that contain a changing number. Inside Table/DataTable cells
|
|
70
|
+
* figures are already tabular (inherited from the Table root, DS-926);
|
|
71
|
+
* an explicit `false` restores proportional figures there. When omitted,
|
|
72
|
+
* figures follow the surrounding context. Numbers only: never enable
|
|
73
|
+
* it on regular text/prose — it only affects digits, and digits inside
|
|
74
|
+
* prose should stay proportional.
|
|
75
|
+
* No effect on `display`/`page`: Poppins ships no tabular figures, so the
|
|
76
|
+
* request is a harmless no-op there — and a large standalone number is a
|
|
77
|
+
* TypographyText `metric` (plus `tabular` if it must align), not a heading.
|
|
78
|
+
*/
|
|
79
|
+
tabular?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Render as a different element using Radix Slot pattern.
|
|
82
|
+
* When true, merges props onto the child element.
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
asChild?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Data hook for automated testing (REQUIRED).
|
|
88
|
+
* Used to identify component in tests and E2E automation.
|
|
89
|
+
* @example "page-title", "card-heading"
|
|
90
|
+
*/
|
|
91
|
+
dataHook: string;
|
|
92
|
+
/**
|
|
93
|
+
* Tracking element identifier for analytics.
|
|
94
|
+
* @default "typography-heading-{variant}"
|
|
95
|
+
*/
|
|
96
|
+
trackingEl?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Tracking label for analytics context.
|
|
99
|
+
*/
|
|
100
|
+
trackingLabel?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Semantic heading with decoupled axes: `level` sets the HTML tag (document
|
|
104
|
+
* outline), `variant` sets the visual style (semantic type scale, DS-714).
|
|
105
|
+
* This makes "an h3 that looks like a section title" a first-class, correct
|
|
106
|
+
* combination — markup encodes meaning, the variant encodes appearance.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* <TypographyHeading level={2} variant="section" dataHook="card-title">
|
|
110
|
+
* Ranking performance
|
|
111
|
+
* </TypographyHeading>
|
|
112
|
+
*/
|
|
113
|
+
declare const TypographyHeading: React.ForwardRefExoticComponent<Omit<TypographyHeadingProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
114
|
+
export { TypographyHeading };
|
|
115
|
+
export type { TypographyHeadingProps, TypographyHeadingLevel, TypographyHeadingVariant, TypographyHeadingAlign, TypographyHeadingColor, };
|
|
116
|
+
//# sourceMappingURL=typography-heading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography-heading.d.ts","sourceRoot":"","sources":["../../src/components/typography-heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;;GAIG;AACH,KAAK,sBAAsB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AACH,KAAK,wBAAwB,GACzB,SAAS,GACT,MAAM,GACN,SAAS,GACT,YAAY,GACZ,SAAS,CAAC;AAEd;;GAEG;AACH,KAAK,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1D;;;;;;GAMG;AACH,KAAK,sBAAsB,GAAG,SAAS,GAAG,OAAO,CAAC;AAmDlD;;;GAGG;AACH,UAAU,sBAAuB,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;IACjE;;;;OAIG;IACH,KAAK,EAAE,sBAAsB,CAAC;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAC/B;;;;OAIG;IACH,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAC/B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;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;;;;;;;;;;GAUG;AACH,QAAA,MAAM,iBAAiB,gHA0CtB,CAAC;AAGF,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { Slot as h } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as y } from "class-variance-authority";
|
|
5
|
+
import { cn as x } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
const b = y("", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
display: "text-display",
|
|
10
|
+
page: "text-heading-page",
|
|
11
|
+
section: "text-heading-section",
|
|
12
|
+
subsection: "text-heading-subsection",
|
|
13
|
+
compact: "text-heading-compact"
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
default: "text-foreground",
|
|
17
|
+
muted: "text-muted-foreground"
|
|
18
|
+
},
|
|
19
|
+
align: {
|
|
20
|
+
left: "text-left",
|
|
21
|
+
center: "text-center",
|
|
22
|
+
right: "text-right"
|
|
23
|
+
},
|
|
24
|
+
// Tri-state on purpose: `undefined` (the default) emits no class so the
|
|
25
|
+
// heading inherits its context — proportional everywhere except inside a
|
|
26
|
+
// Table root, which sets `tabular-nums` (DS-926). Explicit `false` must
|
|
27
|
+
// therefore emit `proportional-nums`, or opting out inside a Table would
|
|
28
|
+
// be a silent no-op.
|
|
29
|
+
tabular: {
|
|
30
|
+
true: "tabular-nums",
|
|
31
|
+
false: "proportional-nums"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
color: "default"
|
|
36
|
+
}
|
|
37
|
+
}), v = {
|
|
38
|
+
1: "page",
|
|
39
|
+
2: "section",
|
|
40
|
+
3: "subsection",
|
|
41
|
+
4: "subsection",
|
|
42
|
+
5: "subsection",
|
|
43
|
+
6: "subsection"
|
|
44
|
+
}, V = f.forwardRef(
|
|
45
|
+
({
|
|
46
|
+
className: e,
|
|
47
|
+
level: t,
|
|
48
|
+
variant: o,
|
|
49
|
+
color: r = "default",
|
|
50
|
+
align: n,
|
|
51
|
+
tabular: i,
|
|
52
|
+
asChild: s = !1,
|
|
53
|
+
dataHook: c,
|
|
54
|
+
trackingEl: d,
|
|
55
|
+
trackingLabel: p,
|
|
56
|
+
...g
|
|
57
|
+
}, l) => {
|
|
58
|
+
const a = o ?? v[t], u = s ? h : `h${t}`;
|
|
59
|
+
return /* @__PURE__ */ m(
|
|
60
|
+
u,
|
|
61
|
+
{
|
|
62
|
+
ref: l,
|
|
63
|
+
className: x(
|
|
64
|
+
b({
|
|
65
|
+
variant: a,
|
|
66
|
+
color: r,
|
|
67
|
+
align: n,
|
|
68
|
+
tabular: i
|
|
69
|
+
}),
|
|
70
|
+
e
|
|
71
|
+
),
|
|
72
|
+
"data-hook": c,
|
|
73
|
+
"data-slot": "typography-heading",
|
|
74
|
+
"data-tracking-el": d || `typography-heading-${a}`,
|
|
75
|
+
"data-tracking-label": p,
|
|
76
|
+
...g
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
V.displayName = "TypographyHeading";
|
|
82
|
+
export {
|
|
83
|
+
V as TypographyHeading
|
|
84
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),f=require("react"),b=require("@radix-ui/react-slot"),x=require("class-variance-authority"),g=require("@brightlocal/ui-components/lib/utils");function m(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const h=m(f),T=x.cva("",{variants:{variant:{body:"text-body","body-sm":"text-body-sm","body-xs":"text-body-xs",metric:"text-metric",code:"text-code"},color:{default:"text-foreground",muted:"text-muted-foreground",destructive:"text-destructive-foreground"},tabular:{true:"tabular-nums",false:"proportional-nums"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{variant:"body",color:"default"}}),j={body:"p","body-sm":"p","body-xs":"p",metric:"span",code:"code"},a=h.forwardRef(({className:t,variant:e="body",color:r="default",tabular:o,align:n,asChild:c=!1,dataHook:s,trackingEl:d,trackingLabel:u,...l},i)=>{const y=c?b.Slot:j[e];return p.jsx(y,{ref:i,className:g.cn(T({variant:e,color:r,tabular:o,align:n}),t),"data-hook":s,"data-slot":"typography-text","data-tracking-el":d||`typography-text-${e}`,"data-tracking-label":u,...l})});a.displayName="TypographyText";exports.TypographyText=a;
|