@ohseungik/maru-ui 0.0.0-stage → 0.1.1

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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -2
  3. package/dist/components/Button/Button.d.ts +16 -0
  4. package/dist/components/Button/index.d.ts +2 -0
  5. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  6. package/dist/components/Checkbox/index.d.ts +2 -0
  7. package/dist/components/Dialog/Dialog.d.ts +29 -0
  8. package/dist/components/Dialog/index.d.ts +2 -0
  9. package/dist/components/Field/Field.d.ts +14 -0
  10. package/dist/components/Field/FieldContext.d.ts +12 -0
  11. package/dist/components/Field/index.d.ts +2 -0
  12. package/dist/components/Heading/Heading.d.ts +12 -0
  13. package/dist/components/Heading/index.d.ts +2 -0
  14. package/dist/components/Input/Input.d.ts +16 -0
  15. package/dist/components/Input/index.d.ts +2 -0
  16. package/dist/components/Popover/Popover.d.ts +48 -0
  17. package/dist/components/Popover/index.d.ts +2 -0
  18. package/dist/components/Select/Select.d.ts +23 -0
  19. package/dist/components/Select/index.d.ts +2 -0
  20. package/dist/components/Skeleton/Skeleton.d.ts +20 -0
  21. package/dist/components/Skeleton/index.d.ts +2 -0
  22. package/dist/components/Stack/Stack.d.ts +16 -0
  23. package/dist/components/Stack/index.d.ts +2 -0
  24. package/dist/components/Switch/Switch.d.ts +13 -0
  25. package/dist/components/Switch/index.d.ts +2 -0
  26. package/dist/components/Table/Table.d.ts +21 -0
  27. package/dist/components/Table/TableParts.d.ts +30 -0
  28. package/dist/components/Table/index.d.ts +4 -0
  29. package/dist/components/Tabs/Tab.d.ts +10 -0
  30. package/dist/components/Tabs/TabList.d.ts +8 -0
  31. package/dist/components/Tabs/TabPanel.d.ts +11 -0
  32. package/dist/components/Tabs/Tabs.d.ts +25 -0
  33. package/dist/components/Tabs/TabsContext.d.ts +16 -0
  34. package/dist/components/Tabs/index.d.ts +9 -0
  35. package/dist/components/Text/Text.d.ts +13 -0
  36. package/dist/components/Text/index.d.ts +2 -0
  37. package/dist/components/Tooltip/Tooltip.d.ts +38 -0
  38. package/dist/components/Tooltip/index.d.ts +2 -0
  39. package/dist/index.d.ts +30 -0
  40. package/dist/index.js +889 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/styles.css +1 -0
  43. package/dist/utils/cx.d.ts +4 -0
  44. package/dist/utils/position.d.ts +29 -0
  45. package/package.json +62 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ohseungik
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,53 @@
1
- # Temporary Holding Version
1
+ # @ohseungik/maru-ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Accessible React components for [Maru UI](https://ohseungik.github.io/Maru-UI/). Native elements first, keyboard and screen reader support tested, light and dark themes.
4
+
5
+ ```bash
6
+ pnpm add @ohseungik/maru-ui @ohseungik/maru-tokens
7
+ ```
8
+
9
+ The components read their colors, spacing and type from the CSS variables in `@ohseungik/maru-tokens`, so install both.
10
+
11
+ ## Usage
12
+
13
+ Import the styles once, tokens first:
14
+
15
+ ```ts
16
+ import '@ohseungik/maru-tokens/css';
17
+ import '@ohseungik/maru-ui/styles.css';
18
+ ```
19
+
20
+ ```tsx
21
+ import { Button, Field, Input, Stack } from '@ohseungik/maru-ui';
22
+
23
+ export function Example() {
24
+ return (
25
+ <Stack gap={3}>
26
+ <Field label="Email" description="Used to sign in.">
27
+ <Input type="email" name="email" />
28
+ </Field>
29
+ <Button>Save</Button>
30
+ </Stack>
31
+ );
32
+ }
33
+ ```
34
+
35
+ ## Components
36
+
37
+ Button, Checkbox, Dialog, Field, Heading, Input, Popover, Select, Skeleton, Stack, Switch, Table (with TableHead, TableBody, TableRow, TableHeader and TableCell), Tabs, Text, Tooltip.
38
+
39
+ ## Requirements
40
+
41
+ - React 18 or newer
42
+ - A current browser. Dialog uses the native `<dialog>` element and Tooltip and Popover use the Popover API (it degrades to a plain element without it).
43
+ - Works with Next.js App Router: the build starts with `"use client"`.
44
+
45
+ ## Links
46
+
47
+ - [Getting started](https://ohseungik.github.io/Maru-UI/?path=/docs/getting-started--docs)
48
+ - [Accessibility principles](https://ohseungik.github.io/Maru-UI/?path=/docs/accessibility--docs)
49
+ - [Source and issues](https://github.com/ohseungik/Maru-UI)
50
+
51
+ ## License
52
+
53
+ MIT
@@ -0,0 +1,16 @@
1
+ import { type ButtonHTMLAttributes } from 'react';
2
+ export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
3
+ export type ButtonSize = 'sm' | 'md' | 'lg';
4
+ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
5
+ /** Visual emphasis. Use one `primary` per view. */
6
+ variant?: ButtonVariant;
7
+ size?: ButtonSize;
8
+ /**
9
+ * Shows a spinner and marks the button busy. The button is also disabled while
10
+ * loading so it cannot be activated twice.
11
+ */
12
+ loading?: boolean;
13
+ /** Defaults to `button` so a Button inside a form never submits by accident. */
14
+ type?: 'button' | 'submit' | 'reset';
15
+ }
16
+ export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,2 @@
1
+ export { Button } from './Button';
2
+ export type { ButtonProps, ButtonSize, ButtonVariant } from './Button';
@@ -0,0 +1,17 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from 'react';
2
+ export type CheckboxSize = 'sm' | 'md' | 'lg';
3
+ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
4
+ /** The visible label. Without it, set `aria-label` or `aria-labelledby`. */
5
+ children?: ReactNode;
6
+ size?: CheckboxSize;
7
+ /**
8
+ * Shows the "some selected" state of a parent checkbox. It is purely visual and
9
+ * announced as "mixed"; the browser clears it when the user clicks, so a controlled
10
+ * parent should recompute it in `onChange`.
11
+ */
12
+ indeterminate?: boolean;
13
+ /** Marks the value as invalid (`aria-invalid`), for example a required checkbox left unchecked. */
14
+ invalid?: boolean;
15
+ }
16
+ /** A native checkbox with a custom box. Click, Space, label click and forms all work natively. */
17
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,2 @@
1
+ export { Checkbox } from './Checkbox';
2
+ export type { CheckboxProps, CheckboxSize } from './Checkbox';
@@ -0,0 +1,29 @@
1
+ import { type DialogHTMLAttributes, type ReactNode, type RefObject } from 'react';
2
+ export type DialogSize = 'sm' | 'md' | 'lg';
3
+ export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open' | 'onClose' | 'onCancel' | 'title'> {
4
+ /** Whether the dialog is shown. The dialog is controlled: update it in `onClose`. */
5
+ open: boolean;
6
+ /** Called when the user asks to close (Esc, close button or backdrop click). */
7
+ onClose: () => void;
8
+ /** Visible title. It also names the dialog (`aria-labelledby`). */
9
+ title: ReactNode;
10
+ /** Optional supporting text. It also describes the dialog (`aria-describedby`). */
11
+ description?: ReactNode;
12
+ /** Footer area, usually the action buttons. */
13
+ actions?: ReactNode;
14
+ size?: DialogSize;
15
+ /** Close when the backdrop is clicked. Turn off for forms that must not be lost. */
16
+ closeOnBackdropClick?: boolean;
17
+ /** Accessible name of the close button. Translate it for your users. */
18
+ closeLabel?: string;
19
+ /** Element to focus on open. Defaults to the first focusable element. */
20
+ initialFocusRef?: RefObject<HTMLElement | null>;
21
+ /** Keep the content in the DOM while closed. Useful to preserve form state. */
22
+ keepMounted?: boolean;
23
+ }
24
+ /**
25
+ * A modal dialog built on the native `<dialog>` element. The browser provides the focus trap,
26
+ * the inert background, Esc handling and focus restoration; this component adds the
27
+ * controlled API, the backdrop click, the scroll lock and the visuals.
28
+ */
29
+ export declare const Dialog: import("react").ForwardRefExoticComponent<DialogProps & import("react").RefAttributes<HTMLDialogElement>>;
@@ -0,0 +1,2 @@
1
+ export { Dialog } from './Dialog';
2
+ export type { DialogProps, DialogSize } from './Dialog';
@@ -0,0 +1,14 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ export interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
3
+ /** Visible label. Always required: a control without a name is not accessible. */
4
+ label: ReactNode;
5
+ /** Help text shown under the label and read after it by screen readers. */
6
+ description?: ReactNode;
7
+ /** Error message. Its presence marks the control invalid. */
8
+ error?: ReactNode;
9
+ required?: boolean;
10
+ disabled?: boolean;
11
+ /** The control, for example an `Input`. */
12
+ children: ReactNode;
13
+ }
14
+ export declare const Field: import("react").ForwardRefExoticComponent<FieldProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,12 @@
1
+ export interface FieldContextValue {
2
+ /** The id the field's label points to. The control inside the field must use it. */
3
+ controlId: string;
4
+ /** Space-separated ids of the description and error, for `aria-describedby`. */
5
+ describedBy: string | undefined;
6
+ invalid: boolean;
7
+ required: boolean;
8
+ disabled: boolean;
9
+ }
10
+ export declare const FieldContext: import("react").Context<FieldContextValue | null>;
11
+ /** Returns the surrounding Field's wiring, or `null` when used outside a Field. */
12
+ export declare function useFieldContext(): FieldContextValue | null;
@@ -0,0 +1,2 @@
1
+ export { Field } from './Field';
2
+ export type { FieldProps } from './Field';
@@ -0,0 +1,12 @@
1
+ import { type HTMLAttributes, type RefAttributes } from 'react';
2
+ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
3
+ export type HeadingSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';
4
+ export type HeadingTone = 'default' | 'muted';
5
+ export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
6
+ /** Semantic level (h1-h6). Decides document structure, not appearance. */
7
+ level: HeadingLevel;
8
+ /** Visual size. Defaults to the size that matches `level`. */
9
+ size?: HeadingSize;
10
+ tone?: HeadingTone;
11
+ }
12
+ export declare const Heading: import("react").ForwardRefExoticComponent<HeadingProps & RefAttributes<HTMLHeadingElement>>;
@@ -0,0 +1,2 @@
1
+ export { Heading } from './Heading';
2
+ export type { HeadingLevel, HeadingProps, HeadingSize, HeadingTone } from './Heading';
@@ -0,0 +1,16 @@
1
+ import { type InputHTMLAttributes } from 'react';
2
+ export type InputSize = 'sm' | 'md' | 'lg';
3
+ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
4
+ size?: InputSize;
5
+ /**
6
+ * Marks the value as invalid (`aria-invalid`). Inside a `Field` this follows the
7
+ * field's `error` automatically, so you rarely need to set it yourself.
8
+ */
9
+ invalid?: boolean;
10
+ }
11
+ /**
12
+ * A native text input. Inside a `Field` it picks up the label, description, error,
13
+ * required and disabled state from the field; on its own it needs an `aria-label`
14
+ * or an external `<label>`.
15
+ */
16
+ export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,2 @@
1
+ export { Input } from './Input';
2
+ export type { InputProps, InputSize } from './Input';
@@ -0,0 +1,48 @@
1
+ import { type MouseEventHandler, type ReactElement, type ReactNode } from 'react';
2
+ import { type Placement } from '../../utils/position';
3
+ export type PopoverPlacement = Placement;
4
+ /** The props Popover adds to its trigger element. */
5
+ interface TriggerProps {
6
+ onClick?: MouseEventHandler<Element>;
7
+ 'aria-expanded'?: boolean;
8
+ 'aria-controls'?: string;
9
+ 'aria-haspopup'?: 'dialog';
10
+ }
11
+ export interface PopoverProps {
12
+ /** What the panel shows. Unlike a tooltip it may be interactive: links, buttons, fields. */
13
+ content: ReactNode;
14
+ /** The one element that opens the popover. It must be a focusable control, such as a button. */
15
+ children: ReactElement<TriggerProps>;
16
+ /** Visible heading of the panel. It is also the panel's accessible name. */
17
+ title?: ReactNode;
18
+ /** The panel's accessible name when there is no visible `title`. One of the two is required. */
19
+ 'aria-label'?: string;
20
+ /** Preferred side. It flips to the opposite side when there is no room. */
21
+ placement?: PopoverPlacement;
22
+ /** Controlled open state. */
23
+ open?: boolean;
24
+ /** Initial open state when uncontrolled. */
25
+ defaultOpen?: boolean;
26
+ /** Called with the next state when the user opens or dismisses the popover. */
27
+ onOpenChange?: (open: boolean) => void;
28
+ /** Render only the trigger. */
29
+ disabled?: boolean;
30
+ className?: string;
31
+ }
32
+ /**
33
+ * A small non-modal panel that opens from a button and can hold interactive content.
34
+ * It is the interactive sibling of Tooltip: a Tooltip is a hint on hover, a Popover is
35
+ * something the user opens on purpose and works inside.
36
+ *
37
+ * The trigger gets `aria-expanded`, `aria-controls` and `aria-haspopup="dialog"`; the panel is
38
+ * a `role="dialog"` that is not modal, so the rest of the page stays reachable.
39
+ *
40
+ * - Opening moves focus to the first control in the panel (or the panel itself).
41
+ * - Esc closes it and returns focus to the trigger.
42
+ * - Clicking outside, or moving focus out of it (for example with Tab), closes it.
43
+ *
44
+ * It is drawn in the browser's top layer with the Popover API, so no ancestor can clip it.
45
+ * The trigger must render one DOM element, because the panel is positioned against it.
46
+ */
47
+ export declare function Popover({ content, children, title, 'aria-label': ariaLabel, placement, open: openProp, defaultOpen, onOpenChange, disabled, className, }: PopoverProps): import("react").JSX.Element;
48
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Popover } from './Popover';
2
+ export type { PopoverPlacement, PopoverProps } from './Popover';
@@ -0,0 +1,23 @@
1
+ import { type ReactNode, type SelectHTMLAttributes } from 'react';
2
+ export type SelectSize = 'sm' | 'md' | 'lg';
3
+ export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
4
+ size?: SelectSize;
5
+ /**
6
+ * Marks the value as invalid (`aria-invalid`). Inside a `Field` this follows the
7
+ * field's `error` automatically, so you rarely need to set it yourself.
8
+ */
9
+ invalid?: boolean;
10
+ /**
11
+ * Text shown while nothing is chosen. It becomes a first, empty option the user cannot
12
+ * pick again. Without it, the browser preselects the first option.
13
+ */
14
+ placeholder?: string;
15
+ /** The `<option>` and `<optgroup>` elements. */
16
+ children: ReactNode;
17
+ }
18
+ /**
19
+ * A native `<select>` with the design system's look. The browser keeps doing what it does
20
+ * best: the option list, keyboard search, mobile pickers and screen reader support. Inside a
21
+ * `Field` it picks up the label, description, error, required and disabled state.
22
+ */
23
+ export declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
@@ -0,0 +1,2 @@
1
+ export { Select } from './Select';
2
+ export type { SelectProps, SelectSize } from './Select';
@@ -0,0 +1,20 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ export type SkeletonVariant = 'text' | 'rect' | 'circle';
3
+ export interface SkeletonProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
4
+ /**
5
+ * The shape: a line of text, a block, or a circle (an avatar). Defaults to `text`.
6
+ */
7
+ variant?: SkeletonVariant;
8
+ /** A number is read as pixels; a string is any CSS length. */
9
+ width?: number | string;
10
+ /** A number is read as pixels; a string is any CSS length. Ignored by `text`, which follows the line height. */
11
+ height?: number | string;
12
+ /** For `text`: how many lines to draw. The last one is shorter, like the end of a paragraph. */
13
+ lines?: number;
14
+ }
15
+ /**
16
+ * A placeholder for content that is still loading. It is decorative: it is hidden from assistive
17
+ * technology, so say that something is loading on the region instead (`aria-busy` and a status
18
+ * message), not on the placeholder.
19
+ */
20
+ export declare const Skeleton: import("react").ForwardRefExoticComponent<SkeletonProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ export { Skeleton } from './Skeleton';
2
+ export type { SkeletonProps, SkeletonVariant } from './Skeleton';
@@ -0,0 +1,16 @@
1
+ import { type HTMLAttributes, type RefAttributes } from 'react';
2
+ /** Keys of `scale.space` in @ohseungik/maru-tokens. A test keeps both in sync. */
3
+ export declare const STACK_GAPS: readonly [0, 1, 2, 3, 4, 5, 6, 8, 10, 12];
4
+ export type StackGap = (typeof STACK_GAPS)[number];
5
+ export type StackElement = 'div' | 'section' | 'nav' | 'header' | 'footer' | 'main' | 'article' | 'aside';
6
+ export interface StackProps extends HTMLAttributes<HTMLElement> {
7
+ as?: StackElement;
8
+ direction?: 'vertical' | 'horizontal';
9
+ /** Space between children, as a key of the spacing scale. */
10
+ gap?: StackGap;
11
+ align?: 'start' | 'center' | 'end' | 'stretch';
12
+ justify?: 'start' | 'center' | 'end' | 'between';
13
+ /** Allow children to wrap onto multiple lines. */
14
+ wrap?: boolean;
15
+ }
16
+ export declare const Stack: import("react").ForwardRefExoticComponent<StackProps & RefAttributes<HTMLElement>>;
@@ -0,0 +1,2 @@
1
+ export { Stack } from './Stack';
2
+ export type { StackElement, StackGap, StackProps } from './Stack';
@@ -0,0 +1,13 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from 'react';
2
+ export type SwitchSize = 'sm' | 'md' | 'lg';
3
+ export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
4
+ /** The visible label. Without it, set `aria-label` or `aria-labelledby`. */
5
+ children?: ReactNode;
6
+ size?: SwitchSize;
7
+ }
8
+ /**
9
+ * An on/off setting that takes effect immediately, like a light switch. It is a native
10
+ * checkbox with `role="switch"`, so Space toggles it and it works in forms. For choices
11
+ * that are only applied after a submit, use `Checkbox` instead.
12
+ */
13
+ export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,2 @@
1
+ export { Switch } from './Switch';
2
+ export type { SwitchProps, SwitchSize } from './Switch';
@@ -0,0 +1,21 @@
1
+ import { type ReactNode, type TableHTMLAttributes } from 'react';
2
+ export type TableSize = 'sm' | 'md';
3
+ export interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
4
+ /**
5
+ * What the table is about. It is a native `<caption>`, so it names the table for assistive
6
+ * technology. Give the table either a caption or an `aria-label`.
7
+ */
8
+ caption?: ReactNode;
9
+ /** Keep the caption for assistive technology only. */
10
+ hideCaption?: boolean;
11
+ size?: TableSize;
12
+ /** Shade every other row. */
13
+ striped?: boolean;
14
+ }
15
+ /**
16
+ * A data table on the native `<table>` elements, inside a wrapper that scrolls sideways when the
17
+ * table is wider than its container. A scroll area is only reachable by keyboard when it can take
18
+ * focus, so the wrapper becomes a focusable, named region exactly while it overflows and is a
19
+ * plain element otherwise (no extra Tab stop).
20
+ */
21
+ export declare const Table: import("react").ForwardRefExoticComponent<TableProps & import("react").RefAttributes<HTMLTableElement>>;
@@ -0,0 +1,30 @@
1
+ import { type HTMLAttributes, type TdHTMLAttributes, type ThHTMLAttributes } from 'react';
2
+ export type TableSort = 'ascending' | 'descending' | 'none';
3
+ export type TableHeadProps = HTMLAttributes<HTMLTableSectionElement>;
4
+ export type TableBodyProps = HTMLAttributes<HTMLTableSectionElement>;
5
+ export type TableRowProps = HTMLAttributes<HTMLTableRowElement>;
6
+ export declare const TableHead: import("react").ForwardRefExoticComponent<TableHeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
7
+ export declare const TableBody: import("react").ForwardRefExoticComponent<TableBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
8
+ export declare const TableRow: import("react").ForwardRefExoticComponent<TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
9
+ export interface TableHeaderProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'scope'> {
10
+ /** `col` for a column heading (the default), `row` for the first cell of a row. */
11
+ scope?: 'col' | 'row';
12
+ /** Right-align numbers and use equal-width digits. */
13
+ numeric?: boolean;
14
+ /**
15
+ * The current sort of this column. Set it on the sorted column and on the other sortable ones
16
+ * (`none`); it is exposed as `aria-sort`. Leave it out for columns that cannot be sorted.
17
+ */
18
+ sort?: TableSort;
19
+ /**
20
+ * Makes the heading a button that asks for a new sort. The table does not sort anything itself:
21
+ * change the rows and the `sort` prop in this handler.
22
+ */
23
+ onSort?: () => void;
24
+ }
25
+ export declare const TableHeader: import("react").ForwardRefExoticComponent<TableHeaderProps & import("react").RefAttributes<HTMLTableCellElement>>;
26
+ export interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
27
+ /** Right-align numbers and use equal-width digits. */
28
+ numeric?: boolean;
29
+ }
30
+ export declare const TableCell: import("react").ForwardRefExoticComponent<TableCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
@@ -0,0 +1,4 @@
1
+ export { Table } from './Table';
2
+ export type { TableProps, TableSize } from './Table';
3
+ export { TableBody, TableCell, TableHead, TableHeader, TableRow } from './TableParts';
4
+ export type { TableBodyProps, TableCellProps, TableHeadProps, TableHeaderProps, TableRowProps, TableSort, } from './TableParts';
@@ -0,0 +1,10 @@
1
+ import { type ButtonHTMLAttributes } from 'react';
2
+ export interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'role' | 'value'> {
3
+ /** Matches the `value` of the `TabPanel` this tab shows. */
4
+ value: string;
5
+ }
6
+ /**
7
+ * One tab. Only the selected tab is in the Tab key order (roving tabindex); the arrow
8
+ * keys, Home and End move focus to another tab.
9
+ */
10
+ export declare const Tab: import("react").ForwardRefExoticComponent<TabProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,8 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ export type TabListProps = Omit<HTMLAttributes<HTMLDivElement>, 'role'>;
3
+ /**
4
+ * The row (or column) of tabs. The arrow keys, Home and End are handled by each `Tab`,
5
+ * which is the element that actually has focus. Give the list an `aria-label` so the
6
+ * group has a name.
7
+ */
8
+ export declare const TabList: import("react").ForwardRefExoticComponent<TabListProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,11 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ export interface TabPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
3
+ /** Matches the `value` of the `Tab` that shows this panel. */
4
+ value: string;
5
+ /**
6
+ * Keep the content in the page (hidden) while the tab is not selected, so its state
7
+ * survives switching. By default only the selected panel renders its content.
8
+ */
9
+ keepMounted?: boolean;
10
+ }
11
+ export declare const TabPanel: import("react").ForwardRefExoticComponent<TabPanelProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,25 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ import { type TabsActivation, type TabsOrientation } from './TabsContext';
3
+ interface TabsBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'> {
4
+ /** Called with the value of the tab the user selected. */
5
+ onValueChange?: (value: string) => void;
6
+ /** `vertical` lists the tabs in a column and uses the Up and Down arrow keys. */
7
+ orientation?: TabsOrientation;
8
+ /**
9
+ * `automatic` selects a tab as soon as it receives focus with the arrow keys.
10
+ * `manual` only moves focus; Enter or Space selects. Prefer `manual` when showing a
11
+ * panel is slow, so keyboard users are not forced to wait on every arrow press.
12
+ */
13
+ activation?: TabsActivation;
14
+ children: ReactNode;
15
+ }
16
+ /** Give either `value` (controlled) or `defaultValue` (uncontrolled), never both. */
17
+ export type TabsProps = TabsBaseProps & ({
18
+ value: string;
19
+ defaultValue?: undefined;
20
+ } | {
21
+ value?: undefined;
22
+ defaultValue: string;
23
+ });
24
+ export declare const Tabs: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<HTMLDivElement>>;
25
+ export {};
@@ -0,0 +1,16 @@
1
+ export type TabsOrientation = 'horizontal' | 'vertical';
2
+ export type TabsActivation = 'automatic' | 'manual';
3
+ export interface TabsContextValue {
4
+ baseId: string;
5
+ /** The value of the selected tab. */
6
+ value: string;
7
+ select: (value: string) => void;
8
+ orientation: TabsOrientation;
9
+ activation: TabsActivation;
10
+ }
11
+ export declare const TabsContext: import("react").Context<TabsContextValue | null>;
12
+ /** Returns the surrounding Tabs, or throws a clear error when used outside of one. */
13
+ export declare function useTabsContext(consumer: string): TabsContextValue;
14
+ /** Ids tie a tab to its panel (`aria-controls` / `aria-labelledby`). */
15
+ export declare function getTabId(baseId: string, value: string): string;
16
+ export declare function getPanelId(baseId: string, value: string): string;
@@ -0,0 +1,9 @@
1
+ export { Tab } from './Tab';
2
+ export type { TabProps } from './Tab';
3
+ export { TabList } from './TabList';
4
+ export type { TabListProps } from './TabList';
5
+ export { TabPanel } from './TabPanel';
6
+ export type { TabPanelProps } from './TabPanel';
7
+ export { Tabs } from './Tabs';
8
+ export type { TabsProps } from './Tabs';
9
+ export type { TabsActivation, TabsOrientation } from './TabsContext';
@@ -0,0 +1,13 @@
1
+ import { type HTMLAttributes, type RefAttributes } from 'react';
2
+ export type TextElement = 'p' | 'span' | 'div' | 'small' | 'strong' | 'em';
3
+ export type TextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
+ export type TextTone = 'default' | 'muted' | 'danger';
5
+ export type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';
6
+ export interface TextProps extends HTMLAttributes<HTMLElement> {
7
+ /** The rendered element. Pick for meaning (`strong`, `em`), not for looks. */
8
+ as?: TextElement;
9
+ size?: TextSize;
10
+ tone?: TextTone;
11
+ weight?: TextWeight;
12
+ }
13
+ export declare const Text: import("react").ForwardRefExoticComponent<TextProps & RefAttributes<HTMLElement>>;
@@ -0,0 +1,2 @@
1
+ export { Text } from './Text';
2
+ export type { TextElement, TextProps, TextSize, TextTone, TextWeight } from './Text';
@@ -0,0 +1,38 @@
1
+ import { type FocusEventHandler, type KeyboardEventHandler, type MouseEventHandler, type ReactElement, type ReactNode } from 'react';
2
+ import { type Placement } from '../../utils/position';
3
+ /** The props Tooltip adds to its trigger element. */
4
+ interface TriggerProps {
5
+ onMouseEnter?: MouseEventHandler<Element>;
6
+ onMouseLeave?: MouseEventHandler<Element>;
7
+ onFocus?: FocusEventHandler<Element>;
8
+ onBlur?: FocusEventHandler<Element>;
9
+ onKeyDown?: KeyboardEventHandler<Element>;
10
+ 'aria-describedby'?: string;
11
+ }
12
+ export type TooltipPlacement = Placement;
13
+ export interface TooltipProps {
14
+ /** Short, plain text. A tooltip cannot contain anything interactive. */
15
+ content: ReactNode;
16
+ /** The one element that triggers the tooltip. It must be able to take focus. */
17
+ children: ReactElement<TriggerProps>;
18
+ /** Preferred side. It flips to the opposite side when there is no room. */
19
+ placement?: TooltipPlacement;
20
+ /** Delay before it opens on hover, in milliseconds. Focus opens it immediately. */
21
+ openDelay?: number;
22
+ /** Grace period to move the pointer onto the tooltip before it closes, in milliseconds. */
23
+ closeDelay?: number;
24
+ /** Render only the trigger. */
25
+ disabled?: boolean;
26
+ className?: string;
27
+ }
28
+ /**
29
+ * A short text hint for a control, shown on hover and keyboard focus. It describes the
30
+ * trigger (`aria-describedby`), it does not name it: icon-only buttons still need an
31
+ * accessible name of their own.
32
+ *
33
+ * It follows WCAG 1.4.13: Esc dismisses it, the pointer can move onto it without it
34
+ * closing, and it stays until the user leaves or dismisses it. It is drawn in the browser's
35
+ * top layer with the Popover API, so no ancestor can clip it.
36
+ */
37
+ export declare function Tooltip({ content, children, placement, openDelay, closeDelay, disabled, className, }: TooltipProps): import("react").JSX.Element;
38
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Tooltip } from './Tooltip';
2
+ export type { TooltipPlacement, TooltipProps } from './Tooltip';
@@ -0,0 +1,30 @@
1
+ export { Button } from './components/Button';
2
+ export type { ButtonProps, ButtonSize, ButtonVariant } from './components/Button';
3
+ export { Checkbox } from './components/Checkbox';
4
+ export type { CheckboxProps, CheckboxSize } from './components/Checkbox';
5
+ export { Dialog } from './components/Dialog';
6
+ export type { DialogProps, DialogSize } from './components/Dialog';
7
+ export { Field } from './components/Field';
8
+ export type { FieldProps } from './components/Field';
9
+ export { Heading } from './components/Heading';
10
+ export type { HeadingLevel, HeadingProps, HeadingSize, HeadingTone } from './components/Heading';
11
+ export { Input } from './components/Input';
12
+ export type { InputProps, InputSize } from './components/Input';
13
+ export { Popover } from './components/Popover';
14
+ export type { PopoverPlacement, PopoverProps } from './components/Popover';
15
+ export { Select } from './components/Select';
16
+ export type { SelectProps, SelectSize } from './components/Select';
17
+ export { Skeleton } from './components/Skeleton';
18
+ export type { SkeletonProps, SkeletonVariant } from './components/Skeleton';
19
+ export { Stack } from './components/Stack';
20
+ export type { StackElement, StackGap, StackProps } from './components/Stack';
21
+ export { Switch } from './components/Switch';
22
+ export type { SwitchProps, SwitchSize } from './components/Switch';
23
+ export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from './components/Table';
24
+ export type { TableBodyProps, TableCellProps, TableHeadProps, TableHeaderProps, TableProps, TableRowProps, TableSize, TableSort, } from './components/Table';
25
+ export { Tab, TabList, TabPanel, Tabs } from './components/Tabs';
26
+ export type { TabListProps, TabPanelProps, TabProps, TabsActivation, TabsOrientation, TabsProps, } from './components/Tabs';
27
+ export { Text } from './components/Text';
28
+ export type { TextElement, TextProps, TextSize, TextTone, TextWeight } from './components/Text';
29
+ export { Tooltip } from './components/Tooltip';
30
+ export type { TooltipPlacement, TooltipProps } from './components/Tooltip';