@flyingrobots/bijou 0.10.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/test/assertions.d.ts +51 -0
- package/dist/adapters/test/assertions.d.ts.map +1 -0
- package/dist/adapters/test/assertions.js +67 -0
- package/dist/adapters/test/assertions.js.map +1 -0
- package/dist/adapters/test/audit-style.d.ts +28 -7
- package/dist/adapters/test/audit-style.d.ts.map +1 -1
- package/dist/adapters/test/audit-style.js +61 -4
- package/dist/adapters/test/audit-style.js.map +1 -1
- package/dist/adapters/test/index.d.ts +36 -1
- package/dist/adapters/test/index.d.ts.map +1 -1
- package/dist/adapters/test/index.js +12 -1
- package/dist/adapters/test/index.js.map +1 -1
- package/dist/adapters/test/io.d.ts +27 -0
- package/dist/adapters/test/io.d.ts.map +1 -1
- package/dist/adapters/test/io.js +56 -0
- package/dist/adapters/test/io.js.map +1 -1
- package/dist/adapters/test/runtime.d.ts +17 -0
- package/dist/adapters/test/runtime.d.ts.map +1 -1
- package/dist/adapters/test/runtime.js +14 -0
- package/dist/adapters/test/runtime.js.map +1 -1
- package/dist/adapters/test/style.d.ts +9 -0
- package/dist/adapters/test/style.d.ts.map +1 -1
- package/dist/adapters/test/style.js +54 -0
- package/dist/adapters/test/style.js.map +1 -1
- package/dist/context.d.ts +21 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +21 -0
- package/dist/context.js.map +1 -1
- package/dist/core/bg-fill.d.ts +32 -0
- package/dist/core/bg-fill.d.ts.map +1 -0
- package/dist/core/bg-fill.js +42 -0
- package/dist/core/bg-fill.js.map +1 -0
- package/dist/core/components/accordion.d.ts +20 -0
- package/dist/core/components/accordion.d.ts.map +1 -1
- package/dist/core/components/accordion.js +13 -6
- package/dist/core/components/accordion.js.map +1 -1
- package/dist/core/components/alert.d.ts +16 -0
- package/dist/core/components/alert.d.ts.map +1 -1
- package/dist/core/components/alert.js +17 -6
- package/dist/core/components/alert.js.map +1 -1
- package/dist/core/components/badge.d.ts +18 -0
- package/dist/core/components/badge.d.ts.map +1 -1
- package/dist/core/components/badge.js +15 -11
- package/dist/core/components/badge.js.map +1 -1
- package/dist/core/components/box.d.ts +31 -0
- package/dist/core/components/box.d.ts.map +1 -1
- package/dist/core/components/box.js +45 -10
- package/dist/core/components/box.js.map +1 -1
- package/dist/core/components/breadcrumb.d.ts +15 -0
- package/dist/core/components/breadcrumb.d.ts.map +1 -1
- package/dist/core/components/breadcrumb.js +13 -6
- package/dist/core/components/breadcrumb.js.map +1 -1
- package/dist/core/components/dag-source.d.ts +52 -9
- package/dist/core/components/dag-source.d.ts.map +1 -1
- package/dist/core/components/dag-source.js +53 -9
- package/dist/core/components/dag-source.js.map +1 -1
- package/dist/core/components/dag-stats.d.ts +2 -0
- package/dist/core/components/dag-stats.d.ts.map +1 -1
- package/dist/core/components/dag-stats.js.map +1 -1
- package/dist/core/components/dag.d.ts +88 -1
- package/dist/core/components/dag.d.ts.map +1 -1
- package/dist/core/components/dag.js +127 -6
- package/dist/core/components/dag.js.map +1 -1
- package/dist/core/components/enumerated-list.d.ts +30 -0
- package/dist/core/components/enumerated-list.d.ts.map +1 -1
- package/dist/core/components/enumerated-list.js +50 -11
- package/dist/core/components/enumerated-list.js.map +1 -1
- package/dist/core/components/hyperlink.d.ts +16 -0
- package/dist/core/components/hyperlink.d.ts.map +1 -1
- package/dist/core/components/hyperlink.js +22 -11
- package/dist/core/components/hyperlink.js.map +1 -1
- package/dist/core/components/index.d.ts +7 -0
- package/dist/core/components/index.d.ts.map +1 -1
- package/dist/core/components/index.js +7 -0
- package/dist/core/components/index.js.map +1 -1
- package/dist/core/components/kbd.d.ts +14 -0
- package/dist/core/components/kbd.d.ts.map +1 -1
- package/dist/core/components/kbd.js +13 -6
- package/dist/core/components/kbd.js.map +1 -1
- package/dist/core/components/log.d.ts +20 -0
- package/dist/core/components/log.d.ts.map +1 -1
- package/dist/core/components/log.js +24 -11
- package/dist/core/components/log.js.map +1 -1
- package/dist/core/components/logo.d.ts +32 -0
- package/dist/core/components/logo.d.ts.map +1 -1
- package/dist/core/components/logo.js +38 -0
- package/dist/core/components/logo.js.map +1 -1
- package/dist/core/components/markdown.d.ts +7 -1
- package/dist/core/components/markdown.d.ts.map +1 -1
- package/dist/core/components/markdown.js +76 -0
- package/dist/core/components/markdown.js.map +1 -1
- package/dist/core/components/paginator.d.ts +16 -0
- package/dist/core/components/paginator.d.ts.map +1 -1
- package/dist/core/components/paginator.js +12 -6
- package/dist/core/components/paginator.js.map +1 -1
- package/dist/core/components/progress.d.ts +55 -0
- package/dist/core/components/progress.d.ts.map +1 -1
- package/dist/core/components/progress.js +37 -6
- package/dist/core/components/progress.js.map +1 -1
- package/dist/core/components/separator.d.ts +16 -0
- package/dist/core/components/separator.d.ts.map +1 -1
- package/dist/core/components/separator.js +12 -6
- package/dist/core/components/separator.js.map +1 -1
- package/dist/core/components/skeleton.d.ts +15 -0
- package/dist/core/components/skeleton.d.ts.map +1 -1
- package/dist/core/components/skeleton.js +12 -6
- package/dist/core/components/skeleton.js.map +1 -1
- package/dist/core/components/spinner.d.ts +37 -0
- package/dist/core/components/spinner.d.ts.map +1 -1
- package/dist/core/components/spinner.js +26 -6
- package/dist/core/components/spinner.js.map +1 -1
- package/dist/core/components/stepper.d.ts +20 -0
- package/dist/core/components/stepper.d.ts.map +1 -1
- package/dist/core/components/stepper.js +16 -6
- package/dist/core/components/stepper.js.map +1 -1
- package/dist/core/components/table.d.ts +20 -0
- package/dist/core/components/table.d.ts.map +1 -1
- package/dist/core/components/table.js +31 -6
- package/dist/core/components/table.js.map +1 -1
- package/dist/core/components/tabs.d.ts +19 -0
- package/dist/core/components/tabs.d.ts.map +1 -1
- package/dist/core/components/tabs.js +19 -6
- package/dist/core/components/tabs.js.map +1 -1
- package/dist/core/components/timeline.d.ts +19 -0
- package/dist/core/components/timeline.d.ts.map +1 -1
- package/dist/core/components/timeline.js +20 -6
- package/dist/core/components/timeline.js.map +1 -1
- package/dist/core/components/tree.d.ts +19 -0
- package/dist/core/components/tree.d.ts.map +1 -1
- package/dist/core/components/tree.js +49 -11
- package/dist/core/components/tree.js.map +1 -1
- package/dist/core/detect/index.d.ts +8 -2
- package/dist/core/detect/index.d.ts.map +1 -1
- package/dist/core/detect/index.js +7 -1
- package/dist/core/detect/index.js.map +1 -1
- package/dist/core/detect/tty.d.ts +36 -0
- package/dist/core/detect/tty.d.ts.map +1 -1
- package/dist/core/detect/tty.js +34 -0
- package/dist/core/detect/tty.js.map +1 -1
- package/dist/core/forms/confirm.d.ts +14 -0
- package/dist/core/forms/confirm.d.ts.map +1 -1
- package/dist/core/forms/confirm.js +15 -5
- package/dist/core/forms/confirm.js.map +1 -1
- package/dist/core/forms/filter.d.ts +30 -0
- package/dist/core/forms/filter.d.ts.map +1 -1
- package/dist/core/forms/filter.js +67 -49
- package/dist/core/forms/filter.js.map +1 -1
- package/dist/core/forms/form-utils.d.ts +103 -0
- package/dist/core/forms/form-utils.d.ts.map +1 -0
- package/dist/core/forms/form-utils.js +135 -0
- package/dist/core/forms/form-utils.js.map +1 -0
- package/dist/core/forms/group.d.ts +12 -0
- package/dist/core/forms/group.d.ts.map +1 -1
- package/dist/core/forms/group.js +7 -0
- package/dist/core/forms/group.js.map +1 -1
- package/dist/core/forms/index.d.ts +6 -0
- package/dist/core/forms/index.d.ts.map +1 -1
- package/dist/core/forms/index.js +6 -0
- package/dist/core/forms/index.js.map +1 -1
- package/dist/core/forms/input.d.ts +17 -0
- package/dist/core/forms/input.d.ts.map +1 -1
- package/dist/core/forms/input.js +27 -15
- package/dist/core/forms/input.js.map +1 -1
- package/dist/core/forms/multiselect.d.ts +16 -0
- package/dist/core/forms/multiselect.d.ts.map +1 -1
- package/dist/core/forms/multiselect.js +54 -38
- package/dist/core/forms/multiselect.js.map +1 -1
- package/dist/core/forms/select.d.ts +17 -0
- package/dist/core/forms/select.d.ts.map +1 -1
- package/dist/core/forms/select.js +51 -37
- package/dist/core/forms/select.js.map +1 -1
- package/dist/core/forms/textarea.d.ts +19 -0
- package/dist/core/forms/textarea.d.ts.map +1 -1
- package/dist/core/forms/textarea.js +51 -47
- package/dist/core/forms/textarea.js.map +1 -1
- package/dist/core/forms/types.d.ts +41 -2
- package/dist/core/forms/types.d.ts.map +1 -1
- package/dist/core/forms/wizard.d.ts +19 -0
- package/dist/core/forms/wizard.d.ts.map +1 -1
- package/dist/core/forms/wizard.js +4 -0
- package/dist/core/forms/wizard.js.map +1 -1
- package/dist/core/resolve-ctx.d.ts +30 -0
- package/dist/core/resolve-ctx.d.ts.map +1 -0
- package/dist/core/resolve-ctx.js +43 -0
- package/dist/core/resolve-ctx.js.map +1 -0
- package/dist/core/text/clip.d.ts +6 -1
- package/dist/core/text/clip.d.ts.map +1 -1
- package/dist/core/text/clip.js +12 -3
- package/dist/core/text/clip.js.map +1 -1
- package/dist/core/text/grapheme.d.ts +15 -3
- package/dist/core/text/grapheme.d.ts.map +1 -1
- package/dist/core/text/grapheme.js +21 -3
- package/dist/core/text/grapheme.js.map +1 -1
- package/dist/core/text/index.d.ts +7 -0
- package/dist/core/text/index.d.ts.map +1 -1
- package/dist/core/text/index.js +7 -0
- package/dist/core/text/index.js.map +1 -1
- package/dist/core/theme/color.d.ts +47 -8
- package/dist/core/theme/color.d.ts.map +1 -1
- package/dist/core/theme/color.js +77 -8
- package/dist/core/theme/color.js.map +1 -1
- package/dist/core/theme/downsample.d.ts +24 -6
- package/dist/core/theme/downsample.d.ts.map +1 -1
- package/dist/core/theme/downsample.js +41 -10
- package/dist/core/theme/downsample.js.map +1 -1
- package/dist/core/theme/dtcg.d.ts +28 -2
- package/dist/core/theme/dtcg.d.ts.map +1 -1
- package/dist/core/theme/dtcg.js +112 -9
- package/dist/core/theme/dtcg.js.map +1 -1
- package/dist/core/theme/extend.d.ts +14 -0
- package/dist/core/theme/extend.d.ts.map +1 -1
- package/dist/core/theme/extend.js +14 -0
- package/dist/core/theme/extend.js.map +1 -1
- package/dist/core/theme/gradient.d.ts +16 -0
- package/dist/core/theme/gradient.d.ts.map +1 -1
- package/dist/core/theme/gradient.js +13 -0
- package/dist/core/theme/gradient.js.map +1 -1
- package/dist/core/theme/index.d.ts +7 -0
- package/dist/core/theme/index.d.ts.map +1 -1
- package/dist/core/theme/index.js +7 -0
- package/dist/core/theme/index.js.map +1 -1
- package/dist/core/theme/presets.d.ts +6 -1
- package/dist/core/theme/presets.d.ts.map +1 -1
- package/dist/core/theme/presets.js +34 -1
- package/dist/core/theme/presets.js.map +1 -1
- package/dist/core/theme/resolve.d.ts +59 -13
- package/dist/core/theme/resolve.d.ts.map +1 -1
- package/dist/core/theme/resolve.js +36 -9
- package/dist/core/theme/resolve.js.map +1 -1
- package/dist/core/theme/styled.d.ts +12 -0
- package/dist/core/theme/styled.d.ts.map +1 -1
- package/dist/core/theme/styled.js +12 -0
- package/dist/core/theme/styled.js.map +1 -1
- package/dist/core/theme/tokens.d.ts +29 -0
- package/dist/core/theme/tokens.d.ts.map +1 -1
- package/dist/factory.d.ts +18 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +11 -0
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/ports/context.d.ts +11 -0
- package/dist/ports/context.d.ts.map +1 -1
- package/dist/ports/index.d.ts +6 -1
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js +5 -0
- package/dist/ports/index.js.map +1 -1
- package/dist/ports/io.d.ts +66 -2
- package/dist/ports/io.d.ts.map +1 -1
- package/dist/ports/runtime.d.ts +11 -0
- package/dist/ports/runtime.d.ts.map +1 -1
- package/dist/ports/style.d.ts +14 -0
- package/dist/ports/style.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/core/components/table.ts"],"names":[],"mappings":"AAEA,OAAO,E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AAC,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAE1D,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACxC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;QAC7E,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
import type { BijouContext } from '../../ports/context.js';
|
|
2
|
+
/** Represent a single tab in a tab bar. */
|
|
2
3
|
export interface TabItem {
|
|
4
|
+
/** Display text for the tab. */
|
|
3
5
|
label: string;
|
|
6
|
+
/** Optional badge text appended to the label (e.g. a count). */
|
|
4
7
|
badge?: string;
|
|
5
8
|
}
|
|
9
|
+
/** Configuration options for the {@link tabs} component. */
|
|
6
10
|
export interface TabsOptions {
|
|
11
|
+
/** Zero-based index of the currently active tab. */
|
|
7
12
|
active: number;
|
|
13
|
+
/** Custom separator string between tabs. Defaults to `' | '` (pipe) or `' │ '` (rich). */
|
|
8
14
|
separator?: string;
|
|
15
|
+
/** Bijou context for rendering mode and theme resolution. */
|
|
9
16
|
ctx?: BijouContext;
|
|
10
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Render a horizontal tab bar with an active-tab indicator.
|
|
20
|
+
*
|
|
21
|
+
* Adapts output by mode:
|
|
22
|
+
* - `pipe`: labels separated by `|`, active tab wrapped in `[brackets]`.
|
|
23
|
+
* - `accessible`: `Tab N of M: label (active)` format.
|
|
24
|
+
* - `interactive`/`static`: `●` marker with bold primary styling for the active tab.
|
|
25
|
+
*
|
|
26
|
+
* @param items - Array of tab items to render.
|
|
27
|
+
* @param options - Rendering options including active index, separator, and context.
|
|
28
|
+
* @returns The formatted tab bar string.
|
|
29
|
+
*/
|
|
11
30
|
export declare function tabs(items: TabItem[], options: TabsOptions): string;
|
|
12
31
|
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/core/components/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/core/components/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,2CAA2C;AAC3C,MAAM,WAAW,OAAO;IACtB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IAC1B,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;AAYD;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAuCnE"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { resolveCtx } from '../resolve-ctx.js';
|
|
2
|
+
/**
|
|
3
|
+
* Format a tab label, appending the badge in parentheses when present.
|
|
4
|
+
*
|
|
5
|
+
* @param item - The tab item to format.
|
|
6
|
+
* @returns The label string, optionally with a badge suffix.
|
|
7
|
+
*/
|
|
7
8
|
function formatLabel(item) {
|
|
8
9
|
return item.badge ? `${item.label} (${item.badge})` : item.label;
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Render a horizontal tab bar with an active-tab indicator.
|
|
13
|
+
*
|
|
14
|
+
* Adapts output by mode:
|
|
15
|
+
* - `pipe`: labels separated by `|`, active tab wrapped in `[brackets]`.
|
|
16
|
+
* - `accessible`: `Tab N of M: label (active)` format.
|
|
17
|
+
* - `interactive`/`static`: `●` marker with bold primary styling for the active tab.
|
|
18
|
+
*
|
|
19
|
+
* @param items - Array of tab items to render.
|
|
20
|
+
* @param options - Rendering options including active index, separator, and context.
|
|
21
|
+
* @returns The formatted tab bar string.
|
|
22
|
+
*/
|
|
10
23
|
export function tabs(items, options) {
|
|
11
24
|
const ctx = resolveCtx(options.ctx);
|
|
12
25
|
const mode = ctx.mode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../../src/core/components/tabs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../../src/core/components/tabs.ts"],"names":[],"mappings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O,KAAK,KAAK,KAAK,GAAG,GAAG,EAAE,CAAC;QACpD,CAAC,CAAC;aACD,IAAI,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,uBAAuB;IACvB,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC;IACvC,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACf,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;YACjB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;YAC/C,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,MAAe,CAAC,EAAE,CAAC;YAC/F,OAAO,KAAK,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;QACnD,CAAC;QACD,OAAO,KAAK,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;IACxE,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
import type { BijouContext } from '../../ports/context.js';
|
|
2
2
|
import type { TokenValue } from '../theme/tokens.js';
|
|
3
3
|
import type { BaseStatusKey } from '../theme/tokens.js';
|
|
4
|
+
/** Represent a single event on a vertical timeline. */
|
|
4
5
|
export interface TimelineEvent {
|
|
6
|
+
/** Primary label for the event. */
|
|
5
7
|
label: string;
|
|
8
|
+
/** Optional longer description shown after the label. */
|
|
6
9
|
description?: string;
|
|
10
|
+
/** Status key determining the dot style and color. Defaults to `'muted'`. */
|
|
7
11
|
status?: BaseStatusKey;
|
|
8
12
|
}
|
|
13
|
+
/** Configuration options for the {@link timeline} component. */
|
|
9
14
|
export interface TimelineOptions {
|
|
15
|
+
/** Token used to style the vertical connector line between events. */
|
|
10
16
|
lineToken?: TokenValue;
|
|
17
|
+
/** Bijou context for rendering mode and theme resolution. */
|
|
11
18
|
ctx?: BijouContext;
|
|
12
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Render a vertical timeline of events with status-colored dots.
|
|
22
|
+
*
|
|
23
|
+
* Adapts output by mode:
|
|
24
|
+
* - `pipe`: `[STATUS] label - description` lines.
|
|
25
|
+
* - `accessible`: `Status: label. description` lines.
|
|
26
|
+
* - `interactive`/`static`: colored `●`/`○` dots connected by `│` lines.
|
|
27
|
+
*
|
|
28
|
+
* @param events - Array of timeline events to render.
|
|
29
|
+
* @param options - Rendering options including line token and context.
|
|
30
|
+
* @returns The formatted timeline string.
|
|
31
|
+
*/
|
|
13
32
|
export declare function timeline(events: TimelineEvent[], options?: TimelineOptions): string;
|
|
14
33
|
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/core/components/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/core/components/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,6DAA6D;IAC7D,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,OAAO,GAAE,eAAoB,GAAG,MAAM,CAyCvF"}
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
if (ctx)
|
|
4
|
-
return ctx;
|
|
5
|
-
return getDefaultContext();
|
|
6
|
-
}
|
|
1
|
+
import { resolveCtx } from '../resolve-ctx.js';
|
|
2
|
+
/** Set of status keys that render as filled dots (`●`) rather than hollow (`○`). */
|
|
7
3
|
const FILLED_STATUSES = new Set(['success', 'error', 'warning', 'info', 'active']);
|
|
4
|
+
/**
|
|
5
|
+
* Capitalize a status key for accessible/human-readable output.
|
|
6
|
+
*
|
|
7
|
+
* @param status - The status key to capitalize.
|
|
8
|
+
* @returns The status string with the first letter uppercased.
|
|
9
|
+
*/
|
|
8
10
|
function statusLabel(status) {
|
|
9
11
|
return status.charAt(0).toUpperCase() + status.slice(1);
|
|
10
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Render a vertical timeline of events with status-colored dots.
|
|
15
|
+
*
|
|
16
|
+
* Adapts output by mode:
|
|
17
|
+
* - `pipe`: `[STATUS] label - description` lines.
|
|
18
|
+
* - `accessible`: `Status: label. description` lines.
|
|
19
|
+
* - `interactive`/`static`: colored `●`/`○` dots connected by `│` lines.
|
|
20
|
+
*
|
|
21
|
+
* @param events - Array of timeline events to render.
|
|
22
|
+
* @param options - Rendering options including line token and context.
|
|
23
|
+
* @returns The formatted timeline string.
|
|
24
|
+
*/
|
|
11
25
|
export function timeline(events, options = {}) {
|
|
12
26
|
const ctx = resolveCtx(options.ctx);
|
|
13
27
|
const mode = ctx.mode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../../src/core/components/timeline.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../../src/core/components/timeline.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAoB/C,oFAAoF;AACpF,MAAM,eAAe,GAAgB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEhG;;;;;GAKG;AACH,SAAS,WAAW,CAAC,MAAqB;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAuB,EAAE,UAA2B,EAAE;IAC7E,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IAEtB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,MA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,CAAC;QACxD,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEnD,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;QAE3C,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
import type { BijouContext } from '../../ports/context.js';
|
|
2
2
|
import type { TokenValue } from '../theme/tokens.js';
|
|
3
|
+
/** Represent a single node in a tree hierarchy. */
|
|
3
4
|
export interface TreeNode {
|
|
5
|
+
/** Display text for this node. */
|
|
4
6
|
label: string;
|
|
7
|
+
/** Optional child nodes nested beneath this node. */
|
|
5
8
|
children?: TreeNode[];
|
|
6
9
|
}
|
|
10
|
+
/** Configuration options for the {@link tree} component. */
|
|
7
11
|
export interface TreeOptions {
|
|
12
|
+
/** Token used to style the tree guide lines and connectors. */
|
|
8
13
|
guideToken?: TokenValue;
|
|
14
|
+
/** Token used to style node labels. */
|
|
9
15
|
labelToken?: TokenValue;
|
|
16
|
+
/** Bijou context for rendering mode and theme resolution. */
|
|
10
17
|
ctx?: BijouContext;
|
|
11
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Render a tree hierarchy with Unicode box-drawing connectors.
|
|
21
|
+
*
|
|
22
|
+
* Adapts output by mode:
|
|
23
|
+
* - `pipe`: indented plain-text tree.
|
|
24
|
+
* - `accessible`: indented tree with child-count annotations.
|
|
25
|
+
* - `interactive`/`static`: styled Unicode connectors with themed guide lines.
|
|
26
|
+
*
|
|
27
|
+
* @param nodes - Top-level tree nodes to render.
|
|
28
|
+
* @param options - Rendering options including guide token and context.
|
|
29
|
+
* @returns The formatted tree string.
|
|
30
|
+
*/
|
|
12
31
|
export declare function tree(nodes: TreeNode[], options?: TreeOptions): string;
|
|
13
32
|
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/core/components/tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/core/components/tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,mDAAmD;AACnD,MAAM,WAAW,QAAQ;IACvB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IAC1B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,uCAAuC;IACvC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,6DAA6D;IAC7D,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAE,WAAgB,GAAG,MAAM,CAezE"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { resolveCtx } from '../resolve-ctx.js';
|
|
2
|
+
/**
|
|
3
|
+
* Render a tree hierarchy with Unicode box-drawing connectors.
|
|
4
|
+
*
|
|
5
|
+
* Adapts output by mode:
|
|
6
|
+
* - `pipe`: indented plain-text tree.
|
|
7
|
+
* - `accessible`: indented tree with child-count annotations.
|
|
8
|
+
* - `interactive`/`static`: styled Unicode connectors with themed guide lines.
|
|
9
|
+
*
|
|
10
|
+
* @param nodes - Top-level tree nodes to render.
|
|
11
|
+
* @param options - Rendering options including guide token and context.
|
|
12
|
+
* @returns The formatted tree string.
|
|
13
|
+
*/
|
|
7
14
|
export function tree(nodes, options = {}) {
|
|
8
15
|
const ctx = resolveCtx(options.ctx);
|
|
9
16
|
const mode = ctx.mode;
|
|
@@ -14,8 +21,16 @@ export function tree(nodes, options = {}) {
|
|
|
14
21
|
return renderAccessible(nodes, 0);
|
|
15
22
|
}
|
|
16
23
|
const guideToken = options.guideToken ?? ctx.theme.theme.border.muted;
|
|
17
|
-
|
|
24
|
+
const labelToken = options.labelToken;
|
|
25
|
+
return renderRich(nodes, '', true, guideToken, labelToken, ctx);
|
|
18
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Render a tree as indented plain text (pipe mode).
|
|
29
|
+
*
|
|
30
|
+
* @param nodes - Nodes at the current depth level.
|
|
31
|
+
* @param depth - Current nesting depth (controls indentation).
|
|
32
|
+
* @returns Plain-text tree string.
|
|
33
|
+
*/
|
|
19
34
|
function renderPlain(nodes, depth) {
|
|
20
35
|
const indent = ' '.repeat(depth);
|
|
21
36
|
const lines = [];
|
|
@@ -27,6 +42,15 @@ function renderPlain(nodes, depth) {
|
|
|
27
42
|
}
|
|
28
43
|
return lines.join('\n');
|
|
29
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Render a tree with accessibility annotations (accessible mode).
|
|
47
|
+
*
|
|
48
|
+
* Parent nodes include a "(contains N items)" suffix for screen readers.
|
|
49
|
+
*
|
|
50
|
+
* @param nodes - Nodes at the current depth level.
|
|
51
|
+
* @param depth - Current nesting depth (controls indentation).
|
|
52
|
+
* @returns Accessible tree string.
|
|
53
|
+
*/
|
|
30
54
|
function renderAccessible(nodes, depth) {
|
|
31
55
|
const indent = ' '.repeat(depth);
|
|
32
56
|
const lines = [];
|
|
@@ -41,23 +65,37 @@ function renderAccessible(nodes, depth) {
|
|
|
41
65
|
}
|
|
42
66
|
return lines.join('\n');
|
|
43
67
|
}
|
|
44
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Render a tree with styled Unicode box-drawing connectors (interactive/static mode).
|
|
70
|
+
*
|
|
71
|
+
* @param nodes - Nodes at the current depth level.
|
|
72
|
+
* @param prefix - Accumulated prefix string for continuation lines.
|
|
73
|
+
* @param isRoot - Whether this is the top-level invocation.
|
|
74
|
+
* @param guideToken - Token used to style connectors and continuation lines.
|
|
75
|
+
* @param labelToken - Optional token used to style node labels. When provided,
|
|
76
|
+
* each label is wrapped with {@link BijouContext.style.styled}; otherwise the
|
|
77
|
+
* raw label text is used.
|
|
78
|
+
* @param ctx - Bijou context for styling.
|
|
79
|
+
* @returns Styled tree string.
|
|
80
|
+
*/
|
|
81
|
+
function renderRich(nodes, prefix, isRoot, guideToken, labelToken, ctx) {
|
|
45
82
|
const lines = [];
|
|
46
83
|
for (const [i, node] of nodes.entries()) {
|
|
47
84
|
const isLast = i === nodes.length - 1;
|
|
48
85
|
const connector = isLast ? '└─ ' : '├─ ';
|
|
86
|
+
const label = labelToken ? ctx.style.styled(labelToken, node.label) : node.label;
|
|
49
87
|
if (isRoot) {
|
|
50
|
-
lines.push(ctx.style.styled(guideToken, connector) +
|
|
88
|
+
lines.push(ctx.style.styled(guideToken, connector) + label);
|
|
51
89
|
}
|
|
52
90
|
else {
|
|
53
|
-
lines.push(prefix + ctx.style.styled(guideToken, connector) +
|
|
91
|
+
lines.push(prefix + ctx.style.styled(guideToken, connector) + label);
|
|
54
92
|
}
|
|
55
93
|
if (node.children && node.children.length > 0) {
|
|
56
94
|
const continuation = isLast ? ' ' : '│ ';
|
|
57
95
|
const newPrefix = isRoot
|
|
58
96
|
? ctx.style.styled(guideToken, continuation)
|
|
59
97
|
: prefix + ctx.style.styled(guideToken, continuation);
|
|
60
|
-
lines.push(renderRich(node.children, newPrefix, false, guideToken, ctx));
|
|
98
|
+
lines.push(renderRich(node.children, newPrefix, false, guideToken, labelToken, ctx));
|
|
61
99
|
}
|
|
62
100
|
}
|
|
63
101
|
return lines.join('\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/core/components/tree.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/core/components/tree.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAoB/C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,IAAI,CAAC,KAAiB,EAAE,UAAuB,EAAE;IAC/D,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IAEtB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC,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CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9C,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;YAC5C,MAAM,SAAS,GAAG,MAAM;gBACtB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC;gBAC5C,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;YACxD,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Environment detection utilities.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports TTY / output-mode detection from the `tty` sub-module.
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
export { detectOutputMode, detectColorScheme } from './tty.js';
|
|
8
|
+
export type { OutputMode, ColorScheme } from './tty.js';
|
|
3
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/detect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/detect/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC/D,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Environment detection utilities.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports TTY / output-mode detection from the `tty` sub-module.
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
export { detectOutputMode, detectColorScheme } from './tty.js';
|
|
2
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/detect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/detect/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -9,6 +9,42 @@
|
|
|
9
9
|
* stdout.isTTY -> 'interactive' (full experience)
|
|
10
10
|
*/
|
|
11
11
|
import type { RuntimePort } from '../../ports/runtime.js';
|
|
12
|
+
/**
|
|
13
|
+
* Terminal output mode.
|
|
14
|
+
*
|
|
15
|
+
* - `'interactive'` — full TUI experience with cursor movement and animation.
|
|
16
|
+
* - `'static'` — single-frame rendering (e.g. CI environments).
|
|
17
|
+
* - `'pipe'` — plain text, no ANSI escapes (piped stdout, `NO_COLOR`, `TERM=dumb`).
|
|
18
|
+
* - `'accessible'` — screen-reader-friendly plain prompts (`BIJOU_ACCESSIBLE=1`).
|
|
19
|
+
*/
|
|
12
20
|
export type OutputMode = 'interactive' | 'static' | 'pipe' | 'accessible';
|
|
21
|
+
/**
|
|
22
|
+
* Detect the appropriate output mode for the current environment.
|
|
23
|
+
*
|
|
24
|
+
* Inspects environment variables and TTY status via the optional
|
|
25
|
+
* {@link RuntimePort} abstraction, falling back to Node.js `process`
|
|
26
|
+
* globals when no port is provided.
|
|
27
|
+
*
|
|
28
|
+
* @param runtime - Optional runtime port for environment access. Falls back to `process`.
|
|
29
|
+
* @returns The detected {@link OutputMode}.
|
|
30
|
+
*/
|
|
13
31
|
export declare function detectOutputMode(runtime?: RuntimePort): OutputMode;
|
|
32
|
+
/**
|
|
33
|
+
* Terminal color scheme.
|
|
34
|
+
*
|
|
35
|
+
* - `'dark'` — light text on a dark background (most terminals).
|
|
36
|
+
* - `'light'` — dark text on a light background.
|
|
37
|
+
*/
|
|
38
|
+
export type ColorScheme = 'light' | 'dark';
|
|
39
|
+
/**
|
|
40
|
+
* Detect whether the terminal background is light or dark.
|
|
41
|
+
*
|
|
42
|
+
* Reads the `COLORFGBG` environment variable (format `"fg;bg"` or
|
|
43
|
+
* `"default;fg;bg"`). The last segment is treated as the background
|
|
44
|
+
* color index: 0–6 → dark, 7+ → light.
|
|
45
|
+
*
|
|
46
|
+
* @param runtime - Optional runtime port for environment access. Falls back to `process`.
|
|
47
|
+
* @returns The detected {@link ColorScheme}. Defaults to `'dark'`.
|
|
48
|
+
*/
|
|
49
|
+
export declare function detectColorScheme(runtime?: RuntimePort): ColorScheme;
|
|
14
50
|
//# sourceMappingURL=tty.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tty.d.ts","sourceRoot":"","sources":["../../../src/core/detect/tty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAC;AAE1E,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,CAgBlE"}
|
|
1
|
+
{"version":3,"file":"tty.d.ts","sourceRoot":"","sources":["../../../src/core/detect/tty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAC;AAE1E;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,CAgBlE;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAepE"}
|
package/dist/core/detect/tty.js
CHANGED
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
* CI=true -> 'static' (single-frame rendering)
|
|
9
9
|
* stdout.isTTY -> 'interactive' (full experience)
|
|
10
10
|
*/
|
|
11
|
+
/**
|
|
12
|
+
* Detect the appropriate output mode for the current environment.
|
|
13
|
+
*
|
|
14
|
+
* Inspects environment variables and TTY status via the optional
|
|
15
|
+
* {@link RuntimePort} abstraction, falling back to Node.js `process`
|
|
16
|
+
* globals when no port is provided.
|
|
17
|
+
*
|
|
18
|
+
* @param runtime - Optional runtime port for environment access. Falls back to `process`.
|
|
19
|
+
* @returns The detected {@link OutputMode}.
|
|
20
|
+
*/
|
|
11
21
|
export function detectOutputMode(runtime) {
|
|
12
22
|
const env = runtime
|
|
13
23
|
? (key) => runtime.env(key)
|
|
@@ -25,4 +35,28 @@ export function detectOutputMode(runtime) {
|
|
|
25
35
|
return 'static';
|
|
26
36
|
return 'interactive';
|
|
27
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Detect whether the terminal background is light or dark.
|
|
40
|
+
*
|
|
41
|
+
* Reads the `COLORFGBG` environment variable (format `"fg;bg"` or
|
|
42
|
+
* `"default;fg;bg"`). The last segment is treated as the background
|
|
43
|
+
* color index: 0–6 → dark, 7+ → light.
|
|
44
|
+
*
|
|
45
|
+
* @param runtime - Optional runtime port for environment access. Falls back to `process`.
|
|
46
|
+
* @returns The detected {@link ColorScheme}. Defaults to `'dark'`.
|
|
47
|
+
*/
|
|
48
|
+
export function detectColorScheme(runtime) {
|
|
49
|
+
const raw = runtime
|
|
50
|
+
? runtime.env('COLORFGBG')
|
|
51
|
+
: process.env['COLORFGBG'];
|
|
52
|
+
if (raw === undefined)
|
|
53
|
+
return 'dark';
|
|
54
|
+
const parts = raw.split(';');
|
|
55
|
+
// split() always returns >= 1 element, so last is never undefined
|
|
56
|
+
const last = parts[parts.length - 1];
|
|
57
|
+
const bg = parseInt(last, 10);
|
|
58
|
+
if (isNaN(bg))
|
|
59
|
+
return 'dark';
|
|
60
|
+
return bg >= 7 ? 'light' : 'dark';
|
|
61
|
+
}
|
|
28
62
|
//# sourceMappingURL=tty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tty.js","sourceRoot":"","sources":["../../../src/core/detect/tty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"tty.js","sourceRoot":"","sources":["../../../src/core/detect/tty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAcH;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAqB;IACpD,MAAM,GAAG,GAAG,OAAO;QACjB,CAAC,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;QACnC,CAAC,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC;IAEpF,IAAI,GAAG,CAAC,kBAAkB,CAAC,KAAK,GAAG;QAAE,OAAO,YAAY,CAAC;IAEzD,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACjD,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1C,IAAI,CAAC,WAAW;QAAE,OAAO,MAAM,CAAC;IAEhC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAE7C,OAAO,aAAa,CAAC;AACvB,CAAC;AAUD;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAqB;IACrD,MAAM,GAAG,GAAG,OAAO;QACjB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;QAC1B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAE7B,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IAErC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,kEAAkE;IAClE,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC;IAEtC,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,IAAI,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,MAAM,CAAC;IAE7B,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,CAAC"}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import type { ConfirmFieldOptions } from './types.js';
|
|
2
2
|
import type { BijouContext } from '../../ports/context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Options for the yes/no confirmation prompt.
|
|
5
|
+
*/
|
|
3
6
|
export interface ConfirmOptions extends ConfirmFieldOptions {
|
|
7
|
+
/** Bijou context for IO, styling, and mode detection. */
|
|
4
8
|
ctx?: BijouContext;
|
|
5
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Prompt the user with a yes/no confirmation question.
|
|
12
|
+
*
|
|
13
|
+
* Accepts "y", "yes", "n", "no" (case-insensitive). An empty response
|
|
14
|
+
* returns the default value (true unless overridden). Display adapts to
|
|
15
|
+
* the current output mode.
|
|
16
|
+
*
|
|
17
|
+
* @param options - Confirmation field configuration.
|
|
18
|
+
* @returns `true` for yes, `false` for no.
|
|
19
|
+
*/
|
|
6
20
|
export declare function confirm(options: ConfirmOptions): Promise<boolean>;
|
|
7
21
|
//# sourceMappingURL=confirm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../../src/core/forms/confirm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../../src/core/forms/confirm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,yDAAyD;IACzD,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBvE"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveCtx } from '../resolve-ctx.js';
|
|
2
|
+
import { formatFormTitle } from './form-utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Prompt the user with a yes/no confirmation question.
|
|
5
|
+
*
|
|
6
|
+
* Accepts "y", "yes", "n", "no" (case-insensitive). An empty response
|
|
7
|
+
* returns the default value (true unless overridden). Display adapts to
|
|
8
|
+
* the current output mode.
|
|
9
|
+
*
|
|
10
|
+
* @param options - Confirmation field configuration.
|
|
11
|
+
* @returns `true` for yes, `false` for no.
|
|
12
|
+
*/
|
|
2
13
|
export async function confirm(options) {
|
|
3
|
-
const ctx = options.ctx
|
|
14
|
+
const ctx = resolveCtx(options.ctx);
|
|
4
15
|
const mode = ctx.mode;
|
|
5
16
|
const noColor = ctx.theme.noColor;
|
|
6
17
|
const defaultYes = options.defaultValue !== false;
|
|
@@ -12,11 +23,10 @@ export async function confirm(options) {
|
|
|
12
23
|
else if (mode === 'pipe' || noColor) {
|
|
13
24
|
prompt = mode === 'pipe'
|
|
14
25
|
? `${options.title} ${hint}? `
|
|
15
|
-
: `${options.title} [${hint}] `;
|
|
26
|
+
: `${formatFormTitle(options.title, ctx)} [${hint}] `;
|
|
16
27
|
}
|
|
17
28
|
else {
|
|
18
|
-
prompt =
|
|
19
|
-
+ ctx.style.bold(options.title)
|
|
29
|
+
prompt = formatFormTitle(options.title, ctx)
|
|
20
30
|
+ ctx.style.styled(ctx.theme.theme.semantic.muted, ` [${hint}]`) + ' ';
|
|
21
31
|
}
|
|
22
32
|
const answer = await ctx.io.question(prompt);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.js","sourceRoot":"","sources":["../../../src/core/forms/confirm.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"confirm.js","sourceRoot":"","sources":["../../../src/core/forms/confirm.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAUlD;;;;;;;;;GASG;AACH,MAA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K,EAAE;QAAE,OAAO,UAAU,CAAC;IACtC,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IACtD,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACtD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,16 +1,46 @@
|
|
|
1
1
|
import type { FieldOptions } from './types.js';
|
|
2
2
|
import type { BijouContext } from '../../ports/context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Single option in a filterable select list.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam T - Type of the option's value.
|
|
7
|
+
*/
|
|
3
8
|
export interface FilterOption<T> {
|
|
9
|
+
/** Display label shown in the option list. */
|
|
4
10
|
label: string;
|
|
11
|
+
/** Value returned when this option is selected. */
|
|
5
12
|
value: T;
|
|
13
|
+
/** Additional search keywords that match this option during filtering. */
|
|
6
14
|
keywords?: string[];
|
|
7
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Options for the filterable select field.
|
|
18
|
+
*
|
|
19
|
+
* @typeParam T - Type of each option's value.
|
|
20
|
+
*/
|
|
8
21
|
export interface FilterOptions<T> extends FieldOptions<T> {
|
|
22
|
+
/** List of filterable options. */
|
|
9
23
|
options: FilterOption<T>[];
|
|
24
|
+
/** Placeholder text shown in the filter input when empty. */
|
|
10
25
|
placeholder?: string;
|
|
26
|
+
/** Maximum number of options visible at once. Default: 7. */
|
|
11
27
|
maxVisible?: number;
|
|
28
|
+
/** Custom match function for filtering. Defaults to case-insensitive label/keyword substring match. */
|
|
12
29
|
match?: (query: string, option: FilterOption<T>) => boolean;
|
|
30
|
+
/** Bijou context for IO, styling, and mode detection. */
|
|
13
31
|
ctx?: BijouContext;
|
|
14
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Prompt the user to choose one item from a filterable list.
|
|
35
|
+
*
|
|
36
|
+
* In interactive TTY mode, renders a search input that narrows the
|
|
37
|
+
* option list in real time. Falls back to a numbered list with
|
|
38
|
+
* text-based matching for pipe and accessible modes.
|
|
39
|
+
*
|
|
40
|
+
* @typeParam T - Type of each option's value.
|
|
41
|
+
* @param options - Filter field configuration.
|
|
42
|
+
* @returns The value of the selected option.
|
|
43
|
+
* @throws {Error} If no options are provided and no defaultValue is set.
|
|
44
|
+
*/
|
|
15
45
|
export declare function filter<T>(options: FilterOptions<T>): Promise<T>;
|
|
16
46
|
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/core/forms/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/core/forms/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;;;GAIG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IACvD,kCAAkC;IAClC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3B,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uGAAuG;IACvG,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;IAC5D,yDAAyD;IACzD,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;AAoBD;;;;;;;;;;;GAWG;AACH,wBAAsB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAarE"}
|