@aeolus-fleet/common 0.34.0 → 0.36.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/README.md +4 -2
- package/dist/fleet/index.d.ts +12 -5
- package/dist/fleet/index.js +10 -2
- package/dist/fleet/index.js.map +1 -1
- package/dist/ids/index.d.ts +3 -0
- package/dist/ids/index.js +2 -0
- package/dist/ids/index.js.map +1 -1
- package/dist/rules/activity.d.ts +10 -0
- package/dist/rules/activity.js +13 -0
- package/dist/rules/activity.js.map +1 -0
- package/dist/rules/alert.d.ts +14 -0
- package/dist/rules/alert.js +33 -0
- package/dist/rules/alert.js.map +1 -0
- package/dist/{header/apps.d.ts → rules/app-switcher.d.ts} +2 -5
- package/dist/{header/apps.js → rules/app-switcher.js} +1 -6
- package/dist/rules/app-switcher.js.map +1 -0
- package/dist/rules/index.d.ts +6 -1
- package/dist/rules/index.js +6 -1
- package/dist/rules/index.js.map +1 -1
- package/dist/rules/page-size.d.ts +7 -0
- package/dist/rules/page-size.js +7 -0
- package/dist/rules/page-size.js.map +1 -1
- package/dist/rules/payload.d.ts +1 -1
- package/dist/rules/payload.js +2 -2
- package/dist/rules/payload.js.map +1 -1
- package/dist/schemas/activity.d.ts +71 -0
- package/dist/schemas/activity.js +53 -0
- package/dist/schemas/activity.js.map +1 -0
- package/dist/schemas/alert.d.ts +564 -0
- package/dist/schemas/alert.js +123 -0
- package/dist/schemas/alert.js.map +1 -0
- package/dist/schemas/content-type.d.ts +2 -0
- package/dist/schemas/content-type.js +6 -0
- package/dist/schemas/content-type.js.map +1 -0
- package/dist/schemas/delivery.d.ts +92 -1
- package/dist/schemas/delivery.js +18 -1
- package/dist/schemas/delivery.js.map +1 -1
- package/dist/schemas/expectations.d.ts +76 -0
- package/dist/schemas/expectations.js +41 -0
- package/dist/schemas/expectations.js.map +1 -0
- package/dist/schemas/fleet.d.ts +81 -0
- package/dist/schemas/fleet.js +8 -0
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/follow.d.ts +3 -0
- package/dist/schemas/history.d.ts +303 -0
- package/dist/schemas/history.js +10 -1
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/index.js +6 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/label.d.ts +2 -2
- package/dist/schemas/message-task-access.d.ts +11 -0
- package/dist/schemas/message-task-access.js +7 -0
- package/dist/schemas/message-task-access.js.map +1 -0
- package/dist/schemas/message.d.ts +1 -1
- package/dist/schemas/message.js +2 -2
- package/dist/schemas/message.js.map +1 -1
- package/dist/schemas/network-rules-file.js +2 -2
- package/dist/schemas/network-rules-file.js.map +1 -1
- package/dist/schemas/network.d.ts +13 -13
- package/dist/schemas/notice-message.d.ts +20 -0
- package/dist/schemas/notice-message.js +26 -0
- package/dist/schemas/notice-message.js.map +1 -0
- package/dist/schemas/page.d.ts +1 -1
- package/dist/schemas/page.js +1 -1
- package/dist/schemas/page.js.map +1 -1
- package/dist/schemas/question.js +1 -5
- package/dist/schemas/question.js.map +1 -1
- package/dist/schemas/report.d.ts +81 -3
- package/dist/schemas/report.js +26 -3
- package/dist/schemas/report.js.map +1 -1
- package/dist/schemas/ship.d.ts +6 -2
- package/dist/schemas/ship.js +6 -2
- package/dist/schemas/ship.js.map +1 -1
- package/dist/schemas/statement.d.ts +2 -2
- package/dist/schemas/statement.js +4 -4
- package/dist/schemas/statement.js.map +1 -1
- package/dist/schemas/step.d.ts +57 -0
- package/dist/schemas/step.js +54 -0
- package/dist/schemas/step.js.map +1 -0
- package/dist/trierarch/report-details.d.ts +1 -1
- package/package.json +4 -44
- package/dist/header/app-header.d.ts +0 -27
- package/dist/header/app-header.js +0 -18
- package/dist/header/app-header.js.map +0 -1
- package/dist/header/app-switcher.d.ts +0 -20
- package/dist/header/app-switcher.js +0 -57
- package/dist/header/app-switcher.js.map +0 -1
- package/dist/header/apps.js.map +0 -1
- package/dist/header/atoms/avatar.d.ts +0 -16
- package/dist/header/atoms/avatar.js +0 -44
- package/dist/header/atoms/avatar.js.map +0 -1
- package/dist/header/atoms/button.d.ts +0 -22
- package/dist/header/atoms/button.js +0 -48
- package/dist/header/atoms/button.js.map +0 -1
- package/dist/header/atoms/dialog-surface.d.ts +0 -19
- package/dist/header/atoms/dialog-surface.js +0 -32
- package/dist/header/atoms/dialog-surface.js.map +0 -1
- package/dist/header/atoms/dialog.d.ts +0 -19
- package/dist/header/atoms/dialog.js +0 -37
- package/dist/header/atoms/dialog.js.map +0 -1
- package/dist/header/atoms/dropdown-menu.d.ts +0 -21
- package/dist/header/atoms/dropdown-menu.js +0 -42
- package/dist/header/atoms/dropdown-menu.js.map +0 -1
- package/dist/header/atoms/kbd.d.ts +0 -7
- package/dist/header/atoms/kbd.js +0 -11
- package/dist/header/atoms/kbd.js.map +0 -1
- package/dist/header/atoms/sheet.d.ts +0 -23
- package/dist/header/atoms/sheet.js +0 -52
- package/dist/header/atoms/sheet.js.map +0 -1
- package/dist/header/atoms/tooltip.d.ts +0 -10
- package/dist/header/atoms/tooltip.js +0 -24
- package/dist/header/atoms/tooltip.js.map +0 -1
- package/dist/header/avatar-entry.d.ts +0 -21
- package/dist/header/avatar-entry.js +0 -6
- package/dist/header/avatar-entry.js.map +0 -1
- package/dist/header/avatar-menu.d.ts +0 -43
- package/dist/header/avatar-menu.js +0 -111
- package/dist/header/avatar-menu.js.map +0 -1
- package/dist/header/class-names.d.ts +0 -3
- package/dist/header/class-names.js +0 -29
- package/dist/header/class-names.js.map +0 -1
- package/dist/header/command-palette.d.ts +0 -44
- package/dist/header/command-palette.js +0 -77
- package/dist/header/command-palette.js.map +0 -1
- package/dist/header/index.d.ts +0 -21
- package/dist/header/index.js +0 -22
- package/dist/header/index.js.map +0 -1
- package/dist/header/tokens.css +0 -154
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { cva } from 'class-variance-authority';
|
|
2
|
-
/**
|
|
3
|
-
* What Dialog and AlertDialog share (docs/design/png/Dialog.png): the --overlay
|
|
4
|
-
* scrim, a centred popup 512 or 560 px wide with 24 px padding and
|
|
5
|
-
* --radius-xl, and the header and footer layout. A popup taller than the
|
|
6
|
-
* window scrolls inside it, so its buttons stay in reach. Under reduced motion
|
|
7
|
-
* nothing zooms; it only fades.
|
|
8
|
-
*/
|
|
9
|
-
export const dialogSurface = {
|
|
10
|
-
overlay: 'fixed inset-0 isolate z-50 bg-overlay duration-(--duration-base) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',
|
|
11
|
-
popup: cva('fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-var(--spacing)*8)] w-full max-w-[calc(100%-var(--spacing)*8)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl border border-border bg-popover p-6 text-body text-popover-foreground shadow-lg duration-(--duration-base) outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:zoom-in-100 motion-reduce:data-closed:zoom-out-100', {
|
|
12
|
-
variants: {
|
|
13
|
-
size: {
|
|
14
|
-
sm: 'sm:max-w-(--size-dialog-sm)',
|
|
15
|
-
md: 'sm:max-w-(--size-dialog-md)',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
defaultVariants: { size: 'sm' },
|
|
19
|
-
}),
|
|
20
|
-
header: 'flex flex-col gap-2',
|
|
21
|
-
// Desktop: right-aligned, Cancel left of the action. Phone: stacked full
|
|
22
|
-
// width, action on top, Cancel last (docs/design/conventions.md, "Buttons").
|
|
23
|
-
footer: 'flex flex-col-reverse gap-2 pt-1 sm:flex-row sm:justify-end',
|
|
24
|
-
title: 'text-heading font-semibold text-foreground',
|
|
25
|
-
description: 'text-body text-muted-foreground',
|
|
26
|
-
// On phone a confirm rises as a bottom sheet (docs/design/png/Sheet.png):
|
|
27
|
-
// pinned to the bottom, full width, rounded top, clear of the home bar.
|
|
28
|
-
phoneSheet: 'max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:max-w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-none max-sm:rounded-t-2xl max-sm:border-x-0 max-sm:border-b-0 max-sm:px-4 max-sm:pb-[max(calc(var(--spacing)*4),env(safe-area-inset-bottom))] max-sm:[&_[data-slot=button]]:h-(--size-control-touch) max-sm:[&_[data-slot=button]]:w-full',
|
|
29
|
-
// On phone a dialog that shows a form or a prompt fills the screen.
|
|
30
|
-
phoneFullScreen: 'max-sm:top-0 max-sm:left-0 max-sm:h-dvh max-sm:max-w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:content-start max-sm:overflow-y-auto max-sm:rounded-none max-sm:border-0',
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=dialog-surface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-surface.js","sourceRoot":"","sources":["../../../src/header/atoms/dialog-surface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EACL,0JAA0J;IAC5J,KAAK,EAAE,GAAG,CACR,8fAA8f,EAC9f;QACE,QAAQ,EAAE;YACR,IAAI,EAAE;gBACJ,EAAE,EAAE,6BAA6B;gBACjC,EAAE,EAAE,6BAA6B;aAClC;SACF;QACD,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;KAChC,CACF;IACD,MAAM,EAAE,qBAAqB;IAC7B,yEAAyE;IACzE,6EAA6E;IAC7E,MAAM,EAAE,6DAA6D;IACrE,KAAK,EAAE,4CAA4C;IACnD,WAAW,EAAE,iCAAiC;IAC9C,0EAA0E;IAC1E,wEAAwE;IACxE,UAAU,EACR,oWAAoW;IACtW,oEAAoE;IACpE,eAAe,EACb,qLAAqL;CACxL,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
2
|
-
import type { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import type { ComponentProps } from 'react';
|
|
4
|
-
import { dialogSurface } from './dialog-surface.js';
|
|
5
|
-
/**
|
|
6
|
-
* shadcn Dialog on Base UI, for a blocking short form (docs/design/png/Dialog.png):
|
|
7
|
-
* sm (512 px) for confirms, md (560 px) for forms. Escape and Cancel close it;
|
|
8
|
-
* focus moves to the first field and returns to the trigger. While busy, the
|
|
9
|
-
* caller keeps it open and disables everything but the loading action.
|
|
10
|
-
*/
|
|
11
|
-
declare function Dialog(props: DialogPrimitive.Root.Props): import("react").JSX.Element;
|
|
12
|
-
declare function DialogTrigger(props: DialogPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
13
|
-
declare function DialogClose(props: DialogPrimitive.Close.Props): import("react").JSX.Element;
|
|
14
|
-
declare function DialogContent({ className, size, children, ...props }: DialogPrimitive.Popup.Props & VariantProps<typeof dialogSurface.popup>): import("react").JSX.Element;
|
|
15
|
-
declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
16
|
-
declare function DialogFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
17
|
-
declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): import("react").JSX.Element;
|
|
18
|
-
declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): import("react").JSX.Element;
|
|
19
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
4
|
-
import { classNames } from '../class-names.js';
|
|
5
|
-
import { dialogSurface } from './dialog-surface.js';
|
|
6
|
-
/**
|
|
7
|
-
* shadcn Dialog on Base UI, for a blocking short form (docs/design/png/Dialog.png):
|
|
8
|
-
* sm (512 px) for confirms, md (560 px) for forms. Escape and Cancel close it;
|
|
9
|
-
* focus moves to the first field and returns to the trigger. While busy, the
|
|
10
|
-
* caller keeps it open and disables everything but the loading action.
|
|
11
|
-
*/
|
|
12
|
-
function Dialog(props) {
|
|
13
|
-
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
14
|
-
}
|
|
15
|
-
function DialogTrigger(props) {
|
|
16
|
-
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
17
|
-
}
|
|
18
|
-
function DialogClose(props) {
|
|
19
|
-
return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
20
|
-
}
|
|
21
|
-
function DialogContent({ className, size, children, ...props }) {
|
|
22
|
-
return (_jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-overlay", className: dialogSurface.overlay }), _jsx(DialogPrimitive.Popup, { "data-slot": "dialog-content", className: classNames(dialogSurface.popup({ size }), className), ...props, children: children })] }));
|
|
23
|
-
}
|
|
24
|
-
function DialogHeader({ className, ...props }) {
|
|
25
|
-
return _jsx("div", { "data-slot": "dialog-header", className: classNames(dialogSurface.header, className), ...props });
|
|
26
|
-
}
|
|
27
|
-
function DialogFooter({ className, ...props }) {
|
|
28
|
-
return _jsx("div", { "data-slot": "dialog-footer", className: classNames(dialogSurface.footer, className), ...props });
|
|
29
|
-
}
|
|
30
|
-
function DialogTitle({ className, ...props }) {
|
|
31
|
-
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: classNames(dialogSurface.title, className), ...props }));
|
|
32
|
-
}
|
|
33
|
-
function DialogDescription({ className, ...props }) {
|
|
34
|
-
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: classNames(dialogSurface.description, className), ...props }));
|
|
35
|
-
}
|
|
36
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
|
|
37
|
-
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/header/atoms/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIlE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;GAKG;AACH,SAAS,MAAM,CAAC,KAAiC;IAC/C,OAAO,KAAC,eAAe,CAAC,IAAI,iBAAW,QAAQ,KAAK,KAAK,GAAI,CAAC;AAChE,CAAC;AAED,SAAS,aAAa,CAAC,KAAoC;IACzD,OAAO,KAAC,eAAe,CAAC,OAAO,iBAAW,gBAAgB,KAAK,KAAK,GAAI,CAAC;AAC3E,CAAC;AAED,SAAS,WAAW,CAAC,KAAkC;IACrD,OAAO,KAAC,eAAe,CAAC,KAAK,iBAAW,cAAc,KAAK,KAAK,GAAI,CAAC;AACvE,CAAC;AAED,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EAC+D;IACvE,OAAO,CACL,MAAC,eAAe,CAAC,MAAM,eACrB,KAAC,eAAe,CAAC,QAAQ,iBAAW,gBAAgB,EAAC,SAAS,EAAE,aAAa,CAAC,OAAO,GAAI,EACzF,KAAC,eAAe,CAAC,KAAK,iBACV,gBAAgB,EAC1B,SAAS,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KAC3D,KAAK,YAER,QAAQ,GACa,IACD,CAC1B,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IAClE,OAAO,2BAAe,eAAe,EAAC,SAAS,EAAE,UAAU,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC9G,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IAClE,OAAO,2BAAe,eAAe,EAAC,SAAS,EAAE,UAAU,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC9G,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACvE,OAAO,CACL,KAAC,eAAe,CAAC,KAAK,iBAAW,cAAc,EAAC,SAAS,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACrH,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAqC;IACnF,OAAO,CACL,KAAC,eAAe,CAAC,WAAW,iBAChB,oBAAoB,EAC9B,SAAS,EAAE,UAAU,CAAC,aAAa,CAAC,WAAW,EAAE,SAAS,CAAC,KACvD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
2
|
-
/**
|
|
3
|
-
* shadcn DropdownMenu on Base UI Menu (docs/design/png/DropdownMenu.png).
|
|
4
|
-
* Desktop only; on phone the same items open in a bottom Sheet. Items that
|
|
5
|
-
* open a dialog end with an ellipsis. The destructive item is last, after a
|
|
6
|
-
* separator, in --destructive-text.
|
|
7
|
-
*/
|
|
8
|
-
declare function DropdownMenu(props: MenuPrimitive.Root.Props): import("react").JSX.Element;
|
|
9
|
-
declare function DropdownMenuTrigger(props: MenuPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
10
|
-
declare function DropdownMenuContent({ align, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'align' | 'side' | 'sideOffset'>): import("react").JSX.Element;
|
|
11
|
-
declare function DropdownMenuGroup(props: MenuPrimitive.Group.Props): import("react").JSX.Element;
|
|
12
|
-
declare function DropdownMenuItem({ className, variant, ...props }: MenuPrimitive.Item.Props & {
|
|
13
|
-
variant?: 'default' | 'destructive';
|
|
14
|
-
}): import("react").JSX.Element;
|
|
15
|
-
/** A small heading over a group of items, such as Theme. */
|
|
16
|
-
declare function DropdownMenuLabel({ className, ...props }: MenuPrimitive.GroupLabel.Props): import("react").JSX.Element;
|
|
17
|
-
declare function DropdownMenuRadioGroup(props: MenuPrimitive.RadioGroup.Props): import("react").JSX.Element;
|
|
18
|
-
/** One choice of a radio group: the check sits at the end of the row while it is chosen. */
|
|
19
|
-
declare function DropdownMenuRadioItem({ className, children, ...props }: MenuPrimitive.RadioItem.Props): import("react").JSX.Element;
|
|
20
|
-
declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): import("react").JSX.Element;
|
|
21
|
-
export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
4
|
-
import { Check } from 'lucide-react';
|
|
5
|
-
import { classNames } from '../class-names.js';
|
|
6
|
-
/**
|
|
7
|
-
* shadcn DropdownMenu on Base UI Menu (docs/design/png/DropdownMenu.png).
|
|
8
|
-
* Desktop only; on phone the same items open in a bottom Sheet. Items that
|
|
9
|
-
* open a dialog end with an ellipsis. The destructive item is last, after a
|
|
10
|
-
* separator, in --destructive-text.
|
|
11
|
-
*/
|
|
12
|
-
function DropdownMenu(props) {
|
|
13
|
-
return _jsx(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
14
|
-
}
|
|
15
|
-
function DropdownMenuTrigger(props) {
|
|
16
|
-
return _jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
17
|
-
}
|
|
18
|
-
function DropdownMenuContent({ align = 'end', side = 'bottom', sideOffset = 4, className, ...props }) {
|
|
19
|
-
return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, side: side, sideOffset: sideOffset, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", className: classNames('max-h-(--available-height) min-w-48 origin-(--transform-origin) overflow-y-auto rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-lg duration-(--duration-fast) outline-none data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0', className), ...props }) }) }));
|
|
20
|
-
}
|
|
21
|
-
function DropdownMenuGroup(props) {
|
|
22
|
-
return _jsx(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
23
|
-
}
|
|
24
|
-
function DropdownMenuItem({ className, variant = 'default', ...props }) {
|
|
25
|
-
return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-variant": variant, className: classNames("relative flex h-8.5 items-center gap-2.5 rounded-sm px-2.5 text-body text-foreground outline-none select-none data-highlighted:bg-accent focus-visible:outline-2 focus-visible:outline-ring data-disabled:pointer-events-none data-disabled:opacity-45 data-[variant=destructive]:text-destructive-text [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--size-icon) [&_svg]:text-muted-foreground data-[variant=destructive]:[&_svg]:text-destructive-text", className), ...props }));
|
|
26
|
-
}
|
|
27
|
-
/** A small heading over a group of items, such as Theme. */
|
|
28
|
-
function DropdownMenuLabel({ className, ...props }) {
|
|
29
|
-
return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", className: classNames('px-2.5 pt-1.5 pb-1 text-caption text-muted-foreground', className), ...props }));
|
|
30
|
-
}
|
|
31
|
-
function DropdownMenuRadioGroup(props) {
|
|
32
|
-
return _jsx(MenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
|
|
33
|
-
}
|
|
34
|
-
/** One choice of a radio group: the check sits at the end of the row while it is chosen. */
|
|
35
|
-
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
36
|
-
return (_jsxs(MenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: classNames("relative flex h-8.5 items-center gap-2.5 rounded-sm px-2.5 text-body text-foreground outline-none select-none data-highlighted:bg-accent focus-visible:outline-2 focus-visible:outline-ring data-disabled:pointer-events-none data-disabled:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--size-icon) [&_svg]:text-muted-foreground", className), ...props, children: [children, _jsx(MenuPrimitive.RadioItemIndicator, { className: "ml-auto flex", children: _jsx(Check, { "aria-hidden": true, className: "text-foreground" }) })] }));
|
|
37
|
-
}
|
|
38
|
-
function DropdownMenuSeparator({ className, ...props }) {
|
|
39
|
-
return (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: classNames('-mx-1 my-1 h-px bg-border', className), ...props }));
|
|
40
|
-
}
|
|
41
|
-
export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, };
|
|
42
|
-
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../src/header/atoms/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;A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,CAAC;AAED,4DAA4D;AAC5D,SAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAkC;IAChF,OAAO,CACL,KAAC,aAAa,CAAC,UAAU,iBACb,qBAAqB,EAC/B,SAAS,EAAE,UAAU,CAAC,uDAAuD,EAAE,SAAS,CAAC,KACrF,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAqC;IACnE,OAAO,KAAC,aAAa,CAAC,UAAU,iBAAW,2BAA2B,KAAK,KAAK,GAAI,CAAC;AACvF,CAAC;AAED,4FAA4F;AAC5F,SAAS,qBAAqB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiC;IAC7F,OAAO,CACL,MAAC,aAAa,CAAC,SAAS,iBACZ,0BAA0B,EACpC,SAAS,EAAE,UAAU,CACnB,oXAAoX,EACpX,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACT,KAAC,aAAa,CAAC,kBAAkB,IAAC,SAAS,EAAC,cAAc,YACxD,KAAC,KAAK,yBAAa,SAAS,EAAC,iBAAiB,GAAG,GAChB,IACX,CAC3B,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiC;IACnF,OAAO,CACL,KAAC,aAAa,CAAC,SAAS,iBACZ,yBAAyB,EACnC,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,SAAS,CAAC,KACzD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,GACpB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* shadcn Kbd (docs/design/png/Kbd.png): a key or shortcut, beside the action
|
|
4
|
-
* it hints at. Desktop only: hidden on phone, and never the only way to learn
|
|
5
|
-
* an action.
|
|
6
|
-
*/
|
|
7
|
-
export declare function Kbd({ className, ...props }: ComponentProps<'kbd'>): import("react").JSX.Element;
|
package/dist/header/atoms/kbd.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { classNames } from '../class-names.js';
|
|
3
|
-
/**
|
|
4
|
-
* shadcn Kbd (docs/design/png/Kbd.png): a key or shortcut, beside the action
|
|
5
|
-
* it hints at. Desktop only: hidden on phone, and never the only way to learn
|
|
6
|
-
* an action.
|
|
7
|
-
*/
|
|
8
|
-
export function Kbd({ className, ...props }) {
|
|
9
|
-
return (_jsx("kbd", { "data-slot": "kbd", className: classNames('inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-xs border border-border bg-muted px-1.25 font-sans text-micro font-medium text-muted-foreground max-sm:hidden', className), ...props }));
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=kbd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kbd.js","sourceRoot":"","sources":["../../../src/header/atoms/kbd.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IAChE,OAAO,CACL,2BACY,KAAK,EACf,SAAS,EAAE,UAAU,CACnB,oLAAoL,EACpL,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
|
|
2
|
-
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
-
import type { ComponentProps } from 'react';
|
|
4
|
-
/**
|
|
5
|
-
* shadcn Sheet on Base UI Dialog (docs/design/png/Sheet.png). Right: the
|
|
6
|
-
* desktop side sheet, 560 px, header with title, context and close, scrolling
|
|
7
|
-
* body, footer. Bottom: the phone sheet for menus, filters and confirms, with a
|
|
8
|
-
* handle, --radius-2xl top corners and full-width 44 px actions, Cancel last.
|
|
9
|
-
* Under reduced motion it fades instead of sliding.
|
|
10
|
-
*/
|
|
11
|
-
declare const sheetPopup: (props?: ({
|
|
12
|
-
side?: "bottom" | "right" | null | undefined;
|
|
13
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
-
declare function Sheet(props: SheetPrimitive.Root.Props): import("react").JSX.Element;
|
|
15
|
-
declare function SheetTrigger(props: SheetPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
16
|
-
declare function SheetClose(props: SheetPrimitive.Close.Props): import("react").JSX.Element;
|
|
17
|
-
declare function SheetContent({ className, children, side, ...props }: SheetPrimitive.Popup.Props & VariantProps<typeof sheetPopup>): import("react").JSX.Element;
|
|
18
|
-
declare function SheetHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
19
|
-
declare function SheetBody({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
20
|
-
declare function SheetFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
21
|
-
declare function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props): import("react").JSX.Element;
|
|
22
|
-
declare function SheetDescription({ className, ...props }: SheetPrimitive.Description.Props): import("react").JSX.Element;
|
|
23
|
-
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
|
|
4
|
-
import { cva } from 'class-variance-authority';
|
|
5
|
-
import { XIcon } from 'lucide-react';
|
|
6
|
-
import { classNames } from '../class-names.js';
|
|
7
|
-
import { Button } from './button.js';
|
|
8
|
-
/**
|
|
9
|
-
* shadcn Sheet on Base UI Dialog (docs/design/png/Sheet.png). Right: the
|
|
10
|
-
* desktop side sheet, 560 px, header with title, context and close, scrolling
|
|
11
|
-
* body, footer. Bottom: the phone sheet for menus, filters and confirms, with a
|
|
12
|
-
* handle, --radius-2xl top corners and full-width 44 px actions, Cancel last.
|
|
13
|
-
* Under reduced motion it fades instead of sliding.
|
|
14
|
-
*/
|
|
15
|
-
const sheetPopup = cva('fixed z-50 flex flex-col bg-popover text-body text-popover-foreground shadow-lg outline-none duration-(--duration-slow) ease-(--ease-standard) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0', {
|
|
16
|
-
variants: {
|
|
17
|
-
side: {
|
|
18
|
-
right: 'inset-y-0 right-0 h-full w-full border-l border-border sm:max-w-(--size-sheet) motion-safe:data-open:slide-in-from-right motion-safe:data-closed:slide-out-to-right',
|
|
19
|
-
bottom: 'inset-x-0 bottom-0 max-h-[90dvh] rounded-t-2xl border-t border-border px-4 pt-2 pb-[max(calc(var(--spacing)*4),env(safe-area-inset-bottom))] motion-safe:data-open:slide-in-from-bottom motion-safe:data-closed:slide-out-to-bottom',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: { side: 'right' },
|
|
23
|
-
});
|
|
24
|
-
function Sheet(props) {
|
|
25
|
-
return _jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
26
|
-
}
|
|
27
|
-
function SheetTrigger(props) {
|
|
28
|
-
return _jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
29
|
-
}
|
|
30
|
-
function SheetClose(props) {
|
|
31
|
-
return _jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
|
|
32
|
-
}
|
|
33
|
-
function SheetContent({ className, children, side = 'right', ...props }) {
|
|
34
|
-
return (_jsxs(SheetPrimitive.Portal, { children: [_jsx(SheetPrimitive.Backdrop, { "data-slot": "sheet-overlay", className: "fixed inset-0 z-50 bg-overlay duration-(--duration-slow) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0" }), _jsxs(SheetPrimitive.Popup, { "data-slot": "sheet-content", "data-side": side, className: classNames(sheetPopup({ side }), className), ...props, children: [side === 'bottom' ? (_jsx("div", { "aria-hidden": true, className: "mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-border" })) : (_jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", render: _jsx(Button, { variant: "ghost", size: "sm", isIconOnly: true, className: "absolute top-4 right-4", "aria-label": "Close" }), children: _jsx(XIcon, {}) })), children] })] }));
|
|
35
|
-
}
|
|
36
|
-
function SheetHeader({ className, ...props }) {
|
|
37
|
-
return (_jsx("div", { "data-slot": "sheet-header", className: classNames('flex flex-col gap-0.5 in-data-[side=right]:border-b in-data-[side=right]:px-6 in-data-[side=right]:py-5 in-data-[side=right]:pr-14', className), ...props }));
|
|
38
|
-
}
|
|
39
|
-
function SheetBody({ className, ...props }) {
|
|
40
|
-
return (_jsx("div", { "data-slot": "sheet-body", className: classNames('min-h-0 flex-1 overflow-y-auto in-data-[side=right]:p-6', className), ...props }));
|
|
41
|
-
}
|
|
42
|
-
function SheetFooter({ className, ...props }) {
|
|
43
|
-
return (_jsx("div", { "data-slot": "sheet-footer", className: classNames('flex flex-col-reverse gap-2 pt-3 in-data-[side=right]:flex-row in-data-[side=right]:justify-end in-data-[side=right]:border-t in-data-[side=right]:px-6 in-data-[side=right]:py-4', className), ...props }));
|
|
44
|
-
}
|
|
45
|
-
function SheetTitle({ className, ...props }) {
|
|
46
|
-
return (_jsx(SheetPrimitive.Title, { "data-slot": "sheet-title", className: classNames('text-heading font-semibold text-foreground in-data-[side=bottom]:py-2 in-data-[side=bottom]:text-section', className), ...props }));
|
|
47
|
-
}
|
|
48
|
-
function SheetDescription({ className, ...props }) {
|
|
49
|
-
return (_jsx(SheetPrimitive.Description, { "data-slot": "sheet-description", className: classNames('text-meta text-muted-foreground', className), ...props }));
|
|
50
|
-
}
|
|
51
|
-
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, };
|
|
52
|
-
//# sourceMappingURL=sheet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../src/header/atoms/sheet.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,GAAG,CACpB,wOAAwO,EACxO;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EACH,qKAAqK;YACvK,MAAM,EACJ,qOAAqO;SACxO;KACF;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;CACnC,CACF,CAAC;AAEF,SAAS,KAAK,CAAC,KAAgC;IAC7C,OAAO,KAAC,cAAc,CAAC,IAAI,iBAAW,OAAO,KAAK,KAAK,GAAI,CAAC;AAC9D,CAAC;AAED,SAAS,YAAY,CAAC,KAAmC;IACvD,OAAO,KAAC,cAAc,CAAC,OAAO,iBAAW,eAAe,KAAK,KAAK,GAAI,CAAC;AACzE,CAAC;AAED,SAAS,UAAU,CAAC,KAAiC;IACnD,OAAO,KAAC,cAAc,CAAC,KAAK,iBAAW,aAAa,KAAK,KAAK,GAAI,CAAC;AACrE,CAAC;AAED,SAAS,YAAY,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,IAAI,GAAG,OAAO,EACd,GAAG,KAAK,EACqD;IAC7D,OA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A8B;IACrE,OAAO,CACL,KAAC,cAAc,CAAC,KAAK,iBACT,aAAa,EACvB,SAAS,EAAE,UAAU,CACnB,0GAA0G,EAC1G,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoC;IACjF,OAAO,CACL,KAAC,cAAc,CAAC,WAAW,iBACf,mBAAmB,EAC7B,SAAS,EAAE,UAAU,CAAC,iCAAiC,EAAE,SAAS,CAAC,KAC/D,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,GACb,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
|
|
2
|
-
/**
|
|
3
|
-
* shadcn Tooltip on Base UI (docs/design/png/Tooltip.png). Supplementary only:
|
|
4
|
-
* the same text is also the accessible name or visible elsewhere. None on phone.
|
|
5
|
-
*/
|
|
6
|
-
declare function TooltipProvider({ delay, ...props }: TooltipPrimitive.Provider.Props): import("react").JSX.Element;
|
|
7
|
-
declare function Tooltip(props: TooltipPrimitive.Root.Props): import("react").JSX.Element;
|
|
8
|
-
declare function TooltipTrigger(props: TooltipPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
9
|
-
declare function TooltipContent({ className, side, sideOffset, align, ...props }: TooltipPrimitive.Popup.Props & Pick<TooltipPrimitive.Positioner.Props, 'align' | 'side' | 'sideOffset'>): import("react").JSX.Element;
|
|
10
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
|
|
4
|
-
import { classNames } from '../class-names.js';
|
|
5
|
-
/** Hover waits this long before a tooltip opens; keyboard focus opens it at once. */
|
|
6
|
-
const HOVER_DELAY_MS = 500;
|
|
7
|
-
/**
|
|
8
|
-
* shadcn Tooltip on Base UI (docs/design/png/Tooltip.png). Supplementary only:
|
|
9
|
-
* the same text is also the accessible name or visible elsewhere. None on phone.
|
|
10
|
-
*/
|
|
11
|
-
function TooltipProvider({ delay = HOVER_DELAY_MS, ...props }) {
|
|
12
|
-
return _jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delay: delay, ...props });
|
|
13
|
-
}
|
|
14
|
-
function Tooltip(props) {
|
|
15
|
-
return _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
16
|
-
}
|
|
17
|
-
function TooltipTrigger(props) {
|
|
18
|
-
return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
19
|
-
}
|
|
20
|
-
function TooltipContent({ className, side = 'top', sideOffset = 6, align = 'center', ...props }) {
|
|
21
|
-
return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { align: align, side: side, sideOffset: sideOffset, className: "isolate z-50 max-sm:hidden", children: _jsx(TooltipPrimitive.Popup, { "data-slot": "tooltip-content", className: classNames('w-fit max-w-xs origin-(--transform-origin) rounded-sm bg-foreground px-2 py-1 text-caption font-medium text-background shadow-md duration-(--duration-fast) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0', className), ...props }) }) }));
|
|
22
|
-
}
|
|
23
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
24
|
-
//# sourceMappingURL=tooltip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/header/atoms/tooltip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,qFAAqF;AACrF,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B;;;GAGG;AACH,SAAS,eAAe,CAAC,EAAE,KAAK,GAAG,cAAc,EAAE,GAAG,KAAK,EAAmC;IAC5F,OAAO,KAAC,gBAAgB,CAAC,QAAQ,iBAAW,kBAAkB,EAAC,KAAK,EAAE,KAAK,KAAM,KAAK,GAAI,CAAC;AAC7F,CAAC;AAED,SAAS,OAAO,CAAC,KAAkC;IACjD,OAAO,KAAC,gBAAgB,CAAC,IAAI,iBAAW,SAAS,KAAK,KAAK,GAAI,CAAC;AAClE,CAAC;AAED,SAAS,cAAc,CAAC,KAAqC;IAC3D,OAAO,KAAC,gBAAgB,CAAC,OAAO,iBAAW,iBAAiB,KAAK,KAAK,GAAI,CAAC;AAC7E,CAAC;AAED,SAAS,cAAc,CAAC,EACtB,SAAS,EACT,IAAI,GAAG,KAAK,EACZ,UAAU,GAAG,CAAC,EACd,KAAK,GAAG,QAAQ,EAChB,GAAG,KAAK,EACgG;IACxG,OAAO,CACL,KAAC,gBAAgB,CAAC,MAAM,cACtB,KAAC,gBAAgB,CAAC,UAAU,IAC1B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,SAAS,EAAC,4BAA4B,YAEtC,KAAC,gBAAgB,CAAC,KAAK,iBACX,iBAAiB,EAC3B,SAAS,EAAE,UAAU,CACnB,qPAAqP,EACrP,SAAS,CACV,KACG,KAAK,GACT,GAC0B,GACN,CAC3B,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
/** An entry of the app's own in the avatar menu, such as Take the tour; phone-only ones stand in for what a tab bar lacks (H6). */
|
|
3
|
-
export interface AvatarMenuEntry {
|
|
4
|
-
key: string;
|
|
5
|
-
label: string;
|
|
6
|
-
icon: ReactNode;
|
|
7
|
-
/** A link, or an action; one of the two. */
|
|
8
|
-
href?: string;
|
|
9
|
-
onSelect?: () => void;
|
|
10
|
-
isPhoneOnly?: boolean;
|
|
11
|
-
/** For an action whose work runs on the server, such as signing in as argo: what the entry says while it runs. Set, the menu stays open once it is picked. */
|
|
12
|
-
workingLabel?: string;
|
|
13
|
-
/** Whether that work runs now: the entry says its working label, with a spinner, and takes no second press. */
|
|
14
|
-
isWorking?: boolean;
|
|
15
|
-
}
|
|
16
|
-
/** What the menu shows of an entry: its label, or its working label while its work runs, and whether picking it closes the menu. */
|
|
17
|
-
export declare function shownEntryOf(entry: AvatarMenuEntry): {
|
|
18
|
-
label: string;
|
|
19
|
-
isWorking: boolean;
|
|
20
|
-
shouldCloseMenu: boolean;
|
|
21
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** What the menu shows of an entry: its label, or its working label while its work runs, and whether picking it closes the menu. */
|
|
2
|
-
export function shownEntryOf(entry) {
|
|
3
|
-
const isWorking = entry.workingLabel !== undefined && entry.isWorking === true;
|
|
4
|
-
return { label: isWorking && entry.workingLabel !== undefined ? entry.workingLabel : entry.label, isWorking, shouldCloseMenu: entry.workingLabel === undefined };
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=avatar-entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-entry.js","sourceRoot":"","sources":["../../src/header/avatar-entry.ts"],"names":[],"mappings":"AAiBA,oIAAoI;AACpI,MAAM,UAAU,YAAY,CAAC,KAAsB;IACjD,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IAC/E,OAAO,EAAE,KAAK,EAAE,SAAS,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;AACnK,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { Theme } from '../index.js';
|
|
2
|
-
import { type SignedInAs } from './apps.js';
|
|
3
|
-
import { type AvatarMenuEntry } from './avatar-entry.js';
|
|
4
|
-
/** A keyboard shortcut the app offers, for the Keyboard shortcuts dialog: its keys in order and what it does. */
|
|
5
|
-
export interface Shortcut {
|
|
6
|
-
keys: readonly string[];
|
|
7
|
-
label: string;
|
|
8
|
-
}
|
|
9
|
-
export interface AvatarMenuProps {
|
|
10
|
-
/** The account's name; undefined until known, or for argo's sign-in and the viewer, which go by those names. */
|
|
11
|
-
name: string | undefined;
|
|
12
|
-
/** How someone is signed in here (H10); undefined until known. */
|
|
13
|
-
signedInAs: SignedInAs | undefined;
|
|
14
|
-
/** This session, as the app words it ("Device · Mac · Chrome, since 08:02"); unset, no session line. */
|
|
15
|
-
session?: string;
|
|
16
|
-
/** Account's address from the apps list: set, the menu offers Your account, Your rights and Email updates (H8). */
|
|
17
|
-
accountUrl?: string;
|
|
18
|
-
/** The theme chosen; undefined while unknown, or for a sign-in that has none (the viewer). */
|
|
19
|
-
theme: Theme | undefined;
|
|
20
|
-
themes: readonly Theme[];
|
|
21
|
-
/** Whether the menu offers the theme at all. */
|
|
22
|
-
hasTheme: boolean;
|
|
23
|
-
onThemeChange: (theme: Theme) => void;
|
|
24
|
-
shortcuts: readonly Shortcut[];
|
|
25
|
-
helpUrl: string;
|
|
26
|
-
onSignOut: () => void;
|
|
27
|
-
isSigningOut: boolean;
|
|
28
|
-
entries?: readonly AvatarMenuEntry[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The avatar menu on desktop (header design H8, H10, H13): the avatar opens a
|
|
32
|
-
* DropdownMenu with who is signed in here and how, the account's own pages
|
|
33
|
-
* in Account, the app's entries, the theme (applied at once), keyboard
|
|
34
|
-
* shortcuts, help and sign out, which shows "Signing out" until it ends.
|
|
35
|
-
*/
|
|
36
|
-
export declare function AvatarMenu(props: AvatarMenuProps): import("react").JSX.Element;
|
|
37
|
-
/**
|
|
38
|
-
* The avatar menu on phone (H6): the avatar opens the same content as a
|
|
39
|
-
* bottom Sheet, with the app's phone-only entries for what its tab bar
|
|
40
|
-
* lacks, the theme as three buttons, and Cancel. No keyboard shortcuts on
|
|
41
|
-
* phone.
|
|
42
|
-
*/
|
|
43
|
-
export declare function AvatarMenuSheet(props: AvatarMenuProps): import("react").JSX.Element;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { BellRing, CircleHelp, CircleUserRound, Keyboard, LaptopMinimal, LoaderCircle, LogOut, Monitor, Moon, ShieldCheck, Sun } from 'lucide-react';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
import { signedInAsOf } from './apps.js';
|
|
6
|
-
import { shownEntryOf } from './avatar-entry.js';
|
|
7
|
-
import { Avatar } from './atoms/avatar.js';
|
|
8
|
-
import { Button } from './atoms/button.js';
|
|
9
|
-
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './atoms/dialog.js';
|
|
10
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from './atoms/dropdown-menu.js';
|
|
11
|
-
import { Kbd } from './atoms/kbd.js';
|
|
12
|
-
import { Sheet, SheetClose, SheetContent, SheetTitle, SheetTrigger } from './atoms/sheet.js';
|
|
13
|
-
import { classNames } from './class-names.js';
|
|
14
|
-
const THEME_LABELS = { light: 'Light', dark: 'Dark', system: 'System' };
|
|
15
|
-
const THEME_ICONS = { light: Sun, dark: Moon, system: Monitor };
|
|
16
|
-
/** The account's own pages in Account, from its address there. */
|
|
17
|
-
function accountPagesOf(accountUrl) {
|
|
18
|
-
return [
|
|
19
|
-
{ key: 'account', label: 'Your account', href: accountUrl, Icon: CircleUserRound },
|
|
20
|
-
{ key: 'rights', label: 'Your rights', href: `${accountUrl}/rights`, Icon: ShieldCheck },
|
|
21
|
-
{ key: 'updates', label: 'Email updates', href: `${accountUrl}/updates`, Icon: BellRing },
|
|
22
|
-
];
|
|
23
|
-
}
|
|
24
|
-
/** The name the avatar shows: the account's, or argo or the viewer by their own. */
|
|
25
|
-
function displayNameOf(name, signedInAs) {
|
|
26
|
-
if (name !== undefined) {
|
|
27
|
-
return name;
|
|
28
|
-
}
|
|
29
|
-
return signedInAs === 'viewer' ? 'viewer' : signedInAs === 'argo' ? 'argo' : ' ';
|
|
30
|
-
}
|
|
31
|
-
function themeOf(value, themes) {
|
|
32
|
-
return themes.find((theme) => theme === value);
|
|
33
|
-
}
|
|
34
|
-
/** Who is signed in here, and how (H10), with this session when the app words it. */
|
|
35
|
-
function WhoHeader({ name, signedInAs, session }) {
|
|
36
|
-
const shown = displayNameOf(name, signedInAs);
|
|
37
|
-
return (_jsxs("div", { className: "flex flex-col gap-2 px-2.5 pt-2 pb-2.5", children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [_jsx(Avatar, { kind: signedInAs === 'argo' ? 'argo' : 'account', size: 28, name: shown }), _jsxs("span", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate text-body font-medium text-foreground", children: shown }), _jsx("span", { "data-testid": "avatar-menu-signed-in-as", className: "truncate text-caption text-muted-foreground", children: signedInAs === undefined ? ' ' : signedInAsOf(signedInAs) })] })] }), session === undefined ? null : (_jsxs("p", { "data-testid": "avatar-menu-session", className: "flex items-start gap-1.5 text-caption text-muted-foreground", children: [_jsx(LaptopMinimal, { "aria-hidden": true, className: "mt-px size-(--size-icon-sm) shrink-0" }), _jsxs("span", { children: ["This session: ", _jsx("span", { className: "font-medium text-foreground", children: session })] })] }))] }));
|
|
38
|
-
}
|
|
39
|
-
/** An entry's icon and label, or a spinner and its working label while its work runs. */
|
|
40
|
-
function EntryContent({ entry }) {
|
|
41
|
-
const shown = shownEntryOf(entry);
|
|
42
|
-
return (_jsxs(_Fragment, { children: [shown.isWorking ? _jsx(LoaderCircle, { "aria-hidden": true, "data-testid": "avatar-menu-entry-spinner", className: "animate-spin motion-reduce:animate-none" }) : entry.icon, shown.label] }));
|
|
43
|
-
}
|
|
44
|
-
function SignOutLabel({ isSigningOut }) {
|
|
45
|
-
return isSigningOut ? (_jsxs(_Fragment, { children: [_jsx(LoaderCircle, { "aria-hidden": true, className: "animate-spin motion-reduce:animate-none" }), "Signing out"] })) : (_jsxs(_Fragment, { children: [_jsx(LogOut, { "aria-hidden": true }), "Sign out"] }));
|
|
46
|
-
}
|
|
47
|
-
/** The app's keyboard shortcuts, desktop only: phone has no Kbd hints (H6). */
|
|
48
|
-
function ShortcutsDialog({ isOpen, onOpenChange, shortcuts }) {
|
|
49
|
-
return (_jsx(Dialog, { open: isOpen, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { size: "sm", "data-testid": "avatar-menu-shortcuts-dialog", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Keyboard shortcuts" }), _jsx(DialogDescription, { children: "What the keys do here." })] }), _jsx("ul", { className: "flex flex-col gap-2", children: shortcuts.map((shortcut) => (_jsxs("li", { className: "flex items-center justify-between gap-4 text-body text-foreground", children: [shortcut.label, _jsx("span", { className: "flex gap-1", children: shortcut.keys.map((key) => (_jsx(Kbd, { children: key }, key))) })] }, shortcut.label))) })] }) }));
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* The avatar menu on desktop (header design H8, H10, H13): the avatar opens a
|
|
53
|
-
* DropdownMenu with who is signed in here and how, the account's own pages
|
|
54
|
-
* in Account, the app's entries, the theme (applied at once), keyboard
|
|
55
|
-
* shortcuts, help and sign out, which shows "Signing out" until it ends.
|
|
56
|
-
*/
|
|
57
|
-
export function AvatarMenu(props) {
|
|
58
|
-
const { name, signedInAs, accountUrl, theme, themes, hasTheme, onThemeChange, shortcuts, helpUrl, onSignOut, isSigningOut, entries = [] } = props;
|
|
59
|
-
const [isShortcutsOpen, setIsShortcutsOpen] = useState(false);
|
|
60
|
-
const shown = displayNameOf(name, signedInAs);
|
|
61
|
-
const label = `Account menu, ${shown}${signedInAs === undefined ? '' : `, ${signedInAsOf(signedInAs)}`}`;
|
|
62
|
-
return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { "data-testid": "avatar-menu", "aria-label": label, className: "inline-flex size-(--size-control) shrink-0 items-center justify-center rounded-full outline-none focus-visible:outline-2 focus-visible:outline-ring", children: _jsx(Avatar, { kind: signedInAs === 'argo' ? 'argo' : 'account', size: 28, name: shown }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-64", children: [_jsx(WhoHeader, { name: name, signedInAs: signedInAs, session: props.session }), accountUrl === undefined
|
|
63
|
-
? null
|
|
64
|
-
: accountPagesOf(accountUrl).map(({ key, label: pageLabel, href, Icon }) => (_jsxs(DropdownMenuItem, { "data-testid": `avatar-menu-${key}`, render: (itemProps) => (_jsx("a", { ...itemProps, href: href, children: itemProps.children })), children: [_jsx(Icon, { "aria-hidden": true }), pageLabel] }, key))), entries
|
|
65
|
-
.filter((entry) => entry.isPhoneOnly !== true)
|
|
66
|
-
.map((entry) => (_jsx(DropdownMenuItem, { "data-testid": `avatar-menu-${entry.key}`, disabled: shownEntryOf(entry).isWorking, closeOnClick: shownEntryOf(entry).shouldCloseMenu, onClick: entry.onSelect, ...(entry.href === undefined
|
|
67
|
-
? {}
|
|
68
|
-
: {
|
|
69
|
-
render: (itemProps) => (_jsx("a", { ...itemProps, href: entry.href, children: itemProps.children })),
|
|
70
|
-
}), children: _jsx(EntryContent, { entry: entry }) }, entry.key))), hasTheme ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuLabel, { children: "Theme" }), _jsx(DropdownMenuRadioGroup, { value: theme ?? null, onValueChange: (value) => {
|
|
71
|
-
const picked = themeOf(value, themes);
|
|
72
|
-
if (picked !== undefined) {
|
|
73
|
-
onThemeChange(picked);
|
|
74
|
-
}
|
|
75
|
-
}, children: themes.map((option) => {
|
|
76
|
-
const Icon = THEME_ICONS[option];
|
|
77
|
-
return (_jsxs(DropdownMenuRadioItem, { value: option, disabled: theme === undefined, closeOnClick: false, "data-testid": `avatar-menu-theme-${option}`, children: [_jsx(Icon, { "aria-hidden": true }), THEME_LABELS[option]] }, option));
|
|
78
|
-
}) })] })] })) : null, _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { "data-testid": "avatar-menu-shortcuts", onClick: () => {
|
|
79
|
-
setIsShortcutsOpen(true);
|
|
80
|
-
}, children: [_jsx(Keyboard, { "aria-hidden": true }), "Keyboard shortcuts"] }), _jsxs(DropdownMenuItem, { "data-testid": "avatar-menu-help", render: (itemProps) => (_jsx("a", { ...itemProps, href: helpUrl, target: "_blank", rel: "noreferrer", children: itemProps.children })), children: [_jsx(CircleHelp, { "aria-hidden": true }), "Help", _jsx("span", { className: "sr-only", children: " (opens in a new tab)" })] }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { "data-testid": "avatar-menu-sign-out", disabled: isSigningOut, closeOnClick: false, onClick: onSignOut, children: _jsx(SignOutLabel, { isSigningOut: isSigningOut }) })] })] }), _jsx(ShortcutsDialog, { isOpen: isShortcutsOpen, onOpenChange: setIsShortcutsOpen, shortcuts: shortcuts })] }));
|
|
81
|
-
}
|
|
82
|
-
const rowClass = 'flex h-(--size-control-touch) w-full items-center gap-2.5 border-t border-border pt-3 text-body-touch text-foreground outline-none focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60 [&_svg]:size-(--size-icon) [&_svg]:text-muted-foreground';
|
|
83
|
-
/**
|
|
84
|
-
* The avatar menu on phone (H6): the avatar opens the same content as a
|
|
85
|
-
* bottom Sheet, with the app's phone-only entries for what its tab bar
|
|
86
|
-
* lacks, the theme as three buttons, and Cancel. No keyboard shortcuts on
|
|
87
|
-
* phone.
|
|
88
|
-
*/
|
|
89
|
-
export function AvatarMenuSheet(props) {
|
|
90
|
-
const { name, signedInAs, accountUrl, theme, themes, hasTheme, onThemeChange, helpUrl, onSignOut, isSigningOut, entries = [] } = props;
|
|
91
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
92
|
-
const shown = displayNameOf(name, signedInAs);
|
|
93
|
-
return (_jsxs(Sheet, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(SheetTrigger, { "data-testid": "avatar-menu", "aria-label": `Account menu, ${shown}${signedInAs === undefined ? '' : `, ${signedInAsOf(signedInAs)}`}`, className: "inline-flex size-(--size-control-touch) shrink-0 items-center justify-center rounded-full outline-none focus-visible:outline-2 focus-visible:outline-ring", children: _jsx(Avatar, { kind: signedInAs === 'argo' ? 'argo' : 'account', size: 28, name: shown }) }), _jsxs(SheetContent, { side: "bottom", "data-testid": "avatar-menu-sheet", className: "gap-3", children: [_jsx(SheetTitle, { className: "sr-only", children: "Account" }), _jsx(WhoHeader, { name: name, signedInAs: signedInAs, session: props.session }), accountUrl === undefined
|
|
94
|
-
? null
|
|
95
|
-
: accountPagesOf(accountUrl).map(({ key, label, href, Icon }) => (_jsxs("a", { href: href, "data-testid": `avatar-menu-${key}`, className: rowClass, children: [_jsx(Icon, { "aria-hidden": true }), label] }, key))), entries.map((entry) => entry.href === undefined ? (_jsx("button", { type: "button", "data-testid": `avatar-menu-${entry.key}`, className: rowClass, disabled: shownEntryOf(entry).isWorking, onClick: () => {
|
|
96
|
-
if (shownEntryOf(entry).shouldCloseMenu) {
|
|
97
|
-
setIsOpen(false);
|
|
98
|
-
}
|
|
99
|
-
entry.onSelect?.();
|
|
100
|
-
}, children: _jsx(EntryContent, { entry: entry }) }, entry.key)) : (_jsxs("a", { href: entry.href, "data-testid": `avatar-menu-${entry.key}`, className: rowClass, onClick: () => {
|
|
101
|
-
setIsOpen(false);
|
|
102
|
-
entry.onSelect?.();
|
|
103
|
-
}, children: [entry.icon, entry.label] }, entry.key))), hasTheme ? (_jsxs("div", { role: "group", "aria-label": "Theme", className: "flex flex-col gap-1.5 border-t border-border pt-3", children: [_jsx("p", { className: "text-caption text-muted-foreground", children: "Theme" }), _jsx("div", { className: "grid grid-cols-3 gap-1 rounded-lg bg-muted p-1", children: themes.map((option) => {
|
|
104
|
-
const Icon = THEME_ICONS[option];
|
|
105
|
-
const isChosen = option === theme;
|
|
106
|
-
return (_jsxs("button", { type: "button", "aria-pressed": isChosen, disabled: theme === undefined, "data-testid": `avatar-menu-theme-${option}`, onClick: () => {
|
|
107
|
-
onThemeChange(option);
|
|
108
|
-
}, className: classNames('inline-flex h-(--size-control-touch) items-center justify-center gap-1.5 rounded-md text-body-touch text-muted-foreground outline-none focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60 [&_svg]:size-(--size-icon)', isChosen ? 'bg-background text-foreground shadow-xs' : undefined), children: [_jsx(Icon, { "aria-hidden": true }), THEME_LABELS[option]] }, option));
|
|
109
|
-
}) })] })) : null, _jsxs("a", { href: helpUrl, target: "_blank", rel: "noreferrer", "data-testid": "avatar-menu-help", className: rowClass, children: [_jsx(CircleHelp, { "aria-hidden": true }), "Help", _jsx("span", { className: "sr-only", children: " (opens in a new tab)" })] }), _jsx("button", { type: "button", "data-testid": "avatar-menu-sign-out", disabled: isSigningOut, onClick: onSignOut, className: rowClass, children: _jsx(SignOutLabel, { isSigningOut: isSigningOut }) }), _jsx(SheetClose, { render: _jsx(Button, { size: "touch", className: "w-full" }), children: "Cancel" })] })] }));
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=avatar-menu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-menu.js","sourceRoot":"","sources":["../../src/header/avatar-menu.tsx"],"names":[],"m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AAU,0BAAe,UAE1B,eAAM,SAAS,EAAC,SAAS,sCAA6B,IACpD,EACJ,iBAAQ,IAAI,EAAC,QAAQ,iBAAa,sBAAsB,EAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,YACtH,KAAC,YAAY,IAAC,YAAY,EAAE,YAAY,GAAI,GACrC,EACT,KAAC,UAAU,IAAC,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,QAAQ,GAAG,uBAAqB,IACtE,IACT,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { extendTailwindMerge } from 'tailwind-merge';
|
|
3
|
-
/**
|
|
4
|
-
* The text styles from tokens.css. tailwind-merge has to know they are font
|
|
5
|
-
* sizes: otherwise it takes text-body for a colour and drops a text colour
|
|
6
|
-
* written before it.
|
|
7
|
-
*/
|
|
8
|
-
const TEXT_STYLES = [
|
|
9
|
-
'micro',
|
|
10
|
-
'caption',
|
|
11
|
-
'meta',
|
|
12
|
-
'body',
|
|
13
|
-
'section',
|
|
14
|
-
'body-touch',
|
|
15
|
-
'input-touch',
|
|
16
|
-
'heading',
|
|
17
|
-
'heading-touch',
|
|
18
|
-
'title',
|
|
19
|
-
'title-touch',
|
|
20
|
-
'metric',
|
|
21
|
-
'id',
|
|
22
|
-
'code',
|
|
23
|
-
];
|
|
24
|
-
const merge = extendTailwindMerge({ extend: { theme: { text: TEXT_STYLES } } });
|
|
25
|
-
/** Joins class names, and lets a later Tailwind class win over an earlier one for the same property. */
|
|
26
|
-
export function classNames(...inputs) {
|
|
27
|
-
return merge(clsx(inputs));
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=class-names.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"class-names.js","sourceRoot":"","sources":["../../src/header/class-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,GAAG;IAClB,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,YAAY;IACZ,aAAa;IACb,SAAS;IACT,eAAe;IACf,OAAO;IACP,aAAa;IACb,QAAQ;IACR,IAAI;IACJ,MAAM;CACP,CAAC;AAEF,MAAM,KAAK,GAAG,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;AAEhF,wGAAwG;AACxG,MAAM,UAAU,UAAU,CAAC,GAAG,MAAoB;IAChD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7B,CAAC"}
|