@baseline-ui/mcp 3.2.1 → 3.4.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/CHANGELOG.md +14 -0
- package/dist/{chunk-RKGE2VKK.js → chunk-KU5KEP2T.js} +1028 -391
- package/dist/index.js +1 -1
- package/dist/server.cjs +1028 -391
- package/dist/server.js +1 -1
- package/package.json +1 -2
- package/sbom.json +13 -459
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import {z
|
|
1
|
+
import {McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import {z}from'zod';var o={BarChart:{id:"charts-barchart",breadcrumb:"Charts/BarChart",importStatement:`import { BarChart } from "@baseline-ui/charts";
|
|
2
2
|
import { Box } from "@baseline-ui/core";`,description:"The `BarChart` component renders a responsive bar chart for categorical data. It is built on top of [Recharts](https://recharts.org/) and styled with Baseline UI design tokens so it picks up the active theme automatically.",documentation:`The \`BarChart\` component renders a responsive bar chart for categorical data. It is built on top of [Recharts](https://recharts.org/) and styled with Baseline UI design tokens so it picks up the active theme automatically.
|
|
3
3
|
|
|
4
4
|
* Renders one or more bar series from a single dataset, keyed by \`xAxisDataKey\` and the per-bar \`dataKey\`.
|
|
@@ -817,6 +817,22 @@ You can add sublabels to the header of the \`AccordionItem\` component using the
|
|
|
817
817
|
</Accordion>
|
|
818
818
|
\`\`\`
|
|
819
819
|
|
|
820
|
+
By default, the content of a collapsed \`AccordionItem\` is unmounted. Set \`shouldForceMount\` on an item to keep its content mounted while collapsed, so its state (for example, typed input) is preserved. Once the collapse animation completes, the content is hidden from view and from assistive technology.
|
|
821
|
+
|
|
822
|
+
Keeping content mounted has costs:
|
|
823
|
+
|
|
824
|
+
* The content renders even if the item is never expanded.
|
|
825
|
+
* The content of an initially collapsed item mounts hidden, so anything that measures its own layout on mount sees zero sizes until the item is first expanded.
|
|
826
|
+
* Changing \`shouldForceMount\` at runtime remounts the content, so set it up front.
|
|
827
|
+
|
|
828
|
+
\`\`\`jsx
|
|
829
|
+
<Accordion>
|
|
830
|
+
<AccordionItem title="Notes" value="notes" shouldForceMount>
|
|
831
|
+
<TextInput label="Notes" />
|
|
832
|
+
</AccordionItem>
|
|
833
|
+
</Accordion>
|
|
834
|
+
\`\`\`
|
|
835
|
+
|
|
820
836
|
* Fully accessible and exposed to assistive technology using ARIA attributes
|
|
821
837
|
* Can be navigated using the keyboard
|
|
822
838
|
|
|
@@ -901,6 +917,8 @@ import React from "react";
|
|
|
901
917
|
import { Accordion } from "../Accordion";
|
|
902
918
|
import { AccordionItem } from "../AccordionItem";
|
|
903
919
|
|
|
920
|
+
import type { Key } from "react";
|
|
921
|
+
|
|
904
922
|
const contentStyle = {
|
|
905
923
|
padding: 10,
|
|
906
924
|
color: themeVars.color.text.primary,
|
|
@@ -982,6 +1000,74 @@ export const AccordionWithDisabledItemsExample: React.FC<
|
|
|
982
1000
|
Omit<React.ComponentProps<typeof AccordionExample>, "disabledKeys">
|
|
983
1001
|
> = (props) => {
|
|
984
1002
|
return <AccordionExample {...props} disabledKeys={new Set(["item-1"])} />;
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1005
|
+
export const AccordionWithLastItemDisabledExample: React.FC<
|
|
1006
|
+
Omit<React.ComponentProps<typeof AccordionExample>, "disabledKeys">
|
|
1007
|
+
> = (props) => {
|
|
1008
|
+
return <AccordionExample {...props} disabledKeys={new Set(["item-3"])} />;
|
|
1009
|
+
};
|
|
1010
|
+
|
|
1011
|
+
export const AccordionWithNumericKeysExample: React.FC = () => {
|
|
1012
|
+
return (
|
|
1013
|
+
<Accordion disabledKeys={new Set([2])}>
|
|
1014
|
+
{[1, 2, 3].map((n) => (
|
|
1015
|
+
<AccordionItem
|
|
1016
|
+
key={n}
|
|
1017
|
+
title={\`Accordion Item \${n}\`}
|
|
1018
|
+
value={n}
|
|
1019
|
+
style={contentStyle}
|
|
1020
|
+
>
|
|
1021
|
+
lorem ipsum dolor sit amet consectetur adipisicing elit
|
|
1022
|
+
</AccordionItem>
|
|
1023
|
+
))}
|
|
1024
|
+
</Accordion>
|
|
1025
|
+
);
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
export const AccordionForceMountExample: React.FC<
|
|
1029
|
+
Omit<React.ComponentProps<typeof Accordion>, "children"> & {
|
|
1030
|
+
shouldForceMount?: boolean;
|
|
1031
|
+
/** Playwright CT cannot pass a \`Set\` prop, so specs pass a key instead. */
|
|
1032
|
+
defaultExpandedKey?: string;
|
|
1033
|
+
}
|
|
1034
|
+
> = ({ shouldForceMount, defaultExpandedKey, ...props }) => {
|
|
1035
|
+
return (
|
|
1036
|
+
<Accordion
|
|
1037
|
+
{...props}
|
|
1038
|
+
{...(defaultExpandedKey && {
|
|
1039
|
+
defaultExpandedKeys: new Set([defaultExpandedKey]),
|
|
1040
|
+
})}
|
|
1041
|
+
>
|
|
1042
|
+
{Array.from({ length: 2 }).map((_, i) => (
|
|
1043
|
+
<AccordionItem
|
|
1044
|
+
key={i}
|
|
1045
|
+
title={\`Accordion Item \${i + 1}\`}
|
|
1046
|
+
value={\`item-\${i + 1}\`}
|
|
1047
|
+
style={contentStyle}
|
|
1048
|
+
shouldForceMount={shouldForceMount}
|
|
1049
|
+
>
|
|
1050
|
+
<input aria-label={\`Item \${i + 1} input\`} />
|
|
1051
|
+
</AccordionItem>
|
|
1052
|
+
))}
|
|
1053
|
+
</Accordion>
|
|
1054
|
+
);
|
|
1055
|
+
};
|
|
1056
|
+
|
|
1057
|
+
export const ControlledAccordionExample: React.FC<{
|
|
1058
|
+
onChange?: (keys: Set<Key>) => void;
|
|
1059
|
+
}> = ({ onChange }) => {
|
|
1060
|
+
const [keys, setKeys] = React.useState<Set<Key>>(new Set());
|
|
1061
|
+
|
|
1062
|
+
return (
|
|
1063
|
+
<AccordionExample
|
|
1064
|
+
expandedKeys={keys}
|
|
1065
|
+
onChange={(k) => {
|
|
1066
|
+
setKeys(k);
|
|
1067
|
+
onChange?.(k);
|
|
1068
|
+
}}
|
|
1069
|
+
/>
|
|
1070
|
+
);
|
|
985
1071
|
};`},similarTo:[],figmaUrl:null},ActionButton:{id:"core-buttons-actionbutton",breadcrumb:"Core/Buttons/ActionButton",importStatement:'import { ActionButton, Menu, VariantViewer } from "@baseline-ui/core";',description:"`ActionButton` is a labeled button that triggers an action when activated by mouse, touch, or keyboard. Use it for primary user actions such as submitting a form, confirming a choice, or invoking a command.",documentation:'`ActionButton` is a labeled button that triggers an action when activated by mouse, touch, or keyboard. Use it for primary user actions such as submitting a form, confirming a choice, or invoking a command.\n\n* Mouse and touch event handling, and press state management\n* Keyboard focus management and cross browser normalization\n* Keyboard event support for Space and Enter keys\n\nYou can import the ActionButton component like so:\n\n```jsx\nimport { ActionButton } from "@baseline-ui/core";\n\nexport default function App() {\n return <ActionButton label="Click Me" />;\n}\n```\n\nIf you want to use a button that can be toggled on and off, you can use the `ToggleButton` component.\n\nThe button has six neutral variants: `primary`, `secondary`, `tertiary`, `popover`, `toolbar` and `ghost`. The default variant is `primary`. You can change the variant by passing the `variant` prop.\n\n```jsx\n<ActionButton label="Primary" />\n<ActionButton label="Secondary" variant="secondary" />\n<ActionButton label="Tertiary" variant="tertiary" />\n<ActionButton label={"Toolbar"} variant={"toolbar"} />\n<ActionButton label="Ghost" variant="ghost" />\n<ActionButton label="Popover" variant="popover" />\n```\n\n`success`, `warning` and `error` carry a support colour for actions whose outcome matters \u2014 confirming, acknowledging a risk, or deleting. Each comes in the same three emphasis levels as the neutral variants, so a support-coloured button can sit at whatever weight the surrounding layout calls for:\n\n* `{name}` \u2014 filled, for the primary action in its context\n* `{name}-secondary` \u2014 tinted fill, for a lower-emphasis action\n* `{name}-tertiary` \u2014 outline that fills with the support colour on hover and on keyboard focus\n\nWhen disabled, all three levels drop the support colour and render in the neutral disabled treatment.\n\n```jsx\n<ActionButton label="Success" variant="success" />\n<ActionButton label="Success" variant="success-secondary" />\n<ActionButton label="Success" variant="success-tertiary" />\n<ActionButton label="Warning" variant="warning" />\n<ActionButton label="Warning" variant="warning-secondary" />\n<ActionButton label="Warning" variant="warning-tertiary" />\n<ActionButton label="Error" variant="error" />\n<ActionButton label="Error" variant="error-secondary" />\n<ActionButton label="Error" variant="error-tertiary" />\n```\n\nActionButton supports three sizes: `sm` (default), `md`, and `lg`. You can change the size by passing the `size` prop.\n\n```jsx\n<ActionButton label="Small (default)" size="sm" />\n<ActionButton label="Medium" size="md" />\n<ActionButton label="Large" size="lg" />\n```\n\nYou can disable a button by passing the `isDisabled` prop. This will disable all mouse, touch, and keyboard interactions. The `-secondary` and `-tertiary` support variants are omitted below because they render identically to disabled `secondary` and `tertiary`.\n\n```jsx\n<ActionButton label="Primary" isDisabled />\n<ActionButton label="Secondary" variant="secondary" isDisabled />\n<ActionButton label="Tertiary" variant="tertiary" isDisabled />\n<ActionButton label="Ghost" variant="ghost" isDisabled />\n<ActionButton label="Toolbar" variant="toolbar" isDisabled />\n<ActionButton label="Popover" variant="popover" isDisabled />\n<ActionButton label="Success" variant="success" isDisabled />\n<ActionButton label="Warning" variant="warning" isDisabled />\n<ActionButton label="Error" variant="error" isDisabled />\n```\n\nYou can place an icon before or after the label by passing the `iconStart` or `iconEnd` props. Choose the icon entrypoint that matches your button size: `@baseline-ui/icons/16` for `sm`, `@baseline-ui/icons/20` for `md`, and `@baseline-ui/icons/24` for `lg`.\n\n```jsx\nimport { EllipseIcon } from "@baseline-ui/icons/16";\n\n<ActionButton label="Label" iconStart={EllipseIcon} />\n<ActionButton label="Label" iconEnd={EllipseIcon} />\n```\n\nYou can listen for events by passing the `onPress` prop. The `onPress` prop will fire when the button is activated by mouse, touch, or keyboard interactions.\n\n```jsx\n<ActionButton label="Click Me" onPress={() => alert("Hello World")} />\n```\n\n| Selector | Description |\n| -------------------- | -------------------------------------------------------------- |\n| \\[data-disabled] | Whether the button is disabled. |\n| \\[data-focused] | Whether the button is focused, either via a mouse or keyboard. |\n| \\[data-hovered] | Whether the button is currently hovered with a mouse. |\n| \\[data-focus-visible] | Whether the button is keyboard focused. |\n| \\[data-pressed] | Whether the button is currently pressed. |\n\n| Key | Function |\n| ------- | --------------------- |\n| `Space` | Activates the button. |\n| `Enter` | Activates the button. |',props:`interface ActionButtonProps {
|
|
986
1072
|
/**
|
|
987
1073
|
* The button's class name.
|
|
@@ -2419,7 +2505,8 @@ showCloseButton?: boolean
|
|
|
2419
2505
|
defaultOpen={false} />;`},{id:"core-overlays-alertdialog--only-primary-action",name:"Only Primary Action",snippet:`const OnlyPrimaryAction = () => <AlertDialogExample
|
|
2420
2506
|
title="Continue?"
|
|
2421
2507
|
message="This action cannot be undone."
|
|
2422
|
-
primaryActionLabel="Continue" />;`}],implementation:`import
|
|
2508
|
+
primaryActionLabel="Continue" />;`}],implementation:`import { WarningFilledIcon } from "@baseline-ui/icons/24";
|
|
2509
|
+
import React from "react";
|
|
2423
2510
|
|
|
2424
2511
|
import { ActionButton } from "../../ActionButton";
|
|
2425
2512
|
import { Modal, ModalContent, ModalTrigger } from "../../Modal";
|
|
@@ -2458,7 +2545,11 @@ export const AlertDialogExample: React.FC<
|
|
|
2458
2545
|
</ModalContent>
|
|
2459
2546
|
</Modal>
|
|
2460
2547
|
);
|
|
2461
|
-
}
|
|
2548
|
+
};
|
|
2549
|
+
|
|
2550
|
+
export const AlertDialogWithIconExample: React.FC<
|
|
2551
|
+
Omit<AlertDialogProps, "icon">
|
|
2552
|
+
> = (props) => <AlertDialogExample icon={WarningFilledIcon} {...props} />;`},similarTo:[],figmaUrl:null},AudioPlayer:{id:"core-media-audioplayer",breadcrumb:"Core/Media/AudioPlayer",importStatement:'import { AudioPlayer } from "@baseline-ui/core";',description:"`AudioPlayer` is an accessible audio playback control with play, pause, seek, and elapsed-time display for any browser-supported audio source. Use it to embed playback of recordings, voice notes, or other audio assets directly in your interface.",documentation:`\`AudioPlayer\` is an accessible audio playback control with play, pause, seek, and elapsed-time display for any browser-supported audio source. Use it to embed playback of recordings, voice notes, or other audio assets directly in your interface.
|
|
2462
2553
|
|
|
2463
2554
|
* Play and pause audio files
|
|
2464
2555
|
* Seek through audio files
|
|
@@ -2577,7 +2668,34 @@ playingLabel?: string
|
|
|
2577
2668
|
* Message id: \`bui.useMedia.paused\`. Defaults to \`"Paused"\`.
|
|
2578
2669
|
*/
|
|
2579
2670
|
pausedLabel?: string
|
|
2580
|
-
}`,stories:{usage:[{id:"core-media-audioplayer--basic",name:"Basic",snippet:'const Basic = () => <AudioPlayer sources={[{ url: "/sound.mp3", type: "audio/mpeg" }]} />;'},{id:"core-media-audioplayer--small",name:"Small",snippet:'const Small = () => <AudioPlayer sources={[{ url: "/sound.mp3", type: "audio/mpeg" }]} size="sm" />;'}],implementation
|
|
2671
|
+
}`,stories:{usage:[{id:"core-media-audioplayer--basic",name:"Basic",snippet:'const Basic = () => <AudioPlayer sources={[{ url: "/sound.mp3", type: "audio/mpeg" }]} />;'},{id:"core-media-audioplayer--small",name:"Small",snippet:'const Small = () => <AudioPlayer sources={[{ url: "/sound.mp3", type: "audio/mpeg" }]} size="sm" />;'}],implementation:`import React from "react";
|
|
2672
|
+
|
|
2673
|
+
import { ActionButton } from "../../ActionButton/ActionButton";
|
|
2674
|
+
import { AudioPlayer } from "../AudioPlayer";
|
|
2675
|
+
|
|
2676
|
+
export function SwitchableSourcePlayer() {
|
|
2677
|
+
const [track, setTrack] = React.useState(1);
|
|
2678
|
+
|
|
2679
|
+
return (
|
|
2680
|
+
<>
|
|
2681
|
+
<ActionButton
|
|
2682
|
+
label="Next track"
|
|
2683
|
+
onPress={() => {
|
|
2684
|
+
setTrack(2);
|
|
2685
|
+
}}
|
|
2686
|
+
/>
|
|
2687
|
+
<AudioPlayer
|
|
2688
|
+
aria-label="Player"
|
|
2689
|
+
sources={[
|
|
2690
|
+
{
|
|
2691
|
+
url: track === 1 ? "/sound.mp3" : "/sound.mp3?track=2",
|
|
2692
|
+
type: "audio/mpeg",
|
|
2693
|
+
},
|
|
2694
|
+
]}
|
|
2695
|
+
/>
|
|
2696
|
+
</>
|
|
2697
|
+
);
|
|
2698
|
+
}`},similarTo:[],figmaUrl:null},Avatar:{id:"core-content-avatar",breadcrumb:"Core/Content/Avatar",importStatement:'import { Avatar, VariantViewer } from "@baseline-ui/core";',description:"`Avatar` is a small visual representation of a user, showing either a profile image or initials derived from the user's name. Use it to identify people in lists, comments, mentions, or anywhere a user needs to be visually attributed.",documentation:`\`Avatar\` is a small visual representation of a user, showing either a profile image or initials derived from the user's name. Use it to identify people in lists, comments, mentions, or anywhere a user needs to be visually attributed.
|
|
2581
2699
|
|
|
2582
2700
|
\`\`\`jsx
|
|
2583
2701
|
import { Avatar } from "../../utils";
|
|
@@ -3308,14 +3426,19 @@ export const CalendarExample: React.FC<
|
|
|
3308
3426
|
Omit<CalendarProps, "defaultValue" | "value"> & {
|
|
3309
3427
|
defaultValue?: string;
|
|
3310
3428
|
value?: string;
|
|
3429
|
+
externalLabel?: string;
|
|
3311
3430
|
}
|
|
3312
|
-
> = ({ defaultValue, value, ...rest }) => {
|
|
3431
|
+
> = ({ defaultValue, value, externalLabel, ...rest }) => {
|
|
3313
3432
|
return (
|
|
3433
|
+
<>
|
|
3434
|
+
{externalLabel ? <span id="external-label">{externalLabel}</span> : null}
|
|
3314
3435
|
<Calendar
|
|
3436
|
+
aria-labelledby={externalLabel ? "external-label" : undefined}
|
|
3315
3437
|
{...rest}
|
|
3316
3438
|
defaultValue={defaultValue ? parseDate(defaultValue) : undefined}
|
|
3317
3439
|
value={value ? parseDate(value) : undefined}
|
|
3318
3440
|
/>
|
|
3441
|
+
</>
|
|
3319
3442
|
);
|
|
3320
3443
|
};
|
|
3321
3444
|
|
|
@@ -3434,10 +3557,14 @@ export const RangeCalendarExample: React.FC<
|
|
|
3434
3557
|
Omit<RangeCalendarProps, "defaultValue" | "value"> & {
|
|
3435
3558
|
defaultValue?: { start: string; end: string };
|
|
3436
3559
|
value?: { start: string; end: string };
|
|
3560
|
+
externalLabel?: string;
|
|
3437
3561
|
}
|
|
3438
|
-
> = ({ defaultValue, value, ...rest }) => {
|
|
3562
|
+
> = ({ defaultValue, value, externalLabel, ...rest }) => {
|
|
3439
3563
|
return (
|
|
3564
|
+
<>
|
|
3565
|
+
{externalLabel ? <span id="external-label">{externalLabel}</span> : null}
|
|
3440
3566
|
<RangeCalendar
|
|
3567
|
+
aria-labelledby={externalLabel ? "external-label" : undefined}
|
|
3441
3568
|
{...rest}
|
|
3442
3569
|
defaultValue={
|
|
3443
3570
|
defaultValue
|
|
@@ -3453,6 +3580,7 @@ export const RangeCalendarExample: React.FC<
|
|
|
3453
3580
|
: undefined
|
|
3454
3581
|
}
|
|
3455
3582
|
/>
|
|
3583
|
+
</>
|
|
3456
3584
|
);
|
|
3457
3585
|
};`},similarTo:[],figmaUrl:null},RangeCalendar:{id:"core-forms-rangecalendar",breadcrumb:"Core/Forms/RangeCalendar",importStatement:'import { Box, I18nProvider, RangeCalendar, Select } from "@baseline-ui/core";',description:"`RangeCalendar` presents a monthly grid of dates from which the user can pick a contiguous start and end day. Use it when capturing a span of time, such as a trip, booking, or reporting period.",documentation:`\`RangeCalendar\` presents a monthly grid of dates from which the user can pick a contiguous start and end day. Use it when capturing a span of time, such as a trip, booking, or reporting period.
|
|
3458
3586
|
|
|
@@ -3806,14 +3934,19 @@ export const CalendarExample: React.FC<
|
|
|
3806
3934
|
Omit<CalendarProps, "defaultValue" | "value"> & {
|
|
3807
3935
|
defaultValue?: string;
|
|
3808
3936
|
value?: string;
|
|
3937
|
+
externalLabel?: string;
|
|
3809
3938
|
}
|
|
3810
|
-
> = ({ defaultValue, value, ...rest }) => {
|
|
3939
|
+
> = ({ defaultValue, value, externalLabel, ...rest }) => {
|
|
3811
3940
|
return (
|
|
3941
|
+
<>
|
|
3942
|
+
{externalLabel ? <span id="external-label">{externalLabel}</span> : null}
|
|
3812
3943
|
<Calendar
|
|
3944
|
+
aria-labelledby={externalLabel ? "external-label" : undefined}
|
|
3813
3945
|
{...rest}
|
|
3814
3946
|
defaultValue={defaultValue ? parseDate(defaultValue) : undefined}
|
|
3815
3947
|
value={value ? parseDate(value) : undefined}
|
|
3816
3948
|
/>
|
|
3949
|
+
</>
|
|
3817
3950
|
);
|
|
3818
3951
|
};
|
|
3819
3952
|
|
|
@@ -3932,10 +4065,14 @@ export const RangeCalendarExample: React.FC<
|
|
|
3932
4065
|
Omit<RangeCalendarProps, "defaultValue" | "value"> & {
|
|
3933
4066
|
defaultValue?: { start: string; end: string };
|
|
3934
4067
|
value?: { start: string; end: string };
|
|
4068
|
+
externalLabel?: string;
|
|
3935
4069
|
}
|
|
3936
|
-
> = ({ defaultValue, value, ...rest }) => {
|
|
4070
|
+
> = ({ defaultValue, value, externalLabel, ...rest }) => {
|
|
3937
4071
|
return (
|
|
4072
|
+
<>
|
|
4073
|
+
{externalLabel ? <span id="external-label">{externalLabel}</span> : null}
|
|
3938
4074
|
<RangeCalendar
|
|
4075
|
+
aria-labelledby={externalLabel ? "external-label" : undefined}
|
|
3939
4076
|
{...rest}
|
|
3940
4077
|
defaultValue={
|
|
3941
4078
|
defaultValue
|
|
@@ -3951,6 +4088,7 @@ export const RangeCalendarExample: React.FC<
|
|
|
3951
4088
|
: undefined
|
|
3952
4089
|
}
|
|
3953
4090
|
/>
|
|
4091
|
+
</>
|
|
3954
4092
|
);
|
|
3955
4093
|
};`},similarTo:[],figmaUrl:null},Checkbox:{id:"core-forms-checkbox",breadcrumb:"Core/Forms/Checkbox",importStatement:'import { Checkbox } from "@baseline-ui/core";',description:"`Checkbox` is a binary control that lets a user turn an individual option on or off, with support for an indeterminate third state. Use it for independent boolean choices in forms, settings, or when selecting any number of items from a list.",documentation:'`Checkbox` is a binary control that lets a user turn an individual option on or off, with support for an indeterminate third state. Use it for independent boolean choices in forms, settings, or when selecting any number of items from a list.\n\n* Built on [React Aria Checkbox](https://react-spectrum.adobe.com/react-aria/Checkbox.html)\n* Full support for form autofill\n* Keyboard focus management and cross browser normalization\n* Labeling support for assistive technology via aria-\\* props\n* Indeterminate state support\n\n```jsx\nimport { Checkbox } from "@baseline-ui/core";\n\n<Checkbox label="Label" onChange={console.log} />;\n```\n\nThe `defaultSelected` prop allows the checkbox to be uncontrolled. This is useful when the checkbox is not part of a group and the checked state is managed by the checkbox itself.\n\n```jsx\n<Checkbox label="Label" defaultSelected onChange={console.log} />\n```\n\nThe `isSelected` prop allows the checkbox to be controlled. This is useful when the checkbox is part of a group and the checked state is managed by a parent component.\n\n```jsx\n<Checkbox label="Label" isSelected onChange={console.log} />\n```\n\nThe `isIndeterminate` prop allows the checkbox to be in an indeterminate state. This is useful when the checkbox is part of a group and some, but not all, of the checkboxes are checked.\n\n```jsx\n<Checkbox label="Label" isIndeterminate onChange={console.log} />\n```\n\nThe `isReadOnly` prop allows the checkbox to be readonly. This mode is useful when you want the checkbox to be focusable, but not editable.\n\n```jsx\n<Checkbox label="Label" isReadOnly isSelected onChange={console.log} />\n```\n\nThe `isDisabled` prop allows the checkbox to be disabled.\n\n```jsx\n<Checkbox label="Label" isDisabled onChange={console.log} />\n```\n\nThe `name` and `value` props allow the checkbox to be used in an HTML form.\n\n```jsx\n<Checkbox label="Label" name="name" value="value" onChange={console.log} />\n```\n\nThe `labelPosition` prop controls whether the label appears before or after the checkbox.\n\n```jsx\n<Checkbox label="Label" labelPosition="start" onChange={console.log} />\n```\n\nThe `isInvalid` prop marks the checkbox as having a validation error.\n\n```jsx\n<Checkbox label="Label" isInvalid onChange={console.log} />\n```\n\nThe `onChange` callback receives a `boolean` indicating the new checked state.\n\n```jsx\n<Checkbox\n label="Label"\n onChange={(isSelected) => {\n console.log("Checked:", isSelected);\n }}\n/>\n```\n\nWhen `isIndeterminate` is `true`, the checkbox displays a minus icon regardless of the `isSelected` state. Clicking an indeterminate checkbox will call `onChange` with `true`.\n\n| Selector | Description |\n| -------------------- | ----------------------------------------------------------------- |\n| \\[data-disabled] | Whether the component is disabled. |\n| \\[data-focused] | Whether the component is focused, either via a mouse or keyboard. |\n| \\[data-hovered] | Whether the component is currently hovered with a mouse. |\n| \\[data-focus-visible] | Whether the component is keyboard focused. |\n| \\[data-selected] | Whether the component is selected. |\n| \\[data-readonly] | Whether the component is read-only. |\n| \\[data-pressed] | Whether the component is currently pressed. |\n| \\[data-indeterminate] | Whether the component is in an indeterminate state. |\n| \\[data-invalid] | Whether the component has a validation error. |\n\n| Key | Function |\n| ------- | ------------------- |\n| `Space` | Toggle the checkbox |',props:`interface CheckboxProps {
|
|
3956
4094
|
/**
|
|
@@ -4291,7 +4429,7 @@ placement?: any
|
|
|
4291
4429
|
presets={presets}
|
|
4292
4430
|
label="Label"
|
|
4293
4431
|
labelPosition="start"
|
|
4294
|
-
defaultValue="#ff0000" />;`},{id:"core-forms-colorinput--without-color-presets",name:"Without Color Presets",snippet:'const WithoutColorPresets = () => <ColorInput presets={[]} label="Label" defaultOpen />;'},{id:"core-forms-colorinput--color-presets-only",name:"Color Presets Only",snippet:'const ColorPresetsOnly = () => <ColorInput presets={presets} label="Label" defaultOpen includePicker={false} />;'},{id:"core-forms-colorinput--with-custom-trigger",name:"With Custom Trigger",snippet:"const WithCustomTrigger = () => <CustomTriggerButton />;"},{id:"core-forms-colorinput--lazy-picker",name:"Lazy Picker",snippet:'const LazyPicker = () => <ColorInput presets={presets} pickerMode="lazy" defaultOpen />;'},{id:"core-forms-colorinput--lazy-picker-mobile",name:"Lazy Picker Mobile",snippet:'const LazyPickerMobile = () => <ColorInput presets={presets} pickerMode="lazy" defaultOpen />;'},{id:"core-forms-colorinput--indeterminate",name:"Indeterminate",snippet:'const Indeterminate = () => <IndeterminateExample presets={presets} defaultValue="#ff0000" />;'}],implementation:`import { EllipseIcon } from "@baseline-ui/icons/24";
|
|
4432
|
+
defaultValue="#ff0000" />;`},{id:"core-forms-colorinput--without-color-presets",name:"Without Color Presets",snippet:'const WithoutColorPresets = () => <ColorInput presets={[]} label="Label" defaultOpen />;'},{id:"core-forms-colorinput--color-presets-only",name:"Color Presets Only",snippet:'const ColorPresetsOnly = () => <ColorInput presets={presets} label="Label" defaultOpen includePicker={false} />;'},{id:"core-forms-colorinput--with-custom-trigger",name:"With Custom Trigger",snippet:"const WithCustomTrigger = () => <CustomTriggerButton />;"},{id:"core-forms-colorinput--lazy-picker",name:"Lazy Picker",snippet:'const LazyPicker = () => <ColorInput presets={presets} pickerMode="lazy" defaultOpen />;'},{id:"core-forms-colorinput--lazy-picker-mobile",name:"Lazy Picker Mobile",snippet:'const LazyPickerMobile = () => <ColorInput presets={presets} pickerMode="lazy" defaultOpen />;'},{id:"core-forms-colorinput--indeterminate",name:"Indeterminate",snippet:'const Indeterminate = () => <IndeterminateExample presets={presets} defaultValue="#ff0000" />;'}],implementation:`import { BorderColorIcon, EllipseIcon } from "@baseline-ui/icons/24";
|
|
4295
4433
|
import React, { useState } from "react";
|
|
4296
4434
|
|
|
4297
4435
|
import { ActionButton } from "../../ActionButton";
|
|
@@ -4299,8 +4437,10 @@ import { ActionIconButton } from "../../ActionIconButton";
|
|
|
4299
4437
|
import { Box } from "../../Box";
|
|
4300
4438
|
import { Text } from "../../Text";
|
|
4301
4439
|
import { ColorInput } from "../ColorInput";
|
|
4440
|
+
import { IconColorInput } from "../IconColorInput";
|
|
4441
|
+
import { presets } from "./data";
|
|
4302
4442
|
|
|
4303
|
-
import type { ColorInputProps } from "../ColorInput.types";
|
|
4443
|
+
import type { ColorInputProps, IconColorInputProps } from "../ColorInput.types";
|
|
4304
4444
|
|
|
4305
4445
|
export const CustomTriggerButton = () => {
|
|
4306
4446
|
return (
|
|
@@ -4403,7 +4543,21 @@ export const IndeterminateWithCustomColorLabel: React.FC<ColorInputProps> = (
|
|
|
4403
4543
|
}
|
|
4404
4544
|
/>
|
|
4405
4545
|
);
|
|
4406
|
-
}
|
|
4546
|
+
};
|
|
4547
|
+
|
|
4548
|
+
export const StoredCustomColorsExample: React.FC<{ storageKey: string }> = ({
|
|
4549
|
+
storageKey,
|
|
4550
|
+
}) => (
|
|
4551
|
+
<ColorInput
|
|
4552
|
+
presets={presets}
|
|
4553
|
+
defaultValue="#000000"
|
|
4554
|
+
storePickedColorKey={storageKey}
|
|
4555
|
+
/>
|
|
4556
|
+
);
|
|
4557
|
+
|
|
4558
|
+
export const IconColorInputExample: React.FC<
|
|
4559
|
+
Omit<IconColorInputProps, "icon">
|
|
4560
|
+
> = (props) => <IconColorInput icon={BorderColorIcon} {...props} />;`},similarTo:[],figmaUrl:null},ColorSwatch:{id:"core-content-colorswatch",breadcrumb:"Core/Content/ColorSwatch",importStatement:'import { Box, ColorSwatch, VariantViewer } from "@baseline-ui/core";',description:'`ColorSwatch` is a small tile that visually represents a single color value, with built-in handling for transparency, "none", and indeterminate states. Use it to preview a color inside pickers, lists, or anywhere a color value needs to be shown next to its label.',documentation:`\`ColorSwatch\` is a small tile that visually represents a single color value, with built-in handling for transparency, "none", and indeterminate states. Use it to preview a color inside pickers, lists, or anywhere a color value needs to be shown next to its label.
|
|
4407
4561
|
|
|
4408
4562
|
* Accessible color representation with screen reader support via aria-label
|
|
4409
4563
|
* Support for transparent colors with a checkered background pattern
|
|
@@ -4760,7 +4914,45 @@ labelPosition?: any
|
|
|
4760
4914
|
label: item.label,
|
|
4761
4915
|
}))}
|
|
4762
4916
|
aria-label="Color Swatch Picker"
|
|
4763
|
-
isDisabled />;`}],implementation
|
|
4917
|
+
isDisabled />;`}],implementation:`import React from "react";
|
|
4918
|
+
|
|
4919
|
+
import { colorItems } from "../../RadioGroup/__tests__/testComponents";
|
|
4920
|
+
import { ColorSwatchPicker } from "../ColorSwatchPicker";
|
|
4921
|
+
|
|
4922
|
+
import type { ColorSwatchPickerProps } from "../ColorSwatchPicker.types";
|
|
4923
|
+
|
|
4924
|
+
const items = colorItems.map((item) => ({
|
|
4925
|
+
color: item.id,
|
|
4926
|
+
label: item.label,
|
|
4927
|
+
}));
|
|
4928
|
+
|
|
4929
|
+
export const ColorSwatchPickerExample: React.FC<
|
|
4930
|
+
Omit<ColorSwatchPickerProps, "items">
|
|
4931
|
+
> = (props) => (
|
|
4932
|
+
<ColorSwatchPicker aria-label="Colors" {...props} items={items} />
|
|
4933
|
+
);
|
|
4934
|
+
|
|
4935
|
+
export const ControlledColorSwatchPickerExample: React.FC = () => {
|
|
4936
|
+
const [value, setValue] = React.useState<string | undefined>();
|
|
4937
|
+
|
|
4938
|
+
return (
|
|
4939
|
+
<>
|
|
4940
|
+
<ColorSwatchPicker
|
|
4941
|
+
aria-label="Colors"
|
|
4942
|
+
items={items}
|
|
4943
|
+
value={value}
|
|
4944
|
+
onChange={setValue}
|
|
4945
|
+
/>
|
|
4946
|
+
<button
|
|
4947
|
+
onClick={() => {
|
|
4948
|
+
setValue(undefined);
|
|
4949
|
+
}}
|
|
4950
|
+
>
|
|
4951
|
+
Clear
|
|
4952
|
+
</button>
|
|
4953
|
+
</>
|
|
4954
|
+
);
|
|
4955
|
+
};`},similarTo:[],figmaUrl:null},ComboBox:{id:"core-forms-combobox",breadcrumb:"Core/Forms/ComboBox",importStatement:'import { ActionButton, ComboBox, VariantViewer } from "@baseline-ui/core";',description:"`ComboBox` pairs a text input with a dropdown list so users can type to filter and then select a single value. Use it when users need to pick one item from a long or dynamic list and benefit from search-as-you-type.",documentation:`\`ComboBox\` pairs a text input with a dropdown list so users can type to filter and then select a single value. Use it when users need to pick one item from a long or dynamic list and benefit from search-as-you-type.
|
|
4764
4956
|
|
|
4765
4957
|
\`\`\`jsx
|
|
4766
4958
|
<ComboBox
|
|
@@ -5003,6 +5195,8 @@ variant?: "primary" | "ghost"
|
|
|
5003
5195
|
labelPosition?: "top" | "start"
|
|
5004
5196
|
/**
|
|
5005
5197
|
* Whether the input is read only.
|
|
5198
|
+
*
|
|
5199
|
+
* @deprecated Use \`isReadOnly\`, which takes precedence when both are set.
|
|
5006
5200
|
*/
|
|
5007
5201
|
readOnly?: boolean
|
|
5008
5202
|
/**
|
|
@@ -5020,6 +5214,12 @@ inputClassName?: string
|
|
|
5020
5214
|
* overrides any \`aria-labelledby\` the toggle would otherwise inherit.
|
|
5021
5215
|
*/
|
|
5022
5216
|
toggleLabel?: string
|
|
5217
|
+
/**
|
|
5218
|
+
* Whether typing in the input filters the items shown in the list. When
|
|
5219
|
+
* \`false\`, every item is shown and \`filter\` is ignored.
|
|
5220
|
+
*
|
|
5221
|
+
* @default true
|
|
5222
|
+
*/
|
|
5023
5223
|
filterItems?: boolean
|
|
5024
5224
|
onInputChange?: (value: string) => void
|
|
5025
5225
|
showIcon?: boolean
|
|
@@ -5052,7 +5252,8 @@ items: ListItem[]
|
|
|
5052
5252
|
*/
|
|
5053
5253
|
menuTrigger?: "manual" | "input" | "focus"
|
|
5054
5254
|
/**
|
|
5055
|
-
* Custom filter function to use when filtering items.
|
|
5255
|
+
* Custom filter function to use when filtering items. Ignored when
|
|
5256
|
+
* \`filterItems\` is \`false\`.
|
|
5056
5257
|
*/
|
|
5057
5258
|
filter?: ComboBoxStateOptions<ListItem>["defaultFilter"]
|
|
5058
5259
|
/**
|
|
@@ -6191,6 +6392,10 @@ openCalendarLabel?: string
|
|
|
6191
6392
|
label="Label"
|
|
6192
6393
|
errorMessage="Error message"
|
|
6193
6394
|
validationState="error"
|
|
6395
|
+
granularity="day" />;`},{id:"core-forms-datefield--with-error-message-only",name:"With Error Message Only",snippet:`const WithErrorMessageOnly = () => <DateField
|
|
6396
|
+
onChange={fn()}
|
|
6397
|
+
label="Label"
|
|
6398
|
+
errorMessage="Error message"
|
|
6194
6399
|
granularity="day" />;`},{id:"core-forms-datefield--with-warning-message",name:"With Warning Message",snippet:`const WithWarningMessage = () => <DateField
|
|
6195
6400
|
onChange={fn()}
|
|
6196
6401
|
label="Label"
|
|
@@ -6303,12 +6508,12 @@ export const MinMaxDateFieldExample: React.FC<
|
|
|
6303
6508
|
maxValue={new CalendarDate(2022, 6, 30)}
|
|
6304
6509
|
/>
|
|
6305
6510
|
);
|
|
6306
|
-
};`},similarTo:[],figmaUrl:null},DateFormat:{id:"core-utilities-dateformat",breadcrumb:"Core/Utilities/DateFormat",importStatement:'import { DateFormat } from "@baseline-ui/core";',description:"`DateFormat` is a component that formats a
|
|
6511
|
+
};`},similarTo:[],figmaUrl:null},DateFormat:{id:"core-utilities-dateformat",breadcrumb:"Core/Utilities/DateFormat",importStatement:'import { DateFormat } from "@baseline-ui/core";',description:"`DateFormat` is a component that formats a `Date` into a localized string. It is built on top of [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).",documentation:`\`DateFormat\` is a component that formats a \`Date\` into a localized string. It is built on top of [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).
|
|
6307
6512
|
|
|
6308
6513
|
\`\`\`jsx
|
|
6309
|
-
import { DateFormat } from "
|
|
6514
|
+
import { DateFormat } from "@baseline-ui/core";
|
|
6310
6515
|
|
|
6311
|
-
const date = "2020-01-01T00:00:00.000Z";
|
|
6516
|
+
const date = new Date("2020-01-01T00:00:00.000Z");
|
|
6312
6517
|
|
|
6313
6518
|
export default () => <DateFormat date={date} />;
|
|
6314
6519
|
\`\`\`
|
|
@@ -6318,9 +6523,9 @@ The above example will render the date in the default locale of the browser.
|
|
|
6318
6523
|
You can override the default locale by using \`I18nProvider\`.
|
|
6319
6524
|
|
|
6320
6525
|
\`\`\`jsx
|
|
6321
|
-
import { I18nProvider } from "
|
|
6526
|
+
import { DateFormat, I18nProvider } from "@baseline-ui/core";
|
|
6322
6527
|
|
|
6323
|
-
const date = "2020-01-01T00:00:00.000Z";
|
|
6528
|
+
const date = new Date("2020-01-01T00:00:00.000Z");
|
|
6324
6529
|
|
|
6325
6530
|
export default () => (
|
|
6326
6531
|
<I18nProvider locale="es">
|
|
@@ -6334,9 +6539,9 @@ The above example will render the date in Espa\xF1ol.
|
|
|
6334
6539
|
You can also format the time portion of the date.
|
|
6335
6540
|
|
|
6336
6541
|
\`\`\`jsx
|
|
6337
|
-
import { DateFormat } from "
|
|
6542
|
+
import { DateFormat } from "@baseline-ui/core";
|
|
6338
6543
|
|
|
6339
|
-
const date = "2020-01-01T00:00:00.000Z";
|
|
6544
|
+
const date = new Date("2020-01-01T00:00:00.000Z");
|
|
6340
6545
|
|
|
6341
6546
|
export default () => <DateFormat date={date} timeStyle={"full"} />;
|
|
6342
6547
|
\`\`\``,props:`interface DateFormatProps {
|
|
@@ -6654,12 +6859,6 @@ By default, the \`Dialog\` component traps focus within the dialog. This means t
|
|
|
6654
6859
|
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
6655
6860
|
| <kbd>Esc</kbd> | Close the dialog |
|
|
6656
6861
|
| <kbd>Tab</kbd> | Move focus to the next focusable element in the dialog. If focus is on the last element, move focus to the first focusable element. |`,props:`interface DialogProps {
|
|
6657
|
-
/**
|
|
6658
|
-
* The accessibility role for the dialog.
|
|
6659
|
-
*
|
|
6660
|
-
* @default 'dialog'
|
|
6661
|
-
*/
|
|
6662
|
-
role?: 'dialog' | 'alertdialog'
|
|
6663
6862
|
/**
|
|
6664
6863
|
* @deprecated Do not use in new components. This is a legacy block
|
|
6665
6864
|
* identifier; new components should exclude it via
|
|
@@ -6700,7 +6899,7 @@ children: React.ReactNode
|
|
|
6700
6899
|
/**
|
|
6701
6900
|
* The size of the dialog. This defines the max width of the dialog.
|
|
6702
6901
|
*
|
|
6703
|
-
* @default "
|
|
6902
|
+
* @default "md"
|
|
6704
6903
|
*/
|
|
6705
6904
|
size?: "sm" | "md" | "lg" | "content"
|
|
6706
6905
|
/**
|
|
@@ -7460,12 +7659,6 @@ className?: string
|
|
|
7460
7659
|
* The style applied to the root element of the component.
|
|
7461
7660
|
*/
|
|
7462
7661
|
style?: React.CSSProperties
|
|
7463
|
-
/**
|
|
7464
|
-
* The accessibility role for the dialog.
|
|
7465
|
-
*
|
|
7466
|
-
* @default 'dialog'
|
|
7467
|
-
*/
|
|
7468
|
-
role?: 'dialog' | 'alertdialog'
|
|
7469
7662
|
/**
|
|
7470
7663
|
* The children to render.
|
|
7471
7664
|
*/
|
|
@@ -7524,7 +7717,7 @@ export const DrawerWithActionExample: React.FC<{
|
|
|
7524
7717
|
Drawer Content
|
|
7525
7718
|
</Drawer>
|
|
7526
7719
|
);
|
|
7527
|
-
};`},similarTo:[],figmaUrl:null},Editor:{id:"core-miscellaneous-editor-rich-text",breadcrumb:"Core/Miscellaneous/Editor",importStatement:'import { Box, Editor, EditorAutoFocusOnMount, Separator } from "@baseline-ui/core";',description:"`Editor` is a text input area that supports either plain text or rich text with formatting, links, and @-mentions. Use it for comments, notes, descriptions, or any free-form content where users need more than a single-line input.",documentation:'`Editor` is a text input area that supports either plain text or rich text with formatting, links, and @-mentions. Use it for comments, notes, descriptions, or any free-form content where users need more than a single-line input.\n\n* supports rich text editing, including bold, italic and underline formatting.\n* supports font color and background color formatting\n* supports link creation, editing and removal\n* supports plain text editing\n* supports mouse, keyboard and touch interactions.\n* Exposed to the screen-readers and other assistive technologies using ARIA.\n* Mention support with user search and keyboard navigation\n* Keyboard shortcuts for common actions (submit, toolbar focus, help)\n* Imperative handle API (`editorHandle`) for programmatic focus and caret positioning\n* Custom footer buttons (action and toggle types)\n* Clear on save/cancel behavior\n* Auto-focus with configurable caret position\n\nYou can import the Editor component like so:\n\n```jsx\nimport { Editor } from "@baseline-ui/core";\n\nexport default function App() {\n return (\n <Editor\n aria-label="Comment"\n placeholder="Write a comment..."\n onSave={(value) => {\n console.log(value);\n }}\n />\n );\n}\n```\n\nIf you only need a single-line plain text input, use the `TextInput` component instead.\n\nThe `Editor` component has multiple variants that can be used to customize the appearance and behavior of the component.\n\n* `default` - the default variant\n* `minimal` - a minimal variant that removes the toolbar and only allows plain text editing.\n\n```jsx\n<Editor\n aria-label="Editor"\n variant="minimal"\n avatarName="John Doe"\n spellCheck={false}\n placeholder="Type something..."\n defaultValue="This is a minimal editor"\n/>\n```\n\nIn the example above, the `variant` prop is used to set the variant to `minimal`. This removes the toolbar and only allows plain text editing.\nThe first editor passes `isInline={false}`; the second one keeps the default inline rendering, which shows the avatar (set via `avatarName`) next to the input.\n\nYou can enable rich text editing by setting the `enableRichText` prop to `true`. This will enable the rich text toolbar and allow users to format the text. The default value is `false`.\n\n```jsx\n<Editor\n aria-label="Editor"\n placeholder="Placeholder"\n enableRichText\n defaultValue="<p>This is a rich editor. It supports <b>bold</b>, <i>italic</i>, and <u>underline</u>. <a href=\'https://example.com\'>Links</a> are also supported.</p><br/><p>You can set both <span style=\'color: #ac0000; background-color: #ffffff;\'>font color</span> and <span style=\'background-color: #ffff00; color: #000000;\'>background color</span>.</p>"\n/>\n```\n\nYou can set a placeholder for the editor by using the `placeholder` prop. This will display a placeholder when the editor is empty.\n\nThe `Editor` component can be controlled by using the `value` and `onChange` props together. This allows you to control the value of the editor from the parent component, in both plain text and rich text mode.\n\nFor uncontrolled usage, set the initial content with `defaultValue` and read edits via `onChange` or `onSave` \u2014 the editor manages its own state afterwards.\n\nFor backwards compatibility, passing `value` without `onChange` in rich text mode sets the initial content only (it behaves like `defaultValue`), matching the behavior of earlier versions.\n\nThe same pattern works in rich text mode \u2014 controlled rich text requires both `value` and `onChange`:\n\n```jsx\nfunction ControlledRichTextEditor() {\n const [value, setValue] = React.useState(\n "<p>This is a <b>controlled</b> rich text editor</p>",\n );\n\n return (\n <Editor\n aria-label="Editor"\n enableRichText\n placeholder="Type something..."\n value={value}\n onChange={(newValue) => {\n setValue(newValue);\n }}\n />\n );\n}\n```\n\nThe `Editor` component can be disabled by using the `isDisabled` prop. This will disable the editor and prevent users from editing the content.\n\nThe `Editor` component supports mentions. You can enable mentions by passing the `mentionableUsers` prop, an array of `MentionableUser` objects with required `id`, `name`, and `displayName` properties, plus optional `avatar` and `description`. The `id` should be unique for each user, `name` is the username matched while typing, and `displayName` is the label rendered for the mention.\nThe mentions feature only works when `enableRichText` is set to `true`. Users can start a mention by typing `@` in the editor or by pressing the mention (@) button in the footer.\n\n```jsx\n<Editor\n aria-label="Editor"\n placeholder="Placeholder"\n enableRichText\n defaultValue="Mentioning <span data-user-id=\'john-doe\'>John Doe</span>."\n mentionableUsers={[\n {\n id: "1",\n name: "john.doe",\n displayName: "John Doe",\n description: "john@gmail.com",\n },\n {\n id: "2",\n name: "jane.doe",\n displayName: "Jane Doe",\n description: "jane@gmail.com",\n },\n ]}\n/>\n```\n\nYou can add custom buttons to the footer by using the `footerButtons` prop. This prop is an array of objects of the shape `{ type: "action" | "toggle", props: {...} }`, where `props` accepts the `ActionIconButton` props (for `type: "action"`) or the `ToggleIconButton` props (for `type: "toggle"`), except `size` and `variant`, which are set by the editor.\n\n```jsx\nimport { AnonymousIcon } from "@baseline-ui/icons/16";\n\n<Editor\n aria-label="Editor"\n enableRichText\n footerButtons={[\n {\n type: "toggle",\n props: {\n "aria-label": "Save",\n icon: AnonymousIcon,\n onPress: () => {\n alert("Save");\n },\n },\n },\n ]}\n/>;\n```\n\n| Key | Function |\n| ------------------------------ | -------------------------------------------------------- |\n| `Ctrl+B` / `Cmd+B` | Toggle bold (rich text mode) |\n| `Ctrl+I` / `Cmd+I` | Toggle italic (rich text mode) |\n| `Ctrl+U` / `Cmd+U` | Toggle underline (rich text mode) |\n| `Ctrl+Z` / `Cmd+Z` | Undo (rich text mode) |\n| `Ctrl+Shift+Z` / `Cmd+Shift+Z` | Redo (rich text mode) |\n| `Ctrl+Y` | Redo (rich text mode) |\n| `@` | Start a mention (rich text mode with `mentionableUsers`) |\n| `Alt+F10` | Focus toolbar (rich text mode) |\n| `Ctrl+Enter` / `Cmd+Enter` | Submit (always) |\n| `Enter` | Submit (when `saveOnEnter` is true) |\n| `Shift+Enter` | New line |\n| `Ctrl+Shift+H` / `Cmd+Shift+H` | Open help dialog (rich text mode) |\n| `Escape` | Close mention input / help dialog |\n| `Tab` | Focus next |\n| `Shift+Tab` | Focus previous |\n\nWhen `saveOnEnter` is set to `true`, pressing the `Enter` key will submit the editor instead of creating a new line. This is useful for single-line text inputs or quick note-taking scenarios.\n\nThe `clearOnSave` and `clearOnCancel` props clear the editor content after the respective action completes. These are useful for resetting the editor after submission or cancellation.\n\nThe `autoFocus` prop allows you to focus the editor on mount with optional caret positioning:\n\n* `true` - Focus on mount, caret at default position\n* `"start"` - Focus on mount, caret at position 0\n* `"end"` - Focus on mount, caret at end of text\n\nThe `editorHandle` ref provides imperative methods for programmatic control:\n\n* `focus()` - Focus the editor\n* `setCaretPosition(index)` - Position the caret at a specific index\n\nThe `isSaveDisabled` prop disables only the save button while keeping the editor content functional. This is different from `isDisabled`, which disables both the editor and buttons.\n\nThe `maxMentionableUsersSuggestions` prop controls how many mention suggestions are displayed when the user types `@`. This is useful for large user lists where you want to limit the visible suggestions.\n\nThe `spellCheck` prop enables or disables browser spell checking in the editor.\n\nIn rich text mode, the editor includes a built-in help dialog that lists all available keyboard shortcuts (formatting, clipboard, undo/redo, submit). It opens as a modal overlay when the user presses `Ctrl+Shift+H` / `Cmd+Shift+H` while the editor has focus, and closes with `Escape` or the close button.\n\nUse the headless editor APIs when you need the rich-text engine without the default `Editor` chrome. This is useful for custom toolbars, inline editors embedded in other components, or experiences that need to render their own controls while reusing Baseline UI\'s rich-text model, keyboard shortcuts, selection handling, undo/redo, and HTML serialization.\n\n```jsx\nimport {\n EditorProvider,\n useEditable,\n useEditor,\n useEditorContext,\n} from "@baseline-ui/core";\n\nfunction FormattingToolbar() {\n const editor = useEditorContext();\n\n return (\n <button\n aria-pressed={editor.isMarkActive("bold")}\n onClick={() => editor.toggleMark("bold")}\n type="button"\n >\n Bold\n </button>\n );\n}\n\nfunction CustomRichTextEditor() {\n const editor = useEditor({\n defaultValue: "<p>Hello <b>world</b></p>",\n onChange: (html) => {\n console.log(html);\n },\n });\n const { editableProps } = useEditable(editor);\n\n return (\n <EditorProvider editor={editor}>\n <FormattingToolbar />\n <div {...editableProps} style={{ whiteSpace: "pre-wrap" }} />\n </EditorProvider>\n );\n}\n```\n\nThe headless API is split into these parts:\n\n| API | Purpose |\n| ------------------ | ------------------------------------------------------------------------ |\n| `useEditor` | Creates one rich-text editor instance and returns the `EditorState` API. |\n| `useEditable` | Attaches an `EditorState` to a `contenteditable` element. |\n| `EditorProvider` | Provides an editor instance to nested toolbar controls. |\n| `useEditorContext` | Reads the nearest provided editor instance. |\n| `EditorCore` | Framework-free engine escape hatch for advanced integrations. |\n\n`EditorState` exposes reactive state (`value`, `isEmpty`, `selectionState`, `canUndo`, `canRedo`, `isDisabled`) and imperative methods (`focus`, `setValue`, `getValue`, `undo`, `redo`, `exec`, `toggleMark`, `setMark`). For custom keyboard behavior, pass `onKeyDown` to `useEditable`; return `true` when you handled the event to skip the built-in shortcuts.\n\nStyle the editable element with `white-space: pre-wrap` (the built-in `Editor` does this internally). This preserves significant whitespace \u2014 leading, trailing, and consecutive spaces \u2014 which would otherwise collapse when the editor re-renders from its model, making a trailing space appear not to be inserted.\n\n| Selector | Description |\n| ------------------------------------------- | ----------------------------------------- |\n| `.BaselineUI-Editor` | Root container element |\n| `.BaselineUI-Editor-Save` | Save/submit button |\n| `.BaselineUI-Editor-Cancel` | Cancel button |\n| `.BaselineUI-Editor-Footer` | Footer toolbar containing action buttons |\n| `.BaselineUI-Editor-Mention` | Mention (@) button in footer |\n| `.BaselineUI-Editor-RichEditorToolbar` | Rich text formatting toolbar |\n| `.BaselineUI-Editor-RichEditorEditingArea` | Rich text contenteditable area |\n| `.BaselineUI-Editor-RichEditorPlaceholder` | Rich text empty-state placeholder overlay |\n| `.BaselineUI-Editor-PlainEditorEditingArea` | Plain text textarea element |\n\n`@baseline-ui/test-utils` ships a Playwright tester for the Editor so component and E2E specs don\'t have to relearn its markup. Build one from a frame and use its locators instead of hand-rolled selectors or translated labels:\n\n```ts\nimport { testers } from "@baseline-ui/test-utils";\n\nconst editor = testers(frame).editor();\n\nawait editor.textbox.fill("Hello");\nawait editor.boldButton.click();\nawait editor.openLinkDialog();\nawait editor.linkInput.fill("https://example.com");\nawait editor.linkAddButton.click();\nawait editor.startMention();\nawait editor.mentionOption("John Doe").click();\n```\n\nThe tester works in both modes \u2014 `textbox` resolves to the rich text contenteditable or the plain-mode `<textarea>` (both expose `role="textbox"`), and the rich-text-only surface (toolbar, link dialog, mention dropdown, help dialog) simply won\'t match when `enableRichText` is off. Pass a `root` locator when more than one Editor is mounted in the same frame:\n\n```ts\nconst editor = testers(frame).editor({\n root: frame.locator(".BaselineUI-Editor").first(),\n});\n```\n\nLocators are backed by stable `data-testid`s on the component (e.g. `editor-bold-button`, `editor-link-input`, `editor-help-dialog-close-button`) rather than accessible names, so they stay reliable across translations. The disclosure helpers (`openFontColorPicker`, `openBackgroundColorPicker`, `openLinkDialog`, `openHelpDialog`, `startMention`) are idempotent and no-op when the target surface is already open.',props:`interface EditorProps {
|
|
7720
|
+
};`},similarTo:[],figmaUrl:null},Editor:{id:"core-miscellaneous-editor-rich-text",breadcrumb:"Core/Miscellaneous/Editor",importStatement:'import { Box, Editor, EditorAutoFocusOnMount, Separator } from "@baseline-ui/core";',description:"`Editor` is a text input area that supports either plain text or rich text with formatting, links, and @-mentions. Use it for comments, notes, descriptions, or any free-form content where users need more than a single-line input.",documentation:'`Editor` is a text input area that supports either plain text or rich text with formatting, links, and @-mentions. Use it for comments, notes, descriptions, or any free-form content where users need more than a single-line input.\n\n* supports rich text editing, including bold, italic and underline formatting.\n* supports font color and background color formatting\n* supports link creation, editing and removal\n* supports plain text editing\n* supports mouse, keyboard and touch interactions.\n* Exposed to the screen-readers and other assistive technologies using ARIA.\n* Mention support with user search and keyboard navigation\n* Keyboard shortcuts for common actions (submit, toolbar focus, help)\n* Imperative handle API (`editorHandle`) for programmatic focus and caret positioning\n* Custom footer buttons (action and toggle types)\n* Clear on save/cancel behavior\n* Auto-focus with configurable caret position\n\nYou can import the Editor component like so:\n\n```jsx\nimport { Editor } from "@baseline-ui/core";\n\nexport default function App() {\n return (\n <Editor\n aria-label="Comment"\n placeholder="Write a comment..."\n onSave={(value) => {\n console.log(value);\n }}\n />\n );\n}\n```\n\nIf you only need a single-line plain text input, use the `TextInput` component instead.\n\nThe `Editor` component has multiple variants that can be used to customize the appearance and behavior of the component.\n\n* `default` - the default variant\n* `minimal` - a minimal variant that removes the toolbar and only allows plain text editing.\n\n```jsx\n<Editor\n aria-label="Editor"\n variant="minimal"\n avatarName="John Doe"\n spellCheck={false}\n placeholder="Type something..."\n defaultValue="This is a minimal editor"\n/>\n```\n\nIn the example above, the `variant` prop is used to set the variant to `minimal`. This removes the toolbar and only allows plain text editing.\nThe first editor passes `isInline={false}`; the second one keeps the default inline rendering, which shows the avatar (set via `avatarName`) next to the input.\n\nYou can enable rich text editing by setting the `enableRichText` prop to `true`. This will enable the rich text toolbar and allow users to format the text. The default value is `false`.\n\n```jsx\n<Editor\n aria-label="Editor"\n placeholder="Placeholder"\n enableRichText\n defaultValue="<p>This is a rich editor. It supports <b>bold</b>, <i>italic</i>, and <u>underline</u>. <a href=\'https://example.com\'>Links</a> are also supported.</p><br/><p>You can set both <span style=\'color: #ac0000; background-color: #ffffff;\'>font color</span> and <span style=\'background-color: #ffff00; color: #000000;\'>background color</span>.</p>"\n/>\n```\n\nYou can set a placeholder for the editor by using the `placeholder` prop. This will display a placeholder when the editor is empty.\n\nThe `Editor` component can be controlled by using the `value` and `onChange` props together. This allows you to control the value of the editor from the parent component, in both plain text and rich text mode.\n\nFor uncontrolled usage, set the initial content with `defaultValue` and read edits via `onChange` or `onSave` \u2014 the editor manages its own state afterwards.\n\nFor backwards compatibility, passing `value` without `onChange` in rich text mode sets the initial content only (it behaves like `defaultValue`), matching the behavior of earlier versions.\n\nThe same pattern works in rich text mode \u2014 controlled rich text requires both `value` and `onChange`:\n\n```jsx\nfunction ControlledRichTextEditor() {\n const [value, setValue] = React.useState(\n "<p>This is a <b>controlled</b> rich text editor</p>",\n );\n\n return (\n <Editor\n aria-label="Editor"\n enableRichText\n placeholder="Type something..."\n value={value}\n onChange={(newValue) => {\n setValue(newValue);\n }}\n />\n );\n}\n```\n\nThe `Editor` component can be disabled by using the `isDisabled` prop. This will disable the editor and prevent users from editing the content.\n\nThe `Editor` component supports mentions. You can enable mentions by passing the `mentionableUsers` prop, an array of `MentionableUser` objects with required `id`, `name`, and `displayName` properties, plus optional `avatar` and `description`. The `id` should be unique for each user, `name` is the username matched while typing, and `displayName` is the label rendered for the mention.\nThe mentions feature only works when `enableRichText` is set to `true`. Users can start a mention by typing `@` in the editor or by pressing the mention (@) button in the footer.\nPasted or dropped mentions are checked against `mentionableUsers`: a mention of a listed user takes that user\'s label, and any other mention, including every mention while `mentionableUsers` is undefined, becomes plain `@Name` text. This also applies when users cut and paste or drag a mention within the editor.\n\n```jsx\n<Editor\n aria-label="Editor"\n placeholder="Placeholder"\n enableRichText\n defaultValue="Mentioning <span data-user-id=\'john-doe\'>John Doe</span>."\n mentionableUsers={[\n {\n id: "1",\n name: "john.doe",\n displayName: "John Doe",\n description: "john@gmail.com",\n },\n {\n id: "2",\n name: "jane.doe",\n displayName: "Jane Doe",\n description: "jane@gmail.com",\n },\n ]}\n/>\n```\n\nYou can add custom buttons to the footer by using the `footerButtons` prop. This prop is an array of objects of the shape `{ type: "action" | "toggle", props: {...} }`, where `props` accepts the `ActionIconButton` props (for `type: "action"`) or the `ToggleIconButton` props (for `type: "toggle"`), except `size` and `variant`, which are set by the editor.\n\n```jsx\nimport { AnonymousIcon } from "@baseline-ui/icons/16";\n\n<Editor\n aria-label="Editor"\n enableRichText\n footerButtons={[\n {\n type: "toggle",\n props: {\n "aria-label": "Save",\n icon: AnonymousIcon,\n onPress: () => {\n alert("Save");\n },\n },\n },\n ]}\n/>;\n```\n\n| Key | Function |\n| ------------------------------ | -------------------------------------------------------- |\n| `Ctrl+B` / `Cmd+B` | Toggle bold (rich text mode) |\n| `Ctrl+I` / `Cmd+I` | Toggle italic (rich text mode) |\n| `Ctrl+U` / `Cmd+U` | Toggle underline (rich text mode) |\n| `Ctrl+Z` / `Cmd+Z` | Undo (rich text mode) |\n| `Ctrl+Shift+Z` / `Cmd+Shift+Z` | Redo (rich text mode) |\n| `Ctrl+Y` | Redo (rich text mode) |\n| `@` | Start a mention (rich text mode with `mentionableUsers`) |\n| `Alt+F10` | Focus toolbar (rich text mode) |\n| `Ctrl+Enter` / `Cmd+Enter` | Submit (always) |\n| `Enter` | Submit (when `saveOnEnter` is true) |\n| `Shift+Enter` | New line |\n| `Ctrl+Shift+H` / `Cmd+Shift+H` | Open help dialog (rich text mode) |\n| `Escape` | Close mention input / help dialog |\n| `Tab` | Focus next |\n| `Shift+Tab` | Focus previous |\n\nWhen `saveOnEnter` is set to `true`, pressing the `Enter` key will submit the editor instead of creating a new line. This is useful for single-line text inputs or quick note-taking scenarios.\n\nThe `clearOnSave` and `clearOnCancel` props clear the editor content after the respective action completes. These are useful for resetting the editor after submission or cancellation.\n\nThe `autoFocus` prop allows you to focus the editor on mount with optional caret positioning:\n\n* `true` - Focus on mount, caret at default position\n* `"start"` - Focus on mount, caret at position 0\n* `"end"` - Focus on mount, caret at end of text\n\nThe `editorHandle` ref provides imperative methods for programmatic control:\n\n* `focus()` - Focus the editor\n* `setCaretPosition(index)` - Position the caret at a specific index\n\nThe `isSaveDisabled` prop disables only the save button while keeping the editor content functional. This is different from `isDisabled`, which disables both the editor and buttons.\n\nThe `maxMentionableUsersSuggestions` prop controls how many mention suggestions are displayed when the user types `@`. This is useful for large user lists where you want to limit the visible suggestions.\n\nThe `spellCheck` prop enables or disables browser spell checking in the editor.\n\nIn rich text mode, the editor includes a built-in help dialog that lists all available keyboard shortcuts (formatting, clipboard, undo/redo, submit). It opens as a modal overlay when the user presses `Ctrl+Shift+H` / `Cmd+Shift+H` while the editor has focus, and closes with `Escape` or the close button.\n\nUse the headless editor APIs when you need the rich-text engine without the default `Editor` chrome. This is useful for custom toolbars, inline editors embedded in other components, or experiences that need to render their own controls while reusing Baseline UI\'s rich-text model, keyboard shortcuts, selection handling, undo/redo, and HTML serialization.\n\n```jsx\nimport {\n EditorProvider,\n useEditable,\n useEditor,\n useEditorContext,\n} from "@baseline-ui/core";\n\nfunction FormattingToolbar() {\n const editor = useEditorContext();\n\n return (\n <button\n aria-pressed={editor.isMarkActive("bold")}\n onClick={() => editor.toggleMark("bold")}\n type="button"\n >\n Bold\n </button>\n );\n}\n\nfunction CustomRichTextEditor() {\n const editor = useEditor({\n defaultValue: "<p>Hello <b>world</b></p>",\n onChange: (html) => {\n console.log(html);\n },\n });\n const { editableProps } = useEditable(editor);\n\n return (\n <EditorProvider editor={editor}>\n <FormattingToolbar />\n <div {...editableProps} style={{ whiteSpace: "pre-wrap" }} />\n </EditorProvider>\n );\n}\n```\n\nThe headless API is split into these parts:\n\n| API | Purpose |\n| ------------------ | ------------------------------------------------------------------------ |\n| `useEditor` | Creates one rich-text editor instance and returns the `EditorState` API. |\n| `useEditable` | Attaches an `EditorState` to a `contenteditable` element. |\n| `EditorProvider` | Provides an editor instance to nested toolbar controls. |\n| `useEditorContext` | Reads the nearest provided editor instance. |\n| `EditorCore` | Framework-free engine escape hatch for advanced integrations. |\n\n`EditorState` exposes reactive state (`value`, `isEmpty`, `selectionState`, `canUndo`, `canRedo`, `isDisabled`) and imperative methods (`focus`, `setValue`, `getValue`, `undo`, `redo`, `exec`, `toggleMark`, `setMark`). For custom keyboard behavior, pass `onKeyDown` to `useEditable`; return `true` when you handled the event to skip the built-in shortcuts.\n\nStyle the editable element with `white-space: pre-wrap` (the built-in `Editor` does this internally). This preserves significant whitespace \u2014 leading, trailing, and consecutive spaces \u2014 which would otherwise collapse when the editor re-renders from its model, making a trailing space appear not to be inserted.\n\n| Selector | Description |\n| ------------------------------------------- | ----------------------------------------- |\n| `.BaselineUI-Editor` | Root container element |\n| `.BaselineUI-Editor-Save` | Save/submit button |\n| `.BaselineUI-Editor-Cancel` | Cancel button |\n| `.BaselineUI-Editor-Footer` | Footer toolbar containing action buttons |\n| `.BaselineUI-Editor-Mention` | Mention (@) button in footer |\n| `.BaselineUI-Editor-RichEditorToolbar` | Rich text formatting toolbar |\n| `.BaselineUI-Editor-RichEditorEditingArea` | Rich text contenteditable area |\n| `.BaselineUI-Editor-RichEditorPlaceholder` | Rich text empty-state placeholder overlay |\n| `.BaselineUI-Editor-PlainEditorEditingArea` | Plain text textarea element |\n\n`@baseline-ui/test-utils` ships a Playwright tester for the Editor so component and E2E specs don\'t have to relearn its markup. Build one from a frame and use its locators instead of hand-rolled selectors or translated labels:\n\n```ts\nimport { testers } from "@baseline-ui/test-utils";\n\nconst editor = testers(frame).editor();\n\nawait editor.textbox.fill("Hello");\nawait editor.boldButton.click();\nawait editor.openLinkDialog();\nawait editor.linkInput.fill("https://example.com");\nawait editor.linkAddButton.click();\nawait editor.startMention();\nawait editor.mentionOption("John Doe").click();\n```\n\nThe tester works in both modes \u2014 `textbox` resolves to the rich text contenteditable or the plain-mode `<textarea>` (both expose `role="textbox"`), and the rich-text-only surface (toolbar, link dialog, mention dropdown, help dialog) simply won\'t match when `enableRichText` is off. Pass a `root` locator when more than one Editor is mounted in the same frame:\n\n```ts\nconst editor = testers(frame).editor({\n root: frame.locator(".BaselineUI-Editor").first(),\n});\n```\n\nLocators are backed by stable `data-testid`s on the component (e.g. `editor-bold-button`, `editor-link-input`, `editor-help-dialog-close-button`) rather than accessible names, so they stay reliable across translations. The disclosure helpers (`openFontColorPicker`, `openBackgroundColorPicker`, `openLinkDialog`, `openHelpDialog`, `startMention`) are idempotent and no-op when the target surface is already open.',props:`interface EditorProps {
|
|
7528
7721
|
/**
|
|
7529
7722
|
* @deprecated Do not use in new components. This is a legacy block
|
|
7530
7723
|
* identifier; new components should exclude it via
|
|
@@ -7657,7 +7850,9 @@ avatarName?: string
|
|
|
7657
7850
|
editableContentAriaLabel?: string
|
|
7658
7851
|
/**
|
|
7659
7852
|
* An optional array of mentionable users. Mention feature is only available
|
|
7660
|
-
* when \`enableRichText\` is set to \`true\` and this prop is provided.
|
|
7853
|
+
* when \`enableRichText\` is set to \`true\` and this prop is provided. Pasted or
|
|
7854
|
+
* dropped mentions of users not in this array, or of any user while it is
|
|
7855
|
+
* undefined, become plain text.
|
|
7661
7856
|
*
|
|
7662
7857
|
* \`\`\`tsx
|
|
7663
7858
|
* type MentionableUser = {
|
|
@@ -7693,7 +7888,7 @@ footerButtons?: (
|
|
|
7693
7888
|
/**
|
|
7694
7889
|
* The imperative handle for manipulating editor.
|
|
7695
7890
|
*/
|
|
7696
|
-
editorHandle?: React.RefObject<EditorHandle>
|
|
7891
|
+
editorHandle?: React.RefObject<EditorHandle | null>
|
|
7697
7892
|
/**
|
|
7698
7893
|
* Whether to clear the editor value when the editor is saved.
|
|
7699
7894
|
*
|
|
@@ -8009,7 +8204,12 @@ linkSaveLabel?: string
|
|
|
8009
8204
|
placeholder="Placeholder"
|
|
8010
8205
|
aria-label="Editor"
|
|
8011
8206
|
isInline={false}
|
|
8012
|
-
defaultValue="<p>Non-inline rich text editor</p>" />;`}],implementation:`import {
|
|
8207
|
+
defaultValue="<p>Non-inline rich text editor</p>" />;`}],implementation:`import {
|
|
8208
|
+
BoldIcon,
|
|
8209
|
+
InfoCircleFilledIcon,
|
|
8210
|
+
ItalicIcon,
|
|
8211
|
+
UnderlineIcon,
|
|
8212
|
+
} from "@baseline-ui/icons/16";
|
|
8013
8213
|
import React from "react";
|
|
8014
8214
|
|
|
8015
8215
|
import { ActionButton } from "../../ActionButton";
|
|
@@ -8025,7 +8225,9 @@ import {
|
|
|
8025
8225
|
useEditorContext,
|
|
8026
8226
|
} from "../headless";
|
|
8027
8227
|
|
|
8228
|
+
import type { ActionIconButtonProps } from "../../ActionIconButton";
|
|
8028
8229
|
import type { ColorPreset } from "../../ColorInput";
|
|
8230
|
+
import type { ToggleIconButtonProps } from "../../ToggleIconButton";
|
|
8029
8231
|
import type { MarkName } from "../core/commands";
|
|
8030
8232
|
import type { EditorHandle, EditorProps } from "../Editor.types";
|
|
8031
8233
|
|
|
@@ -8438,7 +8640,38 @@ export const EditorControlledPlainValueBesideInput = () => {
|
|
|
8438
8640
|
/>
|
|
8439
8641
|
</>
|
|
8440
8642
|
);
|
|
8441
|
-
}
|
|
8643
|
+
};
|
|
8644
|
+
|
|
8645
|
+
type FooterButtonWithoutIcon =
|
|
8646
|
+
| {
|
|
8647
|
+
type: "action";
|
|
8648
|
+
props: Omit<ActionIconButtonProps, "icon" | "size" | "variant">;
|
|
8649
|
+
}
|
|
8650
|
+
| {
|
|
8651
|
+
type: "toggle";
|
|
8652
|
+
props: Omit<ToggleIconButtonProps, "icon" | "size" | "variant">;
|
|
8653
|
+
};
|
|
8654
|
+
|
|
8655
|
+
export const EditorWithFooterButtonsExample: React.FC<
|
|
8656
|
+
Omit<EditorProps, "footerButtons"> & {
|
|
8657
|
+
footerButtons: FooterButtonWithoutIcon[];
|
|
8658
|
+
}
|
|
8659
|
+
> = ({ footerButtons, ...props }) => (
|
|
8660
|
+
<Editor
|
|
8661
|
+
{...props}
|
|
8662
|
+
footerButtons={footerButtons.map((button) =>
|
|
8663
|
+
button.type === "action"
|
|
8664
|
+
? {
|
|
8665
|
+
type: "action",
|
|
8666
|
+
props: { ...button.props, icon: InfoCircleFilledIcon },
|
|
8667
|
+
}
|
|
8668
|
+
: {
|
|
8669
|
+
type: "toggle",
|
|
8670
|
+
props: { ...button.props, icon: InfoCircleFilledIcon },
|
|
8671
|
+
},
|
|
8672
|
+
)}
|
|
8673
|
+
/>
|
|
8674
|
+
);`},similarTo:[],figmaUrl:null},FileInput:{id:"core-forms-fileinput",breadcrumb:"Core/Forms/FileInput",importStatement:'import { FileInput, VariantViewer } from "@baseline-ui/core";',description:"`FileInput` is a form control for selecting one or more files from the user's device. It pairs a primary button with a read-only display of the chosen file name and supports labels, helper text, validation states, and accessibility hooks consistent with `TextInput`.",documentation:'`FileInput` is a form control for selecting one or more files from the user\'s device. It pairs a primary button with a read-only display of the chosen file name and supports labels, helper text, validation states, and accessibility hooks consistent with `TextInput`.\n\n* Built on top of [React Aria\'s `FileTrigger`](https://react-spectrum.adobe.com/react-aria/FileTrigger.html), so it works with mouse, touch, and keyboard.\n* Only the button is interactive \u2014 the label, file name, and helper text are visual and wired into the button via `aria-describedby` for assistive technology.\n* Accepts an array of MIME types or file extensions via `acceptedFileTypes`, and an `allowsMultiple` flag for selecting more than one file.\n* Supports directory selection ([`acceptDirectory`](https://react-spectrum.adobe.com/react-aria/FileTrigger.html#directory-selection)) and mobile capture ([`defaultCamera`](https://react-spectrum.adobe.com/react-aria/FileTrigger.html#media-capture)) via the underlying `FileTrigger`.\n* Renders helper, warning, and error messages with the same precedence rules as the rest of the form components: error > warning > description.\n\n```jsx\nimport { FileInput } from "@baseline-ui/core";\n\n<FileInput\n label="Attachment"\n description="Supports .mov and .mp4"\n acceptedFileTypes={[".mov", ".mp4"]}\n onValueChange={(files) => console.log(files)}\n/>;\n```\n\nIf you need a drag-and-drop drop zone instead of a button trigger, use [`ImageDropZone`](/story/core-forms-imagedropzone--basic) or [`FileUploader`](/story/core-forms-fileuploader--default).\n\nPass a visible `label` for sighted users; the label is wired into the button\'s accessible description so it is announced on focus.\n\n```jsx\n<FileInput label="Attachment" description="Supports .mov and .mp4" />\n```\n\nBy default the label sits above the field. Pass `labelPosition="start"` to align it inline.\n\n```jsx\n<FileInput label="Attachment" labelPosition="start" />\n```\n\nIf the field is described by surrounding context, omit `label`. The button\'s intrinsic name (`buttonLabel`, "Choose file" by default) is still announced.\n\n```jsx\n<FileInput aria-label="Upload a file" />\n```\n\nSet `allowsMultiple` to allow more than one file. The display switches to an aggregate `"N files"` count once more than one file is selected.\n\n```jsx\n<FileInput label="Attachments" allowsMultiple onValueChange={setFiles} />\n```\n\nPass an array of MIME types or file extensions to `acceptedFileTypes`.\n\n```jsx\n<FileInput\n label="Avatar"\n acceptedFileTypes={["image/png", "image/jpeg"]}\n onValueChange={setAvatar}\n/>\n```\n\nSet `acceptDirectory` to let users pick a folder. The browser forwards every file inside the chosen directory to `onValueChange`.\n\n```jsx\n<FileInput label="Upload folder" acceptDirectory onValueChange={setFiles} />\n```\n\nSet `defaultCamera="user"` (front-facing) or `"environment"` (rear-facing) to hint that the picker should open the device\'s camera on mobile.\n\n```jsx\n<FileInput\n label="Take a photo"\n acceptedFileTypes={["image/*"]}\n defaultCamera="environment"\n/>\n```\n\nSet `autoFocus` to focus the button on mount \u2014 useful in dialogs or multi-step flows.\n\n```jsx\n<FileInput label="Attachment" autoFocus />\n```\n\nOverride `buttonLabel` and `placeholder` for non-English copy or domain-specific wording.\n\n```jsx\n<FileInput\n label="Avatar"\n buttonLabel="Browse..."\n placeholder="Drop an image here"\n/>\n```\n\nPass `validationState="warning"` and a `warningMessage` to show a non-blocking advisory.\n\n```jsx\n<FileInput\n label="Attachment"\n validationState="warning"\n warningMessage="This file format is uncommon \u2014 make sure it is supported."\n/>\n```\n\nSetting `errorMessage` flips the field into the error state and replaces the helper text. The error message takes precedence over both `description` and `warningMessage`.\n\n```jsx\n<FileInput label="Attachment" errorMessage="Please choose a supported file." />\n```\n\nDisable the field with `isDisabled`. The button cannot be activated and the displayed file name uses the disabled text color.\n\n```jsx\n<FileInput label="Attachment" isDisabled />\n```\n\n`FileInput` exposes a single callback for handling the selection:\n\n| Prop | Signature | When to use |\n| --------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `onValueChange` | `(files: File[]) => void` | Receives the parsed file list directly. When `allowsMultiple` is not set, the array has at most one entry. An empty array means the user opened and dismissed the file picker. |\n\n`FileInput` sets the following data attributes on the field wrapper. Use them to scope your custom styles.\n\n| Selector | Description |\n| ----------------------------------- | ---------------------------------------------------- |\n| `[data-disabled]` | Present when `isDisabled` is true. |\n| `[data-validation-state="error"]` | Present when an error message or error state is set. |\n| `[data-validation-state="warning"]` | Present when `validationState="warning"`. |\n| `.BaselineUI-FileInput` | Root element of the component. |\n\nTo style the button itself, target `.BaselineUI-FileInput button` or pass a class via `buttonClassName` / inline styles via `buttonStyle`.\n\n* Only the button is interactive; the label, file name, and helper text are visual elements wired into the button via `aria-describedby`.\n* The button keeps its own accessible name (`"Choose file"` by default), so screen readers announce the action on focus.\n* The visible `label`, the selected file name, and any helper/warning/error message are all referenced from the button\'s `aria-describedby`, so they are announced after the action label.\n* An externally supplied `aria-describedby` is merged with the internal IDs rather than replacing them.\n\n| Key | Action |\n| ----------------- | ----------------------------- |\n| `Tab` | Moves focus to the button. |\n| `Shift + Tab` | Moves focus out of the field. |\n| `Space` / `Enter` | Opens the system file picker. |',props:`interface FileInputProps {
|
|
8442
8675
|
/**
|
|
8443
8676
|
* The description to display below the input.
|
|
8444
8677
|
*/
|
|
@@ -8451,30 +8684,6 @@ errorMessage?: string
|
|
|
8451
8684
|
* The warning message to display when the input is in a warning state.
|
|
8452
8685
|
*/
|
|
8453
8686
|
warningMessage?: string
|
|
8454
|
-
/**
|
|
8455
|
-
* Specifies what mime type of files are allowed.
|
|
8456
|
-
*/
|
|
8457
|
-
acceptedFileTypes?: ReadonlyArray<string>
|
|
8458
|
-
/**
|
|
8459
|
-
* Whether multiple files can be selected.
|
|
8460
|
-
*/
|
|
8461
|
-
allowsMultiple?: boolean
|
|
8462
|
-
/**
|
|
8463
|
-
* Specifies the use of a media capture mechanism to capture the media on the spot.
|
|
8464
|
-
*/
|
|
8465
|
-
defaultCamera?: 'user' | 'environment'
|
|
8466
|
-
/**
|
|
8467
|
-
* Handler when a user selects a file.
|
|
8468
|
-
*/
|
|
8469
|
-
onSelect?: (files: FileList | null) => void
|
|
8470
|
-
/**
|
|
8471
|
-
* The children of the component.
|
|
8472
|
-
*/
|
|
8473
|
-
children?: ReactNode
|
|
8474
|
-
/**
|
|
8475
|
-
* Enables the selection of directories instead of individual files.
|
|
8476
|
-
*/
|
|
8477
|
-
acceptDirectory?: boolean
|
|
8478
8687
|
/**
|
|
8479
8688
|
* The id applied to the root element of the component.
|
|
8480
8689
|
*/
|
|
@@ -8852,7 +9061,9 @@ export const manyItems: FileListItem[] = Array.from({ length: 12 }, (_, i) => ({
|
|
|
8852
9061
|
|
|
8853
9062
|
// Swaps in a new array whose items carry new content, which is the only way a caller can
|
|
8854
9063
|
// legitimately invalidate the memoised options.
|
|
8855
|
-
export const UploadingFileList: React.FC = (
|
|
9064
|
+
export const UploadingFileList: React.FC<{ errorMessage?: string }> = ({
|
|
9065
|
+
errorMessage,
|
|
9066
|
+
}) => {
|
|
8856
9067
|
const [items, setItems] = React.useState<FileListItem[]>(loadingItems);
|
|
8857
9068
|
|
|
8858
9069
|
return (
|
|
@@ -8861,7 +9072,7 @@ export const UploadingFileList: React.FC = () => {
|
|
|
8861
9072
|
label="Finish upload"
|
|
8862
9073
|
onPress={() => {
|
|
8863
9074
|
setItems((prev) =>
|
|
8864
|
-
prev.map((item) => ({ ...item, isLoading: false })),
|
|
9075
|
+
prev.map((item) => ({ ...item, isLoading: false, errorMessage })),
|
|
8865
9076
|
);
|
|
8866
9077
|
}}
|
|
8867
9078
|
/>
|
|
@@ -9861,7 +10072,7 @@ canvasStyle?: React.CSSProperties
|
|
|
9861
10072
|
/**
|
|
9862
10073
|
* The ref for the canvas.
|
|
9863
10074
|
*/
|
|
9864
|
-
canvasRef?: React.RefObject<HTMLDivElement>
|
|
10075
|
+
canvasRef?: React.RefObject<HTMLDivElement | null>
|
|
9865
10076
|
/**
|
|
9866
10077
|
* The className applicable to the footer.
|
|
9867
10078
|
*/
|
|
@@ -10599,7 +10810,7 @@ export const EditableGridListExample: React.FC<GridListExampleProps> = (
|
|
|
10599
10810
|
</button>
|
|
10600
10811
|
</>
|
|
10601
10812
|
);
|
|
10602
|
-
};`},similarTo:[],figmaUrl:null},Group:{id:"core-utilities-group",breadcrumb:"Core/Utilities/Group",importStatement:'import { ActionButton, Group } from "@baseline-ui/core";',description:"`Group` is a container that exposes a set of related UI controls as a single labelled unit to assistive technology. Use it to associate adjacent controls like toolbars or button clusters under a shared accessible label.",documentation:'`Group` is a container that exposes a set of related UI controls as a single labelled unit to assistive technology. Use it to associate adjacent controls like toolbars or button clusters under a shared accessible label.\n\n```jsx\nimport { Group, ActionButton } from "../../utils";\n\n<Group>\n <ActionButton label="Label 1" />\n <ActionButton label="Label 2" />\n <ActionButton label="Label 3" />\n</Group>;\n```\n\nThe Group component in the given file path accepts the `aria-label` and `aria-labelledby` attributes to provide an accessible label to the group as a whole. These attributes are read by assistive technology when navigating into the group from outside. It is recommended to use an additional label for the group when the labels of each child element do not provide sufficient context on their own.\n\n```jsx\n<span id="label-id">Label</span>\n<Group aria-labelledby="label-id">\n {/* ... */}\n</Group>\n```\n\nBy default, `Group` uses the `group` ARIA role. If the contents of the group is important enough to be included in the page table of contents, use `role="region"` instead, and ensure that an aria-label or `aria-labelledby` prop is assigned.\n\n```jsx\n<Group role="region" aria-label="Object details">\n {/* ... */}\n</Group>\n```\n\n```\n```',props:`interface GroupProps {
|
|
10813
|
+
};`},similarTo:[],figmaUrl:null},Group:{id:"core-utilities-group",breadcrumb:"Core/Utilities/Group",importStatement:'import { ActionButton, Group } from "@baseline-ui/core";',description:"`Group` is a container that exposes a set of related UI controls as a single labelled unit to assistive technology. Use it to associate adjacent controls like toolbars or button clusters under a shared accessible label.",documentation:'`Group` is a container that exposes a set of related UI controls as a single labelled unit to assistive technology. Use it to associate adjacent controls like toolbars or button clusters under a shared accessible label.\n\n```jsx\nimport { Group, ActionButton } from "../../utils";\n\n<Group>\n <ActionButton label="Label 1" />\n <ActionButton label="Label 2" />\n <ActionButton label="Label 3" />\n</Group>;\n```\n\nThe Group component in the given file path accepts the `aria-label` and `aria-labelledby` attributes to provide an accessible label to the group as a whole. These attributes are read by assistive technology when navigating into the group from outside. It is recommended to use an additional label for the group when the labels of each child element do not provide sufficient context on their own.\n\n```jsx\n<span id="label-id">Label</span>\n<Group aria-labelledby="label-id">\n {/* ... */}\n</Group>\n```\n\nBy default, `Group` uses the `group` ARIA role. If the contents of the group is important enough to be included in the page table of contents, use `role="region"` instead, and ensure that an aria-label or `aria-labelledby` prop is assigned.\n\n```jsx\n<Group role="region" aria-label="Object details">\n {/* ... */}\n</Group>\n```\n\n| Selector | Description |\n| --------------- | ---------------------------------------------------- |\n| \\[data-disabled] | Whether the group is disabled. |\n| \\[data-hovered] | Whether the group is currently hovered with a mouse. |\n\n```\n```',props:`interface GroupProps {
|
|
10603
10814
|
/**
|
|
10604
10815
|
* @deprecated Do not use in new components. This is a legacy block
|
|
10605
10816
|
* identifier; new components should exclude it via
|
|
@@ -11544,11 +11755,13 @@ const SCALE_FACTOR = 1.5;
|
|
|
11544
11755
|
|
|
11545
11756
|
export function ImageGalleryExample({
|
|
11546
11757
|
onDelete,
|
|
11758
|
+
ancestorKey,
|
|
11547
11759
|
...props
|
|
11548
11760
|
}: Omit<React.ComponentProps<typeof ImageGallery>, "onDelete"> & {
|
|
11549
11761
|
onDelete?: (keys: Key[]) => void;
|
|
11762
|
+
ancestorKey?: string;
|
|
11550
11763
|
}) {
|
|
11551
|
-
|
|
11764
|
+
const gallery = (
|
|
11552
11765
|
<ImageGallery
|
|
11553
11766
|
{...props}
|
|
11554
11767
|
onDelete={
|
|
@@ -11560,6 +11773,8 @@ export function ImageGalleryExample({
|
|
|
11560
11773
|
}
|
|
11561
11774
|
/>
|
|
11562
11775
|
);
|
|
11776
|
+
|
|
11777
|
+
return ancestorKey ? <div data-key={ancestorKey}>{gallery}</div> : gallery;
|
|
11563
11778
|
}
|
|
11564
11779
|
|
|
11565
11780
|
export function CustomSizeImageGalleryExample({
|
|
@@ -11845,7 +12060,11 @@ export function MountEffectScrollIntoViewImageGalleryExample() {
|
|
|
11845
12060
|
// Counts \`renderImage\` calls so a spec can prove that a re-render which changes nothing
|
|
11846
12061
|
// the gallery reads does not throw away the list box's cached options. \`Report\` publishes
|
|
11847
12062
|
// the tally taken *before* its own render, so two clicks bracket exactly one re-render.
|
|
11848
|
-
export function RenderCountingImageGalleryExample(
|
|
12063
|
+
export function RenderCountingImageGalleryExample({
|
|
12064
|
+
isControlled = false,
|
|
12065
|
+
}: {
|
|
12066
|
+
isControlled?: boolean;
|
|
12067
|
+
}) {
|
|
11849
12068
|
const calls = React.useRef(0);
|
|
11850
12069
|
const [reported, setReported] = React.useState(0);
|
|
11851
12070
|
|
|
@@ -11866,7 +12085,11 @@ export function RenderCountingImageGalleryExample() {
|
|
|
11866
12085
|
}}
|
|
11867
12086
|
/>
|
|
11868
12087
|
<Text data-testid="render-count">{reported.toString()}</Text>
|
|
12088
|
+
{isControlled ? (
|
|
12089
|
+
<ImageGallery items={items} renderImage={renderImage} />
|
|
12090
|
+
) : (
|
|
11869
12091
|
<ImageGallery defaultItems={items} renderImage={renderImage} />
|
|
12092
|
+
)}
|
|
11870
12093
|
</Box>
|
|
11871
12094
|
);
|
|
11872
12095
|
}
|
|
@@ -12916,10 +13139,13 @@ export const items = [
|
|
|
12916
13139
|
|
|
12917
13140
|
export const InlineToolbarExample = ({
|
|
12918
13141
|
children,
|
|
13142
|
+
itemsAsFunction,
|
|
12919
13143
|
...args
|
|
12920
|
-
}: Partial<React.ComponentProps<typeof InlineToolbar>>
|
|
13144
|
+
}: Partial<React.ComponentProps<typeof InlineToolbar>> & {
|
|
13145
|
+
itemsAsFunction?: boolean;
|
|
13146
|
+
}) => {
|
|
12921
13147
|
return (
|
|
12922
|
-
<InlineToolbar {...args} items={items}>
|
|
13148
|
+
<InlineToolbar {...args} items={itemsAsFunction ? () => items : items}>
|
|
12923
13149
|
{React.Children.count(children) > 0 ? (
|
|
12924
13150
|
children!
|
|
12925
13151
|
) : (
|
|
@@ -13007,6 +13233,11 @@ shouldUseSymbol?: boolean
|
|
|
13007
13233
|
</Box>
|
|
13008
13234
|
</Box>
|
|
13009
13235
|
);`}],implementation:""},similarTo:[],figmaUrl:null},Link:{id:"core-navigation-link",breadcrumb:"Core/Navigation/Link",importStatement:'import { Link, VariantViewer } from "@baseline-ui/core";',description:"`Link` is a styled anchor for navigating between pages, sections, or external destinations. Use it for inline or standalone navigation targets that should look and behave like hyperlinks.",documentation:'`Link` is a styled anchor for navigating between pages, sections, or external destinations. Use it for inline or standalone navigation targets that should look and behave like hyperlinks.\n\n```jsx\nimport { Link } from "../../utils";\n\n<Link href="https://www.nutrient.io/">Nutrient</Link>;\n```\n\nThe `Link` component comes in three sizes: `small`, `medium`, and `large`.\n\n```jsx\nimport { Link } from "../../utils";\n\n<Link href="https://www.nutrient.io/sdk/" size="small">\n Small link\n</Link>\n<Link href="https://www.nutrient.io/sdk/" size="medium">\n Medium link\n</Link>\n<Link href="https://www.nutrient.io/sdk/" size="large">\n Large link\n</Link>\n```\n\nThe `Link` component comes in two variants: `default` and `inline`.\n\n```jsx\nimport { Link } from "../../utils";\n\n<Link href="https://www.nutrient.io/sdk/">Default link</Link>\n<Link href="https://www.nutrient.io/sdk/" variant="inline">\n Inline link\n</Link>\n```\n\nThe `Link` component can be disabled by setting the `isDisabled` prop to `true`. This will disable the link and prevent it from being clicked but will still allow keyboard navigation.\n\n```jsx\nimport { Link } from "../../utils";\n\n<Link href="https://www.nutrient.io/sdk/" isDisabled>\n Disabled link\n</Link>;\n```\n\nYou can also use press handlers to handle client-side actions. For example, you can use the `onPress` handler to handle a click event. In the example below, we use the `onPress` handler to create an alert. We use the `span` element instead of the `a` element to prevent the page from navigating. Proper ARIA attributes are added to the `span` element to make it accessible.\n\n```jsx\nimport { Link } from "../../utils";\n\n<Link onPress={() => alert("Link clicked")} elementType="span">\n Click me to see an alert\n</Link>;\n```\n\nThe `Link` component is rendered as an `<a>` element, so it\u2019s accessible by default. However, you can also use the `onPress` handler to handle client-side actions.\n\nSome of the accessibility features of the `Link` component are that it supports:\n\n* Mouse, keyboard, and touch interactions\n* Navigation links using `<a>` elements or client-side actions using custom handlers\n* The disabled state\n\n| Key | Function |\n| ----- | ------------------- |\n| Enter | Activates the link. |\n\n```\n```',props:`interface LinkProps {
|
|
13236
|
+
/**
|
|
13237
|
+
* Indicates whether this element represents the current item within a container or set of related
|
|
13238
|
+
* elements.
|
|
13239
|
+
*/
|
|
13240
|
+
aria-current?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time'
|
|
13010
13241
|
/**
|
|
13011
13242
|
* Whether the link is disabled.
|
|
13012
13243
|
*/
|
|
@@ -13198,7 +13429,9 @@ renderOption?: (
|
|
|
13198
13429
|
ref: React.Ref<HTMLLIElement>,
|
|
13199
13430
|
) => React.ReactNode
|
|
13200
13431
|
/**
|
|
13201
|
-
* Renders the drop indicator component.
|
|
13432
|
+
* Renders the drop indicator component. It is called before each item and
|
|
13433
|
+
* after the last one, whether or not a drag is in progress, and must return
|
|
13434
|
+
* \`null\` when \`isHidden\` is true.
|
|
13202
13435
|
*/
|
|
13203
13436
|
renderDropIndicator?: (
|
|
13204
13437
|
options: {
|
|
@@ -13277,7 +13510,7 @@ withSectionHeaderPadding?: boolean
|
|
|
13277
13510
|
/**
|
|
13278
13511
|
* Handle to access the listbox methods.
|
|
13279
13512
|
*/
|
|
13280
|
-
listBoxHandle?: React.RefObject<ListHandle>
|
|
13513
|
+
listBoxHandle?: React.RefObject<ListHandle | null>
|
|
13281
13514
|
}`,stories:{usage:[{id:"core-collections-listbox--basic",name:"Basic",snippet:`const Basic = () => <ListBox
|
|
13282
13515
|
items={items}
|
|
13283
13516
|
aria-label="List box"
|
|
@@ -13540,8 +13773,10 @@ export const ListBoxWithSectionsExample: React.FC<
|
|
|
13540
13773
|
};
|
|
13541
13774
|
|
|
13542
13775
|
export const DragAndDropListBoxExample: React.FC<
|
|
13543
|
-
Omit<React.ComponentProps<typeof ListBox>, "items" | "onReorder">
|
|
13544
|
-
|
|
13776
|
+
Omit<React.ComponentProps<typeof ListBox>, "items" | "onReorder"> & {
|
|
13777
|
+
customDropIndicator?: boolean;
|
|
13778
|
+
}
|
|
13779
|
+
> = ({ orientation, layout, customDropIndicator, ...rest }) => {
|
|
13545
13780
|
const list = useListData({
|
|
13546
13781
|
initialItems: Array.from({ length: 20 }).map((_, i) => ({
|
|
13547
13782
|
id: \`item-\${i}\`,
|
|
@@ -13622,6 +13857,15 @@ export const DragAndDropListBoxExample: React.FC<
|
|
|
13622
13857
|
</li>
|
|
13623
13858
|
);
|
|
13624
13859
|
}}
|
|
13860
|
+
{...(customDropIndicator && {
|
|
13861
|
+
renderDropIndicator: (options, ref) => (
|
|
13862
|
+
<li
|
|
13863
|
+
ref={ref}
|
|
13864
|
+
{...options.dropIndicatorProps}
|
|
13865
|
+
data-testid="custom-drop-indicator"
|
|
13866
|
+
/>
|
|
13867
|
+
),
|
|
13868
|
+
})}
|
|
13625
13869
|
enableReorder={true}
|
|
13626
13870
|
items={list.items}
|
|
13627
13871
|
onReorder={onReorder}
|
|
@@ -14177,25 +14421,9 @@ Each menu item exposes the standard React Aria interaction-state attributes, and
|
|
|
14177
14421
|
| \`A\`\u2013\`Z\` | Typeahead \u2014 focuses the next item starting with the typed letters. |
|
|
14178
14422
|
| \`ArrowRight\` | Opens the focused submenu (\`ArrowLeft\` in RTL). |
|
|
14179
14423
|
| \`ArrowLeft\` | Closes the current submenu and returns focus to its trigger (\`ArrowRight\` in RTL). |
|
|
14180
|
-
| \`Escape\` | Closes the menu (or the current submenu level).
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
*/
|
|
14184
|
-
isOpen?: boolean
|
|
14185
|
-
/**
|
|
14186
|
-
* Whether the overlay is open by default (uncontrolled).
|
|
14187
|
-
*/
|
|
14188
|
-
defaultOpen?: boolean
|
|
14189
|
-
/**
|
|
14190
|
-
* Handler that is called when the overlay's open state changes.
|
|
14191
|
-
*/
|
|
14192
|
-
onOpenChange?: (isOpen: boolean) => void
|
|
14193
|
-
/**
|
|
14194
|
-
* How the menu is triggered.
|
|
14195
|
-
*
|
|
14196
|
-
* @default 'press'
|
|
14197
|
-
*/
|
|
14198
|
-
trigger?: 'press' | 'longPress'
|
|
14424
|
+
| \`Escape\` | Closes the menu (or the current submenu level). |
|
|
14425
|
+
|
|
14426
|
+
With \`trigger="longPress"\`, \`Enter\`, \`Space\`, \`ArrowDown\` and \`ArrowUp\` do not open the menu from the trigger; hold \`Alt\` with any of them instead.`,props:`interface MenuProps {
|
|
14199
14427
|
/**
|
|
14200
14428
|
* The custom render function for the collection's options.
|
|
14201
14429
|
*
|
|
@@ -14229,6 +14457,13 @@ optionStyle?: | React.CSSProperties
|
|
|
14229
14457
|
item: TOption,
|
|
14230
14458
|
renderProps: TRenderProps,
|
|
14231
14459
|
) => React.CSSProperties | undefined)
|
|
14460
|
+
/**
|
|
14461
|
+
* How the menu is opened from its trigger. With \`"longPress"\`, a long press
|
|
14462
|
+
* or \`Alt\` + \`ArrowDown\` / \`ArrowUp\` / \`Enter\` / \`Space\` opens the menu.
|
|
14463
|
+
*
|
|
14464
|
+
* @default "press"
|
|
14465
|
+
*/
|
|
14466
|
+
trigger?: "press" | "longPress"
|
|
14232
14467
|
/**
|
|
14233
14468
|
* The \`className\` property assigned to the root element of the component.
|
|
14234
14469
|
*/
|
|
@@ -17301,7 +17536,29 @@ export const TrailingElementExample = () => {
|
|
|
17301
17536
|
</PointPickerContent>
|
|
17302
17537
|
</PointPicker>
|
|
17303
17538
|
);
|
|
17304
|
-
}
|
|
17539
|
+
};
|
|
17540
|
+
|
|
17541
|
+
export const RenderCursorExample: React.FC<{
|
|
17542
|
+
cursor: "custom" | "default" | "none";
|
|
17543
|
+
onRenderCursor: (
|
|
17544
|
+
options: Parameters<
|
|
17545
|
+
NonNullable<PointPickerContentProps["renderCursor"]>
|
|
17546
|
+
>[0],
|
|
17547
|
+
) => void;
|
|
17548
|
+
}> = ({ cursor, onRenderCursor }) => (
|
|
17549
|
+
<PointPicker>
|
|
17550
|
+
<PointPickerDisplay />
|
|
17551
|
+
<PointPickerContent
|
|
17552
|
+
renderCursor={(options) => {
|
|
17553
|
+
onRenderCursor(options);
|
|
17554
|
+
if (cursor === "custom") return <div>custom cursor</div>;
|
|
17555
|
+
return cursor === "none" ? null : undefined;
|
|
17556
|
+
}}
|
|
17557
|
+
>
|
|
17558
|
+
<div style={{ width: 200, height: 200 }}>Test content</div>
|
|
17559
|
+
</PointPickerContent>
|
|
17560
|
+
</PointPicker>
|
|
17561
|
+
);`},similarTo:[],figmaUrl:null},Popover:{id:"core-overlays-popover",breadcrumb:"Core/Overlays/Popover",importStatement:`import {
|
|
17305
17562
|
ActionButton,
|
|
17306
17563
|
Box,
|
|
17307
17564
|
Popover,
|
|
@@ -18800,38 +19057,7 @@ className?: string
|
|
|
18800
19057
|
* The style applied to the root element of the component.
|
|
18801
19058
|
*/
|
|
18802
19059
|
style?: React.CSSProperties
|
|
18803
|
-
}`,stories:{usage:[{id:"core-utilities-portal--basic",name:"Basic",snippet:"const Basic = () => <Portal>I am in a portal</Portal>;"}],implementation:""},similarTo:[],figmaUrl:null},Preview:{id:"core-content-preview",breadcrumb:"Core/Content/Preview",importStatement:'import { InkSvg, Preview, VariantViewer } from "@baseline-ui/core";',description:"`Preview` renders a thumbnail of an image, SVG, or text snippet with optional action buttons overlaid on it. Use it to surface a visual sample of an asset that the user can inspect or act on without opening the full item.",documentation
|
|
18804
|
-
|
|
18805
|
-
* Supports SVG, images and text
|
|
18806
|
-
* Supports custom action buttons to interact with the preview
|
|
18807
|
-
* Exposed to assistive technologies using ARIA attributes
|
|
18808
|
-
* Supports keyboard, mouse and touch interactions
|
|
18809
|
-
|
|
18810
|
-
\`\`\`jsx
|
|
18811
|
-
import { Preview } from "@storybook/addon-docs/blocks";
|
|
18812
|
-
|
|
18813
|
-
<Preview imageSrc="/portrait.png" />;
|
|
18814
|
-
\`\`\`
|
|
18815
|
-
|
|
18816
|
-
The \`Preview\` component has two variants. The two variants only differ in styling. It can be controlled using the \`isInline\` prop.
|
|
18817
|
-
|
|
18818
|
-
The \`Preview\` component can be disabled. When disabled, the preview is not interactive and the action buttons are not rendered.
|
|
18819
|
-
|
|
18820
|
-
| Selector | Description |
|
|
18821
|
-
| -------------------- | ----------------------------------------------------------------- |
|
|
18822
|
-
| \\[data-disabled] | Whether the component is disabled. |
|
|
18823
|
-
| \\[data-focused] | Whether the component is focused, either via a mouse or keyboard. |
|
|
18824
|
-
| \\[data-hovered] | Whether the component is currently hovered with a mouse. |
|
|
18825
|
-
| \\[data-focus-visible] | Whether the component is keyboard focused. |
|
|
18826
|
-
|
|
18827
|
-
| Key | Function |
|
|
18828
|
-
| ------------ | -------------------------------- |
|
|
18829
|
-
| \`Tab\` | Focus the preview |
|
|
18830
|
-
| \`ArrowLeft\` | Focus the previous action button |
|
|
18831
|
-
| \`ArrowRight\` | Focus the next action button |
|
|
18832
|
-
|
|
18833
|
-
\`\`\`
|
|
18834
|
-
\`\`\``,props:`interface PreviewProps {
|
|
19060
|
+
}`,stories:{usage:[{id:"core-utilities-portal--basic",name:"Basic",snippet:"const Basic = () => <Portal>I am in a portal</Portal>;"}],implementation:""},similarTo:[],figmaUrl:null},Preview:{id:"core-content-preview",breadcrumb:"Core/Content/Preview",importStatement:'import { InkSvg, Preview, VariantViewer } from "@baseline-ui/core";',description:"`Preview` renders a thumbnail of an image, SVG, or text snippet with optional action buttons overlaid on it. Use it to surface a visual sample of an asset that the user can inspect or act on without opening the full item.",documentation:'`Preview` renders a thumbnail of an image, SVG, or text snippet with optional action buttons overlaid on it. Use it to surface a visual sample of an asset that the user can inspect or act on without opening the full item.\n\n* Supports SVG, images and text\n* Supports custom action buttons to interact with the preview\n* Exposed to assistive technologies using ARIA attributes\n* Supports keyboard, mouse and touch interactions\n\n```jsx\nimport { Preview } from "@storybook/addon-docs/blocks";\n\n<Preview imageSrc="/portrait.png" />;\n```\n\n`svgSrc` accepts a React element or an SVG string. A string is sanitized before it is rendered: scripts, event handlers and `javascript:` URLs are removed, along with elements such as `use`, `animate`, `set` and `foreignObject`. Sprite icons that reference a symbol with `<use href="#id">` therefore render blank; pass a React element to render them. A string SVG is rendered after the component mounts, so server-rendered HTML contains an empty preview that fills in on the client.\n\nThe `Preview` component has two variants. The two variants only differ in styling. It can be controlled using the `isInline` prop.\n\nThe `Preview` component can be disabled. When disabled, the preview is not interactive and the action buttons are not rendered.\n\n| Selector | Description |\n| -------------------- | ----------------------------------------------------------------- |\n| \\[data-disabled] | Whether the component is disabled. |\n| \\[data-focused] | Whether the component is focused, either via a mouse or keyboard. |\n| \\[data-hovered] | Whether the component is currently hovered with a mouse. |\n| \\[data-focus-visible] | Whether the component is keyboard focused. |\n\n| Key | Function |\n| ------------ | -------------------------------- |\n| `Tab` | Focus the preview |\n| `ArrowLeft` | Focus the previous action button |\n| `ArrowRight` | Focus the next action button |\n\n```\n```',props:`interface PreviewProps {
|
|
18835
19061
|
/**
|
|
18836
19062
|
* @deprecated Do not use in new components. This is a legacy block
|
|
18837
19063
|
* identifier; new components should exclude it via
|
|
@@ -18883,6 +19109,10 @@ imageSrc?: string
|
|
|
18883
19109
|
imageAlt?: string
|
|
18884
19110
|
/**
|
|
18885
19111
|
* The SVG to display in the preview. This can be a React element or a string.
|
|
19112
|
+
* String SVGs are sanitized with DOMPurify's default profile, which removes
|
|
19113
|
+
* scripts, event handlers and elements such as \`use\` (so \`<use href="#id">\`
|
|
19114
|
+
* sprite icons render blank), \`animate\`, \`set\` and \`foreignObject\`. Pass a
|
|
19115
|
+
* React element to render those. String SVGs render after mount.
|
|
18886
19116
|
*/
|
|
18887
19117
|
svgSrc?: string | React.JSX.Element
|
|
18888
19118
|
/**
|
|
@@ -19162,7 +19392,22 @@ errorMessage?: string
|
|
|
19162
19392
|
label="Label"
|
|
19163
19393
|
value={50}
|
|
19164
19394
|
formatOptions={{ style: "currency", currency: "USD" }}
|
|
19165
|
-
showValue />;`},{id:"core-status-progressbar--with-custom-value-label",name:"With Custom Value Label",snippet:'const WithCustomValueLabel = () => <ProgressBar label="Label" value={50} valueLabel="50 out of 100" showValue />;'}],implementation
|
|
19395
|
+
showValue />;`},{id:"core-status-progressbar--with-custom-value-label",name:"With Custom Value Label",snippet:'const WithCustomValueLabel = () => <ProgressBar label="Label" value={50} valueLabel="50 out of 100" showValue />;'}],implementation:`import React from "react";
|
|
19396
|
+
|
|
19397
|
+
import { ProgressBar } from "../ProgressBar";
|
|
19398
|
+
|
|
19399
|
+
import type { ProgressBarProps } from "../ProgressBar.types";
|
|
19400
|
+
|
|
19401
|
+
export const ProgressBarWithExternalHint: React.FC<ProgressBarProps> = (
|
|
19402
|
+
props,
|
|
19403
|
+
) => {
|
|
19404
|
+
return (
|
|
19405
|
+
<>
|
|
19406
|
+
<span id="external-hint">External hint</span>
|
|
19407
|
+
<ProgressBar aria-describedby="external-hint" {...props} />
|
|
19408
|
+
</>
|
|
19409
|
+
);
|
|
19410
|
+
};`},similarTo:[],figmaUrl:null},ProgressSpinner:{id:"core-status-progressspinner",breadcrumb:"Core/Status/ProgressSpinner",importStatement:'import { ProgressSpinner, VariantViewer } from "@baseline-ui/core";',description:"`ProgressSpinner` is an animated indicator that signals an ongoing operation of indeterminate duration. Use it when the user is waiting on a task and you can't report a meaningful percentage of completion.",documentation:'`ProgressSpinner` is an animated indicator that signals an ongoing operation of indeterminate duration. Use it when the user is waiting on a task and you can\'t report a meaningful percentage of completion.\n\n```jsx\nimport { ProgressSpinner } from "../../utils";\n\n<ProgressSpinner aria-label={"Label"} />;\n```\n\nThe `ProgressSpinner` component comes in four variants: `active`, `inactive`, `success` and `error`. The default variant is `active`.\n\n```jsx\nimport { ProgressSpinner } from "../../utils";\n\n<ProgressSpinner aria-label={"Label"} />\n<ProgressSpinner aria-label={"Label"} variant={"inactive"} />\n<ProgressSpinner aria-label={"Label"} variant={"success"} />\n<ProgressSpinner aria-label={"Label"} variant={"error"} />\n```\n\nThe `ProgressSpinner` component comes in two sizes: `sm` and `md`. The default size is `md`.\n\n```jsx\nimport { ProgressSpinner } from "../../utils";\n\n<ProgressSpinner aria-label={"Label"} size={"sm"} />\n<ProgressSpinner aria-label={"Label"} size={"md"} />\n```\n\nYou can provide a label to the `ProgressSpinner` component using the `label` prop.\n\n```jsx\nimport { ProgressSpinner } from "../../utils";\n\n<ProgressSpinner aria-label={"Label"} label={"Label"} />;\n<ProgressSpinner aria-label={"Label"} label={"Label"} size={"sm"} />;\n```',props:`interface ProgressSpinnerProps {
|
|
19166
19411
|
/**
|
|
19167
19412
|
* @deprecated Do not use in new components. This is a legacy block
|
|
19168
19413
|
* identifier; new components should exclude it via
|
|
@@ -19483,6 +19728,7 @@ import React from "react";
|
|
|
19483
19728
|
|
|
19484
19729
|
import { ColorSwatch } from "../../ColorSwatch";
|
|
19485
19730
|
import { RadioGroup, type RadioGroupProps } from "../../RadioGroup";
|
|
19731
|
+
import { items } from "./data";
|
|
19486
19732
|
|
|
19487
19733
|
import type { ListOption } from "../../ListBox";
|
|
19488
19734
|
|
|
@@ -19513,7 +19759,16 @@ export const CustomRenderItem: React.FC<Omit<RadioGroupProps, "items">> = (
|
|
|
19513
19759
|
return (
|
|
19514
19760
|
<RadioGroup items={colorItems} renderOption={colorRenderItem} {...props} />
|
|
19515
19761
|
);
|
|
19516
|
-
}
|
|
19762
|
+
};
|
|
19763
|
+
|
|
19764
|
+
export const RadioGroupWithNextFocusable: React.FC<
|
|
19765
|
+
Omit<RadioGroupProps, "items">
|
|
19766
|
+
> = (props) => (
|
|
19767
|
+
<>
|
|
19768
|
+
<RadioGroup items={items} {...props} />
|
|
19769
|
+
<button>After</button>
|
|
19770
|
+
</>
|
|
19771
|
+
);`},similarTo:[],figmaUrl:null},Reaction:{id:"core-buttons-reaction",breadcrumb:"Core/Buttons/Reaction",importStatement:'import { Reaction, VariantViewer } from "@baseline-ui/core";',description:"`Reaction` is a toggleable button paired with a count that lets users add or remove a reaction to a post or comment. Use it when surfacing lightweight social affordances such as likes, emoji responses, or upvotes.",documentation:`\`Reaction\` is a toggleable button paired with a count that lets users add or remove a reaction to a post or comment. Use it when surfacing lightweight social affordances such as likes, emoji responses, or upvotes.
|
|
19517
19772
|
|
|
19518
19773
|
* It is exposed as a input checkbox via ARIA
|
|
19519
19774
|
* It has mouse, keyboard, and touch support
|
|
@@ -19763,9 +20018,9 @@ style?: React.CSSProperties
|
|
|
19763
20018
|
/**
|
|
19764
20019
|
* The ref to the scrollable element.
|
|
19765
20020
|
*
|
|
19766
|
-
* @default document
|
|
20021
|
+
* @default the page scroller (the document, or the body when it scrolls)
|
|
19767
20022
|
*/
|
|
19768
|
-
scrollRef?: React.RefObject<HTMLElement>
|
|
20023
|
+
scrollRef?: React.RefObject<HTMLElement | null>
|
|
19769
20024
|
/**
|
|
19770
20025
|
* Indicates whether the button should be hidden when the keyboard is being
|
|
19771
20026
|
* used.
|
|
@@ -21428,7 +21683,17 @@ numberInputStyle?: NumberInputProps["style"]
|
|
|
21428
21683
|
label="Slider label"
|
|
21429
21684
|
numberFormatOptions={{
|
|
21430
21685
|
style: "percent",
|
|
21431
|
-
}} />;`},{id:"core-forms-slider--with-label-and-number-input",name:"With Label And Number Input",snippet:"const WithLabelAndNumberInput = () => <Slider includeNumberInput />;"}],implementation
|
|
21686
|
+
}} />;`},{id:"core-forms-slider--with-label-and-number-input",name:"With Label And Number Input",snippet:"const WithLabelAndNumberInput = () => <Slider includeNumberInput />;"}],implementation:`import React from "react";
|
|
21687
|
+
|
|
21688
|
+
import { IconSlider } from "../IconSlider";
|
|
21689
|
+
|
|
21690
|
+
import type { IconSliderProps } from "../Slider.types";
|
|
21691
|
+
|
|
21692
|
+
const TestIcon = () => <div>Icon</div>;
|
|
21693
|
+
|
|
21694
|
+
export const IconSliderWithIconExample: React.FC<
|
|
21695
|
+
Omit<IconSliderProps, "icon">
|
|
21696
|
+
> = (props) => <IconSlider icon={TestIcon} {...props} />;`},similarTo:[],figmaUrl:null},StatusCard:{id:"core-content-statuscard",breadcrumb:"Core/Content/StatusCard",importStatement:`import { Actionable, Box, StatusCard, Text, VariantViewer } from "@baseline-ui/core";
|
|
21432
21697
|
import { CaretUpIcon } from "@baseline-ui/icons/12";`,description:"`StatusCard` is a compact card that pairs a status icon with a title and description to communicate the state of a process or item. Use it to surface health, progress, or outcome signals such as active, success, warning, error, or denied conditions.",documentation:`\`StatusCard\` is a compact card that pairs a status icon with a title and description to communicate the state of a process or item. Use it to surface health, progress, or outcome signals such as active, success, warning, error, or denied conditions.
|
|
21433
21698
|
|
|
21434
21699
|
* Supports multiple status variants: \`active\`, \`warning\`, \`error\`, \`denied\`, and \`success\`
|
|
@@ -21847,7 +22112,7 @@ export const CustomTrailingElementTestComponent: React.FC = () => {
|
|
|
21847
22112
|
)}
|
|
21848
22113
|
/>
|
|
21849
22114
|
);
|
|
21850
|
-
};`},similarTo:[],figmaUrl:null},Stepper:{id:"core-navigation-stepper",breadcrumb:"Core/Navigation/Stepper",importStatement:'import { Box, CheckoutWizard, Stepper, Text } from "@baseline-ui/core";',description:"The `Stepper` visualizes user progress through a sequence of discrete, ordered\nsteps. Use it for multi-step flows like checkout, onboarding, or wizards where\nthe user must complete steps in order.",documentation:'The `Stepper` visualizes user progress through a sequence of discrete, ordered\nsteps. Use it for multi-step flows like checkout, onboarding, or wizards where\nthe user must complete steps in order.\n\n* Sequential progress model: only completed steps and the next-uncompleted step are selectable.\n* Active step is announced to assistive technology via `aria-current="step"`.\n* Completed steps include a visually hidden "Completed" label for screen readers.\n* Each selectable step is independently tabbable \u2014 no roving tabindex.\n* Controlled and uncontrolled APIs for both the selected step and the completion frontier.\n* Two layout variants (`condensed`, `expanded`) and two sizes (`sm`, `md`).\n* Supports indicator-only steps (omit `title`) and disabling individual steps or the whole stepper.\n\nYou can import the `Stepper` component like so:\n\n```jsx\nimport { Stepper } from "@baseline-ui/core";\n\nconst items = [\n { key: "cart", title: "Cart", description: "Review items" },\n { key: "shipping", title: "Shipping", description: "Enter address" },\n { key: "payment", title: "Payment", description: "Pay securely" },\n];\n\nexport default function Checkout() {\n return (\n <Stepper\n items={items}\n defaultSelectedStep="shipping"\n defaultLastCompletedStep="cart"\n aria-label="Checkout"\n />\n );\n}\n```\n\nIf you need parallel views without order or completion semantics, use\n[`Tabs`](?path=/docs/core-tabs--docs). For non-discrete or determinate progress,\nuse [`ProgressBar`](?path=/docs/core-progressbar--docs).\n\nThe `Stepper` supports two variants: `condensed` and `expanded`. The\n`expanded` variant is the default.\n\n* `condensed` \u2014 indicator-only layout with a short connector. Compact and ideal for narrow contexts.\n* `expanded` \u2014 indicator with title and description; the connector grows to fill the available width between steps.\n\n```jsx\n<Stepper items={items} variant="expanded" aria-label="Checkout" />\n<Stepper items={items} variant="condensed" aria-label="Checkout" />\n```\n\nThe `Stepper` supports two sizes: `sm` (20px indicator) and `md` (24px\nindicator). The `md` size is the default.\n\n```jsx\n<Stepper items={items} size="sm" aria-label="Checkout" />\n<Stepper items={items} size="md" aria-label="Checkout" />\n```\n\nEach step renders in one of three statuses, derived from the current selection\nand the completion frontier:\n\n* **complete** \u2014 step appears before `lastCompletedStep` (inclusive); shown with a checkmark.\n* **active** \u2014 step matches `selectedStep`; highlighted indicator with `aria-current="step"`.\n* **incomplete** \u2014 step appears after the active step; numbered indicator with muted styling.\n\nDisable individual steps by setting `isDisabled` on the item. Disabled steps\ncannot be selected and are removed from the tab sequence.\n\n```jsx\n<Stepper\n items={[\n { key: "a", title: "A" },\n { key: "b", title: "B", isDisabled: true },\n { key: "c", title: "C" },\n ]}\n aria-label="Checkout"\n/>\n```\n\nPass `isDisabled` on the `Stepper` itself to disable every step at once \u2014 useful\nwhile a flow is loading or otherwise temporarily inert.\n\n```jsx\n<Stepper items={items} isDisabled aria-label="Checkout" />\n```\n\nTwo independent ways to hide step text:\n\n* Set `variant="condensed"` on the stepper \u2014 hides title and description for every step regardless of whether they were provided.\n* Omit `title` on individual items in the default `expanded` variant \u2014 those specific steps render as indicator-only while others keep their text.\n\n```jsx\n<Stepper\n items={[{ key: "cart" }, { key: "shipping" }, { key: "payment" }]}\n variant="condensed"\n aria-label="Checkout"\n/>\n```\n\nThe `Stepper` can be used uncontrolled by providing `defaultSelectedStep` and\n`defaultLastCompletedStep`.\n\n```jsx\n<Stepper\n items={items}\n defaultSelectedStep="shipping"\n defaultLastCompletedStep="cart"\n aria-label="Checkout"\n/>\n```\n\nFor full control, supply `selectedStep` and `lastCompletedStep` together with\nthe `onSelectionChange` and `onLastCompletedStepChange` callbacks.\n`onLastCompletedStepChange` receives `null` when the frontier resets to "no\nsteps completed yet".\n\n```jsx\nconst [selected, setSelected] = useState("cart");\nconst [lastCompleted, setLastCompleted] = useState(null);\n\n<Stepper\n items={items}\n selectedStep={selected}\n lastCompletedStep={lastCompleted ?? undefined}\n onSelectionChange={setSelected}\n onLastCompletedStepChange={setLastCompleted}\n aria-label="Checkout"\n/>;\n```\n\n* Always supply an `aria-label` that names the flow (e.g. `"Checkout"`). A localized fallback ("Progress") is used if omitted, but a flow-specific label is strongly preferred.\n* The active step is marked with `aria-current="step"`.\n* Completed steps include a visually hidden "Completed" label so screen reader users hear the progress state.\n* Only completed steps and the next-uncompleted step are selectable; future steps are exposed with `aria-disabled="true"`.\n* Per-item `aria-label` has two roles. When set **without** `description`, the step renders in indicator-only mode and the label becomes the accessible name. When set **with** `description`, the step renders normally and the label overrides `title` for assistive technology \u2014 use it to expose a longer or more descriptive name to screen readers without changing the visible text.\n\n| Selector | Description |\n| --------------------------------- | ----------------------------------------------------------- |\n| `[data-variant]` | Layout variant: `condensed` or `expanded`. |\n| `[data-size]` | Size of the indicator: `sm` or `md`. |\n| `[data-status]` | Step status: `complete`, `active`, or `incomplete`. |\n| `[data-disabled]` | Whether the step is disabled. |\n| `[data-hovered]` | Whether the step is currently hovered. |\n| `[data-focused]` | Whether the step is focused (mouse or keyboard). |\n| `[data-focus-visible]` | Whether the step is keyboard focused. |\n| `[aria-current="step"]` | The currently active step. |\n| `[aria-disabled="true"]` | The step is not selectable (future or explicitly disabled). |\n| `.BaselineUI-Stepper` | Root `<ol>` element. |\n| `.BaselineUI-Stepper-Item` | Each step `<li>`. |\n| `.BaselineUI-Stepper-StepLink` | Interactive step `<a>` element. |\n| `.BaselineUI-Stepper-Indicator` | Indicator circle (number or checkmark). |\n| `.BaselineUI-Stepper-Text` | Wrapper around title and description. |\n| `.BaselineUI-Stepper-Title` | Step title text. |\n| `.BaselineUI-Stepper-Description` | Step description text. |\n| `.BaselineUI-Stepper-Connector` | Connector line between steps. |\n\nEach selectable step is a regular focusable link \u2014 the Stepper does not use a\nroving tabindex, so steps are reached individually via `Tab`.\n\n| Key | Function |\n|
|
|
22115
|
+
};`},similarTo:[],figmaUrl:null},Stepper:{id:"core-navigation-stepper",breadcrumb:"Core/Navigation/Stepper",importStatement:'import { Box, CheckoutWizard, Stepper, Text } from "@baseline-ui/core";',description:"The `Stepper` visualizes user progress through a sequence of discrete, ordered\nsteps. Use it for multi-step flows like checkout, onboarding, or wizards where\nthe user must complete steps in order.",documentation:'The `Stepper` visualizes user progress through a sequence of discrete, ordered\nsteps. Use it for multi-step flows like checkout, onboarding, or wizards where\nthe user must complete steps in order.\n\n* Sequential progress model: only completed steps and the next-uncompleted step are selectable.\n* Active step is announced to assistive technology via `aria-current="step"`.\n* Completed steps include a visually hidden "Completed" label for screen readers.\n* Each selectable step is independently tabbable \u2014 no roving tabindex.\n* Controlled and uncontrolled APIs for both the selected step and the completion frontier.\n* Two layout variants (`condensed`, `expanded`) and two sizes (`sm`, `md`).\n* Supports indicator-only steps (omit `title`) and disabling individual steps or the whole stepper.\n\nYou can import the `Stepper` component like so:\n\n```jsx\nimport { Stepper } from "@baseline-ui/core";\n\nconst items = [\n { key: "cart", title: "Cart", description: "Review items" },\n { key: "shipping", title: "Shipping", description: "Enter address" },\n { key: "payment", title: "Payment", description: "Pay securely" },\n];\n\nexport default function Checkout() {\n return (\n <Stepper\n items={items}\n defaultSelectedStep="shipping"\n defaultLastCompletedStep="cart"\n aria-label="Checkout"\n />\n );\n}\n```\n\nIf you need parallel views without order or completion semantics, use\n[`Tabs`](?path=/docs/core-tabs--docs). For non-discrete or determinate progress,\nuse [`ProgressBar`](?path=/docs/core-progressbar--docs).\n\nThe `Stepper` supports two variants: `condensed` and `expanded`. The\n`expanded` variant is the default.\n\n* `condensed` \u2014 indicator-only layout with a short connector. Compact and ideal for narrow contexts.\n* `expanded` \u2014 indicator with title and description; the connector grows to fill the available width between steps.\n\n```jsx\n<Stepper items={items} variant="expanded" aria-label="Checkout" />\n<Stepper items={items} variant="condensed" aria-label="Checkout" />\n```\n\nThe `Stepper` supports two sizes: `sm` (20px indicator) and `md` (24px\nindicator). The `md` size is the default.\n\n```jsx\n<Stepper items={items} size="sm" aria-label="Checkout" />\n<Stepper items={items} size="md" aria-label="Checkout" />\n```\n\nEach step renders in one of three statuses, derived from the current selection\nand the completion frontier:\n\n* **complete** \u2014 step appears before `lastCompletedStep` (inclusive); shown with a checkmark.\n* **active** \u2014 step matches `selectedStep`; highlighted indicator with `aria-current="step"`.\n* **incomplete** \u2014 step appears after the active step; numbered indicator with muted styling.\n\nDisable individual steps by setting `isDisabled` on the item. Disabled steps\ncannot be selected and are removed from the tab sequence.\n\n```jsx\n<Stepper\n items={[\n { key: "a", title: "A" },\n { key: "b", title: "B", isDisabled: true },\n { key: "c", title: "C" },\n ]}\n aria-label="Checkout"\n/>\n```\n\nPass `isDisabled` on the `Stepper` itself to disable every step at once \u2014 useful\nwhile a flow is loading or otherwise temporarily inert.\n\n```jsx\n<Stepper items={items} isDisabled aria-label="Checkout" />\n```\n\nTwo independent ways to hide step text:\n\n* Set `variant="condensed"` on the stepper \u2014 hides title and description for every step regardless of whether they were provided.\n* Omit `title` on individual items in the default `expanded` variant \u2014 those specific steps render as indicator-only while others keep their text.\n\n```jsx\n<Stepper\n items={[{ key: "cart" }, { key: "shipping" }, { key: "payment" }]}\n variant="condensed"\n aria-label="Checkout"\n/>\n```\n\nThe `Stepper` can be used uncontrolled by providing `defaultSelectedStep` and\n`defaultLastCompletedStep`.\n\n```jsx\n<Stepper\n items={items}\n defaultSelectedStep="shipping"\n defaultLastCompletedStep="cart"\n aria-label="Checkout"\n/>\n```\n\nFor full control, supply `selectedStep` and `lastCompletedStep` together with\nthe `onSelectionChange` and `onLastCompletedStepChange` callbacks.\n`onLastCompletedStepChange` receives `null` when the frontier resets to "no\nsteps completed yet".\n\n```jsx\nconst [selected, setSelected] = useState("cart");\nconst [lastCompleted, setLastCompleted] = useState(null);\n\n<Stepper\n items={items}\n selectedStep={selected}\n lastCompletedStep={lastCompleted ?? undefined}\n onSelectionChange={setSelected}\n onLastCompletedStepChange={setLastCompleted}\n aria-label="Checkout"\n/>;\n```\n\n* Always supply an `aria-label` that names the flow (e.g. `"Checkout"`). A localized fallback ("Progress") is used if omitted, but a flow-specific label is strongly preferred.\n* The active step is marked with `aria-current="step"`.\n* Completed steps include a visually hidden "Completed" label so screen reader users hear the progress state.\n* Only completed steps and the next-uncompleted step are selectable; future steps are exposed with `aria-disabled="true"`.\n* Per-item `aria-label` has two roles. When set **without** `description`, the step renders in indicator-only mode and the label becomes the accessible name. When set **with** `description`, the step renders normally and the label overrides `title` for assistive technology \u2014 use it to expose a longer or more descriptive name to screen readers without changing the visible text.\n\n| Selector | Description |\n| --------------------------------- | ----------------------------------------------------------- |\n| `[data-variant]` | Layout variant: `condensed` or `expanded`. |\n| `[data-size]` | Size of the indicator: `sm` or `md`. |\n| `[data-status]` | Step status: `complete`, `active`, or `incomplete`. |\n| `[data-disabled]` | Whether the step is disabled. |\n| `[data-hovered]` | Whether the step is currently hovered. |\n| `[data-focused]` | Whether the step is focused (mouse or keyboard). |\n| `[data-focus-visible]` | Whether the step is keyboard focused. |\n| `[aria-current="step"]` | The currently active step. |\n| `[aria-disabled="true"]` | The step is not selectable (future or explicitly disabled). |\n| `.BaselineUI-Stepper` | Root `<ol>` element. |\n| `.BaselineUI-Stepper-Item` | Each step `<li>`. |\n| `.BaselineUI-Stepper-StepLink` | Interactive step `<a>` element. |\n| `.BaselineUI-Stepper-Indicator` | Indicator circle (number or checkmark). |\n| `.BaselineUI-Stepper-Text` | Wrapper around title and description. |\n| `.BaselineUI-Stepper-Title` | Step title text. |\n| `.BaselineUI-Stepper-Description` | Step description text. |\n| `.BaselineUI-Stepper-Connector` | Connector line between steps. |\n\nEach selectable step is a regular focusable link \u2014 the Stepper does not use a\nroving tabindex, so steps are reached individually via `Tab`.\n\n| Key | Function |\n| ----------- | ------------------------------------------- |\n| `Tab` | Moves focus to the next selectable step. |\n| `ArrowDown` | Moves focus to the next step. |\n| `ArrowUp` | Moves focus to the previous step. |\n| `Enter` | Activates the focused step (if selectable). |',props:`interface StepperProps {
|
|
21851
22116
|
/**
|
|
21852
22117
|
* @deprecated Do not use in new components. This is a legacy block
|
|
21853
22118
|
* identifier; new components should exclude it via
|
|
@@ -21945,7 +22210,7 @@ aria-label?: string
|
|
|
21945
22210
|
*/
|
|
21946
22211
|
stepLabel?: string | ((values: { index: number }) => string)
|
|
21947
22212
|
/**
|
|
21948
|
-
* Overrides the screen-reader-only
|
|
22213
|
+
* Overrides the screen-reader-only prefix marking a step the reader has
|
|
21949
22214
|
* finished.
|
|
21950
22215
|
*
|
|
21951
22216
|
* Message id: \`bui.stepper.completed\`. Defaults to \`"Completed"\`.
|
|
@@ -22981,68 +23246,7 @@ Use the \`renderEmptyState\` prop on \`TableBody\` to display a message when the
|
|
|
22981
23246
|
* **Virtualizer** \u2014 for performance with large datasets
|
|
22982
23247
|
* **Toolbar** \u2014 for contextual actions on selected rows
|
|
22983
23248
|
* **Tag** \u2014 for displaying status badges in cells
|
|
22984
|
-
* **Menu** \u2014 for row-level action menus`,props:`
|
|
22985
|
-
/**
|
|
22986
|
-
* Overrides the default DOM element with a custom render function.
|
|
22987
|
-
* This allows rendering existing components with built-in styles and behaviors
|
|
22988
|
-
* such as router links, animation libraries, and pre-styled components.
|
|
22989
|
-
*
|
|
22990
|
-
* Requirements:
|
|
22991
|
-
*
|
|
22992
|
-
* - You must render the expected element type (e.g. if \`<button>\` is expected, you cannot render an
|
|
22993
|
-
* \`<a>\`).
|
|
22994
|
-
* - Only a single root DOM element can be rendered (no fragments).
|
|
22995
|
-
* - You must pass through props and ref to the underlying DOM element, merging with your own prop
|
|
22996
|
-
* as appropriate.
|
|
22997
|
-
*/
|
|
22998
|
-
render?: (
|
|
22999
|
-
props: React.JSX.IntrinsicElements[E],
|
|
23000
|
-
renderProps: T
|
|
23001
|
-
) => ReactElement
|
|
23002
|
-
/**
|
|
23003
|
-
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the
|
|
23004
|
-
* element. A function may be provided to compute the class based on component state.
|
|
23005
|
-
*/
|
|
23006
|
-
className?: | string
|
|
23007
|
-
| ((values: T & {defaultClassName: string | undefined}) => string)
|
|
23008
|
-
/**
|
|
23009
|
-
* The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the
|
|
23010
|
-
* element. A function may be provided to compute the style based on component state.
|
|
23011
|
-
*/
|
|
23012
|
-
style?: | CSSProperties
|
|
23013
|
-
| ((values: T & {defaultStyle: CSSProperties}) => CSSProperties | undefined)
|
|
23014
|
-
/**
|
|
23015
|
-
* A slot name for the component. Slots allow the component to receive props from a parent
|
|
23016
|
-
* component. An explicit \`null\` value indicates that the local props completely override all
|
|
23017
|
-
* props received from a parent.
|
|
23018
|
-
*/
|
|
23019
|
-
slot?: string | null
|
|
23020
|
-
/**
|
|
23021
|
-
* The elements that make up the table. Includes the TableHeader, TableBody, Columns, and Rows.
|
|
23022
|
-
*/
|
|
23023
|
-
children?: ReactNode
|
|
23024
|
-
/**
|
|
23025
|
-
* How multiple selection should behave in the collection.
|
|
23026
|
-
*
|
|
23027
|
-
* @default 'toggle'
|
|
23028
|
-
*/
|
|
23029
|
-
selectionBehavior?: SelectionBehavior
|
|
23030
|
-
/**
|
|
23031
|
-
* Whether \`disabledKeys\` applies to all interactions, or only selection.
|
|
23032
|
-
*
|
|
23033
|
-
* @default 'all'
|
|
23034
|
-
*/
|
|
23035
|
-
disabledBehavior?: DisabledBehavior
|
|
23036
|
-
/**
|
|
23037
|
-
* Handler that is called when a user performs an action on the row.
|
|
23038
|
-
*/
|
|
23039
|
-
onRowAction?: (key: Key) => void
|
|
23040
|
-
/**
|
|
23041
|
-
* The drag and drop hooks returned by \`useDragAndDrop\` used to enable drag and drop behavior for
|
|
23042
|
-
* the Table.
|
|
23043
|
-
*/
|
|
23044
|
-
dragAndDropHooks?: DragHooks<T> & DropHooks
|
|
23045
|
-
}`,stories:{usage:[{id:"core-collections-table--default",name:"Default",snippet:"const Default = () => <BasicTableExample />;",description:"Basic table with columns and rows, no interactivity"},{id:"core-collections-table--single-selection",name:"Single Selection",snippet:"const SingleSelection = () => <SingleSelectionTableExample />;",description:"Single selection mode with controlled state"},{id:"core-collections-table--multiple-selection",name:"Multiple Selection",snippet:"const MultipleSelection = () => <MultipleSelectionTableExample />;",description:"Multiple selection mode with checkbox column and select-all header"},{id:"core-collections-table--sorting",name:"Sorting",snippet:"const Sorting = () => <SortableTableExample />;",description:"Sortable columns with sort descriptor and client-side sorting"},{id:"core-collections-table--empty",name:"Empty",snippet:"const Empty = () => <EmptyTableExample />;",description:"Empty table with no rows"},{id:"core-collections-table--row-action",name:"Row Action",snippet:`const RowAction = () => (
|
|
23249
|
+
* **Menu** \u2014 for row-level action menus`,props:"",stories:{usage:[{id:"core-collections-table--default",name:"Default",snippet:"const Default = () => <BasicTableExample />;",description:"Basic table with columns and rows, no interactivity"},{id:"core-collections-table--single-selection",name:"Single Selection",snippet:"const SingleSelection = () => <SingleSelectionTableExample />;",description:"Single selection mode with controlled state"},{id:"core-collections-table--multiple-selection",name:"Multiple Selection",snippet:"const MultipleSelection = () => <MultipleSelectionTableExample />;",description:"Multiple selection mode with checkbox column and select-all header"},{id:"core-collections-table--sorting",name:"Sorting",snippet:"const Sorting = () => <SortableTableExample />;",description:"Sortable columns with sort descriptor and client-side sorting"},{id:"core-collections-table--empty",name:"Empty",snippet:"const Empty = () => <EmptyTableExample />;",description:"Empty table with no rows"},{id:"core-collections-table--row-action",name:"Row Action",snippet:`const RowAction = () => (
|
|
23046
23250
|
<OnRowActionTableExample
|
|
23047
23251
|
onRowAction={(key) => {
|
|
23048
23252
|
alert(\`Row action: \${key}\`);
|
|
@@ -23838,12 +24042,14 @@ export const DisabledRowsTableExample: React.FC<
|
|
|
23838
24042
|
|
|
23839
24043
|
interface DragAndDropTableExampleProps {
|
|
23840
24044
|
onReorder?: (event: DroppableCollectionReorderEvent) => void;
|
|
24045
|
+
/** Virtualizes the table without a fixed height, so the page scrolls it. */
|
|
24046
|
+
isVirtualized?: boolean;
|
|
23841
24047
|
}
|
|
23842
24048
|
|
|
23843
24049
|
/** Drag-and-drop row reordering using useTableDragAndDrop hook. */
|
|
23844
24050
|
export const DragAndDropTableExample: React.FC<
|
|
23845
24051
|
DragAndDropTableExampleProps
|
|
23846
|
-
> = ({ onReorder }) => {
|
|
24052
|
+
> = ({ onReorder, isVirtualized }) => {
|
|
23847
24053
|
const list = useListData({ initialItems: rows });
|
|
23848
24054
|
|
|
23849
24055
|
const handleReorder = useCallback(
|
|
@@ -23862,7 +24068,7 @@ export const DragAndDropTableExample: React.FC<
|
|
|
23862
24068
|
onReorder: handleReorder,
|
|
23863
24069
|
});
|
|
23864
24070
|
|
|
23865
|
-
|
|
24071
|
+
const table = (
|
|
23866
24072
|
<Table dragAndDropHooks={dragAndDropHooks} aria-label="Files">
|
|
23867
24073
|
<TableHeader>
|
|
23868
24074
|
<Column id="drag">
|
|
@@ -23906,6 +24112,17 @@ export const DragAndDropTableExample: React.FC<
|
|
|
23906
24112
|
</TableBody>
|
|
23907
24113
|
</Table>
|
|
23908
24114
|
);
|
|
24115
|
+
|
|
24116
|
+
return isVirtualized ? (
|
|
24117
|
+
<>
|
|
24118
|
+
<Virtualizer {...VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS.TABLE}>
|
|
24119
|
+
{table}
|
|
24120
|
+
</Virtualizer>
|
|
24121
|
+
<Box style={{ height: 3000 }} />
|
|
24122
|
+
</>
|
|
24123
|
+
) : (
|
|
24124
|
+
table
|
|
24125
|
+
);
|
|
23909
24126
|
};
|
|
23910
24127
|
|
|
23911
24128
|
/** Table with zero rows and an empty state message. */
|
|
@@ -24043,14 +24260,21 @@ export const OnRowActionTableExample: React.FC<
|
|
|
24043
24260
|
);
|
|
24044
24261
|
|
|
24045
24262
|
/** Virtualized table using actual Virtualizer component with 1000 rows. */
|
|
24046
|
-
export const VirtualizedTableExample: React.FC
|
|
24263
|
+
export const VirtualizedTableExample: React.FC<{
|
|
24264
|
+
/** What bounds the table's height: itself, a scrolling ancestor, or the page. */
|
|
24265
|
+
boundedBy?: "table" | "ancestor" | "window";
|
|
24266
|
+
}> = ({ boundedBy = "table" }) => {
|
|
24047
24267
|
const largeDataset = generateLargeDataset(1000);
|
|
24048
24268
|
|
|
24049
|
-
|
|
24269
|
+
const virtualizer = (
|
|
24050
24270
|
<Virtualizer {...VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS.TABLE}>
|
|
24051
24271
|
<Table
|
|
24052
24272
|
aria-label="Files"
|
|
24053
|
-
style={
|
|
24273
|
+
style={
|
|
24274
|
+
boundedBy === "table"
|
|
24275
|
+
? { height: 400, width: 700, overflow: "auto" }
|
|
24276
|
+
: { width: 700, overflow: "auto" }
|
|
24277
|
+
}
|
|
24054
24278
|
>
|
|
24055
24279
|
<TableHeader>
|
|
24056
24280
|
<Column id="name" isRowHeader={true}>
|
|
@@ -24092,6 +24316,17 @@ export const VirtualizedTableExample: React.FC = () => {
|
|
|
24092
24316
|
</Table>
|
|
24093
24317
|
</Virtualizer>
|
|
24094
24318
|
);
|
|
24319
|
+
|
|
24320
|
+
return boundedBy === "ancestor" ? (
|
|
24321
|
+
<Box
|
|
24322
|
+
data-testid="virtualized-table-scroller"
|
|
24323
|
+
style={{ height: 400, overflow: "auto" }}
|
|
24324
|
+
>
|
|
24325
|
+
{virtualizer}
|
|
24326
|
+
</Box>
|
|
24327
|
+
) : (
|
|
24328
|
+
virtualizer
|
|
24329
|
+
);
|
|
24095
24330
|
};
|
|
24096
24331
|
|
|
24097
24332
|
interface AsyncLoadingTableExampleProps {
|
|
@@ -24848,7 +25083,16 @@ isSelected?: boolean
|
|
|
24848
25083
|
* is rendered.
|
|
24849
25084
|
*/
|
|
24850
25085
|
onRemove?: () => void
|
|
24851
|
-
}`,stories:{usage:[{id:"core-content-tag--basic",name:"Basic",snippet:"const Basic = () => <Tag>Tag</Tag>;"},{id:"core-content-tag--with-icon",name:"With Icon",snippet:"const WithIcon = () => <Tag icon={EllipseIcon}>Tag</Tag>;"},{id:"core-content-tag--removable",name:"Removable",snippet:"const Removable = () => <Tag onRemove={fn()}>Tag</Tag>;"},{id:"core-content-tag--selected",name:"Selected",snippet:"const Selected = () => <Tag isSelected>Tag</Tag>;"},{id:"core-content-tag--selected-with-icon",name:"Selected With Icon",snippet:"const SelectedWithIcon = () => <Tag isSelected icon={EllipseIcon}>Tag</Tag>;"},{id:"core-content-tag--disabled",name:"Disabled",snippet:"const Disabled = () => <Tag isDisabled>Tag</Tag>;"},{id:"core-content-tag--disabled-removable",name:"Disabled Removable",snippet:"const DisabledRemovable = () => <Tag isDisabled onRemove={fn()}>Tag</Tag>;"},{id:"core-content-tag--small",name:"Small",snippet:'const Small = () => <Tag size="sm">Tag</Tag>;'},{id:"core-content-tag--small-with-icon",name:"Small With Icon",snippet:'const SmallWithIcon = () => <Tag size="sm" icon={EllipseIcon12}>Tag</Tag>;'},{id:"core-content-tag--long-text",name:"Long Text",snippet:"const LongText = () => <Tag>This is a very long tag label that might overflow or cause layout issues</Tag>;"}],implementation
|
|
25086
|
+
}`,stories:{usage:[{id:"core-content-tag--basic",name:"Basic",snippet:"const Basic = () => <Tag>Tag</Tag>;"},{id:"core-content-tag--with-icon",name:"With Icon",snippet:"const WithIcon = () => <Tag icon={EllipseIcon}>Tag</Tag>;"},{id:"core-content-tag--removable",name:"Removable",snippet:"const Removable = () => <Tag onRemove={fn()}>Tag</Tag>;"},{id:"core-content-tag--selected",name:"Selected",snippet:"const Selected = () => <Tag isSelected>Tag</Tag>;"},{id:"core-content-tag--selected-with-icon",name:"Selected With Icon",snippet:"const SelectedWithIcon = () => <Tag isSelected icon={EllipseIcon}>Tag</Tag>;"},{id:"core-content-tag--disabled",name:"Disabled",snippet:"const Disabled = () => <Tag isDisabled>Tag</Tag>;"},{id:"core-content-tag--disabled-removable",name:"Disabled Removable",snippet:"const DisabledRemovable = () => <Tag isDisabled onRemove={fn()}>Tag</Tag>;"},{id:"core-content-tag--small",name:"Small",snippet:'const Small = () => <Tag size="sm">Tag</Tag>;'},{id:"core-content-tag--small-with-icon",name:"Small With Icon",snippet:'const SmallWithIcon = () => <Tag size="sm" icon={EllipseIcon12}>Tag</Tag>;'},{id:"core-content-tag--long-text",name:"Long Text",snippet:"const LongText = () => <Tag>This is a very long tag label that might overflow or cause layout issues</Tag>;"}],implementation:`import { EllipseIcon } from "@baseline-ui/icons/16";
|
|
25087
|
+
import React from "react";
|
|
25088
|
+
|
|
25089
|
+
import { Tag } from "../Tag";
|
|
25090
|
+
|
|
25091
|
+
import type { TagProps } from "../Tag.types";
|
|
25092
|
+
|
|
25093
|
+
export const TagWithIconExample: React.FC<Omit<TagProps, "icon">> = (props) => (
|
|
25094
|
+
<Tag icon={EllipseIcon} {...props} />
|
|
25095
|
+
);`},similarTo:[],figmaUrl:null},TagGroup:{id:"core-collections-taggroup",breadcrumb:"Core/Collections/TagGroup",importStatement:'import { RemovableTagGroup, TagGroup, VariantViewer } from "@baseline-ui/core";',description:"`TagGroup` is a focusable collection of `Tag` items with keyboard navigation, selection, and removal. Use it to present a set of related labels, keywords, or filters that users can browse or toggle as a group.",documentation:`\`TagGroup\` is a focusable collection of \`Tag\` items with keyboard navigation, selection, and removal. Use it to present a set of related labels, keywords, or filters that users can browse or toggle as a group.
|
|
24852
25096
|
|
|
24853
25097
|
* The component is exposed to assistive technology as a grid using ARIA
|
|
24854
25098
|
* Keyboard navigation supports arrow keys, home, end, page up, page down, space and enter
|
|
@@ -25139,7 +25383,11 @@ export const RemovableTagGroup: React.FC<
|
|
|
25139
25383
|
}}
|
|
25140
25384
|
/>
|
|
25141
25385
|
);
|
|
25142
|
-
}
|
|
25386
|
+
};
|
|
25387
|
+
|
|
25388
|
+
export const TagGroupExample: React.FC<
|
|
25389
|
+
Omit<React.ComponentProps<typeof TagGroup>, "items" | "aria-label">
|
|
25390
|
+
> = (props) => <TagGroup {...props} items={items} aria-label="Tag group" />;`},similarTo:[],figmaUrl:null},TaggedPagination:{id:"core-forms-taggedpagination",breadcrumb:"Core/Forms/TaggedPagination",importStatement:'import { Box, TaggedPagination, TaggedPaginationExample, VariantViewer } from "@baseline-ui/core";',description:"`TaggedPagination` is a paginator that steps through items by their custom label rather than a sequential index. Use it when pages or records have meaningful identifiers, such as named document pages, that should appear in the input instead of raw numbers.",documentation:`\`TaggedPagination\` is a paginator that steps through items by their custom label rather than a sequential index. Use it when pages or records have meaningful identifiers, such as named document pages, that should appear in the input instead of raw numbers.
|
|
25143
25391
|
|
|
25144
25392
|
* Supports both string and number tags.
|
|
25145
25393
|
* Keyboard handling of next and previous buttons.
|
|
@@ -26660,7 +26908,7 @@ warningMessage?: string
|
|
|
26660
26908
|
onChange={fn()}
|
|
26661
26909
|
label="Label"
|
|
26662
26910
|
errorMessage="Error message"
|
|
26663
|
-
validationState="error" />;`},{id:"core-forms-timefield--with-warning-message",name:"With Warning Message",snippet:`const WithWarningMessage = () => <TimeField
|
|
26911
|
+
validationState="error" />;`},{id:"core-forms-timefield--with-error-message-only",name:"With Error Message Only",snippet:'const WithErrorMessageOnly = () => <TimeField onChange={fn()} label="Label" errorMessage="Error message" />;'},{id:"core-forms-timefield--with-warning-message",name:"With Warning Message",snippet:`const WithWarningMessage = () => <TimeField
|
|
26664
26912
|
onChange={fn()}
|
|
26665
26913
|
label="Label"
|
|
26666
26914
|
warningMessage="Warning message"
|
|
@@ -26812,7 +27060,15 @@ import { GlobalToastRegion } from "../Toast";
|
|
|
26812
27060
|
|
|
26813
27061
|
import type { ToastContent } from "../Toast.types";
|
|
26814
27062
|
|
|
26815
|
-
export const ToastExample = ({
|
|
27063
|
+
export const ToastExample = ({
|
|
27064
|
+
onAction,
|
|
27065
|
+
closeLabel,
|
|
27066
|
+
canClose,
|
|
27067
|
+
}: {
|
|
27068
|
+
onAction?: () => void;
|
|
27069
|
+
closeLabel?: string;
|
|
27070
|
+
canClose?: boolean;
|
|
27071
|
+
}) => {
|
|
26816
27072
|
const [variant, setVariant] = useState<ToastContent["variant"]>("info");
|
|
26817
27073
|
const [shouldIncludeAction, setShouldIncludeAction] = useState(false);
|
|
26818
27074
|
const [arrangement, setArrangement] =
|
|
@@ -26904,6 +27160,8 @@ export const ToastExample = ({ onAction }: { onAction?: () => void }) => {
|
|
|
26904
27160
|
: undefined,
|
|
26905
27161
|
actionLabel: shouldIncludeAction ? "Action" : undefined,
|
|
26906
27162
|
arrangement,
|
|
27163
|
+
closeLabel,
|
|
27164
|
+
canClose,
|
|
26907
27165
|
},
|
|
26908
27166
|
{
|
|
26909
27167
|
timeout: timeoutValue,
|
|
@@ -27513,6 +27771,13 @@ export const StateSpecificIcon: React.FC<
|
|
|
27513
27771
|
unselected: XIcon,
|
|
27514
27772
|
}}
|
|
27515
27773
|
/>
|
|
27774
|
+
);
|
|
27775
|
+
|
|
27776
|
+
export const LabelledByTooltip: React.FC = () => (
|
|
27777
|
+
<>
|
|
27778
|
+
<span id="toggle-label">Mute</span>
|
|
27779
|
+
<ToggleIconButtonExample aria-labelledby="toggle-label" tooltip={true} />
|
|
27780
|
+
</>
|
|
27516
27781
|
);`},similarTo:[],figmaUrl:null},Toolbar:{id:"core-miscellaneous-toolbar",breadcrumb:"Core/Miscellaneous/Toolbar",importStatement:`import {
|
|
27517
27782
|
ChildrenWithTooltip,
|
|
27518
27783
|
CollapsibleChildren,
|
|
@@ -27770,6 +28035,7 @@ export const CollapsibleChildren: React.FC<{
|
|
|
27770
28035
|
size="lg"
|
|
27771
28036
|
variant="toolbar"
|
|
27772
28037
|
tooltip={true}
|
|
28038
|
+
data-testid="toolbar-overflow-button"
|
|
27773
28039
|
/>
|
|
27774
28040
|
),
|
|
27775
28041
|
}
|
|
@@ -28054,14 +28320,14 @@ onOpenChange?: (isOpen: boolean) => void
|
|
|
28054
28320
|
isDisabled?: boolean
|
|
28055
28321
|
/**
|
|
28056
28322
|
* The delay time for the tooltip to show up. [See
|
|
28057
|
-
* guidelines](https://spectrum.adobe.com/
|
|
28323
|
+
* guidelines](https://spectrum.adobe.com/web/rsp/components/tooltip#behaviors).
|
|
28058
28324
|
*
|
|
28059
28325
|
* @default 1500
|
|
28060
28326
|
*/
|
|
28061
28327
|
delay?: number
|
|
28062
28328
|
/**
|
|
28063
28329
|
* The delay time for the tooltip to close. [See
|
|
28064
|
-
* guidelines](https://spectrum.adobe.com/
|
|
28330
|
+
* guidelines](https://spectrum.adobe.com/web/rsp/components/tooltip#behaviors).
|
|
28065
28331
|
*
|
|
28066
28332
|
* @default 500
|
|
28067
28333
|
*/
|
|
@@ -28232,160 +28498,19 @@ export const TooltipGetTargetRectExample = () => {
|
|
|
28232
28498
|
</>
|
|
28233
28499
|
);
|
|
28234
28500
|
};`},similarTo:[],figmaUrl:null},TreeView:{id:"core-collections-treeview",breadcrumb:"Core/Collections/TreeView",importStatement:`import {
|
|
28501
|
+
ActionIconButton,
|
|
28502
|
+
Box,
|
|
28503
|
+
DragAndDropTreeViewExample,
|
|
28504
|
+
InteractiveFieldsDragAndDropExample,
|
|
28505
|
+
Tag,
|
|
28506
|
+
Text,
|
|
28235
28507
|
TreeView,
|
|
28236
28508
|
VirtualizedTreeViewExample,
|
|
28237
28509
|
VirtualizedTreeViewWithActionsExample,
|
|
28238
28510
|
VirtualizedTreeViewWithDescriptionsExample,
|
|
28239
28511
|
VirtualizedTreeViewWithExpandControlExample,
|
|
28240
28512
|
VirtualizedTreeViewWithRenameExample,
|
|
28241
|
-
} from "@baseline-ui/core";`,description:"`TreeView` displays hierarchical data as expandable, selectable, and renameable rows with optional per-item actions. Use it for file browsers, folder structures, outlines, or any nested dataset users need to navigate.",documentation:`\`TreeView\` displays hierarchical data as expandable, selectable, and renameable rows with optional per-item actions. Use it for file browsers, folder structures, outlines, or any nested dataset users need to navigate.
|
|
28242
|
-
|
|
28243
|
-
* Support for mouse, touch, and keyboard interaction
|
|
28244
|
-
* Accessible via React Aria with full keyboard navigation
|
|
28245
|
-
* Support for primary and secondary action buttons on items
|
|
28246
|
-
* Support for inline renaming of item labels (double-click or F2)
|
|
28247
|
-
* Icons and descriptions on individual items
|
|
28248
|
-
* Controlled and uncontrolled expansion state
|
|
28249
|
-
* Custom item title rendering via \`renderItemTitle\`
|
|
28250
|
-
* Virtualization support for large datasets (10,000+ items)
|
|
28251
|
-
|
|
28252
|
-
\`\`\`tsx
|
|
28253
|
-
import { TreeView } from "@baseline-ui/core";
|
|
28254
|
-
const treeItems = {
|
|
28255
|
-
id: "root",
|
|
28256
|
-
label: "Root item",
|
|
28257
|
-
children: [
|
|
28258
|
-
{
|
|
28259
|
-
id: "documents",
|
|
28260
|
-
label: "Documents",
|
|
28261
|
-
children: [
|
|
28262
|
-
{
|
|
28263
|
-
id: "work",
|
|
28264
|
-
label: "Work",
|
|
28265
|
-
},
|
|
28266
|
-
],
|
|
28267
|
-
},
|
|
28268
|
-
],
|
|
28269
|
-
};
|
|
28270
|
-
|
|
28271
|
-
<TreeView items={treeItems} aria-label="File browser" />;
|
|
28272
|
-
\`\`\`
|
|
28273
|
-
|
|
28274
|
-
> **Note:** The top-level \`items\` object acts as a virtual root and is not rendered. Only its \`children\` appear in the tree.
|
|
28275
|
-
|
|
28276
|
-
Each item can have an \`icon\` property that renders an icon next to the label.
|
|
28277
|
-
|
|
28278
|
-
Items can include a \`description\` string, rendered below the label.
|
|
28279
|
-
|
|
28280
|
-
A tree with no nested children \u2014 all chevrons are hidden.
|
|
28281
|
-
|
|
28282
|
-
Trees with deep nesting (4+ levels) indent items based on depth.
|
|
28283
|
-
|
|
28284
|
-
Demonstrates how the component handles lengthy item labels and descriptions.
|
|
28285
|
-
|
|
28286
|
-
Control the expansion state with \`expandedKeys\` and \`onExpandedChange\`.
|
|
28287
|
-
|
|
28288
|
-
Use \`defaultExpandedKeys\` for the initial expansion state. You can still expand and collapse items via interaction.
|
|
28289
|
-
|
|
28290
|
-
Use \`selectedKeys\` to highlight specific items. The tree uses multi-selection mode.
|
|
28291
|
-
|
|
28292
|
-
Add primary and secondary action buttons to each row using \`primaryActionIcon\`/\`secondaryActionIcon\` and \`onPrimaryAction\`/\`onSecondaryAction\`. You can set the \`actionsPosition\` prop to \`"start"\` (default) or \`"end"\` to control their placement.
|
|
28293
|
-
|
|
28294
|
-
Pass a function to \`primaryActionIcon\` or \`secondaryActionIcon\` to render different icons per item: \`(key: Key) => IconComponent\`.
|
|
28295
|
-
|
|
28296
|
-
Similarly, \`primaryActionAriaLabel\` and \`secondaryActionAriaLabel\` accept \`string | ((key: Key) => string)\` for per-item labels.
|
|
28297
|
-
|
|
28298
|
-
Enable inline renaming by passing an \`onRename\` callback. Users can rename by double-clicking the label or pressing <kbd>F2</kbd>. Press <kbd>Enter</kbd> to confirm or <kbd>Escape</kbd> to cancel. Blurring the input (e.g., clicking outside) also confirms the rename.
|
|
28299
|
-
|
|
28300
|
-
Use \`renderItemTitle\` to customize how item titles are rendered. The function receives the full \`TreeListItem\` and returns a \`ReactNode\`.
|
|
28301
|
-
|
|
28302
|
-
Pass \`onAction\` to handle activation of tree items. The callback receives the item's \`key\` and fires when an item is activated (typically via Enter or double-click).
|
|
28303
|
-
|
|
28304
|
-
| Selector | Description |
|
|
28305
|
-
| -------------------------------------- | ---------------------------------- |
|
|
28306
|
-
| \`.BaselineUI-TreeView\` | The root tree container |
|
|
28307
|
-
| \`.BaselineUI-TreeView-Row\` | An individual tree row |
|
|
28308
|
-
| \`.BaselineUI-TreeView-ExpansionToggle\` | The expand/collapse chevron button |
|
|
28309
|
-
| \`.BaselineUI-TreeView-Title\` | The item label text |
|
|
28310
|
-
| \`.BaselineUI-TreeView-Description\` | The item description text |
|
|
28311
|
-
| \`.BaselineUI-TreeView-RenameInput\` | The inline rename text input |
|
|
28312
|
-
|
|
28313
|
-
| Key | Action |
|
|
28314
|
-
| ---------------------- | ----------------------------------------------------------------------------- |
|
|
28315
|
-
| <kbd>Arrow Down</kbd> | Focus the next item |
|
|
28316
|
-
| <kbd>Arrow Up</kbd> | Focus the previous item |
|
|
28317
|
-
| <kbd>Arrow Right</kbd> | Expand the focused item, or move focus to the first child if already expanded |
|
|
28318
|
-
| <kbd>Arrow Left</kbd> | Collapse the focused item, or move focus to the parent if already collapsed |
|
|
28319
|
-
| <kbd>Enter</kbd> | Activate the focused item |
|
|
28320
|
-
| <kbd>Space</kbd> | Toggle selection of the focused item |
|
|
28321
|
-
| <kbd>Home</kbd> | Focus the first item |
|
|
28322
|
-
| <kbd>End</kbd> | Focus the last item |
|
|
28323
|
-
| <kbd>F2</kbd> | Start renaming the focused item (requires \`onRename\` prop) |
|
|
28324
|
-
| <kbd>Escape</kbd> | Cancel renaming |
|
|
28325
|
-
|
|
28326
|
-
* **ListBox** \u2014 for flat, non-hierarchical lists
|
|
28327
|
-
* **Menu** \u2014 for action menus and dropdowns
|
|
28328
|
-
|
|
28329
|
-
For large trees with thousands of items, use virtualization to improve performance and reduce memory usage.
|
|
28330
|
-
|
|
28331
|
-
Consider virtualization when:
|
|
28332
|
-
|
|
28333
|
-
* Trees have 500+ total items (including nested children)
|
|
28334
|
-
* Trees are deeply nested (5+ levels) with many items per level
|
|
28335
|
-
* You need responsive scrolling on mobile devices
|
|
28336
|
-
* Memory usage is a concern
|
|
28337
|
-
|
|
28338
|
-
Wrap TreeView with the Virtualizer component:
|
|
28339
|
-
|
|
28340
|
-
\`\`\`tsx
|
|
28341
|
-
import {
|
|
28342
|
-
TreeView,
|
|
28343
|
-
Virtualizer,
|
|
28344
|
-
VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS,
|
|
28345
|
-
} from "@baseline-ui/core";
|
|
28346
|
-
|
|
28347
|
-
<Virtualizer {...VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS.TREE_VIEW}>
|
|
28348
|
-
<TreeView
|
|
28349
|
-
items={largeTree}
|
|
28350
|
-
aria-label="Large file system"
|
|
28351
|
-
style={{ height: 600, overflow: "auto" }}
|
|
28352
|
-
/>
|
|
28353
|
-
</Virtualizer>;
|
|
28354
|
-
\`\`\`
|
|
28355
|
-
|
|
28356
|
-
**Important:** You must specify an explicit height on the TreeView container.
|
|
28357
|
-
|
|
28358
|
-
The \`VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS.TREE_VIEW\` preset uses a \`rowHeight\` of 44px. To customize row heights (e.g., for items with descriptions), pass \`layout\` and \`layoutOptions\` directly:
|
|
28359
|
-
|
|
28360
|
-
\`\`\`tsx
|
|
28361
|
-
import { ListLayout, TreeView, Virtualizer } from "@baseline-ui/core";
|
|
28362
|
-
|
|
28363
|
-
// Items without descriptions (default)
|
|
28364
|
-
<Virtualizer layout={ListLayout} layoutOptions={{ rowHeight: 44 }}>
|
|
28365
|
-
<TreeView items={tree} style={{ height: 600, overflow: "auto" }} />
|
|
28366
|
-
</Virtualizer>
|
|
28367
|
-
|
|
28368
|
-
// Items with descriptions (variable heights)
|
|
28369
|
-
<Virtualizer layout={ListLayout} layoutOptions={{ estimatedRowHeight: 60 }}>
|
|
28370
|
-
<TreeView
|
|
28371
|
-
items={treeWithDescriptions}
|
|
28372
|
-
style={{ height: 600, overflow: "auto" }}
|
|
28373
|
-
/>
|
|
28374
|
-
</Virtualizer>
|
|
28375
|
-
\`\`\`
|
|
28376
|
-
|
|
28377
|
-
With virtualization:
|
|
28378
|
-
|
|
28379
|
-
* Only ~20-30 visible items rendered at once (regardless of total tree size)
|
|
28380
|
-
* Smooth scrolling up to 100,000+ items
|
|
28381
|
-
* Constant memory usage
|
|
28382
|
-
* Expand/collapse remains responsive
|
|
28383
|
-
|
|
28384
|
-
Without virtualization:
|
|
28385
|
-
|
|
28386
|
-
* All expanded items render to DOM
|
|
28387
|
-
* Performance degrades beyond ~500 items
|
|
28388
|
-
* Memory usage grows with tree size`,props:`interface TreeViewProps {
|
|
28513
|
+
} from "@baseline-ui/core";`,description:"`TreeView` displays hierarchical data as expandable, selectable, and renameable rows with optional per-item actions. Use it for file browsers, folder structures, outlines, or any nested dataset users need to navigate.",documentation:'`TreeView` displays hierarchical data as expandable, selectable, and renameable rows with optional per-item actions. Use it for file browsers, folder structures, outlines, or any nested dataset users need to navigate.\n\n* Support for mouse, touch, and keyboard interaction\n* Accessible via React Aria with full keyboard navigation\n* Support for primary and secondary action buttons on items\n* Support for inline renaming of item labels (double-click or F2)\n* Icons and descriptions on individual items\n* Controlled and uncontrolled expansion state\n* Custom item title rendering via `renderItemTitle`\n* Drag and drop to reorder items or move them into other items, with mouse and keyboard\n* Fully custom rows via `renderItem`\n* Virtualization support for large datasets (10,000+ items)\n\n```tsx\nimport { TreeView } from "@baseline-ui/core";\nconst treeItems = {\n id: "root",\n label: "Root item",\n children: [\n {\n id: "documents",\n label: "Documents",\n children: [\n {\n id: "work",\n label: "Work",\n },\n ],\n },\n ],\n};\n\n<TreeView items={treeItems} aria-label="File browser" />;\n```\n\n> **Note:** The top-level `items` object acts as a virtual root and is not rendered. Only its `children` appear in the tree.\n\nEach item can have an `icon` property that renders an icon next to the label.\n\nItems can include a `description` string, rendered below the label.\n\nA tree with no nested children \u2014 all chevrons are hidden.\n\nTrees with deep nesting (4+ levels) indent items based on depth.\n\nDemonstrates how the component handles lengthy item labels and descriptions.\n\nControl the expansion state with `expandedKeys` and `onExpandedChange`.\n\nUse `defaultExpandedKeys` for the initial expansion state. You can still expand and collapse items via interaction.\n\nUse `selectedKeys` to highlight specific items. The tree uses multi-selection mode.\n\nAdd primary and secondary action buttons to each row using `primaryActionIcon`/`secondaryActionIcon` and `onPrimaryAction`/`onSecondaryAction`. You can set the `actionsPosition` prop to `"start"` (default) or `"end"` to control their placement.\n\nPass a function to `primaryActionIcon` or `secondaryActionIcon` to render different icons per item: `(key: Key) => IconComponent`.\n\nSimilarly, `primaryActionAriaLabel` and `secondaryActionAriaLabel` accept `string | ((key: Key) => string)` for per-item labels.\n\nPass the `dragAndDropHooks` returned by `useDragAndDrop` to let users reorder items or move them into other items within the tree. Each row shows a drag handle. Drag the row from anywhere with the mouse, or focus a row, press <kbd>ArrowRight</kbd> to reach its handle (on a collapsed row with children, the first press expands it) and <kbd>Enter</kbd> to start a keyboard drag, then use the arrow keys to choose a position and press <kbd>Enter</kbd> to drop or <kbd>Escape</kbd> to cancel.\n\n`TreeView` does not change your data. Apply the move to your own `items` in the `onMove` callback, where `target.key` is the item dropped relative to and `target.dropPosition` is `"before"`, `"after"` or `"on"` (move into). `target.key` can be one of the dragged `keys` when an item is dropped back next to itself; treat that as no move rather than removing the item first. Any other option of the hook, such as `getAllowedDropOperations`, can be passed alongside `onMove`. Keep passing `dragAndDropHooks` for the tree\'s lifetime; to turn dragging off, pass `isDisabled` to `useDragAndDrop` instead of removing the prop. Items are offered as `"on"` targets even when they have no children, so a file dropped onto a file would become a folder; pass a `shouldAcceptItemDrop` that looks the target up in your own items, such as `(target) => !!findItem(items, target.key)?.children`, to accept drops only on items that already have children. To read tree fields such as `children` in your own `getItems`, pass the item type: `useDragAndDrop<TreeListItem>({ getItems })`.\n\n```tsx\nimport { TreeView, useDragAndDrop } from "@baseline-ui/core";\n\nconst { dragAndDropHooks } = useDragAndDrop({\n onMove({ keys, target }) {\n setItems((items) =>\n moveItems(items, keys, target.key, target.dropPosition),\n );\n },\n});\n\n<TreeView\n items={items}\n dragAndDropHooks={dragAndDropHooks}\n aria-label="File browser"\n/>;\n```\n\nTo start mouse and touch drags only from the handle, pass `pointerDragSource: "handle"` to `useDragAndDrop`. Users can then select text in the rename input or press other controls in the row without starting a drag. Keyboard dragging is unchanged.\n\nIt works the same in a virtualized tree.\n\nCustom rows from `renderItem` get the same drag handle, placed before your content. Style the row being dropped onto from `isDropTarget`, and the row being dragged from `isDragging`. The insertion line spans the full row; to indent it, style `.BaselineUI-DropIndicator` inside the tree.\n\nWhen rows contain text fields or other controls that handle keys themselves, pass `keyboardNavigationBehavior="tab"`. <kbd>Tab</kbd> then moves into a row\'s controls, and keys pressed in them, such as arrows and space in a text field, stay there instead of moving focus through the tree. <kbd>ArrowRight</kbd> and <kbd>ArrowLeft</kbd> on a focused row still expand and collapse it.\n\nEnable inline renaming by passing an `onRename` callback. Users can rename by double-clicking the label or pressing <kbd>F2</kbd>. Press <kbd>Enter</kbd> to confirm or <kbd>Escape</kbd> to cancel. Blurring the input (e.g., clicking outside) also confirms the rename.\n\nWith `dragAndDropHooks`, the whole row is draggable by default, so dragging the mouse across the rename input drags the row instead of selecting text. Pass `pointerDragSource: "handle"` to `useDragAndDrop` to keep text selection in the input.\n\nUse `renderItemTitle` to customize how item titles are rendered. The function receives the full `TreeListItem` and returns a `ReactNode`.\n\nUse `renderItem` to take over the whole row. It receives the `TreeListItem` and a state object (`level`, `isExpanded`, `hasChildItems`, `isSelected`, `isFocusVisible`, `isHovered`, and `toggleExpanded`) and returns the row\'s content. The tree keeps keyboard navigation, selection, focus, and expansion behavior.\n\n```tsx\nimport { ActionIconButton, TreeView } from "@baseline-ui/core";\nimport { ChevronRightIcon } from "@baseline-ui/icons/8";\n\nimport type { TreeItemRenderState, TreeListItem } from "@baseline-ui/core";\n\nconst renderItem = (\n item: TreeListItem,\n { level, isExpanded, hasChildItems, toggleExpanded }: TreeItemRenderState,\n) => (\n <div style={{ paddingInlineStart: (level - 1) * 16 }}>\n {hasChildItems ? (\n <ActionIconButton\n icon={ChevronRightIcon}\n size="xxs"\n aria-label={`${isExpanded ? "Collapse" : "Expand"} ${item.label}`}\n excludeFromTabOrder={true}\n onPress={toggleExpanded}\n />\n ) : null}\n {item.label}\n </div>\n);\n\n<TreeView items={items} renderItem={renderItem} />;\n```\n\nInstead of wiring `toggleExpanded` yourself, you can give a Baseline button `slot="chevron"`: it expands and collapses the row, stays out of the tab order, and gets a localized "Expand" or "Collapse" label. `expandLabel` and `collapseLabel` don\'t apply to it.\n\nThe custom content replaces the chevron, indentation, icon, title, description, and action buttons, as well as the row\'s padding, hover, selected, and focus styling, so draw those from the state you receive. Always draw a focus indicator from `isFocusVisible`; without one, keyboard users can\'t see which row has focus. To style the row with CSS instead, target `.BaselineUI-TreeView-Row` and its `data-focus-visible`, `data-selected`, `data-expanded`, and `data-level` attributes.\n\nThe item `label` is the row\'s only accessible name: other text you draw in the row, such as metadata or tags, isn\'t announced, so put anything screen reader users need into `label`. While `renderItem` is set, `onPrimaryAction`, `onSecondaryAction`, the action icon and label props, `actionsPosition`, `onRename`, `renameLabel`, `renderItemTitle`, `expandLabel`, and `collapseLabel` have no effect.\n\nDefine `renderItem` outside the render, or memoize it: every row re-renders whenever its identity changes. Use Baseline buttons, such as `ActionIconButton`, for controls inside the row. They handle the press without selecting the row. When virtualizing custom rows, set the layout\'s `rowHeight` to the height of your row.\n\nPass `onAction` to handle activation of tree items. The callback receives the item\'s `key` and fires when an item is activated (typically via Enter or double-click).\n\n| Selector | Description |\n| -------------------------------------- | ---------------------------------------------- |\n| `.BaselineUI-TreeView` | The root tree container |\n| `.BaselineUI-TreeView-Row` | An individual tree row |\n| `.BaselineUI-TreeView-ExpansionToggle` | The expand/collapse chevron button |\n| `.BaselineUI-TreeView-DragHandle` | The drag handle, shown with `dragAndDropHooks` |\n| `.BaselineUI-TreeView-Title` | The item label text |\n| `.BaselineUI-TreeView-Description` | The item description text |\n| `.BaselineUI-TreeView-RenameInput` | The inline rename text input |\n\n| Key | Action |\n| ---------------------- | ----------------------------------------------------------------------------- |\n| <kbd>Arrow Down</kbd> | Focus the next item |\n| <kbd>Arrow Up</kbd> | Focus the previous item |\n| <kbd>Arrow Right</kbd> | Expand the focused item, or move focus to the first child if already expanded |\n| <kbd>Arrow Left</kbd> | Collapse the focused item, or move focus to the parent if already collapsed |\n| <kbd>Enter</kbd> | Activate the focused item |\n| <kbd>Space</kbd> | Toggle selection of the focused item |\n| <kbd>Home</kbd> | Focus the first item |\n| <kbd>End</kbd> | Focus the last item |\n| <kbd>F2</kbd> | Start renaming the focused item (requires `onRename` prop) |\n| <kbd>Escape</kbd> | Cancel renaming |\n\n* **ListBox** \u2014 for flat, non-hierarchical lists\n* **Menu** \u2014 for action menus and dropdowns\n\nFor large trees with thousands of items, use virtualization to improve performance and reduce memory usage.\n\nConsider virtualization when:\n\n* Trees have 500+ total items (including nested children)\n* Trees are deeply nested (5+ levels) with many items per level\n* You need responsive scrolling on mobile devices\n* Memory usage is a concern\n\nWrap TreeView with the Virtualizer component:\n\n```tsx\nimport {\n TreeView,\n Virtualizer,\n VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS,\n} from "@baseline-ui/core";\n\n<Virtualizer {...VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS.TREE_VIEW}>\n <TreeView\n items={largeTree}\n aria-label="Large file system"\n style={{ height: 600, overflow: "auto" }}\n />\n</Virtualizer>;\n```\n\n**Important:** You must specify an explicit height on the TreeView container.\n\nThe `VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS.TREE_VIEW` preset uses a `rowHeight` of 44px. To customize row heights (e.g., for items with descriptions), pass `layout` and `layoutOptions` directly:\n\n```tsx\nimport { ListLayout, TreeView, Virtualizer } from "@baseline-ui/core";\n\n// Items without descriptions (default)\n<Virtualizer layout={ListLayout} layoutOptions={{ rowHeight: 44 }}>\n <TreeView items={tree} style={{ height: 600, overflow: "auto" }} />\n</Virtualizer>\n\n// Items with descriptions (variable heights)\n<Virtualizer layout={ListLayout} layoutOptions={{ estimatedRowHeight: 60 }}>\n <TreeView\n items={treeWithDescriptions}\n style={{ height: 600, overflow: "auto" }}\n />\n</Virtualizer>\n```\n\nWith virtualization:\n\n* Only ~20-30 visible items rendered at once (regardless of total tree size)\n* Smooth scrolling up to 100,000+ items\n* Constant memory usage\n* Expand/collapse remains responsive\n\nWithout virtualization:\n\n* All expanded items render to DOM\n* Performance degrades beyond ~500 items\n* Memory usage grows with tree size',props:`interface TreeViewProps {
|
|
28389
28514
|
/**
|
|
28390
28515
|
* @deprecated Do not use in new components. This is a legacy block
|
|
28391
28516
|
* identifier; new components should exclude it via
|
|
@@ -28533,6 +28658,43 @@ onAction?: (key: Key) => void
|
|
|
28533
28658
|
* @default item => item.label
|
|
28534
28659
|
*/
|
|
28535
28660
|
renderItemTitle?: (item: TreeListItem) => ReactNode
|
|
28661
|
+
/**
|
|
28662
|
+
* The drag and drop hooks that enable moving items within the tree. Get them
|
|
28663
|
+
* from \`useDragAndDrop\`. Keep passing them for the tree's lifetime; to turn
|
|
28664
|
+
* dragging off, pass \`isDisabled\` to \`useDragAndDrop\` instead of removing
|
|
28665
|
+
* this prop.
|
|
28666
|
+
*/
|
|
28667
|
+
dragAndDropHooks?: DragHooks<T> & DropHooks
|
|
28668
|
+
/**
|
|
28669
|
+
* How the keyboard moves focus into a row. With \`"arrow"\`, the arrow keys
|
|
28670
|
+
* move between a row and its controls. With \`"tab"\`, <kbd>Tab</kbd> moves
|
|
28671
|
+
* into a row's controls and keys pressed in them, such as arrows and space in
|
|
28672
|
+
* a text field, stay there. Use \`"tab"\` when rows contain text fields or other
|
|
28673
|
+
* controls that handle keys themselves.
|
|
28674
|
+
*
|
|
28675
|
+
* @default "arrow"
|
|
28676
|
+
*/
|
|
28677
|
+
keyboardNavigationBehavior?: "arrow" | "tab"
|
|
28678
|
+
/**
|
|
28679
|
+
* Renders the entire content of each row, replacing the chevron,
|
|
28680
|
+
* indentation, icon, title, description and actions, as well as the row's
|
|
28681
|
+
* padding, hover, selected and focus styling. The tree keeps its keyboard
|
|
28682
|
+
* navigation, selection, focus and expansion behavior, and the item \`label\`
|
|
28683
|
+
* remains the row's accessible name, so include a text label in the content
|
|
28684
|
+
* and draw a focus indicator from \`isFocusVisible\`.
|
|
28685
|
+
*
|
|
28686
|
+
* When set, \`onPrimaryAction\`, \`onSecondaryAction\`, \`primaryActionIcon\`,
|
|
28687
|
+
* \`secondaryActionIcon\`, \`primaryActionAriaLabel\`,
|
|
28688
|
+
* \`secondaryActionAriaLabel\`, \`actionsPosition\`, \`onRename\`, \`renameLabel\`,
|
|
28689
|
+
* \`renderItemTitle\`, \`expandLabel\` and \`collapseLabel\` have no effect.
|
|
28690
|
+
*
|
|
28691
|
+
* With \`dragAndDropHooks\`, the drag handle is still rendered before the
|
|
28692
|
+
* content. Style the drop target from \`isDropTarget\`.
|
|
28693
|
+
*
|
|
28694
|
+
* Every row re-renders whenever the function's identity changes, so pass a
|
|
28695
|
+
* stable function rather than an inline one.
|
|
28696
|
+
*/
|
|
28697
|
+
renderItem?: (item: TreeListItem, state: TreeItemRenderState) => ReactNode
|
|
28536
28698
|
}`,stories:{usage:[{id:"core-collections-treeview--basic",name:"Basic",snippet:`const Basic = () => <TreeView
|
|
28537
28699
|
onAction={fn()}
|
|
28538
28700
|
items={getTreeItems({ includeIcons: false, includeDescription: false })} />;`},{id:"core-collections-treeview--with-description",name:"With Description",snippet:`const WithDescription = () => <TreeView
|
|
@@ -28603,7 +28765,12 @@ renderItemTitle?: (item: TreeListItem) => ReactNode
|
|
|
28603
28765
|
>
|
|
28604
28766
|
<i style={{ color: "black" }}>{item.label}</i>
|
|
28605
28767
|
</span>
|
|
28606
|
-
)} />;`},{id:"core-collections-treeview--
|
|
28768
|
+
)} />;`},{id:"core-collections-treeview--custom-row",name:"Custom Row",snippet:`const CustomRow = () => <TreeView
|
|
28769
|
+
onAction={fn()}
|
|
28770
|
+
items={fileItems}
|
|
28771
|
+
defaultExpandedKeys={["contracts"]}
|
|
28772
|
+
selectedKeys={["msa"]}
|
|
28773
|
+
renderItem={renderFileRow} />;`},{id:"core-collections-treeview--with-selected-items",name:"With Selected Items",snippet:`const WithSelectedItems = () => <TreeView
|
|
28607
28774
|
onAction={fn()}
|
|
28608
28775
|
items={getTreeItems({ includeIcons: true, includeDescription: false })}
|
|
28609
28776
|
selectedKeys={["documents", "pictures"]} />;`},{id:"core-collections-treeview--empty-tree",name:"Empty Tree",snippet:'const EmptyTree = () => <TreeView onAction={fn()} items={{ id: "root", label: "Root" }} />;'},{id:"core-collections-treeview--single-item",name:"Single Item",snippet:`const SingleItem = () => <TreeView
|
|
@@ -28684,11 +28851,21 @@ renderItemTitle?: (item: TreeListItem) => ReactNode
|
|
|
28684
28851
|
}} />;`},{id:"core-collections-treeview--with-virtualization",name:"With Virtualization",snippet:'const WithVirtualization = () => <VirtualizedTreeViewExample onAction={fn()} aria-label="Virtualized tree with 10,000+ items" />;'},{id:"core-collections-treeview--virtualized-with-descriptions",name:"Virtualized With Descriptions",snippet:'const VirtualizedWithDescriptions = () => <VirtualizedTreeViewWithDescriptionsExample onAction={fn()} aria-label="Virtualized tree with descriptions" />;'},{id:"core-collections-treeview--virtualized-with-expand-control",name:"Virtualized With Expand Control",snippet:'const VirtualizedWithExpandControl = () => <VirtualizedTreeViewWithExpandControlExample onAction={fn()} aria-label="Virtualized tree with expand control" />;'},{id:"core-collections-treeview--virtualized-with-actions",name:"Virtualized With Actions",snippet:'const VirtualizedWithActions = () => <VirtualizedTreeViewWithActionsExample onAction={fn()} aria-label="Virtualized tree with actions" />;'},{id:"core-collections-treeview--virtualized-with-rename",name:"Virtualized With Rename",snippet:`const VirtualizedWithRename = () => <VirtualizedTreeViewWithRenameExample
|
|
28685
28852
|
onAction={fn()}
|
|
28686
28853
|
aria-label="Virtualized tree with rename support"
|
|
28687
|
-
onRename={fn()} />;`}
|
|
28854
|
+
onRename={fn()} />;`},{id:"core-collections-treeview--drag-and-drop",name:"Drag And Drop",snippet:"const DragAndDrop = () => <DragAndDropTreeViewExample />;"},{id:"core-collections-treeview--handle-only-drag-and-drop",name:"Handle Only Drag And Drop",snippet:`const HandleOnlyDragAndDrop = () => (
|
|
28855
|
+
<DragAndDropTreeViewExample pointerDragSource="handle" onRename={fn()} />
|
|
28856
|
+
);`},{id:"core-collections-treeview--interactive-fields-drag-and-drop",name:"Interactive Fields Drag And Drop",snippet:"const InteractiveFieldsDragAndDrop = () => <InteractiveFieldsDragAndDropExample />;"},{id:"core-collections-treeview--virtualized-drag-and-drop",name:"Virtualized Drag And Drop",snippet:"const VirtualizedDragAndDrop = () => <DragAndDropTreeViewExample virtualized={true} />;"},{id:"core-collections-treeview--custom-row-drag-and-drop",name:"Custom Row Drag And Drop",snippet:`const CustomRowDragAndDrop = () => (
|
|
28857
|
+
<DragAndDropTreeViewExample items={fileItems} renderItem={renderFileRow} />
|
|
28858
|
+
);`}],implementation:`import { ChevronRightIcon } from "@baseline-ui/icons/8";
|
|
28859
|
+
import { EllipseIcon, PlusIcon, TrashIcon } from "@baseline-ui/icons/16";
|
|
28688
28860
|
import React, { useMemo, useState } from "react";
|
|
28861
|
+
import { useTreeData } from "react-stately/useTreeData";
|
|
28689
28862
|
|
|
28690
28863
|
import { ActionButton } from "../../ActionButton";
|
|
28864
|
+
import { ActionIconButton } from "../../ActionIconButton";
|
|
28691
28865
|
import { Box } from "../../Box";
|
|
28866
|
+
import { Checkbox } from "../../Checkbox";
|
|
28867
|
+
import { TextInput } from "../../TextInput";
|
|
28868
|
+
import { useDragAndDrop } from "../../UNSAFE_ListBox/hooks/useDragAndDrop";
|
|
28692
28869
|
import {
|
|
28693
28870
|
ListLayout,
|
|
28694
28871
|
VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS,
|
|
@@ -28697,8 +28874,12 @@ import {
|
|
|
28697
28874
|
import { TreeView } from "../TreeView";
|
|
28698
28875
|
import { generateLargeTree, getTreeItems } from "./data";
|
|
28699
28876
|
|
|
28700
|
-
import type {
|
|
28701
|
-
|
|
28877
|
+
import type {
|
|
28878
|
+
TreeItemRenderState,
|
|
28879
|
+
TreeListItem,
|
|
28880
|
+
TreeViewProps,
|
|
28881
|
+
} from "../TreeView.types";
|
|
28882
|
+
import type { DropPosition, Key } from "@react-types/shared";
|
|
28702
28883
|
|
|
28703
28884
|
export function TreeViewWithPrimaryAction({
|
|
28704
28885
|
onPrimaryAction,
|
|
@@ -28772,6 +28953,125 @@ export function TreeViewWithCustomTitle(): React.JSX.Element {
|
|
|
28772
28953
|
);
|
|
28773
28954
|
}
|
|
28774
28955
|
|
|
28956
|
+
function CustomRow({
|
|
28957
|
+
item,
|
|
28958
|
+
state,
|
|
28959
|
+
useChevronSlot,
|
|
28960
|
+
}: {
|
|
28961
|
+
item: TreeListItem;
|
|
28962
|
+
state: TreeItemRenderState;
|
|
28963
|
+
useChevronSlot?: boolean;
|
|
28964
|
+
}): React.JSX.Element {
|
|
28965
|
+
return (
|
|
28966
|
+
<div
|
|
28967
|
+
style={{
|
|
28968
|
+
display: "flex",
|
|
28969
|
+
alignItems: "center",
|
|
28970
|
+
gap: 8,
|
|
28971
|
+
paddingInlineStart: (state.level - 1) * 16,
|
|
28972
|
+
}}
|
|
28973
|
+
>
|
|
28974
|
+
{state.hasChildItems && useChevronSlot ? (
|
|
28975
|
+
<ActionIconButton slot="chevron" icon={ChevronRightIcon} size="xxs" />
|
|
28976
|
+
) : null}
|
|
28977
|
+
{state.hasChildItems && !useChevronSlot ? (
|
|
28978
|
+
<ActionIconButton
|
|
28979
|
+
icon={ChevronRightIcon}
|
|
28980
|
+
size="xxs"
|
|
28981
|
+
aria-label={\`Toggle \${item.label}\`}
|
|
28982
|
+
excludeFromTabOrder={true}
|
|
28983
|
+
onPress={state.toggleExpanded}
|
|
28984
|
+
/>
|
|
28985
|
+
) : null}
|
|
28986
|
+
<span>{item.label}</span>
|
|
28987
|
+
<span>{\`level \${state.level}\`}</span>
|
|
28988
|
+
{state.isExpanded ? <span>expanded</span> : null}
|
|
28989
|
+
{state.isSelected ? <span>selected</span> : null}
|
|
28990
|
+
{state.isFocusVisible ? <span>focus visible</span> : null}
|
|
28991
|
+
{state.isDropTarget ? <span>drop target</span> : null}
|
|
28992
|
+
{state.isDragging ? <span>dragging</span> : null}
|
|
28993
|
+
</div>
|
|
28994
|
+
);
|
|
28995
|
+
}
|
|
28996
|
+
|
|
28997
|
+
export function TreeViewWithCustomRow({
|
|
28998
|
+
useChevronSlot,
|
|
28999
|
+
}: {
|
|
29000
|
+
useChevronSlot?: boolean;
|
|
29001
|
+
}): React.JSX.Element {
|
|
29002
|
+
return (
|
|
29003
|
+
<TreeView
|
|
29004
|
+
items={getTreeItems({})}
|
|
29005
|
+
renderItem={(item, state) => (
|
|
29006
|
+
<CustomRow item={item} state={state} useChevronSlot={useChevronSlot} />
|
|
29007
|
+
)}
|
|
29008
|
+
/>
|
|
29009
|
+
);
|
|
29010
|
+
}
|
|
29011
|
+
|
|
29012
|
+
export function TreeViewWithChangingChildren(): React.JSX.Element {
|
|
29013
|
+
const [changed, setChanged] = useState(false);
|
|
29014
|
+
const items = useMemo(() => {
|
|
29015
|
+
const tree = getTreeItems({});
|
|
29016
|
+
if (!changed) return tree;
|
|
29017
|
+
return {
|
|
29018
|
+
...tree,
|
|
29019
|
+
children: tree.children?.map((child: TreeListItem) =>
|
|
29020
|
+
child.id === "documents"
|
|
29021
|
+
? {
|
|
29022
|
+
...child,
|
|
29023
|
+
children: [
|
|
29024
|
+
{ id: "archive", label: "Archive" },
|
|
29025
|
+
...(child.children ?? []),
|
|
29026
|
+
],
|
|
29027
|
+
}
|
|
29028
|
+
: child,
|
|
29029
|
+
),
|
|
29030
|
+
};
|
|
29031
|
+
}, [changed]);
|
|
29032
|
+
|
|
29033
|
+
return (
|
|
29034
|
+
<Box display="flex" flexDirection="column" gap="md">
|
|
29035
|
+
<ActionButton
|
|
29036
|
+
label="Change children"
|
|
29037
|
+
onPress={() => {
|
|
29038
|
+
setChanged(true);
|
|
29039
|
+
}}
|
|
29040
|
+
/>
|
|
29041
|
+
<TreeView
|
|
29042
|
+
items={items}
|
|
29043
|
+
aria-label="Files"
|
|
29044
|
+
defaultExpandedKeys={["documents"]}
|
|
29045
|
+
/>
|
|
29046
|
+
</Box>
|
|
29047
|
+
);
|
|
29048
|
+
}
|
|
29049
|
+
|
|
29050
|
+
export function TreeViewWithSwappableRow(): React.JSX.Element {
|
|
29051
|
+
const [swapped, setSwapped] = useState(false);
|
|
29052
|
+
const items = useMemo(() => getTreeItems({}), []);
|
|
29053
|
+
|
|
29054
|
+
return (
|
|
29055
|
+
<Box display="flex" flexDirection="column" gap="md">
|
|
29056
|
+
<ActionButton
|
|
29057
|
+
label="Swap row"
|
|
29058
|
+
onPress={() => {
|
|
29059
|
+
setSwapped(true);
|
|
29060
|
+
}}
|
|
29061
|
+
/>
|
|
29062
|
+
<TreeView
|
|
29063
|
+
items={items}
|
|
29064
|
+
defaultExpandedKeys={["documents"]}
|
|
29065
|
+
renderItem={(item) => (
|
|
29066
|
+
<span>
|
|
29067
|
+
{swapped ? \`After: \${item.label}\` : \`Before: \${item.label}\`}
|
|
29068
|
+
</span>
|
|
29069
|
+
)}
|
|
29070
|
+
/>
|
|
29071
|
+
</Box>
|
|
29072
|
+
);
|
|
29073
|
+
}
|
|
29074
|
+
|
|
28775
29075
|
// Example 1: Basic virtualization
|
|
28776
29076
|
export const VirtualizedTreeViewExample: React.FC<
|
|
28777
29077
|
Omit<React.ComponentProps<typeof TreeView>, "items"> & {
|
|
@@ -28930,7 +29230,177 @@ export const VirtualizedTreeViewWithRenameExample: React.FC<
|
|
|
28930
29230
|
/>
|
|
28931
29231
|
</Virtualizer>
|
|
28932
29232
|
);
|
|
28933
|
-
}
|
|
29233
|
+
};
|
|
29234
|
+
|
|
29235
|
+
type TreeNode = ReturnType<typeof useTreeData<TreeListItem>>["items"][number];
|
|
29236
|
+
|
|
29237
|
+
function toTreeListItem(node: TreeNode): TreeListItem {
|
|
29238
|
+
// useTreeData gives leaves an empty array; keep them leaves.
|
|
29239
|
+
const isLeaf = !node.value.children && !node.children?.length;
|
|
29240
|
+
return {
|
|
29241
|
+
...node.value,
|
|
29242
|
+
children: isLeaf
|
|
29243
|
+
? undefined
|
|
29244
|
+
: node.children?.map((child) => toTreeListItem(child)),
|
|
29245
|
+
};
|
|
29246
|
+
}
|
|
29247
|
+
|
|
29248
|
+
const renderCustomRow: TreeViewProps["renderItem"] = (item, state) => (
|
|
29249
|
+
<CustomRow item={item} state={state} />
|
|
29250
|
+
);
|
|
29251
|
+
|
|
29252
|
+
export const DragAndDropTreeViewExample: React.FC<{
|
|
29253
|
+
onMove?: (move: {
|
|
29254
|
+
keys: Key[];
|
|
29255
|
+
key: Key;
|
|
29256
|
+
dropPosition: DropPosition;
|
|
29257
|
+
}) => void;
|
|
29258
|
+
virtualized?: boolean;
|
|
29259
|
+
customRow?: boolean;
|
|
29260
|
+
actionsPosition?: TreeViewProps["actionsPosition"];
|
|
29261
|
+
withActions?: boolean;
|
|
29262
|
+
items?: TreeListItem;
|
|
29263
|
+
renderItem?: TreeViewProps["renderItem"];
|
|
29264
|
+
onRename?: TreeViewProps["onRename"];
|
|
29265
|
+
pointerDragSource?: "item" | "handle";
|
|
29266
|
+
keyboardNavigationBehavior?: TreeViewProps["keyboardNavigationBehavior"];
|
|
29267
|
+
}> = ({
|
|
29268
|
+
onMove,
|
|
29269
|
+
virtualized = false,
|
|
29270
|
+
customRow = false,
|
|
29271
|
+
actionsPosition,
|
|
29272
|
+
withActions = false,
|
|
29273
|
+
items,
|
|
29274
|
+
renderItem,
|
|
29275
|
+
onRename,
|
|
29276
|
+
pointerDragSource,
|
|
29277
|
+
keyboardNavigationBehavior,
|
|
29278
|
+
}) => {
|
|
29279
|
+
const initialItems = useMemo(
|
|
29280
|
+
() =>
|
|
29281
|
+
items ??
|
|
29282
|
+
(virtualized
|
|
29283
|
+
? generateLargeTree({ itemsPerLevel: 100, maxDepth: 1 })
|
|
29284
|
+
: getTreeItems({})),
|
|
29285
|
+
[items, virtualized],
|
|
29286
|
+
);
|
|
29287
|
+
const tree = useTreeData({
|
|
29288
|
+
initialItems: initialItems.children ?? [],
|
|
29289
|
+
getKey: (item) => item.id,
|
|
29290
|
+
getChildren: (item) => item.children ?? [],
|
|
29291
|
+
});
|
|
29292
|
+
|
|
29293
|
+
const { dragAndDropHooks } = useDragAndDrop<TreeListItem>({
|
|
29294
|
+
pointerDragSource,
|
|
29295
|
+
onMove({ keys, target }) {
|
|
29296
|
+
onMove?.({
|
|
29297
|
+
keys: [...keys],
|
|
29298
|
+
key: target.key,
|
|
29299
|
+
dropPosition: target.dropPosition,
|
|
29300
|
+
});
|
|
29301
|
+
if (target.dropPosition === "before") {
|
|
29302
|
+
tree.moveBefore(target.key, keys);
|
|
29303
|
+
} else if (target.dropPosition === "after") {
|
|
29304
|
+
tree.moveAfter(target.key, keys);
|
|
29305
|
+
} else {
|
|
29306
|
+
const index = tree.getItem(target.key)?.children?.length ?? 0;
|
|
29307
|
+
for (const [i, key] of [...keys].entries()) {
|
|
29308
|
+
tree.move(key, target.key, index + i);
|
|
29309
|
+
}
|
|
29310
|
+
}
|
|
29311
|
+
},
|
|
29312
|
+
});
|
|
29313
|
+
|
|
29314
|
+
const treeItems = useMemo(
|
|
29315
|
+
() => ({
|
|
29316
|
+
...initialItems,
|
|
29317
|
+
children: tree.items.map((node) => toTreeListItem(node)),
|
|
29318
|
+
}),
|
|
29319
|
+
[initialItems, tree.items],
|
|
29320
|
+
);
|
|
29321
|
+
|
|
29322
|
+
const treeView = (
|
|
29323
|
+
<TreeView
|
|
29324
|
+
aria-label="Drag and drop tree"
|
|
29325
|
+
items={treeItems}
|
|
29326
|
+
dragAndDropHooks={dragAndDropHooks}
|
|
29327
|
+
keyboardNavigationBehavior={keyboardNavigationBehavior}
|
|
29328
|
+
actionsPosition={actionsPosition}
|
|
29329
|
+
{...(withActions && {
|
|
29330
|
+
primaryActionIcon: PlusIcon,
|
|
29331
|
+
primaryActionAriaLabel: "Add",
|
|
29332
|
+
secondaryActionIcon: TrashIcon,
|
|
29333
|
+
secondaryActionAriaLabel: "Delete",
|
|
29334
|
+
})}
|
|
29335
|
+
onRename={onRename}
|
|
29336
|
+
renderItem={renderItem ?? (customRow ? renderCustomRow : undefined)}
|
|
29337
|
+
style={
|
|
29338
|
+
virtualized ? { height: 600, width: 400, overflow: "auto" } : undefined
|
|
29339
|
+
}
|
|
29340
|
+
/>
|
|
29341
|
+
);
|
|
29342
|
+
|
|
29343
|
+
return virtualized ? (
|
|
29344
|
+
<Virtualizer {...VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS.TREE_VIEW}>
|
|
29345
|
+
{treeView}
|
|
29346
|
+
</Virtualizer>
|
|
29347
|
+
) : (
|
|
29348
|
+
treeView
|
|
29349
|
+
);
|
|
29350
|
+
};
|
|
29351
|
+
|
|
29352
|
+
const renderFieldRow: TreeViewProps["renderItem"] = (item, state) => (
|
|
29353
|
+
<Box
|
|
29354
|
+
display="flex"
|
|
29355
|
+
alignItems="center"
|
|
29356
|
+
gap="md"
|
|
29357
|
+
paddingX="md"
|
|
29358
|
+
paddingY="sm"
|
|
29359
|
+
backgroundColor={
|
|
29360
|
+
state.isSelected
|
|
29361
|
+
? "background.primary.strong"
|
|
29362
|
+
: "background.primary.subtle"
|
|
29363
|
+
}
|
|
29364
|
+
outlineColor={
|
|
29365
|
+
state.isFocusVisible || state.isDropTarget
|
|
29366
|
+
? "focused.default"
|
|
29367
|
+
: "transparent"
|
|
29368
|
+
}
|
|
29369
|
+
outlineWidth={2}
|
|
29370
|
+
outlineStyle="solid"
|
|
29371
|
+
outlineOffset={-2}
|
|
29372
|
+
style={{ paddingInlineStart: (state.level - 1) * 24 }}
|
|
29373
|
+
>
|
|
29374
|
+
{state.hasChildItems ? (
|
|
29375
|
+
<ActionIconButton
|
|
29376
|
+
icon={ChevronRightIcon}
|
|
29377
|
+
size="xxs"
|
|
29378
|
+
variant="secondary"
|
|
29379
|
+
aria-label={\`\${state.isExpanded ? "Collapse" : "Expand"} \${item.label}\`}
|
|
29380
|
+
excludeFromTabOrder={true}
|
|
29381
|
+
onPress={state.toggleExpanded}
|
|
29382
|
+
style={{ rotate: state.isExpanded ? "90deg" : undefined }}
|
|
29383
|
+
/>
|
|
29384
|
+
) : null}
|
|
29385
|
+
<TextInput
|
|
29386
|
+
aria-label={\`Name of \${item.label}\`}
|
|
29387
|
+
defaultValue={item.label}
|
|
29388
|
+
style={{ flex: 1, minWidth: 0 }}
|
|
29389
|
+
/>
|
|
29390
|
+
<Checkbox label="Visible" defaultSelected={true} />
|
|
29391
|
+
</Box>
|
|
29392
|
+
);
|
|
29393
|
+
|
|
29394
|
+
export const InteractiveFieldsDragAndDropExample: React.FC<{
|
|
29395
|
+
onMove?: React.ComponentProps<typeof DragAndDropTreeViewExample>["onMove"];
|
|
29396
|
+
}> = ({ onMove }) => (
|
|
29397
|
+
<DragAndDropTreeViewExample
|
|
29398
|
+
pointerDragSource="handle"
|
|
29399
|
+
keyboardNavigationBehavior="tab"
|
|
29400
|
+
renderItem={renderFieldRow}
|
|
29401
|
+
onMove={onMove}
|
|
29402
|
+
/>
|
|
29403
|
+
);`},similarTo:[],figmaUrl:null},UNSAFE_ListBox:{id:"core-collections-unsafe-listbox",breadcrumb:"Core/Collections/UNSAFE_ListBox",importStatement:`import {
|
|
28934
29404
|
DragAndDropListBoxExample,
|
|
28935
29405
|
DynamicListBoxExample,
|
|
28936
29406
|
UNSAFE_ListBox as ListBox,
|
|
@@ -29261,7 +29731,7 @@ label?: React.ReactNode
|
|
|
29261
29731
|
/**
|
|
29262
29732
|
* Handle to access the listbox methods.
|
|
29263
29733
|
*/
|
|
29264
|
-
listBoxHandle?: React.RefObject<ListHandle>
|
|
29734
|
+
listBoxHandle?: React.RefObject<ListHandle | null>
|
|
29265
29735
|
}`,stories:{usage:[{id:"core-collections-unsafe-listbox--basic",name:"Basic",snippet:'const Basic = () => <ListBox items={items} aria-label="List box" onAction={fn()} />;'},{id:"core-collections-unsafe-listbox--with-focus-loop",name:"With Focus Loop",snippet:'const WithFocusLoop = () => <ListBox items={items} aria-label="List box" shouldFocusWrap onAction={fn()} />;'},{id:"core-collections-unsafe-listbox--with-default-selected",name:"With Default Selected",snippet:`const WithDefaultSelected = () => <ListBox
|
|
29266
29736
|
items={items}
|
|
29267
29737
|
aria-label="List box"
|
|
@@ -29866,7 +30336,9 @@ export const VirtualListBoxGridLayoutWithOutsideClickTargetExample: React.FC<
|
|
|
29866
30336
|
);
|
|
29867
30337
|
};
|
|
29868
30338
|
|
|
29869
|
-
export const ScrollIntoViewExample: React.FC = (
|
|
30339
|
+
export const ScrollIntoViewExample: React.FC<{ idPrefix?: string }> = ({
|
|
30340
|
+
idPrefix = "item-",
|
|
30341
|
+
}) => {
|
|
29870
30342
|
const listBoxHandle = React.useRef<ListHandle>(null);
|
|
29871
30343
|
|
|
29872
30344
|
return (
|
|
@@ -29874,11 +30346,11 @@ export const ScrollIntoViewExample: React.FC = () => {
|
|
|
29874
30346
|
<Box display="flex" gap="sm">
|
|
29875
30347
|
<ActionButton
|
|
29876
30348
|
label="Scroll to Item 0"
|
|
29877
|
-
onPress={() => listBoxHandle.current?.scrollIntoView(
|
|
30349
|
+
onPress={() => listBoxHandle.current?.scrollIntoView(\`\${idPrefix}0\`)}
|
|
29878
30350
|
/>
|
|
29879
30351
|
<ActionButton
|
|
29880
30352
|
label="Scroll to Item 15"
|
|
29881
|
-
onPress={() => listBoxHandle.current?.scrollIntoView(
|
|
30353
|
+
onPress={() => listBoxHandle.current?.scrollIntoView(\`\${idPrefix}15\`)}
|
|
29882
30354
|
/>
|
|
29883
30355
|
</Box>
|
|
29884
30356
|
|
|
@@ -29891,7 +30363,7 @@ export const ScrollIntoViewExample: React.FC = () => {
|
|
|
29891
30363
|
>
|
|
29892
30364
|
<ListBox
|
|
29893
30365
|
items={Array.from({ length: 20 }).map((_, i) => ({
|
|
29894
|
-
id:
|
|
30366
|
+
id: \`\${idPrefix}\${i}\`,
|
|
29895
30367
|
label: \`Item \${i}\`,
|
|
29896
30368
|
}))}
|
|
29897
30369
|
listBoxHandle={listBoxHandle}
|
|
@@ -30340,6 +30812,10 @@ layout: LayoutClass<O> | ILayout<O>
|
|
|
30340
30812
|
* Options for the layout.
|
|
30341
30813
|
*/
|
|
30342
30814
|
layoutOptions?: O
|
|
30815
|
+
/**
|
|
30816
|
+
* Whether to observe each item's size with a ResizeObserver and re-measure when it changes.
|
|
30817
|
+
*/
|
|
30818
|
+
shouldObserveItemSize?: boolean
|
|
30343
30819
|
}`,stories:{usage:[{id:"core-collections-virtualizer--list-layout-example",name:"ListLayoutExample",error:{name:"SyntaxError",message:`Expected story to be a function or variable declaration
|
|
30344
30820
|
10 | export default meta;
|
|
30345
30821
|
11 |
|
|
@@ -30365,7 +30841,13 @@ layoutOptions?: O
|
|
|
30365
30841
|
14 | export { WithVirtualization as TreeViewPresetExample } from "../TreeView/TreeView.stories";
|
|
30366
30842
|
> 15 | export { RTLWithVirtualization as RTLImageGalleryPresetExample } from "../ImageGallery/ImageGallery.stories";
|
|
30367
30843
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
30368
|
-
16 |`}}],implementation:""},similarTo:[],figmaUrl:null},AccordionItem:{id:"core-navigation-accordion-accordionitem",importStatement
|
|
30844
|
+
16 |`}}],implementation:""},similarTo:[],figmaUrl:null},AccordionItem:{id:"core-navigation-accordion-accordionitem",importStatement:`import {
|
|
30845
|
+
Accordion,
|
|
30846
|
+
AccordionForceMountExample,
|
|
30847
|
+
AccordionItem,
|
|
30848
|
+
AccordionItemExample,
|
|
30849
|
+
Checkbox,
|
|
30850
|
+
} from "@baseline-ui/core";`,description:"",documentation:null,props:`interface AccordionItemProps {
|
|
30369
30851
|
/**
|
|
30370
30852
|
* @deprecated Do not use in new components. This is a legacy block
|
|
30371
30853
|
* identifier; new components should exclude it via
|
|
@@ -30445,6 +30927,18 @@ value: Key
|
|
|
30445
30927
|
* the accordion header.
|
|
30446
30928
|
*/
|
|
30447
30929
|
subLabel?: string
|
|
30930
|
+
/**
|
|
30931
|
+
* Keeps the content mounted while the item is collapsed, so its state (for
|
|
30932
|
+
* example, typed input) is preserved. Once the collapse animation completes,
|
|
30933
|
+
* the content is hidden from view and from assistive technology.
|
|
30934
|
+
*
|
|
30935
|
+
* The content renders even if the item is never expanded, and content of an
|
|
30936
|
+
* initially collapsed item mounts hidden, so it measures zero sizes until the
|
|
30937
|
+
* first expand. Set this up front: toggling it remounts the content.
|
|
30938
|
+
*
|
|
30939
|
+
* @default false
|
|
30940
|
+
*/
|
|
30941
|
+
shouldForceMount?: boolean
|
|
30448
30942
|
/**
|
|
30449
30943
|
* @internal
|
|
30450
30944
|
*/
|
|
@@ -30465,13 +30959,15 @@ index?: number
|
|
|
30465
30959
|
title="Accordion Item"
|
|
30466
30960
|
value="item"
|
|
30467
30961
|
showActionsOnTriggerOnly>{undefined}</AccordionItemExample>
|
|
30468
|
-
</Accordion>;`}],implementation:`import { EllipseIcon } from "@baseline-ui/icons/16";
|
|
30962
|
+
</Accordion>;`},{id:"core-navigation-accordion-accordionitem--force-mount",name:"Force Mount",snippet:'const ForceMount = () => <AccordionForceMountExample shouldForceMount defaultExpandedKeys={new Set(["item-1"])} />;'}],implementation:`import { EllipseIcon } from "@baseline-ui/icons/16";
|
|
30469
30963
|
import { themeVars } from "@baseline-ui/tokens";
|
|
30470
30964
|
import React from "react";
|
|
30471
30965
|
|
|
30472
30966
|
import { Accordion } from "../Accordion";
|
|
30473
30967
|
import { AccordionItem } from "../AccordionItem";
|
|
30474
30968
|
|
|
30969
|
+
import type { Key } from "react";
|
|
30970
|
+
|
|
30475
30971
|
const contentStyle = {
|
|
30476
30972
|
padding: 10,
|
|
30477
30973
|
color: themeVars.color.text.primary,
|
|
@@ -30553,6 +31049,74 @@ export const AccordionWithDisabledItemsExample: React.FC<
|
|
|
30553
31049
|
Omit<React.ComponentProps<typeof AccordionExample>, "disabledKeys">
|
|
30554
31050
|
> = (props) => {
|
|
30555
31051
|
return <AccordionExample {...props} disabledKeys={new Set(["item-1"])} />;
|
|
31052
|
+
};
|
|
31053
|
+
|
|
31054
|
+
export const AccordionWithLastItemDisabledExample: React.FC<
|
|
31055
|
+
Omit<React.ComponentProps<typeof AccordionExample>, "disabledKeys">
|
|
31056
|
+
> = (props) => {
|
|
31057
|
+
return <AccordionExample {...props} disabledKeys={new Set(["item-3"])} />;
|
|
31058
|
+
};
|
|
31059
|
+
|
|
31060
|
+
export const AccordionWithNumericKeysExample: React.FC = () => {
|
|
31061
|
+
return (
|
|
31062
|
+
<Accordion disabledKeys={new Set([2])}>
|
|
31063
|
+
{[1, 2, 3].map((n) => (
|
|
31064
|
+
<AccordionItem
|
|
31065
|
+
key={n}
|
|
31066
|
+
title={\`Accordion Item \${n}\`}
|
|
31067
|
+
value={n}
|
|
31068
|
+
style={contentStyle}
|
|
31069
|
+
>
|
|
31070
|
+
lorem ipsum dolor sit amet consectetur adipisicing elit
|
|
31071
|
+
</AccordionItem>
|
|
31072
|
+
))}
|
|
31073
|
+
</Accordion>
|
|
31074
|
+
);
|
|
31075
|
+
};
|
|
31076
|
+
|
|
31077
|
+
export const AccordionForceMountExample: React.FC<
|
|
31078
|
+
Omit<React.ComponentProps<typeof Accordion>, "children"> & {
|
|
31079
|
+
shouldForceMount?: boolean;
|
|
31080
|
+
/** Playwright CT cannot pass a \`Set\` prop, so specs pass a key instead. */
|
|
31081
|
+
defaultExpandedKey?: string;
|
|
31082
|
+
}
|
|
31083
|
+
> = ({ shouldForceMount, defaultExpandedKey, ...props }) => {
|
|
31084
|
+
return (
|
|
31085
|
+
<Accordion
|
|
31086
|
+
{...props}
|
|
31087
|
+
{...(defaultExpandedKey && {
|
|
31088
|
+
defaultExpandedKeys: new Set([defaultExpandedKey]),
|
|
31089
|
+
})}
|
|
31090
|
+
>
|
|
31091
|
+
{Array.from({ length: 2 }).map((_, i) => (
|
|
31092
|
+
<AccordionItem
|
|
31093
|
+
key={i}
|
|
31094
|
+
title={\`Accordion Item \${i + 1}\`}
|
|
31095
|
+
value={\`item-\${i + 1}\`}
|
|
31096
|
+
style={contentStyle}
|
|
31097
|
+
shouldForceMount={shouldForceMount}
|
|
31098
|
+
>
|
|
31099
|
+
<input aria-label={\`Item \${i + 1} input\`} />
|
|
31100
|
+
</AccordionItem>
|
|
31101
|
+
))}
|
|
31102
|
+
</Accordion>
|
|
31103
|
+
);
|
|
31104
|
+
};
|
|
31105
|
+
|
|
31106
|
+
export const ControlledAccordionExample: React.FC<{
|
|
31107
|
+
onChange?: (keys: Set<Key>) => void;
|
|
31108
|
+
}> = ({ onChange }) => {
|
|
31109
|
+
const [keys, setKeys] = React.useState<Set<Key>>(new Set());
|
|
31110
|
+
|
|
31111
|
+
return (
|
|
31112
|
+
<AccordionExample
|
|
31113
|
+
expandedKeys={keys}
|
|
31114
|
+
onChange={(k) => {
|
|
31115
|
+
setKeys(k);
|
|
31116
|
+
onChange?.(k);
|
|
31117
|
+
}}
|
|
31118
|
+
/>
|
|
31119
|
+
);
|
|
30556
31120
|
};`},similarTo:[],figmaUrl:null},IconColorInput:{id:"core-forms-colorinput-iconcolorinput",importStatement:'import { Box, IconColorInput } from "@baseline-ui/core";',description:"",documentation:null,props:`interface IconColorInputProps {
|
|
30557
31121
|
/**
|
|
30558
31122
|
* @deprecated Do not use in new components. This is a legacy block
|
|
@@ -30632,7 +31196,7 @@ variant?: "compact" | "standard"
|
|
|
30632
31196
|
indeterminateIcon={null} />
|
|
30633
31197
|
</Box>
|
|
30634
31198
|
);
|
|
30635
|
-
};`}],implementation:`import { EllipseIcon } from "@baseline-ui/icons/24";
|
|
31199
|
+
};`}],implementation:`import { BorderColorIcon, EllipseIcon } from "@baseline-ui/icons/24";
|
|
30636
31200
|
import React, { useState } from "react";
|
|
30637
31201
|
|
|
30638
31202
|
import { ActionButton } from "../../ActionButton";
|
|
@@ -30640,8 +31204,10 @@ import { ActionIconButton } from "../../ActionIconButton";
|
|
|
30640
31204
|
import { Box } from "../../Box";
|
|
30641
31205
|
import { Text } from "../../Text";
|
|
30642
31206
|
import { ColorInput } from "../ColorInput";
|
|
31207
|
+
import { IconColorInput } from "../IconColorInput";
|
|
31208
|
+
import { presets } from "./data";
|
|
30643
31209
|
|
|
30644
|
-
import type { ColorInputProps } from "../ColorInput.types";
|
|
31210
|
+
import type { ColorInputProps, IconColorInputProps } from "../ColorInput.types";
|
|
30645
31211
|
|
|
30646
31212
|
export const CustomTriggerButton = () => {
|
|
30647
31213
|
return (
|
|
@@ -30744,7 +31310,21 @@ export const IndeterminateWithCustomColorLabel: React.FC<ColorInputProps> = (
|
|
|
30744
31310
|
}
|
|
30745
31311
|
/>
|
|
30746
31312
|
);
|
|
30747
|
-
}
|
|
31313
|
+
};
|
|
31314
|
+
|
|
31315
|
+
export const StoredCustomColorsExample: React.FC<{ storageKey: string }> = ({
|
|
31316
|
+
storageKey,
|
|
31317
|
+
}) => (
|
|
31318
|
+
<ColorInput
|
|
31319
|
+
presets={presets}
|
|
31320
|
+
defaultValue="#000000"
|
|
31321
|
+
storePickedColorKey={storageKey}
|
|
31322
|
+
/>
|
|
31323
|
+
);
|
|
31324
|
+
|
|
31325
|
+
export const IconColorInputExample: React.FC<
|
|
31326
|
+
Omit<IconColorInputProps, "icon">
|
|
31327
|
+
> = (props) => <IconColorInput icon={BorderColorIcon} {...props} />;`},similarTo:[],figmaUrl:null},Icon:{id:"core-miscellaneous-icon",importStatement:'import { Icon } from "@baseline-ui/core";',description:"",documentation:null,props:`interface IconProps {
|
|
30748
31328
|
/**
|
|
30749
31329
|
* The \`className\` property assigned to the SVG element of the component.
|
|
30750
31330
|
*/
|
|
@@ -31457,7 +32037,7 @@ gridLines?: GridLines | ((options: Options) => GridLines)
|
|
|
31457
32037
|
*/
|
|
31458
32038
|
elementHandle?: React.RefObject<{
|
|
31459
32039
|
focus: () => void;
|
|
31460
|
-
}>
|
|
32040
|
+
} | null>
|
|
31461
32041
|
/**
|
|
31462
32042
|
* The callback function that is called when the cursor is moved.
|
|
31463
32043
|
*
|
|
@@ -32098,7 +32678,29 @@ export const TrailingElementExample = () => {
|
|
|
32098
32678
|
</PointPickerContent>
|
|
32099
32679
|
</PointPicker>
|
|
32100
32680
|
);
|
|
32101
|
-
}
|
|
32681
|
+
};
|
|
32682
|
+
|
|
32683
|
+
export const RenderCursorExample: React.FC<{
|
|
32684
|
+
cursor: "custom" | "default" | "none";
|
|
32685
|
+
onRenderCursor: (
|
|
32686
|
+
options: Parameters<
|
|
32687
|
+
NonNullable<PointPickerContentProps["renderCursor"]>
|
|
32688
|
+
>[0],
|
|
32689
|
+
) => void;
|
|
32690
|
+
}> = ({ cursor, onRenderCursor }) => (
|
|
32691
|
+
<PointPicker>
|
|
32692
|
+
<PointPickerDisplay />
|
|
32693
|
+
<PointPickerContent
|
|
32694
|
+
renderCursor={(options) => {
|
|
32695
|
+
onRenderCursor(options);
|
|
32696
|
+
if (cursor === "custom") return <div>custom cursor</div>;
|
|
32697
|
+
return cursor === "none" ? null : undefined;
|
|
32698
|
+
}}
|
|
32699
|
+
>
|
|
32700
|
+
<div style={{ width: 200, height: 200 }}>Test content</div>
|
|
32701
|
+
</PointPickerContent>
|
|
32702
|
+
</PointPicker>
|
|
32703
|
+
);`},similarTo:[],figmaUrl:null},PointPickerDisplay:{id:"core-content-pointpicker-pointpickerdisplay",importStatement:'import { Box, PointPickerDisplay, RichContentExample } from "@baseline-ui/core";',description:"",documentation:null,props:`interface PointPickerDisplayProps {
|
|
32102
32704
|
/**
|
|
32103
32705
|
* @deprecated Do not use in new components. This is a legacy block
|
|
32104
32706
|
* identifier; new components should exclude it via
|
|
@@ -32739,7 +33341,29 @@ export const TrailingElementExample = () => {
|
|
|
32739
33341
|
</PointPickerContent>
|
|
32740
33342
|
</PointPicker>
|
|
32741
33343
|
);
|
|
32742
|
-
}
|
|
33344
|
+
};
|
|
33345
|
+
|
|
33346
|
+
export const RenderCursorExample: React.FC<{
|
|
33347
|
+
cursor: "custom" | "default" | "none";
|
|
33348
|
+
onRenderCursor: (
|
|
33349
|
+
options: Parameters<
|
|
33350
|
+
NonNullable<PointPickerContentProps["renderCursor"]>
|
|
33351
|
+
>[0],
|
|
33352
|
+
) => void;
|
|
33353
|
+
}> = ({ cursor, onRenderCursor }) => (
|
|
33354
|
+
<PointPicker>
|
|
33355
|
+
<PointPickerDisplay />
|
|
33356
|
+
<PointPickerContent
|
|
33357
|
+
renderCursor={(options) => {
|
|
33358
|
+
onRenderCursor(options);
|
|
33359
|
+
if (cursor === "custom") return <div>custom cursor</div>;
|
|
33360
|
+
return cursor === "none" ? null : undefined;
|
|
33361
|
+
}}
|
|
33362
|
+
>
|
|
33363
|
+
<div style={{ width: 200, height: 200 }}>Test content</div>
|
|
33364
|
+
</PointPickerContent>
|
|
33365
|
+
</PointPicker>
|
|
33366
|
+
);`},similarTo:[],figmaUrl:null},PopoverContent:{id:"core-overlays-popover-popovercontent",importStatement:`import {
|
|
32743
33367
|
PopoverBoundaryAxisDemo,
|
|
32744
33368
|
PopoverContainedFocusExample,
|
|
32745
33369
|
PopoverContent,
|
|
@@ -32789,7 +33413,7 @@ style?: | React.CSSProperties
|
|
|
32789
33413
|
* The reference element for the popover position. By default, the popover is
|
|
32790
33414
|
* positioned relative to the trigger element.
|
|
32791
33415
|
*/
|
|
32792
|
-
triggerRef?: React.RefObject<HTMLElement>
|
|
33416
|
+
triggerRef?: React.RefObject<HTMLElement | null>
|
|
32793
33417
|
/**
|
|
32794
33418
|
* The class name for the underlay element.
|
|
32795
33419
|
*/
|
|
@@ -35808,7 +36432,17 @@ popoverContentProps?: Omit<PopoverContentProps, "children">
|
|
|
35808
36432
|
formatValue={(value: number) => \`\${value} pt\`}
|
|
35809
36433
|
aria-label="Icon slider"
|
|
35810
36434
|
onTriggerPress={fn()}
|
|
35811
|
-
isDisabled />;`}],implementation
|
|
36435
|
+
isDisabled />;`}],implementation:`import React from "react";
|
|
36436
|
+
|
|
36437
|
+
import { IconSlider } from "../IconSlider";
|
|
36438
|
+
|
|
36439
|
+
import type { IconSliderProps } from "../Slider.types";
|
|
36440
|
+
|
|
36441
|
+
const TestIcon = () => <div>Icon</div>;
|
|
36442
|
+
|
|
36443
|
+
export const IconSliderWithIconExample: React.FC<
|
|
36444
|
+
Omit<IconSliderProps, "icon">
|
|
36445
|
+
> = (props) => <IconSlider icon={TestIcon} {...props} />;`},similarTo:[],figmaUrl:null}};var i={gettingStarted:`# Getting started
|
|
35812
36446
|
|
|
35813
36447
|
Install the packages required for using Baseline UI with the following command:
|
|
35814
36448
|
|
|
@@ -35816,6 +36450,8 @@ Install the packages required for using Baseline UI with the following command:
|
|
|
35816
36450
|
npm install @baseline-ui/core @baseline-ui/tokens
|
|
35817
36451
|
\`\`\`
|
|
35818
36452
|
|
|
36453
|
+
Baseline UI requires React 18 or 19 (\`react\` and \`react-dom\` are peer dependencies).
|
|
36454
|
+
|
|
35819
36455
|
## Usage
|
|
35820
36456
|
|
|
35821
36457
|
Use the components by importing them from \`@baseline-ui/core\`:
|
|
@@ -37537,7 +38173,7 @@ padding={[null, "lg", "xl"]}
|
|
|
37537
38173
|
|
|
37538
38174
|
* [vanilla-extract sprinkles documentation](https://vanilla-extract.style/documentation/packages/sprinkles/) - Learn about the underlying sprinkles framework
|
|
37539
38175
|
* [Box component documentation](/docs/core-utilities-box--docs) - Detailed information about the Box component
|
|
37540
|
-
* [Theme documentation](/docs/theming--docs) - Learn about Baseline UI's theming system`};var c={"8":["CaretDownIcon","CaretLeftIcon","CaretRightIcon","CaretUpIcon","ChevronRightFilledIcon","ChevronRightIcon","EllipseIcon","MinusIcon","PlusIcon","XIcon"],"12":["CaretDownIcon","CaretLeftIcon","CaretRightIcon","CaretUpIcon","CheckmarkIcon","DragIndicatorIcon","DragIndicatorVerticalIcon","EditIcon","EllipseIcon","EnterKeyIcon","LockFilledIcon","LockIcon","MinusIcon","MoreVIcon","MoreIcon","PlaceholderIcon","PlusIcon","SearchIcon","SizeIcon","TrashIcon","XIcon","ZoomIcon"],"16":["AlignBottomIcon","AlignMiddleIcon","AlignTopIcon","AnonymousIcon","ArrowDiagonalTopLeftBottomRightIcon","ArrowDownCircleFilledIcon","ArrowDownIcon","ArrowIcon","ArrowLeftRightIcon","ArrowRightIcon","ArrowUpArrowDownIcon","ArrowUpIcon","AtIcon","AttachmentsIcon","AvatarIcon","BoldIcon","BookmarkFilledIcon","BookmarkIcon","BulletListIcon","CalendarIcon","CaretLeftIcon","CaretRightIcon","CheckmarkCircleFilledIcon","CheckmarkCircleIcon","CheckmarkIcon","CircleFilledIcon","ClockIcon","CopyIcon","CustomizeIcon","DocumentEditIcon","DownloadIcon","DuplicateIcon","EditIcon","ElipseAreaIcon","EllipseCloudyIcon","EllipseDashedIcon","EllipseIcon","EmbedIcon","EmojiSmileIcon","ErrorAltCircleFilledIcon","ErrorCircleFilledIcon","ErrorCircleIcon","ExpandIcon","FilterAltIcon","FolderIcon","FormButtonIcon","FormChoiceIcon","FormComboboxIcon","FormDateIcon","FormListboxIcon","FormRadioButtonIcon","FormSignatureIcon","FormTextFieldIcon","FullScreenIcon","HelpCircleIcon","HelpIcon","HereIcon","HideIcon","HighlightTextAltIcon","HighlightTextIcon","HorizontalScrollIcon","ImageIcon","InfoCircleFilledIcon","InsertIcon","ItalicIcon","LightBulbIcon","LineIcon","LinkIcon","ListIcon","LockIcon","MagicIcon","MeasureIcon","MinusIcon","MoreIcon","MoreVerticalIcon","NoteArrowRightIcon","NoteCheckIcon","NoteCircleIcon","NoteCloudIcon","NoteCrossIcon","NoteHelpIcon","NoteInsetIcon","NoteKeyIcon","NoteNewParagraphAltIcon","NoteNewParagraphIcon","NoteNoteIcon","NotePointerRightIcon","NoteSpeechBubbleIcon","NoteStarIcon","NumberedListIcon","OpenIcon","PageFittingFillIcon","PageFittingFitIcon","PageHorizontalScrollIcon","PageLayoutDoubleIcon","PageLayoutSingleIcon","PageVerticalScrollIcon","PauseIcon","PenHighlighterIcon","PenIcon","PerimeterIcon","PlaceholderIcon","PlayIcon","PlusIcon","PolygonAreaIcon","PolygonCloudyIcon","PolygonDashedIcon","PolygonIcon","PolylineIcon","ReadOnlyIcon","RectangleAreaIcon","RectangleCloudyIcon","RectangleDashedIcon","RectangleIcon","RedoIcon","RemoveFormattingIcon","ReorderIcon","RotateClockwiseIcon","RotateCounterClockwiseIcon","RulerIcon","SearchIcon","SettingsIcon","ShowIcon","SlashCommandsIcon","SoundRecordIcon","StampIcon","StarFilledIcon","StarIcon","StrikeoutTextAltIcon","TableCellIcon","TableColumnIcon","TableHeaderIcon","TableIcon","TableRowIcon","TextAlignCenterIcon","TextAlignJustifyIcon","TextAlignLeftIcon","TextAlignRightIcon","TextCalloutIcon","TextDecreaseIndentIcon","TextIcon","TextIncreaseIndentIcon","TextMarkIcon","ThumbnailsIcon","ThumbsDownIcon","ThumbsUpIcon","TrashIcon","TypeTextIcon","UnderlineIcon","UndoIcon","UnlockIcon","VerticalScrollIcon","VideoIcon","WarningFilledIcon","WarningIcon","WindowedIcon","WorkflowIcon","XCircleFilledIcon","XIcon"],"20":["AddPageIcon","AnonymousIcon","ArrowLeftIcon","ArrowRightIcon","ArrowUpCircleFilledIcon","AtIcon","AvatarFilledIcon","BoldIcon","CalloutIcon","CaretDownIcon","CaretLeftIcon","CaretRightIcon","CaretUpIcon","CheckCircleFilledIcon","CheckmarkCircleIcon","CheckmarkIcon","ClockIcon","CollapseIcon","CommentIcon","CopyIcon","CutIcon","DistanceIcon","DownloadIcon","DuplicateIcon","EditIcon","EllipseIcon","EmojiSmileIcon","ErrorAltCircleFilledIcon","ErrorAlternativeCircleIcon","ErrorCircleFilledIcon","ErrorCircleIcon","ExpandIcon","FormDateIcon","FormSignatureIcon","FormTextFieldIcon","HelpCircleIcon","HighlightTextIcon","HomeIcon","ImageIcon","InfoCircleFilledIcon","InfoCircleIcon","ItalicIcon","LinkIcon","ListIcon","LockIcon","MagicIcon","MinusIcon","MoreIcon","MoreVerticalIcon","MoveIcon","NoteArrowRightIcon","NoteCheckIcon","NoteCircleIcon","NoteCrossIcon","NoteHelpIcon","NoteInsetIcon","NoteKeyIcon","NoteNewParagraphAltIcon","NoteNewParagraphIcon","NoteNoteIcon","NotePointerRightIcon","NoteSpeechBubbleIcon","NoteStarIcon","OpenIcon","PageMoveLeftIcon","PageMoveRightIcon","PagesInsertIcon","PasteIcon","PipetteIcon","PlusIcon","PrintIcon","RotateClockwiseIcon","SearchIcon","SettingsIcon","ShapeIcon","ShareIcon","SoundIcon","SoundRecordIcon","StarFilledIcon","StarIcon","StyleIcon","TextAlignCenterIcon","TextAlignJustifyIcon","TextAlignLeftIcon","TextAlignRightIcon","TextIcon","ThumbnailsIcon","ThumbsDownIcon","ThumbsUpIcon","TrashIcon","TypeTextIcon","UnderlineIcon","UploadIcon","WarningFilledIcon","WarningIcon","XCircleFilledIcon","XCircleIcon","XIcon"],"24":["AddNoteCloudIcon","AddNoteIcon","AddTextSerifIcon","AiIcon","AirplaneIcon","AlignBottomIcon","AlignHorizontalCenterIcon","AlignMiddleIcon","AlignTopIcon","AnonymousIcon","ArrowDownIcon","ArrowIcon","ArrowLeftIcon","ArrowRightIcon","ArrowUpIcon","AtIcon","AttachmentIcon","AvatarFilledIcon","AvatarIcon","BlendModeIcon","BoldIcon","BookmarkFilledIcon","BookmarkIcon","BorderColorIcon","BottomBorderIcon","BulletListIcon","CalibrateIcon","CaptureAddIcon","CaretDownIcon","CaretIcon","CaretLeftIcon","CaretRightIcon","CaretUpIcon","CheckmarkCircleFilledIcon","CheckmarkCircleIcon","CheckmarkIcon","ChevronListIcon","ClockIcon","CloudyBorderIcon","CollapseIcon","ColorPaletteIcon","ColorSwatchIcon","CommentIcon","CommentInSidebarIcon","CommentOnPageIcon","CompareDocumentsIcon","CopyIcon","CopyPageIcon","CropIcon","CustomizeIcon","CutIcon","DateModifiedIcon","DatePlusIcon","DebugIcon","DocumentArrowDownCircleIcon","DocumentArrowDownIcon","DocumentArrowRightIcon","DocumentFilledIcon","DocumentLockIcon","DocumentPdfIcon","DownloadIcon","DragIndicatorIcon","DragIndicatorVerticalIcon","DuplicateIcon","EditAnnotationsIcon","EditContentIcon","EditDocumentIcon","EditIcon","EditThumbnailsIcon","EllipseAreaIcon","EllipseCloudyIcon","EllipseDashedIcon","EllipseIcon","EmbedIcon","EmojiSmileIcon","EndCapArrowFilledIcon","EndCapArrowIcon","EndCapChevronFilledIcon","EndCapChevronIcon","EndCapCircleIcon","EndCapDiamondIcon","EndCapNoneIcon","EndCapSlantedIcon","EndCapSquareIcon","EndCapStraightIcon","EraserIcon","ErrorAltCircleFilledIcon","ErrorAltIcon","ErrorCircleFilledIcon","ErrorCircleIcon","ExpandIcon","ExpandVerticalIcon","FillColorIcon","FilterIcon","FitToHeightIcon","FivePagesHorizontalFilledIcon","FivePagesVerticalFilledIcon","FolderAddIcon","FolderIcon","FontListIcon","FontSizeIcon","FormButtonIcon","FormChoiceIcon","FormComboboxIcon","FormDateIcon","FormListboxIcon","FormPageIcon","FormRadioButtonIcon","FormSignatureIcon","FormTextFieldIcon","FormTwoRadioButtonsIcon","FourPagesGridFilledIcon","FourPagesHorizontalFilledIcon","FourPagesStackedFilledIcon","FourPagesVerticalFilledIcon","GroupIcon","HamburgerMenuIcon","HandIcon","HeartIcon","HideIcon","HideRevealIcon","HighlightTextIcon","HomeIcon","HorizontalScollIcon","ImageIcon","InfoCircleFilledIcon","InfoCircleIcon","InitialsIcon","InnerHorizontalBorderIcon","InnerVerticalBorderIcon","InsertIcon","ItalicIcon","LayerBottomIcon","LayerDownIcon","LayerTopIcon","LayerUpIcon","LayersIcon","LeftBindingIcon","LeftBorderIcon","LineCapsIcon","LineIcon","LineSpacingIcon","LineStyleCloudyIcon","LineStyleDashedDoubleDashIcon","LineStyleDashedDoubleGapIcon","LineStyleDashedQuadrupleDashIcon","LineStyleDashedSingleGapIcon","LineStyleIcon","LineStyleSolidIcon","LineWidthIcon","LinkIcon","LockFilledIcon","LockIcon","MagicIcon","MagicPenIcon","MailIcon","MarkupIcon","MarqueeZoomIcon","MeasureIcon","MergeIcon","MessageCloudIcon","MinusIcon","MoonIcon","MoreCircleIcon","MoreIcon","MoreVerticalIcon","MoveAllDirectionsIcon","MoveLeftIcon","MoveLeftRightIcon","MoveRightIcon","MultiplePagesIcon","NonEditableIcon","NoteArrowRightIcon","NoteCheckIcon","NoteCircleIcon","NoteCloudIcon","NoteCrossIcon","NoteHelpIcon","NoteIcon","NoteInsetIcon","NoteKeyIcon","NoteNewParagraphAltIcon","NoteNewParagraphIcon","NoteNoteIcon","NotePointerRightIcon","NoteSpeechBubbleIcon","NoteStarIcon","OcrIcon","OpacityIcon","PageAddIcon","PageCurlIcon","PageDuplicateIcon","PageFittingFillIcon","PageFittingFitIcon","PageHorizontalScrollIcon","PageLandscapeIcon","PageLayoutDoubleIcon","PageLayoutSingleIcon","PageMoveLeftIcon","PageMoveRightIcon","PageNumberCircleIcon","PageNumberIcon","PagePortraitIcon","PageRemoveIcon","PageVerticalScrollIcon","PagesInsertAltIcon","PagesInsertIcon","PagesNewFromSelectionAltIcon","PagesNewFromSelectionIcon","PagesSelectAllIcon","PagesSelectNoneIcon","PasteBoardIcon","PastePageIcon","PauseIcon","PenHighlighterIcon","PenIcon","PerimeterIcon","PinDropFilledIcon","PinDropIcon","PipetteIcon","PlayIcon","PlusCircleFilledIcon","PlusCircleIcon","PlusIcon","PointerIcon","PolygonAreaIcon","PolygonCloudyIcon","PolygonDashedIcon","PolygonIcon","PolylineIcon","PrecisionIcon","PrintIcon","PrivateModeIcon","PushPinIcon","QuestionmarkCircleIcon","ReaderViewIcon","RectangleAreaIcon","RectangleCloudyIcon","RectangleDashedIcon","RectangleIcon","RedactIcon","RedactRectangleIcon","RedactTextHighlighterIcon","RedactionTextRepeatingIcon","RedactionTextSingleIcon","RedoAllIcon","RedoIcon","RegexIcon","ReplaceIcon","RightBindingIcon","RightBorderIcon","RotateClockwiseIcon","RotateCounterClockwiseIcon","RotateObjectClockwiseIcon","RotateObjectCounterClockwiseIcon","RulerIcon","ScaleIcon","SearchCircleIcon","SearchIcon","SearchSelectionIcon","SelectAllIcon","SelectionToolIcon","SettingsIcon","ShapesIcon","ShareAltIcon","ShareIcon","ShieldAddIcon","ShieldCheckmarkIcon","ShieldWarningIcon","ShieldXIcon","ShowIcon","SidebarIcon","SignOutIcon","SignatureDigitalIcon","SignatureIcon","SinglePageFilledIcon","SoundIcon","SquigglyTextIcon","StampAddIcon","StampIcon","StarFilledIcon","StarIcon","StartCapArrowFilledIcon","StartCapArrowIcon","StartCapChevronFilledIcon","StartCapChevronIcon","StartCapCircleIcon","StartCapDiamondIcon","StartCapNoneIcon","StartCapSlantedIcon","StartCapSquareIcon","StartCapStraightIcon","StrikeoutTextIcon","StyleFilledIcon","StyleIcon","StylusFilledIcon","StylusIcon","SunIcon","TableCellIcon","TextAlignCenterIcon","TextAlignJustifyIcon","TextAlignLeftIcon","TextAlignRightIcon","TextCalloutIcon","TextColorIcon","TextIcon","TextPropertiesHideIcon","TextPropertiesShowIcon","TextSerifIcon","TextSmallerIcon","ThreePagesHorizontalFilledIcon","ThreePagesStackedFilledIcon","ThreePagesVerticalFilledIcon","ThumbnailsIcon","ThumbsDownIcon","ThumbsUpIcon","TopBorderIcon","TrashIcon","TwoPagesHorizontalFilledIcon","TwoPagesVerticalFilledIcon","TypeTextIcon","UnderlineIcon","UnderlineTextIcon","UndoAllIcon","UndoIcon","UndoRedoIcon","UngroupIcon","UnlockIcon","UploadIcon","UserIcon","VerticalScrollIcon","VideoIcon","WarningFilledIcon","WarningIcon","WidgetIcon","WorkflowIcon","XCircleFilledIcon","XCircleIcon","XIcon","ZoomInIcon","ZoomOutIcon"],"36":["ArrowRight","Check","Circle","Cross","Help","Inset","Key","NewParagraphAlt","NewParagraph","Note","PointerRight","SpeechBubble","Star"]};var p={version:"3.2.1"};var u=`
|
|
38176
|
+
* [Theme documentation](/docs/theming--docs) - Learn about Baseline UI's theming system`};var m={"8":["CaretDownIcon","CaretLeftIcon","CaretRightIcon","CaretUpIcon","ChevronRightFilledIcon","ChevronRightIcon","EllipseIcon","MinusIcon","PlusIcon","XIcon"],"12":["CaretDownIcon","CaretLeftIcon","CaretRightIcon","CaretUpIcon","CheckmarkIcon","DragIndicatorIcon","DragIndicatorVerticalIcon","EditIcon","EllipseIcon","EnterKeyIcon","LockFilledIcon","LockIcon","MinusIcon","MoreVIcon","MoreIcon","PlaceholderIcon","PlusIcon","SearchIcon","SizeIcon","TrashIcon","XIcon","ZoomIcon"],"16":["AlignBottomIcon","AlignMiddleIcon","AlignTopIcon","AnonymousIcon","ArrowDiagonalTopLeftBottomRightIcon","ArrowDownCircleFilledIcon","ArrowDownIcon","ArrowIcon","ArrowLeftRightIcon","ArrowRightIcon","ArrowUpArrowDownIcon","ArrowUpIcon","AtIcon","AttachmentsIcon","AvatarIcon","BoldIcon","BookmarkFilledIcon","BookmarkIcon","BulletListIcon","CalendarIcon","CaretLeftIcon","CaretRightIcon","CheckmarkCircleFilledIcon","CheckmarkCircleIcon","CheckmarkIcon","CircleFilledIcon","ClockIcon","CopyIcon","CustomizeIcon","DocumentEditIcon","DownloadIcon","DuplicateIcon","EditIcon","ElipseAreaIcon","EllipseCloudyIcon","EllipseDashedIcon","EllipseIcon","EmbedIcon","EmojiSmileIcon","ErrorAltCircleFilledIcon","ErrorCircleFilledIcon","ErrorCircleIcon","ExpandIcon","FilterAltIcon","FolderIcon","FormButtonIcon","FormChoiceIcon","FormComboboxIcon","FormDateIcon","FormListboxIcon","FormRadioButtonIcon","FormSignatureIcon","FormTextFieldIcon","FullScreenIcon","HelpCircleIcon","HelpIcon","HereIcon","HideIcon","HighlightTextAltIcon","HighlightTextIcon","HorizontalScrollIcon","ImageIcon","InfoCircleFilledIcon","InsertIcon","ItalicIcon","LightBulbIcon","LineIcon","LinkIcon","ListIcon","LockIcon","MagicIcon","MeasureIcon","MinusIcon","MoreIcon","MoreVerticalIcon","NoteArrowRightIcon","NoteCheckIcon","NoteCircleIcon","NoteCloudIcon","NoteCrossIcon","NoteHelpIcon","NoteInsetIcon","NoteKeyIcon","NoteNewParagraphAltIcon","NoteNewParagraphIcon","NoteNoteIcon","NotePointerRightIcon","NoteSpeechBubbleIcon","NoteStarIcon","NumberedListIcon","OpenIcon","PageFittingFillIcon","PageFittingFitIcon","PageHorizontalScrollIcon","PageLayoutDoubleIcon","PageLayoutSingleIcon","PageVerticalScrollIcon","PauseIcon","PenHighlighterIcon","PenIcon","PerimeterIcon","PlaceholderIcon","PlayIcon","PlusIcon","PolygonAreaIcon","PolygonCloudyIcon","PolygonDashedIcon","PolygonIcon","PolylineIcon","ReadOnlyIcon","RectangleAreaIcon","RectangleCloudyIcon","RectangleDashedIcon","RectangleIcon","RedoIcon","RemoveFormattingIcon","ReorderIcon","RotateClockwiseIcon","RotateCounterClockwiseIcon","RulerIcon","SearchIcon","SettingsIcon","ShowIcon","SlashCommandsIcon","SoundRecordIcon","StampIcon","StarFilledIcon","StarIcon","StrikeoutTextAltIcon","TableCellIcon","TableColumnIcon","TableHeaderIcon","TableIcon","TableRowIcon","TextAlignCenterIcon","TextAlignJustifyIcon","TextAlignLeftIcon","TextAlignRightIcon","TextCalloutIcon","TextDecreaseIndentIcon","TextIcon","TextIncreaseIndentIcon","TextMarkIcon","ThumbnailsIcon","ThumbsDownIcon","ThumbsUpIcon","TrashIcon","TypeTextIcon","UnderlineIcon","UndoIcon","UnlockIcon","VerticalScrollIcon","VideoIcon","WarningFilledIcon","WarningIcon","WindowedIcon","WorkflowIcon","XCircleFilledIcon","XIcon"],"20":["AddPageIcon","AnonymousIcon","ArrowLeftIcon","ArrowRightIcon","ArrowUpCircleFilledIcon","AtIcon","AvatarFilledIcon","BoldIcon","CalloutIcon","CaretDownIcon","CaretLeftIcon","CaretRightIcon","CaretUpIcon","CheckCircleFilledIcon","CheckmarkCircleIcon","CheckmarkIcon","ClockIcon","CollapseIcon","CommentIcon","CopyIcon","CutIcon","DistanceIcon","DownloadIcon","DuplicateIcon","EditIcon","EllipseIcon","EmojiSmileIcon","ErrorAltCircleFilledIcon","ErrorAlternativeCircleIcon","ErrorCircleFilledIcon","ErrorCircleIcon","ExpandIcon","FormDateIcon","FormSignatureIcon","FormTextFieldIcon","HelpCircleIcon","HighlightTextIcon","HomeIcon","ImageIcon","InfoCircleFilledIcon","InfoCircleIcon","ItalicIcon","LinkIcon","ListIcon","LockIcon","MagicIcon","MinusIcon","MoreIcon","MoreVerticalIcon","MoveIcon","NoteArrowRightIcon","NoteCheckIcon","NoteCircleIcon","NoteCrossIcon","NoteHelpIcon","NoteInsetIcon","NoteKeyIcon","NoteNewParagraphAltIcon","NoteNewParagraphIcon","NoteNoteIcon","NotePointerRightIcon","NoteSpeechBubbleIcon","NoteStarIcon","OpenIcon","PageMoveLeftIcon","PageMoveRightIcon","PagesInsertIcon","PasteIcon","PipetteIcon","PlusIcon","PrintIcon","RotateClockwiseIcon","SearchIcon","SettingsIcon","ShapeIcon","ShareIcon","SoundIcon","SoundRecordIcon","StarFilledIcon","StarIcon","StyleIcon","TextAlignCenterIcon","TextAlignJustifyIcon","TextAlignLeftIcon","TextAlignRightIcon","TextIcon","ThumbnailsIcon","ThumbsDownIcon","ThumbsUpIcon","TrashIcon","TypeTextIcon","UnderlineIcon","UploadIcon","WarningFilledIcon","WarningIcon","XCircleFilledIcon","XCircleIcon","XIcon"],"24":["AddNoteCloudIcon","AddNoteIcon","AddTextSerifIcon","AiIcon","AirplaneIcon","AlignBottomIcon","AlignHorizontalCenterIcon","AlignMiddleIcon","AlignTopIcon","AnonymousIcon","ArrowDownIcon","ArrowIcon","ArrowLeftIcon","ArrowRightIcon","ArrowUpIcon","AtIcon","AttachmentIcon","AvatarFilledIcon","AvatarIcon","BlendModeIcon","BoldIcon","BookmarkFilledIcon","BookmarkIcon","BorderColorIcon","BottomBorderIcon","BulletListIcon","CalibrateIcon","CaptureAddIcon","CaretDownIcon","CaretIcon","CaretLeftIcon","CaretRightIcon","CaretUpIcon","CheckmarkCircleFilledIcon","CheckmarkCircleIcon","CheckmarkIcon","ChevronListIcon","ClockIcon","CloudyBorderIcon","CollapseIcon","ColorPaletteIcon","ColorSwatchIcon","CommentIcon","CommentInSidebarIcon","CommentOnPageIcon","CompareDocumentsIcon","CopyIcon","CopyPageIcon","CropIcon","CustomizeIcon","CutIcon","DateModifiedIcon","DatePlusIcon","DebugIcon","DocumentArrowDownCircleIcon","DocumentArrowDownIcon","DocumentArrowRightIcon","DocumentFilledIcon","DocumentLockIcon","DocumentPdfIcon","DownloadIcon","DragIndicatorIcon","DragIndicatorVerticalIcon","DuplicateIcon","EditAnnotationsIcon","EditContentIcon","EditDocumentIcon","EditIcon","EditThumbnailsIcon","EllipseAreaIcon","EllipseCloudyIcon","EllipseDashedIcon","EllipseIcon","EmbedIcon","EmojiSmileIcon","EndCapArrowFilledIcon","EndCapArrowIcon","EndCapChevronFilledIcon","EndCapChevronIcon","EndCapCircleIcon","EndCapDiamondIcon","EndCapNoneIcon","EndCapSlantedIcon","EndCapSquareIcon","EndCapStraightIcon","EraserIcon","ErrorAltCircleFilledIcon","ErrorAltIcon","ErrorCircleFilledIcon","ErrorCircleIcon","ExpandIcon","ExpandVerticalIcon","FillColorIcon","FilterIcon","FitToHeightIcon","FivePagesHorizontalFilledIcon","FivePagesVerticalFilledIcon","FolderAddIcon","FolderIcon","FontListIcon","FontSizeIcon","FormButtonIcon","FormChoiceIcon","FormComboboxIcon","FormDateIcon","FormListboxIcon","FormPageIcon","FormRadioButtonIcon","FormSignatureIcon","FormTextFieldIcon","FormTwoRadioButtonsIcon","FourPagesGridFilledIcon","FourPagesHorizontalFilledIcon","FourPagesStackedFilledIcon","FourPagesVerticalFilledIcon","GroupIcon","HamburgerMenuIcon","HandIcon","HeartIcon","HideIcon","HideRevealIcon","HighlightTextIcon","HomeIcon","HorizontalScollIcon","ImageIcon","InfoCircleFilledIcon","InfoCircleIcon","InitialsIcon","InnerHorizontalBorderIcon","InnerVerticalBorderIcon","InsertIcon","ItalicIcon","LayerBottomIcon","LayerDownIcon","LayerTopIcon","LayerUpIcon","LayersIcon","LeftBindingIcon","LeftBorderIcon","LineCapsIcon","LineIcon","LineSpacingIcon","LineStyleCloudyIcon","LineStyleDashedDoubleDashIcon","LineStyleDashedDoubleGapIcon","LineStyleDashedQuadrupleDashIcon","LineStyleDashedSingleGapIcon","LineStyleIcon","LineStyleSolidIcon","LineWidthIcon","LinkIcon","LockFilledIcon","LockIcon","MagicIcon","MagicPenIcon","MailIcon","MarkupIcon","MarqueeZoomIcon","MeasureIcon","MergeIcon","MessageCloudIcon","MinusIcon","MoonIcon","MoreCircleIcon","MoreIcon","MoreVerticalIcon","MoveAllDirectionsIcon","MoveLeftIcon","MoveLeftRightIcon","MoveRightIcon","MultiplePagesIcon","NonEditableIcon","NoteArrowRightIcon","NoteCheckIcon","NoteCircleIcon","NoteCloudIcon","NoteCrossIcon","NoteHelpIcon","NoteIcon","NoteInsetIcon","NoteKeyIcon","NoteNewParagraphAltIcon","NoteNewParagraphIcon","NoteNoteIcon","NotePointerRightIcon","NoteSpeechBubbleIcon","NoteStarIcon","OcrIcon","OpacityIcon","PageAddIcon","PageCurlIcon","PageDuplicateIcon","PageFittingFillIcon","PageFittingFitIcon","PageHorizontalScrollIcon","PageLandscapeIcon","PageLayoutDoubleIcon","PageLayoutSingleIcon","PageMoveLeftIcon","PageMoveRightIcon","PageNumberCircleIcon","PageNumberIcon","PagePortraitIcon","PageRemoveIcon","PageVerticalScrollIcon","PagesInsertAltIcon","PagesInsertIcon","PagesNewFromSelectionAltIcon","PagesNewFromSelectionIcon","PagesSelectAllIcon","PagesSelectNoneIcon","PasteBoardIcon","PastePageIcon","PauseIcon","PenHighlighterIcon","PenIcon","PerimeterIcon","PinDropFilledIcon","PinDropIcon","PipetteIcon","PlayIcon","PlusCircleFilledIcon","PlusCircleIcon","PlusIcon","PointerIcon","PolygonAreaIcon","PolygonCloudyIcon","PolygonDashedIcon","PolygonIcon","PolylineIcon","PrecisionIcon","PrintIcon","PrivateModeIcon","PushPinIcon","QuestionmarkCircleIcon","ReaderViewIcon","RectangleAreaIcon","RectangleCloudyIcon","RectangleDashedIcon","RectangleIcon","RedactIcon","RedactRectangleIcon","RedactTextHighlighterIcon","RedactionTextRepeatingIcon","RedactionTextSingleIcon","RedoAllIcon","RedoIcon","RegexIcon","ReplaceIcon","RightBindingIcon","RightBorderIcon","RotateClockwiseIcon","RotateCounterClockwiseIcon","RotateObjectClockwiseIcon","RotateObjectCounterClockwiseIcon","RulerIcon","ScaleIcon","SearchCircleIcon","SearchIcon","SearchSelectionIcon","SelectAllIcon","SelectionToolIcon","SettingsIcon","ShapesIcon","ShareAltIcon","ShareIcon","ShieldAddIcon","ShieldCheckmarkIcon","ShieldWarningIcon","ShieldXIcon","ShowIcon","SidebarIcon","SignOutIcon","SignatureDigitalIcon","SignatureIcon","SinglePageFilledIcon","SoundIcon","SquigglyTextIcon","StampAddIcon","StampIcon","StarFilledIcon","StarIcon","StartCapArrowFilledIcon","StartCapArrowIcon","StartCapChevronFilledIcon","StartCapChevronIcon","StartCapCircleIcon","StartCapDiamondIcon","StartCapNoneIcon","StartCapSlantedIcon","StartCapSquareIcon","StartCapStraightIcon","StrikeoutTextIcon","StyleFilledIcon","StyleIcon","StylusFilledIcon","StylusIcon","SunIcon","TableCellIcon","TextAlignCenterIcon","TextAlignJustifyIcon","TextAlignLeftIcon","TextAlignRightIcon","TextCalloutIcon","TextColorIcon","TextIcon","TextPropertiesHideIcon","TextPropertiesShowIcon","TextSerifIcon","TextSmallerIcon","ThreePagesHorizontalFilledIcon","ThreePagesStackedFilledIcon","ThreePagesVerticalFilledIcon","ThumbnailsIcon","ThumbsDownIcon","ThumbsUpIcon","TopBorderIcon","TrashIcon","TwoPagesHorizontalFilledIcon","TwoPagesVerticalFilledIcon","TypeTextIcon","UnderlineIcon","UnderlineTextIcon","UndoAllIcon","UndoIcon","UndoRedoIcon","UngroupIcon","UnlockIcon","UploadIcon","UserIcon","VerticalScrollIcon","VideoIcon","WarningFilledIcon","WarningIcon","WidgetIcon","WorkflowIcon","XCircleFilledIcon","XCircleIcon","XIcon","ZoomInIcon","ZoomOutIcon"],"36":["ArrowRight","Check","Circle","Cross","Help","Inset","Key","NewParagraphAlt","NewParagraph","Note","PointerRight","SpeechBubble","Star"]};var r=["charts-barchart--basic","charts-barchart--custom-colors","charts-barchart--formatted","charts-barchart--hidden-axes","charts-barchart--many-series","charts-barchart--mixed-stacking","charts-barchart--single-series","charts-barchart--stacked","charts-barchart--stacked-with-three-series","charts-barchart--thicker-bars","charts-barchart--with-legend","charts-linechart--basic","charts-linechart--custom-colors","charts-linechart--formatted","charts-linechart--hidden-axes","charts-linechart--linear-curve","charts-linechart--many-lines","charts-linechart--single-line","charts-linechart--sparkline","charts-linechart--with-dots","charts-linechart--with-legend","charts-piechart--basic","charts-piechart--custom-colors","charts-piechart--donut","charts-piechart--long-legend-names","charts-piechart--many-slices","charts-piechart--no-labels","charts-piechart--no-legend","charts-piechart--no-tooltip","charts-piechart--small-slices-below-five-percent","core-buttons-actionbutton--as-div","core-buttons-actionbutton--basic","core-buttons-actionbutton--disabled","core-buttons-actionbutton--variants","core-buttons-actionbutton--with-both-icons","core-buttons-actionbutton--with-icon","core-buttons-actionbutton--with-popover","core-buttons-actiongroup--basic","core-buttons-actiongroup--default-selected","core-buttons-actiongroup--disabled","core-buttons-actiongroup--disabled-items","core-buttons-actiongroup--disabled-items-multi-select","core-buttons-actiongroup--disabled-with-selection","core-buttons-actiongroup--multi-select","core-buttons-actiongroup--multiple-default-selected","core-buttons-actiongroup--multiple-selected-items","core-buttons-actiongroup--single-item","core-buttons-actiongroup--single-select","core-buttons-actiongroup--with-custom-action-item","core-buttons-actiongroup--with-icon","core-buttons-actiongroup--with-icon-disabled","core-buttons-actiongroup--with-icon-multi-select","core-buttons-actiongroup--without-tooltip","core-buttons-actioniconbutton--basic","core-buttons-actioniconbutton--disabled","core-buttons-actioniconbutton--variants","core-buttons-actioniconbutton--with-popover","core-buttons-actioniconbutton--with-tooltip","core-buttons-reaction--basic","core-buttons-reaction--disabled","core-buttons-reaction--read-only","core-buttons-reaction--selected","core-buttons-reaction--variants","core-buttons-scrollcontrolbutton--basic","core-buttons-scrollcontrolbutton--hide-for-keyboard","core-buttons-scrollcontrolbutton--with-custom-delay","core-buttons-scrollcontrolbutton--with-reversed-items","core-buttons-scrollcontrolbutton--without-smooth-scroll","core-buttons-togglebutton--basic","core-buttons-togglebutton--controlled","core-buttons-togglebutton--default-selected","core-buttons-togglebutton--disabled","core-buttons-togglebutton--variants","core-buttons-togglebutton--with-icon","core-buttons-toggleiconbutton--basic","core-buttons-toggleiconbutton--primary-variants","core-buttons-toggleiconbutton--secondary-variants","core-buttons-toggleiconbutton--state-specific-icons","core-buttons-toggleiconbutton--teritary-variants","core-buttons-toggleiconbutton--toolbar-variants","core-buttons-toggleiconbutton--with-tooltip","core-collections-filelist--basic","core-collections-filelist--disabled","core-collections-filelist--disabled-items","core-collections-filelist--loading","core-collections-filelist--long-filename","core-collections-filelist--many-items","core-collections-filelist--mixed-states","core-collections-filelist--with-error","core-collections-gridlist--basic","core-collections-gridlist--default-selected-keys","core-collections-gridlist--disabled","core-collections-gridlist--disabled-rows","core-collections-gridlist--disallow-empty-selection","core-collections-gridlist--with-drag-and-drop","core-collections-gridlist--with-multiple-selection","core-collections-gridlist--with-single-selection","core-collections-imagegallery--basic","core-collections-imagegallery--more-items","core-collections-imagegallery--rtl-with-virtualization","core-collections-imagegallery--scrollable","core-collections-imagegallery--with-controlled-list","core-collections-imagegallery--with-custom-aspect-ratio","core-collections-imagegallery--with-custom-fit","core-collections-imagegallery--with-custom-image-dimensions","core-collections-imagegallery--with-custom-image-renderer","core-collections-imagegallery--with-custom-size","core-collections-imagegallery--with-deletion","core-collections-imagegallery--with-dynamic-list","core-collections-imagegallery--with-long-labels","core-collections-imagegallery--with-medium-size","core-collections-imagegallery--with-multiple-selection","core-collections-imagegallery--with-reordering","core-collections-imagegallery--with-single-selection","core-collections-imagegallery--with-single-selection-and-deletion","core-collections-imagegallery--with-virtualization","core-collections-listbox--basic","core-collections-listbox--controlled-auto-scroll","core-collections-listbox--drag-and-drop-custom-preview","core-collections-listbox--drag-and-drop-grid","core-collections-listbox--drag-and-drop-horizontal","core-collections-listbox--drag-and-drop-multiple","core-collections-listbox--drag-and-drop-single","core-collections-listbox--dynamic-items","core-collections-listbox--with-custom-option-style","core-collections-listbox--with-customized-section-titles","core-collections-listbox--with-default-selected","core-collections-listbox--with-disabled-items","core-collections-listbox--with-focus-loop","core-collections-listbox--with-padded-section-titles","core-collections-listbox--with-section-titles","core-collections-listbox--with-sections","core-collections-listbox--with-selected","core-collections-menu--basic","core-collections-menu--controlled-open","core-collections-menu--disabled","core-collections-menu--long-menu","core-collections-menu--multiple-selection","core-collections-menu--section-level-selection","core-collections-menu--single-selection","core-collections-menu--with-custom-options","core-collections-menu--with-custom-trigger","core-collections-menu--with-disabled-keys","core-collections-menu--with-disabled-submenu","core-collections-menu--with-icons","core-collections-menu--with-long-labels","core-collections-menu--with-sections","core-collections-menu--with-selected-keys-controlled","core-collections-menu--with-submenu","core-collections-table--async-loading","core-collections-table--default","core-collections-table--disabled-rows","core-collections-table--drag-and-drop","core-collections-table--empty","core-collections-table--long-text-content","core-collections-table--multiple-selection","core-collections-table--row-action","core-collections-table--selection-with-row-action","core-collections-table--single-selection","core-collections-table--sorting","core-collections-table--virtualized","core-collections-table--with-tag-and-menu","core-collections-table--with-toolbar","core-collections-taggroup--basic","core-collections-taggroup--disabled","core-collections-taggroup--disabled-items","core-collections-taggroup--group-variants","core-collections-taggroup--multi-select","core-collections-taggroup--removable","core-collections-taggroup--single-select","core-collections-taggroup--small-variants","core-collections-taggroup--variants","core-collections-treeview--basic","core-collections-treeview--custom-row","core-collections-treeview--custom-row-drag-and-drop","core-collections-treeview--deeply-nested","core-collections-treeview--drag-and-drop","core-collections-treeview--empty-tree","core-collections-treeview--flat-tree","core-collections-treeview--handle-only-drag-and-drop","core-collections-treeview--interactive-fields-drag-and-drop","core-collections-treeview--long-labels","core-collections-treeview--single-item","core-collections-treeview--virtualized-drag-and-drop","core-collections-treeview--virtualized-with-actions","core-collections-treeview--virtualized-with-descriptions","core-collections-treeview--virtualized-with-expand-control","core-collections-treeview--virtualized-with-rename","core-collections-treeview--with-actions-at-end","core-collections-treeview--with-controlled-expanded-keys","core-collections-treeview--with-custom-render-icons","core-collections-treeview--with-custom-render-item-title","core-collections-treeview--with-default-expanded-keys","core-collections-treeview--with-description","core-collections-treeview--with-icons","core-collections-treeview--with-primary-action","core-collections-treeview--with-primary-and-secondary-action","core-collections-treeview--with-primary-secondary-and-description-action","core-collections-treeview--with-rename","core-collections-treeview--with-selected-items","core-collections-treeview--with-virtualization","core-collections-unsafe-listbox--basic","core-collections-unsafe-listbox--controlled-auto-scroll","core-collections-unsafe-listbox--drag-and-drop-custom-preview","core-collections-unsafe-listbox--drag-and-drop-grid","core-collections-unsafe-listbox--drag-and-drop-horizontal","core-collections-unsafe-listbox--drag-and-drop-multiple","core-collections-unsafe-listbox--drag-and-drop-single","core-collections-unsafe-listbox--dynamic-items","core-collections-unsafe-listbox--virtualized-horizontal","core-collections-unsafe-listbox--virtualized-scroll-into-view","core-collections-unsafe-listbox--virtualized-vertical","core-collections-unsafe-listbox--virtualized-with-section-separators","core-collections-unsafe-listbox--virtualized-with-sections","core-collections-unsafe-listbox--with-custom-option-style","core-collections-unsafe-listbox--with-customized-section-titles","core-collections-unsafe-listbox--with-default-selected","core-collections-unsafe-listbox--with-disabled-items","core-collections-unsafe-listbox--with-focus-loop","core-collections-unsafe-listbox--with-padded-section-titles","core-collections-unsafe-listbox--with-section-titles","core-collections-unsafe-listbox--with-sections","core-collections-unsafe-listbox--with-selected","core-collections-virtualizer--grid-layout-example","core-collections-virtualizer--list-layout-example","core-collections-virtualizer--rtl-image-gallery-preset-example","core-collections-virtualizer--tree-view-preset-example","core-content-avatar--basic","core-content-avatar--disabled","core-content-avatar--variants","core-content-avatar--with-image","core-content-avatar--with-initials","core-content-avatar--with-notification","core-content-code--basic","core-content-code--with-scroll","core-content-colorswatch--basic","core-content-colorswatch--disabled","core-content-colorswatch--full-transparency","core-content-colorswatch--indeterminate","core-content-colorswatch--interactive","core-content-colorswatch--none","core-content-colorswatch--variants","core-content-colorswatch--with-custom-label","core-content-colorswatch--with-tooltip","core-content-colorswatch--with-transparency","core-content-kbd--common-shortcuts","core-content-kbd--complex-shortcut","core-content-kbd--key-combination","core-content-kbd--key-combination-with-symbols","core-content-kbd--modifier-key","core-content-kbd--single-key","core-content-kbd--symbols-showcase","core-content-markdown--basic","core-content-markdown--with-caret","core-content-pointpicker--basic","core-content-pointpicker--disabled","core-content-pointpicker-pointpickercontent--custom-cursor","core-content-pointpicker-pointpickercontent--custom-cursor-without-default","core-content-pointpicker-pointpickercontent--default","core-content-pointpicker-pointpickercontent--multiple-point-pickers","core-content-pointpicker-pointpickercontent--points-within-radius","core-content-pointpicker-pointpickercontent--programmatic-focus","core-content-pointpicker-pointpickercontent--snap-to-point","core-content-pointpicker-pointpickercontent--trailing-element","core-content-pointpicker-pointpickercontent--without-grid-lines","core-content-pointpicker-pointpickerdisplay--with-custom-scale","core-content-pointpicker-pointpickerdisplay--with-description","core-content-pointpicker-pointpickerdisplay--with-floating-display","core-content-preview--disabled","core-content-preview--image-preview","core-content-preview--svg-preview","core-content-preview--text-preview","core-content-preview--variants","core-content-preview--without-delete-button","core-content-separator--basic","core-content-separator--secondary","core-content-separator--secondary-vertical","core-content-separator--vertical","core-content-statuscard--basic","core-content-statuscard--interactive","core-content-statuscard--long-content","core-content-statuscard--truncated-title","core-content-statuscard--variants","core-content-statuscard--with-custom-icon","core-content-statuscard--with-trailing-element","core-content-statuscard--without-description","core-content-tag--basic","core-content-tag--disabled","core-content-tag--disabled-removable","core-content-tag--long-text","core-content-tag--removable","core-content-tag--selected","core-content-tag--selected-with-icon","core-content-tag--small","core-content-tag--small-with-icon","core-content-tag--with-icon","core-content-text--basic","core-content-text--slots","core-content-text--variants","core-feedback-skeleton--circle","core-feedback-skeleton--composed-example","core-feedback-skeleton--custom-shape","core-feedback-skeleton--document-view-area","core-feedback-skeleton--rectangle","core-feedback-skeleton--text-line","core-forms-buttonselect--basic","core-forms-buttonselect--controlled","core-forms-buttonselect--controlled-button-selection","core-forms-buttonselect--default-button-selected-value","core-forms-buttonselect--default-select-selected-value","core-forms-buttonselect--disabled","core-forms-buttonselect--exclude-from-tab-order","core-forms-buttonselect--items-without-icons","core-forms-buttonselect--long-text-labels","core-forms-buttonselect--many-items","core-forms-buttonselect--variants","core-forms-buttonselect--with-action-behaviour","core-forms-buttonselect--with-button-disabled-key","core-forms-buttonselect--with-callbacks","core-forms-buttonselect--with-default-open","core-forms-buttonselect--with-disabled-keys","core-forms-buttonselect--with-disabled-keys-and-default-selected","core-forms-buttonselect--with-hidden-label","core-forms-buttonselect--with-individual-button-behaviour","core-forms-buttonselect--with-multiple-disabled-keys","core-forms-buttonselect--with-validation-error","core-forms-buttonselect--without-tooltip","core-forms-calendar--default","core-forms-calendar--disabled","core-forms-calendar--extra-small","core-forms-calendar--extra-small-no-title","core-forms-calendar--fixed-weeks","core-forms-calendar--international-calendar","core-forms-calendar--read-only","core-forms-calendar--select-month","core-forms-calendar--select-month-and-year","core-forms-calendar--select-month-and-year-extra-small","core-forms-calendar--select-month-and-year-with-title","core-forms-calendar--select-month-extra-small","core-forms-calendar--select-month-with-title","core-forms-calendar--unavailable-dates","core-forms-calendar--with-default-value","core-forms-calendar--with-min-max","core-forms-calendar--with-title","core-forms-checkbox--checked","core-forms-checkbox--indeterminate","core-forms-checkbox--primary","core-forms-checkbox--with-error","core-forms-checkbox--with-label-at-end","core-forms-checkbox--with-label-at-start","core-forms-colorinput--basic","core-forms-colorinput--color-presets-only","core-forms-colorinput--controlled","core-forms-colorinput--disabled","core-forms-colorinput--indeterminate","core-forms-colorinput--lazy-picker","core-forms-colorinput--lazy-picker-mobile","core-forms-colorinput--with-alpha","core-forms-colorinput--with-controlled-open","core-forms-colorinput--with-custom-trigger","core-forms-colorinput--with-default-open","core-forms-colorinput--with-default-value","core-forms-colorinput--with-label","core-forms-colorinput--with-label-at-start","core-forms-colorinput--with-removal","core-forms-colorinput--without-alpha","core-forms-colorinput--without-color-label","core-forms-colorinput--without-color-presets","core-forms-colorinput-iconcolorinput--compact","core-forms-colorinput-iconcolorinput--compact-disabled","core-forms-colorinput-iconcolorinput--compact-indeterminate","core-forms-colorinput-iconcolorinput--disabled","core-forms-colorinput-iconcolorinput--indeterminate","core-forms-colorinput-iconcolorinput--standard","core-forms-colorinput-iconcolorinput--without-tooltip","core-forms-colorswatchpicker--basic","core-forms-colorswatchpicker--controlled","core-forms-colorswatchpicker--default-value","core-forms-colorswatchpicker--disabled","core-forms-colorswatchpicker--with-icon","core-forms-colorswatchpicker--with-label","core-forms-colorswatchpicker--with-label-at-start","core-forms-combobox--basic","core-forms-combobox--disabled","core-forms-combobox--dynamic-collections","core-forms-combobox--ghost-variant","core-forms-combobox--items-with-icon","core-forms-combobox--read-only","core-forms-combobox--variants","core-forms-combobox--with-custom-filter","core-forms-combobox--with-custom-number-value","core-forms-combobox--with-custom-value","core-forms-combobox--with-description","core-forms-combobox--with-error-message","core-forms-combobox--with-focus-menu-trigger","core-forms-combobox--with-label-at-start","core-forms-combobox--with-manual-menu-trigger","core-forms-combobox--with-min-max-value","core-forms-combobox--with-render-option","core-forms-combobox--with-tooltip","core-forms-combobox--with-warning-message","core-forms-datefield--basic","core-forms-datefield--controlled","core-forms-datefield--default-value","core-forms-datefield--different-granularity","core-forms-datefield--disabled","core-forms-datefield--ghost-variant","core-forms-datefield--html-forms","core-forms-datefield--placeholder-value","core-forms-datefield--read-only","core-forms-datefield--variants","core-forms-datefield--with-calendar-icon","core-forms-datefield--with-calendar-picker","core-forms-datefield--with-calendar-picker-and-default-value","core-forms-datefield--with-calendar-picker-and-min-max","core-forms-datefield--with-calendar-picker-disabled","core-forms-datefield--with-calendar-picker-error","core-forms-datefield--with-calendar-picker-ghost","core-forms-datefield--with-calendar-picker-read-only","core-forms-datefield--with-error-message","core-forms-datefield--with-error-message-only","core-forms-datefield--with-label","core-forms-datefield--with-label-at-start","core-forms-datefield--with-min-and-max-value","core-forms-datefield--with-warning-message","core-forms-fileinput--basic","core-forms-fileinput--custom-labels","core-forms-fileinput--directory","core-forms-fileinput--disabled","core-forms-fileinput--label-position-start","core-forms-fileinput--multiple","core-forms-fileinput--variants","core-forms-fileinput--with-error","core-forms-fileinput--with-warning","core-forms-fileinput--without-label","core-forms-fileuploader--button-variant","core-forms-fileuploader--default","core-forms-fileuploader--disabled","core-forms-fileuploader--error-dropzone","core-forms-fileuploader--inline","core-forms-fileuploader--no-label","core-forms-fileuploader--variants","core-forms-imagedropzone--basic","core-forms-imagedropzone--controlled","core-forms-imagedropzone--disabled","core-forms-imagedropzone--variants","core-forms-imagedropzone--with-default-image","core-forms-imagedropzone--with-file-size-limit","core-forms-imagedropzone--with-file-type-restriction","core-forms-numberinput--basic","core-forms-numberinput--controlled","core-forms-numberinput--disabled","core-forms-numberinput--ghost-variant","core-forms-numberinput--read-only","core-forms-numberinput--variants","core-forms-numberinput--with-custom-step","core-forms-numberinput--with-description","core-forms-numberinput--with-error","core-forms-numberinput--with-error-and-error-message","core-forms-numberinput--with-label","core-forms-numberinput--with-label-at-start","core-forms-numberinput--with-min-and-max","core-forms-numberinput--without-stepper","core-forms-pagination--controlled","core-forms-pagination--disabled","core-forms-pagination--primary","core-forms-pagination--read-only","core-forms-pagination--variants","core-forms-pagination--with-custom-messages","core-forms-pagination--with-default-value","core-forms-pagination--with-large-numbers","core-forms-pagination--with-step","core-forms-pagination--without-actions","core-forms-radiogroup--basic","core-forms-radiogroup--controlled","core-forms-radiogroup--custom-render-option","core-forms-radiogroup--default-value","core-forms-radiogroup--disabled","core-forms-radiogroup--disabled-values","core-forms-radiogroup--horizontal","core-forms-radiogroup--read-only","core-forms-radiogroup--with-group-label","core-forms-radiogroup--with-group-label-at-start","core-forms-radiogroup--with-option-description","core-forms-radiogroup--with-option-label-at-start","core-forms-rangecalendar--default","core-forms-rangecalendar--disabled","core-forms-rangecalendar--extra-small","core-forms-rangecalendar--extra-small-no-title","core-forms-rangecalendar--fixed-weeks","core-forms-rangecalendar--international-calendar","core-forms-rangecalendar--read-only","core-forms-rangecalendar--select-month","core-forms-rangecalendar--select-month-and-year","core-forms-rangecalendar--select-month-and-year-with-title","core-forms-rangecalendar--select-month-with-title","core-forms-rangecalendar--unavailable-dates","core-forms-rangecalendar--with-default-value","core-forms-rangecalendar--with-min-max","core-forms-rangecalendar--with-title","core-forms-searchinput--basic","core-forms-searchinput--clear-button-focusable","core-forms-searchinput--disabled","core-forms-searchinput--variants","core-forms-select--basic","core-forms-select--controlled","core-forms-select--empty-items","core-forms-select--ghost","core-forms-select--long-labels","core-forms-select--long-list","core-forms-select--read-only","core-forms-select--scrollable","core-forms-select--with-autocomplete","core-forms-select--with-controlled-open","core-forms-select--with-custom-trigger","core-forms-select--with-default-open","core-forms-select--with-default-selected-item","core-forms-select--with-description","core-forms-select--with-disabled","core-forms-select--with-disabled-items","core-forms-select--with-error","core-forms-select--with-error-and-error-message","core-forms-select--with-label","core-forms-select--with-label-at-start","core-forms-select--with-section-headers","core-forms-select--with-sections","core-forms-select--with-virtualized-section-headers","core-forms-select--with-warning","core-forms-select--with-warning-and-warning-message","core-forms-select-iconselect--basic","core-forms-select-iconselect--disabled","core-forms-select-iconselect--read-only","core-forms-select-iconselect--with-default-open","core-forms-select-iconselect--with-error","core-forms-select-iconselect--with-warning","core-forms-select-iconselect--without-icon","core-forms-select-iconselect--without-tooltip","core-forms-select-multiselect--basic","core-forms-select-multiselect--controlled","core-forms-select-multiselect--ghost","core-forms-select-multiselect--hide-clear","core-forms-select-multiselect--hide-select-all","core-forms-select-multiselect--hide-select-all-and-clear","core-forms-select-multiselect--long-labels-as-tags","core-forms-select-multiselect--long-list","core-forms-select-multiselect--max-count-1","core-forms-select-multiselect--max-count-3","core-forms-select-multiselect--read-only","core-forms-select-multiselect--read-only-with-tags-open","core-forms-select-multiselect--scrollable","core-forms-select-multiselect--with-autocomplete","core-forms-select-multiselect--with-controlled-open","core-forms-select-multiselect--with-custom-trigger","core-forms-select-multiselect--with-default-open","core-forms-select-multiselect--with-default-selected-item","core-forms-select-multiselect--with-description","core-forms-select-multiselect--with-disabled","core-forms-select-multiselect--with-disabled-items","core-forms-select-multiselect--with-error","core-forms-select-multiselect--with-error-and-error-message","core-forms-select-multiselect--with-error-and-tags","core-forms-select-multiselect--with-label","core-forms-select-multiselect--with-label-at-start","core-forms-select-multiselect--with-sections","core-forms-select-multiselect--with-warning","core-forms-select-multiselect--with-warning-and-warning-message","core-forms-slider--basic","core-forms-slider--controlled","core-forms-slider--disabled","core-forms-slider--read-only","core-forms-slider--read-only-with-number-input","core-forms-slider--with-label","core-forms-slider--with-label-and-number-input","core-forms-slider--with-min-and-max","core-forms-slider--with-number-input","core-forms-slider--with-step","core-forms-slider-iconslider--basic","core-forms-slider-iconslider--disabled","core-forms-slider-iconslider--with-number-input","core-forms-slider-iconslider--without-tooltip","core-forms-switch--basic","core-forms-switch--disabled","core-forms-switch--selected","core-forms-switch--selected-disabled","core-forms-switch--with-label","core-forms-switch--with-label-and-status","core-forms-switch--with-label-in-left-and-status","core-forms-taggedpagination--basic","core-forms-taggedpagination--disabled","core-forms-taggedpagination--read-only","core-forms-taggedpagination--variant","core-forms-taggedpagination--with-page-label","core-forms-textinput--basic","core-forms-textinput--controlled","core-forms-textinput--disabled","core-forms-textinput--ghost-variant","core-forms-textinput--html-forms","core-forms-textinput--multiline","core-forms-textinput--multiline-variants","core-forms-textinput--multiline-with-rows","core-forms-textinput--read-only","core-forms-textinput--variants","core-forms-textinput--with-description","core-forms-textinput--with-error-message","core-forms-textinput--with-label","core-forms-textinput--with-label-at-start","core-forms-textinput--with-warning-message","core-forms-timefield--basic","core-forms-timefield--controlled","core-forms-timefield--default-value","core-forms-timefield--disabled","core-forms-timefield--ghost-variant","core-forms-timefield--html-forms","core-forms-timefield--placeholder-value","core-forms-timefield--read-only","core-forms-timefield--variants","core-forms-timefield--with-error-message","core-forms-timefield--with-error-message-only","core-forms-timefield--with-label","core-forms-timefield--with-label-at-start","core-forms-timefield--with-min-and-max-value","core-forms-timefield--with-warning-message","core-media-audioplayer--basic","core-media-audioplayer--small","core-miscellaneous-editor--basic","core-miscellaneous-editor--headless-custom","core-miscellaneous-editor-plain--auto-focus","core-miscellaneous-editor-plain--auto-focus-at-end","core-miscellaneous-editor-plain--auto-focus-at-start","core-miscellaneous-editor-plain--clear-on-cancel","core-miscellaneous-editor-plain--clear-on-save","core-miscellaneous-editor-plain--controlled","core-miscellaneous-editor-plain--custom-submit-icon","core-miscellaneous-editor-plain--default-save-disabled","core-miscellaneous-editor-plain--disabled","core-miscellaneous-editor-plain--minimal","core-miscellaneous-editor-plain--minimal-disabled","core-miscellaneous-editor-plain--minimal-multiline","core-miscellaneous-editor-plain--minimal-save-disabled","core-miscellaneous-editor-plain--not-inline","core-miscellaneous-editor-plain--save-on-enter","core-miscellaneous-editor-plain--variants","core-miscellaneous-editor-plain--with-cancel","core-miscellaneous-editor-plain--with-dynamic-caret-position","core-miscellaneous-editor-rich-text--auto-focus","core-miscellaneous-editor-rich-text--auto-focus-at-end","core-miscellaneous-editor-rich-text--clear-on-cancel","core-miscellaneous-editor-rich-text--clear-on-save","core-miscellaneous-editor-rich-text--controlled","core-miscellaneous-editor-rich-text--default","core-miscellaneous-editor-rich-text--disabled","core-miscellaneous-editor-rich-text--long-content","core-miscellaneous-editor-rich-text--mentions","core-miscellaneous-editor-rich-text--mentions-max-suggestions","core-miscellaneous-editor-rich-text--not-inline","core-miscellaneous-editor-rich-text--save-disabled","core-miscellaneous-editor-rich-text--save-on-enter","core-miscellaneous-editor-rich-text--variants","core-miscellaneous-editor-rich-text--with-cancel","core-miscellaneous-editor-rich-text--with-custom-footer-buttons","core-miscellaneous-editor-rich-text--with-placeholder","core-miscellaneous-freehandcanvas--basic","core-miscellaneous-freehandcanvas--clear-button","core-miscellaneous-freehandcanvas--controlled","core-miscellaneous-freehandcanvas--default-value","core-miscellaneous-freehandcanvas--disabled","core-miscellaneous-freehandcanvas--history-enabled","core-miscellaneous-freehandcanvas--label","core-miscellaneous-freehandcanvas--streamlining","core-miscellaneous-icon--basic","core-miscellaneous-toolbar--basic","core-miscellaneous-toolbar--collapsible","core-miscellaneous-toolbar--vertical","core-miscellaneous-toolbar--with-inputs","core-miscellaneous-toolbar--with-over-flow","core-miscellaneous-toolbar--with-tabbing-within","core-miscellaneous-toolbar--with-tooltip","core-navigation-accordion--basic","core-navigation-accordion--controlled","core-navigation-accordion--default-expanded-keys","core-navigation-accordion--disabled","core-navigation-accordion--single-expansion","core-navigation-accordion-accordionitem--force-mount","core-navigation-accordion-accordionitem--show-actions-on-trigger-only","core-navigation-accordion-accordionitem--with-buttons","core-navigation-accordion-accordionitem--with-sub-labels","core-navigation-accordion-accordionitem--with-tabbable-content","core-navigation-disclosure--basic","core-navigation-disclosure--controlled","core-navigation-disclosure--truncated-title","core-navigation-disclosure--variants","core-navigation-disclosure--with-custom-icon","core-navigation-disclosure--with-interactive-content","core-navigation-disclosure--with-long-content","core-navigation-disclosure--without-description","core-navigation-link--basic","core-navigation-link--client-side-action","core-navigation-link--variants","core-navigation-stepper--all-complete","core-navigation-stepper--all-states","core-navigation-stepper--condensed","core-navigation-stepper--controlled","core-navigation-stepper--default","core-navigation-stepper--expanded-without-descriptions","core-navigation-stepper--frontier-ahead-of-selection","core-navigation-stepper--indicator-only","core-navigation-stepper--indicator-only-expanded","core-navigation-stepper--is-disabled","core-navigation-stepper--long-title-and-description","core-navigation-stepper--mixed-indicator-and-titled-items","core-navigation-stepper--per-item-aria-label-overrides-title","core-navigation-stepper--single-item","core-navigation-stepper--size-small-condensed","core-navigation-stepper--size-small-expanded","core-navigation-stepper--two-steps","core-navigation-stepper--with-disabled-step","core-navigation-tabs--basic","core-navigation-tabs--controlled","core-navigation-tabs--ghost","core-navigation-tabs--with-action-button","core-navigation-tabs--with-close-button","core-navigation-tabs--with-default-selected","core-navigation-tabs--with-disabled","core-navigation-tabs--with-focusable-content","core-navigation-tabs--with-specific-disabled","core-navigation-tabs-tabitem--with-icon","core-overlays-alertdialog--auto-focus-cancel-button","core-overlays-alertdialog--basic","core-overlays-alertdialog--custom-focused-button","core-overlays-alertdialog--default-open","core-overlays-alertdialog--long-content","core-overlays-alertdialog--only-cancel-button","core-overlays-alertdialog--only-primary-action","core-overlays-alertdialog--primary-action-disabled","core-overlays-alertdialog--separate-close-handler","core-overlays-alertdialog--with-text-input","core-overlays-alertdialog--with-title-only","core-overlays-alertdialog--without-close-button","core-overlays-alertdialog--without-icon","core-overlays-alertdialog--without-message-and-actions","core-overlays-dialog--basic","core-overlays-dialog--default-open","core-overlays-dialog--different-sizes","core-overlays-dialog--ghost","core-overlays-drawer--basic","core-overlays-drawer--with-action","core-overlays-inlinetoolbar--basic","core-overlays-inlinetoolbar--controlled","core-overlays-inlinetoolbar--disabled","core-overlays-inlinetoolbar--disabled-keys","core-overlays-inlinetoolbar--with-interactive-element","core-overlays-inlinetoolbar--with-scroll","core-overlays-modal--basic","core-overlays-modal--controlled","core-overlays-modal--default-open","core-overlays-modal-modalcontent--disabled-animation","core-overlays-modal-modalcontent--drawer-mobile","core-overlays-modal-modalcontent--drawer-mobile-with-nested-popover","core-overlays-modal-modalcontent--form-controls","core-overlays-modal-modalcontent--long-content","core-overlays-modal-modalcontent--not-dismissable","core-overlays-modal-modalcontent--uncontrolled-interaction-outside","core-overlays-modal-modalcontent--with-disabled-focus-management","core-overlays-modal-modalcontent--with-inert","core-overlays-popover--basic","core-overlays-popover--event-leak-fix","core-overlays-popover--with-arrow","core-overlays-popover--with-boundary-element","core-overlays-popover--with-custom-target","core-overlays-popover--with-dynamic-trigger-width","core-overlays-popover--with-no-boundary","core-overlays-popover--with-scrollable-content","core-overlays-popover--with-scrollable-content-non-modal","core-overlays-popover--with-scrollable-viewport","core-overlays-popover--with-tooltip","core-overlays-popover-popovercontent--basic","core-overlays-popover-popovercontent--contained-focus","core-overlays-popover-popovercontent--default-open-with-arrow","core-overlays-popover-popovercontent--disable-animation","core-overlays-popover-popovercontent--manual-repositioning","core-overlays-popover-popovercontent--nested-scrollable-containers","core-overlays-popover-popovercontent--scroll-repositioning","core-overlays-popover-popovercontent--with-boundary-axis","core-overlays-popover-popovercontent--with-horizontal-boundary-behavior","core-overlays-popover-popovertrigger--basic","core-overlays-popover-popovertrigger--function-children","core-overlays-popover-popovertrigger--with-updated-position","core-overlays-tooltip--basic","core-overlays-tooltip--controlled-open","core-overlays-tooltip--disabled","core-overlays-tooltip--focus-trigger","core-overlays-tooltip--no-text","core-overlays-tooltip--placement","core-overlays-tooltip--variants","core-overlays-tooltip--variants-size","core-overlays-tooltip--with-cross-offset","core-overlays-tooltip--with-focusable","core-overlays-tooltip--with-offset","core-overlays-tooltip--with-on-open-change","core-status-inlinealert--basic","core-status-inlinealert--compact","core-status-inlinealert--compact-with-action","core-status-inlinealert--compact-with-action-and-close","core-status-inlinealert--multi-line","core-status-inlinealert--multi-line-with-action","core-status-inlinealert--multi-line-with-action-and-close","core-status-inlinealert--sizes","core-status-inlinealert--variants","core-status-inlinealert--with-action","core-status-inlinealert--with-action-and-close","core-status-progressbar--basic","core-status-progressbar--variants","core-status-progressbar--with-custom-number-formatter","core-status-progressbar--with-custom-value-label","core-status-progressbar--with-error","core-status-progressbar--with-max-value","core-status-progressbar--with-min-and-max-value","core-status-progressbar--with-min-value","core-status-progressbar--with-no-description","core-status-progressbar--with-no-label","core-status-progressbar--with-show-value","core-status-progressspinner--error","core-status-progressspinner--primary","core-status-progressspinner--success","core-status-progressspinner--variants","core-status-progressspinner--without-label","core-status-toast--basic","core-status-toast--timeout","core-status-toast--variants-with-action","core-status-toast--variants-without-action","core-status-toast--with-action","core-utilities-actionable--basic","core-utilities-actionable--disabled","core-utilities-actionable--with-complex-content","core-utilities-actionable--with-div","core-utilities-actionable--with-dynamic-button-styling","core-utilities-actionable--with-dynamic-child-styling","core-utilities-box--basic","core-utilities-box--element-type","core-utilities-box--flex-layout","core-utilities-box--media-queries","core-utilities-box--nested-boxes","core-utilities-dateformat--basic","core-utilities-dateformat--time-only","core-utilities-dateformat--time-only-with-time-zone","core-utilities-dateformat--time-zone-24-hour","core-utilities-dateformat--with-date-and-time","core-utilities-deviceprovider--always-desktop","core-utilities-deviceprovider--always-mobile","core-utilities-deviceprovider--basic","core-utilities-deviceprovider--custom-breakpoints","core-utilities-frameprovider--always-contained","core-utilities-frameprovider--basic","core-utilities-frameprovider--custom-portal-container","core-utilities-frameprovider--inside-shadow-root","core-utilities-frameprovider--nested-containers","core-utilities-frameprovider--never-contained","core-utilities-frameprovider--popover-with-frame-boundary","core-utilities-frameprovider--portal-container-outside-container","core-utilities-frameprovider--with-interactive-elements-outside-of-container","core-utilities-group--basic","core-utilities-i18nprovider--string-format","core-utilities-messageformat--basic","core-utilities-numberformat--basic","core-utilities-numberformat--currency","core-utilities-numberformat--currency-with-fraction-digits","core-utilities-numberformat--currency-with-fraction-digits-and-currency-display","core-utilities-numberformat--percent","core-utilities-numberformat--percent-with-fraction-digits","core-utilities-panel--basic","core-utilities-panel--collapsible","core-utilities-panel--conditional","core-utilities-panel--controlled","core-utilities-panel--disabled-handle","core-utilities-panel--max-size","core-utilities-panel--multiple","core-utilities-panel--nested","core-utilities-panel--persistent","core-utilities-panel--vertical","core-utilities-portal--basic","core-utilities-themeprovider--basic","json-render-examples--dashboard","json-render-examples--data-table","json-render-examples--login-form","json-render-examples--settings-panel"];var h={version:"3.4.0"};var b=`
|
|
37541
38177
|
# Baseline UI MCP Server Guidelines
|
|
37542
38178
|
|
|
37543
38179
|
This MCP server provides AI assistants with structured access to Baseline UI's comprehensive component documentation, icon library, theming resources, and design guidelines.
|
|
@@ -37580,7 +38216,7 @@ When recommending styling or customization approaches:
|
|
|
37580
38216
|
4. **Theming Support**: Design systems with themes enabled; use the theming guides for color scheme customization
|
|
37581
38217
|
5. **Browser Compatibility**: Ensure components are used in browser environments with required APIs
|
|
37582
38218
|
6. **Box Component Usage**: Use the Box component to wrap all components that need to be styled with the design system. The Box component is a generic container component that can be used to wrap other components. It is used to provide a consistent API for layout and spacing. You can use any sprinkle as a prop to add styling to the box.
|
|
37583
|
-
`,
|
|
38219
|
+
`,l=`
|
|
37584
38220
|
A list of available components with descriptions and similar component suggestions. In case don't find the exact component you are looking for, you can look for similar components in the "Similar To" column. The "Similar To" column is a list of components that are similar to the one you are looking for.
|
|
37585
38221
|
|
|
37586
38222
|
A component can be imported using:
|
|
@@ -37588,7 +38224,7 @@ A component can be imported using:
|
|
|
37588
38224
|
\`\`\`tsx
|
|
37589
38225
|
import { ComponentName } from "@baseline-ui/core";
|
|
37590
38226
|
\`\`\`
|
|
37591
|
-
`,
|
|
38227
|
+
`,c=`
|
|
37592
38228
|
A complete icon library organized by size with import instructions. The icons are organized by size and can be imported using the import statement provided.
|
|
37593
38229
|
|
|
37594
38230
|
An icon can be imported using:
|
|
@@ -37604,7 +38240,7 @@ Example:
|
|
|
37604
38240
|
\`\`\`tsx
|
|
37605
38241
|
import { IconName } from "@baseline-ui/icons/12";
|
|
37606
38242
|
\`\`\`
|
|
37607
|
-
`;var
|
|
38243
|
+
`;var g=`
|
|
37608
38244
|
Detailed documentation, props, and story IDs for any Baseline UI component. This resource provides comprehensive component specifications and usage examples.
|
|
37609
38245
|
|
|
37610
38246
|
## Response Structure
|
|
@@ -37640,11 +38276,11 @@ Components can be imported using:
|
|
|
37640
38276
|
\`\`\`tsx
|
|
37641
38277
|
import { ComponentName } from "@baseline-ui/core";
|
|
37642
38278
|
\`\`\`
|
|
37643
|
-
`,
|
|
37644
|
-
Generate a live demo URL for a Baseline UI story. Use story
|
|
37645
|
-
`,
|
|
37646
|
-
Get the Figma URL for a given component. The response
|
|
37647
|
-
`,
|
|
38279
|
+
`,f=`
|
|
38280
|
+
Generate a live demo URL for a Baseline UI story. Use a story ID from the Storybook index; the component info tool lists them for each component. The response is the URL, or an error result with suggestions when the story id is unknown. You can use this URL to understand the structure of the component and how to customize it.
|
|
38281
|
+
`,y=`
|
|
38282
|
+
Get the Figma URL for a given component. The response is the URL, or an error result when the component has no linked Figma design. You can use this URL to understand the structure of the component and how it looks. The actual component's HTML structure might be slightly different from the Figma design but the overall structure and design should be the same including the design tokens.
|
|
38283
|
+
`,d=`
|
|
37648
38284
|
Best practices and guidelines for using Baseline UI components, styling, and design tokens. READ THIS BEFORE DOING ANYTHING.
|
|
37649
38285
|
|
|
37650
38286
|
## Usage
|
|
@@ -37652,9 +38288,9 @@ Best practices and guidelines for using Baseline UI components, styling, and des
|
|
|
37652
38288
|
Use this resource to:
|
|
37653
38289
|
- Understand best practices for using Baseline UI components
|
|
37654
38290
|
- Understand styling guidelines for using Baseline UI components
|
|
37655
|
-
`,
|
|
38291
|
+
`,p=`
|
|
37656
38292
|
A guide for implementing styling elements in Baseline UI components or applying styling to existing components. READ THIS BEFORE DOING ANYTHING.
|
|
37657
|
-
`,
|
|
38293
|
+
`,v=`
|
|
37658
38294
|
List all 8 available resources in the Baseline UI MCP server with their descriptions and URIs. Use this tool to discover what information and documentation is available.
|
|
37659
38295
|
|
|
37660
38296
|
## Available Resources
|
|
@@ -37692,14 +38328,15 @@ Use this tool to:
|
|
|
37692
38328
|
- Consult **list_components** to find the right component for your needs
|
|
37693
38329
|
- Reference **theming** for custom design systems
|
|
37694
38330
|
- Check **styling** for CSS and design token guidance
|
|
37695
|
-
`;var
|
|
38331
|
+
`;var I=`# List of available components in Baseline UI design system
|
|
37696
38332
|
| Name | Description | Similar To |
|
|
37697
38333
|
| --- | --- | --- |
|
|
37698
|
-
${Object.entries(
|
|
38334
|
+
${Object.entries(o).toSorted(([n],[e])=>n.localeCompare(e)).map(([n,{description:e,similarTo:t}])=>`|${n}|${e}|${t?.join(", ")||""}|`).join(`
|
|
37699
38335
|
`)}
|
|
37700
|
-
`,
|
|
38336
|
+
`,P=Object.entries(m).map(([n,e])=>`## ${n}
|
|
37701
38337
|
|
|
37702
|
-
|
|
38338
|
+
${e.map(t=>"- "+t).join(`
|
|
37703
38339
|
`)}`).join(`
|
|
37704
|
-
|
|
37705
|
-
|
|
38340
|
+
|
|
38341
|
+
`),D=new Set(r);function B(n){let e=n.toLowerCase();if(!e)return [];let t=r.filter(s=>s.includes(e));if(t.length>0)return t.slice(0,5);let a=e.split("--")[0];return a?r.filter(s=>s.includes(a)).slice(0,5):[]}function K(){let n=new McpServer({name:"baseline-ui",version:h.version});return n.registerResource("list_components","resource://baseline-ui/list_components.md",{description:l,mimeType:"text/markdown"},e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:I}]})),n.registerResource("list_icons","resource://baseline-ui/list_icons.md",{description:c,mimeType:"text/markdown"},e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:P}]})),n.registerResource("getting_started","resource://baseline-ui/getting_started.md",{description:"Quick start guide for integrating Baseline UI into new projects",mimeType:"text/markdown"},e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:i.gettingStarted}]})),n.registerResource("nutrient_web_viewer_theming","resource://baseline-ui/nutrient_web_viewer_theming.md",{description:"Specialized theming guide for customizing Baseline UI in Nutrient Web Viewer. This is not applicable if you are not theming the Nutrient Web Viewer SDK.",mimeType:"text/markdown"},e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:i.nutrientWebViewerTheming}]})),n.registerResource("theming","resource://baseline-ui/theming.md",{description:"Comprehensive guide for implementing custom themes and color schemes in Baseline UI",mimeType:"text/markdown"},e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:i.theming}]})),n.registerResource("internationalization","resource://baseline-ui/internationalization.md",{description:"Guide for implementing multi-language support and localization in Baseline UI",mimeType:"text/markdown"},e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:i.internationalization}]})),n.registerResource("styling","resource://baseline-ui/styling.md",{description:p,mimeType:"text/markdown"},e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:i.styling}]})),n.registerResource("guidelines","resource://baseline-ui/guidelines.md",{description:d,mimeType:"text/markdown"},e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:b}]})),n.registerTool("get_component_info",{title:"Get component info",description:g,inputSchema:{componentName:z.enum(Object.keys(o))}},({componentName:e})=>({content:[{type:"text",text:JSON.stringify(Object.fromEntries(Object.entries(o[e]).filter(([t])=>!["description","similarTo","figmaUrl"].includes(t))),null,2)}]})),n.registerTool("get_story_url",{title:"Get story demo URL",description:f,inputSchema:{storyId:z.string()}},({storyId:e})=>{let t=e.toLowerCase();if(!D.has(t)){let a=B(e);return {isError:true,content:[{type:"text",text:`Unknown story id "${e}".`+(a.length>0?` Did you mean: ${a.join(", ")}?`:"")+" Story ids come from the Storybook index; get_component_info lists them under `stories.usage[].id`."}]}}return {content:[{type:"text",text:`https://nutrient.io/baseline-ui/iframe.html?id=${t}`}]}}),n.registerTool("get_figma_url",{title:"Get Figma URL",description:y,inputSchema:{componentName:z.enum(Object.keys(o))}},({componentName:e})=>{let{figmaUrl:t}=o[e];return t?{content:[{type:"text",text:t}]}:{isError:true,content:[{type:"text",text:`No Figma URL is available for ${e}.`}]}}),n.registerTool("list_available_resources",{title:"List Available Resources",description:v,inputSchema:{}},()=>({content:[{type:"text",text:JSON.stringify([{name:"list_components",uri:"resource://baseline-ui/list_components.md",description:l,mimeType:"text/markdown"},{name:"list_icons",uri:"resource://baseline-ui/list_icons.md",description:c,mimeType:"text/markdown"},{name:"getting_started",uri:"resource://baseline-ui/getting_started.md",description:"Quick start guide for integrating Baseline UI into new projects",mimeType:"text/markdown"},{name:"nutrient_web_viewer_theming",uri:"resource://baseline-ui/nutrient_web_viewer_theming.md",description:"Specialized theming guide for customizing Baseline UI in Nutrient Web Viewer. This is not applicable if you are not theming the Nutrient Web Viewer SDK.",mimeType:"text/markdown"},{name:"theming",uri:"resource://baseline-ui/theming.md",description:"Comprehensive guide for implementing custom themes and color schemes in Baseline UI",mimeType:"text/markdown"},{name:"internationalization",uri:"resource://baseline-ui/internationalization.md",description:"Guide for implementing multi-language support and localization in Baseline UI",mimeType:"text/markdown"},{name:"styling",uri:"resource://baseline-ui/styling.md",description:p,mimeType:"text/markdown"},{name:"guidelines",uri:"resource://baseline-ui/guidelines.md",description:d,mimeType:"text/markdown"}],null,2)}]})),n}
|
|
38342
|
+
export{K as a};
|