@krak-stack/registry 0.1.60 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/components/ui/app-brand.js +17 -17
- package/dist/components/ui/code-block.js +6 -6
- package/dist/components/ui/color-picker.d.ts +30 -0
- package/dist/components/ui/color-picker.js +386 -0
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/data-table.js +468 -455
- package/dist/components/ui/editing-locale-switcher.js +10 -10
- package/dist/components/ui/effect-form.js +186 -185
- package/dist/components/ui/error-component.js +10 -18
- package/dist/components/ui/file-picker.js +2 -2
- package/dist/components/ui/form.d.ts +131 -335
- package/dist/components/ui/form.js +137 -136
- package/dist/components/ui/google-map.js +38 -6
- package/dist/components/ui/icon-input.js +48 -45
- package/dist/components/ui/krakstack-provider.js +2 -2
- package/dist/components/ui/locale-switcher.js +4 -4
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/search-menu.js +2 -2
- package/dist/components/ui/sidebar-layout.js +82 -80
- package/dist/components/ui/theme-switcher.js +6 -6
- package/dist/components/ui/virtualized-combobox.js +34 -31
- package/dist/lib/docs.d.ts +2 -2
- package/dist/lib/docs.js +187 -185
- package/dist/lib/docs.server.js +45 -23
- package/dist/lib/documentation-toolkit.d.ts +2 -2
- package/dist/lib/documentation-toolkit.js +45 -23
- package/dist/lib/httpapi-adapter.d.ts +11 -3
- package/dist/lib/httpapi-adapter.js +42 -15
- package/dist/lib/httpapi-cli.d.ts +13 -4
- package/dist/lib/httpapi-cli.js +70 -28
- package/dist/lib/httpapi-toolkit.js +40 -13
- package/dist/lib/query.d.ts +4 -4
- package/dist/lib/query.js +13 -13
- package/dist/lib/seo.js +2 -2
- package/dist/lib/webfetch-toolkit.js +7 -7
- package/dist/oxlint/anti-slop/index.js +2 -2
- package/dist/services/agent/client/index.js +155 -153
- package/dist/services/agent/index.js +3 -3
- package/dist/services/agent/schema.js +5 -5
- package/dist/services/events/browser.js +38 -23
- package/dist/services/events/client/audit-log-table.js +472 -459
- package/dist/services/events/client/tracking-notice.js +9 -4
- package/dist/services/events/index.d.ts +3 -1
- package/dist/services/events/index.js +79 -74
- package/dist/services/events/migrations.js +2 -2
- package/dist/services/events/record.js +2 -2
- package/dist/services/events/schema.d.ts +18 -10
- package/dist/services/events/schema.js +42 -42
- package/dist/services/file-extraction/index.js +4 -4
- package/dist/services/file-extraction/schema.d.ts +3 -1
- package/dist/services/file-extraction/schema.js +2 -2
- package/dist/services/health/api.builder.d.ts +8 -8
- package/dist/services/health/api.group.d.ts +8 -8
- package/dist/services/health/index.d.ts +10 -6
- package/dist/services/health/index.js +17 -13
- package/dist/services/health/schema.d.ts +7 -7
- package/dist/services/notification/channels/ses/index.js +2 -2
- package/dist/services/notification/channels/ses/schema.js +2 -2
- package/dist/services/notification/client/index.js +5 -5
- package/dist/services/notification/index.js +3 -3
- package/dist/services/notification/persistence/drizzle.js +2 -2
- package/dist/services/notification/persistence/index.js +15 -15
- package/dist/services/notification/persistence/schema.js +12 -12
- package/dist/services/notification/public.js +8 -8
- package/dist/services/notification/schema.d.ts +3 -1
- package/dist/services/notification/schema.js +2 -2
- package/dist/services/opentelemetry/api.js +7 -5
- package/dist/services/opentelemetry/browser.js +9 -9
- package/dist/services/opentelemetry/index.js +2 -2
- package/dist/services/opentelemetry/processor.d.ts +3 -1
- package/dist/services/opentelemetry/web-vitals.js +12 -7
- package/dist/services/s3/index.js +2 -2
- package/dist/services/s3/schema.d.ts +3 -1
- package/dist/services/s3/schema.js +2 -2
- package/dist/services/speech/api.js +3 -1
- package/dist/services/speech/index.js +15 -8
- package/dist/services/speech/schema.d.ts +3 -1
- package/dist/services/speech/schema.js +12 -10
- package/dist/services/webhooks/client/delivery-table.d.ts +62 -0
- package/dist/services/webhooks/client/delivery-table.js +4711 -0
- package/dist/services/webhooks/http-client.d.ts +1 -0
- package/dist/services/webhooks/http-client.js +17 -5
- package/dist/services/webhooks/index.d.ts +2 -0
- package/dist/services/webhooks/index.js +249 -114
- package/dist/services/webhooks/migrations.d.ts +3 -0
- package/dist/services/webhooks/migrations.js +21 -2
- package/dist/services/webhooks/receiver.d.ts +45 -0
- package/dist/services/webhooks/schema.d.ts +15 -5
- package/dist/services/webhooks/schema.js +41 -21
- package/dist/services/webhooks/url.d.ts +5 -0
- package/dist/services/webhooks/url.js +18 -2
- package/package.json +10 -1
|
@@ -508,7 +508,7 @@ var FilePicker = ({
|
|
|
508
508
|
image,
|
|
509
509
|
invalid = false,
|
|
510
510
|
locale: localeOverride,
|
|
511
|
-
messages,
|
|
511
|
+
messages: messages2,
|
|
512
512
|
multiple = false,
|
|
513
513
|
name,
|
|
514
514
|
onBlur,
|
|
@@ -519,7 +519,7 @@ var FilePicker = ({
|
|
|
519
519
|
title
|
|
520
520
|
}) => {
|
|
521
521
|
const locale = useKrakstackLocale(localeOverride);
|
|
522
|
-
const labels = filePickerMessages(locale,
|
|
522
|
+
const labels = filePickerMessages(locale, messages2);
|
|
523
523
|
const inputRef = useRef(null);
|
|
524
524
|
const dragDepthRef = useRef(0);
|
|
525
525
|
const [dragging, setDragging] = useState(false);
|
|
@@ -781,11 +781,12 @@ function Label({ className, ...props }) {
|
|
|
781
781
|
|
|
782
782
|
// ../../src/components/ui/separator.tsx
|
|
783
783
|
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
784
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
784
785
|
|
|
785
786
|
// ../../src/components/ui/field.tsx
|
|
786
|
-
import { jsx as
|
|
787
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
787
788
|
function FieldSet({ className, ...props }) {
|
|
788
|
-
return /* @__PURE__ */
|
|
789
|
+
return /* @__PURE__ */ jsx10("fieldset", {
|
|
789
790
|
"data-slot": "field-set",
|
|
790
791
|
className: cn("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
791
792
|
...props
|
|
@@ -796,7 +797,7 @@ function FieldLegend({
|
|
|
796
797
|
variant = "legend",
|
|
797
798
|
...props
|
|
798
799
|
}) {
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
+
return /* @__PURE__ */ jsx10("legend", {
|
|
800
801
|
"data-slot": "field-legend",
|
|
801
802
|
"data-variant": variant,
|
|
802
803
|
className: cn("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className),
|
|
@@ -804,7 +805,7 @@ function FieldLegend({
|
|
|
804
805
|
});
|
|
805
806
|
}
|
|
806
807
|
function FieldGroup({ className, ...props }) {
|
|
807
|
-
return /* @__PURE__ */
|
|
808
|
+
return /* @__PURE__ */ jsx10("div", {
|
|
808
809
|
"data-slot": "field-group",
|
|
809
810
|
className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", className),
|
|
810
811
|
...props
|
|
@@ -827,7 +828,7 @@ function Field({
|
|
|
827
828
|
orientation = "vertical",
|
|
828
829
|
...props
|
|
829
830
|
}) {
|
|
830
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ jsx10("div", {
|
|
831
832
|
role: "group",
|
|
832
833
|
"data-slot": "field",
|
|
833
834
|
"data-orientation": orientation,
|
|
@@ -839,14 +840,14 @@ function FieldLabel({
|
|
|
839
840
|
className,
|
|
840
841
|
...props
|
|
841
842
|
}) {
|
|
842
|
-
return /* @__PURE__ */
|
|
843
|
+
return /* @__PURE__ */ jsx10(Label, {
|
|
843
844
|
"data-slot": "field-label",
|
|
844
845
|
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
845
846
|
...props
|
|
846
847
|
});
|
|
847
848
|
}
|
|
848
849
|
function FieldDescription({ className, ...props }) {
|
|
849
|
-
return /* @__PURE__ */
|
|
850
|
+
return /* @__PURE__ */ jsx10("p", {
|
|
850
851
|
"data-slot": "field-description",
|
|
851
852
|
className: cn("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
852
853
|
...props
|
|
@@ -854,9 +855,9 @@ function FieldDescription({ className, ...props }) {
|
|
|
854
855
|
}
|
|
855
856
|
|
|
856
857
|
// ../../src/components/ui/textarea.tsx
|
|
857
|
-
import { jsx as
|
|
858
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
858
859
|
function Textarea({ className, ...props }) {
|
|
859
|
-
return /* @__PURE__ */
|
|
860
|
+
return /* @__PURE__ */ jsx11("textarea", {
|
|
860
861
|
"data-slot": "textarea",
|
|
861
862
|
className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
862
863
|
...props
|
|
@@ -914,9 +915,9 @@ import {
|
|
|
914
915
|
|
|
915
916
|
// ../../src/components/ui/input-group.tsx
|
|
916
917
|
import { cva as cva5 } from "class-variance-authority";
|
|
917
|
-
import { jsx as
|
|
918
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
918
919
|
function InputGroup({ className, ...props }) {
|
|
919
|
-
return /* @__PURE__ */
|
|
920
|
+
return /* @__PURE__ */ jsx12("div", {
|
|
920
921
|
"data-slot": "input-group",
|
|
921
922
|
role: "group",
|
|
922
923
|
className: cn("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
@@ -949,7 +950,7 @@ function InputGroupInput({
|
|
|
949
950
|
className,
|
|
950
951
|
...props
|
|
951
952
|
}) {
|
|
952
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ jsx12(Input, {
|
|
953
954
|
"data-slot": "input-group-control",
|
|
954
955
|
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
|
|
955
956
|
...props
|
|
@@ -958,7 +959,7 @@ function InputGroupInput({
|
|
|
958
959
|
|
|
959
960
|
// ../../src/components/ui/virtualized-combobox.tsx
|
|
960
961
|
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
|
|
961
|
-
import { jsx as
|
|
962
|
+
import { jsx as jsx13, jsxs as jsxs5, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
962
963
|
"use client";
|
|
963
964
|
var messages2 = {
|
|
964
965
|
en: {
|
|
@@ -1037,11 +1038,11 @@ var VirtualizedComboboxList = ({
|
|
|
1037
1038
|
}, [virtualizer]);
|
|
1038
1039
|
return /* @__PURE__ */ jsxs5(Fragment2, {
|
|
1039
1040
|
children: [
|
|
1040
|
-
filteredItems.length === 0 && /* @__PURE__ */
|
|
1041
|
+
filteredItems.length === 0 && /* @__PURE__ */ jsx13("div", {
|
|
1041
1042
|
className: "text-muted-foreground flex min-h-0 flex-1 flex-col items-center justify-center overflow-auto py-6 text-center text-sm",
|
|
1042
1043
|
children: emptyLabel
|
|
1043
1044
|
}),
|
|
1044
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ jsx13(ComboboxPrimitive.List, {
|
|
1045
1046
|
className: "min-h-0 flex-1 scroll-py-1 overflow-auto overscroll-contain p-1",
|
|
1046
1047
|
hidden: filteredItems.length === 0,
|
|
1047
1048
|
ref: handleScrollElementRef,
|
|
@@ -1049,7 +1050,7 @@ var VirtualizedComboboxList = ({
|
|
|
1049
1050
|
height: Math.min(virtualizer.getTotalSize() + 8, 288),
|
|
1050
1051
|
maxHeight: "var(--available-height)"
|
|
1051
1052
|
},
|
|
1052
|
-
children: /* @__PURE__ */
|
|
1053
|
+
children: /* @__PURE__ */ jsx13("div", {
|
|
1053
1054
|
className: "relative w-full",
|
|
1054
1055
|
role: "presentation",
|
|
1055
1056
|
style: { height: virtualizer.getTotalSize() },
|
|
@@ -1062,9 +1063,9 @@ var VirtualizedComboboxList = ({
|
|
|
1062
1063
|
transform: `translateY(${virtualItem.start}px)`
|
|
1063
1064
|
};
|
|
1064
1065
|
if (entry.kind === "group") {
|
|
1065
|
-
return /* @__PURE__ */
|
|
1066
|
+
return /* @__PURE__ */ jsx13(ComboboxPrimitive.Group, {
|
|
1066
1067
|
className: "contents",
|
|
1067
|
-
children: /* @__PURE__ */
|
|
1068
|
+
children: /* @__PURE__ */ jsx13(ComboboxPrimitive.GroupLabel, {
|
|
1068
1069
|
className: "text-muted-foreground absolute top-0 left-0 w-full px-2 pt-3 pb-1 text-xs",
|
|
1069
1070
|
"data-index": virtualItem.index,
|
|
1070
1071
|
ref: virtualizer.measureElement,
|
|
@@ -1083,13 +1084,13 @@ var VirtualizedComboboxList = ({
|
|
|
1083
1084
|
style,
|
|
1084
1085
|
value: entry.item,
|
|
1085
1086
|
children: [
|
|
1086
|
-
renderItem?.(entry.item) ?? /* @__PURE__ */
|
|
1087
|
+
renderItem?.(entry.item) ?? /* @__PURE__ */ jsx13("span", {
|
|
1087
1088
|
className: "min-w-0 truncate",
|
|
1088
1089
|
children: entry.item.label
|
|
1089
1090
|
}),
|
|
1090
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ jsx13(ComboboxPrimitive.ItemIndicator, {
|
|
1091
1092
|
className: "absolute right-2 flex size-4 items-center justify-center",
|
|
1092
|
-
children: /* @__PURE__ */
|
|
1093
|
+
children: /* @__PURE__ */ jsx13(Check, {})
|
|
1093
1094
|
})
|
|
1094
1095
|
]
|
|
1095
1096
|
}, entry.item.value);
|
|
@@ -1111,8 +1112,8 @@ var VirtualizedComboboxContent = ({
|
|
|
1111
1112
|
virtualizerRef
|
|
1112
1113
|
}) => {
|
|
1113
1114
|
const labels = virtualizedComboboxMessages(locale, messageOverrides);
|
|
1114
|
-
return /* @__PURE__ */
|
|
1115
|
-
children: /* @__PURE__ */
|
|
1115
|
+
return /* @__PURE__ */ jsx13(ComboboxPrimitive.Portal, {
|
|
1116
|
+
children: /* @__PURE__ */ jsx13(ComboboxPrimitive.Positioner, {
|
|
1116
1117
|
align: "start",
|
|
1117
1118
|
className: "isolate z-50",
|
|
1118
1119
|
side: "bottom",
|
|
@@ -1120,17 +1121,17 @@ var VirtualizedComboboxContent = ({
|
|
|
1120
1121
|
children: /* @__PURE__ */ jsxs5(ComboboxPrimitive.Popup, {
|
|
1121
1122
|
className: cn("relative flex max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) flex-col overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-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-in-95", contentClassName),
|
|
1122
1123
|
children: [
|
|
1123
|
-
/* @__PURE__ */
|
|
1124
|
+
/* @__PURE__ */ jsx13("div", {
|
|
1124
1125
|
className: "min-w-0 shrink-0 p-1 pb-0",
|
|
1125
|
-
children: /* @__PURE__ */
|
|
1126
|
+
children: /* @__PURE__ */ jsx13(InputGroup, {
|
|
1126
1127
|
className: "border-input/30 bg-input/30 h-8 w-full min-w-0 shadow-none",
|
|
1127
|
-
children: /* @__PURE__ */
|
|
1128
|
+
children: /* @__PURE__ */ jsx13(ComboboxPrimitive.Input, {
|
|
1128
1129
|
placeholder: labels.search,
|
|
1129
|
-
render: /* @__PURE__ */
|
|
1130
|
+
render: /* @__PURE__ */ jsx13(InputGroupInput, {})
|
|
1130
1131
|
})
|
|
1131
1132
|
})
|
|
1132
1133
|
}),
|
|
1133
|
-
/* @__PURE__ */
|
|
1134
|
+
/* @__PURE__ */ jsx13(VirtualizedComboboxList, {
|
|
1134
1135
|
emptyLabel,
|
|
1135
1136
|
groupSelections,
|
|
1136
1137
|
itemIndexRef,
|
|
@@ -1154,20 +1155,20 @@ var defaultTrigger = (ariaLabel, ariaInvalid, disabled, label, triggerId) => /*
|
|
|
1154
1155
|
type: "button",
|
|
1155
1156
|
variant: "outline",
|
|
1156
1157
|
children: [
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ jsx13("span", {
|
|
1158
1159
|
className: "min-w-0 flex-1 truncate pr-7 text-left",
|
|
1159
1160
|
children: label
|
|
1160
1161
|
}),
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ jsx13(ChevronsUpDown, {
|
|
1162
1163
|
className: "text-muted-foreground shrink-0 opacity-70"
|
|
1163
1164
|
})
|
|
1164
1165
|
]
|
|
1165
1166
|
});
|
|
1166
|
-
var defaultClear = (label) => /* @__PURE__ */
|
|
1167
|
+
var defaultClear = (label) => /* @__PURE__ */ jsx13(ComboboxPrimitive.Clear, {
|
|
1167
1168
|
"aria-label": label,
|
|
1168
1169
|
className: "text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute top-1/2 right-7 z-10 flex size-6 -translate-y-1/2 items-center justify-center rounded-sm outline-none focus-visible:border focus-visible:ring-3",
|
|
1169
1170
|
type: "button",
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1171
|
+
children: /* @__PURE__ */ jsx13(X, {
|
|
1171
1172
|
className: "size-3.5"
|
|
1172
1173
|
})
|
|
1173
1174
|
});
|
|
@@ -1206,13 +1207,13 @@ var VirtualizedComboboxSingle = (props) => {
|
|
|
1206
1207
|
/* @__PURE__ */ jsxs5("div", {
|
|
1207
1208
|
className: "relative",
|
|
1208
1209
|
children: [
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ jsx13(ComboboxPrimitive.Trigger, {
|
|
1210
1211
|
render: props.trigger ?? defaultTrigger(props.ariaLabel, props.ariaInvalid, props.disabled, selectedLabel(props.value, props.placeholder), props.triggerId)
|
|
1211
1212
|
}),
|
|
1212
1213
|
props.trigger ? null : defaultClear(labels.clear)
|
|
1213
1214
|
]
|
|
1214
1215
|
}),
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
+
/* @__PURE__ */ jsx13(VirtualizedComboboxContent, {
|
|
1216
1217
|
...props,
|
|
1217
1218
|
groupSelections: false,
|
|
1218
1219
|
itemIndexRef,
|
|
@@ -1248,13 +1249,13 @@ var VirtualizedComboboxMultiple = (props) => {
|
|
|
1248
1249
|
/* @__PURE__ */ jsxs5("div", {
|
|
1249
1250
|
className: "relative",
|
|
1250
1251
|
children: [
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ jsx13(ComboboxPrimitive.Trigger, {
|
|
1252
1253
|
render: props.trigger ?? defaultTrigger(props.ariaLabel, props.ariaInvalid, props.disabled, selectedLabel(props.value, props.placeholder), props.triggerId)
|
|
1253
1254
|
}),
|
|
1254
1255
|
props.trigger ? null : defaultClear(labels.clear)
|
|
1255
1256
|
]
|
|
1256
1257
|
}),
|
|
1257
|
-
/* @__PURE__ */
|
|
1258
|
+
/* @__PURE__ */ jsx13(VirtualizedComboboxContent, {
|
|
1258
1259
|
...props,
|
|
1259
1260
|
groupSelections: true,
|
|
1260
1261
|
itemIndexRef,
|
|
@@ -1266,10 +1267,10 @@ var VirtualizedComboboxMultiple = (props) => {
|
|
|
1266
1267
|
};
|
|
1267
1268
|
function VirtualizedCombobox(props) {
|
|
1268
1269
|
const locale = useKrakstackLocale2(props.locale);
|
|
1269
|
-
return props.multiple ? /* @__PURE__ */
|
|
1270
|
+
return props.multiple ? /* @__PURE__ */ jsx13(VirtualizedComboboxMultiple, {
|
|
1270
1271
|
...props,
|
|
1271
1272
|
locale
|
|
1272
|
-
}) : /* @__PURE__ */
|
|
1273
|
+
}) : /* @__PURE__ */ jsx13(VirtualizedComboboxSingle, {
|
|
1273
1274
|
...props,
|
|
1274
1275
|
locale
|
|
1275
1276
|
});
|
|
@@ -1277,7 +1278,7 @@ function VirtualizedCombobox(props) {
|
|
|
1277
1278
|
|
|
1278
1279
|
// ../../src/components/ui/form.tsx
|
|
1279
1280
|
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider";
|
|
1280
|
-
import { jsx as
|
|
1281
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1281
1282
|
var messages3 = {
|
|
1282
1283
|
en: {
|
|
1283
1284
|
keyValueKey: "Key",
|
|
@@ -1317,14 +1318,14 @@ var formMessages = (locale = "en", translations) => ({
|
|
|
1317
1318
|
});
|
|
1318
1319
|
var useFormMessages = (locale, translations) => formMessages(useKrakstackLocale3(locale), translations);
|
|
1319
1320
|
var ErrorMessage = ({ text }) => {
|
|
1320
|
-
return /* @__PURE__ */
|
|
1321
|
+
return /* @__PURE__ */ jsx14("em", {
|
|
1321
1322
|
role: "alert",
|
|
1322
1323
|
className: "text-destructive text-sm",
|
|
1323
1324
|
children: text
|
|
1324
1325
|
});
|
|
1325
1326
|
};
|
|
1326
1327
|
function FieldError({ errors = [] }) {
|
|
1327
|
-
return errors?.length > 0 ? /* @__PURE__ */
|
|
1328
|
+
return errors?.length > 0 ? /* @__PURE__ */ jsx14(ErrorMessage, {
|
|
1328
1329
|
text: errors.map((error) => {
|
|
1329
1330
|
return error.message?.toString().split(" ").map((word) => {
|
|
1330
1331
|
if (word.startsWith("t:"))
|
|
@@ -1348,24 +1349,24 @@ var TextField = ({
|
|
|
1348
1349
|
/* @__PURE__ */ jsxs6("div", {
|
|
1349
1350
|
className: "flex w-full items-center gap-2",
|
|
1350
1351
|
children: [
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
+
/* @__PURE__ */ jsx14(FieldLabel, {
|
|
1352
1353
|
htmlFor: field.name,
|
|
1353
1354
|
children: props.label
|
|
1354
1355
|
}),
|
|
1355
1356
|
children
|
|
1356
1357
|
]
|
|
1357
1358
|
}),
|
|
1358
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ jsx14(Input, {
|
|
1359
1360
|
id: field.name,
|
|
1360
1361
|
value: field.state.value ?? "",
|
|
1361
1362
|
onChange: (e) => field.handleChange(e.target.value),
|
|
1362
1363
|
...props,
|
|
1363
1364
|
"aria-invalid": invalid
|
|
1364
1365
|
}),
|
|
1365
|
-
props.description && /* @__PURE__ */
|
|
1366
|
+
props.description && /* @__PURE__ */ jsx14(FieldDescription, {
|
|
1366
1367
|
children: props.description
|
|
1367
1368
|
}),
|
|
1368
|
-
/* @__PURE__ */
|
|
1369
|
+
/* @__PURE__ */ jsx14(FieldError, {
|
|
1369
1370
|
errors: field.getMeta().errors
|
|
1370
1371
|
})
|
|
1371
1372
|
]
|
|
@@ -1384,24 +1385,24 @@ var TextAreaField = ({
|
|
|
1384
1385
|
/* @__PURE__ */ jsxs6("div", {
|
|
1385
1386
|
className: "flex w-full items-center gap-2",
|
|
1386
1387
|
children: [
|
|
1387
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ jsx14(FieldLabel, {
|
|
1388
1389
|
htmlFor: field.name,
|
|
1389
1390
|
children: props.label
|
|
1390
1391
|
}),
|
|
1391
1392
|
children
|
|
1392
1393
|
]
|
|
1393
1394
|
}),
|
|
1394
|
-
/* @__PURE__ */
|
|
1395
|
+
/* @__PURE__ */ jsx14(Textarea, {
|
|
1395
1396
|
id: field.name,
|
|
1396
1397
|
value: field.state.value ?? "",
|
|
1397
1398
|
onChange: (e) => field.handleChange(e.target.value),
|
|
1398
1399
|
...props,
|
|
1399
1400
|
"aria-invalid": invalid
|
|
1400
1401
|
}),
|
|
1401
|
-
props.description && /* @__PURE__ */
|
|
1402
|
+
props.description && /* @__PURE__ */ jsx14(FieldDescription, {
|
|
1402
1403
|
children: props.description
|
|
1403
1404
|
}),
|
|
1404
|
-
/* @__PURE__ */
|
|
1405
|
+
/* @__PURE__ */ jsx14(FieldError, {
|
|
1405
1406
|
errors: field.getMeta().errors
|
|
1406
1407
|
})
|
|
1407
1408
|
]
|
|
@@ -1416,7 +1417,7 @@ var CheckboxField = (props) => {
|
|
|
1416
1417
|
/* @__PURE__ */ jsxs6("div", {
|
|
1417
1418
|
className: "flex flex-row items-center gap-2",
|
|
1418
1419
|
children: [
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
+
/* @__PURE__ */ jsx14(Checkbox, {
|
|
1420
1421
|
id: field.name,
|
|
1421
1422
|
name: field.name,
|
|
1422
1423
|
checked: field.state.value ?? false,
|
|
@@ -1424,16 +1425,16 @@ var CheckboxField = (props) => {
|
|
|
1424
1425
|
onCheckedChange: (checked) => field.handleChange(checked),
|
|
1425
1426
|
"aria-invalid": invalid
|
|
1426
1427
|
}),
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
+
/* @__PURE__ */ jsx14(FieldLabel, {
|
|
1428
1429
|
htmlFor: field.name,
|
|
1429
1430
|
children: props.label
|
|
1430
1431
|
})
|
|
1431
1432
|
]
|
|
1432
1433
|
}),
|
|
1433
|
-
props.description && /* @__PURE__ */
|
|
1434
|
+
props.description && /* @__PURE__ */ jsx14(FieldDescription, {
|
|
1434
1435
|
children: props.description
|
|
1435
1436
|
}),
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
+
/* @__PURE__ */ jsx14(FieldError, {
|
|
1437
1438
|
errors: field.getMeta().errors
|
|
1438
1439
|
})
|
|
1439
1440
|
]
|
|
@@ -1451,15 +1452,15 @@ var SingleSelectControl = ({
|
|
|
1451
1452
|
onValueChange: (value) => field.handleChange(value ?? ""),
|
|
1452
1453
|
defaultValue: field.state.value,
|
|
1453
1454
|
children: [
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
+
/* @__PURE__ */ jsx14(SelectTrigger, {
|
|
1455
1456
|
className: "gap-1",
|
|
1456
1457
|
id: field.name,
|
|
1457
1458
|
"aria-invalid": invalid,
|
|
1458
|
-
children: /* @__PURE__ */
|
|
1459
|
+
children: /* @__PURE__ */ jsx14(SelectValue, {
|
|
1459
1460
|
placeholder
|
|
1460
1461
|
})
|
|
1461
1462
|
}),
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
+
/* @__PURE__ */ jsx14(SelectOptions, {
|
|
1463
1464
|
options
|
|
1464
1465
|
})
|
|
1465
1466
|
]
|
|
@@ -1477,15 +1478,15 @@ var MultipleSelectControl = ({
|
|
|
1477
1478
|
multiple: true,
|
|
1478
1479
|
value: field.state.value ?? [],
|
|
1479
1480
|
children: [
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ jsx14(SelectTrigger, {
|
|
1481
1482
|
className: "gap-1",
|
|
1482
1483
|
id: field.name,
|
|
1483
1484
|
"aria-invalid": invalid,
|
|
1484
|
-
children: /* @__PURE__ */
|
|
1485
|
+
children: /* @__PURE__ */ jsx14(SelectValue, {
|
|
1485
1486
|
placeholder
|
|
1486
1487
|
})
|
|
1487
1488
|
}),
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ jsx14(SelectOptions, {
|
|
1489
1490
|
options
|
|
1490
1491
|
})
|
|
1491
1492
|
]
|
|
@@ -1493,9 +1494,9 @@ var MultipleSelectControl = ({
|
|
|
1493
1494
|
};
|
|
1494
1495
|
var SelectOptions = ({
|
|
1495
1496
|
options
|
|
1496
|
-
}) => /* @__PURE__ */
|
|
1497
|
-
children: /* @__PURE__ */
|
|
1498
|
-
children: options.map((option) => /* @__PURE__ */
|
|
1497
|
+
}) => /* @__PURE__ */ jsx14(SelectContent, {
|
|
1498
|
+
children: /* @__PURE__ */ jsx14(SelectGroup, {
|
|
1499
|
+
children: options.map((option) => /* @__PURE__ */ jsx14(SelectItem, {
|
|
1499
1500
|
value: option.value,
|
|
1500
1501
|
children: option.label
|
|
1501
1502
|
}, option.label))
|
|
@@ -1513,23 +1514,23 @@ var SelectField = ({
|
|
|
1513
1514
|
return /* @__PURE__ */ jsxs6(Field, {
|
|
1514
1515
|
"data-invalid": invalid,
|
|
1515
1516
|
children: [
|
|
1516
|
-
/* @__PURE__ */
|
|
1517
|
+
/* @__PURE__ */ jsx14(FieldLabel, {
|
|
1517
1518
|
htmlFor: field.name,
|
|
1518
1519
|
children: label
|
|
1519
1520
|
}),
|
|
1520
|
-
multiple ? /* @__PURE__ */
|
|
1521
|
+
multiple ? /* @__PURE__ */ jsx14(MultipleSelectControl, {
|
|
1521
1522
|
invalid,
|
|
1522
1523
|
options,
|
|
1523
1524
|
placeholder
|
|
1524
|
-
}) : /* @__PURE__ */
|
|
1525
|
+
}) : /* @__PURE__ */ jsx14(SingleSelectControl, {
|
|
1525
1526
|
invalid,
|
|
1526
1527
|
options,
|
|
1527
1528
|
placeholder
|
|
1528
1529
|
}),
|
|
1529
|
-
description ? /* @__PURE__ */
|
|
1530
|
+
description ? /* @__PURE__ */ jsx14(FieldDescription, {
|
|
1530
1531
|
children: description
|
|
1531
1532
|
}) : null,
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
+
/* @__PURE__ */ jsx14(FieldError, {
|
|
1533
1534
|
errors: field.getMeta().errors
|
|
1534
1535
|
})
|
|
1535
1536
|
]
|
|
@@ -1559,14 +1560,14 @@ var KeyValueField = (props) => {
|
|
|
1559
1560
|
return /* @__PURE__ */ jsxs6(Field, {
|
|
1560
1561
|
"data-invalid": invalid,
|
|
1561
1562
|
children: [
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ jsx14(FieldLabel, {
|
|
1563
1564
|
htmlFor: field.name,
|
|
1564
1565
|
children: props.label
|
|
1565
1566
|
}),
|
|
1566
1567
|
keyValues.map(([key, value], index) => /* @__PURE__ */ jsxs6("div", {
|
|
1567
1568
|
className: "flex w-full flex-row items-center gap-2",
|
|
1568
1569
|
children: [
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ jsx14(Input, {
|
|
1570
1571
|
id: field.name,
|
|
1571
1572
|
placeholder: labels.keyValueKey,
|
|
1572
1573
|
name: field.name,
|
|
@@ -1577,7 +1578,7 @@ var KeyValueField = (props) => {
|
|
|
1577
1578
|
field.handleChange(updateKeyValue(e.target.value, value, index));
|
|
1578
1579
|
}
|
|
1579
1580
|
}),
|
|
1580
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ jsx14(Input, {
|
|
1581
1582
|
id: field.name,
|
|
1582
1583
|
name: field.name,
|
|
1583
1584
|
type: "text",
|
|
@@ -1596,13 +1597,13 @@ var KeyValueField = (props) => {
|
|
|
1596
1597
|
field.handleChange(deleteKeyValue(index));
|
|
1597
1598
|
},
|
|
1598
1599
|
children: [
|
|
1599
|
-
/* @__PURE__ */
|
|
1600
|
+
/* @__PURE__ */ jsx14(Trash, {}),
|
|
1600
1601
|
labels.keyValueDelete
|
|
1601
1602
|
]
|
|
1602
1603
|
})
|
|
1603
1604
|
]
|
|
1604
1605
|
}, index)),
|
|
1605
|
-
/* @__PURE__ */
|
|
1606
|
+
/* @__PURE__ */ jsx14("div", {
|
|
1606
1607
|
className: "flex flex-row items-center gap-2",
|
|
1607
1608
|
children: /* @__PURE__ */ jsxs6(Button, {
|
|
1608
1609
|
size: "sm",
|
|
@@ -1615,21 +1616,21 @@ var KeyValueField = (props) => {
|
|
|
1615
1616
|
});
|
|
1616
1617
|
},
|
|
1617
1618
|
children: [
|
|
1618
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ jsx14(Plus, {}),
|
|
1619
1620
|
labels.keyValueAdd
|
|
1620
1621
|
]
|
|
1621
1622
|
})
|
|
1622
1623
|
}),
|
|
1623
|
-
props.description && /* @__PURE__ */
|
|
1624
|
+
props.description && /* @__PURE__ */ jsx14(FieldDescription, {
|
|
1624
1625
|
children: props.description
|
|
1625
1626
|
}),
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ jsx14(FieldError, {
|
|
1627
1628
|
errors: field.getMeta().errors
|
|
1628
1629
|
})
|
|
1629
1630
|
]
|
|
1630
1631
|
});
|
|
1631
1632
|
};
|
|
1632
|
-
var MultiSelectField = (props) => /* @__PURE__ */
|
|
1633
|
+
var MultiSelectField = (props) => /* @__PURE__ */ jsx14(SelectField, {
|
|
1633
1634
|
...props,
|
|
1634
1635
|
multiple: true
|
|
1635
1636
|
});
|
|
@@ -1652,7 +1653,7 @@ var SingleSearchableSelectControl = ({
|
|
|
1652
1653
|
invalid,
|
|
1653
1654
|
items,
|
|
1654
1655
|
locale,
|
|
1655
|
-
messages,
|
|
1656
|
+
messages: messages4,
|
|
1656
1657
|
name,
|
|
1657
1658
|
onSearchValueChange,
|
|
1658
1659
|
placeholder,
|
|
@@ -1661,13 +1662,13 @@ var SingleSearchableSelectControl = ({
|
|
|
1661
1662
|
}) => {
|
|
1662
1663
|
const field = useFieldContext();
|
|
1663
1664
|
const { selectedItems, mergedItems } = getSearchableSelectItems(field.state.value ? [field.state.value] : [], initialItems, items);
|
|
1664
|
-
return /* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ jsx14(VirtualizedCombobox, {
|
|
1665
1666
|
ariaInvalid: invalid,
|
|
1666
1667
|
ariaLabel,
|
|
1667
1668
|
emptyLabel,
|
|
1668
1669
|
items: mergedItems,
|
|
1669
1670
|
locale,
|
|
1670
|
-
...
|
|
1671
|
+
...messages4 ? { messages: messages4 } : {},
|
|
1671
1672
|
onValueChange: (option) => field.handleChange(option?.value ?? ""),
|
|
1672
1673
|
placeholder,
|
|
1673
1674
|
triggerId: name,
|
|
@@ -1684,7 +1685,7 @@ var MultipleSearchableSelectControl = ({
|
|
|
1684
1685
|
invalid,
|
|
1685
1686
|
items,
|
|
1686
1687
|
locale,
|
|
1687
|
-
messages,
|
|
1688
|
+
messages: messages4,
|
|
1688
1689
|
name,
|
|
1689
1690
|
onSearchValueChange,
|
|
1690
1691
|
placeholder,
|
|
@@ -1693,13 +1694,13 @@ var MultipleSearchableSelectControl = ({
|
|
|
1693
1694
|
}) => {
|
|
1694
1695
|
const field = useFieldContext();
|
|
1695
1696
|
const { selectedItems, mergedItems } = getSearchableSelectItems(field.state.value ?? [], initialItems, items);
|
|
1696
|
-
return /* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ jsx14(VirtualizedCombobox, {
|
|
1697
1698
|
ariaInvalid: invalid,
|
|
1698
1699
|
ariaLabel,
|
|
1699
1700
|
emptyLabel,
|
|
1700
1701
|
items: mergedItems,
|
|
1701
1702
|
locale,
|
|
1702
|
-
...
|
|
1703
|
+
...messages4 ? { messages: messages4 } : {},
|
|
1703
1704
|
multiple: true,
|
|
1704
1705
|
onValueChange: (options) => field.handleChange(options.map(({ value }) => value)),
|
|
1705
1706
|
placeholder,
|
|
@@ -1732,19 +1733,19 @@ var SearchableSelectField = ({
|
|
|
1732
1733
|
className: "min-w-0",
|
|
1733
1734
|
"data-invalid": invalid,
|
|
1734
1735
|
children: [
|
|
1735
|
-
/* @__PURE__ */
|
|
1736
|
+
/* @__PURE__ */ jsx14(FieldLabel, {
|
|
1736
1737
|
htmlFor: field.name,
|
|
1737
1738
|
children: label
|
|
1738
1739
|
}),
|
|
1739
|
-
multiple ? /* @__PURE__ */
|
|
1740
|
+
multiple ? /* @__PURE__ */ jsx14(MultipleSearchableSelectControl, {
|
|
1740
1741
|
...controlProps
|
|
1741
|
-
}) : /* @__PURE__ */
|
|
1742
|
+
}) : /* @__PURE__ */ jsx14(SingleSearchableSelectControl, {
|
|
1742
1743
|
...controlProps
|
|
1743
1744
|
}),
|
|
1744
|
-
description ? /* @__PURE__ */
|
|
1745
|
+
description ? /* @__PURE__ */ jsx14(FieldDescription, {
|
|
1745
1746
|
children: description
|
|
1746
1747
|
}) : null,
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
+
/* @__PURE__ */ jsx14(FieldError, {
|
|
1748
1749
|
errors: field.getMeta().errors
|
|
1749
1750
|
})
|
|
1750
1751
|
]
|
|
@@ -1753,24 +1754,24 @@ var SearchableSelectField = ({
|
|
|
1753
1754
|
var FileField = ({
|
|
1754
1755
|
label,
|
|
1755
1756
|
accept,
|
|
1756
|
-
filePickerMessages,
|
|
1757
|
+
filePickerMessages: filePickerMessages2,
|
|
1757
1758
|
locale: localeOverride,
|
|
1758
|
-
messages,
|
|
1759
|
+
messages: messages4,
|
|
1759
1760
|
onFileChange,
|
|
1760
1761
|
required = false
|
|
1761
1762
|
}) => {
|
|
1762
1763
|
const locale = useKrakstackLocale3(localeOverride);
|
|
1763
|
-
const labels = formMessages(locale,
|
|
1764
|
+
const labels = formMessages(locale, messages4);
|
|
1764
1765
|
const field = useFieldContext();
|
|
1765
1766
|
const invalid = !field.state.meta.isValid;
|
|
1766
1767
|
return /* @__PURE__ */ jsxs6(Field, {
|
|
1767
1768
|
"data-invalid": invalid,
|
|
1768
1769
|
children: [
|
|
1769
|
-
/* @__PURE__ */
|
|
1770
|
+
/* @__PURE__ */ jsx14(FieldLabel, {
|
|
1770
1771
|
htmlFor: field.name,
|
|
1771
1772
|
children: label
|
|
1772
1773
|
}),
|
|
1773
|
-
/* @__PURE__ */
|
|
1774
|
+
/* @__PURE__ */ jsx14(FilePicker, {
|
|
1774
1775
|
accept,
|
|
1775
1776
|
canClear: field.state.value instanceof File,
|
|
1776
1777
|
...field.state.value instanceof File ? { file: field.state.value } : {},
|
|
@@ -1778,10 +1779,10 @@ var FileField = ({
|
|
|
1778
1779
|
invalid,
|
|
1779
1780
|
locale,
|
|
1780
1781
|
messages: {
|
|
1781
|
-
...
|
|
1782
|
+
...filePickerMessages2,
|
|
1782
1783
|
[locale]: {
|
|
1783
|
-
...
|
|
1784
|
-
...
|
|
1784
|
+
...filePickerMessages2?.[locale.split("-")[0] ?? locale],
|
|
1785
|
+
...filePickerMessages2?.[locale],
|
|
1785
1786
|
accepts: labels.accepts,
|
|
1786
1787
|
deleteFile: labels.delete
|
|
1787
1788
|
}
|
|
@@ -1799,21 +1800,21 @@ var FileField = ({
|
|
|
1799
1800
|
required,
|
|
1800
1801
|
title: field.state.value instanceof File ? field.state.value.name : label
|
|
1801
1802
|
}),
|
|
1802
|
-
/* @__PURE__ */
|
|
1803
|
+
/* @__PURE__ */ jsx14(FieldError, {
|
|
1803
1804
|
errors: field.getMeta().errors
|
|
1804
1805
|
})
|
|
1805
1806
|
]
|
|
1806
1807
|
});
|
|
1807
1808
|
};
|
|
1808
1809
|
var ImageField = ({
|
|
1809
|
-
filePickerMessages,
|
|
1810
|
+
filePickerMessages: filePickerMessages2,
|
|
1810
1811
|
label,
|
|
1811
1812
|
locale: localeOverride,
|
|
1812
|
-
messages,
|
|
1813
|
+
messages: messages4,
|
|
1813
1814
|
size
|
|
1814
1815
|
}) => {
|
|
1815
1816
|
const locale = useKrakstackLocale3(localeOverride);
|
|
1816
|
-
const labels = formMessages(locale,
|
|
1817
|
+
const labels = formMessages(locale, messages4);
|
|
1817
1818
|
const field = useFieldContext();
|
|
1818
1819
|
const invalid = !field.state.meta.isValid;
|
|
1819
1820
|
const imageUrl = Schema2.is(Schema2.String)(field.state.value) ? field.state.value : undefined;
|
|
@@ -1826,11 +1827,11 @@ var ImageField = ({
|
|
|
1826
1827
|
return /* @__PURE__ */ jsxs6(Field, {
|
|
1827
1828
|
"data-invalid": invalid,
|
|
1828
1829
|
children: [
|
|
1829
|
-
/* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ jsx14(FieldLabel, {
|
|
1830
1831
|
htmlFor: field.name,
|
|
1831
1832
|
children: label
|
|
1832
1833
|
}),
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
+
/* @__PURE__ */ jsx14(FilePicker, {
|
|
1834
1835
|
accept: "image/*",
|
|
1835
1836
|
canClear: Boolean(field.state.value),
|
|
1836
1837
|
...field.state.value instanceof File ? { file: field.state.value } : {},
|
|
@@ -1839,10 +1840,10 @@ var ImageField = ({
|
|
|
1839
1840
|
invalid,
|
|
1840
1841
|
locale,
|
|
1841
1842
|
messages: {
|
|
1842
|
-
...
|
|
1843
|
+
...filePickerMessages2,
|
|
1843
1844
|
[locale]: {
|
|
1844
|
-
...
|
|
1845
|
-
...
|
|
1845
|
+
...filePickerMessages2?.[locale.split("-")[0] ?? locale],
|
|
1846
|
+
...filePickerMessages2?.[locale],
|
|
1846
1847
|
accepts: labels.accepts,
|
|
1847
1848
|
deleteFile: labels.delete
|
|
1848
1849
|
}
|
|
@@ -1853,10 +1854,10 @@ var ImageField = ({
|
|
|
1853
1854
|
onClear: () => field.handleChange(null),
|
|
1854
1855
|
title: field.state.value instanceof File ? field.state.value.name : label
|
|
1855
1856
|
}),
|
|
1856
|
-
size.suggestedWidth && size.suggestedHeight && /* @__PURE__ */
|
|
1857
|
+
size.suggestedWidth && size.suggestedHeight && /* @__PURE__ */ jsx14(FieldDescription, {
|
|
1857
1858
|
children: labels.suggestedImageSize(String(size.suggestedWidth), String(size.suggestedHeight))
|
|
1858
1859
|
}),
|
|
1859
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ jsx14(FieldError, {
|
|
1860
1861
|
errors: field.getMeta().errors
|
|
1861
1862
|
})
|
|
1862
1863
|
]
|
|
@@ -1864,36 +1865,36 @@ var ImageField = ({
|
|
|
1864
1865
|
};
|
|
1865
1866
|
var BlockNavigation = ({
|
|
1866
1867
|
locale,
|
|
1867
|
-
messages
|
|
1868
|
+
messages: messages4
|
|
1868
1869
|
}) => {
|
|
1869
|
-
const labels = useFormMessages(locale,
|
|
1870
|
+
const labels = useFormMessages(locale, messages4);
|
|
1870
1871
|
const form = useFormContext();
|
|
1871
1872
|
const shouldBlock = useStore(form.store, (formState) => formState.isDirty && !(formState.isSubmitting || formState.isSubmitted));
|
|
1872
|
-
return /* @__PURE__ */
|
|
1873
|
+
return /* @__PURE__ */ jsx14(Block, {
|
|
1873
1874
|
enableBeforeUnload: () => shouldBlock,
|
|
1874
1875
|
shouldBlockFn: () => shouldBlock,
|
|
1875
1876
|
withResolver: true,
|
|
1876
|
-
children: ({ status, proceed, reset }) => /* @__PURE__ */
|
|
1877
|
+
children: ({ status, proceed, reset }) => /* @__PURE__ */ jsx14(AlertDialog, {
|
|
1877
1878
|
open: status === "blocked",
|
|
1878
1879
|
children: /* @__PURE__ */ jsxs6(AlertDialogContent, {
|
|
1879
1880
|
children: [
|
|
1880
1881
|
/* @__PURE__ */ jsxs6(AlertDialogHeader, {
|
|
1881
1882
|
children: [
|
|
1882
|
-
/* @__PURE__ */
|
|
1883
|
+
/* @__PURE__ */ jsx14(AlertDialogTitle, {
|
|
1883
1884
|
children: labels.blockNavigationTitle
|
|
1884
1885
|
}),
|
|
1885
|
-
/* @__PURE__ */
|
|
1886
|
+
/* @__PURE__ */ jsx14(AlertDialogDescription, {
|
|
1886
1887
|
children: labels.blockNavigationDescription
|
|
1887
1888
|
})
|
|
1888
1889
|
]
|
|
1889
1890
|
}),
|
|
1890
1891
|
/* @__PURE__ */ jsxs6(AlertDialogFooter, {
|
|
1891
1892
|
children: [
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
+
/* @__PURE__ */ jsx14(AlertDialogCancel, {
|
|
1893
1894
|
onClick: reset,
|
|
1894
1895
|
children: labels.blockNavigationCancel
|
|
1895
1896
|
}),
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
+
/* @__PURE__ */ jsx14(AlertDialogAction, {
|
|
1897
1898
|
onClick: proceed,
|
|
1898
1899
|
children: labels.blockNavigationConfirm
|
|
1899
1900
|
})
|
|
@@ -1907,18 +1908,18 @@ var BlockNavigation = ({
|
|
|
1907
1908
|
var SubmitButton = ({
|
|
1908
1909
|
children,
|
|
1909
1910
|
locale,
|
|
1910
|
-
messages
|
|
1911
|
+
messages: messages4
|
|
1911
1912
|
}) => {
|
|
1912
|
-
const labels = useFormMessages(locale,
|
|
1913
|
+
const labels = useFormMessages(locale, messages4);
|
|
1913
1914
|
const form = useFormContext();
|
|
1914
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ jsx14(form.Subscribe, {
|
|
1915
1916
|
selector: (formState) => [formState.isSubmitting],
|
|
1916
1917
|
children: ([isSubmitting]) => /* @__PURE__ */ jsxs6(Button, {
|
|
1917
1918
|
type: "submit",
|
|
1918
1919
|
disabled: isSubmitting,
|
|
1919
1920
|
className: "self-start",
|
|
1920
1921
|
children: [
|
|
1921
|
-
isSubmitting && /* @__PURE__ */
|
|
1922
|
+
isSubmitting && /* @__PURE__ */ jsx14(Loader2, {
|
|
1922
1923
|
className: "animate-spin"
|
|
1923
1924
|
}),
|
|
1924
1925
|
children ?? labels.submit
|
|
@@ -1936,9 +1937,9 @@ var getFormErrorText = (error) => {
|
|
|
1936
1937
|
};
|
|
1937
1938
|
var FormError = () => {
|
|
1938
1939
|
const form = useFormContext();
|
|
1939
|
-
return /* @__PURE__ */
|
|
1940
|
+
return /* @__PURE__ */ jsx14(form.Subscribe, {
|
|
1940
1941
|
selector: (formState) => getFormErrorText(formState.errorMap.onSubmit),
|
|
1941
|
-
children: (error) => error ? /* @__PURE__ */
|
|
1942
|
+
children: (error) => error ? /* @__PURE__ */ jsx14(ErrorMessage, {
|
|
1942
1943
|
text: error
|
|
1943
1944
|
}) : null
|
|
1944
1945
|
});
|
|
@@ -1960,16 +1961,16 @@ var FieldWrapper = ({
|
|
|
1960
1961
|
localized && editingLocale && locales && /* @__PURE__ */ jsxs6(Badge, {
|
|
1961
1962
|
variant: "outline",
|
|
1962
1963
|
children: [
|
|
1963
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ jsx14(Languages, {}),
|
|
1964
1965
|
locales.find((l) => l.value === editingLocale).label
|
|
1965
1966
|
]
|
|
1966
1967
|
})
|
|
1967
1968
|
]
|
|
1968
1969
|
}),
|
|
1969
|
-
description && /* @__PURE__ */
|
|
1970
|
+
description && /* @__PURE__ */ jsx14(FieldDescription, {
|
|
1970
1971
|
children: description
|
|
1971
1972
|
}),
|
|
1972
|
-
/* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ jsx14(FieldGroup, {
|
|
1973
1974
|
children
|
|
1974
1975
|
})
|
|
1975
1976
|
]
|
|
@@ -1977,15 +1978,15 @@ var FieldWrapper = ({
|
|
|
1977
1978
|
};
|
|
1978
1979
|
var RevertButton = ({
|
|
1979
1980
|
locale,
|
|
1980
|
-
messages,
|
|
1981
|
+
messages: messages4,
|
|
1981
1982
|
original
|
|
1982
1983
|
}) => {
|
|
1983
|
-
const labels = useFormMessages(locale,
|
|
1984
|
+
const labels = useFormMessages(locale, messages4);
|
|
1984
1985
|
const field = useFieldContext();
|
|
1985
1986
|
if (field.state.value !== original) {
|
|
1986
|
-
return /* @__PURE__ */
|
|
1987
|
+
return /* @__PURE__ */ jsx14("div", {
|
|
1987
1988
|
className: "flex flex-1 justify-end",
|
|
1988
|
-
children: /* @__PURE__ */
|
|
1989
|
+
children: /* @__PURE__ */ jsx14(Button, {
|
|
1989
1990
|
variant: "link",
|
|
1990
1991
|
className: "-mr-4 h-auto py-0",
|
|
1991
1992
|
onClick: () => field.handleChange(original),
|
|
@@ -2017,12 +2018,12 @@ var { useAppForm, withForm, withFieldGroup } = createFormHook({
|
|
|
2017
2018
|
}
|
|
2018
2019
|
});
|
|
2019
2020
|
export {
|
|
2020
|
-
|
|
2021
|
-
ErrorMessage,
|
|
2022
|
-
FieldError,
|
|
2023
|
-
FieldWrapper,
|
|
2024
|
-
formMessages,
|
|
2025
|
-
useAppForm,
|
|
2021
|
+
withForm,
|
|
2026
2022
|
withFieldGroup,
|
|
2027
|
-
|
|
2023
|
+
useAppForm,
|
|
2024
|
+
formMessages,
|
|
2025
|
+
FieldWrapper,
|
|
2026
|
+
FieldError,
|
|
2027
|
+
ErrorMessage,
|
|
2028
|
+
BlockNavigation
|
|
2028
2029
|
};
|