@epicbagel/saas-kit 1.31.0 → 1.33.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/THIRD_PARTY_NOTICES.md +6 -5
- package/dist/chunk-2DCJ2SFU.js +20 -0
- package/dist/chunk-2FVFPGP5.js +489 -0
- package/dist/{chunk-HTPPNW74.js → chunk-AWCXVYPL.js} +1 -1
- package/dist/chunk-B54ZEKBG.cjs +63 -0
- package/dist/chunk-CXAFTEEP.cjs +20 -0
- package/dist/{chunk-MOJHETNO.cjs → chunk-F3D5HA2F.cjs} +10 -10
- package/dist/chunk-G3SF4RRA.cjs +489 -0
- package/dist/chunk-HTTRUJQU.cjs +60 -0
- package/dist/{chunk-JS6BLIWL.js → chunk-IZF4WCK6.js} +11 -11
- package/dist/{chunk-PH2TV7XI.cjs → chunk-KOR2QR7I.cjs} +5 -5
- package/dist/{chunk-BGCNGYPL.cjs → chunk-PTMZTP3V.cjs} +2 -2
- package/dist/{chunk-6O3DUMF7.js → chunk-REGA2L5S.js} +1 -1
- package/dist/{chunk-PNI354BY.cjs → chunk-SL6ECEN6.cjs} +2 -2
- package/dist/{chunk-ZGTPNSR7.js → chunk-TS4MC3B3.js} +4 -4
- package/dist/chunk-TUQVHPSI.js +60 -0
- package/dist/chunk-VWOWPNKT.js +73 -0
- package/dist/chunk-XH2I3YJ6.js +63 -0
- package/dist/chunk-Y6X6XDHE.cjs +73 -0
- package/dist/primitives/accent-theme.cjs +66 -0
- package/dist/primitives/accent-theme.d.cts +32 -0
- package/dist/primitives/accent-theme.d.ts +32 -0
- package/dist/primitives/accent-theme.js +66 -0
- package/dist/primitives/activity-feed.cjs +2 -2
- package/dist/primitives/activity-feed.js +2 -2
- package/dist/primitives/agent-audio-visualizer-bar.cjs +3 -3
- package/dist/primitives/agent-audio-visualizer-bar.js +2 -2
- package/dist/primitives/alert.d.cts +1 -1
- package/dist/primitives/alert.d.ts +1 -1
- package/dist/primitives/app-layout.cjs +114 -0
- package/dist/primitives/app-layout.d.cts +47 -0
- package/dist/primitives/app-layout.d.ts +47 -0
- package/dist/primitives/app-layout.js +114 -0
- package/dist/primitives/app-sidebar.cjs +52 -0
- package/dist/primitives/app-sidebar.d.cts +105 -0
- package/dist/primitives/app-sidebar.d.ts +105 -0
- package/dist/primitives/app-sidebar.js +52 -0
- package/dist/primitives/archive-confirmation-dialog.cjs +2 -2
- package/dist/primitives/archive-confirmation-dialog.js +3 -3
- package/dist/primitives/back-bar.cjs +37 -0
- package/dist/primitives/back-bar.d.cts +31 -0
- package/dist/primitives/back-bar.d.ts +31 -0
- package/dist/primitives/back-bar.js +37 -0
- package/dist/primitives/badge.d.cts +1 -1
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/batch-action-bar.cjs +134 -0
- package/dist/primitives/batch-action-bar.d.cts +27 -0
- package/dist/primitives/batch-action-bar.d.ts +27 -0
- package/dist/primitives/batch-action-bar.js +134 -0
- package/dist/primitives/board-view-internals.cjs +3 -3
- package/dist/primitives/board-view-internals.js +2 -2
- package/dist/primitives/board-view.cjs +8 -8
- package/dist/primitives/board-view.js +7 -7
- package/dist/primitives/brand-mark.cjs +26 -0
- package/dist/primitives/brand-mark.d.cts +10 -0
- package/dist/primitives/brand-mark.d.ts +10 -0
- package/dist/primitives/brand-mark.js +26 -0
- package/dist/primitives/bubble.d.cts +1 -1
- package/dist/primitives/bubble.d.ts +1 -1
- package/dist/primitives/button.d.cts +2 -2
- package/dist/primitives/button.d.ts +2 -2
- package/dist/primitives/chat.cjs +27 -27
- package/dist/primitives/chat.js +21 -21
- package/dist/primitives/code-block.cjs +4 -4
- package/dist/primitives/code-block.js +3 -3
- package/dist/primitives/command.cjs +129 -0
- package/dist/primitives/command.d.cts +60 -0
- package/dist/primitives/command.d.ts +60 -0
- package/dist/primitives/command.js +129 -0
- package/dist/primitives/compact-list.cjs +24 -0
- package/dist/primitives/compact-list.d.cts +18 -0
- package/dist/primitives/compact-list.d.ts +18 -0
- package/dist/primitives/compact-list.js +24 -0
- package/dist/primitives/connection.cjs +6 -6
- package/dist/primitives/connection.js +8 -8
- package/dist/primitives/context-bar.cjs +57 -0
- package/dist/primitives/context-bar.d.cts +50 -0
- package/dist/primitives/context-bar.d.ts +50 -0
- package/dist/primitives/context-bar.js +57 -0
- package/dist/primitives/copy-button.cjs +3 -3
- package/dist/primitives/copy-button.js +2 -2
- package/dist/primitives/cycling-prompt.cjs +102 -0
- package/dist/primitives/cycling-prompt.d.cts +24 -0
- package/dist/primitives/cycling-prompt.d.ts +24 -0
- package/dist/primitives/cycling-prompt.js +102 -0
- package/dist/primitives/dialog.d.cts +9 -9
- package/dist/primitives/dialog.d.ts +9 -9
- package/dist/primitives/dotted-list.cjs +41 -0
- package/dist/primitives/dotted-list.d.cts +28 -0
- package/dist/primitives/dotted-list.d.ts +28 -0
- package/dist/primitives/dotted-list.js +41 -0
- package/dist/primitives/drawer.d.cts +6 -6
- package/dist/primitives/drawer.d.ts +6 -6
- package/dist/primitives/field.cjs +3 -3
- package/dist/primitives/field.js +2 -2
- package/dist/primitives/file-dropzone.cjs +3 -3
- package/dist/primitives/file-dropzone.js +2 -2
- package/dist/primitives/file-preview.cjs +4 -4
- package/dist/primitives/file-preview.js +3 -3
- package/dist/primitives/filter-bar.cjs +4 -4
- package/dist/primitives/filter-bar.js +3 -3
- package/dist/primitives/fixed-action-bar.cjs +46 -0
- package/dist/primitives/fixed-action-bar.d.cts +15 -0
- package/dist/primitives/fixed-action-bar.d.ts +15 -0
- package/dist/primitives/fixed-action-bar.js +46 -0
- package/dist/primitives/floating-action-button.cjs +65 -0
- package/dist/primitives/floating-action-button.d.cts +52 -0
- package/dist/primitives/floating-action-button.d.ts +52 -0
- package/dist/primitives/floating-action-button.js +65 -0
- package/dist/primitives/form-section.cjs +38 -0
- package/dist/primitives/form-section.d.cts +43 -0
- package/dist/primitives/form-section.d.ts +43 -0
- package/dist/primitives/form-section.js +38 -0
- package/dist/primitives/key-value-grid.cjs +52 -0
- package/dist/primitives/key-value-grid.d.cts +20 -0
- package/dist/primitives/key-value-grid.d.ts +20 -0
- package/dist/primitives/key-value-grid.js +52 -0
- package/dist/primitives/marketing-footer.cjs +34 -0
- package/dist/primitives/marketing-footer.d.cts +29 -0
- package/dist/primitives/marketing-footer.d.ts +29 -0
- package/dist/primitives/marketing-footer.js +34 -0
- package/dist/primitives/marketing-header.cjs +41 -0
- package/dist/primitives/marketing-header.d.cts +31 -0
- package/dist/primitives/marketing-header.d.ts +31 -0
- package/dist/primitives/marketing-header.js +41 -0
- package/dist/primitives/marketing-section.cjs +8 -0
- package/dist/primitives/marketing-section.d.cts +35 -0
- package/dist/primitives/marketing-section.d.ts +35 -0
- package/dist/primitives/marketing-section.js +8 -0
- package/dist/primitives/marketing-shell.cjs +28 -0
- package/dist/primitives/marketing-shell.d.cts +14 -0
- package/dist/primitives/marketing-shell.d.ts +14 -0
- package/dist/primitives/marketing-shell.js +28 -0
- package/dist/primitives/notes.cjs +4 -4
- package/dist/primitives/notes.js +4 -4
- package/dist/primitives/page-header.cjs +3 -67
- package/dist/primitives/page-header.js +3 -67
- package/dist/primitives/page-tabs.cjs +4 -57
- package/dist/primitives/page-tabs.js +4 -57
- package/dist/primitives/pager.cjs +85 -0
- package/dist/primitives/pager.d.cts +39 -0
- package/dist/primitives/pager.d.ts +39 -0
- package/dist/primitives/pager.js +85 -0
- package/dist/primitives/pagination.cjs +119 -0
- package/dist/primitives/pagination.d.cts +41 -0
- package/dist/primitives/pagination.d.ts +41 -0
- package/dist/primitives/pagination.js +119 -0
- package/dist/primitives/poster.cjs +406 -0
- package/dist/primitives/poster.d.cts +406 -0
- package/dist/primitives/poster.d.ts +406 -0
- package/dist/primitives/poster.js +406 -0
- package/dist/primitives/resource-list.cjs +8 -8
- package/dist/primitives/resource-list.js +7 -7
- package/dist/primitives/responsive-embed.cjs +29 -0
- package/dist/primitives/responsive-embed.d.cts +14 -0
- package/dist/primitives/responsive-embed.d.ts +14 -0
- package/dist/primitives/responsive-embed.js +29 -0
- package/dist/primitives/save-bar.cjs +91 -0
- package/dist/primitives/save-bar.d.cts +55 -0
- package/dist/primitives/save-bar.d.ts +55 -0
- package/dist/primitives/save-bar.js +91 -0
- package/dist/primitives/settings-list.cjs +10 -0
- package/dist/primitives/settings-list.d.cts +31 -0
- package/dist/primitives/settings-list.d.ts +31 -0
- package/dist/primitives/settings-list.js +10 -0
- package/dist/primitives/settings-section.cjs +34 -0
- package/dist/primitives/settings-section.d.cts +44 -0
- package/dist/primitives/settings-section.d.ts +44 -0
- package/dist/primitives/settings-section.js +34 -0
- package/dist/primitives/sheet.d.cts +9 -9
- package/dist/primitives/sheet.d.ts +9 -9
- package/dist/primitives/short-video.cjs +110 -0
- package/dist/primitives/short-video.d.cts +30 -0
- package/dist/primitives/short-video.d.ts +30 -0
- package/dist/primitives/short-video.js +110 -0
- package/dist/primitives/stats-card.cjs +46 -0
- package/dist/primitives/stats-card.d.cts +19 -0
- package/dist/primitives/stats-card.d.ts +19 -0
- package/dist/primitives/stats-card.js +46 -0
- package/dist/primitives/stats-strip.cjs +38 -0
- package/dist/primitives/stats-strip.d.cts +24 -0
- package/dist/primitives/stats-strip.d.ts +24 -0
- package/dist/primitives/stats-strip.js +38 -0
- package/dist/primitives/step-list.cjs +32 -0
- package/dist/primitives/step-list.d.cts +19 -0
- package/dist/primitives/step-list.d.ts +19 -0
- package/dist/primitives/step-list.js +32 -0
- package/dist/primitives/steps.cjs +77 -0
- package/dist/primitives/steps.d.cts +35 -0
- package/dist/primitives/steps.d.ts +35 -0
- package/dist/primitives/steps.js +77 -0
- package/dist/primitives/tabbed-page-header.cjs +53 -0
- package/dist/primitives/tabbed-page-header.d.cts +26 -0
- package/dist/primitives/tabbed-page-header.d.ts +26 -0
- package/dist/primitives/tabbed-page-header.js +53 -0
- package/dist/primitives/theme-selector.cjs +17 -17
- package/dist/primitives/theme-selector.js +5 -5
- package/dist/primitives/voice-dictation-button.cjs +5 -5
- package/dist/primitives/voice-dictation-button.js +4 -4
- package/dist/primitives/voice-session-controls.cjs +4 -4
- package/dist/primitives/voice-session-controls.js +3 -3
- package/dist/primitives/workflow-assistant.cjs +5 -5
- package/dist/primitives/workflow-assistant.js +3 -3
- package/package.json +322 -1
- package/src/styles/components/poster.css +1449 -0
- package/src/styles/components.css +1 -0
- package/src/styles/utilities.css +2 -2
- package/dist/{chunk-5OF6D3GH.js → chunk-4TJBXXUE.js} +3 -3
- package/dist/{chunk-DILYV4FI.js → chunk-7ZRFXJVN.js} +3 -3
- package/dist/{chunk-YYFVG5A6.cjs → chunk-D46FNEZ5.cjs} +2 -2
- package/dist/{chunk-NKWHDI4C.cjs → chunk-FB3VY2PL.cjs} +2 -2
- package/dist/{chunk-MW67PHAQ.cjs → chunk-GUVQAWUW.cjs} +9 -9
- package/dist/{chunk-WHDHUYS6.js → chunk-HBRVOGLA.js} +3 -3
- package/dist/{chunk-FARCLWLU.cjs → chunk-HHF5DEKM.cjs} +3 -3
- package/dist/{chunk-TWCJMFST.js → chunk-O42YC6ZQ.js} +3 -3
- package/dist/{chunk-ZJFYOXSM.cjs → chunk-SRVRNHCX.cjs} +2 -2
- package/dist/{chunk-UFFHGKI7.js → chunk-SW4T3O7M.js} +9 -9
- package/dist/{chunk-62UTAG2C.js → chunk-ULZB4A2I.js} +3 -3
- package/dist/{chunk-ZLEM2SAU.cjs → chunk-Z3JJSNR5.cjs} +2 -2
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogContent
|
|
5
|
+
} from "../chunk-3QT5VYZ3.js";
|
|
6
|
+
import {
|
|
7
|
+
cn
|
|
8
|
+
} from "../chunk-G6SRSWXB.js";
|
|
9
|
+
|
|
10
|
+
// src/primitives/command.tsx
|
|
11
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import { Search } from "lucide-react";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var Command = React.forwardRef(({ className, height = "full", surface = "plain", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
16
|
+
CommandPrimitive,
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
className: cn(
|
|
20
|
+
"flex w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
21
|
+
height === "full" && "h-full",
|
|
22
|
+
surface === "bordered" && "border",
|
|
23
|
+
className
|
|
24
|
+
),
|
|
25
|
+
...props
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
Command.displayName = CommandPrimitive.displayName;
|
|
29
|
+
var CommandDialog = ({ children, ...props }) => {
|
|
30
|
+
return /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsx(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: /* @__PURE__ */ jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) });
|
|
31
|
+
};
|
|
32
|
+
var CommandInput = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
CommandPrimitive.Input,
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
className: cn(
|
|
39
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-[16px] md:text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] }));
|
|
46
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
47
|
+
var CommandList = React.forwardRef(({ className, maxHeight = "default", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
48
|
+
CommandPrimitive.List,
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
className: cn(
|
|
52
|
+
maxHeight === "default" ? "max-h-[300px]" : "max-h-44",
|
|
53
|
+
"overflow-y-auto overflow-x-hidden",
|
|
54
|
+
className
|
|
55
|
+
),
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
));
|
|
59
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
60
|
+
var CommandEmpty = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
61
|
+
CommandPrimitive.Empty,
|
|
62
|
+
{
|
|
63
|
+
ref,
|
|
64
|
+
className: "py-6 text-center text-sm",
|
|
65
|
+
...props
|
|
66
|
+
}
|
|
67
|
+
));
|
|
68
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
69
|
+
var CommandGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
70
|
+
CommandPrimitive.Group,
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
className: cn(
|
|
74
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
));
|
|
80
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
81
|
+
var CommandSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
82
|
+
CommandPrimitive.Separator,
|
|
83
|
+
{
|
|
84
|
+
ref,
|
|
85
|
+
className: cn("-mx-1 h-px bg-border", className),
|
|
86
|
+
...props
|
|
87
|
+
}
|
|
88
|
+
));
|
|
89
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
90
|
+
var CommandItem = React.forwardRef(({ className, gap = "none", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
91
|
+
CommandPrimitive.Item,
|
|
92
|
+
{
|
|
93
|
+
ref,
|
|
94
|
+
className: cn(
|
|
95
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[disabled=false]:pointer-events-auto data-[disabled=false]:opacity-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
96
|
+
gap === "sm" && "gap-2",
|
|
97
|
+
className
|
|
98
|
+
),
|
|
99
|
+
...props
|
|
100
|
+
}
|
|
101
|
+
));
|
|
102
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
103
|
+
var CommandShortcut = ({
|
|
104
|
+
className,
|
|
105
|
+
...props
|
|
106
|
+
}) => {
|
|
107
|
+
return /* @__PURE__ */ jsx(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
className: cn(
|
|
111
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
...props
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
119
|
+
export {
|
|
120
|
+
Command,
|
|
121
|
+
CommandDialog,
|
|
122
|
+
CommandEmpty,
|
|
123
|
+
CommandGroup,
|
|
124
|
+
CommandInput,
|
|
125
|
+
CommandItem,
|
|
126
|
+
CommandList,
|
|
127
|
+
CommandSeparator,
|
|
128
|
+
CommandShortcut
|
|
129
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkR3DQS6U4cjs = require('../chunk-R3DQS6U4.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkKWLSBTB2cjs = require('../chunk-KWLSBTB2.cjs');
|
|
8
|
+
|
|
9
|
+
// src/primitives/compact-list.tsx
|
|
10
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
11
|
+
function CompactList({ items, className }) {
|
|
12
|
+
if (items.length === 0) return null;
|
|
13
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR3DQS6U4cjs.Card, { className: _chunkKWLSBTB2cjs.cn.call(void 0, "divide-y divide-border", className), children: items.map((item) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 px-3 py-2.5", children: [
|
|
14
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "min-w-0 flex-1", children: [
|
|
15
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate text-sm font-medium", children: item.title }),
|
|
16
|
+
item.description && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate text-xs text-muted-foreground", children: item.description })
|
|
17
|
+
] }),
|
|
18
|
+
item.meta && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "shrink-0 text-sm text-muted-foreground", children: item.meta }),
|
|
19
|
+
item.actions && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex shrink-0 items-center gap-1", children: item.actions })
|
|
20
|
+
] }, item.id)) });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
exports.CompactList = CompactList;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface CompactListItem {
|
|
5
|
+
id: string;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
meta?: ReactNode;
|
|
9
|
+
actions?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface CompactListProps {
|
|
12
|
+
items: CompactListItem[];
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Dense rows with optional metadata and trailing actions. */
|
|
16
|
+
declare function CompactList({ items, className }: CompactListProps): react_jsx_runtime.JSX.Element | null;
|
|
17
|
+
|
|
18
|
+
export { CompactList, type CompactListItem, type CompactListProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface CompactListItem {
|
|
5
|
+
id: string;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
meta?: ReactNode;
|
|
9
|
+
actions?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface CompactListProps {
|
|
12
|
+
items: CompactListItem[];
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Dense rows with optional metadata and trailing actions. */
|
|
16
|
+
declare function CompactList({ items, className }: CompactListProps): react_jsx_runtime.JSX.Element | null;
|
|
17
|
+
|
|
18
|
+
export { CompactList, type CompactListItem, type CompactListProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Card
|
|
4
|
+
} from "../chunk-35YMAIEL.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "../chunk-G6SRSWXB.js";
|
|
8
|
+
|
|
9
|
+
// src/primitives/compact-list.tsx
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
function CompactList({ items, className }) {
|
|
12
|
+
if (items.length === 0) return null;
|
|
13
|
+
return /* @__PURE__ */ jsx(Card, { className: cn("divide-y divide-border", className), children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-3 py-2.5", children: [
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
15
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: item.title }),
|
|
16
|
+
item.description && /* @__PURE__ */ jsx("div", { className: "truncate text-xs text-muted-foreground", children: item.description })
|
|
17
|
+
] }),
|
|
18
|
+
item.meta && /* @__PURE__ */ jsx("div", { className: "shrink-0 text-sm text-muted-foreground", children: item.meta }),
|
|
19
|
+
item.actions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-1", children: item.actions })
|
|
20
|
+
] }, item.id)) });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
CompactList
|
|
24
|
+
};
|
|
@@ -12,28 +12,28 @@ var _chunkAU5GUDOWcjs = require('../chunk-AU5GUDOW.cjs');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _chunkWDXEJDMOcjs = require('../chunk-WDXEJDMO.cjs');
|
|
15
|
-
require('../chunk-ZAITUDYD.cjs');
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
var
|
|
17
|
+
var _chunkCTYOW3V2cjs = require('../chunk-CTYOW3V2.cjs');
|
|
18
|
+
require('../chunk-ZAITUDYD.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunk373W6VADcjs = require('../chunk-373W6VAD.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var _chunk667ZCM4Xcjs = require('../chunk-667ZCM4X.cjs');
|
|
26
|
-
require('../chunk-I6GUOEBO.cjs');
|
|
27
25
|
|
|
28
26
|
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
|
|
32
30
|
|
|
31
|
+
var _chunkLIUYHYFNcjs = require('../chunk-LIUYHYFN.cjs');
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
|
|
36
|
-
var
|
|
35
|
+
var _chunk667ZCM4Xcjs = require('../chunk-667ZCM4X.cjs');
|
|
36
|
+
require('../chunk-I6GUOEBO.cjs');
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
var _chunkJDEXZGIYcjs = require('../chunk-JDEXZGIY.cjs');
|
|
@@ -12,18 +12,13 @@ import {
|
|
|
12
12
|
DialogHeader,
|
|
13
13
|
DialogTitle
|
|
14
14
|
} from "../chunk-3QT5VYZ3.js";
|
|
15
|
-
import "../chunk-V4LE2HWP.js";
|
|
16
|
-
import {
|
|
17
|
-
Text
|
|
18
|
-
} from "../chunk-EIY5LLSP.js";
|
|
19
15
|
import {
|
|
20
16
|
Callout
|
|
21
17
|
} from "../chunk-GL5CV4FF.js";
|
|
18
|
+
import "../chunk-V4LE2HWP.js";
|
|
22
19
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} from "../chunk-R4AIM3BQ.js";
|
|
26
|
-
import "../chunk-D4ZL2OEQ.js";
|
|
20
|
+
Text
|
|
21
|
+
} from "../chunk-EIY5LLSP.js";
|
|
27
22
|
import {
|
|
28
23
|
AlertDialog,
|
|
29
24
|
AlertDialogAction,
|
|
@@ -34,6 +29,11 @@ import {
|
|
|
34
29
|
AlertDialogHeader,
|
|
35
30
|
AlertDialogTitle
|
|
36
31
|
} from "../chunk-ZLU32SRP.js";
|
|
32
|
+
import {
|
|
33
|
+
Alert,
|
|
34
|
+
AlertDescription
|
|
35
|
+
} from "../chunk-R4AIM3BQ.js";
|
|
36
|
+
import "../chunk-D4ZL2OEQ.js";
|
|
37
37
|
import {
|
|
38
38
|
buttonVariants
|
|
39
39
|
} from "../chunk-W326GKML.js";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkKWLSBTB2cjs = require('../chunk-KWLSBTB2.cjs');
|
|
6
|
+
|
|
7
|
+
// src/primitives/context-bar.tsx
|
|
8
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
9
|
+
var TONES = {
|
|
10
|
+
/** Inverted/solid — the strongest "you are in a special mode" signal (preview, impersonation). */
|
|
11
|
+
dark: "bg-foreground text-background",
|
|
12
|
+
/** Quiet, in-flow notice. */
|
|
13
|
+
muted: "bg-muted text-muted-foreground",
|
|
14
|
+
/** Caution — staging, destructive context, "this is live data". */
|
|
15
|
+
warning: "bg-amber-500 text-black",
|
|
16
|
+
/** Branded/informational. */
|
|
17
|
+
info: "bg-primary text-primary-foreground"
|
|
18
|
+
};
|
|
19
|
+
function ContextBar({
|
|
20
|
+
label,
|
|
21
|
+
icon,
|
|
22
|
+
children,
|
|
23
|
+
actions,
|
|
24
|
+
tone = "dark",
|
|
25
|
+
sticky = false,
|
|
26
|
+
frosted = false,
|
|
27
|
+
className,
|
|
28
|
+
maxWidth
|
|
29
|
+
}) {
|
|
30
|
+
const frostedMuted = frosted && tone === "muted";
|
|
31
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "context-bar",
|
|
35
|
+
"data-frosted-surface": frostedMuted ? "muted" : void 0,
|
|
36
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0, "w-full", frostedMuted ? "text-foreground" : TONES[tone], sticky && "sticky top-0 z-40", className),
|
|
37
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0,
|
|
41
|
+
"mx-auto flex w-full items-center gap-x-3 gap-y-2 px-4 py-3 sm:px-6",
|
|
42
|
+
maxWidth
|
|
43
|
+
),
|
|
44
|
+
children: [
|
|
45
|
+
icon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex shrink-0 items-center opacity-80 [&_svg]:size-4", children: icon }),
|
|
46
|
+
label && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "shrink-0 font-mono text-xs font-medium uppercase tracking-[0.2em]", children: label }),
|
|
47
|
+
children ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _chunkKWLSBTB2cjs.cn.call(void 0, "min-w-0 flex-1 truncate text-sm", !frostedMuted && "opacity-90"), children }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex-1" }),
|
|
48
|
+
actions && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
exports.ContextBar = ContextBar;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const TONES: {
|
|
5
|
+
/** Inverted/solid — the strongest "you are in a special mode" signal (preview, impersonation). */
|
|
6
|
+
readonly dark: "bg-foreground text-background";
|
|
7
|
+
/** Quiet, in-flow notice. */
|
|
8
|
+
readonly muted: "bg-muted text-muted-foreground";
|
|
9
|
+
/** Caution — staging, destructive context, "this is live data". */
|
|
10
|
+
readonly warning: "bg-amber-500 text-black";
|
|
11
|
+
/** Branded/informational. */
|
|
12
|
+
readonly info: "bg-primary text-primary-foreground";
|
|
13
|
+
};
|
|
14
|
+
interface ContextBarProps {
|
|
15
|
+
/**
|
|
16
|
+
* Short tag rendered in mono uppercase, e.g. `"Preview"`, `"Staging"`, `"Viewing as"`. The "what
|
|
17
|
+
* mode is this" label.
|
|
18
|
+
*/
|
|
19
|
+
label?: ReactNode;
|
|
20
|
+
/** Leading icon (sized to 1rem). */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
/** The message — a sentence explaining the context. */
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
/** Right-aligned controls — a toggle, a button, a dismiss. */
|
|
25
|
+
actions?: ReactNode;
|
|
26
|
+
/** Visual tone. Default `"dark"` (inverted). */
|
|
27
|
+
tone?: keyof typeof TONES;
|
|
28
|
+
/** Pin to the top of the scroll container. Default `false`. */
|
|
29
|
+
sticky?: boolean;
|
|
30
|
+
/** Blurred translucent muted tone; warning, info and dark tones stay solid for contrast. */
|
|
31
|
+
frosted?: boolean;
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Constrain the inner row to a max width (else full-bleed). e.g. `"max-w-5xl"`. */
|
|
34
|
+
maxWidth?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A full-width bar that announces the **current mode/context** of a view — a preview, an
|
|
38
|
+
* impersonation session, a staging environment, a draft — with an optional label, message, and
|
|
39
|
+
* right-aligned actions. App-agnostic: the booking preview is one use; "Viewing as {user}",
|
|
40
|
+
* "Staging — not real data", and "Draft — unpublished" are others.
|
|
41
|
+
*
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <ContextBar tone="dark" icon={<Eye />} label="Preview" actions={<CopyButton … />}>
|
|
44
|
+
* This is exactly what your recipient sees — nothing is booked here.
|
|
45
|
+
* </ContextBar>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function ContextBar({ label, icon, children, actions, tone, sticky, frosted, className, maxWidth, }: ContextBarProps): react_jsx_runtime.JSX.Element;
|
|
49
|
+
|
|
50
|
+
export { ContextBar, type ContextBarProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const TONES: {
|
|
5
|
+
/** Inverted/solid — the strongest "you are in a special mode" signal (preview, impersonation). */
|
|
6
|
+
readonly dark: "bg-foreground text-background";
|
|
7
|
+
/** Quiet, in-flow notice. */
|
|
8
|
+
readonly muted: "bg-muted text-muted-foreground";
|
|
9
|
+
/** Caution — staging, destructive context, "this is live data". */
|
|
10
|
+
readonly warning: "bg-amber-500 text-black";
|
|
11
|
+
/** Branded/informational. */
|
|
12
|
+
readonly info: "bg-primary text-primary-foreground";
|
|
13
|
+
};
|
|
14
|
+
interface ContextBarProps {
|
|
15
|
+
/**
|
|
16
|
+
* Short tag rendered in mono uppercase, e.g. `"Preview"`, `"Staging"`, `"Viewing as"`. The "what
|
|
17
|
+
* mode is this" label.
|
|
18
|
+
*/
|
|
19
|
+
label?: ReactNode;
|
|
20
|
+
/** Leading icon (sized to 1rem). */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
/** The message — a sentence explaining the context. */
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
/** Right-aligned controls — a toggle, a button, a dismiss. */
|
|
25
|
+
actions?: ReactNode;
|
|
26
|
+
/** Visual tone. Default `"dark"` (inverted). */
|
|
27
|
+
tone?: keyof typeof TONES;
|
|
28
|
+
/** Pin to the top of the scroll container. Default `false`. */
|
|
29
|
+
sticky?: boolean;
|
|
30
|
+
/** Blurred translucent muted tone; warning, info and dark tones stay solid for contrast. */
|
|
31
|
+
frosted?: boolean;
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Constrain the inner row to a max width (else full-bleed). e.g. `"max-w-5xl"`. */
|
|
34
|
+
maxWidth?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A full-width bar that announces the **current mode/context** of a view — a preview, an
|
|
38
|
+
* impersonation session, a staging environment, a draft — with an optional label, message, and
|
|
39
|
+
* right-aligned actions. App-agnostic: the booking preview is one use; "Viewing as {user}",
|
|
40
|
+
* "Staging — not real data", and "Draft — unpublished" are others.
|
|
41
|
+
*
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <ContextBar tone="dark" icon={<Eye />} label="Preview" actions={<CopyButton … />}>
|
|
44
|
+
* This is exactly what your recipient sees — nothing is booked here.
|
|
45
|
+
* </ContextBar>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function ContextBar({ label, icon, children, actions, tone, sticky, frosted, className, maxWidth, }: ContextBarProps): react_jsx_runtime.JSX.Element;
|
|
49
|
+
|
|
50
|
+
export { ContextBar, type ContextBarProps };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import {
|
|
4
|
+
cn
|
|
5
|
+
} from "../chunk-G6SRSWXB.js";
|
|
6
|
+
|
|
7
|
+
// src/primitives/context-bar.tsx
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var TONES = {
|
|
10
|
+
/** Inverted/solid — the strongest "you are in a special mode" signal (preview, impersonation). */
|
|
11
|
+
dark: "bg-foreground text-background",
|
|
12
|
+
/** Quiet, in-flow notice. */
|
|
13
|
+
muted: "bg-muted text-muted-foreground",
|
|
14
|
+
/** Caution — staging, destructive context, "this is live data". */
|
|
15
|
+
warning: "bg-amber-500 text-black",
|
|
16
|
+
/** Branded/informational. */
|
|
17
|
+
info: "bg-primary text-primary-foreground"
|
|
18
|
+
};
|
|
19
|
+
function ContextBar({
|
|
20
|
+
label,
|
|
21
|
+
icon,
|
|
22
|
+
children,
|
|
23
|
+
actions,
|
|
24
|
+
tone = "dark",
|
|
25
|
+
sticky = false,
|
|
26
|
+
frosted = false,
|
|
27
|
+
className,
|
|
28
|
+
maxWidth
|
|
29
|
+
}) {
|
|
30
|
+
const frostedMuted = frosted && tone === "muted";
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "context-bar",
|
|
35
|
+
"data-frosted-surface": frostedMuted ? "muted" : void 0,
|
|
36
|
+
className: cn("w-full", frostedMuted ? "text-foreground" : TONES[tone], sticky && "sticky top-0 z-40", className),
|
|
37
|
+
children: /* @__PURE__ */ jsxs(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: cn(
|
|
41
|
+
"mx-auto flex w-full items-center gap-x-3 gap-y-2 px-4 py-3 sm:px-6",
|
|
42
|
+
maxWidth
|
|
43
|
+
),
|
|
44
|
+
children: [
|
|
45
|
+
icon && /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center opacity-80 [&_svg]:size-4", children: icon }),
|
|
46
|
+
label && /* @__PURE__ */ jsx("span", { className: "shrink-0 font-mono text-xs font-medium uppercase tracking-[0.2em]", children: label }),
|
|
47
|
+
children ? /* @__PURE__ */ jsx("span", { className: cn("min-w-0 flex-1 truncate text-sm", !frostedMuted && "opacity-90"), children }) : /* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
48
|
+
actions && /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
ContextBar
|
|
57
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkHHF5DEKMcjs = require('../chunk-HHF5DEKM.cjs');
|
|
5
|
+
require('../chunk-4LXN6GLZ.cjs');
|
|
5
6
|
require('../chunk-JDEXZGIY.cjs');
|
|
6
7
|
require('../chunk-KWLSBTB2.cjs');
|
|
7
|
-
require('../chunk-4LXN6GLZ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.CopyButton =
|
|
10
|
+
exports.CopyButton = _chunkHHF5DEKMcjs.CopyButton;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
CopyButton
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-7ZRFXJVN.js";
|
|
5
|
+
import "../chunk-ZWZAAGQF.js";
|
|
5
6
|
import "../chunk-W326GKML.js";
|
|
6
7
|
import "../chunk-G6SRSWXB.js";
|
|
7
|
-
import "../chunk-ZWZAAGQF.js";
|
|
8
8
|
export {
|
|
9
9
|
CopyButton
|
|
10
10
|
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkKWLSBTB2cjs = require('../chunk-KWLSBTB2.cjs');
|
|
6
|
+
|
|
7
|
+
// src/primitives/cycling-prompt.tsx
|
|
8
|
+
var _react = require('react');
|
|
9
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
10
|
+
var TYPE_MS = 45;
|
|
11
|
+
var DELETE_MS = 22;
|
|
12
|
+
var HOLD_MS = 1800;
|
|
13
|
+
function CyclingPrompt({
|
|
14
|
+
prompts,
|
|
15
|
+
className
|
|
16
|
+
}) {
|
|
17
|
+
const [idx, setIdx] = _react.useState.call(void 0, 0);
|
|
18
|
+
const [text, setText] = _react.useState.call(void 0, "");
|
|
19
|
+
const [phase, setPhase] = _react.useState.call(void 0,
|
|
20
|
+
"typing"
|
|
21
|
+
);
|
|
22
|
+
const [reducedMotion, setReducedMotion] = _react.useState.call(void 0, false);
|
|
23
|
+
_react.useEffect.call(void 0, () => {
|
|
24
|
+
if (typeof window === "undefined") return;
|
|
25
|
+
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
26
|
+
setReducedMotion(mq.matches);
|
|
27
|
+
const onChange = () => setReducedMotion(mq.matches);
|
|
28
|
+
mq.addEventListener("change", onChange);
|
|
29
|
+
return () => mq.removeEventListener("change", onChange);
|
|
30
|
+
}, []);
|
|
31
|
+
_react.useEffect.call(void 0, () => {
|
|
32
|
+
if (reducedMotion || prompts.length === 0) return;
|
|
33
|
+
const current = _nullishCoalesce(prompts[idx], () => ( ""));
|
|
34
|
+
if (phase === "typing") {
|
|
35
|
+
if (text.length < current.length) {
|
|
36
|
+
const t2 = setTimeout(
|
|
37
|
+
() => setText(current.slice(0, text.length + 1)),
|
|
38
|
+
TYPE_MS
|
|
39
|
+
);
|
|
40
|
+
return () => clearTimeout(t2);
|
|
41
|
+
}
|
|
42
|
+
const t = setTimeout(() => setPhase("deleting"), HOLD_MS);
|
|
43
|
+
return () => clearTimeout(t);
|
|
44
|
+
}
|
|
45
|
+
if (phase === "deleting") {
|
|
46
|
+
if (text.length > 0) {
|
|
47
|
+
const t = setTimeout(() => setText(text.slice(0, -1)), DELETE_MS);
|
|
48
|
+
return () => clearTimeout(t);
|
|
49
|
+
}
|
|
50
|
+
setIdx((i) => (i + 1) % prompts.length);
|
|
51
|
+
setPhase("typing");
|
|
52
|
+
}
|
|
53
|
+
}, [text, phase, idx, reducedMotion, prompts]);
|
|
54
|
+
const display = reducedMotion ? _nullishCoalesce(prompts[0], () => ( "")) : text;
|
|
55
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _chunkKWLSBTB2cjs.cn.call(void 0, "inline-flex items-baseline", className), children: [
|
|
56
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: display }),
|
|
57
|
+
!reducedMotion && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
58
|
+
"span",
|
|
59
|
+
{
|
|
60
|
+
"aria-hidden": true,
|
|
61
|
+
className: "ml-0.5 inline-block h-[1em] w-[2px] translate-y-[0.15em] animate-pulse bg-current"
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
function TypewriterText({
|
|
67
|
+
text,
|
|
68
|
+
active = true,
|
|
69
|
+
speedMs = 24,
|
|
70
|
+
onComplete,
|
|
71
|
+
className
|
|
72
|
+
}) {
|
|
73
|
+
const [length, setLength] = _react.useState.call(void 0, active ? 0 : text.length);
|
|
74
|
+
const completed = _react.useRef.call(void 0, false);
|
|
75
|
+
const onCompleteRef = _react.useRef.call(void 0, onComplete);
|
|
76
|
+
_react.useEffect.call(void 0, () => {
|
|
77
|
+
onCompleteRef.current = onComplete;
|
|
78
|
+
}, [onComplete]);
|
|
79
|
+
_react.useEffect.call(void 0, () => {
|
|
80
|
+
setLength(active ? 0 : text.length);
|
|
81
|
+
completed.current = false;
|
|
82
|
+
}, [active, text]);
|
|
83
|
+
_react.useEffect.call(void 0, () => {
|
|
84
|
+
if (!active || length >= text.length) {
|
|
85
|
+
if (length >= text.length && !completed.current) {
|
|
86
|
+
completed.current = true;
|
|
87
|
+
_optionalChain([onCompleteRef, 'access', _ => _.current, 'optionalCall', _2 => _2()]);
|
|
88
|
+
}
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const timer = window.setTimeout(() => setLength((value) => value + 1), speedMs);
|
|
92
|
+
return () => window.clearTimeout(timer);
|
|
93
|
+
}, [active, length, speedMs, text.length]);
|
|
94
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _chunkKWLSBTB2cjs.cn.call(void 0, "whitespace-pre-wrap", className), "aria-label": text, children: [
|
|
95
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "aria-hidden": true, children: text.slice(0, length) }),
|
|
96
|
+
active && length < text.length && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "aria-hidden": true, className: "ml-0.5 inline-block h-[1em] w-px animate-pulse bg-current motion-reduce:hidden" })
|
|
97
|
+
] });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
exports.CyclingPrompt = CyclingPrompt; exports.TypewriterText = TypewriterText;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CyclingPrompt — typewriter caption that types, holds, deletes, and
|
|
5
|
+
* advances through a list of phrases. Pure useEffect state machine.
|
|
6
|
+
* Honors prefers-reduced-motion by showing the first phrase statically.
|
|
7
|
+
*
|
|
8
|
+
* Phrases are caller-supplied so each app shows its own examples.
|
|
9
|
+
*/
|
|
10
|
+
declare function CyclingPrompt({ prompts, className, }: {
|
|
11
|
+
prompts: string[];
|
|
12
|
+
className?: string;
|
|
13
|
+
}): react_jsx_runtime.JSX.Element;
|
|
14
|
+
interface TypewriterTextProps {
|
|
15
|
+
text: string;
|
|
16
|
+
active?: boolean;
|
|
17
|
+
speedMs?: number;
|
|
18
|
+
onComplete?: () => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/** One-shot, accessible typewriter text for guided product demonstrations. */
|
|
22
|
+
declare function TypewriterText({ text, active, speedMs, onComplete, className, }: TypewriterTextProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { CyclingPrompt, TypewriterText, type TypewriterTextProps };
|