@kud/ink-ui 0.12.0 → 0.13.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/index.d.ts CHANGED
@@ -220,6 +220,17 @@ type ToggleSwitchProps = {
220
220
  };
221
221
  declare const ToggleSwitch: ({ on, label, onColor, offColor, }: ToggleSwitchProps) => React.JSX.Element;
222
222
 
223
+ type UpdateBannerProps = {
224
+ name: string;
225
+ current: string;
226
+ latest: string;
227
+ command: string;
228
+ onConfirm: () => void;
229
+ onDecline: () => void;
230
+ focused?: boolean;
231
+ };
232
+ declare const UpdateBanner: ({ name, current, latest, command, onConfirm, onDecline, focused, }: UpdateBannerProps) => React.JSX.Element;
233
+
223
234
  type ProgressBarProps = {
224
235
  value: number;
225
236
  width?: number;
@@ -279,4 +290,4 @@ declare const spacing: {
279
290
  };
280
291
  type Spacing = (typeof spacing)[keyof typeof spacing];
281
292
 
282
- 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, ToggleSwitch, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
293
+ 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, ToggleSwitch, UnorderedList, UpdateBanner, colors, getIconMode, notify, setIconMode, spacing };
package/dist/index.js CHANGED
@@ -601,6 +601,56 @@ var ToggleSwitch = ({
601
601
  label !== void 0 && /* @__PURE__ */ jsx(Text, { color: on ? onColor : void 0, dimColor: !on, children: label })
602
602
  ] });
603
603
  };
604
+ var UpdateBanner = ({
605
+ name,
606
+ current: current2,
607
+ latest,
608
+ command,
609
+ onConfirm,
610
+ onDecline,
611
+ focused = true
612
+ }) => {
613
+ useInput(
614
+ (input, key) => {
615
+ if (key.return || /^y$/i.test(input)) onConfirm();
616
+ else if (key.escape || /^n$/i.test(input)) onDecline();
617
+ },
618
+ { isActive: focused }
619
+ );
620
+ return /* @__PURE__ */ jsxs(
621
+ Box,
622
+ {
623
+ flexDirection: "column",
624
+ borderStyle: "round",
625
+ borderColor: colors.accent,
626
+ paddingX: 2,
627
+ paddingY: 1,
628
+ rowGap: 1,
629
+ children: [
630
+ /* @__PURE__ */ jsxs(Box, { columnGap: 1, children: [
631
+ /* @__PURE__ */ jsx(Text, { bold: true, color: colors.accent, children: "Update available" }),
632
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: name })
633
+ ] }),
634
+ /* @__PURE__ */ jsxs(Box, { columnGap: 1, children: [
635
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: current2 }),
636
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2192" }),
637
+ /* @__PURE__ */ jsx(Text, { bold: true, color: colors.success, children: latest })
638
+ ] }),
639
+ /* @__PURE__ */ jsxs(Box, { columnGap: 1, children: [
640
+ /* @__PURE__ */ jsx(Text, { backgroundColor: colors.accent, color: "black", bold: true, children: " Y " }),
641
+ /* @__PURE__ */ jsx(Text, { children: "upgrade now" }),
642
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\xB7" }),
643
+ /* @__PURE__ */ jsx(Text, { backgroundColor: "#2b323d", color: "#8fa3ad", children: " N " }),
644
+ /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
645
+ "later \u2014 run ",
646
+ command,
647
+ " yourself"
648
+ ] })
649
+ ] })
650
+ ]
651
+ }
652
+ );
653
+ };
604
654
  var ProgressBar = ({
605
655
  value,
606
656
  width = 20,
@@ -715,4 +765,4 @@ var notify = (message, options = {}) => {
715
765
  child.unref();
716
766
  };
717
767
 
718
- 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, ToggleSwitch, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
768
+ 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, ToggleSwitch, UnorderedList, UpdateBanner, colors, getIconMode, notify, setIconMode, spacing };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/ink-ui",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "React component library for Ink CLIs",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",