@almanaclabs/blaze-ui 0.12.0 → 0.14.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/approval-card/approval-card.d.ts +8 -1
- package/dist/components/approval-card/approval-card.d.ts.map +1 -1
- package/dist/components/approval-card/approval-card.js +47 -34
- package/dist/components/button/button.d.ts +3 -2
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +17 -9
- package/dist/components/detail-list/detail-list.d.ts +25 -0
- package/dist/components/detail-list/detail-list.d.ts.map +1 -0
- package/dist/components/detail-list/detail-list.js +38 -0
- package/dist/components/detail-list/index.d.ts +2 -0
- package/dist/components/detail-list/index.d.ts.map +1 -0
- package/dist/components/filter-chips/filter-chips.d.ts +2 -0
- package/dist/components/filter-chips/filter-chips.d.ts.map +1 -1
- package/dist/components/filter-chips/filter-chips.js +10 -6
- package/dist/components/item/item.d.ts +1 -1
- package/dist/components/marker/marker.d.ts +1 -1
- package/dist/components/metric-tile/metric-tile.d.ts +4 -2
- package/dist/components/metric-tile/metric-tile.d.ts.map +1 -1
- package/dist/components/metric-tile/metric-tile.js +51 -45
- package/dist/components/platform-icon/channel-color.d.ts +15 -0
- package/dist/components/platform-icon/channel-color.d.ts.map +1 -0
- package/dist/components/platform-icon/channel-color.js +20 -0
- package/dist/components/platform-icon/index.d.ts +2 -0
- package/dist/components/platform-icon/index.d.ts.map +1 -1
- package/dist/components/platform-icon/letter-mark.d.ts +20 -0
- package/dist/components/platform-icon/letter-mark.d.ts.map +1 -0
- package/dist/components/platform-icon/letter-mark.js +34 -0
- package/dist/components/platform-icon/platform-icon.d.ts +8 -2
- package/dist/components/platform-icon/platform-icon.d.ts.map +1 -1
- package/dist/components/platform-icon/platform-icon.js +69 -45
- package/dist/components/rating/index.d.ts +2 -0
- package/dist/components/rating/index.d.ts.map +1 -0
- package/dist/components/rating/rating.d.ts +15 -0
- package/dist/components/rating/rating.d.ts.map +1 -0
- package/dist/components/rating/rating.js +27 -0
- package/dist/components/section-header/index.d.ts +2 -0
- package/dist/components/section-header/index.d.ts.map +1 -0
- package/dist/components/section-header/section-header.d.ts +20 -0
- package/dist/components/section-header/section-header.d.ts.map +1 -0
- package/dist/components/section-header/section-header.js +32 -0
- package/dist/components/sparkline/index.d.ts +2 -0
- package/dist/components/sparkline/index.d.ts.map +1 -0
- package/dist/components/sparkline/sparkline.d.ts +19 -0
- package/dist/components/sparkline/sparkline.d.ts.map +1 -0
- package/dist/components/sparkline/sparkline.js +69 -0
- package/dist/components/stacked-bar-chart/stacked-bar-chart.d.ts +6 -0
- package/dist/components/stacked-bar-chart/stacked-bar-chart.d.ts.map +1 -1
- package/dist/components/stacked-bar-chart/stacked-bar-chart.js +81 -54
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tag/index.d.ts +2 -0
- package/dist/components/tag/index.d.ts.map +1 -0
- package/dist/components/tag/tag.d.ts +25 -0
- package/dist/components/tag/tag.d.ts.map +1 -0
- package/dist/components/tag/tag.js +60 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +47 -40
- package/package.json +1 -1
- package/src/styles/globals.css +181 -0
|
@@ -8,12 +8,19 @@ type ApprovalCardProps = Omit<React.ComponentProps<'article'>, 'title'> & {
|
|
|
8
8
|
description?: React.ReactNode;
|
|
9
9
|
/** The primary action at the right, usually a `Button`. */
|
|
10
10
|
action?: React.ReactNode;
|
|
11
|
+
/** A menu trigger after the action, such as a ⋯ `DropdownMenu` (ADR 0027). */
|
|
12
|
+
menu?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Full-width content under the header, such as the quoted draft being
|
|
15
|
+
* approved. With a body, the action sits at the top right.
|
|
16
|
+
*/
|
|
17
|
+
body?: React.ReactNode;
|
|
11
18
|
};
|
|
12
19
|
/**
|
|
13
20
|
* A request waiting for the owner, as in a "For your approval" list: an
|
|
14
21
|
* eyebrow, a title, one muted line, and the action at the right. `children`
|
|
15
22
|
* sit under the description, for a preview or extra detail.
|
|
16
23
|
*/
|
|
17
|
-
declare function ApprovalCard({ eyebrow, title, description, action, className, children, ...props }: ApprovalCardProps): React.JSX.Element;
|
|
24
|
+
declare function ApprovalCard({ eyebrow, title, description, action, menu, body, className, children, ...props }: ApprovalCardProps): React.JSX.Element;
|
|
18
25
|
export { ApprovalCard, type ApprovalCardProps };
|
|
19
26
|
//# sourceMappingURL=approval-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-card.d.ts","sourceRoot":"","sources":["../../../src/components/approval-card/approval-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,GAAG;IACxE,wEAAwE;IACxE,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,qCAAqC;IACrC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,iCAAiC;IACjC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"approval-card.d.ts","sourceRoot":"","sources":["../../../src/components/approval-card/approval-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,GAAG;IACxE,wEAAwE;IACxE,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,qCAAqC;IACrC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,iCAAiC;IACjC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB,CAAA;AAED;;;;GAIG;AACH,iBAAS,YAAY,CAAC,EACpB,OAAO,EACP,KAAK,EACL,WAAW,EACX,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAgFnB;AAED,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,42 +1,55 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/approval-card/approval-card.tsx
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
|
|
5
|
+
function a({ eyebrow: a, title: o, description: s, action: c, menu: l, body: u, className: d, children: f, ...p }) {
|
|
6
|
+
let m = t.useId(), h = /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ i("div", {
|
|
7
|
+
"data-slot": "approval-card-content",
|
|
8
|
+
className: "min-w-0 flex-1",
|
|
9
|
+
children: [
|
|
10
|
+
a ? /* @__PURE__ */ r("p", {
|
|
11
|
+
"data-slot": "approval-card-eyebrow",
|
|
12
|
+
className: "type-meta text-muted-foreground",
|
|
13
|
+
children: a
|
|
14
|
+
}) : null,
|
|
15
|
+
/* @__PURE__ */ r("h3", {
|
|
16
|
+
id: m,
|
|
17
|
+
"data-slot": "approval-card-title",
|
|
18
|
+
className: "type-item-title font-medium",
|
|
19
|
+
children: o
|
|
20
|
+
}),
|
|
21
|
+
s ? /* @__PURE__ */ r("p", {
|
|
22
|
+
"data-slot": "approval-card-description",
|
|
23
|
+
className: "type-body mt-1 text-muted-foreground",
|
|
24
|
+
children: s
|
|
25
|
+
}) : null,
|
|
26
|
+
f
|
|
27
|
+
]
|
|
28
|
+
}), c || l ? /* @__PURE__ */ i("div", {
|
|
29
|
+
"data-slot": "approval-card-action",
|
|
30
|
+
className: e("flex flex-none items-center gap-2", u && "self-start"),
|
|
31
|
+
children: [c, l]
|
|
32
|
+
}) : null] });
|
|
33
|
+
return u ? /* @__PURE__ */ i("article", {
|
|
8
34
|
"data-slot": "approval-card",
|
|
9
|
-
"aria-labelledby":
|
|
10
|
-
className: e("flex flex-col gap-
|
|
11
|
-
...
|
|
35
|
+
"aria-labelledby": m,
|
|
36
|
+
className: e("flex flex-col gap-3 rounded-xl border border-border-subtle bg-card p-4 text-card-foreground", d),
|
|
37
|
+
...p,
|
|
12
38
|
children: [/* @__PURE__ */ r("div", {
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}),
|
|
27
|
-
o ? /* @__PURE__ */ n("p", {
|
|
28
|
-
"data-slot": "approval-card-description",
|
|
29
|
-
className: "type-body mt-1 text-muted-foreground",
|
|
30
|
-
children: o
|
|
31
|
-
}) : null,
|
|
32
|
-
l
|
|
33
|
-
]
|
|
34
|
-
}), s ? /* @__PURE__ */ n("div", {
|
|
35
|
-
"data-slot": "approval-card-action",
|
|
36
|
-
className: "flex flex-none items-center gap-2",
|
|
37
|
-
children: s
|
|
38
|
-
}) : null]
|
|
39
|
+
className: "flex flex-col gap-4 sm:flex-row sm:gap-6",
|
|
40
|
+
children: h
|
|
41
|
+
}), /* @__PURE__ */ r("div", {
|
|
42
|
+
"data-slot": "approval-card-body",
|
|
43
|
+
className: "type-body rounded-lg bg-surface-subtle px-3 py-2.5 text-muted-foreground",
|
|
44
|
+
children: u
|
|
45
|
+
})]
|
|
46
|
+
}) : /* @__PURE__ */ r("article", {
|
|
47
|
+
"data-slot": "approval-card",
|
|
48
|
+
"aria-labelledby": m,
|
|
49
|
+
className: e("flex flex-col gap-4 rounded-xl border border-border-subtle bg-card p-4 text-card-foreground sm:flex-row sm:items-center sm:gap-6", d),
|
|
50
|
+
...p,
|
|
51
|
+
children: h
|
|
39
52
|
});
|
|
40
53
|
}
|
|
41
54
|
//#endregion
|
|
42
|
-
export {
|
|
55
|
+
export { a as ApprovalCard };
|
|
@@ -2,11 +2,12 @@ import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "primary" | "secondary" | "tertiary" | "subtle" | "destructive" | "link" | null | undefined;
|
|
5
|
+
variant?: "primary" | "secondary" | "tertiary" | "subtle" | "destructive" | "link" | "soft" | null | undefined;
|
|
6
6
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl" | null | undefined;
|
|
7
|
+
shape?: "default" | "pill" | null | undefined;
|
|
7
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
9
|
export type ButtonProps = ButtonPrimitive.Props & VariantProps<typeof buttonVariants>;
|
|
9
10
|
export declare function ButtonLabel({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
10
|
-
export declare function Button({ className, variant, size, children, ...props }: ButtonProps): React.JSX.Element;
|
|
11
|
+
export declare function Button({ className, variant, size, shape, children, ...props }: ButtonProps): React.JSX.Element;
|
|
11
12
|
export { buttonVariants };
|
|
12
13
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAiBjE,QAAA,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAiBjE,QAAA,MAAM,cAAc;;;;8EA+CnB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,GAC7C,YAAY,CAAC,OAAO,cAAc,CAAC,CAAA;AAErC,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9B;AAeD,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,OAAmB,EACnB,IAAW,EACX,KAAiB,EACjB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,qBAmBb;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -13,7 +13,8 @@ var o = "bg-primary text-primary-foreground hover:bg-[var(--primary-hover)] aria
|
|
|
13
13
|
tertiary: c,
|
|
14
14
|
subtle: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
15
15
|
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/15 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/10 dark:hover:bg-destructive/15 dark:focus-visible:ring-destructive/40",
|
|
16
|
-
link: "text-link underline-offset-4 hover:underline"
|
|
16
|
+
link: "text-link underline-offset-4 hover:underline",
|
|
17
|
+
soft: "bg-primary/10 [color:color-mix(in_srgb,var(--link)_80%,var(--foreground))] hover:bg-primary/15 aria-expanded:bg-primary/15"
|
|
17
18
|
},
|
|
18
19
|
size: {
|
|
19
20
|
xs: l,
|
|
@@ -26,11 +27,16 @@ var o = "bg-primary text-primary-foreground hover:bg-[var(--primary-hover)] aria
|
|
|
26
27
|
"icon-md": "size-8 rounded-[8px] [--icon-stroke-width:var(--icon-stroke-15)] [&_svg:not([class*='size-'])]:size-[15px]",
|
|
27
28
|
"icon-lg": "size-10 rounded-[8px] [--icon-stroke-width:var(--icon-stroke-18)] [&_svg:not([class*='size-'])]:size-[18px]",
|
|
28
29
|
"icon-xl": "size-12 rounded-[10px] [--icon-stroke-width:var(--icon-stroke-24)] [&_svg:not([class*='size-'])]:size-6"
|
|
30
|
+
},
|
|
31
|
+
shape: {
|
|
32
|
+
default: "",
|
|
33
|
+
pill: "rounded-full"
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
36
|
defaultVariants: {
|
|
32
37
|
variant: "primary",
|
|
33
|
-
size: "xl"
|
|
38
|
+
size: "xl",
|
|
39
|
+
shape: "default"
|
|
34
40
|
}
|
|
35
41
|
});
|
|
36
42
|
function h({ className: e, ...n }) {
|
|
@@ -47,18 +53,20 @@ function g(e) {
|
|
|
47
53
|
}
|
|
48
54
|
return typeof e == "number" ? /* @__PURE__ */ a(h, { children: e }) : e;
|
|
49
55
|
}
|
|
50
|
-
function _({ className: e, variant: i = "primary", size: o = "xl",
|
|
51
|
-
let
|
|
56
|
+
function _({ className: e, variant: i = "primary", size: o = "xl", shape: s = "default", children: c, ...l }) {
|
|
57
|
+
let u = t(m({
|
|
52
58
|
variant: i,
|
|
53
|
-
size: o
|
|
54
|
-
|
|
59
|
+
size: o,
|
|
60
|
+
shape: s
|
|
61
|
+
}));
|
|
55
62
|
return /* @__PURE__ */ a(r, {
|
|
56
63
|
"data-slot": "button",
|
|
57
64
|
"data-variant": i,
|
|
58
65
|
"data-size": o,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
"data-shape": s,
|
|
67
|
+
className: typeof e == "function" ? (n) => t(u, e(n)) : t(u, e),
|
|
68
|
+
...l,
|
|
69
|
+
children: n.Children.map(c, g)
|
|
62
70
|
});
|
|
63
71
|
}
|
|
64
72
|
//#endregion
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type DetailListProps = React.ComponentProps<'dl'> & {
|
|
3
|
+
/** `default` rows are divided by hairlines; `compact` rows are tighter and undivided, for a side card. */
|
|
4
|
+
density?: 'default' | 'compact';
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Settings and facts read as label and value, such as a receptionist's name
|
|
8
|
+
* and greeting, each with an optional status and action. Holds
|
|
9
|
+
* `DetailListItem`s.
|
|
10
|
+
*/
|
|
11
|
+
declare function DetailList({ density, className, ...props }: DetailListProps): React.JSX.Element;
|
|
12
|
+
type DetailListItemProps = Omit<React.ComponentProps<'div'>, 'children'> & {
|
|
13
|
+
/** What the value is. */
|
|
14
|
+
label: React.ReactNode;
|
|
15
|
+
/** The value itself. */
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/** A state at the right, usually a `StatusIndicator`. */
|
|
18
|
+
status?: React.ReactNode;
|
|
19
|
+
/** An action at the far right, such as a "Change" button. */
|
|
20
|
+
action?: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
/** One label and value row in a `DetailList`. */
|
|
23
|
+
declare function DetailListItem({ label, children, status, action, className, ...props }: DetailListItemProps): React.JSX.Element;
|
|
24
|
+
export { DetailList, DetailListItem, type DetailListItemProps, type DetailListProps, };
|
|
25
|
+
//# sourceMappingURL=detail-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail-list.d.ts","sourceRoot":"","sources":["../../../src/components/detail-list/detail-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG;IAClD,0GAA0G;IAC1G,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAChC,CAAA;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,EAClB,OAAmB,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,qBASjB;AAED,KAAK,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACzE,yBAAyB;IACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,yDAAyD;IACzD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB,CAAA;AAED,iDAAiD;AACjD,iBAAS,cAAc,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,mBAAmB,qBAiCrB;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,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/detail-list/detail-list.tsx
|
|
5
|
+
function r({ density: n = "default", className: r, ...i }) {
|
|
6
|
+
return /* @__PURE__ */ t("dl", {
|
|
7
|
+
"data-slot": "detail-list",
|
|
8
|
+
"data-density": n,
|
|
9
|
+
className: e("group/detail-list flex flex-col", r),
|
|
10
|
+
...i
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function i({ label: r, children: i, status: a, action: o, className: s, ...c }) {
|
|
14
|
+
return /* @__PURE__ */ n("div", {
|
|
15
|
+
"data-slot": "detail-list-item",
|
|
16
|
+
className: e("grid grid-cols-[minmax(7rem,30%)_minmax(0,1fr)_auto] items-baseline gap-x-4 border-b border-border-subtle py-3 last:border-b-0 group-data-[density=compact]/detail-list:grid-cols-[minmax(0,1fr)_auto] group-data-[density=compact]/detail-list:border-b-0 group-data-[density=compact]/detail-list:py-1.5", s),
|
|
17
|
+
...c,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ t("dt", {
|
|
20
|
+
"data-slot": "detail-list-label",
|
|
21
|
+
className: "type-body font-medium group-data-[density=compact]/detail-list:font-normal group-data-[density=compact]/detail-list:text-muted-foreground",
|
|
22
|
+
children: r
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ t("dd", {
|
|
25
|
+
"data-slot": "detail-list-value",
|
|
26
|
+
className: "type-body min-w-0 text-muted-foreground group-data-[density=compact]/detail-list:col-start-2 group-data-[density=compact]/detail-list:row-start-1 group-data-[density=compact]/detail-list:text-right group-data-[density=compact]/detail-list:text-foreground group-data-[density=compact]/detail-list:tabular-nums",
|
|
27
|
+
children: i
|
|
28
|
+
}),
|
|
29
|
+
a || o ? /* @__PURE__ */ n("dd", {
|
|
30
|
+
"data-slot": "detail-list-end",
|
|
31
|
+
className: "flex items-center justify-end gap-3 group-data-[density=compact]/detail-list:col-span-2",
|
|
32
|
+
children: [a, o]
|
|
33
|
+
}) : null
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { r as DetailList, i as DetailListItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/detail-list/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -2,6 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
type FilterChipOption = {
|
|
3
3
|
value: string;
|
|
4
4
|
label: React.ReactNode;
|
|
5
|
+
/** A small mark before the label, such as an area's icon. */
|
|
6
|
+
icon?: React.ReactNode;
|
|
5
7
|
/** Shown after the label, such as how many rows the filter keeps. */
|
|
6
8
|
count?: number;
|
|
7
9
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-chips.d.ts","sourceRoot":"","sources":["../../../src/components/filter-chips/filter-chips.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,KAAK,gBAAgB,GAAG,IAAI,CAC1B,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,UAAU,GAAG,cAAc,CAC5B,GAAG;IACF,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACpC,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;;GAIG;AACH,iBAAS,WAAW,CAAC,EACnB,OAAO,EACP,KAAK,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EAAE,SAAoB,EAClC,GAAG,KAAK,EACT,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"filter-chips.d.ts","sourceRoot":"","sources":["../../../src/components/filter-chips/filter-chips.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,KAAK,gBAAgB,GAAG,IAAI,CAC1B,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,UAAU,GAAG,cAAc,CAC5B,GAAG;IACF,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACpC,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;;GAIG;AACH,iBAAS,WAAW,CAAC,EACnB,OAAO,EACP,KAAK,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EAAE,SAAoB,EAClC,GAAG,KAAK,EACT,EAAE,gBAAgB,qBAiClB;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,CAAA"}
|
|
@@ -21,12 +21,16 @@ function a({ options: a, value: o, onValueChange: s, disabled: c, className: l,
|
|
|
21
21
|
value: e.value,
|
|
22
22
|
disabled: e.disabled,
|
|
23
23
|
"data-slot": "filter-chip",
|
|
24
|
-
className: "type-body inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-full border border-border bg-card px-3.5 whitespace-nowrap text-muted-foreground transition-colors outline-none hover:bg-surface-subtle hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-pressed:border-foreground data-pressed:bg-foreground data-pressed:text-background",
|
|
25
|
-
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
className: "type-body inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-full border border-border bg-card px-3.5 whitespace-nowrap text-muted-foreground transition-colors outline-none hover:bg-surface-subtle hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-pressed:border-foreground [&_svg]:pointer-events-none [&_svg]:size-[15px] [&_svg]:flex-none [--icon-stroke-width:var(--icon-stroke-15)] data-pressed:bg-foreground data-pressed:text-background",
|
|
25
|
+
children: [
|
|
26
|
+
e.icon,
|
|
27
|
+
e.label,
|
|
28
|
+
e.count === void 0 ? null : /* @__PURE__ */ t("span", {
|
|
29
|
+
"data-slot": "filter-chip-count",
|
|
30
|
+
className: "opacity-70",
|
|
31
|
+
children: e.count
|
|
32
|
+
})
|
|
33
|
+
]
|
|
30
34
|
}, e.value))
|
|
31
35
|
});
|
|
32
36
|
}
|
|
@@ -10,7 +10,7 @@ declare const itemVariants: (props?: ({
|
|
|
10
10
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
11
11
|
declare function Item({ className, variant, size, render, ...props }: useRender.ComponentProps<'div'> & VariantProps<typeof itemVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
12
12
|
declare const itemMediaVariants: (props?: ({
|
|
13
|
-
variant?: "
|
|
13
|
+
variant?: "default" | "image" | "icon" | "photo" | "tile" | null | undefined;
|
|
14
14
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
15
15
|
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof itemMediaVariants>): React.JSX.Element;
|
|
16
16
|
declare function ItemContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const markerVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "default" | "separator" | "border" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare function Marker({ className, variant, render, ...props }: useRender.ComponentProps<'div'> & VariantProps<typeof markerVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
8
8
|
declare function MarkerIcon({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const metricTileVariants: (props?: ({
|
|
4
|
-
variant?: "subtle" | "plain" | null | undefined;
|
|
4
|
+
variant?: "subtle" | "card" | "plain" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
declare const metricTileValueVariants: (props?: ({
|
|
7
7
|
size?: "md" | "lg" | null | undefined;
|
|
@@ -27,8 +27,10 @@ export interface MetricTileProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
27
27
|
delta?: MetricTileDelta;
|
|
28
28
|
/** A closing line, such as "so far" or "120 a day". */
|
|
29
29
|
note?: React.ReactNode;
|
|
30
|
+
/** A small chart at the bottom right, usually a `Sparkline`. */
|
|
31
|
+
chart?: React.ReactNode;
|
|
30
32
|
}
|
|
31
33
|
/** 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;
|
|
34
|
+
declare function MetricTile({ label, icon, value, unit, delta, note, chart, variant, size, className, ...props }: MetricTileProps): React.JSX.Element;
|
|
33
35
|
export { MetricTile, metricTileVariants };
|
|
34
36
|
//# sourceMappingURL=metric-tile.d.ts.map
|
|
@@ -1 +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;;
|
|
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;;8EActB,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;IACtB,gEAAgE;IAChE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACxB;AAED,gFAAgF;AAChF,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,qBAkGjB;AAED,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,75 +1,81 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cva as t } from "class-variance-authority";
|
|
4
|
-
import {
|
|
5
|
-
import { IconArrowDownRight as
|
|
4
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { IconArrowDownRight as a, IconArrowUpRight as o } from "@tabler/icons-react";
|
|
6
6
|
//#region src/components/metric-tile/metric-tile.tsx
|
|
7
|
-
var
|
|
7
|
+
var s = t("flex min-w-0 flex-col", {
|
|
8
8
|
variants: { variant: {
|
|
9
9
|
subtle: "rounded-xl bg-surface-subtle px-4 py-3",
|
|
10
|
-
plain: ""
|
|
10
|
+
plain: "",
|
|
11
|
+
card: "rounded-xl border border-border-subtle bg-card px-4 py-3.5"
|
|
11
12
|
} },
|
|
12
13
|
defaultVariants: { variant: "subtle" }
|
|
13
|
-
}),
|
|
14
|
+
}), c = t("tabular-nums", {
|
|
14
15
|
variants: { size: {
|
|
15
16
|
lg: "type-page-title",
|
|
16
17
|
md: "type-metric"
|
|
17
18
|
} },
|
|
18
19
|
defaultVariants: { size: "lg" }
|
|
19
20
|
});
|
|
20
|
-
function
|
|
21
|
-
let
|
|
22
|
-
|
|
21
|
+
function l({ label: t, icon: l, value: u, unit: d, delta: f, note: p, chart: m, variant: h, size: g, className: _, ...v }) {
|
|
22
|
+
let y = h === "card", b = f?.tone ?? (f?.trend === "down" ? "negative" : "positive"), x = f?.trend === "down" ? a : o, S = f ? /* @__PURE__ */ i("p", {
|
|
23
|
+
"data-slot": "metric-tile-delta",
|
|
24
|
+
"data-trend": f.trend,
|
|
25
|
+
className: e("type-meta flex items-center gap-1", y ? e("mt-1.5 w-fit rounded-full px-1.5 py-px font-medium whitespace-nowrap", b === "positive" ? "bg-success-soft text-success" : "bg-warning-soft text-warning-foreground") : "mt-0.5 text-muted-foreground"),
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ r(x, {
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
className: e("icon-optical-14 shrink-0", y ? "text-current" : b === "positive" ? "text-success" : "text-warning")
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ i("span", {
|
|
32
|
+
className: "sr-only",
|
|
33
|
+
children: [f.trend === "up" ? "Up" : "Down", ", "]
|
|
34
|
+
}),
|
|
35
|
+
f.label
|
|
36
|
+
]
|
|
37
|
+
}) : null, C = p ? /* @__PURE__ */ r("div", {
|
|
38
|
+
"data-slot": "metric-tile-note",
|
|
39
|
+
className: "type-meta text-muted-foreground",
|
|
40
|
+
children: p
|
|
41
|
+
}) : null;
|
|
42
|
+
return /* @__PURE__ */ i("div", {
|
|
23
43
|
"data-slot": "metric-tile",
|
|
24
|
-
"data-variant":
|
|
25
|
-
className: e(
|
|
26
|
-
...
|
|
44
|
+
"data-variant": h ?? "subtle",
|
|
45
|
+
className: e(s({ variant: h }), _),
|
|
46
|
+
...v,
|
|
27
47
|
children: [
|
|
28
|
-
|
|
48
|
+
l ? /* @__PURE__ */ i("p", {
|
|
29
49
|
"data-slot": "metric-tile-label",
|
|
30
50
|
className: "type-label flex items-center gap-2 font-medium",
|
|
31
|
-
children: [
|
|
32
|
-
}) : /* @__PURE__ */
|
|
51
|
+
children: [l, t]
|
|
52
|
+
}) : /* @__PURE__ */ r("p", {
|
|
33
53
|
"data-slot": "metric-tile-label",
|
|
34
54
|
className: "type-meta text-muted-foreground",
|
|
35
55
|
children: t
|
|
36
56
|
}),
|
|
37
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ r("p", {
|
|
38
58
|
"data-slot": "metric-tile-value",
|
|
39
|
-
className: e(
|
|
40
|
-
children:
|
|
59
|
+
className: e(c({ size: g }), l ? "mt-5" : g === "md" && "mt-0.5"),
|
|
60
|
+
children: u
|
|
41
61
|
}),
|
|
42
|
-
|
|
62
|
+
d ? /* @__PURE__ */ r("div", {
|
|
43
63
|
className: "type-meta text-muted-foreground",
|
|
44
|
-
children:
|
|
64
|
+
children: d
|
|
45
65
|
}) : null,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
|
66
|
+
m ? /* @__PURE__ */ i("div", {
|
|
67
|
+
className: "flex flex-wrap items-end justify-between gap-x-3 gap-y-1",
|
|
68
|
+
children: [/* @__PURE__ */ i("div", {
|
|
69
|
+
className: "min-w-0",
|
|
70
|
+
children: [S, C]
|
|
71
|
+
}), /* @__PURE__ */ r("div", {
|
|
72
|
+
"data-slot": "metric-tile-chart",
|
|
73
|
+
className: "flex-none pb-0.5",
|
|
74
|
+
children: m
|
|
75
|
+
})]
|
|
76
|
+
}) : /* @__PURE__ */ i(n, { children: [S, C] })
|
|
71
77
|
]
|
|
72
78
|
});
|
|
73
79
|
}
|
|
74
80
|
//#endregion
|
|
75
|
-
export {
|
|
81
|
+
export { l as MetricTile, s as metricTileVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Platform } from './platform-icon';
|
|
2
|
+
/** The social channels that have a chart color (ADR 0026). */
|
|
3
|
+
type Channel = Extract<Platform, 'x' | 'threads' | 'instagram' | 'facebook' | 'bluesky' | 'linkedin' | 'tiktok' | 'youtube' | 'google' | 'beehiiv' | 'reddit'>;
|
|
4
|
+
declare const CHANNELS: readonly Channel[];
|
|
5
|
+
type ChannelColor = {
|
|
6
|
+
/** The series color, for bars, lines and legend swatches. */
|
|
7
|
+
color: string;
|
|
8
|
+
/** Readable text on `tint`, such as a pressed series toggle. */
|
|
9
|
+
foreground: string;
|
|
10
|
+
/** The 10% tint (16% in dark mode). */
|
|
11
|
+
tint: string;
|
|
12
|
+
};
|
|
13
|
+
declare const CHANNEL_COLOR: Record<Channel, ChannelColor>;
|
|
14
|
+
export { CHANNELS, CHANNEL_COLOR, type Channel, type ChannelColor };
|
|
15
|
+
//# sourceMappingURL=channel-color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-color.d.ts","sourceRoot":"","sources":["../../../src/components/platform-icon/channel-color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,8DAA8D;AAC9D,KAAK,OAAO,GAAG,OAAO,CACpB,QAAQ,EACN,GAAG,GACH,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,UAAU,GACV,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,CACX,CAAA;AAED,QAAA,MAAM,QAAQ,EAAE,SAAS,OAAO,EAY/B,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAA;IAClB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAOD,QAAA,MAAM,aAAa,EASd,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;AAElC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/components/platform-icon/channel-color.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"x",
|
|
4
|
+
"threads",
|
|
5
|
+
"instagram",
|
|
6
|
+
"facebook",
|
|
7
|
+
"bluesky",
|
|
8
|
+
"linkedin",
|
|
9
|
+
"tiktok",
|
|
10
|
+
"youtube",
|
|
11
|
+
"google",
|
|
12
|
+
"beehiiv",
|
|
13
|
+
"reddit"
|
|
14
|
+
], t = Object.fromEntries(e.map((e) => [e, {
|
|
15
|
+
color: `var(--channel-${e})`,
|
|
16
|
+
foreground: `var(--channel-${e}-foreground)`,
|
|
17
|
+
tint: `var(--channel-${e}-soft)`
|
|
18
|
+
}]));
|
|
19
|
+
//#endregion
|
|
20
|
+
export { e as CHANNELS, t as CHANNEL_COLOR };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/platform-icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/platform-icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type LetterMarkProps = Omit<React.ComponentProps<'span'>, 'children'> & {
|
|
3
|
+
/** The service's name. Its first letter (or first two words' initials) fills the tile. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** The tile's color, such as the service's brand color. Defaults to the muted surface. */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** The letter's color on `color`. Defaults to white on a color, foreground on the default tile. */
|
|
8
|
+
foreground?: string;
|
|
9
|
+
/** Rendered width and height in pixels. */
|
|
10
|
+
size?: number;
|
|
11
|
+
/** Names the mark for assistive tech; omit when a visible label says the name. */
|
|
12
|
+
title?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A lettered tile standing in for a service without a `PlatformIcon` mark,
|
|
16
|
+
* such as Yelp or Shopify. It takes the same size as a mark.
|
|
17
|
+
*/
|
|
18
|
+
declare function LetterMark({ name, color, foreground, size, title, className, style, ...props }: LetterMarkProps): React.JSX.Element;
|
|
19
|
+
export { LetterMark, type LetterMarkProps };
|
|
20
|
+
//# sourceMappingURL=letter-mark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letter-mark.d.ts","sourceRoot":"","sources":["../../../src/components/platform-icon/letter-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IACtE,0FAA0F;IAC1F,IAAI,EAAE,MAAM,CAAA;IACZ,0FAA0F;IAC1F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAQD;;;GAGG;AACH,iBAAS,UAAU,CAAC,EAClB,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,eAAe,qBA0BjB;AAED,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/platform-icon/letter-mark.tsx
|
|
5
|
+
function n(e) {
|
|
6
|
+
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
7
|
+
return t.length > 1 ? `${t[0][0]}${t[1][0]}`.toUpperCase() : (t[0]?.[0] ?? "?").toUpperCase();
|
|
8
|
+
}
|
|
9
|
+
function r({ name: r, color: i, foreground: a, size: o = 16, title: s, className: c, style: l, ...u }) {
|
|
10
|
+
let d = n(r);
|
|
11
|
+
return /* @__PURE__ */ t("span", {
|
|
12
|
+
"data-slot": "letter-mark",
|
|
13
|
+
...s ? {
|
|
14
|
+
role: "img",
|
|
15
|
+
"aria-label": s
|
|
16
|
+
} : { "aria-hidden": !0 },
|
|
17
|
+
className: e("inline-flex flex-none items-center justify-center rounded-[25%] leading-none font-semibold select-none", !i && "bg-muted text-foreground", c),
|
|
18
|
+
style: {
|
|
19
|
+
width: o,
|
|
20
|
+
height: o,
|
|
21
|
+
fontSize: Math.round(o * (d.length > 1 ? .42 : .56)),
|
|
22
|
+
...i ? {
|
|
23
|
+
background: i,
|
|
24
|
+
color: a ?? "#FFFFFF"
|
|
25
|
+
} : {},
|
|
26
|
+
...a && !i ? { color: a } : {},
|
|
27
|
+
...l
|
|
28
|
+
},
|
|
29
|
+
...u,
|
|
30
|
+
children: d
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { r as LetterMark };
|