@alchemy.run/sigil 0.0.0-alpha.4 → 0.0.0-alpha.6

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.
Files changed (138) hide show
  1. package/README.md +21 -9
  2. package/THIRD_PARTY_NOTICES.md +39 -1
  3. package/dist/Text-BobFKi74.d.ts +452 -0
  4. package/dist/ansi.d.ts +122 -131
  5. package/dist/ansi.js +86 -6
  6. package/dist/capabilities.d.ts +5 -0
  7. package/dist/capabilities.js +3 -0
  8. package/dist/cell-_ZVhbfl0.js +44 -0
  9. package/dist/color-CkbalRqK.js +2 -0
  10. package/dist/color-policy-BMzMwV7Q.d.ts +22 -0
  11. package/dist/color-policy-SVj1pYTA.js +560 -0
  12. package/dist/color-profile-DHhQHY55.js +36 -0
  13. package/dist/color-profile-u0Nhe9Nv.d.ts +97 -0
  14. package/dist/color.d.ts +21 -0
  15. package/dist/color.js +3 -0
  16. package/dist/cursor-position-D2LAkRG0.d.ts +7 -0
  17. package/dist/detect-Bh4yGP6w.d.ts +186 -0
  18. package/dist/detect-BuTXtY6e.js +373 -0
  19. package/dist/env-YVw64yZS.js +9 -0
  20. package/dist/escapes-CB_6CWOE.d.ts +72 -0
  21. package/dist/geometry-BxXOzJgo.d.ts +11 -0
  22. package/dist/index-DZ88EXJv.d.ts +21 -0
  23. package/dist/index.d.ts +143 -498
  24. package/dist/index.js +1026 -2244
  25. package/dist/osc-CCH7xDoS.js +71 -0
  26. package/dist/osc-Cn0fw77g.d.ts +23 -0
  27. package/dist/paint-C19minOS.d.ts +81 -0
  28. package/dist/query-vaIeGOkH.d.ts +152 -0
  29. package/dist/router.d.ts +392 -0
  30. package/dist/router.js +709 -0
  31. package/dist/sample-Cqw1bjUL.js +445 -0
  32. package/dist/screen-BOSLQ8fF.d.ts +49 -0
  33. package/dist/screen-CiPytswf.js +342 -0
  34. package/dist/screen.d.ts +5 -0
  35. package/dist/screen.js +5 -0
  36. package/dist/semantic-text-style-DIMzC7xt.js +91 -0
  37. package/dist/serialize-BTkAZgw1.js +79 -0
  38. package/dist/session-aZr9O8h3.js +665 -0
  39. package/dist/sgr-BhwaWAJB.js +246 -0
  40. package/dist/store-CgrG9K4y.d.ts +72 -0
  41. package/dist/string-width-CijQwpIk.js +69 -0
  42. package/dist/strip-BvU4toXG.js +6 -0
  43. package/dist/terminal.d.ts +118 -0
  44. package/dist/terminal.js +2 -0
  45. package/dist/tokenize-AjqbvtiT.js +1242 -0
  46. package/dist/tokenize-Dx1y_l5H.d.ts +57 -0
  47. package/dist/truncate-D31fhU6i.js +562 -0
  48. package/dist/use-focus-BzqAJi0n.js +1337 -0
  49. package/package.json +41 -9
  50. package/src/ansi/chalk.ts +5 -3
  51. package/src/ansi/escapes.ts +14 -0
  52. package/src/ansi/graphemes.ts +8 -0
  53. package/src/ansi/hyperlink.ts +44 -0
  54. package/src/ansi/index.ts +3 -1
  55. package/src/ansi/osc.ts +77 -0
  56. package/src/ansi/tokenize.ts +3 -4
  57. package/src/capabilities/color-policy.ts +34 -0
  58. package/src/capabilities/detect.ts +594 -0
  59. package/src/capabilities/index.ts +37 -0
  60. package/src/capabilities/query.ts +657 -0
  61. package/src/capabilities/store.ts +379 -0
  62. package/src/color/index.ts +3 -0
  63. package/src/color/paint.ts +169 -0
  64. package/src/color/palette.ts +48 -0
  65. package/src/color/sample.ts +323 -0
  66. package/src/color.ts +1 -0
  67. package/src/components/AnsiText.tsx +42 -0
  68. package/src/components/App.tsx +98 -10
  69. package/src/components/BackgroundContext.ts +2 -3
  70. package/src/components/Box.tsx +0 -8
  71. package/src/components/CursorContext.ts +1 -1
  72. package/src/components/Hyperlink.tsx +56 -0
  73. package/src/components/TerminalOscContext.ts +25 -0
  74. package/src/components/Text.tsx +22 -45
  75. package/src/components/Transform.tsx +1 -1
  76. package/src/dom.ts +11 -2
  77. package/src/global.d.ts +3 -0
  78. package/src/hooks/use-capabilities.ts +73 -0
  79. package/src/hooks/use-cursor.ts +2 -2
  80. package/src/hooks/use-terminal-osc.ts +59 -0
  81. package/src/index.ts +45 -1
  82. package/src/ink.tsx +213 -153
  83. package/src/{render-node-to-output.ts → paint-tree.ts} +75 -48
  84. package/src/reconciler.ts +24 -3
  85. package/src/render-background.ts +36 -15
  86. package/src/render-border.ts +94 -61
  87. package/src/render-frame.ts +83 -0
  88. package/src/render-to-string.ts +21 -6
  89. package/src/render.ts +15 -6
  90. package/src/router/components.tsx +343 -0
  91. package/src/router/context.ts +41 -0
  92. package/src/router/history.ts +194 -0
  93. package/src/router/hooks.tsx +391 -0
  94. package/src/router/index.ts +34 -0
  95. package/src/router/matcher.ts +571 -0
  96. package/src/screen/ansi.ts +184 -0
  97. package/src/screen/canvas.ts +160 -0
  98. package/src/screen/cell.ts +138 -0
  99. package/src/screen/color-profile.ts +47 -0
  100. package/src/screen/geometry.ts +9 -0
  101. package/src/screen/index.ts +6 -0
  102. package/src/screen/screen.ts +305 -0
  103. package/src/screen/serialize.ts +129 -0
  104. package/src/screen.ts +1 -0
  105. package/src/semantic-text-style.ts +118 -0
  106. package/src/squash-text-nodes.ts +2 -5
  107. package/src/structured-text.ts +325 -0
  108. package/src/styles.ts +19 -14
  109. package/src/terminal/index.ts +2 -0
  110. package/src/terminal/inline-presenter.ts +120 -0
  111. package/src/terminal/input.ts +86 -0
  112. package/src/terminal/render-scheduler.ts +37 -0
  113. package/src/terminal/screen-presenter.ts +188 -0
  114. package/src/terminal/session.ts +407 -0
  115. package/src/terminal.ts +1 -0
  116. package/src/testing/browser.ts +588 -0
  117. package/src/testing/emulators.ts +205 -0
  118. package/src/testing/explorer-app/index.html +12 -0
  119. package/src/testing/explorer-app/main.ts +381 -0
  120. package/src/testing/explorer-app/style.css +194 -0
  121. package/src/testing/explorer-app/tsconfig.json +15 -0
  122. package/src/testing/explorer-app/vite-env.d.ts +1 -0
  123. package/src/testing/index.ts +26 -0
  124. package/src/testing/keys.ts +56 -0
  125. package/src/testing/live.ts +85 -0
  126. package/src/testing/matchers.ts +70 -0
  127. package/src/testing/public.ts +94 -0
  128. package/src/testing/terminal.ts +349 -0
  129. package/src/testing/vitest.ts +157 -0
  130. package/src/transform-adapter.ts +14 -0
  131. package/src/wrap-text.ts +4 -0
  132. package/dist/sgr-CMfEpjSk.d.ts +0 -91
  133. package/dist/truncate-Cr6xVFMa.js +0 -2330
  134. package/src/ansi/supports-color.ts +0 -207
  135. package/src/colorize.ts +0 -60
  136. package/src/log-update.ts +0 -370
  137. package/src/output.ts +0 -308
  138. package/src/renderer.ts +0 -73
package/README.md CHANGED
@@ -11,10 +11,24 @@
11
11
  - **Self-contained**: the only runtime dependencies are `react-reconciler` and `scheduler`. Everything else — the ANSI/terminal subsystem (`src/ansi/`), styling, width measurement, wrapping — is first-class TypeScript in this repository.
12
12
  - **Integrated layout engine**: layout is computed by a TypeScript port of [Yoga](https://github.com/facebook/yoga) (`src/yoga/`) instead of the Yoga WASM binary, continuously verified against an f64-patched reference Yoga build via differential fuzzing.
13
13
  - **Modern toolchain**: built with [Vite+](https://viteplus.dev) (Vitest, Oxlint, Oxfmt, tsdown) and TypeScript 7.
14
+ - **Structured terminal core**: cells retain semantic colors, gradients, links, and graphemes through layout and composition, then serialize for the target terminal profile.
15
+
16
+ Low-level integrations are available through focused `ansi`, `capabilities`, `color`, `router`, `screen`, `terminal`, and `yoga` subpaths. See the [architecture guide](docs/architecture.md), [API stability policy](docs/api-stability.md), [color semantics](docs/color-semantics.md), and [performance notes](docs/performance.md).
14
17
 
15
18
  Upstream Ink and Yoga are tracked as submodules in `.vendor/` — upstream's test suites run against this codebase as part of the regular test run. See `THIRD_PARTY_NOTICES.md` for attribution.
16
19
 
17
- The documentation below is inherited from Ink; the API is unchanged apart from imports
20
+ The familiar Ink component and hook surface remains available from the package root. Sigil also adds terminal-aware APIs described below. The longer API reference is inherited from Ink and uses Sigil imports where applicable.
21
+
22
+ ## Sigil extensions
23
+
24
+ - **Structured rendering** — layout produces a semantic `Screen` of grapheme-aware cells before terminal-specific ANSI serialization. Import low-level primitives from `@alchemy.run/sigil/screen`, `@alchemy.run/sigil/color`, and `@alchemy.run/sigil/terminal`.
25
+ - **Terminal capabilities** — `getCapabilities()` returns the current snapshot, while `capabilities.subscribe()` and `useCapabilitiesChange()` observe live terminal reports. The framework-free API is available from `@alchemy.run/sigil/capabilities`.
26
+ - **Terminal integrations** — `<Hyperlink>` provides OSC 8 links with a fallback. `useTitle`, `useWorkingDirectory`, `useProgress`, `useNotification`, `useClipboard`, and `usePointerShape` manage session-scoped OSC state.
27
+ - **ANSI-aware text** — `<AnsiText>` interprets ANSI-styled input without flattening its semantic colors before rendering.
28
+ - **Routing** — `@alchemy.run/sigil/router` provides an in-memory router designed for terminal applications. See the [routing recipe](recipes/routing.md).
29
+ - **Testing** — the repository includes an internal emulator-backed E2E harness and interactive explorer. These utilities are not part of the public API while their design is evolving.
30
+
31
+ Sigil requires Node.js 22 or newer and React 19.2 or newer.
18
32
 
19
33
  ---
20
34
 
@@ -1363,6 +1377,8 @@ Accepts the same values as [`color`](#color) in the `<Text>` component.
1363
1377
 
1364
1378
  The background color fills the entire `<Box>` area and is inherited by child `<Text>` components unless they specify their own `backgroundColor`.
1365
1379
 
1380
+ Use `backgroundColor=""` to paint the box with explicit blank cells on the terminal's default background. This is useful for opaque compositor layers: lower-layer glyphs are erased without assuming what color the user's terminal background is. Omitting `backgroundColor` keeps the box transparent.
1381
+
1366
1382
  ```jsx
1367
1383
  <Box backgroundColor="blue" alignSelf="flex-start">
1368
1384
  <Text>Blue inherited </Text>
@@ -2661,14 +2677,6 @@ This controls how frequently the UI can update to prevent excessive re-rendering
2661
2677
  Higher values allow more frequent updates but may impact performance.
2662
2678
  Setting it to a lower value may be useful for components that update very frequently, to reduce CPU usage.
2663
2679
 
2664
- ###### incrementalRendering
2665
-
2666
- Type: `boolean`\
2667
- Default: `false`
2668
-
2669
- Enable incremental rendering mode which only updates changed lines instead of redrawing the entire output.
2670
- This can reduce flickering and improve performance for frequently updating UIs.
2671
-
2672
2680
  ###### concurrent
2673
2681
 
2674
2682
  Type: `boolean`\
@@ -3166,6 +3174,10 @@ npm run example examples/[example name]
3166
3174
  - [Static](examples/static/static.tsx) - Use the `<Static>` component to render permanent output.
3167
3175
  - [Child process](examples/subprocess-output) - Renders output from a child process.
3168
3176
  - [Router](examples/router/router.tsx) - Navigate between routes using React Router's `MemoryRouter`.
3177
+ - [Charm brightness](examples/charm-brightness/brightness.tsx) - A native port of Lip Gloss's progressive lightening and darkening demo.
3178
+ - [Charm canvas](examples/charm-canvas/canvas.tsx) - Layered fields and gradient-bordered cards inspired by Lip Gloss's compositor demo.
3179
+ - [Charm layout](examples/charm-layout/layout.tsx) - The Lip Gloss layout showcase rebuilt with React, Yoga, gradients, and compositing.
3180
+ - [Charm profile](examples/charm-profile/profile.tsx) - The Lip Gloss SSH profile showcase adapted to Sigil's stream-scoped terminal capabilities.
3169
3181
 
3170
3182
  ## Continuous Integration
3171
3183
 
@@ -9,6 +9,15 @@ specific origin of each file.
9
9
  The core of this project is a fork of [Ink](https://github.com/vadimdemedes/ink).
10
10
  Copyright (c) Vadym Demedes. See the root `LICENSE` file.
11
11
 
12
+ ## Lip Gloss examples
13
+
14
+ The examples under `examples/charm-*` are ports or adaptations of visual demos
15
+ from [Charmbracelet Lip Gloss](https://github.com/charmbracelet/lipgloss).
16
+
17
+ Copyright (c) 2020-2026 Charmbracelet, Inc.
18
+
19
+ Licensed under the MIT License (text below).
20
+
12
21
  ## Yoga
13
22
 
14
23
  The layout engine (`src/yoga/`) is a TypeScript port of
@@ -53,7 +62,7 @@ Licensed under the MIT License (text above).
53
62
 
54
63
  ## supports-color (MIT)
55
64
 
56
- `src/ansi/supports-color.ts` is derived from `supports-color`.
65
+ The color-level detection in `src/capabilities/detect.ts` is derived from `supports-color`.
57
66
 
58
67
  Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
59
68
  and Josh Junon.
@@ -141,3 +150,32 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
141
150
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
142
151
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
143
152
  PERFORMANCE OF THIS SOFTWARE.
153
+
154
+ ## react-router (MIT)
155
+
156
+ The route matching engine and component model of `src/router/` are ported from
157
+ [react-router](https://github.com/remix-run/react-router)'s declarative mode.
158
+
159
+ Copyright (c) React Training LLC 2015-2019, Remix Software Inc. 2020-2021,
160
+ and Shopify Inc. 2022-2023.
161
+
162
+ Licensed under the MIT License (text above).
163
+
164
+ ## supports-hyperlinks (MIT)
165
+
166
+ The hyperlink detection in `src/capabilities/detect.ts` is derived from
167
+ `supports-hyperlinks`.
168
+
169
+ Copyright (c) James Talmage <james@talmage.io> (https://github.com/jamestalmage)
170
+ and Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
171
+
172
+ Licensed under the MIT License (text above).
173
+
174
+ ## is-unicode-supported (MIT)
175
+
176
+ `detectUnicodeSupport` in `src/capabilities/detect.ts` is derived from
177
+ `is-unicode-supported`.
178
+
179
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
180
+
181
+ Licensed under the MIT License (text above).
@@ -0,0 +1,452 @@
1
+ import { s as Paint } from "./paint-C19minOS.js";
2
+ import { ReactNode } from "react";
3
+ //#region src/glyphs.d.ts
4
+ declare const BOXES: {
5
+ readonly single: {
6
+ readonly topLeft: "┌";
7
+ readonly top: "─";
8
+ readonly topRight: "┐";
9
+ readonly right: "│";
10
+ readonly bottomRight: "┘";
11
+ readonly bottom: "─";
12
+ readonly bottomLeft: "└";
13
+ readonly left: "│";
14
+ };
15
+ readonly double: {
16
+ readonly topLeft: "╔";
17
+ readonly top: "═";
18
+ readonly topRight: "╗";
19
+ readonly right: "║";
20
+ readonly bottomRight: "╝";
21
+ readonly bottom: "═";
22
+ readonly bottomLeft: "╚";
23
+ readonly left: "║";
24
+ };
25
+ readonly round: {
26
+ readonly topLeft: "╭";
27
+ readonly top: "─";
28
+ readonly topRight: "╮";
29
+ readonly right: "│";
30
+ readonly bottomRight: "╯";
31
+ readonly bottom: "─";
32
+ readonly bottomLeft: "╰";
33
+ readonly left: "│";
34
+ };
35
+ readonly bold: {
36
+ readonly topLeft: "┏";
37
+ readonly top: "━";
38
+ readonly topRight: "┓";
39
+ readonly right: "┃";
40
+ readonly bottomRight: "┛";
41
+ readonly bottom: "━";
42
+ readonly bottomLeft: "┗";
43
+ readonly left: "┃";
44
+ };
45
+ readonly singleDouble: {
46
+ readonly topLeft: "╓";
47
+ readonly top: "─";
48
+ readonly topRight: "╖";
49
+ readonly right: "║";
50
+ readonly bottomRight: "╜";
51
+ readonly bottom: "─";
52
+ readonly bottomLeft: "╙";
53
+ readonly left: "║";
54
+ };
55
+ readonly doubleSingle: {
56
+ readonly topLeft: "╒";
57
+ readonly top: "═";
58
+ readonly topRight: "╕";
59
+ readonly right: "│";
60
+ readonly bottomRight: "╛";
61
+ readonly bottom: "═";
62
+ readonly bottomLeft: "╘";
63
+ readonly left: "│";
64
+ };
65
+ readonly classic: {
66
+ readonly topLeft: "+";
67
+ readonly top: "-";
68
+ readonly topRight: "+";
69
+ readonly right: "|";
70
+ readonly bottomRight: "+";
71
+ readonly bottom: "-";
72
+ readonly bottomLeft: "+";
73
+ readonly left: "|";
74
+ };
75
+ readonly arrow: {
76
+ readonly topLeft: "↘";
77
+ readonly top: "↓";
78
+ readonly topRight: "↙";
79
+ readonly right: "←";
80
+ readonly bottomRight: "↖";
81
+ readonly bottom: "↑";
82
+ readonly bottomLeft: "↗";
83
+ readonly left: "→";
84
+ };
85
+ };
86
+ type BoxStyle = keyof typeof BOXES;
87
+ /**
88
+ The set of glyphs making up a box border, for custom `borderStyle` objects.
89
+ */
90
+ type BoxGlyphs = {
91
+ readonly topLeft: string;
92
+ readonly top: string;
93
+ readonly topRight: string;
94
+ readonly right: string;
95
+ readonly bottomRight: string;
96
+ readonly bottom: string;
97
+ readonly bottomLeft: string;
98
+ readonly left: string;
99
+ };
100
+ //#endregion
101
+ //#region src/styles.d.ts
102
+ type Styles = {
103
+ readonly textWrap?: "wrap" | "hard" | "truncate-end" | "truncate" | "truncate-middle" | "truncate-start" | "none";
104
+ /**
105
+ Controls how the element is positioned.
106
+
107
+ When `position` is `static`, `top`, `right`, `bottom`, and `left` are ignored.
108
+ */
109
+ readonly position?: "absolute" | "relative" | "static";
110
+ /**
111
+ Top offset for positioned elements.
112
+ */
113
+ readonly top?: number | string;
114
+ /**
115
+ Right offset for positioned elements.
116
+ */
117
+ readonly right?: number | string;
118
+ /**
119
+ Bottom offset for positioned elements.
120
+ */
121
+ readonly bottom?: number | string;
122
+ /**
123
+ Left offset for positioned elements.
124
+ */
125
+ readonly left?: number | string;
126
+ /**
127
+ Size of the gap between an element's columns.
128
+ */
129
+ readonly columnGap?: number;
130
+ /**
131
+ Size of the gap between an element's rows.
132
+ */
133
+ readonly rowGap?: number;
134
+ /**
135
+ Size of the gap between an element's columns and rows. A shorthand for `columnGap` and `rowGap`.
136
+ */
137
+ readonly gap?: number;
138
+ /**
139
+ Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft`, and `marginRight`.
140
+ */
141
+ readonly margin?: number;
142
+ /**
143
+ Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`.
144
+ */
145
+ readonly marginX?: number;
146
+ /**
147
+ Vertical margin. Equivalent to setting `marginTop` and `marginBottom`.
148
+ */
149
+ readonly marginY?: number;
150
+ /**
151
+ Top margin.
152
+ */
153
+ readonly marginTop?: number;
154
+ /**
155
+ Bottom margin.
156
+ */
157
+ readonly marginBottom?: number;
158
+ /**
159
+ Left margin.
160
+ */
161
+ readonly marginLeft?: number;
162
+ /**
163
+ Right margin.
164
+ */
165
+ readonly marginRight?: number;
166
+ /**
167
+ Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft`, and `paddingRight`.
168
+ */
169
+ readonly padding?: number;
170
+ /**
171
+ Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.
172
+ */
173
+ readonly paddingX?: number;
174
+ /**
175
+ Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.
176
+ */
177
+ readonly paddingY?: number;
178
+ /**
179
+ Top padding.
180
+ */
181
+ readonly paddingTop?: number;
182
+ /**
183
+ Bottom padding.
184
+ */
185
+ readonly paddingBottom?: number;
186
+ /**
187
+ Left padding.
188
+ */
189
+ readonly paddingLeft?: number;
190
+ /**
191
+ Right padding.
192
+ */
193
+ readonly paddingRight?: number;
194
+ /**
195
+ This property defines the ability for a flex item to grow if necessary.
196
+ See [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/).
197
+ */
198
+ readonly flexGrow?: number;
199
+ /**
200
+ It specifies the “flex shrink factor”, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when there isn't enough space on the row.
201
+ See [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/).
202
+ */
203
+ readonly flexShrink?: number;
204
+ /**
205
+ It establishes the main-axis, thus defining the direction flex items are placed in the flex container.
206
+ See [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/).
207
+ */
208
+ readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse";
209
+ /**
210
+ It specifies the initial size of the flex item, before any available space is distributed according to the flex factors.
211
+ See [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/).
212
+ */
213
+ readonly flexBasis?: number | string;
214
+ /**
215
+ It defines whether the flex items are forced in a single line or can be flowed into multiple lines. If set to multiple lines, it also defines the cross-axis which determines the direction new lines are stacked in.
216
+ See [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/).
217
+ */
218
+ readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
219
+ /**
220
+ The align-items property defines the default behavior for how items are laid out along the cross axis (perpendicular to the main axis).
221
+ See [align-items](https://css-tricks.com/almanac/properties/a/align-items/).
222
+ */
223
+ readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
224
+ /**
225
+ It makes possible to override the align-items value for specific flex items.
226
+ See [align-self](https://css-tricks.com/almanac/properties/a/align-self/).
227
+ */
228
+ readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | "stretch" | "baseline";
229
+ /**
230
+ It defines the alignment along the cross axis when there are multiple lines of flex items (when using flex-wrap).
231
+ See [align-content](https://css-tricks.com/almanac/properties/a/align-content/).
232
+ */
233
+ readonly alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly";
234
+ /**
235
+ It defines the alignment along the main axis.
236
+ See [justify-content](https://css-tricks.com/almanac/properties/j/justify-content/).
237
+ */
238
+ readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center";
239
+ /**
240
+ Width of the element in spaces. You can also set it as a percentage, which will calculate the width based on the width of the parent element.
241
+ */
242
+ readonly width?: number | string;
243
+ /**
244
+ Height of the element in lines (rows). You can also set it as a percentage, which will calculate the height based on the height of the parent element.
245
+ */
246
+ readonly height?: number | string;
247
+ /**
248
+ Sets a minimum width of the element.
249
+ Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
250
+ */
251
+ readonly minWidth?: number | string;
252
+ /**
253
+ Sets a minimum height of the element in lines (rows). You can also set it as a percentage, which will calculate the minimum height based on the height of the parent element.
254
+ */
255
+ readonly minHeight?: number | string;
256
+ /**
257
+ Sets a maximum width of the element.
258
+ Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
259
+ */
260
+ readonly maxWidth?: number | string;
261
+ /**
262
+ Sets a maximum height of the element in lines (rows). You can also set it as a percentage, which will calculate the maximum height based on the height of the parent element.
263
+ */
264
+ readonly maxHeight?: number | string;
265
+ /**
266
+ Defines the aspect ratio (width/height) for the element.
267
+
268
+ Use it with at least one size constraint (`width`, `height`, `minHeight`, or `maxHeight`) so Ink can derive the missing dimension.
269
+ */
270
+ readonly aspectRatio?: number;
271
+ /**
272
+ Set this property to `none` to hide the element.
273
+ */
274
+ readonly display?: "flex" | "none";
275
+ /**
276
+ Add a border with a specified style. If `borderStyle` is `undefined` (the default), no border will be added.
277
+ */
278
+ readonly borderStyle?: BoxStyle | BoxGlyphs;
279
+ /**
280
+ Determines whether the top border is visible.
281
+
282
+ @default true
283
+ */
284
+ readonly borderTop?: boolean;
285
+ /**
286
+ Determines whether the bottom border is visible.
287
+
288
+ @default true
289
+ */
290
+ readonly borderBottom?: boolean;
291
+ /**
292
+ Determines whether the left border is visible.
293
+
294
+ @default true
295
+ */
296
+ readonly borderLeft?: boolean;
297
+ /**
298
+ Determines whether the right border is visible.
299
+
300
+ @default true
301
+ */
302
+ readonly borderRight?: boolean;
303
+ /**
304
+ Change border color. A shorthand for setting `borderTopColor`, `borderRightColor`, `borderBottomColor`, and `borderLeftColor`.
305
+ */
306
+ readonly borderColor?: Paint;
307
+ /**
308
+ Change the top border color. Accepts the same values as `color` in `Text` component.
309
+ */
310
+ readonly borderTopColor?: Paint;
311
+ /**
312
+ Change the bottom border color. Accepts the same values as `color` in `Text` component.
313
+ */
314
+ readonly borderBottomColor?: Paint;
315
+ /**
316
+ Change the left border color. Accepts the same values as `color` in `Text` component.
317
+ */
318
+ readonly borderLeftColor?: Paint;
319
+ /**
320
+ Change the right border color. Accepts the same values as `color` in `Text` component.
321
+ */
322
+ readonly borderRightColor?: Paint;
323
+ /**
324
+ Dim the border color. A shorthand for setting `borderTopDimColor`, `borderBottomDimColor`, `borderLeftDimColor`, and `borderRightDimColor`.
325
+
326
+ @default false
327
+ */
328
+ readonly borderDimColor?: boolean;
329
+ /**
330
+ Dim the top border color.
331
+
332
+ @default false
333
+ */
334
+ readonly borderTopDimColor?: boolean;
335
+ /**
336
+ Dim the bottom border color.
337
+
338
+ @default false
339
+ */
340
+ readonly borderBottomDimColor?: boolean;
341
+ /**
342
+ Dim the left border color.
343
+
344
+ @default false
345
+ */
346
+ readonly borderLeftDimColor?: boolean;
347
+ /**
348
+ Dim the right border color.
349
+
350
+ @default false
351
+ */
352
+ readonly borderRightDimColor?: boolean;
353
+ /**
354
+ Change border background color. A shorthand for setting `borderTopBackgroundColor`, `borderRightBackgroundColor`, `borderBottomBackgroundColor`, and `borderLeftBackgroundColor`.
355
+ */
356
+ readonly borderBackgroundColor?: Paint;
357
+ /**
358
+ Change top border background color. Accepts the same values as `backgroundColor` in `Text` component.
359
+ */
360
+ readonly borderTopBackgroundColor?: Paint;
361
+ /**
362
+ Change bottom border background color. Accepts the same values as `backgroundColor` in `Text` component.
363
+ */
364
+ readonly borderBottomBackgroundColor?: Paint;
365
+ /**
366
+ Change left border background color. Accepts the same values as `backgroundColor` in `Text` component.
367
+ */
368
+ readonly borderLeftBackgroundColor?: Paint;
369
+ /**
370
+ Change right border background color. Accepts the same values as `backgroundColor` in `Text` component.
371
+ */
372
+ readonly borderRightBackgroundColor?: Paint;
373
+ /**
374
+ Behavior for an element's overflow in both directions.
375
+
376
+ @default 'visible'
377
+ */
378
+ readonly overflow?: "visible" | "hidden";
379
+ /**
380
+ Behavior for an element's overflow in the horizontal direction.
381
+
382
+ @default 'visible'
383
+ */
384
+ readonly overflowX?: "visible" | "hidden";
385
+ /**
386
+ Behavior for an element's overflow in the vertical direction.
387
+
388
+ @default 'visible'
389
+ */
390
+ readonly overflowY?: "visible" | "hidden";
391
+ /**
392
+ Background color for the element.
393
+
394
+ Accepts the same values as `color` in the `<Text>` component.
395
+ */
396
+ readonly backgroundColor?: Paint;
397
+ };
398
+ //#endregion
399
+ //#region src/components/Text.d.ts
400
+ type Props = {
401
+ /**
402
+ A label for the element for screen readers.
403
+ */
404
+ readonly "aria-label"?: string;
405
+ /**
406
+ Hide the element from screen readers.
407
+ */
408
+ readonly "aria-hidden"?: boolean;
409
+ /**
410
+ Change text color. Ink uses Chalk under the hood, so all its functionality is supported.
411
+ */
412
+ readonly color?: Paint;
413
+ /**
414
+ Same as `color`, but for the background.
415
+ */
416
+ readonly backgroundColor?: Paint;
417
+ /**
418
+ Dim the color (make it less bright).
419
+ */
420
+ readonly dimColor?: boolean;
421
+ /**
422
+ Make the text bold.
423
+ */
424
+ readonly bold?: boolean;
425
+ /**
426
+ Make the text italic.
427
+ */
428
+ readonly italic?: boolean;
429
+ /**
430
+ Make the text underlined.
431
+ */
432
+ readonly underline?: boolean;
433
+ /**
434
+ Make the text crossed out with a line.
435
+ */
436
+ readonly strikethrough?: boolean;
437
+ /**
438
+ Inverse background and foreground colors.
439
+ */
440
+ readonly inverse?: boolean;
441
+ /**
442
+ This property tells Ink to wrap or truncate text if its width is larger than the container. If `wrap` is passed (the default), Ink will wrap text and split it into multiple lines. If `hard` is passed, Ink will fill each line to the full column width, breaking words as necessary. If `truncate-*` is passed, Ink will truncate text instead, resulting in one line of text with the rest cut off. If `none` is passed, the text is neither wrapped nor truncated — it overflows the container (and the screen's nominal width), which is intended for log lines committed to scrollback (e.g. inside `<Static>`), not for live regions.
443
+ */
444
+ readonly wrap?: Styles["textWrap"];
445
+ readonly children?: ReactNode;
446
+ };
447
+ /**
448
+ This component can display text and change its style to make it bold, underlined, italic, or strikethrough.
449
+ */
450
+ declare function Text({ color, backgroundColor, dimColor, bold, italic, underline, strikethrough, inverse, wrap, children, "aria-label": ariaLabel, "aria-hidden": ariaHidden }: Props): import("react").JSX.Element | null;
451
+ //#endregion
452
+ export { Text as n, Styles as r, Props as t };