@kud/ink-ui 0.8.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
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
 
3
3
  type BannerProps = {
4
4
  title: string;
@@ -54,6 +54,27 @@ type LoadingScreenProps = {
54
54
  };
55
55
  declare const LoadingScreen: ({ label }: LoadingScreenProps) => React.JSX.Element;
56
56
 
57
+ type PanelProps = {
58
+ /** Optional title shown in the panel's header row. */
59
+ title?: string;
60
+ /** Accent colour for the border + title when focused. Defaults to the info token. */
61
+ color?: string;
62
+ /** When true the border brightens to `color` and the title gains a ● marker. */
63
+ focused?: boolean;
64
+ width?: number;
65
+ height?: number;
66
+ flexGrow?: number;
67
+ children: ReactNode;
68
+ };
69
+ declare const Panel: ({ title, color, focused, width, height, flexGrow, children, }: PanelProps) => React.JSX.Element;
70
+
71
+ type ColumnsProps = {
72
+ /** Horizontal gap between columns (character cells). Defaults to 1. */
73
+ gap?: number;
74
+ children: ReactNode;
75
+ };
76
+ declare const Columns: ({ gap, children }: ColumnsProps) => React.JSX.Element;
77
+
57
78
  type SelectableRowProps = {
58
79
  active?: boolean;
59
80
  marker?: string;
@@ -248,4 +269,4 @@ declare const spacing: {
248
269
  };
249
270
  type Spacing = (typeof spacing)[keyof typeof spacing];
250
271
 
251
- export { Alert, Badge, type BadgeVariant, Banner, type Color, type Column, ConfirmInput, EmailInput, FooterHints, Header, type Hint, type IconMode, KeyValue, LoadingScreen, MultiSelect, type NotifyOptions, OrderedList, 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 };
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
@@ -73,6 +73,31 @@ 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 Panel = ({
77
+ title,
78
+ color = colors.info,
79
+ focused = false,
80
+ width,
81
+ height,
82
+ flexGrow,
83
+ children
84
+ }) => /* @__PURE__ */ jsxs(
85
+ Box,
86
+ {
87
+ flexDirection: "column",
88
+ width,
89
+ height,
90
+ flexGrow,
91
+ borderStyle: "round",
92
+ borderColor: focused ? color : colors.muted,
93
+ overflow: "hidden",
94
+ children: [
95
+ title && /* @__PURE__ */ jsx(Text, { color: focused ? color : colors.muted, bold: true, children: focused ? `${title} \u25CF` : title }),
96
+ children
97
+ ]
98
+ }
99
+ );
100
+ var Columns = ({ gap = 1, children }) => /* @__PURE__ */ jsx(Box, { flexDirection: "row", gap, flexGrow: 1, children });
76
101
  var isTextValue2 = (value) => typeof value === "string" || typeof value === "number";
77
102
  var SelectableRow = ({
78
103
  active = false,
@@ -667,4 +692,4 @@ var notify = (message, options = {}) => {
667
692
  child.unref();
668
693
  };
669
694
 
670
- export { Alert, Badge, Banner, ConfirmInput, EmailInput, FooterHints, Header, KeyValue, LoadingScreen, MultiSelect, OrderedList, PasswordInput, ProgressBar, 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.8.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",