@fldr/ui 0.3.7 → 0.3.9
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/README.md +66 -448
- package/THEMING.md +2 -6
- package/ai/component-registry.json +25 -13
- package/ai/component-registry.md +2 -2
- package/dist/.build-complete +1 -1
- package/dist/blocks-source/auth-card/auth-card.test.tsx +20 -14
- package/dist/blocks-source/auth-card/auth-card.tsx +73 -55
- package/dist/blocks-source/file-table/file-table.tsx +197 -150
- package/dist/blocks-source/share-dialog/share-dialog.test.tsx +9 -3
- package/dist/blocks-source/share-dialog/share-dialog.tsx +50 -35
- package/dist/blocks.d.ts +21 -4
- package/dist/blocks.js +246 -195
- package/dist/{button-DzavLWXm.d.ts → button-CS82eT0x.d.ts} +1 -1
- package/dist/chunks/{checkbox-eifiwbw34xwsikvf.js → checkbox-d5epe4dl78bzy4f8.js} +8 -8
- package/dist/chunks/highlighter-kb7huz24pcziin6d.js +57 -0
- package/dist/chunks/{layer-dialog-m8qb0wzfg3k7406a.js → layer-dialog-mnaw06pxom8q771w.js} +3 -2
- package/dist/chunks/{table-ngl1b5yc8mcur662.js → table-bdye068ekayq3u1n.js} +1 -1
- package/dist/chunks/table-f8vl74hdx3bzqqbf.js +448 -0
- package/dist/code/server.js +1 -1
- package/dist/code.js +4 -131
- package/dist/components/banner.d.ts +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/input-group.d.ts +2 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/layer-dialog.js +1 -1
- package/dist/components/link.d.ts +2 -67
- package/dist/components/sidebar.d.ts +2 -1
- package/dist/components/table.d.ts +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/toolbar.d.ts +1 -1
- package/dist/form.d.ts +207 -0
- package/dist/form.js +317 -0
- package/dist/hotkeys.d.ts +135 -0
- package/dist/hotkeys.js +206 -0
- package/dist/index-9LwQy84o.d.ts +1 -0
- package/dist/index-B7iG0qDU.d.ts +1 -0
- package/dist/{index-B6JNUfG9.d.ts → index-BMXHK-3k.d.ts} +2 -2
- package/dist/{index-B6Wo_iiN.d.ts → index-B_ug9XY7.d.ts} +1 -1
- package/dist/{index-RP_rt8vB.d.ts → index-Bh9kuAvN.d.ts} +1 -1
- package/dist/{index-DjSGDESy.d.ts → index-CAUjUp2G.d.ts} +1 -1
- package/dist/{index-NnHba-T1.d.ts → index-DK28YxxP.d.ts} +2 -2
- package/dist/{index-aahL-0Zw.d.ts → index-DOVlARA6.d.ts} +2 -2
- package/dist/index-DTj6M6kA.d.ts +1 -0
- package/dist/index.d.ts +14 -12
- package/dist/index.js +3 -4
- package/dist/{input-group-8gEtPiKw.d.ts → input-group-Swzit45o.d.ts} +1 -1
- package/dist/link-CoVXE5W2.d.ts +68 -0
- package/dist/query.d.ts +156 -0
- package/dist/query.js +204 -0
- package/dist/router.d.ts +95 -0
- package/dist/router.js +146 -0
- package/dist/skeleton.d.ts +3 -0
- package/dist/skeleton.js +4 -0
- package/dist/styles/kumo-binding.css +10 -0
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/styles/theme-fldr.css +18 -29
- package/dist/table.d.ts +245 -0
- package/dist/table.js +3 -0
- package/dist/theming.d.ts +8 -28
- package/dist/theming.js +6 -17
- package/package.json +41 -1
- package/dist/chunks/highlighter-mouttug0tu8xg1i8.js +0 -1364
- package/dist/index-DL1-uSuH.d.ts +0 -1
- /package/dist/{index-BkTAB4wj.d.ts → sidebar-BkTAB4wj.d.ts} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
2
|
import { GlobeIcon, LockIcon, XIcon } from "@phosphor-icons/react";
|
|
3
3
|
import { Button } from "../../components/button";
|
|
4
4
|
import { ClipboardText } from "../../components/clipboard-text";
|
|
5
|
-
import { Input } from "../../components/input";
|
|
6
5
|
import { LayerDialog } from "../../components/layer-dialog";
|
|
7
6
|
import { Select } from "../../components/select";
|
|
7
|
+
import { email as emailValidator, useAppForm } from "../../form";
|
|
8
8
|
import { cn } from "../../utils/cn";
|
|
9
9
|
|
|
10
10
|
/** Role key, e.g. `"viewer"`. Keys come from the `roles` prop. */
|
|
@@ -30,6 +30,7 @@ export interface ShareLinkAccess {
|
|
|
30
30
|
export interface ShareDialogLabels {
|
|
31
31
|
title?: (resourceName: string) => string;
|
|
32
32
|
emailPlaceholder?: string;
|
|
33
|
+
invalidEmail?: string;
|
|
33
34
|
invite?: string;
|
|
34
35
|
people?: string;
|
|
35
36
|
owner?: string;
|
|
@@ -68,7 +69,6 @@ const DEFAULT_ROLES: Record<ShareRole, string> = {
|
|
|
68
69
|
viewer: "Viewer",
|
|
69
70
|
editor: "Editor",
|
|
70
71
|
};
|
|
71
|
-
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
72
72
|
|
|
73
73
|
function initials(name: string) {
|
|
74
74
|
const parts = name.trim().split(/\s+/);
|
|
@@ -111,11 +111,10 @@ export function ShareDialog({
|
|
|
111
111
|
className,
|
|
112
112
|
}: ShareDialogProps) {
|
|
113
113
|
const roleKeys = Object.keys(roles);
|
|
114
|
-
const [email, setEmail] = useState("");
|
|
115
|
-
const [inviteRole, setInviteRole] = useState<ShareRole>(roleKeys[0] ?? "");
|
|
116
114
|
const l = {
|
|
117
115
|
title: (name: string) => `Share "${name}"`,
|
|
118
116
|
emailPlaceholder: "Add people by email",
|
|
117
|
+
invalidEmail: "Enter a valid email",
|
|
119
118
|
invite: "Invite",
|
|
120
119
|
people: "People with access",
|
|
121
120
|
owner: "Owner",
|
|
@@ -130,14 +129,15 @@ export function ShareDialog({
|
|
|
130
129
|
copyLink: "Copy link",
|
|
131
130
|
...labels,
|
|
132
131
|
};
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
132
|
+
const form = useAppForm({
|
|
133
|
+
defaultValues: { email: "", role: roleKeys[0] ?? "" },
|
|
134
|
+
onSubmit: ({ value, formApi }) => {
|
|
135
|
+
const email = value.email.trim();
|
|
136
|
+
if (!email) return;
|
|
137
|
+
onInvite(email, value.role);
|
|
138
|
+
formApi.resetField("email");
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
141
|
|
|
142
142
|
const roleOptions = roleKeys.map((key) => (
|
|
143
143
|
<Select.Option key={key} value={key}>
|
|
@@ -153,28 +153,43 @@ export function ShareDialog({
|
|
|
153
153
|
<LayerDialog.Title>{l.title(resourceName)}</LayerDialog.Title>
|
|
154
154
|
<LayerDialog.Body>
|
|
155
155
|
<div className={cn("flex flex-col gap-4", className)}>
|
|
156
|
-
<form
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
156
|
+
<form.AppForm>
|
|
157
|
+
<form.Form className="flex items-start gap-2">
|
|
158
|
+
<div className="min-w-0 flex-1">
|
|
159
|
+
<form.AppField
|
|
160
|
+
name="email"
|
|
161
|
+
validators={{ onChange: emailValidator(l.invalidEmail) }}
|
|
162
|
+
>
|
|
163
|
+
{(field) => (
|
|
164
|
+
<field.TextField
|
|
165
|
+
type="email"
|
|
166
|
+
aria-label={l.emailPlaceholder}
|
|
167
|
+
placeholder={l.emailPlaceholder}
|
|
168
|
+
/>
|
|
169
|
+
)}
|
|
170
|
+
</form.AppField>
|
|
171
|
+
</div>
|
|
172
|
+
<form.Subscribe selector={(s) => s.values.email.trim()}>
|
|
173
|
+
{(email) => (
|
|
174
|
+
<>
|
|
175
|
+
<form.AppField name="role">
|
|
176
|
+
{(field) => (
|
|
177
|
+
<field.SelectField
|
|
178
|
+
aria-label={l.roleFor(email || l.invite)}
|
|
179
|
+
items={roles}
|
|
180
|
+
renderValue={(value) => roles[value]}
|
|
181
|
+
className="w-26"
|
|
182
|
+
/>
|
|
183
|
+
)}
|
|
184
|
+
</form.AppField>
|
|
185
|
+
<form.SubmitButton disabled={!email}>
|
|
186
|
+
{l.invite}
|
|
187
|
+
</form.SubmitButton>
|
|
188
|
+
</>
|
|
189
|
+
)}
|
|
190
|
+
</form.Subscribe>
|
|
191
|
+
</form.Form>
|
|
192
|
+
</form.AppForm>
|
|
178
193
|
|
|
179
194
|
<section className="flex flex-col gap-1">
|
|
180
195
|
<h3 className="text-sm font-medium text-kumo-subtle">
|
package/dist/blocks.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as SidebarCollapsible } from "./
|
|
1
|
+
import { a as SidebarCollapsible } from "./sidebar-BkTAB4wj.js";
|
|
2
|
+
import "./index-DTj6M6kA.js";
|
|
2
3
|
import { a as KumoDeleteResourceSize, i as KUMO_DELETE_RESOURCE_VARIANTS, n as DeleteResourceProps, o as KumoDeleteResourceVariantsProps, r as KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS, t as DeleteResource } from "./delete-resource-DY-GFy2s.js";
|
|
3
4
|
import { n as TabsItem } from "./index-gYC6cQVO.js";
|
|
4
5
|
import { ReactElement, ReactNode } from "react";
|
|
@@ -142,13 +143,17 @@ export interface AuthCardLabels {
|
|
|
142
143
|
signUpSubmit: string;
|
|
143
144
|
magicLinkSubmit: string;
|
|
144
145
|
divider: string;
|
|
146
|
+
/** Validation message for empty fields. */
|
|
147
|
+
required: string;
|
|
148
|
+
/** Validation message for malformed emails. */
|
|
149
|
+
invalidEmail: string;
|
|
145
150
|
}
|
|
146
151
|
export interface AuthCardProps {
|
|
147
152
|
/** @default "sign-in" */
|
|
148
153
|
mode?: AuthCardMode;
|
|
149
154
|
/** `"magic-link"` hides the password field. @default "password" */
|
|
150
155
|
method?: AuthCardMethod;
|
|
151
|
-
/** Called with form values on
|
|
156
|
+
/** Called with validated form values on submit. */
|
|
152
157
|
onSubmit: (values: AuthCardValues) => void;
|
|
153
158
|
/** Provider buttons rendered above the "or" divider. */
|
|
154
159
|
providers?: AuthCardProvider[];
|
|
@@ -242,6 +247,7 @@ export interface FileTableLabels {
|
|
|
242
247
|
selected: (count: number) => string;
|
|
243
248
|
clearSelection: string;
|
|
244
249
|
actions: (name: string) => string;
|
|
250
|
+
search: string;
|
|
245
251
|
}
|
|
246
252
|
export interface FileTableProps<T extends FileItem = FileItem> {
|
|
247
253
|
items: T[];
|
|
@@ -266,10 +272,19 @@ export interface FileTableProps<T extends FileItem = FileItem> {
|
|
|
266
272
|
labels?: Partial<FileTableLabels>;
|
|
267
273
|
/** Locale for size and date formatting. Defaults to the runtime locale. */
|
|
268
274
|
locale?: string;
|
|
275
|
+
/** Show a search field that filters by name and owner. */
|
|
276
|
+
searchable?: boolean;
|
|
277
|
+
/** Shows skeleton rows instead of items. */
|
|
278
|
+
loading?: boolean;
|
|
279
|
+
/** Render only visible rows; for folders with thousands of items. */
|
|
280
|
+
virtualize?: boolean;
|
|
281
|
+
/** Scroll container height (sticky header). @default 480 when virtualized */
|
|
282
|
+
height?: number | string;
|
|
269
283
|
className?: string;
|
|
270
284
|
}
|
|
271
285
|
/**
|
|
272
|
-
* FileTable — sortable, selectable list of files and folders
|
|
286
|
+
* FileTable — sortable, selectable list of files and folders, built on
|
|
287
|
+
* `DataTable`. Folders always sort above files.
|
|
273
288
|
*
|
|
274
289
|
* @example
|
|
275
290
|
* ```tsx
|
|
@@ -278,10 +293,11 @@ export interface FileTableProps<T extends FileItem = FileItem> {
|
|
|
278
293
|
* onOpen={(item) => navigate(item.id)}
|
|
279
294
|
* actions={[{ label: "Delete", variant: "danger", onSelect: remove }]}
|
|
280
295
|
* bulkActions={(ids) => <Button size="sm" onClick={() => share(ids)}>Share</Button>}
|
|
296
|
+
* searchable
|
|
281
297
|
* />
|
|
282
298
|
* ```
|
|
283
299
|
*/
|
|
284
|
-
export declare function FileTable<T extends FileItem = FileItem>({ items, sort: sortProp, defaultSort, onSortChange, selectable, selectedIds, defaultSelectedIds, onSelectionChange, bulkActions, actions, onOpen, empty, labels: labelsProp, locale, className }: FileTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
300
|
+
export declare function FileTable<T extends FileItem = FileItem>({ items, sort: sortProp, defaultSort, onSortChange, selectable, selectedIds, defaultSelectedIds, onSelectionChange, bulkActions, actions, onOpen, empty, labels: labelsProp, locale, searchable, loading, virtualize, height, className }: FileTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
285
301
|
//#endregion
|
|
286
302
|
//#region src/blocks/onboarding-checklist/onboarding-checklist.d.ts
|
|
287
303
|
export interface OnboardingStep {
|
|
@@ -659,6 +675,7 @@ export interface ShareLinkAccess {
|
|
|
659
675
|
export interface ShareDialogLabels {
|
|
660
676
|
title?: (resourceName: string) => string;
|
|
661
677
|
emailPlaceholder?: string;
|
|
678
|
+
invalidEmail?: string;
|
|
662
679
|
invite?: string;
|
|
663
680
|
people?: string;
|
|
664
681
|
owner?: string;
|