@kud/ink-ui 0.9.0 → 0.10.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 CHANGED
@@ -13,12 +13,12 @@
13
13
 
14
14
  ## Features
15
15
 
16
- - **25 ready-made components**, pre-styled and ready to drop in:
16
+ - **27 ready-made components**, pre-styled and ready to drop in:
17
17
  - **Inputs** — `TextInput`, `EmailInput` (domain completion), `PasswordInput` (masked), `ConfirmInput`
18
18
  - **Lists** — `UnorderedList`, `OrderedList` (both nestable), `Table`
19
19
  - **Selection & navigation** — `Select`, `MultiSelect`, `Tabs`, `Switch`, `Toggle`, `SelectableRow`
20
20
  - **Status & feedback** — `Spinner`, `ProgressBar`, `StatusMessage`, `Alert`, `Badge`, `Toast`
21
- - **Layout & chrome** — `Banner`, `Header`, `FooterHints`, `KeyValue`, `LoadingScreen`, `ScrollView`
21
+ - **Layout & chrome** — `Banner`, `Header`, `Panel` (bordered pane, optional focus state), `Columns`, `FooterHints`, `KeyValue`, `LoadingScreen`, `ScrollView`
22
22
  - **Full [@inkjs/ui](https://github.com/vadimdemedes/ink-ui) parity** — every upstream component has an equivalent, plus a dozen more the design system adds on top
23
23
  - **Colourblind-safe by design** — state is signalled by shape, case, and glyph, never colour alone
24
24
  - **Design tokens included** — a shared colour palette (`colors`) and spacing scale (`spacing`) to keep every screen consistent
package/dist/index.d.ts CHANGED
@@ -54,17 +54,6 @@ type LoadingScreenProps = {
54
54
  };
55
55
  declare const LoadingScreen: ({ label }: LoadingScreenProps) => React.JSX.Element;
56
56
 
57
- type ScreenProps = {
58
- children: ReactNode;
59
- /**
60
- * Enter the terminal's alternate buffer so the app owns the whole screen and
61
- * the previous scrollback is restored on exit. Defaults to true. Set false to
62
- * render full-height inline instead.
63
- */
64
- altScreen?: boolean;
65
- };
66
- declare const Screen: ({ children, altScreen }: ScreenProps) => React.JSX.Element;
67
-
68
57
  type PanelProps = {
69
58
  /** Optional title shown in the panel's header row. */
70
59
  title?: string;
@@ -280,4 +269,4 @@ declare const spacing: {
280
269
  };
281
270
  type Spacing = (typeof spacing)[keyof typeof spacing];
282
271
 
283
- export { Alert, Badge, type BadgeVariant, Banner, type Color, type Column, Columns, ConfirmInput, EmailInput, FooterHints, Header, type Hint, type IconMode, KeyValue, LoadingScreen, MultiSelect, type NotifyOptions, OrderedList, Panel, PasswordInput, ProgressBar, Screen, ScrollView, Select, type SelectOption, SelectableRow, type Spacing, type Span, Spinner, StatusMessage, type StatusVariant, type StyledLine, Switch, type SwitchValue, type TabItem, Table, Tabs, TextInput, Toast, Toggle, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
272
+ export { Alert, Badge, type BadgeVariant, Banner, type Color, type Column, Columns, ConfirmInput, EmailInput, FooterHints, Header, type Hint, type IconMode, KeyValue, LoadingScreen, MultiSelect, type NotifyOptions, OrderedList, Panel, PasswordInput, ProgressBar, ScrollView, Select, type SelectOption, SelectableRow, type Spacing, type Span, Spinner, StatusMessage, type StatusVariant, type StyledLine, Switch, type SwitchValue, type TabItem, Table, Tabs, TextInput, Toast, Toggle, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { Box, Text, useStdout, useInput, measureElement } from 'ink';
1
+ import { Box, Text, useInput, measureElement } from 'ink';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import React9, { createContext, useContext, useState, useEffect, useRef, useLayoutEffect } from 'react';
3
+ import React8, { createContext, useContext, useState, useEffect, useRef, useLayoutEffect } from 'react';
4
4
  import cliSpinners from 'cli-spinners';
5
5
  import { glyphs } from '@kud/glyphs';
6
6
  import { spawn } from 'child_process';
@@ -73,30 +73,6 @@ var KeyValue = ({ label, value, labelWidth = 12 }) => /* @__PURE__ */ jsxs(Box,
73
73
  isTextValue(value) ? /* @__PURE__ */ jsx(Text, { children: value }) : value
74
74
  ] });
75
75
  var LoadingScreen = ({ label }) => /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Spinner, { label }) });
76
- var ENTER_ALT = "\x1B[?1049h";
77
- var LEAVE_ALT = "\x1B[?1049l";
78
- var Screen = ({ children, altScreen = true }) => {
79
- const { stdout } = useStdout();
80
- const [size, setSize] = useState({
81
- columns: stdout.columns || 80,
82
- rows: stdout.rows || 24
83
- });
84
- useEffect(() => {
85
- const restore = () => {
86
- if (altScreen) stdout.write(LEAVE_ALT);
87
- };
88
- if (altScreen) stdout.write(ENTER_ALT);
89
- const onResize = () => setSize({ columns: stdout.columns || 80, rows: stdout.rows || 24 });
90
- stdout.on("resize", onResize);
91
- process.on("exit", restore);
92
- return () => {
93
- stdout.off("resize", onResize);
94
- process.off("exit", restore);
95
- restore();
96
- };
97
- }, [stdout, altScreen]);
98
- return /* @__PURE__ */ jsx(Box, { width: size.columns, height: size.rows, flexDirection: "column", children });
99
- };
100
76
  var Panel = ({
101
77
  title,
102
78
  color = colors.info,
@@ -472,10 +448,10 @@ var OrderedListItem = ({ children, _index = 1 }) => /* @__PURE__ */ jsxs(Box, {
472
448
  ] });
473
449
  var OrderedListRoot = ({ children }) => {
474
450
  let n = 0;
475
- const numbered = React9.Children.map(children, (child) => {
476
- if (React9.isValidElement(child) && child.type === OrderedListItem) {
451
+ const numbered = React8.Children.map(children, (child) => {
452
+ if (React8.isValidElement(child) && child.type === OrderedListItem) {
477
453
  n += 1;
478
- return React9.cloneElement(child, {
454
+ return React8.cloneElement(child, {
479
455
  _index: n
480
456
  });
481
457
  }
@@ -716,4 +692,4 @@ var notify = (message, options = {}) => {
716
692
  child.unref();
717
693
  };
718
694
 
719
- export { Alert, Badge, Banner, Columns, ConfirmInput, EmailInput, FooterHints, Header, KeyValue, LoadingScreen, MultiSelect, OrderedList, Panel, PasswordInput, ProgressBar, Screen, ScrollView, Select, SelectableRow, Spinner, StatusMessage, Switch, Table, Tabs, TextInput, Toast, Toggle, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
695
+ export { Alert, Badge, Banner, Columns, ConfirmInput, EmailInput, FooterHints, Header, KeyValue, LoadingScreen, MultiSelect, OrderedList, Panel, PasswordInput, ProgressBar, ScrollView, Select, SelectableRow, Spinner, StatusMessage, Switch, Table, Tabs, TextInput, Toast, Toggle, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/ink-ui",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "React component library for Ink CLIs",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",