@fldr/ui 0.3.5 → 0.3.7
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/THEMING.md +1 -1
- package/ai/component-registry.json +962 -43
- package/ai/component-registry.md +1 -1
- package/dist/.build-complete +1 -1
- package/dist/blocks-source/activity-feed/activity-feed.test.tsx +75 -0
- package/dist/blocks-source/activity-feed/activity-feed.tsx +256 -0
- package/dist/blocks-source/app-shell/app-shell.test.tsx +74 -0
- package/dist/blocks-source/app-shell/app-shell.tsx +123 -0
- package/dist/blocks-source/auth-card/auth-card.test.tsx +64 -0
- package/dist/blocks-source/auth-card/auth-card.tsx +234 -0
- package/dist/blocks-source/dashboard-page/dashboard-page.tsx +167 -0
- package/dist/blocks-source/error-page/error-page.test.tsx +60 -0
- package/dist/blocks-source/error-page/error-page.tsx +97 -0
- package/dist/blocks-source/file-table/file-item.tsx +164 -0
- package/dist/blocks-source/file-table/file-table.test.tsx +82 -0
- package/dist/blocks-source/file-table/file-table.tsx +292 -0
- package/dist/blocks-source/folder-grid/folder-grid.test.tsx +54 -0
- package/dist/blocks-source/folder-grid/folder-grid.tsx +170 -0
- package/dist/blocks-source/login-page/login-page.tsx +47 -0
- package/dist/blocks-source/onboarding-checklist/onboarding-checklist.test.tsx +50 -0
- package/dist/blocks-source/onboarding-checklist/onboarding-checklist.tsx +180 -0
- package/dist/blocks-source/settings-section/settings-section.test.tsx +43 -0
- package/dist/blocks-source/settings-section/settings-section.tsx +165 -0
- package/dist/blocks-source/share-dialog/share-dialog.test.tsx +69 -0
- package/dist/blocks-source/share-dialog/share-dialog.tsx +307 -0
- package/dist/blocks-source/stat-grid/stat-grid.test.tsx +52 -0
- package/dist/blocks-source/stat-grid/stat-grid.tsx +153 -0
- package/dist/blocks-source/upload-dropzone/upload-dropzone.test.tsx +82 -0
- package/dist/blocks-source/upload-dropzone/upload-dropzone.tsx +264 -0
- package/dist/blocks.d.ts +780 -0
- package/dist/blocks.js +1664 -0
- package/dist/chunks/delete-resource-cmlptb61ih8s84r3.js +151 -0
- package/dist/chunks/{tabs-o59bv7348nh2gppm.js → tabs-cja62qojznpj99et.js} +2 -0
- package/dist/components/tabs.js +1 -1
- package/dist/delete-resource-DY-GFy2s.d.ts +48 -0
- package/dist/index.d.ts +4 -50
- package/dist/index.js +2 -147
- package/dist/primitives.d.ts +1 -1
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/styles/theme-fldr.css +12 -0
- package/dist/theming.d.ts +29 -2
- package/dist/theming.js +19 -4
- package/package.json +5 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
|
+
import { t as Button } from "./button-hzvowfkbathmx8yg.js";
|
|
4
|
+
import { t as Banner } from "./banner-mo1xl9ww734kgsqh.js";
|
|
5
|
+
import { t as Input } from "./input-kfi46426y22ocoo4.js";
|
|
6
|
+
import { a as DialogTitle, i as DialogRoot, n as DialogClose, t as Dialog } from "./dialog-g7wavhkdv2gplwq9.js";
|
|
7
|
+
import { t as useCopyFeedback } from "./use-copy-feedback-gl55ghst0csvpv4j.js";
|
|
8
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { CheckIcon, CopyIcon, WarningCircleIcon, XIcon } from "@phosphor-icons/react";
|
|
11
|
+
//#region src/blocks/delete-resource/delete-resource.tsx
|
|
12
|
+
const KUMO_DELETE_RESOURCE_VARIANTS = { size: {
|
|
13
|
+
sm: {
|
|
14
|
+
classes: "",
|
|
15
|
+
description: "Small dialog for simple delete confirmations"
|
|
16
|
+
},
|
|
17
|
+
base: {
|
|
18
|
+
classes: "",
|
|
19
|
+
description: "Default delete confirmation dialog size"
|
|
20
|
+
}
|
|
21
|
+
} };
|
|
22
|
+
const KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS = { size: "base" };
|
|
23
|
+
function DeleteResource({ open, onOpenChange, resourceType, resourceName, onDelete, isDeleting = false, caseSensitive = true, deleteButtonText, size = KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS.size, errorMessage, className }) {
|
|
24
|
+
const [confirmationInput, setConfirmationInput] = useState("");
|
|
25
|
+
const { copied, runCopy, reset: resetCopyFeedback } = useCopyFeedback(1500);
|
|
26
|
+
const openRef = useRef(open);
|
|
27
|
+
openRef.current = open;
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!open) {
|
|
30
|
+
resetCopyFeedback();
|
|
31
|
+
setConfirmationInput("");
|
|
32
|
+
}
|
|
33
|
+
}, [open, resetCopyFeedback]);
|
|
34
|
+
const normalizeForComparison = useCallback((str) => caseSensitive ? str : str.toLowerCase(), [caseSensitive]);
|
|
35
|
+
const isConfirmed = normalizeForComparison(confirmationInput) === normalizeForComparison(resourceName);
|
|
36
|
+
const handleDelete = useCallback(async () => {
|
|
37
|
+
if (!isConfirmed || isDeleting) return;
|
|
38
|
+
await onDelete();
|
|
39
|
+
}, [
|
|
40
|
+
isConfirmed,
|
|
41
|
+
isDeleting,
|
|
42
|
+
onDelete
|
|
43
|
+
]);
|
|
44
|
+
const handleCopy = useCallback(async () => {
|
|
45
|
+
if (!openRef.current) return;
|
|
46
|
+
await runCopy(() => navigator.clipboard.writeText(resourceName), (error) => console.warn("Clipboard copy failed", error));
|
|
47
|
+
}, [resourceName, runCopy]);
|
|
48
|
+
return /* @__PURE__ */ jsx(DialogRoot, {
|
|
49
|
+
open,
|
|
50
|
+
onOpenChange,
|
|
51
|
+
children: /* @__PURE__ */ jsxs(Dialog, {
|
|
52
|
+
size,
|
|
53
|
+
className: cn("p-0", className),
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("div", {
|
|
56
|
+
className: "flex items-center justify-between border-b border-kumo-line px-6 py-4",
|
|
57
|
+
children: [/* @__PURE__ */ jsxs(DialogTitle, {
|
|
58
|
+
className: "text-lg font-semibold",
|
|
59
|
+
children: ["Delete ", resourceName]
|
|
60
|
+
}), /* @__PURE__ */ jsx(DialogClose, { render: (props) => /* @__PURE__ */ jsx(Button, {
|
|
61
|
+
...props,
|
|
62
|
+
variant: "ghost",
|
|
63
|
+
shape: "square",
|
|
64
|
+
size: "sm",
|
|
65
|
+
"aria-label": "Close",
|
|
66
|
+
disabled: isDeleting,
|
|
67
|
+
children: /* @__PURE__ */ jsx(XIcon, { size: 18 })
|
|
68
|
+
}) })]
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ jsxs("div", {
|
|
71
|
+
className: "flex flex-col gap-4 p-6",
|
|
72
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
73
|
+
className: "flex flex-col gap-2",
|
|
74
|
+
children: [errorMessage && /* @__PURE__ */ jsx(Banner, {
|
|
75
|
+
icon: /* @__PURE__ */ jsx(WarningCircleIcon, {}),
|
|
76
|
+
variant: "error",
|
|
77
|
+
children: errorMessage
|
|
78
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
79
|
+
className: "max-w-prose text-base text-pretty text-kumo-subtle",
|
|
80
|
+
children: [
|
|
81
|
+
"This action cannot be undone. This will permanently delete the",
|
|
82
|
+
" ",
|
|
83
|
+
/* @__PURE__ */ jsx("span", {
|
|
84
|
+
className: "font-medium text-kumo-default",
|
|
85
|
+
children: resourceName
|
|
86
|
+
}),
|
|
87
|
+
" ",
|
|
88
|
+
resourceType.toLowerCase(),
|
|
89
|
+
"."
|
|
90
|
+
]
|
|
91
|
+
})]
|
|
92
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
93
|
+
className: "flex flex-col gap-2",
|
|
94
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
95
|
+
className: "flex items-center gap-1.5 text-base",
|
|
96
|
+
children: /* @__PURE__ */ jsxs("span", { children: [
|
|
97
|
+
"Type",
|
|
98
|
+
" ",
|
|
99
|
+
/* @__PURE__ */ jsxs("button", {
|
|
100
|
+
className: "group inline rounded-md bg-kumo-tint px-2 py-1 font-mono text-sm font-semibold hover:cursor-pointer hover:bg-kumo-fill",
|
|
101
|
+
onClick: handleCopy,
|
|
102
|
+
"aria-label": `Copy ${resourceName} to clipboard`,
|
|
103
|
+
children: [resourceName, copied ? /* @__PURE__ */ jsx(CheckIcon, {
|
|
104
|
+
size: 12,
|
|
105
|
+
weight: "bold",
|
|
106
|
+
className: "ml-1.5 inline"
|
|
107
|
+
}) : /* @__PURE__ */ jsx(CopyIcon, {
|
|
108
|
+
size: 12,
|
|
109
|
+
weight: "bold",
|
|
110
|
+
className: "ml-1.5 inline text-kumo-subtle group-hover:text-kumo-default"
|
|
111
|
+
})]
|
|
112
|
+
}),
|
|
113
|
+
" ",
|
|
114
|
+
"to confirm:"
|
|
115
|
+
] })
|
|
116
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
117
|
+
placeholder: resourceName,
|
|
118
|
+
value: confirmationInput,
|
|
119
|
+
onChange: (e) => setConfirmationInput(e.target.value),
|
|
120
|
+
disabled: isDeleting,
|
|
121
|
+
autoComplete: "off",
|
|
122
|
+
autoCorrect: "off",
|
|
123
|
+
autoCapitalize: "off",
|
|
124
|
+
spellCheck: false,
|
|
125
|
+
"aria-label": `Type ${resourceName} to confirm deletion`,
|
|
126
|
+
className: "w-full"
|
|
127
|
+
})]
|
|
128
|
+
})]
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ jsxs("div", {
|
|
131
|
+
className: "flex justify-end gap-3 border-t border-kumo-line px-6 py-4",
|
|
132
|
+
children: [/* @__PURE__ */ jsx(DialogClose, { render: (props) => /* @__PURE__ */ jsx(Button, {
|
|
133
|
+
...props,
|
|
134
|
+
variant: "secondary",
|
|
135
|
+
disabled: isDeleting,
|
|
136
|
+
children: "Cancel"
|
|
137
|
+
}) }), /* @__PURE__ */ jsx(Button, {
|
|
138
|
+
variant: "destructive",
|
|
139
|
+
onClick: handleDelete,
|
|
140
|
+
disabled: !isConfirmed || isDeleting,
|
|
141
|
+
loading: isDeleting,
|
|
142
|
+
children: deleteButtonText || `Delete ${resourceType}`
|
|
143
|
+
})]
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
DeleteResource.displayName = "DeleteResource";
|
|
150
|
+
//#endregion
|
|
151
|
+
export { KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS as n, KUMO_DELETE_RESOURCE_VARIANTS as r, DeleteResource as t };
|
|
@@ -252,11 +252,13 @@ function useOverflowDetect(enabled, watchKey) {
|
|
|
252
252
|
subtree: true
|
|
253
253
|
});
|
|
254
254
|
el.addEventListener("scroll", check, { passive: true });
|
|
255
|
+
el.addEventListener("transitionend", check);
|
|
255
256
|
check();
|
|
256
257
|
return () => {
|
|
257
258
|
ro.disconnect();
|
|
258
259
|
mo.disconnect();
|
|
259
260
|
el.removeEventListener("scroll", check);
|
|
261
|
+
el.removeEventListener("transitionend", check);
|
|
260
262
|
};
|
|
261
263
|
}, [enabled]);
|
|
262
264
|
return {
|
package/dist/components/tabs.js
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region src/blocks/delete-resource/delete-resource.d.ts
|
|
2
|
+
declare const KUMO_DELETE_RESOURCE_VARIANTS: {
|
|
3
|
+
readonly size: {
|
|
4
|
+
readonly sm: {
|
|
5
|
+
readonly classes: "";
|
|
6
|
+
readonly description: "Small dialog for simple delete confirmations";
|
|
7
|
+
};
|
|
8
|
+
readonly base: {
|
|
9
|
+
readonly classes: "";
|
|
10
|
+
readonly description: "Default delete confirmation dialog size";
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
declare const KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS: {
|
|
15
|
+
readonly size: "base";
|
|
16
|
+
};
|
|
17
|
+
type KumoDeleteResourceSize = keyof typeof KUMO_DELETE_RESOURCE_VARIANTS.size;
|
|
18
|
+
interface KumoDeleteResourceVariantsProps {
|
|
19
|
+
size?: KumoDeleteResourceSize;
|
|
20
|
+
}
|
|
21
|
+
interface DeleteResourceProps extends KumoDeleteResourceVariantsProps {
|
|
22
|
+
/** Whether the dialog is open */
|
|
23
|
+
open: boolean;
|
|
24
|
+
/** Callback when open state changes */
|
|
25
|
+
onOpenChange: (open: boolean) => void;
|
|
26
|
+
/** The type of resource being deleted (e.g., "Zone", "Worker", "KV Namespace") */
|
|
27
|
+
resourceType: string;
|
|
28
|
+
/** The name of the specific resource being deleted */
|
|
29
|
+
resourceName: string;
|
|
30
|
+
/** Callback when delete is confirmed */
|
|
31
|
+
onDelete: () => void | Promise<void>;
|
|
32
|
+
/** Whether the delete action is in progress */
|
|
33
|
+
isDeleting?: boolean;
|
|
34
|
+
/** Whether the confirmation input should be case-sensitive (default: true) */
|
|
35
|
+
caseSensitive?: boolean;
|
|
36
|
+
/** Custom delete button text (defaults to "Delete {resourceType}") */
|
|
37
|
+
deleteButtonText?: string;
|
|
38
|
+
/** Additional className for the dialog */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** Error message to display if the delete action fails */
|
|
41
|
+
errorMessage?: string;
|
|
42
|
+
}
|
|
43
|
+
declare function DeleteResource({ open, onOpenChange, resourceType, resourceName, onDelete, isDeleting, caseSensitive, deleteButtonText, size, errorMessage, className }: DeleteResourceProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare namespace DeleteResource {
|
|
45
|
+
var displayName: string;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { KumoDeleteResourceSize as a, KUMO_DELETE_RESOURCE_VARIANTS as i, DeleteResourceProps as n, KumoDeleteResourceVariantsProps as o, KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS as r, DeleteResource as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { A as SidebarProviderProps, C as SidebarMenuItem, D as SidebarMenuSubButtonProps, E as SidebarMenuSubButton, F as SidebarScrollAlign, G as SidebarVariant, I as SidebarScrollToItemOptions, K as useSidebar, L as SidebarSeparator, M as SidebarResizeHandle, N as SidebarRoot, O as SidebarMenuSubItem, P as SidebarRootProps, R as SidebarSide, S as SidebarMenuChevron, T as SidebarMenuSub, U as SidebarState, V as SidebarSlidingViews, W as SidebarTrigger, _ as SidebarMenu, a as SidebarCollapsible, b as SidebarMenuButtonProps, c as SidebarCollapsibleTrigger, d as SidebarContextValue, f as SidebarFooter, g as SidebarLoading, h as SidebarHeader, i as Sidebar, j as SidebarRail, k as SidebarProvider, m as SidebarGroupLabel, n as KUMO_SIDEBAR_STYLING, o as SidebarCollapsibleContent, p as SidebarGroup, r as KUMO_SIDEBAR_VARIANTS, t as KUMO_SIDEBAR_DEFAULT_VARIANTS, u as SidebarContent, v as SidebarMenuBadge, w as SidebarMenuItemProps, x as SidebarMenuButtonSize, y as SidebarMenuButton, z as SidebarSlidingView } from "./index-BkTAB4wj.js";
|
|
2
|
+
import { i as KUMO_DELETE_RESOURCE_VARIANTS, n as DeleteResourceProps, r as KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS, t as DeleteResource } from "./delete-resource-DY-GFy2s.js";
|
|
3
|
+
import { n as TabsItem, r as TabsProps, t as Tabs } from "./index-gYC6cQVO.js";
|
|
1
4
|
import { a as PropSchema, i as ComponentType, n as ComponentSchema, o as SubComponentSchema, r as ComponentStyling, t as ComponentRegistry } from "./types-CBwdSmf-.js";
|
|
2
5
|
import { a as KUMO_FIELD_VARIANTS, i as KUMO_FIELD_DEFAULT_VARIANTS, n as FieldErrorMatch, o as fieldVariants, r as FieldProps, t as Field } from "./field-DIjlHM8W.js";
|
|
3
6
|
import { a as KUMO_AUTOCOMPLETE_VARIANTS, i as KUMO_AUTOCOMPLETE_DEFAULT_VARIANTS, n as Autocomplete, o as KumoAutocompleteSize, r as AutocompleteProps, s as autocompleteVariants } from "./index-T1sSoiWG.js";
|
|
@@ -45,64 +48,15 @@ import { _ as PopoverTriggerProps, a as Popover, d as PopoverDescriptionProps, h
|
|
|
45
48
|
import { a as KumoRadioVariantsProps, c as RadioGroup, d as RadioItemProps, f as RadioLegendProps, i as KumoRadioVariant, l as RadioGroupChangeEventDetails, m as radioVariants, n as KUMO_RADIO_VARIANTS, o as Radio, p as RadioVariant, r as KumoRadioAppearance, s as RadioControlPosition, t as KUMO_RADIO_DEFAULT_VARIANTS, u as RadioGroupProps } from "./index-CU_lnxg7.js";
|
|
46
49
|
import { t as Select } from "./index-DwNMa4LN.js";
|
|
47
50
|
import { i as SensitiveInputProps, n as KUMO_SENSITIVE_INPUT_VARIANTS, r as SensitiveInput, t as KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS } from "./index-D2Gvly0i.js";
|
|
48
|
-
import { A as SidebarProviderProps, C as SidebarMenuItem, D as SidebarMenuSubButtonProps, E as SidebarMenuSubButton, F as SidebarScrollAlign, G as SidebarVariant, I as SidebarScrollToItemOptions, K as useSidebar, L as SidebarSeparator, M as SidebarResizeHandle, N as SidebarRoot, O as SidebarMenuSubItem, P as SidebarRootProps, R as SidebarSide, S as SidebarMenuChevron, T as SidebarMenuSub, U as SidebarState, V as SidebarSlidingViews, W as SidebarTrigger, _ as SidebarMenu, a as SidebarCollapsible, b as SidebarMenuButtonProps, c as SidebarCollapsibleTrigger, d as SidebarContextValue, f as SidebarFooter, g as SidebarLoading, h as SidebarHeader, i as Sidebar, j as SidebarRail, k as SidebarProvider, m as SidebarGroupLabel, n as KUMO_SIDEBAR_STYLING, o as SidebarCollapsibleContent, p as SidebarGroup, r as KUMO_SIDEBAR_VARIANTS, t as KUMO_SIDEBAR_DEFAULT_VARIANTS, u as SidebarContent, v as SidebarMenuBadge, w as SidebarMenuItemProps, x as SidebarMenuButtonSize, y as SidebarMenuButton, z as SidebarSlidingView } from "./index-BkTAB4wj.js";
|
|
49
51
|
import { a as Slider, i as KumoSliderVariantsProps, n as KUMO_SLIDER_VARIANTS, o as SliderProps, r as KumoSliderSize, s as sliderVariants, t as KUMO_SLIDER_DEFAULT_VARIANTS } from "./index-BWe6haHU.js";
|
|
50
52
|
import { t as Surface } from "./index-CzIWigmH.js";
|
|
51
53
|
import { a as Switch, c as SwitchLegendProps } from "./index-AMEc1MEg.js";
|
|
52
54
|
import { a as KUMO_TABLE_OF_CONTENTS_VARIANTS, c as TableOfContentsGroupProps, d as TableOfContentsProps, f as TableOfContentsTitleProps, i as KUMO_TABLE_OF_CONTENTS_DEFAULT_VARIANTS, l as TableOfContentsItemProps, n as UseTableOfContentsActiveIdResult, o as KumoTableOfContentsState, r as useTableOfContentsActiveId, s as TableOfContents, t as UseTableOfContentsActiveIdOptions, u as TableOfContentsListProps } from "./index-DIV3riUd.js";
|
|
53
55
|
import { a as Table } from "./index-RP_rt8vB.js";
|
|
54
|
-
import { n as TabsItem, r as TabsProps, t as Tabs } from "./index-gYC6cQVO.js";
|
|
55
56
|
import { n as TagInputLabels, r as TagInputProps, t as TagInput } from "./index-2jvVmJ8P.js";
|
|
56
57
|
import "./components/text.js";
|
|
57
58
|
import { a as Toasty, i as ToastProvider, o as createKumoToastManager, s as useKumoToastManager, t as Toast } from "./index-B6JNUfG9.js";
|
|
58
59
|
import { a as ToolbarInputGroupProps, c as ToolbarProps, i as ToolbarButtonProps, l as ToolbarSize, n as KUMO_TOOLBAR_VARIANTS, o as ToolbarInputProps, r as Toolbar, s as ToolbarLinkProps, t as KUMO_TOOLBAR_DEFAULT_VARIANTS } from "./index-aahL-0Zw.js";
|
|
59
60
|
import "./components/tooltip.js";
|
|
60
61
|
import { a as cn, i as KumoTranslationsPartial, n as KumoLocaleProviderProps, o as safeRandomId, r as KumoTranslations, t as KumoLocaleProvider } from "./locale-provider-CHMCQ0-J.js";
|
|
61
|
-
|
|
62
|
-
export declare const KUMO_DELETE_RESOURCE_VARIANTS: {
|
|
63
|
-
readonly size: {
|
|
64
|
-
readonly sm: {
|
|
65
|
-
readonly classes: "";
|
|
66
|
-
readonly description: "Small dialog for simple delete confirmations";
|
|
67
|
-
};
|
|
68
|
-
readonly base: {
|
|
69
|
-
readonly classes: "";
|
|
70
|
-
readonly description: "Default delete confirmation dialog size";
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
export declare const KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS: {
|
|
75
|
-
readonly size: "base";
|
|
76
|
-
};
|
|
77
|
-
type KumoDeleteResourceSize = keyof typeof KUMO_DELETE_RESOURCE_VARIANTS.size;
|
|
78
|
-
interface KumoDeleteResourceVariantsProps {
|
|
79
|
-
size?: KumoDeleteResourceSize;
|
|
80
|
-
}
|
|
81
|
-
interface DeleteResourceProps extends KumoDeleteResourceVariantsProps {
|
|
82
|
-
/** Whether the dialog is open */
|
|
83
|
-
open: boolean;
|
|
84
|
-
/** Callback when open state changes */
|
|
85
|
-
onOpenChange: (open: boolean) => void;
|
|
86
|
-
/** The type of resource being deleted (e.g., "Zone", "Worker", "KV Namespace") */
|
|
87
|
-
resourceType: string;
|
|
88
|
-
/** The name of the specific resource being deleted */
|
|
89
|
-
resourceName: string;
|
|
90
|
-
/** Callback when delete is confirmed */
|
|
91
|
-
onDelete: () => void | Promise<void>;
|
|
92
|
-
/** Whether the delete action is in progress */
|
|
93
|
-
isDeleting?: boolean;
|
|
94
|
-
/** Whether the confirmation input should be case-sensitive (default: true) */
|
|
95
|
-
caseSensitive?: boolean;
|
|
96
|
-
/** Custom delete button text (defaults to "Delete {resourceType}") */
|
|
97
|
-
deleteButtonText?: string;
|
|
98
|
-
/** Additional className for the dialog */
|
|
99
|
-
className?: string;
|
|
100
|
-
/** Error message to display if the delete action fails */
|
|
101
|
-
errorMessage?: string;
|
|
102
|
-
}
|
|
103
|
-
export declare function DeleteResource({ open, onOpenChange, resourceType, resourceName, onDelete, isDeleting, caseSensitive, deleteButtonText, size, errorMessage, className }: DeleteResourceProps): import("react/jsx-runtime").JSX.Element;
|
|
104
|
-
export declare namespace DeleteResource {
|
|
105
|
-
var displayName: string;
|
|
106
|
-
}
|
|
107
|
-
//#endregion
|
|
108
|
-
export { Autocomplete, type AutocompleteProps, Badge, type BadgeVariant, Banner, BannerVariant, Breadcrumb as Breadcrumbs, type BreadcrumbsProps, BubbleMap, type BubbleMapProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Chart, ChartLegend, ChartPalette, Checkbox, type CheckboxChangeEventDetails, type CheckboxLegendProps, type CheckboxProps, ChoroplethMap, type ChoroplethMapProps, ClipboardText, CloudflareLogo, type CloudflareLogoColor, type CloudflareLogoProps, type CloudflareLogoSvgColor, type CloudflareLogoSvgVariant, type CloudflareLogoVariant, Code, CodeBlock, Collapsible, type CollapsibleDefaultPanelProps, type CollapsibleDefaultTriggerProps, type CollapsiblePanelProps, type CollapsibleProps, type CollapsibleRootProps, type CollapsibleTriggerProps, Combobox, CommandPalette, type CommandPaletteEmptyProps, type CommandPaletteFooterProps, type CommandPaletteGroupLabelProps, type CommandPaletteGroupProps, type CommandPaletteInputProps, type CommandPaletteItemProps, type CommandPaletteListProps, type CommandPaletteLoadingProps, type CommandPaletteResultItemProps, type CommandPaletteRootProps, type ComponentRegistry, type ComponentSchema, type ComponentStyling, type ComponentType, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DayPickerProps, type DeleteResourceProps, Dialog, DialogClose, type DialogCloseProps, DialogDescription, type DialogDescriptionProps, type DialogProps, DialogRoot, type DialogRootProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, DropdownMenu, Empty, type EmptyProps, Field, type FieldErrorMatch, type FieldProps, Flow, type GenerateCloudflareLogoSvgOptions, GlobeMap, type GlobeMapMarker, type GlobeMapProps, Grid, GridItem, type GridItemProps, type GridProps, type HighlightRange, InlineCopyText, type InlineCopyTextLabels, type InlineCopyTextProps, Input, InputArea, type InputAreaProps, InputGroup, type InputGroupAddonProps, type InputGroupButtonProps, type InputGroupInputProps, type InputGroupRootProps, type InputGroupSuffixProps, type InputProps, KUMO_AUTOCOMPLETE_DEFAULT_VARIANTS, KUMO_AUTOCOMPLETE_VARIANTS, KUMO_BUTTON_GROUP_DEFAULT_VARIANTS, KUMO_BUTTON_GROUP_STYLING, KUMO_BUTTON_GROUP_VARIANTS, KUMO_CLOUDFLARE_LOGO_DEFAULT_VARIANTS, KUMO_CLOUDFLARE_LOGO_VARIANTS, KUMO_COMMAND_PALETTE_DEFAULT_VARIANTS, KUMO_COMMAND_PALETTE_VARIANTS, KUMO_FIELD_DEFAULT_VARIANTS, KUMO_FIELD_VARIANTS, KUMO_GRID_DEFAULT_VARIANTS, KUMO_GRID_VARIANTS, KUMO_INLINE_COPY_TEXT_DEFAULT_VARIANTS, KUMO_INLINE_COPY_TEXT_STYLING, KUMO_INLINE_COPY_TEXT_VARIANTS, KUMO_LABEL_DEFAULT_VARIANTS, KUMO_LABEL_VARIANTS, KUMO_LINK_DEFAULT_VARIANTS, KUMO_LINK_VARIANTS, KUMO_POPOVER_DEFAULT_VARIANTS, KUMO_POPOVER_VARIANTS, KUMO_RADIO_DEFAULT_VARIANTS, KUMO_RADIO_VARIANTS, KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS, KUMO_SENSITIVE_INPUT_VARIANTS, KUMO_SIDEBAR_DEFAULT_VARIANTS, KUMO_SIDEBAR_STYLING, KUMO_SIDEBAR_VARIANTS, KUMO_SLIDER_DEFAULT_VARIANTS, KUMO_SLIDER_VARIANTS, KUMO_TABLE_OF_CONTENTS_DEFAULT_VARIANTS, KUMO_TABLE_OF_CONTENTS_VARIANTS, KUMO_TOOLBAR_DEFAULT_VARIANTS, KUMO_TOOLBAR_VARIANTS, type KumoAutocompleteSize, type KumoChartOption, type KumoGridGap, type KumoGridVariant, type KumoLayerDialogPrimaryVariant, type KumoLayerDialogSize, type KumoLayerDialogVerticalAlign, type KumoLinkVariant, type KumoLinkVariantsProps, KumoLocaleProvider, type KumoLocaleProviderProps, KumoPortalProvider, type KumoRadioAppearance, type KumoRadioVariant, type KumoRadioVariantsProps, type KumoSliderSize, type KumoSliderVariantsProps, type KumoTableOfContentsState, type KumoTranslations, type KumoTranslationsPartial, Label, type LabelProps, LayerCard, LayerDialog, type LayerDialogActionProps, type LayerDialogActionsProps, type LayerDialogBodyProps, type LayerDialogContentProps, type LayerDialogDescriptionProps, type LayerDialogPrimaryProps, type LayerDialogProps, type LayerDialogRootProps, type LayerDialogTitleProps, Link, LinkButton, type LinkButtonProps, type LinkComponentProps, type LinkProps, LinkProvider, Loader, type MapAccessor, type MapGeoJson, type MapProjection, type MapStyle, MenuBar, Meter, Pagination, Popover, type PopoverCloseProps, type PopoverContentProps, type PopoverDescriptionProps, type PopoverRootProps, type PopoverTitleProps, type PopoverTriggerProps, type PortalContainer, PoweredByCloudflare, type PoweredByCloudflareProps, type PropSchema, Radio, type RadioControlPosition, RadioGroup, type RadioGroupChangeEventDetails, type RadioGroupProps, type RadioItemProps, type RadioLegendProps, type RadioVariant, RefreshButton, SankeyChart, type SankeyChartProps, type SankeyLinkData, type SankeyNodeData, type SankeyTooltipParams, Select, SensitiveInput, type SensitiveInputProps, Sidebar, SidebarCollapsible, type SidebarCollapsible as SidebarCollapsibleType, SidebarCollapsibleContent, SidebarCollapsibleTrigger, SidebarContent, type SidebarContextValue, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarLoading, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, type SidebarMenuButtonProps, type SidebarMenuButtonSize, SidebarMenuChevron, SidebarMenuItem, type SidebarMenuItemProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarResizeHandle, SidebarRoot, type SidebarRootProps, type SidebarScrollAlign, type SidebarScrollToItemOptions, SidebarSeparator, type SidebarSide, SidebarSlidingView, SidebarSlidingViews, type SidebarState, SidebarTrigger, type SidebarVariant, SkeletonLine, Slider, type SliderProps, type SubComponentSchema, Surface, Switch, type SwitchLegendProps, Table, TableOfContents, type TableOfContentsGroupProps, type TableOfContentsItemProps, type TableOfContentsListProps, type TableOfContentsProps, type TableOfContentsTitleProps, Tabs, type TabsItem, type TabsProps, TagInput, type TagInputLabels, type TagInputProps, Text, Textarea, TimeseriesChart, Toast, ToastProvider, Toasty, Toolbar, type ToolbarButtonProps, type ToolbarInputGroupProps, type ToolbarInputProps, type ToolbarLinkProps, type ToolbarProps, type ToolbarSize, Tooltip, TooltipProvider, type UseTableOfContentsActiveIdOptions, type UseTableOfContentsActiveIdResult, autocompleteVariants, buttonVariants, cn, createKumoToastManager, fieldVariants, generateCloudflareLogoSvg, gridItemVariants, gridVariants, inputVariants, labelContentVariants, labelVariants, linkVariants, radioVariants, safeRandomId, sliderVariants, useKumoToastManager, useLinkComponent, useMenuNavigation, useSidebar, useTableOfContentsActiveId };
|
|
62
|
+
export { Autocomplete, type AutocompleteProps, Badge, type BadgeVariant, Banner, BannerVariant, Breadcrumb as Breadcrumbs, type BreadcrumbsProps, BubbleMap, type BubbleMapProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Chart, ChartLegend, ChartPalette, Checkbox, type CheckboxChangeEventDetails, type CheckboxLegendProps, type CheckboxProps, ChoroplethMap, type ChoroplethMapProps, ClipboardText, CloudflareLogo, type CloudflareLogoColor, type CloudflareLogoProps, type CloudflareLogoSvgColor, type CloudflareLogoSvgVariant, type CloudflareLogoVariant, Code, CodeBlock, Collapsible, type CollapsibleDefaultPanelProps, type CollapsibleDefaultTriggerProps, type CollapsiblePanelProps, type CollapsibleProps, type CollapsibleRootProps, type CollapsibleTriggerProps, Combobox, CommandPalette, type CommandPaletteEmptyProps, type CommandPaletteFooterProps, type CommandPaletteGroupLabelProps, type CommandPaletteGroupProps, type CommandPaletteInputProps, type CommandPaletteItemProps, type CommandPaletteListProps, type CommandPaletteLoadingProps, type CommandPaletteResultItemProps, type CommandPaletteRootProps, type ComponentRegistry, type ComponentSchema, type ComponentStyling, type ComponentType, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DayPickerProps, DeleteResource, type DeleteResourceProps, Dialog, DialogClose, type DialogCloseProps, DialogDescription, type DialogDescriptionProps, type DialogProps, DialogRoot, type DialogRootProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, DropdownMenu, Empty, type EmptyProps, Field, type FieldErrorMatch, type FieldProps, Flow, type GenerateCloudflareLogoSvgOptions, GlobeMap, type GlobeMapMarker, type GlobeMapProps, Grid, GridItem, type GridItemProps, type GridProps, type HighlightRange, InlineCopyText, type InlineCopyTextLabels, type InlineCopyTextProps, Input, InputArea, type InputAreaProps, InputGroup, type InputGroupAddonProps, type InputGroupButtonProps, type InputGroupInputProps, type InputGroupRootProps, type InputGroupSuffixProps, type InputProps, KUMO_AUTOCOMPLETE_DEFAULT_VARIANTS, KUMO_AUTOCOMPLETE_VARIANTS, KUMO_BUTTON_GROUP_DEFAULT_VARIANTS, KUMO_BUTTON_GROUP_STYLING, KUMO_BUTTON_GROUP_VARIANTS, KUMO_CLOUDFLARE_LOGO_DEFAULT_VARIANTS, KUMO_CLOUDFLARE_LOGO_VARIANTS, KUMO_COMMAND_PALETTE_DEFAULT_VARIANTS, KUMO_COMMAND_PALETTE_VARIANTS, KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS, KUMO_DELETE_RESOURCE_VARIANTS, KUMO_FIELD_DEFAULT_VARIANTS, KUMO_FIELD_VARIANTS, KUMO_GRID_DEFAULT_VARIANTS, KUMO_GRID_VARIANTS, KUMO_INLINE_COPY_TEXT_DEFAULT_VARIANTS, KUMO_INLINE_COPY_TEXT_STYLING, KUMO_INLINE_COPY_TEXT_VARIANTS, KUMO_LABEL_DEFAULT_VARIANTS, KUMO_LABEL_VARIANTS, KUMO_LINK_DEFAULT_VARIANTS, KUMO_LINK_VARIANTS, KUMO_POPOVER_DEFAULT_VARIANTS, KUMO_POPOVER_VARIANTS, KUMO_RADIO_DEFAULT_VARIANTS, KUMO_RADIO_VARIANTS, KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS, KUMO_SENSITIVE_INPUT_VARIANTS, KUMO_SIDEBAR_DEFAULT_VARIANTS, KUMO_SIDEBAR_STYLING, KUMO_SIDEBAR_VARIANTS, KUMO_SLIDER_DEFAULT_VARIANTS, KUMO_SLIDER_VARIANTS, KUMO_TABLE_OF_CONTENTS_DEFAULT_VARIANTS, KUMO_TABLE_OF_CONTENTS_VARIANTS, KUMO_TOOLBAR_DEFAULT_VARIANTS, KUMO_TOOLBAR_VARIANTS, type KumoAutocompleteSize, type KumoChartOption, type KumoGridGap, type KumoGridVariant, type KumoLayerDialogPrimaryVariant, type KumoLayerDialogSize, type KumoLayerDialogVerticalAlign, type KumoLinkVariant, type KumoLinkVariantsProps, KumoLocaleProvider, type KumoLocaleProviderProps, KumoPortalProvider, type KumoRadioAppearance, type KumoRadioVariant, type KumoRadioVariantsProps, type KumoSliderSize, type KumoSliderVariantsProps, type KumoTableOfContentsState, type KumoTranslations, type KumoTranslationsPartial, Label, type LabelProps, LayerCard, LayerDialog, type LayerDialogActionProps, type LayerDialogActionsProps, type LayerDialogBodyProps, type LayerDialogContentProps, type LayerDialogDescriptionProps, type LayerDialogPrimaryProps, type LayerDialogProps, type LayerDialogRootProps, type LayerDialogTitleProps, Link, LinkButton, type LinkButtonProps, type LinkComponentProps, type LinkProps, LinkProvider, Loader, type MapAccessor, type MapGeoJson, type MapProjection, type MapStyle, MenuBar, Meter, Pagination, Popover, type PopoverCloseProps, type PopoverContentProps, type PopoverDescriptionProps, type PopoverRootProps, type PopoverTitleProps, type PopoverTriggerProps, type PortalContainer, PoweredByCloudflare, type PoweredByCloudflareProps, type PropSchema, Radio, type RadioControlPosition, RadioGroup, type RadioGroupChangeEventDetails, type RadioGroupProps, type RadioItemProps, type RadioLegendProps, type RadioVariant, RefreshButton, SankeyChart, type SankeyChartProps, type SankeyLinkData, type SankeyNodeData, type SankeyTooltipParams, Select, SensitiveInput, type SensitiveInputProps, Sidebar, SidebarCollapsible, type SidebarCollapsible as SidebarCollapsibleType, SidebarCollapsibleContent, SidebarCollapsibleTrigger, SidebarContent, type SidebarContextValue, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarLoading, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, type SidebarMenuButtonProps, type SidebarMenuButtonSize, SidebarMenuChevron, SidebarMenuItem, type SidebarMenuItemProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarResizeHandle, SidebarRoot, type SidebarRootProps, type SidebarScrollAlign, type SidebarScrollToItemOptions, SidebarSeparator, type SidebarSide, SidebarSlidingView, SidebarSlidingViews, type SidebarState, SidebarTrigger, type SidebarVariant, SkeletonLine, Slider, type SliderProps, type SubComponentSchema, Surface, Switch, type SwitchLegendProps, Table, TableOfContents, type TableOfContentsGroupProps, type TableOfContentsItemProps, type TableOfContentsListProps, type TableOfContentsProps, type TableOfContentsTitleProps, Tabs, type TabsItem, type TabsProps, TagInput, type TagInputLabels, type TagInputProps, Text, Textarea, TimeseriesChart, Toast, ToastProvider, Toasty, Toolbar, type ToolbarButtonProps, type ToolbarInputGroupProps, type ToolbarInputProps, type ToolbarLinkProps, type ToolbarProps, type ToolbarSize, Tooltip, TooltipProvider, type UseTableOfContentsActiveIdOptions, type UseTableOfContentsActiveIdResult, autocompleteVariants, buttonVariants, cn, createKumoToastManager, fieldVariants, generateCloudflareLogoSvg, gridItemVariants, gridVariants, inputVariants, labelContentVariants, labelVariants, linkVariants, radioVariants, safeRandomId, sliderVariants, useKumoToastManager, useLinkComponent, useMenuNavigation, useSidebar, useTableOfContentsActiveId };
|
package/dist/index.js
CHANGED
|
@@ -27,10 +27,9 @@ import { n as KUMO_TOOLBAR_VARIANTS, r as Toolbar, t as KUMO_TOOLBAR_DEFAULT_VAR
|
|
|
27
27
|
import { t as LayerCard } from "./chunks/layer-card-lsmeuqic9i1isv2b.js";
|
|
28
28
|
import { a as DialogTitle, i as DialogRoot, n as DialogClose, o as DialogTrigger, r as DialogDescription, t as Dialog } from "./chunks/dialog-g7wavhkdv2gplwq9.js";
|
|
29
29
|
import { t as DropdownMenu } from "./chunks/dropdown-e5zk0ez21busnt0b.js";
|
|
30
|
-
import "./components/dropdown.js";
|
|
31
30
|
import { t as Collapsible } from "./chunks/collapsible-ic6813hc4yv5s5hv.js";
|
|
32
31
|
import "./components/field.js";
|
|
33
|
-
import { t as
|
|
32
|
+
import { n as KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS, r as KUMO_DELETE_RESOURCE_VARIANTS, t as DeleteResource } from "./chunks/delete-resource-cmlptb61ih8s84r3.js";
|
|
34
33
|
import { t as SkeletonLine } from "./chunks/skeleton-line-kmhnp0lx3rxhioxa.js";
|
|
35
34
|
import { n as useMenuNavigation, t as MenuBar } from "./chunks/menubar-gzlyhmmc4i24prn1.js";
|
|
36
35
|
import { t as Meter } from "./chunks/meter-poh8jpe0qtq6mvee.js";
|
|
@@ -38,14 +37,13 @@ import { t as Select } from "./chunks/select-h2pejw38n5z3l59r.js";
|
|
|
38
37
|
import { t as Pagination } from "./chunks/pagination-n96r3xdok9nc3pu5.js";
|
|
39
38
|
import { t as Surface } from "./chunks/surface-jr8x5hy0gucjk5ig.js";
|
|
40
39
|
import { r as Switch } from "./chunks/switch-nc8thi7ogd51m3gi.js";
|
|
41
|
-
import { t as Tabs } from "./chunks/tabs-
|
|
40
|
+
import { t as Tabs } from "./chunks/tabs-cja62qojznpj99et.js";
|
|
42
41
|
import { r as Table } from "./chunks/table-ngl1b5yc8mcur662.js";
|
|
43
42
|
import { i as useKumoToastManager, n as Toasty, r as createKumoToastManager, t as ToastProvider } from "./chunks/toast-ljpenshot856xqq4.js";
|
|
44
43
|
import { n as KUMO_POPOVER_VARIANTS, r as Popover, t as KUMO_POPOVER_DEFAULT_VARIANTS } from "./chunks/popover-nqrt3ykqv6sic8pz.js";
|
|
45
44
|
import { n as KUMO_SENSITIVE_INPUT_VARIANTS, r as SensitiveInput, t as KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS } from "./chunks/sensitive-input-dvwlnntm7rdudwp0.js";
|
|
46
45
|
import { a as radioVariants, i as RadioGroup, n as KUMO_RADIO_VARIANTS, r as Radio, t as KUMO_RADIO_DEFAULT_VARIANTS } from "./chunks/radio-nf717i5ypsga9zdh.js";
|
|
47
46
|
import { n as KUMO_COMMAND_PALETTE_DEFAULT_VARIANTS, r as KUMO_COMMAND_PALETTE_VARIANTS, t as CommandPalette } from "./chunks/command-palette-d45ueqbuxygu87ir.js";
|
|
48
|
-
import "./components/link.js";
|
|
49
47
|
import { t as Breadcrumb } from "./chunks/breadcrumbs-z1jo40oxlw8e4eh4.js";
|
|
50
48
|
import { t as Empty } from "./chunks/empty-ijs6kgnd72lv3u94.js";
|
|
51
49
|
import { a as gridItemVariants, i as KUMO_GRID_VARIANTS, n as GridItem, o as gridVariants, r as KUMO_GRID_DEFAULT_VARIANTS, t as Grid } from "./chunks/grid-nwiczrab3r4w0zr2.js";
|
|
@@ -61,147 +59,4 @@ import "./components/button-group.js";
|
|
|
61
59
|
import { t as TagInput } from "./chunks/tag-input-lbx9yzt33d4wu07o.js";
|
|
62
60
|
import { t as LayerDialog } from "./chunks/layer-dialog-m8qb0wzfg3k7406a.js";
|
|
63
61
|
import { i as sliderVariants, n as KUMO_SLIDER_VARIANTS, r as Slider, t as KUMO_SLIDER_DEFAULT_VARIANTS } from "./chunks/slider-e395gihi5cjd62ss.js";
|
|
64
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
65
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
66
|
-
import { CheckIcon, CopyIcon, WarningCircleIcon, XIcon } from "@phosphor-icons/react";
|
|
67
|
-
//#region src/blocks/delete-resource/delete-resource.tsx
|
|
68
|
-
const KUMO_DELETE_RESOURCE_VARIANTS = { size: {
|
|
69
|
-
sm: {
|
|
70
|
-
classes: "",
|
|
71
|
-
description: "Small dialog for simple delete confirmations"
|
|
72
|
-
},
|
|
73
|
-
base: {
|
|
74
|
-
classes: "",
|
|
75
|
-
description: "Default delete confirmation dialog size"
|
|
76
|
-
}
|
|
77
|
-
} };
|
|
78
|
-
const KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS = { size: "base" };
|
|
79
|
-
function DeleteResource({ open, onOpenChange, resourceType, resourceName, onDelete, isDeleting = false, caseSensitive = true, deleteButtonText, size = KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS.size, errorMessage, className }) {
|
|
80
|
-
const [confirmationInput, setConfirmationInput] = useState("");
|
|
81
|
-
const { copied, runCopy, reset: resetCopyFeedback } = useCopyFeedback(1500);
|
|
82
|
-
const openRef = useRef(open);
|
|
83
|
-
openRef.current = open;
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
if (!open) {
|
|
86
|
-
resetCopyFeedback();
|
|
87
|
-
setConfirmationInput("");
|
|
88
|
-
}
|
|
89
|
-
}, [open, resetCopyFeedback]);
|
|
90
|
-
const normalizeForComparison = useCallback((str) => caseSensitive ? str : str.toLowerCase(), [caseSensitive]);
|
|
91
|
-
const isConfirmed = normalizeForComparison(confirmationInput) === normalizeForComparison(resourceName);
|
|
92
|
-
const handleDelete = useCallback(async () => {
|
|
93
|
-
if (!isConfirmed || isDeleting) return;
|
|
94
|
-
await onDelete();
|
|
95
|
-
}, [
|
|
96
|
-
isConfirmed,
|
|
97
|
-
isDeleting,
|
|
98
|
-
onDelete
|
|
99
|
-
]);
|
|
100
|
-
const handleCopy = useCallback(async () => {
|
|
101
|
-
if (!openRef.current) return;
|
|
102
|
-
await runCopy(() => navigator.clipboard.writeText(resourceName), (error) => console.warn("Clipboard copy failed", error));
|
|
103
|
-
}, [resourceName, runCopy]);
|
|
104
|
-
return /* @__PURE__ */ jsx(DialogRoot, {
|
|
105
|
-
open,
|
|
106
|
-
onOpenChange,
|
|
107
|
-
children: /* @__PURE__ */ jsxs(Dialog, {
|
|
108
|
-
size,
|
|
109
|
-
className: cn("p-0", className),
|
|
110
|
-
children: [
|
|
111
|
-
/* @__PURE__ */ jsxs("div", {
|
|
112
|
-
className: "flex items-center justify-between border-b border-kumo-line px-6 py-4",
|
|
113
|
-
children: [/* @__PURE__ */ jsxs(DialogTitle, {
|
|
114
|
-
className: "text-lg font-semibold",
|
|
115
|
-
children: ["Delete ", resourceName]
|
|
116
|
-
}), /* @__PURE__ */ jsx(DialogClose, { render: (props) => /* @__PURE__ */ jsx(Button, {
|
|
117
|
-
...props,
|
|
118
|
-
variant: "ghost",
|
|
119
|
-
shape: "square",
|
|
120
|
-
size: "sm",
|
|
121
|
-
"aria-label": "Close",
|
|
122
|
-
disabled: isDeleting,
|
|
123
|
-
children: /* @__PURE__ */ jsx(XIcon, { size: 18 })
|
|
124
|
-
}) })]
|
|
125
|
-
}),
|
|
126
|
-
/* @__PURE__ */ jsxs("div", {
|
|
127
|
-
className: "flex flex-col gap-4 p-6",
|
|
128
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
129
|
-
className: "flex flex-col gap-2",
|
|
130
|
-
children: [errorMessage && /* @__PURE__ */ jsx(Banner, {
|
|
131
|
-
icon: /* @__PURE__ */ jsx(WarningCircleIcon, {}),
|
|
132
|
-
variant: "error",
|
|
133
|
-
children: errorMessage
|
|
134
|
-
}), /* @__PURE__ */ jsxs("p", {
|
|
135
|
-
className: "max-w-prose text-base text-pretty text-kumo-subtle",
|
|
136
|
-
children: [
|
|
137
|
-
"This action cannot be undone. This will permanently delete the",
|
|
138
|
-
" ",
|
|
139
|
-
/* @__PURE__ */ jsx("span", {
|
|
140
|
-
className: "font-medium text-kumo-default",
|
|
141
|
-
children: resourceName
|
|
142
|
-
}),
|
|
143
|
-
" ",
|
|
144
|
-
resourceType.toLowerCase(),
|
|
145
|
-
"."
|
|
146
|
-
]
|
|
147
|
-
})]
|
|
148
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
149
|
-
className: "flex flex-col gap-2",
|
|
150
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
151
|
-
className: "flex items-center gap-1.5 text-base",
|
|
152
|
-
children: /* @__PURE__ */ jsxs("span", { children: [
|
|
153
|
-
"Type",
|
|
154
|
-
" ",
|
|
155
|
-
/* @__PURE__ */ jsxs("button", {
|
|
156
|
-
className: "group inline rounded-md bg-kumo-tint px-2 py-1 font-mono text-sm font-semibold hover:cursor-pointer hover:bg-kumo-fill",
|
|
157
|
-
onClick: handleCopy,
|
|
158
|
-
"aria-label": `Copy ${resourceName} to clipboard`,
|
|
159
|
-
children: [resourceName, copied ? /* @__PURE__ */ jsx(CheckIcon, {
|
|
160
|
-
size: 12,
|
|
161
|
-
weight: "bold",
|
|
162
|
-
className: "ml-1.5 inline"
|
|
163
|
-
}) : /* @__PURE__ */ jsx(CopyIcon, {
|
|
164
|
-
size: 12,
|
|
165
|
-
weight: "bold",
|
|
166
|
-
className: "ml-1.5 inline text-kumo-subtle group-hover:text-kumo-default"
|
|
167
|
-
})]
|
|
168
|
-
}),
|
|
169
|
-
" ",
|
|
170
|
-
"to confirm:"
|
|
171
|
-
] })
|
|
172
|
-
}), /* @__PURE__ */ jsx(Input, {
|
|
173
|
-
placeholder: resourceName,
|
|
174
|
-
value: confirmationInput,
|
|
175
|
-
onChange: (e) => setConfirmationInput(e.target.value),
|
|
176
|
-
disabled: isDeleting,
|
|
177
|
-
autoComplete: "off",
|
|
178
|
-
autoCorrect: "off",
|
|
179
|
-
autoCapitalize: "off",
|
|
180
|
-
spellCheck: false,
|
|
181
|
-
"aria-label": `Type ${resourceName} to confirm deletion`,
|
|
182
|
-
className: "w-full"
|
|
183
|
-
})]
|
|
184
|
-
})]
|
|
185
|
-
}),
|
|
186
|
-
/* @__PURE__ */ jsxs("div", {
|
|
187
|
-
className: "flex justify-end gap-3 border-t border-kumo-line px-6 py-4",
|
|
188
|
-
children: [/* @__PURE__ */ jsx(DialogClose, { render: (props) => /* @__PURE__ */ jsx(Button, {
|
|
189
|
-
...props,
|
|
190
|
-
variant: "secondary",
|
|
191
|
-
disabled: isDeleting,
|
|
192
|
-
children: "Cancel"
|
|
193
|
-
}) }), /* @__PURE__ */ jsx(Button, {
|
|
194
|
-
variant: "destructive",
|
|
195
|
-
onClick: handleDelete,
|
|
196
|
-
disabled: !isConfirmed || isDeleting,
|
|
197
|
-
loading: isDeleting,
|
|
198
|
-
children: deleteButtonText || `Delete ${resourceType}`
|
|
199
|
-
})]
|
|
200
|
-
})
|
|
201
|
-
]
|
|
202
|
-
})
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
DeleteResource.displayName = "DeleteResource";
|
|
206
|
-
//#endregion
|
|
207
62
|
export { Autocomplete, Badge, Banner, BannerVariant, Breadcrumb as Breadcrumbs, BubbleMap, Button, ButtonGroup, Chart, ChartLegend, ChartPalette, Checkbox, ChoroplethMap, ClipboardText, CloudflareLogo, Code, CodeBlock, Collapsible, Combobox, CommandPalette, DatePicker, DateRangePicker, DeleteResource, Dialog, DialogClose, DialogDescription, DialogRoot, DialogTitle, DialogTrigger, DropdownMenu, Empty, Field, Flow, GlobeMap, Grid, GridItem, InlineCopyText, Input, InputArea, InputGroup, KUMO_AUTOCOMPLETE_DEFAULT_VARIANTS, KUMO_AUTOCOMPLETE_VARIANTS, KUMO_BUTTON_GROUP_DEFAULT_VARIANTS, KUMO_BUTTON_GROUP_STYLING, KUMO_BUTTON_GROUP_VARIANTS, KUMO_CLOUDFLARE_LOGO_DEFAULT_VARIANTS, KUMO_CLOUDFLARE_LOGO_VARIANTS, KUMO_COMMAND_PALETTE_DEFAULT_VARIANTS, KUMO_COMMAND_PALETTE_VARIANTS, KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS, KUMO_DELETE_RESOURCE_VARIANTS, KUMO_FIELD_DEFAULT_VARIANTS, KUMO_FIELD_VARIANTS, KUMO_GRID_DEFAULT_VARIANTS, KUMO_GRID_VARIANTS, KUMO_INLINE_COPY_TEXT_DEFAULT_VARIANTS, KUMO_INLINE_COPY_TEXT_STYLING, KUMO_INLINE_COPY_TEXT_VARIANTS, KUMO_LABEL_DEFAULT_VARIANTS, KUMO_LABEL_VARIANTS, KUMO_LINK_DEFAULT_VARIANTS, KUMO_LINK_VARIANTS, KUMO_POPOVER_DEFAULT_VARIANTS, KUMO_POPOVER_VARIANTS, KUMO_RADIO_DEFAULT_VARIANTS, KUMO_RADIO_VARIANTS, KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS, KUMO_SENSITIVE_INPUT_VARIANTS, KUMO_SIDEBAR_DEFAULT_VARIANTS, KUMO_SIDEBAR_STYLING, KUMO_SIDEBAR_VARIANTS, KUMO_SLIDER_DEFAULT_VARIANTS, KUMO_SLIDER_VARIANTS, KUMO_TABLE_OF_CONTENTS_DEFAULT_VARIANTS, KUMO_TABLE_OF_CONTENTS_VARIANTS, KUMO_TOOLBAR_DEFAULT_VARIANTS, KUMO_TOOLBAR_VARIANTS, KumoLocaleProvider, KumoPortalProvider, Label, LayerCard, LayerDialog, Link, LinkButton, LinkProvider, Loader, MenuBar, Meter, Pagination, Popover, PoweredByCloudflare, Radio, RadioGroup, RefreshButton, SankeyChart, Select, SensitiveInput, Sidebar, SidebarCollapsible, SidebarCollapsibleContent, SidebarCollapsibleTrigger, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarLoading, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuChevron, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarRoot, SidebarSeparator, SidebarSlidingView, SidebarSlidingViews, SidebarTrigger, SkeletonLine, Slider, Surface, Switch, Table, TableOfContents, Tabs, TagInput, Text, Textarea, TimeseriesChart, index_parts_exports as Toast, ToastProvider, Toasty, Toolbar, Tooltip, TooltipProvider, autocompleteVariants, buttonVariants, cn, createKumoToastManager, fieldVariants, generateCloudflareLogoSvg, gridItemVariants, gridVariants, inputVariants, labelContentVariants, labelVariants, linkVariants, radioVariants, safeRandomId, sliderVariants, useKumoToastManager, useLinkComponent, useMenuNavigation, useSidebar, useTableOfContentsActiveId };
|
package/dist/primitives.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OTPField, OTPField as OTPFieldPreview } from "@base-ui/react/otp-field";
|
|
2
|
+
export * from "@base-ui/react/tabs";
|
|
2
3
|
export * from "@base-ui/react/autocomplete";
|
|
3
4
|
export * from "@base-ui/react/checkbox";
|
|
4
5
|
export * from "@base-ui/react/collapsible";
|
|
@@ -14,7 +15,6 @@ export * from "@base-ui/react/popover";
|
|
|
14
15
|
export * from "@base-ui/react/radio-group";
|
|
15
16
|
export * from "@base-ui/react/select";
|
|
16
17
|
export * from "@base-ui/react/slider";
|
|
17
|
-
export * from "@base-ui/react/tabs";
|
|
18
18
|
export * from "@base-ui/react/toast";
|
|
19
19
|
export * from "@base-ui/react/toolbar";
|
|
20
20
|
export * from "@base-ui/react/accordion";
|