@almanaclabs/blaze-ui 0.9.0 → 0.11.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/dist/components/app-shell/app-shell.d.ts +81 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell/app-shell.js +144 -0
- package/dist/components/app-shell/index.d.ts +2 -0
- package/dist/components/app-shell/index.d.ts.map +1 -0
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/chat-bar/chat-bar.d.ts +26 -0
- package/dist/components/chat-bar/chat-bar.d.ts.map +1 -0
- package/dist/components/chat-bar/chat-bar.js +58 -0
- package/dist/components/chat-bar/index.d.ts +2 -0
- package/dist/components/chat-bar/index.d.ts.map +1 -0
- package/dist/components/dense-table/dense-table.d.ts +36 -0
- package/dist/components/dense-table/dense-table.d.ts.map +1 -0
- package/dist/components/dense-table/dense-table.js +41 -0
- package/dist/components/dense-table/index.d.ts +2 -0
- package/dist/components/dense-table/index.d.ts.map +1 -0
- package/dist/components/editable-text/editable-text.d.ts +26 -0
- package/dist/components/editable-text/editable-text.d.ts.map +1 -0
- package/dist/components/editable-text/editable-text.js +82 -0
- package/dist/components/editable-text/index.d.ts +2 -0
- package/dist/components/editable-text/index.d.ts.map +1 -0
- package/dist/components/face-stack-button/face-stack-button.d.ts +31 -0
- package/dist/components/face-stack-button/face-stack-button.d.ts.map +1 -0
- package/dist/components/face-stack-button/face-stack-button.js +47 -0
- package/dist/components/face-stack-button/index.d.ts +2 -0
- package/dist/components/face-stack-button/index.d.ts.map +1 -0
- package/dist/components/goal-card/goal-card.d.ts +51 -0
- package/dist/components/goal-card/goal-card.d.ts.map +1 -0
- package/dist/components/goal-card/goal-card.js +109 -0
- package/dist/components/goal-card/index.d.ts +2 -0
- package/dist/components/goal-card/index.d.ts.map +1 -0
- package/dist/components/input-group/input-group.d.ts +1 -1
- package/dist/components/media-thumbnail/index.d.ts +2 -0
- package/dist/components/media-thumbnail/index.d.ts.map +1 -0
- package/dist/components/media-thumbnail/media-thumbnail.d.ts +21 -0
- package/dist/components/media-thumbnail/media-thumbnail.d.ts.map +1 -0
- package/dist/components/media-thumbnail/media-thumbnail.js +50 -0
- package/dist/components/metric-tile/index.d.ts +2 -0
- package/dist/components/metric-tile/index.d.ts.map +1 -0
- package/dist/components/metric-tile/metric-tile.d.ts +34 -0
- package/dist/components/metric-tile/metric-tile.d.ts.map +1 -0
- package/dist/components/metric-tile/metric-tile.js +75 -0
- package/dist/components/page-header/index.d.ts +2 -0
- package/dist/components/page-header/index.d.ts.map +1 -0
- package/dist/components/page-header/page-header.d.ts +16 -0
- package/dist/components/page-header/page-header.d.ts.map +1 -0
- package/dist/components/page-header/page-header.js +38 -0
- package/dist/components/platform-avatar/index.d.ts +2 -0
- package/dist/components/platform-avatar/index.d.ts.map +1 -0
- package/dist/components/platform-avatar/platform-avatar.d.ts +23 -0
- package/dist/components/platform-avatar/platform-avatar.d.ts.map +1 -0
- package/dist/components/platform-avatar/platform-avatar.js +54 -0
- package/dist/components/platform-icon/index.d.ts +2 -0
- package/dist/components/platform-icon/index.d.ts.map +1 -0
- package/dist/components/platform-icon/platform-icon.d.ts +33 -0
- package/dist/components/platform-icon/platform-icon.d.ts.map +1 -0
- package/dist/components/platform-icon/platform-icon.js +169 -0
- package/dist/components/sidebar/sidebar.js +19 -19
- package/dist/components/signal-strip/index.d.ts +2 -0
- package/dist/components/signal-strip/index.d.ts.map +1 -0
- package/dist/components/signal-strip/signal-strip.d.ts +34 -0
- package/dist/components/signal-strip/signal-strip.d.ts.map +1 -0
- package/dist/components/signal-strip/signal-strip.js +84 -0
- package/dist/components/source-avatar/index.d.ts +2 -0
- package/dist/components/source-avatar/index.d.ts.map +1 -0
- package/dist/components/source-avatar/source-avatar.d.ts +16 -0
- package/dist/components/source-avatar/source-avatar.d.ts.map +1 -0
- package/dist/components/source-avatar/source-avatar.js +15 -0
- package/dist/components/stacked-bar-chart/index.d.ts +2 -0
- package/dist/components/stacked-bar-chart/index.d.ts.map +1 -0
- package/dist/components/stacked-bar-chart/stacked-bar-chart.d.ts +80 -0
- package/dist/components/stacked-bar-chart/stacked-bar-chart.d.ts.map +1 -0
- package/dist/components/stacked-bar-chart/stacked-bar-chart.js +240 -0
- package/dist/components/state-banner/index.d.ts +2 -0
- package/dist/components/state-banner/index.d.ts.map +1 -0
- package/dist/components/state-banner/state-banner.d.ts +32 -0
- package/dist/components/state-banner/state-banner.d.ts.map +1 -0
- package/dist/components/state-banner/state-banner.js +70 -0
- package/dist/components/suggest-chips/index.d.ts +2 -0
- package/dist/components/suggest-chips/index.d.ts.map +1 -0
- package/dist/components/suggest-chips/suggest-chips.d.ts +13 -0
- package/dist/components/suggest-chips/suggest-chips.d.ts.map +1 -0
- package/dist/components/suggest-chips/suggest-chips.js +24 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +65 -49
- package/package.json +1 -1
- package/src/styles/globals.css +69 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/face-stack-button/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Badge } from '../badge';
|
|
2
|
+
import { Card } from '../card';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export type PaceStatus = 'behind' | 'on-track' | 'ahead';
|
|
5
|
+
/** Under 85% of the pace a goal needs is behind; over 115% is ahead. */
|
|
6
|
+
declare function paceStatusOf(value: number, target: number): PaceStatus;
|
|
7
|
+
export interface PaceBadgeProps extends Omit<React.ComponentProps<typeof Badge>, 'variant'> {
|
|
8
|
+
status: PaceStatus;
|
|
9
|
+
}
|
|
10
|
+
/** Behind, On track or Ahead, in the status's color. Children replace the label. */
|
|
11
|
+
declare function PaceBadge({ status, size, children, ...props }: PaceBadgeProps): React.JSX.Element;
|
|
12
|
+
export interface PaceMeterProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
13
|
+
/** Where things stand now, such as the last 7 days. */
|
|
14
|
+
value: number;
|
|
15
|
+
/** The pace the goal needs. Drawn as the tick. */
|
|
16
|
+
target: number;
|
|
17
|
+
/** The end of the bar. Defaults to half again past the target, or the value if higher. */
|
|
18
|
+
max?: number;
|
|
19
|
+
/** Colors the fill. Defaults to `paceStatusOf(value, target)`. */
|
|
20
|
+
status?: PaceStatus;
|
|
21
|
+
/** Accessible name. Defaults to "value of target". */
|
|
22
|
+
'aria-label'?: string;
|
|
23
|
+
}
|
|
24
|
+
/** A bar of the current pace against the pace a goal needs; the tick marks the target. */
|
|
25
|
+
declare function PaceMeter({ value, target, max: maxProp, status, className, 'aria-label': ariaLabel, ...props }: PaceMeterProps): React.JSX.Element;
|
|
26
|
+
export interface GoalCardProps extends Omit<React.ComponentProps<typeof Card>, 'children'> {
|
|
27
|
+
/** What the goal is about, such as a channel or a site. */
|
|
28
|
+
label: React.ReactNode;
|
|
29
|
+
/** A 16px mark before the label. */
|
|
30
|
+
icon?: React.ReactNode;
|
|
31
|
+
/** Something small after the label, such as a "changed" dot. */
|
|
32
|
+
indicator?: React.ReactNode;
|
|
33
|
+
/** The current pace, as a number, for the meter. */
|
|
34
|
+
value: number;
|
|
35
|
+
/** The pace the goal needs. */
|
|
36
|
+
target: number;
|
|
37
|
+
/** How the value reads. Defaults to the value with thousands separators. */
|
|
38
|
+
valueLabel?: React.ReactNode;
|
|
39
|
+
/** The line under the value, such as "new followers last 7 days". */
|
|
40
|
+
unit?: React.ReactNode;
|
|
41
|
+
/** The line under the meter. Defaults to "Target {target}". */
|
|
42
|
+
targetLabel?: React.ReactNode;
|
|
43
|
+
/** Overrides the status worked out from value and target. */
|
|
44
|
+
status?: PaceStatus;
|
|
45
|
+
/** Makes the whole card a button. */
|
|
46
|
+
onOpen?: () => void;
|
|
47
|
+
}
|
|
48
|
+
/** One goal: its status, the current number, a pace meter and the pace it needs. */
|
|
49
|
+
declare function GoalCard({ label, icon, indicator, value, target, valueLabel, unit, targetLabel, status: statusProp, onOpen, className, onKeyDown, ...props }: GoalCardProps): React.JSX.Element;
|
|
50
|
+
export { GoalCard, PaceBadge, PaceMeter, paceStatusOf };
|
|
51
|
+
//# sourceMappingURL=goal-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-card.d.ts","sourceRoot":"","sources":["../../../src/components/goal-card/goal-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAIxC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAA;AAExD,wEAAwE;AACxE,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAI/D;AAqBD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAClC,SAAS,CACV;IACC,MAAM,EAAE,UAAU,CAAA;CACnB;AAED,oFAAoF;AACpF,iBAAS,SAAS,CAAC,EACjB,MAAM,EACN,IAAW,EACX,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,qBAWhB;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,UAAU,CACX;IACC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAA;IACd,0FAA0F;IAC1F,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kEAAkE;IAClE,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,0FAA0F;AAC1F,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,MAAM,EACN,GAAG,EAAE,OAAO,EACZ,MAAM,EACN,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,cAAc,qBAyBhB;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EACjC,UAAU,CACX;IACC,2DAA2D;IAC3D,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,oCAAoC;IACpC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,gEAAgE;IAChE,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,4EAA4E;IAC5E,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,qEAAqE;IACrE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,oFAAoF;AACpF,iBAAS,QAAQ,CAAC,EAChB,KAAK,EACL,IAAI,EACJ,SAAS,EACT,KAAK,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,WAAW,EACX,MAAM,EAAE,UAAU,EAClB,MAAM,EACN,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACT,EAAE,aAAa,qBAgDf;AAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Card as t } from "../card/card.js";
|
|
3
|
+
import { Badge as n } from "../badge/badge.js";
|
|
4
|
+
import { Progress as r } from "../progress/progress.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/goal-card/goal-card.tsx
|
|
8
|
+
function o(e, t) {
|
|
9
|
+
return e < t * .85 ? "behind" : e > t * 1.15 ? "ahead" : "on-track";
|
|
10
|
+
}
|
|
11
|
+
var s = {
|
|
12
|
+
behind: "Behind",
|
|
13
|
+
"on-track": "On track",
|
|
14
|
+
ahead: "Ahead"
|
|
15
|
+
}, c = {
|
|
16
|
+
behind: "warning",
|
|
17
|
+
"on-track": "success",
|
|
18
|
+
ahead: "info"
|
|
19
|
+
}, l = {
|
|
20
|
+
behind: "[&_[data-slot=progress-indicator]]:bg-warning",
|
|
21
|
+
"on-track": "[&_[data-slot=progress-indicator]]:bg-success",
|
|
22
|
+
ahead: "[&_[data-slot=progress-indicator]]:bg-primary"
|
|
23
|
+
};
|
|
24
|
+
function u({ status: e, size: t = "md", children: r, ...a }) {
|
|
25
|
+
return /* @__PURE__ */ i(n, {
|
|
26
|
+
"data-pace": e,
|
|
27
|
+
variant: c[e],
|
|
28
|
+
size: t,
|
|
29
|
+
...a,
|
|
30
|
+
children: r ?? s[e]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function d({ value: t, target: n, max: s, status: c, className: u, "aria-label": d, ...f }) {
|
|
34
|
+
let p = s ?? Math.max(n * 1.5, t, 1), m = c ?? o(t, n);
|
|
35
|
+
return /* @__PURE__ */ a("div", {
|
|
36
|
+
"data-slot": "pace-meter",
|
|
37
|
+
"data-pace": m,
|
|
38
|
+
className: e("relative py-1", u),
|
|
39
|
+
...f,
|
|
40
|
+
children: [/* @__PURE__ */ i(r, {
|
|
41
|
+
value: Math.max(1.5, Math.max(0, t) / p * 100),
|
|
42
|
+
"aria-label": d ?? `${t} of ${n}`,
|
|
43
|
+
className: e("[&_[data-slot=progress-track]]:h-2", l[m])
|
|
44
|
+
}), /* @__PURE__ */ i("span", {
|
|
45
|
+
"data-slot": "pace-meter-target",
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: "absolute top-0 h-4 w-0.5 rounded-full bg-foreground",
|
|
48
|
+
style: { left: `calc(${Math.min(100, n / p * 100)}% - 1px)` }
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function f({ label: n, icon: r, indicator: s, value: c, target: l, valueLabel: f, unit: p, targetLabel: m, status: h, onOpen: g, className: _, onKeyDown: v, ...y }) {
|
|
53
|
+
let b = h ?? o(c, l), x = !!g;
|
|
54
|
+
return /* @__PURE__ */ a(t, {
|
|
55
|
+
"data-slot": "goal-card",
|
|
56
|
+
"data-pace": b,
|
|
57
|
+
role: x ? "button" : void 0,
|
|
58
|
+
tabIndex: x ? 0 : void 0,
|
|
59
|
+
onClick: g,
|
|
60
|
+
onKeyDown: (e) => {
|
|
61
|
+
v?.(e), !(!g || e.defaultPrevented) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), g());
|
|
62
|
+
},
|
|
63
|
+
className: e("gap-0 p-4", x && "cursor-pointer transition-colors hover:border-ring focus-visible:border-ring focus-visible:outline-none", _),
|
|
64
|
+
...y,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ a("div", {
|
|
67
|
+
"data-slot": "goal-card-header",
|
|
68
|
+
className: "flex items-center gap-2",
|
|
69
|
+
children: [
|
|
70
|
+
r ? /* @__PURE__ */ i("span", {
|
|
71
|
+
className: "flex flex-none [&>svg]:size-4",
|
|
72
|
+
children: r
|
|
73
|
+
}) : null,
|
|
74
|
+
/* @__PURE__ */ i("span", {
|
|
75
|
+
className: "type-label min-w-0 truncate",
|
|
76
|
+
children: n
|
|
77
|
+
}),
|
|
78
|
+
s
|
|
79
|
+
]
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ i("div", {
|
|
82
|
+
className: "mt-3",
|
|
83
|
+
children: /* @__PURE__ */ i(u, { status: b })
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ i("p", {
|
|
86
|
+
className: "type-metric mt-3",
|
|
87
|
+
children: f ?? c.toLocaleString("en-US")
|
|
88
|
+
}),
|
|
89
|
+
p ? /* @__PURE__ */ i("p", {
|
|
90
|
+
className: "type-meta text-muted-foreground",
|
|
91
|
+
children: p
|
|
92
|
+
}) : null,
|
|
93
|
+
/* @__PURE__ */ i("div", {
|
|
94
|
+
className: "mt-3",
|
|
95
|
+
children: /* @__PURE__ */ i(d, {
|
|
96
|
+
value: c,
|
|
97
|
+
target: l,
|
|
98
|
+
status: b
|
|
99
|
+
})
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ i("p", {
|
|
102
|
+
className: "type-meta mt-1.5 text-muted-foreground",
|
|
103
|
+
children: m ?? `Target ${l.toLocaleString("en-US")}`
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { f as GoalCard, u as PaceBadge, d as PaceMeter, o as paceStatusOf };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/goal-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -9,7 +9,7 @@ declare const inputGroupVariants: (props?: ({
|
|
|
9
9
|
type InputGroupProps = React.ComponentProps<'div'> & VariantProps<typeof inputGroupVariants>;
|
|
10
10
|
declare function InputGroup({ className, size, ...props }: InputGroupProps): React.JSX.Element;
|
|
11
11
|
declare const inputGroupAddonVariants: (props?: ({
|
|
12
|
-
align?: "inline-
|
|
12
|
+
align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
|
|
13
13
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
14
14
|
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
15
15
|
declare const inputGroupButtonVariants: (props?: ({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-thumbnail/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const mediaThumbnailVariants: (props?: ({
|
|
4
|
+
shape?: "cover" | "square" | null | undefined;
|
|
5
|
+
tone?: "blue" | "green" | "violet" | "neutral" | "amber" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
type MediaThumbnailProps = Omit<React.ComponentProps<'span'>, 'children'> & VariantProps<typeof mediaThumbnailVariants> & {
|
|
8
|
+
/** The picture. Without one, the tile shows its tone with `icon`. */
|
|
9
|
+
src?: string | null;
|
|
10
|
+
/** Text alternative. Empty by default, since the item's title says what it is. */
|
|
11
|
+
alt?: string;
|
|
12
|
+
/** Drawn at 28px in the tone's color when there is no picture. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* An item's picture, or its category's color with an icon when it has none.
|
|
17
|
+
* `shape` sets the size and corners; `tone` the color of the empty tile.
|
|
18
|
+
*/
|
|
19
|
+
declare function MediaThumbnail({ src, alt, icon, shape, tone, className, ...props }: MediaThumbnailProps): React.JSX.Element;
|
|
20
|
+
export { MediaThumbnail, mediaThumbnailVariants, type MediaThumbnailProps };
|
|
21
|
+
//# sourceMappingURL=media-thumbnail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-thumbnail.d.ts","sourceRoot":"","sources":["../../../src/components/media-thumbnail/media-thumbnail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,sBAAsB;;;8EAuB3B,CAAA;AAED,KAAK,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GACvE,YAAY,CAAC,OAAO,sBAAsB,CAAC,GAAG;IAC5C,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,kFAAkF;IAClF,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kEAAkE;IAClE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB,CAAA;AAEH;;;GAGG;AACH,iBAAS,cAAc,CAAC,EACtB,GAAG,EACH,GAAQ,EACR,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,mBAAmB,qBAkCrB;AAED,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,KAAK,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cva as t } from "class-variance-authority";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/media-thumbnail/media-thumbnail.tsx
|
|
6
|
+
var r = t("flex shrink-0 items-center justify-center overflow-hidden", {
|
|
7
|
+
variants: {
|
|
8
|
+
shape: {
|
|
9
|
+
square: "size-13 rounded-sm",
|
|
10
|
+
cover: "aspect-video w-full"
|
|
11
|
+
},
|
|
12
|
+
tone: {
|
|
13
|
+
neutral: "bg-surface-subtle text-muted-foreground",
|
|
14
|
+
blue: "bg-tone-blue-soft text-tone-blue",
|
|
15
|
+
violet: "bg-tone-violet-soft text-tone-violet",
|
|
16
|
+
amber: "bg-tone-amber-soft text-tone-amber",
|
|
17
|
+
green: "bg-tone-green-soft text-tone-green"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
shape: "square",
|
|
22
|
+
tone: "neutral"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
function i({ src: t, alt: i = "", icon: a, shape: o, tone: s, className: c, ...l }) {
|
|
26
|
+
return t ? /* @__PURE__ */ n("img", {
|
|
27
|
+
"data-slot": "media-thumbnail",
|
|
28
|
+
"data-shape": o ?? "square",
|
|
29
|
+
src: t,
|
|
30
|
+
alt: i,
|
|
31
|
+
className: e(r({ shape: o }), "bg-surface-subtle object-cover", c),
|
|
32
|
+
...l
|
|
33
|
+
}) : /* @__PURE__ */ n("span", {
|
|
34
|
+
"data-slot": "media-thumbnail",
|
|
35
|
+
"data-shape": o ?? "square",
|
|
36
|
+
"data-tone": s ?? "neutral",
|
|
37
|
+
...i ? {
|
|
38
|
+
role: "img",
|
|
39
|
+
"aria-label": i
|
|
40
|
+
} : { "aria-hidden": !0 },
|
|
41
|
+
className: e(r({
|
|
42
|
+
shape: o,
|
|
43
|
+
tone: s
|
|
44
|
+
}), "[--icon-stroke-width:var(--icon-stroke-32)] [&>svg]:size-7", c),
|
|
45
|
+
...l,
|
|
46
|
+
children: a
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { i as MediaThumbnail, r as mediaThumbnailVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/metric-tile/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const metricTileVariants: (props?: ({
|
|
4
|
+
variant?: "subtle" | "plain" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
declare const metricTileValueVariants: (props?: ({
|
|
7
|
+
size?: "md" | "lg" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export interface MetricTileDelta {
|
|
10
|
+
/** Which way the number moved. Draws the arrow. */
|
|
11
|
+
trend: 'up' | 'down';
|
|
12
|
+
/** Whether the move is good news. Defaults to up being good. */
|
|
13
|
+
tone?: 'positive' | 'negative';
|
|
14
|
+
/** The comparison, such as "vs 120 the 7 days before". */
|
|
15
|
+
label: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export interface MetricTileProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof metricTileVariants>, VariantProps<typeof metricTileValueVariants> {
|
|
18
|
+
/** What the number counts. With an icon, the label reads as the tile's heading. */
|
|
19
|
+
label: React.ReactNode;
|
|
20
|
+
/** A mark before the label, such as a channel's icon on its tint. */
|
|
21
|
+
icon?: React.ReactNode;
|
|
22
|
+
/** The number itself, already formatted. */
|
|
23
|
+
value: React.ReactNode;
|
|
24
|
+
/** The line right under the value, such as "followers". */
|
|
25
|
+
unit?: React.ReactNode;
|
|
26
|
+
/** The change against an earlier period, with an arrow. */
|
|
27
|
+
delta?: MetricTileDelta;
|
|
28
|
+
/** A closing line, such as "so far" or "120 a day". */
|
|
29
|
+
note?: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/** One number with its label, an optional change against before, and a note. */
|
|
32
|
+
declare function MetricTile({ label, icon, value, unit, delta, note, variant, size, className, ...props }: MetricTileProps): React.JSX.Element;
|
|
33
|
+
export { MetricTile, metricTileVariants };
|
|
34
|
+
//# sourceMappingURL=metric-tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metric-tile.d.ts","sourceRoot":"","sources":["../../../src/components/metric-tile/metric-tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,kBAAkB;;8EAYtB,CAAA;AAEF,QAAA,MAAM,uBAAuB;;8EAU3B,CAAA;AAEF,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;IACpB,gEAAgE;IAChE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;IAC9B,0DAA0D;IAC1D,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,MAAM,WAAW,eACf,SACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,EAC7C,YAAY,CAAC,OAAO,kBAAkB,CAAC,EACvC,YAAY,CAAC,OAAO,uBAAuB,CAAC;IAC9C,mFAAmF;IACnF,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,qEAAqE;IACrE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,4CAA4C;IAC5C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,uDAAuD;IACvD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,gFAAgF;AAChF,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,qBAoEjB;AAED,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cva as t } from "class-variance-authority";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { IconArrowDownRight as i, IconArrowUpRight as a } from "@tabler/icons-react";
|
|
6
|
+
//#region src/components/metric-tile/metric-tile.tsx
|
|
7
|
+
var o = t("flex min-w-0 flex-col", {
|
|
8
|
+
variants: { variant: {
|
|
9
|
+
subtle: "rounded-xl bg-surface-subtle px-4 py-3",
|
|
10
|
+
plain: ""
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { variant: "subtle" }
|
|
13
|
+
}), s = t("tabular-nums", {
|
|
14
|
+
variants: { size: {
|
|
15
|
+
lg: "type-page-title",
|
|
16
|
+
md: "type-metric"
|
|
17
|
+
} },
|
|
18
|
+
defaultVariants: { size: "lg" }
|
|
19
|
+
});
|
|
20
|
+
function c({ label: t, icon: c, value: l, unit: u, delta: d, note: f, variant: p, size: m, className: h, ...g }) {
|
|
21
|
+
let _ = d?.tone ?? (d?.trend === "down" ? "negative" : "positive"), v = d?.trend === "down" ? i : a;
|
|
22
|
+
return /* @__PURE__ */ r("div", {
|
|
23
|
+
"data-slot": "metric-tile",
|
|
24
|
+
"data-variant": p ?? "subtle",
|
|
25
|
+
className: e(o({ variant: p }), h),
|
|
26
|
+
...g,
|
|
27
|
+
children: [
|
|
28
|
+
c ? /* @__PURE__ */ r("p", {
|
|
29
|
+
"data-slot": "metric-tile-label",
|
|
30
|
+
className: "type-label flex items-center gap-2 font-medium",
|
|
31
|
+
children: [c, t]
|
|
32
|
+
}) : /* @__PURE__ */ n("p", {
|
|
33
|
+
"data-slot": "metric-tile-label",
|
|
34
|
+
className: "type-meta text-muted-foreground",
|
|
35
|
+
children: t
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ n("p", {
|
|
38
|
+
"data-slot": "metric-tile-value",
|
|
39
|
+
className: e(s({ size: m }), c ? "mt-5" : m === "md" && "mt-0.5"),
|
|
40
|
+
children: l
|
|
41
|
+
}),
|
|
42
|
+
u ? /* @__PURE__ */ n("div", {
|
|
43
|
+
className: "type-meta text-muted-foreground",
|
|
44
|
+
children: u
|
|
45
|
+
}) : null,
|
|
46
|
+
d ? /* @__PURE__ */ r("p", {
|
|
47
|
+
"data-slot": "metric-tile-delta",
|
|
48
|
+
"data-trend": d.trend,
|
|
49
|
+
className: "type-meta mt-0.5 flex items-center gap-1 text-muted-foreground",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ n(v, {
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
className: e("icon-optical-14 shrink-0", _ === "positive" ? "text-success" : "text-warning")
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ r("span", {
|
|
56
|
+
className: "sr-only",
|
|
57
|
+
children: [
|
|
58
|
+
d.trend === "up" ? "Up" : "Down",
|
|
59
|
+
",",
|
|
60
|
+
" "
|
|
61
|
+
]
|
|
62
|
+
}),
|
|
63
|
+
d.label
|
|
64
|
+
]
|
|
65
|
+
}) : null,
|
|
66
|
+
f ? /* @__PURE__ */ n("div", {
|
|
67
|
+
"data-slot": "metric-tile-note",
|
|
68
|
+
className: "type-meta text-muted-foreground",
|
|
69
|
+
children: f
|
|
70
|
+
}) : null
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { c as MetricTile, o as metricTileVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/page-header/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type PageHeaderProps = Omit<React.ComponentProps<'header'>, 'title'> & {
|
|
3
|
+
/** The page title. */
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
/** One muted line under the title. */
|
|
6
|
+
subtitle?: React.ReactNode;
|
|
7
|
+
/** A small line above the title, such as today's date. */
|
|
8
|
+
eyebrow?: React.ReactNode;
|
|
9
|
+
/** The page's own actions, top right. */
|
|
10
|
+
actions?: React.ReactNode;
|
|
11
|
+
/** Use the display title (a greeting or editorial title) instead of the page title. */
|
|
12
|
+
display?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare function PageHeader({ title, subtitle, eyebrow, actions, display, className, ...props }: PageHeaderProps): React.JSX.Element;
|
|
15
|
+
export { PageHeader, type PageHeaderProps };
|
|
16
|
+
//# sourceMappingURL=page-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../../src/components/page-header/page-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,GAAG;IACrE,sBAAsB;IACtB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,0DAA0D;IAC1D,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,yCAAyC;IACzC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,qBAyCjB;AAED,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/page-header/page-header.tsx
|
|
5
|
+
function r({ title: r, subtitle: i, eyebrow: a, actions: o, display: s = !1, className: c, ...l }) {
|
|
6
|
+
return /* @__PURE__ */ n("header", {
|
|
7
|
+
"data-slot": "page-header",
|
|
8
|
+
className: e("flex items-start justify-between gap-6", c),
|
|
9
|
+
...l,
|
|
10
|
+
children: [/* @__PURE__ */ n("div", {
|
|
11
|
+
"data-slot": "page-header-content",
|
|
12
|
+
className: "min-w-0",
|
|
13
|
+
children: [
|
|
14
|
+
a ? /* @__PURE__ */ t("p", {
|
|
15
|
+
"data-slot": "page-header-eyebrow",
|
|
16
|
+
className: "type-meta mb-1.5 font-medium text-muted-foreground",
|
|
17
|
+
children: a
|
|
18
|
+
}) : null,
|
|
19
|
+
/* @__PURE__ */ t("h1", {
|
|
20
|
+
"data-slot": "page-header-title",
|
|
21
|
+
className: s ? "type-display-title" : "type-page-title",
|
|
22
|
+
children: r
|
|
23
|
+
}),
|
|
24
|
+
i ? /* @__PURE__ */ t("p", {
|
|
25
|
+
"data-slot": "page-header-subtitle",
|
|
26
|
+
className: "type-lead mt-2 max-w-[760px] text-muted-foreground",
|
|
27
|
+
children: i
|
|
28
|
+
}) : null
|
|
29
|
+
]
|
|
30
|
+
}), o ? /* @__PURE__ */ t("div", {
|
|
31
|
+
"data-slot": "page-header-actions",
|
|
32
|
+
className: "flex flex-none items-center gap-2",
|
|
33
|
+
children: o
|
|
34
|
+
}) : null]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { r as PageHeader };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/platform-avatar/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Avatar } from '../avatar';
|
|
2
|
+
import { Platform } from '../platform-icon/platform-icon';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
type PlatformAvatarProps = Omit<React.ComponentProps<typeof Avatar>, 'size' | 'children' | 'style'> & {
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
/** Profile photo. Without one, or while it loads, the first letter of `name` shows. */
|
|
7
|
+
src?: string | null;
|
|
8
|
+
/** Account or person name; its first letter is the fallback. A leading @ is skipped. */
|
|
9
|
+
name?: string;
|
|
10
|
+
/** Text alternative for the photo. Empty by default, since a name usually sits beside it. */
|
|
11
|
+
alt?: string;
|
|
12
|
+
/** Diameter in pixels. The scorecard uses 18, 20, 24, 26 and 32. */
|
|
13
|
+
size?: number;
|
|
14
|
+
/** Shows the platform's mark in a small badge at the bottom-right corner. */
|
|
15
|
+
platform?: Platform;
|
|
16
|
+
/** Names the badge's platform for assistive tech when no visible text says it. */
|
|
17
|
+
platformLabel?: string | boolean;
|
|
18
|
+
/** `cover` fills the circle with a photo; `contain` insets a logo on the card surface with a hairline ring. */
|
|
19
|
+
fit?: 'cover' | 'contain';
|
|
20
|
+
};
|
|
21
|
+
declare function PlatformAvatar({ src, name, alt, size, platform, platformLabel, fit, className, style, ...props }: PlatformAvatarProps): React.JSX.Element;
|
|
22
|
+
export { PlatformAvatar, type PlatformAvatarProps };
|
|
23
|
+
//# sourceMappingURL=platform-avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-avatar.d.ts","sourceRoot":"","sources":["../../../src/components/platform-avatar/platform-avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAE,MAAM,EAA+B,MAAM,WAAW,CAAA;AAC/D,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,gCAAgC,CAAA;AAEvC,KAAK,mBAAmB,GAAG,IAAI,CAC7B,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EACnC,MAAM,GAAG,UAAU,GAAG,OAAO,CAC9B,GAAG;IACF,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,uFAAuF;IACvF,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,6FAA6F;IAC7F,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,kFAAkF;IAClF,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAChC,+GAA+G;IAC/G,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC1B,CAAA;AAWD,iBAAS,cAAc,CAAC,EACtB,GAAG,EACH,IAAI,EACJ,GAAQ,EACR,IAAS,EACT,QAAQ,EACR,aAAa,EACb,GAAa,EACb,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,mBAAmB,qBAkDrB;AAED,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Avatar as t, AvatarFallback as n, AvatarImage as r } from "../avatar/avatar.js";
|
|
3
|
+
import { PLATFORM_LABEL as i, PlatformIcon as a } from "../platform-icon/platform-icon.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/platform-avatar/platform-avatar.tsx
|
|
7
|
+
function c(e) {
|
|
8
|
+
return (e ?? "").replace(/^@/, "").charAt(0).toUpperCase();
|
|
9
|
+
}
|
|
10
|
+
function l(e) {
|
|
11
|
+
return Math.max(10, Math.round(e * .45));
|
|
12
|
+
}
|
|
13
|
+
function u({ src: u, name: d, alt: f = "", size: p = 24, platform: m, platformLabel: h, fit: g = "cover", className: _, style: v, ...y }) {
|
|
14
|
+
let b = l(p), x = m && h ? typeof h == "string" ? h : i[m] : void 0;
|
|
15
|
+
return /* @__PURE__ */ s(t, {
|
|
16
|
+
"data-platform": m,
|
|
17
|
+
"data-fit": g,
|
|
18
|
+
className: e("bg-surface-subtle after:hidden", g === "contain" && "bg-card ring-1 ring-border-subtle", _),
|
|
19
|
+
style: {
|
|
20
|
+
width: p,
|
|
21
|
+
height: p,
|
|
22
|
+
"--platform-avatar-size": `${p}px`,
|
|
23
|
+
...v
|
|
24
|
+
},
|
|
25
|
+
...y,
|
|
26
|
+
children: [
|
|
27
|
+
u ? /* @__PURE__ */ o(r, {
|
|
28
|
+
src: u,
|
|
29
|
+
alt: f,
|
|
30
|
+
className: e(g === "contain" && "bg-card object-contain p-0.5")
|
|
31
|
+
}) : null,
|
|
32
|
+
/* @__PURE__ */ o(n, {
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
className: "bg-surface-subtle font-medium text-muted-foreground text-[length:calc(var(--platform-avatar-size)*0.45)]",
|
|
35
|
+
children: c(d)
|
|
36
|
+
}),
|
|
37
|
+
m ? /* @__PURE__ */ o("span", {
|
|
38
|
+
"data-slot": "platform-avatar-badge",
|
|
39
|
+
className: "absolute -right-0.5 -bottom-0.5 z-10 flex items-center justify-center rounded-full bg-card ring-2 ring-card",
|
|
40
|
+
style: {
|
|
41
|
+
width: b,
|
|
42
|
+
height: b
|
|
43
|
+
},
|
|
44
|
+
children: /* @__PURE__ */ o(a, {
|
|
45
|
+
platform: m,
|
|
46
|
+
size: b - 2,
|
|
47
|
+
title: x
|
|
48
|
+
})
|
|
49
|
+
}) : null
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { u as PlatformAvatar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/platform-icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type Platform = 'x' | 'threads' | 'instagram' | 'facebook' | 'bluesky' | 'linkedin' | 'tiktok' | 'youtube' | 'google' | 'beehiiv' | 'reddit';
|
|
3
|
+
declare const PLATFORMS: readonly Platform[];
|
|
4
|
+
declare const PLATFORM_COLOR: Record<Platform, string>;
|
|
5
|
+
declare const PLATFORM_LABEL: Record<Platform, string>;
|
|
6
|
+
type BrandIconProps = Omit<React.SVGProps<SVGSVGElement>, 'ref' | 'stroke'> & {
|
|
7
|
+
size?: number | string;
|
|
8
|
+
stroke?: number | string;
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
type BrandIcon = React.ForwardRefExoticComponent<BrandIconProps & React.RefAttributes<SVGSVGElement>>;
|
|
12
|
+
declare const BrandX: BrandIcon;
|
|
13
|
+
declare const BrandThreads: BrandIcon;
|
|
14
|
+
declare const BrandFacebook: BrandIcon;
|
|
15
|
+
declare const BrandLinkedin: BrandIcon;
|
|
16
|
+
declare const BrandTiktok: BrandIcon;
|
|
17
|
+
declare const BrandYoutube: BrandIcon;
|
|
18
|
+
declare const BrandReddit: BrandIcon;
|
|
19
|
+
declare const BrandBluesky: BrandIcon;
|
|
20
|
+
declare const BrandInstagram: BrandIcon;
|
|
21
|
+
declare const BrandGoogle: BrandIcon;
|
|
22
|
+
declare const BrandBeehiiv: BrandIcon;
|
|
23
|
+
declare const PLATFORM_ICON: Record<Platform, BrandIcon>;
|
|
24
|
+
type PlatformIconProps = Omit<BrandIconProps, 'size'> & {
|
|
25
|
+
platform: Platform;
|
|
26
|
+
/** Rendered width and height in pixels. */
|
|
27
|
+
size?: number;
|
|
28
|
+
/** Names the mark for assistive tech; omit when a visible label says the platform. */
|
|
29
|
+
title?: string;
|
|
30
|
+
};
|
|
31
|
+
declare function PlatformIcon({ platform, size, className, style, ...props }: PlatformIconProps): React.JSX.Element;
|
|
32
|
+
export { PlatformIcon, PLATFORMS, PLATFORM_COLOR, PLATFORM_ICON, PLATFORM_LABEL, BrandX, BrandThreads, BrandInstagram, BrandFacebook, BrandBluesky, BrandLinkedin, BrandTiktok, BrandYoutube, BrandGoogle, BrandBeehiiv, BrandReddit, type BrandIcon, type BrandIconProps, type Platform, type PlatformIconProps, };
|
|
33
|
+
//# sourceMappingURL=platform-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-icon.d.ts","sourceRoot":"","sources":["../../../src/components/platform-icon/platform-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAuB9B,KAAK,QAAQ,GACT,GAAG,GACH,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,UAAU,GACV,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,CAAA;AAEZ,QAAA,MAAM,SAAS,EAAE,SAAS,QAAQ,EAYjC,CAAA;AAID,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAY5C,CAAA;AAED,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAY5C,CAAA;AAMD,KAAK,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,GAAG;IAC5E,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,SAAS,GAAG,KAAK,CAAC,yBAAyB,CAC9C,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CACpD,CAAA;AAqCD,QAAA,MAAM,MAAM,WAAkD,CAAA;AAC9D,QAAA,MAAM,YAAY,WAA8D,CAAA;AAChF,QAAA,MAAM,aAAa,WAIlB,CAAA;AACD,QAAA,MAAM,aAAa,WAIlB,CAAA;AACD,QAAA,MAAM,WAAW,WAIhB,CAAA;AACD,QAAA,MAAM,YAAY,WAIjB,CAAA;AACD,QAAA,MAAM,WAAW,WAA2D,CAAA;AAE5E,QAAA,MAAM,YAAY,WAKjB,CAAA;AAmCD,QAAA,MAAM,cAAc,WAgBlB,CAAA;AAGF,QAAA,MAAM,WAAW,WAmBf,CAAA;AAGF,QAAA,MAAM,YAAY,WAYhB,CAAA;AAEF,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,CAY9C,CAAA;AAED,KAAK,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IACtD,QAAQ,EAAE,QAAQ,CAAA;IAClB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,IAAS,EACT,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAanB;AAED,OAAO,EACL,YAAY,EACZ,SAAS,EACT,cAAc,EACd,aAAa,EACb,cAAc,EACd,MAAM,EACN,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,iBAAiB,GACvB,CAAA"}
|