neba 1.7.0 → 1.8.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 (74) hide show
  1. package/README.md +7 -7
  2. package/dist/components/app-logo/AppLogo.d.ts +148 -0
  3. package/dist/components/app-logo/AppLogo.js +1 -0
  4. package/dist/components/app-logo/index.d.ts +2 -0
  5. package/dist/components/app-logo/index.js +1 -0
  6. package/dist/components/avatar/Avatar.js +1 -1
  7. package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
  8. package/dist/components/code-block/CodeBlock.d.ts +170 -0
  9. package/dist/components/code-block/CodeBlock.js +1 -0
  10. package/dist/components/code-block/index.d.ts +2 -0
  11. package/dist/components/code-block/index.js +1 -0
  12. package/dist/components/color-picker/ColorPicker.d.ts +1 -1
  13. package/dist/components/drawer/Drawer.js +1 -1
  14. package/dist/components/footer/Footer.d.ts +85 -0
  15. package/dist/components/footer/Footer.js +1 -0
  16. package/dist/components/footer/index.d.ts +2 -0
  17. package/dist/components/footer/index.js +1 -0
  18. package/dist/components/header/Header.d.ts +114 -0
  19. package/dist/components/header/Header.js +1 -0
  20. package/dist/components/header/index.d.ts +2 -0
  21. package/dist/components/header/index.js +1 -0
  22. package/dist/components/how-to-steps/HowToSteps.d.ts +167 -0
  23. package/dist/components/how-to-steps/HowToSteps.js +1 -0
  24. package/dist/components/how-to-steps/index.d.ts +2 -0
  25. package/dist/components/how-to-steps/index.js +1 -0
  26. package/dist/components/page-layout/PageLayout.d.ts +144 -0
  27. package/dist/components/page-layout/PageLayout.js +1 -0
  28. package/dist/components/page-layout/index.d.ts +2 -0
  29. package/dist/components/page-layout/index.js +1 -0
  30. package/dist/components/sidebar/Sidebar.d.ts +144 -0
  31. package/dist/components/sidebar/Sidebar.js +1 -0
  32. package/dist/components/sidebar/SidebarTrigger.d.ts +36 -0
  33. package/dist/components/sidebar/SidebarTrigger.js +1 -0
  34. package/dist/components/sidebar/index.d.ts +4 -0
  35. package/dist/components/sidebar/index.js +1 -0
  36. package/dist/index.d.ts +7 -0
  37. package/dist/index.js +1 -1
  38. package/dist/internal/bottom-navigation.d.ts +4 -3
  39. package/dist/internal/chart.d.ts +3 -2
  40. package/dist/internal/color.d.ts +2 -2
  41. package/dist/internal/date.d.ts +3 -4
  42. package/dist/internal/highlight.d.ts +97 -0
  43. package/dist/internal/highlight.js +1 -0
  44. package/dist/internal/i18n.d.ts +85 -0
  45. package/dist/internal/i18n.js +1 -1
  46. package/dist/internal/icons.d.ts +20 -0
  47. package/dist/internal/icons.js +1 -1
  48. package/dist/internal/initials.d.ts +24 -0
  49. package/dist/internal/initials.js +1 -0
  50. package/dist/internal/page-layout.d.ts +143 -0
  51. package/dist/internal/page-layout.js +1 -0
  52. package/dist/internal/styles.d.ts +11 -0
  53. package/dist/internal/styles.js +1 -1
  54. package/dist/locales/ar.js +1 -1
  55. package/dist/locales/de.js +1 -1
  56. package/dist/locales/es.js +1 -1
  57. package/dist/locales/fr.js +1 -1
  58. package/dist/locales/hi.js +1 -1
  59. package/dist/locales/id.js +1 -1
  60. package/dist/locales/it.js +1 -1
  61. package/dist/locales/ja.js +1 -1
  62. package/dist/locales/ko.js +1 -1
  63. package/dist/locales/nl.js +1 -1
  64. package/dist/locales/pl.js +1 -1
  65. package/dist/locales/pt.js +1 -1
  66. package/dist/locales/ru.js +1 -1
  67. package/dist/locales/th.js +1 -1
  68. package/dist/locales/tr.js +1 -1
  69. package/dist/locales/vi.js +1 -1
  70. package/dist/locales/zh-hans.js +1 -1
  71. package/dist/locales/zh-hant.js +1 -1
  72. package/dist/styles.css +1 -1
  73. package/dist/tailwind.css +473 -0
  74. package/package.json +8 -7
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import type { IconButtonProps } from '../icon-button/IconButton.js';
3
+ import type { PageLayoutCollapse, SidebarSide } from '../../internal/page-layout.js';
4
+ export interface SidebarTriggerProps extends Omit<IconButtonProps, 'icon' | 'label'> {
5
+ /** Which of the layout's two sidebars it opens. @default 'start' */
6
+ side?: SidebarSide;
7
+ /**
8
+ * The width below which the button appears — the same one the sidebar
9
+ * collapses at, since the button exists exactly while the sidebar does not.
10
+ * Inherited from the [PageLayout], which is where it should be set.
11
+ */
12
+ collapseBelow?: PageLayoutCollapse;
13
+ /** The glyph. A hamburger, drawn here, unless something else is given. */
14
+ icon?: React.ReactNode;
15
+ /** What it does, in words. Defaults to the `locale`'s "Open sidebar" / "Close sidebar". */
16
+ label?: string;
17
+ /** Which language that word is in. Inherited from the [PageLayout]. */
18
+ locale?: string;
19
+ }
20
+ /**
21
+ * The button that brings back a [Sidebar] the window has become too narrow to
22
+ * hold.
23
+ *
24
+ * It is drawn only while that is true, and the "while" is a media query rather
25
+ * than a piece of state: the button carries a class that hides it at and above
26
+ * the breakpoint. That matters more than it looks — a trigger whose presence
27
+ * depended on `matchMedia` would be absent from the markup a server sends and
28
+ * would pop into the header a moment after the page arrived, on every phone,
29
+ * every time.
30
+ *
31
+ * Put it in a [Header]'s `brand` slot, ahead of the logo, which is where thirty
32
+ * years of hamburgers have taught readers to look for it. It has to be inside a
33
+ * [PageLayout] to have something to open; outside one there is no sidebar it
34
+ * could be talking about, and it renders nothing.
35
+ */
36
+ export declare const SidebarTrigger: React.ForwardRefExoticComponent<SidebarTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{IconButton as o}from"../icon-button/IconButton.js";import{layoutMessages as t,useMessages as n}from"../../internal/i18n.js";import{collapsedOnlyClasses as a,PageLayoutContext as i}from"../../internal/page-layout.js";import{cx as l}from"../../internal/styles.js";function s(){return e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:e("path",{d:"M4 7h16M4 12h16M4 17h16",strokeLinecap:"round"})})}export const SidebarTrigger=/*@__PURE__*/r.forwardRef(function({side:c="start",collapseBelow:p,icon:m,label:u,locale:d,variant:f="text",className:h,onClick:x,...b},j){const k=r.useContext(i),g=d??k.locale,v=n(t,g);if(!k.present)return null;const w=p??k.collapseBelow,B=k.open[c];return e(o,{ref:j,variant:f,icon:m??e(s,{}),label:u??(B?v.closeSidebar:v.openSidebar),"aria-expanded":B,className:l(a[w],h),onClick:e=>{k.setOpen(c,!B),x?.(e)},...b})});
@@ -0,0 +1,4 @@
1
+ export { Sidebar } from './Sidebar.js';
2
+ export type { SidebarProps, SidebarSide } from './Sidebar.js';
3
+ export { SidebarTrigger } from './SidebarTrigger.js';
4
+ export type { SidebarTriggerProps } from './SidebarTrigger.js';
@@ -0,0 +1 @@
1
+ export{Sidebar}from"./Sidebar.js";export{SidebarTrigger}from"./SidebarTrigger.js";
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from './types.js';
2
2
  export * from './components/accordion/index.js';
3
3
  export * from './components/alert/index.js';
4
4
  export * from './components/animate-appear/index.js';
5
+ export * from './components/app-logo/index.js';
5
6
  export * from './components/animate-blink/index.js';
6
7
  export * from './components/animate-fade/index.js';
7
8
  export * from './components/animate-grow/index.js';
@@ -28,6 +29,7 @@ export * from './components/carousel/index.js';
28
29
  export * from './components/chat-bubble/index.js';
29
30
  export * from './components/checkbox/index.js';
30
31
  export * from './components/chip/index.js';
32
+ export * from './components/code-block/index.js';
31
33
  export * from './components/collapsible/index.js';
32
34
  export * from './components/color-picker/index.js';
33
35
  export * from './components/combobox/index.js';
@@ -44,9 +46,12 @@ export * from './components/file-picker/index.js';
44
46
  export * from './components/grid/index.js';
45
47
  export * from './components/floating-action-button/index.js';
46
48
  export * from './components/floating-bottom-navigation/index.js';
49
+ export * from './components/footer/index.js';
47
50
  export * from './components/grid-container/index.js';
51
+ export * from './components/header/index.js';
48
52
  export * from './components/heatmap-chart/index.js';
49
53
  export * from './components/highlight/index.js';
54
+ export * from './components/how-to-steps/index.js';
50
55
  export * from './components/icon/index.js';
51
56
  export * from './components/icon-button/index.js';
52
57
  export * from './components/line-chart/index.js';
@@ -56,6 +61,7 @@ export * from './components/mockup/index.js';
56
61
  export * from './components/number-field/index.js';
57
62
  export * from './components/otp-field/index.js';
58
63
  export * from './components/overlay/index.js';
64
+ export * from './components/page-layout/index.js';
59
65
  export * from './components/pagination/index.js';
60
66
  export * from './components/panes/index.js';
61
67
  export * from './components/pie-chart/index.js';
@@ -71,6 +77,7 @@ export * from './components/scroll-zone/index.js';
71
77
  export * from './components/segmented-button/index.js';
72
78
  export * from './components/select/index.js';
73
79
  export * from './components/shortcut/index.js';
80
+ export * from './components/sidebar/index.js';
74
81
  export * from './components/skeleton/index.js';
75
82
  export * from './components/slider/index.js';
76
83
  export * from './components/sparkline/index.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./types.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/animate-appear/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/area-chart/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/badge/index.js";export*from"./components/bar-chart/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/collapsible/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/container/index.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/dialog/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/file-picker/index.js";export*from"./components/grid/index.js";export*from"./components/floating-action-button/index.js";export*from"./components/floating-bottom-navigation/index.js";export*from"./components/grid-container/index.js";export*from"./components/heatmap-chart/index.js";export*from"./components/highlight/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/line-chart/index.js";export*from"./components/list/index.js";export*from"./components/menu/index.js";export*from"./components/mockup/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pie-chart/index.js";export*from"./components/pill/index.js";export*from"./components/popover/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/radio-group/index.js";export*from"./components/rating/index.js";export*from"./components/scatter-chart/index.js";export*from"./components/scroll-zone/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/shortcut/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/sparkline/index.js";export*from"./components/spoiler/index.js";export*from"./components/statistic/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/timeline-chart/index.js";export*from"./components/toast/index.js";export*from"./components/toolbar/index.js";export*from"./components/tooltip/index.js";export*from"./components/tree-view/index.js";export*from"./components/typography/index.js";export*from"./components/window-pane/index.js";
1
+ export*from"./types.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/animate-appear/index.js";export*from"./components/app-logo/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/area-chart/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/badge/index.js";export*from"./components/bar-chart/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/code-block/index.js";export*from"./components/collapsible/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/container/index.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/dialog/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/file-picker/index.js";export*from"./components/grid/index.js";export*from"./components/floating-action-button/index.js";export*from"./components/floating-bottom-navigation/index.js";export*from"./components/footer/index.js";export*from"./components/grid-container/index.js";export*from"./components/header/index.js";export*from"./components/heatmap-chart/index.js";export*from"./components/highlight/index.js";export*from"./components/how-to-steps/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/line-chart/index.js";export*from"./components/list/index.js";export*from"./components/menu/index.js";export*from"./components/mockup/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/page-layout/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pie-chart/index.js";export*from"./components/pill/index.js";export*from"./components/popover/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/radio-group/index.js";export*from"./components/rating/index.js";export*from"./components/scatter-chart/index.js";export*from"./components/scroll-zone/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/shortcut/index.js";export*from"./components/sidebar/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/sparkline/index.js";export*from"./components/spoiler/index.js";export*from"./components/statistic/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/timeline-chart/index.js";export*from"./components/toast/index.js";export*from"./components/toolbar/index.js";export*from"./components/tooltip/index.js";export*from"./components/tree-view/index.js";export*from"./components/typography/index.js";export*from"./components/window-pane/index.js";
@@ -9,9 +9,10 @@ export type BottomNavigationValue = string | number;
9
9
  * who has not used the app before, and the default on the bar that spans an
10
10
  * edge of the window.
11
11
  * - `selected` — only the destination that is current. The bar keeps its height
12
- * either way, because the named one is always the tallest; what changes is
13
- * how much of the row is words. The names the other items lose are still in
14
- * the document for a screen reader.
12
+ * either way: every item holds a line open for its name whether or not the
13
+ * name is drawn there, so what travels when the reader moves between two
14
+ * destinations is width and nothing else. The names the other items lose are
15
+ * still in the document for a screen reader.
15
16
  * - `none` — glyphs only, with every name read out but never drawn.
16
17
  */
17
18
  export type BottomNavigationLabels = 'all' | 'selected' | 'none';
@@ -11,8 +11,9 @@
11
11
  * knows is data and pixels; `chart-frame.tsx` is where those become elements.
12
12
  *
13
13
  * The scales are deliberately not a `d3-scale`. A linear scale is six lines, a
14
- * band scale is four, and `nice numbers` is twelve — and the package still has
15
- * one runtime dependency, which is the same trade `color.ts` makes.
14
+ * band scale is four, and `nice numbers` is twelve — against a charting stack
15
+ * that would be the largest thing in the package. The same trade `color.ts`
16
+ * makes.
16
17
  */
17
18
  import type * as React from 'react';
18
19
  import type { NebaChartCategory, NebaChartDatum, NebaChartSeries, NebaDensity, NebaSize } from '../types.js';
@@ -4,8 +4,8 @@
4
4
  * ColorPicker is the only component that has to *compute* a colour rather than
5
5
  * name one, and the whole of what it needs is here: three representations, the
6
6
  * conversions between them, one parser and one formatter. It is a hundred lines
7
- * of trigonometry-free arithmetic, which is the entire reason the library still
8
- * has one runtime dependency.
7
+ * of trigonometry-free arithmetic, which is the entire reason a component that
8
+ * computes colours brings no colour library with it.
9
9
  *
10
10
  * Two decisions worth knowing before reading:
11
11
  *
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * The arithmetic and the naming the four pickers share.
3
3
  *
4
- * No date library under it, deliberately. Neba's one runtime dependency is Base
5
- * UI, and a component library that quietly adds `date-fns` — or worse, picks a
6
- * side in the dayjs/luxon/Temporal argument on its consumer's behalf — has made
7
- * a decision that was not its to make. Everything here is either `Date`
4
+ * No date library under it, deliberately. A component library that quietly adds
5
+ * `date-fns` — or worse, picks a side in the dayjs/luxon/Temporal argument on
6
+ * its consumer's behalf — has made a decision that was not its to make. Everything here is either `Date`
8
7
  * arithmetic, which is a dozen lines, or `Intl`, which the platform already
9
8
  * ships and which knows more about month names in more languages than any
10
9
  * bundled table ever will.
@@ -0,0 +1,97 @@
1
+ /**
2
+ * The grammar engine behind [CodeBlock], and the only thing in the library that
3
+ * is loaded rather than imported.
4
+ *
5
+ * highlight.js is the second runtime dependency Neba has, and it is here for a
6
+ * reason no amount of hand-written regex answers: colouring a language means
7
+ * knowing that language, and there are thirty-four of them. It is reached
8
+ * through `highlight.js/lib/core` plus one module per language — never through
9
+ * the package root, which is all hundred and ninety at once.
10
+ *
11
+ * **Every one of those specifiers is behind an `import()`, and that is the
12
+ * whole design.** A bundler resolves it at build time and emits it as its own
13
+ * chunk, so a page that imports CodeBlock and never highlights anything — a
14
+ * one-line `npm install` with `highlight={false}` — downloads none of it, and a
15
+ * page that highlights TypeScript downloads the core and TypeScript and not the
16
+ * other thirty-three. A component that does the same with a static import
17
+ * spends forty kilobytes before it has drawn a character.
18
+ *
19
+ * The dependency is a real `dependencies` entry rather than an optional peer
20
+ * because a specifier a bundler cannot resolve fails the *whole* build, not
21
+ * just the part that would have used it: Rollup walks and resolves `Code
22
+ * Block.js` while it is still deciding whether to keep it. An optional peer
23
+ * would mean `import { Button } from 'neba'` breaking for anyone who had not
24
+ * installed a syntax highlighter.
25
+ *
26
+ * What comes back out of here is not HTML. highlight.js emits a string of
27
+ * nested `<span>`s, and CodeBlock needs lines — a line is what carries a
28
+ * number, a prompt and a place in a scroll — so `tokenize` turns that string
29
+ * into runs of text with a class on them, split at every newline. That also
30
+ * means nothing in the library ever writes `dangerouslySetInnerHTML`.
31
+ */
32
+ /** One run of text with a single colour: the innermost span highlight.js drew. */
33
+ export interface CodeToken {
34
+ text: string;
35
+ /** The class highlight.js put on it — `hljs-keyword`, `hljs-title function_`. */
36
+ token?: string;
37
+ }
38
+ /** One line of code, as the runs it is made of. An empty array is a blank line. */
39
+ export type CodeLine = CodeToken[];
40
+ /** The core, and what it hands `registerLanguage`. Opaque here; only hljs reads them. */
41
+ type Hljs = typeof import('highlight.js/lib/core').default;
42
+ type LanguageDefinition = Parameters<Hljs['registerLanguage']>[1];
43
+ /**
44
+ * Teaches CodeBlock a language the built-in set does not have.
45
+ *
46
+ * The same arrangement `registerMessages` makes for the eighteen languages the
47
+ * library does not ship, and for the same reason: highlight.js knows a hundred
48
+ * and ninety grammars, a documentation site uses six, and the thirty-four here
49
+ * are a guess at which six. Registering is how a Nix flake or an Elixir project
50
+ * gets coloured without the other hundred and fifty being in anyone's build.
51
+ *
52
+ * ```ts
53
+ * import { registerLanguage } from 'neba';
54
+ * import elixir from 'highlight.js/lib/languages/elixir';
55
+ *
56
+ * registerLanguage('elixir', elixir);
57
+ * ```
58
+ *
59
+ * Call it at module scope. A language registered after a block has drawn does
60
+ * not repaint that block — nothing re-renders on its own — but every block
61
+ * mounted after it sees it.
62
+ *
63
+ * @param name What `language` will be written as. Registering a name the
64
+ * library already has replaces it.
65
+ * @param definition The default export of a `highlight.js/lib/languages/*`
66
+ * module.
67
+ */
68
+ export declare function registerLanguage(name: string, definition: LanguageDefinition): void;
69
+ /** The canonical name a caller's spelling means, whether or not it can be loaded. */
70
+ export declare function canonicalLanguage(language: string | undefined): string | null;
71
+ /**
72
+ * Colours `code`, or returns `null` when the language is unknown or the chunk
73
+ * has not arrived yet.
74
+ *
75
+ * Highlighting the block as a whole and splitting afterwards, never line by
76
+ * line: a block comment, a template literal and a heredoc all span lines, and a
77
+ * highlighter handed one line at a time sees the second line of a comment as
78
+ * code.
79
+ */
80
+ export declare function highlight(code: string, language: string): Promise<CodeLine[] | null>;
81
+ /**
82
+ * highlight.js's own markup, as lines of coloured runs.
83
+ *
84
+ * The output is a strictly nested tree of `<span class="…">` with escaped text
85
+ * between, and a span may cross a newline — which is exactly why this exists
86
+ * rather than a `split('\n')` over the string. Walking it keeps the open class
87
+ * across the break and reopens it on the next line.
88
+ *
89
+ * Only the innermost class survives a nesting. In the browser it is the one on
90
+ * the element the text actually sits in, so it is the one whose colour applies;
91
+ * keeping the ancestors would put two equally specific rules on one run and let
92
+ * stylesheet order decide the colour.
93
+ */
94
+ export declare function tokenize(html: string): CodeLine[];
95
+ /** The same shape with no colour in it: what a block draws before its chunk lands. */
96
+ export declare function plainLines(code: string): CodeLine[];
97
+ export {};
@@ -0,0 +1 @@
1
+ const i={bash:()=>import("highlight.js/lib/languages/bash"),c:()=>import("highlight.js/lib/languages/c"),cpp:()=>import("highlight.js/lib/languages/cpp"),csharp:()=>import("highlight.js/lib/languages/csharp"),css:()=>import("highlight.js/lib/languages/css"),diff:()=>import("highlight.js/lib/languages/diff"),dockerfile:()=>import("highlight.js/lib/languages/dockerfile"),go:()=>import("highlight.js/lib/languages/go"),graphql:()=>import("highlight.js/lib/languages/graphql"),ini:()=>import("highlight.js/lib/languages/ini"),java:()=>import("highlight.js/lib/languages/java"),javascript:()=>import("highlight.js/lib/languages/javascript"),json:()=>import("highlight.js/lib/languages/json"),kotlin:()=>import("highlight.js/lib/languages/kotlin"),less:()=>import("highlight.js/lib/languages/less"),lua:()=>import("highlight.js/lib/languages/lua"),makefile:()=>import("highlight.js/lib/languages/makefile"),markdown:()=>import("highlight.js/lib/languages/markdown"),objectivec:()=>import("highlight.js/lib/languages/objectivec"),perl:()=>import("highlight.js/lib/languages/perl"),php:()=>import("highlight.js/lib/languages/php"),plaintext:()=>import("highlight.js/lib/languages/plaintext"),powershell:()=>import("highlight.js/lib/languages/powershell"),python:()=>import("highlight.js/lib/languages/python"),r:()=>import("highlight.js/lib/languages/r"),ruby:()=>import("highlight.js/lib/languages/ruby"),rust:()=>import("highlight.js/lib/languages/rust"),scss:()=>import("highlight.js/lib/languages/scss"),shell:()=>import("highlight.js/lib/languages/shell"),sql:()=>import("highlight.js/lib/languages/sql"),swift:()=>import("highlight.js/lib/languages/swift"),typescript:()=>import("highlight.js/lib/languages/typescript"),xml:()=>import("highlight.js/lib/languages/xml"),yaml:()=>import("highlight.js/lib/languages/yaml")},t={"c++":"cpp",cc:"cpp",cjs:"javascript",console:"bash",cs:"csharp",cts:"typescript",docker:"dockerfile",gql:"graphql",golang:"go",h:"cpp",hpp:"cpp",htm:"xml",html:"xml",js:"javascript",jsx:"javascript",kt:"kotlin",kts:"kotlin",md:"markdown",mdx:"markdown",mjs:"javascript",mm:"objectivec",mts:"typescript",mysql:"sql",node:"javascript",none:"plaintext",objc:"objectivec",plain:"plaintext",posh:"powershell",ps1:"powershell",psql:"sql",py:"python",rb:"ruby",rs:"rust",sh:"bash",svelte:"xml",svg:"xml",text:"plaintext",toml:"ini",ts:"typescript",tsx:"typescript",txt:"plaintext",vue:"xml",yml:"yaml",zsh:"bash"},l=new Map;export function registerLanguage(i,t){const g=i.toLowerCase();l.set(g,t),s.delete(g)}let g=null;const s=new Map;export function canonicalLanguage(i){if(!i)return null;const l=i.trim().toLowerCase();return l?t[l]??l:null}export async function highlight(t,a){let e=s.get(a);e||(e=async function(t){const s=l.get(t),a=s?void 0:i[t];if(!s&&!a)return null;g??=import("highlight.js/lib/core").then(i=>i.default);const e=await g;return s?e.registerLanguage(t,s):e.getLanguage(t)||e.registerLanguage(t,(await a()).default),t}(a),s.set(a,e));const h=await e;if(!h||!g)return null;return tokenize((await g).highlight(t,{language:h,ignoreIllegals:!0}).value)}const a={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'"};export function tokenize(i){const t=[[]],l=[],g=/<span class="([^"]*)">|<\/span>/g;let s=0;const e=i=>{if(!i)return;const g=l[l.length-1];i.replace(/&(?:amp|lt|gt|quot|#x27);/g,i=>a[i]).split("\n").forEach((i,l)=>{l>0&&t.push([]),i&&t[t.length-1].push(g?{text:i,token:g}:{text:i})})};for(const t of i.matchAll(g))e(i.slice(s,t.index)),s=t.index+t[0].length,void 0===t[1]?l.pop():l.push(t[1]);return e(i.slice(s)),t}export function plainLines(i){return i.split("\n").map(i=>i?[{text:i}]:[])}
@@ -314,6 +314,85 @@ export interface WindowMessages {
314
314
  }
315
315
  /** The `window` namespace, as WindowPane read it. */
316
316
  export declare const windowMessages: MessageTable<WindowMessages>;
317
+ /**
318
+ * PageLayout, Header, Footer and Sidebar.
319
+ *
320
+ * A layout draws almost no text of its own — a header says whatever it was
321
+ * handed — so what is here is only the words that exist *because* the page has
322
+ * a structure: the link that jumps past it, the name of the region a reader
323
+ * lands in, and the button that puts a sidebar back on screen once the window
324
+ * is too narrow to hold one.
325
+ */
326
+ export interface LayoutMessages {
327
+ /**
328
+ * The link that jumps a keyboard reader past the header and the sidebars,
329
+ * drawn only while it holds the focus. It is the first thing in the document
330
+ * and, on a page with forty links in its navigation, the difference between
331
+ * reaching the article and tabbing through the site map first.
332
+ */
333
+ skipToContent: string;
334
+ /** Names the `<aside>` when the caller gives it no name of its own. */
335
+ sidebar: string;
336
+ /** The button that brings back a sidebar the window has become too narrow to hold. */
337
+ openSidebar: string;
338
+ /** And the one that puts it away again. */
339
+ closeSidebar: string;
340
+ /** Names the edge a pointer drags to make a sidebar wider or narrower. */
341
+ resizeSidebar: string;
342
+ }
343
+ /** The `layout` namespace, as PageLayout and Sidebar read it. */
344
+ export declare const layoutMessages: MessageTable<LayoutMessages>;
345
+ /**
346
+ * CodeBlock.
347
+ *
348
+ * The one component in the library whose chrome sits *on* the content rather
349
+ * than beside it: a code block's buttons are inside the block, over the code,
350
+ * and a reader who cannot see them still has to be told what they do.
351
+ */
352
+ export interface CodeMessages {
353
+ /** Names the block itself — the scrollable region, and the fallback when no `title` is given. */
354
+ code: string;
355
+ /** The button that puts the code on the clipboard. */
356
+ copy: string;
357
+ /** What that button says once it has. */
358
+ copied: string;
359
+ /** And what it says when the browser refused — a page served over plain HTTP, mostly. */
360
+ copyFailed: string;
361
+ /** The toggle that drops the colouring and shows the characters as they are. */
362
+ raw: string;
363
+ /** What is read out in place of a prompt symbol, which is decoration and not code. */
364
+ prompt: string;
365
+ }
366
+ /** The `code` namespace, as CodeBlock reads it. */
367
+ export declare const codeMessages: MessageTable<CodeMessages>;
368
+ /**
369
+ * HowToSteps.
370
+ *
371
+ * Five words and a pair of counted sentences. The counted ones carry `{index}`,
372
+ * `{total}` and `{title}`, so a language that puts the number after the noun
373
+ * can, which is the whole reason they are strings with slots rather than
374
+ * numbers the component concatenates.
375
+ */
376
+ export interface StepsMessages {
377
+ /** The button that goes back one step. */
378
+ previous: string;
379
+ /** The one that goes forward. */
380
+ next: string;
381
+ /** And what it becomes on the last step. */
382
+ done: string;
383
+ /** The button under a finished guide. */
384
+ restart: string;
385
+ /** What a finished guide says. */
386
+ completed: string;
387
+ /** Names the list of steps for a screen reader. */
388
+ steps: string;
389
+ /** The counter over the step's body — `{index}` of `{total}`. */
390
+ position: string;
391
+ /** How one row in the list is announced. */
392
+ step: string;
393
+ }
394
+ /** The `steps` namespace, as HowToSteps reads it. */
395
+ export declare const stepsMessages: MessageTable<StepsMessages>;
317
396
  /**
318
397
  * One namespace's strings for a locale, merged over English.
319
398
  *
@@ -379,6 +458,12 @@ export interface NebaLocale {
379
458
  overlay?: Partial<OverlayMessages>;
380
459
  /** Window. */
381
460
  window?: Partial<WindowMessages>;
461
+ /** Layout. */
462
+ layout?: Partial<LayoutMessages>;
463
+ /** Code. */
464
+ code?: Partial<CodeMessages>;
465
+ /** Steps. */
466
+ steps?: Partial<StepsMessages>;
382
467
  }
383
468
  /**
384
469
  * Teaches the library a language.
@@ -1 +1 @@
1
- import*as e from"react";export const actionMessages={"":{close:"Close",dismiss:"Dismiss",clear:"Clear",remove:"Remove"}};export const linkMessages={"":{newTab:"(opens in a new tab)"}};export const spoilerMessages={"":{reveal:"Reveal",hide:"Hide",notice:"This may contain spoilers"}};export const chatMessages={"":{sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not sent",typing:"Typing…"}};export const emptyMessages={"":{title:"Nothing here"}};export const tableMessages={"":{search:"Search",selectAll:"Select all rows",selectRow:"Select row",rowsPerPage:"Rows per page",range:"{start}–{end} of {total}",selected:"{count} selected",empty:"No data"}};export const colorMessages={"":{area:"Saturation and brightness",hue:"Hue",alpha:"Opacity",value:"Colour value",swatches:"Preset colours",clear:"Clear",empty:"Choose a colour"}};export const ratingMessages={"":{label:"Rating",value:"{value} out of {max}",empty:"No rating"}};export const numberMessages={"":{increase:"Increase",decrease:"Decrease"}};export const paginationMessages={"":{label:"Pagination",page:"Page {page}",status:"Page {page} of {total}",previous:"Previous page",next:"Next page",first:"First page",last:"Last page"}};export const carouselMessages={"":{label:"Carousel",slide:"Slide {index} of {total}",previous:"Previous slide",next:"Next slide"}};export const scrollMessages={"":{previous:"Scroll back",next:"Scroll forward"}};export const breadcrumbMessages={"":{label:"Breadcrumb",expand:"Show hidden steps"}};export const comboboxMessages={"":{empty:"No matches",remove:"Remove {label}"}};export const overlayMessages={"":{label:"Overlay"}};export const windowMessages={"":{minimize:"Minimize",maximize:"Maximize",restore:"Restore",resize:"Resize window"}};const s={zh:"zh-hans","zh-cn":"zh-hans","zh-my":"zh-hans","zh-sg":"zh-hans","zh-hk":"zh-hant","zh-mo":"zh-hant","zh-tw":"zh-hant"};const a=new WeakMap;export function resolveMessages(e,t){const o=e[""],r=t?.trim()??"";if(!r)return o;let n=a.get(e);n||(n=new Map,a.set(e,n));const i=n.get(r);if(i)return i;const l=function(e){const s=e.toLowerCase().split(/[-_]/).filter(Boolean),a=s[0];if(!a)return[];const t=s.slice(1),o=t.find(e=>/^[a-z]{4}$/.test(e)),r=t.find(e=>/^([a-z]{2}|\d{3})$/.test(e));return[o?`${a}-${o}`:"",r?`${a}-${r}`:"",a].filter(Boolean)}(r).map(a=>{const t=s[a];return e[a]??(t?e[t]:void 0)}).find(Boolean),c=l?{...o,...l}:o;return n.set(r,c),c}export function useMessages(s,a){return e.useMemo(()=>resolveMessages(s,a),[s,a])}export function fillMessage(e,s){return e.replace(/\{(\w+)\}/g,(e,a)=>s[a]??e)}const t={action:actionMessages,link:linkMessages,spoiler:spoilerMessages,chat:chatMessages,empty:emptyMessages,table:tableMessages,color:colorMessages,rating:ratingMessages,number:numberMessages,pagination:paginationMessages,carousel:carouselMessages,scroll:scrollMessages,breadcrumb:breadcrumbMessages,combobox:comboboxMessages,overlay:overlayMessages,window:windowMessages};export function registerMessages(e,s){const o=e.trim().toLowerCase();for(const[e,r]of Object.entries(s)){const s=t[e];s&&r&&(s[o]=r,a.delete(s))}}
1
+ import*as e from"react";export const actionMessages={"":{close:"Close",dismiss:"Dismiss",clear:"Clear",remove:"Remove"}};export const linkMessages={"":{newTab:"(opens in a new tab)"}};export const spoilerMessages={"":{reveal:"Reveal",hide:"Hide",notice:"This may contain spoilers"}};export const chatMessages={"":{sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not sent",typing:"Typing…"}};export const emptyMessages={"":{title:"Nothing here"}};export const tableMessages={"":{search:"Search",selectAll:"Select all rows",selectRow:"Select row",rowsPerPage:"Rows per page",range:"{start}–{end} of {total}",selected:"{count} selected",empty:"No data"}};export const colorMessages={"":{area:"Saturation and brightness",hue:"Hue",alpha:"Opacity",value:"Colour value",swatches:"Preset colours",clear:"Clear",empty:"Choose a colour"}};export const ratingMessages={"":{label:"Rating",value:"{value} out of {max}",empty:"No rating"}};export const numberMessages={"":{increase:"Increase",decrease:"Decrease"}};export const paginationMessages={"":{label:"Pagination",page:"Page {page}",status:"Page {page} of {total}",previous:"Previous page",next:"Next page",first:"First page",last:"Last page"}};export const carouselMessages={"":{label:"Carousel",slide:"Slide {index} of {total}",previous:"Previous slide",next:"Next slide"}};export const scrollMessages={"":{previous:"Scroll back",next:"Scroll forward"}};export const breadcrumbMessages={"":{label:"Breadcrumb",expand:"Show hidden steps"}};export const comboboxMessages={"":{empty:"No matches",remove:"Remove {label}"}};export const overlayMessages={"":{label:"Overlay"}};export const windowMessages={"":{minimize:"Minimize",maximize:"Maximize",restore:"Restore",resize:"Resize window"}};export const layoutMessages={"":{skipToContent:"Skip to content",sidebar:"Sidebar",openSidebar:"Open sidebar",closeSidebar:"Close sidebar",resizeSidebar:"Resize sidebar"}};export const codeMessages={"":{code:"Code",copy:"Copy",copied:"Copied",copyFailed:"Could not copy",raw:"Raw",prompt:"Prompt"}};export const stepsMessages={"":{previous:"Previous",next:"Next",done:"Done",restart:"Start over",completed:"All steps complete",steps:"Steps",position:"{index} of {total}",step:"Step {index}: {title}"}};const s={zh:"zh-hans","zh-cn":"zh-hans","zh-my":"zh-hans","zh-sg":"zh-hans","zh-hk":"zh-hant","zh-mo":"zh-hant","zh-tw":"zh-hant"};const o=new WeakMap;export function resolveMessages(e,t){const a=e[""],r=t?.trim()??"";if(!r)return a;let n=o.get(e);n||(n=new Map,o.set(e,n));const i=n.get(r);if(i)return i;const l=function(e){const s=e.toLowerCase().split(/[-_]/).filter(Boolean),o=s[0];if(!o)return[];const t=s.slice(1),a=t.find(e=>/^[a-z]{4}$/.test(e)),r=t.find(e=>/^([a-z]{2}|\d{3})$/.test(e));return[a?`${o}-${a}`:"",r?`${o}-${r}`:"",o].filter(Boolean)}(r).map(o=>{const t=s[o];return e[o]??(t?e[t]:void 0)}).find(Boolean),c=l?{...a,...l}:a;return n.set(r,c),c}export function useMessages(s,o){return e.useMemo(()=>resolveMessages(s,o),[s,o])}export function fillMessage(e,s){return e.replace(/\{(\w+)\}/g,(e,o)=>s[o]??e)}const t={action:actionMessages,link:linkMessages,spoiler:spoilerMessages,chat:chatMessages,empty:emptyMessages,table:tableMessages,color:colorMessages,rating:ratingMessages,number:numberMessages,pagination:paginationMessages,carousel:carouselMessages,scroll:scrollMessages,breadcrumb:breadcrumbMessages,combobox:comboboxMessages,overlay:overlayMessages,window:windowMessages,layout:layoutMessages,code:codeMessages,steps:stepsMessages};export function registerMessages(e,s){const a=e.trim().toLowerCase();for(const[e,r]of Object.entries(s)){const s=t[e];s&&r&&(s[a]=r,o.delete(s))}}
@@ -81,6 +81,26 @@ export declare function ArrowRightIcon(): React.JSX.Element;
81
81
  */
82
82
  export declare function LinkIcon(): React.JSX.Element;
83
83
  export declare function ExternalLinkIcon(): React.JSX.Element;
84
+ /**
85
+ * The two sheets of a copy, and the angle brackets of a raw view.
86
+ *
87
+ * A pair for the steppers' reason: they sit next to each other in a CodeBlock's
88
+ * toolbar and nowhere else, so a copy drawn at one weight beside brackets drawn
89
+ * at another reads as two toolkits in one bar. The copy is the back sheet
90
+ * showing behind the front one, which is the shape every editor has used for
91
+ * long enough that it needs no label; the brackets are the mark for "show me
92
+ * what is actually there".
93
+ */
94
+ export declare function CopyIcon(): React.JSX.Element;
95
+ export declare function CodeIcon(): React.JSX.Element;
96
+ /**
97
+ * The arrow that comes back round to where it started.
98
+ *
99
+ * Not the chevron turned, and not two arrows chasing each other: this one means
100
+ * "from the beginning", which is a different act from "again". HowToSteps draws
101
+ * it on the button under a finished guide.
102
+ */
103
+ export declare function RestartIcon(): React.JSX.Element;
84
104
  /**
85
105
  * The three dots that stand for what has been left out.
86
106
  *
@@ -1 +1 @@
1
- import{jsx as r,jsxs as e}from"react/jsx-runtime";export function CloseIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 4.5 7 7m0-7-7 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function ChevronIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 6.5 3.5 3.5 3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function CheckIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m3.5 8.5 3 3 6-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export function MinusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function PlusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function TrendUpIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 11 6.5 7.5 9 10l4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 6h3.5v3.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function TrendDownIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 5 6.5 8.5 9 6l4 4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 10h3.5V6.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CalendarIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"2",y:"3.25",width:"12",height:"10.75",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M2 6.75h12",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M5.25 1.75v2.5M10.75 1.75v2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ClockIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 4.5V8l2.4 1.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function ArrowRightIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3 8h10m-3.5-3.5L13 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function LinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M6.5 9.5a2.75 2.75 0 0 0 4 .25l1.75-1.75a2.75 2.75 0 0 0-3.9-3.9L7.75 5.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 6.5a2.75 2.75 0 0 0-4-.25L3.75 8a2.75 2.75 0 0 0 3.9 3.9l.6-.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ExternalLinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M12.75 9.25v2.5a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5h2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 2.75h3.75V6.5M7.25 8.75l5.75-5.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function EllipsisIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"3.5",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"12.5",cy:"8",r:"1.15",fill:"currentColor"})]})}const o="M8 1.4 9.71 5.65 14.28 5.96 10.76 8.9 11.88 13.34 8 10.9 4.12 13.34 5.24 8.9 1.72 5.96 6.29 5.65Z";export function StarIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round"})})}export function StarOutlineIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}export function DotIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("circle",{cx:"8",cy:"8",r:"3.25",fill:"currentColor"})})}export function NoteIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 7.25v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"4.9",r:"0.85",fill:"currentColor"})]})}export function SuccessIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.25 8.25 1.9 1.9 3.6-3.9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function WarningIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M7.13 2.6 1.9 11.7a1 1 0 0 0 .87 1.5h10.46a1 1 0 0 0 .87-1.5L8.87 2.6a1 1 0 0 0-1.74 0Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),r("path",{d:"M8 6.1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"11.2",r:"0.85",fill:"currentColor"})]})}export function DangerIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.9 5.9 4.2 4.2m0-4.2-4.2 4.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function severityIcon(e){switch(e){case"success":return r(SuccessIcon,{});case"warning":return r(WarningIcon,{});case"danger":return r(DangerIcon,{});default:return r(NoteIcon,{})}}
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";export function CloseIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 4.5 7 7m0-7-7 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function ChevronIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 6.5 3.5 3.5 3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function CheckIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m3.5 8.5 3 3 6-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export function MinusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function PlusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function TrendUpIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 11 6.5 7.5 9 10l4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 6h3.5v3.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function TrendDownIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 5 6.5 8.5 9 6l4 4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 10h3.5V6.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CalendarIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"2",y:"3.25",width:"12",height:"10.75",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M2 6.75h12",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M5.25 1.75v2.5M10.75 1.75v2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ClockIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 4.5V8l2.4 1.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function ArrowRightIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3 8h10m-3.5-3.5L13 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function LinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M6.5 9.5a2.75 2.75 0 0 0 4 .25l1.75-1.75a2.75 2.75 0 0 0-3.9-3.9L7.75 5.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 6.5a2.75 2.75 0 0 0-4-.25L3.75 8a2.75 2.75 0 0 0 3.9 3.9l.6-.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ExternalLinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M12.75 9.25v2.5a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5h2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 2.75h3.75V6.5M7.25 8.75l5.75-5.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CopyIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"5.75",y:"5.75",width:"7.5",height:"7.5",rx:"1.75",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M10.25 3.6a1.85 1.85 0 0 0-1.5-.85h-4a2 2 0 0 0-2 2v4c0 .62.28 1.17.72 1.54",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function CodeIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M5.75 4.5 2.5 8l3.25 3.5m4.5-7L13.5 8l-3.25 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function RestartIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M13 8a5 5 0 1 1-1.6-3.67",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M13.25 2.25v3h-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function EllipsisIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"3.5",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"12.5",cy:"8",r:"1.15",fill:"currentColor"})]})}const o="M8 1.4 9.71 5.65 14.28 5.96 10.76 8.9 11.88 13.34 8 10.9 4.12 13.34 5.24 8.9 1.72 5.96 6.29 5.65Z";export function StarIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round"})})}export function StarOutlineIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}export function DotIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("circle",{cx:"8",cy:"8",r:"3.25",fill:"currentColor"})})}export function NoteIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 7.25v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"4.9",r:"0.85",fill:"currentColor"})]})}export function SuccessIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.25 8.25 1.9 1.9 3.6-3.9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function WarningIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M7.13 2.6 1.9 11.7a1 1 0 0 0 .87 1.5h10.46a1 1 0 0 0 .87-1.5L8.87 2.6a1 1 0 0 0-1.74 0Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),r("path",{d:"M8 6.1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"11.2",r:"0.85",fill:"currentColor"})]})}export function DangerIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.9 5.9 4.2 4.2m0-4.2-4.2 4.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function severityIcon(e){switch(e){case"success":return r(SuccessIcon,{});case"warning":return r(WarningIcon,{});case"danger":return r(DangerIcon,{});default:return r(NoteIcon,{})}}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The letters that stand in for a picture that is not there.
3
+ *
4
+ * One function, in `internal/` for the reason `button-group.ts` is: two
5
+ * components draw it — an [Avatar] with no photograph and an [AppLogo] with no
6
+ * artwork — and neither should have to import the other to say what "the first
7
+ * letter of a name" means. It is a rule about names rather than about pictures,
8
+ * and a library with two of them would spell the same person's initials two
9
+ * ways on the same page.
10
+ */
11
+ /**
12
+ * The first character of the first word, plus the first of the last.
13
+ *
14
+ * `Array.from` rather than `[0]`, so a name that starts with an emoji or with
15
+ * any character outside the basic plane is not cut in half between its two code
16
+ * units. `normalize('NFC')` first, so a name whose accents arrived decomposed —
17
+ * which is what a macOS filename and a good many APIs hand you — yields `Ä`
18
+ * rather than a bare `A`.
19
+ *
20
+ * One word gives one character on purpose. Korean, Japanese and Chinese names
21
+ * are a single token, and two of their characters at 32px is a smudge where one
22
+ * is a name.
23
+ */
24
+ export declare function initialsOf(name: string): string;
@@ -0,0 +1 @@
1
+ export function initialsOf(r){const t=r.normalize("NFC").trim().split(/\s+/).filter(Boolean);if(0===t.length)return"";return((Array.from(t[0])[0]??"")+(t.length>1?Array.from(t[t.length-1])[0]??"":"")).toLocaleUpperCase()}