@justanarthur/modo-ui-notch 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/blocks/activities/agenda/examples.mdx +29 -5
- package/blocks/activities/agenda/index.tsx +438 -181
- package/blocks/activities/clock/examples.mdx +89 -0
- package/blocks/activities/clock/index.tsx +917 -0
- package/blocks/activities/now-playing/examples.mdx +40 -13
- package/blocks/activities/now-playing/index.tsx +399 -120
- package/blocks/activities/weather/examples.mdx +123 -0
- package/blocks/activities/weather/index.tsx +863 -0
- package/blocks/app/expanded-island/examples.mdx +8 -7
- package/blocks/app/expanded-island/index.tsx +22 -4
- package/blocks/app/settings-window/examples.mdx +14 -2
- package/blocks/app/settings-window/index.tsx +33 -10
- package/blocks/system/clipboard/examples.mdx +91 -0
- package/blocks/system/clipboard/index.tsx +773 -0
- package/blocks/system/recent-files/examples.mdx +80 -0
- package/blocks/system/recent-files/index.tsx +627 -0
- package/blocks/system/system-stats/examples.mdx +46 -9
- package/blocks/system/system-stats/index.tsx +445 -104
- package/components/indicators/media-scrubber/examples.mdx +8 -0
- package/components/indicators/media-scrubber/index.tsx +37 -13
- package/components/island/island/examples.mdx +4 -4
- package/components/island/island/index.tsx +2 -2
- package/components/island/island-flash/examples.mdx +15 -18
- package/components/island/island-flash/index.tsx +4 -4
- package/components/island/island-tabs/examples.mdx +5 -5
- package/components/island/widget/examples.mdx +76 -0
- package/components/island/widget/index.tsx +465 -0
- package/dist/blocks/activities/agenda/index.d.ts +2 -1
- package/dist/blocks/activities/agenda/index.js +3 -3
- package/dist/blocks/activities/clock/index.d.ts +3 -0
- package/dist/blocks/activities/clock/index.js +25 -0
- package/dist/blocks/activities/now-playing/index.d.ts +4 -2
- package/dist/blocks/activities/now-playing/index.js +5 -3
- package/dist/blocks/activities/weather/index.d.ts +3 -0
- package/dist/blocks/activities/weather/index.js +21 -0
- package/dist/blocks/app/expanded-island/index.d.ts +1 -1
- package/dist/blocks/app/expanded-island/index.js +4 -3
- package/dist/blocks/app/settings-window/index.d.ts +1 -1
- package/dist/blocks/app/settings-window/index.js +1 -1
- package/dist/blocks/system/clipboard/index.d.ts +3 -0
- package/dist/blocks/system/clipboard/index.js +17 -0
- package/dist/blocks/system/recent-files/index.d.ts +3 -0
- package/dist/blocks/system/recent-files/index.js +19 -0
- package/dist/blocks/system/system-stats/index.d.ts +3 -2
- package/dist/blocks/system/system-stats/index.js +4 -1
- package/dist/components/indicators/media-scrubber/index.d.ts +1 -1
- package/dist/components/indicators/media-scrubber/index.js +1 -1
- package/dist/components/island/island/index.d.ts +1 -1
- package/dist/components/island/island/index.js +2 -2
- package/dist/components/island/island-flash/index.d.ts +1 -1
- package/dist/components/island/island-flash/index.js +1 -1
- package/dist/components/island/island-tabs/index.js +2 -2
- package/dist/components/island/widget/index.d.ts +2 -0
- package/dist/components/island/widget/index.js +32 -0
- package/dist/index.d.ts +15 -15
- package/dist/index.js +104 -58
- package/dist/lib/artwork.d.ts +2 -0
- package/dist/lib/artwork.js +8 -0
- package/dist/lib/geometry.js +1 -1
- package/dist/shared/{chunk-yngkkxz2.d.ts → chunk-0ym9mcqc.d.ts} +10 -6
- package/dist/shared/chunk-2b6gpn8k.js +444 -0
- package/dist/shared/chunk-3hcnf4yx.js +481 -0
- package/dist/shared/chunk-42wab62s.d.ts +197 -0
- package/dist/shared/{chunk-zvh0d3qb.js → chunk-61t2dfte.js} +1 -1
- package/dist/shared/{chunk-9nhpg9t8.d.ts → chunk-6tnq6p89.d.ts} +9 -1
- package/dist/shared/{chunk-hpsabfsd.d.ts → chunk-81fpptwp.d.ts} +1 -1
- package/dist/shared/chunk-93dtpjz7.js +789 -0
- package/dist/shared/{chunk-wwjxs75m.js → chunk-9xtcv3sy.js} +26 -12
- package/dist/shared/chunk-a6njb8db.d.ts +129 -0
- package/dist/shared/chunk-ab8mdg0n.d.ts +149 -0
- package/dist/shared/chunk-evqpf92s.d.ts +168 -0
- package/dist/shared/{chunk-6c1jbefs.d.ts → chunk-fexwzycv.d.ts} +3 -3
- package/dist/shared/chunk-gcyspvgr.js +582 -0
- package/dist/shared/chunk-gejenfap.d.ts +25 -0
- package/dist/shared/chunk-gkj0hjrn.d.ts +136 -0
- package/dist/shared/{chunk-rr5e0g15.d.ts → chunk-j755a1a5.d.ts} +7 -1
- package/dist/shared/chunk-n739am8j.d.ts +112 -0
- package/dist/shared/{chunk-78w7qwp0.js → chunk-ndf79pv5.js} +1 -1
- package/dist/shared/chunk-nwzpekvy.js +774 -0
- package/dist/shared/{chunk-rpfwv3pz.js → chunk-r471sknr.js} +1 -1
- package/dist/shared/chunk-sbrtesdg.d.ts +138 -0
- package/dist/shared/chunk-swc7dqpw.d.ts +115 -0
- package/dist/shared/chunk-t9wqhgzt.js +765 -0
- package/dist/shared/chunk-w5h6ay93.js +72 -0
- package/dist/shared/{chunk-mp1nx0ez.js → chunk-wayv5rhr.js} +15 -4
- package/dist/shared/chunk-wf0jtzhs.js +295 -0
- package/dist/shared/{chunk-sbnrhy5m.js → chunk-y0188bbn.js} +2 -2
- package/dist/shared/chunk-yq5svpk7.js +524 -0
- package/dist/shared/{chunk-s33y1pcq.js → chunk-z3tj1ydg.js} +23 -10
- package/dist/styles.css +151 -49
- package/index.ts +7 -6
- package/lib/artwork.ts +112 -0
- package/lib/geometry.ts +1 -1
- package/mock/activities.tsx +9 -32
- package/mock/artwork.tsx +13 -1
- package/mock/clipboard.tsx +113 -0
- package/mock/clock.tsx +77 -0
- package/mock/data.ts +78 -44
- package/mock/files.tsx +83 -0
- package/mock/island-content.tsx +79 -122
- package/mock/screen.tsx +76 -0
- package/mock/settings.tsx +370 -91
- package/mock/system.ts +49 -0
- package/mock/weather.tsx +135 -0
- package/package.json +7 -2
- package/blocks/activities/shelf/examples.mdx +0 -33
- package/blocks/activities/shelf/index.tsx +0 -289
- package/blocks/activities/timer/examples.mdx +0 -52
- package/blocks/activities/timer/index.tsx +0 -292
- package/blocks/system/controls/examples.mdx +0 -34
- package/blocks/system/controls/index.tsx +0 -167
- package/blocks/system/devices/examples.mdx +0 -25
- package/blocks/system/devices/index.tsx +0 -172
- package/blocks/system/power-alert/examples.mdx +0 -32
- package/blocks/system/power-alert/index.tsx +0 -89
- package/components/indicators/battery-glyph/examples.mdx +0 -22
- package/components/indicators/battery-glyph/index.tsx +0 -91
- package/dist/blocks/activities/shelf/index.d.ts +0 -2
- package/dist/blocks/activities/shelf/index.js +0 -14
- package/dist/blocks/activities/timer/index.d.ts +0 -2
- package/dist/blocks/activities/timer/index.js +0 -19
- package/dist/blocks/system/controls/index.d.ts +0 -2
- package/dist/blocks/system/controls/index.js +0 -10
- package/dist/blocks/system/devices/index.d.ts +0 -2
- package/dist/blocks/system/devices/index.js +0 -12
- package/dist/blocks/system/power-alert/index.d.ts +0 -2
- package/dist/blocks/system/power-alert/index.js +0 -9
- package/dist/components/indicators/battery-glyph/index.d.ts +0 -2
- package/dist/components/indicators/battery-glyph/index.js +0 -9
- package/dist/shared/chunk-2qpcsv5h.d.ts +0 -45
- package/dist/shared/chunk-45gytfr1.d.ts +0 -84
- package/dist/shared/chunk-50ffk4r7.d.ts +0 -69
- package/dist/shared/chunk-5w0yck07.d.ts +0 -32
- package/dist/shared/chunk-7hr53mby.js +0 -116
- package/dist/shared/chunk-b8jb1w72.js +0 -145
- package/dist/shared/chunk-cpewy6yg.js +0 -178
- package/dist/shared/chunk-e3e4s4ds.d.ts +0 -77
- package/dist/shared/chunk-enm6td0p.js +0 -280
- package/dist/shared/chunk-fvedaas2.d.ts +0 -33
- package/dist/shared/chunk-gex38j8x.d.ts +0 -82
- package/dist/shared/chunk-hwtxpzg0.js +0 -69
- package/dist/shared/chunk-phb53x1f.js +0 -252
- package/dist/shared/chunk-r8esmjfs.d.ts +0 -42
- package/dist/shared/chunk-rcp1g9ca.js +0 -70
- package/dist/shared/chunk-rx9sphz2.js +0 -266
- package/dist/shared/chunk-xdeek16r.d.ts +0 -58
- package/dist/shared/chunk-xkzjk1tq.js +0 -206
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// lib/artwork.ts
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
var NONE = "none";
|
|
6
|
+
function useStableArtwork2(artwork, trackKey) {
|
|
7
|
+
const id = typeof artwork === "string" ? artwork : `node:${trackKey}`;
|
|
8
|
+
const [shown, setShown] = useState(() => artwork == null ? { id: NONE, art: null, track: trackKey } : { id, art: artwork, track: trackKey });
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (artwork === undefined)
|
|
11
|
+
return;
|
|
12
|
+
if (artwork === null) {
|
|
13
|
+
setShown((prev) => prev.track === trackKey ? prev : { id: NONE, art: null, track: trackKey });
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (typeof artwork !== "string") {
|
|
17
|
+
setShown((prev) => prev.id === id ? prev : { id, art: artwork, track: trackKey });
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
let live = true;
|
|
21
|
+
const image = new Image;
|
|
22
|
+
image.src = artwork;
|
|
23
|
+
image.decode().then(() => live && setShown((prev) => prev.id === id ? prev : { id, art: artwork, track: trackKey }), () => live && setShown((prev) => prev.track === trackKey ? prev : { id: NONE, art: null, track: trackKey }));
|
|
24
|
+
return () => {
|
|
25
|
+
live = false;
|
|
26
|
+
};
|
|
27
|
+
}, [id, trackKey, artwork === null, artwork === undefined]);
|
|
28
|
+
if (shown.id === id && artwork != null && typeof artwork !== "string")
|
|
29
|
+
return { id, art: artwork };
|
|
30
|
+
return shown;
|
|
31
|
+
}
|
|
32
|
+
var SAMPLE = 12;
|
|
33
|
+
function useArtworkTint2(src) {
|
|
34
|
+
const [tint, setTint] = useState();
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!src)
|
|
37
|
+
return;
|
|
38
|
+
let live = true;
|
|
39
|
+
const image = new Image;
|
|
40
|
+
image.crossOrigin = "anonymous";
|
|
41
|
+
image.src = src;
|
|
42
|
+
image.decode().then(() => {
|
|
43
|
+
const canvas = document.createElement("canvas");
|
|
44
|
+
canvas.width = canvas.height = SAMPLE;
|
|
45
|
+
const context = canvas.getContext("2d", { willReadFrequently: true });
|
|
46
|
+
if (!context)
|
|
47
|
+
return;
|
|
48
|
+
context.drawImage(image, 0, 0, SAMPLE, SAMPLE);
|
|
49
|
+
const { data } = context.getImageData(0, 0, SAMPLE, SAMPLE);
|
|
50
|
+
let r = 0;
|
|
51
|
+
let g = 0;
|
|
52
|
+
let b = 0;
|
|
53
|
+
let total = 0;
|
|
54
|
+
for (let i = 0;i < data.length; i += 4) {
|
|
55
|
+
const [pr = 0, pg = 0, pb = 0] = [data[i], data[i + 1], data[i + 2]];
|
|
56
|
+
const weight = 0.1 + (Math.max(pr, pg, pb) - Math.min(pr, pg, pb)) / 255;
|
|
57
|
+
r += pr * weight;
|
|
58
|
+
g += pg * weight;
|
|
59
|
+
b += pb * weight;
|
|
60
|
+
total += weight;
|
|
61
|
+
}
|
|
62
|
+
if (live)
|
|
63
|
+
setTint({ src, color: `rgb(${r / total} ${g / total} ${b / total})` });
|
|
64
|
+
}).catch(() => live && setTint({ src }));
|
|
65
|
+
return () => {
|
|
66
|
+
live = false;
|
|
67
|
+
};
|
|
68
|
+
}, [src]);
|
|
69
|
+
return tint && tint.src === src ? tint.color : undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { useStableArtwork2, useArtworkTint2 };
|
|
@@ -3,21 +3,28 @@
|
|
|
3
3
|
import {
|
|
4
4
|
DEFAULT_NOTCH2,
|
|
5
5
|
INSET2
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-61t2dfte.js";
|
|
7
7
|
import {
|
|
8
8
|
useIsland2
|
|
9
9
|
} from "./chunk-d5qm9cps.js";
|
|
10
10
|
import {
|
|
11
11
|
IslandTabs2
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-r471sknr.js";
|
|
13
|
+
import {
|
|
14
|
+
contentShown2,
|
|
15
|
+
contentHidden2,
|
|
16
|
+
contentEnter2
|
|
17
|
+
} from "./chunk-2s4q6mt0.js";
|
|
13
18
|
|
|
14
19
|
// blocks/app/expanded-island/index.tsx
|
|
15
20
|
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
21
|
+
import { useReduceMotion } from "@justanarthur/modo-ui/lib/reduced-motion";
|
|
16
22
|
import { useControllableState } from "@justanarthur/modo-ui/lib/use-controllable-state";
|
|
17
23
|
import { cn } from "@justanarthur/modo-ui/lib/utils";
|
|
18
24
|
import ScrollArea from "@justanarthur/modo-ui/primitives/layout/scroll-area";
|
|
19
25
|
import { SizeProvider } from "@justanarthur/modo-ui/primitives/systems/sizes";
|
|
20
26
|
import { Settings } from "lucide-react";
|
|
27
|
+
import { motion } from "motion/react";
|
|
21
28
|
import { useState } from "react";
|
|
22
29
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
30
|
/*!
|
|
@@ -42,6 +49,7 @@ function ExpandedIsland2({
|
|
|
42
49
|
const tab = tabs.find((t) => t.value === value) ?? tabs[0];
|
|
43
50
|
const title = tabs.find((t) => t.value === hovered)?.label ?? tab?.label;
|
|
44
51
|
const notch = island?.geometry.notch.height ?? DEFAULT_NOTCH2.height;
|
|
52
|
+
const reduced = useReduceMotion();
|
|
45
53
|
return /* @__PURE__ */ jsxs("div", {
|
|
46
54
|
className: cn("flex size-full flex-col", className),
|
|
47
55
|
children: [
|
|
@@ -83,10 +91,13 @@ function ExpandedIsland2({
|
|
|
83
91
|
}),
|
|
84
92
|
/* @__PURE__ */ jsx(ScrollArea, {
|
|
85
93
|
className: "min-h-0 flex-1",
|
|
86
|
-
viewportClassName: "scroll-fade [&>div]:flex [&>div]:min-h-full [&>div]:flex-col",
|
|
87
|
-
children: /* @__PURE__ */ jsx(
|
|
94
|
+
viewportClassName: "scroll-fade [&>div]:flex [&>div]:min-h-full [&>div]:flex-col [&>div]:!min-w-0",
|
|
95
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
88
96
|
className: "flex flex-1 flex-col py-1 [&>*]:flex-1",
|
|
89
97
|
style: { paddingInline: INSET2 },
|
|
98
|
+
initial: reduced ? { opacity: 0 } : contentHidden2,
|
|
99
|
+
animate: reduced ? { opacity: 1 } : contentShown2,
|
|
100
|
+
transition: contentEnter2,
|
|
90
101
|
children: tab ? tab.content : /* @__PURE__ */ jsx("div", {
|
|
91
102
|
className: "flex items-center justify-center text-caption text-muted-foreground",
|
|
92
103
|
children: empty
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// components/island/widget/index.tsx
|
|
4
|
+
import Button from "@justanarthur/modo-ui/components/actions/button";
|
|
5
|
+
import Tooltip from "@justanarthur/modo-ui/components/overlays/tooltip";
|
|
6
|
+
import { useSize } from "@justanarthur/modo-ui/lib/size-context";
|
|
7
|
+
import { SURFACE_BG } from "@justanarthur/modo-ui/lib/surface-classes";
|
|
8
|
+
import { useLift } from "@justanarthur/modo-ui/lib/surface-context";
|
|
9
|
+
import { cn } from "@justanarthur/modo-ui/lib/utils";
|
|
10
|
+
import { SizeScope } from "@justanarthur/modo-ui/primitives/systems/sizes";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
/*!
|
|
13
|
+
* Local addition: the open island's widget vocabulary, one frame and the few
|
|
14
|
+
* parts every widget is built from, so Now Playing, Calendar and the rest
|
|
15
|
+
* read as one system.
|
|
16
|
+
*/
|
|
17
|
+
var TITLE = { default: "text-title", compact: "text-title-compact" };
|
|
18
|
+
var SUBTITLE = { default: "text-body", compact: "text-body-compact" };
|
|
19
|
+
var CAPTION = { default: "text-caption", compact: "text-caption-compact" };
|
|
20
|
+
var FIGURE = { default: "text-display", compact: "text-display-compact" };
|
|
21
|
+
var GAP = { default: "gap-5", compact: "gap-4" };
|
|
22
|
+
var ASIDE = { default: "pl-5", compact: "pl-4" };
|
|
23
|
+
var META_ICON = { default: 14, compact: 12 };
|
|
24
|
+
var ACTION_GLYPH = { default: 16, compact: 14 };
|
|
25
|
+
var PRIMARY_GLYPH = { default: 22, compact: 18 };
|
|
26
|
+
function WidgetHeader2({ icon: Icon, children, trailing, className }) {
|
|
27
|
+
const size = useSize();
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
29
|
+
className: cn("flex h-6 min-w-0 items-center gap-1.5 text-muted-foreground", CAPTION[size.variant], className),
|
|
30
|
+
children: [
|
|
31
|
+
Icon && /* @__PURE__ */ jsx(Icon, {
|
|
32
|
+
size: META_ICON[size.variant],
|
|
33
|
+
strokeWidth: 1.5,
|
|
34
|
+
className: "shrink-0"
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ jsx("span", {
|
|
37
|
+
className: "min-w-0 flex-1 truncate",
|
|
38
|
+
children
|
|
39
|
+
}),
|
|
40
|
+
trailing && /* @__PURE__ */ jsx("span", {
|
|
41
|
+
className: "-mr-1 flex shrink-0 items-center",
|
|
42
|
+
children: trailing
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function WidgetTitle2({ children, leading, className }) {
|
|
48
|
+
const size = useSize();
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
50
|
+
className: cn("flex min-w-0 items-center gap-2", className),
|
|
51
|
+
children: [
|
|
52
|
+
leading,
|
|
53
|
+
/* @__PURE__ */ jsx("span", {
|
|
54
|
+
className: cn("min-w-0 truncate weight-semibold text-foreground", TITLE[size.variant]),
|
|
55
|
+
children
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function WidgetSubtitle2({ children, className }) {
|
|
61
|
+
const size = useSize();
|
|
62
|
+
return /* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: cn("block min-w-0 truncate text-muted-foreground", SUBTITLE[size.variant], className),
|
|
64
|
+
children
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function WidgetFigure2({ value, unit, prefix, color, className }) {
|
|
68
|
+
const size = useSize();
|
|
69
|
+
const small = cn("weight-semibold text-muted-foreground", TITLE[size.variant]);
|
|
70
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
71
|
+
className: cn("flex min-w-0 items-baseline gap-1.5 whitespace-nowrap tabular-nums", className),
|
|
72
|
+
children: [
|
|
73
|
+
prefix && /* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: small,
|
|
75
|
+
children: prefix
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ jsx("span", {
|
|
78
|
+
className: cn("weight-bold", FIGURE[size.variant], color ? undefined : "text-foreground"),
|
|
79
|
+
style: color ? { color } : undefined,
|
|
80
|
+
children: value
|
|
81
|
+
}),
|
|
82
|
+
unit && /* @__PURE__ */ jsx("span", {
|
|
83
|
+
className: small,
|
|
84
|
+
children: unit
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function WidgetMetaItem2({ icon: Icon, children }) {
|
|
90
|
+
const size = useSize();
|
|
91
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
92
|
+
className: "flex min-w-0 items-center gap-1 last:shrink-[100]",
|
|
93
|
+
children: [
|
|
94
|
+
Icon && /* @__PURE__ */ jsx(Icon, {
|
|
95
|
+
size: META_ICON[size.variant],
|
|
96
|
+
strokeWidth: 1.5,
|
|
97
|
+
className: "shrink-0"
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ jsx("span", {
|
|
100
|
+
className: "min-w-0 truncate",
|
|
101
|
+
children
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function WidgetMeta2({ children, className }) {
|
|
107
|
+
const size = useSize();
|
|
108
|
+
return /* @__PURE__ */ jsx("div", {
|
|
109
|
+
className: cn("flex min-w-0 items-center gap-3 whitespace-nowrap text-muted-foreground tabular-nums", CAPTION[size.variant], className),
|
|
110
|
+
children
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function WidgetAction2({
|
|
114
|
+
icon: Icon,
|
|
115
|
+
label,
|
|
116
|
+
onClick,
|
|
117
|
+
pressed,
|
|
118
|
+
emphasis = "default",
|
|
119
|
+
filled = false,
|
|
120
|
+
color,
|
|
121
|
+
disabled = false
|
|
122
|
+
}) {
|
|
123
|
+
const size = useSize();
|
|
124
|
+
const primary = emphasis === "primary";
|
|
125
|
+
const lit = primary || !!pressed;
|
|
126
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
127
|
+
content: label,
|
|
128
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
129
|
+
variant: "ghost",
|
|
130
|
+
size: size.variant === "compact" ? "icon-compact" : "icon",
|
|
131
|
+
"aria-label": label,
|
|
132
|
+
"aria-pressed": pressed,
|
|
133
|
+
disabled,
|
|
134
|
+
className: cn(lit && "text-foreground"),
|
|
135
|
+
style: pressed && color ? { color } : undefined,
|
|
136
|
+
onClick,
|
|
137
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
138
|
+
size: primary ? PRIMARY_GLYPH[size.variant] : ACTION_GLYPH[size.variant],
|
|
139
|
+
strokeWidth: 1.5,
|
|
140
|
+
fill: filled ? "currentColor" : "none",
|
|
141
|
+
strokeLinejoin: "round"
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function WidgetMessage2({ icon: Icon, title, description, actions, className }) {
|
|
147
|
+
const size = useSize();
|
|
148
|
+
const level = useLift(1);
|
|
149
|
+
return /* @__PURE__ */ jsx("div", {
|
|
150
|
+
className: cn("@container flex size-full items-center justify-center", className),
|
|
151
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
152
|
+
className: "flex w-full max-w-120 items-center gap-4",
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ jsx("span", {
|
|
155
|
+
className: cn("flex size-12 shrink-0 items-center justify-center rounded-xl text-muted-foreground", SURFACE_BG[level]),
|
|
156
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
157
|
+
size: 20,
|
|
158
|
+
strokeWidth: 1.5
|
|
159
|
+
})
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsxs("div", {
|
|
162
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ jsx("span", {
|
|
165
|
+
className: cn("weight-semibold text-foreground", SUBTITLE[size.variant]),
|
|
166
|
+
children: title
|
|
167
|
+
}),
|
|
168
|
+
description && /* @__PURE__ */ jsx("span", {
|
|
169
|
+
className: cn("text-pretty text-muted-foreground", CAPTION[size.variant]),
|
|
170
|
+
children: description
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
}),
|
|
174
|
+
actions && /* @__PURE__ */ jsx("div", {
|
|
175
|
+
className: "flex shrink-0 items-center gap-2 @max-[22rem]:hidden",
|
|
176
|
+
children: actions
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function WidgetSection2({ label, trailing, children, className }) {
|
|
183
|
+
const size = useSize();
|
|
184
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
185
|
+
className: cn("flex min-w-0 flex-col", className),
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ jsxs("div", {
|
|
188
|
+
className: cn("flex h-6 min-w-0 items-center gap-2 text-muted-foreground", CAPTION[size.variant]),
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ jsx("span", {
|
|
191
|
+
className: "shrink-0",
|
|
192
|
+
children: label
|
|
193
|
+
}),
|
|
194
|
+
trailing && /* @__PURE__ */ jsx("span", {
|
|
195
|
+
className: "flex min-w-0 flex-1 items-center justify-end gap-1.5",
|
|
196
|
+
children: trailing
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
}),
|
|
200
|
+
children
|
|
201
|
+
]
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
function WidgetRow2({ leading, color, children, trailing, className }) {
|
|
205
|
+
const size = useSize();
|
|
206
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
207
|
+
className: cn("flex h-7 min-w-0 items-center gap-2.5", SUBTITLE[size.variant], className),
|
|
208
|
+
children: [
|
|
209
|
+
leading !== undefined && /* @__PURE__ */ jsx("span", {
|
|
210
|
+
className: cn("w-15 shrink-0 whitespace-nowrap tabular-nums text-muted-foreground", CAPTION[size.variant]),
|
|
211
|
+
children: leading
|
|
212
|
+
}),
|
|
213
|
+
color && /* @__PURE__ */ jsx("span", {
|
|
214
|
+
"aria-hidden": true,
|
|
215
|
+
className: "h-3.5 w-0.75 shrink-0 rounded-full",
|
|
216
|
+
style: { backgroundColor: color }
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ jsx("span", {
|
|
219
|
+
className: "min-w-0 flex-1 truncate text-foreground",
|
|
220
|
+
children
|
|
221
|
+
}),
|
|
222
|
+
trailing && /* @__PURE__ */ jsx("span", {
|
|
223
|
+
className: cn("flex shrink-0 items-center gap-1 text-muted-foreground", CAPTION[size.variant]),
|
|
224
|
+
children: trailing
|
|
225
|
+
})
|
|
226
|
+
]
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function WidgetChip2({ color, children }) {
|
|
230
|
+
const level = useLift(1);
|
|
231
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
232
|
+
className: cn("inline-flex h-5 min-w-0 items-center gap-1.5 rounded-full px-2 text-micro text-foreground", SURFACE_BG[level]),
|
|
233
|
+
children: [
|
|
234
|
+
color && /* @__PURE__ */ jsx("span", {
|
|
235
|
+
"aria-hidden": true,
|
|
236
|
+
className: "size-1.5 shrink-0 rounded-full",
|
|
237
|
+
style: { backgroundColor: color }
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ jsx("span", {
|
|
240
|
+
className: "min-w-0 truncate",
|
|
241
|
+
children
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
function WidgetSheet2({ children, size, className }) {
|
|
247
|
+
return /* @__PURE__ */ jsx(SizeScope, {
|
|
248
|
+
size,
|
|
249
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
250
|
+
className: cn("flex w-full min-w-0 flex-col gap-6", className),
|
|
251
|
+
children
|
|
252
|
+
})
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
var Widget2 = Object.assign(function Widget({ media, aside, children, size, className }) {
|
|
256
|
+
const step = useSize(size);
|
|
257
|
+
return /* @__PURE__ */ jsx(SizeScope, {
|
|
258
|
+
size,
|
|
259
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
260
|
+
className: cn("@container flex w-full min-h-0 flex-col justify-center", className),
|
|
261
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
262
|
+
className: cn("flex w-full min-h-0 items-stretch", GAP[step.variant]),
|
|
263
|
+
children: [
|
|
264
|
+
media && /* @__PURE__ */ jsx("div", {
|
|
265
|
+
className: "flex shrink-0 items-center",
|
|
266
|
+
children: media
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ jsx("div", {
|
|
269
|
+
className: "flex min-w-0 flex-1 flex-col justify-center gap-1",
|
|
270
|
+
children
|
|
271
|
+
}),
|
|
272
|
+
aside && /* @__PURE__ */ jsx("div", {
|
|
273
|
+
className: cn("flex w-[42%] min-w-0 shrink-0 flex-col justify-center border-l border-border @max-[30rem]:hidden", ASIDE[step.variant]),
|
|
274
|
+
children: aside
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
})
|
|
278
|
+
})
|
|
279
|
+
});
|
|
280
|
+
}, {
|
|
281
|
+
Header: WidgetHeader2,
|
|
282
|
+
Title: WidgetTitle2,
|
|
283
|
+
Subtitle: WidgetSubtitle2,
|
|
284
|
+
Figure: WidgetFigure2,
|
|
285
|
+
Meta: WidgetMeta2,
|
|
286
|
+
MetaItem: WidgetMetaItem2,
|
|
287
|
+
Action: WidgetAction2,
|
|
288
|
+
Message: WidgetMessage2,
|
|
289
|
+
Section: WidgetSection2,
|
|
290
|
+
Row: WidgetRow2,
|
|
291
|
+
Chip: WidgetChip2,
|
|
292
|
+
Sheet: WidgetSheet2
|
|
293
|
+
});
|
|
294
|
+
var widget_default = Widget2;
|
|
295
|
+
export { WidgetHeader2, WidgetTitle2, WidgetSubtitle2, WidgetFigure2, WidgetMetaItem2, WidgetMeta2, WidgetAction2, WidgetMessage2, WidgetSection2, WidgetRow2, WidgetChip2, WidgetSheet2, Widget2, widget_default };
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
shapeFor2,
|
|
6
6
|
bubbleFor2,
|
|
7
7
|
islandPath2
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-61t2dfte.js";
|
|
9
9
|
import {
|
|
10
10
|
IslandContext2
|
|
11
11
|
} from "./chunk-d5qm9cps.js";
|
|
@@ -70,7 +70,7 @@ function Island2({
|
|
|
70
70
|
notchWidth = 185,
|
|
71
71
|
notchHeight = 32,
|
|
72
72
|
panelWidth = 720,
|
|
73
|
-
panelHeight =
|
|
73
|
+
panelHeight = 240,
|
|
74
74
|
leading,
|
|
75
75
|
trailing,
|
|
76
76
|
minimal,
|