@krak-stack/registry 0.10.18 → 0.10.20
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 +31 -0
- package/README.md +18 -0
- package/dist/components/ui/code-block.js +7 -7
- package/dist/components/ui/copy-button.js +7 -7
- package/dist/components/ui/copy-value.d.ts +4 -1
- package/dist/components/ui/copy-value.js +49 -16
- package/dist/components/ui/data-table.d.ts +3 -3
- package/dist/components/ui/data-table.js +23 -17
- package/dist/components/ui/editing-locale-switcher.js +7 -7
- package/dist/components/ui/effect-form.js +8 -8
- package/dist/components/ui/email-composer.js +871 -0
- package/dist/components/ui/email-editor.d.ts +3 -1
- package/dist/components/ui/email-editor.js +294 -471
- package/dist/components/ui/error-component.js +7 -7
- package/dist/components/ui/form.d.ts +7 -7
- package/dist/components/ui/form.js +18 -14
- package/dist/components/ui/icon-input.js +1 -1
- package/dist/components/ui/map-menu.d.ts +1 -1
- package/dist/components/ui/map-menu.js +183 -60
- package/dist/components/ui/pagination.js +7 -7
- package/dist/components/ui/phone-number-input.js +1 -1
- package/dist/components/ui/rich-text-editor.d.ts +15 -13
- package/dist/components/ui/rich-text-editor.js +280 -661
- package/dist/components/ui/select-with-custom-input.js +7 -7
- package/dist/components/ui/select.js +159 -0
- package/dist/components/ui/timezone-select.js +1 -1
- package/dist/components/ui/virtualized-combobox.js +1 -1
- package/dist/lib/docs.js +7 -7
- package/dist/lib/email-composer/index.js +110 -0
- package/dist/lib/email-composer/schema.js +13 -0
- package/dist/lib/email-document/legacy-rich-text/editor.d.ts +70 -0
- package/dist/lib/email-document/legacy-rich-text/schema.d.ts +65 -0
- package/dist/lib/email-document/legacy-rich-text/tiptap.d.ts +39 -0
- package/dist/lib/email-document/model.d.ts +1 -1
- package/dist/lib/email-document/model.js +2 -2
- package/dist/lib/email-document/render.js +2 -2
- package/dist/lib/email-document/schema.js +1 -1
- package/dist/lib/rich-text/model.js +79 -111
- package/dist/lib/rich-text/schema.d.ts +5 -55
- package/dist/lib/rich-text/schema.js +17 -36
- package/dist/lib/rich-text/tiptap.d.ts +12 -0
- package/dist/services/agent/client/index.js +7 -7
- package/dist/services/events/client/audit-log-table.js +23 -17
- package/dist/services/webhooks/client/delivery-table.js +30 -24
- package/package.json +24 -1
- package/dist/lib/rich-text/dom.d.ts +0 -40
- /package/dist/lib/{rich-text → email-document/legacy-rich-text}/model.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @krak-stack/registry
|
|
2
2
|
|
|
3
|
+
## 0.10.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 18f5e37: Anchor select menus to their trigger instead of overlapping the selected option.
|
|
8
|
+
Keep narrow menus at trigger width and constrain wider menus to the available
|
|
9
|
+
viewport. Apply these defaults to forms, tables, pagination and editing-locale
|
|
10
|
+
selectors through a KrakStack-owned Select registry item; preserve positioning overrides.
|
|
11
|
+
- 08b3ce9: Add a 50 Km map radius preset and use the shared KrakStack Select for radius
|
|
12
|
+
selection. Preserve numeric callbacks, custom radius options, point mode and
|
|
13
|
+
inline/dialog behavior. Radius labels consistently use “Km”.
|
|
14
|
+
- 805d5bd: Validate form field error messages, preserve readonly combobox option types, and
|
|
15
|
+
handle clipboard failures from synchronous button callbacks. Tighten table view
|
|
16
|
+
selection at the Base UI boundary.
|
|
17
|
+
- f382af2: Use native Tiptap JSONContent and standard Tiptap extensions in RichTextEditor, without the KrakStack versioned rich-text format or conversion layer. This changes the value/onChange contract: old version 1 documents are not accepted or silently migrated.
|
|
18
|
+
|
|
19
|
+
Fix caret placement inside links and apply URL edits or removal to the full existing link.
|
|
20
|
+
|
|
21
|
+
Add Email Composer: a document-style editor using the shared RichTextEditor surface, @react-email/editor extensions, and continuous HTML/plain-text previews with escaped variable samples instead of an export button. Keep programmatic React Email export available. Deprecate the drag-and-drop Email Editor, retaining its frozen legacy document support only for existing integrations.
|
|
22
|
+
|
|
23
|
+
- 2aeb055: Add `features.virtualization.scroll: "internal"` to fill a height-constrained flex column while keeping the toolbar and pagination outside the internal scroll area. `"page"` still scrolls with the browser, and `"table"` retains the existing height cap.
|
|
24
|
+
|
|
25
|
+
## 0.10.19
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Add optional `showLabel` and `icon` props to `CopyValue` for a visible input label and a leading decorative icon.
|
|
30
|
+
|
|
3
31
|
## 0.10.18
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -48,14 +76,17 @@
|
|
|
48
76
|
- Place table search alongside the menubar on wider screens, show an icon-only Filters trigger on mobile, and keep internal scroll targets clear of sticky column headers.
|
|
49
77
|
|
|
50
78
|
Match the menubar border and shadow to the search input.
|
|
79
|
+
|
|
51
80
|
- Allow virtualized tables to use page scrolling instead of an internal vertical viewport.
|
|
52
81
|
|
|
53
82
|
Keep list-cell menus from locking page scrolling and disturbing virtualized rows.
|
|
83
|
+
|
|
54
84
|
- Keep table toolbar menus non-modal so opening them does not lock page scrolling.
|
|
55
85
|
- Add opt-in DataTable row virtualization for large flat tables.
|
|
56
86
|
- Make pagination opt-in. Paginated tables default to 100 rows and offer page sizes of 20, 50, and 100.
|
|
57
87
|
|
|
58
88
|
Automatically virtualize tables with at least 100 displayed rows unless `virtualization` is set to `false`.
|
|
89
|
+
|
|
59
90
|
- Virtualize expanded group rows, place the internal scrollbar below the header, and keep the bottom divider attached to the sticky header.
|
|
60
91
|
|
|
61
92
|
## 0.10.11
|
package/README.md
CHANGED
|
@@ -18,6 +18,24 @@ Les composants animés nécessitent la dépendance paire facultative `motion` ;
|
|
|
18
18
|
champ de numéro de téléphone nécessite `libphonenumber-js`. Installez ces paquets
|
|
19
19
|
uniquement pour les composants concernés. Le menu de notifications n'en a pas besoin.
|
|
20
20
|
|
|
21
|
+
## Select popup positioning
|
|
22
|
+
|
|
23
|
+
Use `@krak-stack/registry/select`, or install `@krak-stack/select` with shadcn
|
|
24
|
+
and import from `@/components/ui/select`. This shared Base UI composition serves
|
|
25
|
+
KrakStack forms/tables and consumer applications without product copy or policy.
|
|
26
|
+
Menus default to start alignment, trigger width, available viewport bounds and
|
|
27
|
+
`alignItemWithTrigger={false}`. Existing props can override those defaults.
|
|
28
|
+
Update this registry item rather than bare shadcn `select`; existing consumers
|
|
29
|
+
can update Select alone without upgrading tables or forms.
|
|
30
|
+
|
|
31
|
+
## Map radius selection
|
|
32
|
+
|
|
33
|
+
Map Menu uses the shared KrakStack Select in inline and dialog presentations.
|
|
34
|
+
Default presets are 1, 2, 5, 10, 20, 40, 50, 60, 80, 100, 250 and 500 Km.
|
|
35
|
+
`radiusOptions` still overrides presets; values and callbacks remain numeric.
|
|
36
|
+
The radius popup exposes `data-map-menu-radius-popup` for host styling outside
|
|
37
|
+
the map root. Point mode has no radius control.
|
|
38
|
+
|
|
21
39
|
## Shared integration documentation
|
|
22
40
|
|
|
23
41
|
Generate API, OAuth MCP, and webhook guides in a Bun server loader:
|
|
@@ -92,16 +92,16 @@ function CopyButton({
|
|
|
92
92
|
clearTimeout(copyTimeout.current);
|
|
93
93
|
copyTimeout.current = setTimeout(() => setCopyState("idle"), resetDelay);
|
|
94
94
|
};
|
|
95
|
-
const copy =
|
|
96
|
-
|
|
97
|
-
await navigator.clipboard.writeText(value);
|
|
95
|
+
const copy = () => {
|
|
96
|
+
Promise.resolve().then(() => navigator.clipboard.writeText(value)).then(() => {
|
|
98
97
|
setCopyState("copied");
|
|
99
98
|
onCopied?.();
|
|
100
|
-
|
|
99
|
+
resetCopyState();
|
|
100
|
+
}).catch((cause) => {
|
|
101
101
|
setCopyState("failed");
|
|
102
|
-
onCopyError?.(
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
onCopyError?.(cause instanceof Error ? cause : new Error(labels.copyFailed, { cause }));
|
|
103
|
+
resetCopyState();
|
|
104
|
+
});
|
|
105
105
|
};
|
|
106
106
|
const status = copyState === "copied" ? valueDescription ? `${labels.copied}: ${valueDescription}` : labels.copied : copyState === "failed" ? valueDescription ? `${labels.copyFailed}: ${valueDescription}` : labels.copyFailed : "";
|
|
107
107
|
return /* @__PURE__ */ jsxs(Button, {
|
|
@@ -92,16 +92,16 @@ function CopyButton({
|
|
|
92
92
|
clearTimeout(copyTimeout.current);
|
|
93
93
|
copyTimeout.current = setTimeout(() => setCopyState("idle"), resetDelay);
|
|
94
94
|
};
|
|
95
|
-
const copy =
|
|
96
|
-
|
|
97
|
-
await navigator.clipboard.writeText(value);
|
|
95
|
+
const copy = () => {
|
|
96
|
+
Promise.resolve().then(() => navigator.clipboard.writeText(value)).then(() => {
|
|
98
97
|
setCopyState("copied");
|
|
99
98
|
onCopied?.();
|
|
100
|
-
|
|
99
|
+
resetCopyState();
|
|
100
|
+
}).catch((cause) => {
|
|
101
101
|
setCopyState("failed");
|
|
102
|
-
onCopyError?.(
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
onCopyError?.(cause instanceof Error ? cause : new Error(labels.copyFailed, { cause }));
|
|
103
|
+
resetCopyState();
|
|
104
|
+
});
|
|
105
105
|
};
|
|
106
106
|
const status = copyState === "copied" ? valueDescription ? `${labels.copied}: ${valueDescription}` : labels.copied : copyState === "failed" ? valueDescription ? `${labels.copyFailed}: ${valueDescription}` : labels.copyFailed : "";
|
|
107
107
|
return /* @__PURE__ */ jsxs(Button, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
1
2
|
import { type CopyButtonMessageTranslations } from "./copy-button.js";
|
|
2
3
|
export type CopyValueMessages = {
|
|
3
4
|
show: string;
|
|
@@ -7,6 +8,8 @@ export type CopyValueMessages = {
|
|
|
7
8
|
export type CopyValueProps = {
|
|
8
9
|
value: string;
|
|
9
10
|
label: string;
|
|
11
|
+
showLabel?: boolean;
|
|
12
|
+
icon?: LucideIcon;
|
|
10
13
|
secret?: boolean;
|
|
11
14
|
variant?: "outline" | "ghost";
|
|
12
15
|
disabled?: boolean;
|
|
@@ -18,4 +21,4 @@ export type CopyValueProps = {
|
|
|
18
21
|
copyMessages?: CopyButtonMessageTranslations;
|
|
19
22
|
};
|
|
20
23
|
/** Masking is presentation, not a security boundary. Never logs the value. */
|
|
21
|
-
export declare const CopyValue: ({ value, label, secret, variant, disabled, copyable, autoHideDelay, className, locale: override, messages, copyMessages, }: CopyValueProps) => import("react").JSX.Element;
|
|
24
|
+
export declare const CopyValue: ({ value, label, showLabel, icon: Icon, secret, variant, disabled, copyable, autoHideDelay, className, locale: override, messages, copyMessages, }: CopyValueProps) => import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// ../../src/components/ui/copy-value.tsx
|
|
2
2
|
import { Eye, EyeOff } from "lucide-react";
|
|
3
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
3
|
+
import { useEffect as useEffect2, useId, useState as useState2 } from "react";
|
|
4
4
|
|
|
5
5
|
// ../../src/components/ui/input-group.tsx
|
|
6
6
|
import { cva as cva2 } from "class-variance-authority";
|
|
@@ -188,16 +188,16 @@ function CopyButton({
|
|
|
188
188
|
clearTimeout(copyTimeout.current);
|
|
189
189
|
copyTimeout.current = setTimeout(() => setCopyState("idle"), resetDelay);
|
|
190
190
|
};
|
|
191
|
-
const copy =
|
|
192
|
-
|
|
193
|
-
await navigator.clipboard.writeText(value);
|
|
191
|
+
const copy = () => {
|
|
192
|
+
Promise.resolve().then(() => navigator.clipboard.writeText(value)).then(() => {
|
|
194
193
|
setCopyState("copied");
|
|
195
194
|
onCopied?.();
|
|
196
|
-
|
|
195
|
+
resetCopyState();
|
|
196
|
+
}).catch((cause) => {
|
|
197
197
|
setCopyState("failed");
|
|
198
|
-
onCopyError?.(
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
onCopyError?.(cause instanceof Error ? cause : new Error(labels.copyFailed, { cause }));
|
|
199
|
+
resetCopyState();
|
|
200
|
+
});
|
|
201
201
|
};
|
|
202
202
|
const status = copyState === "copied" ? valueDescription ? `${labels.copied}: ${valueDescription}` : labels.copied : copyState === "failed" ? valueDescription ? `${labels.copyFailed}: ${valueDescription}` : labels.copyFailed : "";
|
|
203
203
|
return /* @__PURE__ */ jsxs(Button, {
|
|
@@ -231,7 +231,20 @@ function CopyButton({
|
|
|
231
231
|
|
|
232
232
|
// ../../src/components/ui/copy-value.tsx
|
|
233
233
|
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
|
|
234
|
-
|
|
234
|
+
|
|
235
|
+
// ../../src/components/ui/label.tsx
|
|
236
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
237
|
+
"use client";
|
|
238
|
+
function Label({ className, ...props }) {
|
|
239
|
+
return /* @__PURE__ */ jsx5("label", {
|
|
240
|
+
"data-slot": "label",
|
|
241
|
+
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
242
|
+
...props
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// ../../src/components/ui/copy-value.tsx
|
|
247
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
235
248
|
var labels = {
|
|
236
249
|
en: { show: "Show", hide: "Hide", hidden: "Hidden value" },
|
|
237
250
|
fr: { show: "Afficher", hide: "Masquer", hidden: "Valeur masquée" }
|
|
@@ -239,6 +252,8 @@ var labels = {
|
|
|
239
252
|
var CopyValue = ({
|
|
240
253
|
value,
|
|
241
254
|
label,
|
|
255
|
+
showLabel = false,
|
|
256
|
+
icon: Icon,
|
|
242
257
|
secret = false,
|
|
243
258
|
variant = "outline",
|
|
244
259
|
disabled,
|
|
@@ -249,6 +264,7 @@ var CopyValue = ({
|
|
|
249
264
|
messages,
|
|
250
265
|
copyMessages
|
|
251
266
|
}) => {
|
|
267
|
+
const inputId = useId();
|
|
252
268
|
const locale = useKrakstackLocale2(override);
|
|
253
269
|
const copy = {
|
|
254
270
|
...locale.startsWith("fr") ? labels.fr : labels.en,
|
|
@@ -268,12 +284,13 @@ var CopyValue = ({
|
|
|
268
284
|
const timer = setTimeout(() => setRevealedValue(null), autoHideDelay);
|
|
269
285
|
return () => clearTimeout(timer);
|
|
270
286
|
}, [revealed, autoHideDelay, value]);
|
|
271
|
-
|
|
287
|
+
const input = /* @__PURE__ */ jsxs2(InputGroup, {
|
|
272
288
|
className: cn("min-w-0", variant === "ghost" && "border-0 bg-transparent shadow-none dark:bg-transparent", className),
|
|
273
289
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ jsx6(InputGroupInput, {
|
|
291
|
+
id: showLabel ? inputId : undefined,
|
|
275
292
|
className: variant === "ghost" ? "pl-0 font-mono" : undefined,
|
|
276
|
-
"aria-label": secret && !revealed ? `${label}: ${copy.hidden}` : label,
|
|
293
|
+
"aria-label": secret && !revealed ? `${label}: ${copy.hidden}` : showLabel ? undefined : label,
|
|
277
294
|
value,
|
|
278
295
|
type: secret && !revealed ? "password" : "text",
|
|
279
296
|
autoComplete: secret ? "off" : undefined,
|
|
@@ -281,11 +298,17 @@ var CopyValue = ({
|
|
|
281
298
|
disabled,
|
|
282
299
|
onFocus: (event) => event.currentTarget.select()
|
|
283
300
|
}),
|
|
301
|
+
Icon && /* @__PURE__ */ jsx6(InputGroupAddon, {
|
|
302
|
+
align: "inline-start",
|
|
303
|
+
children: /* @__PURE__ */ jsx6(Icon, {
|
|
304
|
+
"aria-hidden": "true"
|
|
305
|
+
})
|
|
306
|
+
}),
|
|
284
307
|
/* @__PURE__ */ jsxs2(InputGroupAddon, {
|
|
285
308
|
align: "inline-end",
|
|
286
309
|
className: "gap-0",
|
|
287
310
|
children: [
|
|
288
|
-
secret ? /* @__PURE__ */
|
|
311
|
+
secret ? /* @__PURE__ */ jsx6(InputGroupButton, {
|
|
289
312
|
type: "button",
|
|
290
313
|
size: "icon-sm",
|
|
291
314
|
variant: "ghost",
|
|
@@ -293,13 +316,13 @@ var CopyValue = ({
|
|
|
293
316
|
"aria-label": `${revealed ? copy.hide : copy.show} ${label}`,
|
|
294
317
|
"aria-pressed": revealed,
|
|
295
318
|
onClick: () => setRevealedValue(revealed ? null : value),
|
|
296
|
-
children: revealed ? /* @__PURE__ */
|
|
319
|
+
children: revealed ? /* @__PURE__ */ jsx6(EyeOff, {
|
|
297
320
|
"aria-hidden": "true"
|
|
298
|
-
}) : /* @__PURE__ */
|
|
321
|
+
}) : /* @__PURE__ */ jsx6(Eye, {
|
|
299
322
|
"aria-hidden": "true"
|
|
300
323
|
})
|
|
301
324
|
}) : null,
|
|
302
|
-
copyable ? /* @__PURE__ */
|
|
325
|
+
copyable ? /* @__PURE__ */ jsx6(CopyButton, {
|
|
303
326
|
type: "button",
|
|
304
327
|
value,
|
|
305
328
|
valueDescription: label,
|
|
@@ -313,6 +336,16 @@ var CopyValue = ({
|
|
|
313
336
|
})
|
|
314
337
|
]
|
|
315
338
|
});
|
|
339
|
+
return showLabel ? /* @__PURE__ */ jsxs2("div", {
|
|
340
|
+
className: "flex min-w-0 flex-col gap-2",
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ jsx6(Label, {
|
|
343
|
+
htmlFor: inputId,
|
|
344
|
+
children: label
|
|
345
|
+
}),
|
|
346
|
+
input
|
|
347
|
+
]
|
|
348
|
+
}) : input;
|
|
316
349
|
};
|
|
317
350
|
export {
|
|
318
351
|
CopyValue
|
|
@@ -265,9 +265,9 @@ export type DataTablePaginationFeature = false | {
|
|
|
265
265
|
pageSizes?: readonly number[];
|
|
266
266
|
};
|
|
267
267
|
export interface DataTableVirtualizationOptions {
|
|
268
|
-
/**
|
|
269
|
-
scroll?: "table" | "page";
|
|
270
|
-
/** Maximum
|
|
268
|
+
/** "page" uses window scrolling; "internal" fills a height-constrained flex column. Defaults to "table" (capped viewport). */
|
|
269
|
+
scroll?: "table" | "internal" | "page";
|
|
270
|
+
/** Maximum viewport height in pixels for "table" mode only. Defaults to 480. */
|
|
271
271
|
height?: number;
|
|
272
272
|
/** Initial row height in pixels, before measuring. Defaults to 64. */
|
|
273
273
|
estimateRowHeight?: number;
|
|
@@ -410,7 +410,7 @@ function SelectTrigger({
|
|
|
410
410
|
return /* @__PURE__ */ jsxs3(SelectPrimitive.Trigger, {
|
|
411
411
|
"data-slot": "select-trigger",
|
|
412
412
|
"data-size": size,
|
|
413
|
-
className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border
|
|
413
|
+
className: cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
414
414
|
...props,
|
|
415
415
|
children: [
|
|
416
416
|
children,
|
|
@@ -427,9 +427,9 @@ function SelectContent({
|
|
|
427
427
|
children,
|
|
428
428
|
side = "bottom",
|
|
429
429
|
sideOffset = 4,
|
|
430
|
-
align = "
|
|
430
|
+
align = "start",
|
|
431
431
|
alignOffset = 0,
|
|
432
|
-
alignItemWithTrigger =
|
|
432
|
+
alignItemWithTrigger = false,
|
|
433
433
|
...props
|
|
434
434
|
}) {
|
|
435
435
|
return /* @__PURE__ */ jsx8(SelectPrimitive.Portal, {
|
|
@@ -443,7 +443,7 @@ function SelectContent({
|
|
|
443
443
|
children: /* @__PURE__ */ jsxs3(SelectPrimitive.Popup, {
|
|
444
444
|
"data-slot": "select-content",
|
|
445
445
|
"data-align-trigger": alignItemWithTrigger,
|
|
446
|
-
className: cn("
|
|
446
|
+
className: cn("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none", className),
|
|
447
447
|
...props,
|
|
448
448
|
children: [
|
|
449
449
|
/* @__PURE__ */ jsx8(SelectScrollUpButton, {}),
|
|
@@ -463,7 +463,7 @@ function SelectItem({
|
|
|
463
463
|
}) {
|
|
464
464
|
return /* @__PURE__ */ jsxs3(SelectPrimitive.Item, {
|
|
465
465
|
"data-slot": "select-item",
|
|
466
|
-
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none
|
|
466
|
+
className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
467
467
|
...props,
|
|
468
468
|
children: [
|
|
469
469
|
/* @__PURE__ */ jsx8(SelectPrimitive.ItemText, {
|
|
@@ -487,7 +487,7 @@ function SelectScrollUpButton({
|
|
|
487
487
|
}) {
|
|
488
488
|
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollUpArrow, {
|
|
489
489
|
"data-slot": "select-scroll-up-button",
|
|
490
|
-
className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center
|
|
490
|
+
className: cn("bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
491
491
|
...props,
|
|
492
492
|
children: /* @__PURE__ */ jsx8(ChevronUpIcon, {})
|
|
493
493
|
});
|
|
@@ -498,7 +498,7 @@ function SelectScrollDownButton({
|
|
|
498
498
|
}) {
|
|
499
499
|
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollDownArrow, {
|
|
500
500
|
"data-slot": "select-scroll-down-button",
|
|
501
|
-
className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center
|
|
501
|
+
className: cn("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
502
502
|
...props,
|
|
503
503
|
children: /* @__PURE__ */ jsx8(ChevronDownIcon, {})
|
|
504
504
|
});
|
|
@@ -2139,7 +2139,7 @@ var DataTableToolbar = ({
|
|
|
2139
2139
|
}
|
|
2140
2140
|
};
|
|
2141
2141
|
return /* @__PURE__ */ jsxs9("div", {
|
|
2142
|
-
className: cn("grid min-w-0 items-center gap-2 pb-4", features.search !== false && "md:grid-cols-[minmax(12rem,1fr)_minmax(0,auto)]"),
|
|
2142
|
+
className: cn("grid min-w-0 shrink-0 items-center gap-2 pb-4", features.search !== false && "md:grid-cols-[minmax(12rem,1fr)_minmax(0,auto)]"),
|
|
2143
2143
|
children: [
|
|
2144
2144
|
features.search !== false ? /* @__PURE__ */ jsxs9("div", {
|
|
2145
2145
|
className: "relative min-w-0",
|
|
@@ -2801,9 +2801,13 @@ var ViewMenu = ({
|
|
|
2801
2801
|
}),
|
|
2802
2802
|
/* @__PURE__ */ jsx15(MenubarSeparator2, {}),
|
|
2803
2803
|
/* @__PURE__ */ jsxs9(MenubarRadioGroup, {
|
|
2804
|
-
onValueChange: (
|
|
2805
|
-
|
|
2806
|
-
|
|
2804
|
+
onValueChange: (input) => {
|
|
2805
|
+
const view = Schema2.decodeUnknownOption(DataTablePersistedUiStateSchema.fields.view)(input);
|
|
2806
|
+
if (Option2.isSome(view)) {
|
|
2807
|
+
changeState(setStore, (state) => ({
|
|
2808
|
+
...state,
|
|
2809
|
+
view: view.value
|
|
2810
|
+
}));
|
|
2807
2811
|
}
|
|
2808
2812
|
},
|
|
2809
2813
|
value: store.state.view,
|
|
@@ -3952,7 +3956,7 @@ var DataTablePagination = ({
|
|
|
3952
3956
|
const setPagination = (next) => changeState(setStore, (state) => ({ ...state, ...next }));
|
|
3953
3957
|
return /* @__PURE__ */ jsx15("div", {
|
|
3954
3958
|
"data-table-slot": "pagination",
|
|
3955
|
-
className: cn("pt-4", styles?.pagination),
|
|
3959
|
+
className: cn("shrink-0 pt-4", styles?.pagination),
|
|
3956
3960
|
children: /* @__PURE__ */ jsx15(Pagination, {
|
|
3957
3961
|
pageSizeContentClassName: styles?.popup?.select,
|
|
3958
3962
|
locale: store.config.locale,
|
|
@@ -3968,6 +3972,7 @@ var DataTablePagination = ({
|
|
|
3968
3972
|
})
|
|
3969
3973
|
});
|
|
3970
3974
|
};
|
|
3975
|
+
var getTableLayoutClass = (virtualization) => virtualization && virtualization !== true && virtualization.scroll === "internal" ? "flex min-h-0 flex-1 flex-col" : undefined;
|
|
3971
3976
|
var HydratedDataTable = ({
|
|
3972
3977
|
persistedUiState,
|
|
3973
3978
|
setPersistedUiState,
|
|
@@ -4049,7 +4054,7 @@ var HydratedDataTable = ({
|
|
|
4049
4054
|
uiState
|
|
4050
4055
|
]);
|
|
4051
4056
|
return /* @__PURE__ */ jsxs9("div", {
|
|
4052
|
-
className: cn("w-full max-w-full min-w-0 rounded-md", props.className),
|
|
4057
|
+
className: cn("w-full max-w-full min-w-0 rounded-md", getTableLayoutClass(props.features?.virtualization), props.className),
|
|
4053
4058
|
"data-table-root": "",
|
|
4054
4059
|
children: [
|
|
4055
4060
|
/* @__PURE__ */ jsx15(DataTableToolbar, {
|
|
@@ -4094,7 +4099,7 @@ var DataTable = (props) => {
|
|
|
4094
4099
|
if (!persistedUiState || AsyncResult.isWaiting(persistedUiResult)) {
|
|
4095
4100
|
return /* @__PURE__ */ jsx15("div", {
|
|
4096
4101
|
"aria-busy": "true",
|
|
4097
|
-
className: cn("invisible w-full max-w-full min-w-0 rounded-md", props.className),
|
|
4102
|
+
className: cn("invisible w-full max-w-full min-w-0 rounded-md", getTableLayoutClass(props.features?.virtualization), props.className),
|
|
4098
4103
|
"data-table-root": ""
|
|
4099
4104
|
});
|
|
4100
4105
|
}
|
|
@@ -4191,15 +4196,16 @@ var DataTableContent = ({
|
|
|
4191
4196
|
})
|
|
4192
4197
|
});
|
|
4193
4198
|
}
|
|
4199
|
+
const fillHeight = options.scroll === "internal";
|
|
4194
4200
|
return /* @__PURE__ */ jsxs9(ScrollAreaPrimitive2.Root, {
|
|
4195
|
-
className: "relative isolate max-w-full min-w-0",
|
|
4201
|
+
className: cn("relative isolate max-w-full min-w-0", fillHeight && "flex min-h-0 flex-1 flex-col"),
|
|
4196
4202
|
children: [
|
|
4197
4203
|
/* @__PURE__ */ jsx15(ScrollAreaPrimitive2.Viewport, {
|
|
4198
4204
|
ref: setScrollElement,
|
|
4199
4205
|
"data-table-virtual-viewport": "",
|
|
4200
|
-
className: "@container [overflow-anchor:none] data-has-overflow-y:me-2.5 [&_[data-slot=table-container]]:overflow-visible",
|
|
4206
|
+
className: cn("@container [overflow-anchor:none] data-has-overflow-y:me-2.5 [&_[data-slot=table-container]]:overflow-visible", fillHeight && "min-h-0 flex-1"),
|
|
4201
4207
|
style: {
|
|
4202
|
-
maxHeight: options.height ?? 480,
|
|
4208
|
+
maxHeight: fillHeight ? undefined : options.height ?? 480,
|
|
4203
4209
|
scrollPaddingTop: headerHeight
|
|
4204
4210
|
},
|
|
4205
4211
|
children: /* @__PURE__ */ jsx15(ScrollAreaPrimitive2.Content, {
|
|
@@ -37,7 +37,7 @@ function SelectTrigger({
|
|
|
37
37
|
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
38
38
|
"data-slot": "select-trigger",
|
|
39
39
|
"data-size": size,
|
|
40
|
-
className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border
|
|
40
|
+
className: cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
41
41
|
...props,
|
|
42
42
|
children: [
|
|
43
43
|
children,
|
|
@@ -54,9 +54,9 @@ function SelectContent({
|
|
|
54
54
|
children,
|
|
55
55
|
side = "bottom",
|
|
56
56
|
sideOffset = 4,
|
|
57
|
-
align = "
|
|
57
|
+
align = "start",
|
|
58
58
|
alignOffset = 0,
|
|
59
|
-
alignItemWithTrigger =
|
|
59
|
+
alignItemWithTrigger = false,
|
|
60
60
|
...props
|
|
61
61
|
}) {
|
|
62
62
|
return /* @__PURE__ */ jsx2(SelectPrimitive.Portal, {
|
|
@@ -70,7 +70,7 @@ function SelectContent({
|
|
|
70
70
|
children: /* @__PURE__ */ jsxs(SelectPrimitive.Popup, {
|
|
71
71
|
"data-slot": "select-content",
|
|
72
72
|
"data-align-trigger": alignItemWithTrigger,
|
|
73
|
-
className: cn("
|
|
73
|
+
className: cn("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none", className),
|
|
74
74
|
...props,
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ jsx2(SelectScrollUpButton, {}),
|
|
@@ -90,7 +90,7 @@ function SelectItem({
|
|
|
90
90
|
}) {
|
|
91
91
|
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
92
92
|
"data-slot": "select-item",
|
|
93
|
-
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none
|
|
93
|
+
className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
94
94
|
...props,
|
|
95
95
|
children: [
|
|
96
96
|
/* @__PURE__ */ jsx2(SelectPrimitive.ItemText, {
|
|
@@ -114,7 +114,7 @@ function SelectScrollUpButton({
|
|
|
114
114
|
}) {
|
|
115
115
|
return /* @__PURE__ */ jsx2(SelectPrimitive.ScrollUpArrow, {
|
|
116
116
|
"data-slot": "select-scroll-up-button",
|
|
117
|
-
className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center
|
|
117
|
+
className: cn("bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
118
118
|
...props,
|
|
119
119
|
children: /* @__PURE__ */ jsx2(ChevronUpIcon, {})
|
|
120
120
|
});
|
|
@@ -125,7 +125,7 @@ function SelectScrollDownButton({
|
|
|
125
125
|
}) {
|
|
126
126
|
return /* @__PURE__ */ jsx2(SelectPrimitive.ScrollDownArrow, {
|
|
127
127
|
"data-slot": "select-scroll-down-button",
|
|
128
|
-
className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center
|
|
128
|
+
className: cn("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
129
129
|
...props,
|
|
130
130
|
children: /* @__PURE__ */ jsx2(ChevronDownIcon, {})
|
|
131
131
|
});
|
|
@@ -793,7 +793,7 @@ function SelectTrigger({
|
|
|
793
793
|
return /* @__PURE__ */ jsxs4(SelectPrimitive.Trigger, {
|
|
794
794
|
"data-slot": "select-trigger",
|
|
795
795
|
"data-size": size,
|
|
796
|
-
className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border
|
|
796
|
+
className: cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
797
797
|
...props,
|
|
798
798
|
children: [
|
|
799
799
|
children,
|
|
@@ -810,9 +810,9 @@ function SelectContent({
|
|
|
810
810
|
children,
|
|
811
811
|
side = "bottom",
|
|
812
812
|
sideOffset = 4,
|
|
813
|
-
align = "
|
|
813
|
+
align = "start",
|
|
814
814
|
alignOffset = 0,
|
|
815
|
-
alignItemWithTrigger =
|
|
815
|
+
alignItemWithTrigger = false,
|
|
816
816
|
...props
|
|
817
817
|
}) {
|
|
818
818
|
return /* @__PURE__ */ jsx9(SelectPrimitive.Portal, {
|
|
@@ -826,7 +826,7 @@ function SelectContent({
|
|
|
826
826
|
children: /* @__PURE__ */ jsxs4(SelectPrimitive.Popup, {
|
|
827
827
|
"data-slot": "select-content",
|
|
828
828
|
"data-align-trigger": alignItemWithTrigger,
|
|
829
|
-
className: cn("
|
|
829
|
+
className: cn("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none", className),
|
|
830
830
|
...props,
|
|
831
831
|
children: [
|
|
832
832
|
/* @__PURE__ */ jsx9(SelectScrollUpButton, {}),
|
|
@@ -846,7 +846,7 @@ function SelectItem({
|
|
|
846
846
|
}) {
|
|
847
847
|
return /* @__PURE__ */ jsxs4(SelectPrimitive.Item, {
|
|
848
848
|
"data-slot": "select-item",
|
|
849
|
-
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none
|
|
849
|
+
className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
850
850
|
...props,
|
|
851
851
|
children: [
|
|
852
852
|
/* @__PURE__ */ jsx9(SelectPrimitive.ItemText, {
|
|
@@ -870,7 +870,7 @@ function SelectScrollUpButton({
|
|
|
870
870
|
}) {
|
|
871
871
|
return /* @__PURE__ */ jsx9(SelectPrimitive.ScrollUpArrow, {
|
|
872
872
|
"data-slot": "select-scroll-up-button",
|
|
873
|
-
className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center
|
|
873
|
+
className: cn("bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
874
874
|
...props,
|
|
875
875
|
children: /* @__PURE__ */ jsx9(ChevronUpIcon, {})
|
|
876
876
|
});
|
|
@@ -881,7 +881,7 @@ function SelectScrollDownButton({
|
|
|
881
881
|
}) {
|
|
882
882
|
return /* @__PURE__ */ jsx9(SelectPrimitive.ScrollDownArrow, {
|
|
883
883
|
"data-slot": "select-scroll-down-button",
|
|
884
|
-
className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center
|
|
884
|
+
className: cn("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
885
885
|
...props,
|
|
886
886
|
children: /* @__PURE__ */ jsx9(ChevronDownIcon, {})
|
|
887
887
|
});
|
|
@@ -1168,7 +1168,7 @@ var defaultClear = (label) => /* @__PURE__ */ jsx12(ComboboxPrimitive.Clear, {
|
|
|
1168
1168
|
})
|
|
1169
1169
|
});
|
|
1170
1170
|
var selectedLabel = (value, placeholder) => {
|
|
1171
|
-
if (
|
|
1171
|
+
if (value && !("label" in value)) {
|
|
1172
1172
|
return value.length > 0 ? value.map(({ label }) => label).join(", ") : placeholder;
|
|
1173
1173
|
}
|
|
1174
1174
|
return value && "label" in value ? value.label : placeholder;
|