nish-ui 3.1.0 → 3.3.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 (107) hide show
  1. package/README.md +13 -6
  2. package/dist/base-tailwind.css +30 -15
  3. package/dist/base.css +30 -15
  4. package/dist/chart.js +2 -2
  5. package/dist/elements-all.js +78 -78
  6. package/dist/elements-charts.d.ts +1 -1
  7. package/dist/elements-charts.js +43 -42
  8. package/dist/elements-data.d.ts +10 -0
  9. package/dist/elements-data.js +4 -5
  10. package/dist/elements-forms.js +9 -9
  11. package/dist/elements.d.ts +1 -0
  12. package/dist/elements.js +4 -4
  13. package/dist/esm/chart-values.js +2 -1
  14. package/dist/esm/combobox-filter.js +6 -5
  15. package/dist/esm/command-filter.js +83 -0
  16. package/dist/esm/components/accordion.js +5 -3
  17. package/dist/esm/components/app-shell.js +9 -5
  18. package/dist/esm/components/breadcrumbs.js +8 -4
  19. package/dist/esm/components/calendar-base.js +33 -6
  20. package/dist/esm/components/calendar-classes.js +14 -2
  21. package/dist/esm/components/canvas/follow-caption.js +31 -21
  22. package/dist/esm/components/canvas/follow.js +5 -6
  23. package/dist/esm/components/canvas/minimap.js +3 -3
  24. package/dist/esm/components/canvas/system-canvas.js +3 -1
  25. package/dist/esm/components/canvas/view.js +0 -2
  26. package/dist/esm/components/carousel.js +2 -3
  27. package/dist/esm/components/charts.js +18 -7
  28. package/dist/esm/components/combobox.js +20 -9
  29. package/dist/esm/components/command.js +25 -63
  30. package/dist/esm/components/context-menu.js +2 -1
  31. package/dist/esm/components/data-classes.js +23 -8
  32. package/dist/esm/components/data.js +19 -10
  33. package/dist/esm/components/display.js +24 -15
  34. package/dist/esm/components/drawer.js +17 -4
  35. package/dist/esm/components/error-boundary.js +3 -3
  36. package/dist/esm/components/feedback.js +4 -4
  37. package/dist/esm/components/file-dropzone.js +39 -7
  38. package/dist/esm/components/filters.js +42 -1
  39. package/dist/esm/components/flow.js +12 -9
  40. package/dist/esm/components/forms-classes.js +3 -1
  41. package/dist/esm/components/forms.js +8 -6
  42. package/dist/esm/components/hooks.js +47 -13
  43. package/dist/esm/components/hover-card.js +2 -1
  44. package/dist/esm/components/inbox.js +9 -2
  45. package/dist/esm/components/latest.js +4 -2
  46. package/dist/esm/components/layout.js +7 -4
  47. package/dist/esm/components/menu.js +14 -1
  48. package/dist/esm/components/modal.js +17 -4
  49. package/dist/esm/components/multi-select.js +7 -7
  50. package/dist/esm/components/nav-classes.js +9 -0
  51. package/dist/esm/components/nav.js +32 -12
  52. package/dist/esm/components/navigate.js +1 -1
  53. package/dist/esm/components/overlay-dialog.js +35 -1
  54. package/dist/esm/components/pagination.js +1 -1
  55. package/dist/esm/components/primitives-classes.js +4 -4
  56. package/dist/esm/components/primitives.js +18 -5
  57. package/dist/esm/components/progress.js +2 -1
  58. package/dist/esm/components/radio-group.js +1 -1
  59. package/dist/esm/components/resource-classes.js +7 -3
  60. package/dist/esm/components/resource.js +17 -6
  61. package/dist/esm/components/segmented.js +2 -0
  62. package/dist/esm/components/separator.js +6 -1
  63. package/dist/esm/components/service-tokens.js +18 -7
  64. package/dist/esm/components/settings.js +21 -1
  65. package/dist/esm/components/slider.js +5 -1
  66. package/dist/esm/components/split.js +4 -2
  67. package/dist/esm/components/strings.js +17 -4
  68. package/dist/esm/components/table.js +15 -3
  69. package/dist/esm/components/tabs.js +3 -2
  70. package/dist/esm/components/tag-input.js +5 -1
  71. package/dist/esm/components/time-field.js +15 -7
  72. package/dist/esm/components/toast-card.js +5 -3
  73. package/dist/esm/components/toast-store.js +16 -4
  74. package/dist/esm/components/toast.js +4 -1
  75. package/dist/esm/components/tooltip.js +3 -2
  76. package/dist/esm/components/url-state.js +5 -2
  77. package/dist/esm/components/virtual-table.js +2 -2
  78. package/dist/esm/components/virtual.js +8 -4
  79. package/dist/esm/format.js +27 -4
  80. package/dist/esm/runtime.js +9 -2
  81. package/dist/esm/server/inbox/client.js +4 -0
  82. package/dist/esm/split-layout.js +2 -1
  83. package/dist/esm/theme.js +38 -15
  84. package/dist/esm/tokens.mjs +1 -1
  85. package/dist/format.d.ts +5 -3
  86. package/dist/format.js +36 -7
  87. package/dist/inbox-client.d.ts +6 -2
  88. package/dist/inbox-client.js +4 -1
  89. package/dist/index.d.ts +65 -30
  90. package/dist/nish-components.css +70 -23
  91. package/dist/nish-components.min.css +1 -1
  92. package/dist/nish.css +30 -15
  93. package/dist/nish.min.css +1 -1
  94. package/dist/node/vite.js +1 -1
  95. package/dist/server/hono.d.ts +10 -3
  96. package/dist/server/hono.js +108 -11
  97. package/dist/server/index.d.ts +21 -13
  98. package/dist/server/index.js +124 -29
  99. package/dist/service-tokens.d.ts +4 -4
  100. package/dist/{spa-7myD4xvA.d.ts → spa-FwS7yZ8p.d.ts} +36 -7
  101. package/dist/split-layout.js +2 -2
  102. package/dist/system-canvas.d.ts +11 -10
  103. package/dist/theme.d.ts +30 -2
  104. package/dist/theme.global.js +53 -21
  105. package/dist/theme.js +53 -20
  106. package/package.json +3 -2
  107. package/dist/tokens.js +0 -425
@@ -655,7 +655,7 @@
655
655
  /* --- Pill link (.nish-pill-link) -------------------------------------------------------
656
656
  The "← nish.software" pill at the top left of a header:
657
657
  <a class="nish-pill-link" href="https://nish.software" title="Back to nish.software">← nish.software</a>
658
- Also in base.css (nish.css), so pages that load only nish-components.css get it too.
658
+ Also in base.css, so pages that load only nish.css get it too.
659
659
  --compact: under 480px only the arrow shows, in a 44px circle; data-compact="always" at every width.
660
660
  <a class="nish-pill-link nish-pill-link--compact" href="/">&larr; <span class="nish-pill-link-label">Artifacts</span></a> */
661
661
  :where(.nish-pill-link) {
@@ -1013,7 +1013,7 @@
1013
1013
  :where(.nish-stats--4) {
1014
1014
  grid-template-columns: repeat(2, minmax(0, 1fr));
1015
1015
  }
1016
- @media (min-width: 640px) {
1016
+ @media (min-width: 768px) {
1017
1017
  :where(.nish-stats--4) {
1018
1018
  grid-template-columns: repeat(4, minmax(0, 1fr));
1019
1019
  }
@@ -1539,6 +1539,7 @@
1539
1539
  margin: auto auto 0;
1540
1540
  padding: 0 0 env(safe-area-inset-bottom);
1541
1541
  overflow-y: auto;
1542
+ overscroll-behavior: contain;
1542
1543
  border: 1px solid var(--nish-line);
1543
1544
  border-bottom: 0;
1544
1545
  border-radius: 16px 16px 0 0;
@@ -1638,7 +1639,7 @@
1638
1639
  z-index: var(--nish-z-tooltip, 100);
1639
1640
  display: none;
1640
1641
  width: max-content;
1641
- max-width: min(320px, 100vw - 16px);
1642
+ max-width: min(320px, 100vw - 32px);
1642
1643
  padding: 8px 12px;
1643
1644
  border: 1px solid var(--nish-line-strong);
1644
1645
  border-radius: var(--nish-radius-sm);
@@ -1652,9 +1653,20 @@
1652
1653
  text-align: start;
1653
1654
  text-transform: none;
1654
1655
  white-space: normal;
1655
- pointer-events: none;
1656
1656
  transform: translateX(-50%);
1657
1657
  }
1658
+ /* A transparent bridge over the 8px gap keeps the tip open while the pointer moves onto it (WCAG 1.4.13). */
1659
+ :where(.nish-tooltip) > :where(.nish-tooltip-content)::before {
1660
+ content: '';
1661
+ position: absolute;
1662
+ inset-inline: 0;
1663
+ top: 100%;
1664
+ height: 8px;
1665
+ }
1666
+ :where(.nish-tooltip--bottom) > :where(.nish-tooltip-content)::before {
1667
+ top: auto;
1668
+ bottom: 100%;
1669
+ }
1658
1670
  :where(.nish-tooltip--bottom) > :where(.nish-tooltip-content) {
1659
1671
  top: calc(100% + 8px);
1660
1672
  bottom: auto;
@@ -1695,7 +1707,8 @@
1695
1707
  <div class="nish-skeleton nish-skeleton--thumb"></div>
1696
1708
  <div class="nish-skeleton nish-skeleton--card"></div>
1697
1709
  </div>
1698
- The group is the live region: set aria-busy="false" (or remove the group) once loaded. */
1710
+ The group needs role="status" and visually hidden "Loading" text to be announced (aria-busy alone says nothing):
1711
+ set aria-busy="false" (or remove the group) once loaded. */
1699
1712
  :where(.nish-skeleton) {
1700
1713
  display: block;
1701
1714
  border-radius: var(--nish-radius-sm);
@@ -1796,13 +1809,8 @@
1796
1809
  border-color: color-mix(in srgb, var(--nish-on-loss) 35%, transparent);
1797
1810
  border-top-color: var(--nish-on-loss);
1798
1811
  }
1799
- @media (prefers-reduced-motion: reduce) {
1800
- :where(.nish-btn[aria-busy='true'])::after {
1801
- animation: nish-pulse 1.6s ease-in-out infinite !important;
1802
- animation-iteration-count: infinite !important;
1803
- animation-duration: 1.6s !important;
1804
- }
1805
- }
1812
+ /* Under reduced motion the busy ring pulses instead of turning; that rule lives in base.css
1813
+ (same layer as the reset it overrides, because !important reverses layer order). */
1806
1814
 
1807
1815
  /* --- Sheet (dialog.nish-sheet) ------------------------------------------------------
1808
1816
  A general dialog that is a bottom sheet under 640px and a centered panel from 640px.
@@ -1842,7 +1850,7 @@
1842
1850
  animation: nish-sheet-in 240ms var(--nish-ease-out, ease-out) both;
1843
1851
  }
1844
1852
  :where(.nish-sheet)::before {
1845
- /* The grab handle: a 44px target with a 40x4 bar, like the React Modal. */
1853
+ /* The grab handle: a 44px target (openSheet() starts a drag in the same top 44px) with a 40x4 bar, like the React Modal. */
1846
1854
  content: '';
1847
1855
  flex-shrink: 0;
1848
1856
  height: 44px;
@@ -1862,7 +1870,7 @@
1862
1870
  animation: nish-fade-out 200ms ease-in both;
1863
1871
  }
1864
1872
  /* The page behind a modal sheet does not scroll. */
1865
- :where(html:has(.nish-sheet[open])) {
1873
+ :where(html:has(.nish-sheet[open], dialog.nish-dialog[open], dialog.nish-command[open])) {
1866
1874
  overflow: hidden;
1867
1875
  }
1868
1876
  :where(.nish-sheet-header) {
@@ -2045,13 +2053,16 @@
2045
2053
  transform 150ms,
2046
2054
  background-color 150ms;
2047
2055
  }
2048
- /* Extends the touch target to 44px under a coarse pointer without moving layout. */
2056
+ /* Extends the touch target to 44x44 under a coarse pointer without moving layout (both the 36x20 and the 28x16 small track). */
2049
2057
  @media (pointer: coarse) {
2050
2058
  :where(.nish-switch)::before {
2051
2059
  content: '';
2052
2060
  position: absolute;
2053
2061
  inset: -12px -4px;
2054
2062
  }
2063
+ :where(.nish-switch--sm)::before {
2064
+ inset: -14px -8px;
2065
+ }
2055
2066
  :where(.nish-check-row) {
2056
2067
  align-items: center;
2057
2068
  min-height: var(--nish-tap-min, 44px);
@@ -2938,10 +2949,10 @@
2938
2949
  background: var(--nish-elevated);
2939
2950
  font-family: var(--nish-font-mono, ui-monospace, monospace);
2940
2951
  line-height: 1rem;
2941
- /* base.css styles the bare kbd element, which beats a zero-specificity class: !important wins. */
2942
- padding: 0 6px !important;
2943
- color: var(--nish-hi2) !important;
2944
- font-size: var(--nish-text-2xs) !important;
2952
+ /* This layer (nish.components) sits above nish.base, so these beat base.css's bare kbd rule without !important, and a site's own unlayered CSS can still restyle them. */
2953
+ padding: 0 6px;
2954
+ color: var(--nish-hi2);
2955
+ font-size: var(--nish-text-2xs);
2945
2956
  }
2946
2957
 
2947
2958
  /* --- Page header (.nish-page-header) ----------------------------------------------------
@@ -3311,8 +3322,32 @@
3311
3322
  min-height: 0;
3312
3323
  min-width: 0;
3313
3324
  }
3325
+ /* The tag chip's remove button (the React TAG_REMOVE_HIT): the visible button keeps its xs size and a centred 44px ::after takes the touch. */
3326
+ :where(span.nish-chip) > :where([data-nish-remove]) {
3327
+ min-width: 0;
3328
+ min-height: 0;
3329
+ position: relative;
3330
+ }
3331
+ :where(span.nish-chip) > :where([data-nish-remove])::after {
3332
+ content: '';
3333
+ position: absolute;
3334
+ left: 50%;
3335
+ top: 50%;
3336
+ width: 44px;
3337
+ height: 44px;
3338
+ transform: translate(-50%, -50%);
3339
+ border-radius: 50%;
3340
+ }
3314
3341
  :where(.nish-btn--link) {
3315
3342
  min-height: 0;
3343
+ position: relative;
3344
+ }
3345
+ /* The same invisible hit area as the React link Button (LINK_HIT): a 16px line grows 14px per side to 44px without moving the layout. */
3346
+ :where(.nish-btn--link)::after {
3347
+ content: '';
3348
+ position: absolute;
3349
+ inset-inline: -0.5rem;
3350
+ inset-block: -0.875rem;
3316
3351
  }
3317
3352
  /* Grown to 44px without growing the toast (the React toast's negative margins). */
3318
3353
  :where(.nish-toast-action) {
@@ -3816,7 +3851,7 @@
3816
3851
  gap: 4px;
3817
3852
  }
3818
3853
  :where(.nish-media-row--live .nish-media-row-badges)::before {
3819
- content: 'Live';
3854
+ content: var(--nish-live-label, 'Live');
3820
3855
  box-sizing: border-box;
3821
3856
  padding: 2px 8px;
3822
3857
  border: 1px solid color-mix(in srgb, var(--nish-loss) 30%, transparent);
@@ -4360,6 +4395,7 @@
4360
4395
  margin: 0;
4361
4396
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
4362
4397
  overflow: hidden;
4398
+ overscroll-behavior: contain;
4363
4399
  border: 1px solid var(--nish-line);
4364
4400
  border-radius: 0;
4365
4401
  background: var(--nish-surface);
@@ -4443,10 +4479,10 @@
4443
4479
  font-size: var(--nish-text-base);
4444
4480
  outline: none;
4445
4481
  }
4446
- /* Base :focus-visible (0,1,0) outranks the zero-specificity rule above, so !important keeps the borderless field row free of a ring. */
4482
+ /* This layer sits above nish.base, so it beats base's :focus-visible ring without !important; the row is borderless and has no ring. */
4447
4483
  :where(.nish-command-input) > :where(input),
4448
4484
  :where(input.nish-command-input) {
4449
- outline: none !important;
4485
+ outline: none;
4450
4486
  }
4451
4487
  :where(input.nish-command-input) {
4452
4488
  padding-inline: 16px;
@@ -4683,6 +4719,9 @@
4683
4719
  :where(.nish-switch--sm:dir(rtl):checked, .nish-switch--sm:dir(rtl)[aria-checked='true'])::after {
4684
4720
  transform: translateX(-12px);
4685
4721
  }
4722
+ :where(.nish-range-bar-current:dir(rtl)) {
4723
+ transform: translate(50%, -50%);
4724
+ }
4686
4725
  :where(.nish-subnav:dir(rtl), .nish-table-wrap--fade:dir(rtl), .nish-scroll-row:dir(rtl)) {
4687
4726
  -webkit-mask-image: linear-gradient(to left, var(--nish-fade-start), #000 24px, #000 calc(100% - 24px), var(--nish-fade-end));
4688
4727
  mask-image: linear-gradient(to left, var(--nish-fade-start), #000 24px, #000 calc(100% - 24px), var(--nish-fade-end));
@@ -4804,8 +4843,16 @@
4804
4843
  background: Highlight;
4805
4844
  color: HighlightText;
4806
4845
  }
4846
+ /* Masked icons are painted with a background, which forced colors turns into Canvas:
4847
+ pick a system colour so they stay visible. */
4848
+ :where(.nish-disclosure > summary)::before,
4849
+ :where(.nish-error-state)::before,
4807
4850
  :where(.nish-combobox-option[aria-selected='true'])::after {
4808
- background: currentColor;
4851
+ forced-color-adjust: none;
4852
+ background: CanvasText;
4853
+ }
4854
+ :where(.nish-combobox-option[aria-selected='true'][data-active])::after {
4855
+ background: HighlightText;
4809
4856
  }
4810
4857
  :where(.nish-badge) {
4811
4858
  border: 1px solid currentColor;