@textui/widgets 0.7.0 → 0.9.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.
Files changed (86) hide show
  1. package/dist/control/text-area.d.ts +2 -0
  2. package/dist/control/text-area.d.ts.map +1 -1
  3. package/dist/control/text-area.js +16 -8
  4. package/dist/control/text-input.d.ts.map +1 -1
  5. package/dist/control/text-input.js +6 -0
  6. package/dist/data/code-viewer.d.ts +2 -0
  7. package/dist/data/code-viewer.d.ts.map +1 -1
  8. package/dist/data/code-viewer.js +9 -1
  9. package/dist/data/index.d.ts +9 -0
  10. package/dist/data/index.d.ts.map +1 -1
  11. package/dist/data/index.js +8 -2
  12. package/dist/data/list.d.ts +9 -0
  13. package/dist/data/list.d.ts.map +1 -1
  14. package/dist/data/list.js +20 -3
  15. package/dist/data/markdown-view.d.ts.map +1 -1
  16. package/dist/data/markdown-view.js +4 -1
  17. package/dist/data/pagination.d.ts.map +1 -1
  18. package/dist/data/pagination.js +4 -1
  19. package/dist/data/tree.d.ts +2 -0
  20. package/dist/data/tree.d.ts.map +1 -1
  21. package/dist/data/tree.js +8 -2
  22. package/dist/display/card.d.ts.map +1 -1
  23. package/dist/display/card.js +12 -0
  24. package/dist/display/color-text.d.ts +13 -1
  25. package/dist/display/color-text.d.ts.map +1 -1
  26. package/dist/display/color-text.js +28 -6
  27. package/dist/display/font-text.d.ts +72 -0
  28. package/dist/display/font-text.d.ts.map +1 -0
  29. package/dist/display/font-text.js +35 -0
  30. package/dist/display/fonts.d.ts +138 -0
  31. package/dist/display/fonts.d.ts.map +1 -0
  32. package/dist/display/fonts.js +893 -0
  33. package/dist/display/gard.d.ts +26 -0
  34. package/dist/display/gard.d.ts.map +1 -0
  35. package/dist/display/gard.js +479 -0
  36. package/dist/display/index.d.ts +3 -0
  37. package/dist/display/index.d.ts.map +1 -1
  38. package/dist/display/index.js +7 -0
  39. package/dist/display/key-value.d.ts +25 -5
  40. package/dist/display/key-value.d.ts.map +1 -1
  41. package/dist/display/key-value.js +13 -3
  42. package/dist/display/marquee.d.ts.map +1 -1
  43. package/dist/display/marquee.js +16 -3
  44. package/dist/display/pagga.d.ts +29 -0
  45. package/dist/display/pagga.d.ts.map +1 -0
  46. package/dist/display/pagga.js +101 -0
  47. package/dist/display/pattern.d.ts +117 -0
  48. package/dist/display/pattern.d.ts.map +1 -0
  49. package/dist/display/pattern.js +257 -0
  50. package/dist/display/spinner.d.ts +2 -0
  51. package/dist/display/spinner.d.ts.map +1 -1
  52. package/dist/display/spinner.js +3 -2
  53. package/dist/navigation/menu.d.ts +11 -0
  54. package/dist/navigation/menu.d.ts.map +1 -1
  55. package/dist/navigation/menu.js +22 -9
  56. package/dist/navigation/tabs.d.ts +2 -0
  57. package/dist/navigation/tabs.d.ts.map +1 -1
  58. package/dist/navigation/tabs.js +12 -2
  59. package/dist/overlay/command-palette.d.ts.map +1 -1
  60. package/dist/overlay/command-palette.js +18 -6
  61. package/dist/shells/workbench-shell.d.ts.map +1 -1
  62. package/dist/shells/workbench-shell.js +5 -1
  63. package/package.json +2 -2
  64. package/src/control/text-area.ts +18 -7
  65. package/src/control/text-input.ts +6 -0
  66. package/src/data/code-viewer.ts +10 -1
  67. package/src/data/index.ts +9 -2
  68. package/src/data/list.ts +21 -3
  69. package/src/data/markdown-view.ts +7 -4
  70. package/src/data/pagination.ts +4 -1
  71. package/src/data/tree.ts +9 -2
  72. package/src/display/card.ts +12 -0
  73. package/src/display/color-text.ts +33 -10
  74. package/src/display/font-text.tsx +94 -0
  75. package/src/display/fonts.ts +990 -0
  76. package/src/display/gard.ts +475 -0
  77. package/src/display/index.ts +7 -0
  78. package/src/display/key-value.ts +44 -6
  79. package/src/display/marquee.ts +15 -3
  80. package/src/display/pagga.ts +102 -0
  81. package/src/display/pattern.tsx +427 -0
  82. package/src/display/spinner.ts +5 -2
  83. package/src/navigation/menu.ts +32 -9
  84. package/src/navigation/tabs.ts +13 -2
  85. package/src/overlay/command-palette.ts +13 -2
  86. package/src/shells/workbench-shell.ts +5 -1
@@ -439,7 +439,12 @@ export const CommandPalette = defineComponent<CommandPaletteProps>('CommandPalet
439
439
  // It is the one line in the panel that wraps rather than truncates,
440
440
  // because it is the one place a sentence can be read whole.
441
441
  const chosen = pending ? offered[index] : undefined;
442
- const detail = pending
442
+ // Nothing selectable is nothing to describe: the line under the list would
443
+ // otherwise keep the last answer's sentence, or repeat the question the row
444
+ // above has already asked.
445
+ const detail = rows.length === 0
446
+ ? ''
447
+ : pending
443
448
  ? chosen?.description
444
449
  ?? pending.arg.description
445
450
  ?? i18n.t(
@@ -549,6 +554,11 @@ export const CommandPalette = defineComponent<CommandPaletteProps>('CommandPalet
549
554
  descriptions: pending?.arg.descriptions ?? descriptions,
550
555
  interactive: false,
551
556
  activeId: rows[index],
557
+ // When the answer is a fixed set, the row above already says which kind
558
+ // of nothing this is and this would be the second line. Searching the
559
+ // command list has no such row, and there the menu's own line is the one
560
+ // that says it.
561
+ noMatch: pending ? false : undefined,
552
562
  onSelect: (id: string) => {
553
563
  const at = rows.indexOf(id);
554
564
  if (at >= 0) setHighlight(at);
@@ -560,7 +570,8 @@ export const CommandPalette = defineComponent<CommandPaletteProps>('CommandPalet
560
570
  // that shows only titles makes you run something to find out what it does.
561
571
  h('box', { direction: 'row', gap: 1, align: 'start' },
562
572
  h('text', { content: detail, fg: 'muted', flex: 1, wrap: 'word' }),
563
- h('text', { content: `${rows.length}`, fg: 'subtle' })),
573
+ // A zero beside an empty line is a number with nothing to count.
574
+ rows.length > 0 ? h('text', { content: `${rows.length}`, fg: 'subtle' }) : null),
564
575
  h('box', { direction: 'row', gap: 1 },
565
576
  h('text', {
566
577
  content: pending
@@ -28,7 +28,11 @@ export const WorkbenchShell = defineComponent<ShellProps>('WorkbenchShell', (pro
28
28
  height: '100%',
29
29
  bg: 'canvas',
30
30
  fg: 'text',
31
- border: theme.border,
31
+ // The frame is chrome, not text. A box that states an `fg` draws its
32
+ // border in it - which is right for `<box fg="danger" border="single">`
33
+ // and wrong here, where the `fg` is the application's text colour: it made
34
+ // every screen's outermost edge as bright as the words inside it.
35
+ border: { style: theme.border, color: 'border' },
32
36
  ...props,
33
37
  },
34
38
  h(SurfaceArea, { surface: 'header' }),