@amberstack/comp-lib 0.0.0-stage → 0.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 (260) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -2
  3. package/dist/amberstack.css +2 -0
  4. package/dist/components/Accordion/Accordion.d.ts +18 -0
  5. package/dist/components/Accordion/AccordionContext.d.ts +10 -0
  6. package/dist/components/Accordion/AccordionItem.d.ts +11 -0
  7. package/dist/components/Accordion/index.d.ts +2 -0
  8. package/dist/components/ActivityItem/ActivityItem.d.ts +15 -0
  9. package/dist/components/ActivityItem/index.d.ts +1 -0
  10. package/dist/components/AreaChart/AreaChart.d.ts +4 -0
  11. package/dist/components/AreaChart/index.d.ts +1 -0
  12. package/dist/components/AssetField/AssetField.d.ts +26 -0
  13. package/dist/components/AssetField/index.d.ts +1 -0
  14. package/dist/components/Avatar/Avatar.d.ts +19 -0
  15. package/dist/components/Avatar/AvatarContext.d.ts +3 -0
  16. package/dist/components/Avatar/AvatarGroup.d.ts +12 -0
  17. package/dist/components/Avatar/index.d.ts +2 -0
  18. package/dist/components/Banner/Banner.d.ts +18 -0
  19. package/dist/components/Banner/index.d.ts +1 -0
  20. package/dist/components/BarChart/BarChart.d.ts +25 -0
  21. package/dist/components/BarChart/index.d.ts +1 -0
  22. package/dist/components/BlockHeader/BlockHeader.d.ts +22 -0
  23. package/dist/components/BlockHeader/index.d.ts +1 -0
  24. package/dist/components/Breadcrumb/Breadcrumb.d.ts +9 -0
  25. package/dist/components/Breadcrumb/BreadcrumbItem.d.ts +11 -0
  26. package/dist/components/Breadcrumb/index.d.ts +2 -0
  27. package/dist/components/Button/Button.d.ts +16 -0
  28. package/dist/components/Button/index.d.ts +1 -0
  29. package/dist/components/Calendar/Calendar.d.ts +49 -0
  30. package/dist/components/Calendar/CalendarDay.d.ts +25 -0
  31. package/dist/components/Calendar/CalendarHeader.d.ts +27 -0
  32. package/dist/components/Calendar/DateTriggerInternal.d.ts +30 -0
  33. package/dist/components/Calendar/dateUtils.d.ts +95 -0
  34. package/dist/components/Calendar/index.d.ts +4 -0
  35. package/dist/components/Calendar/useDatePopup.d.ts +22 -0
  36. package/dist/components/Card/Card.d.ts +10 -0
  37. package/dist/components/Card/CardFooter.d.ts +8 -0
  38. package/dist/components/Card/CardHeader.d.ts +14 -0
  39. package/dist/components/Card/index.d.ts +3 -0
  40. package/dist/components/CatalogCard/CatalogCard.d.ts +18 -0
  41. package/dist/components/CatalogCard/index.d.ts +1 -0
  42. package/dist/components/ChartCard/ChartCard.d.ts +30 -0
  43. package/dist/components/ChartCard/index.d.ts +1 -0
  44. package/dist/components/ChartCore/ChartAxes.d.ts +24 -0
  45. package/dist/components/ChartCore/ChartDataTable.d.ts +19 -0
  46. package/dist/components/ChartCore/ChartFrame.d.ts +11 -0
  47. package/dist/components/ChartCore/ChartHoverLayer.d.ts +21 -0
  48. package/dist/components/ChartCore/chartPlayHelpers.d.ts +11 -0
  49. package/dist/components/ChartCore/index.d.ts +10 -0
  50. package/dist/components/ChartCore/paths.d.ts +23 -0
  51. package/dist/components/ChartCore/scales.d.ts +40 -0
  52. package/dist/components/ChartCore/series.d.ts +4 -0
  53. package/dist/components/ChartCore/types.d.ts +38 -0
  54. package/dist/components/ChartCore/useChartHover.d.ts +25 -0
  55. package/dist/components/ChartCore/useChartSize.d.ts +6 -0
  56. package/dist/components/ChartLegend/ChartLegend.d.ts +20 -0
  57. package/dist/components/ChartLegend/ChartLegendItem.d.ts +19 -0
  58. package/dist/components/ChartLegend/index.d.ts +4 -0
  59. package/dist/components/ChartLegend/legendHelpers.d.ts +20 -0
  60. package/dist/components/ChartLegend/useLegendState.d.ts +10 -0
  61. package/dist/components/ChartTooltip/ChartTooltip.d.ts +20 -0
  62. package/dist/components/ChartTooltip/index.d.ts +1 -0
  63. package/dist/components/Checkbox/Checkbox.d.ts +11 -0
  64. package/dist/components/Checkbox/index.d.ts +1 -0
  65. package/dist/components/ChecklistItem/ChecklistItem.d.ts +14 -0
  66. package/dist/components/ChecklistItem/index.d.ts +1 -0
  67. package/dist/components/CommandPalette/CommandPalette.d.ts +32 -0
  68. package/dist/components/CommandPalette/CommandPaletteItem.d.ts +14 -0
  69. package/dist/components/CommandPalette/index.d.ts +2 -0
  70. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +27 -0
  71. package/dist/components/ConfirmDialog/index.d.ts +1 -0
  72. package/dist/components/ContentRow/ContentRow.d.ts +20 -0
  73. package/dist/components/ContentRow/index.d.ts +1 -0
  74. package/dist/components/CredentialRow/CredentialRow.d.ts +18 -0
  75. package/dist/components/CredentialRow/index.d.ts +1 -0
  76. package/dist/components/DataTable/DataTable.d.ts +115 -0
  77. package/dist/components/DataTable/index.d.ts +1 -0
  78. package/dist/components/DataTable/useControllable.d.ts +2 -0
  79. package/dist/components/DateField/DateField.d.ts +4 -0
  80. package/dist/components/DateField/index.d.ts +1 -0
  81. package/dist/components/DatePicker/DatePicker.d.ts +42 -0
  82. package/dist/components/DatePicker/index.d.ts +1 -0
  83. package/dist/components/DateRangePicker/DateRangePicker.d.ts +87 -0
  84. package/dist/components/DateRangePicker/DateRangePresets.d.ts +24 -0
  85. package/dist/components/DateRangePicker/DateRangeTrigger.d.ts +10 -0
  86. package/dist/components/DateRangePicker/index.d.ts +3 -0
  87. package/dist/components/Dialog/Dialog.d.ts +23 -0
  88. package/dist/components/Dialog/DialogBody.d.ts +4 -0
  89. package/dist/components/Dialog/DialogFooter.d.ts +4 -0
  90. package/dist/components/Dialog/DialogHeader.d.ts +15 -0
  91. package/dist/components/Dialog/dialogContext.d.ts +23 -0
  92. package/dist/components/Dialog/index.d.ts +5 -0
  93. package/dist/components/Dialog/useModalBehaviour.d.ts +27 -0
  94. package/dist/components/Divider/Divider.d.ts +10 -0
  95. package/dist/components/Divider/index.d.ts +1 -0
  96. package/dist/components/DonutChart/DonutChart.d.ts +20 -0
  97. package/dist/components/DonutChart/index.d.ts +1 -0
  98. package/dist/components/Drawer/Drawer.d.ts +21 -0
  99. package/dist/components/Drawer/index.d.ts +1 -0
  100. package/dist/components/DropdownMenu/DropdownMenu.d.ts +32 -0
  101. package/dist/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +13 -0
  102. package/dist/components/DropdownMenu/DropdownMenuContext.d.ts +5 -0
  103. package/dist/components/DropdownMenu/DropdownMenuItem.d.ts +16 -0
  104. package/dist/components/DropdownMenu/DropdownMenuLabel.d.ts +4 -0
  105. package/dist/components/DropdownMenu/DropdownMenuSeparator.d.ts +4 -0
  106. package/dist/components/DropdownMenu/index.d.ts +5 -0
  107. package/dist/components/EmptyState/EmptyState.d.ts +14 -0
  108. package/dist/components/EmptyState/index.d.ts +1 -0
  109. package/dist/components/EnvironmentLabel/EnvironmentLabel.d.ts +10 -0
  110. package/dist/components/EnvironmentLabel/index.d.ts +1 -0
  111. package/dist/components/Field/Field.d.ts +26 -0
  112. package/dist/components/Field/FieldContext.d.ts +17 -0
  113. package/dist/components/Field/index.d.ts +2 -0
  114. package/dist/components/Field/useFieldControl.d.ts +34 -0
  115. package/dist/components/Filters/FilterBar.d.ts +9 -0
  116. package/dist/components/Filters/FilterChip.d.ts +18 -0
  117. package/dist/components/Filters/FilterMenu.d.ts +37 -0
  118. package/dist/components/Filters/index.d.ts +3 -0
  119. package/dist/components/IconButton/IconButton.d.ts +16 -0
  120. package/dist/components/IconButton/index.d.ts +1 -0
  121. package/dist/components/Input/Input.d.ts +14 -0
  122. package/dist/components/Input/LockedTagInternal.d.ts +2 -0
  123. package/dist/components/Input/index.d.ts +1 -0
  124. package/dist/components/KPI/KPI.d.ts +24 -0
  125. package/dist/components/KPI/index.d.ts +1 -0
  126. package/dist/components/KPIGraph/KPIGraph.d.ts +12 -0
  127. package/dist/components/KPIGraph/index.d.ts +1 -0
  128. package/dist/components/Kbd/Kbd.d.ts +4 -0
  129. package/dist/components/Kbd/index.d.ts +1 -0
  130. package/dist/components/Label/Label.d.ts +14 -0
  131. package/dist/components/Label/index.d.ts +1 -0
  132. package/dist/components/LineChart/LineChart.d.ts +4 -0
  133. package/dist/components/LineChart/SeriesChartInternal.d.ts +30 -0
  134. package/dist/components/LineChart/index.d.ts +2 -0
  135. package/dist/components/Link/Link.d.ts +20 -0
  136. package/dist/components/Link/index.d.ts +1 -0
  137. package/dist/components/MediaTile/MediaTile.d.ts +13 -0
  138. package/dist/components/MediaTile/index.d.ts +1 -0
  139. package/dist/components/Menu/Menu.d.ts +7 -0
  140. package/dist/components/Menu/MenuItem.d.ts +20 -0
  141. package/dist/components/Menu/index.d.ts +3 -0
  142. package/dist/components/Menu/usePopup.d.ts +46 -0
  143. package/dist/components/MetricCard/MetricCard.d.ts +26 -0
  144. package/dist/components/MetricCard/index.d.ts +1 -0
  145. package/dist/components/MultiSelect/MultiSelect.d.ts +42 -0
  146. package/dist/components/MultiSelect/index.d.ts +1 -0
  147. package/dist/components/NavGroup/NavGroup.d.ts +17 -0
  148. package/dist/components/NavGroup/index.d.ts +1 -0
  149. package/dist/components/NavItem/NavItem.d.ts +28 -0
  150. package/dist/components/NavItem/index.d.ts +1 -0
  151. package/dist/components/NodeGraph/GraphNode.d.ts +15 -0
  152. package/dist/components/NodeGraph/NodeGraph.d.ts +34 -0
  153. package/dist/components/NodeGraph/index.d.ts +2 -0
  154. package/dist/components/NodeReference/NodeReference.d.ts +12 -0
  155. package/dist/components/NodeReference/index.d.ts +1 -0
  156. package/dist/components/NumberField/NumberField.d.ts +28 -0
  157. package/dist/components/NumberField/index.d.ts +1 -0
  158. package/dist/components/PageHeader/PageHeader.d.ts +20 -0
  159. package/dist/components/PageHeader/index.d.ts +1 -0
  160. package/dist/components/Pagination/Pagination.d.ts +21 -0
  161. package/dist/components/Pagination/index.d.ts +1 -0
  162. package/dist/components/PickerItem/PickerItem.d.ts +14 -0
  163. package/dist/components/PickerItem/index.d.ts +1 -0
  164. package/dist/components/Popover/Popover.d.ts +24 -0
  165. package/dist/components/Popover/index.d.ts +1 -0
  166. package/dist/components/ProgressBar/ProgressBar.d.ts +16 -0
  167. package/dist/components/ProgressBar/index.d.ts +1 -0
  168. package/dist/components/ProposedNote/ProposedNote.d.ts +9 -0
  169. package/dist/components/ProposedNote/index.d.ts +1 -0
  170. package/dist/components/Radio/Radio.d.ts +11 -0
  171. package/dist/components/Radio/RadioGroup.d.ts +22 -0
  172. package/dist/components/Radio/RadioGroupContext.d.ts +11 -0
  173. package/dist/components/Radio/index.d.ts +2 -0
  174. package/dist/components/RangeTabs/RangeTabs.d.ts +21 -0
  175. package/dist/components/RangeTabs/Segment.d.ts +7 -0
  176. package/dist/components/RangeTabs/index.d.ts +2 -0
  177. package/dist/components/ResourceCard/ResourceCard.d.ts +29 -0
  178. package/dist/components/ResourceCard/index.d.ts +1 -0
  179. package/dist/components/RichTextField/RichTextField.d.ts +26 -0
  180. package/dist/components/RichTextField/RichTextTool.d.ts +9 -0
  181. package/dist/components/RichTextField/RichTextToolbar.d.ts +12 -0
  182. package/dist/components/RichTextField/index.d.ts +4 -0
  183. package/dist/components/RichTextField/richTextCommands.d.ts +18 -0
  184. package/dist/components/ScatterPlot/ScatterPlot.d.ts +41 -0
  185. package/dist/components/ScatterPlot/index.d.ts +1 -0
  186. package/dist/components/Search/Search.d.ts +15 -0
  187. package/dist/components/Search/index.d.ts +1 -0
  188. package/dist/components/Select/Select.d.ts +38 -0
  189. package/dist/components/Select/index.d.ts +1 -0
  190. package/dist/components/Select/useListbox.d.ts +38 -0
  191. package/dist/components/SetupStep/SetupStep.d.ts +18 -0
  192. package/dist/components/SetupStep/index.d.ts +1 -0
  193. package/dist/components/Sidebar/Sidebar.d.ts +17 -0
  194. package/dist/components/Sidebar/SidebarBrand.d.ts +11 -0
  195. package/dist/components/Sidebar/SidebarUser.d.ts +13 -0
  196. package/dist/components/Sidebar/index.d.ts +3 -0
  197. package/dist/components/Skeleton/Skeleton.d.ts +12 -0
  198. package/dist/components/Skeleton/index.d.ts +1 -0
  199. package/dist/components/SortableRow/SortableRow.d.ts +24 -0
  200. package/dist/components/SortableRow/index.d.ts +1 -0
  201. package/dist/components/Sparkline/Sparkline.d.ts +18 -0
  202. package/dist/components/Sparkline/index.d.ts +1 -0
  203. package/dist/components/Spinner/Spinner.d.ts +10 -0
  204. package/dist/components/Spinner/index.d.ts +1 -0
  205. package/dist/components/Status/Status.d.ts +8 -0
  206. package/dist/components/Status/index.d.ts +1 -0
  207. package/dist/components/StatusIcon/StatusIcon.d.ts +13 -0
  208. package/dist/components/StatusIcon/index.d.ts +1 -0
  209. package/dist/components/Stepper/Step.d.ts +19 -0
  210. package/dist/components/Stepper/Stepper.d.ts +28 -0
  211. package/dist/components/Stepper/index.d.ts +2 -0
  212. package/dist/components/SwitchField/SwitchField.d.ts +10 -0
  213. package/dist/components/SwitchField/index.d.ts +1 -0
  214. package/dist/components/Table/Table.d.ts +9 -0
  215. package/dist/components/Table/TableCell.d.ts +10 -0
  216. package/dist/components/Table/TableCellActions.d.ts +11 -0
  217. package/dist/components/Table/TableCellCheckbox.d.ts +7 -0
  218. package/dist/components/Table/TableCellNumber.d.ts +11 -0
  219. package/dist/components/Table/TableCellStatus.d.ts +4 -0
  220. package/dist/components/Table/TableCellText.d.ts +7 -0
  221. package/dist/components/Table/TableCellTwoLine.d.ts +9 -0
  222. package/dist/components/Table/TableCellUser.d.ts +11 -0
  223. package/dist/components/Table/TableContext.d.ts +3 -0
  224. package/dist/components/Table/TableFooter.d.ts +9 -0
  225. package/dist/components/Table/TableHeaderCell.d.ts +17 -0
  226. package/dist/components/Table/TableHeaderRow.d.ts +4 -0
  227. package/dist/components/Table/TableRow.d.ts +7 -0
  228. package/dist/components/Table/TableToolbar.d.ts +13 -0
  229. package/dist/components/Table/index.d.ts +14 -0
  230. package/dist/components/Table/storyHelpers.d.ts +12 -0
  231. package/dist/components/Tabs/Tab.d.ts +9 -0
  232. package/dist/components/Tabs/TabList.d.ts +4 -0
  233. package/dist/components/Tabs/TabPanel.d.ts +7 -0
  234. package/dist/components/Tabs/Tabs.d.ts +11 -0
  235. package/dist/components/Tabs/TabsContext.d.ts +12 -0
  236. package/dist/components/Tabs/index.d.ts +4 -0
  237. package/dist/components/Textarea/Textarea.d.ts +9 -0
  238. package/dist/components/Textarea/index.d.ts +1 -0
  239. package/dist/components/Toast/Toast.d.ts +23 -0
  240. package/dist/components/Toast/ToastProvider.d.ts +12 -0
  241. package/dist/components/Toast/ToastStack.d.ts +11 -0
  242. package/dist/components/Toast/index.d.ts +4 -0
  243. package/dist/components/Toast/useToast.d.ts +25 -0
  244. package/dist/components/Toggle/Toggle.d.ts +14 -0
  245. package/dist/components/Toggle/index.d.ts +1 -0
  246. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  247. package/dist/components/Tooltip/index.d.ts +1 -0
  248. package/dist/components/Tooltip/useAnchoredPosition.d.ts +13 -0
  249. package/dist/components/TopBar/ContextSwitcher.d.ts +10 -0
  250. package/dist/components/TopBar/TopBar.d.ts +9 -0
  251. package/dist/components/TopBar/TopBarSeparator.d.ts +4 -0
  252. package/dist/components/TopBar/index.d.ts +3 -0
  253. package/dist/components/UnavailableState/UnavailableState.d.ts +18 -0
  254. package/dist/components/UnavailableState/index.d.ts +1 -0
  255. package/dist/icons/index.d.ts +57 -0
  256. package/dist/index.d.ts +86 -0
  257. package/dist/index.js +6774 -0
  258. package/dist/index.js.map +1 -0
  259. package/dist/lib/cx.d.ts +2 -0
  260. package/package.json +87 -4
@@ -0,0 +1,9 @@
1
+ import { type ButtonHTMLAttributes } from 'react';
2
+ export interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
3
+ /** Connects this tab to the TabPanel with the same value. */
4
+ value: string;
5
+ /** Number shown after the label. */
6
+ count?: number;
7
+ }
8
+ /** One tab in a TabList. The selected tab has an orange underline. Arrow keys move between tabs and select them. */
9
+ export declare const Tab: import("react").ForwardRefExoticComponent<TabProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,4 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ export type TabListProps = HTMLAttributes<HTMLDivElement>;
3
+ /** The row of Tab instances on a hairline. Give it an `aria-label`. */
4
+ export declare const TabList: import("react").ForwardRefExoticComponent<TabListProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ export interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Connects this panel to the Tab with the same value. */
4
+ value: string;
5
+ }
6
+ /** The content of one tab. It only renders its children while its tab is selected. */
7
+ export declare const TabPanel: import("react").ForwardRefExoticComponent<TabPanelProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,11 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'> {
3
+ /** The value of the selected tab, when controlled. */
4
+ value?: string;
5
+ /** The value of the first selected tab, when uncontrolled. Defaults to the first tab that is enabled. */
6
+ defaultValue?: string;
7
+ /** Called with the value of the tab the user selects. */
8
+ onChange?: (value: string) => void;
9
+ }
10
+ /** Switches between views of the same object. Holds a TabList and one TabPanel for each Tab. */
11
+ export declare const Tabs: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,12 @@
1
+ export interface TabsContextValue {
2
+ /** The value of the selected tab. */
3
+ value?: string;
4
+ /** Selects a tab because the user asked to. */
5
+ select: (value: string) => void;
6
+ /** Sets the first selection when none was given, without reporting a change. */
7
+ adopt: (value: string) => void;
8
+ tabId: (value: string) => string;
9
+ panelId: (value: string) => string;
10
+ }
11
+ export declare const TabsContext: import("react").Context<TabsContextValue | null>;
12
+ export declare function useTabsContext(part: string): TabsContextValue;
@@ -0,0 +1,4 @@
1
+ export * from './Tabs';
2
+ export * from './TabList';
3
+ export * from './Tab';
4
+ export * from './TabPanel';
@@ -0,0 +1,9 @@
1
+ import { type TextareaHTMLAttributes } from 'react';
2
+ export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
3
+ /** Shows the error state and sets `aria-invalid`. */
4
+ invalid?: boolean;
5
+ /** Read-only look with a "Locked" tag, for values set by staff. */
6
+ locked?: boolean;
7
+ }
8
+ /** Multi-line text control without a label. Use Field for a labelled textarea in a form. */
9
+ export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1 @@
1
+ export * from './Textarea';
@@ -0,0 +1,23 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ export type ToastTone = 'neutral' | 'success' | 'warning' | 'danger' | 'progress';
3
+ export interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
+ /** What kind of message this is. */
5
+ tone?: ToastTone;
6
+ /** The headline. */
7
+ title: ReactNode;
8
+ /** A short confirmation of what happened. */
9
+ body?: ReactNode;
10
+ /** A follow-up, normally a Link. Never the only route to an action. */
11
+ action?: ReactNode;
12
+ /** Shows a dismiss button, and is called when it is pressed. */
13
+ onDismiss?: () => void;
14
+ /** Accessible name of the dismiss button. */
15
+ dismissLabel?: string;
16
+ /** Percentage complete, from 0 to 100. Only used by the `progress` tone. */
17
+ progress?: number;
18
+ }
19
+ /**
20
+ * A brief floating message about something the user just did. Show it inside a ToastStack, whose live region
21
+ * announces it. Danger is also an alert, so it is announced straight away.
22
+ */
23
+ export declare const Toast: import("react").ForwardRefExoticComponent<ToastProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface ToastProviderProps {
3
+ /** The part of the app that can show toasts. */
4
+ children?: ReactNode;
5
+ /** How many toasts to show at once. */
6
+ max?: number;
7
+ }
8
+ /**
9
+ * Provides `useToast` and renders the ToastStack. Toasts leave after about 5 s, except danger, which stays.
10
+ * Timers pause while the pointer or keyboard focus is inside the stack.
11
+ */
12
+ export declare function ToastProvider({ children, max }: ToastProviderProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ export interface ToastStackProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Toast elements, oldest first. The newest shows at the bottom. */
4
+ children?: ReactNode;
5
+ /** How many toasts to show. The newest ones win. */
6
+ max?: number;
7
+ /** Accessible name of the region. */
8
+ 'aria-label'?: string;
9
+ }
10
+ /** The fixed bottom-right region that holds toasts. It stays mounted when empty, so screen readers keep watching it. */
11
+ export declare const ToastStack: import("react").ForwardRefExoticComponent<ToastStackProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,4 @@
1
+ export * from './Toast';
2
+ export * from './ToastStack';
3
+ export * from './ToastProvider';
4
+ export { useToast, type ToastContextValue, type ToastOptions } from './useToast';
@@ -0,0 +1,25 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ToastTone } from './Toast';
3
+ export interface ToastOptions {
4
+ /** What kind of message this is. */
5
+ tone?: ToastTone;
6
+ /** The headline. */
7
+ title: ReactNode;
8
+ /** A short confirmation of what happened. */
9
+ body?: ReactNode;
10
+ /** A follow-up, normally a Link. */
11
+ action?: ReactNode;
12
+ /** Milliseconds before it leaves on its own. Defaults to about 5 s, except for danger, which stays until dismissed. */
13
+ duration?: number;
14
+ /** Percentage complete, for the `progress` tone. */
15
+ progress?: number;
16
+ }
17
+ export interface ToastContextValue {
18
+ /** Shows a toast and returns its id. */
19
+ toast: (options: ToastOptions) => string;
20
+ /** Removes a toast by id. */
21
+ dismiss: (id: string) => void;
22
+ }
23
+ export declare const ToastContext: import("react").Context<ToastContextValue | null>;
24
+ /** Shows and dismisses toasts. Must be used inside a ToastProvider. */
25
+ export declare function useToast(): ToastContextValue;
@@ -0,0 +1,14 @@
1
+ import { type ButtonHTMLAttributes } from 'react';
2
+ export interface ToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'children'> {
3
+ /** Whether it is on, when controlled. */
4
+ checked?: boolean;
5
+ /** Whether it starts on, when uncontrolled. */
6
+ defaultChecked?: boolean;
7
+ /** Called with the new state. */
8
+ onChange?: (checked: boolean) => void;
9
+ }
10
+ /**
11
+ * Immediate on and off control. On is orange because it counts as selection. Use SwitchField to include a label;
12
+ * on its own it needs an `aria-label`.
13
+ */
14
+ export declare const Toggle: import("react").ForwardRefExoticComponent<ToggleProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1 @@
1
+ export * from './Toggle';
@@ -0,0 +1,17 @@
1
+ import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
2
+ import { type AnchoredPlacement } from './useAnchoredPosition';
3
+ export type TooltipPlacement = AnchoredPlacement;
4
+ export interface TooltipProps {
5
+ /** The hint text. Never put essential information or actions in a tooltip. */
6
+ content: ReactNode;
7
+ /** Which side of the target the tooltip sits on. It flips if there isn't room. */
8
+ placement?: TooltipPlacement;
9
+ /** Milliseconds before the tooltip opens on hover or focus. */
10
+ delay?: number;
11
+ /** One focusable element, which must accept mouse, focus and ARIA props. */
12
+ children: ReactElement<HTMLAttributes<HTMLElement>>;
13
+ /** Extra class for the tooltip. */
14
+ className?: string;
15
+ }
16
+ /** A short hint for one focusable element, shown on hover and focus. Escape hides it. */
17
+ export declare function Tooltip({ content, placement, delay, children, className }: TooltipProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Tooltip';
@@ -0,0 +1,13 @@
1
+ import { type HTMLAttributes, type ReactElement, type RefObject } from 'react';
2
+ export type AnchoredPlacement = 'top' | 'bottom' | 'left' | 'right';
3
+ /** Renders the one trigger element with extra props merged in. */
4
+ export declare function TriggerSlot({ element, ...props }: HTMLAttributes<HTMLElement> & {
5
+ element: ReactElement<HTMLAttributes<HTMLElement>>;
6
+ }): ReactElement<HTMLAttributes<HTMLElement>, string | import("react").JSXElementConstructor<any>>;
7
+ /**
8
+ * Keeps a `position: fixed` element next to its anchor while open, following scroll and resize.
9
+ * Flips to the opposite side when the requested one doesn't fit. Writes `top` and `left`, the resolved
10
+ * side as `data-placement`, and the anchor's centre along the shared edge as `--arrow-offset`.
11
+ * `getAnchor` must be stable.
12
+ */
13
+ export declare function useAnchoredPosition(open: boolean, getAnchor: () => HTMLElement | null, floatingRef: RefObject<HTMLElement | null>, placement: AnchoredPlacement, gap: number): void;
@@ -0,0 +1,10 @@
1
+ import { type ButtonHTMLAttributes } from 'react';
2
+ import { type IconName } from '../../icons';
3
+ export interface ContextSwitcherProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'name' | 'children'> {
4
+ /** Name of the current organisation, project or environment. */
5
+ name: string;
6
+ /** Icon before the name. */
7
+ icon?: IconName;
8
+ }
9
+ /** Shows the current context and opens the menu to change it. */
10
+ export declare const ContextSwitcher: import("react").ForwardRefExoticComponent<ContextSwitcherProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,9 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ export interface TopBarProps extends HTMLAttributes<HTMLElement> {
3
+ /** Where you are: a breadcrumb or context switchers. */
4
+ left?: ReactNode;
5
+ /** Global tools: status, docs link, inbox and account. */
6
+ right?: ReactNode;
7
+ }
8
+ /** The 56 px bar across the top of the app. */
9
+ export declare const TopBar: import("react").ForwardRefExoticComponent<TopBarProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,4 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ export type TopBarSeparatorProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'>;
3
+ /** The slash between two context switchers. It is decorative, so screen readers skip it. */
4
+ export declare const TopBarSeparator: import("react").ForwardRefExoticComponent<TopBarSeparatorProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,3 @@
1
+ export * from './TopBar';
2
+ export * from './ContextSwitcher';
3
+ export * from './TopBarSeparator';
@@ -0,0 +1,18 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ import { type IconName } from '../../icons';
3
+ export interface UnavailableStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
+ /** Icon for the feature that is off. */
5
+ icon?: IconName;
6
+ /** What is off. */
7
+ title: ReactNode;
8
+ /** Why it is off, and what still works. */
9
+ description?: ReactNode;
10
+ /** Text of the link that explains how to turn it on. */
11
+ linkLabel?: string;
12
+ /** Where that link goes. */
13
+ linkHref?: string;
14
+ /** Whether the link leaves the app. Opens in a new tab with an external-link icon. */
15
+ linkExternal?: boolean;
16
+ }
17
+ /** Explains that a feature is off because of how the system is set up, and how to turn it on. */
18
+ export declare const UnavailableState: import("react").ForwardRefExoticComponent<UnavailableStateProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from './UnavailableState';
@@ -0,0 +1,57 @@
1
+ import type { SVGProps } from 'react';
2
+ /** Same 24 px paths as the Icons page in Figma. */
3
+ export declare const iconPaths: {
4
+ readonly plus: "M5 12H19M12 5V19";
5
+ readonly minus: "M5 12H19";
6
+ readonly check: "M20 6L9 17L4 12";
7
+ readonly x: "M18 6L6 18M6 6L18 18";
8
+ readonly 'chevron-down': "M6 9L12 15L18 9";
9
+ readonly 'chevron-up': "M18 15L12 9L6 15";
10
+ readonly 'chevron-right': "M9 18L15 12L9 6";
11
+ readonly 'chevron-left': "M15 18L9 12L15 6";
12
+ readonly 'chevrons-up-down': "M7 15L12 20L17 15M7 9L12 4L17 9";
13
+ readonly 'arrow-right': "M5 12H19M12 5L19 12L12 19";
14
+ readonly 'arrow-left': "M12 19L5 12L12 5M19 12H5";
15
+ readonly 'arrow-up': "M5 12L12 5L19 12M12 19V5";
16
+ readonly 'arrow-down': "M12 5V19M19 12L12 19L5 12";
17
+ readonly 'external-link': "M15 3H21V9M10 14L21 3M18 13V19A2 2 0 0 1 16 21H5A2 2 0 0 1 3 19V8A2 2 0 0 1 5 6H11";
18
+ readonly search: "M19 11A8 8 0 1 1 3 11A8 8 0 1 1 19 11M21 21L16.7 16.7";
19
+ readonly lock: "M5 11H19A2 2 0 0 1 21 13V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V13A2 2 0 0 1 5 11ZM7 11V7A5 5 0 0 1 17 7V11";
20
+ readonly 'alert-triangle': "M21.73 18L13.73 4A2 2 0 0 0 10.25 4L2.25 18A2 2 0 0 0 4 21H20A2 2 0 0 0 21.73 18ZM12 9V13M12 17H12.01";
21
+ readonly 'alert-circle': "M22 12A10 10 0 1 1 2 12A10 10 0 1 1 22 12M12 8V12M12 16H12.01";
22
+ readonly info: "M22 12A10 10 0 1 1 2 12A10 10 0 1 1 22 12M12 16V12M12 8H12.01";
23
+ readonly 'check-circle': "M22 12A10 10 0 1 1 2 12A10 10 0 1 1 22 12M9 12L11 14L15 10";
24
+ readonly 'x-circle': "M22 12A10 10 0 1 1 2 12A10 10 0 1 1 22 12M15 9L9 15M9 9L15 15";
25
+ readonly clock: "M22 12A10 10 0 1 1 2 12A10 10 0 1 1 22 12M12 6V12L16 14";
26
+ readonly circle: "M22 12A10 10 0 1 1 2 12A10 10 0 1 1 22 12";
27
+ readonly user: "M19 21V19A4 4 0 0 0 15 15H9A4 4 0 0 0 5 19V21M16 7A4 4 0 1 1 8 7A4 4 0 1 1 16 7";
28
+ readonly sliders: "M21 4H14M10 4H3M21 12H12M8 12H3M21 20H16M12 20H3M14 2V6M8 10V14M16 18V22";
29
+ readonly home: "M3 9L12 2L21 9V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20ZM9 22V12H15V22";
30
+ readonly folder: "M20 20A2 2 0 0 0 22 18V8A2 2 0 0 0 20 6H12.1A2 2 0 0 1 10.41 5.1L9.6 3.9A2 2 0 0 0 7.93 3H4A2 2 0 0 0 2 5V18A2 2 0 0 0 4 20Z";
31
+ readonly database: "M21 5C21 6.66 17 8 12 8S3 6.66 3 5S7 2 12 2S21 3.34 21 5ZM3 5V19C3 20.66 7 22 12 22S21 20.66 21 19V5M3 12C3 13.66 7 15 12 15S21 13.66 21 12";
32
+ readonly globe: "M22 12A10 10 0 1 1 2 12A10 10 0 1 1 22 12M2 12H22M12 2A15 15 0 0 1 12 22A15 15 0 0 1 12 2";
33
+ readonly activity: "M22 12H18L15 21L9 3L6 12H2";
34
+ readonly bell: "M6 8A6 6 0 0 1 18 8C18 15 21 17 21 17H3S6 15 6 8M10.3 21A1.94 1.94 0 0 0 13.7 21";
35
+ readonly trash: "M3 6H21M19 6V20C19 21 18 22 17 22H7C6 22 5 21 5 20V6M8 6V4C8 3 9 2 10 2H14C15 2 16 3 16 4V6";
36
+ readonly pencil: "M12 20H21M16.5 3.5A2.12 2.12 0 0 1 19.5 6.5L7 19L3 20L4 16Z";
37
+ readonly copy: "M10 8H20A2 2 0 0 1 22 10V20A2 2 0 0 1 20 22H10A2 2 0 0 1 8 20V10A2 2 0 0 1 10 8ZM4 16C2.9 16 2 15.1 2 14V4C2 2.9 2.9 2 4 2H14C15.1 2 16 2.9 16 4";
38
+ readonly more: "M12 12H12.01M19 12H19.01M5 12H5.01";
39
+ readonly filter: "M22 3H2L10 12.46V19L14 21V12.46Z";
40
+ readonly calendar: "M8 2V6M16 2V6M5 4H19A2 2 0 0 1 21 6V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V6A2 2 0 0 1 5 4ZM3 10H21";
41
+ readonly 'file-text': "M15 2H6A2 2 0 0 0 4 4V20A2 2 0 0 0 6 22H18A2 2 0 0 0 20 20V7ZM14 2V6A2 2 0 0 0 16 8H20M16 13H8M16 17H8";
42
+ readonly image: "M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3ZM21 15L17.9 11.9A2 2 0 0 0 15.1 11.9L6 21M11 9A2 2 0 1 1 7 9A2 2 0 1 1 11 9";
43
+ readonly 'bar-chart': "M3 3V21H21M8 17V12M13 17V7M18 17V9";
44
+ readonly book: "M4 19.5A2.5 2.5 0 0 1 6.5 17H20V2H6.5A2.5 2.5 0 0 0 4 4.5ZM4 19.5A2.5 2.5 0 0 0 6.5 22H20V17";
45
+ };
46
+ export type IconName = keyof typeof iconPaths;
47
+ export declare const iconNames: IconName[];
48
+ export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'name'> {
49
+ /** Which icon to draw. */
50
+ name: IconName;
51
+ /** Width and height in pixels. */
52
+ size?: number;
53
+ /** Accessible name. Leave empty for decorative icons beside text. */
54
+ label?: string;
55
+ }
56
+ /** Draws an icon in the current text colour, with a 1.5 px stroke at 16 px. */
57
+ export declare function Icon({ name, size, label, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,86 @@
1
+ import './styles/index.css';
2
+ export * from './icons';
3
+ export * from './components/Accordion';
4
+ export * from './components/ActivityItem';
5
+ export * from './components/AreaChart';
6
+ export * from './components/AssetField';
7
+ export * from './components/Avatar';
8
+ export * from './components/Banner';
9
+ export * from './components/BarChart';
10
+ export * from './components/BlockHeader';
11
+ export * from './components/Breadcrumb';
12
+ export * from './components/Button';
13
+ export * from './components/Calendar';
14
+ export * from './components/Card';
15
+ export * from './components/CatalogCard';
16
+ export * from './components/ChartCard';
17
+ export * from './components/ChartCore';
18
+ export * from './components/ChartLegend';
19
+ export * from './components/ChartTooltip';
20
+ export * from './components/Checkbox';
21
+ export * from './components/ChecklistItem';
22
+ export * from './components/CommandPalette';
23
+ export * from './components/ConfirmDialog';
24
+ export * from './components/ContentRow';
25
+ export * from './components/CredentialRow';
26
+ export * from './components/DataTable';
27
+ export * from './components/DateField';
28
+ export * from './components/DatePicker';
29
+ export * from './components/DateRangePicker';
30
+ export * from './components/Dialog';
31
+ export * from './components/Divider';
32
+ export * from './components/DonutChart';
33
+ export * from './components/Drawer';
34
+ export * from './components/DropdownMenu';
35
+ export * from './components/EmptyState';
36
+ export * from './components/EnvironmentLabel';
37
+ export * from './components/Field';
38
+ export * from './components/Filters';
39
+ export * from './components/IconButton';
40
+ export * from './components/Input';
41
+ export * from './components/KPI';
42
+ export * from './components/KPIGraph';
43
+ export * from './components/Kbd';
44
+ export * from './components/Label';
45
+ export * from './components/LineChart';
46
+ export * from './components/Link';
47
+ export * from './components/MediaTile';
48
+ export * from './components/Menu';
49
+ export * from './components/MetricCard';
50
+ export * from './components/MultiSelect';
51
+ export * from './components/NavGroup';
52
+ export * from './components/NavItem';
53
+ export * from './components/NodeGraph';
54
+ export * from './components/NodeReference';
55
+ export * from './components/NumberField';
56
+ export * from './components/PageHeader';
57
+ export * from './components/Pagination';
58
+ export * from './components/PickerItem';
59
+ export * from './components/Popover';
60
+ export * from './components/ProgressBar';
61
+ export * from './components/ProposedNote';
62
+ export * from './components/Radio';
63
+ export * from './components/RangeTabs';
64
+ export * from './components/ResourceCard';
65
+ export * from './components/RichTextField';
66
+ export * from './components/ScatterPlot';
67
+ export * from './components/Search';
68
+ export * from './components/Select';
69
+ export * from './components/SetupStep';
70
+ export * from './components/Sidebar';
71
+ export * from './components/Skeleton';
72
+ export * from './components/SortableRow';
73
+ export * from './components/Sparkline';
74
+ export * from './components/Spinner';
75
+ export * from './components/Status';
76
+ export * from './components/StatusIcon';
77
+ export * from './components/Stepper';
78
+ export * from './components/SwitchField';
79
+ export * from './components/Table';
80
+ export * from './components/Tabs';
81
+ export * from './components/Textarea';
82
+ export * from './components/Toast';
83
+ export * from './components/Toggle';
84
+ export * from './components/Tooltip';
85
+ export * from './components/TopBar';
86
+ export * from './components/UnavailableState';