@almanaclabs/blaze-ui 0.10.0 → 0.12.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 +90 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell/app-shell.js +149 -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/approval-card/approval-card.d.ts +19 -0
- package/dist/components/approval-card/approval-card.d.ts.map +1 -0
- package/dist/components/approval-card/approval-card.js +42 -0
- package/dist/components/approval-card/index.d.ts +2 -0
- package/dist/components/approval-card/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/filter-chips/filter-chips.d.ts +23 -0
- package/dist/components/filter-chips/filter-chips.d.ts.map +1 -0
- package/dist/components/filter-chips/filter-chips.js +34 -0
- package/dist/components/filter-chips/index.d.ts +2 -0
- package/dist/components/filter-chips/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/item/item.d.ts +1 -1
- package/dist/components/item/item.d.ts.map +1 -1
- package/dist/components/item/item.js +3 -2
- 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 +38 -0
- package/dist/components/platform-icon/platform-icon.d.ts.map +1 -0
- package/dist/components/platform-icon/platform-icon.js +272 -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/status-indicator/index.d.ts +2 -0
- package/dist/components/status-indicator/index.d.ts.map +1 -0
- package/dist/components/status-indicator/status-indicator.d.ts +21 -0
- package/dist/components/status-indicator/status-indicator.d.ts.map +1 -0
- package/dist/components/status-indicator/status-indicator.js +30 -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 +20 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -49
- package/package.json +1 -1
- package/src/styles/globals.css +40 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/editable-text/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ButtonProps } from '../button';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type FaceStackFace = {
|
|
4
|
+
/** Profile photo; without one the first letter of `name` shows. */
|
|
5
|
+
src?: string | null;
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
type FaceStackButtonProps = Omit<ButtonProps, 'children' | 'size' | 'className'> & {
|
|
9
|
+
className?: string;
|
|
10
|
+
/** The people or accounts behind the destination. Only the first `max` are drawn. */
|
|
11
|
+
faces: readonly FaceStackFace[];
|
|
12
|
+
/** How many faces overlap at the start of the button. */
|
|
13
|
+
max?: number;
|
|
14
|
+
/** `md` for a row or section header (20px faces), `lg` beside a page title (26px faces). */
|
|
15
|
+
size?: 'md' | 'lg';
|
|
16
|
+
/** The destination's name, in the button's own weight. */
|
|
17
|
+
label?: React.ReactNode;
|
|
18
|
+
/** A count, in the quiet tone after the label. */
|
|
19
|
+
count?: React.ReactNode;
|
|
20
|
+
/** Words after the count, in the same quiet tone ("from accounts you watch"). */
|
|
21
|
+
detail?: React.ReactNode;
|
|
22
|
+
/** The trailing chevron that says the button opens somewhere. */
|
|
23
|
+
showChevron?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A secondary button led by a stack of overlapping faces, then a label and a count.
|
|
27
|
+
* It opens the place those people live (a watch list, followers, a team) on click.
|
|
28
|
+
*/
|
|
29
|
+
declare function FaceStackButton({ faces, max, size, label, count, detail, showChevron, variant, className, ...props }: FaceStackButtonProps): React.JSX.Element;
|
|
30
|
+
export { FaceStackButton, type FaceStackButtonProps, type FaceStackFace };
|
|
31
|
+
//# sourceMappingURL=face-stack-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"face-stack-button.d.ts","sourceRoot":"","sources":["../../../src/components/face-stack-button/face-stack-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAA;AAGpD,KAAK,aAAa,GAAG;IACnB,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,oBAAoB,GAAG,IAAI,CAC9B,WAAW,EACX,UAAU,GAAG,MAAM,GAAG,WAAW,CAClC,GAAG;IACF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qFAAqF;IACrF,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4FAA4F;IAC5F,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,kDAAkD;IAClD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,iFAAiF;IACjF,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;GAGG;AACH,iBAAS,eAAe,CAAC,EACvB,KAAK,EACL,GAAO,EACP,IAAW,EACX,KAAK,EACL,KAAK,EACL,MAAM,EACN,WAAkB,EAClB,OAAqB,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,qBAoDtB;AAED,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import { AvatarGroup as n } from "../avatar/avatar.js";
|
|
4
|
+
import { PlatformAvatar as r } from "../platform-avatar/platform-avatar.js";
|
|
5
|
+
import * as i from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { IconChevronRight as s } from "@tabler/icons-react";
|
|
8
|
+
//#region src/components/face-stack-button/face-stack-button.tsx
|
|
9
|
+
function c({ faces: c, max: l = 4, size: u = "md", label: d, count: f, detail: p, showChevron: m = !0, variant: h = "secondary", className: g, ..._ }) {
|
|
10
|
+
let v = u === "lg" ? 26 : 20, y = [f, p].filter((e) => e != null && e !== "");
|
|
11
|
+
return /* @__PURE__ */ o(t, {
|
|
12
|
+
"data-face-stack": "",
|
|
13
|
+
size: u,
|
|
14
|
+
variant: h,
|
|
15
|
+
className: e("gap-2.5 pl-1.5", g),
|
|
16
|
+
..._,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ a(n, {
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
className: "-space-x-2 *:data-[slot=avatar]:ring-card",
|
|
21
|
+
children: c.slice(0, l).map((e, t) => /* @__PURE__ */ a(r, {
|
|
22
|
+
src: e.src,
|
|
23
|
+
name: e.name,
|
|
24
|
+
size: v
|
|
25
|
+
}, `${e.name}-${t}`))
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ o("span", {
|
|
28
|
+
"data-slot": "face-stack-button-text",
|
|
29
|
+
children: [
|
|
30
|
+
d,
|
|
31
|
+
d !== void 0 && y.length > 0 ? " " : null,
|
|
32
|
+
y.length > 0 ? /* @__PURE__ */ a("span", {
|
|
33
|
+
"data-slot": "face-stack-button-count",
|
|
34
|
+
className: "font-normal text-muted-foreground",
|
|
35
|
+
children: y.map((e, t) => /* @__PURE__ */ o(i.Fragment, { children: [t > 0 ? " " : null, e] }, t))
|
|
36
|
+
}) : null
|
|
37
|
+
]
|
|
38
|
+
}),
|
|
39
|
+
m ? /* @__PURE__ */ a(s, {
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
className: "size-4 text-muted-foreground"
|
|
42
|
+
}) : null
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { c as FaceStackButton };
|
|
@@ -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,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type FilterChipOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
/** Shown after the label, such as how many rows the filter keeps. */
|
|
6
|
+
count?: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type FilterChipsProps = Omit<React.ComponentProps<'div'>, 'onChange' | 'defaultValue'> & {
|
|
10
|
+
options: readonly FilterChipOption[];
|
|
11
|
+
/** The selected option's value. One option is always selected. */
|
|
12
|
+
value: string;
|
|
13
|
+
onValueChange: (value: string) => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A single-select row of rounded filter chips, such as All, Connected and
|
|
18
|
+
* Email above a list. The selected chip is filled with the foreground color.
|
|
19
|
+
* Arrow keys move between chips; picking the selected chip again keeps it.
|
|
20
|
+
*/
|
|
21
|
+
declare function FilterChips({ options, value, onValueChange, disabled, className, 'aria-label': ariaLabel, ...props }: FilterChipsProps): React.JSX.Element;
|
|
22
|
+
export { FilterChips, type FilterChipOption, type FilterChipsProps };
|
|
23
|
+
//# sourceMappingURL=filter-chips.d.ts.map
|
|
@@ -0,0 +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,qBAgClB;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
|
+
import { Toggle as r } from "@base-ui/react/toggle";
|
|
6
|
+
import { ToggleGroup as i } from "@base-ui/react/toggle-group";
|
|
7
|
+
//#region src/components/filter-chips/filter-chips.tsx
|
|
8
|
+
function a({ options: a, value: o, onValueChange: s, disabled: c, className: l, "aria-label": u = "Filter", ...d }) {
|
|
9
|
+
return /* @__PURE__ */ t(i, {
|
|
10
|
+
"data-slot": "filter-chips",
|
|
11
|
+
"aria-label": u,
|
|
12
|
+
value: [o],
|
|
13
|
+
onValueChange: (e) => {
|
|
14
|
+
let t = e[0];
|
|
15
|
+
t !== void 0 && t !== o && s(t);
|
|
16
|
+
},
|
|
17
|
+
disabled: c,
|
|
18
|
+
className: e("flex flex-wrap items-center gap-2", l),
|
|
19
|
+
...d,
|
|
20
|
+
children: a.map((e) => /* @__PURE__ */ n(r, {
|
|
21
|
+
value: e.value,
|
|
22
|
+
disabled: e.disabled,
|
|
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: [e.label, e.count === void 0 ? null : /* @__PURE__ */ t("span", {
|
|
26
|
+
"data-slot": "filter-chip-count",
|
|
27
|
+
className: "opacity-70",
|
|
28
|
+
children: e.count
|
|
29
|
+
})]
|
|
30
|
+
}, e.value))
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { a as FilterChips };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/filter-chips/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,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?: ({
|
|
@@ -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?: "image" | "default" | "icon" | "photo" | null | undefined;
|
|
13
|
+
variant?: "image" | "default" | "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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/components/item/item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAYtE;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,qBASxC;AAED,QAAA,MAAM,YAAY;;;8EAoBjB,CAAA;AAED,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,MAAM,EACN,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,0EAgBrE;AAED,QAAA,MAAM,iBAAiB;;
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/components/item/item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAYtE;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,qBASxC;AAED,QAAA,MAAM,YAAY;;;8EAoBjB,CAAA;AAED,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,MAAM,EACN,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,0EAgBrE;AAED,QAAA,MAAM,iBAAiB;;8EAoBtB,CAAA;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,qBAStE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWxE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWtE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,qBAW1E;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQxE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWvE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWvE;AAED,OAAO,EACL,IAAI,EACJ,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,SAAS,EACT,eAAe,EACf,UAAU,EACV,UAAU,GACX,CAAA"}
|
|
@@ -22,7 +22,7 @@ function s({ className: n, ...i }) {
|
|
|
22
22
|
...i
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
var c = n("group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted", {
|
|
25
|
+
var c = n("group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted [button]:cursor-pointer [button]:text-left [button]:transition-colors [button]:hover:bg-muted [button]:disabled:pointer-events-none [button]:disabled:opacity-50", {
|
|
26
26
|
variants: {
|
|
27
27
|
variant: {
|
|
28
28
|
default: "border-transparent",
|
|
@@ -61,7 +61,8 @@ var u = n("flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=
|
|
|
61
61
|
default: "bg-transparent",
|
|
62
62
|
icon: "[--icon-stroke-width:var(--icon-stroke-16)] [&_svg:not([class*='size-'])]:size-4",
|
|
63
63
|
image: "size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover",
|
|
64
|
-
photo: "size-13 overflow-hidden rounded-sm bg-surface-subtle [&_img]:size-full [&_img]:object-cover"
|
|
64
|
+
photo: "size-13 overflow-hidden rounded-sm bg-surface-subtle [&_img]:size-full [&_img]:object-cover",
|
|
65
|
+
tile: "size-9 rounded-md border border-border-subtle bg-card [--icon-stroke-width:var(--icon-stroke-18)] [&_svg:not([class*='size-'])]:size-[18px]"
|
|
65
66
|
} },
|
|
66
67
|
defaultVariants: { variant: "default" }
|
|
67
68
|
});
|
|
@@ -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"}
|