@eifi1/ui-kit 0.14.2 → 0.15.1
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/chart.d.ts +2 -1
- package/dist/components/alert-banner.js +5 -2
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +1 -1
- package/dist/components/autocomplete.js +9 -2
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/bulk-action-bar.js +6 -3
- package/dist/components/bulk-action-bar.js.map +1 -1
- package/dist/components/button-group.d.ts +1 -1
- package/dist/components/calculator.d.ts +1 -1
- package/dist/components/calendar-heatmap.js +5 -5
- package/dist/components/calendar-heatmap.js.map +1 -1
- package/dist/components/copy-button.d.ts +1 -1
- package/dist/components/data-table-cells.d.ts +1 -1
- package/dist/components/data-table-filter-popover.d.ts +1 -1
- package/dist/components/data-table-filter-popover.js +3 -3
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-filters.d.ts +1 -1
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.js +12 -4
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/facing-pair.d.ts +1 -0
- package/dist/components/field.js +4 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-button.d.ts +1 -1
- package/dist/components/file-dropzone.d.ts +1 -1
- package/dist/components/form-actions.d.ts +1 -1
- package/dist/components/image-grid.d.ts +8 -1
- package/dist/components/image-grid.js +16 -3
- package/dist/components/image-grid.js.map +1 -1
- package/dist/components/measured-grid.js +2 -2
- package/dist/components/measured-grid.js.map +1 -1
- package/dist/components/money-field.d.ts +1 -1
- package/dist/components/multi-select.js +3 -0
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/number-field.d.ts +1 -1
- package/dist/components/number-input.d.ts +5 -2
- package/dist/components/number-input.js +11 -3
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/numpad-sheet.d.ts +1 -1
- package/dist/components/series-chart-budget.d.ts +60 -0
- package/dist/components/series-chart-budget.js +56 -0
- package/dist/components/series-chart-budget.js.map +1 -0
- package/dist/components/series-chart.d.ts +54 -2
- package/dist/components/series-chart.js +104 -20
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/settings-fields.d.ts +1 -1
- package/dist/components/slider.js +6 -2
- package/dist/components/slider.js.map +1 -1
- package/dist/components/stat-tile.js +3 -3
- package/dist/components/stat-tile.js.map +1 -1
- package/dist/components/text-link.d.ts +1 -1
- package/dist/components/time-input.d.ts +1 -1
- package/dist/components/treemap.d.ts +3 -2
- package/dist/components/treemap.js +14 -3
- package/dist/components/treemap.js.map +1 -1
- package/dist/components/ui.d.ts +1 -1
- package/dist/components/ui.js +44 -10
- package/dist/components/ui.js.map +1 -1
- package/dist/components/use-table-state.d.ts +1 -1
- package/dist/{data-table-Drun8Fk9.d.ts → data-table-CfVXtCeG.d.ts} +4 -3
- package/dist/data-table.d.ts +1 -1
- package/dist/feedback/feedback-thread.js +31 -12
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/hooks/use-file-drop.d.ts +1 -1
- package/dist/i18n/defaults.d.ts +1 -1
- package/dist/i18n/kit-labels.d.ts +1 -1
- package/dist/i18n/locales/de-CH-informal.d.ts +1 -1
- package/dist/i18n/locales/de-CH.d.ts +1 -1
- package/dist/i18n/locales/de-informal.d.ts +1 -1
- package/dist/i18n/locales/de.d.ts +1 -1
- package/dist/i18n/locales/es.d.ts +1 -1
- package/dist/i18n/locales/fr.d.ts +1 -1
- package/dist/i18n/locales/hu.d.ts +1 -1
- package/dist/i18n/locales/it.d.ts +1 -1
- package/dist/i18n/locales/zh.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/{kit-labels-Mz8zZHIF.d.ts → kit-labels-BHfRBbHs.d.ts} +5 -1
- package/dist/lib/strip-fade.d.ts +31 -0
- package/dist/lib/strip-fade.js +54 -0
- package/dist/lib/strip-fade.js.map +1 -0
- package/dist/rhf/fields.d.ts +1 -1
- package/dist/rhf/form.d.ts +1 -1
- package/dist/rhf/form.js +1 -1
- package/dist/rhf/form.js.map +1 -1
- package/dist/rhf.d.ts +1 -1
- package/dist/shell/app-shell.d.ts +11 -2
- package/dist/shell/app-shell.js +20 -4
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/top-bar-brand.d.ts +1 -1
- package/dist/shell.d.ts +1 -1
- package/dist/wizard/stepper-nav.d.ts +1 -1
- package/dist/wizard/stepper-nav.js +14 -2
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/alert-banner.tsx +10 -2
- package/src/components/autocomplete.tsx +10 -1
- package/src/components/bulk-action-bar.tsx +12 -3
- package/src/components/calendar-heatmap.tsx +10 -5
- package/src/components/data-table-filter-popover.tsx +6 -3
- package/src/components/data-table.tsx +21 -7
- package/src/components/field.tsx +4 -1
- package/src/components/image-grid.tsx +30 -2
- package/src/components/measured-grid.tsx +3 -2
- package/src/components/multi-select.tsx +3 -0
- package/src/components/number-input.tsx +23 -4
- package/src/components/series-chart-budget.ts +121 -0
- package/src/components/series-chart.tsx +201 -15
- package/src/components/slider.tsx +6 -2
- package/src/components/stat-tile.tsx +8 -3
- package/src/components/treemap.tsx +30 -5
- package/src/components/ui.tsx +91 -11
- package/src/feedback/feedback-thread.tsx +36 -13
- package/src/lib/strip-fade.ts +82 -0
- package/src/rhf/form.tsx +3 -1
- package/src/shell/app-shell.tsx +34 -7
- package/src/wizard/stepper-nav.tsx +23 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import './data-table-sort.js';
|
|
3
|
-
export { z as DEFAULT_PERSIST_PREFIX, T as TableUrlState, g as TableUrlStateProps, h as TableUrlSync, U as UseTableUrlStateOptions, i as UseTableUrlStateReturn, r as readTableUrlState, A as useTableState, w as useTableUrlState } from '../data-table-
|
|
3
|
+
export { z as DEFAULT_PERSIST_PREFIX, T as TableUrlState, g as TableUrlStateProps, h as TableUrlSync, U as UseTableUrlStateOptions, i as UseTableUrlStateReturn, r as readTableUrlState, A as useTableState, w as useTableUrlState } from '../data-table-CfVXtCeG.js';
|
|
4
4
|
import './swipeable-row.js';
|
|
5
5
|
import './data-table-labels.js';
|
|
@@ -394,9 +394,10 @@ interface DataTableProps<T> {
|
|
|
394
394
|
*/
|
|
395
395
|
urlSync?: TableUrlSync;
|
|
396
396
|
/**
|
|
397
|
-
* When true
|
|
398
|
-
*
|
|
399
|
-
*
|
|
397
|
+
* When true, the table fills its parent's height and scrolls INTERNALLY, with the
|
|
398
|
+
* header pinned — so the page itself doesn't add a second, outer scrollbar. On a
|
|
399
|
+
* phone the card list is the scroller instead, with the filter button pinned above
|
|
400
|
+
* it; an unbounded parent simply lets either layout grow to its content. The parent must give it a bounded height (e.g. a flex
|
|
400
401
|
* column inside the viewport-locked app shell). See feedback #207.
|
|
401
402
|
*/
|
|
402
403
|
fillHeight?: boolean;
|
package/dist/data-table.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DEFAULT_DATA_TABLE_LABELS, DataTableLabels, missingDataTableLabels, resolveDataTableLabels } from './components/data-table-labels.js';
|
|
2
2
|
export { SortCycle, SortDir, SortState, SortStepOptions, decodeSorts, encodeSorts, nextSorts, normalizeSorts } from './components/data-table-sort.js';
|
|
3
|
-
export { C as ColumnFilter, D as DataTable, a as DataTableChrome, b as DataTableColumn, c as DataTableDensity, d as DataTableProps, e as DataTableRowAction, F as FilterState, f as FilterValue, M as MobileSwipeActions, S as ServerPagination, T as TableUrlState, g as TableUrlStateProps, h as TableUrlSync, U as UseTableUrlStateOptions, i as UseTableUrlStateReturn, j as dateFilter, k as decodeFilterValue, l as decodeFilterValueOfType, m as defaultFilterState, n as encodeFilterValue, o as filterHref, p as isFilterActive, q as numberFilter, r as readTableUrlState, s as resolveFilter, t as rowMatches, u as selectFilter, v as textFilter, w as useTableUrlState } from './data-table-
|
|
3
|
+
export { C as ColumnFilter, D as DataTable, a as DataTableChrome, b as DataTableColumn, c as DataTableDensity, d as DataTableProps, e as DataTableRowAction, F as FilterState, f as FilterValue, M as MobileSwipeActions, S as ServerPagination, T as TableUrlState, g as TableUrlStateProps, h as TableUrlSync, U as UseTableUrlStateOptions, i as UseTableUrlStateReturn, j as dateFilter, k as decodeFilterValue, l as decodeFilterValueOfType, m as defaultFilterState, n as encodeFilterValue, o as filterHref, p as isFilterActive, q as numberFilter, r as readTableUrlState, s as resolveFilter, t as rowMatches, u as selectFilter, v as textFilter, w as useTableUrlState } from './data-table-CfVXtCeG.js';
|
|
4
4
|
export { PAGE_SIZE_OPTIONS, Pagination } from './components/data-table-pagination.js';
|
|
5
5
|
export { FilterPopover } from './components/data-table-filter-popover.js';
|
|
6
6
|
export { BooleanColumnOptions, BooleanMark, BooleanMarkProps, booleanColumn } from './components/data-table-cells.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useImperativeHandle, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
4
|
-
import { Paperclip, Send } from "lucide-react";
|
|
4
|
+
import { ImageIcon, ImageOff, Paperclip, Send } from "lucide-react";
|
|
5
5
|
import { cn } from "../lib/cn.js";
|
|
6
6
|
import { formatDate, formatRelativeTime } from "../lib/format.js";
|
|
7
7
|
import { Button, EmptyState, Spinner, Textarea } from "../components/ui.js";
|
|
@@ -141,17 +141,7 @@ function DefaultAttachment({
|
|
|
141
141
|
size
|
|
142
142
|
}) {
|
|
143
143
|
const { name, url, type } = attachment;
|
|
144
|
-
if (url && type?.startsWith("image/")) {
|
|
145
|
-
return /* @__PURE__ */ jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "block", children: /* @__PURE__ */ jsx(
|
|
146
|
-
"img",
|
|
147
|
-
{
|
|
148
|
-
src: url,
|
|
149
|
-
alt: name,
|
|
150
|
-
loading: "lazy",
|
|
151
|
-
className: "h-20 w-20 rounded border border-[var(--border)] object-cover"
|
|
152
|
-
}
|
|
153
|
-
) });
|
|
154
|
-
}
|
|
144
|
+
if (url && type?.startsWith("image/")) return /* @__PURE__ */ jsx(ImageThumbnail, { url, name });
|
|
155
145
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
156
146
|
/* @__PURE__ */ jsx(Paperclip, { className: "size-3.5 shrink-0", "aria-hidden": true }),
|
|
157
147
|
/* @__PURE__ */ jsx("span", { className: "truncate", children: name }),
|
|
@@ -160,6 +150,35 @@ function DefaultAttachment({
|
|
|
160
150
|
const chip = "inline-flex max-w-full items-center gap-1 rounded border border-[var(--border)] bg-[var(--bg-surface)] px-2 py-1 text-xs text-[var(--text-secondary)]";
|
|
161
151
|
return url ? /* @__PURE__ */ jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: cn(chip, "hover:bg-[var(--bg-hover)]"), children: content }) : /* @__PURE__ */ jsx("span", { className: chip, children: content });
|
|
162
152
|
}
|
|
153
|
+
function ImageThumbnail({ url, name }) {
|
|
154
|
+
const [failedUrl, setFailedUrl] = useState(null);
|
|
155
|
+
const failed = failedUrl === url;
|
|
156
|
+
const Glyph = failed ? ImageOff : ImageIcon;
|
|
157
|
+
return /* @__PURE__ */ jsxs(
|
|
158
|
+
"a",
|
|
159
|
+
{
|
|
160
|
+
href: url,
|
|
161
|
+
target: "_blank",
|
|
162
|
+
rel: "noopener noreferrer",
|
|
163
|
+
className: "relative block h-20 w-20 overflow-hidden rounded border border-[var(--border)] bg-[var(--bg-surface-2)]",
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ jsx(Glyph, { "aria-hidden": true, className: "absolute inset-0 m-auto size-6 text-[var(--text-muted)]" }),
|
|
166
|
+
!failed && // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- load/error are resource events, not interactions
|
|
167
|
+
/* @__PURE__ */ jsx(
|
|
168
|
+
"img",
|
|
169
|
+
{
|
|
170
|
+
src: url,
|
|
171
|
+
alt: name,
|
|
172
|
+
loading: "lazy",
|
|
173
|
+
onError: () => setFailedUrl(url),
|
|
174
|
+
className: "relative h-full w-full object-cover"
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
failed && /* @__PURE__ */ jsx("span", { className: "sr-only", children: name })
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
163
182
|
function useMinuteClock(active) {
|
|
164
183
|
const [time, setTime] = useState(() => Date.now());
|
|
165
184
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/feedback/feedback-thread.tsx"],"sourcesContent":["import { useEffect, useImperativeHandle, useLayoutEffect, useRef, useState, useSyncExternalStore } from \"react\";\nimport type { ReactNode, Ref } from \"react\";\nimport { Paperclip, Send } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { formatDate, formatRelativeTime } from \"../lib/format\";\nimport { Button, EmptyState, Spinner, Textarea } from \"../components/ui\";\nimport { Skeleton } from \"../components/skeleton\";\nimport { Tooltip } from \"../components/tooltip\";\nimport { useKitFileLabels, useKitLabels, useKitLocale } from \"../i18n/kit-labels\";\nimport { FeedbackAttachmentField } from \"./feedback-attachment\";\nimport type { FeedbackNoteAttachment } from \"./feedback-inbox\";\nimport type { FeedbackAttachmentLabels } from \"./feedback-dialog\";\n\n/**\n * The conversation under a report: who said what, when, with what attached — and the\n * box to answer in.\n *\n * Both apps had written it by hand. kastlan's feedback page grew a comment list of\n * bordered boxes with `slate-*` literals (feedback-page.tsx, \"keksdose left this\n * unbuilt\"), and keksdose built the same thing a second time for support\n * (support-thread.tsx) with sides, bubbles and a composer that clears only what it\n * sent. This is that second one, generalised: the kit owns the look and the\n * behaviour, the app owns the data, the upload and every word it does not share.\n *\n * **Own vs other** is the caller's per message (`own`), not a comparison the kit makes\n * against a user id: whose message sits at the END side depends on who is reading,\n * and only the app knows that (keksdose's support thread labelled a member's question\n * \"Du\" in the admin panel the first time round, by reading the wrong field).\n *\n * **Redaction.** A thread is somebody's words about their own data — exactly what a\n * host's demo / screen-share mode blurs. Bodies, authors and attachments carry\n * `data-private` (the attribute `Tooltip redact` and `StatTile sensitive` use) unless\n * `redact={false}`.\n *\n * **RTL.** Sides are logical — `justify-end` is the reading end, and the bubble's\n * tucked corner is `rounded-ee` / `rounded-es` — and each body is `dir=\"auto\"`, so a\n * Hebrew reply in an English thread (or the reverse) lays out as its own language.\n *\n * **A chat, too** (keksdose G4/G5). keksdose's support chat is the same conversation\n * read the chat way: status lines between the messages (\"Closed automatically\",\n * \"Reopened\"), a day line where the date changes, clock times under it, Enter to send\n * and several files uploaded ahead of the send. Each of those is an opt-in here\n * (`kind: \"event\"`, `daySeparators`, `timeFormat=\"clock\"`, `sendOn=\"enter\"`,\n * `attachmentSlot` + `canSend`), so the feedback thread's defaults stay as they were.\n */\n\n/* ── Labels ───────────────────────────────────────────────────────────────── */\n\n/** The `feedbackThread` namespace of `<UiKitProvider labels>`. */\nexport interface FeedbackThreadLabels {\n /** Accessible name of the message list. */\n thread: string;\n empty: string;\n loading: string;\n /** Author line of an `own` message that has no `author` of its own. */\n you: string;\n /** The badge beside a `staff` author. */\n staff: string;\n /** Accessible name of a message's attachment list. */\n attachments: string;\n}\n\nexport const DEFAULT_FEEDBACK_THREAD_LABELS: FeedbackThreadLabels = {\n thread: \"Comments\",\n empty: \"No comments yet\",\n loading: \"Loading comments…\",\n you: \"You\",\n staff: \"Staff\",\n attachments: \"Attachments\",\n};\n\n/** The `feedbackComposer` namespace of `<UiKitProvider labels>`. The attach buttons'\n * words are `feedbackAttachment`'s, shared with the dialog and the note editor. */\nexport interface FeedbackComposerLabels {\n /** Accessible name of the text box. */\n field: string;\n placeholder: string;\n send: string;\n /** The shortcut line, given the platform's modifier (\"Ctrl\" or \"⌘\"). */\n sendHint: (modifier: string) => string;\n /** The shortcut line under `sendOn=\"enter\"` (keksdose G5): Enter sends, so say how a\n * new line is made. */\n sendHintEnter: string;\n}\n\nexport const DEFAULT_FEEDBACK_COMPOSER_LABELS: FeedbackComposerLabels = {\n field: \"Write a comment\",\n placeholder: \"Write a comment…\",\n send: \"Send\",\n sendHint: (modifier) => `${modifier} + Enter to send`,\n sendHintEnter: \"Enter to send, Shift + Enter for a new line\",\n};\n\n/* ── Thread ───────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackThreadAttachment {\n id?: string | number;\n name: string;\n /** Where to open it. Left out, the attachment is listed by name only. */\n url?: string;\n /** MIME type; an `image/*` with a `url` is shown as a thumbnail. */\n type?: string;\n /** Bytes, shown beside a non-image. */\n size?: number;\n}\n\nexport interface FeedbackThreadMessage {\n /** Leave out, or `\"message\"`. `\"event\"` is a {@link FeedbackThreadEvent}. */\n kind?: \"message\";\n id: string | number;\n /** Who wrote it. Left out on an `own` message, it reads \"You\". */\n author?: ReactNode;\n /** A `Date`, an ISO string or epoch ms. */\n createdAt: Date | string | number;\n body: string;\n attachments?: readonly FeedbackThreadAttachment[];\n /** Written by whoever is reading: sits at the end side, in the brand tint. */\n own?: boolean;\n /** Written by the team rather than a user: gets the \"Staff\" badge. */\n staff?: boolean;\n}\n\n/**\n * A line in the thread that nobody wrote — \"Closed automatically\", \"Marked as\n * resolved\", \"Reopened\" — drawn centred and muted with its time, no author, no side,\n * no bubble.\n *\n * keksdose G4: its support chat interleaves these with the messages, and as a message\n * they came out as a bubble from nobody at the start side, which reads as the member\n * having said \"resolved\". Word it for the READER, as with `own`: the app knows whether\n * \"you reopened it\" or \"Anna reopened it\" is true for the person looking.\n *\n * The text is the app's, not somebody's words about their data, so it is NOT tagged\n * `data-private`; one that names a person can wrap the name in its own\n * `<span data-private>` (`body` is a node for that reason).\n */\nexport interface FeedbackThreadEvent {\n kind: \"event\";\n id: string | number;\n /** A `Date`, an ISO string or epoch ms. */\n createdAt: Date | string | number;\n body: ReactNode;\n}\n\n/** One row of a {@link FeedbackThread}: a message, or an event line between them. */\nexport type FeedbackThreadItem = FeedbackThreadMessage | FeedbackThreadEvent;\n\nexport interface FeedbackThreadProps {\n /** Oldest first. Event lines ({@link FeedbackThreadEvent}) sit among the messages. */\n messages: readonly FeedbackThreadItem[];\n loading?: boolean;\n /** Replaces the default \"No comments yet\". */\n empty?: ReactNode;\n /**\n * Draw one attachment yourself — for files behind auth, which a plain `<img src>`\n * cannot fetch (kastlan's `AuthedImage`), or a lightbox. The default is a thumbnail\n * link for an image with a `url`, a file link otherwise.\n */\n renderAttachment?: (attachment: FeedbackThreadAttachment, message: FeedbackThreadMessage) => ReactNode;\n /** Tag bodies, authors and attachments `data-private`. Default true. */\n redact?: boolean;\n /**\n * How a row's time reads. `\"relative\"` (default): \"5 minutes ago\", a date past six\n * days — right for a report's comments, read days apart. `\"clock\"`: the time of day\n * in the locale (\"14:05\", \"2:05 PM\") — the chat look, keksdose G4; pair it with\n * `daySeparators`, which say which day that clock time is on. Either way the full\n * date and time is in the Tooltip.\n */\n timeFormat?: \"relative\" | \"clock\";\n /**\n * A centred day line before the first row and wherever the next row is on another\n * calendar day (the device's zone): \"Today\", \"Yesterday\", else the date — keksdose\n * G4. \"Today\" / \"Yesterday\" are `Intl.RelativeTimeFormat`'s own words in the kit\n * locale, so there is no label to translate. Default false.\n */\n daySeparators?: boolean;\n /** \"Now\" for the relative times and the day lines — pin it in tests and stories.\n * Default: the clock. */\n now?: Date | number;\n /** Overrides the provider's locale for the times. */\n locale?: string;\n labels?: Partial<FeedbackThreadLabels>;\n className?: string;\n}\n\nexport function FeedbackThread({\n messages,\n loading = false,\n empty,\n renderAttachment,\n redact = true,\n now,\n locale: localeProp,\n timeFormat = \"relative\",\n daySeparators = false,\n labels: labelsProp,\n className,\n}: FeedbackThreadProps) {\n const labels = useKitLabels(\"feedbackThread\", DEFAULT_FEEDBACK_THREAD_LABELS, labelsProp);\n const locale = useKitLocale(localeProp);\n const file = useKitFileLabels();\n const priv = redact ? \"\" : undefined;\n const clock = useMinuteClock(now === undefined);\n const reference = now === undefined ? clock : +now;\n\n if (loading && messages.length === 0) {\n return <Skeleton lines={3} label={labels.loading} className={className} />;\n }\n if (messages.length === 0) {\n return (\n <EmptyState\n variant=\"inline\"\n size=\"sm\"\n title={empty ?? labels.empty}\n className={cn(\"justify-start\", className)}\n />\n );\n }\n\n // Per row, the calendar day of the last readable date up to it — what a day line\n // compares against.\n const days: (number | null)[] = [];\n for (const message of messages) {\n const date = toDate(message.createdAt);\n days.push(date ? dayNumber(date) : (days.at(-1) ?? null));\n }\n\n return (\n <ol aria-label={labels.thread} aria-busy={loading || undefined} className={cn(\"space-y-3\", className)}>\n {messages.flatMap((message, index) => {\n const date = toDate(message.createdAt);\n const time = date && (\n // The kit's Tooltip, not a native title: one tooltip look app-wide\n // (keksdose F0 / dev#523).\n <Tooltip label={new Intl.DateTimeFormat(locale, { dateStyle: \"full\", timeStyle: \"short\" }).format(date)}>\n <time dateTime={date.toISOString()} className=\"tabular-nums\">\n {timeFormat === \"clock\"\n ? formatDate(date, \"time\", { locale })\n : formatRelativeTime(date, {\n now: reference,\n locale,\n // Past the kit's day steps it is a date: \"2 weeks ago\" makes\n // the reader do arithmetic the date already did.\n absoluteAfterDays: 6.5,\n })}\n </time>\n </Tooltip>\n );\n const rows: ReactNode[] = [];\n const day = date && dayNumber(date);\n // Against the last row WITH a readable date: an unparseable one neither starts\n // a day nor hides the next change.\n if (daySeparators && date && day !== days[index - 1]) {\n rows.push(<DaySeparator key={`day-${message.id}`} date={date} now={reference} locale={locale} />);\n }\n if (message.kind === \"event\") {\n // A list item like the rest, so \"Reopened\" is read in its place, but not an\n // article: an article is somebody's post, and this has no author.\n rows.push(\n <li\n key={message.id}\n data-event=\"\"\n className=\"flex flex-wrap items-baseline justify-center gap-x-2 px-4 text-center text-xs text-[var(--text-muted)]\"\n >\n <span>{message.body}</span>\n {time && <span className=\"text-[11px]\">{time}</span>}\n </li>,\n );\n return rows;\n }\n const author = message.author ?? (message.own ? labels.you : null);\n const attachments = message.attachments ?? [];\n rows.push(\n <li\n key={message.id}\n className={cn(\"flex\", message.own ? \"justify-end\" : \"justify-start\")}\n data-own={message.own ? \"\" : undefined}\n >\n <article\n className={cn(\n \"max-w-[85%] min-w-0 rounded-lg px-3 py-2 text-sm\",\n message.own\n ? \"rounded-ee-sm bg-[var(--brand-bg)]\"\n : \"rounded-es-sm bg-[var(--bg-surface-2)]\",\n )}\n >\n <header className=\"mb-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] text-[var(--text-muted)]\">\n {author != null && (\n <span data-private={priv} className=\"font-medium text-[var(--text-secondary)]\">\n {author}\n </span>\n )}\n {message.staff && (\n <span className=\"rounded border border-[var(--border)] bg-[var(--bg-surface)] px-1 text-[10px] font-medium uppercase tracking-wide text-[var(--text-secondary)]\">\n {labels.staff}\n </span>\n )}\n {time}\n </header>\n {message.body && (\n <p\n data-private={priv}\n dir=\"auto\"\n className=\"whitespace-pre-wrap break-words text-start text-[var(--text-primary)]\"\n >\n {message.body}\n </p>\n )}\n {attachments.length > 0 && (\n <ul aria-label={labels.attachments} data-private={priv} className=\"mt-2 flex flex-wrap gap-2\">\n {attachments.map((attachment, index) => (\n <li key={attachment.id ?? `${index}-${attachment.name}`} className=\"min-w-0\">\n {renderAttachment ? (\n renderAttachment(attachment, message)\n ) : (\n <DefaultAttachment attachment={attachment} size={file.size} />\n )}\n </li>\n ))}\n </ul>\n )}\n </article>\n </li>,\n );\n return rows;\n })}\n </ol>\n );\n}\n\nfunction DefaultAttachment({\n attachment,\n size,\n}: {\n attachment: FeedbackThreadAttachment;\n size: (bytes: number) => string;\n}) {\n const { name, url, type } = attachment;\n if (url && type?.startsWith(\"image/\")) {\n return (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\" className=\"block\">\n <img\n src={url}\n alt={name}\n loading=\"lazy\"\n className=\"h-20 w-20 rounded border border-[var(--border)] object-cover\"\n />\n </a>\n );\n }\n const content = (\n <>\n <Paperclip className=\"size-3.5 shrink-0\" aria-hidden />\n <span className=\"truncate\">{name}</span>\n {attachment.size !== undefined && (\n <span className=\"shrink-0 text-[var(--text-muted)]\">{size(attachment.size)}</span>\n )}\n </>\n );\n const chip =\n \"inline-flex max-w-full items-center gap-1 rounded border border-[var(--border)] bg-[var(--bg-surface)] px-2 py-1 text-xs text-[var(--text-secondary)]\";\n return url ? (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\" className={cn(chip, \"hover:bg-[var(--bg-hover)]\")}>\n {content}\n </a>\n ) : (\n <span className={chip}>{content}</span>\n );\n}\n\n/** The time, refreshed once a minute while `active`, so \"2 minutes ago\" does not stay\n * \"just now\" on a page left open. Read in state rather than in render, which must be\n * pure. */\nfunction useMinuteClock(active: boolean): number {\n const [time, setTime] = useState(() => Date.now());\n useEffect(() => {\n if (!active) return;\n const id = setInterval(() => setTime(Date.now()), 60_000);\n return () => clearInterval(id);\n }, [active]);\n return time;\n}\n\n/** The local calendar day as one number (20260926), for \"same day?\" and keys. */\nfunction dayNumber(date: Date): number {\n return date.getFullYear() * 10_000 + (date.getMonth() + 1) * 100 + date.getDate();\n}\n\n/**\n * The day line of `daySeparators` (keksdose G4): \"Today\" / \"Yesterday\" from\n * `Intl.RelativeTimeFormat` (`numeric: \"auto\"`) — the locale's own words, capitalised\n * for a line that stands alone (\"heute\" → \"Heute\"; a script without case is left as\n * is) — else the weekday and date, with the year only when it is not this one.\n *\n * Counted in calendar days, not 24-hour spans: 23:50 yesterday is \"Yesterday\" at\n * 00:10 today.\n */\nfunction DaySeparator({ date, now, locale }: { date: Date; now: number; locale: string | undefined }) {\n const today = new Date(now);\n const days = Math.round(\n (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) -\n Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())) /\n 86_400_000,\n );\n let label: string;\n if (days === 0 || days === -1) {\n const word = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" }).format(days + 0, \"day\");\n label = word.charAt(0).toLocaleUpperCase(locale) + word.slice(1);\n } else {\n label = formatDate(\n date,\n {\n weekday: \"long\",\n day: \"numeric\",\n month: \"long\",\n ...(date.getFullYear() === today.getFullYear() ? null : { year: \"numeric\" }),\n },\n { locale },\n );\n }\n const y = String(date.getFullYear()).padStart(4, \"0\");\n const m = String(date.getMonth() + 1).padStart(2, \"0\");\n const d = String(date.getDate()).padStart(2, \"0\");\n return (\n <li data-day-separator=\"\" className=\"flex items-center gap-3 py-1 text-xs text-[var(--text-muted)]\">\n <span aria-hidden className=\"h-px flex-1 bg-[var(--border)]\" />\n <time dateTime={`${y}-${m}-${d}`} className=\"font-medium\">\n {label}\n </time>\n <span aria-hidden className=\"h-px flex-1 bg-[var(--border)]\" />\n </li>\n );\n}\n\nfunction toDate(value: Date | string | number): Date | null {\n const date = value instanceof Date ? value : new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n}\n\n/* ── Composer ─────────────────────────────────────────────────────────────── */\n\n/** What the composer's attach control takes — {@link FeedbackNoteAttachment} with the\n * labels optional, since the field reads `feedbackAttachment` from the provider. */\nexport type FeedbackComposerAttachment = Omit<FeedbackNoteAttachment, \"labels\"> & {\n labels?: Partial<FeedbackAttachmentLabels>;\n};\n\nexport interface FeedbackComposerProps {\n /**\n * Send the comment. Return the promise: the box clears when it RESOLVES, and only of\n * what was sent — text typed while it was in flight stays. A rejection keeps\n * everything for a retry (surface the error yourself; the composer stays quiet).\n *\n * `attachment` is the built-in field's one picture. Files the host uploaded ahead\n * (`attachmentSlot`) are the host's state, read by the host here — and `body` may be\n * `\"\"` when `canSend` let an attachments-only message go.\n */\n onSend: (body: string, attachment: File | null) => void | Promise<unknown>;\n /** The send is in flight: a spinner on the button and no second send. */\n pending?: boolean;\n /** Offer one picture with the comment (file, paste or `onCaptureScreenshot`).\n * `true` for the defaults. Left out, the composer is text only. */\n attachment?: boolean | FeedbackComposerAttachment;\n /**\n * The host's own attach control, in the row with Send where the built-in field sits\n * (after it, if both are on) — keksdose G5: its support chat uploads up to N files\n * AHEAD of the send and sends their refs, which one `File` in `onSend` cannot carry.\n * The slot is the host's picker plus the chips of what is uploaded; the upload, the\n * refs and clearing them once `onSend` resolves stay with the host. Pair it with\n * `canSend`.\n */\n attachmentSlot?: ReactNode;\n /**\n * Whether Send is enabled, over the composer's own rule (some text in the box) —\n * for state the composer cannot see, i.e. `attachmentSlot`'s (keksdose G5): `true`\n * with files ready makes an empty draft sendable (`onSend(\"\", null)`), `false` while\n * an upload is still running holds even a written reply back. Left out, the text\n * decides. `pending` blocks a send either way.\n */\n canSend?: boolean;\n /**\n * Which key sends. `\"mod-enter\"` (default): Ctrl/⌘+Enter, the report dialog's and\n * note editor's shortcut, with plain Enter a new line — feedback is written in\n * paragraphs. `\"enter\"`: the chat way (keksdose G5) — Enter sends, Shift+Enter is a\n * new line, Ctrl/⌘+Enter still sends; an Enter that confirms an IME composition\n * (Japanese, Chinese input) is the IME's, never a send.\n */\n sendOn?: \"mod-enter\" | \"enter\";\n /** Rendered INSTEAD of the composer — the thread is closed, or read-only for this\n * reader. */\n disabledReason?: ReactNode;\n rows?: number;\n /**\n * The box's hint, over the `placeholder` label — keksdose F9: an admin answering a\n * support ticket is asked something else (\"Reply to Anna…\") than a member adding to\n * their own report, and one provider-wide label cannot say both.\n */\n placeholder?: string;\n /**\n * The draft, controlled — for a host that keeps it itself (saves it per ticket,\n * prefills a template). Left out, the composer keeps its own. Either way a send\n * that resolves clears only what was sent: controlled, that is an\n * `onValueChange(\"\")` the host receives like any keystroke, and only if the draft\n * is still the one that went out.\n */\n value?: string;\n /** Every change to the draft — typing, {@link FeedbackComposerHandle.insertText}, the\n * clear after a send. Required to change a controlled `value`. */\n onValueChange?: (value: string) => void;\n /** {@link FeedbackComposerHandle}: put text into the draft from outside (canned-reply\n * chips) or focus the box. */\n ref?: Ref<FeedbackComposerHandle>;\n labels?: Partial<FeedbackComposerLabels>;\n className?: string;\n}\n\n/**\n * What a {@link FeedbackComposer} `ref` holds.\n *\n * keksdose F9: the support admin answers the same five questions all day and wants\n * chips above the box (\"Thanks, fixed in the next release\") that drop their text in\n * where the caret is. A controlled `value` alone cannot do that well — the host sees\n * the string, not the caret, so it could only append — so the composer, which owns\n * the textarea, does the splice.\n */\nexport interface FeedbackComposerHandle {\n /**\n * Insert `text` at the caret, replacing any selection (the caret the box last had:\n * a click on a chip blurs it, and the selection survives the blur), then focus the\n * box with the caret after the inserted text so the reply can go on. Nothing is\n * added around it — put a space or a newline in `text` if the reply needs one. A\n * no-op while `disabledReason` replaces the box.\n */\n insertText: (text: string) => void;\n focus: () => void;\n}\n\nconst noSubscribe = () => () => {};\nconst isApple = () =>\n typeof navigator !== \"undefined\" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform || navigator.userAgent);\n\n/**\n * The answer box under a {@link FeedbackThread}: a textarea, an optional picture,\n * and Send — Ctrl/⌘+Enter sends, the shortcut the report dialog and the note editor\n * use, so the habit carries across the feature. Plain Enter is a new line: feedback is\n * written in paragraphs, unlike a chat — which `sendOn=\"enter\"` is for (keksdose G5).\n */\nexport function FeedbackComposer({\n onSend,\n pending = false,\n attachment,\n attachmentSlot,\n canSend: canSendProp,\n sendOn = \"mod-enter\",\n disabledReason,\n rows = 3,\n placeholder,\n value,\n onValueChange,\n ref,\n labels: labelsProp,\n className,\n}: FeedbackComposerProps) {\n const labels = useKitLabels(\"feedbackComposer\", DEFAULT_FEEDBACK_COMPOSER_LABELS, labelsProp);\n const [ownDraft, setOwnDraft] = useState(\"\");\n const controlled = value !== undefined;\n const draft = controlled ? value : ownDraft;\n const [file, setFile] = useState<File | null>(null);\n const root = useRef<HTMLDivElement>(null);\n const box = useRef<HTMLTextAreaElement>(null);\n // The draft as of the last commit. The send's `.then` and `insertText` run after\n // renders their closure did not see — text typed while the send was in flight, a\n // second chip clicked before the first one's render — and must not act on a stale\n // string (for a controlled draft there is no updater function to lean on).\n const latest = useRef(draft);\n useLayoutEffect(() => {\n latest.current = draft;\n });\n // Where the caret goes once an inserted text has rendered.\n const caret = useRef<number | null>(null);\n useLayoutEffect(() => {\n const el = box.current;\n if (caret.current === null || !el) return;\n el.focus();\n el.setSelectionRange(caret.current, caret.current);\n caret.current = null;\n });\n\n const setDraft = (next: string) => {\n latest.current = next;\n if (!controlled) setOwnDraft(next);\n onValueChange?.(next);\n };\n\n useImperativeHandle(ref, () => ({\n insertText: (text) => {\n const el = box.current;\n if (!el) return;\n const current = latest.current;\n // A second insert before the first has rendered goes after the first, not at the\n // textarea's not-yet-moved caret. Otherwise the textarea's selection, which may\n // be past the end of a controlled value the host has just shortened: clamp it.\n const pending = caret.current;\n const start = Math.min(pending ?? el.selectionStart ?? current.length, current.length);\n const end = pending ?? Math.max(start, Math.min(el.selectionEnd ?? start, current.length));\n caret.current = start + text.length;\n setDraft(current.slice(0, start) + text + current.slice(end));\n },\n focus: () => box.current?.focus(),\n }));\n // The server snapshot is \"Ctrl\"; the client corrects it after hydration.\n const modifier = useSyncExternalStore(\n noSubscribe,\n () => (isApple() ? \"⌘\" : \"Ctrl\"),\n () => \"Ctrl\",\n );\n\n if (disabledReason != null && disabledReason !== false) {\n return <p className={cn(\"text-xs text-[var(--text-muted)]\", className)}>{disabledReason}</p>;\n }\n\n const canSend = (canSendProp ?? draft.trim().length > 0) && !pending;\n const send = () => {\n if (!canSend) return;\n const sentDraft = draft;\n const sentFile = file;\n Promise.resolve(onSend(draft.trim(), file))\n .then(() => {\n if (latest.current === sentDraft) setDraft(\"\");\n setFile((current) => (current === sentFile ? null : current));\n })\n .catch(() => {});\n };\n\n const config = attachment === true ? {} : attachment || null;\n\n return (\n <div ref={root} className={cn(\"space-y-2\", className)}>\n <Textarea\n rows={rows}\n dir=\"auto\"\n aria-label={labels.field}\n ref={box}\n placeholder={placeholder ?? labels.placeholder}\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\") return;\n const mod = event.ctrlKey || event.metaKey;\n // Under \"enter\": plain Enter sends, Shift+Enter falls through to the\n // textarea's new line, and an Enter that ends an IME composition is the\n // IME's (keyCode 229 is how Safari reports it after the composition ended).\n const chat =\n sendOn === \"enter\" &&\n !event.shiftKey &&\n !event.altKey &&\n !event.nativeEvent.isComposing &&\n event.keyCode !== 229;\n if (mod || chat) {\n event.preventDefault();\n send();\n }\n }}\n />\n <div className=\"flex flex-wrap items-end justify-between gap-2\">\n {config || attachmentSlot != null ? (\n <div className=\"flex min-w-0 flex-wrap items-end gap-2\">\n {config && (\n <FeedbackAttachmentField\n value={file}\n onChange={setFile}\n labels={config.labels}\n accept={config.accept}\n maxBytes={config.maxBytes}\n onError={config.onError}\n onCaptureScreenshot={config.onCaptureScreenshot}\n // The box is this field's sibling; a paste in it bubbles to `root`.\n pasteFrom={root}\n />\n )}\n {attachmentSlot}\n </div>\n ) : (\n <span />\n )}\n <div className=\"ms-auto flex items-center gap-2\">\n <span className=\"text-xs text-[var(--text-placeholder)]\">\n {sendOn === \"enter\" ? labels.sendHintEnter : labels.sendHint(modifier)}\n </span>\n <Button onClick={send} disabled={!canSend} aria-busy={pending || undefined}>\n {pending ? (\n <Spinner label={null} className=\"size-4\" />\n ) : (\n <Send className=\"size-4 rtl:-scale-x-100\" aria-hidden />\n )}\n {labels.send}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AA8MW,SAiJP,UAjJO,KAqDC,YArDD;AA9MX,SAAS,WAAW,qBAAqB,iBAAiB,QAAQ,UAAU,4BAA4B;AAExG,SAAS,WAAW,YAAY;AAChC,SAAS,UAAU;AACnB,SAAS,YAAY,0BAA0B;AAC/C,SAAS,QAAQ,YAAY,SAAS,gBAAgB;AACtD,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,kBAAkB,cAAc,oBAAoB;AAC7D,SAAS,+BAA+B;AAqDjC,MAAM,iCAAuD;AAAA,EAClE,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AACf;AAgBO,MAAM,mCAA2D;AAAA,EACtE,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN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WAAU,mCACb;AAAA,4BAAC,UAAK,WAAU,0CACb,qBAAW,UAAU,OAAO,gBAAgB,OAAO,SAAS,QAAQ,GACvE;AAAA,QACA,qBAAC,UAAO,SAAS,MAAM,UAAU,CAAC,SAAS,aAAW,WAAW,QAC9D;AAAA,oBACC,oBAAC,WAAQ,OAAO,MAAM,WAAU,UAAS,IAEzC,oBAAC,QAAK,WAAU,2BAA0B,eAAW,MAAC;AAAA,UAEvD,OAAO;AAAA,WACV;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":["index","pending"]}
|
|
1
|
+
{"version":3,"sources":["../../src/feedback/feedback-thread.tsx"],"sourcesContent":["import { useEffect, useImperativeHandle, useLayoutEffect, useRef, useState, useSyncExternalStore } from \"react\";\nimport type { ReactNode, Ref } from \"react\";\nimport { ImageIcon, ImageOff, Paperclip, Send } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { formatDate, formatRelativeTime } from \"../lib/format\";\nimport { Button, EmptyState, Spinner, Textarea } from \"../components/ui\";\nimport { Skeleton } from \"../components/skeleton\";\nimport { Tooltip } from \"../components/tooltip\";\nimport { useKitFileLabels, useKitLabels, useKitLocale } from \"../i18n/kit-labels\";\nimport { FeedbackAttachmentField } from \"./feedback-attachment\";\nimport type { FeedbackNoteAttachment } from \"./feedback-inbox\";\nimport type { FeedbackAttachmentLabels } from \"./feedback-dialog\";\n\n/**\n * The conversation under a report: who said what, when, with what attached — and the\n * box to answer in.\n *\n * Both apps had written it by hand. kastlan's feedback page grew a comment list of\n * bordered boxes with `slate-*` literals (feedback-page.tsx, \"keksdose left this\n * unbuilt\"), and keksdose built the same thing a second time for support\n * (support-thread.tsx) with sides, bubbles and a composer that clears only what it\n * sent. This is that second one, generalised: the kit owns the look and the\n * behaviour, the app owns the data, the upload and every word it does not share.\n *\n * **Own vs other** is the caller's per message (`own`), not a comparison the kit makes\n * against a user id: whose message sits at the END side depends on who is reading,\n * and only the app knows that (keksdose's support thread labelled a member's question\n * \"Du\" in the admin panel the first time round, by reading the wrong field).\n *\n * **Redaction.** A thread is somebody's words about their own data — exactly what a\n * host's demo / screen-share mode blurs. Bodies, authors and attachments carry\n * `data-private` (the attribute `Tooltip redact` and `StatTile sensitive` use) unless\n * `redact={false}`.\n *\n * **RTL.** Sides are logical — `justify-end` is the reading end, and the bubble's\n * tucked corner is `rounded-ee` / `rounded-es` — and each body is `dir=\"auto\"`, so a\n * Hebrew reply in an English thread (or the reverse) lays out as its own language.\n *\n * **A chat, too** (keksdose G4/G5). keksdose's support chat is the same conversation\n * read the chat way: status lines between the messages (\"Closed automatically\",\n * \"Reopened\"), a day line where the date changes, clock times under it, Enter to send\n * and several files uploaded ahead of the send. Each of those is an opt-in here\n * (`kind: \"event\"`, `daySeparators`, `timeFormat=\"clock\"`, `sendOn=\"enter\"`,\n * `attachmentSlot` + `canSend`), so the feedback thread's defaults stay as they were.\n */\n\n/* ── Labels ───────────────────────────────────────────────────────────────── */\n\n/** The `feedbackThread` namespace of `<UiKitProvider labels>`. */\nexport interface FeedbackThreadLabels {\n /** Accessible name of the message list. */\n thread: string;\n empty: string;\n loading: string;\n /** Author line of an `own` message that has no `author` of its own. */\n you: string;\n /** The badge beside a `staff` author. */\n staff: string;\n /** Accessible name of a message's attachment list. */\n attachments: string;\n}\n\nexport const DEFAULT_FEEDBACK_THREAD_LABELS: FeedbackThreadLabels = {\n thread: \"Comments\",\n empty: \"No comments yet\",\n loading: \"Loading comments…\",\n you: \"You\",\n staff: \"Staff\",\n attachments: \"Attachments\",\n};\n\n/** The `feedbackComposer` namespace of `<UiKitProvider labels>`. The attach buttons'\n * words are `feedbackAttachment`'s, shared with the dialog and the note editor. */\nexport interface FeedbackComposerLabels {\n /** Accessible name of the text box. */\n field: string;\n placeholder: string;\n send: string;\n /** The shortcut line, given the platform's modifier (\"Ctrl\" or \"⌘\"). */\n sendHint: (modifier: string) => string;\n /** The shortcut line under `sendOn=\"enter\"` (keksdose G5): Enter sends, so say how a\n * new line is made. */\n sendHintEnter: string;\n}\n\nexport const DEFAULT_FEEDBACK_COMPOSER_LABELS: FeedbackComposerLabels = {\n field: \"Write a comment\",\n placeholder: \"Write a comment…\",\n send: \"Send\",\n sendHint: (modifier) => `${modifier} + Enter to send`,\n sendHintEnter: \"Enter to send, Shift + Enter for a new line\",\n};\n\n/* ── Thread ───────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackThreadAttachment {\n id?: string | number;\n name: string;\n /** Where to open it. Left out, the attachment is listed by name only. */\n url?: string;\n /** MIME type; an `image/*` with a `url` is shown as a thumbnail. */\n type?: string;\n /** Bytes, shown beside a non-image. */\n size?: number;\n}\n\nexport interface FeedbackThreadMessage {\n /** Leave out, or `\"message\"`. `\"event\"` is a {@link FeedbackThreadEvent}. */\n kind?: \"message\";\n id: string | number;\n /** Who wrote it. Left out on an `own` message, it reads \"You\". */\n author?: ReactNode;\n /** A `Date`, an ISO string or epoch ms. */\n createdAt: Date | string | number;\n body: string;\n attachments?: readonly FeedbackThreadAttachment[];\n /** Written by whoever is reading: sits at the end side, in the brand tint. */\n own?: boolean;\n /** Written by the team rather than a user: gets the \"Staff\" badge. */\n staff?: boolean;\n}\n\n/**\n * A line in the thread that nobody wrote — \"Closed automatically\", \"Marked as\n * resolved\", \"Reopened\" — drawn centred and muted with its time, no author, no side,\n * no bubble.\n *\n * keksdose G4: its support chat interleaves these with the messages, and as a message\n * they came out as a bubble from nobody at the start side, which reads as the member\n * having said \"resolved\". Word it for the READER, as with `own`: the app knows whether\n * \"you reopened it\" or \"Anna reopened it\" is true for the person looking.\n *\n * The text is the app's, not somebody's words about their data, so it is NOT tagged\n * `data-private`; one that names a person can wrap the name in its own\n * `<span data-private>` (`body` is a node for that reason).\n */\nexport interface FeedbackThreadEvent {\n kind: \"event\";\n id: string | number;\n /** A `Date`, an ISO string or epoch ms. */\n createdAt: Date | string | number;\n body: ReactNode;\n}\n\n/** One row of a {@link FeedbackThread}: a message, or an event line between them. */\nexport type FeedbackThreadItem = FeedbackThreadMessage | FeedbackThreadEvent;\n\nexport interface FeedbackThreadProps {\n /** Oldest first. Event lines ({@link FeedbackThreadEvent}) sit among the messages. */\n messages: readonly FeedbackThreadItem[];\n loading?: boolean;\n /** Replaces the default \"No comments yet\". */\n empty?: ReactNode;\n /**\n * Draw one attachment yourself — for files behind auth, which a plain `<img src>`\n * cannot fetch (kastlan's `AuthedImage`), or a lightbox. The default is a thumbnail\n * link for an image with a `url`, a file link otherwise.\n */\n renderAttachment?: (attachment: FeedbackThreadAttachment, message: FeedbackThreadMessage) => ReactNode;\n /** Tag bodies, authors and attachments `data-private`. Default true. */\n redact?: boolean;\n /**\n * How a row's time reads. `\"relative\"` (default): \"5 minutes ago\", a date past six\n * days — right for a report's comments, read days apart. `\"clock\"`: the time of day\n * in the locale (\"14:05\", \"2:05 PM\") — the chat look, keksdose G4; pair it with\n * `daySeparators`, which say which day that clock time is on. Either way the full\n * date and time is in the Tooltip.\n */\n timeFormat?: \"relative\" | \"clock\";\n /**\n * A centred day line before the first row and wherever the next row is on another\n * calendar day (the device's zone): \"Today\", \"Yesterday\", else the date — keksdose\n * G4. \"Today\" / \"Yesterday\" are `Intl.RelativeTimeFormat`'s own words in the kit\n * locale, so there is no label to translate. Default false.\n */\n daySeparators?: boolean;\n /** \"Now\" for the relative times and the day lines — pin it in tests and stories.\n * Default: the clock. */\n now?: Date | number;\n /** Overrides the provider's locale for the times. */\n locale?: string;\n labels?: Partial<FeedbackThreadLabels>;\n className?: string;\n}\n\nexport function FeedbackThread({\n messages,\n loading = false,\n empty,\n renderAttachment,\n redact = true,\n now,\n locale: localeProp,\n timeFormat = \"relative\",\n daySeparators = false,\n labels: labelsProp,\n className,\n}: FeedbackThreadProps) {\n const labels = useKitLabels(\"feedbackThread\", DEFAULT_FEEDBACK_THREAD_LABELS, labelsProp);\n const locale = useKitLocale(localeProp);\n const file = useKitFileLabels();\n const priv = redact ? \"\" : undefined;\n const clock = useMinuteClock(now === undefined);\n const reference = now === undefined ? clock : +now;\n\n if (loading && messages.length === 0) {\n return <Skeleton lines={3} label={labels.loading} className={className} />;\n }\n if (messages.length === 0) {\n return (\n <EmptyState\n variant=\"inline\"\n size=\"sm\"\n title={empty ?? labels.empty}\n className={cn(\"justify-start\", className)}\n />\n );\n }\n\n // Per row, the calendar day of the last readable date up to it — what a day line\n // compares against.\n const days: (number | null)[] = [];\n for (const message of messages) {\n const date = toDate(message.createdAt);\n days.push(date ? dayNumber(date) : (days.at(-1) ?? null));\n }\n\n return (\n <ol aria-label={labels.thread} aria-busy={loading || undefined} className={cn(\"space-y-3\", className)}>\n {messages.flatMap((message, index) => {\n const date = toDate(message.createdAt);\n const time = date && (\n // The kit's Tooltip, not a native title: one tooltip look app-wide\n // (keksdose F0 / dev#523).\n <Tooltip label={new Intl.DateTimeFormat(locale, { dateStyle: \"full\", timeStyle: \"short\" }).format(date)}>\n <time dateTime={date.toISOString()} className=\"tabular-nums\">\n {timeFormat === \"clock\"\n ? formatDate(date, \"time\", { locale })\n : formatRelativeTime(date, {\n now: reference,\n locale,\n // Past the kit's day steps it is a date: \"2 weeks ago\" makes\n // the reader do arithmetic the date already did.\n absoluteAfterDays: 6.5,\n })}\n </time>\n </Tooltip>\n );\n const rows: ReactNode[] = [];\n const day = date && dayNumber(date);\n // Against the last row WITH a readable date: an unparseable one neither starts\n // a day nor hides the next change.\n if (daySeparators && date && day !== days[index - 1]) {\n rows.push(<DaySeparator key={`day-${message.id}`} date={date} now={reference} locale={locale} />);\n }\n if (message.kind === \"event\") {\n // A list item like the rest, so \"Reopened\" is read in its place, but not an\n // article: an article is somebody's post, and this has no author.\n rows.push(\n <li\n key={message.id}\n data-event=\"\"\n className=\"flex flex-wrap items-baseline justify-center gap-x-2 px-4 text-center text-xs text-[var(--text-muted)]\"\n >\n <span>{message.body}</span>\n {time && <span className=\"text-[11px]\">{time}</span>}\n </li>,\n );\n return rows;\n }\n const author = message.author ?? (message.own ? labels.you : null);\n const attachments = message.attachments ?? [];\n rows.push(\n <li\n key={message.id}\n className={cn(\"flex\", message.own ? \"justify-end\" : \"justify-start\")}\n data-own={message.own ? \"\" : undefined}\n >\n <article\n className={cn(\n \"max-w-[85%] min-w-0 rounded-lg px-3 py-2 text-sm\",\n message.own\n ? \"rounded-ee-sm bg-[var(--brand-bg)]\"\n : \"rounded-es-sm bg-[var(--bg-surface-2)]\",\n )}\n >\n <header className=\"mb-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] text-[var(--text-muted)]\">\n {author != null && (\n <span data-private={priv} className=\"font-medium text-[var(--text-secondary)]\">\n {author}\n </span>\n )}\n {message.staff && (\n <span className=\"rounded border border-[var(--border)] bg-[var(--bg-surface)] px-1 text-[10px] font-medium uppercase tracking-wide text-[var(--text-secondary)]\">\n {labels.staff}\n </span>\n )}\n {time}\n </header>\n {message.body && (\n <p\n data-private={priv}\n dir=\"auto\"\n className=\"whitespace-pre-wrap break-words text-start text-[var(--text-primary)]\"\n >\n {message.body}\n </p>\n )}\n {attachments.length > 0 && (\n <ul aria-label={labels.attachments} data-private={priv} className=\"mt-2 flex flex-wrap gap-2\">\n {attachments.map((attachment, index) => (\n <li key={attachment.id ?? `${index}-${attachment.name}`} className=\"min-w-0\">\n {renderAttachment ? (\n renderAttachment(attachment, message)\n ) : (\n <DefaultAttachment attachment={attachment} size={file.size} />\n )}\n </li>\n ))}\n </ul>\n )}\n </article>\n </li>,\n );\n return rows;\n })}\n </ol>\n );\n}\n\nfunction DefaultAttachment({\n attachment,\n size,\n}: {\n attachment: FeedbackThreadAttachment;\n size: (bytes: number) => string;\n}) {\n const { name, url, type } = attachment;\n if (url && type?.startsWith(\"image/\")) return <ImageThumbnail url={url} name={name} />;\n const content = (\n <>\n <Paperclip className=\"size-3.5 shrink-0\" aria-hidden />\n <span className=\"truncate\">{name}</span>\n {attachment.size !== undefined && (\n <span className=\"shrink-0 text-[var(--text-muted)]\">{size(attachment.size)}</span>\n )}\n </>\n );\n const chip =\n \"inline-flex max-w-full items-center gap-1 rounded border border-[var(--border)] bg-[var(--bg-surface)] px-2 py-1 text-xs text-[var(--text-secondary)]\";\n return url ? (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\" className={cn(chip, \"hover:bg-[var(--bg-hover)]\")}>\n {content}\n </a>\n ) : (\n <span className={chip}>{content}</span>\n );\n}\n\n/** An image attachment's thumbnail. The box is drawn before the picture arrives —\n * `loading=\"lazy\"` leaves it empty until it nears the viewport, and a URL that has\n * expired never fills it — and an empty bordered square read as a broken layout, not\n * as a picture. So the box carries an image glyph underneath until the picture\n * covers it, and swaps it for a broken-image glyph when the load fails. */\nfunction ImageThumbnail({ url, name }: { url: string; name: string }) {\n // Keyed on the URL, so a message whose attachment is replaced tries the new one.\n const [failedUrl, setFailedUrl] = useState<string | null>(null);\n const failed = failedUrl === url;\n const Glyph = failed ? ImageOff : ImageIcon;\n return (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"relative block h-20 w-20 overflow-hidden rounded border border-[var(--border)] bg-[var(--bg-surface-2)]\"\n >\n <Glyph aria-hidden className=\"absolute inset-0 m-auto size-6 text-[var(--text-muted)]\" />\n {!failed && (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- load/error are resource events, not interactions\n <img\n src={url}\n alt={name}\n loading=\"lazy\"\n onError={() => setFailedUrl(url)}\n className=\"relative h-full w-full object-cover\"\n />\n )}\n {/* The <img> and its alt are gone once it failed; the link still needs a name. */}\n {failed && <span className=\"sr-only\">{name}</span>}\n </a>\n );\n}\n\n/** The time, refreshed once a minute while `active`, so \"2 minutes ago\" does not stay\n * \"just now\" on a page left open. Read in state rather than in render, which must be\n * pure. */\nfunction useMinuteClock(active: boolean): number {\n const [time, setTime] = useState(() => Date.now());\n useEffect(() => {\n if (!active) return;\n const id = setInterval(() => setTime(Date.now()), 60_000);\n return () => clearInterval(id);\n }, [active]);\n return time;\n}\n\n/** The local calendar day as one number (20260926), for \"same day?\" and keys. */\nfunction dayNumber(date: Date): number {\n return date.getFullYear() * 10_000 + (date.getMonth() + 1) * 100 + date.getDate();\n}\n\n/**\n * The day line of `daySeparators` (keksdose G4): \"Today\" / \"Yesterday\" from\n * `Intl.RelativeTimeFormat` (`numeric: \"auto\"`) — the locale's own words, capitalised\n * for a line that stands alone (\"heute\" → \"Heute\"; a script without case is left as\n * is) — else the weekday and date, with the year only when it is not this one.\n *\n * Counted in calendar days, not 24-hour spans: 23:50 yesterday is \"Yesterday\" at\n * 00:10 today.\n */\nfunction DaySeparator({ date, now, locale }: { date: Date; now: number; locale: string | undefined }) {\n const today = new Date(now);\n const days = Math.round(\n (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) -\n Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())) /\n 86_400_000,\n );\n let label: string;\n if (days === 0 || days === -1) {\n const word = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" }).format(days + 0, \"day\");\n label = word.charAt(0).toLocaleUpperCase(locale) + word.slice(1);\n } else {\n label = formatDate(\n date,\n {\n weekday: \"long\",\n day: \"numeric\",\n month: \"long\",\n ...(date.getFullYear() === today.getFullYear() ? null : { year: \"numeric\" }),\n },\n { locale },\n );\n }\n const y = String(date.getFullYear()).padStart(4, \"0\");\n const m = String(date.getMonth() + 1).padStart(2, \"0\");\n const d = String(date.getDate()).padStart(2, \"0\");\n return (\n <li data-day-separator=\"\" className=\"flex items-center gap-3 py-1 text-xs text-[var(--text-muted)]\">\n <span aria-hidden className=\"h-px flex-1 bg-[var(--border)]\" />\n <time dateTime={`${y}-${m}-${d}`} className=\"font-medium\">\n {label}\n </time>\n <span aria-hidden className=\"h-px flex-1 bg-[var(--border)]\" />\n </li>\n );\n}\n\nfunction toDate(value: Date | string | number): Date | null {\n const date = value instanceof Date ? value : new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n}\n\n/* ── Composer ─────────────────────────────────────────────────────────────── */\n\n/** What the composer's attach control takes — {@link FeedbackNoteAttachment} with the\n * labels optional, since the field reads `feedbackAttachment` from the provider. */\nexport type FeedbackComposerAttachment = Omit<FeedbackNoteAttachment, \"labels\"> & {\n labels?: Partial<FeedbackAttachmentLabels>;\n};\n\nexport interface FeedbackComposerProps {\n /**\n * Send the comment. Return the promise: the box clears when it RESOLVES, and only of\n * what was sent — text typed while it was in flight stays. A rejection keeps\n * everything for a retry (surface the error yourself; the composer stays quiet).\n *\n * `attachment` is the built-in field's one picture. Files the host uploaded ahead\n * (`attachmentSlot`) are the host's state, read by the host here — and `body` may be\n * `\"\"` when `canSend` let an attachments-only message go.\n */\n onSend: (body: string, attachment: File | null) => void | Promise<unknown>;\n /** The send is in flight: a spinner on the button and no second send. */\n pending?: boolean;\n /** Offer one picture with the comment (file, paste or `onCaptureScreenshot`).\n * `true` for the defaults. Left out, the composer is text only. */\n attachment?: boolean | FeedbackComposerAttachment;\n /**\n * The host's own attach control, in the row with Send where the built-in field sits\n * (after it, if both are on) — keksdose G5: its support chat uploads up to N files\n * AHEAD of the send and sends their refs, which one `File` in `onSend` cannot carry.\n * The slot is the host's picker plus the chips of what is uploaded; the upload, the\n * refs and clearing them once `onSend` resolves stay with the host. Pair it with\n * `canSend`.\n */\n attachmentSlot?: ReactNode;\n /**\n * Whether Send is enabled, over the composer's own rule (some text in the box) —\n * for state the composer cannot see, i.e. `attachmentSlot`'s (keksdose G5): `true`\n * with files ready makes an empty draft sendable (`onSend(\"\", null)`), `false` while\n * an upload is still running holds even a written reply back. Left out, the text\n * decides. `pending` blocks a send either way.\n */\n canSend?: boolean;\n /**\n * Which key sends. `\"mod-enter\"` (default): Ctrl/⌘+Enter, the report dialog's and\n * note editor's shortcut, with plain Enter a new line — feedback is written in\n * paragraphs. `\"enter\"`: the chat way (keksdose G5) — Enter sends, Shift+Enter is a\n * new line, Ctrl/⌘+Enter still sends; an Enter that confirms an IME composition\n * (Japanese, Chinese input) is the IME's, never a send.\n */\n sendOn?: \"mod-enter\" | \"enter\";\n /** Rendered INSTEAD of the composer — the thread is closed, or read-only for this\n * reader. */\n disabledReason?: ReactNode;\n rows?: number;\n /**\n * The box's hint, over the `placeholder` label — keksdose F9: an admin answering a\n * support ticket is asked something else (\"Reply to Anna…\") than a member adding to\n * their own report, and one provider-wide label cannot say both.\n */\n placeholder?: string;\n /**\n * The draft, controlled — for a host that keeps it itself (saves it per ticket,\n * prefills a template). Left out, the composer keeps its own. Either way a send\n * that resolves clears only what was sent: controlled, that is an\n * `onValueChange(\"\")` the host receives like any keystroke, and only if the draft\n * is still the one that went out.\n */\n value?: string;\n /** Every change to the draft — typing, {@link FeedbackComposerHandle.insertText}, the\n * clear after a send. Required to change a controlled `value`. */\n onValueChange?: (value: string) => void;\n /** {@link FeedbackComposerHandle}: put text into the draft from outside (canned-reply\n * chips) or focus the box. */\n ref?: Ref<FeedbackComposerHandle>;\n labels?: Partial<FeedbackComposerLabels>;\n className?: string;\n}\n\n/**\n * What a {@link FeedbackComposer} `ref` holds.\n *\n * keksdose F9: the support admin answers the same five questions all day and wants\n * chips above the box (\"Thanks, fixed in the next release\") that drop their text in\n * where the caret is. A controlled `value` alone cannot do that well — the host sees\n * the string, not the caret, so it could only append — so the composer, which owns\n * the textarea, does the splice.\n */\nexport interface FeedbackComposerHandle {\n /**\n * Insert `text` at the caret, replacing any selection (the caret the box last had:\n * a click on a chip blurs it, and the selection survives the blur), then focus the\n * box with the caret after the inserted text so the reply can go on. Nothing is\n * added around it — put a space or a newline in `text` if the reply needs one. A\n * no-op while `disabledReason` replaces the box.\n */\n insertText: (text: string) => void;\n focus: () => void;\n}\n\nconst noSubscribe = () => () => {};\nconst isApple = () =>\n typeof navigator !== \"undefined\" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform || navigator.userAgent);\n\n/**\n * The answer box under a {@link FeedbackThread}: a textarea, an optional picture,\n * and Send — Ctrl/⌘+Enter sends, the shortcut the report dialog and the note editor\n * use, so the habit carries across the feature. Plain Enter is a new line: feedback is\n * written in paragraphs, unlike a chat — which `sendOn=\"enter\"` is for (keksdose G5).\n */\nexport function FeedbackComposer({\n onSend,\n pending = false,\n attachment,\n attachmentSlot,\n canSend: canSendProp,\n sendOn = \"mod-enter\",\n disabledReason,\n rows = 3,\n placeholder,\n value,\n onValueChange,\n ref,\n labels: labelsProp,\n className,\n}: FeedbackComposerProps) {\n const labels = useKitLabels(\"feedbackComposer\", DEFAULT_FEEDBACK_COMPOSER_LABELS, labelsProp);\n const [ownDraft, setOwnDraft] = useState(\"\");\n const controlled = value !== undefined;\n const draft = controlled ? value : ownDraft;\n const [file, setFile] = useState<File | null>(null);\n const root = useRef<HTMLDivElement>(null);\n const box = useRef<HTMLTextAreaElement>(null);\n // The draft as of the last commit. The send's `.then` and `insertText` run after\n // renders their closure did not see — text typed while the send was in flight, a\n // second chip clicked before the first one's render — and must not act on a stale\n // string (for a controlled draft there is no updater function to lean on).\n const latest = useRef(draft);\n useLayoutEffect(() => {\n latest.current = draft;\n });\n // Where the caret goes once an inserted text has rendered.\n const caret = useRef<number | null>(null);\n useLayoutEffect(() => {\n const el = box.current;\n if (caret.current === null || !el) return;\n el.focus();\n el.setSelectionRange(caret.current, caret.current);\n caret.current = null;\n });\n\n const setDraft = (next: string) => {\n latest.current = next;\n if (!controlled) setOwnDraft(next);\n onValueChange?.(next);\n };\n\n useImperativeHandle(ref, () => ({\n insertText: (text) => {\n const el = box.current;\n if (!el) return;\n const current = latest.current;\n // A second insert before the first has rendered goes after the first, not at the\n // textarea's not-yet-moved caret. Otherwise the textarea's selection, which may\n // be past the end of a controlled value the host has just shortened: clamp it.\n const pending = caret.current;\n const start = Math.min(pending ?? el.selectionStart ?? current.length, current.length);\n const end = pending ?? Math.max(start, Math.min(el.selectionEnd ?? start, current.length));\n caret.current = start + text.length;\n setDraft(current.slice(0, start) + text + current.slice(end));\n },\n focus: () => box.current?.focus(),\n }));\n // The server snapshot is \"Ctrl\"; the client corrects it after hydration.\n const modifier = useSyncExternalStore(\n noSubscribe,\n () => (isApple() ? \"⌘\" : \"Ctrl\"),\n () => \"Ctrl\",\n );\n\n if (disabledReason != null && disabledReason !== false) {\n return <p className={cn(\"text-xs text-[var(--text-muted)]\", className)}>{disabledReason}</p>;\n }\n\n const canSend = (canSendProp ?? draft.trim().length > 0) && !pending;\n const send = () => {\n if (!canSend) return;\n const sentDraft = draft;\n const sentFile = file;\n Promise.resolve(onSend(draft.trim(), file))\n .then(() => {\n if (latest.current === sentDraft) setDraft(\"\");\n setFile((current) => (current === sentFile ? null : current));\n })\n .catch(() => {});\n };\n\n const config = attachment === true ? {} : attachment || null;\n\n return (\n <div ref={root} className={cn(\"space-y-2\", className)}>\n <Textarea\n rows={rows}\n dir=\"auto\"\n aria-label={labels.field}\n ref={box}\n placeholder={placeholder ?? labels.placeholder}\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\") return;\n const mod = event.ctrlKey || event.metaKey;\n // Under \"enter\": plain Enter sends, Shift+Enter falls through to the\n // textarea's new line, and an Enter that ends an IME composition is the\n // IME's (keyCode 229 is how Safari reports it after the composition ended).\n const chat =\n sendOn === \"enter\" &&\n !event.shiftKey &&\n !event.altKey &&\n !event.nativeEvent.isComposing &&\n event.keyCode !== 229;\n if (mod || chat) {\n event.preventDefault();\n send();\n }\n }}\n />\n <div className=\"flex flex-wrap items-end justify-between gap-2\">\n {config || attachmentSlot != null ? (\n <div className=\"flex min-w-0 flex-wrap items-end gap-2\">\n {config && (\n <FeedbackAttachmentField\n value={file}\n onChange={setFile}\n labels={config.labels}\n accept={config.accept}\n maxBytes={config.maxBytes}\n onError={config.onError}\n onCaptureScreenshot={config.onCaptureScreenshot}\n // The box is this field's sibling; a paste in it bubbles to `root`.\n pasteFrom={root}\n />\n )}\n {attachmentSlot}\n </div>\n ) : (\n <span />\n )}\n <div className=\"ms-auto flex items-center gap-2\">\n <span className=\"text-xs text-[var(--text-placeholder)]\">\n {sendOn === \"enter\" ? labels.sendHintEnter : labels.sendHint(modifier)}\n </span>\n <Button onClick={send} disabled={!canSend} aria-busy={pending || undefined}>\n {pending ? (\n <Spinner label={null} className=\"size-4\" />\n ) : (\n <Send className=\"size-4 rtl:-scale-x-100\" aria-hidden />\n )}\n {labels.send}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AA8MW,SAsIP,UAtIO,KAqDC,YArDD;AA9MX,SAAS,WAAW,qBAAqB,iBAAiB,QAAQ,UAAU,4BAA4B;AAExG,SAAS,WAAW,UAAU,WAAW,YAAY;AACrD,SAAS,UAAU;AACnB,SAAS,YAAY,0BAA0B;AAC/C,SAAS,QAAQ,YAAY,SAAS,gBAAgB;AACtD,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,kBAAkB,cAAc,oBAAoB;AAC7D,SAAS,+BAA+B;AAqDjC,MAAM,iCAAuD;AAAA,EAClE,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AACf;AAgBO,MAAM,mCAA2D;AAAA,EACtE,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,UAAU,CAAC,aAAa,GAAG,QAAQ;AAAA,EACnC,eAAe;AACjB;AA8FO,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR;AACF,GAAwB;AACtB,QAAM,SAAS,aAAa,kBAAkB,gCAAgC,UAAU;AACxF,QAAM,SAAS,aAAa,UAAU;AACtC,QAAM,OAAO,iBAAiB;AAC9B,QAAM,OAAO,SAAS,KAAK;AAC3B,QAAM,QAAQ,eAAe,QAAQ,MAAS;AAC9C,QAAM,YAAY,QAAQ,SAAY,QAAQ,CAAC;AAE/C,MAAI,WAAW,SAAS,WAAW,GAAG;AACpC,WAAO,oBAAC,YAAS,OAAO,GAAG,OAAO,OAAO,SAAS,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9D;AAAA,oBACC,oBAAC,WAAQ,OAAO,MAAM,WAAU,UAAS,IAEzC,oBAAC,QAAK,WAAU,2BAA0B,eAAW,MAAC;AAAA,UAEvD,OAAO;AAAA,WACV;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":["index","pending"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DragEvent, ReactElement } from 'react';
|
|
2
|
-
import { aY as UseFilePickerOptions } from '../kit-labels-
|
|
2
|
+
import { aY as UseFilePickerOptions } from '../kit-labels-BHfRBbHs.js';
|
|
3
3
|
import '../components/data-table-labels.js';
|
|
4
4
|
import '../components/mini-calendar.js';
|
|
5
5
|
import '../components/calendar-heatmap.js';
|
package/dist/i18n/defaults.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import '../components/calendar-heatmap.js';
|
|
|
5
5
|
import '../components/popover.js';
|
|
6
6
|
import '../components/chip.js';
|
|
7
7
|
import '../components/field-sync.js';
|
|
8
|
-
export { A as AppShellLabels, C as CalculatorLabels, v as ComboboxLabels, w as CommonLabels, D as CurrencyLabels, E as DEFAULT_APP_SHELL_LABELS, F as DEFAULT_CALCULATOR_LABELS, G as DEFAULT_COMBOBOX_LABELS, H as DEFAULT_COMMON_LABELS, J as DEFAULT_CURRENCY_LABELS, K as DEFAULT_DATE_PICKER_LABELS, L as DEFAULT_FILE_LABELS, O as DEFAULT_MULTI_SELECT_LABELS, Q as DEFAULT_PICKER_SHEET_LABELS, R as DEFAULT_SWIPEABLE_ROW_LABELS, T as DEFAULT_TOP_BAR_LABELS, U as DatePickerLabels, ac as FileLabels, az as KitLinkComponent, aA as KitLinkProps, aC as LabelOverride, aE as MultiSelectLabels, aH as PickerSheetLabels, aM as SwipeableRowLabels, aT as TopBarLabels, aU as UiKitLabelOverrides, aV as UiKitLabels, aW as UiKitProvider, aX as UiKitProviderProps, a$ as formatFileSize, b1 as missingKitLabels, b4 as useKitFileLabels, b5 as useKitLabelOverrides, b6 as useKitLabels, b7 as useKitLink, b8 as useKitLocale, b9 as useKitWeekStart } from '../kit-labels-
|
|
8
|
+
export { A as AppShellLabels, C as CalculatorLabels, v as ComboboxLabels, w as CommonLabels, D as CurrencyLabels, E as DEFAULT_APP_SHELL_LABELS, F as DEFAULT_CALCULATOR_LABELS, G as DEFAULT_COMBOBOX_LABELS, H as DEFAULT_COMMON_LABELS, J as DEFAULT_CURRENCY_LABELS, K as DEFAULT_DATE_PICKER_LABELS, L as DEFAULT_FILE_LABELS, O as DEFAULT_MULTI_SELECT_LABELS, Q as DEFAULT_PICKER_SHEET_LABELS, R as DEFAULT_SWIPEABLE_ROW_LABELS, T as DEFAULT_TOP_BAR_LABELS, U as DatePickerLabels, ac as FileLabels, az as KitLinkComponent, aA as KitLinkProps, aC as LabelOverride, aE as MultiSelectLabels, aH as PickerSheetLabels, aM as SwipeableRowLabels, aT as TopBarLabels, aU as UiKitLabelOverrides, aV as UiKitLabels, aW as UiKitProvider, aX as UiKitProviderProps, a$ as formatFileSize, b1 as missingKitLabels, b4 as useKitFileLabels, b5 as useKitLabelOverrides, b6 as useKitLabels, b7 as useKitLink, b8 as useKitLocale, b9 as useKitWeekStart } from '../kit-labels-BHfRBbHs.js';
|
|
9
9
|
import '../wizard/types.js';
|
|
10
10
|
import '../tour/tour.js';
|
|
11
11
|
import '../search/command-palette.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export { AnchorRole, ChartRampReport, ContrastCheck, ContrastReport, DeriveOptio
|
|
|
25
25
|
export { ALTERNATIVE_PRESETS, DEFAULT_PRESET, DERIVED_PRESETS, IMPRINT_PRESET, PALETTES, PalettePreset, TokenSet, applyTokenSet, presetById } from './theme/palette-presets.js';
|
|
26
26
|
export { ThemeMode, ThemePreference, ThemeState, ThemeStore, applyPersistedTheme, createThemeStore } from './theme/theme-store.js';
|
|
27
27
|
export { PaletteStore, applyPersistedPalette, createPaletteStore } from './theme/palette-store.js';
|
|
28
|
-
export { A as AppShellLabels, B as Button, a as ButtonClassesOptions, b as ButtonLinkProps, c as ButtonProps, d as ButtonSize, e as ButtonTone, f as ButtonVariant, C as CalculatorLabels, g as Card, h as CardAction, i as CardActionProps, j as CardContent, k as CardContentProps, l as CardDescription, m as CardDescriptionProps, n as CardFooter, o as CardFooterProps, p as CardHeader, q as CardHeaderProps, r as CardProps, s as CardTitle, t as CardTitleProps, u as CardTone, v as ComboboxLabels, w as CommonLabels, x as CopyButton, y as CopyButtonLabels, z as CopyButtonProps, D as CurrencyLabels, E as DEFAULT_APP_SHELL_LABELS, F as DEFAULT_CALCULATOR_LABELS, G as DEFAULT_COMBOBOX_LABELS, H as DEFAULT_COMMON_LABELS, I as DEFAULT_COPY_BUTTON_LABELS, J as DEFAULT_CURRENCY_LABELS, K as DEFAULT_DATE_PICKER_LABELS, L as DEFAULT_FILE_LABELS, M as DEFAULT_FILE_PICKER_LABELS, N as DEFAULT_FORM_ACTIONS_LABELS, O as DEFAULT_MULTI_SELECT_LABELS, P as DEFAULT_PASSWORD_REVEAL_LABELS, Q as DEFAULT_PICKER_SHEET_LABELS, R as DEFAULT_SWIPEABLE_ROW_LABELS, S as DEFAULT_TABS_LABELS, T as DEFAULT_TOP_BAR_LABELS, U as DatePickerLabels, V as EmptyState, W as EmptyStateProps, X as FIELD_BASE, Y as FIELD_DISPLAY, Z as FIELD_FLOATING_PAD, _ as FIELD_INVALID, $ as FIELD_TRIGGER, a0 as FIELD_WRITABLE_LOOK, a1 as FLOATING_INPUT_CLASS, a2 as FLOATING_LABEL_CLASS, a3 as FLOATING_LABEL_STATIC, a4 as FieldChevron, a5 as FieldChevronProps, a6 as FieldHint, a7 as FieldHintProps, a8 as FieldLabel, a9 as FieldLabelProps, aa as FileButton, ab as FileButtonProps, ac as FileLabels, ad as FilePickerLabels, ae as FileRejection, af as FileRejectionReason, ag as FileScreenOptions, ah as FloatingField, ai as FloatingFieldProps, aj as FormActions, ak as FormActionsAlign, al as FormActionsDestructive, am as FormActionsLabels, an as FormActionsPlacement, ao as FormActionsProps, ap as IconButton, aq as IconButtonGlyphSize, ar as IconButtonLinkProps, as as IconButtonProps, at as IconButtonSize, au as IconButtonTone, av as IconButtonToneColor, aw as IconButtonVariant, ax as Input, ay as InputProps, az as KitLinkComponent, aA as KitLinkProps, aB as Label, aC as LabelOverride, aD as LabelProps, aE as MultiSelectLabels, aF as PHONE_QUERY, aG as PasswordRevealLabels, aH as PickerSheetLabels, aI as Select, aJ as SelectProps, aK as Spinner, aL as SpinnerProps, aM as SwipeableRowLabels, aN as TabItem, aO as Tabs, aP as TabsLabels, aQ as TabsProps, aR as Textarea, aS as TextareaProps, aT as TopBarLabels, aU as UiKitLabelOverrides, aV as UiKitLabels, aW as UiKitProvider, aX as UiKitProviderProps, aY as UseFilePickerOptions, aZ as UseFilePickerReturn, a_ as buttonClasses, a$ as formatFileSize, b0 as matchesAccept, b1 as missingKitLabels, b2 as resolvePasswordRevealLabels, b3 as useFilePicker, b4 as useKitFileLabels, b5 as useKitLabelOverrides, b6 as useKitLabels, b7 as useKitLink, b8 as useKitLocale, b9 as useKitWeekStart } from './kit-labels-
|
|
28
|
+
export { A as AppShellLabels, B as Button, a as ButtonClassesOptions, b as ButtonLinkProps, c as ButtonProps, d as ButtonSize, e as ButtonTone, f as ButtonVariant, C as CalculatorLabels, g as Card, h as CardAction, i as CardActionProps, j as CardContent, k as CardContentProps, l as CardDescription, m as CardDescriptionProps, n as CardFooter, o as CardFooterProps, p as CardHeader, q as CardHeaderProps, r as CardProps, s as CardTitle, t as CardTitleProps, u as CardTone, v as ComboboxLabels, w as CommonLabels, x as CopyButton, y as CopyButtonLabels, z as CopyButtonProps, D as CurrencyLabels, E as DEFAULT_APP_SHELL_LABELS, F as DEFAULT_CALCULATOR_LABELS, G as DEFAULT_COMBOBOX_LABELS, H as DEFAULT_COMMON_LABELS, I as DEFAULT_COPY_BUTTON_LABELS, J as DEFAULT_CURRENCY_LABELS, K as DEFAULT_DATE_PICKER_LABELS, L as DEFAULT_FILE_LABELS, M as DEFAULT_FILE_PICKER_LABELS, N as DEFAULT_FORM_ACTIONS_LABELS, O as DEFAULT_MULTI_SELECT_LABELS, P as DEFAULT_PASSWORD_REVEAL_LABELS, Q as DEFAULT_PICKER_SHEET_LABELS, R as DEFAULT_SWIPEABLE_ROW_LABELS, S as DEFAULT_TABS_LABELS, T as DEFAULT_TOP_BAR_LABELS, U as DatePickerLabels, V as EmptyState, W as EmptyStateProps, X as FIELD_BASE, Y as FIELD_DISPLAY, Z as FIELD_FLOATING_PAD, _ as FIELD_INVALID, $ as FIELD_TRIGGER, a0 as FIELD_WRITABLE_LOOK, a1 as FLOATING_INPUT_CLASS, a2 as FLOATING_LABEL_CLASS, a3 as FLOATING_LABEL_STATIC, a4 as FieldChevron, a5 as FieldChevronProps, a6 as FieldHint, a7 as FieldHintProps, a8 as FieldLabel, a9 as FieldLabelProps, aa as FileButton, ab as FileButtonProps, ac as FileLabels, ad as FilePickerLabels, ae as FileRejection, af as FileRejectionReason, ag as FileScreenOptions, ah as FloatingField, ai as FloatingFieldProps, aj as FormActions, ak as FormActionsAlign, al as FormActionsDestructive, am as FormActionsLabels, an as FormActionsPlacement, ao as FormActionsProps, ap as IconButton, aq as IconButtonGlyphSize, ar as IconButtonLinkProps, as as IconButtonProps, at as IconButtonSize, au as IconButtonTone, av as IconButtonToneColor, aw as IconButtonVariant, ax as Input, ay as InputProps, az as KitLinkComponent, aA as KitLinkProps, aB as Label, aC as LabelOverride, aD as LabelProps, aE as MultiSelectLabels, aF as PHONE_QUERY, aG as PasswordRevealLabels, aH as PickerSheetLabels, aI as Select, aJ as SelectProps, aK as Spinner, aL as SpinnerProps, aM as SwipeableRowLabels, aN as TabItem, aO as Tabs, aP as TabsLabels, aQ as TabsProps, aR as Textarea, aS as TextareaProps, aT as TopBarLabels, aU as UiKitLabelOverrides, aV as UiKitLabels, aW as UiKitProvider, aX as UiKitProviderProps, aY as UseFilePickerOptions, aZ as UseFilePickerReturn, a_ as buttonClasses, a$ as formatFileSize, b0 as matchesAccept, b1 as missingKitLabels, b2 as resolvePasswordRevealLabels, b3 as useFilePicker, b4 as useKitFileLabels, b5 as useKitLabelOverrides, b6 as useKitLabels, b7 as useKitLink, b8 as useKitLocale, b9 as useKitWeekStart } from './kit-labels-BHfRBbHs.js';
|
|
29
29
|
export { Field, FieldControlProps, FieldLabelVisibility, FieldProps, FieldRenderMeta } from './components/field.js';
|
|
30
30
|
export { SearchField, SearchFieldProps } from './components/search-field.js';
|
|
31
31
|
export { DropdownPanel, DropdownPanelProps, DropdownSearchHeader, DropdownSearchHeaderProps, useDropdown, useDropdownSearch } from './components/dropdown.js';
|
|
@@ -70,7 +70,7 @@ export { Autocomplete, AutocompleteProps } from './components/autocomplete.js';
|
|
|
70
70
|
export { DEFAULT_MEASURED_GRID_LABELS, MeasuredGrid, MeasuredGridColumn, MeasuredGridLabels, MeasuredGridProps, MeasuredGridView, MeasuredRows, UseMeasuredRowsOptions, useMeasuredRows } from './components/measured-grid.js';
|
|
71
71
|
export { WindowedRows, useWindowedRows } from './hooks/use-windowed-rows.js';
|
|
72
72
|
export { Treemap, TreemapCell, TreemapCellProps, TreemapNode, TreemapProps, fitLabel } from './components/treemap.js';
|
|
73
|
-
export { AXIS_TICK_WIDTH, AXIS_TITLE_STRIP, SeriesChart, SeriesChartAxis, SeriesChartHit, SeriesChartMarker, SeriesChartPoint, SeriesChartProps, SeriesChartReference, SeriesChartRow, SeriesChartSeries, SeriesChartSpan, SeriesChartTickValues, SeriesChartTone, SeriesChartTooltip, SeriesChartType, SeriesChartX, SeriesChartXTick, SeriesChartXValue, SeriesSource, StaticSeriesChart, anchoredBand, axisBandWidth, mergeSeries, oneAxis, padBand, paddedDomain, seriesKey, seriesLegendEntries, soleSeriesColor, visibleSeries } from './components/series-chart.js';
|
|
73
|
+
export { AXIS_TICK_WIDTH, AXIS_TITLE_STRIP, SeriesChart, SeriesChartAxis, SeriesChartHit, SeriesChartMarker, SeriesChartPoint, SeriesChartProps, SeriesChartReference, SeriesChartRow, SeriesChartSeries, SeriesChartSpan, SeriesChartTickValues, SeriesChartTone, SeriesChartTooltip, SeriesChartType, SeriesChartX, SeriesChartXTick, SeriesChartXValue, SeriesLegendAxes, SeriesSource, StaticSeriesChart, anchoredBand, axisBandWidth, mergeSeries, oneAxis, padBand, paddedDomain, seriesKey, seriesLegendEntries, soleSeriesColor, visibleSeries } from './components/series-chart.js';
|
|
74
74
|
export { DEFAULT_Y_AXIS, NO_ZOOM, SharedXZoom, ZOOM_MIN_DRAG, ZOOM_SQUARE_ENOUGH, ZoomAxes, ZoomAxesSetting, ZoomBinding, ZoomDrag, ZoomFitSeries, ZoomFitSource, ZoomRow, ZoomSelection, ZoomState, ZoomTarget, axisExtent, defaultZoomAxes, fitXToY, fitYToX, selectionFromDrag, withChartZoom, zoomAfter, zoomAxesFor, zoomDomains } from './components/chart-zoom.js';
|
|
75
75
|
export { LegendColumn, LegendEntry, LegendGroup, STEP_DASH, STROKE_PATTERNS, StaticLegend, StaticLegendProps, ToggleLegend, ToggleLegendProps, strokeDash, toggleHidden } from './components/toggle-legend.js';
|
|
76
76
|
export { FACING_SIDES, FacingSide, facingAxes, facingBand, facingHeadingPad } from './components/facing-pair.js';
|
|
@@ -104,7 +104,7 @@ export { LoadingState, LoadingStateProps, LoadingStateSize } from './components/
|
|
|
104
104
|
export { DEFAULT_SIGNED_AMOUNT_LABELS, Delta, DeltaProps, GoodDirection, SignedAmount, SignedAmountLabels, SignedAmountProps, SignedAmountTone, TextTone, Tone, ToneProps, toneTextClass } from './components/signed-amount.js';
|
|
105
105
|
export { CrashReport, CrashReportResult, DEFAULT_ERROR_BOUNDARY_LABELS, ErrorBoundary, ErrorBoundaryDetails, ErrorBoundaryFallbackProps, ErrorBoundaryLabels, ErrorBoundaryProps, crashFingerprint, describeThrown, formatCrashReport, isChunkLoadError } from './components/error-boundary.js';
|
|
106
106
|
export { AuthedImage, AuthedImageLabels, AuthedImageProps, DEFAULT_AUTHED_IMAGE_LABELS } from './components/authed-image.js';
|
|
107
|
-
export { DEFAULT_IMAGE_GRID_LABELS, ImageGrid, ImageGridLabels, ImageGridProps } from './components/image-grid.js';
|
|
107
|
+
export { DEFAULT_IMAGE_GRID_LABELS, ImageGrid, ImageGridLabels, ImageGridProps, splitFileName } from './components/image-grid.js';
|
|
108
108
|
export { DEFAULT_LIGHTBOX_LABELS, ImageItem, ImageItemKind, Lightbox, LightboxLabels, LightboxProps, imageItemKind } from './components/lightbox.js';
|
|
109
109
|
export { ButtonGroup, ButtonGroupLink, ButtonGroupLinkProps, ButtonGroupLinkRenderProps, ButtonGroupProps } from './components/button-group.js';
|
|
110
110
|
export { NUMERIC_CELL_CLASS, Table, TableAlign, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableDensity, TableEmpty, TableEmptyProps, TableFoot, TableFootProps, TableHead, TableHeadProps, TableHeaderCell, TableHeaderCellProps, TableHeaderCellSize, TableHeaderCellWeight, TableLayout, TableProps, TableRow, TableRowProps, TableRowVariant, TableVAlign } from './components/table.js';
|
|
@@ -120,7 +120,7 @@ export { TextLink, TextLinkCurrent, TextLinkProps, TextLinkRenderProps, TextLink
|
|
|
120
120
|
export { DEFAULT_TOAST_LABELS, TOAST_ACTION_DURATION, ToastAction, ToastId, ToastLabels, ToastOptions, ToastPosition, ToastPromiseOptions, ToastRedoOptions, ToastSwipeDirection, ToastUndoOptions, Toaster, ToasterOffset, ToasterProps, toast } from './components/toast.js';
|
|
121
121
|
export { DEFAULT_DATA_TABLE_LABELS, DataTableLabels, missingDataTableLabels, resolveDataTableLabels } from './components/data-table-labels.js';
|
|
122
122
|
export { SortCycle, SortDir, SortState, SortStepOptions, decodeSorts, encodeSorts, nextSorts, normalizeSorts } from './components/data-table-sort.js';
|
|
123
|
-
export { C as ColumnFilter, D as DataTable, x as DataTableCellProps, a as DataTableChrome, b as DataTableColumn, c as DataTableDensity, y as DataTableHeadProps, d as DataTableProps, e as DataTableRowAction, F as FilterState, f as FilterValue, M as MobileSwipeActions, S as ServerPagination, T as TableUrlState, g as TableUrlStateProps, h as TableUrlSync, U as UseTableUrlStateOptions, i as UseTableUrlStateReturn, j as dateFilter, k as decodeFilterValue, l as decodeFilterValueOfType, m as defaultFilterState, n as encodeFilterValue, o as filterHref, p as isFilterActive, q as numberFilter, r as readTableUrlState, s as resolveFilter, t as rowMatches, u as selectFilter, v as textFilter, w as useTableUrlState } from './data-table-
|
|
123
|
+
export { C as ColumnFilter, D as DataTable, x as DataTableCellProps, a as DataTableChrome, b as DataTableColumn, c as DataTableDensity, y as DataTableHeadProps, d as DataTableProps, e as DataTableRowAction, F as FilterState, f as FilterValue, M as MobileSwipeActions, S as ServerPagination, T as TableUrlState, g as TableUrlStateProps, h as TableUrlSync, U as UseTableUrlStateOptions, i as UseTableUrlStateReturn, j as dateFilter, k as decodeFilterValue, l as decodeFilterValueOfType, m as defaultFilterState, n as encodeFilterValue, o as filterHref, p as isFilterActive, q as numberFilter, r as readTableUrlState, s as resolveFilter, t as rowMatches, u as selectFilter, v as textFilter, w as useTableUrlState } from './data-table-CfVXtCeG.js';
|
|
124
124
|
export { PAGE_SIZE_OPTIONS, Pagination } from './components/data-table-pagination.js';
|
|
125
125
|
export { FilterPopover } from './components/data-table-filter-popover.js';
|
|
126
126
|
export { BooleanColumnOptions, BooleanMark, BooleanMarkProps, booleanColumn } from './components/data-table-cells.js';
|
|
@@ -151,6 +151,7 @@ export { DEFAULT_UI_KIT_LABELS } from './i18n/defaults.js';
|
|
|
151
151
|
export { AccountSettingsLabels, DEFAULT_ACCOUNT_SETTINGS_LABELS, PasskeysSettingLabels, PasswordSettingLabels, ProfileSettingLabels, TwoFactorSettingLabels } from './components/account-settings-labels.js';
|
|
152
152
|
export { CLIPS_ATTRIBUTE } from './lib/clipping.js';
|
|
153
153
|
export { ComboClearValue, ComboOption } from './components/combobox-core.js';
|
|
154
|
+
export { SeriesChartAxisBudget } from './components/series-chart-budget.js';
|
|
154
155
|
export { TimeTickUnit } from './components/series-chart-ticks.js';
|
|
155
156
|
import 'clsx';
|
|
156
157
|
import 'zustand';
|
|
@@ -661,7 +661,11 @@ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "siz
|
|
|
661
661
|
invalid?: boolean;
|
|
662
662
|
/** See {@link Input}'s `error`. */
|
|
663
663
|
error?: ReactNode;
|
|
664
|
-
/** A {@link FieldHint} for the label line — see {@link FloatingField}.
|
|
664
|
+
/** A {@link FieldHint} for the label line — see {@link FloatingField}. Plain
|
|
665
|
+
* TEXT (a string or a number) is a caption instead, and goes UNDER the field
|
|
666
|
+
* like every other field's hint, attached through `aria-describedby`: the label
|
|
667
|
+
* line is 11px of strip shared with the label, and a sentence placed there was
|
|
668
|
+
* set in the value's type on top of both the label and the value. */
|
|
665
669
|
hint?: ReactNode;
|
|
666
670
|
/**
|
|
667
671
|
* `"sm"`: a 28px, 12px-type select for a toolbar or a table header, where the
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const TAB_FADE_PX = 24;
|
|
4
|
+
/**
|
|
5
|
+
* Shared by Tabs' strip and AppShell's scrolling phone sub-nav; internal, not part of
|
|
6
|
+
* the package's surface.
|
|
7
|
+
*
|
|
8
|
+
* Which ends of a sideways-scrolling strip have tabs cut off behind them, as the
|
|
9
|
+
* `mask-image` that fades those ends out — or `undefined` while everything fits.
|
|
10
|
+
*
|
|
11
|
+
* A strip that overflowed used to stop dead at its edge: the last tab sliced through
|
|
12
|
+
* mid-word, and nothing on a phone (whose scrollbars are overlays that only show
|
|
13
|
+
* while you drag) said there was more to reach. A fade is the cue — the letters
|
|
14
|
+
* thin out rather than end — and it is measured, not assumed, so a strip that fits
|
|
15
|
+
* is painted exactly as before. Physical `left`/`right` in the gradient, because
|
|
16
|
+
* `mask-image` has no logical directions; the reading direction is read from the
|
|
17
|
+
* element, and `scrollLeft` is a magnitude here because an RTL strip counts it
|
|
18
|
+
* negative from the start edge.
|
|
19
|
+
*/
|
|
20
|
+
declare function useStripFade(ref: RefObject<HTMLElement | null>): {
|
|
21
|
+
mask: string | undefined;
|
|
22
|
+
overflow: "start" | "end" | "both" | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Scroll `item` into view inside `strip` — the strip only (`scrollBy` on it, never
|
|
26
|
+
* `scrollIntoView`, which would scroll the page too) — far enough to clear the fade.
|
|
27
|
+
* A no-op when the strip fits or the item is already clear of both edges.
|
|
28
|
+
*/
|
|
29
|
+
declare function scrollIntoStrip(strip: HTMLElement, item: HTMLElement): void;
|
|
30
|
+
|
|
31
|
+
export { TAB_FADE_PX, scrollIntoStrip, useStripFade };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLayoutEffect, useState } from "react";
|
|
3
|
+
const TAB_FADE_PX = 24;
|
|
4
|
+
function useStripFade(ref) {
|
|
5
|
+
const [edges, setEdges] = useState({ left: false, right: false, rtl: false });
|
|
6
|
+
useLayoutEffect(() => {
|
|
7
|
+
const el = ref.current;
|
|
8
|
+
if (!el) return;
|
|
9
|
+
const measure = () => {
|
|
10
|
+
const hidden = el.scrollWidth - el.clientWidth;
|
|
11
|
+
const scrolled = Math.abs(el.scrollLeft);
|
|
12
|
+
const rtl2 = getComputedStyle(el).direction === "rtl";
|
|
13
|
+
const atStart = scrolled > 1;
|
|
14
|
+
const atEnd = hidden - scrolled > 1;
|
|
15
|
+
const left = rtl2 ? atEnd : atStart;
|
|
16
|
+
const right = rtl2 ? atStart : atEnd;
|
|
17
|
+
setEdges(
|
|
18
|
+
(prev) => prev.left === left && prev.right === right && prev.rtl === rtl2 ? prev : { left, right, rtl: rtl2 }
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
measure();
|
|
22
|
+
el.addEventListener("scroll", measure, { passive: true });
|
|
23
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
24
|
+
observer?.observe(el);
|
|
25
|
+
for (const child of Array.from(el.children)) observer?.observe(child);
|
|
26
|
+
return () => {
|
|
27
|
+
el.removeEventListener("scroll", measure);
|
|
28
|
+
observer?.disconnect();
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
if (!edges.left && !edges.right) return { mask: void 0, overflow: void 0 };
|
|
32
|
+
const l = edges.left ? `transparent, #000 ${TAB_FADE_PX}px` : "#000";
|
|
33
|
+
const r = edges.right ? `#000 calc(100% - ${TAB_FADE_PX}px), transparent` : "#000";
|
|
34
|
+
const rtl = edges.rtl;
|
|
35
|
+
const start = rtl ? edges.right : edges.left;
|
|
36
|
+
const end = rtl ? edges.left : edges.right;
|
|
37
|
+
return {
|
|
38
|
+
mask: `linear-gradient(to right, ${l}, ${r})`,
|
|
39
|
+
overflow: start && end ? "both" : start ? "start" : "end"
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function scrollIntoStrip(strip, item) {
|
|
43
|
+
if (strip.scrollWidth <= strip.clientWidth) return;
|
|
44
|
+
const s = strip.getBoundingClientRect();
|
|
45
|
+
const t = item.getBoundingClientRect();
|
|
46
|
+
const delta = t.left < s.left + TAB_FADE_PX ? t.left - s.left - TAB_FADE_PX : t.right > s.right - TAB_FADE_PX ? t.right - s.right + TAB_FADE_PX : 0;
|
|
47
|
+
if (delta !== 0) strip.scrollBy({ left: delta });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
TAB_FADE_PX,
|
|
51
|
+
scrollIntoStrip,
|
|
52
|
+
useStripFade
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=strip-fade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/strip-fade.ts"],"sourcesContent":["import { useLayoutEffect, useState, type RefObject } from \"react\";\n\n// How far the fade at a scrolled strip's cut edge reaches, and how much room a tab\n// brought into view keeps from that edge so the fade never lies on top of it.\nexport const TAB_FADE_PX = 24;\n\n/**\n * Shared by Tabs' strip and AppShell's scrolling phone sub-nav; internal, not part of\n * the package's surface.\n *\n * Which ends of a sideways-scrolling strip have tabs cut off behind them, as the\n * `mask-image` that fades those ends out — or `undefined` while everything fits.\n *\n * A strip that overflowed used to stop dead at its edge: the last tab sliced through\n * mid-word, and nothing on a phone (whose scrollbars are overlays that only show\n * while you drag) said there was more to reach. A fade is the cue — the letters\n * thin out rather than end — and it is measured, not assumed, so a strip that fits\n * is painted exactly as before. Physical `left`/`right` in the gradient, because\n * `mask-image` has no logical directions; the reading direction is read from the\n * element, and `scrollLeft` is a magnitude here because an RTL strip counts it\n * negative from the start edge.\n */\nexport function useStripFade(\n ref: RefObject<HTMLElement | null>,\n): { mask: string | undefined; overflow: \"start\" | \"end\" | \"both\" | undefined } {\n const [edges, setEdges] = useState({ left: false, right: false, rtl: false });\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n const measure = () => {\n const hidden = el.scrollWidth - el.clientWidth;\n const scrolled = Math.abs(el.scrollLeft);\n const rtl = getComputedStyle(el).direction === \"rtl\";\n const atStart = scrolled > 1;\n const atEnd = hidden - scrolled > 1;\n const left = rtl ? atEnd : atStart;\n const right = rtl ? atStart : atEnd;\n setEdges((prev) =>\n prev.left === left && prev.right === right && prev.rtl === rtl ? prev : { left, right, rtl },\n );\n };\n measure();\n el.addEventListener(\"scroll\", measure, { passive: true });\n const observer = typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(measure);\n observer?.observe(el);\n // The tabs, too: a label or a badge that grows changes the overflow without\n // resizing the strip's own box.\n for (const child of Array.from(el.children)) observer?.observe(child);\n return () => {\n el.removeEventListener(\"scroll\", measure);\n observer?.disconnect();\n };\n });\n if (!edges.left && !edges.right) return { mask: undefined, overflow: undefined };\n const l = edges.left ? `transparent, #000 ${TAB_FADE_PX}px` : \"#000\";\n const r = edges.right ? `#000 calc(100% - ${TAB_FADE_PX}px), transparent` : \"#000\";\n const rtl = edges.rtl;\n const start = rtl ? edges.right : edges.left;\n const end = rtl ? edges.left : edges.right;\n return {\n mask: `linear-gradient(to right, ${l}, ${r})`,\n overflow: start && end ? \"both\" : start ? \"start\" : \"end\",\n };\n}\n\n/**\n * Scroll `item` into view inside `strip` — the strip only (`scrollBy` on it, never\n * `scrollIntoView`, which would scroll the page too) — far enough to clear the fade.\n * A no-op when the strip fits or the item is already clear of both edges.\n */\nexport function scrollIntoStrip(strip: HTMLElement, item: HTMLElement): void {\n if (strip.scrollWidth <= strip.clientWidth) return;\n const s = strip.getBoundingClientRect();\n const t = item.getBoundingClientRect();\n const delta =\n t.left < s.left + TAB_FADE_PX\n ? t.left - s.left - TAB_FADE_PX\n : t.right > s.right - TAB_FADE_PX\n ? t.right - s.right + TAB_FADE_PX\n : 0;\n if (delta !== 0) strip.scrollBy({ left: delta });\n}\n"],"mappings":";AAAA,SAAS,iBAAiB,gBAAgC;AAInD,MAAM,cAAc;AAkBpB,SAAS,aACd,KAC8E;AAC9E,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE,MAAM,OAAO,OAAO,OAAO,KAAK,MAAM,CAAC;AAC5E,kBAAgB,MAAM;AACpB,UAAM,KAAK,IAAI;AACf,QAAI,CAAC,GAAI;AACT,UAAM,UAAU,MAAM;AACpB,YAAM,SAAS,GAAG,cAAc,GAAG;AACnC,YAAM,WAAW,KAAK,IAAI,GAAG,UAAU;AACvC,YAAMA,OAAM,iBAAiB,EAAE,EAAE,cAAc;AAC/C,YAAM,UAAU,WAAW;AAC3B,YAAM,QAAQ,SAAS,WAAW;AAClC,YAAM,OAAOA,OAAM,QAAQ;AAC3B,YAAM,QAAQA,OAAM,UAAU;AAC9B;AAAA,QAAS,CAAC,SACR,KAAK,SAAS,QAAQ,KAAK,UAAU,SAAS,KAAK,QAAQA,OAAM,OAAO,EAAE,MAAM,OAAO,KAAAA,KAAI;AAAA,MAC7F;AAAA,IACF;AACA,YAAQ;AACR,OAAG,iBAAiB,UAAU,SAAS,EAAE,SAAS,KAAK,CAAC;AACxD,UAAM,WAAW,OAAO,mBAAmB,cAAc,OAAO,IAAI,eAAe,OAAO;AAC1F,cAAU,QAAQ,EAAE;AAGpB,eAAW,SAAS,MAAM,KAAK,GAAG,QAAQ,EAAG,WAAU,QAAQ,KAAK;AACpE,WAAO,MAAM;AACX,SAAG,oBAAoB,UAAU,OAAO;AACxC,gBAAU,WAAW;AAAA,IACvB;AAAA,EACF,CAAC;AACD,MAAI,CAAC,MAAM,QAAQ,CAAC,MAAM,MAAO,QAAO,EAAE,MAAM,QAAW,UAAU,OAAU;AAC/E,QAAM,IAAI,MAAM,OAAO,qBAAqB,WAAW,OAAO;AAC9D,QAAM,IAAI,MAAM,QAAQ,oBAAoB,WAAW,qBAAqB;AAC5E,QAAM,MAAM,MAAM;AAClB,QAAM,QAAQ,MAAM,MAAM,QAAQ,MAAM;AACxC,QAAM,MAAM,MAAM,MAAM,OAAO,MAAM;AACrC,SAAO;AAAA,IACL,MAAM,6BAA6B,CAAC,KAAK,CAAC;AAAA,IAC1C,UAAU,SAAS,MAAM,SAAS,QAAQ,UAAU;AAAA,EACtD;AACF;AAOO,SAAS,gBAAgB,OAAoB,MAAyB;AAC3E,MAAI,MAAM,eAAe,MAAM,YAAa;AAC5C,QAAM,IAAI,MAAM,sBAAsB;AACtC,QAAM,IAAI,KAAK,sBAAsB;AACrC,QAAM,QACJ,EAAE,OAAO,EAAE,OAAO,cACd,EAAE,OAAO,EAAE,OAAO,cAClB,EAAE,QAAQ,EAAE,QAAQ,cAClB,EAAE,QAAQ,EAAE,QAAQ,cACpB;AACR,MAAI,UAAU,EAAG,OAAM,SAAS,EAAE,MAAM,MAAM,CAAC;AACjD;","names":["rtl"]}
|
package/dist/rhf/fields.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ReactElement } from 'react';
|
|
3
3
|
import { FieldValues, FieldPath, ControllerProps, ControllerRenderProps, ControllerFieldState } from 'react-hook-form';
|
|
4
|
-
import { aJ as SelectProps, ay as InputProps, aS as TextareaProps } from '../kit-labels-
|
|
4
|
+
import { aJ as SelectProps, ay as InputProps, aS as TextareaProps } from '../kit-labels-BHfRBbHs.js';
|
|
5
5
|
import { NumberFieldProps } from '../components/number-field.js';
|
|
6
6
|
import { DatePickerProps } from '../components/date-picker.js';
|
|
7
7
|
import { CheckboxProps } from '../components/checkbox.js';
|
package/dist/rhf/form.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactElement, ComponentProps } from 'react';
|
|
3
3
|
import * as react_hook_form from 'react-hook-form';
|
|
4
4
|
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
5
|
-
import { aD as LabelProps } from '../kit-labels-
|
|
5
|
+
import { aD as LabelProps } from '../kit-labels-BHfRBbHs.js';
|
|
6
6
|
import '../components/data-table-labels.js';
|
|
7
7
|
import '../components/mini-calendar.js';
|
|
8
8
|
import '../components/calendar-heatmap.js';
|
package/dist/rhf/form.js
CHANGED
|
@@ -64,7 +64,7 @@ function FormItem({ className, ...rest }) {
|
|
|
64
64
|
[]
|
|
65
65
|
);
|
|
66
66
|
const value = useMemo(() => ({ id, mounted, mark }), [id, mounted, mark]);
|
|
67
|
-
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { "data-slot": "form-item", ...rest, className: cn("grid gap-1", className) }) });
|
|
67
|
+
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { "data-slot": "form-item", ...rest, className: cn("grid content-start gap-1", className) }) });
|
|
68
68
|
}
|
|
69
69
|
function useDescribes(slot, on) {
|
|
70
70
|
const item = useContext(FormItemContext);
|