@voxel51/voodo 2.8.0 → 2.10.0-app-revamp.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.
- package/dist/components/Avatar/Avatar.d.ts +32 -2
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +15 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/ChipSelect/ChipSelect.d.ts +51 -0
- package/dist/components/ChipSelect/ChipSelect.d.ts.map +1 -0
- package/dist/components/ChipSelect/index.d.ts +2 -0
- package/dist/components/ChipSelect/index.d.ts.map +1 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +29 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts.map +1 -0
- package/dist/components/CodeBlock/index.d.ts +2 -0
- package/dist/components/CodeBlock/index.d.ts.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +23 -4
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +115 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.d.ts +24 -8
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Dropdown/DropdownTrigger.d.ts +28 -9
- package/dist/components/Dropdown/DropdownTrigger.d.ts.map +1 -1
- package/dist/components/EmptyArt/EmptyArt.d.ts +96 -0
- package/dist/components/EmptyArt/EmptyArt.d.ts.map +1 -0
- package/dist/components/EmptyArt/index.d.ts +2 -0
- package/dist/components/EmptyArt/index.d.ts.map +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts +14 -1
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/FilterBar/FilterBar.d.ts +33 -0
- package/dist/components/FilterBar/FilterBar.d.ts.map +1 -0
- package/dist/components/FilterBar/index.d.ts +2 -0
- package/dist/components/FilterBar/index.d.ts.map +1 -0
- package/dist/components/FilterChip/FilterChip.d.ts +28 -0
- package/dist/components/FilterChip/FilterChip.d.ts.map +1 -0
- package/dist/components/FilterChip/index.d.ts +2 -0
- package/dist/components/FilterChip/index.d.ts.map +1 -0
- package/dist/components/IconAction/IconAction.d.ts +9 -2
- package/dist/components/IconAction/IconAction.d.ts.map +1 -1
- package/dist/components/Icons/Icon.d.ts.map +1 -1
- package/dist/components/Icons/icons.d.ts +24 -1
- package/dist/components/Icons/icons.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +5 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/SearchInput.d.ts +53 -0
- package/dist/components/Input/SearchInput.d.ts.map +1 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/ListRow/ListRow.d.ts +36 -0
- package/dist/components/ListRow/ListRow.d.ts.map +1 -0
- package/dist/components/ListRow/index.d.ts +2 -0
- package/dist/components/ListRow/index.d.ts.map +1 -0
- package/dist/components/LiveToggle/LiveToggle.d.ts +39 -0
- package/dist/components/LiveToggle/LiveToggle.d.ts.map +1 -0
- package/dist/components/LiveToggle/index.d.ts +2 -0
- package/dist/components/LiveToggle/index.d.ts.map +1 -0
- package/dist/components/Modal/Modal.d.ts +3 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/OverflowRow/OverflowRow.d.ts +49 -0
- package/dist/components/OverflowRow/OverflowRow.d.ts.map +1 -0
- package/dist/components/OverflowRow/index.d.ts +2 -0
- package/dist/components/OverflowRow/index.d.ts.map +1 -0
- package/dist/components/Pill/Pill.d.ts +6 -1
- package/dist/components/Pill/Pill.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +7 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/RichButton/RichButton.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Sheet/Sheet.d.ts +6 -0
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Stack/Stack.d.ts +15 -2
- package/dist/components/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Table/Table.d.ts +7 -3
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/TagInput/TagInput.d.ts +54 -0
- package/dist/components/TagInput/TagInput.d.ts.map +1 -0
- package/dist/components/TagInput/index.d.ts +2 -0
- package/dist/components/TagInput/index.d.ts.map +1 -0
- package/dist/components/Text/Text.d.ts +9 -0
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/TextAction/TextAction.d.ts +18 -1
- package/dist/components/TextAction/TextAction.d.ts.map +1 -1
- package/dist/components/Tooltip/ActionTooltip.d.ts +17 -0
- package/dist/components/Tooltip/ActionTooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +3 -2
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/TooltipLabel.d.ts +28 -0
- package/dist/components/Tooltip/TooltipLabel.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6784 -4708
- package/dist/index.js.map +1 -1
- package/dist/styles/collapse.d.ts +13 -0
- package/dist/styles/collapse.d.ts.map +1 -0
- package/dist/types/icons.d.ts +2 -0
- package/dist/types/icons.d.ts.map +1 -1
- package/dist/util/breakpoints.d.ts +37 -0
- package/dist/util/breakpoints.d.ts.map +1 -0
- package/dist/util/compact.d.ts +31 -0
- package/dist/util/compact.d.ts.map +1 -0
- package/dist/util/useClippedItems.d.ts +31 -0
- package/dist/util/useClippedItems.d.ts.map +1 -0
- package/dist/util/useCompactRow.d.ts +42 -0
- package/dist/util/useCompactRow.d.ts.map +1 -0
- package/dist/util/useElementSize.d.ts.map +1 -1
- package/dist/util/useMediaQuery.d.ts +17 -0
- package/dist/util/useMediaQuery.d.ts.map +1 -0
- package/dist/util/useOverflowFit.d.ts +57 -0
- package/dist/util/useOverflowFit.d.ts.map +1 -0
- package/dist/util/useScrollEdges.d.ts +12 -0
- package/dist/util/useScrollEdges.d.ts.map +1 -0
- package/dist/voodo.css +1 -1
- package/package.json +2 -1
|
@@ -1,23 +1,53 @@
|
|
|
1
|
-
import { FC, HTMLAttributes } from 'react';
|
|
1
|
+
import { FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { Size } from '../../types';
|
|
3
3
|
export type AvatarSize = `${Size.Sm | Size.Md | Size.Lg}`;
|
|
4
|
+
/** `"auto"`: a fill picked from the name; `"neutral"`: the muted fill. */
|
|
5
|
+
export type AvatarTone = "auto" | "neutral";
|
|
4
6
|
export interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
|
|
5
7
|
name: string;
|
|
6
8
|
src?: string;
|
|
7
9
|
size?: AvatarSize;
|
|
10
|
+
/** Shows the name beside the avatar, truncating, as in a "Run by" cell. */
|
|
11
|
+
showName?: boolean;
|
|
12
|
+
/** With `showName`, a second line under the name, such as an email. */
|
|
13
|
+
subtitle?: ReactNode;
|
|
14
|
+
tone?: AvatarTone;
|
|
15
|
+
/** Shown in place of the initials (an invite, a group), on the muted fill. */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
/** What picks the colour, such as an email; defaults to the initials. */
|
|
18
|
+
colorKey?: string;
|
|
19
|
+
/** Rounded square instead of a circle, for a group rather than a person. */
|
|
20
|
+
square?: boolean;
|
|
8
21
|
}
|
|
9
22
|
/**
|
|
10
23
|
* A round picture of a person, falling back to their initials when there is
|
|
11
|
-
* no image.
|
|
24
|
+
* no image or it fails to load.
|
|
12
25
|
*
|
|
13
26
|
* @example
|
|
14
27
|
* ```tsx
|
|
15
28
|
* <Avatar name="Ada Lovelace" src={user.photoUrl} size="sm" />
|
|
29
|
+
* <Avatar name={run.runBy.name} size="sm" showName />
|
|
30
|
+
* <Avatar name="Ada Lovelace" size="lg" showName subtitle="ada@example.com" />
|
|
31
|
+
* <Avatar name="Ada Lovelace" tone="neutral" />
|
|
32
|
+
* <Avatar name="ada@example.com" icon={<MailOutlineIcon size="md" />} />
|
|
33
|
+
* <Avatar name="Labelers" icon={<UsersRoundIcon size={14} />} />
|
|
34
|
+
* <Avatar name="Ada Lovelace" colorKey={user.email} />
|
|
16
35
|
* ```
|
|
17
36
|
*
|
|
18
37
|
* @param name The person's name: it makes the initials and the accessible label.
|
|
19
38
|
* @param src Image URL. Initials show when it is missing.
|
|
20
39
|
* @param size `"sm"` (20px), `"md"` (24px) or `"lg"` (32px). Defaults to `"md"`.
|
|
40
|
+
* @param showName Shows the name beside the avatar (body text, truncating).
|
|
41
|
+
* @param subtitle With `showName`, a second line under a larger name, such
|
|
42
|
+
* as an email or a group's description; both lines truncate.
|
|
43
|
+
* @param tone `"auto"` (default): initials on one of twenty tuned colours
|
|
44
|
+
* picked from `colorKey`, the same for a key everywhere; `"neutral"`: on the
|
|
45
|
+
* muted fill.
|
|
46
|
+
* @param icon Shown in place of the initials when there is no image, on the
|
|
47
|
+
* muted fill: a person not known yet (an invite) or not a person (a group).
|
|
48
|
+
* @param colorKey What picks the colour: a stable id such as the email.
|
|
49
|
+
* Defaults to the initials.
|
|
50
|
+
* @param square Rounded square instead of a circle, for a group.
|
|
21
51
|
* @param className `class` overrides to apply to the component.
|
|
22
52
|
* @param props Additional HTML properties to apply to the component.
|
|
23
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EAAE,EACP,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAIf,OAAO,EAIL,IAAI,EAIL,MAAM,SAAS,CAAC;AAGjB,MAAM,MAAM,UAAU,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE1D,0EAA0E;AAC1E,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5C,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,eAAe,CAAC;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAkHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAoFlC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AnchorHTMLAttributes, ButtonHTMLAttributes, FC } from 'react';
|
|
1
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, FC, ReactNode } from 'react';
|
|
2
2
|
import { IconInput } from '../Icons';
|
|
3
|
+
import { Collapse } from '../../styles/collapse';
|
|
3
4
|
import { Size, Variant } from '../../types';
|
|
4
5
|
type ButtonSize = `${Exclude<Size, Size.Lg | Size.Xl>}`;
|
|
5
6
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "target" | "rel"> {
|
|
@@ -14,6 +15,17 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Pi
|
|
|
14
15
|
leadingIcon?: IconInput;
|
|
15
16
|
trailingIcon?: IconInput;
|
|
16
17
|
borderless?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Hides the text label below a breakpoint, leaving the icons: `true` or
|
|
20
|
+
* `"lg"` below 1024px, `"sm"` below 640px, `"always"` at every width,
|
|
21
|
+
* `"auto"` while the enclosing row is compact. Give it an `aria-label`.
|
|
22
|
+
*/
|
|
23
|
+
collapse?: Collapse;
|
|
24
|
+
/**
|
|
25
|
+
* More about the action, such as why it is disabled: its tooltip, under its
|
|
26
|
+
* name while the label is collapsed.
|
|
27
|
+
*/
|
|
28
|
+
hint?: ReactNode;
|
|
17
29
|
}
|
|
18
30
|
/**
|
|
19
31
|
* A basic button component.
|
|
@@ -33,6 +45,8 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Pi
|
|
|
33
45
|
* rounding the corners.
|
|
34
46
|
* @param leadingIcon Optional icon component which prefixes the button's content.
|
|
35
47
|
* @param trailingIcon Optional icon component which postfixes the button's content.
|
|
48
|
+
* @param collapse Hides the text label below a breakpoint, leaving the icons (including icons passed as children): `true` or `"lg"` below 1024px, `"sm"` below 640px, `"always"` at every width, `"auto"` while the enclosing row is compact (then its tooltip names it). Pass an `aria-label`.
|
|
49
|
+
* @param hint More about the action, such as why it is disabled: its tooltip, under its name while the label is collapsed.
|
|
36
50
|
* @param className `class` overrides to apply to the component.
|
|
37
51
|
* @param children Button content.
|
|
38
52
|
* @param props Additional HTML properties to apply to the component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EAEpB,EAAE,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EAEpB,EAAE,EAGF,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,oBAAoB,CAAC;AAEjE,OAAuB,EACrB,KAAK,QAAQ,EAGd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAOL,IAAI,EAIJ,OAAO,EACR,MAAM,SAAS,CAAC;AAMjB,KAAK,UAAU,GAAG,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AAExD,MAAM,WAAW,WACf,SACE,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC1E;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AA6ID;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CA+HlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAMrD,OAAO,EAML,MAAM,EACN,IAAI,EAIL,MAAM,SAAS,CAAC;AAGjB,KAAK,qBAAqB,GAAG,IAAI,CAC/B,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAC3D,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAsBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAMrD,OAAO,EAML,MAAM,EACN,IAAI,EAIL,MAAM,SAAS,CAAC;AAGjB,KAAK,qBAAqB,GAAG,IAAI,CAC/B,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAC3D,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAsBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAwFtC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { ButtonProps } from '../Button';
|
|
3
|
+
export interface ChipSelectOption<T extends string = string> {
|
|
4
|
+
id: T;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ChipSelectProps<T extends string = string> {
|
|
8
|
+
/** The choices, one checked at a time. */
|
|
9
|
+
options: ChipSelectOption<T>[];
|
|
10
|
+
/** The `id` of the checked option. */
|
|
11
|
+
value: T;
|
|
12
|
+
/** Called with the `id` of the option picked. */
|
|
13
|
+
onChange: (value: T) => void;
|
|
14
|
+
/** Names the control; also the accessible name of the trigger. */
|
|
15
|
+
"aria-label": string;
|
|
16
|
+
/** Leading icon of the trigger. */
|
|
17
|
+
icon?: ButtonProps["leadingIcon"];
|
|
18
|
+
/** What the value is (`Sort by`), shown before it; on a phone only in the tooltip. */
|
|
19
|
+
prefix?: string;
|
|
20
|
+
/** The trigger text, when it should differ from the checked option's label (a count, say). */
|
|
21
|
+
label?: string;
|
|
22
|
+
"data-cy"?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A borderless single-choice menu for filter and sort rows: an icon, an optional
|
|
26
|
+
* `prefix: value` and a caret, opening a checklist of options.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <ChipSelect
|
|
31
|
+
* aria-label="Sort by"
|
|
32
|
+
* prefix="Sort by"
|
|
33
|
+
* icon={ArrowDownWideNarrowIcon}
|
|
34
|
+
* value={sort}
|
|
35
|
+
* onChange={setSort}
|
|
36
|
+
* options={[
|
|
37
|
+
* { id: "newest", label: "Newest" },
|
|
38
|
+
* { id: "oldest", label: "Oldest" },
|
|
39
|
+
* ]}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @param options The choices, one checked at a time. See {@link ChipSelectOption}.
|
|
44
|
+
* @param value The `id` of the checked option.
|
|
45
|
+
* @param onChange Called with the `id` of the option picked.
|
|
46
|
+
* @param icon Leading icon of the trigger.
|
|
47
|
+
* @param prefix What the value is, shown before it. Below 640px only the value shows and a tooltip names both.
|
|
48
|
+
* @param label The trigger text, when it should differ from the checked option's label. Defaults to that label.
|
|
49
|
+
*/
|
|
50
|
+
export declare function ChipSelect<T extends string = string>({ options, value, onChange, icon, prefix, label, "aria-label": ariaLabel, "data-cy": dataCy, }: ChipSelectProps<T>): JSX.Element;
|
|
51
|
+
//# sourceMappingURL=ChipSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChipSelect.d.ts","sourceRoot":"","sources":["../../../src/components/ChipSelect/ChipSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACzD,EAAE,EAAE,CAAC,CAAC;IACN,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACxD,0CAA0C;IAC1C,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,sCAAsC;IACtC,KAAK,EAAE,CAAC,CAAC;IACT,iDAAiD;IACjD,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,kEAAkE;IAClE,YAAY,EAAE,MAAM,CAAC;IACrB,mCAAmC;IACnC,IAAI,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IAClC,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EACpD,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,SAAS,EAAE,MAAM,GAClB,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CA6BlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ChipSelect/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, "onCopy" | "children"> {
|
|
3
|
+
code: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
language?: string;
|
|
6
|
+
onCopy?: (code: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A read-only code snippet on a card, with a copy action in its corner.
|
|
10
|
+
*
|
|
11
|
+
* @param code The code to show and copy.
|
|
12
|
+
* @param language A Prism language for syntax colours (`"python"`, `"json"`,
|
|
13
|
+
* `"yaml"`, `"ts"`, ...). Defaults to `"python"`; unknown languages render plain.
|
|
14
|
+
* @param children Already highlighted markup to show instead of `language`
|
|
15
|
+
* colours; `code` is still what is copied.
|
|
16
|
+
* @param onCopy Called with the code after it is copied.
|
|
17
|
+
* @param props Additional HTML properties to apply to the card.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <CodeBlock
|
|
22
|
+
* language="python"
|
|
23
|
+
* code={'import fiftyone as fo\n\ndataset = fo.load_dataset("quickstart")'}
|
|
24
|
+
* onCopy={() => toast("Copied")}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const CodeBlock: FC<CodeBlockProps>;
|
|
29
|
+
//# sourceMappingURL=CodeBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../src/components/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,EAAE,EACP,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAwDf,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,cAAc,CAAC,cAAc,CAAC,EAC9B,QAAQ,GAAG,UAAU,CACtB;IACC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA4DxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CodeBlock/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, HTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { FC, HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
2
2
|
import { IconInput } from '../Icons';
|
|
3
3
|
import { Size, ZIndex } from '../../types';
|
|
4
4
|
/** `data-*` attributes a host attaches to a part — a test id, a tracking hook. */
|
|
@@ -11,6 +11,11 @@ export interface ComboboxOption {
|
|
|
11
11
|
label: string;
|
|
12
12
|
/** Optional second line — a definition, a slug, an owner. */
|
|
13
13
|
description?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* The section the row belongs to. A titled section starts wherever the
|
|
16
|
+
* group changes, so pass the rows ordered by group.
|
|
17
|
+
*/
|
|
18
|
+
group?: string;
|
|
14
19
|
/** `data-*` attributes for the row — a test id, a tracking hook. */
|
|
15
20
|
[dataAttribute: `data-${string}`]: string | undefined;
|
|
16
21
|
}
|
|
@@ -71,6 +76,18 @@ export interface ComboboxProps extends Omit<HTMLAttributes<HTMLDivElement>, "onC
|
|
|
71
76
|
* @default false
|
|
72
77
|
*/
|
|
73
78
|
portal?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* With `portal`, the element the list drops under and takes its width
|
|
81
|
+
* from, instead of the field — for a field inside a larger frame, such as
|
|
82
|
+
* a search bar, whose list spans the frame.
|
|
83
|
+
*/
|
|
84
|
+
anchor?: RefObject<HTMLElement | null>;
|
|
85
|
+
/**
|
|
86
|
+
* The list always shows, in the flow under the field, with no frame of its
|
|
87
|
+
* own — for a picker inside a popover, like a command palette. Escape and
|
|
88
|
+
* picking still report `onOpenChange(false)`, so the host can close.
|
|
89
|
+
*/
|
|
90
|
+
inline?: boolean;
|
|
74
91
|
/** Explicit z-index for the list. A portaled list defaults to above-modal. */
|
|
75
92
|
zIndex?: ZIndex;
|
|
76
93
|
/**
|
|
@@ -87,8 +104,8 @@ export interface ComboboxProps extends Omit<HTMLAttributes<HTMLDivElement>, "onC
|
|
|
87
104
|
/** Focus the field on mount — for a combobox that opens on demand. */
|
|
88
105
|
focusOnMount?: boolean;
|
|
89
106
|
/**
|
|
90
|
-
* Highlight the first row whenever there is text
|
|
91
|
-
* match without an arrow key first. Off by default: with it off, Enter on
|
|
107
|
+
* Highlight the first row whenever there is text (an inline list: always),
|
|
108
|
+
* so Enter takes the top match without an arrow key first. Off by default: with it off, Enter on
|
|
92
109
|
* unmatched text commits free text (or nothing), never a row the user
|
|
93
110
|
* has not pointed at.
|
|
94
111
|
* @default false
|
|
@@ -145,12 +162,14 @@ export interface ComboboxProps extends Omit<HTMLAttributes<HTMLDivElement>, "onC
|
|
|
145
162
|
* @param emptyMessage Shown when there are no options; a function receives `close`.
|
|
146
163
|
* @param className `class` overrides for the wrapper.
|
|
147
164
|
* @param portal Render the list in a portal, anchored to the field.
|
|
165
|
+
* @param anchor With `portal`, the element the list drops under instead of the field.
|
|
166
|
+
* @param inline The list always shows, in the flow, unframed.
|
|
148
167
|
* @param zIndex Explicit z-index for the list.
|
|
149
168
|
* @param commitOnBlur Commit free text on blur (default `true`).
|
|
150
169
|
* @param borderless No frame on the field.
|
|
151
170
|
* @param icon A leading icon in the field.
|
|
152
171
|
* @param focusOnMount Focus the field on mount.
|
|
153
|
-
* @param autoHighlight Highlight the first row whenever there is text.
|
|
172
|
+
* @param autoHighlight Highlight the first row whenever there is text (inline: always).
|
|
154
173
|
* @param inputProps Attributes for the field itself.
|
|
155
174
|
* @param header Shown above the list's contents whenever the list is open.
|
|
156
175
|
* @param listProps Attributes for the list.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/Combobox.tsx"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/Combobox.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { FC, HTMLAttributes, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import { Breakpoint } from '../../util/breakpoints';
|
|
3
|
+
/** A column of a {@link DataTable}. */
|
|
4
|
+
export type DataTableColumn = {
|
|
5
|
+
/** Key of this column's cell in each row's `cells`. */
|
|
6
|
+
key: string;
|
|
7
|
+
/** Header text; in card mode it labels `meta` values. */
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Place of the column in card mode: `"primary"` is the card title,
|
|
11
|
+
* `"status"` sits beside it, `"actions"` at its end and `"meta"` (default)
|
|
12
|
+
* on the line below as `Label: value`.
|
|
13
|
+
*/
|
|
14
|
+
role?: "primary" | "status" | "meta" | "actions";
|
|
15
|
+
/** Hides the column (header and cells) on windows narrower than this. Wide mode only. */
|
|
16
|
+
hideBelow?: Breakpoint;
|
|
17
|
+
align?: "start" | "end";
|
|
18
|
+
/**
|
|
19
|
+
* Column width in wide mode: a length such as `"16rem"`; `"fit"` hugs the
|
|
20
|
+
* content without wrapping; `"fill"` takes the free space and truncates
|
|
21
|
+
* first. Give the `primary` column `"fill"` and the others `"fit"` for a
|
|
22
|
+
* row of one flexible card then compact cells.
|
|
23
|
+
*/
|
|
24
|
+
width?: string;
|
|
25
|
+
};
|
|
26
|
+
/** A row of a {@link DataTable}. */
|
|
27
|
+
export type DataTableRow = {
|
|
28
|
+
id: string;
|
|
29
|
+
/** Cell content keyed by column `key`. */
|
|
30
|
+
cells: Record<string, ReactNode>;
|
|
31
|
+
/** Called on a click or Enter on the row; the event tells e.g. a ⌘-click to open in a new tab. */
|
|
32
|
+
onClick?: (event: SyntheticEvent) => void;
|
|
33
|
+
/** Spread onto the row (`tr`, or the card in card mode), e.g. `data-cy`. */
|
|
34
|
+
props?: HTMLAttributes<HTMLTableRowElement>;
|
|
35
|
+
/**
|
|
36
|
+
* Content shown under the row, full width (e.g. an expanded row's
|
|
37
|
+
* details); in card mode at the end of the card. Clicks in it do not
|
|
38
|
+
* reach `onClick`.
|
|
39
|
+
*/
|
|
40
|
+
detail?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
export interface DataTableProps {
|
|
43
|
+
columns: DataTableColumn[];
|
|
44
|
+
rows: DataTableRow[];
|
|
45
|
+
/** Shown in place of the rows when there are none. */
|
|
46
|
+
empty?: ReactNode;
|
|
47
|
+
/** The table shows cards while it is narrower than this. Defaults to `"sm"`. */
|
|
48
|
+
cardBelow?: Breakpoint;
|
|
49
|
+
className?: string;
|
|
50
|
+
/** Names the table for assistive technology. */
|
|
51
|
+
"aria-label"?: string;
|
|
52
|
+
/**
|
|
53
|
+
* More rows, as {@link DataTableRowItem} elements: for a row which needs
|
|
54
|
+
* hooks or state of its own. They follow `rows`.
|
|
55
|
+
*/
|
|
56
|
+
children?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A table built from a column model. While the table itself is narrower
|
|
60
|
+
* than `cardBelow` (by its own width, so a table in a narrow pane also
|
|
61
|
+
* changes), each row shows as a card: the `primary` cell as title with
|
|
62
|
+
* `status` beside it and `actions` (icon-only) at the end, then the `meta`
|
|
63
|
+
* cells as wrapping `Label: value` items. Empty meta values are skipped.
|
|
64
|
+
* A row's `detail` (e.g. expanded details) shows full width under it.
|
|
65
|
+
*
|
|
66
|
+
* Clicks and Enter in an `actions` cell or a `detail` do not reach the
|
|
67
|
+
* row's `onClick`.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <DataTable
|
|
72
|
+
* columns={[
|
|
73
|
+
* { key: "name", label: "Name", role: "primary" },
|
|
74
|
+
* { key: "status", label: "Status", role: "status" },
|
|
75
|
+
* { key: "updated", label: "Updated", hideBelow: "md" },
|
|
76
|
+
* { key: "menu", label: "", role: "actions", align: "end" },
|
|
77
|
+
* ]}
|
|
78
|
+
* rows={runs.map((run) => ({
|
|
79
|
+
* id: run.id,
|
|
80
|
+
* cells: { name: run.name, status: <RunStatus run={run} />, updated: run.updated, menu: <RunMenu run={run} /> },
|
|
81
|
+
* onClick: () => openRun(run.id),
|
|
82
|
+
* props: { "data-cy": "run-row" } as HTMLAttributes<HTMLTableRowElement>,
|
|
83
|
+
* }))}
|
|
84
|
+
* empty="No runs yet"
|
|
85
|
+
* />
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param columns The columns, in wide-mode order. See {@link DataTableColumn}.
|
|
89
|
+
* @param rows The rows. See {@link DataTableRow}.
|
|
90
|
+
* @param empty Shown in place of the rows when there are none.
|
|
91
|
+
* @param cardBelow Breakpoint under which the table shows cards. Defaults to `"sm"` (640px).
|
|
92
|
+
* @param className Additional CSS class names for the table, or the box holding the cards.
|
|
93
|
+
* @param aria-label Names the table for assistive technology.
|
|
94
|
+
* @param children More rows as {@link DataTableRowItem} elements, for rows with hooks or state.
|
|
95
|
+
*/
|
|
96
|
+
export declare const DataTable: FC<DataTableProps>;
|
|
97
|
+
/**
|
|
98
|
+
* A row of a {@link DataTable}, rendered as a table row or a card to match
|
|
99
|
+
* the table. Use it as a child of `DataTable` when a row needs hooks or state
|
|
100
|
+
* of its own; its props are those of a {@link DataTableRow}, without `id`.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```tsx
|
|
104
|
+
* const RunRow = ({ run }: { run: Run }) => {
|
|
105
|
+
* const [open, setOpen] = useState(false);
|
|
106
|
+
* return <DataTableRowItem cells={{ name: run.name, menu: <Menu open={open} /> }} />;
|
|
107
|
+
* };
|
|
108
|
+
*
|
|
109
|
+
* <DataTable columns={columns} rows={[]}>
|
|
110
|
+
* {runs.map((run) => <RunRow key={run.id} run={run} />)}
|
|
111
|
+
* </DataTable>
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export declare const DataTableRowItem: FC<Omit<DataTableRow, "id">>;
|
|
115
|
+
//# sourceMappingURL=DataTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,EAAE,EACF,cAAc,EAEd,SAAS,EACT,cAAc,EACf,MAAM,OAAO,CAAC;AAsBf,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKxE,uCAAuC;AACvC,MAAM,MAAM,eAAe,GAAG;IAC5B,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,KAAK,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;IACjD,yFAAyF;IACzF,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oCAAoC;AACpC,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACjC,kGAAkG;IAClG,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,4EAA4E;IAC5E,KAAK,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAC;IAC5C;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,sDAAsD;IACtD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gFAAgF;IAChF,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAyOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAiDxC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAQzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { UseDisclosureOptions } from '../../util/useDisclosure';
|
|
3
3
|
export type DrawerSide = `${"left" | "right" | "top" | "bottom"}`;
|
|
4
|
+
/** A length in pixels, or a percentage of the viewport along the drawer's axis. */
|
|
5
|
+
export type DrawerLength = number | `${number}%`;
|
|
4
6
|
export interface DrawerHeaderState {
|
|
5
7
|
open: boolean;
|
|
6
8
|
toggle: () => void;
|
|
@@ -11,12 +13,16 @@ export interface DrawerProps extends UseDisclosureOptions {
|
|
|
11
13
|
* Maximum content-area size in pixels. The header and resize handle are
|
|
12
14
|
* excluded — `maxSize` caps only the scrollable body region.
|
|
13
15
|
*/
|
|
14
|
-
maxSize:
|
|
16
|
+
maxSize: DrawerLength;
|
|
15
17
|
mode?: "push" | "float";
|
|
18
|
+
/** Shade the container behind an open floating drawer; a click on it closes the drawer. */
|
|
19
|
+
scrim?: boolean;
|
|
20
|
+
/** Offer the drag handle. Defaults to `true`. */
|
|
21
|
+
resizable?: boolean;
|
|
16
22
|
header?: (state: DrawerHeaderState) => React.ReactNode;
|
|
17
23
|
onSizeChange?: (size: number) => void;
|
|
18
|
-
/** Controlled content-area size
|
|
19
|
-
size?:
|
|
24
|
+
/** Controlled content-area size, up to `maxSize`. */
|
|
25
|
+
size?: DrawerLength;
|
|
20
26
|
children?: React.ReactNode;
|
|
21
27
|
className?: string;
|
|
22
28
|
style?: React.CSSProperties;
|
|
@@ -41,20 +47,30 @@ export interface DrawerProps extends UseDisclosureOptions {
|
|
|
41
47
|
* >
|
|
42
48
|
* <LogList />
|
|
43
49
|
* </Drawer>
|
|
50
|
+
*
|
|
51
|
+
* <Drawer side="bottom" mode="float" scrim resizable={false} size="62%" maxSize="90%" open={open} onOpenChange={setOpen}>
|
|
52
|
+
* <Inspector />
|
|
53
|
+
* </Drawer>
|
|
44
54
|
* ```
|
|
45
55
|
*
|
|
46
56
|
* @param side The edge the drawer docks to. Defaults to `"bottom"`.
|
|
47
|
-
* @param maxSize Maximum size of the content area in pixels
|
|
48
|
-
* resize handle are not
|
|
57
|
+
* @param maxSize Maximum size of the content area, in pixels or as a
|
|
58
|
+
* percentage of the viewport (`"62%"`). The header and resize handle are not
|
|
59
|
+
* counted.
|
|
49
60
|
* @param mode `"push"` keeps the drawer in the layout flow, so it pushes
|
|
50
|
-
* neighbouring content aside; `"float"` positions it over the content
|
|
51
|
-
* Defaults to
|
|
61
|
+
* neighbouring content aside; `"float"` positions it over the content along
|
|
62
|
+
* its edge. Content stays mounted while closed in both modes. Defaults to
|
|
63
|
+
* `"push"`.
|
|
64
|
+
* @param resizable Whether the drag handle shows. Defaults to `true`.
|
|
65
|
+
* @param scrim With `mode="float"`, shades the container behind the open
|
|
66
|
+
* drawer; clicking the shade closes the drawer. Defaults to `false`.
|
|
52
67
|
* @param header Renders the header. Receives `{ open, toggle }`.
|
|
53
68
|
* @param defaultOpen Initial open state when uncontrolled. Defaults to `true`.
|
|
54
69
|
* @param open Controlled open state.
|
|
55
70
|
* @param onOpenChange Called when the open state changes.
|
|
56
71
|
* @param onSizeChange Called with the new content size in pixels.
|
|
57
|
-
* @param size Controlled content size in pixels
|
|
72
|
+
* @param size Controlled content size, in pixels or as a percentage of the
|
|
73
|
+
* viewport; the content then fills that size. Drags report the new size
|
|
58
74
|
* through `onSizeChange` instead of resizing the drawer themselves; dragging
|
|
59
75
|
* it shut closes it through `onOpenChange` and reports no size.
|
|
60
76
|
* @param children The drawer content.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAKjE,MAAM,MAAM,UAAU,GAAG,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,EAAE,CAAC;AAElE,mFAAmF;AACnF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AA+CD,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACvD,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,KAAK,CAAC,SAAS,CAAC;IACvD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,qDAAqD;IACrD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+FjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,YAAY,EACV,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,YAAY,GACb,MAAM,UAAU,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
export type DropdownTriggerProps = Omit<ButtonProps, "variant" | "trailingIcon">;
|
|
3
|
+
export type DropdownTriggerProps = Omit<ButtonProps, "variant" | "trailingIcon"> & {
|
|
4
|
+
/** What the value is, shown before it (`Sort by: Newest`); on a phone only in the tooltip. */
|
|
5
|
+
prefix?: ReactNode;
|
|
6
|
+
};
|
|
9
7
|
/**
|
|
10
8
|
* The standard trigger button for a {@link Dropdown}.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Renders as a secondary button with a trailing caret-down icon so users
|
|
10
|
+
* know the element opens a menu. `borderless` drops the outline for a
|
|
11
|
+
* rounded pill that fills only on hover, for toolbars and filter rows.
|
|
13
12
|
*
|
|
14
13
|
* @example
|
|
15
14
|
* ```tsx
|
|
@@ -18,8 +17,28 @@ export type DropdownTriggerProps = Omit<ButtonProps, "variant" | "trailingIcon">
|
|
|
18
17
|
* </Dropdown>
|
|
19
18
|
* ```
|
|
20
19
|
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Dropdown
|
|
23
|
+
* trigger={
|
|
24
|
+
* <DropdownTrigger borderless leadingIcon={SlidersHorizontalIcon} prefix="Sort by">
|
|
25
|
+
* Newest
|
|
26
|
+
* </DropdownTrigger>
|
|
27
|
+
* }
|
|
28
|
+
* >
|
|
29
|
+
* <MenuTextItem onClick={() => {}}>Oldest</MenuTextItem>
|
|
30
|
+
* </Dropdown>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
21
33
|
* @param children Button label.
|
|
34
|
+
* @param prefix What the value names, shown as `prefix: value`. Below 640px,
|
|
35
|
+
* or in a row out of room (`useCompactRow`, `OverflowRow`), only the value
|
|
36
|
+
* shows and a tooltip reads prefix and value; the `aria-label` keeps both
|
|
37
|
+
* unless one is passed.
|
|
22
38
|
* @param size Button size. Defaults to `"sm"`.
|
|
39
|
+
* @param borderless No outline; a rounded fill appears on hover. The leading
|
|
40
|
+
* icon shrinks to 14px and both icons take the muted icon colour.
|
|
41
|
+
* @param leadingIcon Optional icon before the label.
|
|
23
42
|
* @param props Additional {@link ButtonProps} (excluding `variant` and `trailingIcon`).
|
|
24
43
|
*/
|
|
25
44
|
export declare const DropdownTrigger: FC<DropdownTriggerProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/DropdownTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"DropdownTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/DropdownTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AA4C/D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,WAAW,EACX,SAAS,GAAG,cAAc,CAC3B,GAAG;IACF,8FAA8F;IAC9F,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAuEpD,CAAC"}
|