@skylab-kulubu/skylcn-ui 0.1.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/LICENSE +21 -0
- package/README.md +100 -0
- package/dist/assets/skylab-mark.d.ts +5 -0
- package/dist/assets/skylab-mark.d.ts.map +1 -0
- package/dist/assets/skylab-mark.js +29 -0
- package/dist/assets/skylab-mark.js.map +1 -0
- package/dist/charts/chart-frame.d.ts +42 -0
- package/dist/charts/chart-frame.d.ts.map +1 -0
- package/dist/charts/chart-frame.js +33 -0
- package/dist/charts/chart-frame.js.map +1 -0
- package/dist/charts/charts.d.ts +84 -0
- package/dist/charts/charts.d.ts.map +1 -0
- package/dist/charts/charts.js +194 -0
- package/dist/charts/charts.js.map +1 -0
- package/dist/charts/index.d.ts +3 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +3 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +17 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/app-shell.d.ts +96 -0
- package/dist/components/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell.js +191 -0
- package/dist/components/app-shell.js.map +1 -0
- package/dist/components/avatar.d.ts +28 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +26 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +41 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +42 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/bar-list.d.ts +33 -0
- package/dist/components/bar-list.d.ts.map +1 -0
- package/dist/components/bar-list.js +31 -0
- package/dist/components/bar-list.js.map +1 -0
- package/dist/components/breadcrumbs.d.ts +16 -0
- package/dist/components/breadcrumbs.d.ts.map +1 -0
- package/dist/components/breadcrumbs.js +21 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/button.d.ts +30 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +51 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +44 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +93 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +38 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +38 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +42 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +92 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/checkbox.d.ts +3 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +9 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/command.d.ts +31 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +91 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/copy-button.d.ts +10 -0
- package/dist/components/copy-button.d.ts.map +1 -0
- package/dist/components/copy-button.js +23 -0
- package/dist/components/copy-button.js.map +1 -0
- package/dist/components/data-list.d.ts +70 -0
- package/dist/components/data-list.d.ts.map +1 -0
- package/dist/components/data-list.js +119 -0
- package/dist/components/data-list.js.map +1 -0
- package/dist/components/dialog.d.ts +41 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +49 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/display-extra.d.ts +91 -0
- package/dist/components/display-extra.d.ts.map +1 -0
- package/dist/components/display-extra.js +91 -0
- package/dist/components/display-extra.js.map +1 -0
- package/dist/components/drawer.d.ts +22 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +50 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/feedback.d.ts +63 -0
- package/dist/components/feedback.d.ts.map +1 -0
- package/dist/components/feedback.js +59 -0
- package/dist/components/feedback.js.map +1 -0
- package/dist/components/field.d.ts +21 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +38 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/form-extra.d.ts +58 -0
- package/dist/components/form-extra.d.ts.map +1 -0
- package/dist/components/form-extra.js +51 -0
- package/dist/components/form-extra.js.map +1 -0
- package/dist/components/icon-swap.d.ts +15 -0
- package/dist/components/icon-swap.d.ts.map +1 -0
- package/dist/components/icon-swap.js +13 -0
- package/dist/components/icon-swap.js.map +1 -0
- package/dist/components/list.d.ts +43 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +30 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/menu.d.ts +41 -0
- package/dist/components/menu.d.ts.map +1 -0
- package/dist/components/menu.js +67 -0
- package/dist/components/menu.js.map +1 -0
- package/dist/components/month-calendar.d.ts +38 -0
- package/dist/components/month-calendar.d.ts.map +1 -0
- package/dist/components/month-calendar.js +64 -0
- package/dist/components/month-calendar.js.map +1 -0
- package/dist/components/motion.d.ts +43 -0
- package/dist/components/motion.d.ts.map +1 -0
- package/dist/components/motion.js +56 -0
- package/dist/components/motion.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +28 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +26 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/page-header.d.ts +45 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/page-header.js +37 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/pagination.d.ts +19 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +70 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +10 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +15 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/preview-card.d.ts +11 -0
- package/dist/components/preview-card.d.ts.map +1 -0
- package/dist/components/preview-card.js +18 -0
- package/dist/components/preview-card.js.map +1 -0
- package/dist/components/proportion-bar.d.ts +16 -0
- package/dist/components/proportion-bar.d.ts.map +1 -0
- package/dist/components/proportion-bar.js +20 -0
- package/dist/components/proportion-bar.js.map +1 -0
- package/dist/components/radio-group.d.ts +11 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +13 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/reveal.d.ts +19 -0
- package/dist/components/reveal.d.ts.map +1 -0
- package/dist/components/reveal.js +25 -0
- package/dist/components/reveal.js.map +1 -0
- package/dist/components/segmented-control.d.ts +16 -0
- package/dist/components/segmented-control.d.ts.map +1 -0
- package/dist/components/segmented-control.js +21 -0
- package/dist/components/segmented-control.js.map +1 -0
- package/dist/components/select.d.ts +25 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +33 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/side-nav.d.ts +33 -0
- package/dist/components/side-nav.d.ts.map +1 -0
- package/dist/components/side-nav.js +52 -0
- package/dist/components/side-nav.js.map +1 -0
- package/dist/components/skeleton.d.ts +4 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +7 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/skylab-loader.d.ts +10 -0
- package/dist/components/skylab-loader.d.ts.map +1 -0
- package/dist/components/skylab-loader.js +12 -0
- package/dist/components/skylab-loader.js.map +1 -0
- package/dist/components/sparkline.d.ts +12 -0
- package/dist/components/sparkline.d.ts.map +1 -0
- package/dist/components/sparkline.js +26 -0
- package/dist/components/sparkline.js.map +1 -0
- package/dist/components/state-card.d.ts +27 -0
- package/dist/components/state-card.d.ts.map +1 -0
- package/dist/components/state-card.js +17 -0
- package/dist/components/state-card.js.map +1 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +12 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/tabs.d.ts +8 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +17 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/toast.d.ts +17 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +30 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/tooltip.d.ts +15 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +13 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/tree.d.ts +26 -0
- package/dist/components/tree.d.ts.map +1 -0
- package/dist/components/tree.js +92 -0
- package/dist/components/tree.js.map +1 -0
- package/dist/components/trend-badge.d.ts +13 -0
- package/dist/components/trend-badge.d.ts.map +1 -0
- package/dist/components/trend-badge.js +22 -0
- package/dist/components/trend-badge.js.map +1 -0
- package/dist/data-table/data-table.d.ts +59 -0
- package/dist/data-table/data-table.d.ts.map +1 -0
- package/dist/data-table/data-table.js +207 -0
- package/dist/data-table/data-table.js.map +1 -0
- package/dist/data-table/index.d.ts +2 -0
- package/dist/data-table/index.d.ts.map +1 -0
- package/dist/data-table/index.js +2 -0
- package/dist/data-table/index.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +2 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/motion-preference.d.ts +11 -0
- package/dist/lib/motion-preference.d.ts.map +1 -0
- package/dist/lib/motion-preference.js +42 -0
- package/dist/lib/motion-preference.js.map +1 -0
- package/dist/lib/motion-tokens.d.ts +55 -0
- package/dist/lib/motion-tokens.d.ts.map +1 -0
- package/dist/lib/motion-tokens.js +26 -0
- package/dist/lib/motion-tokens.js.map +1 -0
- package/dist/lib/motion.d.ts +3 -0
- package/dist/lib/motion.d.ts.map +1 -0
- package/dist/lib/motion.js +19 -0
- package/dist/lib/motion.js.map +1 -0
- package/dist/lib/provider.d.ts +160 -0
- package/dist/lib/provider.d.ts.map +1 -0
- package/dist/lib/provider.js +156 -0
- package/dist/lib/provider.js.map +1 -0
- package/dist/lib/theme-script.d.ts +15 -0
- package/dist/lib/theme-script.d.ts.map +1 -0
- package/dist/lib/theme-script.js +15 -0
- package/dist/lib/theme-script.js.map +1 -0
- package/dist/lib/theme.d.ts +13 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/theme.js +78 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/lib/use-pending-indicator.d.ts +7 -0
- package/dist/lib/use-pending-indicator.d.ts.map +1 -0
- package/dist/lib/use-pending-indicator.js +27 -0
- package/dist/lib/use-pending-indicator.js.map +1 -0
- package/dist/lib/use-reduced-motion.d.ts +7 -0
- package/dist/lib/use-reduced-motion.d.ts.map +1 -0
- package/dist/lib/use-reduced-motion.js +28 -0
- package/dist/lib/use-reduced-motion.js.map +1 -0
- package/dist/styles/theme.css +368 -0
- package/dist/styles/tokens.css +248 -0
- package/package.json +90 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NavigationMenu as NavPrimitive } from '@base-ui/react/navigation-menu';
|
|
2
|
+
import { type LucideIcon } from 'lucide-react';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* A site's top navigation whose items open panels of links; the panel
|
|
6
|
+
* resizes and slides between items. Meant for public pages from md up;
|
|
7
|
+
* pair it with a Drawer menu on phones.
|
|
8
|
+
*/
|
|
9
|
+
export declare function NavigationMenu({ className, children, ...props }: NavPrimitive.Root.Props): import("react").JSX.Element;
|
|
10
|
+
export type NavigationMenuItemProps = {
|
|
11
|
+
/** The item's label in the bar. */
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
/** The panel's links; leave out for a plain link with `href`. */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
href?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
/** One item of the bar: a panel of links, or a plain link when it has only `href`. */
|
|
19
|
+
export declare function NavigationMenuItem({ label, children, href, className }: NavigationMenuItemProps): import("react").JSX.Element;
|
|
20
|
+
export type NavigationMenuLinkProps = {
|
|
21
|
+
href: string;
|
|
22
|
+
title: ReactNode;
|
|
23
|
+
description?: ReactNode;
|
|
24
|
+
icon?: LucideIcon;
|
|
25
|
+
};
|
|
26
|
+
/** A link card inside a panel: an icon, a title and a line on where it leads. */
|
|
27
|
+
export declare function NavigationMenuLink({ href, title, description, icon: Icon, }: NavigationMenuLinkProps): import("react").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../src/components/navigation-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,IAAI,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,+BA8BxF;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,mCAAmC;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF,sFAAsF;AACtF,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,uBAAuB,+BA+B/F;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,WAAW,EACX,IAAI,EAAE,IAAI,GACX,EAAE,uBAAuB,+BAqBzB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { NavigationMenu as NavPrimitive } from '@base-ui/react/navigation-menu';
|
|
4
|
+
import { ChevronDown } from 'lucide-react';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
/**
|
|
7
|
+
* A site's top navigation whose items open panels of links; the panel
|
|
8
|
+
* resizes and slides between items. Meant for public pages from md up;
|
|
9
|
+
* pair it with a Drawer menu on phones.
|
|
10
|
+
*/
|
|
11
|
+
export function NavigationMenu({ className, children, ...props }) {
|
|
12
|
+
return (_jsxs(NavPrimitive.Root, { "data-slot": "navigation-menu", className: cn('relative [--duration:var(--motion-duration-slow)] [--easing:var(--motion-ease-enter)]', className), ...props, children: [_jsx(NavPrimitive.List, { className: "flex items-center gap-0.5", children: children }), _jsx(NavPrimitive.Portal, { children: _jsx(NavPrimitive.Positioner, { sideOffset: 8, collisionPadding: { top: 5, bottom: 5, left: 16, right: 16 }, className: "z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-(--duration) ease-(--easing) data-instant:transition-none", children: _jsx(NavPrimitive.Popup, { className: cn('relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) overflow-hidden rounded-xl border border-border bg-popover text-foreground shadow-overlay outline-hidden', 'transition-[opacity,scale,width,height] duration-(--duration) ease-(--easing)', 'data-ending-style:scale-(--motion-scale-from) data-ending-style:opacity-0 data-ending-style:duration-(--motion-duration-fast) data-starting-style:scale-(--motion-scale-from) data-starting-style:opacity-0'), children: _jsx(NavPrimitive.Viewport, { className: "relative size-full overflow-hidden" }) }) }) })] }));
|
|
13
|
+
}
|
|
14
|
+
const trigger = 'flex h-9 items-center gap-1 rounded-md px-3 text-sm text-muted-foreground outline-hidden transition-colors duration-(--motion-duration-fast) hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring data-popup-open:bg-accent data-popup-open:text-foreground';
|
|
15
|
+
/** One item of the bar: a panel of links, or a plain link when it has only `href`. */
|
|
16
|
+
export function NavigationMenuItem({ label, children, href, className }) {
|
|
17
|
+
if (!children) {
|
|
18
|
+
return (_jsx(NavPrimitive.Item, { children: _jsx(NavPrimitive.Link, { href: href, className: cn(trigger, className), children: label }) }));
|
|
19
|
+
}
|
|
20
|
+
return (_jsxs(NavPrimitive.Item, { children: [_jsxs(NavPrimitive.Trigger, { className: cn(trigger, className), children: [label, _jsx(NavPrimitive.Icon, { className: "transition-transform duration-(--motion-duration-base) ease-enter data-popup-open:rotate-180", children: _jsx(ChevronDown, { className: "size-3.5" }) })] }), _jsx(NavPrimitive.Content, { className: cn('grid w-[calc(100vw-2rem)] gap-1 p-2 sm:w-max sm:max-w-lg sm:grid-cols-2', 'transition-[opacity,translate] duration-(--duration) ease-(--easing) data-ending-style:opacity-0 data-starting-style:opacity-0', 'data-starting-style:data-[activation-direction=left]:-translate-x-1/4 data-starting-style:data-[activation-direction=right]:translate-x-1/4', 'data-ending-style:data-[activation-direction=left]:translate-x-1/4 data-ending-style:data-[activation-direction=right]:-translate-x-1/4', 'motion-reduce:translate-x-0!'), children: children })] }));
|
|
21
|
+
}
|
|
22
|
+
/** A link card inside a panel: an icon, a title and a line on where it leads. */
|
|
23
|
+
export function NavigationMenuLink({ href, title, description, icon: Icon, }) {
|
|
24
|
+
return (_jsxs(NavPrimitive.Link, { href: href, className: "flex gap-3 rounded-lg p-2.5 outline-hidden transition-colors duration-(--motion-duration-fast) hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring sm:w-56", children: [Icon ? (_jsx("span", { className: "grid size-8 shrink-0 place-items-center rounded-md border border-border text-skylab-300", children: _jsx(Icon, { className: "size-4", "aria-hidden": true }) })) : null, _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "block text-sm font-medium text-foreground", children: title }), description ? (_jsx("span", { className: "mt-0.5 block text-xs leading-relaxed text-muted-foreground", children: description })) : null] })] }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=navigation-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-menu.js","sourceRoot":"","sources":["../../src/components/navigation-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,IAAI,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAmB,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAA2B;IACvF,OAAO,CACL,MAAC,YAAY,CAAC,IAAI,iBACN,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CACX,uFAAuF,EACvF,SAAS,CACV,KACG,KAAK,aAET,KAAC,YAAY,CAAC,IAAI,IAAC,SAAS,EAAC,2BAA2B,YAAE,QAAQ,GAAqB,EACvF,KAAC,YAAY,CAAC,MAAM,cAClB,KAAC,YAAY,CAAC,UAAU,IACtB,UAAU,EAAE,CAAC,EACb,gBAAgB,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAC5D,SAAS,EAAC,qLAAqL,YAE/L,KAAC,YAAY,CAAC,KAAK,IACjB,SAAS,EAAE,EAAE,CACX,oLAAoL,EACpL,+EAA+E,EAC/E,6MAA6M,CAC9M,YAED,KAAC,YAAY,CAAC,QAAQ,I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R,gBAAM,SAAS,EAAC,SAAS,aACvB,eAAM,SAAS,EAAC,2CAA2C,YAAE,KAAK,GAAQ,EACzE,WAAW,CAAC,CAAC,CAAC,CACb,eAAM,SAAS,EAAC,4DAA4D,YACzE,WAAW,GACP,CACR,CAAC,CAAC,CAAC,IAAI,IACH,IACW,CACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
export type PageHeaderProps = {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
/** A badge beside the title, such as a form's open or closed state. */
|
|
6
|
+
badge?: ReactNode;
|
|
7
|
+
/** Buttons at the right of the title row. */
|
|
8
|
+
actions?: ReactNode;
|
|
9
|
+
/** Chips or stats under the description. */
|
|
10
|
+
meta?: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
/** A toolbar row under the divider: search, filters, view switches. */
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/** The top of a page: title, description, actions and an optional toolbar row. */
|
|
16
|
+
export declare function PageHeader({ title, description, badge, actions, meta, className, children, }: PageHeaderProps): import("react").JSX.Element;
|
|
17
|
+
export type SearchInputProps = Omit<ComponentProps<'input'>, 'value' | 'onChange' | 'size'> & {
|
|
18
|
+
value: string;
|
|
19
|
+
onValueChange: (value: string) => void;
|
|
20
|
+
/** The narrow form for toolbars in the shell header; it widens while focused. */
|
|
21
|
+
compact?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** A search box with a leading glass and a clear button while it has text. */
|
|
24
|
+
export declare function SearchInput({ value, onValueChange, compact, placeholder, className, ...props }: SearchInputProps): import("react").JSX.Element;
|
|
25
|
+
export type FilterPillOption<T extends string> = {
|
|
26
|
+
value: T;
|
|
27
|
+
label: ReactNode;
|
|
28
|
+
count?: number;
|
|
29
|
+
};
|
|
30
|
+
export type FilterPillsProps<T extends string> = {
|
|
31
|
+
value: T;
|
|
32
|
+
onValueChange: (value: T) => void;
|
|
33
|
+
options: readonly FilterPillOption<T>[];
|
|
34
|
+
'aria-label': string;
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
/** A few mutually exclusive list filters, with optional counts. */
|
|
38
|
+
export declare function FilterPills<T extends string>({ value, onValueChange, options, 'aria-label': ariaLabel, className, }: FilterPillsProps<T>): import("react").JSX.Element;
|
|
39
|
+
/** A labelled figure for header rows: a count, a date, a total. */
|
|
40
|
+
export declare function Stat({ label, value, className, }: {
|
|
41
|
+
label: ReactNode;
|
|
42
|
+
value: ReactNode;
|
|
43
|
+
className?: string;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
//# sourceMappingURL=page-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../src/components/page-header.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMnE,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,uEAAuE;IACvE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,KAAK,EACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT,QAAQ,GACT,EAAE,eAAe,+BAsBjB;AAED,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,UAAU,GA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react/jsx-runtime";
|
|
3
|
+
import { Search, X } from 'lucide-react';
|
|
4
|
+
import { AnimatePresence, LayoutGroup, m } from 'motion/react';
|
|
5
|
+
import { useId } from 'react';
|
|
6
|
+
import { cn } from '../lib/cn.js';
|
|
7
|
+
import { transitions } from '../lib/motion-tokens.js';
|
|
8
|
+
import { useSkylcn } from '../lib/provider.js';
|
|
9
|
+
import { AnimatedNumber } from './motion.js';
|
|
10
|
+
/** The top of a page: title, description, actions and an optional toolbar row. */
|
|
11
|
+
export function PageHeader({ title, description, badge, actions, meta, className, children, }) {
|
|
12
|
+
return (_jsxs("header", { "data-slot": "page-header", className: cn('flex flex-col gap-3', className), children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2.5", children: [_jsx("h1", { className: "truncate text-lg font-semibold text-foreground", children: title }), badge ? _jsx("span", { className: "shrink-0", children: badge }) : null] }), description ? (_jsx("p", { className: "mt-0.5 text-2xs text-subtle-foreground", children: description })) : null, meta ? _jsx("div", { className: "flex flex-wrap items-center gap-1.5 pt-2", children: meta }) : null] }), actions ? _jsx("div", { className: "flex shrink-0 items-center gap-1.5", children: actions }) : null] }), _jsx("div", { className: "h-px bg-border" }), children ? (_jsx("div", { className: "flex flex-wrap items-center gap-2 md:flex-nowrap", children: children })) : null] }));
|
|
13
|
+
}
|
|
14
|
+
/** A search box with a leading glass and a clear button while it has text. */
|
|
15
|
+
export function SearchInput({ value, onValueChange, compact = false, placeholder, className, ...props }) {
|
|
16
|
+
const { messages } = useSkylcn();
|
|
17
|
+
return (_jsxs("div", { "data-slot": "search-input", className: cn('relative', compact
|
|
18
|
+
? 'w-56 transition-[width] duration-(--motion-duration-base) ease-enter focus-within:w-72'
|
|
19
|
+
: 'max-w-sm min-w-45 flex-1', className), children: [_jsx(Search, { className: "pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-faint-foreground" }), _jsx("input", { type: "search", value: value, onChange: (event) => onValueChange(event.target.value), placeholder: placeholder ?? messages.search, "aria-label": props['aria-label'] ?? (typeof placeholder === 'string' ? placeholder : messages.search), className: cn('w-full rounded-md border border-input bg-card pr-8 pl-8 text-xs text-foreground outline-hidden placeholder:text-subtle-foreground', 'transition-[border-color,background-color] duration-(--motion-duration-fast) ease-enter', 'focus-visible:border-skylab-400/50 focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-skylab-400/20', '[&::-webkit-search-cancel-button]:hidden', compact ? 'h-8' : 'h-9 rounded-lg', 'pointer-coarse:h-10 pointer-coarse:text-base'), ...props }), _jsx(AnimatePresence, { initial: false, children: value ? (_jsx(m.button, { type: "button", onClick: () => onValueChange(''), "aria-label": messages.clearSearch, title: messages.clearSearch, initial: { opacity: 0, scale: 0.8 }, animate: { opacity: 1, scale: 1, transition: transitions.enter }, exit: { opacity: 0, scale: 0.8, transition: transitions.exit }, className: "absolute top-1/2 right-1.5 grid size-5 -translate-y-1/2 place-items-center rounded text-subtle-foreground outline-hidden transition-colors duration-(--motion-duration-fast) hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(X, { className: "size-3.5" }) }, "clear")) : null })] }));
|
|
20
|
+
}
|
|
21
|
+
/** A few mutually exclusive list filters, with optional counts. */
|
|
22
|
+
export function FilterPills({ value, onValueChange, options, 'aria-label': ariaLabel, className, }) {
|
|
23
|
+
const group = useId();
|
|
24
|
+
return (_jsx(LayoutGroup, { id: group, children: _jsx("div", { role: "group", "aria-label": ariaLabel, "data-slot": "filter-pills", className: cn('inline-flex h-8 items-center gap-0.5 rounded-md border border-border bg-input-background p-0.5 pointer-coarse:h-10', className), children: options.map((option) => {
|
|
25
|
+
const active = option.value === value;
|
|
26
|
+
return (_jsxs("button", { type: "button", "aria-pressed": active, onClick: () => onValueChange(option.value), className: cn('relative isolate inline-flex h-full items-center gap-1.5 rounded px-2.5 text-xs outline-hidden', 'transition-colors duration-(--motion-duration-fast) ease-enter focus-visible:ring-2 focus-visible:ring-ring', active
|
|
27
|
+
? 'text-skylab-300'
|
|
28
|
+
: 'text-muted-foreground hover:text-secondary-foreground'), children: [active ? (
|
|
29
|
+
// The chosen pill's fill glides to the next choice
|
|
30
|
+
_jsx(m.span, { layoutId: "pill", "aria-hidden": true, className: "absolute inset-0 -z-10 rounded bg-skylab-500/20", transition: transitions.layout })) : null, option.label, option.count !== undefined ? (_jsx("span", { className: cn('text-3xs tabular-nums', active ? 'text-skylab-300' : 'text-subtle-foreground'), children: _jsx(AnimatedNumber, { value: option.count, tabular: true }) })) : null] }, option.value));
|
|
31
|
+
}) }) }));
|
|
32
|
+
}
|
|
33
|
+
/** A labelled figure for header rows: a count, a date, a total. */
|
|
34
|
+
export function Stat({ label, value, className, }) {
|
|
35
|
+
return (_jsxs("div", { "data-slot": "stat", className: cn('text-right', className), children: [_jsx("p", { className: "text-3xs font-medium tracking-label text-subtle-foreground uppercase", children: label }), _jsx("p", { className: "text-sm font-semibold text-foreground tabular-nums", children: value ?? '--' })] }));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=page-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.js","sourceRoot":"","sources":["../../src/components/page-header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAuC,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgB7C,kFAAkF;AAClF,MAAM,UAAU,UAAU,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,CACR,CAAC,CAAC,CAAC,IAAI,KA/BH,MAAM,CAAC,KAAK,CAgCV,CACV,CAAC;YACJ,CAAC,CAAC,GACE,GACM,CACf,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,IAAI,CAAC,EACnB,KAAK,EACL,KAAK,EACL,SAAS,GAKV;IACC,OAAO,CACL,4BAAe,MAAM,EAAC,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,aAC1D,YAAG,SAAS,EAAC,sEAAsE,YAChF,KAAK,GACJ,EACJ,YAAG,SAAS,EAAC,oDAAoD,YAAE,KAAK,IAAI,IAAI,GAAK,IACjF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type PageSlot = number | 'gap-start' | 'gap-end';
|
|
2
|
+
export declare function pageSlots(current: number, total: number): PageSlot[];
|
|
3
|
+
export type PaginationProps = {
|
|
4
|
+
current: number;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
onPageChange: (page: number) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Lets the reader type a page number into the current page. On by default
|
|
9
|
+
* once some pages are folded away behind "…".
|
|
10
|
+
*/
|
|
11
|
+
jumpToPage?: boolean;
|
|
12
|
+
/** Names the navigation when a page has more than one; "Sayfalama" by default. */
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
/** Page steps with a window around the current page; hidden when there is one page. */
|
|
17
|
+
export declare function Pagination({ current, totalPages, onPageChange, jumpToPage, 'aria-label': label, className, }: PaginationProps): import("react").JSX.Element | null;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAOA,KAAK,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAEjD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,EAAE,CAKpE;AASD,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF,uFAAuF;AACvF,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,UAAU,EACV,YAAY,EACZ,UAAU,EACV,YAAY,EAAE,KAAK,EACnB,SAAS,GACV,EAAE,eAAe,sCA2EjB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowLeft, ArrowRight } from 'lucide-react';
|
|
4
|
+
import { useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
import { useSkylcn } from '../lib/provider.js';
|
|
7
|
+
export function pageSlots(current, total) {
|
|
8
|
+
if (total <= 5)
|
|
9
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
10
|
+
if (current <= 3)
|
|
11
|
+
return [1, 2, 3, 4, 'gap-end', total];
|
|
12
|
+
if (current >= total - 2)
|
|
13
|
+
return [1, 'gap-start', total - 3, total - 2, total - 1, total];
|
|
14
|
+
return [1, 'gap-start', current - 1, current, current + 1, 'gap-end', total];
|
|
15
|
+
}
|
|
16
|
+
const stepClass = cn('flex size-7 items-center justify-center rounded-md border border-border text-xs outline-hidden pointer-coarse:size-9', 'transition-colors duration-(--motion-duration-fast) focus-visible:ring-2 focus-visible:ring-ring', 'enabled:bg-card enabled:text-secondary-foreground enabled:hover:border-skylab-400/40 enabled:hover:bg-skylab-500/10', 'disabled:cursor-not-allowed disabled:bg-muted disabled:text-subtle-foreground disabled:opacity-60');
|
|
17
|
+
const CURRENT = 'h-7 min-w-7 rounded-md border border-skylab-400/40 bg-skylab-500/15 px-1 text-xs font-semibold text-skylab-300 tabular-nums pointer-coarse:h-9 pointer-coarse:min-w-9';
|
|
18
|
+
/** Page steps with a window around the current page; hidden when there is one page. */
|
|
19
|
+
export function Pagination({ current, totalPages, onPageChange, jumpToPage, 'aria-label': label, className, }) {
|
|
20
|
+
const { messages } = useSkylcn();
|
|
21
|
+
const total = Math.max(1, Math.floor(totalPages) || 1);
|
|
22
|
+
const page = Math.min(Math.max(1, Math.floor(current) || 1), total);
|
|
23
|
+
if (total <= 1)
|
|
24
|
+
return null;
|
|
25
|
+
const slots = pageSlots(page, total);
|
|
26
|
+
const editable = jumpToPage ?? slots.length < total;
|
|
27
|
+
const goTo = (next) => {
|
|
28
|
+
const clamped = Math.min(Math.max(next, 1), total);
|
|
29
|
+
if (clamped !== page)
|
|
30
|
+
onPageChange(clamped);
|
|
31
|
+
};
|
|
32
|
+
const currentPage = editable ? (_jsx(PageInput, { page: page, total: total, label: messages.pageInput(total), onJump: goTo })) : (_jsxs("span", { "aria-current": "page", className: cn(CURRENT, 'inline-grid place-items-center'), children: [_jsx("span", { className: "sr-only", children: messages.page(page) }), _jsx("span", { "aria-hidden": true, children: page })] }));
|
|
33
|
+
return (_jsxs("nav", { "data-slot": "pagination", "aria-label": label ?? messages.pagination, className: cn('flex flex-wrap items-center justify-center gap-1', className), children: [_jsx("button", { type: "button", className: stepClass, onClick: () => goTo(page - 1), disabled: page <= 1, "aria-label": messages.previousPage, children: _jsx(ArrowLeft, { className: "size-3.5" }) }), _jsxs("span", { className: "flex items-center gap-1.5 px-1 text-xs text-subtle-foreground tabular-nums sm:hidden", children: [currentPage, _jsxs("span", { "aria-hidden": true, children: ["/ ", total] })] }), _jsx("div", { className: "hidden items-center gap-1 rounded-lg border border-border bg-card px-1 py-0.5 shadow-sm sm:flex", children: slots.map((slot) => slot === page ? (
|
|
34
|
+
// One key for the current page wherever it sits, so typing into it survives the move
|
|
35
|
+
_jsx("span", { className: "contents", children: currentPage }, "current")) : typeof slot === 'number' ? (_jsx("button", { type: "button", onClick: () => goTo(slot), "aria-label": messages.page(slot), className: "size-7 rounded-md text-xs font-semibold text-secondary-foreground tabular-nums outline-hidden transition-colors duration-(--motion-duration-fast) hover:bg-accent-strong hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:size-9", children: slot }, slot)) : (_jsx("span", { "aria-hidden": true, className: "px-1 text-xs text-subtle-foreground", children: "\u2026" }, slot))) }), _jsx("button", { type: "button", className: stepClass, onClick: () => goTo(page + 1), disabled: page >= total, "aria-label": messages.nextPage, children: _jsx(ArrowRight, { className: "size-3.5" }) })] }));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The current page as a field: digits only, as many as the last page has.
|
|
39
|
+
* Enter or leaving the field goes there, held within 1 and the last page;
|
|
40
|
+
* Escape or an empty field puts the current page back.
|
|
41
|
+
*/
|
|
42
|
+
function PageInput({ page, total, label, onJump, }) {
|
|
43
|
+
const [draft, setDraft] = useState(null);
|
|
44
|
+
const ref = useRef(null);
|
|
45
|
+
const digits = String(total).length;
|
|
46
|
+
// After a jump the new number is selected, ready to be typed over
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (ref.current && document.activeElement === ref.current)
|
|
49
|
+
ref.current.select();
|
|
50
|
+
}, [page]);
|
|
51
|
+
const commit = () => {
|
|
52
|
+
if (draft === null)
|
|
53
|
+
return;
|
|
54
|
+
const typed = Number.parseInt(draft, 10);
|
|
55
|
+
setDraft(null);
|
|
56
|
+
if (Number.isFinite(typed))
|
|
57
|
+
onJump(typed);
|
|
58
|
+
};
|
|
59
|
+
return (_jsx("input", { ref: ref, type: "text", inputMode: "numeric", enterKeyHint: "go", autoComplete: "off", maxLength: digits, "aria-label": label, title: label, value: draft ?? String(page), onChange: (event) => setDraft(event.target.value.replace(/\D/g, '')), onFocus: (event) => event.target.select(), onBlur: commit, onKeyDown: (event) => {
|
|
60
|
+
if (event.key === 'Enter') {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
commit();
|
|
63
|
+
}
|
|
64
|
+
else if (event.key === 'Escape' && draft !== null) {
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
setDraft(null);
|
|
67
|
+
}
|
|
68
|
+
}, style: { width: `calc(${digits}ch + 1rem)` }, className: cn(CURRENT, 'cursor-text text-center outline-hidden transition-[border-color,background-color,color] duration-(--motion-duration-fast) selection:bg-skylab-400/30 selection:text-foreground-strong pointer-coarse:text-base', 'hover:border-skylab-300/60 focus-visible:border-skylab-400/60 focus-visible:bg-input-background focus-visible:text-foreground focus-visible:ring-2 focus-visible:ring-ring') }));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,KAAa;IACtD,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtE,IAAI,OAAO,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE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AC7K,GACD,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
2
|
+
export declare const Popover: typeof PopoverPrimitive.Root;
|
|
3
|
+
export declare const PopoverTrigger: PopoverPrimitive.Trigger;
|
|
4
|
+
export declare const PopoverClose: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export type PopoverContentProps = PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>;
|
|
6
|
+
/** A floating panel: filters, share options, pickers. Glassy like the admin filter shells. */
|
|
7
|
+
export declare function PopoverContent({ className, side, align, sideOffset, alignOffset, anchor, ...props }: PopoverContentProps): import("react").JSX.Element;
|
|
8
|
+
export declare const PopoverTitle: ({ className, ...props }: PopoverPrimitive.Title.Props) => import("react").JSX.Element;
|
|
9
|
+
export declare const PopoverDescription: ({ className, ...props }: PopoverPrimitive.Description.Props) => import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAIrE,eAAO,MAAM,OAAO,8BAAwB,CAAC;AAC7C,eAAO,MAAM,cAAc,0BAA2B,CAAC;AACvD,eAAO,MAAM,YAAY,uJAAyB,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,GAC5D,IAAI,CACF,gBAAgB,CAAC,UAAU,CAAC,KAAK,EACjC,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,aAAa,GAAG,QAAQ,CAC3D,CAAC;AAEJ,8FAA8F;AAC9F,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,IAAe,EACf,KAAgB,EAChB,UAAc,EACd,WAAe,EACf,MAAM,EACN,GAAG,KAAK,EACT,EAAE,mBAAmB,+BAuBrB;AAED,eAAO,MAAM,YAAY,GAAI,yBAAyB,gBAAgB,CAAC,KAAK,CAAC,KAAK,gCAKjF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,yBAAyB,gBAAgB,CAAC,WAAW,CAAC,KAAK,gCAK7F,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
import { popupMotionBase } from '../lib/motion.js';
|
|
6
|
+
export const Popover = PopoverPrimitive.Root;
|
|
7
|
+
export const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
8
|
+
export const PopoverClose = PopoverPrimitive.Close;
|
|
9
|
+
/** A floating panel: filters, share options, pickers. Glassy like the admin filter shells. */
|
|
10
|
+
export function PopoverContent({ className, side = 'bottom', align = 'center', sideOffset = 8, alignOffset = 0, anchor, ...props }) {
|
|
11
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Positioner, { side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, anchor: anchor, className: "z-50", children: _jsx(PopoverPrimitive.Popup, { "data-slot": "popover-content", className: cn('w-80 max-w-[calc(100vw-1rem)] rounded-xl border border-border-strong bg-popover/85 p-3 text-foreground shadow-overlay outline-hidden backdrop-blur', popupMotionBase, className), ...props }) }) }));
|
|
12
|
+
}
|
|
13
|
+
export const PopoverTitle = ({ className, ...props }) => (_jsx(PopoverPrimitive.Title, { className: cn('text-sm font-semibold text-foreground', className), ...props }));
|
|
14
|
+
export const PopoverDescription = ({ className, ...props }) => (_jsx(PopoverPrimitive.Description, { className: cn('text-2xs text-subtle-foreground', className), ...props }));
|
|
15
|
+
//# sourceMappingURL=popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAC7C,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC;AACvD,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC;AAQnD,8FAA8F;AAC9F,MAAM,UAAU,cAAc,CAAC,EAC7B,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,QAAQ,EAChB,UAAU,GAAG,CAAC,EACd,WAAW,GAAG,CAAC,EACf,MAAM,EACN,GAAG,KAAK,EACY;IACpB,OAAO,CACL,KAAC,gBAAgB,CAAC,MAAM,cACtB,KAAC,gBAAgB,CAAC,UAAU,IAC1B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,SAAS,EAAC,MAAM,YAEhB,KAAC,gBAAgB,CAAC,KAAK,iBACX,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CACX,oJAAoJ,EACpJ,eAAe,EACf,SAAS,CACV,KACG,KAAK,GACT,GAC0B,GACN,CAC3B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgC,EAAE,EAAE,CAAC,CACrF,KAAC,gBAAgB,CAAC,KAAK,IACrB,SAAS,EAAE,EAAE,CAAC,uCAAuC,EAAE,SAAS,CAAC,KAC7D,KAAK,GACT,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAsC,EAAE,EAAE,CAAC,CACjG,KAAC,gBAAgB,CAAC,WAAW,IAC3B,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,SAAS,CAAC,KACvD,KAAK,GACT,CACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card';
|
|
2
|
+
export declare const PreviewCard: <Payload>(props: PreviewCardPrimitive.Root.Props<Payload>) => React.JSX.Element;
|
|
3
|
+
/** The link that shows the card on hover or keyboard focus; opens after `delay` ms (300 here). */
|
|
4
|
+
export declare function PreviewCardTrigger({ delay, closeDelay, ...props }: PreviewCardPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
5
|
+
export type PreviewCardContentProps = PreviewCardPrimitive.Popup.Props & Pick<PreviewCardPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset'>;
|
|
6
|
+
/**
|
|
7
|
+
* A glimpse of what a link leads to, beside it: a component, a member, an
|
|
8
|
+
* event. Extra help only; the link works the same without it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function PreviewCardContent({ className, side, align, sideOffset, ...props }: PreviewCardContentProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=preview-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-card.d.ts","sourceRoot":"","sources":["../../src/components/preview-card.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAIlF,eAAO,MAAM,WAAW,iFAA4B,CAAC;AAErD,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,EACjC,KAAW,EACX,UAAgB,EAChB,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,OAAO,CAAC,KAAK,+BAEpC;AAED,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,KAAK,CAAC,KAAK,GACpE,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC,CAAC;AAE/E;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,IAAc,EACd,KAAe,EACf,UAAe,EACf,GAAG,KAAK,EACT,EAAE,uBAAuB,+BAqBzB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
import { popupMotionBase } from '../lib/motion.js';
|
|
6
|
+
export const PreviewCard = PreviewCardPrimitive.Root;
|
|
7
|
+
/** The link that shows the card on hover or keyboard focus; opens after `delay` ms (300 here). */
|
|
8
|
+
export function PreviewCardTrigger({ delay = 300, closeDelay = 150, ...props }) {
|
|
9
|
+
return _jsx(PreviewCardPrimitive.Trigger, { delay: delay, closeDelay: closeDelay, ...props });
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A glimpse of what a link leads to, beside it: a component, a member, an
|
|
13
|
+
* event. Extra help only; the link works the same without it.
|
|
14
|
+
*/
|
|
15
|
+
export function PreviewCardContent({ className, side = 'right', align = 'start', sideOffset = 12, ...props }) {
|
|
16
|
+
return (_jsx(PreviewCardPrimitive.Portal, { children: _jsx(PreviewCardPrimitive.Positioner, { side: side, align: align, sideOffset: sideOffset, className: "z-50", children: _jsx(PreviewCardPrimitive.Popup, { "data-slot": "preview-card", className: cn('w-72 max-w-[calc(100vw-1rem)] rounded-xl border border-border bg-popover p-3 text-foreground shadow-overlay outline-hidden', popupMotionBase, className), ...props }) }) }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=preview-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-card.js","sourceRoot":"","sources":["../../src/components/preview-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC,IAAI,CAAC;AAErD,kGAAkG;AAClG,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,GAAG,GAAG,EACX,UAAU,GAAG,GAAG,EAChB,GAAG,KAAK,EAC2B;IACnC,OAAO,KAAC,oBAAoB,CAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,KAAM,KAAK,GAAI,CAAC;AAC3F,CAAC;AAKD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,SAAS,EACT,IAAI,GAAG,OAAO,EACd,KAAK,GAAG,OAAO,EACf,UAAU,GAAG,EAAE,EACf,GAAG,KAAK,EACgB;IACxB,OAAO,CACL,KAAC,oBAAoB,CAAC,MAAM,cAC1B,KAAC,oBAAoB,CAAC,UAAU,IAC9B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,EAAC,MAAM,YAEhB,KAAC,oBAAoB,CAAC,KAAK,iBACf,cAAc,EACxB,SAAS,EAAE,EAAE,CACX,4HAA4H,EAC5H,eAAe,EACf,SAAS,CACV,KACG,KAAK,GACT,GAC8B,GACN,CAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ProportionSegment = {
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
value: number;
|
|
5
|
+
};
|
|
6
|
+
export type ProportionBarProps = {
|
|
7
|
+
/** Two to six parts in a fixed order; each keeps its chart colour by position. */
|
|
8
|
+
segments: readonly ProportionSegment[];
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* One whole split into a few parts along a thin bar, such as registered and
|
|
13
|
+
* anonymous replies, with a legend of counts and shares under it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ProportionBar({ segments, className }: ProportionBarProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=proportion-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proportion-bar.d.ts","sourceRoot":"","sources":["../../src/components/proportion-bar.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,iBAAiB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,kFAAkF;IAClF,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BA8CxE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../lib/cn.js';
|
|
4
|
+
import { useSkylcn } from '../lib/provider.js';
|
|
5
|
+
/**
|
|
6
|
+
* One whole split into a few parts along a thin bar, such as registered and
|
|
7
|
+
* anonymous replies, with a legend of counts and shares under it.
|
|
8
|
+
*/
|
|
9
|
+
export function ProportionBar({ segments, className }) {
|
|
10
|
+
const { locale } = useSkylcn();
|
|
11
|
+
const tag = locale === 'tr' ? 'tr-TR' : 'en-US';
|
|
12
|
+
const total = segments.reduce((sum, segment) => sum + segment.value, 0);
|
|
13
|
+
const share = (value) => (total ? (value / total) * 100 : 0);
|
|
14
|
+
const percent = (value) => {
|
|
15
|
+
const text = Math.round(share(value)).toLocaleString(tag);
|
|
16
|
+
return locale === 'tr' ? `%${text}` : `${text}%`;
|
|
17
|
+
};
|
|
18
|
+
return (_jsxs("div", { "data-slot": "proportion-bar", className: cn('flex flex-col gap-2', className), children: [_jsx("div", { "aria-hidden": true, className: cn('flex h-2 w-full gap-0.5 overflow-hidden rounded-full', total === 0 && 'bg-muted'), children: segments.map((segment, i) => segment.value > 0 ? (_jsx("span", { className: "h-full transition-[width] duration-(--motion-duration-slow) ease-enter first:rounded-l-full last:rounded-r-full", style: { width: `${share(segment.value)}%`, background: `var(--chart-${i + 1})` } }, segment.key)) : null) }), _jsx("ul", { className: "flex flex-wrap gap-x-4 gap-y-1", children: segments.map((segment, i) => (_jsxs("li", { className: "flex items-center gap-1.5 text-2xs", children: [_jsx("span", { "aria-hidden": true, className: "size-2 shrink-0 rounded-xs", style: { background: `var(--chart-${i + 1})` } }), _jsx("span", { className: "text-secondary-foreground", children: segment.label }), _jsxs("span", { className: "text-subtle-foreground tabular-nums", children: [segment.value.toLocaleString(tag), " \u00B7 ", percent(segment.value)] })] }, segment.key))) })] }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=proportion-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proportion-bar.js","sourceRoot":"","sources":["../../src/components/proportion-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU/C;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAsB;IACvE,MAAM,EAAE,MAAM,EAAE,GAAG,SA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,CAAC,IAAI,CACT,GACG,EACN,aAAI,SAAS,EAAC,gCAAgC,YAC3C,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAC5B,cAAsB,SAAS,EAAC,oCAAoC,aAClE,oCAEE,SAAS,EAAC,4BAA4B,EACtC,KAAK,EAAE,EAAE,UAAU,EAAE,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,GAC9C,EACF,eAAM,SAAS,EAAC,2BAA2B,YAAE,OAAO,CAAC,KAAK,GAAQ,EAClE,gBAAM,SAAS,EAAC,qCAAqC,aAClD,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,cAAK,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,IACxD,KATA,OAAO,CAAC,GAAG,CAUf,CACN,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
export declare function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props): import("react").JSX.Element;
|
|
5
|
+
export type RadioProps = RadioPrimitive.Root.Props & {
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
/** One choice of a RadioGroup, with its label; the whole row is the hit area. */
|
|
10
|
+
export declare function Radio({ label, description, className, ...props }: RadioProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../src/components/radio-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,CAAC,KAAK,+BAQ5E;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,GAAG;IACnD,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BA0B5E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
4
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
export function RadioGroup({ className, ...props }) {
|
|
7
|
+
return (_jsx(RadioGroupPrimitive, { "data-slot": "radio-group", className: cn('flex flex-col gap-2', className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
/** One choice of a RadioGroup, with its label; the whole row is the hit area. */
|
|
10
|
+
export function Radio({ label, description, className, ...props }) {
|
|
11
|
+
return (_jsxs("label", { className: cn('group flex cursor-pointer items-start gap-2.5 text-sm has-data-disabled:cursor-not-allowed', className), children: [_jsx(RadioPrimitive.Root, { className: cn('mt-0.5 grid size-4 shrink-0 place-items-center rounded-full border border-border-strong bg-input-background outline-hidden pointer-coarse:size-5', 'transition-[border-color,background-color] duration-(--motion-duration-fast) focus-visible:ring-2 focus-visible:ring-ring', 'data-checked:border-skylab-400 data-checked:bg-skylab-500/15 data-disabled:opacity-50'), ...props, children: _jsx(RadioPrimitive.Indicator, { className: "size-2 rounded-full bg-skylab-400 transition-[scale,opacity] duration-(--motion-duration-fast) ease-enter data-ending-style:scale-0 data-starting-style:scale-0" }) }), _jsxs("span", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-secondary-foreground group-has-data-disabled:text-faint-foreground", children: label }), description ? _jsx("span", { className: "text-xs text-muted-foreground", children: description }) : null] })] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=radio-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../src/components/radio-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA6B;IAC3E,OAAO,CACL,KAAC,mBAAmB,iBACR,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,KAC3C,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAOD,iFAAiF;AACjF,MAAM,UAAU,KAAK,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,KAAK,EAAc;IAC3E,OAAO,CACL,iBACE,SAAS,EAAE,EAAE,CACX,4FAA4F,EAC5F,SAAS,CACV,aAED,KAAC,cAAc,CAAC,IAAI,IAClB,SAAS,EAAE,EAAE,CACX,kJAAkJ,EAClJ,2HAA2H,EAC3H,uFAAuF,CACxF,KACG,KAAK,YAET,KAAC,cAAc,CAAC,SAAS,IAAC,SAAS,EAAC,iKAAiK,GAAG,GACpL,EACtB,gBAAM,SAAS,EAAC,uBAAuB,aACrC,eAAM,SAAS,EAAC,yEAAyE,YACtF,KAAK,GACD,EACN,WAAW,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,+BAA+B,YAAE,WAAW,GAAQ,CAAC,CAAC,CAAC,IAAI,IACrF,IACD,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
export type RevealProps = Omit<ComponentProps<'div'>, 'onAnimationStart' | 'onDrag' | 'onDragStart' | 'onDragEnd'> & {
|
|
3
|
+
/** Position among its siblings; each step waits one stagger longer, up to eight. */
|
|
4
|
+
index?: number;
|
|
5
|
+
/** `lg` travels a little further, for cards and sections. */
|
|
6
|
+
size?: 'md' | 'lg';
|
|
7
|
+
/**
|
|
8
|
+
* Waits until it scrolls into view instead of animating on mount, for the
|
|
9
|
+
* sections of a long public page.
|
|
10
|
+
*/
|
|
11
|
+
inView?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Rises and fades in once, one after another with its siblings: dashboard
|
|
15
|
+
* sections, cards, search results, landing page blocks. Reduced motion leaves
|
|
16
|
+
* the fade and drops the rise.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Reveal({ index, size, inView, className, style, ...props }: RevealProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=reveal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reveal.d.ts","sourceRoot":"","sources":["../../src/components/reveal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAM3D,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,cAAc,CAAC,KAAK,CAAC,EACrB,kBAAkB,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,CAC5D,GAAG;IACF,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAS,EACT,IAAW,EACX,MAAc,EACd,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,WAAW,+BAgCb"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { m } from 'motion/react';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
import { motionTokens, transitions } from '../lib/motion-tokens.js';
|
|
6
|
+
const CAP = 8;
|
|
7
|
+
/**
|
|
8
|
+
* Rises and fades in once, one after another with its siblings: dashboard
|
|
9
|
+
* sections, cards, search results, landing page blocks. Reduced motion leaves
|
|
10
|
+
* the fade and drops the rise.
|
|
11
|
+
*/
|
|
12
|
+
export function Reveal({ index = 0, size = 'md', inView = false, className, style, ...props }) {
|
|
13
|
+
const step = Math.min(index, CAP);
|
|
14
|
+
if (inView) {
|
|
15
|
+
return (_jsx(m.div, { "data-slot": "reveal", initial: {
|
|
16
|
+
opacity: 0,
|
|
17
|
+
y: size === 'lg' ? motionTokens.shiftLarge * 2 : motionTokens.shiftLarge,
|
|
18
|
+
}, whileInView: { opacity: 1, y: 0 }, viewport: { once: true, margin: '0px 0px -10% 0px' }, transition: { ...transitions.enterSlow, delay: step * motionTokens.stagger }, className: className, style: style, ...props }));
|
|
19
|
+
}
|
|
20
|
+
return (_jsx("div", { "data-slot": "reveal", className: cn(size === 'lg' ? 'enter-rise-lg' : 'enter-rise', className), style: {
|
|
21
|
+
animationDelay: `calc(var(--motion-stagger) * ${step})`,
|
|
22
|
+
...style,
|
|
23
|
+
}, ...props }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=reveal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reveal.js","sourceRoot":"","sources":["../../src/components/reveal.tsx"],"names":[],"mappings":"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,GAAG;YACvD,GAAG,KAAK;SACQ,KAEhB,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react';
|
|
2
|
+
export type SegmentedOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: LucideIcon;
|
|
6
|
+
};
|
|
7
|
+
export type SegmentedControlProps = {
|
|
8
|
+
options: readonly SegmentedOption[];
|
|
9
|
+
value: string;
|
|
10
|
+
onValueChange: (value: string) => void;
|
|
11
|
+
'aria-label'?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
/** A row of mutually exclusive choices with a sliding highlight, as wide as its longest choice times the count (pass w-full to stretch); icons render icon-only with the label as tooltip. */
|
|
15
|
+
export declare function SegmentedControl({ options, value, onValueChange, 'aria-label': ariaLabel, className, }: SegmentedControlProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=segmented-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmented-control.d.ts","sourceRoot":"","sources":["../../src/components/segmented-control.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAElF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,8LAA8L;AAC9L,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,KAAK,EACL,aAAa,EACb,YAAY,EAAE,SAAS,EACvB,SAAS,GACV,EAAE,qBAAqB,+BAqDvB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Toggle } from '@base-ui/react/toggle';
|
|
4
|
+
import { ToggleGroup } from '@base-ui/react/toggle-group';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
/** A row of mutually exclusive choices with a sliding highlight, as wide as its longest choice times the count (pass w-full to stretch); icons render icon-only with the label as tooltip. */
|
|
7
|
+
export function SegmentedControl({ options, value, onValueChange, 'aria-label': ariaLabel, className, }) {
|
|
8
|
+
const count = Math.max(options.length, 1);
|
|
9
|
+
const activeIndex = Math.max(0, options.findIndex((option) => option.value === value));
|
|
10
|
+
return (_jsxs(ToggleGroup, { "data-slot": "segmented-control", value: [value], onValueChange: (next) => {
|
|
11
|
+
if (next[0])
|
|
12
|
+
onValueChange(next[0]);
|
|
13
|
+
}, "aria-label": ariaLabel, className: cn('relative inline-grid w-fit max-w-full rounded-lg border border-border bg-input-background p-1 text-2xs', className), style: { gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))` }, children: [_jsx("span", { "aria-hidden": true, className: "absolute inset-y-1 left-1 rounded-md border border-skylab-400/40 bg-skylab-500/15 shadow-sm transition-transform duration-(--motion-duration-base) ease-enter", style: {
|
|
14
|
+
width: `calc((100% - 0.5rem) / ${count})`,
|
|
15
|
+
transform: `translateX(${activeIndex * 100}%)`,
|
|
16
|
+
} }), options.map((option) => {
|
|
17
|
+
const Icon = option.icon;
|
|
18
|
+
return (_jsx(Toggle, { value: option.value, "aria-label": option.label, title: option.label, className: cn('relative z-10 flex h-7 w-full items-center justify-center rounded-md px-2 font-medium text-secondary-foreground outline-hidden pointer-coarse:h-9', 'transition-colors duration-(--motion-duration-fast) hover:text-skylab-300 focus-visible:ring-2 focus-visible:ring-ring', 'data-pressed:text-skylab-300'), children: Icon ? (_jsx(Icon, { className: "size-4", "aria-hidden": true })) : (_jsx("span", { className: "truncate", children: option.label })) }, option.value));
|
|
19
|
+
})] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=segmented-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmented-control.js","sourceRoot":"","sources":["../../src/components/segmented-control.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAYlC,8LAA8L;AAC9L,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,EACP,KAAK,EACL,aAAa,EACb,YAAY,EAAE,SAAS,EACvB,SAAS,GACa;IACtB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAC1B,CAAC,EACD,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,CACtD,CAAC;IAEF,OAAO,CACL,MAAC,WAAW,iBACA,mBAAmB,EAC7B,KAAK,EAAE,CAAC,KAAK,CAAC,EACd,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE;YACtB,IAAI,IAAI,CAAC,CAAC,CAAC;gBAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC,gBACW,SAAS,EACrB,SAAS,EAAE,EAAE,CACX,wGAAwG,EACxG,SAAS,CACV,EACD,KAAK,EAAE,EAAE,mBAAmB,EAAE,UAAU,KAAK,mBAAmB,EAAE,aAElE,oCAEE,SAAS,EAAC,+JAA+J,EACzK,KAAK,E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