@aeolus-fleet/common 0.28.3 → 0.29.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/fleet/index.d.ts +10 -6
- package/dist/fleet/index.js +7 -5
- package/dist/fleet/index.js.map +1 -1
- package/dist/header/app-header.d.ts +27 -0
- package/dist/header/app-header.js +18 -0
- package/dist/header/app-header.js.map +1 -0
- package/dist/header/app-switcher.d.ts +20 -0
- package/dist/header/app-switcher.js +57 -0
- package/dist/header/app-switcher.js.map +1 -0
- package/dist/header/apps.d.ts +45 -0
- package/dist/header/apps.js +44 -0
- package/dist/header/apps.js.map +1 -0
- package/dist/header/atoms/avatar.d.ts +16 -0
- package/dist/header/atoms/avatar.js +44 -0
- package/dist/header/atoms/avatar.js.map +1 -0
- package/dist/header/atoms/button.d.ts +22 -0
- package/dist/header/atoms/button.js +48 -0
- package/dist/header/atoms/button.js.map +1 -0
- package/dist/header/atoms/dialog-surface.d.ts +19 -0
- package/dist/header/atoms/dialog-surface.js +32 -0
- package/dist/header/atoms/dialog-surface.js.map +1 -0
- package/dist/header/atoms/dialog.d.ts +19 -0
- package/dist/header/atoms/dialog.js +37 -0
- package/dist/header/atoms/dialog.js.map +1 -0
- package/dist/header/atoms/dropdown-menu.d.ts +21 -0
- package/dist/header/atoms/dropdown-menu.js +42 -0
- package/dist/header/atoms/dropdown-menu.js.map +1 -0
- package/dist/header/atoms/kbd.d.ts +7 -0
- package/dist/header/atoms/kbd.js +11 -0
- package/dist/header/atoms/kbd.js.map +1 -0
- package/dist/header/atoms/sheet.d.ts +23 -0
- package/dist/header/atoms/sheet.js +52 -0
- package/dist/header/atoms/sheet.js.map +1 -0
- package/dist/header/atoms/tooltip.d.ts +10 -0
- package/dist/header/atoms/tooltip.js +24 -0
- package/dist/header/atoms/tooltip.js.map +1 -0
- package/dist/header/avatar-entry.d.ts +21 -0
- package/dist/header/avatar-entry.js +6 -0
- package/dist/header/avatar-entry.js.map +1 -0
- package/dist/header/avatar-menu.d.ts +43 -0
- package/dist/header/avatar-menu.js +111 -0
- package/dist/header/avatar-menu.js.map +1 -0
- package/dist/header/class-names.d.ts +3 -0
- package/dist/header/class-names.js +29 -0
- package/dist/header/class-names.js.map +1 -0
- package/dist/header/command-palette.d.ts +42 -0
- package/dist/header/command-palette.js +76 -0
- package/dist/header/command-palette.js.map +1 -0
- package/dist/header/index.d.ts +21 -0
- package/dist/header/index.js +22 -0
- package/dist/header/index.js.map +1 -0
- package/dist/header/tokens.css +154 -0
- package/dist/schemas/account-token.d.ts +5 -1
- package/dist/schemas/account-token.js +4 -1
- package/dist/schemas/account-token.js.map +1 -1
- package/dist/schemas/apps-list.d.ts +51 -0
- package/dist/schemas/apps-list.js +21 -0
- package/dist/schemas/apps-list.js.map +1 -0
- package/dist/schemas/console.d.ts +47 -2
- package/dist/schemas/console.js +41 -4
- package/dist/schemas/console.js.map +1 -1
- package/dist/schemas/delivery.d.ts +43 -1
- package/dist/schemas/delivery.js +11 -0
- package/dist/schemas/delivery.js.map +1 -1
- package/dist/schemas/fleet.d.ts +7 -8
- package/dist/schemas/fleet.js +0 -4
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/follow.d.ts +2 -1
- package/dist/schemas/guide.d.ts +3 -0
- package/dist/schemas/history.d.ts +61 -3
- package/dist/schemas/history.js +3 -0
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/installation.d.ts +9 -0
- package/dist/schemas/installation.js +7 -0
- package/dist/schemas/installation.js.map +1 -1
- package/dist/schemas/network.d.ts +13 -13
- package/dist/schemas/notice.d.ts +7 -2
- package/dist/schemas/notice.js +2 -2
- package/dist/schemas/notice.js.map +1 -1
- package/dist/schemas/statement.d.ts +1 -0
- package/package.json +44 -4
package/dist/fleet/index.d.ts
CHANGED
|
@@ -94,24 +94,27 @@ export type FleetScope = z.infer<typeof fleetScopeSchema>;
|
|
|
94
94
|
/**
|
|
95
95
|
* What a ship is (decision 0044): `argo` is the one `operator`, the console's
|
|
96
96
|
* door is the `viewer`, an `agent` is a session, a `person` a human's ship
|
|
97
|
-
* crewed by their own app or a chat,
|
|
98
|
-
* outside party, crewed by its adapter
|
|
97
|
+
* crewed by their own app or a chat, an `app` an application or an
|
|
98
|
+
* outside party, crewed by its adapter, and a `plugin` software installed
|
|
99
|
+
* once per installation serving many fleets (decision 0050).
|
|
99
100
|
*/
|
|
100
|
-
export declare const SHIP_KINDS: readonly ["operator", "agent", "viewer", "person", "app"];
|
|
101
|
+
export declare const SHIP_KINDS: readonly ["operator", "agent", "viewer", "person", "app", "plugin"];
|
|
101
102
|
export declare const shipKindSchema: z.ZodEnum<{
|
|
102
103
|
operator: "operator";
|
|
103
104
|
agent: "agent";
|
|
104
105
|
viewer: "viewer";
|
|
105
106
|
person: "person";
|
|
106
107
|
app: "app";
|
|
108
|
+
plugin: "plugin";
|
|
107
109
|
}>;
|
|
108
110
|
export type ShipKind = z.infer<typeof shipKindSchema>;
|
|
109
|
-
/** The kinds a commission makes; argo and the viewer ship come with the fleet. */
|
|
110
|
-
export declare const COMMISSIONED_SHIP_KINDS: readonly ["agent", "person", "app"];
|
|
111
|
+
/** The kinds a commission makes; argo and the viewer ship come with the fleet. A plugin's commission is its connect (decision 0050). */
|
|
112
|
+
export declare const COMMISSIONED_SHIP_KINDS: readonly ["agent", "person", "app", "plugin"];
|
|
111
113
|
export declare const commissionedShipKindSchema: z.ZodEnum<{
|
|
112
114
|
agent: "agent";
|
|
113
115
|
person: "person";
|
|
114
116
|
app: "app";
|
|
117
|
+
plugin: "plugin";
|
|
115
118
|
}>;
|
|
116
119
|
export type CommissionedShipKind = z.infer<typeof commissionedShipKindSchema>;
|
|
117
120
|
/** Where the session crewing a ship runs. `OTHER` carries a short description. */
|
|
@@ -164,7 +167,7 @@ export declare const deliveryStateSchema: z.ZodEnum<{
|
|
|
164
167
|
}>;
|
|
165
168
|
export type DeliveryState = z.infer<typeof deliveryStateSchema>;
|
|
166
169
|
/** The event types written so far. Each later slice adds the ones it writes. */
|
|
167
|
-
export declare const EVENT_TYPES: readonly ["FleetInitialised", "ShipCommissioned", "OwnerSet", "OwnerChanged", "ShipClaimed", "LeaseRevoked", "CredentialRevoked", "StartingPromptIssued", "OperatorPasswordReset", "MessageAccepted", "LeasePushed", "DeliveryReceived", "DeliveryHanded", "DeliveryAcknowledged", "DeliveryHandled", "DeliveryNotHandled", "DeliveryOverdue", "DeliveryUndeliverable", "DeliveryReturned", "ShipRetired", "DeliveryAbandoned", "DeliveryDismissed", "ShipRenamed", "ShipReported", "StatementSet", "TurnReported", "SignInTicketIssued", "FleetLimitsChanged", "ViewerSessionStarted", "CrewRequested", "CrewRequestRemoved", "CrewAssigned", "CrewStatusChanged", "CrewRequestExplained", "CrewRequestGivenBack", "LabelDefined", "LabelValuesChanged", "LabelRetired", "LabelAssigned", "LabelUnassigned", "LabelDeleted", "WorktreeClearRequested", "WorktreeCleared", "WorktreeClearRemoved", "NetworkRulesSet", "NetworkRulesDeclared", "NetworkRulesDraftSaved", "NetworkRulesDraftDiscarded", "NetworkPluginRegistered", "NetworkPluginUnregistered", "BuiltInRuleChanged", "ScopesDeclared", "ScopesChanged", "PluginConnected", "PluginDisconnected", "VerifiedFactsSet", "VerifiedFactsRemoved"];
|
|
170
|
+
export declare const EVENT_TYPES: readonly ["FleetInitialised", "ShipCommissioned", "OwnerSet", "OwnerChanged", "ShipClaimed", "LeaseRevoked", "CredentialRevoked", "StartingPromptIssued", "OperatorPasswordReset", "OperatorLoginSet", "MessageAccepted", "LeasePushed", "DeliveryReceived", "DeliveryHanded", "DeliveryAcknowledged", "DeliveryHandled", "DeliveryNotHandled", "DeliveryOverdue", "DeliveryUndeliverable", "DeliveryReturned", "ShipRetired", "DeliveryAbandoned", "DeliveryDismissed", "ShipRenamed", "ShipReported", "StatementSet", "TurnReported", "SignInTicketIssued", "FleetLimitsChanged", "ViewerSessionStarted", "CrewRequested", "CrewRequestRemoved", "CrewAssigned", "CrewStatusChanged", "CrewRequestExplained", "CrewRequestGivenBack", "LabelDefined", "LabelValuesChanged", "LabelRetired", "LabelAssigned", "LabelUnassigned", "LabelDeleted", "WorktreeClearRequested", "WorktreeCleared", "WorktreeClearRemoved", "NetworkRulesSet", "NetworkRulesDeclared", "NetworkRulesDraftSaved", "NetworkRulesDraftDiscarded", "NetworkPluginRegistered", "NetworkPluginUnregistered", "BuiltInRuleChanged", "ScopesDeclared", "ScopesChanged", "PluginConnected", "PluginDisconnected", "VerifiedFactsSet", "VerifiedFactsRemoved"];
|
|
168
171
|
export declare const eventTypeSchema: z.ZodEnum<{
|
|
169
172
|
FleetInitialised: "FleetInitialised";
|
|
170
173
|
ShipCommissioned: "ShipCommissioned";
|
|
@@ -175,6 +178,7 @@ export declare const eventTypeSchema: z.ZodEnum<{
|
|
|
175
178
|
CredentialRevoked: "CredentialRevoked";
|
|
176
179
|
StartingPromptIssued: "StartingPromptIssued";
|
|
177
180
|
OperatorPasswordReset: "OperatorPasswordReset";
|
|
181
|
+
OperatorLoginSet: "OperatorLoginSet";
|
|
178
182
|
MessageAccepted: "MessageAccepted";
|
|
179
183
|
LeasePushed: "LeasePushed";
|
|
180
184
|
DeliveryReceived: "DeliveryReceived";
|
package/dist/fleet/index.js
CHANGED
|
@@ -120,13 +120,14 @@ export const fleetScopeSchema = z.enum(FLEET_SCOPES);
|
|
|
120
120
|
/**
|
|
121
121
|
* What a ship is (decision 0044): `argo` is the one `operator`, the console's
|
|
122
122
|
* door is the `viewer`, an `agent` is a session, a `person` a human's ship
|
|
123
|
-
* crewed by their own app or a chat,
|
|
124
|
-
* outside party, crewed by its adapter
|
|
123
|
+
* crewed by their own app or a chat, an `app` an application or an
|
|
124
|
+
* outside party, crewed by its adapter, and a `plugin` software installed
|
|
125
|
+
* once per installation serving many fleets (decision 0050).
|
|
125
126
|
*/
|
|
126
|
-
export const SHIP_KINDS = ['operator', 'agent', 'viewer', 'person', 'app'];
|
|
127
|
+
export const SHIP_KINDS = ['operator', 'agent', 'viewer', 'person', 'app', 'plugin'];
|
|
127
128
|
export const shipKindSchema = z.enum(SHIP_KINDS);
|
|
128
|
-
/** The kinds a commission makes; argo and the viewer ship come with the fleet. */
|
|
129
|
-
export const COMMISSIONED_SHIP_KINDS = ['agent', 'person', 'app'];
|
|
129
|
+
/** The kinds a commission makes; argo and the viewer ship come with the fleet. A plugin's commission is its connect (decision 0050). */
|
|
130
|
+
export const COMMISSIONED_SHIP_KINDS = ['agent', 'person', 'app', 'plugin'];
|
|
130
131
|
export const commissionedShipKindSchema = z.enum(COMMISSIONED_SHIP_KINDS);
|
|
131
132
|
/** Where the session crewing a ship runs. `OTHER` carries a short description. */
|
|
132
133
|
export const LOCATION_KINDS = ['DEVICE', 'CLOUD', 'SERVER', 'OTHER'];
|
|
@@ -172,6 +173,7 @@ export const EVENT_TYPES = [
|
|
|
172
173
|
'CredentialRevoked',
|
|
173
174
|
'StartingPromptIssued',
|
|
174
175
|
'OperatorPasswordReset',
|
|
176
|
+
'OperatorLoginSet',
|
|
175
177
|
'MessageAccepted',
|
|
176
178
|
'LeasePushed',
|
|
177
179
|
'DeliveryReceived',
|
package/dist/fleet/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fleet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,iBAAiB;IACjB,YAAY;IACZ,kBAAkB;IAClB,cAAc;IACd,aAAa;IACb,UAAU;IACV,eAAe;IACf,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,aAAa;IACb,eAAe;IACf,eAAe;IACf,YAAY;IACZ,cAAc;IACd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ACjB,uBAAuB;IACvB,kBAAkB;IAClB,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,oBAAoB;IACpB,oBAAoB;IACpB,sBAAsB;IACtB,eAAe;IACf,oBAAoB;IACpB,cAAc;IACd,mBAAmB;IACnB,sBAAsB;IACtB,sBAAsB;IACtB,cAAc;IACd,oBAAoB;IACpB,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,wBAAwB;IACxB,iBAAiB;IACjB,sBAAsB;IACtB,iBAAiB;IACjB,sBAAsB;IACtB,wBAAwB;IACxB,4BAA4B;IAC5B,8FAA8F;IAC9F,yBAAyB;IACzB,2BAA2B;IAC3B,oBAAoB;IACpB,gBAAgB;IAChB,eAAe;IACf,iBAAiB;IACjB,oBAAoB;IACpB,kBAAkB;IAClB,sBAAsB;CACd,CAAC;AACX,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAGnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AppSwitcherModel } from './apps.js';
|
|
3
|
+
import { type AvatarMenuProps } from './avatar-menu.js';
|
|
4
|
+
interface AppHeaderProps {
|
|
5
|
+
/** Undefined while the fleet in view is not known yet: the title's shape stands in. */
|
|
6
|
+
switcher: AppSwitcherModel | undefined;
|
|
7
|
+
/** The avatar menu, always last. */
|
|
8
|
+
account: AvatarMenuProps;
|
|
9
|
+
/** Opens the command palette; without it the search trigger is not shown. */
|
|
10
|
+
onSearch?: () => void;
|
|
11
|
+
/** The search trigger's words: "Search ships or jump to". */
|
|
12
|
+
searchLabel?: string;
|
|
13
|
+
/** The app's own part after the title, such as a breadcrumb. */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/** The app's own controls before the search, such as a live status or Compose. */
|
|
16
|
+
actions?: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The header every Aeolus web app shows on desktop (header design H1 to H13),
|
|
21
|
+
* 56 px: the switcher in the title ("Acme / Console ▾"), the app's own part
|
|
22
|
+
* after it, then the app's controls, the command palette's search trigger
|
|
23
|
+
* with its ⌘K hint, and the avatar menu. Each app's own bar takes the
|
|
24
|
+
* header on phone, with the switcher compact (H6).
|
|
25
|
+
*/
|
|
26
|
+
export declare function AppHeader({ switcher, account, onSearch, searchLabel, children, actions, className }: AppHeaderProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Search } from 'lucide-react';
|
|
3
|
+
import { AppSwitcher } from './app-switcher.js';
|
|
4
|
+
import { Button } from './atoms/button.js';
|
|
5
|
+
import { Kbd } from './atoms/kbd.js';
|
|
6
|
+
import { AvatarMenu } from './avatar-menu.js';
|
|
7
|
+
import { classNames } from './class-names.js';
|
|
8
|
+
/**
|
|
9
|
+
* The header every Aeolus web app shows on desktop (header design H1 to H13),
|
|
10
|
+
* 56 px: the switcher in the title ("Acme / Console ▾"), the app's own part
|
|
11
|
+
* after it, then the app's controls, the command palette's search trigger
|
|
12
|
+
* with its ⌘K hint, and the avatar menu. Each app's own bar takes the
|
|
13
|
+
* header on phone, with the switcher compact (H6).
|
|
14
|
+
*/
|
|
15
|
+
export function AppHeader({ switcher, account, onSearch, searchLabel = 'Search or jump to', children, actions, className }) {
|
|
16
|
+
return (_jsxs("header", { "data-slot": "app-header", className: classNames('sticky top-0 z-30 flex h-(--size-header) shrink-0 items-center justify-between gap-4 border-b border-border bg-background px-6', className), children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [switcher === undefined ? (_jsx("span", { "data-testid": "app-switcher-loading", "aria-hidden": true, className: "h-4 w-36 shrink-0 animate-pulse rounded bg-muted motion-reduce:animate-none" })) : (_jsx(AppSwitcher, { switcher: switcher, layout: "full", className: "shrink-0" })), children] }), _jsxs("div", { className: "flex shrink-0 items-center gap-3", children: [actions, onSearch ? (_jsxs(Button, { size: "sm", icon: _jsx(Search, { "aria-hidden": true }), "data-testid": "header-search", className: "w-60 justify-start font-normal text-muted-foreground max-lg:w-auto", onClick: onSearch, children: [_jsx("span", { className: "grow text-left max-lg:sr-only", children: searchLabel }), _jsx(Kbd, { children: "\u2318K" })] })) : null, _jsx(AvatarMenu, { ...account })] })] }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=app-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-header.js","sourceRoot":"","sources":["../../src/header/app-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAkB9C;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAkB;IACxI,OAAO,CACL,+BACY,YAAY,EACtB,SAAS,EAAE,UAAU,CAAC,gIAAgI,EAAE,SAAS,CAAC,aAElK,eAAK,SAAS,EAAC,iCAAiC,aAC7C,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CACxB,8BAAkB,sBAAsB,uBAAa,SAAS,EAAC,6EAA6E,GAAG,CAChJ,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,EAAC,SAAS,EAAC,UAAU,GAAG,CACvE,EACA,QAAQ,IACL,EACN,eAAK,SAAS,EAAC,kCAAkC,aAC9C,OAAO,EACP,QAAQ,CAAC,CAAC,CAAC,CACV,MAAC,MAAM,IAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAE,KAAC,MAAM,0BAAe,iBAAc,eAAe,EAAC,SAAS,EAAC,oEAAoE,EAAC,OAAO,EAAE,QAAQ,aAC1K,eAAM,SAAS,EAAC,+BAA+B,YAAE,WAAW,GAAQ,EACpE,KAAC,GAAG,0BAAS,IACN,CACV,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,UAAU,OAAK,OAAO,GAAI,IACvB,IACC,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AppSwitcherModel } from './apps.js';
|
|
2
|
+
interface AppSwitcherProps {
|
|
3
|
+
switcher: AppSwitcherModel;
|
|
4
|
+
/**
|
|
5
|
+
* full: "Acme / Console ▾", the fleet part switching fleet and the app part
|
|
6
|
+
* switching app, each a menu. compact (phone, H6): "Console ▾", one bottom
|
|
7
|
+
* Sheet with the fleets, then the apps.
|
|
8
|
+
*/
|
|
9
|
+
layout: 'full' | 'compact';
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The switcher in the title (header design H1, H6, H8, H9): the fleet in view
|
|
14
|
+
* and the app open. Choosing another fleet or app follows its link; the
|
|
15
|
+
* choice says "Opening ..." with a spinner at once, and the others wait,
|
|
16
|
+
* until the browser leaves. Without anywhere else to go it is plain text,
|
|
17
|
+
* with no ▾.
|
|
18
|
+
*/
|
|
19
|
+
export declare function AppSwitcher({ switcher, layout, className }: AppSwitcherProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Check, ChevronDown, LoaderCircle } from 'lucide-react';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { Button } from './atoms/button.js';
|
|
6
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from './atoms/dropdown-menu.js';
|
|
7
|
+
import { Sheet, SheetClose, SheetContent, SheetTitle, SheetTrigger } from './atoms/sheet.js';
|
|
8
|
+
import { classNames } from './class-names.js';
|
|
9
|
+
const triggerClass = 'inline-flex min-w-0 items-center gap-1 rounded-md px-1.5 py-1 text-body font-semibold text-foreground outline-none transition-colors duration-(--duration-fast) hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring aria-expanded:bg-accent disabled:opacity-60';
|
|
10
|
+
/** A choice's mark: a spinner while it opens, a check on the one in view. */
|
|
11
|
+
function Mark({ isCurrent, isOpening }) {
|
|
12
|
+
if (isOpening) {
|
|
13
|
+
return _jsx(LoaderCircle, { "aria-hidden": true, className: "ml-auto animate-spin motion-reduce:animate-none" });
|
|
14
|
+
}
|
|
15
|
+
return isCurrent ? _jsx(Check, { "aria-hidden": true, className: "ml-auto" }) : null;
|
|
16
|
+
}
|
|
17
|
+
/** One choice in a desktop menu: a link, with "Opening" while the browser goes there. */
|
|
18
|
+
function MenuChoice({ url, name, isCurrent, opening, onOpen, testId }) {
|
|
19
|
+
const isOpening = opening?.url === url && opening.name === name;
|
|
20
|
+
return (_jsxs(DropdownMenuItem, { "data-testid": testId, "data-current": isCurrent || undefined, disabled: opening !== undefined && !isOpening, closeOnClick: false, render: (props) => (_jsx("a", { ...props, href: url, "aria-current": isCurrent ? 'page' : undefined, onClick: (event) => {
|
|
21
|
+
props.onClick?.(event);
|
|
22
|
+
onOpen({ url, name });
|
|
23
|
+
}, children: props.children })), children: [_jsx("span", { className: "min-w-0 truncate", children: isOpening ? `Opening ${name}` : name }), _jsx(Mark, { isCurrent: isCurrent, isOpening: isOpening })] }));
|
|
24
|
+
}
|
|
25
|
+
/** One choice in the phone's Sheet: a 44 px link, with "Opening" while the browser goes there. */
|
|
26
|
+
function SheetChoice({ url, name, isCurrent, opening, onOpen, testId }) {
|
|
27
|
+
const isOpening = opening?.url === url && opening.name === name;
|
|
28
|
+
return (_jsxs("a", { href: url, "data-testid": testId, "aria-current": isCurrent ? 'page' : undefined, "aria-disabled": opening !== undefined && !isOpening ? true : undefined, onClick: (event) => {
|
|
29
|
+
if (opening !== undefined) {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
onOpen({ url, name });
|
|
34
|
+
}, className: "flex h-(--size-control-touch) items-center gap-2.5 rounded-md px-2 text-body-touch text-foreground outline-none focus-visible:outline-2 focus-visible:outline-ring aria-disabled:opacity-60 [&_svg]:size-(--size-icon) [&_svg]:text-muted-foreground", children: [_jsx("span", { className: "min-w-0 truncate", children: isOpening ? `Opening ${name}` : name }), _jsx(Mark, { isCurrent: isCurrent, isOpening: isOpening })] }));
|
|
35
|
+
}
|
|
36
|
+
function SheetGroup({ label, children }) {
|
|
37
|
+
return (_jsxs("div", { role: "group", "aria-label": label, className: "flex flex-col gap-0.5", children: [_jsx("p", { className: "px-2 text-caption font-medium text-muted-foreground", children: label }), children] }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The switcher in the title (header design H1, H6, H8, H9): the fleet in view
|
|
41
|
+
* and the app open. Choosing another fleet or app follows its link; the
|
|
42
|
+
* choice says "Opening ..." with a spinner at once, and the others wait,
|
|
43
|
+
* until the browser leaves. Without anywhere else to go it is plain text,
|
|
44
|
+
* with no ▾.
|
|
45
|
+
*/
|
|
46
|
+
export function AppSwitcher({ switcher, layout, className }) {
|
|
47
|
+
const [opening, setOpening] = useState(undefined);
|
|
48
|
+
const { fleet, appLabel, fleets, apps, canSwitch } = switcher;
|
|
49
|
+
if (!canSwitch) {
|
|
50
|
+
return (_jsxs("p", { "data-testid": "app-switcher", className: classNames('flex min-w-0 items-center gap-1 px-1.5 text-body font-semibold text-foreground', className), children: [layout === 'full' ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "truncate", children: fleet.name }), _jsx("span", { "aria-hidden": true, className: "text-muted-foreground", children: "/" })] })) : null, _jsx("span", { className: "truncate", children: appLabel })] }));
|
|
51
|
+
}
|
|
52
|
+
if (layout === 'compact') {
|
|
53
|
+
return (_jsxs(Sheet, { children: [_jsxs(SheetTrigger, { "data-testid": "app-switcher", "aria-label": `Switch fleet or app: ${fleet.name}, ${appLabel}`, className: classNames(triggerClass, 'text-title-touch', className), children: [_jsx("span", { className: "truncate", children: appLabel }), opening === undefined ? _jsx(ChevronDown, { "aria-hidden": true, className: "size-(--size-icon) shrink-0 text-muted-foreground" }) : _jsx(LoaderCircle, { "aria-hidden": true, className: "size-(--size-icon) shrink-0 animate-spin motion-reduce:animate-none" })] }), _jsxs(SheetContent, { side: "bottom", "data-testid": "app-switcher-sheet", className: "gap-3", children: [_jsx(SheetTitle, { className: "sr-only", children: "Switch fleet or app" }), _jsx(SheetGroup, { label: "Fleets", children: fleets.map((choice) => (_jsx(SheetChoice, { url: choice.url, name: choice.name, isCurrent: choice.isCurrent, opening: opening, onOpen: setOpening, testId: "app-switcher-fleet" }, choice.id))) }), _jsx(SheetGroup, { label: "Apps", children: apps.map((choice) => (_jsx(SheetChoice, { url: choice.url, name: choice.label, isCurrent: choice.isCurrent, opening: opening, onOpen: setOpening, testId: "app-switcher-app" }, choice.app))) }), _jsx(SheetClose, { render: _jsx(Button, { size: "touch", className: "w-full" }), children: "Cancel" })] })] }));
|
|
54
|
+
}
|
|
55
|
+
return (_jsxs("nav", { "aria-label": "Fleet and app", "data-testid": "app-switcher", className: classNames('flex min-w-0 items-center gap-0.5', className), children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { "data-testid": "app-switcher-fleets", "aria-label": `Fleet: ${fleet.name}. Switch fleet`, className: triggerClass, children: _jsx("span", { className: "truncate", children: fleet.name }) }), _jsx(DropdownMenuContent, { align: "start", className: "w-56", children: _jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuLabel, { children: "Fleets" }), fleets.map((choice) => (_jsx(MenuChoice, { url: choice.url, name: choice.name, isCurrent: choice.isCurrent, opening: opening, onOpen: setOpening, testId: "app-switcher-fleet" }, choice.id)))] }) })] }), _jsx("span", { "aria-hidden": true, className: "text-muted-foreground", children: "/" }), _jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "data-testid": "app-switcher-apps", "aria-label": `App: ${appLabel}. Switch app`, className: triggerClass, children: [_jsx("span", { className: "truncate", children: appLabel }), opening === undefined ? _jsx(ChevronDown, { "aria-hidden": true, className: "size-(--size-icon-sm) shrink-0 text-muted-foreground" }) : _jsx(LoaderCircle, { "aria-hidden": true, className: "size-(--size-icon-sm) shrink-0 animate-spin motion-reduce:animate-none" })] }), _jsx(DropdownMenuContent, { align: "start", className: "w-56", children: _jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuLabel, { children: "Apps" }), apps.map((choice) => (_jsx(MenuChoice, { url: choice.url, name: choice.label, isCurrent: choice.isCurrent, opening: opening, onOpen: setOpening, testId: "app-switcher-app" }, choice.app)))] }) })] })] }));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=app-switcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-switcher.js","sourceRoot":"","sources":["../../src/header/app-switcher.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAChE,O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E,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAC,kBAAkB,IAA7I,MAAM,CAAC,GAAG,CAAsI,CAClK,CAAC,IACgB,GACA,IACT,IACX,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AppsList, FleetId, HeaderApp } from '../index.js';
|
|
2
|
+
/** How the header names each app. */
|
|
3
|
+
export declare const APP_LABELS: Record<HeaderApp, string>;
|
|
4
|
+
/** A fleet the switcher offers, and where choosing it goes. */
|
|
5
|
+
export interface SwitcherFleet {
|
|
6
|
+
id: FleetId;
|
|
7
|
+
name: string;
|
|
8
|
+
url: string;
|
|
9
|
+
isCurrent: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** An app the switcher offers, and where it opens. */
|
|
12
|
+
export interface SwitcherApp {
|
|
13
|
+
app: HeaderApp;
|
|
14
|
+
label: string;
|
|
15
|
+
url: string;
|
|
16
|
+
isCurrent: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AppSwitcherModel {
|
|
19
|
+
fleet: {
|
|
20
|
+
id: FleetId;
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
appLabel: string;
|
|
24
|
+
fleets: SwitcherFleet[];
|
|
25
|
+
apps: SwitcherApp[];
|
|
26
|
+
/** Whether there is anywhere else to go: a second fleet or a second app. */
|
|
27
|
+
canSwitch: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The switcher for the app open in the fleet in view. Choosing another fleet
|
|
31
|
+
* opens the same app there when the account may open it, else the first app
|
|
32
|
+
* it may open there, else Account (H9).
|
|
33
|
+
*/
|
|
34
|
+
export declare function appSwitcherOf(input: {
|
|
35
|
+
list: AppsList | undefined;
|
|
36
|
+
fleet: {
|
|
37
|
+
id: FleetId;
|
|
38
|
+
name: string;
|
|
39
|
+
};
|
|
40
|
+
app: HeaderApp;
|
|
41
|
+
}): AppSwitcherModel;
|
|
42
|
+
/** How someone is signed in here (H10). */
|
|
43
|
+
export type SignedInAs = 'argo' | 'account' | 'viewer';
|
|
44
|
+
/** The avatar menu's line for how someone is signed in here. */
|
|
45
|
+
export declare function signedInAsOf(signedInAs: SignedInAs): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* What the switcher in the title offers (header design H1, H8, H9): the fleets
|
|
3
|
+
* of the account and the apps of the fleet in view, from the list pagasae
|
|
4
|
+
* answers. Without a list (argo's sign-in, the viewer, self-hosted) it offers
|
|
5
|
+
* the fleet in view and the app open alone, and switches nothing. Every app
|
|
6
|
+
* takes the fleet in view from its address, `?fleet=<fleet id>`; Account
|
|
7
|
+
* and Admin stand outside any fleet.
|
|
8
|
+
*/
|
|
9
|
+
/** How the header names each app. */
|
|
10
|
+
export const APP_LABELS = { console: 'Console', gateway: 'Gateway', account: 'Account', admin: 'Admin' };
|
|
11
|
+
/** Where an app of a fleet opens for that fleet. */
|
|
12
|
+
function inFleet(url, fleetId) {
|
|
13
|
+
const address = new URL(url);
|
|
14
|
+
address.searchParams.set('fleet', fleetId);
|
|
15
|
+
return address.toString();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The switcher for the app open in the fleet in view. Choosing another fleet
|
|
19
|
+
* opens the same app there when the account may open it, else the first app
|
|
20
|
+
* it may open there, else Account (H9).
|
|
21
|
+
*/
|
|
22
|
+
export function appSwitcherOf(input) {
|
|
23
|
+
const { list, fleet, app } = input;
|
|
24
|
+
const appLabel = APP_LABELS[app];
|
|
25
|
+
if (list === undefined) {
|
|
26
|
+
return { fleet, appLabel, fleets: [{ ...fleet, url: '', isCurrent: true }], apps: [{ app, label: appLabel, url: '', isCurrent: true }], canSwitch: false };
|
|
27
|
+
}
|
|
28
|
+
const accountUrl = list.apps.find((link) => link.app === 'account')?.url;
|
|
29
|
+
// A fleet with no app to open and no Account to go to instead has nowhere to link: it is left out, never a link to nowhere.
|
|
30
|
+
const fleets = list.fleets.flatMap((listed) => {
|
|
31
|
+
const opened = listed.apps.find((link) => link.app === app) ?? listed.apps[0];
|
|
32
|
+
const url = opened === undefined ? accountUrl : inFleet(opened.url, listed.id);
|
|
33
|
+
return url === undefined ? [] : [{ id: listed.id, name: listed.name, url, isCurrent: listed.id === fleet.id }];
|
|
34
|
+
});
|
|
35
|
+
const inView = (list.fleets.find((listed) => listed.id === fleet.id)?.apps ?? []).map((link) => ({ ...link, url: inFleet(link.url, fleet.id) }));
|
|
36
|
+
const apps = [...inView, ...list.apps].map((link) => ({ app: link.app, label: APP_LABELS[link.app], url: link.url, isCurrent: link.app === app }));
|
|
37
|
+
return { fleet, appLabel, fleets, apps, canSwitch: fleets.length > 1 || apps.length > 1 };
|
|
38
|
+
}
|
|
39
|
+
const SIGNED_IN_AS_LABELS = { argo: 'Signed in as argo', account: 'Signed in as your account', viewer: 'Viewer' };
|
|
40
|
+
/** The avatar menu's line for how someone is signed in here. */
|
|
41
|
+
export function signedInAsOf(signedInAs) {
|
|
42
|
+
return SIGNED_IN_AS_LABELS[signedInAs];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=apps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/header/apps.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,qCAAqC;AACrC,MAAM,CAAC,MAAM,UAAU,GAA8B,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAEpI,oDAAoD;AACpD,SAAS,OAAO,CAAC,GAAW,EAAE,OAAgB;IAC5C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IA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mB,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
/**
|
|
3
|
+
* shadcn Avatar on Base UI, used as a mark (docs/design/png/Avatar.png): the
|
|
4
|
+
* app, the operator's account, a ship (two mono letters from its name), argo
|
|
5
|
+
* (the operator mark) and a retired ship (dashed frame). Decorative: the name
|
|
6
|
+
* is always written next to it, so it is hidden from assistive technology.
|
|
7
|
+
*/
|
|
8
|
+
declare const avatarVariants: (props?: ({
|
|
9
|
+
kind?: "app" | "retired" | "ship" | "argo" | "account" | null | undefined;
|
|
10
|
+
size?: 20 | 28 | 36 | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
export declare function Avatar({ kind, size, name, className, }: VariantProps<typeof avatarVariants> & {
|
|
13
|
+
name?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { Ship, UserRound } from 'lucide-react';
|
|
6
|
+
import { classNames } from '../class-names.js';
|
|
7
|
+
/**
|
|
8
|
+
* shadcn Avatar on Base UI, used as a mark (docs/design/png/Avatar.png): the
|
|
9
|
+
* app, the operator's account, a ship (two mono letters from its name), argo
|
|
10
|
+
* (the operator mark) and a retired ship (dashed frame). Decorative: the name
|
|
11
|
+
* is always written next to it, so it is hidden from assistive technology.
|
|
12
|
+
*/
|
|
13
|
+
const avatarVariants = cva('inline-flex shrink-0 items-center justify-center overflow-hidden font-semibold uppercase select-none', {
|
|
14
|
+
variants: {
|
|
15
|
+
kind: {
|
|
16
|
+
app: 'rounded-sm bg-primary text-primary-foreground',
|
|
17
|
+
account: 'rounded-full bg-secondary font-sans text-foreground',
|
|
18
|
+
ship: 'rounded-sm bg-secondary font-mono text-foreground',
|
|
19
|
+
argo: 'rounded-sm bg-highlight text-primary',
|
|
20
|
+
retired: 'rounded-sm border border-dashed border-input font-mono font-medium text-muted-foreground',
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
20: 'size-5 text-micro [&_svg]:size-3',
|
|
24
|
+
28: 'size-7 text-micro [&_svg]:size-(--size-icon-sm)',
|
|
25
|
+
36: 'size-9 text-caption [&_svg]:size-(--size-icon)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: { kind: 'ship', size: 28 },
|
|
29
|
+
});
|
|
30
|
+
const LETTERS = 2;
|
|
31
|
+
function markOf(kind, name) {
|
|
32
|
+
if (kind === 'app') {
|
|
33
|
+
return _jsx(Ship, { "aria-hidden": true });
|
|
34
|
+
}
|
|
35
|
+
if (kind === 'argo') {
|
|
36
|
+
return _jsx(UserRound, { "aria-hidden": true });
|
|
37
|
+
}
|
|
38
|
+
return name.replaceAll('-', '').slice(0, LETTERS);
|
|
39
|
+
}
|
|
40
|
+
export function Avatar({ kind = 'ship', size, name = '', className, }) {
|
|
41
|
+
const resolvedKind = kind ?? 'ship';
|
|
42
|
+
return (_jsx(AvatarPrimitive.Root, { "aria-hidden": true, "data-slot": "avatar", className: classNames(avatarVariants({ kind, size }), className), children: _jsx(AvatarPrimitive.Fallback, { children: markOf(resolvedKind, name) }) }));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/header/atoms/avatar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AA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AC,YAEhE,KAAC,eAAe,CAAC,QAAQ,cAAE,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,GAA4B,GAC5D,CACxB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* shadcn Button on Base UI, themed to docs/design/png/Button.png: primary
|
|
6
|
+
* (shadcn default), secondary (shadcn outline), ghost and destructive, in four
|
|
7
|
+
* sizes. Icons sit spacing-2 from the label.
|
|
8
|
+
*/
|
|
9
|
+
declare const buttonVariants: (props?: ({
|
|
10
|
+
variant?: "primary" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
11
|
+
size?: "touch" | "xs" | "sm" | "md" | null | undefined;
|
|
12
|
+
isIconOnly?: boolean | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
type ButtonProps = ButtonPrimitive.Props & VariantProps<typeof buttonVariants> & {
|
|
15
|
+
/** A Lucide icon before the label. */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
/** Keeps the label, puts a spinner in place of the icon and blocks input, without dimming. */
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/** A link styled as a button: pass `render={<a href="..." />}` and `nativeButton={false}` (Base UI's asChild). */
|
|
21
|
+
export declare function Button({ className, variant, size, isIconOnly, icon, isLoading, disabled, children, ...props }: ButtonProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { LoaderCircle } from 'lucide-react';
|
|
5
|
+
import { classNames } from '../class-names.js';
|
|
6
|
+
/**
|
|
7
|
+
* shadcn Button on Base UI, themed to docs/design/png/Button.png: primary
|
|
8
|
+
* (shadcn default), secondary (shadcn outline), ghost and destructive, in four
|
|
9
|
+
* sizes. Icons sit spacing-2 from the label.
|
|
10
|
+
*/
|
|
11
|
+
const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 rounded-md border border-transparent font-medium whitespace-nowrap transition-[background-color,border-color,opacity] duration-(--duration-fast) select-none data-disabled:pointer-events-none data-disabled:not-data-loading:opacity-45 data-loading:cursor-progress [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--size-icon)", {
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
primary: 'bg-primary text-primary-foreground hover:bg-primary-hover',
|
|
15
|
+
secondary: 'border-input bg-card text-foreground shadow-sm hover:bg-accent aria-expanded:bg-accent',
|
|
16
|
+
ghost: 'bg-transparent text-foreground hover:bg-accent aria-expanded:bg-accent',
|
|
17
|
+
destructive: 'bg-destructive text-destructive-foreground hover:opacity-90',
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
xs: 'h-(--size-control-xs) gap-1.5 px-2.5 text-meta',
|
|
21
|
+
sm: 'h-(--size-control-sm) px-3 text-meta',
|
|
22
|
+
md: 'h-(--size-control) px-3.5 text-body',
|
|
23
|
+
touch: 'h-(--size-control-touch) rounded-lg px-4 text-body-touch',
|
|
24
|
+
},
|
|
25
|
+
isIconOnly: {
|
|
26
|
+
true: 'px-0',
|
|
27
|
+
false: '',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
compoundVariants: [
|
|
31
|
+
{ isIconOnly: true, size: 'xs', className: 'w-(--size-control-xs)' },
|
|
32
|
+
{ isIconOnly: true, size: 'sm', className: 'w-(--size-control-sm)' },
|
|
33
|
+
{ isIconOnly: true, size: 'md', className: 'w-(--size-control)' },
|
|
34
|
+
{ isIconOnly: true, size: 'touch', className: 'w-(--size-control-touch)' },
|
|
35
|
+
],
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: 'secondary',
|
|
38
|
+
size: 'md',
|
|
39
|
+
isIconOnly: false,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
/** A link styled as a button: pass `render={<a href="..." />}` and `nativeButton={false}` (Base UI's asChild). */
|
|
43
|
+
export function Button({ className, variant, size, isIconOnly, icon, isLoading = false, disabled, children, ...props }) {
|
|
44
|
+
return (_jsxs(ButtonPrimitive, { "data-slot": "button", "data-loading": isLoading ? '' : undefined, "aria-busy": isLoading || undefined, disabled: disabled === true || isLoading,
|
|
45
|
+
// A busy button keeps its focus, so a keyboard user does not lose their place.
|
|
46
|
+
focusableWhenDisabled: isLoading, className: classNames(buttonVariants({ variant, size, isIconOnly }), className), ...props, children: [isLoading ? _jsx(LoaderCircle, { "aria-hidden": true, className: "animate-spin motion-reduce:animate-none" }) : icon, children] }));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/header/atoms/button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,cAAc,GAAG,GAAG,CACxB,4ZAA4Z,EAC5Z;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,2DAA2D;YACpE,SAAS,EAAE,wFAAwF;YACnG,KAAK,EAAE,wEAAwE;YAC/E,WAAW,EAAE,6DAA6D;SAC3E;QACD,IAAI,EAAE;YACJ,EAAE,EAAE,gDAAgD;YACpD,EAAE,EAAE,sCAAsC;Y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G,QAAQ,IACO,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What Dialog and AlertDialog share (docs/design/png/Dialog.png): the --overlay
|
|
3
|
+
* scrim, a centred popup 512 or 560 px wide with 24 px padding and
|
|
4
|
+
* --radius-xl, and the header and footer layout. A popup taller than the
|
|
5
|
+
* window scrolls inside it, so its buttons stay in reach. Under reduced motion
|
|
6
|
+
* nothing zooms; it only fades.
|
|
7
|
+
*/
|
|
8
|
+
export declare const dialogSurface: {
|
|
9
|
+
overlay: string;
|
|
10
|
+
popup: (props?: ({
|
|
11
|
+
size?: "sm" | "md" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
header: string;
|
|
14
|
+
footer: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
phoneSheet: string;
|
|
18
|
+
phoneFullScreen: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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, };
|