@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
|
@@ -9,7 +9,7 @@ import { z } from 'zod';
|
|
|
9
9
|
* deadline and whether it is repeatable (interop 3.4, 5.2, 5.3). Core checks
|
|
10
10
|
* the shape and acts on none of it.
|
|
11
11
|
*/
|
|
12
|
-
/** The most a statement holds:
|
|
12
|
+
/** The most a statement holds: 256 KB as the UTF-8 bytes of its JSON, as a payload does (decision 0006). */
|
|
13
13
|
export declare const STATEMENT_MAX_BYTES: number;
|
|
14
14
|
/** The longest a statement's summary may be. */
|
|
15
15
|
export declare const STATEMENT_SUMMARY_MAX_LENGTH = 1000;
|
|
@@ -41,7 +41,7 @@ export declare const capabilitySchema: z.ZodObject<{
|
|
|
41
41
|
export type Capability = z.infer<typeof capabilitySchema>;
|
|
42
42
|
/** The size of a statement: the UTF-8 bytes of its JSON. */
|
|
43
43
|
export declare function statementBytes(statement: unknown): number;
|
|
44
|
-
/** A statement: a summary and capabilities, each name once, at most
|
|
44
|
+
/** A statement: a summary and capabilities, each name once, at most 256 KB. */
|
|
45
45
|
export declare const statementSchema: z.ZodObject<{
|
|
46
46
|
summary: z.ZodString;
|
|
47
47
|
capabilities: z.ZodArray<z.ZodObject<{
|
|
@@ -13,8 +13,8 @@ import { discoveredVerifiedFactSchema } from './verified-fact.js';
|
|
|
13
13
|
* deadline and whether it is repeatable (interop 3.4, 5.2, 5.3). Core checks
|
|
14
14
|
* the shape and acts on none of it.
|
|
15
15
|
*/
|
|
16
|
-
/** The most a statement holds:
|
|
17
|
-
export const STATEMENT_MAX_BYTES =
|
|
16
|
+
/** The most a statement holds: 256 KB as the UTF-8 bytes of its JSON, as a payload does (decision 0006). */
|
|
17
|
+
export const STATEMENT_MAX_BYTES = 256 * 1024;
|
|
18
18
|
/** The longest a statement's summary may be. */
|
|
19
19
|
export const STATEMENT_SUMMARY_MAX_LENGTH = 1000;
|
|
20
20
|
/** A capability's name as MCP names a tool: 1 to 128 letters, digits, `_`, `-` or `.`. */
|
|
@@ -67,8 +67,8 @@ const utf8 = new TextEncoder();
|
|
|
67
67
|
export function statementBytes(statement) {
|
|
68
68
|
return utf8.encode(JSON.stringify(statement)).byteLength;
|
|
69
69
|
}
|
|
70
|
-
const STATEMENT_SIZE_MESSAGE = `A statement is at most ${String(STATEMENT_MAX_BYTES)} bytes (
|
|
71
|
-
/** A statement: a summary and capabilities, each name once, at most
|
|
70
|
+
const STATEMENT_SIZE_MESSAGE = `A statement is at most ${String(STATEMENT_MAX_BYTES)} bytes (256 KB) as JSON in UTF-8`;
|
|
71
|
+
/** A statement: a summary and capabilities, each name once, at most 256 KB. */
|
|
72
72
|
export const statementSchema = z
|
|
73
73
|
.strictObject({
|
|
74
74
|
summary: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statement.js","sourceRoot":"","sources":["../../src/schemas/statement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAElE;;;;;;;;;GASG;AAEH,
|
|
1
|
+
{"version":3,"file":"statement.js","sourceRoot":"","sources":["../../src/schemas/statement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAElE;;;;;;;;;GASG;AAEH,4GAA4G;AAC5G,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,GAAG,IAAI,CAAC;AAE9C,gDAAgD;AAChD,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD,0F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AM,EAAE,EAAE,CAAC;CAC5D,CAAC;KACD,QAAQ,EAAE,CAAC;AAId;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,KAAK,CACZ,CAAC,CAAC,MAAM,CAAC;QACP,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,gBAAgB;QACxB,SAAS,EAAE,yBAAyB;QACpC,+FAA+F;QAC/F,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC;KAChD,CAAC,CACH;IACD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CAC1E,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Steps (docs/design/bridge, CC14): a ship asks a person for what only a
|
|
4
|
+
* human can do (create a repository, sign in to an outside server) by sending
|
|
5
|
+
* the person's ship a message of the step content type; the person answers
|
|
6
|
+
* with a reply of the step outcome content type. Both payloads are data only:
|
|
7
|
+
* the fleet carries them as any message. The asking ship withdraws a step, or
|
|
8
|
+
* replaces it with a new one, by a message of its own content type naming the
|
|
9
|
+
* step's uuid, as for a question (decision 0038).
|
|
10
|
+
*/
|
|
11
|
+
export declare const STEP_CONTENT_TYPE = "application/vnd.aeolus.step+json";
|
|
12
|
+
export declare const STEP_OUTCOME_CONTENT_TYPE = "application/vnd.aeolus.step-outcome+json";
|
|
13
|
+
export declare const STEP_WITHDRAWAL_CONTENT_TYPE = "application/vnd.aeolus.step-withdrawal+json";
|
|
14
|
+
export declare const STEP_REPLACEMENT_CONTENT_TYPE = "application/vnd.aeolus.step-replacement+json";
|
|
15
|
+
export declare function isStepContentType(contentType: string): boolean;
|
|
16
|
+
export declare function isStepOutcomeContentType(contentType: string): boolean;
|
|
17
|
+
export declare function isStepWithdrawalContentType(contentType: string): boolean;
|
|
18
|
+
export declare function isStepReplacementContentType(contentType: string): boolean;
|
|
19
|
+
/** A step: its own uuid, a title, why it is needed, and the link where it is done, when there is one (an http(s) URL). */
|
|
20
|
+
export declare const stepSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodUUID;
|
|
22
|
+
title: z.ZodString;
|
|
23
|
+
why: z.ZodString;
|
|
24
|
+
link: z.ZodOptional<z.ZodURL>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type Step = z.infer<typeof stepSchema>;
|
|
27
|
+
/** A withdrawal: the uuid of the step the asker withdraws. */
|
|
28
|
+
export declare const stepWithdrawalSchema: z.ZodObject<{
|
|
29
|
+
stepId: z.ZodUUID;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
/** A replacement: the uuid of the step the asker replaces, and the new step, with a uuid of its own. */
|
|
32
|
+
export declare const stepReplacementSchema: z.ZodObject<{
|
|
33
|
+
stepId: z.ZodUUID;
|
|
34
|
+
step: z.ZodObject<{
|
|
35
|
+
id: z.ZodUUID;
|
|
36
|
+
title: z.ZodString;
|
|
37
|
+
why: z.ZodString;
|
|
38
|
+
link: z.ZodOptional<z.ZodURL>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
/** How a step ended: the person did it, or cannot. */
|
|
42
|
+
export declare const STEP_OUTCOMES: readonly ["done", "cannot"];
|
|
43
|
+
export declare const stepOutcomeKindSchema: z.ZodEnum<{
|
|
44
|
+
done: "done";
|
|
45
|
+
cannot: "cannot";
|
|
46
|
+
}>;
|
|
47
|
+
export type StepOutcomeKind = z.infer<typeof stepOutcomeKindSchema>;
|
|
48
|
+
/** A step outcome: the step's uuid, done or cannot, and an optional note for either. */
|
|
49
|
+
export declare const stepOutcomeSchema: z.ZodObject<{
|
|
50
|
+
stepId: z.ZodUUID;
|
|
51
|
+
outcome: z.ZodEnum<{
|
|
52
|
+
done: "done";
|
|
53
|
+
cannot: "cannot";
|
|
54
|
+
}>;
|
|
55
|
+
note: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type StepOutcome = z.infer<typeof stepOutcomeSchema>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { essenceOf } from './content-type.js';
|
|
3
|
+
/**
|
|
4
|
+
* Steps (docs/design/bridge, CC14): a ship asks a person for what only a
|
|
5
|
+
* human can do (create a repository, sign in to an outside server) by sending
|
|
6
|
+
* the person's ship a message of the step content type; the person answers
|
|
7
|
+
* with a reply of the step outcome content type. Both payloads are data only:
|
|
8
|
+
* the fleet carries them as any message. The asking ship withdraws a step, or
|
|
9
|
+
* replaces it with a new one, by a message of its own content type naming the
|
|
10
|
+
* step's uuid, as for a question (decision 0038).
|
|
11
|
+
*/
|
|
12
|
+
export const STEP_CONTENT_TYPE = 'application/vnd.aeolus.step+json';
|
|
13
|
+
export const STEP_OUTCOME_CONTENT_TYPE = 'application/vnd.aeolus.step-outcome+json';
|
|
14
|
+
export const STEP_WITHDRAWAL_CONTENT_TYPE = 'application/vnd.aeolus.step-withdrawal+json';
|
|
15
|
+
export const STEP_REPLACEMENT_CONTENT_TYPE = 'application/vnd.aeolus.step-replacement+json';
|
|
16
|
+
export function isStepContentType(contentType) {
|
|
17
|
+
return essenceOf(contentType) === STEP_CONTENT_TYPE;
|
|
18
|
+
}
|
|
19
|
+
export function isStepOutcomeContentType(contentType) {
|
|
20
|
+
return essenceOf(contentType) === STEP_OUTCOME_CONTENT_TYPE;
|
|
21
|
+
}
|
|
22
|
+
export function isStepWithdrawalContentType(contentType) {
|
|
23
|
+
return essenceOf(contentType) === STEP_WITHDRAWAL_CONTENT_TYPE;
|
|
24
|
+
}
|
|
25
|
+
export function isStepReplacementContentType(contentType) {
|
|
26
|
+
return essenceOf(contentType) === STEP_REPLACEMENT_CONTENT_TYPE;
|
|
27
|
+
}
|
|
28
|
+
const textSchema = z.string().min(1);
|
|
29
|
+
/** A step: its own uuid, a title, why it is needed, and the link where it is done, when there is one (an http(s) URL). */
|
|
30
|
+
export const stepSchema = z.object({
|
|
31
|
+
id: z.uuid(),
|
|
32
|
+
title: textSchema,
|
|
33
|
+
why: z.string(),
|
|
34
|
+
link: z.url({ protocol: /^https?$/ }).optional(),
|
|
35
|
+
});
|
|
36
|
+
/** A withdrawal: the uuid of the step the asker withdraws. */
|
|
37
|
+
export const stepWithdrawalSchema = z.object({ stepId: z.uuid() });
|
|
38
|
+
/** A replacement: the uuid of the step the asker replaces, and the new step, with a uuid of its own. */
|
|
39
|
+
export const stepReplacementSchema = z
|
|
40
|
+
.object({ stepId: z.uuid(), step: stepSchema })
|
|
41
|
+
.refine(({ stepId, step }) => step.id !== stepId, {
|
|
42
|
+
message: 'The new step has a uuid of its own',
|
|
43
|
+
path: ['step', 'id'],
|
|
44
|
+
});
|
|
45
|
+
/** How a step ended: the person did it, or cannot. */
|
|
46
|
+
export const STEP_OUTCOMES = ['done', 'cannot'];
|
|
47
|
+
export const stepOutcomeKindSchema = z.enum(STEP_OUTCOMES);
|
|
48
|
+
/** A step outcome: the step's uuid, done or cannot, and an optional note for either. */
|
|
49
|
+
export const stepOutcomeSchema = z.object({
|
|
50
|
+
stepId: z.uuid(),
|
|
51
|
+
outcome: stepOutcomeKindSchema,
|
|
52
|
+
note: textSchema.optional(),
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=step.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.js","sourceRoot":"","sources":["../../src/schemas/step.ts"],"names":[],"mappings":"AAAA,OAAO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AE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAEnE,wGAAwG;AACxG,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;KAC9C,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,EAAE;IAChD,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC;CACrB,CAAC,CAAC;AAEL,sDAAsD;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAG3D,wFAAwF;AACxF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE;IAChB,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeolus-fleet/common",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Shared schemas and ids for Aeolus packages
|
|
3
|
+
"version": "0.36.0",
|
|
4
|
+
"description": "Shared schemas and ids for Aeolus packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aeolus"
|
|
7
7
|
],
|
|
@@ -24,58 +24,18 @@
|
|
|
24
24
|
"./rules": {
|
|
25
25
|
"types": "./dist/rules/index.d.ts",
|
|
26
26
|
"default": "./dist/rules/index.js"
|
|
27
|
-
}
|
|
28
|
-
"./header": {
|
|
29
|
-
"types": "./dist/header/index.d.ts",
|
|
30
|
-
"default": "./dist/header/index.js"
|
|
31
|
-
},
|
|
32
|
-
"./header/tokens.css": "./dist/header/tokens.css"
|
|
27
|
+
}
|
|
33
28
|
},
|
|
34
29
|
"files": [
|
|
35
30
|
"dist"
|
|
36
31
|
],
|
|
37
32
|
"scripts": {
|
|
38
|
-
"build": "tsc --project tsconfig.build.json
|
|
33
|
+
"build": "tsc --project tsconfig.build.json",
|
|
39
34
|
"typecheck": "tsc --project tsconfig.json",
|
|
40
35
|
"prepack": "cp ../../LICENSE LICENSE",
|
|
41
36
|
"postpack": "rm LICENSE"
|
|
42
37
|
},
|
|
43
38
|
"dependencies": {
|
|
44
39
|
"zod": "^4.6.5"
|
|
45
|
-
},
|
|
46
|
-
"peerDependencies": {
|
|
47
|
-
"@base-ui/react": "^1.8.0",
|
|
48
|
-
"class-variance-authority": "^0.7.1",
|
|
49
|
-
"clsx": "^2.1.1",
|
|
50
|
-
"lucide-react": "^1.51.0",
|
|
51
|
-
"react": "^19.3.0",
|
|
52
|
-
"react-dom": "^19.3.0",
|
|
53
|
-
"tailwind-merge": "^3.7.0"
|
|
54
|
-
},
|
|
55
|
-
"peerDependenciesMeta": {
|
|
56
|
-
"@base-ui/react": {
|
|
57
|
-
"optional": true
|
|
58
|
-
},
|
|
59
|
-
"class-variance-authority": {
|
|
60
|
-
"optional": true
|
|
61
|
-
},
|
|
62
|
-
"clsx": {
|
|
63
|
-
"optional": true
|
|
64
|
-
},
|
|
65
|
-
"lucide-react": {
|
|
66
|
-
"optional": true
|
|
67
|
-
},
|
|
68
|
-
"react": {
|
|
69
|
-
"optional": true
|
|
70
|
-
},
|
|
71
|
-
"react-dom": {
|
|
72
|
-
"optional": true
|
|
73
|
-
},
|
|
74
|
-
"tailwind-merge": {
|
|
75
|
-
"optional": true
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
"devDependencies": {
|
|
79
|
-
"@storybook/nextjs-vite": "^10.6.1"
|
|
80
40
|
}
|
|
81
41
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,20 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC1J,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAmB9C,MAAM,YAAY,GAChB,gRAAgR,CAAC;AAEnR,6EAA6E;AAC7E,SAAS,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,EAA8C;IAChF,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,KAAC,YAAY,yBAAa,SAAS,EAAC,iDAAiD,GAAG,CAAC;IAClG,CAAC;IACD,OAAO,SAAS,CAAC,CAAC,CAAC,KAAC,KAAK,yBAAa,SAAS,EAAC,SAAS,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACtE,CAAC;AAED,yFAAyF;AACzF,SAAS,UAAU,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAuI;IACxM,MAAM,SAAS,GAAG,OAAO,EAAE,GAAG,KAAK,GAAG,IAAI,OAAO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.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 {};
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;AAClE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,cAAc,GAAG,GAAG,CACxB,sGAAsG,E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itive } 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 {};
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;YAC1C,EAAE,EAAE,qCAAqC;YACzC,KAAK,EAAE,0DAA0D;SAClE;QACD,UAAU,EAAE;YACV,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,EAAE;SACV;KACF;IACD,gBAAgB,EAAE;QAChB,EAAE,UAAU,EA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ide 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
|
-
};
|