@baseline-ui/mcp 3.3.0 → 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 +7 -0
- package/dist/{chunk-TZ3HMVY7.js → chunk-KU5KEP2T.js} +808 -330
- package/dist/index.js +1 -1
- package/dist/server.cjs +807 -329
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/sbom.json +13 -13
|
@@ -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.
|
|
@@ -2582,7 +2668,34 @@ playingLabel?: string
|
|
|
2582
2668
|
* Message id: \`bui.useMedia.paused\`. Defaults to \`"Paused"\`.
|
|
2583
2669
|
*/
|
|
2584
2670
|
pausedLabel?: string
|
|
2585
|
-
}`,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.
|
|
2586
2699
|
|
|
2587
2700
|
\`\`\`jsx
|
|
2588
2701
|
import { Avatar } from "../../utils";
|
|
@@ -3313,14 +3426,19 @@ export const CalendarExample: React.FC<
|
|
|
3313
3426
|
Omit<CalendarProps, "defaultValue" | "value"> & {
|
|
3314
3427
|
defaultValue?: string;
|
|
3315
3428
|
value?: string;
|
|
3429
|
+
externalLabel?: string;
|
|
3316
3430
|
}
|
|
3317
|
-
> = ({ defaultValue, value, ...rest }) => {
|
|
3431
|
+
> = ({ defaultValue, value, externalLabel, ...rest }) => {
|
|
3318
3432
|
return (
|
|
3433
|
+
<>
|
|
3434
|
+
{externalLabel ? <span id="external-label">{externalLabel}</span> : null}
|
|
3319
3435
|
<Calendar
|
|
3436
|
+
aria-labelledby={externalLabel ? "external-label" : undefined}
|
|
3320
3437
|
{...rest}
|
|
3321
3438
|
defaultValue={defaultValue ? parseDate(defaultValue) : undefined}
|
|
3322
3439
|
value={value ? parseDate(value) : undefined}
|
|
3323
3440
|
/>
|
|
3441
|
+
</>
|
|
3324
3442
|
);
|
|
3325
3443
|
};
|
|
3326
3444
|
|
|
@@ -3439,10 +3557,14 @@ export const RangeCalendarExample: React.FC<
|
|
|
3439
3557
|
Omit<RangeCalendarProps, "defaultValue" | "value"> & {
|
|
3440
3558
|
defaultValue?: { start: string; end: string };
|
|
3441
3559
|
value?: { start: string; end: string };
|
|
3560
|
+
externalLabel?: string;
|
|
3442
3561
|
}
|
|
3443
|
-
> = ({ defaultValue, value, ...rest }) => {
|
|
3562
|
+
> = ({ defaultValue, value, externalLabel, ...rest }) => {
|
|
3444
3563
|
return (
|
|
3564
|
+
<>
|
|
3565
|
+
{externalLabel ? <span id="external-label">{externalLabel}</span> : null}
|
|
3445
3566
|
<RangeCalendar
|
|
3567
|
+
aria-labelledby={externalLabel ? "external-label" : undefined}
|
|
3446
3568
|
{...rest}
|
|
3447
3569
|
defaultValue={
|
|
3448
3570
|
defaultValue
|
|
@@ -3458,6 +3580,7 @@ export const RangeCalendarExample: React.FC<
|
|
|
3458
3580
|
: undefined
|
|
3459
3581
|
}
|
|
3460
3582
|
/>
|
|
3583
|
+
</>
|
|
3461
3584
|
);
|
|
3462
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.
|
|
3463
3586
|
|
|
@@ -3811,14 +3934,19 @@ export const CalendarExample: React.FC<
|
|
|
3811
3934
|
Omit<CalendarProps, "defaultValue" | "value"> & {
|
|
3812
3935
|
defaultValue?: string;
|
|
3813
3936
|
value?: string;
|
|
3937
|
+
externalLabel?: string;
|
|
3814
3938
|
}
|
|
3815
|
-
> = ({ defaultValue, value, ...rest }) => {
|
|
3939
|
+
> = ({ defaultValue, value, externalLabel, ...rest }) => {
|
|
3816
3940
|
return (
|
|
3941
|
+
<>
|
|
3942
|
+
{externalLabel ? <span id="external-label">{externalLabel}</span> : null}
|
|
3817
3943
|
<Calendar
|
|
3944
|
+
aria-labelledby={externalLabel ? "external-label" : undefined}
|
|
3818
3945
|
{...rest}
|
|
3819
3946
|
defaultValue={defaultValue ? parseDate(defaultValue) : undefined}
|
|
3820
3947
|
value={value ? parseDate(value) : undefined}
|
|
3821
3948
|
/>
|
|
3949
|
+
</>
|
|
3822
3950
|
);
|
|
3823
3951
|
};
|
|
3824
3952
|
|
|
@@ -3937,10 +4065,14 @@ export const RangeCalendarExample: React.FC<
|
|
|
3937
4065
|
Omit<RangeCalendarProps, "defaultValue" | "value"> & {
|
|
3938
4066
|
defaultValue?: { start: string; end: string };
|
|
3939
4067
|
value?: { start: string; end: string };
|
|
4068
|
+
externalLabel?: string;
|
|
3940
4069
|
}
|
|
3941
|
-
> = ({ defaultValue, value, ...rest }) => {
|
|
4070
|
+
> = ({ defaultValue, value, externalLabel, ...rest }) => {
|
|
3942
4071
|
return (
|
|
4072
|
+
<>
|
|
4073
|
+
{externalLabel ? <span id="external-label">{externalLabel}</span> : null}
|
|
3943
4074
|
<RangeCalendar
|
|
4075
|
+
aria-labelledby={externalLabel ? "external-label" : undefined}
|
|
3944
4076
|
{...rest}
|
|
3945
4077
|
defaultValue={
|
|
3946
4078
|
defaultValue
|
|
@@ -3956,6 +4088,7 @@ export const RangeCalendarExample: React.FC<
|
|
|
3956
4088
|
: undefined
|
|
3957
4089
|
}
|
|
3958
4090
|
/>
|
|
4091
|
+
</>
|
|
3959
4092
|
);
|
|
3960
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 {
|
|
3961
4094
|
/**
|
|
@@ -4781,7 +4914,45 @@ labelPosition?: any
|
|
|
4781
4914
|
label: item.label,
|
|
4782
4915
|
}))}
|
|
4783
4916
|
aria-label="Color Swatch Picker"
|
|
4784
|
-
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.
|
|
4785
4956
|
|
|
4786
4957
|
\`\`\`jsx
|
|
4787
4958
|
<ComboBox
|
|
@@ -5024,6 +5195,8 @@ variant?: "primary" | "ghost"
|
|
|
5024
5195
|
labelPosition?: "top" | "start"
|
|
5025
5196
|
/**
|
|
5026
5197
|
* Whether the input is read only.
|
|
5198
|
+
*
|
|
5199
|
+
* @deprecated Use \`isReadOnly\`, which takes precedence when both are set.
|
|
5027
5200
|
*/
|
|
5028
5201
|
readOnly?: boolean
|
|
5029
5202
|
/**
|
|
@@ -5041,6 +5214,12 @@ inputClassName?: string
|
|
|
5041
5214
|
* overrides any \`aria-labelledby\` the toggle would otherwise inherit.
|
|
5042
5215
|
*/
|
|
5043
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
|
+
*/
|
|
5044
5223
|
filterItems?: boolean
|
|
5045
5224
|
onInputChange?: (value: string) => void
|
|
5046
5225
|
showIcon?: boolean
|
|
@@ -5073,7 +5252,8 @@ items: ListItem[]
|
|
|
5073
5252
|
*/
|
|
5074
5253
|
menuTrigger?: "manual" | "input" | "focus"
|
|
5075
5254
|
/**
|
|
5076
|
-
* Custom filter function to use when filtering items.
|
|
5255
|
+
* Custom filter function to use when filtering items. Ignored when
|
|
5256
|
+
* \`filterItems\` is \`false\`.
|
|
5077
5257
|
*/
|
|
5078
5258
|
filter?: ComboBoxStateOptions<ListItem>["defaultFilter"]
|
|
5079
5259
|
/**
|
|
@@ -6212,6 +6392,10 @@ openCalendarLabel?: string
|
|
|
6212
6392
|
label="Label"
|
|
6213
6393
|
errorMessage="Error message"
|
|
6214
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"
|
|
6215
6399
|
granularity="day" />;`},{id:"core-forms-datefield--with-warning-message",name:"With Warning Message",snippet:`const WithWarningMessage = () => <DateField
|
|
6216
6400
|
onChange={fn()}
|
|
6217
6401
|
label="Label"
|
|
@@ -6324,12 +6508,12 @@ export const MinMaxDateFieldExample: React.FC<
|
|
|
6324
6508
|
maxValue={new CalendarDate(2022, 6, 30)}
|
|
6325
6509
|
/>
|
|
6326
6510
|
);
|
|
6327
|
-
};`},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).
|
|
6328
6512
|
|
|
6329
6513
|
\`\`\`jsx
|
|
6330
|
-
import { DateFormat } from "
|
|
6514
|
+
import { DateFormat } from "@baseline-ui/core";
|
|
6331
6515
|
|
|
6332
|
-
const date = "2020-01-01T00:00:00.000Z";
|
|
6516
|
+
const date = new Date("2020-01-01T00:00:00.000Z");
|
|
6333
6517
|
|
|
6334
6518
|
export default () => <DateFormat date={date} />;
|
|
6335
6519
|
\`\`\`
|
|
@@ -6339,9 +6523,9 @@ The above example will render the date in the default locale of the browser.
|
|
|
6339
6523
|
You can override the default locale by using \`I18nProvider\`.
|
|
6340
6524
|
|
|
6341
6525
|
\`\`\`jsx
|
|
6342
|
-
import { I18nProvider } from "
|
|
6526
|
+
import { DateFormat, I18nProvider } from "@baseline-ui/core";
|
|
6343
6527
|
|
|
6344
|
-
const date = "2020-01-01T00:00:00.000Z";
|
|
6528
|
+
const date = new Date("2020-01-01T00:00:00.000Z");
|
|
6345
6529
|
|
|
6346
6530
|
export default () => (
|
|
6347
6531
|
<I18nProvider locale="es">
|
|
@@ -6355,9 +6539,9 @@ The above example will render the date in Espa\xF1ol.
|
|
|
6355
6539
|
You can also format the time portion of the date.
|
|
6356
6540
|
|
|
6357
6541
|
\`\`\`jsx
|
|
6358
|
-
import { DateFormat } from "
|
|
6542
|
+
import { DateFormat } from "@baseline-ui/core";
|
|
6359
6543
|
|
|
6360
|
-
const date = "2020-01-01T00:00:00.000Z";
|
|
6544
|
+
const date = new Date("2020-01-01T00:00:00.000Z");
|
|
6361
6545
|
|
|
6362
6546
|
export default () => <DateFormat date={date} timeStyle={"full"} />;
|
|
6363
6547
|
\`\`\``,props:`interface DateFormatProps {
|
|
@@ -6675,12 +6859,6 @@ By default, the \`Dialog\` component traps focus within the dialog. This means t
|
|
|
6675
6859
|
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
6676
6860
|
| <kbd>Esc</kbd> | Close the dialog |
|
|
6677
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 {
|
|
6678
|
-
/**
|
|
6679
|
-
* The accessibility role for the dialog.
|
|
6680
|
-
*
|
|
6681
|
-
* @default 'dialog'
|
|
6682
|
-
*/
|
|
6683
|
-
role?: 'dialog' | 'alertdialog'
|
|
6684
6862
|
/**
|
|
6685
6863
|
* @deprecated Do not use in new components. This is a legacy block
|
|
6686
6864
|
* identifier; new components should exclude it via
|
|
@@ -6721,7 +6899,7 @@ children: React.ReactNode
|
|
|
6721
6899
|
/**
|
|
6722
6900
|
* The size of the dialog. This defines the max width of the dialog.
|
|
6723
6901
|
*
|
|
6724
|
-
* @default "
|
|
6902
|
+
* @default "md"
|
|
6725
6903
|
*/
|
|
6726
6904
|
size?: "sm" | "md" | "lg" | "content"
|
|
6727
6905
|
/**
|
|
@@ -7481,12 +7659,6 @@ className?: string
|
|
|
7481
7659
|
* The style applied to the root element of the component.
|
|
7482
7660
|
*/
|
|
7483
7661
|
style?: React.CSSProperties
|
|
7484
|
-
/**
|
|
7485
|
-
* The accessibility role for the dialog.
|
|
7486
|
-
*
|
|
7487
|
-
* @default 'dialog'
|
|
7488
|
-
*/
|
|
7489
|
-
role?: 'dialog' | 'alertdialog'
|
|
7490
7662
|
/**
|
|
7491
7663
|
* The children to render.
|
|
7492
7664
|
*/
|
|
@@ -8512,30 +8684,6 @@ errorMessage?: string
|
|
|
8512
8684
|
* The warning message to display when the input is in a warning state.
|
|
8513
8685
|
*/
|
|
8514
8686
|
warningMessage?: string
|
|
8515
|
-
/**
|
|
8516
|
-
* Specifies what mime type of files are allowed.
|
|
8517
|
-
*/
|
|
8518
|
-
acceptedFileTypes?: ReadonlyArray<string>
|
|
8519
|
-
/**
|
|
8520
|
-
* Whether multiple files can be selected.
|
|
8521
|
-
*/
|
|
8522
|
-
allowsMultiple?: boolean
|
|
8523
|
-
/**
|
|
8524
|
-
* Specifies the use of a media capture mechanism to capture the media on the spot.
|
|
8525
|
-
*/
|
|
8526
|
-
defaultCamera?: 'user' | 'environment'
|
|
8527
|
-
/**
|
|
8528
|
-
* Handler when a user selects a file.
|
|
8529
|
-
*/
|
|
8530
|
-
onSelect?: (files: FileList | null) => void
|
|
8531
|
-
/**
|
|
8532
|
-
* The children of the component.
|
|
8533
|
-
*/
|
|
8534
|
-
children?: ReactNode
|
|
8535
|
-
/**
|
|
8536
|
-
* Enables the selection of directories instead of individual files.
|
|
8537
|
-
*/
|
|
8538
|
-
acceptDirectory?: boolean
|
|
8539
8687
|
/**
|
|
8540
8688
|
* The id applied to the root element of the component.
|
|
8541
8689
|
*/
|
|
@@ -8913,7 +9061,9 @@ export const manyItems: FileListItem[] = Array.from({ length: 12 }, (_, i) => ({
|
|
|
8913
9061
|
|
|
8914
9062
|
// Swaps in a new array whose items carry new content, which is the only way a caller can
|
|
8915
9063
|
// legitimately invalidate the memoised options.
|
|
8916
|
-
export const UploadingFileList: React.FC = (
|
|
9064
|
+
export const UploadingFileList: React.FC<{ errorMessage?: string }> = ({
|
|
9065
|
+
errorMessage,
|
|
9066
|
+
}) => {
|
|
8917
9067
|
const [items, setItems] = React.useState<FileListItem[]>(loadingItems);
|
|
8918
9068
|
|
|
8919
9069
|
return (
|
|
@@ -8922,7 +9072,7 @@ export const UploadingFileList: React.FC = () => {
|
|
|
8922
9072
|
label="Finish upload"
|
|
8923
9073
|
onPress={() => {
|
|
8924
9074
|
setItems((prev) =>
|
|
8925
|
-
prev.map((item) => ({ ...item, isLoading: false })),
|
|
9075
|
+
prev.map((item) => ({ ...item, isLoading: false, errorMessage })),
|
|
8926
9076
|
);
|
|
8927
9077
|
}}
|
|
8928
9078
|
/>
|
|
@@ -10660,7 +10810,7 @@ export const EditableGridListExample: React.FC<GridListExampleProps> = (
|
|
|
10660
10810
|
</button>
|
|
10661
10811
|
</>
|
|
10662
10812
|
);
|
|
10663
|
-
};`},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 {
|
|
10664
10814
|
/**
|
|
10665
10815
|
* @deprecated Do not use in new components. This is a legacy block
|
|
10666
10816
|
* identifier; new components should exclude it via
|
|
@@ -12989,10 +13139,13 @@ export const items = [
|
|
|
12989
13139
|
|
|
12990
13140
|
export const InlineToolbarExample = ({
|
|
12991
13141
|
children,
|
|
13142
|
+
itemsAsFunction,
|
|
12992
13143
|
...args
|
|
12993
|
-
}: Partial<React.ComponentProps<typeof InlineToolbar>>
|
|
13144
|
+
}: Partial<React.ComponentProps<typeof InlineToolbar>> & {
|
|
13145
|
+
itemsAsFunction?: boolean;
|
|
13146
|
+
}) => {
|
|
12994
13147
|
return (
|
|
12995
|
-
<InlineToolbar {...args} items={items}>
|
|
13148
|
+
<InlineToolbar {...args} items={itemsAsFunction ? () => items : items}>
|
|
12996
13149
|
{React.Children.count(children) > 0 ? (
|
|
12997
13150
|
children!
|
|
12998
13151
|
) : (
|
|
@@ -13080,6 +13233,11 @@ shouldUseSymbol?: boolean
|
|
|
13080
13233
|
</Box>
|
|
13081
13234
|
</Box>
|
|
13082
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'
|
|
13083
13241
|
/**
|
|
13084
13242
|
* Whether the link is disabled.
|
|
13085
13243
|
*/
|
|
@@ -13271,7 +13429,9 @@ renderOption?: (
|
|
|
13271
13429
|
ref: React.Ref<HTMLLIElement>,
|
|
13272
13430
|
) => React.ReactNode
|
|
13273
13431
|
/**
|
|
13274
|
-
* 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.
|
|
13275
13435
|
*/
|
|
13276
13436
|
renderDropIndicator?: (
|
|
13277
13437
|
options: {
|
|
@@ -13613,8 +13773,10 @@ export const ListBoxWithSectionsExample: React.FC<
|
|
|
13613
13773
|
};
|
|
13614
13774
|
|
|
13615
13775
|
export const DragAndDropListBoxExample: React.FC<
|
|
13616
|
-
Omit<React.ComponentProps<typeof ListBox>, "items" | "onReorder">
|
|
13617
|
-
|
|
13776
|
+
Omit<React.ComponentProps<typeof ListBox>, "items" | "onReorder"> & {
|
|
13777
|
+
customDropIndicator?: boolean;
|
|
13778
|
+
}
|
|
13779
|
+
> = ({ orientation, layout, customDropIndicator, ...rest }) => {
|
|
13618
13780
|
const list = useListData({
|
|
13619
13781
|
initialItems: Array.from({ length: 20 }).map((_, i) => ({
|
|
13620
13782
|
id: \`item-\${i}\`,
|
|
@@ -13695,6 +13857,15 @@ export const DragAndDropListBoxExample: React.FC<
|
|
|
13695
13857
|
</li>
|
|
13696
13858
|
);
|
|
13697
13859
|
}}
|
|
13860
|
+
{...(customDropIndicator && {
|
|
13861
|
+
renderDropIndicator: (options, ref) => (
|
|
13862
|
+
<li
|
|
13863
|
+
ref={ref}
|
|
13864
|
+
{...options.dropIndicatorProps}
|
|
13865
|
+
data-testid="custom-drop-indicator"
|
|
13866
|
+
/>
|
|
13867
|
+
),
|
|
13868
|
+
})}
|
|
13698
13869
|
enableReorder={true}
|
|
13699
13870
|
items={list.items}
|
|
13700
13871
|
onReorder={onReorder}
|
|
@@ -14250,25 +14421,9 @@ Each menu item exposes the standard React Aria interaction-state attributes, and
|
|
|
14250
14421
|
| \`A\`\u2013\`Z\` | Typeahead \u2014 focuses the next item starting with the typed letters. |
|
|
14251
14422
|
| \`ArrowRight\` | Opens the focused submenu (\`ArrowLeft\` in RTL). |
|
|
14252
14423
|
| \`ArrowLeft\` | Closes the current submenu and returns focus to its trigger (\`ArrowRight\` in RTL). |
|
|
14253
|
-
| \`Escape\` | Closes the menu (or the current submenu level).
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
*/
|
|
14257
|
-
isOpen?: boolean
|
|
14258
|
-
/**
|
|
14259
|
-
* Whether the overlay is open by default (uncontrolled).
|
|
14260
|
-
*/
|
|
14261
|
-
defaultOpen?: boolean
|
|
14262
|
-
/**
|
|
14263
|
-
* Handler that is called when the overlay's open state changes.
|
|
14264
|
-
*/
|
|
14265
|
-
onOpenChange?: (isOpen: boolean) => void
|
|
14266
|
-
/**
|
|
14267
|
-
* How the menu is triggered.
|
|
14268
|
-
*
|
|
14269
|
-
* @default 'press'
|
|
14270
|
-
*/
|
|
14271
|
-
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 {
|
|
14272
14427
|
/**
|
|
14273
14428
|
* The custom render function for the collection's options.
|
|
14274
14429
|
*
|
|
@@ -14302,6 +14457,13 @@ optionStyle?: | React.CSSProperties
|
|
|
14302
14457
|
item: TOption,
|
|
14303
14458
|
renderProps: TRenderProps,
|
|
14304
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"
|
|
14305
14467
|
/**
|
|
14306
14468
|
* The \`className\` property assigned to the root element of the component.
|
|
14307
14469
|
*/
|
|
@@ -19230,7 +19392,22 @@ errorMessage?: string
|
|
|
19230
19392
|
label="Label"
|
|
19231
19393
|
value={50}
|
|
19232
19394
|
formatOptions={{ style: "currency", currency: "USD" }}
|
|
19233
|
-
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 {
|
|
19234
19411
|
/**
|
|
19235
19412
|
* @deprecated Do not use in new components. This is a legacy block
|
|
19236
19413
|
* identifier; new components should exclude it via
|
|
@@ -19551,6 +19728,7 @@ import React from "react";
|
|
|
19551
19728
|
|
|
19552
19729
|
import { ColorSwatch } from "../../ColorSwatch";
|
|
19553
19730
|
import { RadioGroup, type RadioGroupProps } from "../../RadioGroup";
|
|
19731
|
+
import { items } from "./data";
|
|
19554
19732
|
|
|
19555
19733
|
import type { ListOption } from "../../ListBox";
|
|
19556
19734
|
|
|
@@ -19581,7 +19759,16 @@ export const CustomRenderItem: React.FC<Omit<RadioGroupProps, "items">> = (
|
|
|
19581
19759
|
return (
|
|
19582
19760
|
<RadioGroup items={colorItems} renderOption={colorRenderItem} {...props} />
|
|
19583
19761
|
);
|
|
19584
|
-
}
|
|
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.
|
|
19585
19772
|
|
|
19586
19773
|
* It is exposed as a input checkbox via ARIA
|
|
19587
19774
|
* It has mouse, keyboard, and touch support
|
|
@@ -19831,7 +20018,7 @@ style?: React.CSSProperties
|
|
|
19831
20018
|
/**
|
|
19832
20019
|
* The ref to the scrollable element.
|
|
19833
20020
|
*
|
|
19834
|
-
* @default document
|
|
20021
|
+
* @default the page scroller (the document, or the body when it scrolls)
|
|
19835
20022
|
*/
|
|
19836
20023
|
scrollRef?: React.RefObject<HTMLElement | null>
|
|
19837
20024
|
/**
|
|
@@ -21925,7 +22112,7 @@ export const CustomTrailingElementTestComponent: React.FC = () => {
|
|
|
21925
22112
|
)}
|
|
21926
22113
|
/>
|
|
21927
22114
|
);
|
|
21928
|
-
};`},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 {
|
|
21929
22116
|
/**
|
|
21930
22117
|
* @deprecated Do not use in new components. This is a legacy block
|
|
21931
22118
|
* identifier; new components should exclude it via
|
|
@@ -22023,7 +22210,7 @@ aria-label?: string
|
|
|
22023
22210
|
*/
|
|
22024
22211
|
stepLabel?: string | ((values: { index: number }) => string)
|
|
22025
22212
|
/**
|
|
22026
|
-
* Overrides the screen-reader-only
|
|
22213
|
+
* Overrides the screen-reader-only prefix marking a step the reader has
|
|
22027
22214
|
* finished.
|
|
22028
22215
|
*
|
|
22029
22216
|
* Message id: \`bui.stepper.completed\`. Defaults to \`"Completed"\`.
|
|
@@ -23059,68 +23246,7 @@ Use the \`renderEmptyState\` prop on \`TableBody\` to display a message when the
|
|
|
23059
23246
|
* **Virtualizer** \u2014 for performance with large datasets
|
|
23060
23247
|
* **Toolbar** \u2014 for contextual actions on selected rows
|
|
23061
23248
|
* **Tag** \u2014 for displaying status badges in cells
|
|
23062
|
-
* **Menu** \u2014 for row-level action menus`,props:`
|
|
23063
|
-
/**
|
|
23064
|
-
* Overrides the default DOM element with a custom render function.
|
|
23065
|
-
* This allows rendering existing components with built-in styles and behaviors
|
|
23066
|
-
* such as router links, animation libraries, and pre-styled components.
|
|
23067
|
-
*
|
|
23068
|
-
* Requirements:
|
|
23069
|
-
*
|
|
23070
|
-
* - You must render the expected element type (e.g. if \`<button>\` is expected, you cannot render an
|
|
23071
|
-
* \`<a>\`).
|
|
23072
|
-
* - Only a single root DOM element can be rendered (no fragments).
|
|
23073
|
-
* - You must pass through props and ref to the underlying DOM element, merging with your own prop
|
|
23074
|
-
* as appropriate.
|
|
23075
|
-
*/
|
|
23076
|
-
render?: (
|
|
23077
|
-
props: React.JSX.IntrinsicElements[E],
|
|
23078
|
-
renderProps: T
|
|
23079
|
-
) => ReactElement
|
|
23080
|
-
/**
|
|
23081
|
-
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the
|
|
23082
|
-
* element. A function may be provided to compute the class based on component state.
|
|
23083
|
-
*/
|
|
23084
|
-
className?: | string
|
|
23085
|
-
| ((values: T & {defaultClassName: string | undefined}) => string)
|
|
23086
|
-
/**
|
|
23087
|
-
* The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the
|
|
23088
|
-
* element. A function may be provided to compute the style based on component state.
|
|
23089
|
-
*/
|
|
23090
|
-
style?: | CSSProperties
|
|
23091
|
-
| ((values: T & {defaultStyle: CSSProperties}) => CSSProperties | undefined)
|
|
23092
|
-
/**
|
|
23093
|
-
* A slot name for the component. Slots allow the component to receive props from a parent
|
|
23094
|
-
* component. An explicit \`null\` value indicates that the local props completely override all
|
|
23095
|
-
* props received from a parent.
|
|
23096
|
-
*/
|
|
23097
|
-
slot?: string | null
|
|
23098
|
-
/**
|
|
23099
|
-
* The elements that make up the table. Includes the TableHeader, TableBody, Columns, and Rows.
|
|
23100
|
-
*/
|
|
23101
|
-
children?: ReactNode
|
|
23102
|
-
/**
|
|
23103
|
-
* How multiple selection should behave in the collection.
|
|
23104
|
-
*
|
|
23105
|
-
* @default 'toggle'
|
|
23106
|
-
*/
|
|
23107
|
-
selectionBehavior?: SelectionBehavior
|
|
23108
|
-
/**
|
|
23109
|
-
* Whether \`disabledKeys\` applies to all interactions, or only selection.
|
|
23110
|
-
*
|
|
23111
|
-
* @default 'all'
|
|
23112
|
-
*/
|
|
23113
|
-
disabledBehavior?: DisabledBehavior
|
|
23114
|
-
/**
|
|
23115
|
-
* Handler that is called when a user performs an action on the row.
|
|
23116
|
-
*/
|
|
23117
|
-
onRowAction?: (key: Key) => void
|
|
23118
|
-
/**
|
|
23119
|
-
* The drag and drop hooks returned by \`useDragAndDrop\` used to enable drag and drop behavior for
|
|
23120
|
-
* the Table.
|
|
23121
|
-
*/
|
|
23122
|
-
dragAndDropHooks?: DragHooks<T> & DropHooks
|
|
23123
|
-
}`,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 = () => (
|
|
23124
23250
|
<OnRowActionTableExample
|
|
23125
23251
|
onRowAction={(key) => {
|
|
23126
23252
|
alert(\`Row action: \${key}\`);
|
|
@@ -23916,12 +24042,14 @@ export const DisabledRowsTableExample: React.FC<
|
|
|
23916
24042
|
|
|
23917
24043
|
interface DragAndDropTableExampleProps {
|
|
23918
24044
|
onReorder?: (event: DroppableCollectionReorderEvent) => void;
|
|
24045
|
+
/** Virtualizes the table without a fixed height, so the page scrolls it. */
|
|
24046
|
+
isVirtualized?: boolean;
|
|
23919
24047
|
}
|
|
23920
24048
|
|
|
23921
24049
|
/** Drag-and-drop row reordering using useTableDragAndDrop hook. */
|
|
23922
24050
|
export const DragAndDropTableExample: React.FC<
|
|
23923
24051
|
DragAndDropTableExampleProps
|
|
23924
|
-
> = ({ onReorder }) => {
|
|
24052
|
+
> = ({ onReorder, isVirtualized }) => {
|
|
23925
24053
|
const list = useListData({ initialItems: rows });
|
|
23926
24054
|
|
|
23927
24055
|
const handleReorder = useCallback(
|
|
@@ -23940,7 +24068,7 @@ export const DragAndDropTableExample: React.FC<
|
|
|
23940
24068
|
onReorder: handleReorder,
|
|
23941
24069
|
});
|
|
23942
24070
|
|
|
23943
|
-
|
|
24071
|
+
const table = (
|
|
23944
24072
|
<Table dragAndDropHooks={dragAndDropHooks} aria-label="Files">
|
|
23945
24073
|
<TableHeader>
|
|
23946
24074
|
<Column id="drag">
|
|
@@ -23984,6 +24112,17 @@ export const DragAndDropTableExample: React.FC<
|
|
|
23984
24112
|
</TableBody>
|
|
23985
24113
|
</Table>
|
|
23986
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
|
+
);
|
|
23987
24126
|
};
|
|
23988
24127
|
|
|
23989
24128
|
/** Table with zero rows and an empty state message. */
|
|
@@ -24121,14 +24260,21 @@ export const OnRowActionTableExample: React.FC<
|
|
|
24121
24260
|
);
|
|
24122
24261
|
|
|
24123
24262
|
/** Virtualized table using actual Virtualizer component with 1000 rows. */
|
|
24124
|
-
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" }) => {
|
|
24125
24267
|
const largeDataset = generateLargeDataset(1000);
|
|
24126
24268
|
|
|
24127
|
-
|
|
24269
|
+
const virtualizer = (
|
|
24128
24270
|
<Virtualizer {...VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS.TABLE}>
|
|
24129
24271
|
<Table
|
|
24130
24272
|
aria-label="Files"
|
|
24131
|
-
style={
|
|
24273
|
+
style={
|
|
24274
|
+
boundedBy === "table"
|
|
24275
|
+
? { height: 400, width: 700, overflow: "auto" }
|
|
24276
|
+
: { width: 700, overflow: "auto" }
|
|
24277
|
+
}
|
|
24132
24278
|
>
|
|
24133
24279
|
<TableHeader>
|
|
24134
24280
|
<Column id="name" isRowHeader={true}>
|
|
@@ -24170,6 +24316,17 @@ export const VirtualizedTableExample: React.FC = () => {
|
|
|
24170
24316
|
</Table>
|
|
24171
24317
|
</Virtualizer>
|
|
24172
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
|
+
);
|
|
24173
24330
|
};
|
|
24174
24331
|
|
|
24175
24332
|
interface AsyncLoadingTableExampleProps {
|
|
@@ -25226,7 +25383,11 @@ export const RemovableTagGroup: React.FC<
|
|
|
25226
25383
|
}}
|
|
25227
25384
|
/>
|
|
25228
25385
|
);
|
|
25229
|
-
}
|
|
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.
|
|
25230
25391
|
|
|
25231
25392
|
* Supports both string and number tags.
|
|
25232
25393
|
* Keyboard handling of next and previous buttons.
|
|
@@ -26747,7 +26908,7 @@ warningMessage?: string
|
|
|
26747
26908
|
onChange={fn()}
|
|
26748
26909
|
label="Label"
|
|
26749
26910
|
errorMessage="Error message"
|
|
26750
|
-
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
|
|
26751
26912
|
onChange={fn()}
|
|
26752
26913
|
label="Label"
|
|
26753
26914
|
warningMessage="Warning message"
|
|
@@ -26899,7 +27060,15 @@ import { GlobalToastRegion } from "../Toast";
|
|
|
26899
27060
|
|
|
26900
27061
|
import type { ToastContent } from "../Toast.types";
|
|
26901
27062
|
|
|
26902
|
-
export const ToastExample = ({
|
|
27063
|
+
export const ToastExample = ({
|
|
27064
|
+
onAction,
|
|
27065
|
+
closeLabel,
|
|
27066
|
+
canClose,
|
|
27067
|
+
}: {
|
|
27068
|
+
onAction?: () => void;
|
|
27069
|
+
closeLabel?: string;
|
|
27070
|
+
canClose?: boolean;
|
|
27071
|
+
}) => {
|
|
26903
27072
|
const [variant, setVariant] = useState<ToastContent["variant"]>("info");
|
|
26904
27073
|
const [shouldIncludeAction, setShouldIncludeAction] = useState(false);
|
|
26905
27074
|
const [arrangement, setArrangement] =
|
|
@@ -26991,6 +27160,8 @@ export const ToastExample = ({ onAction }: { onAction?: () => void }) => {
|
|
|
26991
27160
|
: undefined,
|
|
26992
27161
|
actionLabel: shouldIncludeAction ? "Action" : undefined,
|
|
26993
27162
|
arrangement,
|
|
27163
|
+
closeLabel,
|
|
27164
|
+
canClose,
|
|
26994
27165
|
},
|
|
26995
27166
|
{
|
|
26996
27167
|
timeout: timeoutValue,
|
|
@@ -27600,6 +27771,13 @@ export const StateSpecificIcon: React.FC<
|
|
|
27600
27771
|
unselected: XIcon,
|
|
27601
27772
|
}}
|
|
27602
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
|
+
</>
|
|
27603
27781
|
);`},similarTo:[],figmaUrl:null},Toolbar:{id:"core-miscellaneous-toolbar",breadcrumb:"Core/Miscellaneous/Toolbar",importStatement:`import {
|
|
27604
27782
|
ChildrenWithTooltip,
|
|
27605
27783
|
CollapsibleChildren,
|
|
@@ -27857,6 +28035,7 @@ export const CollapsibleChildren: React.FC<{
|
|
|
27857
28035
|
size="lg"
|
|
27858
28036
|
variant="toolbar"
|
|
27859
28037
|
tooltip={true}
|
|
28038
|
+
data-testid="toolbar-overflow-button"
|
|
27860
28039
|
/>
|
|
27861
28040
|
),
|
|
27862
28041
|
}
|
|
@@ -28141,14 +28320,14 @@ onOpenChange?: (isOpen: boolean) => void
|
|
|
28141
28320
|
isDisabled?: boolean
|
|
28142
28321
|
/**
|
|
28143
28322
|
* The delay time for the tooltip to show up. [See
|
|
28144
|
-
* guidelines](https://spectrum.adobe.com/
|
|
28323
|
+
* guidelines](https://spectrum.adobe.com/web/rsp/components/tooltip#behaviors).
|
|
28145
28324
|
*
|
|
28146
28325
|
* @default 1500
|
|
28147
28326
|
*/
|
|
28148
28327
|
delay?: number
|
|
28149
28328
|
/**
|
|
28150
28329
|
* The delay time for the tooltip to close. [See
|
|
28151
|
-
* guidelines](https://spectrum.adobe.com/
|
|
28330
|
+
* guidelines](https://spectrum.adobe.com/web/rsp/components/tooltip#behaviors).
|
|
28152
28331
|
*
|
|
28153
28332
|
* @default 500
|
|
28154
28333
|
*/
|
|
@@ -28319,160 +28498,19 @@ export const TooltipGetTargetRectExample = () => {
|
|
|
28319
28498
|
</>
|
|
28320
28499
|
);
|
|
28321
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,
|
|
28322
28507
|
TreeView,
|
|
28323
28508
|
VirtualizedTreeViewExample,
|
|
28324
28509
|
VirtualizedTreeViewWithActionsExample,
|
|
28325
28510
|
VirtualizedTreeViewWithDescriptionsExample,
|
|
28326
28511
|
VirtualizedTreeViewWithExpandControlExample,
|
|
28327
28512
|
VirtualizedTreeViewWithRenameExample,
|
|
28328
|
-
} 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.
|
|
28329
|
-
|
|
28330
|
-
* Support for mouse, touch, and keyboard interaction
|
|
28331
|
-
* Accessible via React Aria with full keyboard navigation
|
|
28332
|
-
* Support for primary and secondary action buttons on items
|
|
28333
|
-
* Support for inline renaming of item labels (double-click or F2)
|
|
28334
|
-
* Icons and descriptions on individual items
|
|
28335
|
-
* Controlled and uncontrolled expansion state
|
|
28336
|
-
* Custom item title rendering via \`renderItemTitle\`
|
|
28337
|
-
* Virtualization support for large datasets (10,000+ items)
|
|
28338
|
-
|
|
28339
|
-
\`\`\`tsx
|
|
28340
|
-
import { TreeView } from "@baseline-ui/core";
|
|
28341
|
-
const treeItems = {
|
|
28342
|
-
id: "root",
|
|
28343
|
-
label: "Root item",
|
|
28344
|
-
children: [
|
|
28345
|
-
{
|
|
28346
|
-
id: "documents",
|
|
28347
|
-
label: "Documents",
|
|
28348
|
-
children: [
|
|
28349
|
-
{
|
|
28350
|
-
id: "work",
|
|
28351
|
-
label: "Work",
|
|
28352
|
-
},
|
|
28353
|
-
],
|
|
28354
|
-
},
|
|
28355
|
-
],
|
|
28356
|
-
};
|
|
28357
|
-
|
|
28358
|
-
<TreeView items={treeItems} aria-label="File browser" />;
|
|
28359
|
-
\`\`\`
|
|
28360
|
-
|
|
28361
|
-
> **Note:** The top-level \`items\` object acts as a virtual root and is not rendered. Only its \`children\` appear in the tree.
|
|
28362
|
-
|
|
28363
|
-
Each item can have an \`icon\` property that renders an icon next to the label.
|
|
28364
|
-
|
|
28365
|
-
Items can include a \`description\` string, rendered below the label.
|
|
28366
|
-
|
|
28367
|
-
A tree with no nested children \u2014 all chevrons are hidden.
|
|
28368
|
-
|
|
28369
|
-
Trees with deep nesting (4+ levels) indent items based on depth.
|
|
28370
|
-
|
|
28371
|
-
Demonstrates how the component handles lengthy item labels and descriptions.
|
|
28372
|
-
|
|
28373
|
-
Control the expansion state with \`expandedKeys\` and \`onExpandedChange\`.
|
|
28374
|
-
|
|
28375
|
-
Use \`defaultExpandedKeys\` for the initial expansion state. You can still expand and collapse items via interaction.
|
|
28376
|
-
|
|
28377
|
-
Use \`selectedKeys\` to highlight specific items. The tree uses multi-selection mode.
|
|
28378
|
-
|
|
28379
|
-
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.
|
|
28380
|
-
|
|
28381
|
-
Pass a function to \`primaryActionIcon\` or \`secondaryActionIcon\` to render different icons per item: \`(key: Key) => IconComponent\`.
|
|
28382
|
-
|
|
28383
|
-
Similarly, \`primaryActionAriaLabel\` and \`secondaryActionAriaLabel\` accept \`string | ((key: Key) => string)\` for per-item labels.
|
|
28384
|
-
|
|
28385
|
-
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.
|
|
28386
|
-
|
|
28387
|
-
Use \`renderItemTitle\` to customize how item titles are rendered. The function receives the full \`TreeListItem\` and returns a \`ReactNode\`.
|
|
28388
|
-
|
|
28389
|
-
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).
|
|
28390
|
-
|
|
28391
|
-
| Selector | Description |
|
|
28392
|
-
| -------------------------------------- | ---------------------------------- |
|
|
28393
|
-
| \`.BaselineUI-TreeView\` | The root tree container |
|
|
28394
|
-
| \`.BaselineUI-TreeView-Row\` | An individual tree row |
|
|
28395
|
-
| \`.BaselineUI-TreeView-ExpansionToggle\` | The expand/collapse chevron button |
|
|
28396
|
-
| \`.BaselineUI-TreeView-Title\` | The item label text |
|
|
28397
|
-
| \`.BaselineUI-TreeView-Description\` | The item description text |
|
|
28398
|
-
| \`.BaselineUI-TreeView-RenameInput\` | The inline rename text input |
|
|
28399
|
-
|
|
28400
|
-
| Key | Action |
|
|
28401
|
-
| ---------------------- | ----------------------------------------------------------------------------- |
|
|
28402
|
-
| <kbd>Arrow Down</kbd> | Focus the next item |
|
|
28403
|
-
| <kbd>Arrow Up</kbd> | Focus the previous item |
|
|
28404
|
-
| <kbd>Arrow Right</kbd> | Expand the focused item, or move focus to the first child if already expanded |
|
|
28405
|
-
| <kbd>Arrow Left</kbd> | Collapse the focused item, or move focus to the parent if already collapsed |
|
|
28406
|
-
| <kbd>Enter</kbd> | Activate the focused item |
|
|
28407
|
-
| <kbd>Space</kbd> | Toggle selection of the focused item |
|
|
28408
|
-
| <kbd>Home</kbd> | Focus the first item |
|
|
28409
|
-
| <kbd>End</kbd> | Focus the last item |
|
|
28410
|
-
| <kbd>F2</kbd> | Start renaming the focused item (requires \`onRename\` prop) |
|
|
28411
|
-
| <kbd>Escape</kbd> | Cancel renaming |
|
|
28412
|
-
|
|
28413
|
-
* **ListBox** \u2014 for flat, non-hierarchical lists
|
|
28414
|
-
* **Menu** \u2014 for action menus and dropdowns
|
|
28415
|
-
|
|
28416
|
-
For large trees with thousands of items, use virtualization to improve performance and reduce memory usage.
|
|
28417
|
-
|
|
28418
|
-
Consider virtualization when:
|
|
28419
|
-
|
|
28420
|
-
* Trees have 500+ total items (including nested children)
|
|
28421
|
-
* Trees are deeply nested (5+ levels) with many items per level
|
|
28422
|
-
* You need responsive scrolling on mobile devices
|
|
28423
|
-
* Memory usage is a concern
|
|
28424
|
-
|
|
28425
|
-
Wrap TreeView with the Virtualizer component:
|
|
28426
|
-
|
|
28427
|
-
\`\`\`tsx
|
|
28428
|
-
import {
|
|
28429
|
-
TreeView,
|
|
28430
|
-
Virtualizer,
|
|
28431
|
-
VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS,
|
|
28432
|
-
} from "@baseline-ui/core";
|
|
28433
|
-
|
|
28434
|
-
<Virtualizer {...VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS.TREE_VIEW}>
|
|
28435
|
-
<TreeView
|
|
28436
|
-
items={largeTree}
|
|
28437
|
-
aria-label="Large file system"
|
|
28438
|
-
style={{ height: 600, overflow: "auto" }}
|
|
28439
|
-
/>
|
|
28440
|
-
</Virtualizer>;
|
|
28441
|
-
\`\`\`
|
|
28442
|
-
|
|
28443
|
-
**Important:** You must specify an explicit height on the TreeView container.
|
|
28444
|
-
|
|
28445
|
-
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:
|
|
28446
|
-
|
|
28447
|
-
\`\`\`tsx
|
|
28448
|
-
import { ListLayout, TreeView, Virtualizer } from "@baseline-ui/core";
|
|
28449
|
-
|
|
28450
|
-
// Items without descriptions (default)
|
|
28451
|
-
<Virtualizer layout={ListLayout} layoutOptions={{ rowHeight: 44 }}>
|
|
28452
|
-
<TreeView items={tree} style={{ height: 600, overflow: "auto" }} />
|
|
28453
|
-
</Virtualizer>
|
|
28454
|
-
|
|
28455
|
-
// Items with descriptions (variable heights)
|
|
28456
|
-
<Virtualizer layout={ListLayout} layoutOptions={{ estimatedRowHeight: 60 }}>
|
|
28457
|
-
<TreeView
|
|
28458
|
-
items={treeWithDescriptions}
|
|
28459
|
-
style={{ height: 600, overflow: "auto" }}
|
|
28460
|
-
/>
|
|
28461
|
-
</Virtualizer>
|
|
28462
|
-
\`\`\`
|
|
28463
|
-
|
|
28464
|
-
With virtualization:
|
|
28465
|
-
|
|
28466
|
-
* Only ~20-30 visible items rendered at once (regardless of total tree size)
|
|
28467
|
-
* Smooth scrolling up to 100,000+ items
|
|
28468
|
-
* Constant memory usage
|
|
28469
|
-
* Expand/collapse remains responsive
|
|
28470
|
-
|
|
28471
|
-
Without virtualization:
|
|
28472
|
-
|
|
28473
|
-
* All expanded items render to DOM
|
|
28474
|
-
* Performance degrades beyond ~500 items
|
|
28475
|
-
* 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 {
|
|
28476
28514
|
/**
|
|
28477
28515
|
* @deprecated Do not use in new components. This is a legacy block
|
|
28478
28516
|
* identifier; new components should exclude it via
|
|
@@ -28620,6 +28658,43 @@ onAction?: (key: Key) => void
|
|
|
28620
28658
|
* @default item => item.label
|
|
28621
28659
|
*/
|
|
28622
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
|
|
28623
28698
|
}`,stories:{usage:[{id:"core-collections-treeview--basic",name:"Basic",snippet:`const Basic = () => <TreeView
|
|
28624
28699
|
onAction={fn()}
|
|
28625
28700
|
items={getTreeItems({ includeIcons: false, includeDescription: false })} />;`},{id:"core-collections-treeview--with-description",name:"With Description",snippet:`const WithDescription = () => <TreeView
|
|
@@ -28690,7 +28765,12 @@ renderItemTitle?: (item: TreeListItem) => ReactNode
|
|
|
28690
28765
|
>
|
|
28691
28766
|
<i style={{ color: "black" }}>{item.label}</i>
|
|
28692
28767
|
</span>
|
|
28693
|
-
)} />;`},{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
|
|
28694
28774
|
onAction={fn()}
|
|
28695
28775
|
items={getTreeItems({ includeIcons: true, includeDescription: false })}
|
|
28696
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
|
|
@@ -28771,11 +28851,21 @@ renderItemTitle?: (item: TreeListItem) => ReactNode
|
|
|
28771
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
|
|
28772
28852
|
onAction={fn()}
|
|
28773
28853
|
aria-label="Virtualized tree with rename support"
|
|
28774
|
-
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";
|
|
28775
28860
|
import React, { useMemo, useState } from "react";
|
|
28861
|
+
import { useTreeData } from "react-stately/useTreeData";
|
|
28776
28862
|
|
|
28777
28863
|
import { ActionButton } from "../../ActionButton";
|
|
28864
|
+
import { ActionIconButton } from "../../ActionIconButton";
|
|
28778
28865
|
import { Box } from "../../Box";
|
|
28866
|
+
import { Checkbox } from "../../Checkbox";
|
|
28867
|
+
import { TextInput } from "../../TextInput";
|
|
28868
|
+
import { useDragAndDrop } from "../../UNSAFE_ListBox/hooks/useDragAndDrop";
|
|
28779
28869
|
import {
|
|
28780
28870
|
ListLayout,
|
|
28781
28871
|
VIRTUALIZER_LAYOUT_DEFAULT_OPTIONS,
|
|
@@ -28784,8 +28874,12 @@ import {
|
|
|
28784
28874
|
import { TreeView } from "../TreeView";
|
|
28785
28875
|
import { generateLargeTree, getTreeItems } from "./data";
|
|
28786
28876
|
|
|
28787
|
-
import type {
|
|
28788
|
-
|
|
28877
|
+
import type {
|
|
28878
|
+
TreeItemRenderState,
|
|
28879
|
+
TreeListItem,
|
|
28880
|
+
TreeViewProps,
|
|
28881
|
+
} from "../TreeView.types";
|
|
28882
|
+
import type { DropPosition, Key } from "@react-types/shared";
|
|
28789
28883
|
|
|
28790
28884
|
export function TreeViewWithPrimaryAction({
|
|
28791
28885
|
onPrimaryAction,
|
|
@@ -28859,6 +28953,125 @@ export function TreeViewWithCustomTitle(): React.JSX.Element {
|
|
|
28859
28953
|
);
|
|
28860
28954
|
}
|
|
28861
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
|
+
|
|
28862
29075
|
// Example 1: Basic virtualization
|
|
28863
29076
|
export const VirtualizedTreeViewExample: React.FC<
|
|
28864
29077
|
Omit<React.ComponentProps<typeof TreeView>, "items"> & {
|
|
@@ -29017,7 +29230,177 @@ export const VirtualizedTreeViewWithRenameExample: React.FC<
|
|
|
29017
29230
|
/>
|
|
29018
29231
|
</Virtualizer>
|
|
29019
29232
|
);
|
|
29020
|
-
}
|
|
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 {
|
|
29021
29404
|
DragAndDropListBoxExample,
|
|
29022
29405
|
DynamicListBoxExample,
|
|
29023
29406
|
UNSAFE_ListBox as ListBox,
|
|
@@ -29953,7 +30336,9 @@ export const VirtualListBoxGridLayoutWithOutsideClickTargetExample: React.FC<
|
|
|
29953
30336
|
);
|
|
29954
30337
|
};
|
|
29955
30338
|
|
|
29956
|
-
export const ScrollIntoViewExample: React.FC = (
|
|
30339
|
+
export const ScrollIntoViewExample: React.FC<{ idPrefix?: string }> = ({
|
|
30340
|
+
idPrefix = "item-",
|
|
30341
|
+
}) => {
|
|
29957
30342
|
const listBoxHandle = React.useRef<ListHandle>(null);
|
|
29958
30343
|
|
|
29959
30344
|
return (
|
|
@@ -29961,11 +30346,11 @@ export const ScrollIntoViewExample: React.FC = () => {
|
|
|
29961
30346
|
<Box display="flex" gap="sm">
|
|
29962
30347
|
<ActionButton
|
|
29963
30348
|
label="Scroll to Item 0"
|
|
29964
|
-
onPress={() => listBoxHandle.current?.scrollIntoView(
|
|
30349
|
+
onPress={() => listBoxHandle.current?.scrollIntoView(\`\${idPrefix}0\`)}
|
|
29965
30350
|
/>
|
|
29966
30351
|
<ActionButton
|
|
29967
30352
|
label="Scroll to Item 15"
|
|
29968
|
-
onPress={() => listBoxHandle.current?.scrollIntoView(
|
|
30353
|
+
onPress={() => listBoxHandle.current?.scrollIntoView(\`\${idPrefix}15\`)}
|
|
29969
30354
|
/>
|
|
29970
30355
|
</Box>
|
|
29971
30356
|
|
|
@@ -29978,7 +30363,7 @@ export const ScrollIntoViewExample: React.FC = () => {
|
|
|
29978
30363
|
>
|
|
29979
30364
|
<ListBox
|
|
29980
30365
|
items={Array.from({ length: 20 }).map((_, i) => ({
|
|
29981
|
-
id:
|
|
30366
|
+
id: \`\${idPrefix}\${i}\`,
|
|
29982
30367
|
label: \`Item \${i}\`,
|
|
29983
30368
|
}))}
|
|
29984
30369
|
listBoxHandle={listBoxHandle}
|
|
@@ -30427,6 +30812,10 @@ layout: LayoutClass<O> | ILayout<O>
|
|
|
30427
30812
|
* Options for the layout.
|
|
30428
30813
|
*/
|
|
30429
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
|
|
30430
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
|
|
30431
30820
|
10 | export default meta;
|
|
30432
30821
|
11 |
|
|
@@ -30452,7 +30841,13 @@ layoutOptions?: O
|
|
|
30452
30841
|
14 | export { WithVirtualization as TreeViewPresetExample } from "../TreeView/TreeView.stories";
|
|
30453
30842
|
> 15 | export { RTLWithVirtualization as RTLImageGalleryPresetExample } from "../ImageGallery/ImageGallery.stories";
|
|
30454
30843
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
30455
|
-
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 {
|
|
30456
30851
|
/**
|
|
30457
30852
|
* @deprecated Do not use in new components. This is a legacy block
|
|
30458
30853
|
* identifier; new components should exclude it via
|
|
@@ -30532,6 +30927,18 @@ value: Key
|
|
|
30532
30927
|
* the accordion header.
|
|
30533
30928
|
*/
|
|
30534
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
|
|
30535
30942
|
/**
|
|
30536
30943
|
* @internal
|
|
30537
30944
|
*/
|
|
@@ -30552,13 +30959,15 @@ index?: number
|
|
|
30552
30959
|
title="Accordion Item"
|
|
30553
30960
|
value="item"
|
|
30554
30961
|
showActionsOnTriggerOnly>{undefined}</AccordionItemExample>
|
|
30555
|
-
</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";
|
|
30556
30963
|
import { themeVars } from "@baseline-ui/tokens";
|
|
30557
30964
|
import React from "react";
|
|
30558
30965
|
|
|
30559
30966
|
import { Accordion } from "../Accordion";
|
|
30560
30967
|
import { AccordionItem } from "../AccordionItem";
|
|
30561
30968
|
|
|
30969
|
+
import type { Key } from "react";
|
|
30970
|
+
|
|
30562
30971
|
const contentStyle = {
|
|
30563
30972
|
padding: 10,
|
|
30564
30973
|
color: themeVars.color.text.primary,
|
|
@@ -30640,6 +31049,74 @@ export const AccordionWithDisabledItemsExample: React.FC<
|
|
|
30640
31049
|
Omit<React.ComponentProps<typeof AccordionExample>, "disabledKeys">
|
|
30641
31050
|
> = (props) => {
|
|
30642
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
|
+
);
|
|
30643
31120
|
};`},similarTo:[],figmaUrl:null},IconColorInput:{id:"core-forms-colorinput-iconcolorinput",importStatement:'import { Box, IconColorInput } from "@baseline-ui/core";',description:"",documentation:null,props:`interface IconColorInputProps {
|
|
30644
31121
|
/**
|
|
30645
31122
|
* @deprecated Do not use in new components. This is a legacy block
|
|
@@ -37696,7 +38173,7 @@ padding={[null, "lg", "xl"]}
|
|
|
37696
38173
|
|
|
37697
38174
|
* [vanilla-extract sprinkles documentation](https://vanilla-extract.style/documentation/packages/sprinkles/) - Learn about the underlying sprinkles framework
|
|
37698
38175
|
* [Box component documentation](/docs/core-utilities-box--docs) - Detailed information about the Box component
|
|
37699
|
-
* [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.3.0"};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=`
|
|
37700
38177
|
# Baseline UI MCP Server Guidelines
|
|
37701
38178
|
|
|
37702
38179
|
This MCP server provides AI assistants with structured access to Baseline UI's comprehensive component documentation, icon library, theming resources, and design guidelines.
|
|
@@ -37739,7 +38216,7 @@ When recommending styling or customization approaches:
|
|
|
37739
38216
|
4. **Theming Support**: Design systems with themes enabled; use the theming guides for color scheme customization
|
|
37740
38217
|
5. **Browser Compatibility**: Ensure components are used in browser environments with required APIs
|
|
37741
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.
|
|
37742
|
-
`,
|
|
38219
|
+
`,l=`
|
|
37743
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.
|
|
37744
38221
|
|
|
37745
38222
|
A component can be imported using:
|
|
@@ -37747,7 +38224,7 @@ A component can be imported using:
|
|
|
37747
38224
|
\`\`\`tsx
|
|
37748
38225
|
import { ComponentName } from "@baseline-ui/core";
|
|
37749
38226
|
\`\`\`
|
|
37750
|
-
`,
|
|
38227
|
+
`,c=`
|
|
37751
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.
|
|
37752
38229
|
|
|
37753
38230
|
An icon can be imported using:
|
|
@@ -37763,7 +38240,7 @@ Example:
|
|
|
37763
38240
|
\`\`\`tsx
|
|
37764
38241
|
import { IconName } from "@baseline-ui/icons/12";
|
|
37765
38242
|
\`\`\`
|
|
37766
|
-
`;var
|
|
38243
|
+
`;var g=`
|
|
37767
38244
|
Detailed documentation, props, and story IDs for any Baseline UI component. This resource provides comprehensive component specifications and usage examples.
|
|
37768
38245
|
|
|
37769
38246
|
## Response Structure
|
|
@@ -37799,11 +38276,11 @@ Components can be imported using:
|
|
|
37799
38276
|
\`\`\`tsx
|
|
37800
38277
|
import { ComponentName } from "@baseline-ui/core";
|
|
37801
38278
|
\`\`\`
|
|
37802
|
-
`,
|
|
37803
|
-
Generate a live demo URL for a Baseline UI story. Use story
|
|
37804
|
-
`,
|
|
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=`
|
|
37805
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.
|
|
37806
|
-
`,
|
|
38283
|
+
`,d=`
|
|
37807
38284
|
Best practices and guidelines for using Baseline UI components, styling, and design tokens. READ THIS BEFORE DOING ANYTHING.
|
|
37808
38285
|
|
|
37809
38286
|
## Usage
|
|
@@ -37811,9 +38288,9 @@ Best practices and guidelines for using Baseline UI components, styling, and des
|
|
|
37811
38288
|
Use this resource to:
|
|
37812
38289
|
- Understand best practices for using Baseline UI components
|
|
37813
38290
|
- Understand styling guidelines for using Baseline UI components
|
|
37814
|
-
`,
|
|
38291
|
+
`,p=`
|
|
37815
38292
|
A guide for implementing styling elements in Baseline UI components or applying styling to existing components. READ THIS BEFORE DOING ANYTHING.
|
|
37816
|
-
`,
|
|
38293
|
+
`,v=`
|
|
37817
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.
|
|
37818
38295
|
|
|
37819
38296
|
## Available Resources
|
|
@@ -37851,14 +38328,15 @@ Use this tool to:
|
|
|
37851
38328
|
- Consult **list_components** to find the right component for your needs
|
|
37852
38329
|
- Reference **theming** for custom design systems
|
|
37853
38330
|
- Check **styling** for CSS and design token guidance
|
|
37854
|
-
`;var
|
|
38331
|
+
`;var I=`# List of available components in Baseline UI design system
|
|
37855
38332
|
| Name | Description | Similar To |
|
|
37856
38333
|
| --- | --- | --- |
|
|
37857
38334
|
${Object.entries(o).toSorted(([n],[e])=>n.localeCompare(e)).map(([n,{description:e,similarTo:t}])=>`|${n}|${e}|${t?.join(", ")||""}|`).join(`
|
|
37858
38335
|
`)}
|
|
37859
|
-
`,
|
|
38336
|
+
`,P=Object.entries(m).map(([n,e])=>`## ${n}
|
|
37860
38337
|
|
|
37861
|
-
|
|
38338
|
+
${e.map(t=>"- "+t).join(`
|
|
37862
38339
|
`)}`).join(`
|
|
37863
|
-
|
|
37864
|
-
|
|
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};
|