@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
package/dist/input.js
CHANGED
|
@@ -10,7 +10,7 @@ const p = f(
|
|
|
10
10
|
"border border-input bg-background rounded-sm",
|
|
11
11
|
"outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out",
|
|
12
12
|
// Typography
|
|
13
|
-
"text-
|
|
13
|
+
"text-body",
|
|
14
14
|
"text-foreground",
|
|
15
15
|
"overflow-hidden text-ellipsis",
|
|
16
16
|
// States - Focus
|
|
@@ -43,29 +43,29 @@ const p = f(
|
|
|
43
43
|
}
|
|
44
44
|
), v = u.forwardRef(
|
|
45
45
|
({
|
|
46
|
-
className:
|
|
46
|
+
className: a,
|
|
47
47
|
hasIcon: r = !1,
|
|
48
48
|
hasSecondaryIcon: t = !1,
|
|
49
49
|
dataHook: i,
|
|
50
|
-
error:
|
|
51
|
-
trackingEl:
|
|
50
|
+
error: d,
|
|
51
|
+
trackingEl: s,
|
|
52
52
|
trackingLabel: n,
|
|
53
53
|
...e
|
|
54
54
|
}, l) => {
|
|
55
|
-
const
|
|
55
|
+
const o = d || e["aria-invalid"] === !0 || e["aria-invalid"] === "true";
|
|
56
56
|
return /* @__PURE__ */ c(
|
|
57
57
|
"input",
|
|
58
58
|
{
|
|
59
59
|
ref: l,
|
|
60
|
-
"aria-invalid":
|
|
60
|
+
"aria-invalid": o ? "true" : void 0,
|
|
61
61
|
className: b(
|
|
62
62
|
p({ hasIcon: r, hasSecondaryIcon: t }),
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
o && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
|
|
64
|
+
a
|
|
65
65
|
),
|
|
66
66
|
"data-hook": i,
|
|
67
67
|
"data-slot": "input",
|
|
68
|
-
"data-tracking-el":
|
|
68
|
+
"data-tracking-el": s,
|
|
69
69
|
"data-tracking-label": n,
|
|
70
70
|
...e
|
|
71
71
|
}
|
package/dist/label.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),p=require("react"),f=require("@radix-ui/react-label"),m=require("class-variance-authority"),g=require("@brightlocal/ui-components/lib/utils");function n(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const y=n(p),j=n(f),o=m.cva(["text-label","text-foreground"],{variants:{optional:{true:"after:ml-1 after:content-['(optional)']"},srOnly:{true:"sr-only"}},defaultVariants:{}}),l=y.forwardRef(({className:e,optional:a,srOnly:t,dataHook:r,trackingEl:i,trackingLabel:s,children:c,...u},d)=>b.jsx(j.Root,{ref:d,className:g.cn("flex items-center select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",o({optional:a,srOnly:t}),e),"data-hook":r,"data-slot":"label","data-tracking-el":i||"label","data-tracking-label":s,...u,children:c}));l.displayName="Label";exports.Label=l;exports.labelVariants=o;
|
package/dist/label.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components/label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,aAAa;;;
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components/label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,aAAa;;;8EAUjB,CAAC;AAEH,UAAU,UAAW,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC;IAClE;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,KAAK,qFAgCV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAEhC,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/label.js
CHANGED
|
@@ -1,51 +1,48 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import * as m from "@radix-ui/react-label";
|
|
4
4
|
import { cva as c } from "class-variance-authority";
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
optional: {
|
|
11
|
-
true: "after:ml-1 after:content-['(optional)']"
|
|
12
|
-
},
|
|
13
|
-
srOnly: {
|
|
14
|
-
true: "sr-only"
|
|
15
|
-
}
|
|
5
|
+
import { cn as b } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
const f = c(["text-label", "text-foreground"], {
|
|
7
|
+
variants: {
|
|
8
|
+
optional: {
|
|
9
|
+
true: "after:ml-1 after:content-['(optional)']"
|
|
16
10
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
srOnly: {
|
|
12
|
+
true: "sr-only"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {}
|
|
16
|
+
}), u = p.forwardRef(
|
|
20
17
|
({
|
|
21
18
|
className: a,
|
|
22
19
|
optional: e,
|
|
23
20
|
srOnly: t,
|
|
24
|
-
dataHook:
|
|
25
|
-
trackingEl:
|
|
21
|
+
dataHook: r,
|
|
22
|
+
trackingEl: o,
|
|
26
23
|
trackingLabel: l,
|
|
27
|
-
children:
|
|
28
|
-
...
|
|
24
|
+
children: i,
|
|
25
|
+
...n
|
|
29
26
|
}, s) => /* @__PURE__ */ d(
|
|
30
|
-
|
|
27
|
+
m.Root,
|
|
31
28
|
{
|
|
32
29
|
ref: s,
|
|
33
|
-
className:
|
|
30
|
+
className: b(
|
|
34
31
|
"flex items-center select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
35
|
-
|
|
32
|
+
f({ optional: e, srOnly: t }),
|
|
36
33
|
a
|
|
37
34
|
),
|
|
38
|
-
"data-hook":
|
|
35
|
+
"data-hook": r,
|
|
39
36
|
"data-slot": "label",
|
|
40
|
-
"data-tracking-el":
|
|
37
|
+
"data-tracking-el": o || "label",
|
|
41
38
|
"data-tracking-label": l,
|
|
42
|
-
...
|
|
43
|
-
children:
|
|
39
|
+
...n,
|
|
40
|
+
children: i
|
|
44
41
|
}
|
|
45
42
|
)
|
|
46
43
|
);
|
|
47
44
|
u.displayName = "Label";
|
|
48
45
|
export {
|
|
49
46
|
u as Label,
|
|
50
|
-
|
|
47
|
+
f as labelVariants
|
|
51
48
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react");function a(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const l=a(c),u=130;function s({children:t,size:e,slot:n}){const o=l.isValidElement(t)&&typeof t.type=="function"?l.cloneElement(t,{size:e}):t;return r.jsx("div",{className:"flex shrink-0 items-center justify-center [&>*]:h-auto [&>*]:max-h-full [&>*]:max-w-full","data-slot":n,style:{width:e,height:e},children:o})}exports.BLOCK_ILLUSTRATION_SIZE=u;exports.BlockIllustration=s;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The size the design specifies for a page-scope illustration, shared by every
|
|
4
|
+
* block that draws one — `ProgressState` and `EmptyState` at page scope — so the
|
|
5
|
+
* artwork never resizes as one of those screens becomes the other.
|
|
6
|
+
*
|
|
7
|
+
* The artwork is the title's companion, not the subject of the screen: much
|
|
8
|
+
* larger and it outweighs the 24px heading under it, and the eye lands on the
|
|
9
|
+
* drawing instead of the words that say what to do next.
|
|
10
|
+
*/
|
|
11
|
+
declare const BLOCK_ILLUSTRATION_SIZE = 130;
|
|
12
|
+
/**
|
|
13
|
+
* Props for the internal BlockIllustration wrapper.
|
|
14
|
+
*/
|
|
15
|
+
interface BlockIllustrationProps {
|
|
16
|
+
/** The illustration element, exactly as the consumer passed it. */
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
/** Rendered width and height in pixels. */
|
|
19
|
+
size: number;
|
|
20
|
+
/** The owning block's slot name, e.g. `"empty-screen-illustration"`. */
|
|
21
|
+
slot: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Renders a consumer-supplied illustration at the block's own size.
|
|
25
|
+
*/
|
|
26
|
+
declare function BlockIllustration({ children, size, slot }: BlockIllustrationProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export { BlockIllustration, BLOCK_ILLUSTRATION_SIZE };
|
|
28
|
+
//# sourceMappingURL=block-illustration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-illustration.d.ts","sourceRoot":"","sources":["../../src/lib/block-illustration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgC/B;;;;;;;;GAQG;AACH,QAAA,MAAM,uBAAuB,MAAM,CAAC;AAEpC;;GAEG;AACH,UAAU,sBAAsB;IAC9B,mEAAmE;IACnE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,iBAAS,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,sBAAsB,2CA2B1E;AAED,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
const i = 130;
|
|
4
|
+
function m({ children: t, size: e, slot: l }) {
|
|
5
|
+
const n = o.isValidElement(t) && typeof t.type == "function" ? o.cloneElement(t, {
|
|
6
|
+
size: e
|
|
7
|
+
}) : t;
|
|
8
|
+
return /* @__PURE__ */ s(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: "flex shrink-0 items-center justify-center [&>*]:h-auto [&>*]:max-h-full [&>*]:max-w-full",
|
|
12
|
+
"data-slot": l,
|
|
13
|
+
style: { width: e, height: e },
|
|
14
|
+
children: n
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
i as BLOCK_ILLUSTRATION_SIZE,
|
|
20
|
+
m as BlockIllustration
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),g=require("react"),p=require("@brightlocal/ui-components/lib/utils"),f=require("../typography-text.cjs");function y(t){const a=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(a,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const s=y(g),b=32,i=s.forwardRef(({className:t,dataHook:a,icon:e,message:r,slot:n,trackingEl:o,trackingLabel:l,...d},u)=>{const m=s.isValidElement(e)&&typeof e.type!="string"&&e.type!==s.Fragment?s.cloneElement(e,{size:b}):e;return c.jsxs("div",{ref:u,className:p.cn("bg-muted flex flex-col items-center justify-center gap-2 text-center",t),"data-hook":a,"data-slot":n,"data-tracking-el":o??n,"data-tracking-label":l,...d,children:[c.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground flex items-center justify-center [&_svg:not([class*='size-'])]:size-8","data-hook":`${a}-icon`,"data-slot":`${n}-icon`,children:m}),c.jsx(f.TypographyText,{align:"center",color:"muted","data-slot":`${n}-message`,dataHook:`${a}-message`,variant:"body-sm",children:r})]})});i.displayName="EmptyCanvas";exports.EmptyCanvas=i;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the internal EmptyCanvas body.
|
|
4
|
+
*/
|
|
5
|
+
interface EmptyCanvasProps extends Omit<React.ComponentPropsWithoutRef<"div">, "children" | "title"> {
|
|
6
|
+
/** Required data-hook; the parts derive `-icon` and `-message` from it. */
|
|
7
|
+
dataHook: string;
|
|
8
|
+
/**
|
|
9
|
+
* The decorative glyph. This component owns its size — whatever the element
|
|
10
|
+
* carries is overridden — so no call site has a number to get wrong.
|
|
11
|
+
*/
|
|
12
|
+
icon: React.ReactNode;
|
|
13
|
+
/** The one line under the glyph. */
|
|
14
|
+
message: string;
|
|
15
|
+
/** The calling component's slot name, e.g. `"chart-empty"`. */
|
|
16
|
+
slot: string;
|
|
17
|
+
/** Tracking element identifier for analytics. */
|
|
18
|
+
trackingEl?: string;
|
|
19
|
+
/** Tracking label for analytics context. */
|
|
20
|
+
trackingLabel?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Renders the muted canvas surface with its glyph and line.
|
|
24
|
+
*/
|
|
25
|
+
declare const EmptyCanvas: React.ForwardRefExoticComponent<EmptyCanvasProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export { EmptyCanvas };
|
|
27
|
+
//# sourceMappingURL=empty-canvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-canvas.d.ts","sourceRoot":"","sources":["../../src/lib/empty-canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmC/B;;GAEG;AACH,UAAU,gBAAiB,SAAQ,IAAI,CACrC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,UAAU,GAAG,OAAO,CACrB;IACC,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,WAAW,yFA6DhB,CAAC;AAIF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxs as p, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { cn as f } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
import { TypographyText as g } from "../typography-text.js";
|
|
5
|
+
const y = 32, x = a.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
className: n,
|
|
8
|
+
dataHook: r,
|
|
9
|
+
icon: e,
|
|
10
|
+
message: i,
|
|
11
|
+
slot: t,
|
|
12
|
+
trackingEl: m,
|
|
13
|
+
trackingLabel: o,
|
|
14
|
+
...d
|
|
15
|
+
}, c) => {
|
|
16
|
+
const l = a.isValidElement(e) && typeof e.type != "string" && e.type !== a.Fragment ? a.cloneElement(e, {
|
|
17
|
+
size: y
|
|
18
|
+
}) : e;
|
|
19
|
+
return /* @__PURE__ */ p(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
ref: c,
|
|
23
|
+
className: f(
|
|
24
|
+
"bg-muted flex flex-col items-center justify-center gap-2 text-center",
|
|
25
|
+
n
|
|
26
|
+
),
|
|
27
|
+
"data-hook": r,
|
|
28
|
+
"data-slot": t,
|
|
29
|
+
"data-tracking-el": m ?? t,
|
|
30
|
+
"data-tracking-label": o,
|
|
31
|
+
...d,
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ s(
|
|
34
|
+
"span",
|
|
35
|
+
{
|
|
36
|
+
"aria-hidden": "true",
|
|
37
|
+
className: "text-muted-foreground flex items-center justify-center [&_svg:not([class*='size-'])]:size-8",
|
|
38
|
+
"data-hook": `${r}-icon`,
|
|
39
|
+
"data-slot": `${t}-icon`,
|
|
40
|
+
children: l
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ s(
|
|
44
|
+
g,
|
|
45
|
+
{
|
|
46
|
+
align: "center",
|
|
47
|
+
color: "muted",
|
|
48
|
+
"data-slot": `${t}-message`,
|
|
49
|
+
dataHook: `${r}-message`,
|
|
50
|
+
variant: "body-sm",
|
|
51
|
+
children: i
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
x.displayName = "EmptyCanvas";
|
|
60
|
+
export {
|
|
61
|
+
x as EmptyCanvas
|
|
62
|
+
};
|
package/dist/lib/motion.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={type:"spring",stiffness:500,damping:45},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=150,S=200,N={type:"spring",stiffness:500,damping:45},_={stiffness:180,damping:24,mass:1},n={type:"spring",stiffness:80,damping:20,mass:1},t={type:"spring",stiffness:30,damping:9,mass:.5};exports.MOTION_DURATION_BASE_MS=S;exports.MOTION_DURATION_FAST_MS=s;exports.SPRING_GENTLE=n;exports.SPRING_SETTLE=t;exports.SPRING_SMOOTH=_;exports.SPRING_SNAPPY=N;
|
package/dist/lib/motion.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
const s = {
|
|
1
|
+
const s = 150, n = 200, t = {
|
|
2
2
|
type: "spring",
|
|
3
3
|
stiffness: 500,
|
|
4
4
|
damping: 45
|
|
5
|
-
},
|
|
5
|
+
}, i = {
|
|
6
6
|
stiffness: 180,
|
|
7
7
|
damping: 24,
|
|
8
8
|
mass: 1
|
|
9
|
-
},
|
|
9
|
+
}, p = {
|
|
10
10
|
type: "spring",
|
|
11
11
|
stiffness: 80,
|
|
12
12
|
damping: 20,
|
|
13
13
|
mass: 1
|
|
14
|
-
},
|
|
14
|
+
}, S = {
|
|
15
15
|
type: "spring",
|
|
16
16
|
stiffness: 30,
|
|
17
17
|
damping: 9,
|
|
18
18
|
mass: 0.5
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
n as MOTION_DURATION_BASE_MS,
|
|
22
|
+
s as MOTION_DURATION_FAST_MS,
|
|
23
|
+
p as SPRING_GENTLE,
|
|
24
|
+
S as SPRING_SETTLE,
|
|
25
|
+
i as SPRING_SMOOTH,
|
|
26
|
+
t as SPRING_SNAPPY
|
|
25
27
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");function r({children:t}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{"aria-hidden":"true",className:"flex-1"}),t,e.jsx("div",{"aria-hidden":"true",className:"flex-[1.6]"})]})}exports.OpticalCenter=r;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface OpticalCenterProps {
|
|
3
|
+
/** The content to hold at the optical centre. */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Two flexible spacers in a 38/62 ratio around the children. The parent must
|
|
8
|
+
* be a `flex flex-1 flex-col` box for the ratio to have room to work.
|
|
9
|
+
*/
|
|
10
|
+
declare function OpticalCenter({ children }: OpticalCenterProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { OpticalCenter };
|
|
12
|
+
//# sourceMappingURL=optical-center.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optical-center.d.ts","sourceRoot":"","sources":["../../src/lib/optical-center.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAyB/B,UAAU,kBAAkB;IAC1B,iDAAiD;IACjD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,iBAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CAQtD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
function n({ children: r }) {
|
|
3
|
+
return /* @__PURE__ */ a(i, { children: [
|
|
4
|
+
/* @__PURE__ */ e("div", { "aria-hidden": "true", className: "flex-1" }),
|
|
5
|
+
r,
|
|
6
|
+
/* @__PURE__ */ e("div", { "aria-hidden": "true", className: "flex-[1.6]" })
|
|
7
|
+
] });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
n as OpticalCenter
|
|
11
|
+
};
|
package/dist/lib/utils.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 t=require("clsx"),a=require("tailwind-merge"),o=a.extendTailwindMerge({extend:{classGroups:{duration:[{duration:["fast","base","slow"]}],ease:[{ease:["emphasized","overshoot"]}],"font-weight":[{text:["emphasis"]}],"font-size":[{text:["display","heading-page","heading-section","heading-subsection","heading-compact","body","body-sm","body-xs","label","label-sm","metric","code","code-inline"]}]}}});function s(...e){return o(t.clsx(e))}const d="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 duration-base ease-out data-[state=closed]:duration-fast data-[state=closed]:ease-in";exports.FLOATING_CONTENT_ANIMATION=d;exports.cn=s;
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAyC7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,eAAO,MAAM,0BAA0B,0aACkY,CAAC"}
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,15 +1,38 @@
|
|
|
1
|
-
import { clsx as
|
|
2
|
-
import { extendTailwindMerge as
|
|
3
|
-
const o =
|
|
1
|
+
import { clsx as e } from "clsx";
|
|
2
|
+
import { extendTailwindMerge as a } from "tailwind-merge";
|
|
3
|
+
const o = a({
|
|
4
4
|
extend: {
|
|
5
5
|
classGroups: {
|
|
6
6
|
duration: [{ duration: ["fast", "base", "slow"] }],
|
|
7
|
-
ease: [{ ease: ["emphasized", "overshoot"] }]
|
|
7
|
+
ease: [{ ease: ["emphasized", "overshoot"] }],
|
|
8
|
+
// text-emphasis sets font-weight only, so it belongs to the font-weight
|
|
9
|
+
// group (conflicts with font-bold etc.), NOT font-size — and unregistered
|
|
10
|
+
// it would be treated as a text colour and clobber color utilities.
|
|
11
|
+
"font-weight": [{ text: ["emphasis"] }],
|
|
12
|
+
"font-size": [
|
|
13
|
+
{
|
|
14
|
+
text: [
|
|
15
|
+
"display",
|
|
16
|
+
"heading-page",
|
|
17
|
+
"heading-section",
|
|
18
|
+
"heading-subsection",
|
|
19
|
+
"heading-compact",
|
|
20
|
+
"body",
|
|
21
|
+
"body-sm",
|
|
22
|
+
"body-xs",
|
|
23
|
+
"label",
|
|
24
|
+
"label-sm",
|
|
25
|
+
"metric",
|
|
26
|
+
"code",
|
|
27
|
+
"code-inline"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
]
|
|
8
31
|
}
|
|
9
32
|
}
|
|
10
33
|
});
|
|
11
34
|
function i(...t) {
|
|
12
|
-
return o(
|
|
35
|
+
return o(e(t));
|
|
13
36
|
}
|
|
14
37
|
const n = "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 duration-base ease-out data-[state=closed]:duration-fast data-[state=closed]:ease-in";
|
|
15
38
|
export {
|
package/dist/link.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 o=require("react/jsx-runtime"),m=require("react"),y=require("@brightlocal/icons"),u=require("@radix-ui/react-slot"),j=require("class-variance-authority"),S=require("@brightlocal/ui-components/button"),a=require("@brightlocal/ui-components/lib/utils");function q(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const O=q(m),_=new Set(["aria-disabled:opacity-50","aria-invalid:ring-destructive/20","dark:aria-invalid:ring-destructive/40","aria-invalid:border-destructive","data-[state=open]:bg-accent"]),i=t=>a.cn(S.ButtonVariants({variant:t,size:"default"}).split(/\s+/).filter(e=>e&&!_.has(e)).join(" "),"no-underline"),w=j.cva("",{variants:{variant:{inline:["inline-flex","items-center","gap-2","cursor-pointer","outline-none","rounded-sm","text-link","dark:text-link-dark","no-underline","hover:underline","hover:underline-offset-4","active:text-link/80","visited:text-link-visited","visited:dark:text-link-visited-dark","transition-[text-decoration,text-decoration-color,text-underline-offset,color]","duration-fast","ease-out","focus-visible:shadow-default"],inherit:["inline","cursor-pointer","outline-none","rounded-sm","text-inherit","underline","underline-offset-4","decoration-current/60","hover:decoration-current","[&_svg]:ml-1","[&_svg]:inline","[&_svg]:align-text-bottom","transition-[text-decoration-color]","duration-fast","ease-out","focus-visible:shadow-default"],primary:i("primary"),filled:i("secondary"),outline:a.cn(i("outline"),"text-foreground"),ghost:i("ghost"),icon:a.cn(i("ghost"),"size-9 p-0")}},defaultVariants:{variant:"inline"}}),f=O.forwardRef(({className:t,variant:e="inline",dataHook:n,trackingEl:r,trackingLabel:k,asChild:g=!1,external:s=!1,showExternalIcon:v=!0,children:l,...x},b)=>{const p=s?{target:"_blank",rel:"noopener noreferrer"}:{},h=e==="inline"?"link-default":`link-${e}`,c={ref:b,className:a.cn(w({variant:e}),t),"data-hook":n,"data-slot":"link","data-tracking-el":r||h,"data-tracking-label":k,...p,...x},d=s&&v&&o.jsx(y.ExternalLink,{"aria-hidden":"true","data-slot":"external-icon"});return g?o.jsxs(u.Slot,{...c,children:[o.jsx(u.Slottable,{children:l}),d]}):o.jsxs("a",{...c,children:[l,d]})});f.displayName="Link";exports.Link=f;
|
package/dist/link.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const linkVariants: (props?: ({
|
|
4
|
-
variant?: "inline" | "ghost" | "filled" | "icon" | "outline" | "primary" | null | undefined;
|
|
4
|
+
variant?: "inherit" | "inline" | "ghost" | "filled" | "icon" | "outline" | "primary" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
/** Supported visual style variants for the Link component. */
|
|
7
7
|
export type LinkVariant = NonNullable<VariantProps<typeof linkVariants>["variant"]>;
|
|
@@ -11,11 +11,13 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
|
11
11
|
*/
|
|
12
12
|
dataHook: string;
|
|
13
13
|
/**
|
|
14
|
-
* Visual style variant. `inline` renders a standard text link; `
|
|
15
|
-
* renders
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* Visual style variant. `inline` renders a standard text link; `inherit`
|
|
15
|
+
* renders an always-underlined link that takes the surrounding text colour
|
|
16
|
+
* (for links inside body copy, alerts and muted text); `primary` renders
|
|
17
|
+
* the brand CTA treatment (matches `Button variant="primary"`); `filled`,
|
|
18
|
+
* `outline` and `ghost` render button-styled treatments for inline actions
|
|
19
|
+
* and high-priority navigation; `icon` renders a circular icon-only link
|
|
20
|
+
* (provide an `aria-label` since there is no text content).
|
|
19
21
|
* @default "inline"
|
|
20
22
|
*/
|
|
21
23
|
variant?: LinkVariant;
|
package/dist/link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAmClE,QAAA,MAAM,YAAY;;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAmClE,QAAA,MAAM,YAAY;;8EAsFjB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,WAAW,GAAG,WAAW,CACnC,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,SAAS,CAAC,CAC7C,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC9E;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,QAAA,MAAM,IAAI,qFAwDT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/link.js
CHANGED
|
@@ -2,19 +2,19 @@ import { jsxs as s, jsx as d } from "react/jsx-runtime";
|
|
|
2
2
|
import * as h from "react";
|
|
3
3
|
import { ExternalLink as b } from "@brightlocal/icons";
|
|
4
4
|
import { Slot as y, Slottable as S } from "@radix-ui/react-slot";
|
|
5
|
-
import { cva as
|
|
6
|
-
import { ButtonVariants as
|
|
7
|
-
import { cn as
|
|
8
|
-
const
|
|
5
|
+
import { cva as w } from "class-variance-authority";
|
|
6
|
+
import { ButtonVariants as L } from "@brightlocal/ui-components/button";
|
|
7
|
+
import { cn as n } from "@brightlocal/ui-components/lib/utils";
|
|
8
|
+
const _ = /* @__PURE__ */ new Set([
|
|
9
9
|
"aria-disabled:opacity-50",
|
|
10
10
|
"aria-invalid:ring-destructive/20",
|
|
11
11
|
"dark:aria-invalid:ring-destructive/40",
|
|
12
12
|
"aria-invalid:border-destructive",
|
|
13
13
|
"data-[state=open]:bg-accent"
|
|
14
|
-
]), e = (
|
|
15
|
-
|
|
14
|
+
]), e = (i) => n(
|
|
15
|
+
L({ variant: i, size: "default" }).split(/\s+/).filter((t) => t && !_.has(t)).join(" "),
|
|
16
16
|
"no-underline"
|
|
17
|
-
),
|
|
17
|
+
), j = w(
|
|
18
18
|
// No shared base: the button-styled variants carry the Button base classes,
|
|
19
19
|
// and a base here would be silently overridden by them in tailwind-merge
|
|
20
20
|
// (last wins). Each variant is self-contained.
|
|
@@ -48,6 +48,38 @@ const w = /* @__PURE__ */ new Set([
|
|
|
48
48
|
// Focus state
|
|
49
49
|
"focus-visible:shadow-default"
|
|
50
50
|
],
|
|
51
|
+
// Inline link that reads as part of the surrounding sentence: no
|
|
52
|
+
// link colour of its own — `color: inherit` picks up whatever the
|
|
53
|
+
// parent text sets (muted body copy, alert foregrounds, ...).
|
|
54
|
+
// Because colour no longer distinguishes the link from the text
|
|
55
|
+
// around it, the underline is the only affordance and is therefore
|
|
56
|
+
// persistent (WCAG 1.4.1) — hover feedback comes from the underline
|
|
57
|
+
// strengthening, not from a colour change. Deliberately no `visited:`
|
|
58
|
+
// styling: a purple visited colour would break the "part of the
|
|
59
|
+
// sentence" goal. Plain `inline` display (not `inline-flex`) so the
|
|
60
|
+
// link wraps naturally across lines inside a paragraph.
|
|
61
|
+
inherit: [
|
|
62
|
+
"inline",
|
|
63
|
+
"cursor-pointer",
|
|
64
|
+
"outline-none",
|
|
65
|
+
"rounded-sm",
|
|
66
|
+
"text-inherit",
|
|
67
|
+
// Persistent underline; softened until hovered
|
|
68
|
+
"underline",
|
|
69
|
+
"underline-offset-4",
|
|
70
|
+
"decoration-current/60",
|
|
71
|
+
"hover:decoration-current",
|
|
72
|
+
// External icon sits in the text flow with the label
|
|
73
|
+
"[&_svg]:ml-1",
|
|
74
|
+
"[&_svg]:inline",
|
|
75
|
+
"[&_svg]:align-text-bottom",
|
|
76
|
+
// Transitions
|
|
77
|
+
"transition-[text-decoration-color]",
|
|
78
|
+
"duration-fast",
|
|
79
|
+
"ease-out",
|
|
80
|
+
// Focus state
|
|
81
|
+
"focus-visible:shadow-default"
|
|
82
|
+
],
|
|
51
83
|
// Button-styled, brand CTA (matches Button `primary`).
|
|
52
84
|
primary: e("primary"),
|
|
53
85
|
// Button-styled, filled (maps to Button `secondary`).
|
|
@@ -55,22 +87,22 @@ const w = /* @__PURE__ */ new Set([
|
|
|
55
87
|
// Button-styled, bordered (matches Button `outline`). Button's outline
|
|
56
88
|
// declares no text color (buttons default sensibly; anchors inherit
|
|
57
89
|
// ambient/link colors), so links must pin `text-foreground` explicitly.
|
|
58
|
-
outline:
|
|
90
|
+
outline: n(e("outline"), "text-foreground"),
|
|
59
91
|
// Button-styled, transparent (matches Button `ghost`).
|
|
60
92
|
ghost: e("ghost"),
|
|
61
93
|
// Icon-only, circular. Mirrors `ghost` in a fixed 36px square
|
|
62
94
|
// footprint — the same `size-9 p-0` Button applies to icon-only
|
|
63
95
|
// buttons. Requires an `aria-label` since there is no text content.
|
|
64
|
-
icon:
|
|
96
|
+
icon: n(e("ghost"), "size-9 p-0")
|
|
65
97
|
}
|
|
66
98
|
},
|
|
67
99
|
defaultVariants: {
|
|
68
100
|
variant: "inline"
|
|
69
101
|
}
|
|
70
102
|
}
|
|
71
|
-
),
|
|
103
|
+
), V = h.forwardRef(
|
|
72
104
|
({
|
|
73
|
-
className:
|
|
105
|
+
className: i,
|
|
74
106
|
variant: t = "inline",
|
|
75
107
|
dataHook: c,
|
|
76
108
|
trackingEl: u,
|
|
@@ -78,12 +110,12 @@ const w = /* @__PURE__ */ new Set([
|
|
|
78
110
|
asChild: k = !1,
|
|
79
111
|
external: r = !1,
|
|
80
112
|
showExternalIcon: m = !0,
|
|
81
|
-
children:
|
|
113
|
+
children: o,
|
|
82
114
|
...p
|
|
83
115
|
}, v) => {
|
|
84
|
-
const x = r ? { target: "_blank", rel: "noopener noreferrer" } : {}, g = t === "inline" ? "link-default" : `link-${t}`,
|
|
116
|
+
const x = r ? { target: "_blank", rel: "noopener noreferrer" } : {}, g = t === "inline" ? "link-default" : `link-${t}`, a = {
|
|
85
117
|
ref: v,
|
|
86
|
-
className:
|
|
118
|
+
className: n(j({ variant: t }), i),
|
|
87
119
|
"data-hook": c,
|
|
88
120
|
"data-slot": "link",
|
|
89
121
|
"data-tracking-el": u || g,
|
|
@@ -91,16 +123,16 @@ const w = /* @__PURE__ */ new Set([
|
|
|
91
123
|
...x,
|
|
92
124
|
...p
|
|
93
125
|
}, l = r && m && /* @__PURE__ */ d(b, { "aria-hidden": "true", "data-slot": "external-icon" });
|
|
94
|
-
return k ? /* @__PURE__ */ s(y, { ...
|
|
95
|
-
/* @__PURE__ */ d(S, { children:
|
|
126
|
+
return k ? /* @__PURE__ */ s(y, { ...a, children: [
|
|
127
|
+
/* @__PURE__ */ d(S, { children: o }),
|
|
96
128
|
l
|
|
97
|
-
] }) : /* @__PURE__ */ s("a", { ...
|
|
98
|
-
|
|
129
|
+
] }) : /* @__PURE__ */ s("a", { ...a, children: [
|
|
130
|
+
o,
|
|
99
131
|
l
|
|
100
132
|
] });
|
|
101
133
|
}
|
|
102
134
|
);
|
|
103
|
-
|
|
135
|
+
V.displayName = "Link";
|
|
104
136
|
export {
|
|
105
|
-
|
|
137
|
+
V as Link
|
|
106
138
|
};
|