@ai-matrx/records-ui 0.101.28 → 0.101.30
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/CHANGELOG.md +12 -0
- package/dist/index.cjs +2209 -2183
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +57 -31
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +5 -3
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +6 -4
- package/dist/pickers.js.map +1 -1
- package/package.json +7 -5
package/dist/index.d.cts
CHANGED
|
@@ -3369,9 +3369,14 @@ declare function choiceNudgeOf(client: RecordsClient): Promise<ChoiceNudge>;
|
|
|
3369
3369
|
*/
|
|
3370
3370
|
declare function useChoiceNudge(enabled?: boolean): ChoiceNudge | null;
|
|
3371
3371
|
|
|
3372
|
+
interface EmbeddedLook {
|
|
3373
|
+
blankEmpty: boolean;
|
|
3374
|
+
choiceDot: boolean;
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3372
3377
|
/** The envelope for one key, when the document carries one. */
|
|
3373
3378
|
declare function envelopeFor(document: RecordDocument | undefined, key: string): ValueEnvelope | undefined;
|
|
3374
|
-
declare function renderValue(field: Field, value: unknown, document?: RecordDocument, labels?: LabelLookup, stillWaitingFor?: string | null): string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
3379
|
+
declare function renderValue(field: Field, value: unknown, document?: RecordDocument, labels?: LabelLookup, stillWaitingFor?: string | null, look?: EmbeddedLook | null): string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
3375
3380
|
/**
|
|
3376
3381
|
* The text of one scalar, with the Field's UNIT and FORMAT applied — FLD-N-1
|
|
3377
3382
|
* says both change the MEANING — and with an id resolved to the NAME of the
|
|
@@ -3441,7 +3446,7 @@ declare function RecordValue({ field, value, document, format, withheld, inCell,
|
|
|
3441
3446
|
* unbound, the words as written.
|
|
3442
3447
|
*/
|
|
3443
3448
|
inCell?: boolean | undefined;
|
|
3444
|
-
}): react.JSX.Element;
|
|
3449
|
+
}): react.JSX.Element | null;
|
|
3445
3450
|
/**
|
|
3446
3451
|
* WHAT ONE CARD SAYS — the kanban's, the calendar's, the gallery's and the pipeline's alike, so
|
|
3447
3452
|
* no card can read a record differently from another. `field` is the card's title column
|
package/dist/index.d.ts
CHANGED
|
@@ -3369,9 +3369,14 @@ declare function choiceNudgeOf(client: RecordsClient): Promise<ChoiceNudge>;
|
|
|
3369
3369
|
*/
|
|
3370
3370
|
declare function useChoiceNudge(enabled?: boolean): ChoiceNudge | null;
|
|
3371
3371
|
|
|
3372
|
+
interface EmbeddedLook {
|
|
3373
|
+
blankEmpty: boolean;
|
|
3374
|
+
choiceDot: boolean;
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3372
3377
|
/** The envelope for one key, when the document carries one. */
|
|
3373
3378
|
declare function envelopeFor(document: RecordDocument | undefined, key: string): ValueEnvelope | undefined;
|
|
3374
|
-
declare function renderValue(field: Field, value: unknown, document?: RecordDocument, labels?: LabelLookup, stillWaitingFor?: string | null): string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
3379
|
+
declare function renderValue(field: Field, value: unknown, document?: RecordDocument, labels?: LabelLookup, stillWaitingFor?: string | null, look?: EmbeddedLook | null): string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
3375
3380
|
/**
|
|
3376
3381
|
* The text of one scalar, with the Field's UNIT and FORMAT applied — FLD-N-1
|
|
3377
3382
|
* says both change the MEANING — and with an id resolved to the NAME of the
|
|
@@ -3441,7 +3446,7 @@ declare function RecordValue({ field, value, document, format, withheld, inCell,
|
|
|
3441
3446
|
* unbound, the words as written.
|
|
3442
3447
|
*/
|
|
3443
3448
|
inCell?: boolean | undefined;
|
|
3444
|
-
}): react.JSX.Element;
|
|
3449
|
+
}): react.JSX.Element | null;
|
|
3445
3450
|
/**
|
|
3446
3451
|
* WHAT ONE CARD SAYS — the kanban's, the calendar's, the gallery's and the pipeline's alike, so
|
|
3447
3452
|
* no card can read a record differently from another. `field` is the card's title column
|
package/dist/index.js
CHANGED
|
@@ -5119,7 +5119,7 @@ function useWhoChanged(fieldKey, recordId) {
|
|
|
5119
5119
|
}
|
|
5120
5120
|
|
|
5121
5121
|
// src/values.tsx
|
|
5122
|
-
import { formatColumnValue } from "@ai-matrx/design-system/data-table";
|
|
5122
|
+
import { SWATCH_CLASS, formatColumnValue } from "@ai-matrx/design-system/data-table";
|
|
5123
5123
|
import { formatFieldValue as formatFieldValue3 } from "@ai-matrx/design-system/field-formats";
|
|
5124
5124
|
|
|
5125
5125
|
// src/withheld.tsx
|
|
@@ -5155,6 +5155,25 @@ function WithheldValue({ field: field2, notice }) {
|
|
|
5155
5155
|
// src/values.tsx
|
|
5156
5156
|
import { Badge as Badge5, cn as cn17 } from "@ai-matrx/design-system";
|
|
5157
5157
|
|
|
5158
|
+
// src/embeddedLook.tsx
|
|
5159
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
5160
|
+
var EMBEDDED_LOOK = { blankEmpty: true, choiceDot: true };
|
|
5161
|
+
var EmbeddedLookContext = createContext4(null);
|
|
5162
|
+
var EmbeddedLookProvider = EmbeddedLookContext.Provider;
|
|
5163
|
+
function useEmbeddedLook() {
|
|
5164
|
+
return useContext4(EmbeddedLookContext);
|
|
5165
|
+
}
|
|
5166
|
+
var EMBEDDED_TABLE_CLASS = [
|
|
5167
|
+
"[&_tbody_td]:h-10",
|
|
5168
|
+
"[&_tbody_td]:align-middle!",
|
|
5169
|
+
"[&_tbody_td]:border-r",
|
|
5170
|
+
"[&_tbody_td]:border-border",
|
|
5171
|
+
"[&_tbody_td:last-child]:border-r-0",
|
|
5172
|
+
"[&_thead_th]:border-r",
|
|
5173
|
+
"[&_thead_th]:border-border",
|
|
5174
|
+
"[&_thead_th:last-child]:border-r-0"
|
|
5175
|
+
].join(" ");
|
|
5176
|
+
|
|
5158
5177
|
// src/enumLabels.ts
|
|
5159
5178
|
function exhaustiveValuesOf() {
|
|
5160
5179
|
return function(values) {
|
|
@@ -6145,7 +6164,7 @@ function SourceArchivedValue({ state }) {
|
|
|
6145
6164
|
return /* @__PURE__ */ jsx26("span", { className: "text-xs italic text-muted-foreground", title: sourceArchivedSentence(state), "data-records-source-archived": state.field_id ?? "", children: SOURCE_ARCHIVED_WORDS });
|
|
6146
6165
|
}
|
|
6147
6166
|
var ABSENCE_WORDS = ABSENCE_WORD_LABEL;
|
|
6148
|
-
function renderValue(field2, value, document2, labels, stillWaitingFor) {
|
|
6167
|
+
function renderValue(field2, value, document2, labels, stillWaitingFor, look) {
|
|
6149
6168
|
const archivedSource = sourceArchivedOf2(value);
|
|
6150
6169
|
if (archivedSource) return /* @__PURE__ */ jsx26(SourceArchivedValue, { state: archivedSource });
|
|
6151
6170
|
const envelope = envelopeFor(document2, field2.key);
|
|
@@ -6165,6 +6184,7 @@ function renderValue(field2, value, document2, labels, stillWaitingFor) {
|
|
|
6165
6184
|
if (computed?.why) {
|
|
6166
6185
|
return /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground", title: computed.why, "data-records-empty-why": computed.kind, children: "\u2014" });
|
|
6167
6186
|
}
|
|
6187
|
+
if (look?.blankEmpty) return null;
|
|
6168
6188
|
return /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
6169
6189
|
}
|
|
6170
6190
|
if (isSignatureField(field2)) return /* @__PURE__ */ jsx26(SignatureValue, { value, fieldKey: field2.key, document: document2 });
|
|
@@ -6180,8 +6200,8 @@ function renderValue(field2, value, document2, labels, stillWaitingFor) {
|
|
|
6180
6200
|
if (kv) return /* @__PURE__ */ jsx26(KindValueCell, { kv, where: "cell", title: field2.label });
|
|
6181
6201
|
const chosen = kind === "select" || kind === "multi_select";
|
|
6182
6202
|
const chipOf = (item) => {
|
|
6183
|
-
const
|
|
6184
|
-
return { className:
|
|
6203
|
+
const chipLook = choiceChipLookOf(field2, item, scalarText(field2, item, labels));
|
|
6204
|
+
return { className: chipLook.className, tinted: chipLook.color !== null, dot: SWATCH_CLASS[chipLook.color ?? "gray"] };
|
|
6185
6205
|
};
|
|
6186
6206
|
if (chosen) {
|
|
6187
6207
|
const items = Array.isArray(value) ? value : [value];
|
|
@@ -6195,6 +6215,7 @@ function renderValue(field2, value, document2, labels, stillWaitingFor) {
|
|
|
6195
6215
|
"data-records-choice-chip": "",
|
|
6196
6216
|
...chip.tinted ? { "data-records-choice-tint": "" } : {},
|
|
6197
6217
|
children: [
|
|
6218
|
+
look?.choiceDot ? /* @__PURE__ */ jsx26("span", { "aria-hidden": "true", "data-records-choice-dot": "", className: cn17("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
|
|
6198
6219
|
statusMark(field2, item, Array.isArray(value) ? void 0 : document2),
|
|
6199
6220
|
scalarText(field2, item, labels, Array.isArray(value) ? void 0 : stillWaitingFor)
|
|
6200
6221
|
]
|
|
@@ -6306,6 +6327,7 @@ function RecordValue({
|
|
|
6306
6327
|
const ui = useRecordsUi();
|
|
6307
6328
|
const labels = useRecordLabels(ONE_FIELD_ARRAY_CACHE(field2));
|
|
6308
6329
|
const stillWaitingFor = useLabelWait(field2);
|
|
6330
|
+
const embeddedLook = useEmbeddedLook();
|
|
6309
6331
|
if (withheld && (value === null || value === void 0)) return /* @__PURE__ */ jsx26(WithheldValue, { field: field2, notice: withheld });
|
|
6310
6332
|
if (value === null || value === void 0) {
|
|
6311
6333
|
const failed = workedOutErrorFor(document2, field2.key);
|
|
@@ -6317,7 +6339,7 @@ function RecordValue({
|
|
|
6317
6339
|
}
|
|
6318
6340
|
const archivedSource = sourceArchivedOf2(value);
|
|
6319
6341
|
if (archivedSource) return /* @__PURE__ */ jsx26(SourceArchivedValue, { state: archivedSource });
|
|
6320
|
-
if (formulaHasNothingToWorkOn(field2, document2)) return /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
6342
|
+
if (formulaHasNothingToWorkOn(field2, document2)) return embeddedLook?.blankEmpty ? null : /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
6321
6343
|
if (value !== null && value !== void 0 && value !== "" && !envelopeFor(document2, field2.key)?.absent) {
|
|
6322
6344
|
const newer = newerKindValue(field2, value, { inCell });
|
|
6323
6345
|
if (newer !== void 0) return /* @__PURE__ */ jsx26(Fragment6, { children: newer });
|
|
@@ -6345,10 +6367,11 @@ function RecordValue({
|
|
|
6345
6367
|
}
|
|
6346
6368
|
}
|
|
6347
6369
|
const shown4 = format ?? formatForField(field2);
|
|
6348
|
-
const
|
|
6370
|
+
const shape = shown4 && (shown4.id === "date" || shown4.id === "datetime") && isDateField(field2) ? dateFormatFor(field2, value) : void 0;
|
|
6371
|
+
const dated = shape ? { ...shape, ...shown4?.options ? { options: shown4.options } : {} } : void 0;
|
|
6349
6372
|
const formatted = shown4 ? formatColumnValue({ format: dated ?? shown4 }, value) : null;
|
|
6350
6373
|
if (formatted) return /* @__PURE__ */ jsx26(FormattedValue, { value, format: dated ?? shown4 });
|
|
6351
|
-
return /* @__PURE__ */ jsx26(Fragment6, { children: renderValue(field2, value, document2, labels, stillWaitingFor) });
|
|
6374
|
+
return /* @__PURE__ */ jsx26(Fragment6, { children: renderValue(field2, value, document2, labels, stillWaitingFor, embeddedLook) });
|
|
6352
6375
|
}
|
|
6353
6376
|
var ONE_FIELD_ARRAYS = /* @__PURE__ */ new WeakMap();
|
|
6354
6377
|
function ONE_FIELD_ARRAY_CACHE(field2) {
|
|
@@ -8766,7 +8789,7 @@ import {
|
|
|
8766
8789
|
SelectValue as SelectValue5,
|
|
8767
8790
|
cn as cn21
|
|
8768
8791
|
} from "@ai-matrx/design-system";
|
|
8769
|
-
import { STYLE_COLORS as STYLE_COLORS3, STYLE_COLOR_LABELS, SWATCH_CLASS } from "@ai-matrx/design-system/data-table";
|
|
8792
|
+
import { STYLE_COLORS as STYLE_COLORS3, STYLE_COLOR_LABELS, SWATCH_CLASS as SWATCH_CLASS2 } from "@ai-matrx/design-system/data-table";
|
|
8770
8793
|
import { Fragment as Fragment9, jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
8771
8794
|
var rowSeed = 0;
|
|
8772
8795
|
var nextRow = () => `new-${rowSeed += 1}`;
|
|
@@ -8989,7 +9012,7 @@ function ChoiceSwatch({ words: words2, color, onColor }) {
|
|
|
8989
9012
|
"data-records-choice-swatch": color ?? "none",
|
|
8990
9013
|
className: cn21(
|
|
8991
9014
|
"h-4 w-4 shrink-0 rounded-full",
|
|
8992
|
-
color ?
|
|
9015
|
+
color ? SWATCH_CLASS2[color] : "border border-border bg-background"
|
|
8993
9016
|
)
|
|
8994
9017
|
}
|
|
8995
9018
|
) }),
|
|
@@ -9016,7 +9039,7 @@ function ChoiceSwatch({ words: words2, color, onColor }) {
|
|
|
9016
9039
|
title: STYLE_COLOR_LABELS[c],
|
|
9017
9040
|
"data-records-choice-color": `${words2}:${c}`,
|
|
9018
9041
|
onClick: () => pick(c),
|
|
9019
|
-
className: cn21("h-5 w-5 rounded-full",
|
|
9042
|
+
className: cn21("h-5 w-5 rounded-full", SWATCH_CLASS2[c], color === c && "ring-2 ring-ring ring-offset-1")
|
|
9020
9043
|
},
|
|
9021
9044
|
c
|
|
9022
9045
|
))
|
|
@@ -18417,12 +18440,12 @@ function shapeTextOfNode(node) {
|
|
|
18417
18440
|
}
|
|
18418
18441
|
|
|
18419
18442
|
// src/toolbarSlot.tsx
|
|
18420
|
-
import { createContext as
|
|
18443
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
18421
18444
|
import { createPortal } from "react-dom";
|
|
18422
18445
|
import { Fragment as Fragment18, jsx as jsx58 } from "react/jsx-runtime";
|
|
18423
|
-
var TableToolbarSlotContext =
|
|
18446
|
+
var TableToolbarSlotContext = createContext5(void 0);
|
|
18424
18447
|
function useTableToolbarSlot() {
|
|
18425
|
-
return
|
|
18448
|
+
return useContext5(TableToolbarSlotContext);
|
|
18426
18449
|
}
|
|
18427
18450
|
function InTableToolbar({ children }) {
|
|
18428
18451
|
const slot = useTableToolbarSlot();
|
|
@@ -18430,13 +18453,13 @@ function InTableToolbar({ children }) {
|
|
|
18430
18453
|
if (slot === null) return null;
|
|
18431
18454
|
return createPortal(children, slot);
|
|
18432
18455
|
}
|
|
18433
|
-
var TableToolbarFoldContext =
|
|
18456
|
+
var TableToolbarFoldContext = createContext5(0);
|
|
18434
18457
|
function useTableToolbarFold() {
|
|
18435
|
-
return
|
|
18458
|
+
return useContext5(TableToolbarFoldContext);
|
|
18436
18459
|
}
|
|
18437
|
-
var TableToolbarSheetExtrasContext =
|
|
18460
|
+
var TableToolbarSheetExtrasContext = createContext5(void 0);
|
|
18438
18461
|
function useTableToolbarSheetExtras() {
|
|
18439
|
-
return
|
|
18462
|
+
return useContext5(TableToolbarSheetExtrasContext);
|
|
18440
18463
|
}
|
|
18441
18464
|
|
|
18442
18465
|
// src/GridLayoutMenu.tsx
|
|
@@ -20934,7 +20957,7 @@ function HandOrderDialog({
|
|
|
20934
20957
|
}
|
|
20935
20958
|
|
|
20936
20959
|
// src/viewAddress.ts
|
|
20937
|
-
import { createContext as
|
|
20960
|
+
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
20938
20961
|
var VIEW_ADDRESS_KEYS = ["sort", "cf", "q", "hide", "page"];
|
|
20939
20962
|
function isViewAddressEmpty(state) {
|
|
20940
20963
|
if (!state) return true;
|
|
@@ -20988,8 +21011,8 @@ function viewAddressFromParams(get) {
|
|
|
20988
21011
|
function sameViewAddress(a, b) {
|
|
20989
21012
|
return JSON.stringify(viewAddressToParams(a)) === JSON.stringify(viewAddressToParams(b));
|
|
20990
21013
|
}
|
|
20991
|
-
var ViewAddressContext =
|
|
20992
|
-
var useViewAddress = () =>
|
|
21014
|
+
var ViewAddressContext = createContext6(null);
|
|
21015
|
+
var useViewAddress = () => useContext6(ViewAddressContext);
|
|
20993
21016
|
|
|
20994
21017
|
// src/Grid.tsx
|
|
20995
21018
|
import { Fragment as Fragment23, jsx as jsx68, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
@@ -22366,6 +22389,8 @@ function GridBody({
|
|
|
22366
22389
|
const tableToolbar = useMemo35(
|
|
22367
22390
|
() => ({
|
|
22368
22391
|
search: !embedded,
|
|
22392
|
+
// The host (Spaces) has its own Properties menu: an embedded table draws no Columns button.
|
|
22393
|
+
...embedded ? { columns: false } : {},
|
|
22369
22394
|
searchPlaceholder: "Search records",
|
|
22370
22395
|
/*
|
|
22371
22396
|
* A PHONE (tranche 6o): search and the one Tools button sit side by side at the START of
|
|
@@ -22753,7 +22778,7 @@ function GridBody({
|
|
|
22753
22778
|
"data-records-grid-wrap": look.wrap ? "on" : "off",
|
|
22754
22779
|
"data-records-grid-fit": look.fit,
|
|
22755
22780
|
onPasteCapture: takeEmptyTablePaste,
|
|
22756
|
-
children: /* @__PURE__ */ jsx68(
|
|
22781
|
+
children: /* @__PURE__ */ jsx68(EmbeddedLookProvider, { value: embedded ? EMBEDDED_LOOK : null, children: /* @__PURE__ */ jsx68(
|
|
22757
22782
|
MatrxDataTable,
|
|
22758
22783
|
{
|
|
22759
22784
|
...fills ? { className: "min-h-0 flex-1" } : {},
|
|
@@ -22773,7 +22798,8 @@ function GridBody({
|
|
|
22773
22798
|
...embedded ? { appearance: "embedded" } : {},
|
|
22774
22799
|
tableClassName: cn34(
|
|
22775
22800
|
!look.wrap && "[&_tbody_td]:max-w-[28rem] [&_tbody_td]:overflow-hidden [&_tbody_td]:text-ellipsis [&_tbody_td]:whitespace-nowrap! [&_tbody_td_*]:whitespace-nowrap!",
|
|
22776
|
-
look.fit === "scroll" && "sm:[&>table]:w-max! sm:[&>table]:max-w-none! sm:[&>table]:min-w-full!"
|
|
22801
|
+
look.fit === "scroll" && "sm:[&>table]:w-max! sm:[&>table]:max-w-none! sm:[&>table]:min-w-full!",
|
|
22802
|
+
embedded && EMBEDDED_TABLE_CLASS
|
|
22777
22803
|
),
|
|
22778
22804
|
footerRows,
|
|
22779
22805
|
...embedded ? { copy: false } : copyConfig ? { copy: copyConfig } : {},
|
|
@@ -22833,7 +22859,7 @@ function GridBody({
|
|
|
22833
22859
|
toolbar: tableToolbar
|
|
22834
22860
|
},
|
|
22835
22861
|
`records-grid-${tableId}:${openingKey}`
|
|
22836
|
-
)
|
|
22862
|
+
) })
|
|
22837
22863
|
}
|
|
22838
22864
|
),
|
|
22839
22865
|
summaries.error ? /* @__PURE__ */ jsx68(RefusalNotice, { error: summaries.error }) : null,
|
|
@@ -27941,7 +27967,7 @@ import { Button as Button67, Select as Select16, SelectContent as SelectContent1
|
|
|
27941
27967
|
import {
|
|
27942
27968
|
CHOICE_CHIP_CLASS as CHOICE_CHIP_CLASS4,
|
|
27943
27969
|
EMPTY_TABLE_STYLE as EMPTY_TABLE_STYLE2,
|
|
27944
|
-
SWATCH_CLASS as
|
|
27970
|
+
SWATCH_CLASS as SWATCH_CLASS3,
|
|
27945
27971
|
resolveRowColor as resolveRowColor4,
|
|
27946
27972
|
ROW_TINT_CLASS as ROW_TINT_CLASS3
|
|
27947
27973
|
} from "@ai-matrx/design-system/data-table";
|
|
@@ -31985,7 +32011,7 @@ function Kanban({
|
|
|
31985
32011
|
void move(card, name, to);
|
|
31986
32012
|
},
|
|
31987
32013
|
children: [
|
|
31988
|
-
columnColor(name) ? /* @__PURE__ */ jsx105("span", { "aria-hidden": "true", "data-card-accent": columnColor(name), className: cn53("absolute inset-y-0.5 left-0 w-1 rounded",
|
|
32014
|
+
columnColor(name) ? /* @__PURE__ */ jsx105("span", { "aria-hidden": "true", "data-card-accent": columnColor(name), className: cn53("absolute inset-y-0.5 left-0 w-1 rounded", SWATCH_CLASS3[columnColor(name)]) }) : null,
|
|
31989
32015
|
/* @__PURE__ */ jsx105(
|
|
31990
32016
|
RecordActionMenu,
|
|
31991
32017
|
{
|
|
@@ -35920,7 +35946,7 @@ import { BasicInput as BasicInput24, Button as Button78, cn as cn66 } from "@ai-
|
|
|
35920
35946
|
// src/AccentSwatches.tsx
|
|
35921
35947
|
import { PORTAL_ACCENTS } from "@ai-matrx/records";
|
|
35922
35948
|
import { cn as cn64 } from "@ai-matrx/design-system";
|
|
35923
|
-
import { STYLE_COLOR_LABELS as STYLE_COLOR_LABELS3, SWATCH_CLASS as
|
|
35949
|
+
import { STYLE_COLOR_LABELS as STYLE_COLOR_LABELS3, SWATCH_CLASS as SWATCH_CLASS4 } from "@ai-matrx/design-system/data-table";
|
|
35924
35950
|
import { jsx as jsx116, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
35925
35951
|
function AccentSwatches({ value, onChange, options = PORTAL_ACCENTS, noneLabel = "App colour" }) {
|
|
35926
35952
|
return /* @__PURE__ */ jsxs105("div", { className: "flex flex-wrap gap-1.5", role: "radiogroup", "aria-label": "Colour", children: [
|
|
@@ -35947,7 +35973,7 @@ function AccentSwatches({ value, onChange, options = PORTAL_ACCENTS, noneLabel =
|
|
|
35947
35973
|
"aria-label": STYLE_COLOR_LABELS3[c],
|
|
35948
35974
|
title: STYLE_COLOR_LABELS3[c],
|
|
35949
35975
|
onClick: () => onChange(c),
|
|
35950
|
-
className: cn64("h-7 w-7 rounded-full border-2",
|
|
35976
|
+
className: cn64("h-7 w-7 rounded-full border-2", SWATCH_CLASS4[c], value === c ? "border-foreground" : "border-transparent")
|
|
35951
35977
|
},
|
|
35952
35978
|
c
|
|
35953
35979
|
))
|
|
@@ -36939,7 +36965,7 @@ function Invite({ card, onInvited }) {
|
|
|
36939
36965
|
|
|
36940
36966
|
// src/FormLookFrame.tsx
|
|
36941
36967
|
import { cn as cn68 } from "@ai-matrx/design-system";
|
|
36942
|
-
import { SWATCH_CLASS as
|
|
36968
|
+
import { SWATCH_CLASS as SWATCH_CLASS5 } from "@ai-matrx/design-system/data-table";
|
|
36943
36969
|
import { jsx as jsx120, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
36944
36970
|
var ACCENT_PRIMARY = {
|
|
36945
36971
|
slate: "215 19% 35%",
|
|
@@ -36958,15 +36984,15 @@ function safeHref(url) {
|
|
|
36958
36984
|
return null;
|
|
36959
36985
|
}
|
|
36960
36986
|
function formLookView(style, fallbackName) {
|
|
36961
|
-
const accent = style?.accent && style.accent in
|
|
36987
|
+
const accent = style?.accent && style.accent in SWATCH_CLASS5 ? style.accent : null;
|
|
36962
36988
|
const https = (u) => typeof u === "string" && /^https:\/\//i.test(u) ? u : null;
|
|
36963
36989
|
const links = Array.isArray(style?.footer_links) ? style.footer_links : [];
|
|
36964
36990
|
return {
|
|
36965
36991
|
name: (style?.display_name ?? "").trim() || fallbackName.trim() || "Form",
|
|
36966
36992
|
logoUrl: https(style?.logo_url),
|
|
36967
36993
|
coverUrl: https(style?.cover_url),
|
|
36968
|
-
bandClass: accent ?
|
|
36969
|
-
monogramClass: accent ? `${
|
|
36994
|
+
bandClass: accent ? SWATCH_CLASS5[accent] : null,
|
|
36995
|
+
monogramClass: accent ? `${SWATCH_CLASS5[accent]} text-white` : "bg-primary text-primary-foreground",
|
|
36970
36996
|
primaryVars: accent && ACCENT_PRIMARY[accent] ? {
|
|
36971
36997
|
"--primary": ACCENT_PRIMARY[accent],
|
|
36972
36998
|
"--primary-foreground": "0 0% 100%",
|