neba 0.0.1 → 1.1.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 (224) hide show
  1. package/README.md +177 -2
  2. package/dist/components/accordion/Accordion.d.ts +97 -0
  3. package/dist/components/accordion/Accordion.js +1 -0
  4. package/dist/components/accordion/index.d.ts +2 -0
  5. package/dist/components/accordion/index.js +1 -0
  6. package/dist/components/alert/Alert.d.ts +47 -0
  7. package/dist/components/alert/Alert.js +1 -0
  8. package/dist/components/alert/index.d.ts +2 -0
  9. package/dist/components/alert/index.js +1 -0
  10. package/dist/components/badge/Badge.d.ts +80 -0
  11. package/dist/components/badge/Badge.js +1 -0
  12. package/dist/components/badge/index.d.ts +2 -0
  13. package/dist/components/badge/index.js +1 -0
  14. package/dist/components/blockquote/Blockquote.d.ts +65 -0
  15. package/dist/components/blockquote/Blockquote.js +1 -0
  16. package/dist/components/blockquote/index.d.ts +2 -0
  17. package/dist/components/blockquote/index.js +1 -0
  18. package/dist/components/box/Box.d.ts +50 -0
  19. package/dist/components/box/Box.js +1 -0
  20. package/dist/components/box/index.d.ts +2 -0
  21. package/dist/components/box/index.js +1 -0
  22. package/dist/components/button/Button.d.ts +25 -3
  23. package/dist/components/button/Button.js +1 -1
  24. package/dist/components/button/index.d.ts +1 -0
  25. package/dist/components/button-group/ButtonGroup.d.ts +31 -0
  26. package/dist/components/button-group/ButtonGroup.js +1 -0
  27. package/dist/components/button-group/index.d.ts +2 -0
  28. package/dist/components/button-group/index.js +1 -0
  29. package/dist/components/card/Card.d.ts +45 -0
  30. package/dist/components/card/Card.js +1 -0
  31. package/dist/components/card/index.d.ts +2 -0
  32. package/dist/components/card/index.js +1 -0
  33. package/dist/components/carousel/Carousel.d.ts +74 -0
  34. package/dist/components/carousel/Carousel.js +1 -0
  35. package/dist/components/carousel/index.d.ts +2 -0
  36. package/dist/components/carousel/index.js +1 -0
  37. package/dist/components/checkbox/Checkbox.d.ts +39 -0
  38. package/dist/components/checkbox/Checkbox.js +1 -0
  39. package/dist/components/checkbox/index.d.ts +2 -0
  40. package/dist/components/checkbox/index.js +1 -0
  41. package/dist/components/chip/Chip.d.ts +50 -0
  42. package/dist/components/chip/Chip.js +1 -0
  43. package/dist/components/chip/index.d.ts +2 -0
  44. package/dist/components/chip/index.js +1 -0
  45. package/dist/components/combobox/Combobox.d.ts +131 -0
  46. package/dist/components/combobox/Combobox.js +1 -0
  47. package/dist/components/combobox/index.d.ts +2 -0
  48. package/dist/components/combobox/index.js +1 -0
  49. package/dist/components/container/Container.d.ts +55 -0
  50. package/dist/components/container/Container.js +1 -0
  51. package/dist/components/container/index.d.ts +2 -0
  52. package/dist/components/container/index.js +1 -0
  53. package/dist/components/date-picker/DatePicker.d.ts +75 -0
  54. package/dist/components/date-picker/DatePicker.js +1 -0
  55. package/dist/components/date-picker/index.d.ts +2 -0
  56. package/dist/components/date-picker/index.js +1 -0
  57. package/dist/components/date-range-picker/DateRangePicker.d.ts +81 -0
  58. package/dist/components/date-range-picker/DateRangePicker.js +1 -0
  59. package/dist/components/date-range-picker/index.d.ts +2 -0
  60. package/dist/components/date-range-picker/index.js +1 -0
  61. package/dist/components/date-time-picker/DateTimePicker.d.ts +68 -0
  62. package/dist/components/date-time-picker/DateTimePicker.js +1 -0
  63. package/dist/components/date-time-picker/index.d.ts +2 -0
  64. package/dist/components/date-time-picker/index.js +1 -0
  65. package/dist/components/dialog/Dialog.d.ts +111 -0
  66. package/dist/components/dialog/Dialog.js +1 -0
  67. package/dist/components/dialog/index.d.ts +2 -0
  68. package/dist/components/dialog/index.js +1 -0
  69. package/dist/components/divider/Divider.d.ts +67 -0
  70. package/dist/components/divider/Divider.js +1 -0
  71. package/dist/components/divider/index.d.ts +2 -0
  72. package/dist/components/divider/index.js +1 -0
  73. package/dist/components/file-picker/FilePicker.d.ts +103 -0
  74. package/dist/components/file-picker/FilePicker.js +1 -0
  75. package/dist/components/file-picker/index.d.ts +2 -0
  76. package/dist/components/file-picker/index.js +1 -0
  77. package/dist/components/grid/Grid.d.ts +50 -0
  78. package/dist/components/grid/Grid.js +1 -0
  79. package/dist/components/grid/index.d.ts +2 -0
  80. package/dist/components/grid/index.js +1 -0
  81. package/dist/components/grid-container/GridContainer.d.ts +79 -0
  82. package/dist/components/grid-container/GridContainer.js +1 -0
  83. package/dist/components/grid-container/index.d.ts +2 -0
  84. package/dist/components/grid-container/index.js +1 -0
  85. package/dist/components/highlight/Highlight.d.ts +84 -0
  86. package/dist/components/highlight/Highlight.js +1 -0
  87. package/dist/components/highlight/index.d.ts +2 -0
  88. package/dist/components/highlight/index.js +1 -0
  89. package/dist/components/icon/Icon.d.ts +58 -0
  90. package/dist/components/icon/Icon.js +1 -0
  91. package/dist/components/icon/index.d.ts +2 -0
  92. package/dist/components/icon/index.js +1 -0
  93. package/dist/components/icon-button/IconButton.d.ts +39 -0
  94. package/dist/components/icon-button/IconButton.js +1 -0
  95. package/dist/components/icon-button/index.d.ts +2 -0
  96. package/dist/components/icon-button/index.js +1 -0
  97. package/dist/components/list/List.d.ts +81 -0
  98. package/dist/components/list/List.js +1 -0
  99. package/dist/components/list/index.d.ts +2 -0
  100. package/dist/components/list/index.js +1 -0
  101. package/dist/components/menu/Menu.d.ts +216 -0
  102. package/dist/components/menu/Menu.js +1 -0
  103. package/dist/components/menu/index.d.ts +2 -0
  104. package/dist/components/menu/index.js +1 -0
  105. package/dist/components/number-field/NumberField.d.ts +113 -0
  106. package/dist/components/number-field/NumberField.js +1 -0
  107. package/dist/components/number-field/index.d.ts +2 -0
  108. package/dist/components/number-field/index.js +1 -0
  109. package/dist/components/overlay/Overlay.d.ts +85 -0
  110. package/dist/components/overlay/Overlay.js +1 -0
  111. package/dist/components/overlay/index.d.ts +2 -0
  112. package/dist/components/overlay/index.js +1 -0
  113. package/dist/components/pagination/Pagination.d.ts +65 -0
  114. package/dist/components/pagination/Pagination.js +1 -0
  115. package/dist/components/pagination/index.d.ts +2 -0
  116. package/dist/components/pagination/index.js +1 -0
  117. package/dist/components/pill/Pill.d.ts +80 -0
  118. package/dist/components/pill/Pill.js +1 -0
  119. package/dist/components/pill/index.d.ts +2 -0
  120. package/dist/components/pill/index.js +1 -0
  121. package/dist/components/progress-box/ProgressBox.d.ts +33 -0
  122. package/dist/components/progress-box/ProgressBox.js +1 -0
  123. package/dist/components/progress-box/index.d.ts +2 -0
  124. package/dist/components/progress-box/index.js +1 -0
  125. package/dist/components/progress-circular/ProgressCircular.d.ts +19 -0
  126. package/dist/components/progress-circular/ProgressCircular.js +1 -0
  127. package/dist/components/progress-circular/index.d.ts +2 -0
  128. package/dist/components/progress-circular/index.js +1 -0
  129. package/dist/components/progress-linear/ProgressLinear.d.ts +20 -0
  130. package/dist/components/progress-linear/ProgressLinear.js +1 -0
  131. package/dist/components/progress-linear/index.d.ts +2 -0
  132. package/dist/components/progress-linear/index.js +1 -0
  133. package/dist/components/radio-group/RadioGroup.d.ts +51 -0
  134. package/dist/components/radio-group/RadioGroup.js +1 -0
  135. package/dist/components/radio-group/index.d.ts +2 -0
  136. package/dist/components/radio-group/index.js +1 -0
  137. package/dist/components/segmented-button/SegmentedButton.d.ts +77 -0
  138. package/dist/components/segmented-button/SegmentedButton.js +1 -0
  139. package/dist/components/segmented-button/index.d.ts +2 -0
  140. package/dist/components/segmented-button/index.js +1 -0
  141. package/dist/components/select/Select.d.ts +76 -0
  142. package/dist/components/select/Select.js +1 -0
  143. package/dist/components/select/index.d.ts +2 -0
  144. package/dist/components/select/index.js +1 -0
  145. package/dist/components/shortcut/Shortcut.d.ts +60 -0
  146. package/dist/components/shortcut/Shortcut.js +1 -0
  147. package/dist/components/shortcut/index.d.ts +2 -0
  148. package/dist/components/shortcut/index.js +1 -0
  149. package/dist/components/slider/Slider.d.ts +38 -0
  150. package/dist/components/slider/Slider.js +1 -0
  151. package/dist/components/slider/index.d.ts +2 -0
  152. package/dist/components/slider/index.js +1 -0
  153. package/dist/components/statistic/Statistic.d.ts +91 -0
  154. package/dist/components/statistic/Statistic.js +1 -0
  155. package/dist/components/statistic/index.d.ts +2 -0
  156. package/dist/components/statistic/index.js +1 -0
  157. package/dist/components/switch/Switch.d.ts +39 -0
  158. package/dist/components/switch/Switch.js +1 -0
  159. package/dist/components/switch/index.d.ts +2 -0
  160. package/dist/components/switch/index.js +1 -0
  161. package/dist/components/table/Table.d.ts +80 -0
  162. package/dist/components/table/Table.js +1 -0
  163. package/dist/components/table/index.d.ts +2 -0
  164. package/dist/components/table/index.js +1 -0
  165. package/dist/components/tabs/Tabs.d.ts +92 -0
  166. package/dist/components/tabs/Tabs.js +1 -0
  167. package/dist/components/tabs/index.d.ts +2 -0
  168. package/dist/components/tabs/index.js +1 -0
  169. package/dist/components/text-field/TextField.d.ts +63 -0
  170. package/dist/components/text-field/TextField.js +1 -0
  171. package/dist/components/text-field/index.d.ts +2 -0
  172. package/dist/components/text-field/index.js +1 -0
  173. package/dist/components/time-picker/TimePicker.d.ts +76 -0
  174. package/dist/components/time-picker/TimePicker.js +1 -0
  175. package/dist/components/time-picker/index.d.ts +2 -0
  176. package/dist/components/time-picker/index.js +1 -0
  177. package/dist/components/timeline/Timeline.d.ts +98 -0
  178. package/dist/components/timeline/Timeline.js +1 -0
  179. package/dist/components/timeline/index.d.ts +2 -0
  180. package/dist/components/timeline/index.js +1 -0
  181. package/dist/components/toast/Toast.d.ts +116 -0
  182. package/dist/components/toast/Toast.js +1 -0
  183. package/dist/components/toast/index.d.ts +2 -0
  184. package/dist/components/toast/index.js +1 -0
  185. package/dist/components/toolbar/Toolbar.d.ts +67 -0
  186. package/dist/components/toolbar/Toolbar.js +1 -0
  187. package/dist/components/toolbar/index.d.ts +2 -0
  188. package/dist/components/toolbar/index.js +1 -0
  189. package/dist/components/tooltip/Tooltip.d.ts +81 -0
  190. package/dist/components/tooltip/Tooltip.js +1 -0
  191. package/dist/components/tooltip/index.d.ts +2 -0
  192. package/dist/components/tooltip/index.js +1 -0
  193. package/dist/components/typography/Typography.d.ts +62 -0
  194. package/dist/components/typography/Typography.js +1 -0
  195. package/dist/components/typography/index.d.ts +2 -0
  196. package/dist/components/typography/index.js +1 -0
  197. package/dist/index.d.ts +50 -1
  198. package/dist/index.js +1 -1
  199. package/dist/internal/button-group.d.ts +25 -0
  200. package/dist/internal/button-group.js +1 -0
  201. package/dist/internal/calendar.d.ts +149 -0
  202. package/dist/internal/calendar.js +1 -0
  203. package/dist/internal/date.d.ts +170 -0
  204. package/dist/internal/date.js +1 -0
  205. package/dist/internal/grid.d.ts +69 -0
  206. package/dist/internal/grid.js +1 -0
  207. package/dist/internal/icons.d.ts +79 -0
  208. package/dist/internal/icons.js +1 -0
  209. package/dist/internal/menu.d.ts +20 -0
  210. package/dist/internal/menu.js +1 -0
  211. package/dist/internal/picker.d.ts +111 -0
  212. package/dist/internal/picker.js +1 -0
  213. package/dist/internal/progress.d.ts +122 -0
  214. package/dist/internal/progress.js +1 -0
  215. package/dist/internal/sizer.d.ts +33 -0
  216. package/dist/internal/sizer.js +1 -0
  217. package/dist/internal/styles.d.ts +257 -0
  218. package/dist/internal/styles.js +1 -0
  219. package/dist/styles.css +2 -0
  220. package/dist/tailwind.css +892 -0
  221. package/dist/types.d.ts +142 -0
  222. package/dist/types.js +8 -0
  223. package/package.json +90 -21
  224. package/pnpm-workspace.yaml +0 -2
@@ -0,0 +1,116 @@
1
+ import * as React from 'react';
2
+ import type { NebaAlign, NebaColor, NebaStyleProps, NebaVariant } from '../../types';
3
+ /**
4
+ * Where the stack sits.
5
+ *
6
+ * Written as two words rather than as a `side` plus an `align` pair, because
7
+ * they are not independent: a toast stack is always pinned to the top or the
8
+ * bottom, never to a side, and offering `left`/`right` as a "side" would invite
9
+ * a stack down the middle of the screen that nothing in the layout survives.
10
+ * The second half is `NebaAlign`, the same word every other component uses.
11
+ */
12
+ export type ToastPosition = `top-${NebaAlign}` | `bottom-${NebaAlign}`;
13
+ /**
14
+ * The Neba style props a single toast can override, carried in Base UI's
15
+ * per-toast `data`. Anything not set here falls back to the provider.
16
+ */
17
+ export interface ToastData {
18
+ color?: NebaColor;
19
+ variant?: NebaVariant;
20
+ icon?: React.ReactNode | false;
21
+ }
22
+ export interface ToastOptions extends ToastData {
23
+ /**
24
+ * Reusing an id updates that toast in place and restarts its timer, which is
25
+ * what "uploading… / uploaded" wants: one toast that changed its mind, not two
26
+ * stacked on each other.
27
+ */
28
+ id?: string;
29
+ /** The headline. */
30
+ title?: React.ReactNode;
31
+ /** The detail under it. A toast with only this is a one-line toast. */
32
+ description?: React.ReactNode;
33
+ /**
34
+ * How long before it dismisses itself, in milliseconds. `0` means it stays
35
+ * until it is closed — which is the right answer for anything the reader has
36
+ * to act on, because a toast that leaves before it is read said nothing.
37
+ */
38
+ timeout?: number;
39
+ /**
40
+ * `high` interrupts a screen reader; `low` waits for a pause. An error is
41
+ * worth interrupting for and a save confirmation is not.
42
+ * @default 'low'
43
+ */
44
+ priority?: 'low' | 'high';
45
+ /** The label of the action button. Passing it is what makes the button appear. */
46
+ actionLabel?: React.ReactNode;
47
+ onAction?: (event: React.MouseEvent<HTMLButtonElement>) => void;
48
+ /** Called when the toast closes, however it closed. */
49
+ onClose?: () => void;
50
+ /** Called once it has finished animating out and left the DOM. */
51
+ onRemove?: () => void;
52
+ }
53
+ export interface ToastProviderProps extends Pick<NebaStyleProps, 'variant' | 'size' | 'density'> {
54
+ /** The default colour family. A single toast overrides it in `add`. */
55
+ color?: NebaColor;
56
+ /** @default 'bottom-end' */
57
+ position?: ToastPosition;
58
+ /**
59
+ * How long a toast lasts by default, in milliseconds. `0` keeps every toast
60
+ * up until it is closed.
61
+ * @default 5000
62
+ */
63
+ timeout?: number;
64
+ /**
65
+ * How many are shown at once. The rest are kept and revealed as the stack
66
+ * drains rather than being thrown away.
67
+ * @default 3
68
+ */
69
+ limit?: number;
70
+ /** How wide a toast is allowed to get. Numbers are pixels. @default 380 */
71
+ width?: number | string;
72
+ /** Accessible name of every toast's × button. */
73
+ closeLabel?: string;
74
+ children?: React.ReactNode;
75
+ }
76
+ /**
77
+ * Raises toasts from anywhere under a `ToastProvider`.
78
+ *
79
+ * A hook rather than a component, because the thing a caller has at the moment
80
+ * a toast is warranted is a click handler, not a place in the tree — and a
81
+ * `<Toast open={…}/>` they would have to keep mounted, with a piece of state per
82
+ * message, is the shape this component exists to avoid.
83
+ */
84
+ export declare function useToast(): {
85
+ /** Raises a toast and returns its id. */
86
+ add: (options: ToastOptions) => string;
87
+ /** Closes one toast, or every toast when called with nothing. */
88
+ close: (id?: string) => void;
89
+ /** Changes a toast already on screen. */
90
+ update: (id: string, options: ToastOptions) => void;
91
+ /**
92
+ * One toast that follows a promise: the loading message while it runs,
93
+ * then the success or the error. `timeout: 0` is applied to the loading
94
+ * state by Base UI, so a slow request cannot dismiss its own toast.
95
+ */
96
+ promise: <Value>(promise: Promise<Value>, options: {
97
+ loading: ToastOptions;
98
+ success: ToastOptions | ((value: Value) => ToastOptions);
99
+ error: ToastOptions | ((error: unknown) => ToastOptions);
100
+ }) => Promise<Value>;
101
+ /** Every toast currently in the stack, newest first. */
102
+ toasts: import("@base-ui/react").ToastObject<ToastData>[];
103
+ };
104
+ /**
105
+ * Puts the toast stack on the page and lets anything under it raise a message.
106
+ *
107
+ * Wrap the application once. Everything about how a toast *looks* is decided
108
+ * here — where the stack sits, how wide it is, which surface it wears, how long
109
+ * it lasts — so the call site stays the one thing it should be: what happened.
110
+ *
111
+ * Base UI owns the parts of this that are genuinely hard and invisible when
112
+ * they work: the timers and their pausing on hover and on window blur, the
113
+ * limit, the swipe, the F6 focus hotkey, and the live region that makes a
114
+ * message that appeared out of nowhere reach a screen reader at all.
115
+ */
116
+ export declare function ToastProvider({ variant, size, color, density, position, timeout, limit, width, closeLabel, children }: ToastProviderProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{Toast as i}from"@base-ui/react/toast";import{boxPaddingClasses as n}from"../box/Box";import{CloseIcon as s,severityIcons as a}from"../../internal/icons";import{controlSlots as r,focusRingClasses as l,hasContent as c,iconClasses as d,metaTextClasses as p,radiusClasses as u,sheetBodyClasses as m,sheetHeaderGapClasses as f,sheetSectionGapClasses as b,sheetTitleClasses as x,surfaceClasses as v}from"../../internal/styles";const h={"top-start":"top-0 items-start","top-center":"top-0 items-center","top-end":"top-0 items-end","bottom-start":"bottom-0 items-start flex-col-reverse","bottom-center":"bottom-0 items-center flex-col-reverse","bottom-end":"bottom-0 items-end flex-col-reverse"},y={solid:[v,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--neba-shadow-3),var(--neba-plate-solid)]"].join(" "),outline:[v,"border text-(--neba-fg) bg-(--n-panel-press)","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]"].join(" "),text:[v,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]"].join(" ")},g={solid:"",outline:"text-(--n-accent)",text:"text-(--n-accent)"};function w(e){const{color:t,variant:o,icon:i,actionLabel:n,onAction:s,...a}=e;return{...a,data:{color:t,variant:o,icon:i},actionProps:void 0===n?void 0:{children:n,onClick:s}}}export function useToast(){const e=i.useToastManager();return o.useMemo(()=>({add:t=>e.add(w(t)),close:t=>e.close(t),update:(t,o)=>e.update(t,w(o)),promise:(t,o)=>e.promise(t,{loading:w(o.loading),success:e=>w("function"==typeof o.success?o.success(e):o.success),error:e=>w("function"==typeof o.error?o.error(e):o.error)}),toasts:e.toasts}),[e])}function j({toast:o,variant:v,color:h,size:w,density:j,closeLabel:N,swipeDirection:_}){const T=o.data?.variant??v??"outline",z=o.data?.color??h,$=void 0===o.data?.icon?a[z]:o.data.icon,k=g[T],D=c(o.title);return t(i.Root,{toast:o,swipeDirection:_,className:["pointer-events-auto flex w-full items-start",n[j??"default"][w],u[w],b[w],m[w],y[T],d,"[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0","data-[limited]:hidden",l,"[outline:none]"].filter(Boolean).join(" "),style:r(z,3,T),children:[c($)?e("span",{className:`flex h-[1lh] shrink-0 items-center ${k}`,children:$}):null,t("div",{className:`flex min-w-0 flex-1 flex-col ${f[w]}`,children:[e(i.Title,{className:`neba-title font-semibold ${x[w]} ${k}`}),e(i.Description,{className:D?""+("solid"===T?"":"text-(--neba-muted-fg)"):""})]}),e(i.Action,{className:["flex h-[1lh] shrink-0 cursor-pointer items-center rounded-full px-2","font-medium underline-offset-2",k||"text-(--n-on-solid)","hover:underline","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2",p[w]].join(" ")}),e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(i.Close,{"aria-label":N,className:["inline-flex size-[1.15em] cursor-pointer items-center justify-center rounded-full","opacity-70 [transition:opacity_var(--neba-duration)_var(--neba-ease)]","hover:opacity-100 focus-visible:opacity-100","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),children:e(s,{})})})]})}function N(t){const{toasts:o}=i.useToastManager(),{position:n,width:s,...a}=t,r=[n.startsWith("top")?"up":"down","left","right"];return e(i.Portal,{children:e(i.Viewport,{className:["neba-portal pointer-events-none fixed inset-x-0 z-50 flex flex-col gap-2 p-4",h[n]].join(" "),children:o.map(t=>e("div",{className:"w-full",style:{maxWidth:"number"==typeof s?`${s}px`:s},children:e(j,{toast:t,swipeDirection:r,...a})},t.id))})})}export function ToastProvider({variant:o="outline",size:n="md",color:s="primary",density:a="default",position:r="bottom-end",timeout:l=5e3,limit:c=3,width:d=380,closeLabel:p="Close",children:u}){return t(i.Provider,{timeout:l,limit:c,children:[u,e(N,{position:r,variant:o,size:n,color:s,density:a,width:d,closeLabel:p})]})}
@@ -0,0 +1,2 @@
1
+ export { ToastProvider, useToast } from './Toast';
2
+ export type { ToastData, ToastOptions, ToastPosition, ToastProviderProps } from './Toast';
@@ -0,0 +1 @@
1
+ export{ToastProvider,useToast}from"./Toast";
@@ -0,0 +1,67 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import type { NebaElevation, NebaPosition, NebaStyleProps } from '../../types';
4
+ export interface ToolbarProps extends NebaStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
5
+ /**
6
+ * Drop shadow depth. `0` — the default — is flat even when the bar is pinned:
7
+ * a shadow under a header is a way of saying "there is content beneath this",
8
+ * and that is only true once the page has been scrolled. Raise it yourself, or
9
+ * leave it flat and turn on `divider`.
10
+ * @default 0
11
+ */
12
+ elevation?: NebaElevation;
13
+ /**
14
+ * How the bar sits in the page's scroll.
15
+ *
16
+ * - `static` — in the flow, scrolling away with the content.
17
+ * - `sticky` — in the flow until it reaches the edge, then held there. What an
18
+ * application header usually wants: it takes up its own space, so nothing
19
+ * underneath has to be padded around it.
20
+ * - `fixed` — out of the flow entirely. The page needs padding of its own, or
21
+ * the first screenful sits behind the bar.
22
+ * @default 'static'
23
+ */
24
+ position?: NebaPosition;
25
+ /** Which edge it is held against when `position` is not `static`. @default 'top' */
26
+ side?: 'top' | 'bottom';
27
+ /**
28
+ * Draws a hairline along the edge that faces the content — under a `top` bar,
29
+ * over a `bottom` one.
30
+ * @default false
31
+ */
32
+ divider?: boolean;
33
+ /** Pinned to the start of the bar: a logo, a title, a back button. */
34
+ start?: React.ReactNode;
35
+ /** Pinned to the end: the actions. */
36
+ end?: React.ReactNode;
37
+ /**
38
+ * Renders something other than a `<div>` — `render={<header />}`,
39
+ * `render={<nav />}`. Base UI's own escape hatch, and worth reaching for here:
40
+ * a page's header should be a `<header>`.
41
+ */
42
+ render?: useRender.RenderProp;
43
+ /** The middle. Takes whatever width `start` and `end` leave. */
44
+ children?: React.ReactNode;
45
+ }
46
+ /**
47
+ * A bar of controls: an application header, a page's action row, the strip along
48
+ * the bottom of an editor.
49
+ *
50
+ * Three slots and a row. `start` and `end` are pinned to their ends and
51
+ * `children` takes what is left, which is the arrangement every toolbar has ever
52
+ * had — so it is laid out here rather than left to a caller and a spacer `<div>`
53
+ * they have to remember.
54
+ *
55
+ * The one thing it does not do is take a height. A toolbar is as tall as the
56
+ * controls in it plus its padding, and that padding is the `size`/`density` pair
57
+ * every other surface uses — so `density="compact"` gives the dense bar without
58
+ * a second prop meaning the same thing, and without the type scale moving.
59
+ *
60
+ * It has no `role="toolbar"`, deliberately. That role is a promise about
61
+ * keyboard behaviour — one tab stop for the whole bar, arrow keys between the
62
+ * controls in it — and a bar that claims it without implementing it is worse for
63
+ * a keyboard reader than one that never claimed anything. What a header wants is
64
+ * `render={<header />}`; what a genuine roving-focus toolbar wants is a
65
+ * ButtonGroup, which is one.
66
+ */
67
+ export declare const Toolbar: React.ForwardRefExoticComponent<ToolbarProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import*as o from"react";import{useRender as n}from"@base-ui/react/use-render";import{boxPaddingXClasses as i,boxPaddingYClasses as a}from"../box/Box";import{hasContent as s,radiusClasses as l,sheetSectionGapClasses as d,surfaceClasses as m,surfaceSlots as c,transitionClasses as b}from"../../internal/styles";const p={solid:[m,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[m,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},f={static:{top:"",bottom:""},sticky:{top:"sticky top-0 z-20",bottom:"sticky bottom-0 z-20"},fixed:{top:"fixed inset-x-0 top-0 z-30",bottom:"fixed inset-x-0 bottom-0 z-30"}},x={top:"border-b [border-color:var(--n-line)]",bottom:"border-t [border-color:var(--n-line)]"};export const Toolbar=o.forwardRef(function({variant:o="outline",size:m="md",color:v="primary",density:g="default",elevation:h=0,position:u="static",side:w="top",divider:y=!1,start:j,end:k,render:z,className:N,style:B,children:F,...R},T){const q=["flex w-full min-w-0 items-center",i[g][m],a[g][m],d[m],"static"===u?l[m]:"",p[o],y?x[w]:"",f[u][w],b,N??""].filter(Boolean).join(" ");return n({render:z,ref:T,props:{className:q,style:{...c(v,h),...B},children:r(t,{children:[s(j)?e("div",{className:"flex min-w-0 shrink-0 items-center gap-2",children:j}):null,e("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:F}),s(k)?e("div",{className:"flex min-w-0 shrink-0 items-center gap-2",children:k}):null]}),...R}})});
@@ -0,0 +1,2 @@
1
+ export { Toolbar } from './Toolbar';
2
+ export type { ToolbarProps } from './Toolbar';
@@ -0,0 +1 @@
1
+ export{Toolbar}from"./Toolbar";
@@ -0,0 +1,81 @@
1
+ import * as React from 'react';
2
+ import { Tooltip as BaseUITooltip } from '@base-ui/react/tooltip';
3
+ import type { NebaAlign, NebaSide, NebaStyleProps } from '../../types';
4
+ export interface TooltipProps extends Pick<NebaStyleProps, 'size' | 'color' | 'density'> {
5
+ /**
6
+ * What the tooltip says.
7
+ *
8
+ * A short phrase. A tooltip is not a container — it cannot be reached by a
9
+ * pointer on a touch screen, it disappears the moment attention moves, and
10
+ * anything inside it that could be clicked cannot be. Content that needs
11
+ * either of those is a Popover's job, not this one.
12
+ */
13
+ content: React.ReactNode;
14
+ /**
15
+ * The element the tooltip hangs off. Exactly one element, which must accept a
16
+ * ref and spread props — every Neba component does.
17
+ */
18
+ children: React.ReactElement;
19
+ /**
20
+ * Which edge of the trigger it appears on. May flip to the opposite side when
21
+ * there is no room, which is Base UI's doing and is the right behaviour.
22
+ * @default 'top'
23
+ */
24
+ side?: NebaSide;
25
+ /** Where it sits along that edge. @default 'center' */
26
+ align?: NebaAlign;
27
+ /** Distance from the trigger, in pixels. @default 6 */
28
+ sideOffset?: number;
29
+ /**
30
+ * How long the pointer has to rest before it opens, in milliseconds.
31
+ * @default 600
32
+ */
33
+ delay?: number;
34
+ /** How long it waits before closing once the pointer leaves. @default 0 */
35
+ closeDelay?: number;
36
+ /** Draws the little wedge pointing at the trigger. @default true */
37
+ arrow?: boolean;
38
+ /** Whether the tooltip is open. Use with `onOpenChange` for a controlled one. */
39
+ open?: boolean;
40
+ /** Whether it starts open, for an uncontrolled one. */
41
+ defaultOpen?: boolean;
42
+ onOpenChange?: (open: boolean) => void;
43
+ /**
44
+ * Stops the tooltip from opening at all, without disabling the trigger. For
45
+ * the tooltip that only exists while a label is truncated.
46
+ * @default false
47
+ */
48
+ disabled?: boolean;
49
+ className?: string;
50
+ style?: React.CSSProperties;
51
+ }
52
+ /**
53
+ * Shares one delay across a group of tooltips: once any of them has opened, its
54
+ * neighbours open instantly, and the wait comes back after a pause.
55
+ *
56
+ * Worth wrapping a toolbar in. Without it, moving along a row of icon buttons
57
+ * means waiting out the full delay at every stop, which is what makes tooltips
58
+ * feel like they are fighting the pointer.
59
+ */
60
+ export declare const TooltipProvider: React.FC<import("@base-ui/react").TooltipProviderProps>;
61
+ export type TooltipProviderProps = React.ComponentProps<typeof BaseUITooltip.Provider>;
62
+ /**
63
+ * A short label that appears when the pointer rests on something.
64
+ *
65
+ * The whole component is a wrapper: `<Tooltip content="Copy"><Button …/></Tooltip>`.
66
+ * Base UI's Trigger merges itself onto the child rather than rendering a box of
67
+ * its own, so the tooltip adds no element to the layout and the child stays
68
+ * whatever it was — a button, a chip, a truncated cell.
69
+ *
70
+ * Base UI owns the parts that are genuinely hard: the delay and the group
71
+ * timeout, opening on focus but not on a focus that came from a click, closing
72
+ * on Escape, and keeping the popup off the edges of the window.
73
+ *
74
+ * The one thing it deliberately leaves open is the part that makes a tooltip
75
+ * mean anything to a screen reader — `role="tooltip"` on the plate and an
76
+ * `aria-describedby` pointing at it from the trigger — because a popup can be
77
+ * many things and only the caller knows which. Here it is always a tooltip, so
78
+ * this component wires both, and drops the reference while it is closed rather
79
+ * than pointing at an element that is not in the document.
80
+ */
81
+ export declare function Tooltip({ content, children, size, color, density, side, align, sideOffset, delay, closeDelay, arrow, open, defaultOpen, onOpenChange, disabled, className, style }: TooltipProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Tooltip as o}from"@base-ui/react/tooltip";import{controlSlots as i,metaTextClasses as s,paddingXClasses as n,radiusClasses as l,surfaceClasses as r}from"../../internal/styles";export const TooltipProvider=o.Provider;const d=[r,"max-w-64 text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--neba-shadow-3),var(--neba-plate-solid)]","[outline:none]","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0","data-[instant]:[transition-duration:0ms]"].join(" "),p={xs:"py-0.5",sm:"py-0.5",md:"py-1",lg:"py-1.5",xl:"py-2"},c={xs:6,sm:7,md:8,lg:9,xl:10};export function Tooltip({content:r,children:m,size:h="sm",color:y="secondary",density:f="default",side:x="top",align:b="center",sideOffset:g=6,delay:u,closeDelay:v,arrow:w=!0,open:j,defaultOpen:O,onOpenChange:N,disabled:P=!1,className:T,style:z}){const B=c[h],C=a.useId(),[D,_]=a.useState(O??!1),k=j??D;return t(o.Root,{open:j,defaultOpen:O,onOpenChange:e=>{_(e),N?.(e)},children:[e(o.Trigger,{render:m,delay:u,closeDelay:v,disabled:P,"aria-describedby":k?C:void 0}),e(o.Portal,{children:e(o.Positioner,{className:"neba-portal z-50 [outline:none]",side:x,align:b,sideOffset:g,children:t(o.Popup,{id:C,role:"tooltip",className:[d,l[h],n[f][h],p[h],s[h],T??""].filter(Boolean).join(" "),style:{...i(y,3,"solid"),...z},children:[w?e(o.Arrow,{className:["data-[side=top]:bottom-[-1px]","data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180","data-[side=left]:right-[-1px] data-[side=left]:-rotate-90","data-[side=right]:left-[-1px] data-[side=right]:rotate-90"].join(" "),children:e("svg",{width:B,height:B/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:e("path",{d:"M0 0h10L5 5z",fill:"var(--n-fill)"})})}):null,r]})})})]})}
@@ -0,0 +1,2 @@
1
+ export { Tooltip, TooltipProvider } from './Tooltip';
2
+ export type { TooltipProps, TooltipProviderProps } from './Tooltip';
@@ -0,0 +1 @@
1
+ export{Tooltip,TooltipProvider}from"./Tooltip";
@@ -0,0 +1,62 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import type { NebaColor } from '../../types';
4
+ /**
5
+ * What a piece of text *is*, which decides both its type scale and the element
6
+ * it renders as.
7
+ *
8
+ * This is deliberately not called `variant`. In this library `variant` means the
9
+ * weight of a surface — `solid` / `outline` / `text` — and a second meaning for
10
+ * the same word is exactly what the prop conventions forbid.
11
+ */
12
+ export type TypographyLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'lead' | 'caption' | 'overline';
13
+ export type TypographyAlign = 'start' | 'center' | 'end' | 'justify';
14
+ export type TypographyWeight = 'regular' | 'medium' | 'semibold' | 'bold';
15
+ export interface TypographyProps extends Omit<React.ComponentPropsWithoutRef<'p'>, 'color' | 'children'> {
16
+ /**
17
+ * The type scale, and the element that carries it. `h1`–`h6` render the
18
+ * matching heading, `lead`/`body` a `<p>`, `caption`/`overline` a `<span>`.
19
+ * @default 'body'
20
+ */
21
+ level?: TypographyLevel;
22
+ /**
23
+ * Semantic colour role. Unlike every other component this has **no default**:
24
+ * text inherits the page's own colour unless a role is asked for, because the
25
+ * common case for a paragraph is to look like the paragraphs around it.
26
+ */
27
+ color?: NebaColor;
28
+ /** Overrides the weight the level would otherwise pick. */
29
+ weight?: TypographyWeight;
30
+ align?: TypographyAlign;
31
+ /**
32
+ * Clamps the text to this many lines with an ellipsis. `1` is a single-line
33
+ * truncation. Omit it and the text wraps as far as it needs to.
34
+ */
35
+ lines?: number;
36
+ /**
37
+ * Adds the space below that a run of prose expects. Off by default: a library
38
+ * component that injects margins is one a layout has to fight.
39
+ * @default false
40
+ */
41
+ gutter?: boolean;
42
+ /**
43
+ * Renders a different element without changing the type scale — a `h2`-sized
44
+ * line that is semantically a `<p>`, or the other way round. Base UI's own
45
+ * escape hatch, so it behaves the same here as on Box.
46
+ */
47
+ render?: useRender.RenderProp;
48
+ children?: React.ReactNode;
49
+ }
50
+ /**
51
+ * Text at one of the library's sizes.
52
+ *
53
+ * The type scale is the one thing in a design system that everything else is
54
+ * measured against, and until now it only existed inside the components that
55
+ * happened to need it — a Card's title, a TextField's label. This is that ladder
56
+ * on its own, so a page can use it without wrapping its prose in a card.
57
+ *
58
+ * `level` sets the scale *and* the element, which is the common case. When they
59
+ * have to differ — a subheading that should not enter the document outline, a
60
+ * `<p>` that has to look like an `h3` — `render` breaks the tie.
61
+ */
62
+ export declare const Typography: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1 @@
1
+ import*as e from"react";import{useRender as t}from"@base-ui/react/use-render";const r={h1:"text-[1.875rem]/[2.25rem] tracking-[-0.02em]",h2:"text-[1.5rem]/[1.875rem] tracking-[-0.015em]",h3:"text-[1.25rem]/[1.625rem] tracking-[-0.01em]",h4:"text-[1.0625rem]/[1.5rem]",h5:"text-[0.9375rem]/[1.375rem]",h6:"text-[0.8125rem]/[1.25rem]",lead:"text-[1.0625rem]/[1.75rem]",body:"text-[0.8125rem]/[1.375rem]",caption:"text-[0.75rem]/[1.125rem]",overline:"text-[0.6875rem]/[1rem] tracking-[0.08em] uppercase"},m={h1:"semibold",h2:"semibold",h3:"semibold",h4:"semibold",h5:"semibold",h6:"semibold",lead:"regular",body:"regular",caption:"regular",overline:"medium"},n={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",caption:"span",overline:"span"},a=new Set(["caption","overline"]),l={h1:"mb-4",h2:"mb-3.5",h3:"mb-3",h4:"mb-2.5",h5:"mb-2",h6:"mb-2",lead:"mb-4",body:"mb-3",caption:"mb-2",overline:"mb-2"},o={regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},i={start:"text-start",center:"text-center",end:"text-end",justify:"text-justify"},c={1:"truncate",2:"line-clamp-2",3:"line-clamp-3",4:"line-clamp-4",5:"line-clamp-5",6:"line-clamp-6"};export const Typography=e.forwardRef(function({level:h="body",color:d,weight:s,align:b,lines:p,gutter:x=!1,render:u,className:f,style:g,children:y,...v},k){const j=[r[h],o[s??m[h]],b?i[b]:"",p?c[p]??"line-clamp-6":"",x?l[h]:"",d?"text-(--n-accent)":a.has(h)?"text-(--neba-muted-fg)":"text-(--neba-fg)",f??""].filter(Boolean).join(" ");return t({render:u??e.createElement(n[h]),ref:k,props:{className:j,style:d?{"--n-accent":`var(--neba-${d}-accent)`,...g}:g,children:y,...v}})});
@@ -0,0 +1,2 @@
1
+ export { Typography } from './Typography';
2
+ export type { TypographyAlign, TypographyLevel, TypographyProps, TypographyWeight } from './Typography';
@@ -0,0 +1 @@
1
+ export{Typography}from"./Typography";
package/dist/index.d.ts CHANGED
@@ -1 +1,50 @@
1
- export * from './components/button/index.js';
1
+ export * from './types';
2
+ export * from './components/accordion';
3
+ export * from './components/alert';
4
+ export * from './components/badge';
5
+ export * from './components/blockquote';
6
+ export * from './components/box';
7
+ export * from './components/button';
8
+ export * from './components/button-group';
9
+ export * from './components/card';
10
+ export * from './components/carousel';
11
+ export * from './components/checkbox';
12
+ export * from './components/chip';
13
+ export * from './components/combobox';
14
+ export * from './components/container';
15
+ export * from './components/date-picker';
16
+ export * from './components/date-range-picker';
17
+ export * from './components/date-time-picker';
18
+ export * from './components/dialog';
19
+ export * from './components/divider';
20
+ export * from './components/file-picker';
21
+ export * from './components/grid';
22
+ export * from './components/grid-container';
23
+ export * from './components/highlight';
24
+ export * from './components/icon';
25
+ export * from './components/icon-button';
26
+ export * from './components/list';
27
+ export * from './components/menu';
28
+ export * from './components/number-field';
29
+ export * from './components/overlay';
30
+ export * from './components/pagination';
31
+ export * from './components/pill';
32
+ export * from './components/progress-box';
33
+ export * from './components/progress-circular';
34
+ export * from './components/progress-linear';
35
+ export * from './components/radio-group';
36
+ export * from './components/segmented-button';
37
+ export * from './components/select';
38
+ export * from './components/shortcut';
39
+ export * from './components/slider';
40
+ export * from './components/statistic';
41
+ export * from './components/switch';
42
+ export * from './components/table';
43
+ export * from './components/tabs';
44
+ export * from './components/text-field';
45
+ export * from './components/time-picker';
46
+ export * from './components/timeline';
47
+ export * from './components/toast';
48
+ export * from './components/toolbar';
49
+ export * from './components/tooltip';
50
+ export * from './components/typography';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./components/button/index.js";
1
+ export*from"./types";export*from"./components/accordion";export*from"./components/alert";export*from"./components/badge";export*from"./components/blockquote";export*from"./components/box";export*from"./components/button";export*from"./components/button-group";export*from"./components/card";export*from"./components/carousel";export*from"./components/checkbox";export*from"./components/chip";export*from"./components/combobox";export*from"./components/container";export*from"./components/date-picker";export*from"./components/date-range-picker";export*from"./components/date-time-picker";export*from"./components/dialog";export*from"./components/divider";export*from"./components/file-picker";export*from"./components/grid";export*from"./components/grid-container";export*from"./components/highlight";export*from"./components/icon";export*from"./components/icon-button";export*from"./components/list";export*from"./components/menu";export*from"./components/number-field";export*from"./components/overlay";export*from"./components/pagination";export*from"./components/pill";export*from"./components/progress-box";export*from"./components/progress-circular";export*from"./components/progress-linear";export*from"./components/radio-group";export*from"./components/segmented-button";export*from"./components/select";export*from"./components/shortcut";export*from"./components/slider";export*from"./components/statistic";export*from"./components/switch";export*from"./components/table";export*from"./components/tabs";export*from"./components/text-field";export*from"./components/time-picker";export*from"./components/timeline";export*from"./components/toast";export*from"./components/toolbar";export*from"./components/tooltip";export*from"./components/typography";
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+ import type { NebaColor, NebaDensity, NebaElevation, NebaSize, NebaVariant } from '../types';
3
+ /**
4
+ * What a Button inherits from the ButtonGroup around it.
5
+ *
6
+ * The alternative — `React.Children.map` with `cloneElement` — breaks the moment
7
+ * a caller wraps one of the buttons in a Tooltip, a `<Fragment>` or a `.map()`,
8
+ * which is most of the time. A context reaches the Button wherever it ended up.
9
+ *
10
+ * Every field is optional and every one of them means "not specified": a Button
11
+ * falls back to its own default rather than to a value the group invented, so
12
+ * `<ButtonGroup>` with no props changes nothing except the corners.
13
+ *
14
+ * It lives in `internal/` rather than in the button-group folder so that Button
15
+ * can read it without the two components importing each other.
16
+ */
17
+ export interface ButtonGroupContextValue {
18
+ variant?: NebaVariant;
19
+ size?: NebaSize;
20
+ color?: NebaColor;
21
+ density?: NebaDensity;
22
+ elevation?: NebaElevation;
23
+ disabled?: boolean;
24
+ }
25
+ export declare const ButtonGroupContext: React.Context<ButtonGroupContextValue | null>;
@@ -0,0 +1 @@
1
+ import*as t from"react";export const ButtonGroupContext=t.createContext(null);
@@ -0,0 +1,149 @@
1
+ import * as React from 'react';
2
+ import { type TimeUnit } from './date';
3
+ import type { NebaColor, NebaDensity, NebaSize, NebaWeekday } from '../types';
4
+ /**
5
+ * The calendar grid and the clock columns, written once for the four pickers.
6
+ *
7
+ * They live in `internal/` for the reason `button-group.ts` does: a
8
+ * DateTimePicker is a DatePicker and a TimePicker in one popup, and a
9
+ * DateRangePicker is two calendars, so three components need this and none of
10
+ * them should have to import another. The one thing it reaches *up* for is
11
+ * `Button` — the header's steppers are buttons, they are not a new kind of
12
+ * control, and Pagination already makes that argument. Nothing here is exported
13
+ * from `src/index.ts`.
14
+ *
15
+ * The day cells are deliberately *not* Buttons. A cell has states a Button has
16
+ * no vocabulary for — inside a range, at the end of a range, today, belonging to
17
+ * the month next door — and four of them have to be told apart at a glance in a
18
+ * grid of forty-two.
19
+ */
20
+ /**
21
+ * Every string a picker says that is not a date.
22
+ *
23
+ * One object rather than eighteen props. These are a set: a caller who has to
24
+ * translate "Previous month" has to translate "Next month" in the same breath,
25
+ * and a component with eighteen `*Label` props is a component whose signature is
26
+ * mostly apology. The dates themselves are never in here — those come from
27
+ * `Intl`, which already knows what July is called in more languages than this
28
+ * file ever will.
29
+ */
30
+ export interface PickerLabels {
31
+ /** The calendar's steppers, in day view. */
32
+ previousMonth: string;
33
+ nextMonth: string;
34
+ /** The same steppers in month view, where they move by a year. */
35
+ previousYear: string;
36
+ nextYear: string;
37
+ /** And in year view, where they move by a page of twelve. */
38
+ previousYears: string;
39
+ nextYears: string;
40
+ /** The two header buttons that open the month grid and the year grid. */
41
+ chooseMonth: string;
42
+ chooseYear: string;
43
+ /** The footer's actions. */
44
+ today: string;
45
+ now: string;
46
+ clear: string;
47
+ done: string;
48
+ /** The clock's columns. */
49
+ hour: string;
50
+ minute: string;
51
+ second: string;
52
+ meridiem: string;
53
+ /** Which end of a range the calendar is currently asking for. */
54
+ start: string;
55
+ end: string;
56
+ }
57
+ export declare const defaultPickerLabels: PickerLabels;
58
+ /** Merges a caller's overrides over the defaults, once per render. */
59
+ export declare function usePickerLabels(overrides?: Partial<PickerLabels>): PickerLabels;
60
+ export interface CalendarProps {
61
+ size: NebaSize;
62
+ color: NebaColor;
63
+ locale?: string;
64
+ weekStartsOn: NebaWeekday;
65
+ /** The month on screen. Controlled, so two panels can be kept a month apart. */
66
+ month: Date;
67
+ onMonthChange: (month: Date) => void;
68
+ /** The days drawn filled — one for a single picker, up to two for a range. */
69
+ selected: readonly (Date | null | undefined)[];
70
+ /** The two ends the band is drawn between. Both `null` outside range mode. */
71
+ rangeStart?: Date | null;
72
+ rangeEnd?: Date | null;
73
+ onSelect: (date: Date) => void;
74
+ /** The day under the pointer, for a range that is only half chosen. */
75
+ onPreviewChange?: (date: Date | null) => void;
76
+ minDate?: Date | null;
77
+ maxDate?: Date | null;
78
+ shouldDisableDate?: (date: Date) => boolean;
79
+ /**
80
+ * Draws the leading and trailing days that belong to the neighbouring months.
81
+ *
82
+ * On by default, because clicking the 1st of next month from this month's
83
+ * panel is a real shortcut. A two-month range picker turns it *off*, and not
84
+ * as a matter of taste: with both panels showing six full weeks, the 1st of
85
+ * August appears twice — once as a trailing day of July and once as itself —
86
+ * and two cells with the same name in the same popup is ambiguous to a pointer
87
+ * and outright broken to a screen reader.
88
+ * @default true
89
+ */
90
+ showOutsideDays?: boolean;
91
+ /** Takes the focus on mount — the popup has just opened. */
92
+ autoFocus?: boolean;
93
+ showPreviousButton?: boolean;
94
+ showNextButton?: boolean;
95
+ labels: PickerLabels;
96
+ className?: string;
97
+ }
98
+ /**
99
+ * One month, with a way to reach every other one.
100
+ *
101
+ * Three views on the same footprint: the days of a month, the twelve months of a
102
+ * year, twelve years at a time. They are deliberately the same width *and* the
103
+ * same height — the day view is seven rows counting its header, and the other
104
+ * two stretch four rows and three rows across that same height — so switching
105
+ * view never resizes the popup under the pointer that opened it.
106
+ *
107
+ * Arrow keys move by one cell, `PageUp`/`PageDown` by a month (a year with
108
+ * Shift), `Home`/`End` to the ends of the week, and running off an edge steps
109
+ * the calendar rather than stopping. One roving tab stop, so `Tab` leaves the
110
+ * grid instead of walking forty-two cells — the pattern the ARIA date-picker
111
+ * practice describes, and the reason none of the cells is a `disabled` button.
112
+ */
113
+ export declare function Calendar({ size, color, locale, weekStartsOn, month, onMonthChange, selected, rangeStart, rangeEnd, onSelect, onPreviewChange, minDate, maxDate, shouldDisableDate, showOutsideDays, autoFocus, showPreviousButton, showNextButton, labels, className }: CalendarProps): React.JSX.Element;
114
+ export type { TimeUnit };
115
+ export interface TimeGridProps {
116
+ size: NebaSize;
117
+ density: NebaDensity;
118
+ locale?: string;
119
+ /** The time on screen, or `null` while nothing has been chosen. */
120
+ value: Date | null;
121
+ /** The day the columns write into while `value` is still `null`. */
122
+ referenceDate: Date;
123
+ onChange: (value: Date) => void;
124
+ /** A 12-hour dial with an AM/PM column. Defaults to whatever the locale does. */
125
+ hour12: boolean;
126
+ showSeconds: boolean;
127
+ hourStep: number;
128
+ minuteStep: number;
129
+ secondStep: number;
130
+ shouldDisableTime?: (value: Date, unit: TimeUnit) => boolean;
131
+ /** Takes the focus on mount — the popup has just opened. */
132
+ autoFocus?: boolean;
133
+ labels: PickerLabels;
134
+ className?: string;
135
+ }
136
+ /**
137
+ * Hours, minutes and — when asked for — seconds, as columns you scroll rather
138
+ * than as a dial you drag.
139
+ *
140
+ * Columns because they are the shape that answers what a time picker is actually
141
+ * asked: "half past nine" is two glances, and "any time at all, on the hour" is
142
+ * a column you never touch. A clock face is prettier and needs a `transform` to
143
+ * read, which this library does not have.
144
+ *
145
+ * The chosen row in each column is scrolled into view once, on open. That is the
146
+ * only imperative work here and it is not optional: a column of sixty minutes
147
+ * that opens at `00` while the value is `45` has hidden its own answer.
148
+ */
149
+ export declare function TimeGrid({ size, density, locale, value, referenceDate, onChange, hour12, showSeconds, hourStep, minuteStep, secondStep, shouldDisableTime, autoFocus, labels, className }: TimeGridProps): React.JSX.Element;