@wheelhouse/ui 0.2.0 → 0.2.1
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/dist/blocks/index.d.ts +2 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +1 -0
- package/dist/blocks/navigation/index.d.ts +2 -0
- package/dist/blocks/navigation/index.d.ts.map +1 -0
- package/dist/blocks/navigation/index.js +1 -0
- package/dist/blocks/navigation/pattern-1/index.d.ts +3 -0
- package/dist/blocks/navigation/pattern-1/index.d.ts.map +1 -0
- package/dist/blocks/navigation/pattern-1/index.js +1 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.config.d.ts +47 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.config.d.ts.map +1 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.config.js +55 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.d.ts +7 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.d.ts.map +1 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.js +50 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.stories.d.ts +16 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.stories.d.ts.map +1 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.stories.js +20 -0
- package/dist/components/accordion/accordion.js +2 -2
- package/dist/components/alert/alert.stories.js +4 -4
- package/dist/components/alert-dialog/alert-dialog.stories.js +2 -2
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +3 -4
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/calendar/calendar.d.ts +34 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -0
- package/dist/components/calendar/calendar.js +82 -0
- package/dist/components/calendar/calendar.stories.d.ts +16 -0
- package/dist/components/calendar/calendar.stories.d.ts.map +1 -0
- package/dist/components/calendar/calendar.stories.js +33 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/collapsible/collapsible.stories.js +4 -4
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +5 -7
- package/dist/components/command/command.d.ts.map +1 -1
- package/dist/components/command/command.js +3 -4
- package/dist/components/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/context-menu.js +4 -5
- package/dist/components/date-selector/date-selector-context.d.ts +6 -0
- package/dist/components/date-selector/date-selector-context.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector-context.js +11 -0
- package/dist/components/date-selector/date-selector-parts.d.ts +68 -0
- package/dist/components/date-selector/date-selector-parts.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector-parts.js +131 -0
- package/dist/components/date-selector/date-selector-types.d.ts +118 -0
- package/dist/components/date-selector/date-selector-types.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector-types.js +32 -0
- package/dist/components/date-selector/date-selector-value.d.ts +47 -0
- package/dist/components/date-selector/date-selector-value.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector-value.js +183 -0
- package/dist/components/date-selector/date-selector.d.ts +6 -0
- package/dist/components/date-selector/date-selector.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector.js +144 -0
- package/dist/components/date-selector/date-selector.stories.d.ts +135 -0
- package/dist/components/date-selector/date-selector.stories.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector.stories.js +144 -0
- package/dist/components/date-selector/index.d.ts +7 -0
- package/dist/components/date-selector/index.d.ts.map +1 -0
- package/dist/components/date-selector/index.js +5 -0
- package/dist/components/date-selector/use-date-selector.d.ts +50 -0
- package/dist/components/date-selector/use-date-selector.d.ts.map +1 -0
- package/dist/components/date-selector/use-date-selector.js +305 -0
- package/dist/components/dialog/dialog.js +2 -2
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +5 -6
- package/dist/components/empty/empty.stories.js +2 -2
- package/dist/components/filters/filters.js +4 -4
- package/dist/components/filters/filters.stories.js +3 -3
- package/dist/components/frame/frame.d.ts +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/input-group/input-group.d.ts +2 -2
- package/dist/components/input-group/input-group.stories.js +3 -3
- package/dist/components/item/item.d.ts +2 -2
- package/dist/components/item/item.stories.d.ts.map +1 -1
- package/dist/components/item/item.stories.js +5 -6
- package/dist/components/kbd/kbd.stories.js +2 -2
- package/dist/components/menubar/menubar.js +3 -3
- package/dist/components/native-select/native-select.js +2 -2
- package/dist/components/navigation-menu/navigation-menu.js +2 -2
- package/dist/components/pagination/pagination.js +4 -4
- package/dist/components/select/select.js +5 -5
- package/dist/components/sheet/sheet.js +2 -2
- package/dist/components/sonner/sonner.d.ts +1 -1
- package/dist/components/sonner/sonner.js +7 -7
- package/dist/components/sortable/index.d.ts +3 -0
- package/dist/components/sortable/index.d.ts.map +1 -0
- package/dist/components/sortable/index.js +1 -0
- package/dist/components/sortable/sortable.d.ts +94 -0
- package/dist/components/sortable/sortable.d.ts.map +1 -0
- package/dist/components/sortable/sortable.js +210 -0
- package/dist/components/sortable/sortable.stories.d.ts +14 -0
- package/dist/components/sortable/sortable.stories.d.ts.map +1 -0
- package/dist/components/sortable/sortable.stories.js +38 -0
- package/dist/components/spinner/spinner.d.ts +3 -3
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +2 -2
- package/dist/components/status-indicator/index.d.ts +3 -0
- package/dist/components/status-indicator/index.d.ts.map +1 -0
- package/dist/components/status-indicator/index.js +1 -0
- package/dist/components/status-indicator/status-indicator.d.ts +51 -0
- package/dist/components/status-indicator/status-indicator.d.ts.map +1 -0
- package/dist/components/status-indicator/status-indicator.js +48 -0
- package/dist/components/status-indicator/status-indicator.stories.d.ts +20 -0
- package/dist/components/status-indicator/status-indicator.stories.d.ts.map +1 -0
- package/dist/components/status-indicator/status-indicator.stories.js +97 -0
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/text/text.d.ts +1 -1
- package/dist/components/text/text.js +1 -1
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/llms.txt +11 -4
- package/package.json +9 -6
- package/src/styles/globals.css +4 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './navigation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/blocks/navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './pattern-1';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/navigation/pattern-1/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NavigationPattern1 } from './pattern-1';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation data for {@link NavigationPattern1}. Single source for desktop + mobile.
|
|
3
|
+
*/
|
|
4
|
+
export type NavBadge = {
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
/** Simple top-level link (Dashboard, Performance, …). */
|
|
8
|
+
export type Pattern1PrimaryLink = {
|
|
9
|
+
kind: 'link';
|
|
10
|
+
label: string;
|
|
11
|
+
href: string;
|
|
12
|
+
/** Current / highlighted item (e.g. Dashboard). */
|
|
13
|
+
active?: boolean;
|
|
14
|
+
badge?: NavBadge;
|
|
15
|
+
};
|
|
16
|
+
/** Expandable group (Portfolio + children). */
|
|
17
|
+
export type Pattern1PrimarySubmenu = {
|
|
18
|
+
kind: 'submenu';
|
|
19
|
+
label: string;
|
|
20
|
+
items: readonly {
|
|
21
|
+
label: string;
|
|
22
|
+
href: string;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
export type Pattern1PrimaryItem = Pattern1PrimaryLink | Pattern1PrimarySubmenu;
|
|
26
|
+
/** Left cluster: primary app routes. */
|
|
27
|
+
export declare const pattern1PrimaryNav: readonly Pattern1PrimaryItem[];
|
|
28
|
+
export type Pattern1SupportItem = {
|
|
29
|
+
label: string;
|
|
30
|
+
href: string;
|
|
31
|
+
};
|
|
32
|
+
/** Right cluster: Help / Support menu. */
|
|
33
|
+
export declare const pattern1SupportMenu: {
|
|
34
|
+
triggerLabel: string;
|
|
35
|
+
items: readonly Pattern1SupportItem[];
|
|
36
|
+
};
|
|
37
|
+
export type Pattern1UserLink = {
|
|
38
|
+
label: string;
|
|
39
|
+
href: string;
|
|
40
|
+
};
|
|
41
|
+
/** Right cluster: Account menu — grouped sections + log out. */
|
|
42
|
+
export declare const pattern1UserMenu: {
|
|
43
|
+
triggerLabel: string;
|
|
44
|
+
sections: readonly (readonly Pattern1UserLink[])[];
|
|
45
|
+
logOut: Pattern1UserLink;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=pattern-1.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-1.config.d.ts","sourceRoot":"","sources":["../../../../src/blocks/navigation/pattern-1/pattern-1.config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,yDAAyD;AACzD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;AAE/E,wCAAwC;AACxC,eAAO,MAAM,kBAAkB,EAAE,SAAS,mBAAmB,EAiB5D,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,0CAA0C;AAC1C,eAAO,MAAM,mBAAmB,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAA;CAO9F,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,EAAE;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC,SAAS,gBAAgB,EAAE,CAAC,EAAE,CAAC;IACnD,MAAM,EAAE,gBAAgB,CAAC;CAuB5B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation data for {@link NavigationPattern1}. Single source for desktop + mobile.
|
|
3
|
+
*/
|
|
4
|
+
/** Left cluster: primary app routes. */
|
|
5
|
+
export const pattern1PrimaryNav = [
|
|
6
|
+
{ kind: 'link', label: 'Dashboard', href: '/dashboard', active: true },
|
|
7
|
+
{
|
|
8
|
+
kind: 'submenu',
|
|
9
|
+
label: 'Portfolio',
|
|
10
|
+
items: [
|
|
11
|
+
{ label: 'Settings', href: '/portfolio/settings' },
|
|
12
|
+
{ label: 'Calendar', href: '/portfolio/calendar' },
|
|
13
|
+
{ label: 'Performance', href: '/portfolio/performance' },
|
|
14
|
+
{ label: 'Engine Version', href: '/portfolio/engine' },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{ kind: 'link', label: 'Performance', href: '/products' },
|
|
18
|
+
{ kind: 'link', label: 'Reporting', href: '/customers', badge: { label: 'Beta' } },
|
|
19
|
+
{ kind: 'link', label: 'Budgets', href: '/settings', badge: { label: 'Beta' } },
|
|
20
|
+
{ kind: 'link', label: 'Sets', href: '/settings' },
|
|
21
|
+
{ kind: 'link', label: 'Markets', href: '/settings' },
|
|
22
|
+
];
|
|
23
|
+
/** Right cluster: Help / Support menu. */
|
|
24
|
+
export const pattern1SupportMenu = {
|
|
25
|
+
triggerLabel: 'Support',
|
|
26
|
+
items: [
|
|
27
|
+
{ label: 'Live chat', href: '/support/chat' },
|
|
28
|
+
{ label: 'Help center', href: '/help' },
|
|
29
|
+
{ label: 'Changelog', href: '/changelog' },
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
/** Right cluster: Account menu — grouped sections + log out. */
|
|
33
|
+
export const pattern1UserMenu = {
|
|
34
|
+
triggerLabel: 'User',
|
|
35
|
+
sections: [
|
|
36
|
+
[
|
|
37
|
+
{ label: 'Profile', href: '/account/profile' },
|
|
38
|
+
{ label: 'Notifications', href: '/account/notifications' },
|
|
39
|
+
{ label: 'Email preferences', href: '/account/email-preferences' },
|
|
40
|
+
{ label: 'Your referrals', href: '/account/referrals' },
|
|
41
|
+
{ label: 'Teams', href: '/account/teams' },
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
{ label: 'Connected channels', href: '/connections' },
|
|
45
|
+
{ label: 'Add channel', href: '/connections/add' },
|
|
46
|
+
{ label: 'API key', href: '/account/api-key' },
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
{ label: 'Payment method', href: '/billing/payment' },
|
|
50
|
+
{ label: 'Subscriptions', href: '/billing/subscriptions' },
|
|
51
|
+
{ label: 'Invoices', href: '/billing/invoices' },
|
|
52
|
+
],
|
|
53
|
+
],
|
|
54
|
+
logOut: { label: 'Log out', href: '/logout' },
|
|
55
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type NavigationPattern1Props = React.ComponentProps<'div'>;
|
|
3
|
+
/**
|
|
4
|
+
* Responsive app header: mobile bar (menu, brand, search, upgrade) plus desktop nav with account actions.
|
|
5
|
+
*/
|
|
6
|
+
export declare function NavigationPattern1({ className, ...props }: NavigationPattern1Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=pattern-1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-1.d.ts","sourceRoot":"","sources":["../../../../src/blocks/navigation/pattern-1/pattern-1.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqB/B,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AA4HlE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,2CAoJlF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Bell, ChevronDown, Menu, Search, X } from 'lucide-react';
|
|
5
|
+
import { Avatar, AvatarFallback, AvatarImage } from '../../../components/avatar';
|
|
6
|
+
import { Badge } from '../../../components/badge';
|
|
7
|
+
import { Button } from '../../../components/button';
|
|
8
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../../components/collapsible';
|
|
9
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '../../../components/dropdown-menu';
|
|
10
|
+
import { Separator } from '../../../components/separator';
|
|
11
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from '../../../components/sheet';
|
|
12
|
+
import { cn } from '../../../lib/utils';
|
|
13
|
+
import { pattern1PrimaryNav, pattern1SupportMenu, pattern1UserMenu } from './pattern-1.config';
|
|
14
|
+
/** Demo user — keep in sync between desktop account menu and mobile sheet. */
|
|
15
|
+
const demoUser = {
|
|
16
|
+
name: 'shadcn',
|
|
17
|
+
email: 'm@example.com',
|
|
18
|
+
avatarSrc: 'https://github.com/shadcn.png',
|
|
19
|
+
avatarAlt: '@shadcn',
|
|
20
|
+
initials: 'CN',
|
|
21
|
+
};
|
|
22
|
+
const navLinkClass = 'rounded-md px-3 py-1 text-sm font-medium text-muted-foreground hover:bg-primary/5 outline-none focus-visible:ring-2 focus-visible:ring-ring';
|
|
23
|
+
const sheetNavLinkClass = 'flex items-center gap-2 rounded-md px-3 py-2.5 text-sm font-normal text-muted-foreground hover:bg-accent hover:text-accent-foreground';
|
|
24
|
+
function primaryNavKey(entry, index) {
|
|
25
|
+
return entry.kind === 'link' ? `link-${entry.label}-${entry.href}-${index}` : `submenu-${entry.label}`;
|
|
26
|
+
}
|
|
27
|
+
/** Wheelhouse icon mark — aligned with `marketing_site/public/svg/wh-logo-icon.svg`. */
|
|
28
|
+
function BrandLogo({ className, ...props }) {
|
|
29
|
+
return (_jsxs("svg", { viewBox: "0 0 282 196", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": true, className: cn('h-5 w-auto shrink-0', className), ...props, children: [_jsx("path", { d: "M113.84 192.61L182.63 73.4702C201.1 41.4702 178.01 1.47021 141.07 1.47021H3.4999C3.149 1.47057 2.80437 1.56325 2.50062 1.73893C2.19687 1.91462 1.94468 2.16712 1.76939 2.4711C1.5941 2.77508 1.50186 3.11983 1.50195 3.47073C1.50204 3.82163 1.59445 4.16633 1.7699 4.47021L110.38 192.61C110.556 192.913 110.808 193.165 111.112 193.34C111.415 193.515 111.76 193.607 112.11 193.607C112.46 193.607 112.805 193.515 113.108 193.34C113.412 193.165 113.664 192.913 113.84 192.61Z", fill: "#AA1DA5" }), _jsx("path", { d: "M171.33 192.61L279.93 4.5C280.106 4.19611 280.198 3.85141 280.198 3.50051C280.198 3.14961 280.106 2.80487 279.931 2.50089C279.755 2.19691 279.503 1.9444 279.2 1.76872C278.896 1.59303 278.551 1.50036 278.2 1.5H140.74C103.74 1.5 80.6402 41.5 99.1302 73.57L167.86 192.57C168.032 192.877 168.282 193.134 168.584 193.314C168.887 193.494 169.232 193.591 169.584 193.595C169.936 193.599 170.283 193.51 170.589 193.337C170.896 193.164 171.152 192.913 171.33 192.61V192.61Z", fill: "#D926D2" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M142.811 1.5H140.74C103.74 1.5 80.6402 41.5 99.1302 73.57L140.858 145.817L182.63 73.4702C200.808 41.976 178.729 2.73259 142.811 1.5Z", fill: "#71146D" })] }));
|
|
30
|
+
}
|
|
31
|
+
function MobileNavLinks({ onNavigate }) {
|
|
32
|
+
return (_jsxs("div", { className: "flex flex-col gap-0.5 p-4 pt-2", children: [pattern1PrimaryNav.map((entry, i) => {
|
|
33
|
+
if (entry.kind === 'link') {
|
|
34
|
+
return (_jsxs("a", { className: cn(sheetNavLinkClass, entry.active && 'text-primary'), href: entry.href, onClick: onNavigate, children: [entry.label, entry.badge ? _jsx(Badge, { size: "sm", children: entry.badge.label }) : null] }, primaryNavKey(entry, i)));
|
|
35
|
+
}
|
|
36
|
+
return (_jsxs(Collapsible, { className: "w-full", children: [_jsx(CollapsibleTrigger, { render: _jsxs("button", { type: "button", className: cn(sheetNavLinkClass, 'group flex w-full cursor-default justify-between font-normal text-muted-foreground hover:text-accent-foreground'), children: [_jsx("span", { children: entry.label }), _jsx(ChevronDown, { className: "size-4 shrink-0 opacity-80 transition-transform group-data-[panel-open]:rotate-180" })] }) }), _jsx(CollapsibleContent, { className: "flex flex-col gap-0.5 pt-0.5 pb-1", children: entry.items.map((sub) => (_jsx("a", { className: cn(sheetNavLinkClass, 'py-2 pl-8 text-sm'), href: sub.href, onClick: onNavigate, children: sub.label }, sub.href))) })] }, primaryNavKey(entry, i)));
|
|
37
|
+
}), _jsx(Separator, { className: "my-3" }), _jsxs("div", { className: "flex items-center gap-3 rounded-md px-3 py-2", children: [_jsxs(Avatar, { className: "size-8 border-0 after:hidden", children: [_jsx(AvatarImage, { src: demoUser.avatarSrc, alt: demoUser.avatarAlt }), _jsx(AvatarFallback, { children: demoUser.initials })] }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "truncate text-sm font-medium text-foreground", children: demoUser.name }), _jsx("p", { className: "truncate text-xs text-muted-foreground", children: demoUser.email })] })] }), pattern1UserMenu.sections.map((section, si) => (_jsxs(React.Fragment, { children: [si > 0 ? _jsx(Separator, { className: "my-2" }) : null, section.map((item) => (_jsx("a", { className: sheetNavLinkClass, href: item.href, onClick: onNavigate, children: item.label }, item.href)))] }, `user-section-${si}`))), _jsx(Separator, { className: "my-2" }), _jsx("a", { className: cn(sheetNavLinkClass, 'text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground'), href: pattern1UserMenu.logOut.href, onClick: onNavigate, children: pattern1UserMenu.logOut.label })] }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Responsive app header: mobile bar (menu, brand, search, upgrade) plus desktop nav with account actions.
|
|
41
|
+
*/
|
|
42
|
+
export function NavigationPattern1({ className, ...props }) {
|
|
43
|
+
const [mobileMenuOpen, setMobileMenuOpen] = React.useState(false);
|
|
44
|
+
return (_jsxs("div", { "data-slot": "navigation-pattern-1", className: cn(className), ...props, children: [_jsx("nav", { className: "lg:hidden", "aria-label": "Main", children: _jsxs("div", { className: "relative flex h-14 items-center justify-between border-b border-border bg-background px-4", children: [_jsxs(Button, { type: "button", variant: "ghost", className: "relative -ml-2 h-9 w-9 shrink-0 px-0 [&_svg]:size-5", "aria-expanded": mobileMenuOpen, "aria-controls": "navigation-pattern-1-mobile-sheet", "aria-label": mobileMenuOpen ? 'Close menu' : 'Open menu', onClick: () => setMobileMenuOpen((open) => !open), children: [_jsx("span", { className: cn('absolute transition-all duration-300', mobileMenuOpen ? '-rotate-90 opacity-0' : 'rotate-0 opacity-100'), "aria-hidden": true, children: _jsx(Menu, {}) }), _jsx("span", { className: cn('absolute transition-all duration-300', mobileMenuOpen ? 'rotate-0 opacity-100' : '-rotate-90 opacity-0'), "aria-hidden": true, children: _jsx(X, {}) })] }), _jsx("div", { className: "pointer-events-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", children: _jsx(BrandLogo, { className: "h-6 w-auto" }) }), _jsxs("div", { className: "flex shrink-0 items-center gap-3", children: [_jsx(Button, { type: "button", variant: "ghost", className: "size-9 p-0 [&_svg]:size-5", "aria-label": "Search", children: _jsx(Search, { className: "text-muted-foreground" }) }), _jsx(Button, { type: "button", variant: "ghost", className: "size-9 p-0 [&_svg]:size-5", "aria-label": "Notifications", children: _jsx(Bell, { className: "text-muted-foreground" }) })] })] }) }), _jsx(Sheet, { open: mobileMenuOpen, onOpenChange: setMobileMenuOpen, children: _jsxs(SheetContent, { id: "navigation-pattern-1-mobile-sheet", side: "left", showCloseButton: false, className: "flex h-[100dvh] max-h-[100dvh] w-full flex-col gap-0 overflow-hidden p-0 sm:max-w-sm", children: [_jsxs(SheetHeader, { className: "shrink-0 border-b border-border text-left", children: [_jsx(SheetTitle, { children: "Menu" }), _jsx(SheetDescription, { className: "sr-only", children: "Primary navigation links for the application." })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain", children: _jsx(MobileNavLinks, { onNavigate: () => setMobileMenuOpen(false) }) })] }) }), _jsx("nav", { className: "hidden h-12 border-b border-border bg-background lg:block", "aria-label": "Main", children: _jsxs("div", { className: "container flex h-full items-center justify-between px-6", children: [_jsxs("div", { className: "flex items-center gap-x-3", children: [_jsx(BrandLogo, {}), _jsx("div", { className: "flex items-center gap-x-1", children: pattern1PrimaryNav.map((entry, i) => {
|
|
45
|
+
if (entry.kind === 'link') {
|
|
46
|
+
return (_jsxs("a", { className: cn(navLinkClass, entry.active && 'text-primary', entry.badge && 'inline-flex items-center gap-1'), href: entry.href, children: [entry.label, entry.badge ? (_jsx(Badge, { variant: "outline", size: "sm", children: entry.badge.label })) : null] }, primaryNavKey(entry, i)));
|
|
47
|
+
}
|
|
48
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { className: cn(navLinkClass, 'inline-flex cursor-default items-center gap-0 border-0 bg-transparent'), children: [entry.label, _jsx(ChevronDown, { className: "ml-1 size-4 opacity-80" })] }), _jsx(DropdownMenuContent, { align: "start", className: "min-w-48", children: entry.items.map((sub) => (_jsx(DropdownMenuItem, { children: sub.label }, sub.href))) })] }, primaryNavKey(entry, i)));
|
|
49
|
+
}) })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": "Search", children: _jsx(Search, { className: "size-4 text-muted-foreground" }) }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": "Search", children: _jsx(Bell, { className: "size-4 text-muted-foreground" }) }), _jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { className: cn(navLinkClass, 'inline-flex cursor-default items-center gap-0 border-0 bg-transparent'), children: [pattern1SupportMenu.triggerLabel, _jsx(ChevronDown, { className: "ml-1 size-4 opacity-80" })] }), _jsx(DropdownMenuContent, { align: "start", className: "min-w-48", children: pattern1SupportMenu.items.map((item) => (_jsx(DropdownMenuItem, { children: item.label }, item.href))) })] }), _jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { className: cn(navLinkClass, 'inline-flex cursor-default items-center gap-0 border-0 bg-transparent'), children: [pattern1UserMenu.triggerLabel, _jsx(ChevronDown, { className: "ml-1 size-4 opacity-80" })] }), _jsxs(DropdownMenuContent, { align: "end", className: "min-w-56", children: [_jsxs(DropdownMenuLabel, { className: "font-normal", children: [_jsx("span", { className: "block text-sm font-medium", children: demoUser.name }), _jsx("span", { className: "block text-xs text-muted-foreground", children: demoUser.email })] }), _jsx(DropdownMenuSeparator, {}), pattern1UserMenu.sections.map((section, si) => (_jsxs(React.Fragment, { children: [si > 0 ? _jsx(DropdownMenuSeparator, {}) : null, section.map((item) => (_jsx(DropdownMenuItem, { children: item.label }, `${item.href}-${item.label}`)))] }, `user-dd-${si}`))), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { variant: "destructive", children: pattern1UserMenu.logOut.label })] })] })] })] }) })] }));
|
|
50
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { NavigationPattern1 } from './pattern-1';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof NavigationPattern1;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
/** Wide canvas: show the desktop bar only (`hidden lg:block` → forced visible). */
|
|
13
|
+
export declare const Desktop: Story;
|
|
14
|
+
/** Wide canvas: show the mobile bar and sheet trigger (`lg:hidden` → forced visible). */
|
|
15
|
+
export declare const Mobile: Story;
|
|
16
|
+
//# sourceMappingURL=pattern-1.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-1.stories.d.ts","sourceRoot":"","sources":["../../../../src/blocks/navigation/pattern-1/pattern-1.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,QAAA,MAAM,IAAI;;;;;;CAMiC,CAAC;AAE5C,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,mFAAmF;AACnF,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,MAAM,EAAE,KAEpB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { NavigationPattern1 } from './pattern-1';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Blocks/Navigation/Pattern 1',
|
|
6
|
+
component: NavigationPattern1,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'padded',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
/** Wide canvas: show the desktop bar only (`hidden lg:block` → forced visible). */
|
|
13
|
+
export const Desktop = {
|
|
14
|
+
// className="[&>nav:first-of-type]:hidden [&>nav:last-of-type]:!block"
|
|
15
|
+
render: () => _jsx(NavigationPattern1, {}),
|
|
16
|
+
};
|
|
17
|
+
/** Wide canvas: show the mobile bar and sheet trigger (`lg:hidden` → forced visible). */
|
|
18
|
+
export const Mobile = {
|
|
19
|
+
render: () => _jsx(NavigationPattern1, { className: "[&>nav:first-of-type]:!block [&>nav:last-of-type]:!hidden" }),
|
|
20
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Accordion as AccordionPrimitive } from '@base-ui/react/accordion';
|
|
4
4
|
import { cn } from '../../lib/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { ChevronDown, ChevronUp } from 'lucide-react';
|
|
6
6
|
function Accordion({ className, ...props }) {
|
|
7
7
|
return _jsx(AccordionPrimitive.Root, { "data-slot": "accordion", className: cn('flex w-full flex-col', className), ...props });
|
|
8
8
|
}
|
|
@@ -10,7 +10,7 @@ function AccordionItem({ className, ...props }) {
|
|
|
10
10
|
return _jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn('not-last:border-b', className), ...props });
|
|
11
11
|
}
|
|
12
12
|
function AccordionTrigger({ className, children, ...props }) {
|
|
13
|
-
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground', className), ...props, children: [children, _jsx(
|
|
13
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground', className), ...props, children: [children, _jsx(ChevronDown, { "data-slot": "accordion-trigger-icon", className: "pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" }), _jsx(ChevronUp, { "data-slot": "accordion-trigger-icon", className: "pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" })] }) }));
|
|
14
14
|
}
|
|
15
15
|
function AccordionContent({ className, children, ...props }) {
|
|
16
16
|
return (_jsx(AccordionPrimitive.Panel, { "data-slot": "accordion-content", className: "overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up", ...props, children: _jsx("div", { className: cn('h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4', className), children: children }) }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Alert, AlertAction, AlertDescription, AlertTitle } from './alert';
|
|
3
3
|
import { Button } from '../button';
|
|
4
|
-
import {
|
|
4
|
+
import { AlertTriangle, Info } from 'lucide-react';
|
|
5
5
|
const meta = {
|
|
6
6
|
title: 'UI/Alert',
|
|
7
7
|
component: Alert,
|
|
@@ -22,13 +22,13 @@ export const Gallery = {
|
|
|
22
22
|
layout: 'padded',
|
|
23
23
|
controls: { disable: true },
|
|
24
24
|
},
|
|
25
|
-
render: () => (_jsxs("div", { className: "flex max-w-[min(100vw-2rem,42rem)] flex-col gap-10", children: [_jsxs("section", { className: "flex flex-col gap-3", children: [_jsx("h3", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: "Default" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs(Alert, { children: [_jsx(AlertTitle, { children: "Heads up!" }), _jsx(AlertDescription, { children: "You can add components to your app using the CLI." })] }), _jsxs(Alert, { children: [_jsx(
|
|
25
|
+
render: () => (_jsxs("div", { className: "flex max-w-[min(100vw-2rem,42rem)] flex-col gap-10", children: [_jsxs("section", { className: "flex flex-col gap-3", children: [_jsx("h3", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: "Default" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs(Alert, { children: [_jsx(AlertTitle, { children: "Heads up!" }), _jsx(AlertDescription, { children: "You can add components to your app using the CLI." })] }), _jsxs(Alert, { children: [_jsx(Info, { "aria-hidden": "true" }), _jsx(AlertTitle, { children: "Information" }), _jsx(AlertDescription, { children: "Your subscription renews on the 1st of next month." })] })] })] }), _jsxs("section", { className: "flex flex-col gap-3", children: [_jsx("h3", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: "Destructive" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs(Alert, { variant: "destructive", children: [_jsx(AlertTitle, { children: "Something went wrong" }), _jsx(AlertDescription, { children: "Your session has expired. Please sign in again to continue." })] }), _jsxs(Alert, { variant: "destructive", children: [_jsx(AlertTriangle, { "aria-hidden": "true" }), _jsx(AlertTitle, { children: "Something went wrong" }), _jsx(AlertDescription, { children: "Your session has expired. Please sign in again to continue." })] })] })] }), _jsxs("section", { className: "flex flex-col gap-3", children: [_jsx("h3", { className: "text-xs font-medium tracking-wide text-muted-foreground uppercase", children: "With Action" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs(Alert, { children: [_jsx(AlertTitle, { children: "Update available" }), _jsx(AlertDescription, { children: "A new version of the application is ready to install." }), _jsx(AlertAction, { children: _jsx(Button, { size: "xs", variant: "outline", children: "Update" }) })] }), _jsxs(Alert, { variant: "destructive", children: [_jsx(AlertTriangle, { "aria-hidden": "true" }), _jsx(AlertTitle, { children: "Payment failed" }), _jsx(AlertDescription, { children: "We could not process your payment. Please update your billing details." }), _jsx(AlertAction, { children: _jsx(Button, { size: "xs", variant: "outline", children: "Fix now" }) })] })] })] })] })),
|
|
26
26
|
};
|
|
27
27
|
export const WithIcon = {
|
|
28
|
-
render: (args) => (_jsxs(Alert, { ...args, children: [_jsx(
|
|
28
|
+
render: (args) => (_jsxs(Alert, { ...args, children: [_jsx(Info, { "aria-hidden": "true" }), _jsx(AlertTitle, { children: "Information" }), _jsx(AlertDescription, { children: "Your subscription renews on the 1st of next month." })] })),
|
|
29
29
|
};
|
|
30
30
|
export const Destructive = {
|
|
31
|
-
render: (args) => (_jsxs(Alert, { ...args, variant: "destructive", children: [_jsx(
|
|
31
|
+
render: (args) => (_jsxs(Alert, { ...args, variant: "destructive", children: [_jsx(AlertTriangle, { "aria-hidden": "true" }), _jsx(AlertTitle, { children: "Something went wrong" }), _jsx(AlertDescription, { children: "Your session has expired. Please sign in again to continue." })] })),
|
|
32
32
|
};
|
|
33
33
|
export const WithAction = {
|
|
34
34
|
render: (args) => (_jsxs(Alert, { ...args, children: [_jsx(AlertTitle, { children: "Update available" }), _jsx(AlertDescription, { children: "A new version of the application is ready to install." }), _jsx(AlertAction, { children: _jsx(Button, { size: "xs", variant: "outline", children: "Update" }) })] })),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { AlertCircle } from 'lucide-react';
|
|
3
3
|
import { Button } from '../button';
|
|
4
4
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogTitle, AlertDialogTrigger, } from './alert-dialog';
|
|
5
5
|
const meta = {
|
|
@@ -15,7 +15,7 @@ export const Default = {
|
|
|
15
15
|
render: () => (_jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { render: _jsx(Button, { variant: "outline", size: "sm" }), children: "Delete item" }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Delete this item?" }), _jsx(AlertDialogDescription, { children: "This action cannot be undone. The item will be removed permanently." })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { variant: "destructive", children: "Delete" })] })] })] })),
|
|
16
16
|
};
|
|
17
17
|
export const WithMedia = {
|
|
18
|
-
render: () => (_jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { render: _jsx(Button, { variant: "outline", size: "sm" }), children: "Unsaved changes" }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogMedia, { children: _jsx(
|
|
18
|
+
render: () => (_jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { render: _jsx(Button, { variant: "outline", size: "sm" }), children: "Unsaved changes" }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogMedia, { children: _jsx(AlertCircle, { "aria-hidden": true }) }), _jsx(AlertDialogTitle, { children: "Discard changes?" }), _jsx(AlertDialogDescription, { children: "You have unsaved edits. If you leave now, they will be lost." })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Keep editing" }), _jsx(AlertDialogAction, { variant: "destructive", children: "Discard" })] })] })] })),
|
|
19
19
|
};
|
|
20
20
|
export const SizeSm = {
|
|
21
21
|
render: () => (_jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { render: _jsx(Button, { variant: "outline", size: "sm" }), children: "Compact layout" }), _jsxs(AlertDialogContent, { size: "sm", children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Sign out?" }), _jsx(AlertDialogDescription, { children: "You will need to sign in again to access your account." })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { children: "Sign out" })] })] })] })),
|
|
@@ -27,7 +27,7 @@ export declare const badgeVariantKeys: (keyof typeof badgeVariantStyles)[];
|
|
|
27
27
|
export declare const badgeSizeKeys: (keyof typeof badgeSizeStyles)[];
|
|
28
28
|
declare const badgeVariants: (props?: ({
|
|
29
29
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
30
|
-
variant?: "default" | "
|
|
30
|
+
variant?: "default" | "outline" | "secondary" | "info" | "success" | "warning" | "destructive" | "warning-light" | "success-light" | "info-light" | "destructive-light" | "primary-outline" | "warning-outline" | "success-outline" | "info-outline" | "destructive-outline" | null | undefined;
|
|
31
31
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
32
32
|
type BadgeVariantProps = VariantProps<typeof badgeVariants>;
|
|
33
33
|
type BadgeVariant = BadgeVariantProps['variant'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/breadcrumb.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/breadcrumb.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAKtD,8BAA8B;AAC9B,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAC1D,kCAAkC;AAClC,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAC7D,kCAAkC;AAClC,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAC7D,kCAAkC;AAClC,MAAM,MAAM,mBAAmB,GAAG,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AAChE,kCAAkC;AAClC,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AAC/D,uCAAuC;AACvC,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAClE,sCAAsC;AACtC,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AAEnE,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAEvE;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAQ1E;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAE1E;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,0EAcrF;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAW5E;AAED,iBAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAMzF;AAED,iBAAS,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAahF;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -4,8 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
5
5
|
import { useRender } from '@base-ui/react/use-render';
|
|
6
6
|
import { cn } from '../../lib/utils';
|
|
7
|
-
import {
|
|
8
|
-
import { DotsThreeIcon } from '@phosphor-icons/react/DotsThree';
|
|
7
|
+
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
9
8
|
function Breadcrumb({ className, ...props }) {
|
|
10
9
|
return _jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props });
|
|
11
10
|
}
|
|
@@ -31,9 +30,9 @@ function BreadcrumbPage({ className, ...props }) {
|
|
|
31
30
|
return (_jsx("span", { "data-slot": "breadcrumb-page", role: "link", "aria-disabled": "true", "aria-current": "page", className: cn('font-normal text-foreground', className), ...props }));
|
|
32
31
|
}
|
|
33
32
|
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
34
|
-
return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn('[&>svg]:size-3.5', className), ...props, children: children ?? _jsx(
|
|
33
|
+
return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn('[&>svg]:size-3.5', className), ...props, children: children ?? _jsx(ChevronRight, {}) }));
|
|
35
34
|
}
|
|
36
35
|
function BreadcrumbEllipsis({ className, ...props }) {
|
|
37
|
-
return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn('flex size-5 items-center justify-center [&>svg]:size-4', className), ...props, children: [_jsx(
|
|
36
|
+
return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn('flex size-5 items-center justify-center [&>svg]:size-4', className), ...props, children: [_jsx(MoreHorizontal, {}), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
38
37
|
}
|
|
39
38
|
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis };
|
|
@@ -22,8 +22,8 @@ declare const buttonSizeStyles: {
|
|
|
22
22
|
export declare const buttonVariantKeys: (keyof typeof buttonVariantStyles)[];
|
|
23
23
|
export declare const buttonSizeKeys: (keyof typeof buttonSizeStyles)[];
|
|
24
24
|
declare const buttonVariants: (props?: ({
|
|
25
|
-
variant?: "
|
|
26
|
-
size?: "default" | "
|
|
25
|
+
variant?: "default" | "link" | "outline" | "secondary" | "destructive" | "destructive-outline" | "ghost" | null | undefined;
|
|
26
|
+
size?: "default" | "sm" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
27
27
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
28
28
|
/**
|
|
29
29
|
* Props for `Button`. Inherits additional behavior from
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type DayButton, DayPicker, type Locale } from 'react-day-picker';
|
|
3
|
+
import { Button } from '../button';
|
|
4
|
+
/**
|
|
5
|
+
* Props for {@link Calendar}. Includes all [react-day-picker `DayPicker` props](https://daypicker.dev/api/interfaces/DayPickerProps)
|
|
6
|
+
* plus Wheelhouse styling options.
|
|
7
|
+
*/
|
|
8
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker> & {
|
|
9
|
+
/**
|
|
10
|
+
* Visual variant for the previous/next month controls; matches {@link Button} `variant` values.
|
|
11
|
+
* @default "ghost"
|
|
12
|
+
*/
|
|
13
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Month grid for picking dates, ranges, or multiple days. Wraps [react-day-picker](https://react-day-picker.js.org/) `DayPicker`
|
|
17
|
+
* with design-token class names, Lucide chevrons, and {@link Button}-based day cells (`data-slot="calendar"` on the root).
|
|
18
|
+
*/
|
|
19
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Props for {@link CalendarDayButton}. Mirrors the `DayButton` component from react-day-picker with an optional `locale`
|
|
22
|
+
* for `data-day` formatting.
|
|
23
|
+
*/
|
|
24
|
+
export type CalendarDayButtonProps = React.ComponentProps<typeof DayButton> & {
|
|
25
|
+
/** Passed from the parent `DayPicker` for locale-aware day labels. */
|
|
26
|
+
locale?: Partial<Locale>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Individual day cell button used inside {@link Calendar}. Focus management for keyboard navigation is handled here.
|
|
30
|
+
* Override via `components.DayButton` on {@link Calendar} only when you need custom day rendering.
|
|
31
|
+
*/
|
|
32
|
+
declare function CalendarDayButton({ className, day, modifiers, locale, ...props }: CalendarDayButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export { Calendar, CalendarDayButton };
|
|
34
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAwB,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGhG,OAAO,EAAE,MAAM,EAAkB,MAAM,WAAW,CAAC;AAGnD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IACjE;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;CAClE,CAAC;AAEF;;;GAGG;AACH,iBAAS,QAAQ,CAAC,EACd,SAAS,EACT,UAAU,EACV,eAAsB,EACtB,aAAuB,EACvB,aAAuB,EACvB,MAAM,EACN,UAAU,EACV,UAAU,EACV,GAAG,KAAK,EACX,EAAE,aAAa,2CAqGf;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1E,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,2CAyBjG;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { Button, buttonVariants } from '../button';
|
|
7
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-react';
|
|
8
|
+
/**
|
|
9
|
+
* Month grid for picking dates, ranges, or multiple days. Wraps [react-day-picker](https://react-day-picker.js.org/) `DayPicker`
|
|
10
|
+
* with design-token class names, Lucide chevrons, and {@link Button}-based day cells (`data-slot="calendar"` on the root).
|
|
11
|
+
*/
|
|
12
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'ghost', locale, formatters, components, ...props }) {
|
|
13
|
+
const defaultClassNames = getDefaultClassNames();
|
|
14
|
+
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent', String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, locale: locale, formatters: {
|
|
15
|
+
formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: 'short' }),
|
|
16
|
+
...formatters,
|
|
17
|
+
}, classNames: {
|
|
18
|
+
root: cn('w-fit', defaultClassNames.root),
|
|
19
|
+
months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),
|
|
20
|
+
month: cn('flex w-full flex-col gap-4', defaultClassNames.month),
|
|
21
|
+
nav: cn('absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1', defaultClassNames.nav),
|
|
22
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50', defaultClassNames.button_previous),
|
|
23
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50', defaultClassNames.button_next),
|
|
24
|
+
month_caption: cn('flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)', defaultClassNames.month_caption),
|
|
25
|
+
dropdowns: cn('flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium', defaultClassNames.dropdowns),
|
|
26
|
+
dropdown_root: cn('relative rounded-(--cell-radius)', defaultClassNames.dropdown_root),
|
|
27
|
+
dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),
|
|
28
|
+
caption_label: cn('font-medium select-none', captionLayout === 'label'
|
|
29
|
+
? 'text-sm'
|
|
30
|
+
: 'flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground', defaultClassNames.caption_label),
|
|
31
|
+
/** RDP v9: the day grid `<table>` uses the `month_grid` class key (not `table`). */
|
|
32
|
+
month_grid: cn('w-full border-collapse', defaultClassNames.month_grid),
|
|
33
|
+
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
34
|
+
weekday: cn('flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none', defaultClassNames.weekday),
|
|
35
|
+
week: cn('mt-2 flex w-full', defaultClassNames.week),
|
|
36
|
+
week_number_header: cn('w-(--cell-size) select-none', defaultClassNames.week_number_header),
|
|
37
|
+
week_number: cn('text-[0.8rem] text-muted-foreground select-none', defaultClassNames.week_number),
|
|
38
|
+
day: cn('group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)', props.showWeekNumber
|
|
39
|
+
? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'
|
|
40
|
+
: '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)', defaultClassNames.day),
|
|
41
|
+
range_start: cn('relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted', defaultClassNames.range_start),
|
|
42
|
+
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
43
|
+
range_end: cn('relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted', defaultClassNames.range_end),
|
|
44
|
+
today: cn('rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none', defaultClassNames.today),
|
|
45
|
+
outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
|
|
46
|
+
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
47
|
+
hidden: cn('invisible', defaultClassNames.hidden),
|
|
48
|
+
...classNames,
|
|
49
|
+
}, components: {
|
|
50
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
51
|
+
return _jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props });
|
|
52
|
+
},
|
|
53
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
54
|
+
if (orientation === 'left') {
|
|
55
|
+
return _jsx(ChevronLeft, { className: cn('size-4', className), ...props });
|
|
56
|
+
}
|
|
57
|
+
if (orientation === 'right') {
|
|
58
|
+
return _jsx(ChevronRight, { className: cn('size-4', className), ...props });
|
|
59
|
+
}
|
|
60
|
+
return _jsx(ChevronDown, { className: cn('size-4', className), ...props });
|
|
61
|
+
},
|
|
62
|
+
DayButton: ({ ...props }) => _jsx(CalendarDayButton, { locale: locale, ...props }),
|
|
63
|
+
WeekNumber: ({ children, ...props }) => {
|
|
64
|
+
return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
|
|
65
|
+
},
|
|
66
|
+
...components,
|
|
67
|
+
}, ...props }));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Individual day cell button used inside {@link Calendar}. Focus management for keyboard navigation is handled here.
|
|
71
|
+
* Override via `components.DayButton` on {@link Calendar} only when you need custom day rendering.
|
|
72
|
+
*/
|
|
73
|
+
function CalendarDayButton({ className, day, modifiers, locale, ...props }) {
|
|
74
|
+
const defaultClassNames = getDefaultClassNames();
|
|
75
|
+
const ref = React.useRef(null);
|
|
76
|
+
React.useEffect(() => {
|
|
77
|
+
if (modifiers.focused)
|
|
78
|
+
ref.current?.focus();
|
|
79
|
+
}, [modifiers.focused]);
|
|
80
|
+
return (_jsx(Button, { variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(locale?.code), "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn('relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
|
|
81
|
+
}
|
|
82
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Calendar } from '.';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Calendar;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Single: Story;
|
|
14
|
+
export declare const Range: Story;
|
|
15
|
+
export declare const DropdownCaption: Story;
|
|
16
|
+
//# sourceMappingURL=calendar.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/calendar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAE7B,QAAA,MAAM,IAAI;;;;;;;CAOuB,CAAC;AAElC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,MAAM,EAAE,KAKpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAgB7B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Calendar } from '.';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'UI/Calendar',
|
|
6
|
+
component: Calendar,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
export const Single = {
|
|
14
|
+
render: function SingleCalendar() {
|
|
15
|
+
const [selected, setSelected] = useState(new Date(2026, 3, 13));
|
|
16
|
+
return _jsx(Calendar, { mode: "single", selected: selected, onSelect: setSelected, defaultMonth: selected, className: "rounded-md border" });
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const Range = {
|
|
20
|
+
render: function RangeCalendar() {
|
|
21
|
+
const [range, setRange] = useState({
|
|
22
|
+
from: new Date(2026, 3, 10),
|
|
23
|
+
to: new Date(2026, 3, 18),
|
|
24
|
+
});
|
|
25
|
+
return _jsx(Calendar, { mode: "range", selected: range, onSelect: setRange, defaultMonth: range?.from, numberOfMonths: 2, className: "rounded-md border" });
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export const DropdownCaption = {
|
|
29
|
+
render: function DropdownCaptionCalendar() {
|
|
30
|
+
const [selected, setSelected] = useState(new Date(2026, 3, 13));
|
|
31
|
+
return (_jsx(Calendar, { mode: "single", captionLayout: "dropdown", selected: selected, onSelect: setSelected, defaultMonth: selected, fromYear: 2020, toYear: 2030, className: "rounded-md border" }));
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Calendar, CalendarDayButton } from './calendar';
|