@fldr/ui 0.3.8 → 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/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 -18
- package/dist/table.d.ts +245 -0
- package/dist/table.js +3 -0
- package/dist/theming.d.ts +4 -4
- package/dist/theming.js +2 -2
- 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
package/dist/router.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { b as SidebarMenuButtonProps } from "./sidebar-BkTAB4wj.js";
|
|
2
|
+
import { i as KumoButtonVariantsProps } from "./button-CS82eT0x.js";
|
|
3
|
+
import { i as KumoLinkVariantsProps } from "./link-CoVXE5W2.js";
|
|
4
|
+
import { AnchorHTMLAttributes, ReactNode } from "react";
|
|
5
|
+
//#region src/router/router-link.d.ts
|
|
6
|
+
type AnchorProps = AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
7
|
+
/** Props TanStack Router hands to the host when the link is active. */
|
|
8
|
+
type RouterStateProps = {
|
|
9
|
+
"data-status"?: "active";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Type-safe TanStack Router link styled as a Kumo `Link`.
|
|
13
|
+
*
|
|
14
|
+
* Accepts every TanStack `Link` prop (`to`, `params`, `search`, `preload`, …)
|
|
15
|
+
* plus Kumo's `variant`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <RouterLink to="/posts/$postId" params={{ postId: "42" }} variant="plain">
|
|
20
|
+
* Read post
|
|
21
|
+
* </RouterLink>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const RouterLink: import("@tanstack/react-router").LinkComponent<import("react").ForwardRefExoticComponent<AnchorProps & KumoLinkVariantsProps & import("react").RefAttributes<HTMLAnchorElement>>, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Type-safe TanStack Router link styled as a Kumo `LinkButton`.
|
|
27
|
+
*
|
|
28
|
+
* Takes Button `variant`, `size`, `shape` and `icon`. TanStack's `disabled`
|
|
29
|
+
* renders LinkButton's disabled state.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <RouterLinkButton to="/settings" variant="primary" icon={GearIcon}>
|
|
34
|
+
* Settings
|
|
35
|
+
* </RouterLinkButton>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare const RouterLinkButton: import("@tanstack/react-router").LinkComponent<import("react").ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement> & KumoButtonVariantsProps & {
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
icon?: import("@phosphor-icons/react").Icon | React.ReactNode;
|
|
43
|
+
external?: boolean;
|
|
44
|
+
linksExternal?: boolean;
|
|
45
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>, string>;
|
|
46
|
+
/**
|
|
47
|
+
* Type-safe TanStack Router link rendered as `Sidebar.MenuButton`.
|
|
48
|
+
*
|
|
49
|
+
* `active` comes from the router (`data-active` + `aria-current="page"`).
|
|
50
|
+
* Tune matching with `activeOptions`, e.g. `{ exact: true }` for index routes.
|
|
51
|
+
* Must sit inside `Sidebar.Provider`.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* <Sidebar.Menu>
|
|
56
|
+
* <RouterSidebarLink to="/" icon={HouseIcon} activeOptions={{ exact: true }}>
|
|
57
|
+
* Home
|
|
58
|
+
* </RouterSidebarLink>
|
|
59
|
+
* <RouterSidebarLink to="/projects" icon={FolderIcon}>Projects</RouterSidebarLink>
|
|
60
|
+
* </Sidebar.Menu>
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare const RouterSidebarLink: import("@tanstack/react-router").LinkComponent<import("react").ForwardRefExoticComponent<Omit<SidebarMenuButtonProps, "active"> & RouterStateProps & import("react").RefAttributes<HTMLButtonElement>>, string>;
|
|
64
|
+
/**
|
|
65
|
+
* Type-safe TanStack Router link rendered as `Breadcrumbs.Link`.
|
|
66
|
+
*
|
|
67
|
+
* The mobile trail only collapses `Breadcrumbs.Link` children, so on narrow
|
|
68
|
+
* screens a trail of `RouterBreadcrumbLink`s shows every crumb.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* <Breadcrumbs>
|
|
73
|
+
* <RouterBreadcrumbLink to="/projects">Projects</RouterBreadcrumbLink>
|
|
74
|
+
* <Breadcrumbs.Separator />
|
|
75
|
+
* <Breadcrumbs.Current>Settings</Breadcrumbs.Current>
|
|
76
|
+
* </Breadcrumbs>
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare const RouterBreadcrumbLink: import("@tanstack/react-router").LinkComponent<import("react").ForwardRefExoticComponent<AnchorProps & {
|
|
80
|
+
icon?: ReactNode;
|
|
81
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>, string>;
|
|
82
|
+
/**
|
|
83
|
+
* Routes every href-based Kumo link (`Link`, `LinkButton`,
|
|
84
|
+
* `Sidebar.MenuSubButton`, `Breadcrumbs.Link`, …) through TanStack Router.
|
|
85
|
+
* Hrefs are plain strings, so prefer the typed `Router*` links where you can.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* const router = createRouter({ routeTree, InnerWrap: RouterLinkProvider });
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function RouterLinkProvider({ children }: {
|
|
93
|
+
children: ReactNode;
|
|
94
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
//#endregion
|
package/dist/router.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./chunks/vendor-styling-gs32v7xt5znc8kg0.js";
|
|
3
|
+
import { t as LinkProvider } from "./chunks/link-provider-kbwllpbo24fvgioj.js";
|
|
4
|
+
import { r as Link$1 } from "./chunks/link-h84bkh8eem39p529.js";
|
|
5
|
+
import { n as LinkButton } from "./chunks/button-hzvowfkbathmx8yg.js";
|
|
6
|
+
import { t as Breadcrumb } from "./chunks/breadcrumbs-z1jo40oxlw8e4eh4.js";
|
|
7
|
+
import { i as Sidebar } from "./chunks/sidebar-mhlgvpawixxoey2k.js";
|
|
8
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
import { Link, createLink } from "@tanstack/react-router";
|
|
11
|
+
//#region src/router/router-link.tsx
|
|
12
|
+
const KumoLinkAnchor = forwardRef(function KumoLinkAnchor(props, ref) {
|
|
13
|
+
return /* @__PURE__ */ jsx(Link$1, {
|
|
14
|
+
ref,
|
|
15
|
+
render: /* @__PURE__ */ jsx("a", {}),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Type-safe TanStack Router link styled as a Kumo `Link`.
|
|
21
|
+
*
|
|
22
|
+
* Accepts every TanStack `Link` prop (`to`, `params`, `search`, `preload`, …)
|
|
23
|
+
* plus Kumo's `variant`.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <RouterLink to="/posts/$postId" params={{ postId: "42" }} variant="plain">
|
|
28
|
+
* Read post
|
|
29
|
+
* </RouterLink>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
const RouterLink = createLink(KumoLinkAnchor);
|
|
33
|
+
const KumoLinkButtonAnchor = forwardRef(function KumoLinkButtonAnchor(props, ref) {
|
|
34
|
+
return /* @__PURE__ */ jsx(LinkProvider, { children: /* @__PURE__ */ jsx(LinkButton, {
|
|
35
|
+
ref,
|
|
36
|
+
...props
|
|
37
|
+
}) });
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Type-safe TanStack Router link styled as a Kumo `LinkButton`.
|
|
41
|
+
*
|
|
42
|
+
* Takes Button `variant`, `size`, `shape` and `icon`. TanStack's `disabled`
|
|
43
|
+
* renders LinkButton's disabled state.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <RouterLinkButton to="/settings" variant="primary" icon={GearIcon}>
|
|
48
|
+
* Settings
|
|
49
|
+
* </RouterLinkButton>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
const RouterLinkButton = createLink(KumoLinkButtonAnchor);
|
|
53
|
+
const SidebarMenuAnchor = forwardRef(function SidebarMenuAnchor(props, ref) {
|
|
54
|
+
return /* @__PURE__ */ jsx(LinkProvider, { children: /* @__PURE__ */ jsx(Sidebar.MenuButton, {
|
|
55
|
+
ref,
|
|
56
|
+
active: props["data-status"] === "active",
|
|
57
|
+
...props
|
|
58
|
+
}) });
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Type-safe TanStack Router link rendered as `Sidebar.MenuButton`.
|
|
62
|
+
*
|
|
63
|
+
* `active` comes from the router (`data-active` + `aria-current="page"`).
|
|
64
|
+
* Tune matching with `activeOptions`, e.g. `{ exact: true }` for index routes.
|
|
65
|
+
* Must sit inside `Sidebar.Provider`.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <Sidebar.Menu>
|
|
70
|
+
* <RouterSidebarLink to="/" icon={HouseIcon} activeOptions={{ exact: true }}>
|
|
71
|
+
* Home
|
|
72
|
+
* </RouterSidebarLink>
|
|
73
|
+
* <RouterSidebarLink to="/projects" icon={FolderIcon}>Projects</RouterSidebarLink>
|
|
74
|
+
* </Sidebar.Menu>
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
const RouterSidebarLink = createLink(SidebarMenuAnchor);
|
|
78
|
+
const RouterAnchorContext = createContext(null);
|
|
79
|
+
/** Anchor that layers the enclosing router props over Kumo's own props. */
|
|
80
|
+
const RouterAnchor = forwardRef(function RouterAnchor({ to: _to, className, ...props }, ref) {
|
|
81
|
+
const routerProps = useContext(RouterAnchorContext);
|
|
82
|
+
return /* @__PURE__ */ jsx("a", {
|
|
83
|
+
ref,
|
|
84
|
+
...props,
|
|
85
|
+
...routerProps,
|
|
86
|
+
className: cn(className, routerProps?.className)
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
const BreadcrumbAnchor = forwardRef(function BreadcrumbAnchor({ icon, children, href, ...props }, ref) {
|
|
90
|
+
return /* @__PURE__ */ jsx(RouterAnchorContext.Provider, {
|
|
91
|
+
value: {
|
|
92
|
+
...props,
|
|
93
|
+
href,
|
|
94
|
+
ref
|
|
95
|
+
},
|
|
96
|
+
children: /* @__PURE__ */ jsx(LinkProvider, {
|
|
97
|
+
component: RouterAnchor,
|
|
98
|
+
children: /* @__PURE__ */ jsx(Breadcrumb.Link, {
|
|
99
|
+
href: href ?? "",
|
|
100
|
+
icon,
|
|
101
|
+
children
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
/**
|
|
107
|
+
* Type-safe TanStack Router link rendered as `Breadcrumbs.Link`.
|
|
108
|
+
*
|
|
109
|
+
* The mobile trail only collapses `Breadcrumbs.Link` children, so on narrow
|
|
110
|
+
* screens a trail of `RouterBreadcrumbLink`s shows every crumb.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```tsx
|
|
114
|
+
* <Breadcrumbs>
|
|
115
|
+
* <RouterBreadcrumbLink to="/projects">Projects</RouterBreadcrumbLink>
|
|
116
|
+
* <Breadcrumbs.Separator />
|
|
117
|
+
* <Breadcrumbs.Current>Settings</Breadcrumbs.Current>
|
|
118
|
+
* </Breadcrumbs>
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
const RouterBreadcrumbLink = createLink(BreadcrumbAnchor);
|
|
122
|
+
const HrefLink = forwardRef(function HrefLink({ href, to, ...props }, ref) {
|
|
123
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
124
|
+
ref,
|
|
125
|
+
to: href ?? to,
|
|
126
|
+
...props
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
/**
|
|
130
|
+
* Routes every href-based Kumo link (`Link`, `LinkButton`,
|
|
131
|
+
* `Sidebar.MenuSubButton`, `Breadcrumbs.Link`, …) through TanStack Router.
|
|
132
|
+
* Hrefs are plain strings, so prefer the typed `Router*` links where you can.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```tsx
|
|
136
|
+
* const router = createRouter({ routeTree, InnerWrap: RouterLinkProvider });
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
function RouterLinkProvider({ children }) {
|
|
140
|
+
return /* @__PURE__ */ jsx(LinkProvider, {
|
|
141
|
+
component: HrefLink,
|
|
142
|
+
children
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
export { RouterBreadcrumbLink, RouterLink, RouterLinkButton, RouterLinkProvider, RouterSidebarLink };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Skeleton, SkeletonBox, SkeletonBoxProps, SkeletonProps, SkeletonSuspense, SkeletonSuspenseProps, SkulletConfig as SkeletonProviderProps, SkulletProvider as SkeletonProvider, useReveal } from "skullet/react";
|
|
2
|
+
import { forgetShapes } from "skullet";
|
|
3
|
+
export { Skeleton, SkeletonBox, type SkeletonBoxProps, type SkeletonProps, SkeletonProvider, type SkeletonProviderProps, SkeletonSuspense, type SkeletonSuspenseProps, forgetShapes, useReveal };
|
package/dist/skeleton.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Skeleton, SkeletonBox, SkeletonSuspense, SkulletProvider as SkeletonProvider, useReveal } from "skullet/react";
|
|
3
|
+
import { forgetShapes } from "skullet";
|
|
4
|
+
export { Skeleton, SkeletonBox, SkeletonProvider, SkeletonSuspense, forgetShapes, useReveal };
|
|
@@ -46,6 +46,16 @@
|
|
|
46
46
|
[data-mode="dark"] {
|
|
47
47
|
color-scheme: dark;
|
|
48
48
|
}
|
|
49
|
+
|
|
50
|
+
/* skullet skeletons (@fldr/ui/skeleton) follow the active theme. Redeclared
|
|
51
|
+
wherever a theme or mode can change, since var() resolves where declared. */
|
|
52
|
+
:root,
|
|
53
|
+
[data-theme],
|
|
54
|
+
[data-mode] {
|
|
55
|
+
--skullet-base: color-mix(in oklab, var(--text-color-kumo-default) 9%, transparent);
|
|
56
|
+
--skullet-highlight: color-mix(in oklab, var(--text-color-kumo-default) 5%, transparent);
|
|
57
|
+
--skullet-radius: 0.375rem;
|
|
58
|
+
}
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
@layer utilities {
|